@motionscript/core 0.1.0-alpha.5 → 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 +55 -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-LKUYVFU3.js.map +7 -0
- 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 +2 -0
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/manifest.json +3 -4
- package/dist/browser/sdk.js +1 -1
- package/dist/component/api.d.ts +508 -0
- package/dist/component/api.d.ts.map +1 -0
- package/dist/component/api.js +4 -0
- package/dist/component/api.js.map +1 -0
- package/dist/component/builtins/audio.d.ts +26 -0
- package/dist/component/builtins/audio.d.ts.map +1 -0
- package/dist/component/builtins/audio.js +41 -0
- package/dist/component/builtins/audio.js.map +1 -0
- package/dist/component/builtins/canvas3d.d.ts +98 -0
- package/dist/component/builtins/canvas3d.d.ts.map +1 -0
- package/dist/component/builtins/canvas3d.js +21 -0
- package/dist/component/builtins/canvas3d.js.map +1 -0
- package/dist/component/builtins/composite.d.ts +56 -0
- package/dist/component/builtins/composite.d.ts.map +1 -0
- package/dist/component/builtins/composite.js +25 -0
- package/dist/component/builtins/composite.js.map +1 -0
- package/dist/component/builtins/geometry.d.ts +505 -0
- package/dist/component/builtins/geometry.d.ts.map +1 -0
- package/dist/component/builtins/geometry.js +107 -0
- package/dist/component/builtins/geometry.js.map +1 -0
- package/dist/component/builtins/layout.d.ts +88 -0
- package/dist/component/builtins/layout.d.ts.map +1 -0
- package/dist/component/builtins/layout.js +84 -0
- package/dist/component/builtins/layout.js.map +1 -0
- package/dist/component/builtins/media.d.ts +95 -0
- package/dist/component/builtins/media.d.ts.map +1 -0
- package/dist/component/builtins/media.js +149 -0
- package/dist/component/builtins/media.js.map +1 -0
- package/dist/component/builtins/providers.d.ts +23 -0
- package/dist/component/builtins/providers.d.ts.map +1 -0
- package/dist/component/builtins/providers.js +30 -0
- package/dist/component/builtins/providers.js.map +1 -0
- package/dist/component/builtins/text.d.ts +193 -0
- package/dist/component/builtins/text.d.ts.map +1 -0
- package/dist/component/builtins/text.js +113 -0
- package/dist/component/builtins/text.js.map +1 -0
- package/dist/component/builtins/three.d.ts +1085 -0
- package/dist/component/builtins/three.d.ts.map +1 -0
- package/dist/component/builtins/three.js +265 -0
- package/dist/component/builtins/three.js.map +1 -0
- package/dist/component/clip-of.d.ts +5 -0
- package/dist/component/clip-of.d.ts.map +1 -0
- package/dist/component/clip-of.js +33 -0
- package/dist/component/clip-of.js.map +1 -0
- package/dist/component/commands-for.d.ts +19 -0
- package/dist/component/commands-for.d.ts.map +1 -0
- package/dist/component/commands-for.js +5 -0
- package/dist/component/commands-for.js.map +1 -0
- package/dist/component/component-audio.d.ts +9 -0
- package/dist/component/component-audio.d.ts.map +1 -0
- package/dist/component/component-audio.js +18 -0
- package/dist/component/component-audio.js.map +1 -0
- package/dist/component/component2d.d.ts +9 -0
- package/dist/component/component2d.d.ts.map +1 -0
- package/dist/component/component2d.js +239 -0
- package/dist/component/component2d.js.map +1 -0
- package/dist/component/component3d.d.ts +9 -0
- package/dist/component/component3d.d.ts.map +1 -0
- package/dist/component/component3d.js +99 -0
- package/dist/component/component3d.js.map +1 -0
- package/dist/component/factory.d.ts +63 -0
- package/dist/component/factory.d.ts.map +1 -0
- package/dist/component/factory.js +313 -0
- package/dist/component/factory.js.map +1 -0
- package/dist/component/modules/aim.d.ts +30 -0
- package/dist/component/modules/aim.d.ts.map +1 -0
- package/dist/component/modules/aim.js +39 -0
- package/dist/component/modules/aim.js.map +1 -0
- package/dist/component/modules/corners.d.ts +13 -0
- package/dist/component/modules/corners.d.ts.map +1 -0
- package/dist/component/modules/corners.js +12 -0
- package/dist/component/modules/corners.js.map +1 -0
- package/dist/component/modules/flow.d.ts +26 -0
- package/dist/component/modules/flow.d.ts.map +1 -0
- package/dist/component/modules/flow.js +55 -0
- package/dist/component/modules/flow.js.map +1 -0
- package/dist/component/modules/material.d.ts +40 -0
- package/dist/component/modules/material.d.ts.map +1 -0
- package/dist/component/modules/material.js +75 -0
- package/dist/component/modules/material.js.map +1 -0
- package/dist/component/modules/paint.d.ts +71 -0
- package/dist/component/modules/paint.d.ts.map +1 -0
- package/dist/component/modules/paint.js +106 -0
- package/dist/component/modules/paint.js.map +1 -0
- package/dist/component/modules/shapes.d.ts +31 -0
- package/dist/component/modules/shapes.d.ts.map +1 -0
- package/dist/component/modules/shapes.js +43 -0
- package/dist/component/modules/shapes.js.map +1 -0
- package/dist/component/modules/text-layout.d.ts +26 -0
- package/dist/component/modules/text-layout.d.ts.map +1 -0
- package/dist/component/modules/text-layout.js +57 -0
- package/dist/component/modules/text-layout.js.map +1 -0
- package/dist/component/modules/text-style.d.ts +48 -0
- package/dist/component/modules/text-style.d.ts.map +1 -0
- package/dist/component/modules/text-style.js +63 -0
- package/dist/component/modules/text-style.js.map +1 -0
- package/dist/component/modules/three-entries.d.ts +23 -0
- package/dist/component/modules/three-entries.d.ts.map +1 -0
- package/dist/component/modules/three-entries.js +41 -0
- package/dist/component/modules/three-entries.js.map +1 -0
- package/dist/component/modules/view3d.d.ts +55 -0
- package/dist/component/modules/view3d.d.ts.map +1 -0
- package/dist/component/modules/view3d.js +160 -0
- package/dist/component/modules/view3d.js.map +1 -0
- package/dist/component/timeline.d.ts +22 -0
- package/dist/component/timeline.d.ts.map +1 -0
- package/dist/component/timeline.js +128 -0
- package/dist/component/timeline.js.map +1 -0
- package/dist/component/type-def.d.ts +26 -0
- package/dist/component/type-def.d.ts.map +1 -0
- package/dist/component/type-def.js +16 -0
- package/dist/component/type-def.js.map +1 -0
- package/dist/component/types.d.ts +91 -0
- package/dist/component/types.d.ts.map +1 -0
- package/dist/component/types.js +88 -0
- package/dist/component/types.js.map +1 -0
- package/dist/component/views.d.ts +121 -0
- package/dist/component/views.d.ts.map +1 -0
- package/dist/component/views.js +413 -0
- package/dist/component/views.js.map +1 -0
- package/dist/component.d.ts +10 -19
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +10 -19
- 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/audio.d.ts +9 -1
- package/dist/document/audio.d.ts.map +1 -1
- package/dist/document/audio.js +41 -0
- package/dist/document/audio.js.map +1 -1
- package/dist/document/builtins.d.ts.map +1 -1
- package/dist/document/builtins.js +13 -31
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +2 -2
- package/dist/document/command-traits.js +4 -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/diff.d.ts.map +1 -1
- package/dist/document/diff.js +3 -3
- package/dist/document/diff.js.map +1 -1
- package/dist/document/doc-index.d.ts.map +1 -1
- package/dist/document/doc-index.js +3 -3
- package/dist/document/doc-index.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 +9 -3
- package/dist/document/node-descriptor.d.ts.map +1 -1
- package/dist/document/node-descriptor.js.map +1 -1
- package/dist/document/placement.js +2 -2
- package/dist/document/placement.js.map +1 -1
- package/dist/document/registry.d.ts +29 -36
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +29 -35
- package/dist/document/registry.js.map +1 -1
- package/dist/document/settled-index.d.ts +49 -0
- package/dist/document/settled-index.d.ts.map +1 -0
- package/dist/document/settled-index.js +247 -0
- package/dist/document/settled-index.js.map +1 -0
- package/dist/document/timeline.d.ts +29 -3
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +99 -3
- 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 +22 -0
- package/dist/experimental.d.ts.map +1 -0
- package/dist/experimental.js +20 -0
- package/dist/experimental.js.map +1 -0
- package/dist/index.d.ts +10 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -2
- 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/nodes/audio/index.d.ts +2 -2
- package/dist/nodes/audio/index.d.ts.map +1 -1
- package/dist/nodes/audio/index.js +0 -2
- package/dist/nodes/audio/index.js.map +1 -1
- package/dist/nodes/audio/sound-node.d.ts +2 -1
- package/dist/nodes/audio/sound-node.d.ts.map +1 -1
- package/dist/nodes/audio/sound-node.js +3 -0
- package/dist/nodes/audio/sound-node.js.map +1 -1
- package/dist/nodes/index.d.ts +39 -27
- package/dist/nodes/index.d.ts.map +1 -1
- package/dist/nodes/index.js +16 -30
- package/dist/nodes/index.js.map +1 -1
- package/dist/nodes/node/node.d.ts +7 -1
- package/dist/nodes/node/node.d.ts.map +1 -1
- package/dist/nodes/node/node.js +23 -8
- package/dist/nodes/node/node.js.map +1 -1
- package/dist/nodes/root/canvas2d-node.d.ts +2 -1
- package/dist/nodes/root/canvas2d-node.d.ts.map +1 -1
- package/dist/nodes/root/canvas2d-node.js +3 -0
- package/dist/nodes/root/canvas2d-node.js.map +1 -1
- package/dist/nodes/text/richtext-node.d.ts +0 -5
- package/dist/nodes/text/richtext-node.d.ts.map +1 -1
- package/dist/nodes/text/richtext-node.js +5 -71
- package/dist/nodes/text/richtext-node.js.map +1 -1
- package/dist/nodes/text/text-base.d.ts +5 -22
- package/dist/nodes/text/text-base.d.ts.map +1 -1
- package/dist/nodes/text/text-base.js +12 -363
- package/dist/nodes/text/text-base.js.map +1 -1
- package/dist/nodes/text/text-layout.d.ts +87 -0
- package/dist/nodes/text/text-layout.d.ts.map +1 -0
- package/dist/nodes/text/text-layout.js +368 -0
- package/dist/nodes/text/text-layout.js.map +1 -0
- package/dist/nodes/three/canvas3d-node.d.ts +3 -1
- package/dist/nodes/three/canvas3d-node.d.ts.map +1 -1
- package/dist/nodes/three/canvas3d-node.js +6 -0
- package/dist/nodes/three/canvas3d-node.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 +7 -4
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +21 -7
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +11 -3
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +83 -23
- 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 +9 -10
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +12 -5
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +6 -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 +6 -3
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +46 -21
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +47 -43
- 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 +13 -1
- package/dist/tween/command.d.ts.map +1 -1
- package/dist/tween/command.js +14 -0
- 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 +7 -10
- package/dist/browser/chunks/chunk-FUZVFT3W.js +0 -18
- package/dist/browser/chunks/chunk-FUZVFT3W.js.map +0 -7
- package/dist/browser/chunks/chunk-QG6C23IJ.js +0 -3
- package/dist/browser/chunks/chunk-QG6C23IJ.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/jsx-jsx-dev-runtime.js +0 -2
- package/dist/browser/jsx-jsx-runtime.js +0 -2
- package/dist/browser/jsx-jsx-runtime.js.map +0 -7
- /package/dist/browser/{jsx-jsx-dev-runtime.js.map → experimental.js.map} +0 -0
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import { NullRenderContext } from "../render/null-render-context.js";
|
|
2
|
+
import { Graphics2D as GraphicsClass } from "../render/graphics2d.js";
|
|
3
|
+
import { frameIn, Node2D as Node2DClass } from "../nodes/2d/node2d.js";
|
|
4
|
+
import { Node3D } from "../nodes/three/node3d.js";
|
|
5
|
+
import { Scene3D } from "../render3d/scene3d.js";
|
|
6
|
+
import { clipOf } from "../component/clip-of.js";
|
|
7
|
+
/** The node a view stands for: how the engine's own modules (`Paint`, `Flow`) reach past the public surface. */
|
|
8
|
+
export const NODE = Symbol("componentNode");
|
|
9
|
+
let pass = null;
|
|
10
|
+
export function withPass(node, scope, room, run) {
|
|
11
|
+
const outer = pass;
|
|
12
|
+
pass = { node, scope, room, sizes: new Map() };
|
|
13
|
+
try {
|
|
14
|
+
return run();
|
|
15
|
+
}
|
|
16
|
+
finally {
|
|
17
|
+
pass = outer;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const decided = new WeakSet();
|
|
21
|
+
/** An engine module sized this node itself in this measure: its factory reports the size as it stands. */
|
|
22
|
+
export function markDecided(node) {
|
|
23
|
+
decided.add(node);
|
|
24
|
+
}
|
|
25
|
+
export function takeDecided(node) {
|
|
26
|
+
return decided.delete(node);
|
|
27
|
+
}
|
|
28
|
+
export function currentPass() {
|
|
29
|
+
if (!pass)
|
|
30
|
+
throw new Error("A component's measure or layout helper ran outside a measure or layout pass.");
|
|
31
|
+
return pass;
|
|
32
|
+
}
|
|
33
|
+
function measureChild(node, max) {
|
|
34
|
+
const p = currentPass();
|
|
35
|
+
const constraints = { maxWidth: max.width, maxHeight: max.height };
|
|
36
|
+
const measured = node.measure(constraints, p.scope);
|
|
37
|
+
const size = { width: measured.width ?? 0, height: measured.height ?? 0 };
|
|
38
|
+
p.sizes.set(node, size);
|
|
39
|
+
return size;
|
|
40
|
+
}
|
|
41
|
+
// ---- child views ------------------------------------------------------------
|
|
42
|
+
const childViews = new WeakMap();
|
|
43
|
+
/** A child as its parent's fields see it. One per child node, reused every frame. */
|
|
44
|
+
class ChildViewImpl {
|
|
45
|
+
[NODE];
|
|
46
|
+
state;
|
|
47
|
+
constructor(node) {
|
|
48
|
+
this[NODE] = node;
|
|
49
|
+
// The node's own accessors are its resolved values; a proxy keeps a parent from writing through them.
|
|
50
|
+
this.state = new Proxy(node, {
|
|
51
|
+
set: () => { throw new TypeError("A child's state is read-only to its parent; animate it with a command."); },
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
get id() { return this[NODE].id; }
|
|
55
|
+
get key() { return (keyOf(this[NODE]) ?? this[NODE].className); }
|
|
56
|
+
get size() {
|
|
57
|
+
// Outside a pass (a command being built), the size it was last laid out at, as a command's own node reports.
|
|
58
|
+
if (!pass) {
|
|
59
|
+
const box = this[NODE].layoutBounds;
|
|
60
|
+
return { width: box?.width ?? 0, height: box?.height ?? 0 };
|
|
61
|
+
}
|
|
62
|
+
return pass.sizes.get(this[NODE]) ?? measureChild(this[NODE], pass.room);
|
|
63
|
+
}
|
|
64
|
+
get children() {
|
|
65
|
+
const node = this[NODE];
|
|
66
|
+
return node._commandChildren ? node._commandChildren() : node.children.map(childView);
|
|
67
|
+
}
|
|
68
|
+
measure(max) {
|
|
69
|
+
return measureChild(this[NODE], max);
|
|
70
|
+
}
|
|
71
|
+
to(targets) {
|
|
72
|
+
return { _piece: { kind: "child", node: this[NODE], targets: targets } };
|
|
73
|
+
}
|
|
74
|
+
run(name, args) {
|
|
75
|
+
return { _piece: { kind: "run", node: this[NODE], name, args } };
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export function childView(node) {
|
|
79
|
+
let view = childViews.get(node);
|
|
80
|
+
if (!view)
|
|
81
|
+
childViews.set(node, view = new ChildViewImpl(node));
|
|
82
|
+
return view;
|
|
83
|
+
}
|
|
84
|
+
export function nodeOfView(view) {
|
|
85
|
+
return view[NODE];
|
|
86
|
+
}
|
|
87
|
+
const nodeViews = new WeakMap();
|
|
88
|
+
const NO_FRAME = { x: 0, y: 0, rotation: 0, scale: 1 };
|
|
89
|
+
/** A node outside a component's own children (an ancestor, a referenced node), as one reader's fields read it. */
|
|
90
|
+
class NodeViewImpl {
|
|
91
|
+
reader;
|
|
92
|
+
[NODE];
|
|
93
|
+
state;
|
|
94
|
+
constructor(node, reader) {
|
|
95
|
+
this.reader = reader;
|
|
96
|
+
this[NODE] = node;
|
|
97
|
+
// A component's state as its own fields read it: a reference of its own is a view from where it stands.
|
|
98
|
+
// Anything else it has (a 2D node's cardinal points) reads off the node.
|
|
99
|
+
const fields = node._view ?? node;
|
|
100
|
+
this.state = new Proxy(fields, {
|
|
101
|
+
get: (target, key) => {
|
|
102
|
+
// Its constructor is the node's: what a host asks to tell what kind of node it reads.
|
|
103
|
+
if (key === "constructor")
|
|
104
|
+
return node.constructor;
|
|
105
|
+
if (key in target)
|
|
106
|
+
return Reflect.get(target, key);
|
|
107
|
+
const value = Reflect.get(node, key);
|
|
108
|
+
// A method of the node runs on the node, not on this read-only view.
|
|
109
|
+
return typeof value === "function" ? value.bind(node) : value;
|
|
110
|
+
},
|
|
111
|
+
set: () => { throw new TypeError("Another node's state is read-only to a component; animate it with a command."); },
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
get id() { return this[NODE].id; }
|
|
115
|
+
get key() { return (keyOf(this[NODE]) ?? this[NODE].className); }
|
|
116
|
+
get size() {
|
|
117
|
+
const node = this[NODE];
|
|
118
|
+
const box = node instanceof Node2DClass ? node.layoutBounds : undefined;
|
|
119
|
+
return { width: box?.width ?? 0, height: box?.height ?? 0 };
|
|
120
|
+
}
|
|
121
|
+
get frame() {
|
|
122
|
+
const node = this[NODE];
|
|
123
|
+
return node instanceof Node2DClass && this.reader instanceof Node2DClass ? frameIn(this.reader, node) : NO_FRAME;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/** `node` as `reader` sees it. One view per pair. */
|
|
127
|
+
export function nodeView(node, reader) {
|
|
128
|
+
let byReader = nodeViews.get(node);
|
|
129
|
+
if (!byReader)
|
|
130
|
+
nodeViews.set(node, byReader = new WeakMap());
|
|
131
|
+
let view = byReader.get(reader);
|
|
132
|
+
if (!view)
|
|
133
|
+
byReader.set(reader, view = new NodeViewImpl(node, reader));
|
|
134
|
+
return view;
|
|
135
|
+
}
|
|
136
|
+
export function nodeOfNodeView(view) {
|
|
137
|
+
return view[NODE];
|
|
138
|
+
}
|
|
139
|
+
const found = new WeakMap();
|
|
140
|
+
/** The node with `id` in `reader`'s scene, as `reader` sees it, or `null`. Remembered per reader while it stays in the scene. */
|
|
141
|
+
export function referenced(reader, id) {
|
|
142
|
+
if (typeof id !== "string" || id === "")
|
|
143
|
+
return null;
|
|
144
|
+
let known = found.get(reader);
|
|
145
|
+
let node = known?.get(id);
|
|
146
|
+
if (!node || node.id !== id || rootOf(node) !== rootOf(reader)) {
|
|
147
|
+
node = findIn(rootOf(reader), id) ?? undefined;
|
|
148
|
+
if (!node) {
|
|
149
|
+
known?.delete(id);
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
if (!known)
|
|
153
|
+
found.set(reader, known = new Map());
|
|
154
|
+
known.set(id, node);
|
|
155
|
+
}
|
|
156
|
+
return nodeView(node, reader);
|
|
157
|
+
}
|
|
158
|
+
function rootOf(node) {
|
|
159
|
+
let at = node;
|
|
160
|
+
while (at.parent)
|
|
161
|
+
at = at.parent;
|
|
162
|
+
return at;
|
|
163
|
+
}
|
|
164
|
+
function findIn(at, id) {
|
|
165
|
+
if (at.id === id)
|
|
166
|
+
return at;
|
|
167
|
+
for (const child of at._allChildren) {
|
|
168
|
+
const hit = findIn(child, id);
|
|
169
|
+
if (hit)
|
|
170
|
+
return hit;
|
|
171
|
+
}
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
let keyOf = () => undefined;
|
|
175
|
+
/** Set by the factory module, which owns the node descriptors. */
|
|
176
|
+
export function setKeyLookup(lookup) {
|
|
177
|
+
keyOf = lookup;
|
|
178
|
+
}
|
|
179
|
+
export function stateViewPrototype(keys, references = new Set()) {
|
|
180
|
+
const entries = {};
|
|
181
|
+
for (const key of keys) {
|
|
182
|
+
entries[key] = references.has(key)
|
|
183
|
+
? { get() { return referenced(this[NODE], this[NODE][key]); }, enumerable: true }
|
|
184
|
+
: { get() { return this[NODE][key]; }, enumerable: true };
|
|
185
|
+
}
|
|
186
|
+
const proto = {};
|
|
187
|
+
// The children of the node's own tree, as its commands see them too.
|
|
188
|
+
Object.defineProperty(proto, "children", {
|
|
189
|
+
get() { return this[NODE]._commandChildren(); },
|
|
190
|
+
enumerable: false,
|
|
191
|
+
});
|
|
192
|
+
return { proto, entries };
|
|
193
|
+
}
|
|
194
|
+
export function stateView(shape, node) {
|
|
195
|
+
const view = Object.create(shape.proto);
|
|
196
|
+
Object.defineProperties(view, shape.entries);
|
|
197
|
+
view[NODE] = node;
|
|
198
|
+
return view;
|
|
199
|
+
}
|
|
200
|
+
/** A command's `state`: where it starts, so a frame function reading it never sees its own writes. */
|
|
201
|
+
export function snapshot(view) {
|
|
202
|
+
const out = {};
|
|
203
|
+
for (const key in view)
|
|
204
|
+
out[key] = view[key];
|
|
205
|
+
return out;
|
|
206
|
+
}
|
|
207
|
+
// ---- measurer and render context --------------------------------------------
|
|
208
|
+
export class MeasurerImpl {
|
|
209
|
+
host;
|
|
210
|
+
max = {};
|
|
211
|
+
scope = null;
|
|
212
|
+
constructor(host) {
|
|
213
|
+
this.host = host;
|
|
214
|
+
}
|
|
215
|
+
get time() {
|
|
216
|
+
return this.host.time;
|
|
217
|
+
}
|
|
218
|
+
text(text, font) {
|
|
219
|
+
if (!this.scope)
|
|
220
|
+
throw new Error("measurer.text was called outside measure.");
|
|
221
|
+
return this.scope.measureText(text, font.fontSize, font.fontFamily, font.fontWeight, font.letterSpacing);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
/** Reused every frame: `pass` and `cut` are rewritten before each render. */
|
|
225
|
+
export class RenderContextImpl {
|
|
226
|
+
host;
|
|
227
|
+
probing;
|
|
228
|
+
pass = null;
|
|
229
|
+
/** The near-plane cut a 2.5D space puts in front of this node's own paint. */
|
|
230
|
+
cut = null;
|
|
231
|
+
/**
|
|
232
|
+
* `probing`: `render` runs only to find the shape it paints (for clip and
|
|
233
|
+
* picking outside a frame), so nothing is drawn and no child is visited.
|
|
234
|
+
*/
|
|
235
|
+
constructor(host, probing = false) {
|
|
236
|
+
this.host = host;
|
|
237
|
+
this.probing = probing;
|
|
238
|
+
}
|
|
239
|
+
get size() {
|
|
240
|
+
const box = this.host.layoutBounds;
|
|
241
|
+
return { width: box?.width ?? 0, height: box?.height ?? 0 };
|
|
242
|
+
}
|
|
243
|
+
get time() {
|
|
244
|
+
return this.host.time;
|
|
245
|
+
}
|
|
246
|
+
draw(graphics) {
|
|
247
|
+
if (!graphics || this.probing)
|
|
248
|
+
return;
|
|
249
|
+
const out = this.target();
|
|
250
|
+
if (Array.isArray(graphics))
|
|
251
|
+
for (const g of graphics)
|
|
252
|
+
out.draw(g);
|
|
253
|
+
else
|
|
254
|
+
out.draw(graphics);
|
|
255
|
+
}
|
|
256
|
+
children() {
|
|
257
|
+
if (this.probing)
|
|
258
|
+
return;
|
|
259
|
+
// Drawn plainly, so a space or composite the last frame declared no longer holds for them.
|
|
260
|
+
if (!this.composite)
|
|
261
|
+
this.host._record = null;
|
|
262
|
+
this.host._renderOwnChildren(this.target());
|
|
263
|
+
}
|
|
264
|
+
/** What this render has declared so far. Its host's record follows at once, so the children it draws see it. */
|
|
265
|
+
composite = null;
|
|
266
|
+
_declare(composite) {
|
|
267
|
+
this.composite = { ...this.composite, ...composite };
|
|
268
|
+
if (!this.probing)
|
|
269
|
+
this.host._record = this.composite;
|
|
270
|
+
}
|
|
271
|
+
mask(options) {
|
|
272
|
+
this._declare({ bounds: "first" });
|
|
273
|
+
if (this.probing)
|
|
274
|
+
return;
|
|
275
|
+
const out = this.target();
|
|
276
|
+
const [stencil, ...content] = this.host.children;
|
|
277
|
+
if (!stencil)
|
|
278
|
+
return;
|
|
279
|
+
if (content.length === 0) {
|
|
280
|
+
stencil.render(out);
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
out.beginMask({ mode: options.mode, inverted: options.inverted });
|
|
284
|
+
stencil.render(out);
|
|
285
|
+
out.applyMask();
|
|
286
|
+
for (const child of content)
|
|
287
|
+
child.render(out);
|
|
288
|
+
out.endMask();
|
|
289
|
+
}
|
|
290
|
+
merge(op, paint) {
|
|
291
|
+
this._declare({ bounds: op === "subtract" ? "first" : op === "intersect" ? "intersect" : "union" });
|
|
292
|
+
if (this.probing)
|
|
293
|
+
return;
|
|
294
|
+
const out = this.target();
|
|
295
|
+
out.beginBoolean(op);
|
|
296
|
+
for (const child of this.host._allChildren)
|
|
297
|
+
if (child instanceof Node2DClass)
|
|
298
|
+
child.render(out);
|
|
299
|
+
out.endBoolean();
|
|
300
|
+
// A drawing with no shape of its own paints the merged outline.
|
|
301
|
+
out.draw(new GraphicsClass().shadow(paint.shadow).fill(paint.fill));
|
|
302
|
+
if (paint.overlay && paint.overlay.length > 0)
|
|
303
|
+
out.draw(new GraphicsClass().fill(paint.overlay));
|
|
304
|
+
out.draw(new GraphicsClass().stroke(paint.stroke));
|
|
305
|
+
}
|
|
306
|
+
/** Your children, through a camera viewing your box: aimed at `lookAt`, zoomed, turned by `heading`. */
|
|
307
|
+
camera(scope) {
|
|
308
|
+
this._declare({ camera: scope });
|
|
309
|
+
if (this.probing)
|
|
310
|
+
return;
|
|
311
|
+
const out = this.target();
|
|
312
|
+
const rect = this.host.layoutBounds;
|
|
313
|
+
out.beginCamera({ x: rect?.x ?? 0, y: -(rect?.y ?? 0), width: rect?.width ?? 0, height: rect?.height ?? 0 }, scope.lookAt, scope.zoom, scope.heading);
|
|
314
|
+
for (const child of this.host._allChildren)
|
|
315
|
+
if (child instanceof Node2DClass)
|
|
316
|
+
child.render(out);
|
|
317
|
+
out.endCamera();
|
|
318
|
+
}
|
|
319
|
+
/** Your 3D children, rendered in order into a new scene. */
|
|
320
|
+
scene3D() {
|
|
321
|
+
const scene = new Scene3D();
|
|
322
|
+
for (const child of this.host._allChildren)
|
|
323
|
+
if (child instanceof Node3D)
|
|
324
|
+
child.render(scene);
|
|
325
|
+
this._declare({ scene });
|
|
326
|
+
return scene;
|
|
327
|
+
}
|
|
328
|
+
/** Your children, standing in one 2.5D space seen by `camera`, drawn far to near. */
|
|
329
|
+
space(camera) {
|
|
330
|
+
this._declare({ space: camera });
|
|
331
|
+
if (!this.probing)
|
|
332
|
+
this.host._renderOwnChildren(this.target());
|
|
333
|
+
}
|
|
334
|
+
textStyle(style, body) {
|
|
335
|
+
if (this.probing)
|
|
336
|
+
return body();
|
|
337
|
+
const out = this.target();
|
|
338
|
+
out.pushTextStyle(style);
|
|
339
|
+
try {
|
|
340
|
+
body();
|
|
341
|
+
}
|
|
342
|
+
finally {
|
|
343
|
+
out.popTextStyle();
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
clip(shape, body) {
|
|
347
|
+
if (this.probing)
|
|
348
|
+
return body();
|
|
349
|
+
const outline = clipOf(shape);
|
|
350
|
+
// No outline is no clip, as a node with no `clipSelf` confines nothing.
|
|
351
|
+
if (outline.isEmpty())
|
|
352
|
+
return body();
|
|
353
|
+
const out = this.target();
|
|
354
|
+
out.beginClip(outline);
|
|
355
|
+
try {
|
|
356
|
+
body();
|
|
357
|
+
}
|
|
358
|
+
finally {
|
|
359
|
+
out.endClip();
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
/** An ancestor stands this node in a space: one opens it, and nothing between them flattens. */
|
|
363
|
+
get inSpace() {
|
|
364
|
+
for (let at = this.host.parent; at; at = at.parent) {
|
|
365
|
+
if (!(at instanceof Node2DClass))
|
|
366
|
+
return false;
|
|
367
|
+
if (at._spaceCamera())
|
|
368
|
+
return true;
|
|
369
|
+
if (!at._rendersChildrenInSpace())
|
|
370
|
+
return false;
|
|
371
|
+
}
|
|
372
|
+
return false;
|
|
373
|
+
}
|
|
374
|
+
ancestor(component) {
|
|
375
|
+
for (let at = this.host.parent; at; at = at.parent) {
|
|
376
|
+
if (at instanceof component.node)
|
|
377
|
+
return nodeView(at, this.host);
|
|
378
|
+
}
|
|
379
|
+
return null;
|
|
380
|
+
}
|
|
381
|
+
/** Paint `body` in front of the space's near plane, as `Node2D` does for its own paint. */
|
|
382
|
+
inFront(body) {
|
|
383
|
+
if (this.probing)
|
|
384
|
+
return;
|
|
385
|
+
const out = this.target();
|
|
386
|
+
if (!this.cut) {
|
|
387
|
+
body();
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
out.beginClip(this.cut);
|
|
391
|
+
try {
|
|
392
|
+
body();
|
|
393
|
+
}
|
|
394
|
+
finally {
|
|
395
|
+
out.endClip();
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
target() {
|
|
399
|
+
if (this.probing)
|
|
400
|
+
return PROBE_PASS;
|
|
401
|
+
if (!this.pass)
|
|
402
|
+
throw new Error("A component's render context was used outside render.");
|
|
403
|
+
return this.pass;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
/** Where a probe's scoped calls (a clip, a camera) land: a pass that draws nothing. */
|
|
407
|
+
const PROBE_PASS = new NullRenderContext();
|
|
408
|
+
export function internalsOf(ctx) {
|
|
409
|
+
if (!(ctx instanceof RenderContextImpl))
|
|
410
|
+
throw new TypeError("Paint.draw takes the render context its render field was given.");
|
|
411
|
+
return ctx;
|
|
412
|
+
}
|
|
413
|
+
//# sourceMappingURL=views.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"views.js","sourceRoot":"","sources":["../../src/component/views.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE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,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,IAAI,CAAC;YACD,IAAI,EAAE,CAAC;QACX,CAAC;gBAAS,CAAC;YACP,GAAG,CAAC,OAAO,EAAE,CAAC;QAClB,CAAC;IACL,CAAC;IAED,MAAM;QACF,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO,UAAU,CAAC;QACpC,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;QACzF,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;CACJ;AAED,uFAAuF;AACvF,MAAM,UAAU,GAAiB,IAAI,iBAAiB,EAAE,CAAC;AAEzD,MAAM,UAAU,WAAW,CAAC,GAAoB;IAC5C,IAAI,CAAC,CAAC,GAAG,YAAY,iBAAiB,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,iEAAiE,CAAC,CAAC;IAChI,OAAO,GAAG,CAAC;AACf,CAAC","sourcesContent":["import type { Size2D } from \"@/attributes/layout/size\";\r\nimport type { SizeConstraints } from \"@/layout/constraints\";\r\nimport type { Node2D, CameraScope } from \"@/nodes/2d/node2d\";\r\nimport type { Node } from \"@/nodes/node/node\";\r\nimport type { Graphics2D } from \"@/render/graphics2d\";\r\nimport type { MeasureContext2D } from \"@/render/measure-context\";\r\nimport type { RenderPass2D } from \"@/render/render-context2d\";\r\nimport type { Clip } from \"@/render/clip\";\r\nimport { NullRenderContext } from \"@/render/null-render-context\";\r\nimport { Graphics2D as GraphicsClass } from \"@/render/graphics2d\";\r\nimport { frameIn, Node2D as Node2DClass } from \"@/nodes/2d/node2d\";\r\nimport { Node3D } from \"@/nodes/three/node3d\";\r\nimport { Scene3D } from \"@/render3d/scene3d\";\r\nimport type { BooleanOperation } from \"@/attributes/mask/boolean\";\r\nimport type { MaskOptions } from \"@/attributes/mask/mask\";\r\nimport type { ChildBoundsMode } from \"@/nodes/geometry/group-bounds\";\r\nimport type { SpaceCamera } from \"@/attributes/layout/space3d\";\r\nimport type { TextStyle } from \"@/attributes/text/types\";\r\nimport type { MergePaint, ChildView, Clock, Component, Element, FontSpec, Max, Measurer, NodeFrame, NodeView, Piece, RenderContext2D } from \"@/component/api\";\r\nimport { clipOf } from \"@/component/clip-of\";\r\n\r\n/**\r\n * What a render did with its children beyond drawing them: composited them\r\n * (the ink bounds that leaves), looked at them through a camera, or stood them\r\n * in a 2.5D space. Picking and the space machinery read it between frames.\r\n */\r\nexport interface Composite {\r\n readonly bounds?: ChildBoundsMode;\r\n readonly camera?: CameraScope;\r\n readonly space?: SpaceCamera;\r\n /** The scene its 3D children were rendered into: what picking projects through. */\r\n readonly scene?: Scene3D;\r\n}\r\n\r\n/** The node a view stands for: how the engine's own modules (`Paint`, `Flow`) reach past the public surface. */\r\nexport const NODE = Symbol(\"componentNode\");\r\n\r\n/** What a generated node exposes to its views and modules. Never part of the authoring surface. */\r\nexport interface ComponentHost extends Node2D {\r\n _renderOwnChildren(pass: RenderPass2D): void;\r\n _animate(frame: (t: number) => Record<string, unknown>, duration: number, easing: unknown): unknown;\r\n _lastShape: Graphics2D | null;\r\n /** The composite its last render or probe declared; `undefined` before either. */\r\n _record: Composite | null | undefined;\r\n}\r\n\r\n// ---- the pass in progress -------------------------------------------------\r\n\r\n/**\r\n * Measure and layout run synchronously, one node at a time, so the node being\r\n * laid out and its measurer are a single slot rather than state on every view.\r\n */\r\ninterface Pass {\r\n readonly node: Node2D;\r\n readonly scope: MeasureContext2D;\r\n readonly room: Max;\r\n readonly sizes: Map<Node2D, Size2D>;\r\n}\r\n\r\nlet pass: Pass | null = null;\r\n\r\nexport function withPass<T>(node: Node2D, scope: MeasureContext2D, room: Max, run: () => T): T {\r\n const outer = pass;\r\n pass = { node, scope, room, sizes: new Map() };\r\n try {\r\n return run();\r\n } finally {\r\n pass = outer;\r\n }\r\n}\r\n\r\nconst decided = new WeakSet<Node2D>();\r\n\r\n/** An engine module sized this node itself in this measure: its factory reports the size as it stands. */\r\nexport function markDecided(node: Node2D): void {\r\n decided.add(node);\r\n}\r\n\r\nexport function takeDecided(node: Node2D): boolean {\r\n return decided.delete(node);\r\n}\r\n\r\nexport function currentPass(): Pass {\r\n if (!pass) throw new Error(\"A component's measure or layout helper ran outside a measure or layout pass.\");\r\n return pass;\r\n}\r\n\r\nfunction measureChild(node: Node2D, max: Max): Size2D {\r\n const p = currentPass();\r\n const constraints: SizeConstraints = { maxWidth: max.width, maxHeight: max.height };\r\n const measured = node.measure(constraints, p.scope);\r\n const size = { width: measured.width ?? 0, height: measured.height ?? 0 };\r\n p.sizes.set(node, size);\r\n return size;\r\n}\r\n\r\n// ---- child views ------------------------------------------------------------\r\n\r\nconst childViews = new WeakMap<Node2D, ChildViewImpl>();\r\n\r\n/** A child as its parent's fields see it. One per child node, reused every frame. */\r\nclass ChildViewImpl implements ChildView {\r\n readonly [NODE]: Node2D;\r\n readonly state: never;\r\n\r\n constructor(node: Node2D) {\r\n this[NODE] = node;\r\n // The node's own accessors are its resolved values; a proxy keeps a parent from writing through them.\r\n this.state = new Proxy(node, {\r\n set: () => { throw new TypeError(\"A child's state is read-only to its parent; animate it with a command.\"); },\r\n }) as never;\r\n }\r\n\r\n get id(): string { return this[NODE].id; }\r\n get key(): never { return (keyOf(this[NODE]) ?? this[NODE].className) as never; }\r\n\r\n get size(): Size2D {\r\n // Outside a pass (a command being built), the size it was last laid out at, as a command's own node reports.\r\n if (!pass) {\r\n const box = this[NODE].layoutBounds;\r\n return { width: box?.width ?? 0, height: box?.height ?? 0 };\r\n }\r\n return pass.sizes.get(this[NODE]) ?? measureChild(this[NODE], pass.room);\r\n }\r\n\r\n get children(): readonly ChildView[] {\r\n const node = this[NODE] as Node2D & { _commandChildren?(): readonly ChildView[] };\r\n return node._commandChildren ? node._commandChildren() : node.children.map(childView);\r\n }\r\n\r\n measure(max: Max): Size2D {\r\n return measureChild(this[NODE], max);\r\n }\r\n\r\n to(targets: object): Piece {\r\n return { _piece: { kind: \"child\", node: this[NODE], targets: targets as Record<string, unknown> } };\r\n }\r\n\r\n run(name: string, args?: object): Piece {\r\n return { _piece: { kind: \"run\", node: this[NODE], name, args } };\r\n }\r\n}\r\n\r\nexport function childView(node: Node2D | Node): ChildView {\r\n let view = childViews.get(node as Node2D);\r\n if (!view) childViews.set(node as Node2D, view = new ChildViewImpl(node as Node2D));\r\n return view as unknown as ChildView;\r\n}\r\n\r\nexport function nodeOfView(view: ChildView<any>): Node2D {\r\n return (view as unknown as ChildViewImpl)[NODE];\r\n}\r\n\r\nconst nodeViews = new WeakMap<Node, WeakMap<Node, NodeViewImpl>>();\r\n\r\nconst NO_FRAME: NodeFrame = { x: 0, y: 0, rotation: 0, scale: 1 };\r\n\r\n/** A node outside a component's own children (an ancestor, a referenced node), as one reader's fields read it. */\r\nclass NodeViewImpl implements NodeView {\r\n readonly [NODE]: Node;\r\n readonly state: never;\r\n\r\n constructor(node: Node, readonly reader: Node) {\r\n this[NODE] = node;\r\n // A component's state as its own fields read it: a reference of its own is a view from where it stands.\r\n // Anything else it has (a 2D node's cardinal points) reads off the node.\r\n const fields = (node as { _view?: object })._view ?? node;\r\n this.state = new Proxy(fields, {\r\n get: (target, key) => {\r\n // Its constructor is the node's: what a host asks to tell what kind of node it reads.\r\n if (key === \"constructor\") return node.constructor;\r\n if (key in target) return Reflect.get(target, key);\r\n const value = Reflect.get(node, key) as unknown;\r\n // A method of the node runs on the node, not on this read-only view.\r\n return typeof value === \"function\" ? (value as (...args: unknown[]) => unknown).bind(node) : value;\r\n },\r\n set: () => { throw new TypeError(\"Another node's state is read-only to a component; animate it with a command.\"); },\r\n }) as never;\r\n }\r\n\r\n get id(): string { return this[NODE].id; }\r\n get key(): never { return (keyOf(this[NODE] as Node2D) ?? this[NODE].className) as never; }\r\n\r\n get size(): Size2D {\r\n const node = this[NODE];\r\n const box = node instanceof Node2DClass ? node.layoutBounds : undefined;\r\n return { width: box?.width ?? 0, height: box?.height ?? 0 };\r\n }\r\n\r\n get frame(): NodeFrame {\r\n const node = this[NODE];\r\n return node instanceof Node2DClass && this.reader instanceof Node2DClass ? frameIn(this.reader, node) : NO_FRAME;\r\n }\r\n}\r\n\r\n/** `node` as `reader` sees it. One view per pair. */\r\nexport function nodeView(node: Node, reader: Node): NodeView {\r\n let byReader = nodeViews.get(node);\r\n if (!byReader) nodeViews.set(node, byReader = new WeakMap());\r\n let view = byReader.get(reader);\r\n if (!view) byReader.set(reader, view = new NodeViewImpl(node, reader));\r\n return view;\r\n}\r\n\r\nexport function nodeOfNodeView(view: NodeView): Node {\r\n return (view as unknown as NodeViewImpl)[NODE];\r\n}\r\n\r\nconst found = new WeakMap<Node, Map<string, Node>>();\r\n\r\n/** The node with `id` in `reader`'s scene, as `reader` sees it, or `null`. Remembered per reader while it stays in the scene. */\r\nexport function referenced(reader: Node, id: unknown): NodeView | null {\r\n if (typeof id !== \"string\" || id === \"\") return null;\r\n let known = found.get(reader);\r\n let node = known?.get(id);\r\n if (!node || node.id !== id || rootOf(node) !== rootOf(reader)) {\r\n node = findIn(rootOf(reader), id) ?? undefined;\r\n if (!node) {\r\n known?.delete(id);\r\n return null;\r\n }\r\n if (!known) found.set(reader, known = new Map());\r\n known.set(id, node);\r\n }\r\n return nodeView(node, reader);\r\n}\r\n\r\nfunction rootOf(node: Node): Node {\r\n let at = node;\r\n while (at.parent) at = at.parent;\r\n return at;\r\n}\r\n\r\nfunction findIn(at: Node, id: string): Node | null {\r\n if (at.id === id) return at;\r\n for (const child of at._allChildren) {\r\n const hit = findIn(child, id);\r\n if (hit) return hit;\r\n }\r\n return null;\r\n}\r\n\r\nlet keyOf: (node: Node2D) => string | undefined = () => undefined;\r\n/** Set by the factory module, which owns the node descriptors. */\r\nexport function setKeyLookup(lookup: (node: Node2D) => string | undefined): void {\r\n keyOf = lookup;\r\n}\r\n\r\n// ---- state views ------------------------------------------------------------\r\n\r\n/**\r\n * One prototype of getters per component, so a node's `state` is a single\r\n * object made once: every read goes straight to the node's own slot, and a\r\n * frame allocates nothing to hand its fields their values.\r\n */\r\nexport interface ViewShape {\r\n readonly proto: object;\r\n /** Own, so `{ ...state }` copies every entry; the getters themselves are shared. */\r\n readonly entries: PropertyDescriptorMap;\r\n}\r\n\r\nexport function stateViewPrototype(keys: readonly string[], references: ReadonlySet<string> = new Set()): ViewShape {\r\n const entries: PropertyDescriptorMap = {};\r\n for (const key of keys) {\r\n entries[key] = references.has(key)\r\n ? { get(this: { [NODE]: Node }) { return referenced(this[NODE], (this[NODE] as unknown as Record<string, unknown>)[key]); }, enumerable: true }\r\n : { get(this: { [NODE]: object }) { return (this[NODE] as Record<string, unknown>)[key]; }, enumerable: true };\r\n }\r\n const proto = {};\r\n // The children of the node's own tree, as its commands see them too.\r\n Object.defineProperty(proto, \"children\", {\r\n get(this: { [NODE]: { _commandChildren(): readonly ChildView[] } }) { return this[NODE]._commandChildren(); },\r\n enumerable: false,\r\n });\r\n return { proto, entries };\r\n}\r\n\r\nexport function stateView(shape: ViewShape, node: object): object {\r\n const view = Object.create(shape.proto) as { [NODE]: object };\r\n Object.defineProperties(view, shape.entries);\r\n view[NODE] = node;\r\n return view;\r\n}\r\n\r\n/** A command's `state`: where it starts, so a frame function reading it never sees its own writes. */\r\nexport function snapshot(view: object): Record<string, unknown> {\r\n const out: Record<string, unknown> = {};\r\n for (const key in view) out[key] = (view as Record<string, unknown>)[key];\r\n return out;\r\n}\r\n\r\n// ---- measurer and render context --------------------------------------------\r\n\r\nexport class MeasurerImpl implements Measurer {\r\n max: Max = {};\r\n scope: MeasureContext2D | null = null;\r\n\r\n constructor(readonly host: Node) { }\r\n\r\n get time(): Clock {\r\n return this.host.time;\r\n }\r\n\r\n text(text: string, font: FontSpec): Size2D {\r\n if (!this.scope) throw new Error(\"measurer.text was called outside measure.\");\r\n return this.scope.measureText(text, font.fontSize, font.fontFamily, font.fontWeight, font.letterSpacing);\r\n }\r\n}\r\n\r\n/** Reused every frame: `pass` and `cut` are rewritten before each render. */\r\nexport class RenderContextImpl implements RenderContext2D {\r\n pass: RenderPass2D | null = null;\r\n /** The near-plane cut a 2.5D space puts in front of this node's own paint. */\r\n cut: Clip | null = null;\r\n\r\n /**\r\n * `probing`: `render` runs only to find the shape it paints (for clip and\r\n * picking outside a frame), so nothing is drawn and no child is visited.\r\n */\r\n constructor(readonly host: ComponentHost, readonly probing = false) { }\r\n\r\n get size(): Size2D {\r\n const box = this.host.layoutBounds;\r\n return { width: box?.width ?? 0, height: box?.height ?? 0 };\r\n }\r\n\r\n get time(): Clock {\r\n return this.host.time;\r\n }\r\n\r\n draw(graphics: Graphics2D | readonly Graphics2D[] | null | undefined): void {\r\n if (!graphics || this.probing) return;\r\n const out = this.target();\r\n if (Array.isArray(graphics)) for (const g of graphics) out.draw(g);\r\n else out.draw(graphics as Graphics2D);\r\n }\r\n\r\n children(): void {\r\n if (this.probing) return;\r\n // Drawn plainly, so a space or composite the last frame declared no longer holds for them.\r\n if (!this.composite) this.host._record = null;\r\n this.host._renderOwnChildren(this.target());\r\n }\r\n\r\n /** What this render has declared so far. Its host's record follows at once, so the children it draws see it. */\r\n composite: Composite | null = null;\r\n\r\n private _declare(composite: Composite): void {\r\n this.composite = { ...this.composite, ...composite };\r\n if (!this.probing) this.host._record = this.composite;\r\n }\r\n\r\n mask(options: MaskOptions): void {\r\n this._declare({ bounds: \"first\" });\r\n if (this.probing) return;\r\n const out = this.target();\r\n const [stencil, ...content] = this.host.children;\r\n if (!stencil) return;\r\n if (content.length === 0) {\r\n stencil.render(out);\r\n return;\r\n }\r\n out.beginMask({ mode: options.mode, inverted: options.inverted });\r\n stencil.render(out);\r\n out.applyMask();\r\n for (const child of content) child.render(out);\r\n out.endMask();\r\n }\r\n\r\n merge(op: BooleanOperation, paint: MergePaint): void {\r\n this._declare({ bounds: op === \"subtract\" ? \"first\" : op === \"intersect\" ? \"intersect\" : \"union\" });\r\n if (this.probing) return;\r\n const out = this.target();\r\n out.beginBoolean(op);\r\n for (const child of this.host._allChildren) if (child instanceof Node2DClass) child.render(out);\r\n out.endBoolean();\r\n // A drawing with no shape of its own paints the merged outline.\r\n out.draw(new GraphicsClass().shadow(paint.shadow).fill(paint.fill));\r\n if (paint.overlay && (paint.overlay as unknown[]).length > 0) out.draw(new GraphicsClass().fill(paint.overlay));\r\n out.draw(new GraphicsClass().stroke(paint.stroke));\r\n }\r\n\r\n /** Your children, through a camera viewing your box: aimed at `lookAt`, zoomed, turned by `heading`. */\r\n camera(scope: CameraScope): void {\r\n this._declare({ camera: scope });\r\n if (this.probing) return;\r\n const out = this.target();\r\n const rect = this.host.layoutBounds;\r\n out.beginCamera({ x: rect?.x ?? 0, y: -(rect?.y ?? 0), width: rect?.width ?? 0, height: rect?.height ?? 0 }, scope.lookAt, scope.zoom, scope.heading);\r\n for (const child of this.host._allChildren) if (child instanceof Node2DClass) child.render(out);\r\n out.endCamera();\r\n }\r\n\r\n /** Your 3D children, rendered in order into a new scene. */\r\n scene3D(): Scene3D {\r\n const scene = new Scene3D();\r\n for (const child of this.host._allChildren) if (child instanceof Node3D) child.render(scene);\r\n this._declare({ scene });\r\n return scene;\r\n }\r\n\r\n /** Your children, standing in one 2.5D space seen by `camera`, drawn far to near. */\r\n space(camera: SpaceCamera): void {\r\n this._declare({ space: camera });\r\n if (!this.probing) this.host._renderOwnChildren(this.target());\r\n }\r\n\r\n textStyle(style: TextStyle | null, body: () => void): void {\r\n if (this.probing) return body();\r\n const out = this.target();\r\n out.pushTextStyle(style);\r\n try {\r\n body();\r\n } finally {\r\n out.popTextStyle();\r\n }\r\n }\r\n\r\n clip(shape: Graphics2D, body: () => void): void {\r\n if (this.probing) return body();\r\n const outline = clipOf(shape);\r\n // No outline is no clip, as a node with no `clipSelf` confines nothing.\r\n if (outline.isEmpty()) return body();\r\n const out = this.target();\r\n out.beginClip(outline);\r\n try {\r\n body();\r\n } finally {\r\n out.endClip();\r\n }\r\n }\r\n\r\n /** An ancestor stands this node in a space: one opens it, and nothing between them flattens. */\r\n get inSpace(): boolean {\r\n for (let at = this.host.parent; at; at = at.parent) {\r\n if (!(at instanceof Node2DClass)) return false;\r\n if (at._spaceCamera()) return true;\r\n if (!at._rendersChildrenInSpace()) return false;\r\n }\r\n return false;\r\n }\r\n\r\n ancestor<K extends string, S, C>(component: Component<K, S, C, any, any, any>): NodeView<Element<K, S, C>> | null {\r\n for (let at = this.host.parent; at; at = at.parent) {\r\n if (at instanceof component.node) return nodeView(at, this.host) as unknown as NodeView<Element<K, S, C>>;\r\n }\r\n return null;\r\n }\r\n\r\n /** Paint `body` in front of the space's near plane, as `Node2D` does for its own paint. */\r\n inFront(body: () => void): void {\r\n if (this.probing) return;\r\n const out = this.target();\r\n if (!this.cut) {\r\n body();\r\n return;\r\n }\r\n out.beginClip(this.cut);\r\n try {\r\n body();\r\n } finally {\r\n out.endClip();\r\n }\r\n }\r\n\r\n target(): RenderPass2D {\r\n if (this.probing) return PROBE_PASS;\r\n if (!this.pass) throw new Error(\"A component's render context was used outside render.\");\r\n return this.pass;\r\n }\r\n}\r\n\r\n/** Where a probe's scoped calls (a clip, a camera) land: a pass that draws nothing. */\r\nconst PROBE_PASS: RenderPass2D = new NullRenderContext();\r\n\r\nexport function internalsOf(ctx: RenderContext2D): RenderContextImpl {\r\n if (!(ctx instanceof RenderContextImpl)) throw new TypeError(\"Paint.draw takes the render context its render field was given.\");\r\n return ctx;\r\n}\r\n"]}
|
package/dist/component.d.ts
CHANGED
|
@@ -1,28 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* What a **component package** built on this engine needs, and cannot supply
|
|
3
|
-
* itself
|
|
3
|
+
* itself: number formatting, the text a host falls back to, the named shape
|
|
4
|
+
* outlines and the orbit-camera lerps.
|
|
4
5
|
*
|
|
5
|
-
* A subpath rather than the main barrel
|
|
6
|
-
*
|
|
7
|
-
* machinery a `@motionscript/*` component uses to be a component — to
|
|
8
|
-
* choreograph an entrance that can be seeked, to declare the assets of paints
|
|
9
|
-
* it computes rather than stores, to ask what family a host's text falls back
|
|
10
|
-
* to. Putting it in the main barrel would offer three more names to everyone
|
|
11
|
-
* who wanted a `Rect`, and one of them (`hold`) already means something else
|
|
12
|
-
* there — audio automation has its own, and the collision is how this surface
|
|
13
|
-
* announced itself.
|
|
6
|
+
* A subpath rather than the main barrel because none of this is engine API: a
|
|
7
|
+
* scene author never reaches for it.
|
|
14
8
|
*
|
|
15
9
|
* This file is a **re-export barrel only** — everything it names lives beside
|
|
16
|
-
* whatever actually owns it (the
|
|
17
|
-
*
|
|
18
|
-
* rather than duplicated or reinvented here.
|
|
10
|
+
* whatever actually owns it (the number formatter beside the Number node, the
|
|
11
|
+
* orbit-camera lerps under `attributes/`) rather than duplicated here.
|
|
19
12
|
*/
|
|
20
|
-
export * from "./
|
|
21
|
-
export * from "./nodes/node/declare-paints.js";
|
|
22
|
-
export * from "./nodes/node/text-defaults.js";
|
|
13
|
+
export * from "./components/builtins/text/text-defaults.js";
|
|
23
14
|
export * from "./util/metrics.js";
|
|
24
|
-
export * from "./
|
|
25
|
-
export * from "./
|
|
15
|
+
export * from "./components/builtins/text/number-format.js";
|
|
16
|
+
export * from "./components/builtins/text/number-pattern.js";
|
|
26
17
|
export * from "./attributes/render3d/orbit.js";
|
|
27
|
-
export * from "./
|
|
18
|
+
export * from "./components/builtins/geometry/shape-outline.js";
|
|
28
19
|
//# sourceMappingURL=component.d.ts.map
|
package/dist/component.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,cAAc,0CAA0C,CAAA;AACxD,cAAc,gBAAgB,CAAA;AAC9B,cAAc,0CAA0C,CAAA;AACxD,cAAc,2CAA2C,CAAA;AACzD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,8CAA8C,CAAA"}
|
package/dist/component.js
CHANGED
|
@@ -1,28 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* What a **component package** built on this engine needs, and cannot supply
|
|
3
|
-
* itself
|
|
3
|
+
* itself: number formatting, the text a host falls back to, the named shape
|
|
4
|
+
* outlines and the orbit-camera lerps.
|
|
4
5
|
*
|
|
5
|
-
* A subpath rather than the main barrel
|
|
6
|
-
*
|
|
7
|
-
* machinery a `@motionscript/*` component uses to be a component — to
|
|
8
|
-
* choreograph an entrance that can be seeked, to declare the assets of paints
|
|
9
|
-
* it computes rather than stores, to ask what family a host's text falls back
|
|
10
|
-
* to. Putting it in the main barrel would offer three more names to everyone
|
|
11
|
-
* who wanted a `Rect`, and one of them (`hold`) already means something else
|
|
12
|
-
* there — audio automation has its own, and the collision is how this surface
|
|
13
|
-
* announced itself.
|
|
6
|
+
* A subpath rather than the main barrel because none of this is engine API: a
|
|
7
|
+
* scene author never reaches for it.
|
|
14
8
|
*
|
|
15
9
|
* This file is a **re-export barrel only** — everything it names lives beside
|
|
16
|
-
* whatever actually owns it (the
|
|
17
|
-
*
|
|
18
|
-
* rather than duplicated or reinvented here.
|
|
10
|
+
* whatever actually owns it (the number formatter beside the Number node, the
|
|
11
|
+
* orbit-camera lerps under `attributes/`) rather than duplicated here.
|
|
19
12
|
*/
|
|
20
|
-
export * from "./
|
|
21
|
-
export * from "./nodes/node/declare-paints.js";
|
|
22
|
-
export * from "./nodes/node/text-defaults.js";
|
|
13
|
+
export * from "./components/builtins/text/text-defaults.js";
|
|
23
14
|
export * from "./util/metrics.js";
|
|
24
|
-
export * from "./
|
|
25
|
-
export * from "./
|
|
15
|
+
export * from "./components/builtins/text/number-format.js";
|
|
16
|
+
export * from "./components/builtins/text/number-pattern.js";
|
|
26
17
|
export * from "./attributes/render3d/orbit.js";
|
|
27
|
-
export * from "./
|
|
18
|
+
export * from "./components/builtins/geometry/shape-outline.js";
|
|
28
19
|
//# sourceMappingURL=component.js.map
|
package/dist/component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,cAAc,0CAA0C,CAAA;AACxD,cAAc,gBAAgB,CAAA;AAC9B,cAAc,0CAA0C,CAAA;AACxD,cAAc,2CAA2C,CAAA;AACzD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,8CAA8C,CAAA","sourcesContent":["/**\r\n * What a **component package** built on this engine needs, and cannot supply\r\n * itself: number formatting, the text a host falls back to, the named shape\r\n * outlines and the orbit-camera lerps.\r\n *\r\n * A subpath rather than the main barrel because none of this is engine API: a\r\n * scene author never reaches for it.\r\n *\r\n * This file is a **re-export barrel only** — everything it names lives beside\r\n * whatever actually owns it (the number formatter beside the Number node, the\r\n * orbit-camera lerps under `attributes/`) rather than duplicated here.\r\n */\r\nexport * from \"@/components/builtins/text/text-defaults\"\r\nexport * from \"@/util/metrics\"\r\nexport * from \"@/components/builtins/text/number-format\"\r\nexport * from \"@/components/builtins/text/number-pattern\"\r\nexport * from \"@/attributes/render3d/orbit\"\r\nexport * from \"@/components/builtins/geometry/shape-outline\"\r\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { NodeOf } from "../../../components/factory/api.js";
|
|
2
|
+
import type { NodeAudioProps } from "../../../components/trees/audio/node-audio.js";
|
|
3
|
+
/** A clip from the catalog, playing into the buses it sits in. */
|
|
4
|
+
export declare const SoundNode: import("../../../components/factory/api.js").Component<"sound", import("../../../components/factory/api.js").Merge<import("../../../components/factory/api.js").BoxAudioState, {
|
|
5
|
+
readonly src: import("../../../components/factory/api.js").Type<string, string, false>;
|
|
6
|
+
readonly trimStart: 0;
|
|
7
|
+
readonly trimEnd: import("../../../components/factory/api.js").Type<number | undefined, number | undefined, false>;
|
|
8
|
+
readonly loop: false;
|
|
9
|
+
readonly speed: 1;
|
|
10
|
+
}>, {
|
|
11
|
+
readonly play: unknown;
|
|
12
|
+
}, readonly [], import("../../../components/trees/audio/node-audio.js").NodeAudio<NodeAudioProps>, import("../../../components/factory/api.js").TreeCallProps<import("../../../components/factory/api.js").Merge<import("../../../components/factory/api.js").BoxAudioState, {
|
|
13
|
+
readonly src: import("../../../components/factory/api.js").Type<string, string, false>;
|
|
14
|
+
readonly trimStart: 0;
|
|
15
|
+
readonly trimEnd: import("../../../components/factory/api.js").Type<number | undefined, number | undefined, false>;
|
|
16
|
+
readonly loop: false;
|
|
17
|
+
readonly speed: 1;
|
|
18
|
+
}>, import("../../../components/factory/api.js").BuiltNode<import("../../../components/factory/api.js").Merge<import("../../../components/factory/api.js").BoxAudioState, {
|
|
19
|
+
readonly src: import("../../../components/factory/api.js").Type<string, string, false>;
|
|
20
|
+
readonly trimStart: 0;
|
|
21
|
+
readonly trimEnd: import("../../../components/factory/api.js").Type<number | undefined, number | undefined, false>;
|
|
22
|
+
readonly loop: false;
|
|
23
|
+
readonly speed: 1;
|
|
24
|
+
}>, {
|
|
25
|
+
readonly play: unknown;
|
|
26
|
+
}, import("../../../components/trees/audio/node-audio.js").NodeAudio<NodeAudioProps>>>>;
|
|
27
|
+
/** A mix of the sounds and buses in it; `solo` silences its siblings. */
|
|
28
|
+
export declare const AudioBus: import("../../../components/factory/api.js").Component<"audioBus", import("../../../components/factory/api.js").Merge<import("../../../components/factory/api.js").BoxAudioState, {
|
|
29
|
+
readonly solo: false;
|
|
30
|
+
}>, {}, null, import("../../../components/trees/audio/node-audio.js").NodeAudio<NodeAudioProps>, import("../../../components/factory/api.js").TreeCallProps<import("../../../components/factory/api.js").Merge<import("../../../components/factory/api.js").BoxAudioState, {
|
|
31
|
+
readonly solo: false;
|
|
32
|
+
}>, import("../../../components/factory/api.js").BuiltNode<import("../../../components/factory/api.js").Merge<import("../../../components/factory/api.js").BoxAudioState, {
|
|
33
|
+
readonly solo: false;
|
|
34
|
+
}>, {}, import("../../../components/trees/audio/node-audio.js").NodeAudio<NodeAudioProps>>>>;
|
|
35
|
+
export type SoundNode = NodeOf<typeof SoundNode>;
|
|
36
|
+
export type AudioBus = NodeOf<typeof AudioBus>;
|
|
37
|
+
export interface AudioBusProps extends NodeAudioProps {
|
|
38
|
+
/** Silence every other bus that is not itself soloed. */
|
|
39
|
+
solo: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface SoundNodeProps extends NodeAudioProps {
|
|
42
|
+
/** Path/URL of the audio (or video) asset. Must exist in the asset manifest. */
|
|
43
|
+
src: string;
|
|
44
|
+
/** In-point inside the source file, in seconds. Defaults to 0. */
|
|
45
|
+
trimStart: number;
|
|
46
|
+
/** Out-point inside the source file. Defaults to the source's full length. */
|
|
47
|
+
trimEnd: number | undefined;
|
|
48
|
+
/** Repeat the trimmed clip until it is removed. */
|
|
49
|
+
loop: boolean;
|
|
50
|
+
/** Playback-rate multiplier. 2 plays twice as fast and occupies half the clip time. */
|
|
51
|
+
speed: number;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=audio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audio.d.ts","sourceRoot":"","sources":["../../../../src/components/builtins/audio/audio.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAgB1E,kEAAkE;AAClE,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;6EAepB,CAAC;AAEH,yEAAyE;AACzE,eAAO,MAAM,QAAQ;;;;;;kFAGnB,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,SAAS,CAAC,CAAC;AACjD,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAC;AAI/C,MAAM,WAAW,aAAc,SAAQ,cAAc;IACjD,yDAAyD;IACzD,IAAI,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,cAAe,SAAQ,cAAc;IAClD,gFAAgF;IAChF,GAAG,EAAE,MAAM,CAAC;IACZ,kEAAkE;IAClE,SAAS,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,mDAAmD;IACnD,IAAI,EAAE,OAAO,CAAC;IACd,uFAAuF;IACvF,KAAK,EAAE,MAAM,CAAC;CACjB"}
|