Blame view

天文台pc/tianwentai-ui/node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs 1.14 KB
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  import { createBox } from '../../projection/geometry/models.mjs';
  import { VisualElement } from '../VisualElement.mjs';
  
  function isObjectKey(key, object) {
      return key in object;
  }
  class ObjectVisualElement extends VisualElement {
      constructor() {
          super(...arguments);
          this.type = "object";
      }
      readValueFromInstance(instance, key) {
          if (isObjectKey(key, instance)) {
              const value = instance[key];
              if (typeof value === "string" || typeof value === "number") {
                  return value;
              }
          }
          return undefined;
      }
      getBaseTargetFromProps() {
          return undefined;
      }
      removeValueFromRenderState(key, renderState) {
          delete renderState.output[key];
      }
      measureInstanceViewportBox() {
          return createBox();
      }
      build(renderState, latestValues) {
          Object.assign(renderState.output, latestValues);
      }
      renderInstance(instance, { output }) {
          Object.assign(instance, output);
      }
      sortInstanceNodePosition() {
          return 0;
      }
  }
  
  export { ObjectVisualElement };
  //# sourceMappingURL=ObjectVisualElement.mjs.map