@motionscript/core 0.1.0-alpha.0 → 0.1.0-alpha.5
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 +282 -0
- package/LICENSE +201 -201
- package/NOTICE +48 -0
- package/README.md +93 -72
- package/dist/assets/asset-index.js.map +1 -1
- package/dist/assets/catalog.d.ts +9 -0
- package/dist/assets/catalog.d.ts.map +1 -1
- package/dist/assets/catalog.js +11 -0
- package/dist/assets/catalog.js.map +1 -1
- package/dist/assets/errors.d.ts.map +1 -1
- package/dist/assets/errors.js +8 -3
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/index.js.map +1 -1
- package/dist/assets/manager.d.ts +26 -1
- package/dist/assets/manager.d.ts.map +1 -1
- package/dist/assets/manager.js +93 -11
- package/dist/assets/manager.js.map +1 -1
- package/dist/assets/manifest.js.map +1 -1
- package/dist/assets/record.js.map +1 -1
- package/dist/assets/scope.d.ts +3 -3
- package/dist/assets/scope.d.ts.map +1 -1
- package/dist/assets/scope.js.map +1 -1
- package/dist/attributes/audio/filters/chain.d.ts +1 -1
- package/dist/attributes/audio/filters/chain.js.map +1 -1
- package/dist/attributes/audio/filters/curve.d.ts +8 -8
- package/dist/attributes/audio/filters/curve.d.ts.map +1 -1
- package/dist/attributes/audio/filters/curve.js +20 -19
- package/dist/attributes/audio/filters/curve.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/echo.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/gain.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/highpass.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/lowpass.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/speed.d.ts +2 -2
- package/dist/attributes/audio/filters/implementations/speed.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/tremolo.js.map +1 -1
- package/dist/attributes/audio/filters/index.d.ts +1 -1
- package/dist/attributes/audio/filters/index.d.ts.map +1 -1
- package/dist/attributes/audio/filters/index.js +1 -1
- package/dist/attributes/audio/filters/index.js.map +1 -1
- package/dist/attributes/audio/filters/registry.js.map +1 -1
- package/dist/attributes/audio/filters/union.js.map +1 -1
- package/dist/attributes/audio/request.d.ts +32 -4
- package/dist/attributes/audio/request.d.ts.map +1 -1
- package/dist/attributes/audio/request.js +9 -1
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +11 -2
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js +15 -8
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/audio/sound.d.ts +4 -2
- package/dist/attributes/audio/sound.d.ts.map +1 -1
- package/dist/attributes/audio/sound.js +8 -4
- package/dist/attributes/audio/sound.js.map +1 -1
- package/dist/attributes/index.d.ts +1 -0
- package/dist/attributes/index.d.ts.map +1 -1
- package/dist/attributes/index.js +1 -0
- package/dist/attributes/index.js.map +1 -1
- package/dist/attributes/layout/alignment.js +1 -1
- package/dist/attributes/layout/alignment.js.map +1 -1
- package/dist/attributes/layout/index.js.map +1 -1
- package/dist/attributes/layout/insets.js.map +1 -1
- package/dist/attributes/layout/matrix2d.js.map +1 -1
- package/dist/attributes/layout/size.js.map +1 -1
- package/dist/attributes/layout/transform3d.js.map +1 -1
- package/dist/attributes/layout/vector2.js.map +1 -1
- package/dist/attributes/layout/world-transform.js.map +1 -1
- package/dist/attributes/mask/boolean.js.map +1 -1
- package/dist/attributes/mask/mask.js.map +1 -1
- package/dist/attributes/properties/decorator.d.ts +17 -6
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- package/dist/attributes/properties/decorator.js +26 -14
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/inputs.js.map +1 -1
- package/dist/attributes/properties/typed.d.ts +9 -2
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +15 -1
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/render3d/orbit.d.ts +8 -8
- package/dist/attributes/render3d/orbit.js +7 -7
- package/dist/attributes/render3d/orbit.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/corners/corner-style.js.map +1 -1
- package/dist/attributes/shape/corners/corners.js.map +1 -1
- package/dist/attributes/shape/corners/index.js.map +1 -1
- package/dist/attributes/shape/effects/backdrop.d.ts +4 -4
- package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
- package/dist/attributes/shape/effects/backdrop.js.map +1 -1
- package/dist/attributes/shape/effects/chain.d.ts +28 -120
- package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/chain.js +16 -88
- package/dist/attributes/shape/effects/chain.js.map +1 -1
- package/dist/attributes/shape/effects/effect-data.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +2 -2
- package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -1
- package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.d.ts +15 -24
- package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.d.ts +1 -1
- package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.js +15 -8
- package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
- package/dist/attributes/shape/effects/index.d.ts +2 -6
- package/dist/attributes/shape/effects/index.d.ts.map +1 -1
- package/dist/attributes/shape/effects/index.js.map +1 -1
- package/dist/attributes/shape/effects/registry.d.ts +23 -6
- package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
- package/dist/attributes/shape/effects/registry.js +44 -10
- package/dist/attributes/shape/effects/registry.js.map +1 -1
- package/dist/attributes/shape/effects/union.d.ts +2 -6
- package/dist/attributes/shape/effects/union.d.ts.map +1 -1
- package/dist/attributes/shape/effects/union.js.map +1 -1
- package/dist/attributes/shape/fill/blend.js.map +1 -1
- package/dist/attributes/shape/fill/chain.js.map +1 -1
- package/dist/attributes/shape/fill/coerce.js.map +1 -1
- package/dist/attributes/shape/fill/color/constants.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
- package/dist/attributes/shape/fill/color/parser.js +81 -44
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.d.ts +16 -0
- package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -0
- package/dist/attributes/shape/fill/gradient-stops.js +65 -0
- package/dist/attributes/shape/fill/gradient-stops.js.map +1 -0
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/color.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/conic-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/conic-gradient.js +2 -5
- package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js +2 -10
- package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.js +5 -4
- package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/linear-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/linear-gradient.js +2 -6
- package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/radial-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/radial-gradient.js +2 -5
- package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/stripe.js.map +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/index.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.d.ts +9 -1
- package/dist/attributes/shape/fill/lerp.d.ts.map +1 -1
- package/dist/attributes/shape/fill/lerp.js +12 -1
- package/dist/attributes/shape/fill/lerp.js.map +1 -1
- package/dist/attributes/shape/fill/media-preset.js.map +1 -1
- package/dist/attributes/shape/fill/registry.js.map +1 -1
- package/dist/attributes/shape/fill/union.js.map +1 -1
- package/dist/attributes/shape/filters/chain.d.ts +4 -10
- package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
- package/dist/attributes/shape/filters/chain.js +1 -13
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/posterize-time.js.map +1 -1
- package/dist/attributes/shape/filters/index.d.ts +1 -1
- package/dist/attributes/shape/filters/index.js.map +1 -1
- package/dist/attributes/shape/filters/registry.d.ts +2 -2
- package/dist/attributes/shape/filters/registry.js +3 -3
- package/dist/attributes/shape/filters/registry.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +6 -7
- 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/anchors.d.ts.map +1 -1
- package/dist/attributes/shape/path/anchors.js +12 -5
- package/dist/attributes/shape/path/anchors.js.map +1 -1
- package/dist/attributes/shape/path/bezier.js.map +1 -1
- package/dist/attributes/shape/path/index.js.map +1 -1
- package/dist/attributes/shape/path/measure.js.map +1 -1
- package/dist/attributes/shape/path/morph.d.ts.map +1 -1
- package/dist/attributes/shape/path/morph.js +16 -4
- package/dist/attributes/shape/path/morph.js.map +1 -1
- package/dist/attributes/shape/path/ops.js.map +1 -1
- package/dist/attributes/shape/path/types.js.map +1 -1
- package/dist/attributes/shape/path/walk.js.map +1 -1
- package/dist/attributes/shape/shaders/index.js.map +1 -1
- package/dist/attributes/shape/shaders/pack.js.map +1 -1
- package/dist/attributes/shape/shaders/resolve.js.map +1 -1
- package/dist/attributes/shape/shadow/index.js.map +1 -1
- package/dist/attributes/shape/shadow/shadow.js.map +1 -1
- package/dist/attributes/shape/stroke/index.d.ts +2 -2
- package/dist/attributes/shape/stroke/index.d.ts.map +1 -1
- package/dist/attributes/shape/stroke/index.js +1 -1
- package/dist/attributes/shape/stroke/index.js.map +1 -1
- package/dist/attributes/shape/stroke/stroke.d.ts +27 -6
- package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
- package/dist/attributes/shape/stroke/stroke.js +22 -2
- package/dist/attributes/shape/stroke/stroke.js.map +1 -1
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/index.js.map +1 -1
- package/dist/attributes/text/ops.d.ts +6 -0
- package/dist/attributes/text/ops.d.ts.map +1 -1
- package/dist/attributes/text/ops.js +1 -0
- package/dist/attributes/text/ops.js.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/chunk-FUZVFT3W.js +18 -0
- package/dist/browser/chunks/chunk-FUZVFT3W.js.map +7 -0
- package/dist/browser/chunks/chunk-QG6C23IJ.js +3 -0
- package/dist/browser/chunks/chunk-QG6C23IJ.js.map +7 -0
- package/dist/browser/chunks/chunk-SFNJRPBV.js +2 -0
- package/dist/browser/chunks/chunk-SFNJRPBV.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/component.js.map +3 -3
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/jsx-jsx-dev-runtime.js +1 -1
- package/dist/browser/jsx-jsx-runtime.js +1 -1
- package/dist/browser/manifest.json +3 -2
- package/dist/browser/sdk.js +1 -1
- package/dist/component.js.map +1 -1
- package/dist/document/audio.d.ts +1 -1
- package/dist/document/audio.js +4 -4
- package/dist/document/audio.js.map +1 -1
- package/dist/document/builtins.d.ts.map +1 -1
- package/dist/document/builtins.js +8 -14
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +1 -1
- package/dist/document/command-traits.d.ts.map +1 -1
- package/dist/document/command-traits.js +17 -3
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/diff.js.map +1 -1
- package/dist/document/doc-index.d.ts +2 -2
- package/dist/document/doc-index.d.ts.map +1 -1
- package/dist/document/doc-index.js.map +1 -1
- package/dist/document/expression/compile.d.ts.map +1 -1
- package/dist/document/expression/compile.js +8 -5
- package/dist/document/expression/compile.js.map +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/expression/parse.d.ts.map +1 -1
- package/dist/document/expression/parse.js +15 -6
- package/dist/document/expression/parse.js.map +1 -1
- package/dist/document/expression/refs.d.ts +1 -1
- package/dist/document/expression/refs.js +1 -1
- package/dist/document/expression/refs.js.map +1 -1
- package/dist/document/expression/types.js.map +1 -1
- package/dist/document/expression/walk.d.ts.map +1 -1
- package/dist/document/expression/walk.js +2 -1
- package/dist/document/expression/walk.js.map +1 -1
- package/dist/document/index.d.ts +2 -0
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/index.js +2 -0
- package/dist/document/index.js.map +1 -1
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.d.ts +19 -0
- package/dist/document/node-descriptor.d.ts.map +1 -1
- package/dist/document/node-descriptor.js.map +1 -1
- package/dist/document/placement.d.ts +70 -0
- package/dist/document/placement.d.ts.map +1 -0
- package/dist/document/placement.js +83 -0
- package/dist/document/placement.js.map +1 -0
- package/dist/document/project.d.ts +2 -2
- package/dist/document/project.d.ts.map +1 -1
- package/dist/document/project.js.map +1 -1
- package/dist/document/registry.d.ts +34 -16
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +51 -12
- package/dist/document/registry.js.map +1 -1
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.d.ts +73 -18
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +192 -40
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +12 -12
- package/dist/document/types.d.ts.map +1 -1
- package/dist/document/types.js +2 -2
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +2 -2
- package/dist/document/validate.d.ts.map +1 -1
- package/dist/document/validate.js +37 -31
- package/dist/document/validate.js.map +1 -1
- package/dist/document/withdraw.d.ts +28 -0
- package/dist/document/withdraw.d.ts.map +1 -0
- package/dist/document/withdraw.js +61 -0
- package/dist/document/withdraw.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/jsx/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx/jsx-runtime.d.ts +9 -1
- package/dist/jsx/jsx-runtime.d.ts.map +1 -1
- package/dist/jsx/jsx-runtime.js +13 -3
- package/dist/jsx/jsx-runtime.js.map +1 -1
- package/dist/layout/bounds.d.ts +0 -1
- package/dist/layout/bounds.d.ts.map +1 -1
- package/dist/layout/bounds.js.map +1 -1
- package/dist/layout/constraints.js.map +1 -1
- package/dist/layout/flex.d.ts +4 -2
- package/dist/layout/flex.d.ts.map +1 -1
- package/dist/layout/flex.js +27 -11
- package/dist/layout/flex.js.map +1 -1
- package/dist/layout/freeform.js.map +1 -1
- package/dist/layout/grid.js.map +1 -1
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/item.js.map +1 -1
- package/dist/layout/ops.d.ts +6 -0
- package/dist/layout/ops.d.ts.map +1 -1
- package/dist/layout/ops.js +6 -0
- package/dist/layout/ops.js.map +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/nodes/2d/node-lifecycle.js.map +1 -1
- package/dist/nodes/2d/node-motion.js.map +1 -1
- package/dist/nodes/2d/node-render.d.ts +3 -3
- package/dist/nodes/2d/node-render.d.ts.map +1 -1
- package/dist/nodes/2d/node-render.js.map +1 -1
- package/dist/nodes/2d/node-transform.js.map +1 -1
- package/dist/nodes/2d/node2d.d.ts +115 -3
- package/dist/nodes/2d/node2d.d.ts.map +1 -1
- package/dist/nodes/2d/node2d.js +188 -32
- package/dist/nodes/2d/node2d.js.map +1 -1
- package/dist/nodes/2d/paint-node.d.ts +27 -0
- package/dist/nodes/2d/paint-node.d.ts.map +1 -1
- package/dist/nodes/2d/paint-node.js +42 -0
- package/dist/nodes/2d/paint-node.js.map +1 -1
- package/dist/nodes/audio/audio-bus.js.map +1 -1
- package/dist/nodes/audio/index.js.map +1 -1
- package/dist/nodes/audio/node-audio.d.ts +3 -2
- package/dist/nodes/audio/node-audio.d.ts.map +1 -1
- package/dist/nodes/audio/node-audio.js +8 -5
- package/dist/nodes/audio/node-audio.js.map +1 -1
- package/dist/nodes/audio/sound-node.d.ts +2 -2
- package/dist/nodes/audio/sound-node.d.ts.map +1 -1
- package/dist/nodes/audio/sound-node.js +2 -2
- package/dist/nodes/audio/sound-node.js.map +1 -1
- package/dist/nodes/geometry/bounds-shape-node.d.ts +4 -4
- package/dist/nodes/geometry/bounds-shape-node.js +2 -2
- package/dist/nodes/geometry/bounds-shape-node.js.map +1 -1
- package/dist/nodes/geometry/box-path-node.d.ts +3 -3
- package/dist/nodes/geometry/box-path-node.js +2 -2
- package/dist/nodes/geometry/box-path-node.js.map +1 -1
- package/dist/nodes/geometry/ellipse-node.js.map +1 -1
- package/dist/nodes/geometry/group-bounds.d.ts +2 -2
- package/dist/nodes/geometry/group-bounds.d.ts.map +1 -1
- package/dist/nodes/geometry/group-bounds.js +1 -2
- package/dist/nodes/geometry/group-bounds.js.map +1 -1
- package/dist/nodes/geometry/path-node.d.ts.map +1 -1
- package/dist/nodes/geometry/path-node.js +6 -0
- package/dist/nodes/geometry/path-node.js.map +1 -1
- package/dist/nodes/geometry/polygon-node.js.map +1 -1
- package/dist/nodes/geometry/polygram-node.js.map +1 -1
- package/dist/nodes/geometry/rect-node.js.map +1 -1
- package/dist/nodes/geometry/shape-node.js.map +1 -1
- package/dist/nodes/geometry/shape-outline.d.ts +2 -2
- package/dist/nodes/geometry/shape-outline.d.ts.map +1 -1
- package/dist/nodes/geometry/shape-outline.js +2 -13
- package/dist/nodes/geometry/shape-outline.js.map +1 -1
- package/dist/nodes/index.d.ts +3 -8
- package/dist/nodes/index.d.ts.map +1 -1
- package/dist/nodes/index.js +3 -8
- package/dist/nodes/index.js.map +1 -1
- package/dist/nodes/layout/camera-node.d.ts +9 -0
- package/dist/nodes/layout/camera-node.d.ts.map +1 -1
- package/dist/nodes/layout/camera-node.js +38 -3
- package/dist/nodes/layout/camera-node.js.map +1 -1
- package/dist/nodes/layout/orbit-camera-node.d.ts +1 -1
- package/dist/nodes/layout/orbit-camera-node.js +1 -1
- package/dist/nodes/layout/orbit-camera-node.js.map +1 -1
- package/dist/nodes/layout/rotated-box.js.map +1 -1
- package/dist/nodes/media/video-node.d.ts.map +1 -1
- package/dist/nodes/media/video-node.js +5 -3
- package/dist/nodes/media/video-node.js.map +1 -1
- package/dist/nodes/node/declare-paints.js.map +1 -1
- package/dist/nodes/node/node-editor-state.js.map +1 -1
- package/dist/nodes/node/node-reactive.js.map +1 -1
- package/dist/nodes/node/node-time.d.ts +3 -3
- package/dist/nodes/node/node-time.d.ts.map +1 -1
- package/dist/nodes/node/node-time.js +1 -1
- package/dist/nodes/node/node-time.js.map +1 -1
- package/dist/nodes/node/node-walk.js.map +1 -1
- package/dist/nodes/node/node.d.ts +5 -3
- package/dist/nodes/node/node.d.ts.map +1 -1
- package/dist/nodes/node/node.js +44 -19
- package/dist/nodes/node/node.js.map +1 -1
- package/dist/nodes/node/text-defaults.d.ts +10 -12
- package/dist/nodes/node/text-defaults.d.ts.map +1 -1
- package/dist/nodes/node/text-defaults.js +10 -12
- package/dist/nodes/node/text-defaults.js.map +1 -1
- package/dist/nodes/{scene → root}/canvas2d-node.d.ts +2 -2
- package/dist/nodes/root/canvas2d-node.d.ts.map +1 -0
- package/dist/nodes/{scene → root}/canvas2d-node.js +2 -2
- package/dist/nodes/root/canvas2d-node.js.map +1 -0
- package/dist/nodes/root/provider-node.d.ts.map +1 -0
- package/dist/nodes/root/provider-node.js.map +1 -0
- package/dist/nodes/root/theme-provider-node.d.ts.map +1 -0
- package/dist/nodes/root/theme-provider-node.js.map +1 -0
- package/dist/nodes/text/default-text-style-node.d.ts +5 -2
- package/dist/nodes/text/default-text-style-node.d.ts.map +1 -1
- package/dist/nodes/text/default-text-style-node.js +10 -4
- package/dist/nodes/text/default-text-style-node.js.map +1 -1
- package/dist/nodes/text/number-format.d.ts +1 -1
- package/dist/nodes/text/number-format.js +1 -1
- package/dist/nodes/text/number-format.js.map +1 -1
- package/dist/nodes/text/number-node.js.map +1 -1
- package/dist/nodes/text/number-pattern.js.map +1 -1
- package/dist/nodes/text/richtext-node.js +1 -1
- package/dist/nodes/text/richtext-node.js.map +1 -1
- package/dist/nodes/text/text-base.d.ts.map +1 -1
- package/dist/nodes/text/text-base.js +1 -1
- package/dist/nodes/text/text-base.js.map +1 -1
- package/dist/nodes/text/text-node.js.map +1 -1
- package/dist/nodes/text/text-selection.js.map +1 -1
- package/dist/nodes/three/camera-nodes.d.ts +21 -3
- package/dist/nodes/three/camera-nodes.d.ts.map +1 -1
- package/dist/nodes/three/camera-nodes.js +42 -1
- package/dist/nodes/three/camera-nodes.js.map +1 -1
- package/dist/nodes/three/canvas3d-node.d.ts +29 -6
- package/dist/nodes/three/canvas3d-node.d.ts.map +1 -1
- package/dist/nodes/three/canvas3d-node.js +44 -2
- package/dist/nodes/three/canvas3d-node.js.map +1 -1
- package/dist/nodes/three/drawable-nodes.d.ts +25 -11
- package/dist/nodes/three/drawable-nodes.d.ts.map +1 -1
- package/dist/nodes/three/drawable-nodes.js +43 -13
- package/dist/nodes/three/drawable-nodes.js.map +1 -1
- package/dist/nodes/three/environment-nodes.d.ts +9 -3
- package/dist/nodes/three/environment-nodes.d.ts.map +1 -1
- package/dist/nodes/three/environment-nodes.js.map +1 -1
- package/dist/nodes/three/geometry-nodes.d.ts +2 -2
- package/dist/nodes/three/geometry-nodes.js +2 -2
- package/dist/nodes/three/geometry-nodes.js.map +1 -1
- package/dist/nodes/three/grid-geometry3d.js.map +1 -1
- package/dist/nodes/three/group3d.js.map +1 -1
- package/dist/nodes/three/light-nodes.d.ts.map +1 -1
- package/dist/nodes/three/light-nodes.js +3 -3
- package/dist/nodes/three/light-nodes.js.map +1 -1
- package/dist/nodes/three/mesh3d.js.map +1 -1
- package/dist/nodes/three/node3d.d.ts +48 -0
- package/dist/nodes/three/node3d.d.ts.map +1 -1
- package/dist/nodes/three/node3d.js +53 -3
- package/dist/nodes/three/node3d.js.map +1 -1
- package/dist/platform/audio-sink.d.ts +2 -2
- package/dist/platform/audio-sink.d.ts.map +1 -1
- package/dist/platform/audio-sink.js.map +1 -1
- package/dist/platform/exporter.d.ts +13 -8
- package/dist/platform/exporter.d.ts.map +1 -1
- package/dist/platform/exporter.js.map +1 -1
- package/dist/platform/index.d.ts +1 -1
- package/dist/platform/index.d.ts.map +1 -1
- package/dist/platform/index.js.map +1 -1
- package/dist/platform/stepped-clock.js.map +1 -1
- package/dist/platform/storage-adapter.d.ts +12 -6
- package/dist/platform/storage-adapter.d.ts.map +1 -1
- package/dist/platform/storage-adapter.js +4 -0
- package/dist/platform/storage-adapter.js.map +1 -1
- package/dist/platform/ticker.d.ts +6 -0
- package/dist/platform/ticker.d.ts.map +1 -1
- package/dist/platform/ticker.js +6 -0
- package/dist/platform/ticker.js.map +1 -1
- package/dist/project/config.js.map +1 -1
- package/dist/project/index.js.map +1 -1
- package/dist/project/tree.d.ts +3 -3
- package/dist/project/tree.d.ts.map +1 -1
- package/dist/project/tree.js.map +1 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/index.js.map +1 -1
- package/dist/props/observer.js.map +1 -1
- package/dist/props/slot.js.map +1 -1
- package/dist/renamed-scene-names.d.ts +17 -0
- package/dist/renamed-scene-names.d.ts.map +1 -0
- package/dist/renamed-scene-names.js +9 -0
- package/dist/renamed-scene-names.js.map +1 -0
- package/dist/render/canvas-render-context2d.d.ts +10 -3
- package/dist/render/canvas-render-context2d.d.ts.map +1 -1
- package/dist/render/canvas-render-context2d.js +10 -0
- package/dist/render/canvas-render-context2d.js.map +1 -1
- package/dist/render/clip-contains.js.map +1 -1
- package/dist/render/clip.js.map +1 -1
- package/dist/render/descriptors/ellipse.js.map +1 -1
- package/dist/render/descriptors/latex.js.map +1 -1
- package/dist/render/descriptors/line.js.map +1 -1
- package/dist/render/descriptors/path-builder.js.map +1 -1
- package/dist/render/descriptors/path.js.map +1 -1
- package/dist/render/descriptors/polygon.js.map +1 -1
- package/dist/render/descriptors/polygram.js.map +1 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/richtext.js.map +1 -1
- package/dist/render/descriptors/shape.d.ts +12 -0
- package/dist/render/descriptors/shape.d.ts.map +1 -1
- package/dist/render/descriptors/shape.js.map +1 -1
- package/dist/render/descriptors/text.d.ts +2 -2
- package/dist/render/descriptors/text.js +2 -2
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/descriptors/transform.d.ts +2 -2
- package/dist/render/descriptors/transform.d.ts.map +1 -1
- package/dist/render/descriptors/transform.js.map +1 -1
- package/dist/render/graphics2d.d.ts +3 -3
- package/dist/render/graphics2d.d.ts.map +1 -1
- package/dist/render/graphics2d.js +1 -1
- package/dist/render/graphics2d.js.map +1 -1
- package/dist/render/index.js.map +1 -1
- package/dist/render/measure-context.js.map +1 -1
- package/dist/render/null-render-context.js.map +1 -1
- package/dist/render/render-context2d.d.ts +5 -5
- package/dist/render/render-context2d.d.ts.map +1 -1
- package/dist/render/render-context2d.js.map +1 -1
- package/dist/render/surface.js.map +1 -1
- package/dist/render/text-defaults.js.map +1 -1
- package/dist/render/text-layout.js.map +1 -1
- package/dist/render3d/bounds3d.d.ts.map +1 -1
- package/dist/render3d/bounds3d.js +4 -2
- package/dist/render3d/bounds3d.js.map +1 -1
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/camera.d.ts +6 -0
- package/dist/render3d/camera.d.ts.map +1 -1
- package/dist/render3d/camera.js +5 -3
- package/dist/render3d/camera.js.map +1 -1
- package/dist/render3d/fill3d.d.ts +2 -9
- package/dist/render3d/fill3d.d.ts.map +1 -1
- package/dist/render3d/fill3d.js +2 -13
- package/dist/render3d/fill3d.js.map +1 -1
- package/dist/render3d/geometry.d.ts +8 -1
- package/dist/render3d/geometry.d.ts.map +1 -1
- package/dist/render3d/geometry.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts +8 -4
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +18 -10
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/index.d.ts +1 -1
- package/dist/render3d/index.js +1 -1
- package/dist/render3d/index.js.map +1 -1
- package/dist/render3d/inert.d.ts +14 -0
- package/dist/render3d/inert.d.ts.map +1 -0
- package/dist/render3d/inert.js +62 -0
- package/dist/render3d/inert.js.map +1 -0
- package/dist/render3d/light.js.map +1 -1
- package/dist/render3d/material.d.ts +10 -5
- package/dist/render3d/material.d.ts.map +1 -1
- package/dist/render3d/material.js.map +1 -1
- package/dist/render3d/matrix4.js.map +1 -1
- package/dist/render3d/render-context3d.js.map +1 -1
- package/dist/render3d/resources.d.ts +2 -2
- package/dist/render3d/resources.js +2 -2
- package/dist/render3d/resources.js.map +1 -1
- package/dist/render3d/rounded-box.js.map +1 -1
- package/dist/render3d/scene-settings.d.ts +23 -4
- package/dist/render3d/scene-settings.d.ts.map +1 -1
- package/dist/render3d/scene-settings.js.map +1 -1
- package/dist/render3d/scene3d.d.ts +11 -0
- package/dist/render3d/scene3d.d.ts.map +1 -1
- package/dist/render3d/scene3d.js +39 -6
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/segments.js.map +1 -1
- package/dist/render3d/texture.d.ts +9 -0
- package/dist/render3d/texture.d.ts.map +1 -1
- package/dist/render3d/texture.js +13 -0
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/tracking.js.map +1 -1
- package/dist/render3d/transform.d.ts +1 -1
- package/dist/render3d/transform.js.map +1 -1
- package/dist/render3d/vector3.d.ts +18 -1
- package/dist/render3d/vector3.d.ts.map +1 -1
- package/dist/render3d/vector3.js +27 -0
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/render3d/walk.d.ts +1 -1
- package/dist/render3d/walk.d.ts.map +1 -1
- package/dist/render3d/walk.js +5 -1
- package/dist/render3d/walk.js.map +1 -1
- package/dist/runtime/asset-refine.js.map +1 -1
- package/dist/runtime/asset-timeline.js.map +1 -1
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.d.ts +2 -2
- package/dist/runtime/audio-index.d.ts.map +1 -1
- package/dist/runtime/audio-index.js +8 -2
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/builtin-context.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +5 -3
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +10 -6
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +9 -0
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +33 -3
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +5 -0
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +2 -0
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/frame-time.d.ts +31 -0
- package/dist/runtime/frame-time.d.ts.map +1 -0
- package/dist/runtime/frame-time.js +29 -0
- package/dist/runtime/frame-time.js.map +1 -0
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/node-picking.d.ts +44 -3
- package/dist/runtime/node-picking.d.ts.map +1 -1
- package/dist/runtime/node-picking.js +118 -3
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +2 -1
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +5 -2
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/placement.d.ts.map +1 -1
- package/dist/runtime/placement.js +4 -5
- package/dist/runtime/placement.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts +31 -2
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +63 -6
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/playback.js.map +1 -1
- package/dist/runtime/precompisition.js.map +1 -1
- package/dist/runtime/project-assets.js.map +1 -1
- package/dist/runtime/session.d.ts +9 -7
- package/dist/runtime/session.d.ts.map +1 -1
- package/dist/runtime/session.js +12 -4
- package/dist/runtime/session.js.map +1 -1
- package/dist/runtime/settle.js.map +1 -1
- package/dist/runtime/state-evaluator.d.ts +1 -1
- package/dist/runtime/state-evaluator.d.ts.map +1 -1
- package/dist/runtime/state-evaluator.js +4 -3
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +27 -22
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +23 -9
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +12 -4
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js +10 -22
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/ease/constants.d.ts.map +1 -1
- package/dist/tween/ease/constants.js +8 -5
- package/dist/tween/ease/constants.js.map +1 -1
- package/dist/tween/ease/curve.d.ts.map +1 -1
- package/dist/tween/ease/curve.js +4 -3
- package/dist/tween/ease/curve.js.map +1 -1
- package/dist/tween/ease/describe.d.ts +15 -0
- package/dist/tween/ease/describe.d.ts.map +1 -0
- package/dist/tween/ease/describe.js +37 -0
- package/dist/tween/ease/describe.js.map +1 -0
- package/dist/tween/ease/type.js.map +1 -1
- package/dist/tween/index.js.map +1 -1
- package/dist/tween/inert.js.map +1 -1
- package/dist/tween/lerp.js.map +1 -1
- package/dist/tween/loop.js.map +1 -1
- package/dist/tween/prepare.d.ts +3 -3
- package/dist/tween/prepare.js +3 -3
- package/dist/tween/prepare.js.map +1 -1
- package/dist/tween/seekable.d.ts +12 -1
- package/dist/tween/seekable.d.ts.map +1 -1
- package/dist/tween/seekable.js +15 -0
- package/dist/tween/seekable.js.map +1 -1
- package/dist/tween/stepper.js.map +1 -1
- package/dist/tween/to-command.js.map +1 -1
- package/dist/util/clamp.js.map +1 -1
- package/dist/util/context.js.map +1 -1
- package/dist/util/csv.js.map +1 -1
- package/dist/util/generateList.js.map +1 -1
- package/dist/util/index.js.map +1 -1
- package/dist/util/metrics.d.ts +1 -1
- package/dist/util/metrics.js +1 -1
- package/dist/util/metrics.js.map +1 -1
- package/dist/util/random.js.map +1 -1
- package/dist/util/reference.js.map +1 -1
- package/dist/util/scheduler.js.map +1 -1
- package/package.json +2 -1
- package/dist/attributes/shape/effects/implementations/displace.d.ts +0 -48
- package/dist/attributes/shape/effects/implementations/displace.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/displace.js +0 -30
- package/dist/attributes/shape/effects/implementations/displace.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/god-rays.d.ts +0 -28
- package/dist/attributes/shape/effects/implementations/god-rays.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/god-rays.js +0 -26
- package/dist/attributes/shape/effects/implementations/god-rays.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/texture.d.ts +0 -28
- package/dist/attributes/shape/effects/implementations/texture.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/texture.js +0 -25
- package/dist/attributes/shape/effects/implementations/texture.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/trails.d.ts +0 -41
- package/dist/attributes/shape/effects/implementations/trails.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/trails.js +0 -22
- package/dist/attributes/shape/effects/implementations/trails.js.map +0 -1
- package/dist/browser/chunks/chunk-2T3HXSC2.js +0 -2
- package/dist/browser/chunks/chunk-2T3HXSC2.js.map +0 -7
- package/dist/browser/chunks/chunk-P3XQCHDW.js +0 -16
- package/dist/browser/chunks/chunk-P3XQCHDW.js.map +0 -7
- package/dist/browser/chunks/chunk-VJQMKHGQ.js +0 -3
- package/dist/browser/chunks/chunk-VJQMKHGQ.js.map +0 -7
- package/dist/nodes/geometry/dot-grid-node.d.ts +0 -105
- package/dist/nodes/geometry/dot-grid-node.d.ts.map +0 -1
- package/dist/nodes/geometry/dot-grid-node.js +0 -142
- package/dist/nodes/geometry/dot-grid-node.js.map +0 -1
- package/dist/nodes/geometry/grid-lines.d.ts +0 -101
- package/dist/nodes/geometry/grid-lines.d.ts.map +0 -1
- package/dist/nodes/geometry/grid-lines.js +0 -128
- package/dist/nodes/geometry/grid-lines.js.map +0 -1
- package/dist/nodes/geometry/grid-pattern-node.d.ts +0 -58
- package/dist/nodes/geometry/grid-pattern-node.d.ts.map +0 -1
- package/dist/nodes/geometry/grid-pattern-node.js +0 -172
- package/dist/nodes/geometry/grid-pattern-node.js.map +0 -1
- package/dist/nodes/geometry/line-grid-node.d.ts +0 -62
- package/dist/nodes/geometry/line-grid-node.d.ts.map +0 -1
- package/dist/nodes/geometry/line-grid-node.js +0 -127
- package/dist/nodes/geometry/line-grid-node.js.map +0 -1
- package/dist/nodes/geometry/line-node.d.ts +0 -58
- package/dist/nodes/geometry/line-node.d.ts.map +0 -1
- package/dist/nodes/geometry/line-node.js +0 -123
- package/dist/nodes/geometry/line-node.js.map +0 -1
- package/dist/nodes/geometry/viewport-pattern-node.d.ts +0 -39
- package/dist/nodes/geometry/viewport-pattern-node.d.ts.map +0 -1
- package/dist/nodes/geometry/viewport-pattern-node.js +0 -79
- package/dist/nodes/geometry/viewport-pattern-node.js.map +0 -1
- package/dist/nodes/scene/canvas2d-node.d.ts.map +0 -1
- package/dist/nodes/scene/canvas2d-node.js.map +0 -1
- package/dist/nodes/scene/provider-node.d.ts.map +0 -1
- package/dist/nodes/scene/provider-node.js.map +0 -1
- package/dist/nodes/scene/theme-provider-node.d.ts.map +0 -1
- package/dist/nodes/scene/theme-provider-node.js.map +0 -1
- /package/dist/nodes/{scene → root}/provider-node.d.ts +0 -0
- /package/dist/nodes/{scene → root}/provider-node.js +0 -0
- /package/dist/nodes/{scene → root}/theme-provider-node.d.ts +0 -0
- /package/dist/nodes/{scene → root}/theme-provider-node.js +0 -0
|
@@ -130,7 +130,8 @@ export function renameRefs(value, rename) {
|
|
|
130
130
|
if (!isSource(source))
|
|
131
131
|
return STATIC(source);
|
|
132
132
|
return STATIC(source.replace(REF, (whole, ref) => {
|
|
133
|
-
|
|
133
|
+
// The parser trims a reference's name (`[ g ]` reads `g`), so the callback sees it trimmed too.
|
|
134
|
+
const next = rename(ref.trim());
|
|
134
135
|
return next === undefined ? whole : `[${next}]`;
|
|
135
136
|
}));
|
|
136
137
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walk.js","sourceRoot":"","sources":["../../../src/document/expression/walk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;AACjG,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,QAAQ,CAAC,KAAa;IAClC,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC3D,CAAC;AAKD,MAAM,MAAM,GAAG,CAAC,KAAc,EAAiB,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AAE9E;;;;;;;;;GASG;AACH,SAAS,IAAI,CAAC,KAAc,EAAE,IAAY,EAAE,QAAuB;IAC/D,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAE5D,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACvB,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC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QACrD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACf,CAAC;AAED,yFAAyF;AACzF,MAAM,GAAG,GAAG,gBAAgB,CAAC;AAE7B;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAI,KAAQ,EAAE,MAA2C;IAC/E,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,EAAE;QACtC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;QAC7C,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,GAAW,EAAE,EAAE;YACrD,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;YACzB,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC;QACpD,CAAC,CAAC,CAAC,CAAC;IACR,CAAC,CAAC,CAAC;IACH,OAAQ,MAAuB,CAAC,KAAK,CAAC;AAC1C,CAAC;AAED,SAAS,aAAa,CAAC,CAAU;IAC7B,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACpE,CAAC","sourcesContent":["/**\n * Recognition, and the one walk over an authored prop value.\n *\n * There were two walks — one compiling, one collecting — with the same three\n * cases and different leaves, and they had already drifted: the compiling one\n * read `Object.keys`, the collecting one `for…in`. Neither carried a path, so an\n * `ExpressionError` from a formula nested inside a `fill` array named the\n * formula and left the reader to find which prop it was written in.\n *\n * One recursion now, parameterized by what to do with a string. `bind` returns a\n * replacement, so containers are rebuilt around it; `collect` returns its input,\n * so nothing is rebuilt and the result is thrown away.\n */\nimport { compile } from \"./compile\";\nimport { parse } from \"./parse\";\nimport type { CompiledProps, CompiledValue, ExpressionSite, VariableResolver } from \"./types\";\n\n/**\n * True when a value is a formula rather than a string.\n *\n * `\"==\"` is the escape, so `\"==total\"` is the literal `\"=total\"` and not an\n * expression; a bare `\"=\"` is likewise just that string. Both are handled by\n * {@link unescape}, which every literal path runs values through.\n */\nexport function isSource(value: unknown): value is string {\n return typeof value === \"string\" && value.length > 1 && value[0] === \"=\" && value[1] !== \"=\";\n}\n\n/** Strip the escape from a literal string that begins with `=`. `\"==x\"` → `\"=x\"`. */\nexport function unescape(value: string): string {\n return value.startsWith(\"==\") ? value.slice(1) : value;\n}\n\n/** What the walk does with each string it reaches. Returns the value to put back. */\ntype StringHandler = (source: string, path: string) => CompiledValue;\n\nconst STATIC = (value: unknown): CompiledValue => ({ dynamic: false, value });\n\n/**\n * Visit every string in an authored value, at any depth.\n *\n * An expression is recognised at any depth, not just as a whole prop, because\n * half the props worth driving are compound: `{\"origin\": {\"x\": \"=[g]\", \"y\": 0}}`,\n * `{\"fill\": [\"#111\", {\"type\": \"solid\", \"color\": \"=[c]\"}]}`. A container holding\n * one is rebuilt on each recompute; a container holding none is passed through\n * **by identity**, so a scene that uses no expressions allocates nothing and\n * compares equal to the document it came from.\n */\nfunction walk(value: unknown, path: string, onString: StringHandler): CompiledValue {\n if (typeof value === \"string\") return onString(value, path);\n\n if (Array.isArray(value)) {\n const parts = value.map((v, i) => walk(v, `${path}[${i}]`, onString));\n if (parts.some((p) => p.dynamic)) {\n return { dynamic: true, read: () => parts.map((p) => (p.dynamic ? p.read() : p.value)) };\n }\n // Rebuild only if a leaf actually changed, so the common case keeps the\n // document's own array.\n const rebuilt = parts.map((p) => (p as { value: unknown }).value);\n return STATIC(rebuilt.every((v, i) => v === value[i]) ? value : rebuilt);\n }\n\n if (isPlainObject(value)) {\n const keys = Object.keys(value);\n const parts = keys.map((k) => walk(value[k], `${path}.${k}`, onString));\n if (parts.some((p) => p.dynamic)) {\n return {\n dynamic: true,\n read: () => {\n const out: Record<string, unknown> = {};\n keys.forEach((k, i) => {\n const part = parts[i];\n out[k] = part.dynamic ? part.read() : part.value;\n });\n return out;\n },\n };\n }\n if (!parts.some((p, i) => (p as { value: unknown }).value !== value[keys[i]])) return STATIC(value);\n const rebuilt: Record<string, unknown> = {};\n keys.forEach((k, i) => { rebuilt[k] = (parts[i] as { value: unknown }).value; });\n return STATIC(rebuilt);\n }\n\n return STATIC(value);\n}\n\n/** Compile one authored prop value: a plain value, or the binding it produced. */\nexport function bind(value: unknown, resolve: VariableResolver, path = \"props\"): CompiledValue {\n return walk(value, path, (source, at) =>\n isSource(source)\n // The `=` is the document's marker, not the grammar's — strip it here\n // and the parser never sees one.\n ? { dynamic: true, read: compile(parse(source.slice(1)), resolve, at) }\n : STATIC(unescape(source)));\n}\n\n/** Compile a whole props bag. See {@link CompiledProps}. */\nexport function bindProps(\n props: Record<string, unknown> | undefined,\n resolve: VariableResolver,\n path = \"props\",\n): CompiledProps {\n const literal: Record<string, unknown> = {};\n const bindings: Record<string, () => unknown> = {};\n let hasBindings = false;\n\n for (const key of Object.keys(props ?? {})) {\n const compiled = bind(props![key], resolve, `${path}.${key}`);\n if (compiled.dynamic) {\n bindings[key] = compiled.read;\n hasBindings = true;\n } else {\n literal[key] = compiled.value;\n }\n }\n return { literal, bindings, hasBindings };\n}\n\n/**\n * Find every expression inside an authored value, at any depth.\n *\n * Used by the validator, which checks that each one parses and names a declared\n * variable — the two failures worth catching before anything is built.\n */\nexport function collect(value: unknown, path: string): ExpressionSite[] {\n const out: ExpressionSite[] = [];\n walk(value, path, (source, at) => {\n if (isSource(source)) out.push({ path: at, source });\n return STATIC(source);\n });\n return out;\n}\n\n/** A bracketed reference. The grammar has no string literals, so a `[` is always one. */\nconst REF = /\\[([^[\\]]+)\\]/g;\n\n/**\n * Rewrite the references inside every expression in an authored value.\n *\n * `rename` sees each reference as written (`\"fade\"`, `\"card.x\"`) and returns its\n * replacement, or `undefined` to keep it. What a host moving a subtree between\n * documents needs when ids or keys change on the way; a value with nothing to\n * rewrite comes back **by identity**, the same as {@link bind}'s static path.\n */\nexport function renameRefs<T>(value: T, rename: (ref: string) => string | undefined): T {\n const result = walk(value, \"\", (source) => {\n if (!isSource(source)) return STATIC(source);\n return STATIC(source.replace(REF, (whole, ref: string) => {\n const next = rename(ref);\n return next === undefined ? whole : `[${next}]`;\n }));\n });\n return (result as { value: T }).value;\n}\n\nfunction isPlainObject(v: unknown): v is Record<string, unknown> {\n return typeof v === \"object\" && v !== null && !Array.isArray(v);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"walk.js","sourceRoot":"","sources":["../../../src/document/expression/walk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;AACjG,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,QAAQ,CAAC,KAAa;IAClC,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC3D,CAAC;AAKD,MAAM,MAAM,GAAG,CAAC,KAAc,EAAiB,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AAE9E;;;;;;;;;GASG;AACH,SAAS,IAAI,CAAC,KAAc,EAAE,IAAY,EAAE,QAAuB;IAC/D,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAC,KAAK,EAAE,IAAI,C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E,EAAE,EAAE,EAAE;QAC7B,IAAI,QAAQ,CAAC,MAAM,CAAC;YAAE,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QACrD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACf,CAAC;AAED,yFAAyF;AACzF,MAAM,GAAG,GAAG,gBAAgB,CAAC;AAE7B;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAI,KAAQ,EAAE,MAA2C;IAC/E,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,EAAE;QACtC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;QAC7C,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,GAAW,EAAE,EAAE;YACrD,gGAAgG;YAChG,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;YAChC,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC;QACpD,CAAC,CAAC,CAAC,CAAC;IACR,CAAC,CAAC,CAAC;IACH,OAAQ,MAAuB,CAAC,KAAK,CAAC;AAC1C,CAAC;AAED,SAAS,aAAa,CAAC,CAAU;IAC7B,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACpE,CAAC","sourcesContent":["/**\r\n * Recognition, and the one walk over an authored prop value.\r\n *\r\n * There were two walks — one compiling, one collecting — with the same three\r\n * cases and different leaves, and they had already drifted: the compiling one\r\n * read `Object.keys`, the collecting one `for…in`. Neither carried a path, so an\r\n * `ExpressionError` from a formula nested inside a `fill` array named the\r\n * formula and left the reader to find which prop it was written in.\r\n *\r\n * One recursion now, parameterized by what to do with a string. `bind` returns a\r\n * replacement, so containers are rebuilt around it; `collect` returns its input,\r\n * so nothing is rebuilt and the result is thrown away.\r\n */\r\nimport { compile } from \"./compile\";\r\nimport { parse } from \"./parse\";\r\nimport type { CompiledProps, CompiledValue, ExpressionSite, VariableResolver } from \"./types\";\r\n\r\n/**\r\n * True when a value is a formula rather than a string.\r\n *\r\n * `\"==\"` is the escape, so `\"==total\"` is the literal `\"=total\"` and not an\r\n * expression; a bare `\"=\"` is likewise just that string. Both are handled by\r\n * {@link unescape}, which every literal path runs values through.\r\n */\r\nexport function isSource(value: unknown): value is string {\r\n return typeof value === \"string\" && value.length > 1 && value[0] === \"=\" && value[1] !== \"=\";\r\n}\r\n\r\n/** Strip the escape from a literal string that begins with `=`. `\"==x\"` → `\"=x\"`. */\r\nexport function unescape(value: string): string {\r\n return value.startsWith(\"==\") ? value.slice(1) : value;\r\n}\r\n\r\n/** What the walk does with each string it reaches. Returns the value to put back. */\r\ntype StringHandler = (source: string, path: string) => CompiledValue;\r\n\r\nconst STATIC = (value: unknown): CompiledValue => ({ dynamic: false, value });\r\n\r\n/**\r\n * Visit every string in an authored value, at any depth.\r\n *\r\n * An expression is recognised at any depth, not just as a whole prop, because\r\n * half the props worth driving are compound: `{\"origin\": {\"x\": \"=[g]\", \"y\": 0}}`,\r\n * `{\"fill\": [\"#111\", {\"type\": \"solid\", \"color\": \"=[c]\"}]}`. A container holding\r\n * one is rebuilt on each recompute; a container holding none is passed through\r\n * **by identity**, so a scene that uses no expressions allocates nothing and\r\n * compares equal to the document it came from.\r\n */\r\nfunction walk(value: unknown, path: string, onString: StringHandler): CompiledValue {\r\n if (typeof value === \"string\") return onString(value, path);\r\n\r\n if (Array.isArray(value)) {\r\n const parts = value.map((v, i) => walk(v, `${path}[${i}]`, onString));\r\n if (parts.some((p) => p.dynamic)) {\r\n return { dynamic: true, read: () => parts.map((p) => (p.dynamic ? p.read() : p.value)) };\r\n }\r\n // Rebuild only if a leaf actually changed, so the common case keeps the\r\n // document's own array.\r\n const rebuilt = parts.map((p) => (p as { value: unknown }).value);\r\n return STATIC(rebuilt.every((v, i) => v === value[i]) ? value : rebuilt);\r\n }\r\n\r\n if (isPlainObject(value)) {\r\n const keys = Object.keys(value);\r\n const parts = keys.map((k) => walk(value[k], `${path}.${k}`, onString));\r\n if (parts.some((p) => p.dynamic)) {\r\n return {\r\n dynamic: true,\r\n read: () => {\r\n const out: Record<string, unknown> = {};\r\n keys.forEach((k, i) => {\r\n const part = parts[i];\r\n out[k] = part.dynamic ? part.read() : part.value;\r\n });\r\n return out;\r\n },\r\n };\r\n }\r\n if (!parts.some((p, i) => (p as { value: unknown }).value !== value[keys[i]])) return STATIC(value);\r\n const rebuilt: Record<string, unknown> = {};\r\n keys.forEach((k, i) => { rebuilt[k] = (parts[i] as { value: unknown }).value; });\r\n return STATIC(rebuilt);\r\n }\r\n\r\n return STATIC(value);\r\n}\r\n\r\n/** Compile one authored prop value: a plain value, or the binding it produced. */\r\nexport function bind(value: unknown, resolve: VariableResolver, path = \"props\"): CompiledValue {\r\n return walk(value, path, (source, at) =>\r\n isSource(source)\r\n // The `=` is the document's marker, not the grammar's — strip it here\r\n // and the parser never sees one.\r\n ? { dynamic: true, read: compile(parse(source.slice(1)), resolve, at) }\r\n : STATIC(unescape(source)));\r\n}\r\n\r\n/** Compile a whole props bag. See {@link CompiledProps}. */\r\nexport function bindProps(\r\n props: Record<string, unknown> | undefined,\r\n resolve: VariableResolver,\r\n path = \"props\",\r\n): CompiledProps {\r\n const literal: Record<string, unknown> = {};\r\n const bindings: Record<string, () => unknown> = {};\r\n let hasBindings = false;\r\n\r\n for (const key of Object.keys(props ?? {})) {\r\n const compiled = bind(props![key], resolve, `${path}.${key}`);\r\n if (compiled.dynamic) {\r\n bindings[key] = compiled.read;\r\n hasBindings = true;\r\n } else {\r\n literal[key] = compiled.value;\r\n }\r\n }\r\n return { literal, bindings, hasBindings };\r\n}\r\n\r\n/**\r\n * Find every expression inside an authored value, at any depth.\r\n *\r\n * Used by the validator, which checks that each one parses and names a declared\r\n * variable — the two failures worth catching before anything is built.\r\n */\r\nexport function collect(value: unknown, path: string): ExpressionSite[] {\r\n const out: ExpressionSite[] = [];\r\n walk(value, path, (source, at) => {\r\n if (isSource(source)) out.push({ path: at, source });\r\n return STATIC(source);\r\n });\r\n return out;\r\n}\r\n\r\n/** A bracketed reference. The grammar has no string literals, so a `[` is always one. */\r\nconst REF = /\\[([^[\\]]+)\\]/g;\r\n\r\n/**\r\n * Rewrite the references inside every expression in an authored value.\r\n *\r\n * `rename` sees each reference as written (`\"fade\"`, `\"card.x\"`) and returns its\r\n * replacement, or `undefined` to keep it. What a host moving a subtree between\r\n * documents needs when ids or keys change on the way; a value with nothing to\r\n * rewrite comes back **by identity**, the same as {@link bind}'s static path.\r\n */\r\nexport function renameRefs<T>(value: T, rename: (ref: string) => string | undefined): T {\r\n const result = walk(value, \"\", (source) => {\r\n if (!isSource(source)) return STATIC(source);\r\n return STATIC(source.replace(REF, (whole, ref: string) => {\r\n // The parser trims a reference's name (`[ g ]` reads `g`), so the callback sees it trimmed too.\r\n const next = rename(ref.trim());\r\n return next === undefined ? whole : `[${next}]`;\r\n }));\r\n });\r\n return (result as { value: T }).value;\r\n}\r\n\r\nfunction isPlainObject(v: unknown): v is Record<string, unknown> {\r\n return typeof v === \"object\" && v !== null && !Array.isArray(v);\r\n}\r\n"]}
|
package/dist/document/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export * from "./validate.js";
|
|
|
5
5
|
export * from "./registry.js";
|
|
6
6
|
export * from "./node-descriptor.js";
|
|
7
7
|
export * from "./node-decorator.js";
|
|
8
|
+
export * from "./withdraw.js";
|
|
9
|
+
export * from "./placement.js";
|
|
8
10
|
export * from "./timeline.js";
|
|
9
11
|
export * from "./audio.js";
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/document/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/document/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|
package/dist/document/index.js
CHANGED
|
@@ -5,6 +5,8 @@ export * from "./validate.js";
|
|
|
5
5
|
export * from "./registry.js";
|
|
6
6
|
export * from "./node-descriptor.js";
|
|
7
7
|
export * from "./node-decorator.js";
|
|
8
|
+
export * from "./withdraw.js";
|
|
9
|
+
export * from "./placement.js";
|
|
8
10
|
export * from "./timeline.js";
|
|
9
11
|
export * from "./audio.js";
|
|
10
12
|
// `installBuiltins` is deliberately NOT exported: a `Registry` seeds itself from
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/document/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,iFAAiF;AACjF,2EAA2E;AAC3E,mBAAmB","sourcesContent":["export * from \"./types\";\nexport * from \"./project\";\nexport * from \"./expression\";\nexport * from \"./validate\";\nexport * from \"./registry\";\nexport * from \"./node-descriptor\";\nexport * from \"./node-decorator\";\nexport * from \"./timeline\";\nexport * from \"./audio\";\n// `installBuiltins` is deliberately NOT exported: a `Registry` seeds itself from\n// its own constructor, so a host has no module-scope call for a bundler to\n// tree-shake away.\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/document/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,iFAAiF;AACjF,2EAA2E;AAC3E,mBAAmB","sourcesContent":["export * from \"./types\";\r\nexport * from \"./project\";\r\nexport * from \"./expression\";\r\nexport * from \"./validate\";\r\nexport * from \"./registry\";\r\nexport * from \"./node-descriptor\";\r\nexport * from \"./node-decorator\";\r\nexport * from \"./withdraw\";\r\nexport * from \"./placement\";\r\nexport * from \"./timeline\";\r\nexport * from \"./audio\";\r\n// `installBuiltins` is deliberately NOT exported: a `Registry` seeds itself from\r\n// its own constructor, so a host has no module-scope call for a bundler to\r\n// tree-shake away.\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-decorator.js","sourceRoot":"","sources":["../../src/document/node-decorator.ts"],"names":[],"mappings":"AAEA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,UAAU,IAAI,CAAC,IAAiC;IAClD,iEAAiE;IACjE,4EAA4E;IAC5E,2EAA2E;IAC3E,OAAO;IACP,OAAO,UAAsD,IAAO;QAChE,MAAM,UAAU,GAAuB,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACtF,IAAI,CAAC,SAAqC,CAAC,SAAS,CAAC,GAAG,UAAU,CAAC;QACpE,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC;AACN,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAsC;IACpE,MAAM,KAAK,GAAG,IAAI,CAAC,SAAgD,CAAC;IACpE,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC;QAAE,OAAO,SAAS,CAAC;IACxF,OAAO,KAAK,CAAC,SAAS,CAAuB,CAAC;AAClD,CAAC","sourcesContent":["import type { NodeTypeDescriptor } from \"./node-descriptor\";\n\n/** Symbol under which `@node` metadata is stored on a class prototype. */\nexport const NODE_META = Symbol(\"nodeMeta\");\n\n/**\n * Declare a node class's document key — and nothing else.\n *\n * **It does not register.** Registration happens when the class is handed to a\n * `Registry` (`new Engine(platform, { nodes: [Blob] })`), because a registry is\n * a value an engine owns rather than a table the module graph writes into. A\n * decorator that registered made the *order modules happened to be imported in*\n * part of the engine's state: whichever host loaded first won the key, a second\n * engine in the same process inherited a vocabulary it never asked for, and a\n * class that was merely imported was already registered whether or not anything\n * meant to offer it.\n *\n * What is left is a declaration, read back by {@link getNodeDescriptor}:\n *\n * ```ts\n * @node(\"blob\")\n * class Blob extends Node2D<BlobProps> {\n * @property({ default: 0.4 }) declare readonly wobble: number;\n *\n * @command({ args: [\"wobble\"] })\n * wobbleTo(args: CommandArgs<{ wobble: number }>) { … }\n * }\n *\n * const registry = new Registry({ nodes: [Blob] });\n * // { \"type\": \"blob\", \"props\": { \"wobble\": 0.4 } }\n * ```\n *\n * The full form declares everything a host needs to *offer* the type — the\n * shelves it sits on, how it lays children out, what a freshly placed one is\n * seeded with — which is what a component package used to restate in a\n * `manifest.json` beside a class nothing checked it against:\n *\n * ```ts\n * @node({\n * key: \"lineChart\",\n * forkable: true,\n * layout: { children: \"freeform\", acceptsChildren: true },\n * seed: { width: 760, height: 460 },\n * })\n * ```\n *\n * None of it is read while rendering — see {@link NodeTypeDescriptor}.\n *\n * **The key is written out, not taken from the class name.** A minifier is free\n * to rename `Blob` to `o`, and the key is what stored documents contain — so a\n * derived one would work in development and silently rewrite every document's\n * vocabulary in a production bundle. It is public API, and spelled like it.\n */\nexport function node(type: string | NodeTypeDescriptor) {\n // Deliberately looser than `NodeConstructor`, which takes a bare\n // `Record<string, unknown>`: a real node class declares its own props type,\n // and requiring assignability would reject exactly the classes this exists\n // for.\n return function <T extends new (...args: never[]) => object>(ctor: T): T {\n const descriptor: NodeTypeDescriptor = typeof type === \"string\" ? { key: type } : type;\n (ctor.prototype as Record<symbol, unknown>)[NODE_META] = descriptor;\n return ctor;\n };\n}\n\n/**\n * What `@node` declared on this exact class, or `undefined`.\n *\n * Own prototype only, deliberately: a subclass inherits its parent's methods but\n * not its identity, and a `Card extends Rect` that answered to `\"rect\"` would\n * collide with the real one the moment both were registered.\n */\nexport function getNodeDescriptor(ctor: new (...args: never[]) => object): NodeTypeDescriptor | undefined {\n const proto = ctor.prototype as Record<symbol, unknown> | undefined;\n if (!proto || !Object.prototype.hasOwnProperty.call(proto, NODE_META)) return undefined;\n return proto[NODE_META] as NodeTypeDescriptor;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"node-decorator.js","sourceRoot":"","sources":["../../src/document/node-decorator.ts"],"names":[],"mappings":"AAEA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,UAAU,IAAI,CAAC,IAAiC;IAClD,iEAAiE;IACjE,4EAA4E;IAC5E,2EAA2E;IAC3E,OAAO;IACP,OAAO,UAAsD,IAAO;QAChE,MAAM,UAAU,GAAuB,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACtF,IAAI,CAAC,SAAqC,CAAC,SAAS,CAAC,GAAG,UAAU,CAAC;QACpE,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC;AACN,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAsC;IACpE,MAAM,KAAK,GAAG,IAAI,CAAC,SAAgD,CAAC;IACpE,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC;QAAE,OAAO,SAAS,CAAC;IACxF,OAAO,KAAK,CAAC,SAAS,CAAuB,CAAC;AAClD,CAAC","sourcesContent":["import type { NodeTypeDescriptor } from \"./node-descriptor\";\r\n\r\n/** Symbol under which `@node` metadata is stored on a class prototype. */\r\nexport const NODE_META = Symbol(\"nodeMeta\");\r\n\r\n/**\r\n * Declare a node class's document key — and nothing else.\r\n *\r\n * **It does not register.** Registration happens when the class is handed to a\r\n * `Registry` (`new Engine(platform, { nodes: [Blob] })`), because a registry is\r\n * a value an engine owns rather than a table the module graph writes into. A\r\n * decorator that registered made the *order modules happened to be imported in*\r\n * part of the engine's state: whichever host loaded first won the key, a second\r\n * engine in the same process inherited a vocabulary it never asked for, and a\r\n * class that was merely imported was already registered whether or not anything\r\n * meant to offer it.\r\n *\r\n * What is left is a declaration, read back by {@link getNodeDescriptor}:\r\n *\r\n * ```ts\r\n * @node(\"blob\")\r\n * class Blob extends Node2D<BlobProps> {\r\n * @property({ default: 0.4 }) declare readonly wobble: number;\r\n *\r\n * @command({ args: [\"wobble\"] })\r\n * wobbleTo(args: CommandArgs<{ wobble: number }>) { … }\r\n * }\r\n *\r\n * const registry = new Registry({ nodes: [Blob] });\r\n * // { \"type\": \"blob\", \"props\": { \"wobble\": 0.4 } }\r\n * ```\r\n *\r\n * The full form declares everything a host needs to *offer* the type — the\r\n * shelves it sits on, how it lays children out, what a freshly placed one is\r\n * seeded with — which is what a component package used to restate in a\r\n * `manifest.json` beside a class nothing checked it against:\r\n *\r\n * ```ts\r\n * @node({\r\n * key: \"lineChart\",\r\n * forkable: true,\r\n * layout: { children: \"freeform\", acceptsChildren: true },\r\n * seed: { width: 760, height: 460 },\r\n * })\r\n * ```\r\n *\r\n * None of it is read while rendering — see {@link NodeTypeDescriptor}.\r\n *\r\n * **The key is written out, not taken from the class name.** A minifier is free\r\n * to rename `Blob` to `o`, and the key is what stored documents contain — so a\r\n * derived one would work in development and silently rewrite every document's\r\n * vocabulary in a production bundle. It is public API, and spelled like it.\r\n */\r\nexport function node(type: string | NodeTypeDescriptor) {\r\n // Deliberately looser than `NodeConstructor`, which takes a bare\r\n // `Record<string, unknown>`: a real node class declares its own props type,\r\n // and requiring assignability would reject exactly the classes this exists\r\n // for.\r\n return function <T extends new (...args: never[]) => object>(ctor: T): T {\r\n const descriptor: NodeTypeDescriptor = typeof type === \"string\" ? { key: type } : type;\r\n (ctor.prototype as Record<symbol, unknown>)[NODE_META] = descriptor;\r\n return ctor;\r\n };\r\n}\r\n\r\n/**\r\n * What `@node` declared on this exact class, or `undefined`.\r\n *\r\n * Own prototype only, deliberately: a subclass inherits its parent's methods but\r\n * not its identity, and a `Card extends Rect` that answered to `\"rect\"` would\r\n * collide with the real one the moment both were registered.\r\n */\r\nexport function getNodeDescriptor(ctor: new (...args: never[]) => object): NodeTypeDescriptor | undefined {\r\n const proto = ctor.prototype as Record<symbol, unknown> | undefined;\r\n if (!proto || !Object.prototype.hasOwnProperty.call(proto, NODE_META)) return undefined;\r\n return proto[NODE_META] as NodeTypeDescriptor;\r\n}\r\n"]}
|
|
@@ -46,6 +46,25 @@ export interface NodeTypeDescriptor {
|
|
|
46
46
|
layout?: NodeLayoutDescriptor;
|
|
47
47
|
/** What a freshly placed one's props are seeded with. */
|
|
48
48
|
seed?: Record<string, unknown>;
|
|
49
|
+
/**
|
|
50
|
+
* The types this one goes inside: a plot in a coordinate system, a tangent
|
|
51
|
+
* in a plot. A name also stands for every type built on it ({@link parentKey}).
|
|
52
|
+
* Unsaid, it goes wherever its {@link dimension} allows.
|
|
53
|
+
*
|
|
54
|
+
* A statement about the class, not a rule the engine enforces: a node put
|
|
55
|
+
* elsewhere still builds and usually draws nothing, which is exactly what
|
|
56
|
+
* a host is told here so it can offer the type only where it works. See
|
|
57
|
+
* `placement.ts`.
|
|
58
|
+
*/
|
|
59
|
+
within?: readonly string[];
|
|
60
|
+
/**
|
|
61
|
+
* Types it needs at least one of beside it, under the same parent: an area
|
|
62
|
+
* between curves needs a curve. For a requirement that is not a parent,
|
|
63
|
+
* because the thing needed is shared or there may be several of it.
|
|
64
|
+
*/
|
|
65
|
+
beside?: readonly string[];
|
|
66
|
+
/** Takes only the children that name it in their {@link within}: a plot holds its marks, not a photograph. */
|
|
67
|
+
closed?: boolean;
|
|
49
68
|
/**
|
|
50
69
|
* The editable properties, by key — **derived from `@property`**, never
|
|
51
70
|
* written here.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-descriptor.d.ts","sourceRoot":"","sources":["../../src/document/node-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;;;;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M,MAAM,YAAY,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-descriptor.js","sourceRoot":"","sources":["../../src/document/node-descriptor.ts"],"names":[],"mappings":"","sourcesContent":["import type { PropertyEditor } from \"@/attributes/properties/decorator\";\nimport type { NodeDimension } from \"@/nodes/node/node\";\n\n/**\n * What a node type declares about itself beyond its key.\n *\n * The **technical** description of a type — how it lays children out, what a\n * fresh one is seeded with, what it inherits from. Deliberately *not* how it is\n * presented: no display name, no icon, no shelf, no copy. Those are a host's to\n * resolve and to translate, and a component that carried them would be shipping\n * one language's product decisions inside an engine artifact.\n *\n * It replaced a `manifest.json` written beside each package. Two descriptions of\n * one class is the shape that drifts, and it did: eight of nine packages ended\n * up promising commands their classes had never implemented.\n *\n * **Nothing here is read while rendering.** A frame is identical whether a type\n * declares a seed or not. It exists so a host has one place to ask.\n */\nexport interface NodeTypeDescriptor {\n /**\n * The document key, matching `NodeSpec.type`.\n *\n * **Frozen** for anything already published: a stored document naming it has\n * to keep meaning the same thing forever.\n */\n key: string;\n /** The type it inherits editing sections and commands from, for a host that groups them. */\n parentKey?: string;\n /**\n * Which scene graph the type belongs to — **derived from the class**, never\n * written here, for the same reason {@link properties} is.\n *\n * `dimension` is a getter on the prototype precisely so it answers before a\n * node is constructed, which is what lets a host ask \"can this type go in\n * that tree?\" from the registry alone rather than by building one and\n * catching the throw.\n */\n dimension?: NodeDimension;\n /**\n * Whether a host may copy this component's source.\n *\n * False for anything a host reaches into by identity — its own primitives. A\n * type is forkable exactly when the host knows nothing about it beyond this.\n */\n forkable?: boolean;\n\n layout?: NodeLayoutDescriptor;\n /** What a freshly placed one's props are seeded with. */\n seed?: Record<string, unknown>;\n\n /**\n * The editable properties, by key — **derived from `@property`**, never\n * written here.\n *\n * A hand-written list of a class's properties, beside a class of\n * properties, is exactly the restatement this whole descriptor exists to\n * remove. What a host needs beyond the key — a range, an enum's choices, the\n * controls inside an object-valued prop — is declared on the `@property`\n * itself, which is the thing being edited.\n */\n properties?: Record<string, NodePropertyDescriptor>;\n}\n\n/** One editable property, as a host draws it. */\nexport interface NodePropertyDescriptor extends PropertyEditor {\n /** The control to draw. Always present here, inferred when not declared. */\n kind: string;\n /** What a freshly placed node holds, when the class declares one. */\n default?: unknown;\n}\n\n/** The layout answer a node type's children get from it. */\nexport interface NodeLayoutDescriptor {\n children?: \"flow\" | \"horizontal\" | \"vertical\" | \"grid\" | \"freeform\";\n acceptsChildren?: boolean;\n defaultWidthMode?: NodeSizeMode;\n defaultHeightMode?: NodeSizeMode;\n /** What a freshly placed one is sized to. */\n defaultWidth?: number;\n defaultHeight?: number;\n /** A locked width:height, for a type whose box *is* its design. */\n aspectRatio?: number;\n}\n\n/** How a node type sizes one axis. */\nexport type NodeSizeMode = \"fixed\" | \"hug\" | \"fill\";\n"]}
|
|
1
|
+
{"version":3,"file":"node-descriptor.js","sourceRoot":"","sources":["../../src/document/node-descriptor.ts"],"names":[],"mappings":"","sourcesContent":["import type { PropertyEditor } from \"@/attributes/properties/decorator\";\r\nimport type { NodeDimension } from \"@/nodes/node/node\";\r\n\r\n/**\r\n * What a node type declares about itself beyond its key.\r\n *\r\n * The **technical** description of a type — how it lays children out, what a\r\n * fresh one is seeded with, what it inherits from. Deliberately *not* how it is\r\n * presented: no display name, no icon, no shelf, no copy. Those are a host's to\r\n * resolve and to translate, and a component that carried them would be shipping\r\n * one language's product decisions inside an engine artifact.\r\n *\r\n * It replaced a `manifest.json` written beside each package. Two descriptions of\r\n * one class is the shape that drifts, and it did: eight of nine packages ended\r\n * up promising commands their classes had never implemented.\r\n *\r\n * **Nothing here is read while rendering.** A frame is identical whether a type\r\n * declares a seed or not. It exists so a host has one place to ask.\r\n */\r\nexport interface NodeTypeDescriptor {\r\n /**\r\n * The document key, matching `NodeSpec.type`.\r\n *\r\n * **Frozen** for anything already published: a stored document naming it has\r\n * to keep meaning the same thing forever.\r\n */\r\n key: string;\r\n /** The type it inherits editing sections and commands from, for a host that groups them. */\r\n parentKey?: string;\r\n /**\r\n * Which scene graph the type belongs to — **derived from the class**, never\r\n * written here, for the same reason {@link properties} is.\r\n *\r\n * `dimension` is a getter on the prototype precisely so it answers before a\r\n * node is constructed, which is what lets a host ask \"can this type go in\r\n * that tree?\" from the registry alone rather than by building one and\r\n * catching the throw.\r\n */\r\n dimension?: NodeDimension;\r\n /**\r\n * Whether a host may copy this component's source.\r\n *\r\n * False for anything a host reaches into by identity — its own primitives. A\r\n * type is forkable exactly when the host knows nothing about it beyond this.\r\n */\r\n forkable?: boolean;\r\n\r\n layout?: NodeLayoutDescriptor;\r\n /** What a freshly placed one's props are seeded with. */\r\n seed?: Record<string, unknown>;\r\n\r\n /**\r\n * The types this one goes inside: a plot in a coordinate system, a tangent\r\n * in a plot. A name also stands for every type built on it ({@link parentKey}).\r\n * Unsaid, it goes wherever its {@link dimension} allows.\r\n *\r\n * A statement about the class, not a rule the engine enforces: a node put\r\n * elsewhere still builds and usually draws nothing, which is exactly what\r\n * a host is told here so it can offer the type only where it works. See\r\n * `placement.ts`.\r\n */\r\n within?: readonly string[];\r\n /**\r\n * Types it needs at least one of beside it, under the same parent: an area\r\n * between curves needs a curve. For a requirement that is not a parent,\r\n * because the thing needed is shared or there may be several of it.\r\n */\r\n beside?: readonly string[];\r\n /** Takes only the children that name it in their {@link within}: a plot holds its marks, not a photograph. */\r\n closed?: boolean;\r\n\r\n /**\r\n * The editable properties, by key — **derived from `@property`**, never\r\n * written here.\r\n *\r\n * A hand-written list of a class's properties, beside a class of\r\n * properties, is exactly the restatement this whole descriptor exists to\r\n * remove. What a host needs beyond the key — a range, an enum's choices, the\r\n * controls inside an object-valued prop — is declared on the `@property`\r\n * itself, which is the thing being edited.\r\n */\r\n properties?: Record<string, NodePropertyDescriptor>;\r\n}\r\n\r\n/** One editable property, as a host draws it. */\r\nexport interface NodePropertyDescriptor extends PropertyEditor {\r\n /** The control to draw. Always present here, inferred when not declared. */\r\n kind: string;\r\n /** What a freshly placed node holds, when the class declares one. */\r\n default?: unknown;\r\n}\r\n\r\n/** The layout answer a node type's children get from it. */\r\nexport interface NodeLayoutDescriptor {\r\n children?: \"flow\" | \"horizontal\" | \"vertical\" | \"grid\" | \"freeform\";\r\n acceptsChildren?: boolean;\r\n defaultWidthMode?: NodeSizeMode;\r\n defaultHeightMode?: NodeSizeMode;\r\n /** What a freshly placed one is sized to. */\r\n defaultWidth?: number;\r\n defaultHeight?: number;\r\n /** A locked width:height, for a type whose box *is* its design. */\r\n aspectRatio?: number;\r\n}\r\n\r\n/** How a node type sizes one axis. */\r\nexport type NodeSizeMode = \"fixed\" | \"hug\" | \"fill\";\r\n"]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { Registry } from "./registry.js";
|
|
2
|
+
import { type NodeSpec } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Where a node type may go, read off the registry without building anything:
|
|
5
|
+
* the answer a host needs before it offers a type under a parent, accepts a
|
|
6
|
+
* drop, or lets an assistant create a row.
|
|
7
|
+
*
|
|
8
|
+
* Four things decide it. A parent that takes no children takes none. The two
|
|
9
|
+
* trees do not mix: a `Node3D` lives under a Canvas 3D or another 3D node, and
|
|
10
|
+
* nothing else does. A type that names where it goes ({@link
|
|
11
|
+
* NodeTypeDescriptor.within}) goes only there, and a {@link
|
|
12
|
+
* NodeTypeDescriptor.closed} parent takes only the types that name it. Those
|
|
13
|
+
* are about the parent; {@link NodeTypeDescriptor.beside} is about the
|
|
14
|
+
* siblings, and is kept apart because a host can meet it by adding one.
|
|
15
|
+
*
|
|
16
|
+
* None of it is enforced when a document is built. A node in the wrong place
|
|
17
|
+
* builds and, as a rule, draws nothing; this says why.
|
|
18
|
+
*/
|
|
19
|
+
/** Why a node of a type is not where it can work. */
|
|
20
|
+
export type PlacementIssue =
|
|
21
|
+
/** The parent takes no children. */
|
|
22
|
+
{
|
|
23
|
+
kind: "leaf";
|
|
24
|
+
parent: string;
|
|
25
|
+
}
|
|
26
|
+
/** A 3D node outside a 3D tree, or anything else inside one. */
|
|
27
|
+
| {
|
|
28
|
+
kind: "dimension";
|
|
29
|
+
parent: string | null;
|
|
30
|
+
}
|
|
31
|
+
/** It goes inside one of `within`, and the parent is none of them. */
|
|
32
|
+
| {
|
|
33
|
+
kind: "within";
|
|
34
|
+
within: readonly string[];
|
|
35
|
+
}
|
|
36
|
+
/** The parent takes only the types that name it. */
|
|
37
|
+
| {
|
|
38
|
+
kind: "closed";
|
|
39
|
+
parent: string;
|
|
40
|
+
}
|
|
41
|
+
/** It needs one of `beside` under the same parent, and there is none. */
|
|
42
|
+
| {
|
|
43
|
+
kind: "beside";
|
|
44
|
+
beside: readonly string[];
|
|
45
|
+
};
|
|
46
|
+
export interface PlacementOptions {
|
|
47
|
+
/**
|
|
48
|
+
* A host's own sense of one type standing for another, beside the
|
|
49
|
+
* registry's: a copy of a component it made under a new key is still that
|
|
50
|
+
* component to whatever goes inside it.
|
|
51
|
+
*/
|
|
52
|
+
isA?: (type: string, name: string) => boolean;
|
|
53
|
+
}
|
|
54
|
+
/** Whether `type` is `name`, or is built on it through `parentKey`. */
|
|
55
|
+
export declare function nodeTypeIsA(registry: Registry, type: string, name: string): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Why a node of `child` cannot go directly inside one of `parent`, or `null`
|
|
58
|
+
* when it can. A `null` parent is the document's own root, which is 2D and
|
|
59
|
+
* names nothing.
|
|
60
|
+
*/
|
|
61
|
+
export declare function parentIssue(registry: Registry, child: string, parent: string | null, options?: PlacementOptions): PlacementIssue | null;
|
|
62
|
+
/** The sibling `child` needs that `siblings`, the types already under its parent, do not include; `null` when it needs none or has one. */
|
|
63
|
+
export declare function siblingIssue(registry: Registry, child: string, siblings: readonly string[], options?: PlacementOptions): PlacementIssue | null;
|
|
64
|
+
/**
|
|
65
|
+
* Every node of `nodes` that is not where its type says it goes, by id, with
|
|
66
|
+
* the first reason. A node of an unregistered type is left out: that is a build
|
|
67
|
+
* error, and says so itself.
|
|
68
|
+
*/
|
|
69
|
+
export declare function placementIssues(registry: Registry, nodes: readonly Pick<NodeSpec, "id" | "type" | "parentId">[], options?: PlacementOptions): Map<string, PlacementIssue>;
|
|
70
|
+
//# sourceMappingURL=placement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placement.d.ts","sourceRoot":"","sources":["../../src/document/placement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEtD;;;;;;;;;;;;;;;GAeG;AAEH,qDAAqD;AACrD,MAAM,MAAM,cAAc;AACtB,oCAAoC;AAClC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AAClC,gEAAgE;GAC9D;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE;AAC9C,sEAAsE;GACpE;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE;AAC/C,oDAAoD;GAClD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AACpC,yEAAyE;GACvE;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAEpD,MAAM,WAAW,gBAAgB;IAC7B;;;;OAIG;IACH,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CACjD;AAKD,uEAAuE;AACvE,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAOnF;AAMD;;;;GAIG;AACH,wBAAgB,WAAW,CACvB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,OAAO,GAAE,gBAAqB,GAC/B,cAAc,GAAG,IAAI,CAgBvB;AAED,2IAA2I;AAC3I,wBAAgB,YAAY,CACxB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,OAAO,GAAE,gBAAqB,GAC/B,cAAc,GAAG,IAAI,CAIvB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC3B,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,SAAS,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,MAAM,GAAG,UAAU,CAAC,EAAE,EAC5D,OAAO,GAAE,gBAAqB,GAC/B,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAsB7B"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { ROOT_NODE_ID } from "./types.js";
|
|
2
|
+
/** The one core type whose children are of the other dimension. */
|
|
3
|
+
const CANVAS_3D = "canvas3d";
|
|
4
|
+
/** Whether `type` is `name`, or is built on it through `parentKey`. */
|
|
5
|
+
export function nodeTypeIsA(registry, type, name) {
|
|
6
|
+
const seen = new Set();
|
|
7
|
+
for (let at = type; at !== undefined && !seen.has(at); at = registry.describe(at)?.parentKey) {
|
|
8
|
+
if (at === name)
|
|
9
|
+
return true;
|
|
10
|
+
seen.add(at);
|
|
11
|
+
}
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
function among(registry, type, names, options) {
|
|
15
|
+
return names.some((name) => nodeTypeIsA(registry, type, name) || options.isA?.(type, name) === true);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Why a node of `child` cannot go directly inside one of `parent`, or `null`
|
|
19
|
+
* when it can. A `null` parent is the document's own root, which is 2D and
|
|
20
|
+
* names nothing.
|
|
21
|
+
*/
|
|
22
|
+
export function parentIssue(registry, child, parent, options = {}) {
|
|
23
|
+
const own = registry.describe(child);
|
|
24
|
+
const holder = parent === null ? undefined : registry.describe(parent);
|
|
25
|
+
if (parent !== null && holder?.layout?.acceptsChildren === false)
|
|
26
|
+
return { kind: "leaf", parent };
|
|
27
|
+
const within = own?.within ?? [];
|
|
28
|
+
if (within.length > 0 && (parent === null || !among(registry, parent, within, options))) {
|
|
29
|
+
return { kind: "within", within };
|
|
30
|
+
}
|
|
31
|
+
if (parent !== null && holder?.closed === true && !among(registry, parent, within, options)) {
|
|
32
|
+
return { kind: "closed", parent };
|
|
33
|
+
}
|
|
34
|
+
const inThree = parent !== null && (holder?.dimension === "3d" || among(registry, parent, [CANVAS_3D], options));
|
|
35
|
+
if ((own?.dimension === "3d") !== inThree)
|
|
36
|
+
return { kind: "dimension", parent };
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
/** The sibling `child` needs that `siblings`, the types already under its parent, do not include; `null` when it needs none or has one. */
|
|
40
|
+
export function siblingIssue(registry, child, siblings, options = {}) {
|
|
41
|
+
const beside = registry.describe(child)?.beside ?? [];
|
|
42
|
+
if (beside.length === 0 || siblings.some((type) => among(registry, type, beside, options)))
|
|
43
|
+
return null;
|
|
44
|
+
return { kind: "beside", beside };
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Every node of `nodes` that is not where its type says it goes, by id, with
|
|
48
|
+
* the first reason. A node of an unregistered type is left out: that is a build
|
|
49
|
+
* error, and says so itself.
|
|
50
|
+
*/
|
|
51
|
+
export function placementIssues(registry, nodes, options = {}) {
|
|
52
|
+
// A document may write its stage as a row or leave it out: either way its children's parent is the root.
|
|
53
|
+
const parentOf = (node) => (node.parentId === ROOT_NODE_ID ? null : node.parentId);
|
|
54
|
+
const byId = new Map(nodes.map((node) => [node.id, node]));
|
|
55
|
+
const children = new Map();
|
|
56
|
+
for (const node of nodes) {
|
|
57
|
+
if (node.id === ROOT_NODE_ID)
|
|
58
|
+
continue;
|
|
59
|
+
const under = children.get(parentOf(node));
|
|
60
|
+
if (under)
|
|
61
|
+
under.push(node.type);
|
|
62
|
+
else
|
|
63
|
+
children.set(parentOf(node), [node.type]);
|
|
64
|
+
}
|
|
65
|
+
const issues = new Map();
|
|
66
|
+
for (const node of nodes) {
|
|
67
|
+
if (node.id === ROOT_NODE_ID || !registry.hasNode(node.type))
|
|
68
|
+
continue;
|
|
69
|
+
const parentId = parentOf(node);
|
|
70
|
+
const parentType = parentId === null ? null : (byId.get(parentId)?.type ?? null);
|
|
71
|
+
const issue = parentIssue(registry, node.type, parentType, options) ??
|
|
72
|
+
siblingIssue(registry, node.type, without(children.get(parentId) ?? [], node.type), options);
|
|
73
|
+
if (issue)
|
|
74
|
+
issues.set(node.id, issue);
|
|
75
|
+
}
|
|
76
|
+
return issues;
|
|
77
|
+
}
|
|
78
|
+
// The node's own type once: a second area is a sibling of the first, the first is not its own.
|
|
79
|
+
function without(types, own) {
|
|
80
|
+
const at = types.indexOf(own);
|
|
81
|
+
return at === -1 ? [...types] : [...types.slice(0, at), ...types.slice(at + 1)];
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=placement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placement.js","sourceRoot":"","sources":["../../src/document/placement.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAiB,MAAM,SAAS,CAAC;AAyCtD,mEAAmE;AACnE,MAAM,SAAS,GAAG,UAAU,CAAC;AAE7B,uEAAuE;AACvE,MAAM,UAAU,WAAW,CAAC,QAAkB,EAAE,IAAY,EAAE,IAAY;IACtE,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,IAAI,EAAE,GAAuB,IAAI,EAAE,EAAE,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC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AE,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;QACjG,IAAI,KAAK;YAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,+FAA+F;AAC/F,SAAS,OAAO,CAAC,KAAwB,EAAE,GAAW;IAClD,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC9B,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;AACpF,CAAC","sourcesContent":["import type { Registry } from \"./registry\";\r\nimport { ROOT_NODE_ID, type NodeSpec } from \"./types\";\r\n\r\n/**\r\n * Where a node type may go, read off the registry without building anything:\r\n * the answer a host needs before it offers a type under a parent, accepts a\r\n * drop, or lets an assistant create a row.\r\n *\r\n * Four things decide it. A parent that takes no children takes none. The two\r\n * trees do not mix: a `Node3D` lives under a Canvas 3D or another 3D node, and\r\n * nothing else does. A type that names where it goes ({@link\r\n * NodeTypeDescriptor.within}) goes only there, and a {@link\r\n * NodeTypeDescriptor.closed} parent takes only the types that name it. Those\r\n * are about the parent; {@link NodeTypeDescriptor.beside} is about the\r\n * siblings, and is kept apart because a host can meet it by adding one.\r\n *\r\n * None of it is enforced when a document is built. A node in the wrong place\r\n * builds and, as a rule, draws nothing; this says why.\r\n */\r\n\r\n/** Why a node of a type is not where it can work. */\r\nexport type PlacementIssue =\r\n /** The parent takes no children. */\r\n | { kind: \"leaf\"; parent: string }\r\n /** A 3D node outside a 3D tree, or anything else inside one. */\r\n | { kind: \"dimension\"; parent: string | null }\r\n /** It goes inside one of `within`, and the parent is none of them. */\r\n | { kind: \"within\"; within: readonly string[] }\r\n /** The parent takes only the types that name it. */\r\n | { kind: \"closed\"; parent: string }\r\n /** It needs one of `beside` under the same parent, and there is none. */\r\n | { kind: \"beside\"; beside: readonly string[] };\r\n\r\nexport interface PlacementOptions {\r\n /**\r\n * A host's own sense of one type standing for another, beside the\r\n * registry's: a copy of a component it made under a new key is still that\r\n * component to whatever goes inside it.\r\n */\r\n isA?: (type: string, name: string) => boolean;\r\n}\r\n\r\n/** The one core type whose children are of the other dimension. */\r\nconst CANVAS_3D = \"canvas3d\";\r\n\r\n/** Whether `type` is `name`, or is built on it through `parentKey`. */\r\nexport function nodeTypeIsA(registry: Registry, type: string, name: string): boolean {\r\n const seen = new Set<string>();\r\n for (let at: string | undefined = type; at !== undefined && !seen.has(at); at = registry.describe(at)?.parentKey) {\r\n if (at === name) return true;\r\n seen.add(at);\r\n }\r\n return false;\r\n}\r\n\r\nfunction among(registry: Registry, type: string, names: readonly string[], options: PlacementOptions): boolean {\r\n return names.some((name) => nodeTypeIsA(registry, type, name) || options.isA?.(type, name) === true);\r\n}\r\n\r\n/**\r\n * Why a node of `child` cannot go directly inside one of `parent`, or `null`\r\n * when it can. A `null` parent is the document's own root, which is 2D and\r\n * names nothing.\r\n */\r\nexport function parentIssue(\r\n registry: Registry,\r\n child: string,\r\n parent: string | null,\r\n options: PlacementOptions = {},\r\n): PlacementIssue | null {\r\n const own = registry.describe(child);\r\n const holder = parent === null ? undefined : registry.describe(parent);\r\n if (parent !== null && holder?.layout?.acceptsChildren === false) return { kind: \"leaf\", parent };\r\n\r\n const within = own?.within ?? [];\r\n if (within.length > 0 && (parent === null || !among(registry, parent, within, options))) {\r\n return { kind: \"within\", within };\r\n }\r\n if (parent !== null && holder?.closed === true && !among(registry, parent, within, options)) {\r\n return { kind: \"closed\", parent };\r\n }\r\n\r\n const inThree = parent !== null && (holder?.dimension === \"3d\" || among(registry, parent, [CANVAS_3D], options));\r\n if ((own?.dimension === \"3d\") !== inThree) return { kind: \"dimension\", parent };\r\n return null;\r\n}\r\n\r\n/** The sibling `child` needs that `siblings`, the types already under its parent, do not include; `null` when it needs none or has one. */\r\nexport function siblingIssue(\r\n registry: Registry,\r\n child: string,\r\n siblings: readonly string[],\r\n options: PlacementOptions = {},\r\n): PlacementIssue | null {\r\n const beside = registry.describe(child)?.beside ?? [];\r\n if (beside.length === 0 || siblings.some((type) => among(registry, type, beside, options))) return null;\r\n return { kind: \"beside\", beside };\r\n}\r\n\r\n/**\r\n * Every node of `nodes` that is not where its type says it goes, by id, with\r\n * the first reason. A node of an unregistered type is left out: that is a build\r\n * error, and says so itself.\r\n */\r\nexport function placementIssues(\r\n registry: Registry,\r\n nodes: readonly Pick<NodeSpec, \"id\" | \"type\" | \"parentId\">[],\r\n options: PlacementOptions = {},\r\n): Map<string, PlacementIssue> {\r\n // A document may write its stage as a row or leave it out: either way its children's parent is the root.\r\n const parentOf = (node: Pick<NodeSpec, \"parentId\">) => (node.parentId === ROOT_NODE_ID ? null : node.parentId);\r\n const byId = new Map(nodes.map((node) => [node.id, node]));\r\n const children = new Map<string | null, string[]>();\r\n for (const node of nodes) {\r\n if (node.id === ROOT_NODE_ID) continue;\r\n const under = children.get(parentOf(node));\r\n if (under) under.push(node.type);\r\n else children.set(parentOf(node), [node.type]);\r\n }\r\n const issues = new Map<string, PlacementIssue>();\r\n for (const node of nodes) {\r\n if (node.id === ROOT_NODE_ID || !registry.hasNode(node.type)) continue;\r\n const parentId = parentOf(node);\r\n const parentType = parentId === null ? null : (byId.get(parentId)?.type ?? null);\r\n const issue =\r\n parentIssue(registry, node.type, parentType, options) ??\r\n siblingIssue(registry, node.type, without(children.get(parentId) ?? [], node.type), options);\r\n if (issue) issues.set(node.id, issue);\r\n }\r\n return issues;\r\n}\r\n\r\n// The node's own type once: a second area is a sibling of the first, the first is not its own.\r\nfunction without(types: readonly string[], own: string): string[] {\r\n const at = types.indexOf(own);\r\n return at === -1 ? [...types] : [...types.slice(0, at), ...types.slice(at + 1)];\r\n}\r\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Size2D } from "../attributes/layout/size.js";
|
|
2
2
|
import type { Theme } from "../project/config.js";
|
|
3
|
-
import type { ClipDocument,
|
|
3
|
+
import type { ClipDocument, VisualDocument } from "./types.js";
|
|
4
4
|
/**
|
|
5
5
|
* The **project** as data: a whole video, not one clip — and the one thing the
|
|
6
6
|
* runtime plays.
|
|
@@ -83,7 +83,7 @@ export declare function isProjectDocument(doc: unknown): doc is ProjectDocument;
|
|
|
83
83
|
* Viewport and fps describe the output rather than the clip, so they come from
|
|
84
84
|
* the caller.
|
|
85
85
|
*/
|
|
86
|
-
export declare function asProjectDocument(doc: ProjectDocument |
|
|
86
|
+
export declare function asProjectDocument(doc: ProjectDocument | VisualDocument, output?: {
|
|
87
87
|
name?: string;
|
|
88
88
|
viewport?: Size2D;
|
|
89
89
|
fps?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/document/project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/document/project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG5D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,SAAS,CAAC;IAChB,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;;OAGG;IACH,MAAM,EAAE,KAAK,EAAE,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,KAAK;IAClB;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,IAAI,EAAE,YAAY,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;;OAQG;IACH,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,gDAAgD;AAChD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,eAAe,CAEtE;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC7B,GAAG,EAAE,eAAe,GAAG,cAAc,EACrC,MAAM,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAChE,eAAe,CAUjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/document/project.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AA6E3C,gDAAgD;AAChD,MAAM,UAAU,iBAAiB,CAAC,GAAY;IAC1C,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAK,GAAuB,CAAC,IAAI,KAAK,SAAS,CAAC;AAClG,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC7B,
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/document/project.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AA6E3C,gDAAgD;AAChD,MAAM,UAAU,iBAAiB,CAAC,GAAY;IAC1C,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAK,GAAuB,CAAC,IAAI,KAAK,SAAS,CAAC;AAClG,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC7B,GAAqC,EACrC,SAA6D,EAAE;IAE/D,IAAI,iBAAiB,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IACvC,OAAO;QACH,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,UAAU;QAC/B,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC;KACvE,CAAC;AACN,CAAC","sourcesContent":["import type { Size2D } from \"@/attributes/layout/size\";\r\nimport type { Theme } from \"@/project/config\";\r\n\r\nimport type { ClipDocument, VisualDocument } from \"./types\";\r\nimport { documentDuration } from \"./types\";\r\n\r\n/**\r\n * The **project** as data: a whole video, not one clip — and the one thing the\r\n * runtime plays.\r\n *\r\n * A clip document says what happens inside one composition. This says how those\r\n * compositions are laid against each other to make the finished thing — and it\r\n * is the same idea one level up, so it reads the same way: rows placed at times,\r\n * evaluated rather than played.\r\n *\r\n * ### One list of tracks\r\n *\r\n * A {@link ClipDocument} is a still, a composition *or* an audio document, and a\r\n * composition already carries both picture and sound — so there is one list for\r\n * all of it, not a second one for sound.\r\n *\r\n * **Array position is paint order**, first entry at the back, exactly as\r\n * position in a `fill` array is. A background is the first track; an overlay is\r\n * the last; a cross-dissolve is two tracks whose spans overlap and whose clips\r\n * fade themselves.\r\n */\r\nexport interface ProjectDocument {\r\n kind: \"project\";\r\n /** Human-readable project name. */\r\n name: string;\r\n /** Target frame rate. Defaults to 60. */\r\n fps?: number;\r\n /** Output canvas dimensions in pixels. Defaults to 1920×1080. */\r\n viewport?: Size2D;\r\n /** Visual design tokens (colors, typography) available to every clip. */\r\n theme?: Theme;\r\n /**\r\n * Every clip, placed. **Array position is paint order** — the first entry is\r\n * at the back.\r\n */\r\n tracks: Track[];\r\n}\r\n\r\n/**\r\n * One clip, placed on the project timeline.\r\n *\r\n * The clip document is **inline**, not referenced by id. A shared id would deduplicate JSON and\r\n * cost an id space, a resolution step and a dangling-reference failure mode — and\r\n * it would not buy what it looks like it buys, because the content that actually\r\n * repeats in an edit mostly has to *differ* per placement (a lower third with\r\n * different text, a chapter card with a different label).\r\n */\r\nexport interface Track {\r\n /**\r\n * Stable identity, so a host can address, reorder and diff one row — and so\r\n * the runtime can keep a track's built tree across an edit that leaves its\r\n * clip untouched.\r\n */\r\n id: string;\r\n /** Display label. */\r\n name?: string;\r\n /** What plays: a still, a composition, or sound. */\r\n clip: ClipDocument;\r\n /**\r\n * Second on the **project** timeline at which this clip's own clock reads 0.\r\n * Authored, never derived from the row above it, so a clip's start cannot\r\n * move because a neighbour changed. Defaults to 0.\r\n */\r\n startAt?: number;\r\n /**\r\n * Seconds this clip occupies. **Required.**\r\n *\r\n * So a project's length is arithmetic over its tracks rather than something\r\n * measured out of a media file or a timeline — a three-minute music bed\r\n * cannot silently make a thirty-second edit three minutes long. Longer than\r\n * the document holds its last frame; shorter cuts it off, which is also what\r\n * lets a **still**, a document with no length at all, be a backdrop.\r\n */\r\n duration: number;\r\n}\r\n\r\n/** Narrows an unknown document to a project. */\r\nexport function isProjectDocument(doc: unknown): doc is ProjectDocument {\r\n return typeof doc === \"object\" && doc !== null && (doc as ProjectDocument).kind === \"project\";\r\n}\r\n\r\n/**\r\n * The project a session plays, from either document it can open.\r\n *\r\n * A lone still or composition becomes the only track of a project around it.\r\n * Viewport and fps describe the output rather than the clip, so they come from\r\n * the caller.\r\n */\r\nexport function asProjectDocument(\r\n doc: ProjectDocument | VisualDocument,\r\n output: { name?: string; viewport?: Size2D; fps?: number } = {},\r\n): ProjectDocument {\r\n if (isProjectDocument(doc)) return doc;\r\n return {\r\n kind: \"project\",\r\n name: output.name ?? \"Untitled\",\r\n fps: output.fps,\r\n viewport: output.viewport,\r\n theme: doc.theme,\r\n tracks: [{ id: \"clip\", clip: doc, duration: documentDuration(doc) }],\r\n };\r\n}\r\n"]}
|
|
@@ -122,6 +122,13 @@ export type CommandTypeEntry = {
|
|
|
122
122
|
* renderer bug. A command opting in is saying its args reach `set()`.
|
|
123
123
|
*/
|
|
124
124
|
binds?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* The method it runs on its target, where it runs one: the paint
|
|
127
|
+
* commands call the node's own `fillTo`, `strokeTo`, …. A node type
|
|
128
|
+
* without it, or one that withdrew it, does not take the command
|
|
129
|
+
* ({@link Registry.takesCommand}).
|
|
130
|
+
*/
|
|
131
|
+
method?: string;
|
|
125
132
|
} | {
|
|
126
133
|
key: string;
|
|
127
134
|
scope: "variable";
|
|
@@ -143,6 +150,8 @@ export interface NodeTypeRecord {
|
|
|
143
150
|
ctor: NodeConstructor;
|
|
144
151
|
/** Its commands, by the key a document names them with. */
|
|
145
152
|
commands: ReadonlyMap<string, NodeCommandEntry>;
|
|
153
|
+
/** Commands it inherits and withdrew (`withdraw`): never offered, still dispatched for a stored document that names one. */
|
|
154
|
+
withdrawn: ReadonlyMap<string, NodeCommandEntry>;
|
|
146
155
|
/**
|
|
147
156
|
* What the type declares about itself — see {@link NodeTypeDescriptor}.
|
|
148
157
|
*
|
|
@@ -168,29 +177,29 @@ export interface NodeCommandEntry {
|
|
|
168
177
|
* string, via {@link Registry.addNodeFromSource}.
|
|
169
178
|
*
|
|
170
179
|
* Entirely host-supplied — `core` has no compiler dependency and cannot
|
|
171
|
-
* import the published
|
|
180
|
+
* import the published `@motionscript/sdk` barrel itself (that package
|
|
172
181
|
* depends on `core`, so the reverse direction would be circular).
|
|
173
182
|
*/
|
|
174
183
|
export interface DynamicNodeConfig {
|
|
175
184
|
/**
|
|
176
|
-
* What `require("motionscript")` resolves to inside a compiled
|
|
177
|
-
* the host's own already-loaded sdk barrel instance. Must be the
|
|
178
|
-
* module instance the rest of the app uses, or `instanceof` silently
|
|
179
|
-
* fails against it. `
|
|
180
|
-
*
|
|
181
|
-
*
|
|
185
|
+
* What `require("@motionscript/sdk")` resolves to inside a compiled
|
|
186
|
+
* script — the host's own already-loaded sdk barrel instance. Must be the
|
|
187
|
+
* same module instance the rest of the app uses, or `instanceof` silently
|
|
188
|
+
* fails against it. The earlier unscoped specifiers, `"motionscript"` and
|
|
189
|
+
* the dashed `"motion-script"`, resolve to the same object, so a node
|
|
190
|
+
* script authored under either name keeps compiling unmodified.
|
|
182
191
|
*/
|
|
183
192
|
sdk: Record<string, unknown>;
|
|
184
193
|
/**
|
|
185
|
-
* What `require("motionscript/jsx-runtime")` resolves to (also under
|
|
186
|
-
* legacy `motion-script/jsx-runtime`
|
|
187
|
-
* that uses JSX outright.
|
|
194
|
+
* What `require("@motionscript/sdk/jsx-runtime")` resolves to (also under
|
|
195
|
+
* the legacy `motionscript/jsx-runtime` and `motion-script/jsx-runtime`
|
|
196
|
+
* specifiers). Omit to reject a script that uses JSX outright.
|
|
188
197
|
*/
|
|
189
198
|
jsxRuntime?: Record<string, unknown>;
|
|
190
199
|
/**
|
|
191
200
|
* Further modules a script may `require`, by exact specifier — what a
|
|
192
|
-
* forked component imports beyond the sdk
|
|
193
|
-
* `@motionscript/
|
|
201
|
+
* forked component imports beyond the sdk barrel:
|
|
202
|
+
* `@motionscript/sdk/component`, its package's kit. Consulted after the
|
|
194
203
|
* two above, so neither can be shadowed. Each value has to be the host's
|
|
195
204
|
* own loaded instance, for the same `instanceof` reason as `sdk`.
|
|
196
205
|
*/
|
|
@@ -314,6 +323,7 @@ export declare class Registry {
|
|
|
314
323
|
addCommand(key: string, factory: CommandFactory, options?: {
|
|
315
324
|
binds?: boolean;
|
|
316
325
|
args?: readonly CommandArg[];
|
|
326
|
+
method?: string;
|
|
317
327
|
}): this;
|
|
318
328
|
/**
|
|
319
329
|
* Register a command that writes a **variable** rather than a node.
|
|
@@ -335,6 +345,13 @@ export declare class Registry {
|
|
|
335
345
|
* source, and an `instanceof` against the original is false for it.
|
|
336
346
|
*/
|
|
337
347
|
nodeCommand(nodeTypeKey: string, commandKey: string): CommandFactory | undefined;
|
|
348
|
+
/**
|
|
349
|
+
* Whether a node of `nodeTypeKey` takes `commandKey`: one its own table
|
|
350
|
+
* publishes, or a node-less one that acts on a node (`to`, `fillTo`) unless
|
|
351
|
+
* the method it runs is one the type lacks or withdrew. What a host offers a
|
|
352
|
+
* node is its table and the node-less commands it takes.
|
|
353
|
+
*/
|
|
354
|
+
takesCommand(nodeTypeKey: string, commandKey: string): boolean;
|
|
338
355
|
/**
|
|
339
356
|
* Every command key available. With a node type, that type's own table;
|
|
340
357
|
* without one, the node-less commands. Sorted, so the order is stable.
|
|
@@ -419,10 +436,11 @@ export declare class Registry {
|
|
|
419
436
|
*
|
|
420
437
|
* `new Function` in-realm, never a blob module or a worker — see
|
|
421
438
|
* {@link DynamicNodeConfig} and `deny-globals.ts` for why. `require()` is
|
|
422
|
-
* locked to exactly `"motionscript"`/`"motionscript/jsx-runtime"`
|
|
423
|
-
* the
|
|
424
|
-
*
|
|
425
|
-
* only so `require("constructor")` cannot
|
|
439
|
+
* locked to exactly `"@motionscript/sdk"`/`"@motionscript/sdk/jsx-runtime"`
|
|
440
|
+
* (plus the earlier unscoped `"motionscript"` and `"motion-script"`
|
|
441
|
+
* spellings, so a script written under either name still compiles) and
|
|
442
|
+
* the host's `modules`, own keys only so `require("constructor")` cannot
|
|
443
|
+
* reach `Object`. No relative
|
|
426
444
|
* imports, since a dynamic node is one script, not a package.
|
|
427
445
|
*/
|
|
428
446
|
private _evalNodeModule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/document/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAiB,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAe,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAkB,KAAK,UAAU,EAAE,KAAK,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACvG,OAAO,EAEH,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,MAAM,EACd,MAAM,iCAAiC,CAAC;AAIzC,OAAO,KAAK,EAA0B,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/document/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAiB,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAe,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAkB,KAAK,UAAU,EAAE,KAAK,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACvG,OAAO,EAEH,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,MAAM,EACd,MAAM,iCAAiC,CAAC;AAIzC,OAAO,KAAK,EAA0B,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAUxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,yFAAyF;AACzF,MAAM,MAAM,eAAe,GAAG,KAAK,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,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