@motionscript/core 0.1.0-alpha.3 → 0.1.0-alpha.6
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 +247 -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 +79 -4
- 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 +17 -2
- package/dist/attributes/audio/request.d.ts.map +1 -1
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +4 -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.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 +3 -1
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- 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.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-2RIYH36X.js +3 -0
- package/dist/browser/chunks/chunk-2RIYH36X.js.map +7 -0
- package/dist/browser/chunks/chunk-DDJN3QII.js +15 -0
- package/dist/browser/chunks/chunk-DDJN3QII.js.map +7 -0
- package/dist/browser/chunks/chunk-DHB4COFY.js +2 -0
- package/dist/browser/chunks/chunk-DHB4COFY.js.map +7 -0
- package/dist/browser/chunks/chunk-EJDPYDQI.js +5 -0
- package/dist/browser/chunks/chunk-EJDPYDQI.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/chunks/chunk-XAWE4EAK.js +2 -0
- package/dist/browser/chunks/chunk-XAWE4EAK.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/component.js.map +4 -4
- package/dist/browser/experimental.js +2 -0
- package/dist/browser/experimental.js.map +7 -0
- 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 +4 -2
- package/dist/browser/sdk.js +1 -1
- package/dist/component/api.d.ts +508 -0
- package/dist/component/api.d.ts.map +1 -0
- package/dist/component/api.js +4 -0
- package/dist/component/api.js.map +1 -0
- package/dist/component/builtins/audio.d.ts +26 -0
- package/dist/component/builtins/audio.d.ts.map +1 -0
- package/dist/component/builtins/audio.js +41 -0
- package/dist/component/builtins/audio.js.map +1 -0
- package/dist/component/builtins/canvas3d.d.ts +98 -0
- package/dist/component/builtins/canvas3d.d.ts.map +1 -0
- package/dist/component/builtins/canvas3d.js +21 -0
- package/dist/component/builtins/canvas3d.js.map +1 -0
- package/dist/component/builtins/composite.d.ts +56 -0
- package/dist/component/builtins/composite.d.ts.map +1 -0
- package/dist/component/builtins/composite.js +25 -0
- package/dist/component/builtins/composite.js.map +1 -0
- package/dist/component/builtins/geometry.d.ts +505 -0
- package/dist/component/builtins/geometry.d.ts.map +1 -0
- package/dist/component/builtins/geometry.js +107 -0
- package/dist/component/builtins/geometry.js.map +1 -0
- package/dist/component/builtins/layout.d.ts +88 -0
- package/dist/component/builtins/layout.d.ts.map +1 -0
- package/dist/component/builtins/layout.js +84 -0
- package/dist/component/builtins/layout.js.map +1 -0
- package/dist/component/builtins/media.d.ts +95 -0
- package/dist/component/builtins/media.d.ts.map +1 -0
- package/dist/component/builtins/media.js +149 -0
- package/dist/component/builtins/media.js.map +1 -0
- package/dist/component/builtins/providers.d.ts +23 -0
- package/dist/component/builtins/providers.d.ts.map +1 -0
- package/dist/component/builtins/providers.js +30 -0
- package/dist/component/builtins/providers.js.map +1 -0
- package/dist/component/builtins/text.d.ts +193 -0
- package/dist/component/builtins/text.d.ts.map +1 -0
- package/dist/component/builtins/text.js +113 -0
- package/dist/component/builtins/text.js.map +1 -0
- package/dist/component/builtins/three.d.ts +1085 -0
- package/dist/component/builtins/three.d.ts.map +1 -0
- package/dist/component/builtins/three.js +265 -0
- package/dist/component/builtins/three.js.map +1 -0
- package/dist/component/clip-of.d.ts +5 -0
- package/dist/component/clip-of.d.ts.map +1 -0
- package/dist/component/clip-of.js +33 -0
- package/dist/component/clip-of.js.map +1 -0
- package/dist/component/commands-for.d.ts +19 -0
- package/dist/component/commands-for.d.ts.map +1 -0
- package/dist/component/commands-for.js +5 -0
- package/dist/component/commands-for.js.map +1 -0
- package/dist/component/component-audio.d.ts +9 -0
- package/dist/component/component-audio.d.ts.map +1 -0
- package/dist/component/component-audio.js +18 -0
- package/dist/component/component-audio.js.map +1 -0
- package/dist/component/component2d.d.ts +9 -0
- package/dist/component/component2d.d.ts.map +1 -0
- package/dist/component/component2d.js +239 -0
- package/dist/component/component2d.js.map +1 -0
- package/dist/component/component3d.d.ts +9 -0
- package/dist/component/component3d.d.ts.map +1 -0
- package/dist/component/component3d.js +99 -0
- package/dist/component/component3d.js.map +1 -0
- package/dist/component/factory.d.ts +63 -0
- package/dist/component/factory.d.ts.map +1 -0
- package/dist/component/factory.js +313 -0
- package/dist/component/factory.js.map +1 -0
- package/dist/component/modules/aim.d.ts +30 -0
- package/dist/component/modules/aim.d.ts.map +1 -0
- package/dist/component/modules/aim.js +39 -0
- package/dist/component/modules/aim.js.map +1 -0
- package/dist/component/modules/corners.d.ts +13 -0
- package/dist/component/modules/corners.d.ts.map +1 -0
- package/dist/component/modules/corners.js +12 -0
- package/dist/component/modules/corners.js.map +1 -0
- package/dist/component/modules/flow.d.ts +26 -0
- package/dist/component/modules/flow.d.ts.map +1 -0
- package/dist/component/modules/flow.js +55 -0
- package/dist/component/modules/flow.js.map +1 -0
- package/dist/component/modules/material.d.ts +40 -0
- package/dist/component/modules/material.d.ts.map +1 -0
- package/dist/component/modules/material.js +75 -0
- package/dist/component/modules/material.js.map +1 -0
- package/dist/component/modules/paint.d.ts +71 -0
- package/dist/component/modules/paint.d.ts.map +1 -0
- package/dist/component/modules/paint.js +106 -0
- package/dist/component/modules/paint.js.map +1 -0
- package/dist/component/modules/shapes.d.ts +31 -0
- package/dist/component/modules/shapes.d.ts.map +1 -0
- package/dist/component/modules/shapes.js +43 -0
- package/dist/component/modules/shapes.js.map +1 -0
- package/dist/component/modules/text-layout.d.ts +26 -0
- package/dist/component/modules/text-layout.d.ts.map +1 -0
- package/dist/component/modules/text-layout.js +57 -0
- package/dist/component/modules/text-layout.js.map +1 -0
- package/dist/component/modules/text-style.d.ts +48 -0
- package/dist/component/modules/text-style.d.ts.map +1 -0
- package/dist/component/modules/text-style.js +63 -0
- package/dist/component/modules/text-style.js.map +1 -0
- package/dist/component/modules/three-entries.d.ts +23 -0
- package/dist/component/modules/three-entries.d.ts.map +1 -0
- package/dist/component/modules/three-entries.js +41 -0
- package/dist/component/modules/three-entries.js.map +1 -0
- package/dist/component/modules/view3d.d.ts +55 -0
- package/dist/component/modules/view3d.d.ts.map +1 -0
- package/dist/component/modules/view3d.js +160 -0
- package/dist/component/modules/view3d.js.map +1 -0
- package/dist/component/timeline.d.ts +22 -0
- package/dist/component/timeline.d.ts.map +1 -0
- package/dist/component/timeline.js +128 -0
- package/dist/component/timeline.js.map +1 -0
- package/dist/component/type-def.d.ts +26 -0
- package/dist/component/type-def.d.ts.map +1 -0
- package/dist/component/type-def.js +16 -0
- package/dist/component/type-def.js.map +1 -0
- package/dist/component/types.d.ts +91 -0
- package/dist/component/types.d.ts.map +1 -0
- package/dist/component/types.js +88 -0
- package/dist/component/types.js.map +1 -0
- package/dist/component/views.d.ts +121 -0
- package/dist/component/views.d.ts.map +1 -0
- package/dist/component/views.js +413 -0
- package/dist/component/views.js.map +1 -0
- package/dist/component.d.ts +4 -5
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +3 -5
- package/dist/component.js.map +1 -1
- package/dist/document/audio.d.ts +10 -2
- package/dist/document/audio.d.ts.map +1 -1
- package/dist/document/audio.js +45 -4
- package/dist/document/audio.js.map +1 -1
- package/dist/document/builtins.d.ts.map +1 -1
- package/dist/document/builtins.js +15 -39
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +1 -1
- package/dist/document/command-traits.js +16 -1
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/diff.d.ts.map +1 -1
- package/dist/document/diff.js +3 -3
- package/dist/document/diff.js.map +1 -1
- package/dist/document/doc-index.d.ts +2 -2
- package/dist/document/doc-index.d.ts.map +1 -1
- package/dist/document/doc-index.js +3 -3
- package/dist/document/doc-index.js.map +1 -1
- package/dist/document/expression/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 +25 -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 +23 -11
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +46 -19
- package/dist/document/registry.js.map +1 -1
- package/dist/document/settled-index.d.ts +49 -0
- package/dist/document/settled-index.d.ts.map +1 -0
- package/dist/document/settled-index.js +247 -0
- package/dist/document/settled-index.js.map +1 -0
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.d.ts +100 -19
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +290 -42
- 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/experimental.d.ts +22 -0
- package/dist/experimental.d.ts.map +1 -0
- package/dist/experimental.js +20 -0
- package/dist/experimental.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -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 +180 -28
- 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.d.ts +2 -2
- package/dist/nodes/audio/index.d.ts.map +1 -1
- package/dist/nodes/audio/index.js +0 -2
- package/dist/nodes/audio/index.js.map +1 -1
- package/dist/nodes/audio/node-audio.js.map +1 -1
- package/dist/nodes/audio/sound-node.d.ts +4 -3
- package/dist/nodes/audio/sound-node.d.ts.map +1 -1
- package/dist/nodes/audio/sound-node.js +4 -1
- 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 +40 -33
- package/dist/nodes/index.d.ts.map +1 -1
- package/dist/nodes/index.js +17 -36
- 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 +2 -0
- 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 +12 -4
- package/dist/nodes/node/node.d.ts.map +1 -1
- package/dist/nodes/node/node.js +67 -27
- 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 +4 -3
- package/dist/nodes/root/canvas2d-node.d.ts.map +1 -0
- package/dist/nodes/{scene → root}/canvas2d-node.js +5 -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.d.ts +0 -5
- package/dist/nodes/text/richtext-node.d.ts.map +1 -1
- package/dist/nodes/text/richtext-node.js +6 -72
- package/dist/nodes/text/richtext-node.js.map +1 -1
- package/dist/nodes/text/text-base.d.ts +5 -22
- package/dist/nodes/text/text-base.d.ts.map +1 -1
- package/dist/nodes/text/text-base.js +13 -364
- package/dist/nodes/text/text-base.js.map +1 -1
- package/dist/nodes/text/text-layout.d.ts +87 -0
- package/dist/nodes/text/text-layout.d.ts.map +1 -0
- package/dist/nodes/text/text-layout.js +368 -0
- package/dist/nodes/text/text-layout.js.map +1 -0
- package/dist/nodes/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 +32 -7
- package/dist/nodes/three/canvas3d-node.d.ts.map +1 -1
- package/dist/nodes/three/canvas3d-node.js +50 -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 +2 -2
- package/dist/render/canvas-render-context2d.d.ts.map +1 -1
- 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 +2 -2
- 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.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.js.map +1 -1
- package/dist/runtime/builtin-context.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +9 -4
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +27 -9
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +18 -0
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +97 -0
- 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 +124 -10
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +13 -5
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +10 -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.d.ts.map +1 -1
- package/dist/runtime/text-geometry.js +7 -3
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +50 -25
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +52 -42
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +2 -0
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.d.ts +12 -0
- package/dist/tween/command.d.ts.map +1 -1
- package/dist/tween/command.js +14 -0
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/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 +1 -1
- 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 +7 -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-KJXGRHOL.js +0 -3
- package/dist/browser/chunks/chunk-KJXGRHOL.js.map +0 -7
- package/dist/browser/chunks/chunk-TGDX2SS2.js +0 -18
- package/dist/browser/chunks/chunk-TGDX2SS2.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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AssetManifest } from "../assets/manifest.js";
|
|
2
2
|
import type { ProjectDocument } from "../document/project.js";
|
|
3
3
|
import type { Registry } from "../document/registry.js";
|
|
4
|
+
import type { FrameSpec } from "../runtime/frame-time.js";
|
|
4
5
|
/**
|
|
5
6
|
* Encoding settings, passed through to whatever the platform's exporter uses.
|
|
6
7
|
*
|
|
@@ -8,6 +9,11 @@ import type { Registry } from "../document/registry.js";
|
|
|
8
9
|
* backend might take: `core` has no opinion about encoders.
|
|
9
10
|
*/
|
|
10
11
|
export type EncodeOptions = Record<string, unknown>;
|
|
12
|
+
/** A run of project frames: `start` included, `end` not. */
|
|
13
|
+
export interface FrameRange {
|
|
14
|
+
start: number;
|
|
15
|
+
end: number;
|
|
16
|
+
}
|
|
11
17
|
/** What an {@link Exporter} needs to encode a timeline. */
|
|
12
18
|
export interface ExportVideoRequest {
|
|
13
19
|
/** The project, its fps and viewport resolved — see `Session.document`. Carries its theme. */
|
|
@@ -18,6 +24,12 @@ export interface ExportVideoRequest {
|
|
|
18
24
|
scale?: number;
|
|
19
25
|
manifest?: AssetManifest;
|
|
20
26
|
includeAudio?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Encode only these frames, as a file of their own that starts at 0. It is
|
|
29
|
+
* always silent: a range is one segment of a split export, whose audio is
|
|
30
|
+
* mixed once over the whole timeline.
|
|
31
|
+
*/
|
|
32
|
+
frames?: FrameRange;
|
|
21
33
|
/** Progress through the export, in `[0, 1]`. */
|
|
22
34
|
onProgress?: (progress: number) => void;
|
|
23
35
|
signal?: AbortSignal;
|
|
@@ -27,14 +39,7 @@ export interface ExportVideoRequest {
|
|
|
27
39
|
export interface ExportStillRequest {
|
|
28
40
|
project: ProjectDocument;
|
|
29
41
|
registry: Registry;
|
|
30
|
-
frame:
|
|
31
|
-
kind: "frame";
|
|
32
|
-
frame: number;
|
|
33
|
-
} | {
|
|
34
|
-
kind: "first";
|
|
35
|
-
} | {
|
|
36
|
-
kind: "last";
|
|
37
|
-
};
|
|
42
|
+
frame: FrameSpec;
|
|
38
43
|
scale?: number;
|
|
39
44
|
manifest?: AssetManifest;
|
|
40
45
|
format?: "png" | "jpeg";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exporter.d.ts","sourceRoot":"","sources":["../../src/platform/exporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"exporter.d.ts","sourceRoot":"","sources":["../../src/platform/exporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEpD,4DAA4D;AAC5D,MAAM,WAAW,UAAU;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACf;AAED,2DAA2D;AAC3D,MAAM,WAAW,kBAAkB;IAC/B,8FAA8F;IAC9F,OAAO,EAAE,eAAe,CAAC;IACzB,sEAAsE;IACtE,QAAQ,EAAE,QAAQ,CAAC;IACnB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;OAIG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,gDAAgD;IAChD,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE,aAAa,CAAC;CAC1B;AAED,0DAA0D;AAC1D,MAAM,WAAW,kBAAkB;IAC/B,OAAO,EAAE,eAAe,CAAC;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,WAAW,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,UAAU,CAAC;IAClB,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACrB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IACrE,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CACpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exporter.js","sourceRoot":"","sources":["../../src/platform/exporter.ts"],"names":[],"mappings":"","sourcesContent":["import { AssetManifest } from \"@/assets/manifest\";\nimport type { ProjectDocument } from \"@/document/project\";\nimport type { Registry } from \"@/document/registry\";\n\n/**\n * Encoding settings, passed through to whatever the platform's exporter uses.\n *\n * Deliberately `unknown`-shaped rather than a union of every codec option each\n * backend might take: `core` has no opinion about encoders.\n */\nexport type EncodeOptions = Record<string, unknown>;\n\n/** What an {@link Exporter} needs to encode a timeline. */\nexport interface ExportVideoRequest {\n /** The project, its fps and viewport resolved — see `Session.document`. Carries its theme. */\n project: ProjectDocument;\n /** The vocabulary its clips compile against: the opening engine's. */\n registry: Registry;\n /** Resolution multiplier on the viewport. Default 1. */\n scale?: number;\n manifest?: AssetManifest;\n includeAudio?: boolean;\n /** Progress through the export, in `[0, 1]`. */\n onProgress?: (progress: number) => void;\n signal?: AbortSignal;\n encode?: EncodeOptions;\n}\n\n/** What an {@link Exporter} needs to encode one frame. */\nexport interface ExportStillRequest {\n project: ProjectDocument;\n registry: Registry;\n frame:
|
|
1
|
+
{"version":3,"file":"exporter.js","sourceRoot":"","sources":["../../src/platform/exporter.ts"],"names":[],"mappings":"","sourcesContent":["import { AssetManifest } from \"@/assets/manifest\";\r\nimport type { ProjectDocument } from \"@/document/project\";\r\nimport type { Registry } from \"@/document/registry\";\r\nimport type { FrameSpec } from \"@/runtime/frame-time\";\r\n\r\n/**\r\n * Encoding settings, passed through to whatever the platform's exporter uses.\r\n *\r\n * Deliberately `unknown`-shaped rather than a union of every codec option each\r\n * backend might take: `core` has no opinion about encoders.\r\n */\r\nexport type EncodeOptions = Record<string, unknown>;\r\n\r\n/** A run of project frames: `start` included, `end` not. */\r\nexport interface FrameRange {\r\n start: number;\r\n end: number;\r\n}\r\n\r\n/** What an {@link Exporter} needs to encode a timeline. */\r\nexport interface ExportVideoRequest {\r\n /** The project, its fps and viewport resolved — see `Session.document`. Carries its theme. */\r\n project: ProjectDocument;\r\n /** The vocabulary its clips compile against: the opening engine's. */\r\n registry: Registry;\r\n /** Resolution multiplier on the viewport. Default 1. */\r\n scale?: number;\r\n manifest?: AssetManifest;\r\n includeAudio?: boolean;\r\n /**\r\n * Encode only these frames, as a file of their own that starts at 0. It is\r\n * always silent: a range is one segment of a split export, whose audio is\r\n * mixed once over the whole timeline.\r\n */\r\n frames?: FrameRange;\r\n /** Progress through the export, in `[0, 1]`. */\r\n onProgress?: (progress: number) => void;\r\n signal?: AbortSignal;\r\n encode?: EncodeOptions;\r\n}\r\n\r\n/** What an {@link Exporter} needs to encode one frame. */\r\nexport interface ExportStillRequest {\r\n project: ProjectDocument;\r\n registry: Registry;\r\n frame: FrameSpec;\r\n scale?: number;\r\n manifest?: AssetManifest;\r\n format?: \"png\" | \"jpeg\";\r\n quality?: number;\r\n signal?: AbortSignal;\r\n}\r\n\r\nexport interface ExportedStill {\r\n bytes: Uint8Array;\r\n /** The frame actually captured — the request clamped into range. */\r\n frame: number;\r\n totalFrames: number;\r\n}\r\n\r\n/**\r\n * How a `Session` turns itself into bytes.\r\n *\r\n * A **port**: `core` declares it, a platform implements it, and the dependency\r\n * runs platform → core like every other seam here — which is what lets\r\n * `Session.export()` exist in `core` without importing anything that encodes.\r\n */\r\nexport interface Exporter {\r\n exportVideo(request: ExportVideoRequest): Promise<Uint8Array | void>;\r\n exportStill(request: ExportStillRequest): Promise<ExportedStill>;\r\n}\r\n"]}
|
package/dist/platform/index.d.ts
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
/** @internal */ export { AudioSink } from './audio-sink.js';
|
|
3
3
|
/** @internal */ export { StorageAdapter, type DecodePolicy } from './storage-adapter.js';
|
|
4
4
|
/** @internal */ export { SteppedClock } from './stepped-clock.js';
|
|
5
|
-
export type { Exporter, ExportVideoRequest, ExportStillRequest, ExportedStill, EncodeOptions, } from './exporter.js';
|
|
5
|
+
export type { Exporter, ExportVideoRequest, ExportStillRequest, ExportedStill, EncodeOptions, FrameRange, } from './exporter.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACnD,gBAAgB,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1D,gBAAgB,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACvF,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAChE,YAAY,EACR,QAAQ,EACR,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACnD,gBAAgB,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1D,gBAAgB,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACvF,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAChE,YAAY,EACR,QAAQ,EACR,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,UAAU,GACb,MAAM,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACnD,gBAAgB,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1D,gBAAgB,CAAC,OAAO,EAAE,cAAc,EAAqB,MAAM,mBAAmB,CAAC;AACvF,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["/** @internal */ export { Ticker } from './ticker';\n/** @internal */ export { AudioSink } from './audio-sink';\n/** @internal */ export { StorageAdapter, type DecodePolicy } from './storage-adapter';\n/** @internal */ export { SteppedClock } from './stepped-clock';\nexport type {\n Exporter,\n ExportVideoRequest,\n ExportStillRequest,\n ExportedStill,\n EncodeOptions,\n} from './exporter';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACnD,gBAAgB,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1D,gBAAgB,CAAC,OAAO,EAAE,cAAc,EAAqB,MAAM,mBAAmB,CAAC;AACvF,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["/** @internal */ export { Ticker } from './ticker';\r\n/** @internal */ export { AudioSink } from './audio-sink';\r\n/** @internal */ export { StorageAdapter, type DecodePolicy } from './storage-adapter';\r\n/** @internal */ export { SteppedClock } from './stepped-clock';\r\nexport type {\r\n Exporter,\r\n ExportVideoRequest,\r\n ExportStillRequest,\r\n ExportedStill,\r\n EncodeOptions,\r\n FrameRange,\r\n} from './exporter';\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepped-clock.js","sourceRoot":"","sources":["../../src/platform/stepped-clock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,YAAa,SAAQ,MAAM;IACpC,IAAI,CAAC,CAAS;QACV,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;CACJ","sourcesContent":["import { Ticker } from \"./ticker\";\n\n/**\n * A clock with no wall clock behind it: the playhead is wherever it was last put.\n *\n * What a headless session runs on. `PlaybackController` needs *a* clock to seek\n * against, but an export has no realtime to sync to — and must not have one,\n * because a wall-clock export drifts. So the platform reports `null` from\n * `createTicker` to say \"no realtime transport here\", and a session stands\n * this in so everything that is not transport — seeking, node picking, reading a\n * node's box, drawing a frame — works exactly as it does in a browser.\n *\n * `play()` is deliberately not overridden into a no-op: nothing reaches it,\n * because a session with no realtime clock exposes `playback === null` and there\n * is no other route to it.\n *\n * @internal\n */\nexport class SteppedClock extends Ticker {\n seek(t: number): void {\n this.setCurrentTime(t);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"stepped-clock.js","sourceRoot":"","sources":["../../src/platform/stepped-clock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,YAAa,SAAQ,MAAM;IACpC,IAAI,CAAC,CAAS;QACV,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;CACJ","sourcesContent":["import { Ticker } from \"./ticker\";\r\n\r\n/**\r\n * A clock with no wall clock behind it: the playhead is wherever it was last put.\r\n *\r\n * What a headless session runs on. `PlaybackController` needs *a* clock to seek\r\n * against, but an export has no realtime to sync to — and must not have one,\r\n * because a wall-clock export drifts. So the platform reports `null` from\r\n * `createTicker` to say \"no realtime transport here\", and a session stands\r\n * this in so everything that is not transport — seeking, node picking, reading a\r\n * node's box, drawing a frame — works exactly as it does in a browser.\r\n *\r\n * `play()` is deliberately not overridden into a no-op: nothing reaches it,\r\n * because a session with no realtime clock exposes `playback === null` and there\r\n * is no other route to it.\r\n *\r\n * @internal\r\n */\r\nexport class SteppedClock extends Ticker {\r\n seek(t: number): void {\r\n this.setCurrentTime(t);\r\n }\r\n}\r\n"]}
|
|
@@ -2,12 +2,16 @@ import { AssetCatalog } from "../assets/catalog.js";
|
|
|
2
2
|
import { AssetRecord } from "../assets/record.js";
|
|
3
3
|
import { Size2D } from "../attributes/layout/size.js";
|
|
4
4
|
/**
|
|
5
|
-
* How an adapter picks the resolution to decode media at
|
|
5
|
+
* How an adapter picks the resolution to decode media at, and how strict it is
|
|
6
|
+
* about what it cannot load.
|
|
6
7
|
*
|
|
7
8
|
* `"exact"` — export, stills, screenshots: the level follows the current draw
|
|
8
9
|
* alone, so a frame is the same pixels whatever was drawn before it on a reused
|
|
9
|
-
* adapter
|
|
10
|
-
*
|
|
10
|
+
* adapter, and a font family the manifest cannot describe is refused rather
|
|
11
|
+
* than shaped against the fallback face. `"interactive"` — preview: reuse
|
|
12
|
+
* whatever resident level is already good enough, and upgrade in the
|
|
13
|
+
* background; an undescribed family draws in the fallback face until a manifest
|
|
14
|
+
* describes it.
|
|
11
15
|
*/
|
|
12
16
|
export type DecodePolicy = "exact" | "interactive";
|
|
13
17
|
export declare abstract class StorageAdapter {
|
|
@@ -53,9 +57,11 @@ export declare abstract class StorageAdapter {
|
|
|
53
57
|
* Register every face of `fontFamily` the catalog describes.
|
|
54
58
|
*
|
|
55
59
|
* Returns whether the family was actually loaded. `false` means the manifest
|
|
56
|
-
* has no entry for it
|
|
57
|
-
* the platform fallback, which is what a system font name
|
|
58
|
-
*
|
|
60
|
+
* has no entry for it. Not an error while previewing (an undescribed family
|
|
61
|
+
* shapes against the platform fallback, which is what a system font name
|
|
62
|
+
* does), but a blocking caller refuses it — see {@link DecodePolicy} — and
|
|
63
|
+
* it must not be remembered as handled either way: see the note in
|
|
64
|
+
* {@link runLoad}.
|
|
59
65
|
*/
|
|
60
66
|
abstract loadFont(src: string, fontFamily: string, fontWeight: number): Promise<boolean>;
|
|
61
67
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-adapter.d.ts","sourceRoot":"","sources":["../../src/platform/storage-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"storage-adapter.d.ts","sourceRoot":"","sources":["../../src/platform/storage-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,aAAa,CAAC;AAEnD,8BAAsB,cAAc;IAChC,SAAS,CAAC,OAAO,EAAE,YAAY,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AC,OAAO,CAAC;IAIxF;;;;;;;OAOG;IACG,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC;IAI1C,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IAI3C,qEAAqE;IACrE,eAAe,IAAI,YAAY;IAI/B,gGAAgG;IAChG,iBAAiB,IAAI,OAAO;IAI5B;;;;;;;;OAQG;IACG,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC;IAI5C;;;;OAIG;IACH,kBAAkB,IAAI,OAAO;IAI7B,iFAAiF;IAC3E,mBAAmB,IAAI,OAAO,CAAC,OAAO,CAAC;IAI7C;;;;OAIG;IACH,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAMlC,OAAO,IAAI,IAAI;CAIlB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AssetNotLoadedError } from "../assets/errors.js";
|
|
1
2
|
export class StorageAdapter {
|
|
2
3
|
catalog;
|
|
3
4
|
viewport;
|
|
@@ -61,6 +62,9 @@ export class StorageAdapter {
|
|
|
61
62
|
case 'font': {
|
|
62
63
|
const { fontFamily, fontWeight } = this.parseFontKey(key);
|
|
63
64
|
loaded = await this.loadFont(key, fontFamily, fontWeight);
|
|
65
|
+
if (!loaded && this.getDecodePolicy() === "exact") {
|
|
66
|
+
throw new AssetNotLoadedError("font", fontFamily, `The manifest has no font entry for "${fontFamily}", so this frame would be shaped against the fallback face and differ from the one drawn once it is described. Add the family to the manifest's font record.`);
|
|
67
|
+
}
|
|
64
68
|
break;
|
|
65
69
|
}
|
|
66
70
|
case 'audio':
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-adapter.js","sourceRoot":"","sources":["../../src/platform/storage-adapter.ts"],"names":[],"mappings":"AAcA,MAAM,OAAgB,cAAc;IACtB,OAAO,CAAe;IACtB,QAAQ,CAAS;IAC3B,YAAY,OAAqB,EAAE,QAAgB;QAC/C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB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AAG,CAAC,CAAC,CAAC,UAAU;SACnD,CAAC;IACN,CAAC;IA+BD,6EAA6E;IAE7E;;;;;;;OAOG;IACH,KAAK,CAAC,gBAAgB;QAClB,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,eAAe,CAAC,MAAoB;QAChC,mDAAmD;IACvD,CAAC;IAED,qEAAqE;IACrE,eAAe;QACX,OAAO,aAAa,CAAC;IACzB,CAAC;IAED,gGAAgG;IAChG,iBAAiB;QACb,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,kBAAkB;QACpB,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACnC,CAAC;IAED;;;;OAIG;IACH,kBAAkB;QACd,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,iFAAiF;IACjF,KAAK,CAAC,mBAAmB;QACrB,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;;;OAIG;IACH,UAAU,CAAC,OAAgB;QACvB,gDAAgD;IACpD,CAAC;IAED,6EAA6E;IAE7E,OAAO;QACH,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;QAC3B,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;IAC9B,CAAC;CACJ","sourcesContent":["import { AssetCatalog } from \"@/assets/catalog\";\nimport { AssetRecord } from \"@/assets/record\";\nimport { Size2D } from \"@/attributes/layout/size\";\n\n/**\n * How an adapter picks the resolution to decode media at.\n *\n * `\"exact\"` — export, stills, screenshots: the level follows the current draw\n * alone, so a frame is the same pixels whatever was drawn before it on a reused\n * adapter. `\"interactive\"` — preview: reuse whatever resident level is already\n * good enough, and upgrade in the background.\n */\nexport type DecodePolicy = \"exact\" | \"interactive\";\n\nexport abstract class StorageAdapter {\n protected catalog: AssetCatalog;\n protected viewport: Size2D;\n constructor(catalog: AssetCatalog, viewport: Size2D) {\n this.catalog = catalog;\n this.viewport = viewport;\n }\n\n /**\n * Point the adapter at a different asset catalog, keeping every decode it has\n * already cached.\n *\n * Safe because the catalog supplies *metadata* (durations, intrinsic sizes)\n * while the caches are keyed by source URL: a src the new catalog drops leaves\n * an orphaned decode, and a src it adds simply isn't cached yet. Neither is a\n * correctness problem, which is what lets a long-lived renderer take an\n * updated manifest without paying to re-decode everything still in use.\n *\n * The viewport has no such setter; a host that changes output size rebuilds\n * the adapter.\n */\n setCatalog(catalog: AssetCatalog): void {\n this.catalog = catalog;\n }\n /**\n * Every asset src whose loadXxx is currently in flight, mapped to its\n * pending promise. The render path awaits these to guarantee no draw\n * happens while a load is still resolving. Cleared on completion.\n */\n protected inFlightLoads = new Map<string, Promise<void>>();\n /** Keys of assets that have been fully loaded and are ready to use. */\n protected cachedAssets = new Set<string>();\n\n // ─── Asset loading dispatch ───────────────────────────────────────────────\n\n /** Whether `key` has finished loading and is usable now. */\n isLoaded(key: string): boolean {\n return this.cachedAssets.has(key);\n }\n\n async loadAsset(key: string, value: AssetRecord): Promise<void> {\n const existing = this.inFlightLoads.get(key);\n if (existing) return existing;\n if (this.cachedAssets.has(key)) return;\n\n const job = this.runLoad(key, value);\n this.inFlightLoads.set(key, job);\n try {\n await job;\n } finally {\n this.inFlightLoads.delete(key);\n }\n }\n\n private async runLoad(key: string, value: AssetRecord): Promise<void> {\n let loaded = true;\n switch (value.type) {\n case 'image':\n await this.loadImage(key);\n break;\n case 'video':\n await this.loadVideo(key, value.startFrame, value.endFrame, value.trimStart, value.trimEnd);\n break;\n case 'font': {\n const { fontFamily, fontWeight } = this.parseFontKey(key);\n loaded = await this.loadFont(key, fontFamily, fontWeight);\n break;\n }\n case 'audio':\n // Audio files are loaded on-demand via fetchAudioData / syncAudio, not through loadAsset.\n break;\n case 'loader':\n // Loaders are opaque callbacks run directly by the AssetManager and\n // never dispatched through the storage adapter.\n throw new Error(\"Loader records must not be routed through StorageAdapter.loadAsset\");\n default: {\n const _exhaustive: never = value;\n throw new Error(`Unsupported asset type: ${(_exhaustive as AssetRecord).type}`);\n }\n }\n\n // Only a load that actually happened is cached. This matters for exactly\n // one case: a font family the manifest cannot describe. Caching it anyway\n // marked the family handled for the life of this adapter, so a manifest\n // that *later* described it — which is what installing a typeface does,\n // folded into the live manifest without rebuilding the controller — could\n // never load it, and the text stayed in the fallback face until something\n // else tore the adapter down.\n if (loaded) this.cachedAssets.add(key);\n }\n\n // ─── Font key parsing ─────────────────────────────────────────────────────\n\n protected parseFontKey(key: string): { fontFamily: string; fontWeight: number } {\n const [fontFamily, weightStr] = key.split('@');\n const fontWeight = weightStr ? parseInt(weightStr, 10) : 400;\n return {\n fontFamily: fontFamily || key,\n fontWeight: isNaN(fontWeight) ? 400 : fontWeight,\n };\n }\n\n // ─── Abstract load methods ────────────────────────────────────────────────\n\n /** Decode resolution follows the draw, so a load names only the source. */\n abstract loadImage(src: string): Promise<void>;\n abstract loadVideo(\n src: string,\n startFrame: number,\n endFrame: number,\n trimStart: number,\n trimEnd?: number,\n ): Promise<void>;\n abstract loadAudio(\n src: string,\n startFrame: number,\n endFrame: number,\n trimStart: number,\n trimEnd?: number,\n ): Promise<void>;\n abstract fetchAudioData(src: string): Promise<ArrayBuffer>;\n /**\n * Register every face of `fontFamily` the catalog describes.\n *\n * Returns whether the family was actually loaded. `false` means the manifest\n * has no entry for it — not an error (an undescribed family shapes against\n * the platform fallback, which is what a system font name does), but it must\n * not be remembered as handled: see the note in {@link runLoad}.\n */\n abstract loadFont(src: string, fontFamily: string, fontWeight: number): Promise<boolean>;\n\n // ─── Frame warming ────────────────────────────────────────────────────────\n\n /**\n * Decode any exact media frames the most recent render asked for but couldn't\n * satisfy synchronously (e.g. a video frame at a freshly-seeked timestamp),\n * and report whether there were any. A blocking caller (seek / screenshot /\n * export) renders once, awaits this, and re-renders while it returns true so\n * the frame is accurate even on a cold jump. Defaults to a no-op for adapters\n * with no time-varying media.\n */\n async warmPendingVideo(): Promise<boolean> {\n return false;\n }\n\n setDecodePolicy(policy: DecodePolicy): void {\n // no-op for adapters that decode at one resolution\n }\n\n /** Read back so a caller that borrows the adapter can restore it. */\n getDecodePolicy(): DecodePolicy {\n return \"interactive\";\n }\n\n /** Whether the most recent render left decodes that {@link warmPendingDecodes} would settle. */\n hasPendingDecodes(): boolean {\n return false;\n }\n\n /**\n * Settle what the last render could not draw acceptably under the current\n * policy — video frames, every exact image level under `\"exact\"`, a source\n * drawn with nothing resident under `\"interactive\"` — and report whether there\n * was any. See `renderSettled`.\n *\n * Defaults to {@link warmPendingVideo} so an adapter written against it keeps\n * working; that alias goes away after one release.\n */\n async warmPendingDecodes(): Promise<boolean> {\n return this.warmPendingVideo();\n }\n\n /**\n * Whether an `\"interactive\"` decode is on its way that would draw the last\n * render sharper. Not something a paint waits for: a preview shows what is\n * resident and repaints when {@link warmPendingUpgrades} reports a landing.\n */\n hasPendingUpgrades(): boolean {\n return false;\n }\n\n /** Await the upgrades {@link hasPendingUpgrades} reports; whether one landed. */\n async warmPendingUpgrades(): Promise<boolean> {\n return false;\n }\n\n /**\n * Notify the adapter whether playback is live. Time-varying media (video) uses\n * this to prefetch ahead only while playing and to quiesce on pause, so a\n * paused timeline doesn't drain a backlog of stale decodes. No-op by default.\n */\n setPlaying(playing: boolean): void {\n // no-op for adapters with no time-varying media\n }\n\n // ─── Lifecycle ────────────────────────────────────────────────────────────\n\n dispose(): void {\n this.inFlightLoads.clear();\n this.cachedAssets.clear();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"storage-adapter.js","sourceRoot":"","sources":["../../src/platform/storage-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAkBtD,MAAM,OAAgB,cAAc;IACtB,OAAO,CAAe;IACtB,QAAQ,CAAS;IAC3B,YAAY,OAAqB,EAAE,QAAgB;QAC/C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,UAAU,CAAC,OAAqB;QAC5B,IAAI,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AG;YAC7B,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU;SACnD,CAAC;IACN,CAAC;IAiCD,6EAA6E;IAE7E;;;;;;;OAOG;IACH,KAAK,CAAC,gBAAgB;QAClB,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,eAAe,CAAC,MAAoB;QAChC,mDAAmD;IACvD,CAAC;IAED,qEAAqE;IACrE,eAAe;QACX,OAAO,aAAa,CAAC;IACzB,CAAC;IAED,gGAAgG;IAChG,iBAAiB;QACb,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,kBAAkB;QACpB,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACnC,CAAC;IAED;;;;OAIG;IACH,kBAAkB;QACd,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,iFAAiF;IACjF,KAAK,CAAC,mBAAmB;QACrB,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;;;OAIG;IACH,UAAU,CAAC,OAAgB;QACvB,gDAAgD;IACpD,CAAC;IAED,6EAA6E;IAE7E,OAAO;QACH,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;QAC3B,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;IAC9B,CAAC;CACJ","sourcesContent":["import { AssetCatalog } from \"@/assets/catalog\";\r\nimport { AssetNotLoadedError } from \"@/assets/errors\";\r\nimport { AssetRecord } from \"@/assets/record\";\r\nimport { Size2D } from \"@/attributes/layout/size\";\r\n\r\n/**\r\n * How an adapter picks the resolution to decode media at, and how strict it is\r\n * about what it cannot load.\r\n *\r\n * `\"exact\"` — export, stills, screenshots: the level follows the current draw\r\n * alone, so a frame is the same pixels whatever was drawn before it on a reused\r\n * adapter, and a font family the manifest cannot describe is refused rather\r\n * than shaped against the fallback face. `\"interactive\"` — preview: reuse\r\n * whatever resident level is already good enough, and upgrade in the\r\n * background; an undescribed family draws in the fallback face until a manifest\r\n * describes it.\r\n */\r\nexport type DecodePolicy = \"exact\" | \"interactive\";\r\n\r\nexport abstract class StorageAdapter {\r\n protected catalog: AssetCatalog;\r\n protected viewport: Size2D;\r\n constructor(catalog: AssetCatalog, viewport: Size2D) {\r\n this.catalog = catalog;\r\n this.viewport = viewport;\r\n }\r\n\r\n /**\r\n * Point the adapter at a different asset catalog, keeping every decode it has\r\n * already cached.\r\n *\r\n * Safe because the catalog supplies *metadata* (durations, intrinsic sizes)\r\n * while the caches are keyed by source URL: a src the new catalog drops leaves\r\n * an orphaned decode, and a src it adds simply isn't cached yet. Neither is a\r\n * correctness problem, which is what lets a long-lived renderer take an\r\n * updated manifest without paying to re-decode everything still in use.\r\n *\r\n * The viewport has no such setter; a host that changes output size rebuilds\r\n * the adapter.\r\n */\r\n setCatalog(catalog: AssetCatalog): void {\r\n this.catalog = catalog;\r\n }\r\n /**\r\n * Every asset src whose loadXxx is currently in flight, mapped to its\r\n * pending promise. The render path awaits these to guarantee no draw\r\n * happens while a load is still resolving. Cleared on completion.\r\n */\r\n protected inFlightLoads = new Map<string, Promise<void>>();\r\n /** Keys of assets that have been fully loaded and are ready to use. */\r\n protected cachedAssets = new Set<string>();\r\n\r\n // ─── Asset loading dispatch ───────────────────────────────────────────────\r\n\r\n /** Whether `key` has finished loading and is usable now. */\r\n isLoaded(key: string): boolean {\r\n return this.cachedAssets.has(key);\r\n }\r\n\r\n async loadAsset(key: string, value: AssetRecord): Promise<void> {\r\n const existing = this.inFlightLoads.get(key);\r\n if (existing) return existing;\r\n if (this.cachedAssets.has(key)) return;\r\n\r\n const job = this.runLoad(key, value);\r\n this.inFlightLoads.set(key, job);\r\n try {\r\n await job;\r\n } finally {\r\n this.inFlightLoads.delete(key);\r\n }\r\n }\r\n\r\n private async runLoad(key: string, value: AssetRecord): Promise<void> {\r\n let loaded = true;\r\n switch (value.type) {\r\n case 'image':\r\n await this.loadImage(key);\r\n break;\r\n case 'video':\r\n await this.loadVideo(key, value.startFrame, value.endFrame, value.trimStart, value.trimEnd);\r\n break;\r\n case 'font': {\r\n const { fontFamily, fontWeight } = this.parseFontKey(key);\r\n loaded = await this.loadFont(key, fontFamily, fontWeight);\r\n if (!loaded && this.getDecodePolicy() === \"exact\") {\r\n throw new AssetNotLoadedError(\r\n \"font\",\r\n fontFamily,\r\n `The manifest has no font entry for \"${fontFamily}\", so this frame would be shaped against the fallback face and differ from the one drawn once it is described. Add the family to the manifest's font record.`,\r\n );\r\n }\r\n break;\r\n }\r\n case 'audio':\r\n // Audio files are loaded on-demand via fetchAudioData / syncAudio, not through loadAsset.\r\n break;\r\n case 'loader':\r\n // Loaders are opaque callbacks run directly by the AssetManager and\r\n // never dispatched through the storage adapter.\r\n throw new Error(\"Loader records must not be routed through StorageAdapter.loadAsset\");\r\n default: {\r\n const _exhaustive: never = value;\r\n throw new Error(`Unsupported asset type: ${(_exhaustive as AssetRecord).type}`);\r\n }\r\n }\r\n\r\n // Only a load that actually happened is cached. This matters for exactly\r\n // one case: a font family the manifest cannot describe. Caching it anyway\r\n // marked the family handled for the life of this adapter, so a manifest\r\n // that *later* described it — which is what installing a typeface does,\r\n // folded into the live manifest without rebuilding the controller — could\r\n // never load it, and the text stayed in the fallback face until something\r\n // else tore the adapter down.\r\n if (loaded) this.cachedAssets.add(key);\r\n }\r\n\r\n // ─── Font key parsing ─────────────────────────────────────────────────────\r\n\r\n protected parseFontKey(key: string): { fontFamily: string; fontWeight: number } {\r\n const [fontFamily, weightStr] = key.split('@');\r\n const fontWeight = weightStr ? parseInt(weightStr, 10) : 400;\r\n return {\r\n fontFamily: fontFamily || key,\r\n fontWeight: isNaN(fontWeight) ? 400 : fontWeight,\r\n };\r\n }\r\n\r\n // ─── Abstract load methods ────────────────────────────────────────────────\r\n\r\n /** Decode resolution follows the draw, so a load names only the source. */\r\n abstract loadImage(src: string): Promise<void>;\r\n abstract loadVideo(\r\n src: string,\r\n startFrame: number,\r\n endFrame: number,\r\n trimStart: number,\r\n trimEnd?: number,\r\n ): Promise<void>;\r\n abstract loadAudio(\r\n src: string,\r\n startFrame: number,\r\n endFrame: number,\r\n trimStart: number,\r\n trimEnd?: number,\r\n ): Promise<void>;\r\n abstract fetchAudioData(src: string): Promise<ArrayBuffer>;\r\n /**\r\n * Register every face of `fontFamily` the catalog describes.\r\n *\r\n * Returns whether the family was actually loaded. `false` means the manifest\r\n * has no entry for it. Not an error while previewing (an undescribed family\r\n * shapes against the platform fallback, which is what a system font name\r\n * does), but a blocking caller refuses it — see {@link DecodePolicy} — and\r\n * it must not be remembered as handled either way: see the note in\r\n * {@link runLoad}.\r\n */\r\n abstract loadFont(src: string, fontFamily: string, fontWeight: number): Promise<boolean>;\r\n\r\n // ─── Frame warming ────────────────────────────────────────────────────────\r\n\r\n /**\r\n * Decode any exact media frames the most recent render asked for but couldn't\r\n * satisfy synchronously (e.g. a video frame at a freshly-seeked timestamp),\r\n * and report whether there were any. A blocking caller (seek / screenshot /\r\n * export) renders once, awaits this, and re-renders while it returns true so\r\n * the frame is accurate even on a cold jump. Defaults to a no-op for adapters\r\n * with no time-varying media.\r\n */\r\n async warmPendingVideo(): Promise<boolean> {\r\n return false;\r\n }\r\n\r\n setDecodePolicy(policy: DecodePolicy): void {\r\n // no-op for adapters that decode at one resolution\r\n }\r\n\r\n /** Read back so a caller that borrows the adapter can restore it. */\r\n getDecodePolicy(): DecodePolicy {\r\n return \"interactive\";\r\n }\r\n\r\n /** Whether the most recent render left decodes that {@link warmPendingDecodes} would settle. */\r\n hasPendingDecodes(): boolean {\r\n return false;\r\n }\r\n\r\n /**\r\n * Settle what the last render could not draw acceptably under the current\r\n * policy — video frames, every exact image level under `\"exact\"`, a source\r\n * drawn with nothing resident under `\"interactive\"` — and report whether there\r\n * was any. See `renderSettled`.\r\n *\r\n * Defaults to {@link warmPendingVideo} so an adapter written against it keeps\r\n * working; that alias goes away after one release.\r\n */\r\n async warmPendingDecodes(): Promise<boolean> {\r\n return this.warmPendingVideo();\r\n }\r\n\r\n /**\r\n * Whether an `\"interactive\"` decode is on its way that would draw the last\r\n * render sharper. Not something a paint waits for: a preview shows what is\r\n * resident and repaints when {@link warmPendingUpgrades} reports a landing.\r\n */\r\n hasPendingUpgrades(): boolean {\r\n return false;\r\n }\r\n\r\n /** Await the upgrades {@link hasPendingUpgrades} reports; whether one landed. */\r\n async warmPendingUpgrades(): Promise<boolean> {\r\n return false;\r\n }\r\n\r\n /**\r\n * Notify the adapter whether playback is live. Time-varying media (video) uses\r\n * this to prefetch ahead only while playing and to quiesce on pause, so a\r\n * paused timeline doesn't drain a backlog of stale decodes. No-op by default.\r\n */\r\n setPlaying(playing: boolean): void {\r\n // no-op for adapters with no time-varying media\r\n }\r\n\r\n // ─── Lifecycle ────────────────────────────────────────────────────────────\r\n\r\n dispose(): void {\r\n this.inFlightLoads.clear();\r\n this.cachedAssets.clear();\r\n }\r\n}\r\n"]}
|
|
@@ -25,6 +25,12 @@ export type TimeCallback = (time: number) => void;
|
|
|
25
25
|
* 2. Register listeners via `onTick` / `onPlay` / `onPause` / `onTime`.
|
|
26
26
|
* 3. Call `play`, `pause`, or `seek` to control playback.
|
|
27
27
|
* 4. Call `dispose` when the clock is no longer needed to prevent leaks.
|
|
28
|
+
*
|
|
29
|
+
* `play`, `pause` and `seek` take effect before they return, so any order of them
|
|
30
|
+
* in one turn leaves the clock where the last one put it. A time listener or tick
|
|
31
|
+
* callback may `seek` (a host looping wraps to the start when it hears the end), and
|
|
32
|
+
* a subclass must read the end of a run again afterwards. At the end of a run it
|
|
33
|
+
* reports a final tick and pauses.
|
|
28
34
|
*/
|
|
29
35
|
export declare abstract class Ticker {
|
|
30
36
|
private _isPlaying;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ticker.d.ts","sourceRoot":"","sources":["../../src/platform/ticker.ts"],"names":[],"mappings":"AAAA,0JAA0J;AAC1J,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,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MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAK3C,+GAA+G;cAC/F,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrC,wDAAwD;IACxD,KAAK,IAAI,IAAI;IAKb,gGAAgG;IAChG,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAE9B,SAAS,CAAC,aAAa,EAAE,YAAY,EAAE,CAAM;IAC7C,SAAS,CAAC,aAAa,EAAE,YAAY,EAAE,CAAM;IAC7C,SAAS,CAAC,cAAc,EAAE,CAAC,MAAM,IAAI,CAAC,EAAE,CAAM;IAC9C,SAAS,CAAC,aAAa,EAAE,YAAY,EAAE,CAAM;IAE7C,6FAA6F;IAC7F,OAAO;IAOP,MAAM,CAAC,QAAQ,EAAE,YAAY;IAI7B,MAAM,CAAC,QAAQ,EAAE,YAAY;IAI7B,OAAO,CAAC,QAAQ,EAAE,MAAM,IAAI;IAI5B,MAAM,CAAC,QAAQ,EAAE,YAAY;CAGhC"}
|
package/dist/platform/ticker.js
CHANGED
|
@@ -12,6 +12,12 @@
|
|
|
12
12
|
* 2. Register listeners via `onTick` / `onPlay` / `onPause` / `onTime`.
|
|
13
13
|
* 3. Call `play`, `pause`, or `seek` to control playback.
|
|
14
14
|
* 4. Call `dispose` when the clock is no longer needed to prevent leaks.
|
|
15
|
+
*
|
|
16
|
+
* `play`, `pause` and `seek` take effect before they return, so any order of them
|
|
17
|
+
* in one turn leaves the clock where the last one put it. A time listener or tick
|
|
18
|
+
* callback may `seek` (a host looping wraps to the start when it hears the end), and
|
|
19
|
+
* a subclass must read the end of a run again afterwards. At the end of a run it
|
|
20
|
+
* reports a final tick and pauses.
|
|
15
21
|
*/
|
|
16
22
|
export class Ticker {
|
|
17
23
|
_isPlaying = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ticker.js","sourceRoot":"","sources":["../../src/platform/ticker.ts"],"names":[],"mappings":"AAgBA
|
|
1
|
+
{"version":3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G,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IACzE,CAAC;IAED,wDAAwD;IACxD,KAAK;QACD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,cAAc;YAAE,EAAE,EAAE,CAAC;IAC/C,CAAC;IAKS,aAAa,GAAmB,EAAE,CAAC;IACnC,aAAa,GAAmB,EAAE,CAAC;IACnC,cAAc,GAAmB,EAAE,CAAC;IACpC,aAAa,GAAmB,EAAE,CAAC;IAE7C,6FAA6F;IAC7F,OAAO;QACH,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;QAC9B,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;QAC9B,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC;QAC/B,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;IAClC,CAAC;IAED,MAAM,CAAC,QAAsB;QACzB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,CAAC,QAAsB;QACzB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,CAAC,QAAoB;QACxB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED,MAAM,CAAC,QAAsB;QACzB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;CACJ","sourcesContent":["/** Called every animation frame with the current playhead time (seconds). Must return a Promise so the clock can await all renderers before advancing. */\r\nexport type TickCallback = (time: number) => Promise<void>;\r\n\r\n/** Fired when playback starts. Receives the time at which playback began, the playback speed multiplier, and whether playback is reversed. */\r\nexport type PlayCallback = (time: number, speed: number, reverse: boolean) => void;\r\n\r\n/**\r\n * Fired when the playhead reaches a new frame.\r\n *\r\n * Once per frame, not once per animation frame — see\r\n * {@link Ticker.setCurrentTime}. A subclass advancing its clock faster than\r\n * the project's frame rate (which every rAF-driven one does on a high-refresh\r\n * display) keeps the extra positions to itself.\r\n */\r\nexport type TimeCallback = (time: number) => void;\r\n\r\n/**\r\n * Platform-agnostic base class for driving animation playback.\r\n *\r\n * Subclasses implement the actual frame loop (e.g. requestAnimationFrame in the\r\n * browser, a setInterval loop in Node) and call `setCurrentTime` / `tick` each\r\n * frame. `Ticker` owns the subscriber lists and the shared playback state\r\n * so that renderers and UI controls can coordinate without knowing about each\r\n * other.\r\n *\r\n * Lifecycle:\r\n * 1. Set total duration with `setDuration`.\r\n * 2. Register listeners via `onTick` / `onPlay` / `onPause` / `onTime`.\r\n * 3. Call `play`, `pause`, or `seek` to control playback.\r\n * 4. Call `dispose` when the clock is no longer needed to prevent leaks.\r\n *\r\n * `play`, `pause` and `seek` take effect before they return, so any order of them\r\n * in one turn leaves the clock where the last one put it. A time listener or tick\r\n * callback may `seek` (a host looping wraps to the start when it hears the end), and\r\n * a subclass must read the end of a run again afterwards. At the end of a run it\r\n * reports a final tick and pauses.\r\n */\r\nexport abstract class Ticker {\r\n private _isPlaying: boolean = false;\r\n private _currentTime: number = 0;\r\n protected _duration: number = 0;\r\n\r\n get isPlaying(): boolean {\r\n return this._isPlaying;\r\n }\r\n\r\n /** Current playhead position in seconds. */\r\n get currentTime(): number {\r\n return this._currentTime;\r\n }\r\n\r\n /** Total animation duration in seconds. */\r\n get duration(): number {\r\n return this._duration;\r\n }\r\n\r\n setDuration(duration: number): void {\r\n this._duration = duration;\r\n }\r\n\r\n /**\r\n * Updates the playhead and notifies time listeners. No-ops if the time hasn't\r\n * changed.\r\n *\r\n * `notify` exists because the two halves of that sentence want different\r\n * rates. The playhead itself has to be exact — `pause` and `play` anchor\r\n * their elapsed-time maths on it, so it is advanced on every frame of the\r\n * subclass's loop — while a *listener* is a host drawing a timecode or\r\n * seeking a renderer, and neither can do anything with a position that has\r\n * not reached the next frame yet.\r\n *\r\n * Passing `false` therefore keeps the clock exact and the subscribers quiet.\r\n * A subclass that knows its frame rate uses it to fire {@link onTime} once\r\n * per frame rather than once per animation frame; on a 144Hz display those\r\n * are not the same number, and the difference was landing on hosts as a React\r\n * render per refresh to drive a 60fps render.\r\n */\r\n protected setCurrentTime(t: number, notify: boolean = true): void {\r\n if (this._currentTime === t) return;\r\n this._currentTime = t;\r\n if (!notify) return;\r\n for (const cb of this.timeCallbacks) cb(t);\r\n }\r\n\r\n protected setPlaying(playing: boolean): void {\r\n this._isPlaying = playing;\r\n }\r\n\r\n /** Starts playback at the given speed and direction, notifying all play listeners. */\r\n play(speed: number, reverse: boolean): void {\r\n this._isPlaying = true;\r\n for (const cb of this.playCallbacks) cb(this._currentTime, speed, reverse);\r\n }\r\n\r\n /** Awaits all tick callbacks in parallel. Subclasses call this once per frame after updating `currentTime`. */\r\n protected async tick(): Promise<void> {\r\n await Promise.all(this.tickCallbacks.map(c => c(this._currentTime)));\r\n }\r\n\r\n /** Pauses playback and notifies all pause listeners. */\r\n pause(): void {\r\n this._isPlaying = false;\r\n for (const cb of this.pauseCallbacks) cb();\r\n }\r\n\r\n /** Moves the playhead to `t` (seconds). Subclasses decide whether this also triggers a tick. */\r\n abstract seek(t: number): void;\r\n\r\n protected tickCallbacks: TickCallback[] = [];\r\n protected playCallbacks: PlayCallback[] = [];\r\n protected pauseCallbacks: (() => void)[] = [];\r\n protected timeCallbacks: TimeCallback[] = [];\r\n\r\n /** Clears all registered callbacks. Call when tearing down a scene to avoid memory leaks. */\r\n dispose() {\r\n this.tickCallbacks.length = 0;\r\n this.playCallbacks.length = 0;\r\n this.pauseCallbacks.length = 0;\r\n this.timeCallbacks.length = 0;\r\n }\r\n\r\n onTick(callback: TickCallback) {\r\n this.tickCallbacks.push(callback);\r\n }\r\n\r\n onPlay(callback: PlayCallback) {\r\n this.playCallbacks.push(callback);\r\n }\r\n\r\n onPause(callback: () => void) {\r\n this.pauseCallbacks.push(callback);\r\n }\r\n\r\n onTime(callback: TimeCallback) {\r\n this.timeCallbacks.push(callback);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/project/config.ts"],"names":[],"mappings":"","sourcesContent":["import { Color } from \"@/attributes/shape/fill/color/parser\";\nimport type { TextStyle } from \"@/attributes/text/types\";\n\n/** A color token: a resolvable {@link Color}, or a nested group of them. Groups\n * flatten to dash-joined names — `{ brand: { 500: … } }` → `brand-500`. */\nexport type ColorToken = Color | ColorGroup;\nexport interface ColorGroup { [key: string]: ColorToken; }\n\n/** Named color tokens, possibly nested into groups. Referenced by their\n * (flattened) name in any `fill`/`stroke` string. */\nexport type ColorTokens = Record<string, ColorToken>;\n\n/** A named text-style preset referenced by a `Text`/`RichText` `variant` prop.\n * Each field it sets supplies that style key to a variant'd node (unless the\n * author set it explicitly). Same shape as the `<DefaultTextStyle>` defaults. */\nexport type TypographyPreset = TextStyle;\n\n/** Named typography presets, keyed by variant name (e.g. `header`, `body`).\n * The `default` key is reserved: if present, it's applied to every `Text`/\n * `RichText` as a project-wide base style — no `variant` prop or\n * `<DefaultTextStyle>` wrapper needed — for any style key a more specific\n * source (explicit prop, `variant`, inherited `<DefaultTextStyle>`) doesn't\n * set. Declared as an explicit property (rather than folded into the index\n * signature) so editors offer it in autocomplete. */\nexport type Typography = { default?: TypographyPreset } & Record<string, TypographyPreset>;\n\n/** The visual design tokens — color tokens and typography presets. */\nexport interface Theme {\n /** Named color tokens (possibly grouped) for `fill`/`stroke` strings. */\n colors?: ColorTokens;\n /** Named text-style presets selected via a `Text`/`RichText` `variant`. */\n typography?: Typography;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/project/config.ts"],"names":[],"mappings":"","sourcesContent":["import { Color } from \"@/attributes/shape/fill/color/parser\";\r\nimport type { TextStyle } from \"@/attributes/text/types\";\r\n\r\n/** A color token: a resolvable {@link Color}, or a nested group of them. Groups\r\n * flatten to dash-joined names — `{ brand: { 500: … } }` → `brand-500`. */\r\nexport type ColorToken = Color | ColorGroup;\r\nexport interface ColorGroup { [key: string]: ColorToken; }\r\n\r\n/** Named color tokens, possibly nested into groups. Referenced by their\r\n * (flattened) name in any `fill`/`stroke` string. */\r\nexport type ColorTokens = Record<string, ColorToken>;\r\n\r\n/** A named text-style preset referenced by a `Text`/`RichText` `variant` prop.\r\n * Each field it sets supplies that style key to a variant'd node (unless the\r\n * author set it explicitly). Same shape as the `<DefaultTextStyle>` defaults. */\r\nexport type TypographyPreset = TextStyle;\r\n\r\n/** Named typography presets, keyed by variant name (e.g. `header`, `body`).\r\n * The `default` key is reserved: if present, it's applied to every `Text`/\r\n * `RichText` as a project-wide base style — no `variant` prop or\r\n * `<DefaultTextStyle>` wrapper needed — for any style key a more specific\r\n * source (explicit prop, `variant`, inherited `<DefaultTextStyle>`) doesn't\r\n * set. Declared as an explicit property (rather than folded into the index\r\n * signature) so editors offer it in autocomplete. */\r\nexport type Typography = { default?: TypographyPreset } & Record<string, TypographyPreset>;\r\n\r\n/** The visual design tokens — color tokens and typography presets. */\r\nexport interface Theme {\r\n /** Named color tokens (possibly grouped) for `fill`/`stroke` strings. */\r\n colors?: ColorTokens;\r\n /** Named text-style presets selected via a `Text`/`RichText` `variant`. */\r\n typography?: Typography;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/project/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC","sourcesContent":["export * from './config';\nexport * from './tree';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/project/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC","sourcesContent":["export * from './config';\r\nexport * from './tree';\r\n"]}
|
package/dist/project/tree.d.ts
CHANGED
|
@@ -17,16 +17,16 @@ export interface NodeState {
|
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* A single audio clip exposed by a node for timeline display. Times are in
|
|
20
|
-
*
|
|
20
|
+
* clip seconds; `src` is the (fetchable) audio source path. Nodes that own
|
|
21
21
|
* audio — e.g. a Scene with managed sounds — report one entry per play range.
|
|
22
22
|
*/
|
|
23
23
|
/** @internal */
|
|
24
24
|
export interface WaveformInfo {
|
|
25
25
|
/** Fetchable audio source path / URL. */
|
|
26
26
|
src: string;
|
|
27
|
-
/**
|
|
27
|
+
/** Clip timestamp (seconds) when the clip starts. */
|
|
28
28
|
startTime: number;
|
|
29
|
-
/**
|
|
29
|
+
/** Clip timestamp (seconds) when the clip ends, or null if open-ended. */
|
|
30
30
|
endTime: number | null;
|
|
31
31
|
}
|
|
32
32
|
export interface TreeState {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../src/project/tree.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,gBAAgB;AAChB,wBAAgB,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAEvE;AAED,gBAAgB;AAChB,MAAM,WAAW,SAAS;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAGnC;AAED;;;;GAIG;AACH,gBAAgB;AAChB,MAAM,WAAW,YAAY;IACzB,yCAAyC;IACzC,GAAG,EAAE,MAAM,CAAC;IACZ,
|
|
1
|
+
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../src/project/tree.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,gBAAgB;AAChB,wBAAgB,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAEvE;AAED,gBAAgB;AAChB,MAAM,WAAW,SAAS;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAGnC;AAED;;;;GAIG;AACH,gBAAgB;AAChB,MAAM,WAAW,YAAY;IACzB,yCAAyC;IACzC,GAAG,EAAE,MAAM,CAAC;IACZ,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,SAAS;IACtB;;;;;OAKG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,SAAS,EAAE,CAAC;CACzB"}
|
package/dist/project/tree.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../../src/project/tree.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,gBAAgB;AAChB,MAAM,UAAU,QAAQ,CAAC,UAAkB,EAAE,UAAkB;IAC3D,OAAO,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,IAAI,UAAU,EAAE,CAAC;AAClF,CAAC","sourcesContent":["/**\n * Structural key for a node within its scene: the child-index path from the\n * scene root, joined with \".\". The root is \"\". Not every node has an authored id\n * — the children a composite node builds for itself get a UUID apiece — so\n * lifespan tracking keys on this instead, which every node has. The build is\n * deterministic, so the same structural slot maps to the same path in both the\n * precomp pass and playback.\n */\n/** @internal */\nexport function nodePath(parentPath: string, childIndex: number): string {\n return parentPath === \"\" ? String(childIndex) : `${parentPath}.${childIndex}`;\n}\n\n/** @internal */\nexport interface NodeState {\n id: string;\n type: string;\n /** Attribute overrides applied when this state is active. */\n properties: Record<string, any>;\n\n\n}\n\n/**\n * A single audio clip exposed by a node for timeline display. Times are in\n *
|
|
1
|
+
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../../src/project/tree.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,gBAAgB;AAChB,MAAM,UAAU,QAAQ,CAAC,UAAkB,EAAE,UAAkB;IAC3D,OAAO,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,IAAI,UAAU,EAAE,CAAC;AAClF,CAAC","sourcesContent":["/**\r\n * Structural key for a node within its scene: the child-index path from the\r\n * scene root, joined with \".\". The root is \"\". Not every node has an authored id\r\n * — the children a composite node builds for itself get a UUID apiece — so\r\n * lifespan tracking keys on this instead, which every node has. The build is\r\n * deterministic, so the same structural slot maps to the same path in both the\r\n * precomp pass and playback.\r\n */\r\n/** @internal */\r\nexport function nodePath(parentPath: string, childIndex: number): string {\r\n return parentPath === \"\" ? String(childIndex) : `${parentPath}.${childIndex}`;\r\n}\r\n\r\n/** @internal */\r\nexport interface NodeState {\r\n id: string;\r\n type: string;\r\n /** Attribute overrides applied when this state is active. */\r\n properties: Record<string, any>;\r\n\r\n\r\n}\r\n\r\n/**\r\n * A single audio clip exposed by a node for timeline display. Times are in\r\n * clip seconds; `src` is the (fetchable) audio source path. Nodes that own\r\n * audio — e.g. a Scene with managed sounds — report one entry per play range.\r\n */\r\n/** @internal */\r\nexport interface WaveformInfo {\r\n /** Fetchable audio source path / URL. */\r\n src: string;\r\n /** Clip timestamp (seconds) when the clip starts. */\r\n startTime: number;\r\n /** Clip timestamp (seconds) when the clip ends, or null if open-ended. */\r\n endTime: number | null;\r\n}\r\n\r\nexport interface TreeState {\r\n /**\r\n * The node's `NodeSpec.id` when it came from a document row, otherwise a\r\n * per-instance UUID — so it survives a rebuild for an authored node and\r\n * changes for one a composite built for itself. {@link path} is the key that\r\n * is stable for both.\r\n */\r\n id: string;\r\n /**\r\n * Structural path from the scene root (`\"\"` for the root, `\"0.2\"` for the\r\n * third child of the first). Stable across rebuilds for every node, authored\r\n * or not, so a host can key selection, expansion, and overrides on it. It is\r\n * also what `getNodeBox` / `setNodeOverride` accept.\r\n */\r\n path: string;\r\n type: string;\r\n meta?: Record<string, unknown>;\r\n /** Audio clips owned by this node, for waveform rendering in the timeline. */\r\n waveform?: WaveformInfo[];\r\n /**\r\n * Absolute timeline frame (across the whole video) at which this node first\r\n * appears. Undefined when its lifespan is unknown (e.g. no precomp data).\r\n */\r\n startFrame?: number;\r\n /**\r\n * Absolute timeline frame at which this node was last present. Together with\r\n * startFrame this bounds the node's track bar to its true lifespan.\r\n */\r\n endFrame?: number;\r\n children: TreeState[];\r\n}"]}
|
package/dist/props/host.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.js","sourceRoot":"","sources":["../../src/props/host.ts"],"names":[],"mappings":"AAgCA,gBAAgB;AAChB,MAAM,UAAU,WAAW,CAAC,GAAa,EAAE,IAAY;IACnD,OAAO,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACxC,CAAC;AAED,wDAAwD;AACxD,MAAM,UAAU,WAAW,CAAC,GAAa;IACrC,OAAO,GAAG,CAAC,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;AAChD,CAAC","sourcesContent":["import { PropSlot } from \"./slot\";\n\n/** @internal */\nexport type TweenFn<T> = (from: T, to: T, t: number) => T;\n\n/**\n * The slots behind an object's `@property`-declared fields, plus the per-field\n * metadata `set()` and `to()` route through.\n *\n * One object rather than three loose maps on the host, because the host is a\n * `Node` and every public field it carries is published API. Grouping them\n * means a node exposes one internal name instead of three, and gives the thing\n * a name a reader can look up.\n *\n * @internal\n */\nexport interface PropCells {\n /** Field → its live slot. Present for every registered prop. */\n slots: Map<string, PropSlot<any>>;\n /** Field → how it interpolates, for props a numeric lerp cannot cover. */\n tweens?: Map<string, TweenFn<any>>;\n /** Field → external prop value to internal slot value, for fields that need it. */\n mappers?: Map<string, (ext: any, prev?: any) => any>;\n}\n\n/** @internal */\nexport interface PropHost {\n /** See {@link PropCells}. Absent until the first prop is registered, and\n * cleared by `dispose()`. */\n __cells?: PropCells;\n}\n\n/** @internal */\nexport function getPropSlot(obj: PropHost, name: string): PropSlot<any> | undefined {\n return obj.__cells?.slots.get(name);\n}\n\n/** The host's slots, created on first use. @internal */\nexport function ensureCells(obj: PropHost): PropCells {\n return obj.__cells ??= { slots: new Map() };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"host.js","sourceRoot":"","sources":["../../src/props/host.ts"],"names":[],"mappings":"AAgCA,gBAAgB;AAChB,MAAM,UAAU,WAAW,CAAC,GAAa,EAAE,IAAY;IACnD,OAAO,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACxC,CAAC;AAED,wDAAwD;AACxD,MAAM,UAAU,WAAW,CAAC,GAAa;IACrC,OAAO,GAAG,CAAC,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;AAChD,CAAC","sourcesContent":["import { PropSlot } from \"./slot\";\r\n\r\n/** @internal */\r\nexport type TweenFn<T> = (from: T, to: T, t: number) => T;\r\n\r\n/**\r\n * The slots behind an object's `@property`-declared fields, plus the per-field\r\n * metadata `set()` and `to()` route through.\r\n *\r\n * One object rather than three loose maps on the host, because the host is a\r\n * `Node` and every public field it carries is published API. Grouping them\r\n * means a node exposes one internal name instead of three, and gives the thing\r\n * a name a reader can look up.\r\n *\r\n * @internal\r\n */\r\nexport interface PropCells {\r\n /** Field → its live slot. Present for every registered prop. */\r\n slots: Map<string, PropSlot<any>>;\r\n /** Field → how it interpolates, for props a numeric lerp cannot cover. */\r\n tweens?: Map<string, TweenFn<any>>;\r\n /** Field → external prop value to internal slot value, for fields that need it. */\r\n mappers?: Map<string, (ext: any, prev?: any) => any>;\r\n}\r\n\r\n/** @internal */\r\nexport interface PropHost {\r\n /** See {@link PropCells}. Absent until the first prop is registered, and\r\n * cleared by `dispose()`. */\r\n __cells?: PropCells;\r\n}\r\n\r\n/** @internal */\r\nexport function getPropSlot(obj: PropHost, name: string): PropSlot<any> | undefined {\r\n return obj.__cells?.slots.get(name);\r\n}\r\n\r\n/** The host's slots, created on first use. @internal */\r\nexport function ensureCells(obj: PropHost): PropCells {\r\n return obj.__cells ??= { slots: new Map() };\r\n}\r\n"]}
|
package/dist/props/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/props/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAGlC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["export { PropSlot } from \"./slot\";\nexport type { PropSnapshot } from \"./slot\";\nexport type { TweenFn, PropCells, PropHost } from \"./host\";\nexport { getPropSlot } from \"./host\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/props/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAGlC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["export { PropSlot } from \"./slot\";\r\nexport type { PropSnapshot } from \"./slot\";\r\nexport type { TweenFn, PropCells, PropHost } from \"./host\";\r\nexport { getPropSlot } from \"./host\";\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observer.js","sourceRoot":"","sources":["../../src/props/observer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAiB,MAAM,QAAQ,CAAC;AAgBrD,6DAA6D;AAC7D,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC;AAC1C,qEAAqE;AACrE,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC;AACjC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;AAC3C,0EAA0E;AAC1E,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;AAE1C,2GAA2G;AAC3G,MAAM,UAAU,YAAY,CAAI,QAAsB,EAAE,EAAW;IAC/D,MAAM,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IACxC,IAAI,CAAC;QACD,OAAO,EAAE,EAAE,CAAC;IAChB,CAAC;YAAS,CAAC;QACP,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;AACL,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,UAAU,CAAI,EAAW;IACrC,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,CAAC;QACD,OAAO,EAAE,EAAE,CAAC;IAChB,CAAC;YAAS,CAAC;QACP,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;AACL,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,SAAS,CAAC,IAAuB;IAC7C,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;AACtE,CAAC","sourcesContent":["import { _setObserver, type PropSlot } from \"./slot\";\n\n/**\n * What the slots touched inside {@link observeSlots} are reported to.\n *\n * Reads and writes are recorded rather than declared: a dependency is whatever a\n * computation actually touched, bindings included, so nothing has to annotate a\n * prop as mattering to anyone.\n */\nexport interface SlotObserver {\n read(slot: PropSlot<unknown>): void;\n write(slot: PropSlot<unknown>): void;\n /** A node's clock was read — a result that depends on it is not a function of slots alone. */\n clock?(host: { readonly id: string }): void;\n}\n\n/** The {@link PropSlot._name} of `Node2D`'s laid-out box. */\nexport const LAYOUT_SLOT = \"layoutBounds\";\n/** A document variable's slot is named this plus the variable id. */\nexport const VAR_PREFIX = \"var:\";\n/** A timeline node's presence pseudo-slot is named this plus the node id. */\nexport const PRESENCE_PREFIX = \"presence:\";\n/** A node's child list and parent link, as a pseudo-slot on that node. */\nexport const STRUCTURE_SLOT = \"structure\";\n\n/** Run `fn` with every slot read and write reported to `observer`. An inner scope shadows an outer one. */\nexport function observeSlots<T>(observer: SlotObserver, fn: () => T): T {\n const previous = _setObserver(observer);\n try {\n return fn();\n } finally {\n _setObserver(previous);\n }\n}\n\n/** Run `fn` with nothing observing, inside a scope that is. */\nexport function unobserved<T>(fn: () => T): T {\n const previous = _setObserver(null);\n try {\n return fn();\n } finally {\n _setObserver(previous);\n }\n}\n\n/** `\"card.x\"` for a node's prop, the bare name for a hostless slot (`\"var:g\"`). */\nexport function slotLabel(slot: PropSlot<unknown>): string {\n return slot._host ? `${slot._host.id}.${slot._name}` : slot._name;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"observer.js","sourceRoot":"","sources":["../../src/props/observer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAiB,MAAM,QAAQ,CAAC;AAgBrD,6DAA6D;AAC7D,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC;AAC1C,qEAAqE;AACrE,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC;AACjC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;AAC3C,0EAA0E;AAC1E,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;AAE1C,2GAA2G;AAC3G,MAAM,UAAU,YAAY,CAAI,QAAsB,EAAE,EAAW;IAC/D,MAAM,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IACxC,IAAI,CAAC;QACD,OAAO,EAAE,EAAE,CAAC;IAChB,CAAC;YAAS,CAAC;QACP,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;AACL,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,UAAU,CAAI,EAAW;IACrC,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,CAAC;QACD,OAAO,EAAE,EAAE,CAAC;IAChB,CAAC;YAAS,CAAC;QACP,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;AACL,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,SAAS,CAAC,IAAuB;IAC7C,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;AACtE,CAAC","sourcesContent":["import { _setObserver, type PropSlot } from \"./slot\";\r\n\r\n/**\r\n * What the slots touched inside {@link observeSlots} are reported to.\r\n *\r\n * Reads and writes are recorded rather than declared: a dependency is whatever a\r\n * computation actually touched, bindings included, so nothing has to annotate a\r\n * prop as mattering to anyone.\r\n */\r\nexport interface SlotObserver {\r\n read(slot: PropSlot<unknown>): void;\r\n write(slot: PropSlot<unknown>): void;\r\n /** A node's clock was read — a result that depends on it is not a function of slots alone. */\r\n clock?(host: { readonly id: string }): void;\r\n}\r\n\r\n/** The {@link PropSlot._name} of `Node2D`'s laid-out box. */\r\nexport const LAYOUT_SLOT = \"layoutBounds\";\r\n/** A document variable's slot is named this plus the variable id. */\r\nexport const VAR_PREFIX = \"var:\";\r\n/** A timeline node's presence pseudo-slot is named this plus the node id. */\r\nexport const PRESENCE_PREFIX = \"presence:\";\r\n/** A node's child list and parent link, as a pseudo-slot on that node. */\r\nexport const STRUCTURE_SLOT = \"structure\";\r\n\r\n/** Run `fn` with every slot read and write reported to `observer`. An inner scope shadows an outer one. */\r\nexport function observeSlots<T>(observer: SlotObserver, fn: () => T): T {\r\n const previous = _setObserver(observer);\r\n try {\r\n return fn();\r\n } finally {\r\n _setObserver(previous);\r\n }\r\n}\r\n\r\n/** Run `fn` with nothing observing, inside a scope that is. */\r\nexport function unobserved<T>(fn: () => T): T {\r\n const previous = _setObserver(null);\r\n try {\r\n return fn();\r\n } finally {\r\n _setObserver(previous);\r\n }\r\n}\r\n\r\n/** `\"card.x\"` for a node's prop, the bare name for a hostless slot (`\"var:g\"`). */\r\nexport function slotLabel(slot: PropSlot<unknown>): string {\r\n return slot._host ? `${slot._host.id}.${slot._name}` : slot._name;\r\n}\r\n"]}
|
package/dist/props/slot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slot.js","sourceRoot":"","sources":["../../src/props/slot.ts"],"names":[],"mappings":"AAcA;;;GAGG;AACH,MAAM,CAAC,IAAI,SAAS,GAAwB,IAAI,CAAC;AAEjD,6FAA6F;AAC7F,MAAM,UAAU,YAAY,CAAC,QAA6B;IACtD,MAAM,QAAQ,GAAG,SAAS,CAAC;IAC3B,SAAS,GAAG,QAAQ,CAAC;IACrB,OAAO,QAAQ,CAAC;AACpB,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,QAAQ;IAQJ;IACA;IARL,MAAM,CAAI;IACV,GAAG,GAAqB,IAAI,CAAC;IAC7B,QAAQ,GAAG,KAAK,CAAC;IAEzB,iFAAiF;IACjF,YACI,OAAU,EACD,QAAwC,IAAI,EAC5C,QAAgB,EAAE;QADlB,UAAK,GAAL,KAAK,CAAuC;QAC5C,UAAK,GAAL,KAAK,CAAa;QAE3B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED,GAAG;QACC,sEAAsE;QACtE,0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I,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;IACnF,CAAC;IAED,WAAW,CAAC,IAAqB;QAC7B,IAAI,IAAI,CAAC,EAAE;YAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;;YAC3B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,mFAAmF;IACnF,OAAO;QACH,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,MAAM,GAAG,SAAyB,CAAC;IAC5C,CAAC;CACJ","sourcesContent":["import type { SlotObserver } from \"./observer\";\n\n/**\n * A captured state of a {@link PropSlot}: the thunk it was bound to, or the\n * plain value it held. Produced by {@link PropSlot.snapshot} and consumed by\n * {@link PropSlot.restoreFrom}.\n */\n/** @internal */\nexport interface PropSnapshot<T> {\n value: T;\n /** Present only for a bound slot; restoring one re-binds rather than freezing it. */\n fn?: () => T;\n}\n\n/**\n * @internal The observer every slot reports to, or `null` — which is every frame of\n * playback, so the hot path pays one null check. Installed by `observeSlots`.\n */\nexport let _observer: SlotObserver | null = null;\n\n/** @internal Only this module can reassign the binding. Returns the observer it replaced. */\nexport function _setObserver(observer: SlotObserver | null): SlotObserver | null {\n const previous = _observer;\n _observer = observer;\n return previous;\n}\n\n/**\n * The storage behind one `@property`: a plain value, or a thunk evaluated on\n * every read.\n *\n * There is no dependency graph and nothing to invalidate. A bound slot\n * recomputes when it is asked, which is what makes a document expression\n * (`\"=4[g]+3\"`), an author's `width={() => …}` and an alignment binding reading\n * a box written mid-layout all correct without anything declaring an edge. The\n * cache-and-invalidate version of this could only get the last one right by\n * observing the write, and paid for it everywhere: a `peek()`/`get()` split at\n * every write path, so a read taken inside whatever computation happened to be\n * running did not register an edge with no business existing.\n *\n * The bet is that recomputing is cheaper than tracking. Bindings here are\n * arithmetic over a handful of reads, and a frame's draw dwarfs all of them.\n */\nexport class PropSlot<T> {\n private _value: T;\n private _fn: (() => T) | null = null;\n private _running = false;\n\n /** `_host` and `_name` only label the slot for an observer — see `slotLabel`. */\n constructor(\n initial: T,\n readonly _host: { readonly id: string } | null = null,\n readonly _name: string = \"\",\n ) {\n this._value = initial;\n }\n\n get(): T {\n // Before the re-entrancy check, so a binding's own reads are recorded\n // under whatever read it.\n if (_observer !== null) _observer.read(this);\n // A binding that reads its own slot re-enters here mid-evaluation —\n // `bind(() => mapper(ext(), slot.get()))` is how a mapper is handed the\n // previous value. It gets the last settled one instead of recursing.\n if (!this._fn || this._running) return this._value;\n this._running = true;\n try {\n return (this._value = this._fn());\n } finally {\n this._running = false;\n }\n }\n\n set(value: T): void {\n if (_observer !== null) _observer.write(this);\n this._fn = null;\n this._value = value;\n }\n\n bind(fn: () => T): void {\n if (_observer !== null) _observer.write(this);\n this._fn = fn;\n }\n\n /** Freeze a bound slot at what it currently computes. */\n unbind(): void {\n if (!this._fn) return;\n if (_observer !== null) _observer.write(this);\n this._value = this.get();\n this._fn = null;\n }\n\n isBound(): boolean {\n return this._fn !== null;\n }\n\n snapshot(): PropSnapshot<T> {\n return this._fn ? { value: this.get(), fn: this._fn } : { value: this._value };\n }\n\n restoreFrom(snap: PropSnapshot<T>): void {\n if (snap.fn) this.bind(snap.fn);\n else this.set(snap.value);\n }\n\n /** Releases the bound closure and the value slot. The slot is inert after this. */\n dispose(): void {\n this._fn = null;\n this._value = undefined as unknown as T;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"slot.js","sourceRoot":"","sources":["../../src/props/slot.ts"],"names":[],"mappings":"AAcA;;;GAGG;AACH,MAAM,CAAC,IAAI,SAAS,GAAwB,IAAI,CAAC;AAEjD,6FAA6F;AAC7F,MAAM,UAAU,YAAY,CAAC,QAA6B;IACtD,MAAM,QAAQ,GAAG,SAAS,CAAC;IAC3B,SAAS,GAAG,QAAQ,CAA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ACzD,MAAM;QACF,IAAI,CAAC,IAAI,CAAC,GAAG;YAAE,OAAO;QACtB,IAAI,SAAS,KAAK,IAAI;YAAE,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;IACpB,CAAC;IAED,OAAO;QACH,OAAO,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC;IAC7B,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;IACnF,CAAC;IAED,WAAW,CAAC,IAAqB;QAC7B,IAAI,IAAI,CAAC,EAAE;YAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;;YAC3B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,mFAAmF;IACnF,OAAO;QACH,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,MAAM,GAAG,SAAyB,CAAC;IAC5C,CAAC;CACJ","sourcesContent":["import type { SlotObserver } from \"./observer\";\r\n\r\n/**\r\n * A captured state of a {@link PropSlot}: the thunk it was bound to, or the\r\n * plain value it held. Produced by {@link PropSlot.snapshot} and consumed by\r\n * {@link PropSlot.restoreFrom}.\r\n */\r\n/** @internal */\r\nexport interface PropSnapshot<T> {\r\n value: T;\r\n /** Present only for a bound slot; restoring one re-binds rather than freezing it. */\r\n fn?: () => T;\r\n}\r\n\r\n/**\r\n * @internal The observer every slot reports to, or `null` — which is every frame of\r\n * playback, so the hot path pays one null check. Installed by `observeSlots`.\r\n */\r\nexport let _observer: SlotObserver | null = null;\r\n\r\n/** @internal Only this module can reassign the binding. Returns the observer it replaced. */\r\nexport function _setObserver(observer: SlotObserver | null): SlotObserver | null {\r\n const previous = _observer;\r\n _observer = observer;\r\n return previous;\r\n}\r\n\r\n/**\r\n * The storage behind one `@property`: a plain value, or a thunk evaluated on\r\n * every read.\r\n *\r\n * There is no dependency graph and nothing to invalidate. A bound slot\r\n * recomputes when it is asked, which is what makes a document expression\r\n * (`\"=4[g]+3\"`), an author's `width={() => …}` and an alignment binding reading\r\n * a box written mid-layout all correct without anything declaring an edge. The\r\n * cache-and-invalidate version of this could only get the last one right by\r\n * observing the write, and paid for it everywhere: a `peek()`/`get()` split at\r\n * every write path, so a read taken inside whatever computation happened to be\r\n * running did not register an edge with no business existing.\r\n *\r\n * The bet is that recomputing is cheaper than tracking. Bindings here are\r\n * arithmetic over a handful of reads, and a frame's draw dwarfs all of them.\r\n */\r\nexport class PropSlot<T> {\r\n private _value: T;\r\n private _fn: (() => T) | null = null;\r\n private _running = false;\r\n\r\n /** `_host` and `_name` only label the slot for an observer — see `slotLabel`. */\r\n constructor(\r\n initial: T,\r\n readonly _host: { readonly id: string } | null = null,\r\n readonly _name: string = \"\",\r\n ) {\r\n this._value = initial;\r\n }\r\n\r\n get(): T {\r\n // Before the re-entrancy check, so a binding's own reads are recorded\r\n // under whatever read it.\r\n if (_observer !== null) _observer.read(this);\r\n // A binding that reads its own slot re-enters here mid-evaluation —\r\n // `bind(() => mapper(ext(), slot.get()))` is how a mapper is handed the\r\n // previous value. It gets the last settled one instead of recursing.\r\n if (!this._fn || this._running) return this._value;\r\n this._running = true;\r\n try {\r\n return (this._value = this._fn());\r\n } finally {\r\n this._running = false;\r\n }\r\n }\r\n\r\n set(value: T): void {\r\n if (_observer !== null) _observer.write(this);\r\n this._fn = null;\r\n this._value = value;\r\n }\r\n\r\n bind(fn: () => T): void {\r\n if (_observer !== null) _observer.write(this);\r\n this._fn = fn;\r\n }\r\n\r\n /** Freeze a bound slot at what it currently computes. */\r\n unbind(): void {\r\n if (!this._fn) return;\r\n if (_observer !== null) _observer.write(this);\r\n this._value = this.get();\r\n this._fn = null;\r\n }\r\n\r\n isBound(): boolean {\r\n return this._fn !== null;\r\n }\r\n\r\n snapshot(): PropSnapshot<T> {\r\n return this._fn ? { value: this.get(), fn: this._fn } : { value: this._value };\r\n }\r\n\r\n restoreFrom(snap: PropSnapshot<T>): void {\r\n if (snap.fn) this.bind(snap.fn);\r\n else this.set(snap.value);\r\n }\r\n\r\n /** Releases the bound closure and the value slot. The slot is inert after this. */\r\n dispose(): void {\r\n this._fn = null;\r\n this._value = undefined as unknown as T;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { integrateSpeedToClipTime, sourceTimeAtClipElapsed } from './attributes/audio/filters/curve.js';
|
|
2
|
+
import type { NodeEffect } from './attributes/shape/effects/union.js';
|
|
3
|
+
import { ClipTimeline } from './document/timeline.js';
|
|
4
|
+
import type { VisualDocument } from './document/types.js';
|
|
5
|
+
/** @deprecated Renamed to {@link VisualDocument}. */
|
|
6
|
+
export type SceneDocument = VisualDocument;
|
|
7
|
+
/** @deprecated Renamed to {@link ClipTimeline}. */
|
|
8
|
+
export declare const SceneTimeline: typeof ClipTimeline;
|
|
9
|
+
/** @deprecated Renamed to {@link ClipTimeline}. */
|
|
10
|
+
export type SceneTimeline = ClipTimeline;
|
|
11
|
+
/** @deprecated Renamed to {@link NodeEffect}. */
|
|
12
|
+
export type SceneEffect = NodeEffect;
|
|
13
|
+
/** @deprecated Renamed to {@link integrateSpeedToClipTime}. */
|
|
14
|
+
export declare const integrateSpeedToSceneTime: typeof integrateSpeedToClipTime;
|
|
15
|
+
/** @deprecated Renamed to {@link sourceTimeAtClipElapsed}. */
|
|
16
|
+
export declare const sourceTimeAtSceneElapsed: typeof sourceTimeAtClipElapsed;
|
|
17
|
+
//# sourceMappingURL=renamed-scene-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renamed-scene-names.d.ts","sourceRoot":"","sources":["../src/renamed-scene-names.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AACrG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIvD,qDAAqD;AACrD,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC;AAC3C,mDAAmD;AACnD,eAAO,MAAM,aAAa,qBAAe,CAAC;AAC1C,mDAAmD;AACnD,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC;AACzC,iDAAiD;AACjD,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC;AACrC,+DAA+D;AAC/D,eAAO,MAAM,yBAAyB,iCAA2B,CAAC;AAClE,8DAA8D;AAC9D,eAAO,MAAM,wBAAwB,gCAA0B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { integrateSpeedToClipTime, sourceTimeAtClipElapsed } from './attributes/audio/filters/curve.js';
|
|
2
|
+
import { ClipTimeline } from './document/timeline.js';
|
|
3
|
+
/** @deprecated Renamed to {@link ClipTimeline}. */
|
|
4
|
+
export const SceneTimeline = ClipTimeline;
|
|
5
|
+
/** @deprecated Renamed to {@link integrateSpeedToClipTime}. */
|
|
6
|
+
export const integrateSpeedToSceneTime = integrateSpeedToClipTime;
|
|
7
|
+
/** @deprecated Renamed to {@link sourceTimeAtClipElapsed}. */
|
|
8
|
+
export const sourceTimeAtSceneElapsed = sourceTimeAtClipElapsed;
|
|
9
|
+
//# sourceMappingURL=renamed-scene-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renamed-scene-names.js","sourceRoot":"","sources":["../src/renamed-scene-names.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAErG,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAOnD,mDAAmD;AACnD,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAC;AAK1C,+DAA+D;AAC/D,MAAM,CAAC,MAAM,yBAAyB,GAAG,wBAAwB,CAAC;AAClE,8DAA8D;AAC9D,MAAM,CAAC,MAAM,wBAAwB,GAAG,uBAAuB,CAAC","sourcesContent":["import { integrateSpeedToClipTime, sourceTimeAtClipElapsed } from './attributes/audio/filters/curve';\r\nimport type { NodeEffect } from './attributes/shape/effects/union';\r\nimport { ClipTimeline } from './document/timeline';\r\nimport type { VisualDocument } from './document/types';\r\n\r\n// The names the document API had before \"scene\" became \"clip\", kept until 1.0.\r\n\r\n/** @deprecated Renamed to {@link VisualDocument}. */\r\nexport type SceneDocument = VisualDocument;\r\n/** @deprecated Renamed to {@link ClipTimeline}. */\r\nexport const SceneTimeline = ClipTimeline;\r\n/** @deprecated Renamed to {@link ClipTimeline}. */\r\nexport type SceneTimeline = ClipTimeline;\r\n/** @deprecated Renamed to {@link NodeEffect}. */\r\nexport type SceneEffect = NodeEffect;\r\n/** @deprecated Renamed to {@link integrateSpeedToClipTime}. */\r\nexport const integrateSpeedToSceneTime = integrateSpeedToClipTime;\r\n/** @deprecated Renamed to {@link sourceTimeAtClipElapsed}. */\r\nexport const sourceTimeAtSceneElapsed = sourceTimeAtClipElapsed;\r\n"]}
|
|
@@ -9,7 +9,7 @@ import type { BooleanOperation } from "../attributes/mask/boolean.js";
|
|
|
9
9
|
import { TextState } from "./descriptors/text.js";
|
|
10
10
|
import { TextBlockLayout } from "./text-layout.js";
|
|
11
11
|
import type { NodeRenderState, RasterizedSurface, RenderContext2D, RenderPass2D, SpaceRects, EffectTarget } from "./render-context2d.js";
|
|
12
|
-
import type {
|
|
12
|
+
import type { NodeEffect } from "../attributes/shape/effects/union.js";
|
|
13
13
|
/**
|
|
14
14
|
* The base every {@link RenderContext2D} backend extends.
|
|
15
15
|
*
|
|
@@ -88,7 +88,7 @@ export declare abstract class CanvasRenderContext2D implements RenderPass2D {
|
|
|
88
88
|
abstract beginClip(clip: Clip): void;
|
|
89
89
|
abstract endClip(): void;
|
|
90
90
|
/** See {@link RenderContext2D.beginEffects}. No-op by default. */
|
|
91
|
-
beginEffects(effects:
|
|
91
|
+
beginEffects(effects: NodeEffect[], target: EffectTarget, width: number, height: number): void;
|
|
92
92
|
endEffects(): void;
|
|
93
93
|
/** See {@link RenderContext2D.rasterize}. Returns `null` by default. */
|
|
94
94
|
rasterize(width: number, height: number, draw: () => void, pixelRatio?: number): RasterizedSurface | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvas-render-context2d.d.ts","sourceRoot":"","sources":["../../src/render/canvas-render-context2d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACtI,O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