@motionscript/core 0.1.0-alpha.6 → 0.1.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/README.md +2 -4
- package/dist/assets/errors.js +4 -5
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/scope.d.ts +1 -1
- package/dist/assets/scope.d.ts.map +1 -1
- package/dist/assets/scope.js +1 -1
- package/dist/assets/scope.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +3 -18
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/index.d.ts +3 -5
- package/dist/attributes/index.d.ts.map +1 -1
- package/dist/attributes/index.js +2 -2
- package/dist/attributes/index.js.map +1 -1
- package/dist/attributes/layout/insets.d.ts +1 -1
- package/dist/attributes/layout/insets.js.map +1 -1
- package/dist/attributes/layout/size.d.ts +1 -1
- package/dist/attributes/layout/size.js +1 -1
- package/dist/attributes/layout/size.js.map +1 -1
- package/dist/attributes/properties/decorator.d.ts +44 -11
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- package/dist/attributes/properties/decorator.js +37 -9
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/inputs.d.ts +1 -1
- package/dist/attributes/properties/inputs.js +1 -1
- package/dist/attributes/properties/inputs.js.map +1 -1
- package/dist/attributes/properties/typed.d.ts +19 -140
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +12 -108
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.d.ts +1 -1
- package/dist/attributes/shape/corners/corner-radius.js +1 -1
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts +1 -1
- package/dist/attributes/shape/fill/color/parser.js +1 -1
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -2
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.d.ts +2 -2
- package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.d.ts +1 -1
- package/dist/attributes/shape/fill/implementations/video.js +1 -1
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.d.ts +1 -1
- package/dist/attributes/shape/fill/lerp.js.map +1 -1
- package/dist/attributes/shape/filters/chain.d.ts +1 -1
- package/dist/attributes/shape/filters/chain.js +1 -1
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +4 -3
- package/dist/attributes/shape/filters/union.d.ts.map +1 -1
- package/dist/attributes/shape/filters/union.js.map +1 -1
- package/dist/attributes/shape/path/ops.d.ts +1 -2
- package/dist/attributes/shape/path/ops.d.ts.map +1 -1
- package/dist/attributes/shape/path/ops.js.map +1 -1
- package/dist/attributes/shared/operators.d.ts +2 -2
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/types.d.ts +2 -3
- package/dist/attributes/text/types.d.ts.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/chunk-D4FSTPML.js +14 -0
- package/dist/browser/chunks/chunk-D4FSTPML.js.map +7 -0
- package/dist/browser/chunks/chunk-LKUYVFU3.js +2 -0
- package/dist/browser/chunks/{chunk-DHB4COFY.js.map → chunk-LKUYVFU3.js.map} +4 -4
- package/dist/browser/chunks/chunk-RTNATFWX.js +5 -0
- package/dist/browser/chunks/chunk-RTNATFWX.js.map +7 -0
- package/dist/browser/chunks/chunk-ZRPZPWZU.js +3 -0
- package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/component.js.map +4 -4
- package/dist/browser/experimental.js +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/manifest.json +2 -4
- package/dist/browser/sdk.js +1 -1
- package/dist/component.d.ts +10 -18
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +10 -17
- package/dist/component.js.map +1 -1
- package/dist/components/builtins/audio/audio.d.ts +53 -0
- package/dist/components/builtins/audio/audio.d.ts.map +1 -0
- package/dist/components/builtins/audio/audio.js +41 -0
- package/dist/components/builtins/audio/audio.js.map +1 -0
- package/dist/components/builtins/geometry/composite.d.ts +93 -0
- package/dist/components/builtins/geometry/composite.d.ts.map +1 -0
- package/dist/components/builtins/geometry/composite.js +25 -0
- package/dist/components/builtins/geometry/composite.js.map +1 -0
- package/dist/components/builtins/geometry/geometry.d.ts +921 -0
- package/dist/components/builtins/geometry/geometry.d.ts.map +1 -0
- package/dist/components/builtins/geometry/geometry.js +107 -0
- package/dist/components/builtins/geometry/geometry.js.map +1 -0
- package/dist/components/builtins/geometry/shape-outline.d.ts +93 -0
- package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -0
- package/dist/components/builtins/geometry/shape-outline.js +470 -0
- package/dist/components/builtins/geometry/shape-outline.js.map +1 -0
- package/dist/components/builtins/layout/layout.d.ts +186 -0
- package/dist/components/builtins/layout/layout.d.ts.map +1 -0
- package/dist/components/builtins/layout/layout.js +84 -0
- package/dist/components/builtins/layout/layout.js.map +1 -0
- package/dist/components/builtins/media/media.d.ts +240 -0
- package/dist/components/builtins/media/media.d.ts.map +1 -0
- package/dist/components/builtins/media/media.js +149 -0
- package/dist/components/builtins/media/media.js.map +1 -0
- package/dist/components/builtins/providers/providers.d.ts +47 -0
- package/dist/components/builtins/providers/providers.d.ts.map +1 -0
- package/dist/components/builtins/providers/providers.js +30 -0
- package/dist/components/builtins/providers/providers.js.map +1 -0
- package/dist/components/builtins/text/number-format.d.ts +66 -0
- package/dist/components/builtins/text/number-format.d.ts.map +1 -0
- package/dist/components/builtins/text/number-format.js +227 -0
- package/dist/components/builtins/text/number-format.js.map +1 -0
- package/dist/components/builtins/text/number-pattern.d.ts +51 -0
- package/dist/components/builtins/text/number-pattern.d.ts.map +1 -0
- package/dist/components/builtins/text/number-pattern.js +77 -0
- package/dist/components/builtins/text/number-pattern.js.map +1 -0
- package/dist/components/builtins/text/text-defaults.d.ts +32 -0
- package/dist/components/builtins/text/text-defaults.d.ts.map +1 -0
- package/dist/components/builtins/text/text-defaults.js +37 -0
- package/dist/components/builtins/text/text-defaults.js.map +1 -0
- package/dist/components/builtins/text/text-layout.d.ts +82 -0
- package/dist/components/builtins/text/text-layout.d.ts.map +1 -0
- package/dist/components/builtins/text/text-layout.js +331 -0
- package/dist/components/builtins/text/text-layout.js.map +1 -0
- package/dist/components/builtins/text/text.d.ts +409 -0
- package/dist/components/builtins/text/text.d.ts.map +1 -0
- package/dist/components/builtins/text/text.js +113 -0
- package/dist/components/builtins/text/text.js.map +1 -0
- package/dist/components/builtins/three/canvas3d.d.ts +245 -0
- package/dist/components/builtins/three/canvas3d.d.ts.map +1 -0
- package/dist/components/builtins/three/canvas3d.js +21 -0
- package/dist/components/builtins/three/canvas3d.js.map +1 -0
- package/dist/components/builtins/three/grid-geometry3d.d.ts +62 -0
- package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -0
- package/dist/components/builtins/three/grid-geometry3d.js +114 -0
- package/dist/components/builtins/three/grid-geometry3d.js.map +1 -0
- package/dist/components/builtins/three/three.d.ts +1889 -0
- package/dist/components/builtins/three/three.d.ts.map +1 -0
- package/dist/components/builtins/three/three.js +305 -0
- package/dist/components/builtins/three/three.js.map +1 -0
- package/dist/components/factory/api.d.ts +516 -0
- package/dist/components/factory/api.d.ts.map +1 -0
- package/dist/components/factory/api.js +4 -0
- package/dist/components/factory/api.js.map +1 -0
- package/dist/components/factory/clip-of.d.ts +5 -0
- package/dist/components/factory/clip-of.d.ts.map +1 -0
- package/dist/components/factory/clip-of.js +33 -0
- package/dist/components/factory/clip-of.js.map +1 -0
- package/dist/components/factory/commands-for.d.ts +19 -0
- package/dist/components/factory/commands-for.d.ts.map +1 -0
- package/dist/components/factory/commands-for.js +5 -0
- package/dist/components/factory/commands-for.js.map +1 -0
- package/dist/components/factory/component-audio.d.ts +9 -0
- package/dist/components/factory/component-audio.d.ts.map +1 -0
- package/dist/components/factory/component-audio.js +18 -0
- package/dist/components/factory/component-audio.js.map +1 -0
- package/dist/components/factory/component2d.d.ts +8 -0
- package/dist/components/factory/component2d.d.ts.map +1 -0
- package/dist/components/factory/component2d.js +240 -0
- package/dist/components/factory/component2d.js.map +1 -0
- package/dist/components/factory/component3d.d.ts +9 -0
- package/dist/components/factory/component3d.d.ts.map +1 -0
- package/dist/components/factory/component3d.js +99 -0
- package/dist/components/factory/component3d.js.map +1 -0
- package/dist/components/factory/factory.d.ts +63 -0
- package/dist/components/factory/factory.d.ts.map +1 -0
- package/dist/components/factory/factory.js +313 -0
- package/dist/components/factory/factory.js.map +1 -0
- package/dist/components/factory/timeline.d.ts +22 -0
- package/dist/components/factory/timeline.d.ts.map +1 -0
- package/dist/components/factory/timeline.js +128 -0
- package/dist/components/factory/timeline.js.map +1 -0
- package/dist/components/factory/type-def.d.ts +26 -0
- package/dist/components/factory/type-def.d.ts.map +1 -0
- package/dist/components/factory/type-def.js +16 -0
- package/dist/components/factory/type-def.js.map +1 -0
- package/dist/components/factory/types.d.ts +91 -0
- package/dist/components/factory/types.d.ts.map +1 -0
- package/dist/components/factory/types.js +88 -0
- package/dist/components/factory/types.js.map +1 -0
- package/dist/components/factory/views.d.ts +121 -0
- package/dist/components/factory/views.d.ts.map +1 -0
- package/dist/components/factory/views.js +413 -0
- package/dist/components/factory/views.js.map +1 -0
- package/dist/components/modules/aim.d.ts +30 -0
- package/dist/components/modules/aim.d.ts.map +1 -0
- package/dist/components/modules/aim.js +39 -0
- package/dist/components/modules/aim.js.map +1 -0
- package/dist/components/modules/corners.d.ts +13 -0
- package/dist/components/modules/corners.d.ts.map +1 -0
- package/dist/components/modules/corners.js +12 -0
- package/dist/components/modules/corners.js.map +1 -0
- package/dist/components/modules/flow.d.ts +26 -0
- package/dist/components/modules/flow.d.ts.map +1 -0
- package/dist/components/modules/flow.js +57 -0
- package/dist/components/modules/flow.js.map +1 -0
- package/dist/components/modules/material.d.ts +40 -0
- package/dist/components/modules/material.d.ts.map +1 -0
- package/dist/components/modules/material.js +75 -0
- package/dist/components/modules/material.js.map +1 -0
- package/dist/components/modules/paint.d.ts +71 -0
- package/dist/components/modules/paint.d.ts.map +1 -0
- package/dist/components/modules/paint.js +106 -0
- package/dist/components/modules/paint.js.map +1 -0
- package/dist/components/modules/shapes.d.ts +31 -0
- package/dist/components/modules/shapes.d.ts.map +1 -0
- package/dist/components/modules/shapes.js +43 -0
- package/dist/components/modules/shapes.js.map +1 -0
- package/dist/components/modules/text-layout.d.ts +26 -0
- package/dist/components/modules/text-layout.d.ts.map +1 -0
- package/dist/components/modules/text-layout.js +57 -0
- package/dist/components/modules/text-layout.js.map +1 -0
- package/dist/components/modules/text-style.d.ts +48 -0
- package/dist/components/modules/text-style.d.ts.map +1 -0
- package/dist/components/modules/text-style.js +63 -0
- package/dist/components/modules/text-style.js.map +1 -0
- package/dist/components/modules/three-entries.d.ts +23 -0
- package/dist/components/modules/three-entries.d.ts.map +1 -0
- package/dist/components/modules/three-entries.js +41 -0
- package/dist/components/modules/three-entries.js.map +1 -0
- package/dist/components/modules/view3d.d.ts +59 -0
- package/dist/components/modules/view3d.d.ts.map +1 -0
- package/dist/components/modules/view3d.js +171 -0
- package/dist/components/modules/view3d.js.map +1 -0
- package/dist/components/trees/2d/group-bounds.d.ts +56 -0
- package/dist/components/trees/2d/group-bounds.d.ts.map +1 -0
- package/dist/components/trees/2d/group-bounds.js +87 -0
- package/dist/components/trees/2d/group-bounds.js.map +1 -0
- package/dist/components/trees/2d/node-lifecycle.d.ts +46 -0
- package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -0
- package/dist/components/trees/2d/node-lifecycle.js +264 -0
- package/dist/components/trees/2d/node-lifecycle.js.map +1 -0
- package/dist/components/trees/2d/node-motion.d.ts +56 -0
- package/dist/components/trees/2d/node-motion.d.ts.map +1 -0
- package/dist/components/trees/2d/node-motion.js +86 -0
- package/dist/components/trees/2d/node-motion.js.map +1 -0
- package/dist/components/trees/2d/node-render.d.ts +36 -0
- package/dist/components/trees/2d/node-render.d.ts.map +1 -0
- package/dist/components/trees/2d/node-render.js +67 -0
- package/dist/components/trees/2d/node-render.js.map +1 -0
- package/dist/components/trees/2d/node-space.d.ts +63 -0
- package/dist/components/trees/2d/node-space.d.ts.map +1 -0
- package/dist/components/trees/2d/node-space.js +131 -0
- package/dist/components/trees/2d/node-space.js.map +1 -0
- package/dist/components/trees/2d/node-transform.d.ts +55 -0
- package/dist/components/trees/2d/node-transform.d.ts.map +1 -0
- package/dist/components/trees/2d/node-transform.js +73 -0
- package/dist/components/trees/2d/node-transform.js.map +1 -0
- package/dist/components/trees/2d/node2d.d.ts +1020 -0
- package/dist/components/trees/2d/node2d.d.ts.map +1 -0
- package/dist/components/trees/2d/node2d.js +1481 -0
- package/dist/components/trees/2d/node2d.js.map +1 -0
- package/dist/components/trees/audio/index.d.ts +2 -0
- package/dist/components/trees/audio/index.d.ts.map +1 -0
- package/dist/components/trees/audio/index.js +2 -0
- package/dist/components/trees/audio/index.js.map +1 -0
- package/dist/components/trees/audio/node-audio.d.ts +109 -0
- package/dist/components/trees/audio/node-audio.d.ts.map +1 -0
- package/dist/components/trees/audio/node-audio.js +167 -0
- package/dist/components/trees/audio/node-audio.js.map +1 -0
- package/dist/components/trees/index.d.ts +10 -0
- package/dist/components/trees/index.d.ts.map +1 -0
- package/dist/components/trees/index.js +14 -0
- package/dist/components/trees/index.js.map +1 -0
- package/dist/components/trees/node/node-editor-state.d.ts +53 -0
- package/dist/components/trees/node/node-editor-state.d.ts.map +1 -0
- package/dist/components/trees/node/node-editor-state.js +23 -0
- package/dist/components/trees/node/node-editor-state.js.map +1 -0
- package/dist/components/trees/node/node-reactive.d.ts +89 -0
- package/dist/components/trees/node/node-reactive.d.ts.map +1 -0
- package/dist/components/trees/node/node-reactive.js +135 -0
- package/dist/components/trees/node/node-reactive.js.map +1 -0
- package/dist/components/trees/node/node-time.d.ts +39 -0
- package/dist/components/trees/node/node-time.d.ts.map +1 -0
- package/dist/components/trees/node/node-time.js +14 -0
- package/dist/components/trees/node/node-time.js.map +1 -0
- package/dist/components/trees/node/node-walk.d.ts +46 -0
- package/dist/components/trees/node/node-walk.d.ts.map +1 -0
- package/dist/components/trees/node/node-walk.js +74 -0
- package/dist/components/trees/node/node-walk.js.map +1 -0
- package/dist/components/trees/node/node.d.ts +401 -0
- package/dist/components/trees/node/node.d.ts.map +1 -0
- package/dist/components/trees/node/node.js +680 -0
- package/dist/components/trees/node/node.js.map +1 -0
- package/dist/components/trees/root/canvas2d-node.d.ts +163 -0
- package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -0
- package/dist/components/trees/root/canvas2d-node.js +216 -0
- package/dist/components/trees/root/canvas2d-node.js.map +1 -0
- package/dist/components/trees/three/node3d.d.ts +222 -0
- package/dist/components/trees/three/node3d.d.ts.map +1 -0
- package/dist/components/trees/three/node3d.js +289 -0
- package/dist/components/trees/three/node3d.js.map +1 -0
- package/dist/document/builtins.js +13 -13
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +2 -2
- package/dist/document/command-traits.js +1 -1
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.d.ts +2 -2
- package/dist/document/deny-globals.js +2 -2
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/expression/index.d.ts +1 -1
- package/dist/document/expression/index.js +1 -1
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.js +1 -1
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/index.d.ts +1 -2
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/index.js +1 -2
- package/dist/document/index.js.map +1 -1
- package/dist/document/node-decorator.d.ts +14 -10
- package/dist/document/node-decorator.d.ts.map +1 -1
- package/dist/document/node-decorator.js +14 -10
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.d.ts +3 -3
- package/dist/document/node-descriptor.d.ts.map +1 -1
- package/dist/document/node-descriptor.js.map +1 -1
- package/dist/document/registry.d.ts +23 -25
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +12 -18
- package/dist/document/registry.js.map +1 -1
- package/dist/document/timeline.d.ts +3 -3
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +2 -2
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +4 -4
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +1 -1
- package/dist/document/validate.js.map +1 -1
- package/dist/experimental.d.ts +19 -19
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.js +17 -17
- package/dist/experimental.js.map +1 -1
- package/dist/index.d.ts +10 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -11
- package/dist/index.js.map +1 -1
- package/dist/layout/types.d.ts +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/props/host.d.ts +1 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/slot.d.ts +1 -1
- package/dist/props/slot.js +1 -1
- package/dist/props/slot.js.map +1 -1
- package/dist/render/clip.d.ts +1 -1
- package/dist/render/clip.js +1 -1
- package/dist/render/clip.js.map +1 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/text.d.ts +11 -5
- package/dist/render/descriptors/text.d.ts.map +1 -1
- package/dist/render/descriptors/text.js +7 -1
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/render-context2d.d.ts +2 -2
- package/dist/render/render-context2d.js.map +1 -1
- package/dist/render3d/builders.d.ts +1 -1
- package/dist/render3d/builders.js +1 -1
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts +13 -19
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +13 -19
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/scene3d.d.ts +1 -1
- package/dist/render3d/scene3d.js +1 -1
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/texture.d.ts +2 -2
- package/dist/render3d/texture.d.ts.map +1 -1
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/vector3.d.ts +2 -2
- package/dist/render3d/vector3.js +2 -2
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/runtime/asset-refine.d.ts +1 -1
- package/dist/runtime/asset-refine.d.ts.map +1 -1
- package/dist/runtime/asset-refine.js +1 -1
- package/dist/runtime/asset-refine.js.map +1 -1
- package/dist/runtime/asset-update.js +1 -1
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.d.ts +0 -11
- package/dist/runtime/audio-index.d.ts.map +1 -1
- package/dist/runtime/audio-index.js +0 -25
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +3 -3
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +4 -4
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +2 -3
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +17 -35
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +3 -3
- package/dist/runtime/engine.js +2 -2
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/node-picking.d.ts +2 -2
- package/dist/runtime/node-picking.d.ts.map +1 -1
- package/dist/runtime/node-picking.js +3 -3
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +2 -2
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +1 -1
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts +2 -2
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +1 -1
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/state-evaluator.d.ts +2 -2
- package/dist/runtime/state-evaluator.d.ts.map +1 -1
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.d.ts +1 -1
- package/dist/runtime/text-geometry.d.ts.map +1 -1
- package/dist/runtime/text-geometry.js +4 -5
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +43 -39
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +24 -25
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +7 -9
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js +2 -2
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.d.ts +1 -1
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/index.d.ts +2 -1
- package/dist/tween/index.d.ts.map +1 -1
- package/dist/tween/index.js +1 -1
- package/dist/tween/index.js.map +1 -1
- package/dist/tween/loop.d.ts +1 -1
- package/dist/tween/loop.js +1 -1
- package/dist/tween/loop.js.map +1 -1
- package/dist/util/reference.d.ts +6 -6
- package/dist/util/reference.js.map +1 -1
- package/package.json +2 -10
- package/dist/browser/chunks/chunk-2RIYH36X.js +0 -3
- package/dist/browser/chunks/chunk-2RIYH36X.js.map +0 -7
- package/dist/browser/chunks/chunk-DDJN3QII.js +0 -15
- package/dist/browser/chunks/chunk-DDJN3QII.js.map +0 -7
- package/dist/browser/chunks/chunk-DHB4COFY.js +0 -2
- package/dist/browser/chunks/chunk-EJDPYDQI.js +0 -5
- package/dist/browser/chunks/chunk-EJDPYDQI.js.map +0 -7
- package/dist/browser/chunks/chunk-SFNJRPBV.js +0 -2
- package/dist/browser/chunks/chunk-SFNJRPBV.js.map +0 -7
- package/dist/browser/chunks/chunk-XAWE4EAK.js +0 -2
- package/dist/browser/chunks/chunk-XAWE4EAK.js.map +0 -7
- package/dist/browser/jsx-jsx-dev-runtime.js +0 -2
- package/dist/browser/jsx-jsx-dev-runtime.js.map +0 -7
- package/dist/browser/jsx-jsx-runtime.js +0 -2
- package/dist/browser/jsx-jsx-runtime.js.map +0 -7
|
@@ -5,9 +5,9 @@ import { type PlacedCommandInfo, type PlacedSound } from "../document/timeline.j
|
|
|
5
5
|
import type { TimelinePatch } from "../document/timeline-patch.js";
|
|
6
6
|
import type { PropSlot } from "../props/slot.js";
|
|
7
7
|
import { type ClipDocument, type NodeSpan } from "../document/types.js";
|
|
8
|
-
import type { Node } from "../
|
|
9
|
-
import { type NodeEditorStates } from "../
|
|
10
|
-
import { Canvas2D } from "../
|
|
8
|
+
import type { Node } from "../components/trees/node/node.js";
|
|
9
|
+
import { type NodeEditorStates } from "../components/trees/node/node-editor-state.js";
|
|
10
|
+
import { Canvas2D } from "../components/trees/root/canvas2d-node.js";
|
|
11
11
|
import type { MeasureContext2D } from "../render/measure-context.js";
|
|
12
12
|
import type { RenderPass2D } from "../render/render-context2d.js";
|
|
13
13
|
/** What a clip is built and measured against — the same for every track in a session. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clip-instance.d.ts","sourceRoot":"","sources":["../../src/runtime/clip-instance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAgB,KAAK,iBAAiB,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC7F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAA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kG;IAClG,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;IAIjE,gEAAgE;IAChE,QAAQ,IAAI,QAAQ,EAAE;IAItB,2GAA2G;IAC3G,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS;IAIzC;;;OAGG;IACH,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS;IAe1C;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,QAAQ,GAAG,SAAS;IASxC;;;;;OAKG;IACH,YAAY,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;IAkB/F,OAAO,IAAI,IAAI;IAKf,OAAO,CAAC,KAAK,CAAe;IAC5B,OAAO,CAAC,IAAI,CAAiB;IAC7B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IACzC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkE;IAExF,OAAO,CAAC,UAAU;IASlB;;;OAGG;IACH,OAAO,CAAC,QAAQ;CASnB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { clipDocument } from "../document/audio.js";
|
|
2
2
|
import { ClipTimeline } from "../document/timeline.js";
|
|
3
3
|
import { effectiveSpans, ROOT_NODE_ID, } from "../document/types.js";
|
|
4
|
-
import { applyEditorStates } from "../
|
|
5
|
-
import { primeMotionTree, sampleTree } from "../
|
|
6
|
-
import { Canvas2D } from "../
|
|
4
|
+
import { applyEditorStates } from "../components/trees/node/node-editor-state.js";
|
|
5
|
+
import { primeMotionTree, sampleTree } from "../components/trees/node/node-walk.js";
|
|
6
|
+
import { Canvas2D } from "../components/trees/root/canvas2d-node.js";
|
|
7
7
|
import { nodePath } from "../project/tree.js";
|
|
8
8
|
import { ContextMap } from "../util/context.js";
|
|
9
9
|
/**
|
|
@@ -25,7 +25,7 @@ export class ClipInstance {
|
|
|
25
25
|
const { width, height } = _scope.viewport;
|
|
26
26
|
// Seeded here because this canvas *is* the document's root row, yet it is
|
|
27
27
|
// the one node no `Registry.instantiate` makes: `ClipTimeline` applies
|
|
28
|
-
// that row's props with `set()`, which writes
|
|
28
|
+
// that row's props with `set()`, which writes property fields only, so
|
|
29
29
|
// an unseeded root would report a UUID no document row mentions.
|
|
30
30
|
this.canvas = new Canvas2D({ id: ROOT_NODE_ID, width, height, flow: "freeform" });
|
|
31
31
|
this._timeline = new ClipTimeline(this._doc, _scope.registry, this.canvas);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clip-instance.js","sourceRoot":"","sources":["../../src/runtime/clip-instance.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAA4C,MAAM,qBAAqB,CAAC;AAG7F,OAAO,EACH,cAAc,EACd,YAAY,GAIf,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAyB,MAAM,gCAAgC,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAW5C;;;;;;;GAOG;AACH,MAAM,OAAO,YAAY;IAG8C;IAF1D,MAAM,CAAW;IAE1B,YAAY,IAAkB,EAAE,QAAgB,EAAmB,MAAoB;QAApB,WAAM,GAAN,MAAM,CAAc;QACnF,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,I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AK,EAAE,CAAC;YACjC,IAAI,IAAI,CAAC,EAAE,KAAK,YAAY;gBAAE,SAAS;YACvC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAE,EAAE,CAAC,CAAC;QACpF,CAAC;IACL,CAAC;IAED;;;OAGG;IACK,QAAQ,CAAC,IAAU;QACvB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpC,IAAI,CAAC,GAAG;YAAE,OAAO,SAAS,CAAC;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,KAAK,IAAI,IAAI,GAAG,CAAC,QAAQ,KAAK,YAAY;YACjE,CAAC,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM;YACxB,CAAC,CAAC,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,EAAE,KAAK,GAAG,CAAC,QAAQ,CAAC;QACpD,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACzC,CAAC;CACJ;AAED,SAAS,OAAO,CAAC,IAAkB;IAC/B,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["import type { AssetCatalog } from \"@/assets/catalog\";\r\nimport type { Size2D } from \"@/attributes/layout/size\";\r\nimport { clipDocument } from \"@/document/audio\";\r\nimport type { Registry } from \"@/document/registry\";\r\nimport { ClipTimeline, type PlacedCommandInfo, type PlacedSound } from \"@/document/timeline\";\r\nimport type { TimelinePatch } from \"@/document/timeline-patch\";\r\nimport type { PropSlot } from \"@/props/slot\";\r\nimport {\r\n effectiveSpans,\r\n ROOT_NODE_ID,\r\n type ClipDocument,\r\n type NodeSpan,\r\n type VisualDocument,\r\n} from \"@/document/types\";\r\nimport type { Node } from \"@/nodes/node/node\";\r\nimport { applyEditorStates, type NodeEditorStates } from \"@/nodes/node/node-editor-state\";\r\nimport { primeMotionTree, sampleTree } from \"@/nodes/node/node-walk\";\r\nimport { Canvas2D } from \"@/nodes/root/canvas2d-node\";\r\nimport { nodePath } from \"@/project/tree\";\r\nimport type { MeasureContext2D } from \"@/render/measure-context\";\r\nimport type { RenderPass2D } from \"@/render/render-context2d\";\r\nimport { ContextMap } from \"@/util/context\";\r\n\r\n/** What a clip is built and measured against — the same for every track in a session. */\r\nexport interface RuntimeScope {\r\n registry: Registry;\r\n viewport: Size2D;\r\n fps: number;\r\n assets: AssetCatalog;\r\n measurer: MeasureContext2D;\r\n}\r\n\r\n/**\r\n * One track's clip, live: the viewport-sized {@link Canvas2D} it builds into and\r\n * the timeline compiled over it.\r\n *\r\n * Built once, then asked for a time. Nothing resets one — a caller that needs a\r\n * fresh tree builds a new instance — which is what lets the measuring pass and\r\n * the evaluator each hold their own instead of taking turns with one.\r\n */\r\nexport class ClipInstance {\r\n readonly canvas: Canvas2D;\r\n\r\n constructor(clip: ClipDocument, duration: number, private readonly _scope: RuntimeScope) {\r\n this._clip = clip;\r\n this._duration = duration;\r\n this._doc = lowered(clip);\r\n const { width, height } = _scope.viewport;\r\n // Seeded here because this canvas *is* the document's root row, yet it is\r\n // the one node no `Registry.instantiate` makes: `ClipTimeline` applies\r\n // that row's props with `set()`, which writes @property fields only, so\r\n // an unseeded root would report a UUID no document row mentions.\r\n this.canvas = new Canvas2D({ id: ROOT_NODE_ID, width, height, flow: \"freeform\" });\r\n this._timeline = new ClipTimeline(this._doc, _scope.registry, this.canvas);\r\n this._indexRows();\r\n }\r\n\r\n get duration(): number {\r\n return this._duration;\r\n }\r\n\r\n /** The clip document this instance plays, as handed in — before audio lowering. */\r\n get clip(): ClipDocument {\r\n return this._clip;\r\n }\r\n\r\n /**\r\n * Build the tree, then fix every command against it laid out — see `ClipTimeline.compile`.\r\n * `measurer` stands in for the scope's during the build only.\r\n */\r\n build(measurer: MeasureContext2D = this._scope.measurer): void {\r\n this.attach(0);\r\n this._timeline.build();\r\n this.sample();\r\n this.layout(measurer);\r\n this._timeline.compile(() => {\r\n this.sample();\r\n this.layout(measurer);\r\n });\r\n this.layout(measurer);\r\n }\r\n\r\n /**\r\n * Patch the built tree to play `next`, re-instantiating and recompiling only\r\n * what the difference touches. `false` means the change needs a fresh instance\r\n * (see `planTimelinePatch`); the tree is untouched then. A throw leaves the tree\r\n * unusable — the caller disposes it and builds fresh.\r\n */\r\n update(next: ClipDocument, duration: number): boolean {\r\n if (next === this._clip) {\r\n this._duration = duration;\r\n return true;\r\n }\r\n const patch = this.planUpdate(next);\r\n if (!patch) return false;\r\n this.applyUpdate(patch, next, duration);\r\n return true;\r\n }\r\n\r\n /** {@link update}'s plan, for a caller that has to look at the tree before it changes. */\r\n planUpdate(next: ClipDocument): TimelinePatch | null {\r\n return this._timeline.planUpdate(lowered(next));\r\n }\r\n\r\n applyUpdate(\r\n patch: TimelinePatch,\r\n next: ClipDocument,\r\n duration: number,\r\n measurer: MeasureContext2D = this._scope.measurer,\r\n ): void {\r\n this.attach(0);\r\n const relayout = () => {\r\n this.sample();\r\n this.layout(measurer);\r\n };\r\n this._timeline.applyUpdate(patch, relayout, relayout);\r\n this.layout(measurer);\r\n this._clip = next;\r\n this._doc = patch.next.doc;\r\n this._duration = duration;\r\n this._indexRows();\r\n }\r\n\r\n /** Every command as compiled, with what each writes — see `ClipTimeline.placedCommands`. */\r\n placedCommands(): readonly PlacedCommandInfo[] {\r\n return this._timeline.placedCommands();\r\n }\r\n\r\n commandSounds(): PlacedSound[] {\r\n return this._timeline.commandSounds();\r\n }\r\n\r\n /** `read`, with the tree's presence as it stands at `seconds`; the presence is put back after. */\r\n atPresence<T>(seconds: number, read: () => T): T {\r\n const was = this._timeline.presenceTime;\r\n this._timeline.syncPresence(seconds);\r\n try {\r\n return read();\r\n } finally {\r\n this._timeline.syncPresence(was);\r\n }\r\n }\r\n\r\n evaluateAt(seconds: number, onWrite?: (index: number, slot: PropSlot<unknown>) => void): void {\r\n this._timeline.syncPresence(seconds);\r\n this._timeline.evaluateAt(seconds, onWrite);\r\n }\r\n\r\n attach(seconds: number, editor?: NodeEditorStates): void {\r\n this.canvas.attach({ assets: this._scope.assets, context: ContextMap.EMPTY, time: seconds });\r\n // Before layout, so a node that appeared this frame gets its editor state\r\n // on the frame it appears — and a hidden one is out of the flow before it\r\n // is measured.\r\n applyEditorStates(this.canvas, editor);\r\n }\r\n\r\n layout(measurer: MeasureContext2D = this._scope.measurer): void {\r\n const { width, height } = this._scope.viewport;\r\n this.canvas.layout({ x: 0, y: 0, width, height }, measurer);\r\n }\r\n\r\n render(pass: RenderPass2D): void {\r\n this.canvas.render(pass);\r\n }\r\n\r\n sample(): void {\r\n sampleTree(this.canvas);\r\n }\r\n\r\n primeMotion(at: number): void {\r\n primeMotionTree(this.canvas, at);\r\n }\r\n\r\n /** The node a document row built, mounted or not; the canvas for the root. */\r\n node(rowId: string): Node | undefined {\r\n return this._timeline.liveNode(rowId);\r\n }\r\n\r\n /** What a document row holds before any command acts on it — see `ClipTimeline.baselineProps`. */\r\n baselineProps(rowId: string): Record<string, unknown> | undefined {\r\n return this._timeline.baselineProps(rowId);\r\n }\r\n\r\n /** Every document row's effective span, the root's excepted. */\r\n rowSpans(): NodeSpan[] {\r\n return [...this._rows.values()].map((row) => row.span);\r\n }\r\n\r\n /** One row's effective span — `undefined` for the root, which spans the clip, and for an id no row has. */\r\n rowSpan(id: string): NodeSpan | undefined {\r\n return this._rows.get(id)?.span;\r\n }\r\n\r\n /**\r\n * `node`'s owner key as {@link forEachOwner} spells it, mounted or not —\r\n * `undefined` for a node no row built.\r\n */\r\n ownerKeyOf(node: Node): string | undefined {\r\n let below = \"\";\r\n for (let current: Node = node; ;) {\r\n if (current === this.canvas || this._timeline.liveNode(current.id) === current) {\r\n const row = current === this.canvas ? ROOT_NODE_ID : current.id;\r\n return below === \"\" ? row : `${row}/${below}`;\r\n }\r\n const parent = current.parent;\r\n if (!parent) return undefined;\r\n const index = parent._allChildren.indexOf(current);\r\n below = below === \"\" ? String(index) : `${index}.${below}`;\r\n current = parent;\r\n }\r\n }\r\n\r\n /**\r\n * When `node` is in the tree, in clip seconds: its document row's effective\r\n * span, or the nearest row ancestor's for a node a composite built. The canvas\r\n * spans the clip. `undefined` for a node outside this tree.\r\n */\r\n spanOf(node: Node): NodeSpan | undefined {\r\n for (let current: Node | null = node; current; current = current.parent) {\r\n if (current === this.canvas) return { start: 0, end: this.duration };\r\n const span = this._rowSpan(current);\r\n if (span) return { ...span };\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Visit every mounted node, parents first, with its span, its structural path\r\n * and its **owner key** — the nearest row's id, plus the path below that row for\r\n * a node a composite built. A UUID changes on every build and a path from the\r\n * root changes whenever an earlier sibling enters or leaves; this does neither.\r\n */\r\n forEachOwner(visit: (node: Node, ownerKey: string, span: NodeSpan, path: string) => void): void {\r\n const walk = (node: Node, row: string, below: string, span: NodeSpan, path: string): void => {\r\n if (!node.mounted) return;\r\n const own = node === this.canvas ? undefined : this._rowSpan(node);\r\n if (own) {\r\n row = node.id;\r\n below = \"\";\r\n span = own;\r\n }\r\n visit(node, below === \"\" ? row : `${row}/${below}`, span, path);\r\n const children = node._allChildren;\r\n for (let i = 0; i < children.length; i++) {\r\n walk(children[i], row, below === \"\" ? String(i) : `${below}.${i}`, span, nodePath(path, i));\r\n }\r\n };\r\n walk(this.canvas, ROOT_NODE_ID, \"\", { start: 0, end: this.duration }, \"\");\r\n }\r\n\r\n dispose(): void {\r\n for (const child of this.canvas.children) child.dispose();\r\n this.canvas.dispose();\r\n }\r\n\r\n private _clip: ClipDocument;\r\n private _doc: VisualDocument;\r\n private _duration: number;\r\n private readonly _timeline: ClipTimeline;\r\n private readonly _rows = new Map<string, { parentId: string | null; span: NodeSpan }>();\r\n\r\n private _indexRows(): void {\r\n this._rows.clear();\r\n const spans = effectiveSpans(this._doc.nodes);\r\n for (const spec of this._doc.nodes) {\r\n if (spec.id === ROOT_NODE_ID) continue;\r\n this._rows.set(spec.id, { parentId: spec.parentId, span: spans.get(spec.id)! });\r\n }\r\n }\r\n\r\n /**\r\n * `node`'s row span when a document row built it. The parent is checked as well\r\n * as the id, because a composite can hand its own id down to a child it builds.\r\n */\r\n private _rowSpan(node: Node): NodeSpan | undefined {\r\n const row = this._rows.get(node.id);\r\n if (!row) return undefined;\r\n const parent = node.parent;\r\n const placed = row.parentId === null || row.parentId === ROOT_NODE_ID\r\n ? parent === this.canvas\r\n : parent !== null && parent.id === row.parentId;\r\n return placed ? row.span : undefined;\r\n }\r\n}\r\n\r\nfunction lowered(clip: ClipDocument): VisualDocument {\r\n return clipDocument(clip);\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"clip-instance.js","sourceRoot":"","sources":["../../src/runtime/clip-instance.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAA4C,MAAM,qBAAqB,CAAC;AAG7F,OAAO,EACH,cAAc,EACd,YAAY,GAIf,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAyB,MAAM,2CAA2C,CAAC;AACrG,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAW5C;;;;;;;GAOG;AACH,MAAM,OAAO,YAAY;IAG8C;IAF1D,MAAM,CAAW;IAE1B,YAAY,IAAkB,EAAE,QAAgB,EAAmB,MAAoB;QAApB,WAAM,GAAN,MAAM,CAAc;QACnF,IAAI,CAAC,KAAK,GAA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C,CAAC;QAC9C,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YACjC,IAAI,IAAI,CAAC,EAAE,KAAK,YAAY;gBAAE,SAAS;YACvC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAE,EAAE,CAAC,CAAC;QACpF,CAAC;IACL,CAAC;IAED;;;OAGG;IACK,QAAQ,CAAC,IAAU;QACvB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpC,IAAI,CAAC,GAAG;YAAE,OAAO,SAAS,CAAC;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,KAAK,IAAI,IAAI,GAAG,CAAC,QAAQ,KAAK,YAAY;YACjE,CAAC,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM;YACxB,CAAC,CAAC,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,EAAE,KAAK,GAAG,CAAC,QAAQ,CAAC;QACpD,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACzC,CAAC;CACJ;AAED,SAAS,OAAO,CAAC,IAAkB;IAC/B,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["import type { AssetCatalog } from \"@/assets/catalog\";\r\nimport type { Size2D } from \"@/attributes/layout/size\";\r\nimport { clipDocument } from \"@/document/audio\";\r\nimport type { Registry } from \"@/document/registry\";\r\nimport { ClipTimeline, type PlacedCommandInfo, type PlacedSound } from \"@/document/timeline\";\r\nimport type { TimelinePatch } from \"@/document/timeline-patch\";\r\nimport type { PropSlot } from \"@/props/slot\";\r\nimport {\r\n effectiveSpans,\r\n ROOT_NODE_ID,\r\n type ClipDocument,\r\n type NodeSpan,\r\n type VisualDocument,\r\n} from \"@/document/types\";\r\nimport type { Node } from \"@/components/trees/node/node\";\r\nimport { applyEditorStates, type NodeEditorStates } from \"@/components/trees/node/node-editor-state\";\r\nimport { primeMotionTree, sampleTree } from \"@/components/trees/node/node-walk\";\r\nimport { Canvas2D } from \"@/components/trees/root/canvas2d-node\";\r\nimport { nodePath } from \"@/project/tree\";\r\nimport type { MeasureContext2D } from \"@/render/measure-context\";\r\nimport type { RenderPass2D } from \"@/render/render-context2d\";\r\nimport { ContextMap } from \"@/util/context\";\r\n\r\n/** What a clip is built and measured against — the same for every track in a session. */\r\nexport interface RuntimeScope {\r\n registry: Registry;\r\n viewport: Size2D;\r\n fps: number;\r\n assets: AssetCatalog;\r\n measurer: MeasureContext2D;\r\n}\r\n\r\n/**\r\n * One track's clip, live: the viewport-sized {@link Canvas2D} it builds into and\r\n * the timeline compiled over it.\r\n *\r\n * Built once, then asked for a time. Nothing resets one — a caller that needs a\r\n * fresh tree builds a new instance — which is what lets the measuring pass and\r\n * the evaluator each hold their own instead of taking turns with one.\r\n */\r\nexport class ClipInstance {\r\n readonly canvas: Canvas2D;\r\n\r\n constructor(clip: ClipDocument, duration: number, private readonly _scope: RuntimeScope) {\r\n this._clip = clip;\r\n this._duration = duration;\r\n this._doc = lowered(clip);\r\n const { width, height } = _scope.viewport;\r\n // Seeded here because this canvas *is* the document's root row, yet it is\r\n // the one node no `Registry.instantiate` makes: `ClipTimeline` applies\r\n // that row's props with `set()`, which writes property fields only, so\r\n // an unseeded root would report a UUID no document row mentions.\r\n this.canvas = new Canvas2D({ id: ROOT_NODE_ID, width, height, flow: \"freeform\" });\r\n this._timeline = new ClipTimeline(this._doc, _scope.registry, this.canvas);\r\n this._indexRows();\r\n }\r\n\r\n get duration(): number {\r\n return this._duration;\r\n }\r\n\r\n /** The clip document this instance plays, as handed in — before audio lowering. */\r\n get clip(): ClipDocument {\r\n return this._clip;\r\n }\r\n\r\n /**\r\n * Build the tree, then fix every command against it laid out — see `ClipTimeline.compile`.\r\n * `measurer` stands in for the scope's during the build only.\r\n */\r\n build(measurer: MeasureContext2D = this._scope.measurer): void {\r\n this.attach(0);\r\n this._timeline.build();\r\n this.sample();\r\n this.layout(measurer);\r\n this._timeline.compile(() => {\r\n this.sample();\r\n this.layout(measurer);\r\n });\r\n this.layout(measurer);\r\n }\r\n\r\n /**\r\n * Patch the built tree to play `next`, re-instantiating and recompiling only\r\n * what the difference touches. `false` means the change needs a fresh instance\r\n * (see `planTimelinePatch`); the tree is untouched then. A throw leaves the tree\r\n * unusable — the caller disposes it and builds fresh.\r\n */\r\n update(next: ClipDocument, duration: number): boolean {\r\n if (next === this._clip) {\r\n this._duration = duration;\r\n return true;\r\n }\r\n const patch = this.planUpdate(next);\r\n if (!patch) return false;\r\n this.applyUpdate(patch, next, duration);\r\n return true;\r\n }\r\n\r\n /** {@link update}'s plan, for a caller that has to look at the tree before it changes. */\r\n planUpdate(next: ClipDocument): TimelinePatch | null {\r\n return this._timeline.planUpdate(lowered(next));\r\n }\r\n\r\n applyUpdate(\r\n patch: TimelinePatch,\r\n next: ClipDocument,\r\n duration: number,\r\n measurer: MeasureContext2D = this._scope.measurer,\r\n ): void {\r\n this.attach(0);\r\n const relayout = () => {\r\n this.sample();\r\n this.layout(measurer);\r\n };\r\n this._timeline.applyUpdate(patch, relayout, relayout);\r\n this.layout(measurer);\r\n this._clip = next;\r\n this._doc = patch.next.doc;\r\n this._duration = duration;\r\n this._indexRows();\r\n }\r\n\r\n /** Every command as compiled, with what each writes — see `ClipTimeline.placedCommands`. */\r\n placedCommands(): readonly PlacedCommandInfo[] {\r\n return this._timeline.placedCommands();\r\n }\r\n\r\n commandSounds(): PlacedSound[] {\r\n return this._timeline.commandSounds();\r\n }\r\n\r\n /** `read`, with the tree's presence as it stands at `seconds`; the presence is put back after. */\r\n atPresence<T>(seconds: number, read: () => T): T {\r\n const was = this._timeline.presenceTime;\r\n this._timeline.syncPresence(seconds);\r\n try {\r\n return read();\r\n } finally {\r\n this._timeline.syncPresence(was);\r\n }\r\n }\r\n\r\n evaluateAt(seconds: number, onWrite?: (index: number, slot: PropSlot<unknown>) => void): void {\r\n this._timeline.syncPresence(seconds);\r\n this._timeline.evaluateAt(seconds, onWrite);\r\n }\r\n\r\n attach(seconds: number, editor?: NodeEditorStates): void {\r\n this.canvas.attach({ assets: this._scope.assets, context: ContextMap.EMPTY, time: seconds });\r\n // Before layout, so a node that appeared this frame gets its editor state\r\n // on the frame it appears — and a hidden one is out of the flow before it\r\n // is measured.\r\n applyEditorStates(this.canvas, editor);\r\n }\r\n\r\n layout(measurer: MeasureContext2D = this._scope.measurer): void {\r\n const { width, height } = this._scope.viewport;\r\n this.canvas.layout({ x: 0, y: 0, width, height }, measurer);\r\n }\r\n\r\n render(pass: RenderPass2D): void {\r\n this.canvas.render(pass);\r\n }\r\n\r\n sample(): void {\r\n sampleTree(this.canvas);\r\n }\r\n\r\n primeMotion(at: number): void {\r\n primeMotionTree(this.canvas, at);\r\n }\r\n\r\n /** The node a document row built, mounted or not; the canvas for the root. */\r\n node(rowId: string): Node | undefined {\r\n return this._timeline.liveNode(rowId);\r\n }\r\n\r\n /** What a document row holds before any command acts on it — see `ClipTimeline.baselineProps`. */\r\n baselineProps(rowId: string): Record<string, unknown> | undefined {\r\n return this._timeline.baselineProps(rowId);\r\n }\r\n\r\n /** Every document row's effective span, the root's excepted. */\r\n rowSpans(): NodeSpan[] {\r\n return [...this._rows.values()].map((row) => row.span);\r\n }\r\n\r\n /** One row's effective span — `undefined` for the root, which spans the clip, and for an id no row has. */\r\n rowSpan(id: string): NodeSpan | undefined {\r\n return this._rows.get(id)?.span;\r\n }\r\n\r\n /**\r\n * `node`'s owner key as {@link forEachOwner} spells it, mounted or not —\r\n * `undefined` for a node no row built.\r\n */\r\n ownerKeyOf(node: Node): string | undefined {\r\n let below = \"\";\r\n for (let current: Node = node; ;) {\r\n if (current === this.canvas || this._timeline.liveNode(current.id) === current) {\r\n const row = current === this.canvas ? ROOT_NODE_ID : current.id;\r\n return below === \"\" ? row : `${row}/${below}`;\r\n }\r\n const parent = current.parent;\r\n if (!parent) return undefined;\r\n const index = parent._allChildren.indexOf(current);\r\n below = below === \"\" ? String(index) : `${index}.${below}`;\r\n current = parent;\r\n }\r\n }\r\n\r\n /**\r\n * When `node` is in the tree, in clip seconds: its document row's effective\r\n * span, or the nearest row ancestor's for a node a composite built. The canvas\r\n * spans the clip. `undefined` for a node outside this tree.\r\n */\r\n spanOf(node: Node): NodeSpan | undefined {\r\n for (let current: Node | null = node; current; current = current.parent) {\r\n if (current === this.canvas) return { start: 0, end: this.duration };\r\n const span = this._rowSpan(current);\r\n if (span) return { ...span };\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Visit every mounted node, parents first, with its span, its structural path\r\n * and its **owner key** — the nearest row's id, plus the path below that row for\r\n * a node a composite built. A UUID changes on every build and a path from the\r\n * root changes whenever an earlier sibling enters or leaves; this does neither.\r\n */\r\n forEachOwner(visit: (node: Node, ownerKey: string, span: NodeSpan, path: string) => void): void {\r\n const walk = (node: Node, row: string, below: string, span: NodeSpan, path: string): void => {\r\n if (!node.mounted) return;\r\n const own = node === this.canvas ? undefined : this._rowSpan(node);\r\n if (own) {\r\n row = node.id;\r\n below = \"\";\r\n span = own;\r\n }\r\n visit(node, below === \"\" ? row : `${row}/${below}`, span, path);\r\n const children = node._allChildren;\r\n for (let i = 0; i < children.length; i++) {\r\n walk(children[i], row, below === \"\" ? String(i) : `${below}.${i}`, span, nodePath(path, i));\r\n }\r\n };\r\n walk(this.canvas, ROOT_NODE_ID, \"\", { start: 0, end: this.duration }, \"\");\r\n }\r\n\r\n dispose(): void {\r\n for (const child of this.canvas.children) child.dispose();\r\n this.canvas.dispose();\r\n }\r\n\r\n private _clip: ClipDocument;\r\n private _doc: VisualDocument;\r\n private _duration: number;\r\n private readonly _timeline: ClipTimeline;\r\n private readonly _rows = new Map<string, { parentId: string | null; span: NodeSpan }>();\r\n\r\n private _indexRows(): void {\r\n this._rows.clear();\r\n const spans = effectiveSpans(this._doc.nodes);\r\n for (const spec of this._doc.nodes) {\r\n if (spec.id === ROOT_NODE_ID) continue;\r\n this._rows.set(spec.id, { parentId: spec.parentId, span: spans.get(spec.id)! });\r\n }\r\n }\r\n\r\n /**\r\n * `node`'s row span when a document row built it. The parent is checked as well\r\n * as the id, because a composite can hand its own id down to a child it builds.\r\n */\r\n private _rowSpan(node: Node): NodeSpan | undefined {\r\n const row = this._rows.get(node.id);\r\n if (!row) return undefined;\r\n const parent = node.parent;\r\n const placed = row.parentId === null || row.parentId === ROOT_NODE_ID\r\n ? parent === this.canvas\r\n : parent !== null && parent.id === row.parentId;\r\n return placed ? row.span : undefined;\r\n }\r\n}\r\n\r\nfunction lowered(clip: ClipDocument): VisualDocument {\r\n return clipDocument(clip);\r\n}\r\n"]}
|
|
@@ -142,9 +142,8 @@ export declare class ClipStore {
|
|
|
142
142
|
private _drop;
|
|
143
143
|
private _link;
|
|
144
144
|
/**
|
|
145
|
-
* Declare
|
|
146
|
-
*
|
|
147
|
-
* does not stop the rest.
|
|
145
|
+
* Declare an arriving owner's audio: the sounds its placed commands play.
|
|
146
|
+
* It reads no slots, but is linked for audio like every arrival.
|
|
148
147
|
*/
|
|
149
148
|
private _declareAudio;
|
|
150
149
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clip-store.d.ts","sourceRoot":"","sources":["../../src/runtime/clip-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAIhD,OAAO,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"clip-store.d.ts","sourceRoot":"","sources":["../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;IACtH,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,gBAAgB;IA2BxB,OAAO,CAAC,WAAW;IAWnB;;;;OAIG;IACH,OAAO,CAAC,QAAQ;IAkChB,wEAAwE;IACxE,OAAO,CAAC,aAAa;IAgBrB;;;OAGG;IACH,OAAO,CAAC,QAAQ;IAmBhB,OAAO,CAAC,gBAAgB;CAQ3B"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { AssetIndex } from "../assets/asset-index.js";
|
|
2
2
|
import { isContextProvider } from "../document/command-traits.js";
|
|
3
3
|
import { diffClip, jsonEqual } from "../document/diff.js";
|
|
4
|
-
import { observeSlots } from "../props/observer.js";
|
|
5
4
|
import { now, yieldToScheduler } from "../util/scheduler.js";
|
|
6
5
|
import { refineAssets } from "./asset-refine.js";
|
|
7
6
|
import { dirtyOwners, OwnerDependencies, SlotNamer } from "./asset-update.js";
|
|
8
|
-
import { AudioIndex
|
|
7
|
+
import { AudioIndex } from "./audio-index.js";
|
|
9
8
|
import { requestOf } from "../attributes/audio/schedule.js";
|
|
10
|
-
import { busPathOf, busPathTo, findBusById, NodeAudio } from "../
|
|
9
|
+
import { busPathOf, busPathTo, findBusById, NodeAudio } from "../components/trees/audio/node-audio.js";
|
|
11
10
|
/** The owner key the placed commands' sounds go under. */
|
|
12
11
|
const COMMAND_AUDIO = "@commands";
|
|
13
12
|
import { ClipInstance } from "./clip-instance.js";
|
|
@@ -516,9 +515,9 @@ export class ClipStore {
|
|
|
516
515
|
catalog,
|
|
517
516
|
declare: this._refine === "assets",
|
|
518
517
|
onPhase: (phase) => profile?.enter(phase),
|
|
519
|
-
onArrive: (
|
|
518
|
+
onArrive: (_node, ownerKey) => {
|
|
520
519
|
profile?.enter("audio");
|
|
521
|
-
this._declareAudio(entry,
|
|
520
|
+
this._declareAudio(entry, ownerKey, audioSlots);
|
|
522
521
|
},
|
|
523
522
|
});
|
|
524
523
|
this._commit(entry, refined, audioSlots);
|
|
@@ -591,11 +590,11 @@ export class ClipStore {
|
|
|
591
590
|
owners: dirty.owners,
|
|
592
591
|
below: dirty.below,
|
|
593
592
|
declare: this._refine === "assets",
|
|
594
|
-
onArrive: (
|
|
593
|
+
onArrive: (_node, ownerKey, span, frame) => {
|
|
595
594
|
seen.add(ownerKey);
|
|
596
|
-
// Audio is declared
|
|
595
|
+
// Audio is declared as an owner arrives, which a sweep starting later never sees.
|
|
597
596
|
if (frame === spanFrames(span, fps, frameCount)?.startFrame) {
|
|
598
|
-
this._declareAudio(entry,
|
|
597
|
+
this._declareAudio(entry, ownerKey, audioSlots);
|
|
599
598
|
}
|
|
600
599
|
},
|
|
601
600
|
});
|
|
@@ -675,32 +674,16 @@ export class ClipStore {
|
|
|
675
674
|
entry.deps.set(key, [...assets ?? [], ...audio ?? []]);
|
|
676
675
|
}
|
|
677
676
|
/**
|
|
678
|
-
* Declare
|
|
679
|
-
*
|
|
680
|
-
* does not stop the rest.
|
|
677
|
+
* Declare an arriving owner's audio: the sounds its placed commands play.
|
|
678
|
+
* It reads no slots, but is linked for audio like every arrival.
|
|
681
679
|
*/
|
|
682
|
-
_declareAudio(entry,
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
if (
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
entry.audio.removeOwner(ownerKey);
|
|
690
|
-
entry.audioErrors.delete(ownerKey);
|
|
691
|
-
return;
|
|
692
|
-
}
|
|
693
|
-
// TODO(audio-dependency-warning): warn in development when a command writes
|
|
694
|
-
// one of `reads` mid-span: "use a curve or split the row".
|
|
695
|
-
try {
|
|
696
|
-
const requests = observeSlots({ read: (slot) => { reads.push(slot); }, write: () => { } }, () => declaredAudio(node, span, this._scope.assets, ownerKey, (n) => entry.instance.spanOf(n)));
|
|
697
|
-
entry.audio.setOwner(ownerKey, requests);
|
|
698
|
-
entry.audioErrors.delete(ownerKey);
|
|
699
|
-
}
|
|
700
|
-
catch (err) {
|
|
701
|
-
entry.audio.removeOwner(ownerKey);
|
|
702
|
-
entry.audioErrors.set(ownerKey, { ...buildErrorOf(entry.track.id, err), nodeId: node.id });
|
|
703
|
-
}
|
|
680
|
+
_declareAudio(entry, ownerKey, slots) {
|
|
681
|
+
slots.set(ownerKey, []);
|
|
682
|
+
const sounds = entry.instance ? this._commandSoundsOf(entry, entry.instance).get(ownerKey) : undefined;
|
|
683
|
+
if (sounds)
|
|
684
|
+
return this._setCommandAudio(entry, entry.instance, ownerKey, sounds);
|
|
685
|
+
entry.audio.removeOwner(ownerKey);
|
|
686
|
+
entry.audioErrors.delete(ownerKey);
|
|
704
687
|
}
|
|
705
688
|
/**
|
|
706
689
|
* What the placed commands play, as one owner: a sound is scheduled ahead of
|
|
@@ -747,14 +730,13 @@ export class ClipStore {
|
|
|
747
730
|
throw new Error(`${node.className} is not in the tree, so it has no span.`);
|
|
748
731
|
return found;
|
|
749
732
|
};
|
|
750
|
-
const scope = { catalog, span: { start: 0, end: Infinity }, clip: () => { }, _spanOf: spanOf };
|
|
751
733
|
try {
|
|
752
734
|
const requests = sounds.map((sound, n) => {
|
|
753
735
|
const { bus: busId, closed, ...options } = sound.options;
|
|
754
736
|
// The buses as they stand when the sound starts: a bus may since have left.
|
|
755
737
|
const bus = instance.atPresence(sound.at, () => {
|
|
756
738
|
const target = busId ? findBusById(sound.node, busId) : null;
|
|
757
|
-
return target ? busPathTo(target,
|
|
739
|
+
return target ? busPathTo(target, spanOf) : sound.node instanceof NodeAudio ? busPathOf(sound.node, spanOf) : undefined;
|
|
758
740
|
});
|
|
759
741
|
const trimEnd = options.trimEnd ?? (closed ? catalog.getMediaDuration(sound.src) : undefined);
|
|
760
742
|
return requestOf({ ...options, trimEnd, src: sound.src, at: sound.at, until: sound.until, bus }, catalog, key, n);
|