@motionscript/core 0.1.0-alpha.8 → 0.1.0
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 +25 -0
- package/LICENSE +201 -201
- package/NOTICE +49 -49
- package/README.md +91 -91
- package/dist/assets/asset-index.js.map +1 -1
- package/dist/assets/catalog.js.map +1 -1
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/index.js.map +1 -1
- 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.js.map +1 -1
- package/dist/attributes/audio/effects/chain.js.map +1 -1
- package/dist/attributes/audio/effects/implementations/echo.js.map +1 -1
- package/dist/attributes/audio/effects/implementations/gain.js.map +1 -1
- package/dist/attributes/audio/effects/implementations/highpass.js.map +1 -1
- package/dist/attributes/audio/effects/implementations/lowpass.js.map +1 -1
- package/dist/attributes/audio/effects/implementations/tremolo.js.map +1 -1
- package/dist/attributes/audio/effects/index.js.map +1 -1
- package/dist/attributes/audio/effects/registry.js.map +1 -1
- package/dist/attributes/audio/effects/union.js.map +1 -1
- package/dist/attributes/audio/ramp.js.map +1 -1
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/audio/sound.js.map +1 -1
- package/dist/attributes/audio/transition.js.map +1 -1
- package/dist/attributes/index.js.map +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/space3d.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.js.map +1 -1
- package/dist/attributes/properties/inputs.js.map +1 -1
- package/dist/attributes/properties/typed.js.map +1 -1
- 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.js.map +1 -1
- 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.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.d.ts +2 -2
- 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.d.ts +2 -2
- 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.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.d.ts +4 -4
- 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.d.ts +2 -2
- 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.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 +2 -2
- 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.js.map +1 -1
- package/dist/attributes/shape/effects/registry.js.map +1 -1
- package/dist/attributes/shape/effects/spec.js.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 +20 -5
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.js.map +1 -1
- 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.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
- 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.js.map +1 -1
- 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.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.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.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.js.map +1 -1
- package/dist/attributes/shape/filters/registry.js.map +1 -1
- package/dist/attributes/shape/filters/union.js.map +1 -1
- 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.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/language.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.js.map +1 -1
- 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.js.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/{chunk-LKUYVFU3.js → chunk-4BDLFEOC.js} +1 -1
- package/dist/browser/chunks/chunk-4BDLFEOC.js.map +7 -0
- package/dist/browser/chunks/chunk-CCGVIR4F.js +3 -0
- package/dist/browser/chunks/chunk-CCGVIR4F.js.map +7 -0
- package/dist/browser/chunks/chunk-N4WSN5WY.js +13 -0
- package/dist/browser/chunks/chunk-N4WSN5WY.js.map +7 -0
- package/dist/browser/chunks/chunk-WZSI3GSK.js +6 -0
- package/dist/browser/chunks/chunk-WZSI3GSK.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/experimental.js +1 -1
- package/dist/browser/experimental.js.map +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/manifest.json +1 -1
- package/dist/browser/sdk.js +1 -1
- package/dist/component.js.map +1 -1
- package/dist/components/builtins/audio/audio.js.map +1 -1
- package/dist/components/builtins/geometry/composite.js.map +1 -1
- package/dist/components/builtins/geometry/geometry.js.map +1 -1
- package/dist/components/builtins/geometry/shape-outline.js.map +1 -1
- package/dist/components/builtins/layout/layout.js.map +1 -1
- package/dist/components/builtins/media/media.js.map +1 -1
- package/dist/components/builtins/providers/providers.js.map +1 -1
- package/dist/components/builtins/text/number-format.js.map +1 -1
- package/dist/components/builtins/text/number-pattern.js.map +1 -1
- package/dist/components/builtins/text/text-defaults.js.map +1 -1
- package/dist/components/builtins/text/text-layout.js.map +1 -1
- package/dist/components/builtins/text/text.d.ts +9 -9
- package/dist/components/builtins/text/text.js.map +1 -1
- package/dist/components/builtins/three/canvas3d.js.map +1 -1
- package/dist/components/builtins/three/grid-geometry3d.js.map +1 -1
- package/dist/components/builtins/three/three.js.map +1 -1
- package/dist/components/factory/api.js.map +1 -1
- package/dist/components/factory/clip-of.js.map +1 -1
- package/dist/components/factory/commands-for.js.map +1 -1
- package/dist/components/factory/component-audio.js.map +1 -1
- package/dist/components/factory/component2d.js.map +1 -1
- package/dist/components/factory/component3d.js.map +1 -1
- package/dist/components/factory/factory.js.map +1 -1
- package/dist/components/factory/timeline.js.map +1 -1
- package/dist/components/factory/type-def.js.map +1 -1
- package/dist/components/factory/types.js.map +1 -1
- package/dist/components/factory/views.d.ts.map +1 -1
- package/dist/components/factory/views.js +41 -1
- package/dist/components/factory/views.js.map +1 -1
- package/dist/components/modules/aim.js.map +1 -1
- package/dist/components/modules/corners.js.map +1 -1
- package/dist/components/modules/flow.js.map +1 -1
- package/dist/components/modules/material.js.map +1 -1
- package/dist/components/modules/paint.js.map +1 -1
- package/dist/components/modules/shapes.js.map +1 -1
- package/dist/components/modules/text-layout.js.map +1 -1
- package/dist/components/modules/text-style.d.ts +1 -1
- package/dist/components/modules/text-style.js.map +1 -1
- package/dist/components/modules/three-entries.js.map +1 -1
- package/dist/components/modules/view3d.js.map +1 -1
- package/dist/components/trees/2d/group-bounds.js.map +1 -1
- package/dist/components/trees/2d/node-lifecycle.js.map +1 -1
- package/dist/components/trees/2d/node-motion.js.map +1 -1
- package/dist/components/trees/2d/node-render.js.map +1 -1
- package/dist/components/trees/2d/node-space.js.map +1 -1
- package/dist/components/trees/2d/node-transform.js.map +1 -1
- package/dist/components/trees/2d/node2d.js.map +1 -1
- package/dist/components/trees/audio/index.js.map +1 -1
- package/dist/components/trees/audio/node-audio.js.map +1 -1
- package/dist/components/trees/index.js.map +1 -1
- package/dist/components/trees/node/node-editor-state.js.map +1 -1
- package/dist/components/trees/node/node-reactive.d.ts +3 -4
- package/dist/components/trees/node/node-reactive.d.ts.map +1 -1
- package/dist/components/trees/node/node-reactive.js +13 -10
- package/dist/components/trees/node/node-reactive.js.map +1 -1
- package/dist/components/trees/node/node-time.js.map +1 -1
- package/dist/components/trees/node/node-walk.js.map +1 -1
- package/dist/components/trees/node/node.js.map +1 -1
- package/dist/components/trees/root/canvas2d-node.js.map +1 -1
- package/dist/components/trees/three/node3d.js.map +1 -1
- package/dist/document/audio.js.map +1 -1
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +8 -0
- package/dist/document/command-traits.d.ts.map +1 -1
- package/dist/document/command-traits.js +17 -0
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/diff.js.map +1 -1
- package/dist/document/doc-index.js.map +1 -1
- package/dist/document/expression/compile.js.map +1 -1
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/expression/parse.js.map +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.js.map +1 -1
- package/dist/document/index.js.map +1 -1
- package/dist/document/migrate.js.map +1 -1
- package/dist/document/missing-node.js.map +1 -1
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.js.map +1 -1
- package/dist/document/placement.js.map +1 -1
- package/dist/document/project.js.map +1 -1
- package/dist/document/prop-evolution.js.map +1 -1
- package/dist/document/registry.js.map +1 -1
- package/dist/document/settled-index.d.ts +6 -0
- package/dist/document/settled-index.d.ts.map +1 -1
- package/dist/document/settled-index.js +18 -1
- package/dist/document/settled-index.js.map +1 -1
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +26 -6
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.js.map +1 -1
- package/dist/document/vocabulary.js.map +1 -1
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/layout/bounds.js.map +1 -1
- package/dist/layout/constraints.js.map +1 -1
- 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.js.map +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/platform/audio-sink.js.map +1 -1
- package/dist/platform/exporter.js.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.js.map +1 -1
- 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.js.map +1 -1
- package/dist/props/host.d.ts +5 -0
- package/dist/props/host.d.ts.map +1 -1
- package/dist/props/host.js +3 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/index.js.map +1 -1
- package/dist/props/layout.d.ts +29 -0
- package/dist/props/layout.d.ts.map +1 -0
- package/dist/props/layout.js +84 -0
- package/dist/props/layout.js.map +1 -0
- package/dist/props/observer.js.map +1 -1
- package/dist/props/slot.js.map +1 -1
- package/dist/renamed-scene-names.js.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/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.js.map +1 -1
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/descriptors/transform.js.map +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.js.map +1 -1
- package/dist/render/render-issue.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.js.map +1 -1
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/camera.js.map +1 -1
- package/dist/render3d/fill3d.js.map +1 -1
- package/dist/render3d/geometry.js.map +1 -1
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/index.js.map +1 -1
- package/dist/render3d/inert.js.map +1 -1
- package/dist/render3d/light.js.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.js.map +1 -1
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/segments.js.map +1 -1
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/tracking.js.map +1 -1
- package/dist/render3d/transform.js.map +1 -1
- package/dist/render3d/vector3.js.map +1 -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.js.map +1 -1
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/frame-time.js.map +1 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/placement.js.map +1 -1
- 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.js.map +1 -1
- package/dist/runtime/settle.js.map +1 -1
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/ease/constants.js.map +1 -1
- package/dist/tween/ease/curve.js.map +1 -1
- package/dist/tween/ease/describe.js.map +1 -1
- package/dist/tween/ease/spec.js.map +1 -1
- 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.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.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 +1 -1
- package/dist/attributes/audio/filters/chain.d.ts +0 -113
- package/dist/attributes/audio/filters/chain.d.ts.map +0 -1
- package/dist/attributes/audio/filters/chain.js +0 -104
- package/dist/attributes/audio/filters/chain.js.map +0 -1
- package/dist/attributes/audio/filters/curve.d.ts +0 -152
- package/dist/attributes/audio/filters/curve.d.ts.map +0 -1
- package/dist/attributes/audio/filters/curve.js +0 -250
- package/dist/attributes/audio/filters/curve.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/echo.d.ts +0 -14
- package/dist/attributes/audio/filters/implementations/echo.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/echo.js +0 -11
- package/dist/attributes/audio/filters/implementations/echo.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/gain.d.ts +0 -10
- package/dist/attributes/audio/filters/implementations/gain.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/gain.js +0 -6
- package/dist/attributes/audio/filters/implementations/gain.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/highpass.d.ts +0 -12
- package/dist/attributes/audio/filters/implementations/highpass.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/highpass.js +0 -10
- package/dist/attributes/audio/filters/implementations/highpass.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/lowpass.d.ts +0 -12
- package/dist/attributes/audio/filters/implementations/lowpass.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/lowpass.js +0 -10
- package/dist/attributes/audio/filters/implementations/lowpass.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/speed.d.ts +0 -18
- package/dist/attributes/audio/filters/implementations/speed.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/speed.js +0 -6
- package/dist/attributes/audio/filters/implementations/speed.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/tremolo.d.ts +0 -12
- package/dist/attributes/audio/filters/implementations/tremolo.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/tremolo.js +0 -10
- package/dist/attributes/audio/filters/implementations/tremolo.js.map +0 -1
- package/dist/attributes/audio/filters/index.d.ts +0 -22
- package/dist/attributes/audio/filters/index.d.ts.map +0 -1
- package/dist/attributes/audio/filters/index.js +0 -8
- package/dist/attributes/audio/filters/index.js.map +0 -1
- package/dist/attributes/audio/filters/registry.d.ts +0 -36
- package/dist/attributes/audio/filters/registry.d.ts.map +0 -1
- package/dist/attributes/audio/filters/registry.js +0 -82
- package/dist/attributes/audio/filters/registry.js.map +0 -1
- package/dist/attributes/audio/filters/union.d.ts +0 -18
- package/dist/attributes/audio/filters/union.d.ts.map +0 -1
- package/dist/attributes/audio/filters/union.js +0 -28
- package/dist/attributes/audio/filters/union.js.map +0 -1
- package/dist/attributes/shape/sksl-uniforms.d.ts +0 -146
- package/dist/attributes/shape/sksl-uniforms.d.ts.map +0 -1
- package/dist/attributes/shape/sksl-uniforms.js +0 -0
- package/dist/attributes/shape/sksl-uniforms.js.map +0 -1
- package/dist/browser/chunks/chunk-AOT33LMS.js +0 -13
- package/dist/browser/chunks/chunk-AOT33LMS.js.map +0 -7
- package/dist/browser/chunks/chunk-GKM6UZJR.js +0 -6
- package/dist/browser/chunks/chunk-GKM6UZJR.js.map +0 -7
- package/dist/browser/chunks/chunk-LKUYVFU3.js.map +0 -7
- package/dist/browser/chunks/chunk-ZRPZPWZU.js +0 -3
- package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +0 -7
- package/dist/component/api.d.ts +0 -508
- package/dist/component/api.d.ts.map +0 -1
- package/dist/component/api.js +0 -4
- package/dist/component/api.js.map +0 -1
- package/dist/component/builtins/audio.d.ts +0 -26
- package/dist/component/builtins/audio.d.ts.map +0 -1
- package/dist/component/builtins/audio.js +0 -41
- package/dist/component/builtins/audio.js.map +0 -1
- package/dist/component/builtins/canvas3d.d.ts +0 -98
- package/dist/component/builtins/canvas3d.d.ts.map +0 -1
- package/dist/component/builtins/canvas3d.js +0 -21
- package/dist/component/builtins/canvas3d.js.map +0 -1
- package/dist/component/builtins/composite.d.ts +0 -56
- package/dist/component/builtins/composite.d.ts.map +0 -1
- package/dist/component/builtins/composite.js +0 -25
- package/dist/component/builtins/composite.js.map +0 -1
- package/dist/component/builtins/geometry.d.ts +0 -505
- package/dist/component/builtins/geometry.d.ts.map +0 -1
- package/dist/component/builtins/geometry.js +0 -107
- package/dist/component/builtins/geometry.js.map +0 -1
- package/dist/component/builtins/layout.d.ts +0 -88
- package/dist/component/builtins/layout.d.ts.map +0 -1
- package/dist/component/builtins/layout.js +0 -84
- package/dist/component/builtins/layout.js.map +0 -1
- package/dist/component/builtins/media.d.ts +0 -95
- package/dist/component/builtins/media.d.ts.map +0 -1
- package/dist/component/builtins/media.js +0 -149
- package/dist/component/builtins/media.js.map +0 -1
- package/dist/component/builtins/providers.d.ts +0 -23
- package/dist/component/builtins/providers.d.ts.map +0 -1
- package/dist/component/builtins/providers.js +0 -30
- package/dist/component/builtins/providers.js.map +0 -1
- package/dist/component/builtins/text.d.ts +0 -193
- package/dist/component/builtins/text.d.ts.map +0 -1
- package/dist/component/builtins/text.js +0 -113
- package/dist/component/builtins/text.js.map +0 -1
- package/dist/component/builtins/three.d.ts +0 -1085
- package/dist/component/builtins/three.d.ts.map +0 -1
- package/dist/component/builtins/three.js +0 -265
- package/dist/component/builtins/three.js.map +0 -1
- package/dist/component/clip-of.d.ts +0 -5
- package/dist/component/clip-of.d.ts.map +0 -1
- package/dist/component/clip-of.js +0 -33
- package/dist/component/clip-of.js.map +0 -1
- package/dist/component/commands-for.d.ts +0 -19
- package/dist/component/commands-for.d.ts.map +0 -1
- package/dist/component/commands-for.js +0 -5
- package/dist/component/commands-for.js.map +0 -1
- package/dist/component/component-audio.d.ts +0 -9
- package/dist/component/component-audio.d.ts.map +0 -1
- package/dist/component/component-audio.js +0 -18
- package/dist/component/component-audio.js.map +0 -1
- package/dist/component/component2d.d.ts +0 -9
- package/dist/component/component2d.d.ts.map +0 -1
- package/dist/component/component2d.js +0 -239
- package/dist/component/component2d.js.map +0 -1
- package/dist/component/component3d.d.ts +0 -9
- package/dist/component/component3d.d.ts.map +0 -1
- package/dist/component/component3d.js +0 -99
- package/dist/component/component3d.js.map +0 -1
- package/dist/component/factory.d.ts +0 -63
- package/dist/component/factory.d.ts.map +0 -1
- package/dist/component/factory.js +0 -313
- package/dist/component/factory.js.map +0 -1
- package/dist/component/modules/aim.d.ts +0 -30
- package/dist/component/modules/aim.d.ts.map +0 -1
- package/dist/component/modules/aim.js +0 -39
- package/dist/component/modules/aim.js.map +0 -1
- package/dist/component/modules/corners.d.ts +0 -13
- package/dist/component/modules/corners.d.ts.map +0 -1
- package/dist/component/modules/corners.js +0 -12
- package/dist/component/modules/corners.js.map +0 -1
- package/dist/component/modules/flow.d.ts +0 -26
- package/dist/component/modules/flow.d.ts.map +0 -1
- package/dist/component/modules/flow.js +0 -55
- package/dist/component/modules/flow.js.map +0 -1
- package/dist/component/modules/material.d.ts +0 -40
- package/dist/component/modules/material.d.ts.map +0 -1
- package/dist/component/modules/material.js +0 -75
- package/dist/component/modules/material.js.map +0 -1
- package/dist/component/modules/paint.d.ts +0 -71
- package/dist/component/modules/paint.d.ts.map +0 -1
- package/dist/component/modules/paint.js +0 -106
- package/dist/component/modules/paint.js.map +0 -1
- package/dist/component/modules/shapes.d.ts +0 -31
- package/dist/component/modules/shapes.d.ts.map +0 -1
- package/dist/component/modules/shapes.js +0 -43
- package/dist/component/modules/shapes.js.map +0 -1
- package/dist/component/modules/text-layout.d.ts +0 -26
- package/dist/component/modules/text-layout.d.ts.map +0 -1
- package/dist/component/modules/text-layout.js +0 -57
- package/dist/component/modules/text-layout.js.map +0 -1
- package/dist/component/modules/text-style.d.ts +0 -48
- package/dist/component/modules/text-style.d.ts.map +0 -1
- package/dist/component/modules/text-style.js +0 -63
- package/dist/component/modules/text-style.js.map +0 -1
- package/dist/component/modules/three-entries.d.ts +0 -23
- package/dist/component/modules/three-entries.d.ts.map +0 -1
- package/dist/component/modules/three-entries.js +0 -41
- package/dist/component/modules/three-entries.js.map +0 -1
- package/dist/component/modules/view3d.d.ts +0 -55
- package/dist/component/modules/view3d.d.ts.map +0 -1
- package/dist/component/modules/view3d.js +0 -160
- package/dist/component/modules/view3d.js.map +0 -1
- package/dist/component/timeline.d.ts +0 -22
- package/dist/component/timeline.d.ts.map +0 -1
- package/dist/component/timeline.js +0 -128
- package/dist/component/timeline.js.map +0 -1
- package/dist/component/type-def.d.ts +0 -26
- package/dist/component/type-def.d.ts.map +0 -1
- package/dist/component/type-def.js +0 -16
- package/dist/component/type-def.js.map +0 -1
- package/dist/component/types.d.ts +0 -91
- package/dist/component/types.d.ts.map +0 -1
- package/dist/component/types.js +0 -88
- package/dist/component/types.js.map +0 -1
- package/dist/component/views.d.ts +0 -121
- package/dist/component/views.d.ts.map +0 -1
- package/dist/component/views.js +0 -413
- package/dist/component/views.js.map +0 -1
- package/dist/document/withdraw.d.ts +0 -28
- package/dist/document/withdraw.d.ts.map +0 -1
- package/dist/document/withdraw.js +0 -61
- package/dist/document/withdraw.js.map +0 -1
- package/dist/jsx/jsx-dev-runtime.d.ts +0 -3
- package/dist/jsx/jsx-dev-runtime.d.ts.map +0 -1
- package/dist/jsx/jsx-dev-runtime.js +0 -3
- package/dist/jsx/jsx-dev-runtime.js.map +0 -1
- package/dist/jsx/jsx-runtime.d.ts +0 -27
- package/dist/jsx/jsx-runtime.d.ts.map +0 -1
- package/dist/jsx/jsx-runtime.js +0 -26
- package/dist/jsx/jsx-runtime.js.map +0 -1
- package/dist/nodes/2d/node-lifecycle.d.ts +0 -46
- package/dist/nodes/2d/node-lifecycle.d.ts.map +0 -1
- package/dist/nodes/2d/node-lifecycle.js +0 -264
- package/dist/nodes/2d/node-lifecycle.js.map +0 -1
- package/dist/nodes/2d/node-motion.d.ts +0 -56
- package/dist/nodes/2d/node-motion.d.ts.map +0 -1
- package/dist/nodes/2d/node-motion.js +0 -86
- package/dist/nodes/2d/node-motion.js.map +0 -1
- package/dist/nodes/2d/node-render.d.ts +0 -44
- package/dist/nodes/2d/node-render.d.ts.map +0 -1
- package/dist/nodes/2d/node-render.js +0 -80
- package/dist/nodes/2d/node-render.js.map +0 -1
- package/dist/nodes/2d/node-space.d.ts +0 -63
- package/dist/nodes/2d/node-space.d.ts.map +0 -1
- package/dist/nodes/2d/node-space.js +0 -131
- package/dist/nodes/2d/node-space.js.map +0 -1
- package/dist/nodes/2d/node-transform.d.ts +0 -55
- package/dist/nodes/2d/node-transform.d.ts.map +0 -1
- package/dist/nodes/2d/node-transform.js +0 -73
- package/dist/nodes/2d/node-transform.js.map +0 -1
- package/dist/nodes/2d/node2d.d.ts +0 -1111
- package/dist/nodes/2d/node2d.d.ts.map +0 -1
- package/dist/nodes/2d/node2d.js +0 -1665
- package/dist/nodes/2d/node2d.js.map +0 -1
- package/dist/nodes/2d/paint-node.d.ts +0 -142
- package/dist/nodes/2d/paint-node.d.ts.map +0 -1
- package/dist/nodes/2d/paint-node.js +0 -232
- package/dist/nodes/2d/paint-node.js.map +0 -1
- package/dist/nodes/audio/audio-bus.d.ts +0 -28
- package/dist/nodes/audio/audio-bus.d.ts.map +0 -1
- package/dist/nodes/audio/audio-bus.js +0 -33
- package/dist/nodes/audio/audio-bus.js.map +0 -1
- package/dist/nodes/audio/index.d.ts +0 -4
- package/dist/nodes/audio/index.d.ts.map +0 -1
- package/dist/nodes/audio/index.js +0 -2
- package/dist/nodes/audio/index.js.map +0 -1
- package/dist/nodes/audio/node-audio.d.ts +0 -107
- package/dist/nodes/audio/node-audio.d.ts.map +0 -1
- package/dist/nodes/audio/node-audio.js +0 -179
- package/dist/nodes/audio/node-audio.js.map +0 -1
- package/dist/nodes/audio/sound-node.d.ts +0 -41
- package/dist/nodes/audio/sound-node.d.ts.map +0 -1
- package/dist/nodes/audio/sound-node.js +0 -71
- package/dist/nodes/audio/sound-node.js.map +0 -1
- package/dist/nodes/geometry/boolean-node.d.ts +0 -28
- package/dist/nodes/geometry/boolean-node.d.ts.map +0 -1
- package/dist/nodes/geometry/boolean-node.js +0 -81
- package/dist/nodes/geometry/boolean-node.js.map +0 -1
- package/dist/nodes/geometry/bounds-shape-node.d.ts +0 -149
- package/dist/nodes/geometry/bounds-shape-node.d.ts.map +0 -1
- package/dist/nodes/geometry/bounds-shape-node.js +0 -181
- package/dist/nodes/geometry/bounds-shape-node.js.map +0 -1
- package/dist/nodes/geometry/box-path-node.d.ts +0 -89
- package/dist/nodes/geometry/box-path-node.d.ts.map +0 -1
- package/dist/nodes/geometry/box-path-node.js +0 -116
- package/dist/nodes/geometry/box-path-node.js.map +0 -1
- package/dist/nodes/geometry/ellipse-node.d.ts +0 -18
- package/dist/nodes/geometry/ellipse-node.d.ts.map +0 -1
- package/dist/nodes/geometry/ellipse-node.js +0 -45
- package/dist/nodes/geometry/ellipse-node.js.map +0 -1
- package/dist/nodes/geometry/group-bounds.d.ts +0 -56
- package/dist/nodes/geometry/group-bounds.d.ts.map +0 -1
- package/dist/nodes/geometry/group-bounds.js +0 -87
- package/dist/nodes/geometry/group-bounds.js.map +0 -1
- package/dist/nodes/geometry/mask-node.d.ts +0 -33
- package/dist/nodes/geometry/mask-node.d.ts.map +0 -1
- package/dist/nodes/geometry/mask-node.js +0 -66
- package/dist/nodes/geometry/mask-node.js.map +0 -1
- package/dist/nodes/geometry/path-node.d.ts +0 -26
- package/dist/nodes/geometry/path-node.d.ts.map +0 -1
- package/dist/nodes/geometry/path-node.js +0 -58
- package/dist/nodes/geometry/path-node.js.map +0 -1
- package/dist/nodes/geometry/polygon-node.d.ts +0 -26
- package/dist/nodes/geometry/polygon-node.d.ts.map +0 -1
- package/dist/nodes/geometry/polygon-node.js +0 -47
- package/dist/nodes/geometry/polygon-node.js.map +0 -1
- package/dist/nodes/geometry/polygram-node.d.ts +0 -33
- package/dist/nodes/geometry/polygram-node.d.ts.map +0 -1
- package/dist/nodes/geometry/polygram-node.js +0 -52
- package/dist/nodes/geometry/polygram-node.js.map +0 -1
- package/dist/nodes/geometry/rect-node.d.ts +0 -38
- package/dist/nodes/geometry/rect-node.d.ts.map +0 -1
- package/dist/nodes/geometry/rect-node.js +0 -56
- package/dist/nodes/geometry/rect-node.js.map +0 -1
- package/dist/nodes/geometry/shape-node.d.ts +0 -71
- package/dist/nodes/geometry/shape-node.d.ts.map +0 -1
- package/dist/nodes/geometry/shape-node.js +0 -140
- package/dist/nodes/geometry/shape-node.js.map +0 -1
- package/dist/nodes/geometry/shape-outline.d.ts +0 -93
- package/dist/nodes/geometry/shape-outline.d.ts.map +0 -1
- package/dist/nodes/geometry/shape-outline.js +0 -470
- package/dist/nodes/geometry/shape-outline.js.map +0 -1
- package/dist/nodes/index.d.ts +0 -53
- package/dist/nodes/index.d.ts.map +0 -1
- package/dist/nodes/index.js +0 -35
- package/dist/nodes/index.js.map +0 -1
- package/dist/nodes/layout/camera-node.d.ts +0 -80
- package/dist/nodes/layout/camera-node.d.ts.map +0 -1
- package/dist/nodes/layout/camera-node.js +0 -153
- package/dist/nodes/layout/camera-node.js.map +0 -1
- package/dist/nodes/layout/orbit-camera-node.d.ts +0 -80
- package/dist/nodes/layout/orbit-camera-node.d.ts.map +0 -1
- package/dist/nodes/layout/orbit-camera-node.js +0 -118
- package/dist/nodes/layout/orbit-camera-node.js.map +0 -1
- package/dist/nodes/layout/rotated-box.d.ts +0 -20
- package/dist/nodes/layout/rotated-box.d.ts.map +0 -1
- package/dist/nodes/layout/rotated-box.js +0 -76
- package/dist/nodes/layout/rotated-box.js.map +0 -1
- package/dist/nodes/media/video-node.d.ts +0 -229
- package/dist/nodes/media/video-node.d.ts.map +0 -1
- package/dist/nodes/media/video-node.js +0 -350
- package/dist/nodes/media/video-node.js.map +0 -1
- package/dist/nodes/node/declare-paints.d.ts +0 -19
- package/dist/nodes/node/declare-paints.d.ts.map +0 -1
- package/dist/nodes/node/declare-paints.js +0 -27
- package/dist/nodes/node/declare-paints.js.map +0 -1
- package/dist/nodes/node/node-editor-state.d.ts +0 -53
- package/dist/nodes/node/node-editor-state.d.ts.map +0 -1
- package/dist/nodes/node/node-editor-state.js +0 -23
- package/dist/nodes/node/node-editor-state.js.map +0 -1
- package/dist/nodes/node/node-reactive.d.ts +0 -89
- package/dist/nodes/node/node-reactive.d.ts.map +0 -1
- package/dist/nodes/node/node-reactive.js +0 -135
- package/dist/nodes/node/node-reactive.js.map +0 -1
- package/dist/nodes/node/node-time.d.ts +0 -39
- package/dist/nodes/node/node-time.d.ts.map +0 -1
- package/dist/nodes/node/node-time.js +0 -14
- package/dist/nodes/node/node-time.js.map +0 -1
- package/dist/nodes/node/node-walk.d.ts +0 -46
- package/dist/nodes/node/node-walk.d.ts.map +0 -1
- package/dist/nodes/node/node-walk.js +0 -74
- package/dist/nodes/node/node-walk.js.map +0 -1
- package/dist/nodes/node/node.d.ts +0 -445
- package/dist/nodes/node/node.d.ts.map +0 -1
- package/dist/nodes/node/node.js +0 -745
- package/dist/nodes/node/node.js.map +0 -1
- package/dist/nodes/node/text-defaults.d.ts +0 -32
- package/dist/nodes/node/text-defaults.d.ts.map +0 -1
- package/dist/nodes/node/text-defaults.js +0 -37
- package/dist/nodes/node/text-defaults.js.map +0 -1
- package/dist/nodes/root/canvas2d-node.d.ts +0 -163
- package/dist/nodes/root/canvas2d-node.d.ts.map +0 -1
- package/dist/nodes/root/canvas2d-node.js +0 -264
- package/dist/nodes/root/canvas2d-node.js.map +0 -1
- package/dist/nodes/root/provider-node.d.ts +0 -47
- package/dist/nodes/root/provider-node.d.ts.map +0 -1
- package/dist/nodes/root/provider-node.js +0 -63
- package/dist/nodes/root/provider-node.js.map +0 -1
- package/dist/nodes/root/theme-provider-node.d.ts +0 -29
- package/dist/nodes/root/theme-provider-node.d.ts.map +0 -1
- package/dist/nodes/root/theme-provider-node.js +0 -43
- package/dist/nodes/root/theme-provider-node.js.map +0 -1
- package/dist/nodes/text/default-text-style-node.d.ts +0 -103
- package/dist/nodes/text/default-text-style-node.d.ts.map +0 -1
- package/dist/nodes/text/default-text-style-node.js +0 -146
- package/dist/nodes/text/default-text-style-node.js.map +0 -1
- package/dist/nodes/text/number-format.d.ts +0 -66
- package/dist/nodes/text/number-format.d.ts.map +0 -1
- package/dist/nodes/text/number-format.js +0 -227
- package/dist/nodes/text/number-format.js.map +0 -1
- package/dist/nodes/text/number-node.d.ts +0 -94
- package/dist/nodes/text/number-node.d.ts.map +0 -1
- package/dist/nodes/text/number-node.js +0 -86
- package/dist/nodes/text/number-node.js.map +0 -1
- package/dist/nodes/text/number-pattern.d.ts +0 -51
- package/dist/nodes/text/number-pattern.d.ts.map +0 -1
- package/dist/nodes/text/number-pattern.js +0 -77
- package/dist/nodes/text/number-pattern.js.map +0 -1
- package/dist/nodes/text/richtext-node.d.ts +0 -68
- package/dist/nodes/text/richtext-node.d.ts.map +0 -1
- package/dist/nodes/text/richtext-node.js +0 -78
- package/dist/nodes/text/richtext-node.js.map +0 -1
- package/dist/nodes/text/text-base.d.ts +0 -118
- package/dist/nodes/text/text-base.d.ts.map +0 -1
- package/dist/nodes/text/text-base.js +0 -153
- package/dist/nodes/text/text-base.js.map +0 -1
- package/dist/nodes/text/text-layout.d.ts +0 -87
- package/dist/nodes/text/text-layout.d.ts.map +0 -1
- package/dist/nodes/text/text-layout.js +0 -368
- package/dist/nodes/text/text-layout.js.map +0 -1
- package/dist/nodes/text/text-node.d.ts +0 -84
- package/dist/nodes/text/text-node.d.ts.map +0 -1
- package/dist/nodes/text/text-node.js +0 -188
- package/dist/nodes/text/text-node.js.map +0 -1
- package/dist/nodes/text/text-selection.d.ts +0 -125
- package/dist/nodes/text/text-selection.d.ts.map +0 -1
- package/dist/nodes/text/text-selection.js +0 -209
- package/dist/nodes/text/text-selection.js.map +0 -1
- package/dist/nodes/three/camera-nodes.d.ts +0 -109
- package/dist/nodes/three/camera-nodes.d.ts.map +0 -1
- package/dist/nodes/three/camera-nodes.js +0 -112
- package/dist/nodes/three/camera-nodes.js.map +0 -1
- package/dist/nodes/three/canvas3d-node.d.ts +0 -295
- package/dist/nodes/three/canvas3d-node.d.ts.map +0 -1
- package/dist/nodes/three/canvas3d-node.js +0 -486
- package/dist/nodes/three/canvas3d-node.js.map +0 -1
- package/dist/nodes/three/drawable-nodes.d.ts +0 -173
- package/dist/nodes/three/drawable-nodes.d.ts.map +0 -1
- package/dist/nodes/three/drawable-nodes.js +0 -284
- package/dist/nodes/three/drawable-nodes.js.map +0 -1
- package/dist/nodes/three/environment-nodes.d.ts +0 -106
- package/dist/nodes/three/environment-nodes.d.ts.map +0 -1
- package/dist/nodes/three/environment-nodes.js +0 -134
- package/dist/nodes/three/environment-nodes.js.map +0 -1
- package/dist/nodes/three/geometry-nodes.d.ts +0 -197
- package/dist/nodes/three/geometry-nodes.d.ts.map +0 -1
- package/dist/nodes/three/geometry-nodes.js +0 -322
- package/dist/nodes/three/geometry-nodes.js.map +0 -1
- package/dist/nodes/three/grid-geometry3d.d.ts +0 -62
- package/dist/nodes/three/grid-geometry3d.d.ts.map +0 -1
- package/dist/nodes/three/grid-geometry3d.js +0 -114
- package/dist/nodes/three/grid-geometry3d.js.map +0 -1
- package/dist/nodes/three/group3d.d.ts +0 -23
- package/dist/nodes/three/group3d.d.ts.map +0 -1
- package/dist/nodes/three/group3d.js +0 -21
- package/dist/nodes/three/group3d.js.map +0 -1
- package/dist/nodes/three/light-nodes.d.ts +0 -120
- package/dist/nodes/three/light-nodes.d.ts.map +0 -1
- package/dist/nodes/three/light-nodes.js +0 -173
- package/dist/nodes/three/light-nodes.js.map +0 -1
- package/dist/nodes/three/mesh3d.d.ts +0 -117
- package/dist/nodes/three/mesh3d.d.ts.map +0 -1
- package/dist/nodes/three/mesh3d.js +0 -147
- package/dist/nodes/three/mesh3d.js.map +0 -1
- package/dist/nodes/three/node3d.d.ts +0 -230
- package/dist/nodes/three/node3d.d.ts.map +0 -1
- package/dist/nodes/three/node3d.js +0 -337
- package/dist/nodes/three/node3d.js.map +0 -1
- package/dist/render/descriptors/latex.d.ts +0 -6
- package/dist/render/descriptors/latex.d.ts.map +0 -1
- package/dist/render/descriptors/latex.js +0 -2
- package/dist/render/descriptors/latex.js.map +0 -1
- package/dist/tween/seekable.d.ts +0 -81
- package/dist/tween/seekable.d.ts.map +0 -1
- package/dist/tween/seekable.js +0 -137
- package/dist/tween/seekable.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/implementations/shader.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,GAGtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAuB,MAAM,wBAAwB,CAAC;AAE/E;;;GAGG;AACH,MAAM,YAAY,GAAG,CAAC,CAAC;AAwFvB,gFAAgF;AAChF,SAAS,eAAe,CAAC,QAA8C;IACnE,IAAI,CAAC,QAAQ,EAAE,MAAM;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,GAAG,GAAoB,EAAE,CAAC;IAChC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC7B,IAAI,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,OAAO,EAAE,GAAG;YAAE,SAAS;QAC9C,IAAI,GAAG,CAAC,MAAM,IAAI,YAAY,EAAE,CAAC;YAC7B,OAAO,CAAC,IAAI,CAAC,6CAA6C,YAAY,kCAAkC,CAAC,CAAC;YAC1G,MAAM;QACV,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;AACxC,CAAC;AAED,SAAS,YAAY,CAAC,MAAgD;IAClE,MAAM,QAAQ,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC1C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AC9E,gCAAgC;IAChC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;QACtB,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,IAAI,EAAE;YAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACzE,CAAC;CACJ,CAAC","sourcesContent":["import type { BlendMode } from '../blend';\r\nimport type { FillData } from '../registry';\r\nimport {\r\n lerpUniformRecord,\r\n normalizeUniforms,\r\n uniformRecordsEqual,\r\n type ShaderUniform,\r\n type ShaderUniformRecord,\r\n} from '../../shaders/uniforms';\r\nimport { shaderContractOf, type ShaderLanguage } from '../../shaders/language';\r\n\r\n/**\r\n * Ceiling on bound textures: a fill wanting more than a handful is really a 3D\r\n * scene, and the cap keeps a typo in a generated list from exhausting texture units.\r\n */\r\nconst MAX_TEXTURES = 4;\r\n\r\n/** An image the shader samples. */\r\nexport interface ShaderTexture {\r\n /** The name the shader pack gives this texture. */\r\n name: string;\r\n /** Asset path, resolved like any other image fill's `src`. */\r\n src: string;\r\n}\r\n\r\n/**\r\n * A custom WGSL shader, painted as a fill.\r\n *\r\n * The source defines `fn fill(in: FillIn) -> vec4f`, returning **premultiplied**\r\n * rgba; `in` carries `uv` (0–1 across the box), `local` (px from the box's\r\n * top-left), `size`, `time` and `scale` (device px per px), and the uniforms are\r\n * `u`, a `struct Params` the source declares. The first of `textures` is what\r\n * `sample_texture(uv)` reads.\r\n *\r\n * The escape hatch at the end of the procedural spectrum: where\r\n * {@link NoiseFillProp} and {@link FractalNoiseFillProp} expose a fixed set of\r\n * knobs over a fixed field, this hands the whole fragment function to the author.\r\n * It is still a fill, so it paints inside the shape's own path — an `Ellipse`, a\r\n * `Path`, a run of `Text` — stacks as one layer in the fill array, and inherits\r\n * the layer's `opacity`/`blend`/`space` like every other kind.\r\n *\r\n * Rect({ fill: Fills.shader(src, { uniforms: { amount: 0.4 } }) })\r\n * Text({ text: \"DEPTH\", fontSize: 320, fill: Fills.shader(src) })\r\n *\r\n * It must *not* fold `opacity` in: the fill layer's opacity is already applied\r\n * to the output, so a shader applying it again renders at the square of what\r\n * was asked for.\r\n *\r\n * `source` is the compile-cache key, so it **snaps** at a tween's midpoint rather\r\n * than interpolating — tweening it would compile a program per frame. Keep the\r\n * source constant (hoist it to module scope) and put everything that changes in a\r\n * uniform, which costs nothing: uniform values are an in-place write.\r\n */\r\nexport interface ShaderFillProp {\r\n type: 'shader';\r\n /** The program. Hoist it; don't rebuild it per frame. */\r\n source: string;\r\n /** The language `source` is written in; WGSL when absent. */\r\n language?: ShaderLanguage;\r\n /** WGSL only: the contract version it is written against (`WGSL_CONTRACT` when absent). */\r\n contract?: number;\r\n /**\r\n * The shader pack this was built from, when it was built from one.\r\n *\r\n * **Reserved, and carried rather than read.** A pack resolves to a plain\r\n * uniform record before it reaches here, so nothing in the render path needs\r\n * it — the frame is identical with or without it. What it exists for is the\r\n * trip back: a document stores resolved uniforms, and without a reference to\r\n * the pack a host reopening a saved scene has a set of numbers and no way to\r\n * know which of them were `twist` and `ink`, so the property panel it drew\r\n * when the shader was applied cannot be drawn again.\r\n *\r\n * An id naming a pack that is not registered is **not** an error: the shader\r\n * still renders, because the uniforms it needs are already in the document.\r\n * The host simply cannot offer the panel.\r\n */\r\n shaderId?: string;\r\n /**\r\n * Uniform values keyed by their declared name. The positional\r\n * `[{name, value}]` array is accepted too, so a shader can move between an\r\n * effect and a fill unchanged.\r\n */\r\n uniforms?: ShaderUniformRecord | readonly ShaderUniform[];\r\n /** Images the shader samples. */\r\n textures?: readonly ShaderTexture[];\r\n opacity?: number;\r\n blend?: BlendMode;\r\n}\r\n\r\nexport interface ShaderFillResolved {\r\n type: 'shader';\r\n source: string;\r\n language: ShaderLanguage;\r\n /** WGSL only. See {@link ShaderFillProp.contract}. */\r\n contract?: number;\r\n /** See {@link ShaderFillProp.shaderId}. */\r\n shaderId?: string;\r\n uniforms: ShaderUniformRecord;\r\n textures?: ShaderTexture[];\r\n opacity?: number;\r\n blend?: BlendMode;\r\n}\r\n\r\n/** Copy the texture list, dropping malformed entries and capping the length. */\r\nfunction resolveTextures(textures: readonly ShaderTexture[] | undefined): ShaderTexture[] | undefined {\r\n if (!textures?.length) return undefined;\r\n const out: ShaderTexture[] = [];\r\n for (const texture of textures) {\r\n if (!texture?.name || !texture?.src) continue;\r\n if (out.length >= MAX_TEXTURES) {\r\n console.warn(`[shader] A shader fill declares more than ${MAX_TEXTURES} textures; the rest are ignored.`);\r\n break;\r\n }\r\n out.push({ name: texture.name, src: texture.src });\r\n }\r\n return out.length ? out : undefined;\r\n}\r\n\r\nfunction withContract(shader: { language?: string; contract?: number }): { contract?: number } {\r\n const contract = shaderContractOf(shader);\r\n return contract === undefined ? {} : { contract };\r\n}\r\n\r\nfunction texturesEqual(a: ShaderTexture[] | undefined, b: ShaderTexture[] | undefined): boolean {\r\n if (a === b) return true;\r\n if (!a || !b || a.length !== b.length) return false;\r\n return a.every((t, i) => t.name === b[i].name && t.src === b[i].src);\r\n}\r\n\r\nexport const shaderFill: FillData<ShaderFillResolved> = {\r\n resolve: (prop: ShaderFillProp) => ({\r\n type: 'shader',\r\n source: prop.source ?? '',\r\n // A stored document may still say \"sksl\"; carried so the renderer can report it.\r\n language: prop.language ?? 'wgsl',\r\n ...withContract(prop),\r\n // Carried, never read: see `ShaderFillProp.shaderId`. Omitted when absent\r\n // so `equals` compares like with like for a fill that never had one.\r\n ...(prop.shaderId !== undefined ? { shaderId: prop.shaderId } : {}),\r\n // Normalised (and key-sorted) here rather than at paint time so `equals`\r\n // and any structural diff see the same canonical record the renderer\r\n // binds, whichever authoring shape it came in as.\r\n uniforms: normalizeUniforms(prop.uniforms),\r\n textures: resolveTextures(prop.textures),\r\n opacity: prop.opacity,\r\n blend: prop.blend,\r\n }),\r\n\r\n // `source` and `textures` snap; only the uniform values and `opacity`\r\n // interpolate. The source is the compile-cache key, so there is nothing\r\n // halfway between two programs to cross to — the same reason an image\r\n // fill's `src` and a 3D fill's scene snap.\r\n //\r\n // Deliberately returns neither `type` nor `blend`: `FillResult` omits both and\r\n // `lerpFill` reassembles via `{ ...a, ...lerp(...) }`, which is also what makes\r\n // the ragged-array self-pair (a fill fading against a copy of itself, when two\r\n // fill arrays differ in length) work.\r\n lerp: (a, b, t) => ({\r\n source: t < 0.5 ? a.source : b.source,\r\n language: t < 0.5 ? a.language : b.language,\r\n ...withContract(t < 0.5 ? a : b),\r\n uniforms: lerpUniformRecord(a.uniforms, b.uniforms, t),\r\n textures: t < 0.5 ? a.textures : b.textures,\r\n opacity: (a.opacity ?? 1) + ((b.opacity ?? 1) - (a.opacity ?? 1)) * t,\r\n }),\r\n\r\n equals: (a, b) =>\r\n a.source === b.source &&\r\n a.contract === b.contract &&\r\n uniformRecordsEqual(a.uniforms, b.uniforms) &&\r\n texturesEqual(a.textures, b.textures),\r\n\r\n // Runs off the same descriptors the renderer binds, so what gets loaded can't\r\n // drift from what gets sampled.\r\n declare: (fill, assets) => {\r\n for (const texture of fill.textures ?? []) assets.image(texture.src);\r\n },\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"shader.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/implementations/shader.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,GAGtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAuB,MAAM,wBAAwB,CAAC;AAE/E;;;GAGG;AACH,MAAM,YAAY,GAAG,CAAC,CAAC;AAwFvB,gFAAgF;AAChF,SAAS,eAAe,CAAC,QAA8C;IACnE,IAAI,CAAC,QAAQ,EAAE,MAAM;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,GAAG,GAAoB,EAAE,CAAC;IAChC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC7B,IAAI,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,OAAO,EAAE,GAAG;YAAE,SAAS;QAC9C,IAAI,GAAG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CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;KACxE,CAAC;IAEF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACb,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QACrB,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ;QACzB,mBAAmB,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC;QAC3C,aAAa,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC;IAEzC,8EAA8E;IAC9E,gCAAgC;IAChC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;QACtB,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,IAAI,EAAE;YAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACzE,CAAC;CACJ,CAAC","sourcesContent":["import type { BlendMode } from '../blend';\nimport type { FillData } from '../registry';\nimport {\n lerpUniformRecord,\n normalizeUniforms,\n uniformRecordsEqual,\n type ShaderUniform,\n type ShaderUniformRecord,\n} from '../../shaders/uniforms';\nimport { shaderContractOf, type ShaderLanguage } from '../../shaders/language';\n\n/**\n * Ceiling on bound textures: a fill wanting more than a handful is really a 3D\n * scene, and the cap keeps a typo in a generated list from exhausting texture units.\n */\nconst MAX_TEXTURES = 4;\n\n/** An image the shader samples. */\nexport interface ShaderTexture {\n /** The name the shader pack gives this texture. */\n name: string;\n /** Asset path, resolved like any other image fill's `src`. */\n src: string;\n}\n\n/**\n * A custom WGSL shader, painted as a fill.\n *\n * The source defines `fn fill(in: FillIn) -> vec4f`, returning **premultiplied**\n * rgba; `in` carries `uv` (0–1 across the box), `local` (px from the box's\n * top-left), `size`, `time` and `scale` (device px per px), and the uniforms are\n * `u`, a `struct Params` the source declares. The first of `textures` is what\n * `sample_texture(uv)` reads.\n *\n * The escape hatch at the end of the procedural spectrum: where\n * {@link NoiseFillProp} and {@link FractalNoiseFillProp} expose a fixed set of\n * knobs over a fixed field, this hands the whole fragment function to the author.\n * It is still a fill, so it paints inside the shape's own path — an `Ellipse`, a\n * `Path`, a run of `Text` — stacks as one layer in the fill array, and inherits\n * the layer's `opacity`/`blend`/`space` like every other kind.\n *\n * Rect({ fill: Fills.shader(src, { uniforms: { amount: 0.4 } }) })\n * Text({ text: \"DEPTH\", fontSize: 320, fill: Fills.shader(src) })\n *\n * It must *not* fold `opacity` in: the fill layer's opacity is already applied\n * to the output, so a shader applying it again renders at the square of what\n * was asked for.\n *\n * `source` is the compile-cache key, so it **snaps** at a tween's midpoint rather\n * than interpolating — tweening it would compile a program per frame. Keep the\n * source constant (hoist it to module scope) and put everything that changes in a\n * uniform, which costs nothing: uniform values are an in-place write.\n */\nexport interface ShaderFillProp {\n type: 'shader';\n /** The program. Hoist it; don't rebuild it per frame. */\n source: string;\n /** The language `source` is written in; WGSL when absent. */\n language?: ShaderLanguage;\n /** WGSL only: the contract version it is written against (`WGSL_CONTRACT` when absent). */\n contract?: number;\n /**\n * The shader pack this was built from, when it was built from one.\n *\n * **Reserved, and carried rather than read.** A pack resolves to a plain\n * uniform record before it reaches here, so nothing in the render path needs\n * it — the frame is identical with or without it. What it exists for is the\n * trip back: a document stores resolved uniforms, and without a reference to\n * the pack a host reopening a saved scene has a set of numbers and no way to\n * know which of them were `twist` and `ink`, so the property panel it drew\n * when the shader was applied cannot be drawn again.\n *\n * An id naming a pack that is not registered is **not** an error: the shader\n * still renders, because the uniforms it needs are already in the document.\n * The host simply cannot offer the panel.\n */\n shaderId?: string;\n /**\n * Uniform values keyed by their declared name. The positional\n * `[{name, value}]` array is accepted too, so a shader can move between an\n * effect and a fill unchanged.\n */\n uniforms?: ShaderUniformRecord | readonly ShaderUniform[];\n /** Images the shader samples. */\n textures?: readonly ShaderTexture[];\n opacity?: number;\n blend?: BlendMode;\n}\n\nexport interface ShaderFillResolved {\n type: 'shader';\n source: string;\n language: ShaderLanguage;\n /** WGSL only. See {@link ShaderFillProp.contract}. */\n contract?: number;\n /** See {@link ShaderFillProp.shaderId}. */\n shaderId?: string;\n uniforms: ShaderUniformRecord;\n textures?: ShaderTexture[];\n opacity?: number;\n blend?: BlendMode;\n}\n\n/** Copy the texture list, dropping malformed entries and capping the length. */\nfunction resolveTextures(textures: readonly ShaderTexture[] | undefined): ShaderTexture[] | undefined {\n if (!textures?.length) return undefined;\n const out: ShaderTexture[] = [];\n for (const texture of textures) {\n if (!texture?.name || !texture?.src) continue;\n if (out.length >= MAX_TEXTURES) {\n console.warn(`[shader] A shader fill declares more than ${MAX_TEXTURES} textures; the rest are ignored.`);\n break;\n }\n out.push({ name: texture.name, src: texture.src });\n }\n return out.length ? out : undefined;\n}\n\nfunction withContract(shader: { language?: string; contract?: number }): { contract?: number } {\n const contract = shaderContractOf(shader);\n return contract === undefined ? {} : { contract };\n}\n\nfunction texturesEqual(a: ShaderTexture[] | undefined, b: ShaderTexture[] | undefined): boolean {\n if (a === b) return true;\n if (!a || !b || a.length !== b.length) return false;\n return a.every((t, i) => t.name === b[i].name && t.src === b[i].src);\n}\n\nexport const shaderFill: FillData<ShaderFillResolved> = {\n resolve: (prop: ShaderFillProp) => ({\n type: 'shader',\n source: prop.source ?? '',\n // A stored document may still say \"sksl\"; carried so the renderer can report it.\n language: prop.language ?? 'wgsl',\n ...withContract(prop),\n // Carried, never read: see `ShaderFillProp.shaderId`. Omitted when absent\n // so `equals` compares like with like for a fill that never had one.\n ...(prop.shaderId !== undefined ? { shaderId: prop.shaderId } : {}),\n // Normalised (and key-sorted) here rather than at paint time so `equals`\n // and any structural diff see the same canonical record the renderer\n // binds, whichever authoring shape it came in as.\n uniforms: normalizeUniforms(prop.uniforms),\n textures: resolveTextures(prop.textures),\n opacity: prop.opacity,\n blend: prop.blend,\n }),\n\n // `source` and `textures` snap; only the uniform values and `opacity`\n // interpolate. The source is the compile-cache key, so there is nothing\n // halfway between two programs to cross to — the same reason an image\n // fill's `src` and a 3D fill's scene snap.\n //\n // Deliberately returns neither `type` nor `blend`: `FillResult` omits both and\n // `lerpFill` reassembles via `{ ...a, ...lerp(...) }`, which is also what makes\n // the ragged-array self-pair (a fill fading against a copy of itself, when two\n // fill arrays differ in length) work.\n lerp: (a, b, t) => ({\n source: t < 0.5 ? a.source : b.source,\n language: t < 0.5 ? a.language : b.language,\n ...withContract(t < 0.5 ? a : b),\n uniforms: lerpUniformRecord(a.uniforms, b.uniforms, t),\n textures: t < 0.5 ? a.textures : b.textures,\n opacity: (a.opacity ?? 1) + ((b.opacity ?? 1) - (a.opacity ?? 1)) * t,\n }),\n\n equals: (a, b) =>\n a.source === b.source &&\n a.contract === b.contract &&\n uniformRecordsEqual(a.uniforms, b.uniforms) &&\n texturesEqual(a.textures, b.textures),\n\n // Runs off the same descriptors the renderer binds, so what gets loaded can't\n // drift from what gets sampled.\n declare: (fill, assets) => {\n for (const texture of fill.textures ?? []) assets.image(texture.src);\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/implementations/stripe.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGrE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAsB1C,MAAM,CAAC,MAAM,UAAU,GAAiC;IACpD,OAAO,EAAE,CAAC,IAAoB,EAAE,EAAE,CAAC,CAAC;QAChC,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI;YACrB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,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AC,CAAC,KAAK,CAAC;QACxB,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC;KACzD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACb,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG;QACf,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW;QAC/B,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;QACnB,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC9D,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;CACrE,CAAC","sourcesContent":["import { Color, NormalizedColor, parseColor } from '../color/parser';\
|
|
1
|
+
{"version":3,"file":"stripe.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/implementations/stripe.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGrE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAsB1C,MAAM,CAAC,MAAM,UAAU,GAAiC;IACpD,OAAO,EAAE,CAAC,IAAoB,EAAE,EAAE,CAAC,CAAC;QAChC,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,KAAK,EAAE,IAAI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AAC,CAAC,EAAE,CAAC,CAAC;SACxC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC;QACxB,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC;KACzD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACb,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG;QACf,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW;QAC/B,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;QACnB,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC9D,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;CACrE,CAAC","sourcesContent":["import { Color, NormalizedColor, parseColor } from '../color/parser';\nimport type { BlendMode } from '../blend';\nimport type { FillData } from '../registry';\nimport { lerpNumber } from '@/tween/lerp';\n\nexport interface StripeFillProp {\n type: 'stripe';\n gap?: number;\n strokeWidth?: number;\n angle?: number;\n color?: Color;\n opacity?: number;\n blend?: BlendMode;\n}\n\nexport interface StripeFillResolved {\n type: 'stripe';\n gap?: number;\n strokeWidth?: number;\n angle?: number;\n color?: NormalizedColor;\n opacity?: number;\n blend?: BlendMode;\n}\n\nexport const stripeFill: FillData<StripeFillResolved> = {\n resolve: (prop: StripeFillProp) => ({\n type: 'stripe',\n gap: prop.gap,\n strokeWidth: prop.strokeWidth,\n angle: prop.angle,\n color: prop.color != null\n ? Array.isArray(prop.color)\n ? (prop.color as NormalizedColor)\n : parseColor(prop.color as string)\n : undefined,\n opacity: prop.opacity,\n blend: prop.blend,\n }),\n lerp: (a, b, t) => ({\n gap: lerpNumber(a.gap ?? 8, b.gap ?? 8, t),\n strokeWidth: lerpNumber(a.strokeWidth ?? 1, b.strokeWidth ?? 1, t),\n angle: lerpNumber(a.angle ?? -45, b.angle ?? -45, t),\n color: a.color && b.color ? [\n lerpNumber(a.color[0], b.color[0], t),\n lerpNumber(a.color[1], b.color[1], t),\n lerpNumber(a.color[2], b.color[2], t),\n lerpNumber(a.color[3], b.color[3], t),\n ] : (a.color ?? b.color),\n opacity: lerpNumber(a.opacity ?? 1, b.opacity ?? 1, t),\n }),\n equals: (a, b) =>\n a.gap === b.gap &&\n a.strokeWidth === b.strokeWidth &&\n a.angle === b.angle &&\n a.color?.[0] === b.color?.[0] && a.color?.[1] === b.color?.[1] &&\n a.color?.[2] === b.color?.[2] && a.color?.[3] === b.color?.[3],\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/implementations/video.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAIpE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EACH,kBAAkB,EAClB,eAAe,EACf,kBAAkB,GAGrB,MAAM,iBAAiB,CAAC;AA+EzB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,qBAAqB,CACjC,IAAuB,EACvB,OAAe,EACf,cAAuB;IAEvB,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,IAAI,CAAC,CAAC;IAClC,OAAO,kBAAkB,CAAC,IAAI,EAAE,KAAK,EAAE,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,cAA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AAM,CAAC,CAAC;IAC5C,CAAC;CACJ,CAAC","sourcesContent":["import type { BlendMode } from '../blend';\r\nimport type { MediaAdjustment, VideoOnlyAdjustment } from '../../filters/union';\r\nimport type { PosterizeTimeFilter } from '../../filters/implementations/posterize-time';\r\nimport type { FillData } from '../registry';\r\nimport type { ImageCrop, ImageFit, ImageMatrix } from './image';\r\nimport { lerpImagePlacement, resolveImagePlacement } from './image';\r\nimport type { Alignment } from '@/attributes/layout/alignment';\r\nimport type { InsetsResolved } from '@/attributes/layout/insets';\r\nimport type { Vector2 } from '@/attributes/layout/vector2';\r\nimport { lerpNumber } from '@/tween/lerp';\r\nimport type { VideoAdjustment } from '../../filters/chain';\r\nimport {\r\n declareMediaPreset,\r\n lerpMediaPreset,\r\n resolveMediaPreset,\r\n type MediaPresetResolved,\r\n type VideoPresetProp,\r\n} from '../media-preset';\r\n\r\n/** Adjustments a video fill carries — the pixel ones plus the video-only ones. */\r\ntype VideoFillFilter = MediaAdjustment | VideoOnlyAdjustment;\r\n\r\nexport interface VideoFillProp {\r\n type: 'video';\r\n src: string;\r\n /** How the (cropped) frame is scaled into the node's bounds. Defaults to `'fill'`. */\r\n fit?: ImageFit;\r\n /** Window onto the source frame, applied before `fit`. See {@link ImageCrop}. */\r\n crop?: ImageCrop;\r\n /** Magnification on top of the fitted scale. See {@link ImageFillProp.zoom}. */\r\n zoom?: number;\r\n /** The point held fixed as `zoom` scales. See {@link ImageFillProp.anchor}. */\r\n anchor?: Alignment;\r\n /** Raw frame→shape matrix; wins over everything above. See {@link ImageFillProp.matrix}. */\r\n matrix?: ImageMatrix;\r\n /**\r\n * Source time to paint, in seconds — an **explicit override**. Omit it (the\r\n * default) and the timestamp is derived at draw time from how long the node\r\n * painting the fill has existed, so a video fill plays on its own wherever\r\n * it is used (fill, overlay, stroke, shadow, a raw `Graphics2D` in a custom\r\n * node) with nothing to wire up. Set it to drive the playhead yourself —\r\n * e.g. tween it to scrub the clip.\r\n *\r\n * Pass `null` to hand the playhead back to the clock: `Node2D.set` skips\r\n * `undefined` values (it merges a partial), so `null` is what un-does an\r\n * override that is already live.\r\n */\r\n timestamp?: number | null;\r\n /** Whether the derived timestamp advances with the node's clock. Default `true`. */\r\n playing?: boolean;\r\n trimStart?: number;\r\n trimEnd?: number;\r\n /**\r\n * Seconds after the painting node appears before playback begins (default\r\n * `0`). Use it when the fill joins a node that already existed — a video\r\n * cross-faded in at 4s into a node's life would otherwise open 4s into the\r\n * clip. Negative values start the clip already in progress.\r\n */\r\n playStart?: number;\r\n speed?: number;\r\n /** The grade laid over this footage — see {@link VideoPresetProp}. */\r\n preset?: VideoPresetProp;\r\n /**\r\n * @deprecated Moved to `preset.adjustments`. Still read and folded into the\r\n * preset on resolve. Removed in the next major.\r\n */\r\n filters?: VideoAdjustment;\r\n loop?: 'forward' | 'reverse' | 'none';\r\n duration?: number;\r\n opacity?: number;\r\n blend?: BlendMode;\r\n}\r\n\r\nexport interface VideoFillResolved {\r\n type: 'video';\r\n src: string;\r\n fit?: ImageFit;\r\n crop?: InsetsResolved;\r\n zoom?: number;\r\n anchor?: Vector2;\r\n matrix?: ImageMatrix;\r\n /** Explicit source time, or `undefined`/`null` to derive it — see {@link VideoFillProp.timestamp}. */\r\n timestamp?: number | null;\r\n playing: boolean;\r\n trimStart?: number;\r\n trimEnd?: number;\r\n playStart?: number;\r\n speed?: number;\r\n /** Absent when the fill is ungraded — see {@link resolveMediaPreset}. */\r\n preset?: MediaPresetResolved<VideoFillFilter>;\r\n loop?: 'forward' | 'reverse' | 'none';\r\n duration?: number;\r\n opacity?: number;\r\n blend?: BlendMode;\r\n}\r\n\r\n/**\r\n * The source time a video fill paints at, given `elapsed` — how long the node\r\n * painting it has existed (`NodeRenderState.elapsed`).\r\n *\r\n * A pure function of the fill and the clock, called by the backend as it paints,\r\n * the same way a motion blur is resolved against the node's sampled velocity.\r\n * Deriving it at draw time (rather than advancing a stored timestamp each tick)\r\n * is what lets a video fill play anywhere paint is accepted — stroke, shadow,\r\n * a text run, a component's raw `Graphics2D` — instead of only on the two\r\n * nodes that remembered to update it. It also makes frame *N* identical however\r\n * the playhead reached it, so scrubbing and export agree with playback.\r\n *\r\n * `sourceDuration` is the clip's real length in seconds, used to resolve the\r\n * `trimEnd` default and the loop cycle. Pass `undefined` (or a non-positive\r\n * value) when it isn't known yet — playback then runs linearly and unlooped,\r\n * which is what a decoder that hasn't opened the container can honour anyway.\r\n */\r\nexport function resolveVideoTimestamp(\r\n fill: VideoFillResolved,\r\n elapsed: number,\r\n sourceDuration?: number,\r\n): number {\r\n const start = fill.trimStart ?? 0;\r\n return posterizeTimestamp(fill, start, rawTimestamp(fill, elapsed, sourceDuration, start));\r\n}\r\n\r\n/** {@link resolveVideoTimestamp} before the posterize-time quantization. */\r\nfunction rawTimestamp(\r\n fill: VideoFillResolved,\r\n elapsed: number,\r\n sourceDuration: number | undefined,\r\n start: number,\r\n): number {\r\n // An authored timestamp wins outright: the author is driving the playhead.\r\n if (fill.timestamp != null) return fill.timestamp;\r\n // Paused with no authored time: hold the clip's first frame.\r\n if (!fill.playing) return start;\r\n\r\n const played = Math.max(0, elapsed - (fill.playStart ?? 0)) * (fill.speed ?? 1);\r\n return sourceTimeFor(played, start, trimEndFor(fill, sourceDuration), fill.loop, fill.duration);\r\n}\r\n\r\n/**\r\n * The clip's out point: what the fill states, or the source's own length once\r\n * the container has been opened, or unbounded while it has not.\r\n *\r\n * `Infinity` is the unbounded sentinel here, as it is throughout the audio side\r\n * (`Sound.trimEnd`, `AudioRequest.endAt`) — a decoder that has not read the\r\n * container cannot answer \"how long\", and running linearly and unlooped is what\r\n * it can honour in the meantime.\r\n */\r\nexport function trimEndFor(\r\n fill: Pick<VideoFillResolved, 'trimEnd'>,\r\n sourceDuration: number | undefined,\r\n): number {\r\n const hasDuration = sourceDuration !== undefined && Number.isFinite(sourceDuration) && sourceDuration > 0;\r\n return fill.trimEnd ?? (hasDuration ? sourceDuration : Infinity);\r\n}\r\n\r\n/**\r\n * Where `played` seconds of *consumed source* land inside the trimmed window,\r\n * once looping and clamping are applied.\r\n *\r\n * Split out of {@link rawTimestamp} because two callers now need it and only one\r\n * of them derives `played` the same way. The fill computes it linearly from the\r\n * clock; a {@link Video} node driven by a `segments` schedule computes it by\r\n * walking that schedule, since a paused stretch consumes no source at all. What\r\n * \"and then it wraps\" or \"and then it stops\" means is the same for both, and\r\n * this is the one place that says so.\r\n */\r\nexport function sourceTimeFor(\r\n /** Seconds of source consumed so far — already scaled by playback rate. */\r\n played: number,\r\n /** The trim-in point, which every result is measured from. */\r\n start: number,\r\n /** The trim-out point, or `Infinity` while the source's length is unknown. */\r\n end: number,\r\n loop: 'forward' | 'reverse' | 'none' | undefined,\r\n /** An explicit loop-cycle length; defaults to the trimmed clip's own. */\r\n cycleLength?: number,\r\n): number {\r\n const rawLoopDuration = cycleLength ?? (end !== Infinity ? end - start : undefined);\r\n const loopDuration = rawLoopDuration !== undefined && rawLoopDuration > 0 ? rawLoopDuration : undefined;\r\n if ((loop ?? 'none') !== 'none' && loopDuration !== undefined) {\r\n const cycle = played % loopDuration;\r\n if (loop === 'reverse') {\r\n const ping = Math.floor(played / loopDuration) % 2 === 0;\r\n return start + (ping ? cycle : loopDuration - cycle);\r\n }\r\n return start + cycle;\r\n }\r\n const linear = start + played;\r\n return end !== Infinity ? Math.min(linear, end) : linear;\r\n}\r\n\r\n/**\r\n * Posterize Time: snap the resolved source timestamp to a coarser grid so each\r\n * frame is held for a full 1/fps interval (the stop-motion look). Done after\r\n * trim/speed/loop so the quantization lives in source-time space and lines up\r\n * with the adapter's decoded-frame grid. `floor` (not round) holds a frame for\r\n * its whole interval, matching After Effects.\r\n */\r\nfunction posterizeTimestamp(fill: VideoFillResolved, start: number, timestamp: number): number {\r\n const posterize = fill.preset?.adjustments.find(\r\n (f): f is PosterizeTimeFilter => f.type === 'posterizeTime',\r\n );\r\n if (!posterize || posterize.fps <= 0) return timestamp;\r\n const grid = 1 / posterize.fps;\r\n return start + Math.floor((timestamp - start) / grid) * grid;\r\n}\r\n\r\nexport const videoFill: FillData<VideoFillResolved> = {\r\n // See `imageFill.resolve` for why `crop`/`anchor` are destructured out.\r\n resolve: ({ crop, anchor, preset, filters, ...prop }: VideoFillProp): VideoFillResolved => ({\r\n ...prop,\r\n ...resolveImagePlacement({ crop, anchor }),\r\n preset: resolveMediaPreset(preset, filters) as\r\n | MediaPresetResolved<VideoFillFilter>\r\n | undefined,\r\n playing: prop.playing ?? true,\r\n }),\r\n lerp: (a, b, t) => ({\r\n src: t < 0.5 ? a.src : b.src,\r\n fit: t < 0.5 ? a.fit : b.fit,\r\n ...lerpImagePlacement(a, b, t),\r\n loop: t < 0.5 ? a.loop : b.loop,\r\n duration: t < 0.5 ? a.duration : b.duration,\r\n trimStart: t < 0.5 ? a.trimStart : b.trimStart,\r\n trimEnd: t < 0.5 ? a.trimEnd : b.trimEnd,\r\n playStart: t < 0.5 ? a.playStart : b.playStart,\r\n playing: t < 0.5 ? a.playing : b.playing,\r\n opacity: (a.opacity ?? 1) + ((b.opacity ?? 1) - (a.opacity ?? 1)) * t,\r\n // Both derived (the common case) stays derived — lerping `?? 0` here\r\n // would pin the tween's result to an explicit timestamp and freeze the\r\n // clip for as long as the tween's output is live.\r\n timestamp: a.timestamp == null && b.timestamp == null\r\n ? undefined\r\n : lerpNumber(a.timestamp ?? 0, b.timestamp ?? 0, t),\r\n speed: lerpNumber(a.speed ?? 1, b.speed ?? 1, t),\r\n // See the note on `imageFill.lerp` — without this the *from* fill's\r\n // grade rides the whole tween and snaps at the end.\r\n preset: lerpMediaPreset(a.preset, b.preset, t),\r\n }),\r\n equals: (a, b) => a.src === b.src,\r\n declare: (fill, assets) => {\r\n assets.video(fill.src, { start: fill.trimStart ?? 0, end: fill.trimEnd });\r\n declareMediaPreset(fill.preset, assets);\r\n },\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"video.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/fill/implementations/video.ts"],"names":[],"mappings":"AAKA,OA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C,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;KACjD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG;IACjC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;QACtB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAC1E,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;CACJ,CAAC","sourcesContent":["import type { BlendMode } from '../blend';\nimport type { MediaAdjustment, VideoOnlyAdjustment } from '../../filters/union';\nimport type { PosterizeTimeFilter } from '../../filters/implementations/posterize-time';\nimport type { FillData } from '../registry';\nimport type { ImageCrop, ImageFit, ImageMatrix } from './image';\nimport { lerpImagePlacement, resolveImagePlacement } from './image';\nimport type { Alignment } from '@/attributes/layout/alignment';\nimport type { InsetsResolved } from '@/attributes/layout/insets';\nimport type { Vector2 } from '@/attributes/layout/vector2';\nimport { lerpNumber } from '@/tween/lerp';\nimport type { VideoAdjustment } from '../../filters/chain';\nimport {\n declareMediaPreset,\n lerpMediaPreset,\n resolveMediaPreset,\n type MediaPresetResolved,\n type VideoPresetProp,\n} from '../media-preset';\n\n/** Adjustments a video fill carries — the pixel ones plus the video-only ones. */\ntype VideoFillFilter = MediaAdjustment | VideoOnlyAdjustment;\n\nexport interface VideoFillProp {\n type: 'video';\n src: string;\n /** How the (cropped) frame is scaled into the node's bounds. Defaults to `'fill'`. */\n fit?: ImageFit;\n /** Window onto the source frame, applied before `fit`. See {@link ImageCrop}. */\n crop?: ImageCrop;\n /** Magnification on top of the fitted scale. See {@link ImageFillProp.zoom}. */\n zoom?: number;\n /** The point held fixed as `zoom` scales. See {@link ImageFillProp.anchor}. */\n anchor?: Alignment;\n /** Raw frame→shape matrix; wins over everything above. See {@link ImageFillProp.matrix}. */\n matrix?: ImageMatrix;\n /**\n * Source time to paint, in seconds — an **explicit override**. Omit it (the\n * default) and the timestamp is derived at draw time from how long the node\n * painting the fill has existed, so a video fill plays on its own wherever\n * it is used (fill, overlay, stroke, shadow, a raw `Graphics2D` in a custom\n * node) with nothing to wire up. Set it to drive the playhead yourself —\n * e.g. tween it to scrub the clip.\n *\n * Pass `null` to hand the playhead back to the clock: `Node2D.set` skips\n * `undefined` values (it merges a partial), so `null` is what un-does an\n * override that is already live.\n */\n timestamp?: number | null;\n /** Whether the derived timestamp advances with the node's clock. Default `true`. */\n playing?: boolean;\n trimStart?: number;\n trimEnd?: number;\n /**\n * Seconds after the painting node appears before playback begins (default\n * `0`). Use it when the fill joins a node that already existed — a video\n * cross-faded in at 4s into a node's life would otherwise open 4s into the\n * clip. Negative values start the clip already in progress.\n */\n playStart?: number;\n speed?: number;\n /** The grade laid over this footage — see {@link VideoPresetProp}. */\n preset?: VideoPresetProp;\n /**\n * @deprecated Moved to `preset.adjustments`. Still read and folded into the\n * preset on resolve. Removed in the next major.\n */\n filters?: VideoAdjustment;\n loop?: 'forward' | 'reverse' | 'none';\n duration?: number;\n opacity?: number;\n blend?: BlendMode;\n}\n\nexport interface VideoFillResolved {\n type: 'video';\n src: string;\n fit?: ImageFit;\n crop?: InsetsResolved;\n zoom?: number;\n anchor?: Vector2;\n matrix?: ImageMatrix;\n /** Explicit source time, or `undefined`/`null` to derive it — see {@link VideoFillProp.timestamp}. */\n timestamp?: number | null;\n playing: boolean;\n trimStart?: number;\n trimEnd?: number;\n playStart?: number;\n speed?: number;\n /** Absent when the fill is ungraded — see {@link resolveMediaPreset}. */\n preset?: MediaPresetResolved<VideoFillFilter>;\n loop?: 'forward' | 'reverse' | 'none';\n duration?: number;\n opacity?: number;\n blend?: BlendMode;\n}\n\n/**\n * The source time a video fill paints at, given `elapsed` — how long the node\n * painting it has existed (`NodeRenderState.elapsed`).\n *\n * A pure function of the fill and the clock, called by the backend as it paints,\n * the same way a motion blur is resolved against the node's sampled velocity.\n * Deriving it at draw time (rather than advancing a stored timestamp each tick)\n * is what lets a video fill play anywhere paint is accepted — stroke, shadow,\n * a text run, a component's raw `Graphics2D` — instead of only on the two\n * nodes that remembered to update it. It also makes frame *N* identical however\n * the playhead reached it, so scrubbing and export agree with playback.\n *\n * `sourceDuration` is the clip's real length in seconds, used to resolve the\n * `trimEnd` default and the loop cycle. Pass `undefined` (or a non-positive\n * value) when it isn't known yet — playback then runs linearly and unlooped,\n * which is what a decoder that hasn't opened the container can honour anyway.\n */\nexport function resolveVideoTimestamp(\n fill: VideoFillResolved,\n elapsed: number,\n sourceDuration?: number,\n): number {\n const start = fill.trimStart ?? 0;\n return posterizeTimestamp(fill, start, rawTimestamp(fill, elapsed, sourceDuration, start));\n}\n\n/** {@link resolveVideoTimestamp} before the posterize-time quantization. */\nfunction rawTimestamp(\n fill: VideoFillResolved,\n elapsed: number,\n sourceDuration: number | undefined,\n start: number,\n): number {\n // An authored timestamp wins outright: the author is driving the playhead.\n if (fill.timestamp != null) return fill.timestamp;\n // Paused with no authored time: hold the clip's first frame.\n if (!fill.playing) return start;\n\n const played = Math.max(0, elapsed - (fill.playStart ?? 0)) * (fill.speed ?? 1);\n return sourceTimeFor(played, start, trimEndFor(fill, sourceDuration), fill.loop, fill.duration);\n}\n\n/**\n * The clip's out point: what the fill states, or the source's own length once\n * the container has been opened, or unbounded while it has not.\n *\n * `Infinity` is the unbounded sentinel here, as it is throughout the audio side\n * (`Sound.trimEnd`, `AudioRequest.endAt`) — a decoder that has not read the\n * container cannot answer \"how long\", and running linearly and unlooped is what\n * it can honour in the meantime.\n */\nexport function trimEndFor(\n fill: Pick<VideoFillResolved, 'trimEnd'>,\n sourceDuration: number | undefined,\n): number {\n const hasDuration = sourceDuration !== undefined && Number.isFinite(sourceDuration) && sourceDuration > 0;\n return fill.trimEnd ?? (hasDuration ? sourceDuration : Infinity);\n}\n\n/**\n * Where `played` seconds of *consumed source* land inside the trimmed window,\n * once looping and clamping are applied.\n *\n * Split out of {@link rawTimestamp} because two callers now need it and only one\n * of them derives `played` the same way. The fill computes it linearly from the\n * clock; a {@link Video} node driven by a `segments` schedule computes it by\n * walking that schedule, since a paused stretch consumes no source at all. What\n * \"and then it wraps\" or \"and then it stops\" means is the same for both, and\n * this is the one place that says so.\n */\nexport function sourceTimeFor(\n /** Seconds of source consumed so far — already scaled by playback rate. */\n played: number,\n /** The trim-in point, which every result is measured from. */\n start: number,\n /** The trim-out point, or `Infinity` while the source's length is unknown. */\n end: number,\n loop: 'forward' | 'reverse' | 'none' | undefined,\n /** An explicit loop-cycle length; defaults to the trimmed clip's own. */\n cycleLength?: number,\n): number {\n const rawLoopDuration = cycleLength ?? (end !== Infinity ? end - start : undefined);\n const loopDuration = rawLoopDuration !== undefined && rawLoopDuration > 0 ? rawLoopDuration : undefined;\n if ((loop ?? 'none') !== 'none' && loopDuration !== undefined) {\n const cycle = played % loopDuration;\n if (loop === 'reverse') {\n const ping = Math.floor(played / loopDuration) % 2 === 0;\n return start + (ping ? cycle : loopDuration - cycle);\n }\n return start + cycle;\n }\n const linear = start + played;\n return end !== Infinity ? Math.min(linear, end) : linear;\n}\n\n/**\n * Posterize Time: snap the resolved source timestamp to a coarser grid so each\n * frame is held for a full 1/fps interval (the stop-motion look). Done after\n * trim/speed/loop so the quantization lives in source-time space and lines up\n * with the adapter's decoded-frame grid. `floor` (not round) holds a frame for\n * its whole interval, matching After Effects.\n */\nfunction posterizeTimestamp(fill: VideoFillResolved, start: number, timestamp: number): number {\n const posterize = fill.preset?.adjustments.find(\n (f): f is PosterizeTimeFilter => f.type === 'posterizeTime',\n );\n if (!posterize || posterize.fps <= 0) return timestamp;\n const grid = 1 / posterize.fps;\n return start + Math.floor((timestamp - start) / grid) * grid;\n}\n\nexport const videoFill: FillData<VideoFillResolved> = {\n // See `imageFill.resolve` for why `crop`/`anchor` are destructured out.\n resolve: ({ crop, anchor, preset, filters, ...prop }: VideoFillProp): VideoFillResolved => ({\n ...prop,\n ...resolveImagePlacement({ crop, anchor }),\n preset: resolveMediaPreset(preset, filters) as\n | MediaPresetResolved<VideoFillFilter>\n | undefined,\n playing: prop.playing ?? true,\n }),\n lerp: (a, b, t) => ({\n src: t < 0.5 ? a.src : b.src,\n fit: t < 0.5 ? a.fit : b.fit,\n ...lerpImagePlacement(a, b, t),\n loop: t < 0.5 ? a.loop : b.loop,\n duration: t < 0.5 ? a.duration : b.duration,\n trimStart: t < 0.5 ? a.trimStart : b.trimStart,\n trimEnd: t < 0.5 ? a.trimEnd : b.trimEnd,\n playStart: t < 0.5 ? a.playStart : b.playStart,\n playing: t < 0.5 ? a.playing : b.playing,\n opacity: (a.opacity ?? 1) + ((b.opacity ?? 1) - (a.opacity ?? 1)) * t,\n // Both derived (the common case) stays derived — lerping `?? 0` here\n // would pin the tween's result to an explicit timestamp and freeze the\n // clip for as long as the tween's output is live.\n timestamp: a.timestamp == null && b.timestamp == null\n ? undefined\n : lerpNumber(a.timestamp ?? 0, b.timestamp ?? 0, t),\n speed: lerpNumber(a.speed ?? 1, b.speed ?? 1, t),\n // See the note on `imageFill.lerp` — without this the *from* fill's\n // grade rides the whole tween and snaps at the end.\n preset: lerpMediaPreset(a.preset, b.preset, t),\n }),\n equals: (a, b) => a.src === b.src,\n declare: (fill, assets) => {\n assets.video(fill.src, { start: fill.trimStart ?? 0, end: fill.trimEnd });\n declareMediaPreset(fill.preset, assets);\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/attributes/shape/fill/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG3F,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE3E,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAI7C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAI7D,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAazE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC","sourcesContent":["export { BlendModes as BLEND_MODES_LIST, NodeBlendModes, getBlendModeHash } from './blend';\
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/attributes/shape/fill/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG3F,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE3E,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAI7C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAI7D,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAazE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC","sourcesContent":["export { BlendModes as BLEND_MODES_LIST, NodeBlendModes, getBlendModeHash } from './blend';\nexport type { BlendMode, NodeBlendMode } from './blend';\n\nexport { setTheme, parseColor, getTypographyPreset } from './color/parser';\nexport type { NormalizedColor, Color } from './color/parser';\nexport { lerpColor, colorOps } from './lerp';\n\nexport type { FillProp, FillResolved, FillSpace, FillCommon } from './union';\n\nexport { Fills, FillChain, resolveChainFill } from './chain';\nexport type { Fill, FillOptions, VideoFillOptions, MediaPlacementOptions } from './chain';\n\nexport type { FillData } from './registry';\nexport { resolveFill, lerpFill, canLerpFill, fillOps } from './registry';\n\nexport type { SolidFillProp, SolidFillResolved } from './implementations/color';\nexport type { ConicGradientFillProp, ConicGradientFillResolved } from './implementations/conic-gradient';\nexport type { ImageFit, ImageCrop, ImageMatrix, ImageFillProp, ImageFillResolved } from './implementations/image';\nexport type { LinearGradientFillProp, LinearGradientFillResolved } from './implementations/linear-gradient';\nexport type { NoiseFillProp, NoiseFillResolved } from './implementations/noise';\nexport type { FractalNoiseFillProp, FractalNoiseFillResolved, FractalNoiseBasis } from './implementations/fractal-noise';\nexport type { RadialGradientFillProp, RadialGradientFillResolved } from './implementations/radial-gradient';\nexport type { ShaderFillProp, ShaderFillResolved, ShaderTexture } from './implementations/shader';\nexport type { StripeFillProp, StripeFillResolved } from './implementations/stripe';\nexport type { DotGridFillProp, DotGridFillResolved } from './implementations/dot-grid';\nexport type { GridFillProp, GridFillResolved } from './implementations/grid';\nexport { MINOR_WIDTH_RATIO } from './implementations/grid';\nexport type { VideoFillProp, VideoFillResolved } from './implementations/video';\nexport { resolveVideoTimestamp } from './implementations/video';\nexport type { Canvas3DFillProp, Canvas3DFillResolved } from './implementations/canvas3d';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lerp.js","sourceRoot":"","sources":["../../../../src/attributes/shape/fill/lerp.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAA0B,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGpE,2EAA2E;AAC3E,MAAM,UAAU,SAAS,CAAC,IAAqB,EAAE,EAAmB,EAAE,CAAS;IAC3E,OAAO;QACH,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;QAC/B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AAE,CAAC;IAC3E,CAAC;CACJ,CAAC;AAEF,SAAS,OAAO,CAAC,KAAY;IACzB,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC;AAED,SAAS,IAAI,CAAC,OAAe;IACzB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC7F,CAAC","sourcesContent":["/**\n * Low-level color interpolation utilities.\n *\n * These helpers operate on {@link NormalizedColor} tuples (linear [R, G, B, A]\n * in the 0–1 range) and are used by fill implementations that need per-channel\n * lerp without pulling in the full fill-registry machinery.\n */\n\nimport { Color, NormalizedColor, parseColor } from \"./color/parser\";\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\n\n/** Linearly interpolates two normalized RGBA colors channel-by-channel. */\nexport function lerpColor(from: NormalizedColor, to: NormalizedColor, t: number): NormalizedColor {\n return [\n from[0] + (to[0] - from[0]) * t,\n from[1] + (to[1] - from[1]) * t,\n from[2] + (to[2] - from[2]) * t,\n from[3] + (to[3] - from[3]) * t,\n ];\n}\n\n/** Helpers the colour attribute carries beyond its mapper and lerp. */\nexport interface ColorOps {\n /**\n * `#rrggbb`, or `#rrggbbaa` when not opaque — for a consumer that takes a\n * colour as a string, such as a resolved `Types.color` entry read back.\n */\n hex(value: Color): string;\n}\n\n/** The colour attribute's op set: parses a CSS string (or passes an already-normalized\n * tuple through) and interpolates in normalized space. */\nexport const colorOps: AttributeOps<Color, NormalizedColor> & ColorOps = {\n resolve,\n lerp: lerpColor,\n hex(value) {\n const [r, g, b, a] = resolve(value);\n const alpha = byte(a);\n return `#${byte(r)}${byte(g)}${byte(b)}${alpha === \"ff\" ? \"\" : alpha}`;\n },\n};\n\nfunction resolve(value: Color): NormalizedColor {\n return Array.isArray(value) ? value : parseColor(value);\n}\n\nfunction byte(channel: number): string {\n return Math.round(Math.min(1, Math.max(0, channel)) * 255).toString(16).padStart(2, \"0\");\n}\n\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-preset.js","sourceRoot":"","sources":["../../../../src/attributes/shape/fill/media-preset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AA4C3D,wEAAwE;AACxE,MAAM,OAAO,GAA+B,EAAE,WAAW,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;AAE9E;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAC9B,MAAqD,EACrD,aAAiD;IAEjD,MAAM,KAAK,GAAG,MAAM,EAAE,WAAW,IAAI,aAAa,CAAC;IACnD,MAAM,WAAW,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAC;IACnD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC/C,OAAO;QACH,WAAW;QACX,uEAAuE;QACvE,oEAAoE;QACpE,+CAA+C;QAC/C,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,IAAI,CAAC,CAAC,CAAC;KAC9D,CAAC;AACN,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,eAAe,CAC3B,CAAqC,EACrC,CAAqC,EACrC,CAAS;IAET,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IAC/B,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,WAAW,EAAE,CAAE,CAAC,WAAW,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;IAChE,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,WAAW,EAAE,CAAE,CAAC,WAAW,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;IAC9D,OAAO;QACH,WAAW,EAAE,eAAe,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,EAAE,CAAC,CAAQ;QACxE,SAAS,EAAE,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC;KACzD,CAAC;AACN,CAAC;AAED,MAAM,UAAU,kBAAkB,CAC9B,MAA8E,EAC9E,MAAkB;IAElB,KAAK,MAAM,UAAU,IAAI,MAAM,EAAE,WAAW,IAAI,EAAE;QAAE,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AAC1F,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,aAAa;IACzB,OAAO,OAAiC,CAAC;AAC7C,CAAC","sourcesContent":["import { lerpNumber } from \"@/tween/lerp\";\
|
|
1
|
+
{"version":3,"file":"media-preset.js","sourceRoot":"","sources":["../../../../src/attributes/shape/fill/media-preset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AA4C3D,wEAAwE;AACxE,MAAM,OAAO,GAA+B,EAAE,WAAW,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;AAE9E;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAC9B,MAAqD,EACrD,aAAiD;IAEjD,MAAM,KAAK,GAAG,MAAM,EAAE,WAAW,IAAI,aAAa,CAAC;IACnD,MAAM,WAAW,GA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nimport { declareFilter, lerpFilterArray } from \"../filters/registry\";\nimport { resolveChainAdjustments } from \"../filters/chain\";\nimport type { ImageAdjustment, VideoAdjustment } from \"../filters/chain\";\nimport type { MediaAdjustment, VideoOnlyAdjustment } from \"../filters/union\";\n\n/**\n * A **preset**: the grade a media fill carries — an ordered chain of\n * adjustments plus one dry/wet mix.\n *\n * This replaces the bare `filters` array a media fill used to take, and the\n * reason it is a wrapper rather than a second sibling prop is `intensity`. A\n * grade is authored as a *look*, and the question asked of a look constantly is\n * \"the same, but less\" — which is one number about the whole chain, not a number\n * to be smeared back across every adjustment in it. Scaling each adjustment\n * toward its own neutral is the approximation you are forced into when the\n * renderer can't mix; here it can, so it does, and \"50% of this LUT\" means\n * exactly what it says.\n *\n * The old `filters` prop is still accepted and folded in — see\n * {@link resolveMediaPreset}.\n */\nexport interface MediaPresetProp {\n /** The chain: one adjustment, a plain array, or an {@link AdjustmentChain}. */\n adjustments?: ImageAdjustment;\n /**\n * How much of the grade to apply, 0–1. Defaults to 1.\n *\n * A real mix against the ungraded pixels, not a scaling of the chain's own\n * values.\n */\n intensity?: number;\n}\n\n/** {@link MediaPresetProp} for a video fill, which also admits the temporal adjustments. */\nexport interface VideoPresetProp {\n adjustments?: VideoAdjustment;\n intensity?: number;\n}\n\n/** A preset with its chain flattened and its mix defaulted. */\nexport interface MediaPresetResolved<A = MediaAdjustment> {\n adjustments: A[];\n intensity: number;\n}\n\n/** The preset a fill has when it says nothing — no chain, fully wet. */\nconst NEUTRAL: MediaPresetResolved<never> = { adjustments: [], intensity: 1 };\n\n/**\n * Normalise a fill's grade, folding in the deprecated `filters` prop.\n *\n * `undefined` — not an empty preset — when there is no grade at all, because a\n * media fill with no adjustments takes a cheaper path through the renderer and\n * an always-present key would take every ungraded image in a project off it.\n * The same rule `crop` follows one level up.\n *\n * `filters` loses to `adjustments` when a fill somehow carries both: the new\n * spelling is the one the author reached for most recently.\n */\nexport function resolveMediaPreset(\n preset: MediaPresetProp | VideoPresetProp | undefined,\n legacyFilters?: ImageAdjustment | VideoAdjustment,\n): MediaPresetResolved<MediaAdjustment | VideoOnlyAdjustment> | undefined {\n const chain = preset?.adjustments ?? legacyFilters;\n const adjustments = resolveChainAdjustments(chain);\n if (adjustments.length === 0) return undefined;\n return {\n adjustments,\n // Clamped rather than trusted: an intensity outside 0–1 would make the\n // renderer's mix extrapolate past the graded image, which is a look\n // nobody asked for and no control can produce.\n intensity: Math.min(1, Math.max(0, preset?.intensity ?? 1)),\n };\n}\n\n/**\n * Interpolate two presets.\n *\n * The chain lerps pairwise (see {@link lerpFilterArray}) and the mix lerps as a\n * number, so a grade can be animated either way — by moving the adjustments'\n * own values, or by moving `intensity`.\n *\n * **An absent preset is read as the other side's chain at `intensity: 0`**, not\n * as an empty chain. That is the whole reason the mix is worth having, and it\n * fixes something the bare `filters` array could not express: `lerpFilterArray`\n * keeps an index present on only one side *as-is*, so tweening a fill from\n * grayscaled to ungraded used to hold the grayscale at full strength for the\n * entire tween and then cut. Holding the chain and fading the mix is what\n * \"remove this grade over half a second\" has always meant.\n */\nexport function lerpMediaPreset<A extends MediaAdjustment | VideoOnlyAdjustment>(\n a: MediaPresetResolved<A> | undefined,\n b: MediaPresetResolved<A> | undefined,\n t: number,\n): MediaPresetResolved<A> | undefined {\n if (!a && !b) return undefined;\n const from = a ?? { adjustments: b!.adjustments, intensity: 0 };\n const to = b ?? { adjustments: a!.adjustments, intensity: 0 };\n return {\n adjustments: lerpFilterArray(from.adjustments, to.adjustments, t) as A[],\n intensity: lerpNumber(from.intensity, to.intensity, t),\n };\n}\n\nexport function declareMediaPreset(\n preset: MediaPresetResolved<MediaAdjustment | VideoOnlyAdjustment> | undefined,\n assets: AssetScope,\n): void {\n for (const adjustment of preset?.adjustments ?? []) declareFilter(adjustment, assets);\n}\n\n/** The neutral preset, for a reader that would rather not branch on `undefined`. */\nexport function neutralPreset<A>(): MediaPresetResolved<A> {\n return NEUTRAL as MediaPresetResolved<A>;\n}\n"]}
|
|
@@ -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,EAAE,CAAC,EAAE,EAAE,CAAC;YACjC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;YACjB,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;gBACV,kEAAkE;gBAClE,mEAAmE;gBACnE,gEAAgE;gBAChE,oEAAoE;gBACpE,qEAAqE;gBACrE,kEAAkE;gBAClE,IAAI,WAAW,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;oBACrB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;gBAC1C,CAAC;qBAAM,CAAC;oBACJ,IAAI,OAAO,GAAG,CAAC;wBAAE,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;oBAC3D,IAAI,OAAO,GAAG,CAAC;wBAAE,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;gBAC5D,CAAC;YACL,CAAC;iBAAM,IAAI,CAAC,EAAE,CAAC;gBACX,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;YAC5D,CAAC;iBAAM,IAAI,EAAE,EAAE,CAAC;gBACZ,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;YAC9D,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAC","sourcesContent":["import type { AssetScope } from \"@/assets/scope\";\r\nimport { FillProp, FillResolved, FillSpace } from \"./union\";\r\nimport { Fill, resolveChainFill } from \"./chain\";\r\nimport { canCoerce, coercePair } from \"./coerce\";\r\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\r\n\r\nimport { colorFill } from \"./implementations/color\";\r\nimport { linearGradientFill } from \"./implementations/linear-gradient\";\r\nimport { radialGradientFill } from \"./implementations/radial-gradient\";\r\nimport { conicGradientFill } from \"./implementations/conic-gradient\";\r\nimport { noiseFill } from \"./implementations/noise\";\r\nimport { fractalNoiseFill } from \"./implementations/fractal-noise\";\r\nimport { stripeFill } from \"./implementations/stripe\";\r\nimport { dotGridFill } from \"./implementations/dot-grid\";\r\nimport { gridFill } from \"./implementations/grid\";\r\nimport { shaderFill } from \"./implementations/shader\";\r\nimport { imageFill } from \"./implementations/image\";\r\nimport { videoFill } from \"./implementations/video\";\r\nimport { canvas3DFill } from \"./implementations/canvas3d\";\r\n// The one value import from `render3d` into the fill layer, for the bare-scene\r\n// coercion in `resolveFill`. Acyclic: `render3d` only imports `Color` back from\r\n// here, and does so type-only.\r\nimport { Scene3D } from \"@/render3d/scene3d\";\r\n\r\ntype FillResult<T extends FillResolved> = Omit<Omit<T, \"type\">, \"blend\">;\r\n\r\nexport interface FillData<T extends FillResolved> {\r\n resolve(prop: any): T;\r\n equals(a: T, b: T): boolean;\r\n lerp(from: FillResult<T>, to: FillResult<T>, t: number): FillResult<T>;\r\n declare?(fill: T, assets: AssetScope): void;\r\n}\r\n\r\nconst FILLS = new Map<string, FillData<FillResolved>>([\r\n [\"solid\", colorFill as FillData<FillResolved>],\r\n [\"linear-gradient\", linearGradientFill as FillData<FillResolved>],\r\n [\"radial-gradient\", radialGradientFill as FillData<FillResolved>],\r\n [\"conic-gradient\", conicGradientFill as FillData<FillResolved>],\r\n [\"noise\", noiseFill as FillData<FillResolved>],\r\n [\"fractalNoise\", fractalNoiseFill as FillData<FillResolved>],\r\n [\"stripe\", stripeFill as FillData<FillResolved>],\r\n [\"dotGrid\", dotGridFill as FillData<FillResolved>],\r\n [\"grid\", gridFill as FillData<FillResolved>],\r\n [\"shader\", shaderFill as FillData<FillResolved>],\r\n [\"image\", imageFill as FillData<FillResolved>],\r\n [\"video\", videoFill as FillData<FillResolved>],\r\n [\"canvas3D\", canvas3DFill as FillData<FillResolved>],\r\n]);\r\n\r\nfunction get(name: string): FillData<FillResolved> {\r\n const data = FILLS.get(name);\r\n if (!data) throw new Error(`Fill \"${name}\" is not registered`);\r\n return data;\r\n}\r\n\r\nexport function resolveFill(prop: FillProp): FillResolved {\r\n if (typeof prop === \"string\") return resolveFill({ type: \"solid\", color: prop });\r\n // A bare built scene is shorthand for a 3D fill, the same way a bare CSS\r\n // string is shorthand for a solid one.\r\n if (prop instanceof Scene3D) return resolveFill({ type: \"canvas3D\", scene: prop });\r\n const resolved = get(prop.type).resolve(prop);\r\n // `space` is a cross-cutting rendering directive (like `blend`); carry it\r\n // through generically so each fill `resolve()` doesn't have to know about it.\r\n const space = (prop as { space?: FillSpace }).space;\r\n return space !== undefined ? { ...resolved, space } : resolved;\r\n}\r\n\r\n/**\r\n * What an empty media slot paints: an image fill naming no source.\r\n *\r\n * The renderer turns an empty `src` into the transparency checkerboard rather\r\n * than into nothing. Both media nodes reach for this when their own source is\r\n * unset, so the two cannot end up drawing different placeholders.\r\n *\r\n * Resolved once and shared: it has no props to vary, and the two places that key\r\n * per-fill state by object identity (`paintSlot`, `preflighted`) are both scoped\r\n * to one node's single `applyFills` call, where this can appear only once.\r\n *\r\n * Declared here rather than beside the image fill's own implementation because\r\n * resolving one needs {@link resolveFill}, and that lives on this side of the\r\n * dependency — the implementations are what the registry imports, not the other\r\n * way round.\r\n */\r\nexport const UNSET_MEDIA_FILL: FillResolved = resolveFill({\r\n type: \"image\",\r\n src: \"\",\r\n} as FillProp);\r\n\r\n/**\r\n * True when `a` and `b` can be interpolated into a single fill by {@link\r\n * lerpFill} without throwing — i.e. they share a type with the same `blend`, or\r\n * they're a color/gradient pair {@link canCoerce} can promote to one type.\r\n *\r\n * Pairs that fail this (e.g. color↔image, image↔video, or same-type fills with\r\n * differing blend modes) have no meaningful single-type in-between; {@link\r\n * fillOps}'s `lerp` cross-fades them as two stacked layers instead.\r\n */\r\nexport function canLerpFill(a: FillResolved, b: FillResolved): boolean {\r\n if (a.type === b.type) return a.blend === b.blend;\r\n return canCoerce(a, b);\r\n}\r\n\r\nexport function lerpFill(a: FillResolved, b: FillResolved, t: number): FillResolved {\r\n const clamped = Math.min(1, Math.max(0, t));\r\n\r\n // Cross-type tween (color↔gradient, or gradient↔gradient of different\r\n // kinds): promote both endpoints to a common type, then lerp with that\r\n // type's lerp. blend cannot interpolate, so it snaps with the rest of the\r\n // coerced shape.\r\n if (a.type !== b.type) {\r\n if (!canCoerce(a, b)) {\r\n throw new Error(`No registered lerp for fills of type \"${a.type}\" and \"${b.type}\"`);\r\n }\r\n const [ca, cb] = coercePair(a, b);\r\n return { ...ca, ...get(ca.type).lerp(ca, cb, clamped) };\r\n }\r\n\r\n if (a.blend !== b.blend) {\r\n throw new Error(`No registered lerp for fills of type \"${a.type}\" and \"${b.type}\"`);\r\n }\r\n return { ...a, ...get(a.type).lerp(a, b, clamped) };\r\n}\r\n\r\n/** Returns `fill` with its effective opacity scaled by `factor` (clamped to ≥0). */\r\nfunction scaleOpacity(fill: FillResolved, factor: number): FillResolved {\r\n return { ...fill, opacity: (fill.opacity ?? 1) * Math.max(0, factor) };\r\n}\r\n\r\nexport function declareFill(fill: FillResolved, assets: AssetScope): void {\r\n FILLS.get(fill.type)?.declare?.(fill, assets);\r\n}\r\n\r\n/** The fill-layer attribute's op set — the `fill` prop's resolve/lerp pair. */\r\nexport const fillOps: AttributeOps<Fill, FillResolved[]> = {\r\n resolve: (prop) => resolveChainFill(prop).map(resolveFill),\r\n lerp: (from, to, t) => {\r\n if (from === to) return from;\r\n if (!from.length && !to.length) return [];\r\n const clamped = Math.min(1, Math.max(0, t));\r\n const maxLength = Math.max(from.length, to.length);\r\n const result: FillResolved[] = [];\r\n for (let i = 0; i < maxLength; i++) {\r\n const f = from[i];\r\n const tf = to[i];\r\n if (f && tf) {\r\n // Interpolate in place when the two fills share an interpolatable\r\n // shape (same type, or a coercible color/gradient pair). When they\r\n // don't (e.g. color↔image, image↔video) there is no single-type\r\n // in-between, so cross-fade instead: paint the outgoing fill fading\r\n // out beneath the incoming fill fading in. The dropped-out endpoints\r\n // are omitted so a static array of one fill stays a single layer.\r\n if (canLerpFill(f, tf)) {\r\n result.push(lerpFill(f, tf, clamped));\r\n } else {\r\n if (clamped < 1) result.push(scaleOpacity(f, 1 - clamped));\r\n if (clamped > 0) result.push(scaleOpacity(tf, clamped));\r\n }\r\n } else if (f) {\r\n result.push(lerpFill(f, { ...f, opacity: 0 }, clamped));\r\n } else if (tf) {\r\n result.push(lerpFill({ ...tf, opacity: 0 }, tf, clamped));\r\n }\r\n }\r\n return result;\r\n },\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/attributes/shape/fill/registry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGjD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OA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AAE,CAAC;gBACX,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;YAC5D,CAAC;iBAAM,IAAI,EAAE,EAAE,CAAC;gBACZ,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;YAC9D,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAC","sourcesContent":["import type { AssetScope } from \"@/assets/scope\";\nimport { FillProp, FillResolved, FillSpace } from \"./union\";\nimport { Fill, resolveChainFill } from \"./chain\";\nimport { canCoerce, coercePair } from \"./coerce\";\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\n\nimport { colorFill } from \"./implementations/color\";\nimport { linearGradientFill } from \"./implementations/linear-gradient\";\nimport { radialGradientFill } from \"./implementations/radial-gradient\";\nimport { conicGradientFill } from \"./implementations/conic-gradient\";\nimport { noiseFill } from \"./implementations/noise\";\nimport { fractalNoiseFill } from \"./implementations/fractal-noise\";\nimport { stripeFill } from \"./implementations/stripe\";\nimport { dotGridFill } from \"./implementations/dot-grid\";\nimport { gridFill } from \"./implementations/grid\";\nimport { shaderFill } from \"./implementations/shader\";\nimport { imageFill } from \"./implementations/image\";\nimport { videoFill } from \"./implementations/video\";\nimport { canvas3DFill } from \"./implementations/canvas3d\";\n// The one value import from `render3d` into the fill layer, for the bare-scene\n// coercion in `resolveFill`. Acyclic: `render3d` only imports `Color` back from\n// here, and does so type-only.\nimport { Scene3D } from \"@/render3d/scene3d\";\n\ntype FillResult<T extends FillResolved> = Omit<Omit<T, \"type\">, \"blend\">;\n\nexport interface FillData<T extends FillResolved> {\n resolve(prop: any): T;\n equals(a: T, b: T): boolean;\n lerp(from: FillResult<T>, to: FillResult<T>, t: number): FillResult<T>;\n declare?(fill: T, assets: AssetScope): void;\n}\n\nconst FILLS = new Map<string, FillData<FillResolved>>([\n [\"solid\", colorFill as FillData<FillResolved>],\n [\"linear-gradient\", linearGradientFill as FillData<FillResolved>],\n [\"radial-gradient\", radialGradientFill as FillData<FillResolved>],\n [\"conic-gradient\", conicGradientFill as FillData<FillResolved>],\n [\"noise\", noiseFill as FillData<FillResolved>],\n [\"fractalNoise\", fractalNoiseFill as FillData<FillResolved>],\n [\"stripe\", stripeFill as FillData<FillResolved>],\n [\"dotGrid\", dotGridFill as FillData<FillResolved>],\n [\"grid\", gridFill as FillData<FillResolved>],\n [\"shader\", shaderFill as FillData<FillResolved>],\n [\"image\", imageFill as FillData<FillResolved>],\n [\"video\", videoFill as FillData<FillResolved>],\n [\"canvas3D\", canvas3DFill as FillData<FillResolved>],\n]);\n\nfunction get(name: string): FillData<FillResolved> {\n const data = FILLS.get(name);\n if (!data) throw new Error(`Fill \"${name}\" is not registered`);\n return data;\n}\n\nexport function resolveFill(prop: FillProp): FillResolved {\n if (typeof prop === \"string\") return resolveFill({ type: \"solid\", color: prop });\n // A bare built scene is shorthand for a 3D fill, the same way a bare CSS\n // string is shorthand for a solid one.\n if (prop instanceof Scene3D) return resolveFill({ type: \"canvas3D\", scene: prop });\n const resolved = get(prop.type).resolve(prop);\n // `space` is a cross-cutting rendering directive (like `blend`); carry it\n // through generically so each fill `resolve()` doesn't have to know about it.\n const space = (prop as { space?: FillSpace }).space;\n return space !== undefined ? { ...resolved, space } : resolved;\n}\n\n/**\n * What an empty media slot paints: an image fill naming no source.\n *\n * The renderer turns an empty `src` into the transparency checkerboard rather\n * than into nothing. Both media nodes reach for this when their own source is\n * unset, so the two cannot end up drawing different placeholders.\n *\n * Resolved once and shared: it has no props to vary, and the two places that key\n * per-fill state by object identity (`paintSlot`, `preflighted`) are both scoped\n * to one node's single `applyFills` call, where this can appear only once.\n *\n * Declared here rather than beside the image fill's own implementation because\n * resolving one needs {@link resolveFill}, and that lives on this side of the\n * dependency — the implementations are what the registry imports, not the other\n * way round.\n */\nexport const UNSET_MEDIA_FILL: FillResolved = resolveFill({\n type: \"image\",\n src: \"\",\n} as FillProp);\n\n/**\n * True when `a` and `b` can be interpolated into a single fill by {@link\n * lerpFill} without throwing — i.e. they share a type with the same `blend`, or\n * they're a color/gradient pair {@link canCoerce} can promote to one type.\n *\n * Pairs that fail this (e.g. color↔image, image↔video, or same-type fills with\n * differing blend modes) have no meaningful single-type in-between; {@link\n * fillOps}'s `lerp` cross-fades them as two stacked layers instead.\n */\nexport function canLerpFill(a: FillResolved, b: FillResolved): boolean {\n if (a.type === b.type) return a.blend === b.blend;\n return canCoerce(a, b);\n}\n\nexport function lerpFill(a: FillResolved, b: FillResolved, t: number): FillResolved {\n const clamped = Math.min(1, Math.max(0, t));\n\n // Cross-type tween (color↔gradient, or gradient↔gradient of different\n // kinds): promote both endpoints to a common type, then lerp with that\n // type's lerp. blend cannot interpolate, so it snaps with the rest of the\n // coerced shape.\n if (a.type !== b.type) {\n if (!canCoerce(a, b)) {\n throw new Error(`No registered lerp for fills of type \"${a.type}\" and \"${b.type}\"`);\n }\n const [ca, cb] = coercePair(a, b);\n return { ...ca, ...get(ca.type).lerp(ca, cb, clamped) };\n }\n\n if (a.blend !== b.blend) {\n throw new Error(`No registered lerp for fills of type \"${a.type}\" and \"${b.type}\"`);\n }\n return { ...a, ...get(a.type).lerp(a, b, clamped) };\n}\n\n/** Returns `fill` with its effective opacity scaled by `factor` (clamped to ≥0). */\nfunction scaleOpacity(fill: FillResolved, factor: number): FillResolved {\n return { ...fill, opacity: (fill.opacity ?? 1) * Math.max(0, factor) };\n}\n\nexport function declareFill(fill: FillResolved, assets: AssetScope): void {\n FILLS.get(fill.type)?.declare?.(fill, assets);\n}\n\n/** The fill-layer attribute's op set — the `fill` prop's resolve/lerp pair. */\nexport const fillOps: AttributeOps<Fill, FillResolved[]> = {\n resolve: (prop) => resolveChainFill(prop).map(resolveFill),\n lerp: (from, to, t) => {\n if (from === to) return from;\n if (!from.length && !to.length) return [];\n const clamped = Math.min(1, Math.max(0, t));\n const maxLength = Math.max(from.length, to.length);\n const result: FillResolved[] = [];\n for (let i = 0; i < maxLength; i++) {\n const f = from[i];\n const tf = to[i];\n if (f && tf) {\n // Interpolate in place when the two fills share an interpolatable\n // shape (same type, or a coercible color/gradient pair). When they\n // don't (e.g. color↔image, image↔video) there is no single-type\n // in-between, so cross-fade instead: paint the outgoing fill fading\n // out beneath the incoming fill fading in. The dropped-out endpoints\n // are omitted so a static array of one fill stays a single layer.\n if (canLerpFill(f, tf)) {\n result.push(lerpFill(f, tf, clamped));\n } else {\n if (clamped < 1) result.push(scaleOpacity(f, 1 - clamped));\n if (clamped > 0) result.push(scaleOpacity(tf, clamped));\n }\n } else if (f) {\n result.push(lerpFill(f, { ...f, opacity: 0 }, clamped));\n } else if (tf) {\n result.push(lerpFill({ ...tf, opacity: 0 }, tf, clamped));\n }\n }\n return result;\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"union.js","sourceRoot":"","sources":["../../../../src/attributes/shape/fill/union.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG","sourcesContent":["/**\
|
|
1
|
+
{"version":3,"file":"union.js","sourceRoot":"","sources":["../../../../src/attributes/shape/fill/union.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG","sourcesContent":["/**\n * Union types that represent every supported fill variant.\n *\n * Two flavors exist for each fill:\n * - **Prop** — the loose author-facing shape accepted by node props (e.g. CSS\n * color strings, optional fields with sensible defaults).\n * - **Resolved** — the strict internal shape used by the renderer after\n * {@link FillRegistry.resolve} has normalised every field.\n */\n\n/**\n * Reference frame a fill (and the stroke/shadow that wrap one) resolves\n * against. The drawn shapes are always treated as one unit (their union); the\n * space only changes which rect the gradient/image is mapped onto:\n *\n * - `local` — the shape's own (union) bounds. The fill is pinned to the\n * figure, so moving the node around does not change its\n * appearance. This is the default.\n * - `parent` — the parent node's layout rect; moving the node *within* its\n * parent slides it across the fill, so the appearance changes.\n * - `global` — the render viewport; the fill is anchored to the frame, so\n * moving the node anywhere on screen changes which slice it shows.\n */\nexport type FillSpace = \"local\" | \"parent\" | \"global\";\n\nimport { SolidFillProp, SolidFillResolved } from \"./implementations/color\";\nimport { ConicGradientFillProp, ConicGradientFillResolved } from \"./implementations/conic-gradient\";\nimport { ImageFillProp, ImageFillResolved } from \"./implementations/image\";\nimport { LinearGradientFillProp, LinearGradientFillResolved } from \"./implementations/linear-gradient\";\nimport { NoiseFillProp, NoiseFillResolved } from \"./implementations/noise\";\nimport { FractalNoiseFillProp, FractalNoiseFillResolved } from \"./implementations/fractal-noise\";\nimport { RadialGradientFillProp, RadialGradientFillResolved } from \"./implementations/radial-gradient\";\nimport { ShaderFillProp, ShaderFillResolved } from \"./implementations/shader\";\nimport { StripeFillProp, StripeFillResolved } from \"./implementations/stripe\";\nimport { DotGridFillProp, DotGridFillResolved } from \"./implementations/dot-grid\";\nimport { GridFillProp, GridFillResolved } from \"./implementations/grid\";\nimport { VideoFillProp, VideoFillResolved } from \"./implementations/video\";\nimport { Canvas3DFillProp, Canvas3DFillResolved } from \"./implementations/canvas3d\";\nimport type { Scene3D } from \"@/render3d/scene3d\";\n\n/**\n * Loose fill value accepted by node `fill` props.\n *\n * A plain CSS color string (e.g. `\"red\"`, `\"#ff0\"`) is shorthand for a\n * {@link SolidFillProp} and is resolved automatically by the registry.\n */\n/** Fields shared by every fill variant, regardless of type. */\nexport interface FillCommon {\n /**\n * Reference frame this fill resolves against. Defaults to `local`.\n * See {@link FillSpace}.\n */\n space?: FillSpace;\n}\n\ntype WithCommon<T> = T & FillCommon;\n\nexport type FillProp =\n | string\n // A bare built scene is shorthand for a {@link Canvas3DFillProp}, the same way a\n // bare CSS string is shorthand for a solid fill. Both are coerced by the\n // registry: `fill={[\"#0b0d12\", g3]}`.\n | Scene3D\n | WithCommon<SolidFillProp>\n | WithCommon<NoiseFillProp>\n | WithCommon<FractalNoiseFillProp>\n | WithCommon<ShaderFillProp>\n | WithCommon<StripeFillProp>\n | WithCommon<DotGridFillProp>\n | WithCommon<GridFillProp>\n | WithCommon<LinearGradientFillProp>\n | WithCommon<RadialGradientFillProp>\n | WithCommon<ConicGradientFillProp>\n | WithCommon<ImageFillProp>\n | WithCommon<VideoFillProp>\n | WithCommon<Canvas3DFillProp>;\n\n/** Fully resolved fill ready for the renderer. */\nexport type FillResolved =\n | WithCommon<SolidFillResolved>\n | WithCommon<NoiseFillResolved>\n | WithCommon<FractalNoiseFillResolved>\n | WithCommon<ShaderFillResolved>\n | WithCommon<StripeFillResolved>\n | WithCommon<DotGridFillResolved>\n | WithCommon<GridFillResolved>\n | WithCommon<LinearGradientFillResolved>\n | WithCommon<RadialGradientFillResolved>\n | WithCommon<ConicGradientFillResolved>\n | WithCommon<ImageFillResolved>\n | WithCommon<VideoFillResolved>\n | WithCommon<Canvas3DFillResolved>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../../../src/attributes/shape/filters/chain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAkJ/C,8EAA8E;AAC9E,SAAS,YAAY,CAAmB,GAAe,EAAE,GAAY;IACjE,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAE,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,EAAQ,CAAC,CAAC,CAAC,GAAG,CAAC;AACjE,CAAC;AAED;;;;;;GAMG;AACH,SAAS,UAAU,CAAC,KAAkB;IAClC,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAc,CAAC;AACtC,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,eAAe;IACL;IAAnB,YAAmB,OAAoB,EAAE;QAAtB,SAAI,GAAJ,IAAI,CAAkB;IAAI,CAAC;IAE9C;;;OAGG;IACO,MAAM,CAAC,MAAiB;QAC9B,MAAM,IAAI,G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AAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrD,CAAC;CACJ;AAkBD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC;AAEjD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAE3D;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC;AAExC;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,gBAAgB,CAAC;AAE7C;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAsD;IAC1F,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IACrC,IAAI,OAAO,YAAY,eAAe;QAAE,OAAO,OAAO,CAAC,IAAI,CAAC;IAC5D,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO,OAAO,CAAC;IAC3C,OAAO,CAAC,OAAO,CAAC,CAAC;AACrB,CAAC","sourcesContent":["import { MediaAdjustment, VideoOnlyAdjustment } from \"./union\";\r\nimport { EffectChain } from \"../effects/chain\";\r\nimport type { BlendMode } from \"../fill/blend\";\r\nimport type { ColorAdjustmentFilter } from \"./implementations/color-adjustment\";\r\nimport type { CurvesChannel } from \"./implementations/curves\";\r\nimport type { EffectOptions } from \"../effects/effect-data\";\r\nimport type {\r\n AsciiOptions,\r\n BitCrushOptions,\r\n BlockDisplaceOptions,\r\n BloomOptions,\r\n BulgeOptions,\r\n ChromaticAberrationOptions,\r\n DirectionalBlurOptions,\r\n DitherOptions,\r\n DuotoneOptions,\r\n EdgesOptions,\r\n GrainOptions,\r\n HalftoneOptions,\r\n InvertOptions,\r\n LutOptions,\r\n KaleidoscopeOptions,\r\n OilPaintOptions,\r\n PixelateOptions,\r\n PosterizeOptions,\r\n ProgressiveBlurOptions,\r\n RadialBlurOptions,\r\n RgbShiftOptions,\r\n ScanlinesOptions,\r\n ScatterOptions,\r\n SharpenOptions,\r\n ShaderEffectOptions,\r\n StreakOptions,\r\n ThresholdOptions,\r\n TwirlOptions,\r\n VignetteOptions,\r\n VintageOptions,\r\n WaveOptions,\r\n} from \"../effects/chain\";\r\n\r\n/** Any concrete filter a chain may hold — pixel or video-only. */\r\ntype AnyFilter = MediaAdjustment | VideoOnlyAdjustment;\r\n\r\n/**\r\n * ## Adjustments and filters are two layers, not two names for one thing\r\n *\r\n * An **adjustment** is the unit an author writes: `Adjustments.blur(8)`, one\r\n * entry in the ordered chain a media fill's `preset` carries. A **filter** is\r\n * the primitive the renderer realises it as — `BlurFilter`, `CurvesFilter`, and\r\n * the `FilterData` handlers in `registry.ts`.\r\n *\r\n * Most of the time the two are one-to-one, which is what makes the distinction\r\n * look like pedantry. It isn't: an editor above this layer composes adjustments\r\n * that have no primitive of their own (a lift/gamma/gain grade is three\r\n * per-channel `CurvesFilter`s), and one primitive — the LUT's texture lookup —\r\n * is reached through no chain builder at all. Naming the two layers apart is\r\n * what lets that mapping be written down instead of assumed.\r\n *\r\n * It also settles a collision with no good answer otherwise: the options for\r\n * `Adjustments.colorAdjustment(…)` are named after the primitive they omit from\r\n * (`ColorAdjustmentFilterOptions`), because `ColorAdjustmentAdjustmentOptions`\r\n * is not a name anyone should have to type.\r\n *\r\n * ## The builders\r\n *\r\n * Media adjustments follow the same one-argument rule as node effects: every\r\n * builder takes a single options object, and those with one dominant scalar\r\n * also accept that scalar directly. Field names are the shared vocabulary —\r\n * `radius` for a pixel distance, `amount` for a 0–1 intensity — so\r\n * `Adjustments.blur(8)` and `Effects.blur(8)` describe the same quantity.\r\n *\r\n * Most of the roster *is* the node-effect roster: an adjustment is an effect\r\n * applied to one fill layer's own pixels instead of to a node and everything\r\n * beneath it, so `Adjustments.oilPaint(4)` and `Effects.oilPaint(4)` are the\r\n * same implementation reached two ways. See {@link EffectAdjustment} for the\r\n * short list of effects that cannot be adjustments.\r\n */\r\n\r\n/** Gaussian blur. Scalar shorthand sets `radius`. */\r\nexport interface BlurFilterOptions {\r\n /** Blur radius in pixels. */\r\n radius: number;\r\n}\r\n\r\n/** Desaturation. Scalar shorthand sets `amount`. */\r\nexport interface GrayscaleFilterOptions {\r\n /** 0 = original, 1 = fully grayscale. */\r\n amount: number;\r\n}\r\n\r\n/** Alpha (opacity) multiply. Scalar shorthand sets `amount`. */\r\nexport interface AlphaFilterOptions {\r\n /** 0 = fully transparent, 1 = unchanged. */\r\n amount: number;\r\n}\r\n\r\n/** Luminance scale. Scalar shorthand sets `amount`. */\r\nexport interface ExposureFilterOptions {\r\n /** Exposure multiplier. 1 = unchanged, >1 brighter, <1 darker. */\r\n amount: number;\r\n}\r\n\r\n/** Raw 4×5 row-major colour matrix. Array shorthand sets `matrix`. */\r\nexport interface ColorMatrixFilterOptions {\r\n /** 4×5 row-major colour matrix: rows R, G, B, A of `[r, g, b, a, bias]`. */\r\n matrix: number[];\r\n}\r\n\r\n/** Tone curve through control points. */\r\nexport interface CurvesFilterOptions {\r\n /** Curve control points as [input, output] pairs in [0, 1]. */\r\n points: [number, number][];\r\n /** Channel(s) to apply the curve to (default `'rgb'`). */\r\n channel?: CurvesChannel;\r\n}\r\n\r\n/** Photographic tonal/colour adjustments. All fields optional. */\r\nexport type ColorAdjustmentFilterOptions = Omit<ColorAdjustmentFilter, 'type'>;\r\n\r\n/** Stop-motion frame-rate resample (video only). Scalar shorthand sets `fps`. */\r\nexport interface PosterizeTimeFilterOptions {\r\n /** Target frame rate the source playhead snaps to. */\r\n fps: number;\r\n}\r\n\r\n/** Motion-trail echo of past frames (video only). */\r\nexport interface EchoFilterOptions {\r\n /** Number of past-frame taps drawn behind the current frame. */\r\n echoes: number;\r\n /** Delay between successive taps, in source seconds. */\r\n delay: number;\r\n /** Per-tap alpha multiplier; tap `n` is drawn at `decay ** n` (default 0.5). */\r\n decay?: number;\r\n /** Blend mode used to composite the echo taps (default `'screen'`). */\r\n blend?: BlendMode;\r\n}\r\n\r\n/**\r\n * A node effect's builder options as a **filter** accepts them: the same\r\n * fields minus the cross-cutting {@link EffectOptions} (today `mode`).\r\n *\r\n * A filter is on the fill's own pixels by definition, so there is no backdrop\r\n * to point it at — dropping the knob is clearer than accepting it and silently\r\n * ignoring it. Scalar shorthands survive untouched.\r\n */\r\ntype AsFilterOptions<T> = T extends number ? number : Omit<T, keyof EffectOptions>;\r\n\r\n/** Normalise a `number | Options` filter argument onto its dominant field. */\r\nfunction scalarFilter<O extends object>(arg: number | O, key: keyof O): O {\r\n return typeof arg === \"number\" ? ({ [key]: arg } as O) : arg;\r\n}\r\n\r\n/**\r\n * The single effect a one-builder {@link EffectChain} produced.\r\n *\r\n * Every effect-backed filter routes through here rather than re-declaring the\r\n * effect literal, so defaults, scalar shorthands and field normalisation have\r\n * exactly one definition — the one scenes already use.\r\n */\r\nfunction fromEffect(chain: EffectChain): AnyFilter {\r\n return chain.list[0] as AnyFilter;\r\n}\r\n\r\n/**\r\n * Immutable, chainable list of media filters — the filters valid on an **image**\r\n * fill.\r\n *\r\n * Each builder method returns a new chain with the filter appended, so chains\r\n * are safe to share and branch. {@link VideoAdjustmentChain} extends this with the\r\n * video-only temporal filters; the split is what keeps `posterizeTime` off an\r\n * image fill, mirroring how `Fill` is structured.\r\n *\r\n * @example\r\n * const chain = Adjustments.blur(4).grayscale(0.5);\r\n * node.filters = chain; // assign directly\r\n * node.filters = [...chain, { type: 'alpha', amount: 0.5 }]; // spread into array\r\n */\r\nexport class AdjustmentChain {\r\n constructor(public list: AnyFilter[] = []) { }\r\n\r\n /**\r\n * Append `filter`, returning a chain of the same class — so the video\r\n * subclass keeps its extra builders reachable after an inherited one.\r\n */\r\n protected append(filter: AnyFilter): this {\r\n const Ctor = this.constructor as new (list: AnyFilter[]) => this;\r\n return new Ctor([...this.list, filter]);\r\n }\r\n\r\n // -- Filters with no node-effect counterpart -------------------------\r\n\r\n /** Append a Gaussian blur. */\r\n blur(options: number | BlurFilterOptions) {\r\n const { radius } = scalarFilter(options, \"radius\");\r\n return this.append({ type: 'blur', radius });\r\n }\r\n\r\n /** Append a grayscale filter. */\r\n grayscale(options: number | GrayscaleFilterOptions) {\r\n const { amount } = scalarFilter(options, \"amount\");\r\n return this.append({ type: 'grayscale', amount });\r\n }\r\n\r\n /** Append an alpha (opacity) filter. */\r\n alpha(options: number | AlphaFilterOptions) {\r\n const { amount } = scalarFilter(options, \"amount\");\r\n return this.append({ type: 'alpha', amount });\r\n }\r\n\r\n /** Append an exposure filter. */\r\n exposure(options: number | ExposureFilterOptions) {\r\n const { amount } = scalarFilter(options, \"amount\");\r\n return this.append({ type: 'exposure', amount });\r\n }\r\n\r\n /** Append a color-adjustment filter from the given partial settings. */\r\n colorAdjustment(options: ColorAdjustmentFilterOptions) {\r\n return this.append({ type: 'colorAdjustment', ...options });\r\n }\r\n\r\n /** Append a raw 4×5 row-major color matrix. */\r\n colorMatrix(options: number[] | ColorMatrixFilterOptions) {\r\n const matrix = Array.isArray(options) ? options : options.matrix;\r\n return this.append({ type: 'colorMatrix', matrix });\r\n }\r\n\r\n /** Append a curves filter from control `points` ([input, output] pairs). */\r\n curves(options: CurvesFilterOptions) {\r\n return this.append({ type: 'curves', points: options.points, channel: options.channel });\r\n }\r\n\r\n // -- Blur family ------------------------------------------------------\r\n\r\n /** Append a directional (linear) blur, smearing the fill along one axis. */\r\n directionalBlur(options: AsFilterOptions<number | DirectionalBlurOptions>) {\r\n return this.append(fromEffect(new EffectChain().directionalBlur(options)));\r\n }\r\n\r\n /** Append a radial blur — zoom or spin streaks about a centre point. */\r\n radialBlur(options?: AsFilterOptions<number | RadialBlurOptions>) {\r\n return this.append(fromEffect(new EffectChain().radialBlur(options)));\r\n }\r\n\r\n /**\r\n * Append a progressive blur — a blur that ramps across the fill, for the\r\n * frosted-toward-one-edge look.\r\n */\r\n progressiveBlur(options?: AsFilterOptions<number | ProgressiveBlurOptions>) {\r\n return this.append(fromEffect(new EffectChain().progressiveBlur(options)));\r\n }\r\n\r\n /** Append a bloom (glow): bright areas bleed soft light outward. */\r\n bloom(options?: AsFilterOptions<number | BloomOptions>) {\r\n return this.append(fromEffect(new EffectChain().bloom(options)));\r\n }\r\n\r\n /** Append anamorphic streaks off the fill's highlights. */\r\n streak(options?: AsFilterOptions<number | StreakOptions>) {\r\n return this.append(fromEffect(new EffectChain().streak(options)));\r\n }\r\n\r\n /** Append an unsharp-mask sharpen. */\r\n sharpen(options?: AsFilterOptions<number | SharpenOptions>) {\r\n return this.append(fromEffect(new EffectChain().sharpen(options)));\r\n }\r\n\r\n // -- Colour -----------------------------------------------------------\r\n\r\n /** Append a colour invert (negative). */\r\n invert(options?: AsFilterOptions<number | InvertOptions>) {\r\n return this.append(fromEffect(new EffectChain().invert(options)));\r\n }\r\n\r\n /** Append a vintage / film-look grade (sepia + desaturate + warmth). */\r\n vintage(options?: AsFilterOptions<number | VintageOptions>) {\r\n return this.append(fromEffect(new EffectChain().vintage(options)));\r\n }\r\n\r\n /** Append a duotone map — remap luminance between two colours. */\r\n duotone(options?: AsFilterOptions<number | DuotoneOptions>) {\r\n return this.append(fromEffect(new EffectChain().duotone(options)));\r\n }\r\n\r\n /** Append colour banding: quantize to `levels` tones per channel. */\r\n posterize(options?: AsFilterOptions<number | PosterizeOptions>) {\r\n return this.append(fromEffect(new EffectChain().posterize(options)));\r\n }\r\n\r\n /** Append a hard luminance threshold (1-bit black/white). */\r\n threshold(options?: AsFilterOptions<number | ThresholdOptions>) {\r\n return this.append(fromEffect(new EffectChain().threshold(options)));\r\n }\r\n\r\n /** Append a bit-depth crush, optionally snapping to a hardware palette. */\r\n bitCrush(options?: AsFilterOptions<number | BitCrushOptions>) {\r\n return this.append(fromEffect(new EffectChain().bitCrush(options)));\r\n }\r\n\r\n // -- Texture / pattern ------------------------------------------------\r\n\r\n /**\r\n * Append ordered (Bayer) dithering — quantize to `levels` tones, hiding the\r\n * banding in a repeating threshold pattern.\r\n */\r\n dither(options?: AsFilterOptions<number | DitherOptions>) {\r\n return this.append(fromEffect(new EffectChain().dither(options)));\r\n }\r\n\r\n /** Append a halftone screen — print-style dots (or lines) sized by tone. */\r\n halftone(options?: AsFilterOptions<number | HalftoneOptions>) {\r\n return this.append(fromEffect(new EffectChain().halftone(options)));\r\n }\r\n\r\n /** Append film grain. Animate it by tweening `seed`. */\r\n grain(options?: AsFilterOptions<number | GrainOptions>) {\r\n return this.append(fromEffect(new EffectChain().grain(options)));\r\n }\r\n\r\n /** Append a 3D colour lookup table — see {@link EffectChain.lut}. */\r\n lut(options: AsFilterOptions<LutOptions>) {\r\n return this.append(fromEffect(new EffectChain().lut(options as LutOptions)));\r\n }\r\n\r\n /** Append CRT-style scanlines. */\r\n scanlines(options?: AsFilterOptions<number | ScanlinesOptions>) {\r\n return this.append(fromEffect(new EffectChain().scanlines(options)));\r\n }\r\n\r\n /** Append an After Effects-style Mosaic — `blocks` across the fill. */\r\n pixelate(options: AsFilterOptions<number | PixelateOptions>) {\r\n return this.append(fromEffect(new EffectChain().pixelate(options)));\r\n }\r\n\r\n /**\r\n * Append Kuwahara \"oil paint\" brushwork: average within a region, never\r\n * across an edge, so flat areas smooth into strokes while edges stay crisp.\r\n *\r\n * Cost grows with `radius²` — the most expensive filter in the set.\r\n */\r\n oilPaint(options?: AsFilterOptions<number | OilPaintOptions>) {\r\n return this.append(fromEffect(new EffectChain().oilPaint(options)));\r\n }\r\n\r\n /** Append an ASCII-art remap of the fill through a glyph ramp. */\r\n ascii(options?: AsFilterOptions<number | AsciiOptions>) {\r\n return this.append(fromEffect(new EffectChain().ascii(options)));\r\n }\r\n\r\n /** Append an edge-detect pass (Sobel / Prewitt / Laplacian). */\r\n edges(options?: AsFilterOptions<number | EdgesOptions>) {\r\n return this.append(fromEffect(new EffectChain().edges(options)));\r\n }\r\n\r\n /** Append a darkened border falling off toward the fill's corners. */\r\n vignette(options?: AsFilterOptions<number | VignetteOptions>) {\r\n return this.append(fromEffect(new EffectChain().vignette(options)));\r\n }\r\n\r\n // -- Displacement / lens ----------------------------------------------\r\n\r\n /** Append lens-dispersion colour fringing. */\r\n chromaticAberration(options?: AsFilterOptions<number | ChromaticAberrationOptions>) {\r\n return this.append(fromEffect(new EffectChain().chromaticAberration(options)));\r\n }\r\n\r\n /** Append a hard per-channel RGB offset (the glitchy cousin of the above). */\r\n rgbShift(options?: AsFilterOptions<number | RgbShiftOptions>) {\r\n return this.append(fromEffect(new EffectChain().rgbShift(options)));\r\n }\r\n\r\n /** Append per-pixel random jitter. */\r\n scatter(options?: AsFilterOptions<number | ScatterOptions>) {\r\n return this.append(fromEffect(new EffectChain().scatter(options)));\r\n }\r\n\r\n /** Append horizontal band tearing — the datamosh / bad-signal look. */\r\n blockDisplace(options?: AsFilterOptions<number | BlockDisplaceOptions>) {\r\n return this.append(fromEffect(new EffectChain().blockDisplace(options)));\r\n }\r\n\r\n /** Append a bulge (barrel) or, with a negative strength, a pinch. */\r\n bulge(options: AsFilterOptions<number | BulgeOptions>) {\r\n return this.append(fromEffect(new EffectChain().bulge(options)));\r\n }\r\n\r\n /** Append a twirl (swirl about a centre point). */\r\n twirl(options?: AsFilterOptions<number | TwirlOptions>) {\r\n return this.append(fromEffect(new EffectChain().twirl(options)));\r\n }\r\n\r\n /** Append a sine/triangle/square wave warp. */\r\n wave(options?: AsFilterOptions<number | WaveOptions>) {\r\n return this.append(fromEffect(new EffectChain().wave(options)));\r\n }\r\n\r\n /** Append a kaleidoscope mirror of the fill about a centre point. */\r\n kaleidoscope(options?: AsFilterOptions<number | KaleidoscopeOptions>) {\r\n return this.append(fromEffect(new EffectChain().kaleidoscope(options)));\r\n }\r\n\r\n /** Append a custom shader pass over the fill. */\r\n shader(options: AsFilterOptions<ShaderEffectOptions>) {\r\n return this.append(fromEffect(new EffectChain().shader(options)));\r\n }\r\n\r\n /** Allows spreading the chain into an array: `[...Adjustments.blur(5)]`. */\r\n *[Symbol.iterator]() {\r\n yield* this.list;\r\n }\r\n\r\n /** Serializes to the raw filter array so frameworks that call `toJSON` get a plain value. */\r\n toJSON() {\r\n return this.list;\r\n }\r\n}\r\n\r\n/**\r\n * An {@link AdjustmentChain} plus the video-only temporal filters — the\r\n * filters valid on a **video** fill.\r\n *\r\n * @example\r\n * node.filters = VideoAdjustments.posterizeTime(6).grayscale(1);\r\n */\r\nexport class VideoAdjustmentChain extends AdjustmentChain {\r\n /** Append a posterize-time filter; snaps the video playhead to `fps`. */\r\n posterizeTime(options: number | PosterizeTimeFilterOptions) {\r\n const { fps } = scalarFilter(options, \"fps\");\r\n return this.append({ type: 'posterizeTime', fps });\r\n }\r\n\r\n /** Append an echo (motion-trail) filter over the clip's past frames. */\r\n echo(options: EchoFilterOptions) {\r\n return this.append({ type: 'echo', ...options });\r\n }\r\n}\r\n\r\n/**\r\n * Accepted shapes for an **image** fill's `filters` prop — a single pixel\r\n * filter, a plain array of them, or a filter chain. Mirrors how `Fill` is the\r\n * loose author-facing union for a fill. Video-only filters are excluded here.\r\n */\r\nexport type ImageAdjustment = MediaAdjustment | MediaAdjustment[] | AdjustmentChain;\r\n\r\n/**\r\n * Accepted shapes for a **video** fill's `filters` prop — the pixel filters\r\n * plus the video-only temporal filters (`posterizeTime`, `echo`).\r\n */\r\nexport type VideoAdjustment =\r\n | (MediaAdjustment | VideoOnlyAdjustment)\r\n | (MediaAdjustment | VideoOnlyAdjustment)[]\r\n | AdjustmentChain;\r\n\r\n/**\r\n * Entry point for building **image** filter chains fluently.\r\n *\r\n * An empty chain, so `Adjustments.blur(8)` is `new AdjustmentChain().blur(8)`\r\n * — and every builder's signature and documentation has one definition, on\r\n * {@link AdjustmentChain}, which is what an editor shows on hover.\r\n *\r\n * Contains only pixel filters; video-only filters (`posterizeTime`, `echo`)\r\n * live on {@link VideoAdjustments} because image fills cannot use them.\r\n *\r\n * @example\r\n * node.filters = Adjustments.blur(8).grayscale(1);\r\n * Rect({ fill: Fills.image('bg.jpg', { filters: Adjustments.oilPaint(4) }) })\r\n */\r\nexport const Adjustments = new AdjustmentChain();\r\n\r\n/**\r\n * Entry point for building **video** filter chains fluently — every\r\n * {@link Adjustments} builder plus the video-only temporal ones.\r\n *\r\n * @example\r\n * node.filters = VideoAdjustments.posterizeTime(6);\r\n * node.filters = VideoAdjustments.grayscale(1).blur(6);\r\n */\r\nexport const VideoAdjustments = new VideoAdjustmentChain();\r\n\r\n/**\r\n * The previous name for {@link Adjustments}.\r\n *\r\n * Kept because a scene is *source code in someone else's project*: a rename that\r\n * only shows up as a compile error in a file we can't edit is still a rename that\r\n * broke their build. The alias costs one line and buys a release in which both\r\n * spellings work.\r\n *\r\n * @deprecated Use {@link Adjustments}. Removed in the next major.\r\n */\r\nexport const ImageFilters = Adjustments;\r\n\r\n/**\r\n * The previous name for {@link VideoAdjustments}.\r\n *\r\n * @deprecated Use {@link VideoAdjustments}. Removed in the next major.\r\n */\r\nexport const VideoFilters = VideoAdjustments;\r\n\r\n/**\r\n * Normalises any `ImageAdjustment`/`VideoAdjustment` value to a plain filter array.\r\n * Used internally when reading props before rendering or interpolation.\r\n */\r\nexport function resolveChainAdjustments(filters: ImageAdjustment | VideoAdjustment | undefined): AnyFilter[] {\r\n if (filters === undefined) return [];\r\n if (filters instanceof AdjustmentChain) return filters.list;\r\n if (Array.isArray(filters)) return filters;\r\n return [filters];\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../../../src/attributes/shape/filters/chain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAkJ/C,8EAA8E;AAC9E,SAAS,YAAY,CAAmB,GAAe,EAAE,GAAY;IACjE,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAE,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,EAAQ,CAAC,CAAC,CAAC,GAAG,CAAC;AACjE,CAAC;AAED;;;;;;GAMG;AACH,SAAS,UAAU,CAAC,KAAkB;IAClC,OAAO,KAAK,CAAC,IAAI,CAA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E,GAAG,EAAE,GAAG,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC7C,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,wEAAwE;IACxE,IAAI,CAAC,OAA0B;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrD,CAAC;CACJ;AAkBD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC;AAEjD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAE3D;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC;AAExC;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,gBAAgB,CAAC;AAE7C;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAsD;IAC1F,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IACrC,IAAI,OAAO,YAAY,eAAe;QAAE,OAAO,OAAO,CAAC,IAAI,CAAC;IAC5D,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO,OAAO,CAAC;IAC3C,OAAO,CAAC,OAAO,CAAC,CAAC;AACrB,CAAC","sourcesContent":["import { MediaAdjustment, VideoOnlyAdjustment } from \"./union\";\nimport { EffectChain } from \"../effects/chain\";\nimport type { BlendMode } from \"../fill/blend\";\nimport type { ColorAdjustmentFilter } from \"./implementations/color-adjustment\";\nimport type { CurvesChannel } from \"./implementations/curves\";\nimport type { EffectOptions } from \"../effects/effect-data\";\nimport type {\n AsciiOptions,\n BitCrushOptions,\n BlockDisplaceOptions,\n BloomOptions,\n BulgeOptions,\n ChromaticAberrationOptions,\n DirectionalBlurOptions,\n DitherOptions,\n DuotoneOptions,\n EdgesOptions,\n GrainOptions,\n HalftoneOptions,\n InvertOptions,\n LutOptions,\n KaleidoscopeOptions,\n OilPaintOptions,\n PixelateOptions,\n PosterizeOptions,\n ProgressiveBlurOptions,\n RadialBlurOptions,\n RgbShiftOptions,\n ScanlinesOptions,\n ScatterOptions,\n SharpenOptions,\n ShaderEffectOptions,\n StreakOptions,\n ThresholdOptions,\n TwirlOptions,\n VignetteOptions,\n VintageOptions,\n WaveOptions,\n} from \"../effects/chain\";\n\n/** Any concrete filter a chain may hold — pixel or video-only. */\ntype AnyFilter = MediaAdjustment | VideoOnlyAdjustment;\n\n/**\n * ## Adjustments and filters are two layers, not two names for one thing\n *\n * An **adjustment** is the unit an author writes: `Adjustments.blur(8)`, one\n * entry in the ordered chain a media fill's `preset` carries. A **filter** is\n * the primitive the renderer realises it as — `BlurFilter`, `CurvesFilter`, and\n * the `FilterData` handlers in `registry.ts`.\n *\n * Most of the time the two are one-to-one, which is what makes the distinction\n * look like pedantry. It isn't: an editor above this layer composes adjustments\n * that have no primitive of their own (a lift/gamma/gain grade is three\n * per-channel `CurvesFilter`s), and one primitive — the LUT's texture lookup —\n * is reached through no chain builder at all. Naming the two layers apart is\n * what lets that mapping be written down instead of assumed.\n *\n * It also settles a collision with no good answer otherwise: the options for\n * `Adjustments.colorAdjustment(…)` are named after the primitive they omit from\n * (`ColorAdjustmentFilterOptions`), because `ColorAdjustmentAdjustmentOptions`\n * is not a name anyone should have to type.\n *\n * ## The builders\n *\n * Media adjustments follow the same one-argument rule as node effects: every\n * builder takes a single options object, and those with one dominant scalar\n * also accept that scalar directly. Field names are the shared vocabulary —\n * `radius` for a pixel distance, `amount` for a 0–1 intensity — so\n * `Adjustments.blur(8)` and `Effects.blur(8)` describe the same quantity.\n *\n * Most of the roster *is* the node-effect roster: an adjustment is an effect\n * applied to one fill layer's own pixels instead of to a node and everything\n * beneath it, so `Adjustments.oilPaint(4)` and `Effects.oilPaint(4)` are the\n * same implementation reached two ways. See {@link EffectAdjustment} for the\n * short list of effects that cannot be adjustments.\n */\n\n/** Gaussian blur. Scalar shorthand sets `radius`. */\nexport interface BlurFilterOptions {\n /** Blur radius in pixels. */\n radius: number;\n}\n\n/** Desaturation. Scalar shorthand sets `amount`. */\nexport interface GrayscaleFilterOptions {\n /** 0 = original, 1 = fully grayscale. */\n amount: number;\n}\n\n/** Alpha (opacity) multiply. Scalar shorthand sets `amount`. */\nexport interface AlphaFilterOptions {\n /** 0 = fully transparent, 1 = unchanged. */\n amount: number;\n}\n\n/** Luminance scale. Scalar shorthand sets `amount`. */\nexport interface ExposureFilterOptions {\n /** Exposure multiplier. 1 = unchanged, >1 brighter, <1 darker. */\n amount: number;\n}\n\n/** Raw 4×5 row-major colour matrix. Array shorthand sets `matrix`. */\nexport interface ColorMatrixFilterOptions {\n /** 4×5 row-major colour matrix: rows R, G, B, A of `[r, g, b, a, bias]`. */\n matrix: number[];\n}\n\n/** Tone curve through control points. */\nexport interface CurvesFilterOptions {\n /** Curve control points as [input, output] pairs in [0, 1]. */\n points: [number, number][];\n /** Channel(s) to apply the curve to (default `'rgb'`). */\n channel?: CurvesChannel;\n}\n\n/** Photographic tonal/colour adjustments. All fields optional. */\nexport type ColorAdjustmentFilterOptions = Omit<ColorAdjustmentFilter, 'type'>;\n\n/** Stop-motion frame-rate resample (video only). Scalar shorthand sets `fps`. */\nexport interface PosterizeTimeFilterOptions {\n /** Target frame rate the source playhead snaps to. */\n fps: number;\n}\n\n/** Motion-trail echo of past frames (video only). */\nexport interface EchoFilterOptions {\n /** Number of past-frame taps drawn behind the current frame. */\n echoes: number;\n /** Delay between successive taps, in source seconds. */\n delay: number;\n /** Per-tap alpha multiplier; tap `n` is drawn at `decay ** n` (default 0.5). */\n decay?: number;\n /** Blend mode used to composite the echo taps (default `'screen'`). */\n blend?: BlendMode;\n}\n\n/**\n * A node effect's builder options as a **filter** accepts them: the same\n * fields minus the cross-cutting {@link EffectOptions} (today `mode`).\n *\n * A filter is on the fill's own pixels by definition, so there is no backdrop\n * to point it at — dropping the knob is clearer than accepting it and silently\n * ignoring it. Scalar shorthands survive untouched.\n */\ntype AsFilterOptions<T> = T extends number ? number : Omit<T, keyof EffectOptions>;\n\n/** Normalise a `number | Options` filter argument onto its dominant field. */\nfunction scalarFilter<O extends object>(arg: number | O, key: keyof O): O {\n return typeof arg === \"number\" ? ({ [key]: arg } as O) : arg;\n}\n\n/**\n * The single effect a one-builder {@link EffectChain} produced.\n *\n * Every effect-backed filter routes through here rather than re-declaring the\n * effect literal, so defaults, scalar shorthands and field normalisation have\n * exactly one definition — the one scenes already use.\n */\nfunction fromEffect(chain: EffectChain): AnyFilter {\n return chain.list[0] as AnyFilter;\n}\n\n/**\n * Immutable, chainable list of media filters — the filters valid on an **image**\n * fill.\n *\n * Each builder method returns a new chain with the filter appended, so chains\n * are safe to share and branch. {@link VideoAdjustmentChain} extends this with the\n * video-only temporal filters; the split is what keeps `posterizeTime` off an\n * image fill, mirroring how `Fill` is structured.\n *\n * @example\n * const chain = Adjustments.blur(4).grayscale(0.5);\n * node.filters = chain; // assign directly\n * node.filters = [...chain, { type: 'alpha', amount: 0.5 }]; // spread into array\n */\nexport class AdjustmentChain {\n constructor(public list: AnyFilter[] = []) { }\n\n /**\n * Append `filter`, returning a chain of the same class — so the video\n * subclass keeps its extra builders reachable after an inherited one.\n */\n protected append(filter: AnyFilter): this {\n const Ctor = this.constructor as new (list: AnyFilter[]) => this;\n return new Ctor([...this.list, filter]);\n }\n\n // -- Filters with no node-effect counterpart -------------------------\n\n /** Append a Gaussian blur. */\n blur(options: number | BlurFilterOptions) {\n const { radius } = scalarFilter(options, \"radius\");\n return this.append({ type: 'blur', radius });\n }\n\n /** Append a grayscale filter. */\n grayscale(options: number | GrayscaleFilterOptions) {\n const { amount } = scalarFilter(options, \"amount\");\n return this.append({ type: 'grayscale', amount });\n }\n\n /** Append an alpha (opacity) filter. */\n alpha(options: number | AlphaFilterOptions) {\n const { amount } = scalarFilter(options, \"amount\");\n return this.append({ type: 'alpha', amount });\n }\n\n /** Append an exposure filter. */\n exposure(options: number | ExposureFilterOptions) {\n const { amount } = scalarFilter(options, \"amount\");\n return this.append({ type: 'exposure', amount });\n }\n\n /** Append a color-adjustment filter from the given partial settings. */\n colorAdjustment(options: ColorAdjustmentFilterOptions) {\n return this.append({ type: 'colorAdjustment', ...options });\n }\n\n /** Append a raw 4×5 row-major color matrix. */\n colorMatrix(options: number[] | ColorMatrixFilterOptions) {\n const matrix = Array.isArray(options) ? options : options.matrix;\n return this.append({ type: 'colorMatrix', matrix });\n }\n\n /** Append a curves filter from control `points` ([input, output] pairs). */\n curves(options: CurvesFilterOptions) {\n return this.append({ type: 'curves', points: options.points, channel: options.channel });\n }\n\n // -- Blur family ------------------------------------------------------\n\n /** Append a directional (linear) blur, smearing the fill along one axis. */\n directionalBlur(options: AsFilterOptions<number | DirectionalBlurOptions>) {\n return this.append(fromEffect(new EffectChain().directionalBlur(options)));\n }\n\n /** Append a radial blur — zoom or spin streaks about a centre point. */\n radialBlur(options?: AsFilterOptions<number | RadialBlurOptions>) {\n return this.append(fromEffect(new EffectChain().radialBlur(options)));\n }\n\n /**\n * Append a progressive blur — a blur that ramps across the fill, for the\n * frosted-toward-one-edge look.\n */\n progressiveBlur(options?: AsFilterOptions<number | ProgressiveBlurOptions>) {\n return this.append(fromEffect(new EffectChain().progressiveBlur(options)));\n }\n\n /** Append a bloom (glow): bright areas bleed soft light outward. */\n bloom(options?: AsFilterOptions<number | BloomOptions>) {\n return this.append(fromEffect(new EffectChain().bloom(options)));\n }\n\n /** Append anamorphic streaks off the fill's highlights. */\n streak(options?: AsFilterOptions<number | StreakOptions>) {\n return this.append(fromEffect(new EffectChain().streak(options)));\n }\n\n /** Append an unsharp-mask sharpen. */\n sharpen(options?: AsFilterOptions<number | SharpenOptions>) {\n return this.append(fromEffect(new EffectChain().sharpen(options)));\n }\n\n // -- Colour -----------------------------------------------------------\n\n /** Append a colour invert (negative). */\n invert(options?: AsFilterOptions<number | InvertOptions>) {\n return this.append(fromEffect(new EffectChain().invert(options)));\n }\n\n /** Append a vintage / film-look grade (sepia + desaturate + warmth). */\n vintage(options?: AsFilterOptions<number | VintageOptions>) {\n return this.append(fromEffect(new EffectChain().vintage(options)));\n }\n\n /** Append a duotone map — remap luminance between two colours. */\n duotone(options?: AsFilterOptions<number | DuotoneOptions>) {\n return this.append(fromEffect(new EffectChain().duotone(options)));\n }\n\n /** Append colour banding: quantize to `levels` tones per channel. */\n posterize(options?: AsFilterOptions<number | PosterizeOptions>) {\n return this.append(fromEffect(new EffectChain().posterize(options)));\n }\n\n /** Append a hard luminance threshold (1-bit black/white). */\n threshold(options?: AsFilterOptions<number | ThresholdOptions>) {\n return this.append(fromEffect(new EffectChain().threshold(options)));\n }\n\n /** Append a bit-depth crush, optionally snapping to a hardware palette. */\n bitCrush(options?: AsFilterOptions<number | BitCrushOptions>) {\n return this.append(fromEffect(new EffectChain().bitCrush(options)));\n }\n\n // -- Texture / pattern ------------------------------------------------\n\n /**\n * Append ordered (Bayer) dithering — quantize to `levels` tones, hiding the\n * banding in a repeating threshold pattern.\n */\n dither(options?: AsFilterOptions<number | DitherOptions>) {\n return this.append(fromEffect(new EffectChain().dither(options)));\n }\n\n /** Append a halftone screen — print-style dots (or lines) sized by tone. */\n halftone(options?: AsFilterOptions<number | HalftoneOptions>) {\n return this.append(fromEffect(new EffectChain().halftone(options)));\n }\n\n /** Append film grain. Animate it by tweening `seed`. */\n grain(options?: AsFilterOptions<number | GrainOptions>) {\n return this.append(fromEffect(new EffectChain().grain(options)));\n }\n\n /** Append a 3D colour lookup table — see {@link EffectChain.lut}. */\n lut(options: AsFilterOptions<LutOptions>) {\n return this.append(fromEffect(new EffectChain().lut(options as LutOptions)));\n }\n\n /** Append CRT-style scanlines. */\n scanlines(options?: AsFilterOptions<number | ScanlinesOptions>) {\n return this.append(fromEffect(new EffectChain().scanlines(options)));\n }\n\n /** Append an After Effects-style Mosaic — `blocks` across the fill. */\n pixelate(options: AsFilterOptions<number | PixelateOptions>) {\n return this.append(fromEffect(new EffectChain().pixelate(options)));\n }\n\n /**\n * Append Kuwahara \"oil paint\" brushwork: average within a region, never\n * across an edge, so flat areas smooth into strokes while edges stay crisp.\n *\n * Cost grows with `radius²` — the most expensive filter in the set.\n */\n oilPaint(options?: AsFilterOptions<number | OilPaintOptions>) {\n return this.append(fromEffect(new EffectChain().oilPaint(options)));\n }\n\n /** Append an ASCII-art remap of the fill through a glyph ramp. */\n ascii(options?: AsFilterOptions<number | AsciiOptions>) {\n return this.append(fromEffect(new EffectChain().ascii(options)));\n }\n\n /** Append an edge-detect pass (Sobel / Prewitt / Laplacian). */\n edges(options?: AsFilterOptions<number | EdgesOptions>) {\n return this.append(fromEffect(new EffectChain().edges(options)));\n }\n\n /** Append a darkened border falling off toward the fill's corners. */\n vignette(options?: AsFilterOptions<number | VignetteOptions>) {\n return this.append(fromEffect(new EffectChain().vignette(options)));\n }\n\n // -- Displacement / lens ----------------------------------------------\n\n /** Append lens-dispersion colour fringing. */\n chromaticAberration(options?: AsFilterOptions<number | ChromaticAberrationOptions>) {\n return this.append(fromEffect(new EffectChain().chromaticAberration(options)));\n }\n\n /** Append a hard per-channel RGB offset (the glitchy cousin of the above). */\n rgbShift(options?: AsFilterOptions<number | RgbShiftOptions>) {\n return this.append(fromEffect(new EffectChain().rgbShift(options)));\n }\n\n /** Append per-pixel random jitter. */\n scatter(options?: AsFilterOptions<number | ScatterOptions>) {\n return this.append(fromEffect(new EffectChain().scatter(options)));\n }\n\n /** Append horizontal band tearing — the datamosh / bad-signal look. */\n blockDisplace(options?: AsFilterOptions<number | BlockDisplaceOptions>) {\n return this.append(fromEffect(new EffectChain().blockDisplace(options)));\n }\n\n /** Append a bulge (barrel) or, with a negative strength, a pinch. */\n bulge(options: AsFilterOptions<number | BulgeOptions>) {\n return this.append(fromEffect(new EffectChain().bulge(options)));\n }\n\n /** Append a twirl (swirl about a centre point). */\n twirl(options?: AsFilterOptions<number | TwirlOptions>) {\n return this.append(fromEffect(new EffectChain().twirl(options)));\n }\n\n /** Append a sine/triangle/square wave warp. */\n wave(options?: AsFilterOptions<number | WaveOptions>) {\n return this.append(fromEffect(new EffectChain().wave(options)));\n }\n\n /** Append a kaleidoscope mirror of the fill about a centre point. */\n kaleidoscope(options?: AsFilterOptions<number | KaleidoscopeOptions>) {\n return this.append(fromEffect(new EffectChain().kaleidoscope(options)));\n }\n\n /** Append a custom shader pass over the fill. */\n shader(options: AsFilterOptions<ShaderEffectOptions>) {\n return this.append(fromEffect(new EffectChain().shader(options)));\n }\n\n /** Allows spreading the chain into an array: `[...Adjustments.blur(5)]`. */\n *[Symbol.iterator]() {\n yield* this.list;\n }\n\n /** Serializes to the raw filter array so frameworks that call `toJSON` get a plain value. */\n toJSON() {\n return this.list;\n }\n}\n\n/**\n * An {@link AdjustmentChain} plus the video-only temporal filters — the\n * filters valid on a **video** fill.\n *\n * @example\n * node.filters = VideoAdjustments.posterizeTime(6).grayscale(1);\n */\nexport class VideoAdjustmentChain extends AdjustmentChain {\n /** Append a posterize-time filter; snaps the video playhead to `fps`. */\n posterizeTime(options: number | PosterizeTimeFilterOptions) {\n const { fps } = scalarFilter(options, \"fps\");\n return this.append({ type: 'posterizeTime', fps });\n }\n\n /** Append an echo (motion-trail) filter over the clip's past frames. */\n echo(options: EchoFilterOptions) {\n return this.append({ type: 'echo', ...options });\n }\n}\n\n/**\n * Accepted shapes for an **image** fill's `filters` prop — a single pixel\n * filter, a plain array of them, or a filter chain. Mirrors how `Fill` is the\n * loose author-facing union for a fill. Video-only filters are excluded here.\n */\nexport type ImageAdjustment = MediaAdjustment | MediaAdjustment[] | AdjustmentChain;\n\n/**\n * Accepted shapes for a **video** fill's `filters` prop — the pixel filters\n * plus the video-only temporal filters (`posterizeTime`, `echo`).\n */\nexport type VideoAdjustment =\n | (MediaAdjustment | VideoOnlyAdjustment)\n | (MediaAdjustment | VideoOnlyAdjustment)[]\n | AdjustmentChain;\n\n/**\n * Entry point for building **image** filter chains fluently.\n *\n * An empty chain, so `Adjustments.blur(8)` is `new AdjustmentChain().blur(8)`\n * — and every builder's signature and documentation has one definition, on\n * {@link AdjustmentChain}, which is what an editor shows on hover.\n *\n * Contains only pixel filters; video-only filters (`posterizeTime`, `echo`)\n * live on {@link VideoAdjustments} because image fills cannot use them.\n *\n * @example\n * node.filters = Adjustments.blur(8).grayscale(1);\n * Rect({ fill: Fills.image('bg.jpg', { filters: Adjustments.oilPaint(4) }) })\n */\nexport const Adjustments = new AdjustmentChain();\n\n/**\n * Entry point for building **video** filter chains fluently — every\n * {@link Adjustments} builder plus the video-only temporal ones.\n *\n * @example\n * node.filters = VideoAdjustments.posterizeTime(6);\n * node.filters = VideoAdjustments.grayscale(1).blur(6);\n */\nexport const VideoAdjustments = new VideoAdjustmentChain();\n\n/**\n * The previous name for {@link Adjustments}.\n *\n * Kept because a scene is *source code in someone else's project*: a rename that\n * only shows up as a compile error in a file we can't edit is still a rename that\n * broke their build. The alias costs one line and buys a release in which both\n * spellings work.\n *\n * @deprecated Use {@link Adjustments}. Removed in the next major.\n */\nexport const ImageFilters = Adjustments;\n\n/**\n * The previous name for {@link VideoAdjustments}.\n *\n * @deprecated Use {@link VideoAdjustments}. Removed in the next major.\n */\nexport const VideoFilters = VideoAdjustments;\n\n/**\n * Normalises any `ImageAdjustment`/`VideoAdjustment` value to a plain filter array.\n * Used internally when reading props before rendering or interpolation.\n */\nexport function resolveChainAdjustments(filters: ImageAdjustment | VideoAdjustment | undefined): AnyFilter[] {\n if (filters === undefined) return [];\n if (filters instanceof AdjustmentChain) return filters.list;\n if (Array.isArray(filters)) return filters;\n return [filters];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/filters/implementations/alpha.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAS1C,MAAM,CAAC,MAAM,WAAW,GAA4B;IAChD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC;IACzF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;CAC1C,CAAC","sourcesContent":["import type { FilterData } from \"../registry\";\
|
|
1
|
+
{"version":3,"file":"alpha.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/filters/implementations/alpha.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAS1C,MAAM,CAAC,MAAM,WAAW,GAA4B;IAChD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC;IACzF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;CAC1C,CAAC","sourcesContent":["import type { FilterData } from \"../registry\";\nimport { lerpNumber } from \"@/tween/lerp\";\n\n/** Multiplies every pixel's alpha channel by `amount`, fading the entire layer. */\nexport interface AlphaFilter {\n type: 'alpha';\n /** 0 = fully transparent, 1 = unchanged. */\n amount: number;\n}\n\nexport const alphaFilter: FilterData<AlphaFilter> = {\n lerp: (from, to, t) => ({ type: \"alpha\", amount: lerpNumber(from.amount, to.amount, t) }),\n equals: (a, b) => a.amount === b.amount,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blur.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/filters/implementations/blur.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAS1C,MAAM,CAAC,MAAM,UAAU,GAA2B;IAC9C,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC;IACxF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;CAC1C,CAAC","sourcesContent":["import type { FilterData } from \"../registry\";\
|
|
1
|
+
{"version":3,"file":"blur.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/filters/implementations/blur.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAS1C,MAAM,CAAC,MAAM,UAAU,GAA2B;IAC9C,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC;IACxF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;CAC1C,CAAC","sourcesContent":["import type { FilterData } from \"../registry\";\nimport { lerpNumber } from \"@/tween/lerp\";\n\n/** Applies a Gaussian blur to the media layer. */\nexport interface BlurFilter {\n type: 'blur';\n /** Blur radius in pixels. */\n radius: number;\n}\n\nexport const blurFilter: FilterData<BlurFilter> = {\n lerp: (from, to, t) => ({ type: \"blur\", radius: lerpNumber(from.radius, to.radius, t) }),\n equals: (a, b) => a.radius === b.radius,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-adjustment.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/filters/implementations/color-adjustment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA8B1C,MAAM,CAAC,MAAM,qBAAqB,GAAsC;IACpE,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,iBAAiB;QACvB,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,EAAE,EAAE,CAAC,UAAU,IAAI,CAAC,EAAE,CAAC,CAAC;QACnE,QAAQ,EAAE,UAAU,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,EAAE,EAAE,CAAC,QAAQ,IAAI,CAAC,EAAE,CAAC,CAAC;QAC7D,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,EAAE,EAAE,CAAC,UAAU,IAAI,CAAC,EAAE,CAAC,CAAC;QACnE,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;QAC9C,QAAQ,EAAE,UAAU,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,EAAE,EAAE,CAAC,QAAQ,IAAI,CAAC,EAAE,CAAC,CAAC;QAC7D,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,EAAE,EAAE,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1D,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,EAAE,EAAE,CAAC,UAAU,IAAI,CAAC,EAAE,CAAC,CAAC;QACnE,WAAW,EAAE,UAAU,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,EAAE,EAAE,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC,CAAC;QACtE,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC;QACjD,QAAQ,EAAE,UAAU,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,EAAE,EAAE,CAAC,QAAQ,IAAI,CAAC,EAAE,CAAC,CAAC;KAChE,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACb,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU;QAC7B,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ;QACzB,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU;QAC7B,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG;QACf,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ;QACzB,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO;QACvB,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU;QAC7B,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW;QAC/B,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI;QACjB,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ;CAChC,CAAC","sourcesContent":["import type { FilterData } from \"../registry\";\
|
|
1
|
+
{"version":3,"file":"color-adjustment.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/filters/implementations/color-adjustment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA8B1C,MAAM,CAAC,MAAM,qBAAqB,GAAsC;IACpE,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,iBAAiB;QACvB,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,EAAE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KAAK,CAAC,CAAC,QAAQ;QACzB,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU;QAC7B,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG;QACf,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ;QACzB,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO;QACvB,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU;QAC7B,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW;QAC/B,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI;QACjB,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ;CAChC,CAAC","sourcesContent":["import type { FilterData } from \"../registry\";\nimport { lerpNumber } from \"@/tween/lerp\";\n\n/**\n * A collection of photographic-style tonal and color adjustments.\n * All fields are optional; omitted fields use their neutral default.\n */\nexport interface ColorAdjustmentFilter {\n type: 'colorAdjustment';\n /** -1 to 1 (0 = unchanged). Shifts the overall lightness without clipping like exposure does. */\n brightness?: number;\n /** 0 to 2 (1 = unchanged). Spreads highlights and shadows further apart. */\n contrast?: number;\n /** 0 to 3 (1 = unchanged). Scales color saturation uniformly. */\n saturation?: number;\n /** Hue rotation in degrees (0 = unchanged), luma-preserving. Wraps at 360. */\n hue?: number;\n /** -1 to 1 (0 = unchanged). Boosts muted colors more than vibrant ones. */\n vibrance?: number;\n /** -1 to 1 (0 = unchanged). Lifts or crushes shadow regions. */\n shadows?: number;\n /** -1 to 1 (0 = unchanged). Brightens or dims highlight regions. */\n highlights?: number;\n /** -1 to 1 (0 = unchanged). Negative = cool (blue), positive = warm (orange). */\n temperature?: number;\n /** -1 to 1 (0 = unchanged). Negative = green shift, positive = magenta shift. */\n tint?: number;\n /** 0 to 1 (0 = none). Darkens the edges of the frame. */\n vignette?: number;\n}\n\nexport const colorAdjustmentFilter: FilterData<ColorAdjustmentFilter> = {\n lerp: (from, to, t) => ({\n type: \"colorAdjustment\",\n brightness: lerpNumber(from.brightness ?? 0, to.brightness ?? 0, t),\n contrast: lerpNumber(from.contrast ?? 1, to.contrast ?? 1, t),\n saturation: lerpNumber(from.saturation ?? 1, to.saturation ?? 1, t),\n hue: lerpNumber(from.hue ?? 0, to.hue ?? 0, t),\n vibrance: lerpNumber(from.vibrance ?? 0, to.vibrance ?? 0, t),\n shadows: lerpNumber(from.shadows ?? 0, to.shadows ?? 0, t),\n highlights: lerpNumber(from.highlights ?? 0, to.highlights ?? 0, t),\n temperature: lerpNumber(from.temperature ?? 0, to.temperature ?? 0, t),\n tint: lerpNumber(from.tint ?? 0, to.tint ?? 0, t),\n vignette: lerpNumber(from.vignette ?? 0, to.vignette ?? 0, t),\n }),\n equals: (a, b) =>\n a.brightness === b.brightness &&\n a.contrast === b.contrast &&\n a.saturation === b.saturation &&\n a.hue === b.hue &&\n a.vibrance === b.vibrance &&\n a.shadows === b.shadows &&\n a.highlights === b.highlights &&\n a.temperature === b.temperature &&\n a.tint === b.tint &&\n a.vignette === b.vignette,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-matrix.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/filters/implementations/color-matrix.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAe1C,MAAM,CAAC,MAAM,iBAAiB,GAAkC;IAC5D,2EAA2E;IAC3E,wEAAwE;IACxE,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;KACzE,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;CACvG,CAAC","sourcesContent":["import type { FilterData } from \"../registry\";\
|
|
1
|
+
{"version":3,"file":"color-matrix.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/filters/implementations/color-matrix.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAe1C,MAAM,CAAC,MAAM,iBAAiB,GAAkC;IAC5D,2EAA2E;IAC3E,wEAAwE;IACxE,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;KACzE,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;CACvG,CAAC","sourcesContent":["import type { FilterData } from \"../registry\";\nimport { lerpNumber } from \"@/tween/lerp\";\n\n/**\n * Applies an arbitrary 4×5 color transform.\n *\n * The matrix is row-major with rows [R, G, B, A], each row being\n * [rScale, gScale, bScale, aScale, bias]. Useful for tinting,\n * channel swaps, or any effect not covered by the named filters.\n */\nexport interface ColorMatrixFilter {\n type: 'colorMatrix';\n /** 4×5 row-major color matrix. */\n matrix: number[];\n}\n\nexport const colorMatrixFilter: FilterData<ColorMatrixFilter> = {\n // Lerps each matrix coefficient independently; missing target coefficients\n // hold their source value so partial matrices still animate gracefully.\n lerp: (from, to, t) => ({\n type: \"colorMatrix\",\n matrix: from.matrix.map((v, i) => lerpNumber(v, to.matrix[i] ?? v, t)),\n }),\n equals: (a, b) => a.matrix.length === b.matrix.length && a.matrix.every((v, i) => v === b.matrix[i]),\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"curves.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/filters/implementations/curves.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAoB1C,MAAM,CAAC,MAAM,YAAY,GAA6B;IAClD,yEAAyE;IACzE,iDAAiD;IACjD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO;QAC5C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YAClC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACxC,OAAO,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAqB,CAAC;QAC5E,CAAC,CAAC;KACL,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACb,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO;QACvB,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM;QACnC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CACtF,CAAC","sourcesContent":["import type { FilterData } from \"../registry\";\
|
|
1
|
+
{"version":3,"file":"curves.js","sourceRoot":"","sources":["../../../../../src/attributes/shape/filters/implementations/curves.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAoB1C,MAAM,CAAC,MAAM,YAAY,GAA6B;IAClD,yEAAyE;IACzE,iDAAiD;IACjD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO;QAC5C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YAClC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACxC,OAAO,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAqB,CAAC;QAC5E,CAAC,CAAC;KACL,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACb,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO;QACvB,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM;QACnC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CACtF,CAAC","sourcesContent":["import type { FilterData } from \"../registry\";\nimport { lerpNumber } from \"@/tween/lerp\";\n\n/** Which color channel(s) a curves adjustment targets. */\nexport type CurvesChannel = 'rgb' | 'r' | 'g' | 'b' | 'a';\n\n/**\n * Remaps pixel values along a tone curve defined by control points.\n *\n * Points are [input, output] pairs in the [0, 1] range. The renderer\n * interpolates a smooth curve through them. Applies to composite RGB\n * by default; set `channel` to target a single channel.\n */\nexport interface CurvesFilter {\n type: 'curves';\n /** Curve control points as [input, output] pairs in [0, 1]. */\n points: [number, number][];\n /** Channel(s) to apply the curve to. Default 'rgb'. */\n channel?: CurvesChannel;\n}\n\nexport const curvesFilter: FilterData<CurvesFilter> = {\n // Channel hard-cuts at t=0.5 because interpolating between channel names\n // would produce meaningless intermediate states.\n lerp: (from, to, t) => ({\n type: \"curves\",\n channel: t < 0.5 ? from.channel : to.channel,\n points: from.points.map(([x, y], i) => {\n const [tx, ty] = to.points[i] ?? [x, y];\n return [lerpNumber(x, tx, t), lerpNumber(y, ty, t)] as [number, number];\n }),\n }),\n equals: (a, b) =>\n a.channel === b.channel &&\n a.points.length === b.points.length &&\n a.points.every(([x, y], i) => x === b.points[i]?.[0] && y === b.points[i]?.[1]),\n};\n"]}
|