@motionscript/core 0.1.0-alpha.6 → 0.1.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/README.md +2 -4
- package/dist/assets/errors.js +4 -5
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/scope.d.ts +1 -1
- package/dist/assets/scope.d.ts.map +1 -1
- package/dist/assets/scope.js +1 -1
- package/dist/assets/scope.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +3 -18
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/index.d.ts +3 -5
- package/dist/attributes/index.d.ts.map +1 -1
- package/dist/attributes/index.js +2 -2
- package/dist/attributes/index.js.map +1 -1
- package/dist/attributes/layout/insets.d.ts +1 -1
- package/dist/attributes/layout/insets.js.map +1 -1
- package/dist/attributes/layout/size.d.ts +1 -1
- package/dist/attributes/layout/size.js +1 -1
- package/dist/attributes/layout/size.js.map +1 -1
- package/dist/attributes/properties/decorator.d.ts +44 -11
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- package/dist/attributes/properties/decorator.js +37 -9
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/inputs.d.ts +1 -1
- package/dist/attributes/properties/inputs.js +1 -1
- package/dist/attributes/properties/inputs.js.map +1 -1
- package/dist/attributes/properties/typed.d.ts +19 -140
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +12 -108
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.d.ts +1 -1
- package/dist/attributes/shape/corners/corner-radius.js +1 -1
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts +1 -1
- package/dist/attributes/shape/fill/color/parser.js +1 -1
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -2
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.d.ts +2 -2
- package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.d.ts +1 -1
- package/dist/attributes/shape/fill/implementations/video.js +1 -1
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.d.ts +1 -1
- package/dist/attributes/shape/fill/lerp.js.map +1 -1
- package/dist/attributes/shape/filters/chain.d.ts +1 -1
- package/dist/attributes/shape/filters/chain.js +1 -1
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +4 -3
- package/dist/attributes/shape/filters/union.d.ts.map +1 -1
- package/dist/attributes/shape/filters/union.js.map +1 -1
- package/dist/attributes/shape/path/ops.d.ts +1 -2
- package/dist/attributes/shape/path/ops.d.ts.map +1 -1
- package/dist/attributes/shape/path/ops.js.map +1 -1
- package/dist/attributes/shared/operators.d.ts +2 -2
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/types.d.ts +2 -3
- package/dist/attributes/text/types.d.ts.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/chunk-D4FSTPML.js +14 -0
- package/dist/browser/chunks/chunk-D4FSTPML.js.map +7 -0
- package/dist/browser/chunks/chunk-LKUYVFU3.js +2 -0
- package/dist/browser/chunks/{chunk-DHB4COFY.js.map → chunk-LKUYVFU3.js.map} +4 -4
- package/dist/browser/chunks/chunk-RTNATFWX.js +5 -0
- package/dist/browser/chunks/chunk-RTNATFWX.js.map +7 -0
- package/dist/browser/chunks/chunk-ZRPZPWZU.js +3 -0
- package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/component.js.map +4 -4
- package/dist/browser/experimental.js +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/manifest.json +2 -4
- package/dist/browser/sdk.js +1 -1
- package/dist/component.d.ts +10 -18
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +10 -17
- package/dist/component.js.map +1 -1
- package/dist/components/builtins/audio/audio.d.ts +53 -0
- package/dist/components/builtins/audio/audio.d.ts.map +1 -0
- package/dist/components/builtins/audio/audio.js +41 -0
- package/dist/components/builtins/audio/audio.js.map +1 -0
- package/dist/components/builtins/geometry/composite.d.ts +93 -0
- package/dist/components/builtins/geometry/composite.d.ts.map +1 -0
- package/dist/components/builtins/geometry/composite.js +25 -0
- package/dist/components/builtins/geometry/composite.js.map +1 -0
- package/dist/components/builtins/geometry/geometry.d.ts +921 -0
- package/dist/components/builtins/geometry/geometry.d.ts.map +1 -0
- package/dist/components/builtins/geometry/geometry.js +107 -0
- package/dist/components/builtins/geometry/geometry.js.map +1 -0
- package/dist/components/builtins/geometry/shape-outline.d.ts +93 -0
- package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -0
- package/dist/components/builtins/geometry/shape-outline.js +470 -0
- package/dist/components/builtins/geometry/shape-outline.js.map +1 -0
- package/dist/components/builtins/layout/layout.d.ts +186 -0
- package/dist/components/builtins/layout/layout.d.ts.map +1 -0
- package/dist/components/builtins/layout/layout.js +84 -0
- package/dist/components/builtins/layout/layout.js.map +1 -0
- package/dist/components/builtins/media/media.d.ts +240 -0
- package/dist/components/builtins/media/media.d.ts.map +1 -0
- package/dist/components/builtins/media/media.js +149 -0
- package/dist/components/builtins/media/media.js.map +1 -0
- package/dist/components/builtins/providers/providers.d.ts +47 -0
- package/dist/components/builtins/providers/providers.d.ts.map +1 -0
- package/dist/components/builtins/providers/providers.js +30 -0
- package/dist/components/builtins/providers/providers.js.map +1 -0
- package/dist/components/builtins/text/number-format.d.ts +66 -0
- package/dist/components/builtins/text/number-format.d.ts.map +1 -0
- package/dist/components/builtins/text/number-format.js +227 -0
- package/dist/components/builtins/text/number-format.js.map +1 -0
- package/dist/components/builtins/text/number-pattern.d.ts +51 -0
- package/dist/components/builtins/text/number-pattern.d.ts.map +1 -0
- package/dist/components/builtins/text/number-pattern.js +77 -0
- package/dist/components/builtins/text/number-pattern.js.map +1 -0
- package/dist/components/builtins/text/text-defaults.d.ts +32 -0
- package/dist/components/builtins/text/text-defaults.d.ts.map +1 -0
- package/dist/components/builtins/text/text-defaults.js +37 -0
- package/dist/components/builtins/text/text-defaults.js.map +1 -0
- package/dist/components/builtins/text/text-layout.d.ts +82 -0
- package/dist/components/builtins/text/text-layout.d.ts.map +1 -0
- package/dist/components/builtins/text/text-layout.js +331 -0
- package/dist/components/builtins/text/text-layout.js.map +1 -0
- package/dist/components/builtins/text/text.d.ts +409 -0
- package/dist/components/builtins/text/text.d.ts.map +1 -0
- package/dist/components/builtins/text/text.js +113 -0
- package/dist/components/builtins/text/text.js.map +1 -0
- package/dist/components/builtins/three/canvas3d.d.ts +245 -0
- package/dist/components/builtins/three/canvas3d.d.ts.map +1 -0
- package/dist/components/builtins/three/canvas3d.js +21 -0
- package/dist/components/builtins/three/canvas3d.js.map +1 -0
- package/dist/components/builtins/three/grid-geometry3d.d.ts +62 -0
- package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -0
- package/dist/components/builtins/three/grid-geometry3d.js +114 -0
- package/dist/components/builtins/three/grid-geometry3d.js.map +1 -0
- package/dist/components/builtins/three/three.d.ts +1889 -0
- package/dist/components/builtins/three/three.d.ts.map +1 -0
- package/dist/components/builtins/three/three.js +305 -0
- package/dist/components/builtins/three/three.js.map +1 -0
- package/dist/components/factory/api.d.ts +516 -0
- package/dist/components/factory/api.d.ts.map +1 -0
- package/dist/components/factory/api.js +4 -0
- package/dist/components/factory/api.js.map +1 -0
- package/dist/components/factory/clip-of.d.ts +5 -0
- package/dist/components/factory/clip-of.d.ts.map +1 -0
- package/dist/components/factory/clip-of.js +33 -0
- package/dist/components/factory/clip-of.js.map +1 -0
- package/dist/components/factory/commands-for.d.ts +19 -0
- package/dist/components/factory/commands-for.d.ts.map +1 -0
- package/dist/components/factory/commands-for.js +5 -0
- package/dist/components/factory/commands-for.js.map +1 -0
- package/dist/components/factory/component-audio.d.ts +9 -0
- package/dist/components/factory/component-audio.d.ts.map +1 -0
- package/dist/components/factory/component-audio.js +18 -0
- package/dist/components/factory/component-audio.js.map +1 -0
- package/dist/components/factory/component2d.d.ts +8 -0
- package/dist/components/factory/component2d.d.ts.map +1 -0
- package/dist/components/factory/component2d.js +240 -0
- package/dist/components/factory/component2d.js.map +1 -0
- package/dist/components/factory/component3d.d.ts +9 -0
- package/dist/components/factory/component3d.d.ts.map +1 -0
- package/dist/components/factory/component3d.js +99 -0
- package/dist/components/factory/component3d.js.map +1 -0
- package/dist/components/factory/factory.d.ts +63 -0
- package/dist/components/factory/factory.d.ts.map +1 -0
- package/dist/components/factory/factory.js +313 -0
- package/dist/components/factory/factory.js.map +1 -0
- package/dist/components/factory/timeline.d.ts +22 -0
- package/dist/components/factory/timeline.d.ts.map +1 -0
- package/dist/components/factory/timeline.js +128 -0
- package/dist/components/factory/timeline.js.map +1 -0
- package/dist/components/factory/type-def.d.ts +26 -0
- package/dist/components/factory/type-def.d.ts.map +1 -0
- package/dist/components/factory/type-def.js +16 -0
- package/dist/components/factory/type-def.js.map +1 -0
- package/dist/components/factory/types.d.ts +91 -0
- package/dist/components/factory/types.d.ts.map +1 -0
- package/dist/components/factory/types.js +88 -0
- package/dist/components/factory/types.js.map +1 -0
- package/dist/components/factory/views.d.ts +121 -0
- package/dist/components/factory/views.d.ts.map +1 -0
- package/dist/components/factory/views.js +413 -0
- package/dist/components/factory/views.js.map +1 -0
- package/dist/components/modules/aim.d.ts +30 -0
- package/dist/components/modules/aim.d.ts.map +1 -0
- package/dist/components/modules/aim.js +39 -0
- package/dist/components/modules/aim.js.map +1 -0
- package/dist/components/modules/corners.d.ts +13 -0
- package/dist/components/modules/corners.d.ts.map +1 -0
- package/dist/components/modules/corners.js +12 -0
- package/dist/components/modules/corners.js.map +1 -0
- package/dist/components/modules/flow.d.ts +26 -0
- package/dist/components/modules/flow.d.ts.map +1 -0
- package/dist/components/modules/flow.js +57 -0
- package/dist/components/modules/flow.js.map +1 -0
- package/dist/components/modules/material.d.ts +40 -0
- package/dist/components/modules/material.d.ts.map +1 -0
- package/dist/components/modules/material.js +75 -0
- package/dist/components/modules/material.js.map +1 -0
- package/dist/components/modules/paint.d.ts +71 -0
- package/dist/components/modules/paint.d.ts.map +1 -0
- package/dist/components/modules/paint.js +106 -0
- package/dist/components/modules/paint.js.map +1 -0
- package/dist/components/modules/shapes.d.ts +31 -0
- package/dist/components/modules/shapes.d.ts.map +1 -0
- package/dist/components/modules/shapes.js +43 -0
- package/dist/components/modules/shapes.js.map +1 -0
- package/dist/components/modules/text-layout.d.ts +26 -0
- package/dist/components/modules/text-layout.d.ts.map +1 -0
- package/dist/components/modules/text-layout.js +57 -0
- package/dist/components/modules/text-layout.js.map +1 -0
- package/dist/components/modules/text-style.d.ts +48 -0
- package/dist/components/modules/text-style.d.ts.map +1 -0
- package/dist/components/modules/text-style.js +63 -0
- package/dist/components/modules/text-style.js.map +1 -0
- package/dist/components/modules/three-entries.d.ts +23 -0
- package/dist/components/modules/three-entries.d.ts.map +1 -0
- package/dist/components/modules/three-entries.js +41 -0
- package/dist/components/modules/three-entries.js.map +1 -0
- package/dist/components/modules/view3d.d.ts +59 -0
- package/dist/components/modules/view3d.d.ts.map +1 -0
- package/dist/components/modules/view3d.js +171 -0
- package/dist/components/modules/view3d.js.map +1 -0
- package/dist/components/trees/2d/group-bounds.d.ts +56 -0
- package/dist/components/trees/2d/group-bounds.d.ts.map +1 -0
- package/dist/components/trees/2d/group-bounds.js +87 -0
- package/dist/components/trees/2d/group-bounds.js.map +1 -0
- package/dist/components/trees/2d/node-lifecycle.d.ts +46 -0
- package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -0
- package/dist/components/trees/2d/node-lifecycle.js +264 -0
- package/dist/components/trees/2d/node-lifecycle.js.map +1 -0
- package/dist/components/trees/2d/node-motion.d.ts +56 -0
- package/dist/components/trees/2d/node-motion.d.ts.map +1 -0
- package/dist/components/trees/2d/node-motion.js +86 -0
- package/dist/components/trees/2d/node-motion.js.map +1 -0
- package/dist/components/trees/2d/node-render.d.ts +36 -0
- package/dist/components/trees/2d/node-render.d.ts.map +1 -0
- package/dist/components/trees/2d/node-render.js +67 -0
- package/dist/components/trees/2d/node-render.js.map +1 -0
- package/dist/components/trees/2d/node-space.d.ts +63 -0
- package/dist/components/trees/2d/node-space.d.ts.map +1 -0
- package/dist/components/trees/2d/node-space.js +131 -0
- package/dist/components/trees/2d/node-space.js.map +1 -0
- package/dist/components/trees/2d/node-transform.d.ts +55 -0
- package/dist/components/trees/2d/node-transform.d.ts.map +1 -0
- package/dist/components/trees/2d/node-transform.js +73 -0
- package/dist/components/trees/2d/node-transform.js.map +1 -0
- package/dist/components/trees/2d/node2d.d.ts +1020 -0
- package/dist/components/trees/2d/node2d.d.ts.map +1 -0
- package/dist/components/trees/2d/node2d.js +1481 -0
- package/dist/components/trees/2d/node2d.js.map +1 -0
- package/dist/components/trees/audio/index.d.ts +2 -0
- package/dist/components/trees/audio/index.d.ts.map +1 -0
- package/dist/components/trees/audio/index.js +2 -0
- package/dist/components/trees/audio/index.js.map +1 -0
- package/dist/components/trees/audio/node-audio.d.ts +109 -0
- package/dist/components/trees/audio/node-audio.d.ts.map +1 -0
- package/dist/components/trees/audio/node-audio.js +167 -0
- package/dist/components/trees/audio/node-audio.js.map +1 -0
- package/dist/components/trees/index.d.ts +10 -0
- package/dist/components/trees/index.d.ts.map +1 -0
- package/dist/components/trees/index.js +14 -0
- package/dist/components/trees/index.js.map +1 -0
- package/dist/components/trees/node/node-editor-state.d.ts +53 -0
- package/dist/components/trees/node/node-editor-state.d.ts.map +1 -0
- package/dist/components/trees/node/node-editor-state.js +23 -0
- package/dist/components/trees/node/node-editor-state.js.map +1 -0
- package/dist/components/trees/node/node-reactive.d.ts +89 -0
- package/dist/components/trees/node/node-reactive.d.ts.map +1 -0
- package/dist/components/trees/node/node-reactive.js +135 -0
- package/dist/components/trees/node/node-reactive.js.map +1 -0
- package/dist/components/trees/node/node-time.d.ts +39 -0
- package/dist/components/trees/node/node-time.d.ts.map +1 -0
- package/dist/components/trees/node/node-time.js +14 -0
- package/dist/components/trees/node/node-time.js.map +1 -0
- package/dist/components/trees/node/node-walk.d.ts +46 -0
- package/dist/components/trees/node/node-walk.d.ts.map +1 -0
- package/dist/components/trees/node/node-walk.js +74 -0
- package/dist/components/trees/node/node-walk.js.map +1 -0
- package/dist/components/trees/node/node.d.ts +401 -0
- package/dist/components/trees/node/node.d.ts.map +1 -0
- package/dist/components/trees/node/node.js +680 -0
- package/dist/components/trees/node/node.js.map +1 -0
- package/dist/components/trees/root/canvas2d-node.d.ts +163 -0
- package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -0
- package/dist/components/trees/root/canvas2d-node.js +216 -0
- package/dist/components/trees/root/canvas2d-node.js.map +1 -0
- package/dist/components/trees/three/node3d.d.ts +222 -0
- package/dist/components/trees/three/node3d.d.ts.map +1 -0
- package/dist/components/trees/three/node3d.js +289 -0
- package/dist/components/trees/three/node3d.js.map +1 -0
- package/dist/document/builtins.js +13 -13
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +2 -2
- package/dist/document/command-traits.js +1 -1
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.d.ts +2 -2
- package/dist/document/deny-globals.js +2 -2
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/expression/index.d.ts +1 -1
- package/dist/document/expression/index.js +1 -1
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.js +1 -1
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/index.d.ts +1 -2
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/index.js +1 -2
- package/dist/document/index.js.map +1 -1
- package/dist/document/node-decorator.d.ts +14 -10
- package/dist/document/node-decorator.d.ts.map +1 -1
- package/dist/document/node-decorator.js +14 -10
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.d.ts +3 -3
- package/dist/document/node-descriptor.d.ts.map +1 -1
- package/dist/document/node-descriptor.js.map +1 -1
- package/dist/document/registry.d.ts +23 -25
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +12 -18
- package/dist/document/registry.js.map +1 -1
- package/dist/document/timeline.d.ts +3 -3
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +2 -2
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +4 -4
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +1 -1
- package/dist/document/validate.js.map +1 -1
- package/dist/experimental.d.ts +19 -19
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.js +17 -17
- package/dist/experimental.js.map +1 -1
- package/dist/index.d.ts +10 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -11
- package/dist/index.js.map +1 -1
- package/dist/layout/types.d.ts +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/props/host.d.ts +1 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/slot.d.ts +1 -1
- package/dist/props/slot.js +1 -1
- package/dist/props/slot.js.map +1 -1
- package/dist/render/clip.d.ts +1 -1
- package/dist/render/clip.js +1 -1
- package/dist/render/clip.js.map +1 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/text.d.ts +11 -5
- package/dist/render/descriptors/text.d.ts.map +1 -1
- package/dist/render/descriptors/text.js +7 -1
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/render-context2d.d.ts +2 -2
- package/dist/render/render-context2d.js.map +1 -1
- package/dist/render3d/builders.d.ts +1 -1
- package/dist/render3d/builders.js +1 -1
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts +13 -19
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +13 -19
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/scene3d.d.ts +1 -1
- package/dist/render3d/scene3d.js +1 -1
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/texture.d.ts +2 -2
- package/dist/render3d/texture.d.ts.map +1 -1
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/vector3.d.ts +2 -2
- package/dist/render3d/vector3.js +2 -2
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/runtime/asset-refine.d.ts +1 -1
- package/dist/runtime/asset-refine.d.ts.map +1 -1
- package/dist/runtime/asset-refine.js +1 -1
- package/dist/runtime/asset-refine.js.map +1 -1
- package/dist/runtime/asset-update.js +1 -1
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.d.ts +0 -11
- package/dist/runtime/audio-index.d.ts.map +1 -1
- package/dist/runtime/audio-index.js +0 -25
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +3 -3
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +4 -4
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +2 -3
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +17 -35
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +3 -3
- package/dist/runtime/engine.js +2 -2
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/node-picking.d.ts +2 -2
- package/dist/runtime/node-picking.d.ts.map +1 -1
- package/dist/runtime/node-picking.js +3 -3
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +2 -2
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +1 -1
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts +2 -2
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +1 -1
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/state-evaluator.d.ts +2 -2
- package/dist/runtime/state-evaluator.d.ts.map +1 -1
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.d.ts +1 -1
- package/dist/runtime/text-geometry.d.ts.map +1 -1
- package/dist/runtime/text-geometry.js +4 -5
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +43 -39
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +24 -25
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +7 -9
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js +2 -2
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.d.ts +1 -1
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/index.d.ts +2 -1
- package/dist/tween/index.d.ts.map +1 -1
- package/dist/tween/index.js +1 -1
- package/dist/tween/index.js.map +1 -1
- package/dist/tween/loop.d.ts +1 -1
- package/dist/tween/loop.js +1 -1
- package/dist/tween/loop.js.map +1 -1
- package/dist/util/reference.d.ts +6 -6
- package/dist/util/reference.js.map +1 -1
- package/package.json +2 -10
- package/dist/browser/chunks/chunk-2RIYH36X.js +0 -3
- package/dist/browser/chunks/chunk-2RIYH36X.js.map +0 -7
- package/dist/browser/chunks/chunk-DDJN3QII.js +0 -15
- package/dist/browser/chunks/chunk-DDJN3QII.js.map +0 -7
- package/dist/browser/chunks/chunk-DHB4COFY.js +0 -2
- package/dist/browser/chunks/chunk-EJDPYDQI.js +0 -5
- package/dist/browser/chunks/chunk-EJDPYDQI.js.map +0 -7
- package/dist/browser/chunks/chunk-SFNJRPBV.js +0 -2
- package/dist/browser/chunks/chunk-SFNJRPBV.js.map +0 -7
- package/dist/browser/chunks/chunk-XAWE4EAK.js +0 -2
- package/dist/browser/chunks/chunk-XAWE4EAK.js.map +0 -7
- package/dist/browser/jsx-jsx-dev-runtime.js +0 -2
- package/dist/browser/jsx-jsx-dev-runtime.js.map +0 -7
- package/dist/browser/jsx-jsx-runtime.js +0 -2
- package/dist/browser/jsx-jsx-runtime.js.map +0 -7
|
@@ -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,GAAG,IAAI,CAAC,WAA8C,CAAC;QACjE,OAAO,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAC5C,CAAC;IAED,uEAAuE;IAEvE,8BAA8B;IAC9B,IAAI,CAAC,OAAmC;QACpC,MAAM,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACnD,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;I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;;;;;;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 in Skia format. */\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 (Skia format). */\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 /** @deprecated Use {@link AdjustmentChain.shader}. */\r\n sksl(options: AsFilterOptions<Omit<ShaderEffectOptions, \"source\"> & { shader: string }>) {\r\n return this.append(fromEffect(new EffectChain().sksl(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,CAAC,CAAC,CAAc,CAAC;AACtC,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,OAA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ACH,MAAM,OAAO,oBAAqB,SAAQ,eAAe;IACrD,yEAAyE;IACzE,aAAa,CAAC,OAA4C;QACtD,MAAM,EAAE,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\";\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 in Skia format. */\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 (Skia format). */\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 /** @deprecated Use {@link AdjustmentChain.shader}. */\r\n sksl(options: AsFilterOptions<Omit<ShaderEffectOptions, \"source\"> & { shader: string }>) {\r\n return this.append(fromEffect(new EffectChain().sksl(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"]}
|
|
@@ -53,9 +53,10 @@ type NonFilterEffect = MagnifyEffect | GlassEffect | MotionBlurEffect | OutlineE
|
|
|
53
53
|
* This is what lets a background image be oil-painted, dithered or posterized
|
|
54
54
|
* without wrapping it in a node whose effect would also hit its children:
|
|
55
55
|
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
56
|
+
* Rect({
|
|
57
|
+
* fill: Fills.image('bg.jpg', { filters: Adjustments.oilPaint(4) }),
|
|
58
|
+
* children: [Text({ text: "still sharp" })],
|
|
59
|
+
* })
|
|
59
60
|
*
|
|
60
61
|
* The effects carry a `mode` field that means nothing here (a fill has no
|
|
61
62
|
* backdrop); the {@link VideoAdjustmentChain} builders drop it, and the renderer ignores
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"union.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/filters/union.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,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 @@
|
|
|
1
|
-
{"version":3,"file":"union.js","sourceRoot":"","sources":["../../../../src/attributes/shape/filters/union.ts"],"names":[],"mappings":"","sourcesContent":["import type { AlphaFilter } from \"./implementations/alpha\";\r\nimport type { BlurFilter } from \"./implementations/blur\";\r\nimport type { ColorAdjustmentFilter } from \"./implementations/color-adjustment\";\r\nimport type { ColorMatrixFilter } from \"./implementations/color-matrix\";\r\nimport type { CurvesFilter } from \"./implementations/curves\";\r\nimport type { ExposureFilter } from \"./implementations/exposure\";\r\nimport type { GrayscaleFilter } from \"./implementations/grayscale\";\r\nimport type { PosterizeTimeFilter } from \"./implementations/posterize-time\";\r\nimport type { VideoEchoFilter } from \"./implementations/echo\";\r\n\r\nimport type { NodeEffect } from \"../effects/union\";\r\nimport type { BlurEffect } from \"../effects/implementations/blur\";\r\nimport type { GrayscaleEffect } from \"../effects/implementations/grayscale\";\r\nimport type { CurvesEffect } from \"../effects/implementations/curves\";\r\nimport type { ColorAdjustmentEffect } from \"../effects/implementations/color-adjustment\";\r\nimport type { MagnifyEffect } from \"../effects/implementations/magnify\";\r\nimport type { MotionBlurEffect } from \"../effects/implementations/motion-blur\";\r\nimport type { OutlineEffect } from \"../effects/implementations/outline\";\r\nimport type { DropShadowEffect } from \"@/attributes/shape/effects/implementations/drop-shadow\";\r\nimport type { GlowEffect } from \"../effects/implementations/glow\";\r\nimport type { GlassEffect } from \"../effects/implementations/glass\";\r\n\r\n/**\r\n * The node effects that are **not** media filters, and why.\r\n *\r\n * Everything else in {@link NodeEffect} is a function of the pixels it is\r\n * given, so it means exactly the same thing applied to a node's rendered\r\n * content or to one fill layer's own pixels — and the renderer already runs\r\n * both through a single handler registry. This is the exception list, so a new\r\n * effect becomes a filter by default rather than by remembering to add it.\r\n *\r\n * Two reasons land here:\r\n *\r\n * - **Needs something a fill layer doesn't have.** `magnify` and `glass` sample\r\n * the backdrop beneath the node — glass is a slab you see *through*, and a\r\n * node's own paint is not something there is anything behind; `motionBlur` and\r\n * `trails` are derived from the node's sampled velocity. A fill has no\r\n * backdrop and no motion of its own.\r\n * - **Draws outside the silhouette.** `outline` paints a ring around the\r\n * content, which the shape path a fill is clipped to would cut away, and\r\n * `glow` bleeds past it in every direction — a glow clipped to the thing that\r\n * cast it is not a dimmer glow, it is no glow at all. (`bloom` stays: it is\r\n * the contained version of the same idea, which is what makes it the right\r\n * one to reach for on a fill.)\r\n *\r\n * `blur`, `grayscale`, `curves` and `colorAdjustment` are excluded for a third,\r\n * bookkeeping reason: they already have a dedicated filter type below, sharing\r\n * the same fields and the same renderer handler.\r\n */\r\ntype NonFilterEffect =\r\n | MagnifyEffect\r\n | GlassEffect\r\n | MotionBlurEffect\r\n | OutlineEffect\r\n | DropShadowEffect\r\n | GlowEffect\r\n | BlurEffect\r\n | GrayscaleEffect\r\n | CurvesEffect\r\n | ColorAdjustmentEffect;\r\n\r\n/**\r\n * Node effects usable as a media filter — i.e. applied to one image/video\r\n * fill's own pixels rather than to a node and everything under it.\r\n *\r\n * This is what lets a background image be oil-painted, dithered or posterized\r\n * without wrapping it in a node whose effect would also hit its children:\r\n *\r\n *
|
|
1
|
+
{"version":3,"file":"union.js","sourceRoot":"","sources":["../../../../src/attributes/shape/filters/union.ts"],"names":[],"mappings":"","sourcesContent":["import type { AlphaFilter } from \"./implementations/alpha\";\r\nimport type { BlurFilter } from \"./implementations/blur\";\r\nimport type { ColorAdjustmentFilter } from \"./implementations/color-adjustment\";\r\nimport type { ColorMatrixFilter } from \"./implementations/color-matrix\";\r\nimport type { CurvesFilter } from \"./implementations/curves\";\r\nimport type { ExposureFilter } from \"./implementations/exposure\";\r\nimport type { GrayscaleFilter } from \"./implementations/grayscale\";\r\nimport type { PosterizeTimeFilter } from \"./implementations/posterize-time\";\r\nimport type { VideoEchoFilter } from \"./implementations/echo\";\r\n\r\nimport type { NodeEffect } from \"../effects/union\";\r\nimport type { BlurEffect } from \"../effects/implementations/blur\";\r\nimport type { GrayscaleEffect } from \"../effects/implementations/grayscale\";\r\nimport type { CurvesEffect } from \"../effects/implementations/curves\";\r\nimport type { ColorAdjustmentEffect } from \"../effects/implementations/color-adjustment\";\r\nimport type { MagnifyEffect } from \"../effects/implementations/magnify\";\r\nimport type { MotionBlurEffect } from \"../effects/implementations/motion-blur\";\r\nimport type { OutlineEffect } from \"../effects/implementations/outline\";\r\nimport type { DropShadowEffect } from \"@/attributes/shape/effects/implementations/drop-shadow\";\r\nimport type { GlowEffect } from \"../effects/implementations/glow\";\r\nimport type { GlassEffect } from \"../effects/implementations/glass\";\r\n\r\n/**\r\n * The node effects that are **not** media filters, and why.\r\n *\r\n * Everything else in {@link NodeEffect} is a function of the pixels it is\r\n * given, so it means exactly the same thing applied to a node's rendered\r\n * content or to one fill layer's own pixels — and the renderer already runs\r\n * both through a single handler registry. This is the exception list, so a new\r\n * effect becomes a filter by default rather than by remembering to add it.\r\n *\r\n * Two reasons land here:\r\n *\r\n * - **Needs something a fill layer doesn't have.** `magnify` and `glass` sample\r\n * the backdrop beneath the node — glass is a slab you see *through*, and a\r\n * node's own paint is not something there is anything behind; `motionBlur` and\r\n * `trails` are derived from the node's sampled velocity. A fill has no\r\n * backdrop and no motion of its own.\r\n * - **Draws outside the silhouette.** `outline` paints a ring around the\r\n * content, which the shape path a fill is clipped to would cut away, and\r\n * `glow` bleeds past it in every direction — a glow clipped to the thing that\r\n * cast it is not a dimmer glow, it is no glow at all. (`bloom` stays: it is\r\n * the contained version of the same idea, which is what makes it the right\r\n * one to reach for on a fill.)\r\n *\r\n * `blur`, `grayscale`, `curves` and `colorAdjustment` are excluded for a third,\r\n * bookkeeping reason: they already have a dedicated filter type below, sharing\r\n * the same fields and the same renderer handler.\r\n */\r\ntype NonFilterEffect =\r\n | MagnifyEffect\r\n | GlassEffect\r\n | MotionBlurEffect\r\n | OutlineEffect\r\n | DropShadowEffect\r\n | GlowEffect\r\n | BlurEffect\r\n | GrayscaleEffect\r\n | CurvesEffect\r\n | ColorAdjustmentEffect;\r\n\r\n/**\r\n * Node effects usable as a media filter — i.e. applied to one image/video\r\n * fill's own pixels rather than to a node and everything under it.\r\n *\r\n * This is what lets a background image be oil-painted, dithered or posterized\r\n * without wrapping it in a node whose effect would also hit its children:\r\n *\r\n * Rect({\r\n * fill: Fills.image('bg.jpg', { filters: Adjustments.oilPaint(4) }),\r\n * children: [Text({ text: \"still sharp\" })],\r\n * })\r\n *\r\n * The effects carry a `mode` field that means nothing here (a fill has no\r\n * backdrop); the {@link VideoAdjustmentChain} builders drop it, and the renderer ignores\r\n * it on this path.\r\n */\r\nexport type EffectAdjustment = Exclude<NodeEffect, NonFilterEffect>;\r\n\r\n/**\r\n * Discriminated union of pixel filters — the filters valid on both image and\r\n * video fills. Each is realised either as a single CanvasKit image filter\r\n * applied via `paint.setImageFilter`, or — for the ones that resample pixel\r\n * *positions* — as a lens shader wrapping the fill's own shader.\r\n */\r\nexport type MediaAdjustment =\r\n | ExposureFilter\r\n | BlurFilter\r\n | GrayscaleFilter\r\n | AlphaFilter\r\n | ColorMatrixFilter\r\n | CurvesFilter\r\n | ColorAdjustmentFilter\r\n | EffectAdjustment;\r\n\r\n/**\r\n * Discriminated union of video-only filters — temporal/multi-frame effects that\r\n * are meaningless on a still image (a single frame has no time axis and no\r\n * previous frames). Consumed outside the pixel `setImageFilter` path.\r\n */\r\nexport type VideoOnlyAdjustment =\r\n | PosterizeTimeFilter\r\n | VideoEchoFilter;\r\n"]}
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
* carries the rest, which is the repo's existing shape for an attribute whose
|
|
6
6
|
* operations go past interpolation — `insetsOps` is `AttributeOps & InsetsOps`,
|
|
7
7
|
* `alignmentOps` is `AttributeOps & AlignmentOps`, `cornerRadiusOps` the same.
|
|
8
|
-
*
|
|
9
|
-
* addition.
|
|
8
|
+
* Every `Types.path` entry is untouched by the addition.
|
|
10
9
|
*
|
|
11
10
|
* Behind it is **one** pen walk. There were seven — one each in `bounds`,
|
|
12
11
|
* `length`, `dash`, `sampler`, `subpath`, `morph` and the editor's vector model
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ops.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/path/ops.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ops.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/path/ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AASlE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGvH,+DAA+D;AAC/D,MAAM,WAAW,OAAO;IAEpB,gFAAgF;IAChF,QAAQ,CAAC,CAAC,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,GAAG,WAAW,EAAE,CAAC;IACxD,6EAA6E;IAC7E,QAAQ,CAAC,CAAC,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,GAAG,WAAW,EAAE,CAAC;IACxD,6EAA6E;IAC7E,MAAM,CAAC,CAAC,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,GAAG,YAAY,EAAE,CAAC;IACvD,sEAAsE;IACtE,OAAO,CAAC,CAAC,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,GAAG,UAAU,CAAC;IAGpD,mEAAmE;IACnE,MAAM,CAAC,CAAC,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,GAAG,IAAI,CAAC;IACvD,2DAA2D;IAC3D,IAAI,CAAC,CAAC,EAAE,QAAQ,GAAG,IAAI,GAAG,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GAAG,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,OAAO,GAAG,UAAU,CAAC;IAC/D,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,GAAG,UAAU,CAAC;IACxD,8EAA8E;IAC9E,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,GAAG,CAAC,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;IAC3E,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC;IAGnC,kDAAkD;IAClD,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,iBAAiB,CAAC;IAC/C,qFAAqF;IACrF,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,GAAG,iBAAiB,CAAC;IAC5D,6EAA6E;IAC7E,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9D,0EAA0E;IAC1E,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,UAAU,CAAC;QAAC,MAAM,EAAE,UAAU,CAAC;QAAC,EAAE,EAAE,UAAU,CAAA;KAAE,CAAC;CAChH;AAGD,eAAO,MAAM,OAAO,EAAE,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,OAkCxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ops.js","sourceRoot":"","sources":["../../../../src/attributes/shape/path/ops.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ops.js","sourceRoot":"","sources":["../../../../src/attributes/shape/path/ops.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EACH,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EACpE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,GACrD,MAAM,WAAW,CAAC;AAoEnB,MAAM,CAAC,MAAM,OAAO,GAA+C;IAC/D,6DAA6D;IAC7D,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;IACzB,IAAI;IAEJ,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,OAAO;IAEP,MAAM;IACN,IAAI;IACJ,MAAM;IACN,OAAO;IAEP,IAAI;IACJ,IAAI;IACJ,SAAS;IAET,IAAI;IACJ,MAAM;IAEN,WAAW;IACX,cAAc;IACd,YAAY;IACZ,GAAG;IACH,SAAS;IACT,MAAM;IACN,OAAO;IAEP,SAAS;IACT,QAAQ;IACR,OAAO;IACP,KAAK;CACR,CAAC","sourcesContent":["/**\r\n * Every path-geometry operation, on one object.\r\n *\r\n * `pathOps` was already the path attribute's `resolve`/`lerp` pair; it now\r\n * carries the rest, which is the repo's existing shape for an attribute whose\r\n * operations go past interpolation — `insetsOps` is `AttributeOps & InsetsOps`,\r\n * `alignmentOps` is `AttributeOps & AlignmentOps`, `cornerRadiusOps` the same.\r\n * Every `Types.path` entry is untouched by the addition.\r\n *\r\n * Behind it is **one** pen walk. There were seven — one each in `bounds`,\r\n * `length`, `dash`, `sampler`, `subpath`, `morph` and the editor's vector model\r\n * — and they disagreed about where `Z` leaves the cursor, which control point an\r\n * `S`/`T` reflects, and what an arc is. The pipeline is now:\r\n *\r\n * PathData ── commands ──▶ PathCommand[] ── contours ──▶ PathContour[]\r\n * │\r\n * bounds · size · length · sampler · dash · trim ◀─────┤\r\n * cubics ── morph ◀──────────┤\r\n * anchors ── editing ◀────────┘\r\n *\r\n * `cubics` and `anchors` are the only two places geometry is flattened to a\r\n * single curve type, because a morph needs one segment kind to pair up and\r\n * nobody can drag an arc's handles. Everything that measures keeps the arc.\r\n *\r\n * Each method is the module function of the same name, so a call site and its\r\n * implementation are one grep apart.\r\n */\r\nimport { PathCommand, PathData } from \"@/render/descriptors/path\";\r\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\r\n\r\nimport { bounds, commands, contours, size } from \"./walk\";\r\nimport { dash, dashScale, length, sampler, trim } from \"./measure\";\r\nimport { cubics, lerp, plan, sample } from \"./morph\";\r\nimport {\r\n anchorBounds, anchorCommands, anchors, endFit, fitToBox, fromAnchors,\r\n isEmpty, map, normalize, pointOn, split, translate,\r\n} from \"./anchors\";\r\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport type { Extents } from \"@/layout/bounds\";\r\nimport { PathContour, CubicSubpath, VectorPath, PathSampler, MorphPlan, PathNormalization, PathAnchor } from \"./types\";\r\n\r\n\r\n/** The path attribute's operations beyond `resolve`/`lerp`. */\r\nexport interface PathOps {\r\n // ── Reading ────────────────────────────────────────────────────────────\r\n /** Parse. A `PathCommand[]` passes through by reference; nullish gives `[]`. */\r\n commands(d: PathData | null | undefined): PathCommand[];\r\n /** The normal form: absolute, shorthands expanded, grouped into contours. */\r\n contours(d: PathData | null | undefined): PathContour[];\r\n /** All-cubic form. Lossy for arcs — one of the two flattening boundaries. */\r\n cubics(d: PathData | null | undefined): CubicSubpath[];\r\n /** The editable anchor model. Lossy for arcs — the other boundary. */\r\n anchors(d: PathData | null | undefined): VectorPath;\r\n\r\n // ── Measuring ──────────────────────────────────────────────────────────\r\n /** Tight box: each segment's own extrema, not its control hull. */\r\n bounds(d: PathData | null | undefined): Extents | null;\r\n /** {@link bounds} as a size; `0 x 0` for an empty path. */\r\n size(d: PathData | null | undefined): { width: number; height: number };\r\n /** Total arc length. An arc is measured along the arc, not across its chord. */\r\n length(d: PathData | null | undefined): number;\r\n /** Point and unit tangent at a distance along the path. */\r\n sampler(d: PathData): PathSampler;\r\n\r\n // ── Rewriting ──────────────────────────────────────────────────────────\r\n /** The portion between two arc-length fractions. Works on strings. */\r\n trim(d: PathData, start: number, end: number): PathData;\r\n /** Only the \"on\" runs of a dash pattern, fit as the renderer fits it, as a `d` string. */\r\n dash(d: PathData | null | undefined, pattern: number[], offset?: number): string;\r\n /** How far a pattern is stretched to fit one contour of a path — see `dash`. */\r\n dashScale(pattern: number[], contour: { length: number; closed: boolean }, total: number): number | null;\r\n\r\n // ── Morphing ───────────────────────────────────────────────────────────\r\n /** A reusable correspondence between two paths. Expensive; `lerp` caches one. */\r\n plan(from: PathCommand[], to: PathCommand[]): MorphPlan;\r\n /** Sample a plan at `t`. Cheap. */\r\n sample(plan: MorphPlan, t: number): PathCommand[];\r\n\r\n // ── The anchor model ───────────────────────────────────────────────────\r\n /** Anchors back to a `d` string. Emits only `M`/`L`/`C`/`Z`. */\r\n fromAnchors(path: VectorPath): string;\r\n /** Anchors to commands, with a transform folded into the same pass. */\r\n anchorCommands(path: VectorPath, transform?: (p: Vector2) => Vector2): PathCommand[];\r\n /** Tight box of an anchor path. */\r\n anchorBounds(path: VectorPath): Extents | null;\r\n /** Every point and handle mapped. */\r\n map(path: VectorPath, fn: (p: Vector2) => Vector2): VectorPath;\r\n translate(path: VectorPath, delta: Vector2): VectorPath;\r\n /** The turn-and-scale about `start` carrying `end` onto `to` — a `map` fn. */\r\n endFit(start: Vector2, end: Vector2, to: Vector2): (p: Vector2) => Vector2;\r\n isEmpty(path: VectorPath): boolean;\r\n\r\n // ── The unit box ───────────────────────────────────────────────────────\r\n /** Re-quote against the geometry's own bounds. */\r\n normalize(path: VectorPath): PathNormalization;\r\n /** Re-quote against a stated box — the general form of {@link PathOps.normalize}. */\r\n fitToBox(path: VectorPath, box: Extents): PathNormalization;\r\n /** A point on the segment between two anchors, for hit-testing an insert. */\r\n pointOn(from: PathAnchor, to: PathAnchor, t: number): Vector2;\r\n /** De Casteljau split, so inserting an anchor does not move the curve. */\r\n split(from: PathAnchor, to: PathAnchor, t: number): { from: PathAnchor; middle: PathAnchor; to: PathAnchor };\r\n}\r\n\r\n\r\nexport const pathOps: AttributeOps<PathData, PathData> & PathOps = {\r\n // An SVG path string or command list needs no normalization.\r\n resolve: (value) => value,\r\n lerp,\r\n\r\n commands,\r\n contours,\r\n cubics,\r\n anchors,\r\n\r\n bounds,\r\n size,\r\n length,\r\n sampler,\r\n\r\n trim,\r\n dash,\r\n dashScale,\r\n\r\n plan,\r\n sample,\r\n\r\n fromAnchors,\r\n anchorCommands,\r\n anchorBounds,\r\n map,\r\n translate,\r\n endFit,\r\n isEmpty,\r\n\r\n normalize,\r\n fitToBox,\r\n pointOn,\r\n split,\r\n};\r\n"]}
|
|
@@ -4,9 +4,9 @@ import type { RectCornerRadius, CornerRadiusResolved } from "../../attributes/sh
|
|
|
4
4
|
* The mapper + lerp pair behind every tweenable attribute: `resolve` turns loose
|
|
5
5
|
* author input (a CSS string, a shorthand object, a previously-resolved value)
|
|
6
6
|
* into the strict `TResolved` a renderer reads, and `lerp` interpolates between
|
|
7
|
-
* two resolved values. This is the same pair
|
|
7
|
+
* two resolved values. This is the same pair `property`'s `mapper`/`tween`
|
|
8
8
|
* options take — see `attributes/properties/typed.ts`, which builds each
|
|
9
|
-
*
|
|
9
|
+
* `xProperty()` directly from one of these.
|
|
10
10
|
*/
|
|
11
11
|
export interface AttributeOps<TInput, TResolved> {
|
|
12
12
|
resolve(value: TInput, previous?: TResolved): TResolved;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operators.js","sourceRoot":"","sources":["../../../src/attributes/shared/operators.ts"],"names":[],"mappings":"","sourcesContent":["import type { LerpFunction } from \"@/tween/lerp\";\r\nimport type { RectCornerRadius, CornerRadiusResolved } from \"@/attributes/shape/corners/corner-radius\";\r\n\r\n/**\r\n * The mapper + lerp pair behind every tweenable attribute: `resolve` turns loose\r\n * author input (a CSS string, a shorthand object, a previously-resolved value)\r\n * into the strict `TResolved` a renderer reads, and `lerp` interpolates between\r\n * two resolved values. This is the same pair
|
|
1
|
+
{"version":3,"file":"operators.js","sourceRoot":"","sources":["../../../src/attributes/shared/operators.ts"],"names":[],"mappings":"","sourcesContent":["import type { LerpFunction } from \"@/tween/lerp\";\r\nimport type { RectCornerRadius, CornerRadiusResolved } from \"@/attributes/shape/corners/corner-radius\";\r\n\r\n/**\r\n * The mapper + lerp pair behind every tweenable attribute: `resolve` turns loose\r\n * author input (a CSS string, a shorthand object, a previously-resolved value)\r\n * into the strict `TResolved` a renderer reads, and `lerp` interpolates between\r\n * two resolved values. This is the same pair `property`'s `mapper`/`tween`\r\n * options take — see `attributes/properties/typed.ts`, which builds each\r\n * `xProperty()` directly from one of these.\r\n */\r\nexport interface AttributeOps<TInput, TResolved> {\r\n resolve(value: TInput, previous?: TResolved): TResolved;\r\n lerp: LerpFunction<TResolved>;\r\n}\r\n\r\n/** An attribute whose resolved value can collapse to one value shared by every component. */\r\nexport interface HasUniformCheck<TInput, T> {\r\n isUniformInput(value: TInput): boolean;\r\n isUniform(value: T): boolean;\r\n}\r\n\r\n/** An attribute whose resolved value can be entirely zero. */\r\nexport interface HasZeroCheck<TResolved> {\r\n isZero(value: TResolved): boolean;\r\n}\r\n\r\n/** The corner-radius attribute's full op set — see `shape/corners/corner-radius.ts`. */\r\nexport type CornerRadiusOps = AttributeOps<RectCornerRadius, CornerRadiusResolved>\r\n & HasUniformCheck<RectCornerRadius, CornerRadiusResolved>\r\n & HasZeroCheck<CornerRadiusResolved>;\r\n"]}
|
|
@@ -49,9 +49,8 @@ export interface ResolvedTextSpan {
|
|
|
49
49
|
stroke: StrokeResolved[];
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
* A stretch of a `Text` node's string set apart from the rest
|
|
53
|
-
* the string
|
|
54
|
-
* end)` are offsets into the string; an absent field is the node's own.
|
|
52
|
+
* A stretch of a `Text` node's string set apart from the rest. `[start, end)`
|
|
53
|
+
* are offsets into the string; an absent field is the node's own.
|
|
55
54
|
*/
|
|
56
55
|
export interface TextRun {
|
|
57
56
|
start: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/attributes/text/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE/D,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,KAAK,CAAC;AAElF,iEAAiE;AACjE,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAExD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,WAAW,GAAG,cAAc,CAAC;AAEnE,wFAAwF;AACxF,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAE5D,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAExD;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IAC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AAM,WAAW,SAAS;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,sEAAsE;AACtE,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,SAAS,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/attributes/text/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Every type the text attribute names, in one place.\r\n *\r\n * A `TextSpan` is what an author writes and a `ResolvedTextSpan` what a renderer\r\n * reads. A `TextStyle` is the partial style every source of text defaults speaks —\r\n * `<DefaultTextStyle>`, a `variant` preset, `theme.typography`.\r\n */\r\nimport type { Fill } from \"@/attributes/shape/fill/chain\";\r\nimport type { FillResolved } from \"@/attributes/shape/fill/union\";\r\nimport type { Stroke, StrokeResolved } from \"@/attributes/shape/stroke/stroke\";\r\nimport type { Shadow } from \"@/attributes/shape/shadow/shadow\";\r\n\r\nexport type TextAlign = 'left' | 'right' | 'center' | 'justify' | 'start' | 'end';\r\n\r\n/** Where a block shorter (or taller) than its box sits in it. */\r\nexport type VerticalAlign = 'top' | 'center' | 'bottom';\r\n\r\nexport type TextDecoration = 'none' | 'underline' | 'line-through';\r\n\r\n/** `'title'` capitalises the first letter of each word and leaves the rest as typed. */\r\nexport type TextCase = 'none' | 'upper' | 'lower' | 'title';\r\n\r\nexport type FontStyle = 'normal' | 'italic' | 'oblique';\r\n\r\n/**\r\n * A styled run of text. Spans may nest — children inherit any style fields\r\n * the parent set and override the ones they redeclare (Flutter-style\r\n * TextSpan). A span with `children` and no `text` acts as a pure style\r\n * scope; a span with both contributes its `text` before its children.\r\n */\r\nexport interface TextSpan {\r\n text?: string;\r\n fontFamily?: string;\r\n fontSize?: number;\r\n fontWeight?: number;\r\n fontStyle?: FontStyle;\r\n letterSpacing?: number;\r\n fill?: Fill;\r\n stroke?: Stroke;\r\n children?: TextSpan[];\r\n}\r\n\r\n/**\r\n * A span flattened against its parents — every style field is concrete and\r\n * fills/strokes are resolved. Newlines in `text` are preserved; the renderer\r\n * splits on `\\n` to lay out lines.\r\n */\r\nexport interface ResolvedTextSpan {\r\n text: string;\r\n fontFamily: string;\r\n fontSize: number;\r\n fontWeight: number;\r\n fontStyle: FontStyle;\r\n letterSpacing: number;\r\n fill: FillResolved[];\r\n stroke: StrokeResolved[];\r\n}\r\n\r\n/**\r\n * A stretch of a `Text` node's string set apart from the rest
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/attributes/text/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Every type the text attribute names, in one place.\r\n *\r\n * A `TextSpan` is what an author writes and a `ResolvedTextSpan` what a renderer\r\n * reads. A `TextStyle` is the partial style every source of text defaults speaks —\r\n * `<DefaultTextStyle>`, a `variant` preset, `theme.typography`.\r\n */\r\nimport type { Fill } from \"@/attributes/shape/fill/chain\";\r\nimport type { FillResolved } from \"@/attributes/shape/fill/union\";\r\nimport type { Stroke, StrokeResolved } from \"@/attributes/shape/stroke/stroke\";\r\nimport type { Shadow } from \"@/attributes/shape/shadow/shadow\";\r\n\r\nexport type TextAlign = 'left' | 'right' | 'center' | 'justify' | 'start' | 'end';\r\n\r\n/** Where a block shorter (or taller) than its box sits in it. */\r\nexport type VerticalAlign = 'top' | 'center' | 'bottom';\r\n\r\nexport type TextDecoration = 'none' | 'underline' | 'line-through';\r\n\r\n/** `'title'` capitalises the first letter of each word and leaves the rest as typed. */\r\nexport type TextCase = 'none' | 'upper' | 'lower' | 'title';\r\n\r\nexport type FontStyle = 'normal' | 'italic' | 'oblique';\r\n\r\n/**\r\n * A styled run of text. Spans may nest — children inherit any style fields\r\n * the parent set and override the ones they redeclare (Flutter-style\r\n * TextSpan). A span with `children` and no `text` acts as a pure style\r\n * scope; a span with both contributes its `text` before its children.\r\n */\r\nexport interface TextSpan {\r\n text?: string;\r\n fontFamily?: string;\r\n fontSize?: number;\r\n fontWeight?: number;\r\n fontStyle?: FontStyle;\r\n letterSpacing?: number;\r\n fill?: Fill;\r\n stroke?: Stroke;\r\n children?: TextSpan[];\r\n}\r\n\r\n/**\r\n * A span flattened against its parents — every style field is concrete and\r\n * fills/strokes are resolved. Newlines in `text` are preserved; the renderer\r\n * splits on `\\n` to lay out lines.\r\n */\r\nexport interface ResolvedTextSpan {\r\n text: string;\r\n fontFamily: string;\r\n fontSize: number;\r\n fontWeight: number;\r\n fontStyle: FontStyle;\r\n letterSpacing: number;\r\n fill: FillResolved[];\r\n stroke: StrokeResolved[];\r\n}\r\n\r\n/**\r\n * A stretch of a `Text` node's string set apart from the rest. `[start, end)`\r\n * are offsets into the string; an absent field is the node's own.\r\n */\r\nexport interface TextRun {\r\n start: number;\r\n end: number;\r\n fontFamily?: string;\r\n fontSize?: number;\r\n fontWeight?: number;\r\n fontStyle?: FontStyle;\r\n letterSpacing?: number;\r\n textDecoration?: TextDecoration;\r\n fill?: Fill;\r\n stroke?: Stroke;\r\n}\r\n\r\n/** A {@link TextRun} with its paints resolved. */\r\nexport interface ResolvedTextRun extends Omit<TextRun, \"fill\" | \"stroke\"> {\r\n fill?: FillResolved[];\r\n stroke?: StrokeResolved[];\r\n}\r\n\r\n/**\r\n * A text node's style vocabulary. Each field is the loose author-facing type of\r\n * the matching `Text` prop, and optional: only the keys a source sets are\r\n * present, so a descendant inherits exactly those and keeps its own defaults for\r\n * the rest.\r\n */\r\nexport interface TextStyle {\r\n fontFamily?: string;\r\n fontSize?: number | 'autofit';\r\n fontWeight?: number;\r\n fontStyle?: FontStyle;\r\n letterSpacing?: number;\r\n lineHeight?: number;\r\n textAlign?: TextAlign;\r\n fill?: Fill;\r\n stroke?: Stroke;\r\n shadow?: Shadow;\r\n}\r\n\r\n/** A {@link TextStyle} key that shapes text rather than paints it. */\r\nexport type TextShapingKey = Exclude<keyof TextStyle, \"fill\" | \"stroke\" | \"shadow\">;\r\n"]}
|