@motionscript/core 0.1.0-alpha.8 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/LICENSE +201 -201
- package/NOTICE +49 -49
- package/README.md +91 -91
- package/dist/assets/asset-index.js.map +1 -1
- package/dist/assets/catalog.js.map +1 -1
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/index.js.map +1 -1
- package/dist/assets/manager.js.map +1 -1
- package/dist/assets/manifest.js.map +1 -1
- package/dist/assets/record.js.map +1 -1
- package/dist/assets/scope.js.map +1 -1
- package/dist/attributes/audio/effects/chain.js.map +1 -1
- package/dist/attributes/audio/effects/implementations/echo.js.map +1 -1
- package/dist/attributes/audio/effects/implementations/gain.js.map +1 -1
- package/dist/attributes/audio/effects/implementations/highpass.js.map +1 -1
- package/dist/attributes/audio/effects/implementations/lowpass.js.map +1 -1
- package/dist/attributes/audio/effects/implementations/tremolo.js.map +1 -1
- package/dist/attributes/audio/effects/index.js.map +1 -1
- package/dist/attributes/audio/effects/registry.js.map +1 -1
- package/dist/attributes/audio/effects/union.js.map +1 -1
- package/dist/attributes/audio/ramp.js.map +1 -1
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/audio/sound.js.map +1 -1
- package/dist/attributes/audio/transition.js.map +1 -1
- package/dist/attributes/index.js.map +1 -1
- package/dist/attributes/layout/alignment.js.map +1 -1
- package/dist/attributes/layout/index.js.map +1 -1
- package/dist/attributes/layout/insets.js.map +1 -1
- package/dist/attributes/layout/matrix2d.js.map +1 -1
- package/dist/attributes/layout/size.js.map +1 -1
- package/dist/attributes/layout/space3d.js.map +1 -1
- package/dist/attributes/layout/transform3d.js.map +1 -1
- package/dist/attributes/layout/vector2.js.map +1 -1
- package/dist/attributes/layout/world-transform.js.map +1 -1
- package/dist/attributes/mask/boolean.js.map +1 -1
- package/dist/attributes/mask/mask.js.map +1 -1
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/inputs.js.map +1 -1
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/render3d/orbit.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/corners/corner-style.js.map +1 -1
- package/dist/attributes/shape/corners/corners.js.map +1 -1
- package/dist/attributes/shape/corners/index.js.map +1 -1
- package/dist/attributes/shape/effects/backdrop.js.map +1 -1
- package/dist/attributes/shape/effects/chain.js.map +1 -1
- package/dist/attributes/shape/effects/effect-data.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.d.ts +2 -2
- package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.d.ts +2 -2
- package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.d.ts +4 -4
- package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.d.ts +2 -2
- package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.d.ts +2 -2
- package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
- package/dist/attributes/shape/effects/index.js.map +1 -1
- package/dist/attributes/shape/effects/registry.js.map +1 -1
- package/dist/attributes/shape/effects/spec.js.map +1 -1
- package/dist/attributes/shape/effects/union.js.map +1 -1
- package/dist/attributes/shape/fill/blend.js.map +1 -1
- package/dist/attributes/shape/fill/chain.js.map +1 -1
- package/dist/attributes/shape/fill/coerce.js.map +1 -1
- package/dist/attributes/shape/fill/color/constants.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
- package/dist/attributes/shape/fill/color/parser.js +20 -5
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/color.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/stripe.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
- package/dist/attributes/shape/fill/index.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.js.map +1 -1
- package/dist/attributes/shape/fill/media-preset.js.map +1 -1
- package/dist/attributes/shape/fill/registry.js.map +1 -1
- package/dist/attributes/shape/fill/union.js.map +1 -1
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/posterize-time.js.map +1 -1
- package/dist/attributes/shape/filters/index.js.map +1 -1
- package/dist/attributes/shape/filters/registry.js.map +1 -1
- package/dist/attributes/shape/filters/union.js.map +1 -1
- package/dist/attributes/shape/path/anchors.js.map +1 -1
- package/dist/attributes/shape/path/bezier.js.map +1 -1
- package/dist/attributes/shape/path/index.js.map +1 -1
- package/dist/attributes/shape/path/measure.js.map +1 -1
- package/dist/attributes/shape/path/morph.js.map +1 -1
- package/dist/attributes/shape/path/ops.js.map +1 -1
- package/dist/attributes/shape/path/types.js.map +1 -1
- package/dist/attributes/shape/path/walk.js.map +1 -1
- package/dist/attributes/shape/shaders/index.js.map +1 -1
- package/dist/attributes/shape/shaders/language.js.map +1 -1
- package/dist/attributes/shape/shaders/pack.js.map +1 -1
- package/dist/attributes/shape/shaders/resolve.js.map +1 -1
- package/dist/attributes/shape/shadow/index.js.map +1 -1
- package/dist/attributes/shape/shadow/shadow.js.map +1 -1
- package/dist/attributes/shape/stroke/index.js.map +1 -1
- package/dist/attributes/shape/stroke/stroke.js.map +1 -1
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/index.js.map +1 -1
- package/dist/attributes/text/ops.js.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/{chunk-LKUYVFU3.js → chunk-4BDLFEOC.js} +1 -1
- package/dist/browser/chunks/chunk-4BDLFEOC.js.map +7 -0
- package/dist/browser/chunks/chunk-CCGVIR4F.js +3 -0
- package/dist/browser/chunks/chunk-CCGVIR4F.js.map +7 -0
- package/dist/browser/chunks/chunk-N4WSN5WY.js +13 -0
- package/dist/browser/chunks/chunk-N4WSN5WY.js.map +7 -0
- package/dist/browser/chunks/chunk-WZSI3GSK.js +6 -0
- package/dist/browser/chunks/chunk-WZSI3GSK.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/experimental.js +1 -1
- package/dist/browser/experimental.js.map +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/manifest.json +1 -1
- package/dist/browser/sdk.js +1 -1
- package/dist/component.js.map +1 -1
- package/dist/components/builtins/audio/audio.js.map +1 -1
- package/dist/components/builtins/geometry/composite.js.map +1 -1
- package/dist/components/builtins/geometry/geometry.js.map +1 -1
- package/dist/components/builtins/geometry/shape-outline.js.map +1 -1
- package/dist/components/builtins/layout/layout.js.map +1 -1
- package/dist/components/builtins/media/media.js.map +1 -1
- package/dist/components/builtins/providers/providers.js.map +1 -1
- package/dist/components/builtins/text/number-format.js.map +1 -1
- package/dist/components/builtins/text/number-pattern.js.map +1 -1
- package/dist/components/builtins/text/text-defaults.js.map +1 -1
- package/dist/components/builtins/text/text-layout.js.map +1 -1
- package/dist/components/builtins/text/text.d.ts +9 -9
- package/dist/components/builtins/text/text.js.map +1 -1
- package/dist/components/builtins/three/canvas3d.js.map +1 -1
- package/dist/components/builtins/three/grid-geometry3d.js.map +1 -1
- package/dist/components/builtins/three/three.js.map +1 -1
- package/dist/components/factory/api.js.map +1 -1
- package/dist/components/factory/clip-of.js.map +1 -1
- package/dist/components/factory/commands-for.js.map +1 -1
- package/dist/components/factory/component-audio.js.map +1 -1
- package/dist/components/factory/component2d.js.map +1 -1
- package/dist/components/factory/component3d.js.map +1 -1
- package/dist/components/factory/factory.js.map +1 -1
- package/dist/components/factory/timeline.js.map +1 -1
- package/dist/components/factory/type-def.js.map +1 -1
- package/dist/components/factory/types.js.map +1 -1
- package/dist/components/factory/views.d.ts.map +1 -1
- package/dist/components/factory/views.js +41 -1
- package/dist/components/factory/views.js.map +1 -1
- package/dist/components/modules/aim.js.map +1 -1
- package/dist/components/modules/corners.js.map +1 -1
- package/dist/components/modules/flow.js.map +1 -1
- package/dist/components/modules/material.js.map +1 -1
- package/dist/components/modules/paint.js.map +1 -1
- package/dist/components/modules/shapes.js.map +1 -1
- package/dist/components/modules/text-layout.js.map +1 -1
- package/dist/components/modules/text-style.d.ts +1 -1
- package/dist/components/modules/text-style.js.map +1 -1
- package/dist/components/modules/three-entries.js.map +1 -1
- package/dist/components/modules/view3d.js.map +1 -1
- package/dist/components/trees/2d/group-bounds.js.map +1 -1
- package/dist/components/trees/2d/node-lifecycle.js.map +1 -1
- package/dist/components/trees/2d/node-motion.js.map +1 -1
- package/dist/components/trees/2d/node-render.js.map +1 -1
- package/dist/components/trees/2d/node-space.js.map +1 -1
- package/dist/components/trees/2d/node-transform.js.map +1 -1
- package/dist/components/trees/2d/node2d.js.map +1 -1
- package/dist/components/trees/audio/index.js.map +1 -1
- package/dist/components/trees/audio/node-audio.js.map +1 -1
- package/dist/components/trees/index.js.map +1 -1
- package/dist/components/trees/node/node-editor-state.js.map +1 -1
- package/dist/components/trees/node/node-reactive.d.ts +3 -4
- package/dist/components/trees/node/node-reactive.d.ts.map +1 -1
- package/dist/components/trees/node/node-reactive.js +13 -10
- package/dist/components/trees/node/node-reactive.js.map +1 -1
- package/dist/components/trees/node/node-time.js.map +1 -1
- package/dist/components/trees/node/node-walk.js.map +1 -1
- package/dist/components/trees/node/node.js.map +1 -1
- package/dist/components/trees/root/canvas2d-node.js.map +1 -1
- package/dist/components/trees/three/node3d.js.map +1 -1
- package/dist/document/audio.js.map +1 -1
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +8 -0
- package/dist/document/command-traits.d.ts.map +1 -1
- package/dist/document/command-traits.js +17 -0
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/diff.js.map +1 -1
- package/dist/document/doc-index.js.map +1 -1
- package/dist/document/expression/compile.js.map +1 -1
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/expression/parse.js.map +1 -1
- package/dist/document/expression/refs.js.map +1 -1
- package/dist/document/expression/types.js.map +1 -1
- package/dist/document/expression/walk.js.map +1 -1
- package/dist/document/index.js.map +1 -1
- package/dist/document/migrate.js.map +1 -1
- package/dist/document/missing-node.js.map +1 -1
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.js.map +1 -1
- package/dist/document/placement.js.map +1 -1
- package/dist/document/project.js.map +1 -1
- package/dist/document/prop-evolution.js.map +1 -1
- package/dist/document/registry.js.map +1 -1
- package/dist/document/settled-index.d.ts +6 -0
- package/dist/document/settled-index.d.ts.map +1 -1
- package/dist/document/settled-index.js +18 -1
- package/dist/document/settled-index.js.map +1 -1
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +26 -6
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.js.map +1 -1
- package/dist/document/vocabulary.js.map +1 -1
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/layout/bounds.js.map +1 -1
- package/dist/layout/constraints.js.map +1 -1
- package/dist/layout/flex.js.map +1 -1
- package/dist/layout/freeform.js.map +1 -1
- package/dist/layout/grid.js.map +1 -1
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/item.js.map +1 -1
- package/dist/layout/ops.js.map +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/platform/audio-sink.js.map +1 -1
- package/dist/platform/exporter.js.map +1 -1
- package/dist/platform/index.js.map +1 -1
- package/dist/platform/stepped-clock.js.map +1 -1
- package/dist/platform/storage-adapter.js.map +1 -1
- package/dist/platform/ticker.js.map +1 -1
- package/dist/project/config.js.map +1 -1
- package/dist/project/index.js.map +1 -1
- package/dist/project/tree.js.map +1 -1
- package/dist/props/host.d.ts +5 -0
- package/dist/props/host.d.ts.map +1 -1
- package/dist/props/host.js +3 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/index.js.map +1 -1
- package/dist/props/layout.d.ts +29 -0
- package/dist/props/layout.d.ts.map +1 -0
- package/dist/props/layout.js +84 -0
- package/dist/props/layout.js.map +1 -0
- package/dist/props/observer.js.map +1 -1
- package/dist/props/slot.js.map +1 -1
- package/dist/renamed-scene-names.js.map +1 -1
- package/dist/render/canvas-render-context2d.js.map +1 -1
- package/dist/render/clip-contains.js.map +1 -1
- package/dist/render/clip.js.map +1 -1
- package/dist/render/descriptors/ellipse.js.map +1 -1
- package/dist/render/descriptors/line.js.map +1 -1
- package/dist/render/descriptors/path-builder.js.map +1 -1
- package/dist/render/descriptors/path.js.map +1 -1
- package/dist/render/descriptors/polygon.js.map +1 -1
- package/dist/render/descriptors/polygram.js.map +1 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/richtext.js.map +1 -1
- package/dist/render/descriptors/shape.js.map +1 -1
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/descriptors/transform.js.map +1 -1
- package/dist/render/graphics2d.js.map +1 -1
- package/dist/render/index.js.map +1 -1
- package/dist/render/measure-context.js.map +1 -1
- package/dist/render/null-render-context.js.map +1 -1
- package/dist/render/render-context2d.js.map +1 -1
- package/dist/render/render-issue.js.map +1 -1
- package/dist/render/surface.js.map +1 -1
- package/dist/render/text-defaults.js.map +1 -1
- package/dist/render/text-layout.js.map +1 -1
- package/dist/render3d/bounds3d.js.map +1 -1
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/camera.js.map +1 -1
- package/dist/render3d/fill3d.js.map +1 -1
- package/dist/render3d/geometry.js.map +1 -1
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/index.js.map +1 -1
- package/dist/render3d/inert.js.map +1 -1
- package/dist/render3d/light.js.map +1 -1
- package/dist/render3d/material.js.map +1 -1
- package/dist/render3d/matrix4.js.map +1 -1
- package/dist/render3d/render-context3d.js.map +1 -1
- package/dist/render3d/resources.js.map +1 -1
- package/dist/render3d/rounded-box.js.map +1 -1
- package/dist/render3d/scene-settings.js.map +1 -1
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/segments.js.map +1 -1
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/tracking.js.map +1 -1
- package/dist/render3d/transform.js.map +1 -1
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/render3d/walk.js.map +1 -1
- package/dist/runtime/asset-refine.js.map +1 -1
- package/dist/runtime/asset-timeline.js.map +1 -1
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/builtin-context.js.map +1 -1
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/frame-time.js.map +1 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/placement.js.map +1 -1
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/playback.js.map +1 -1
- package/dist/runtime/precompisition.js.map +1 -1
- package/dist/runtime/project-assets.js.map +1 -1
- package/dist/runtime/session.js.map +1 -1
- package/dist/runtime/settle.js.map +1 -1
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/ease/constants.js.map +1 -1
- package/dist/tween/ease/curve.js.map +1 -1
- package/dist/tween/ease/describe.js.map +1 -1
- package/dist/tween/ease/spec.js.map +1 -1
- package/dist/tween/ease/type.js.map +1 -1
- package/dist/tween/index.js.map +1 -1
- package/dist/tween/inert.js.map +1 -1
- package/dist/tween/lerp.js.map +1 -1
- package/dist/tween/loop.js.map +1 -1
- package/dist/tween/prepare.js.map +1 -1
- package/dist/tween/stepper.js.map +1 -1
- package/dist/tween/to-command.js.map +1 -1
- package/dist/util/clamp.js.map +1 -1
- package/dist/util/context.js.map +1 -1
- package/dist/util/csv.js.map +1 -1
- package/dist/util/generateList.js.map +1 -1
- package/dist/util/index.js.map +1 -1
- package/dist/util/metrics.js.map +1 -1
- package/dist/util/random.js.map +1 -1
- package/dist/util/reference.js.map +1 -1
- package/dist/util/scheduler.js.map +1 -1
- package/package.json +1 -1
- package/dist/attributes/audio/filters/chain.d.ts +0 -113
- package/dist/attributes/audio/filters/chain.d.ts.map +0 -1
- package/dist/attributes/audio/filters/chain.js +0 -104
- package/dist/attributes/audio/filters/chain.js.map +0 -1
- package/dist/attributes/audio/filters/curve.d.ts +0 -152
- package/dist/attributes/audio/filters/curve.d.ts.map +0 -1
- package/dist/attributes/audio/filters/curve.js +0 -250
- package/dist/attributes/audio/filters/curve.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/echo.d.ts +0 -14
- package/dist/attributes/audio/filters/implementations/echo.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/echo.js +0 -11
- package/dist/attributes/audio/filters/implementations/echo.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/gain.d.ts +0 -10
- package/dist/attributes/audio/filters/implementations/gain.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/gain.js +0 -6
- package/dist/attributes/audio/filters/implementations/gain.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/highpass.d.ts +0 -12
- package/dist/attributes/audio/filters/implementations/highpass.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/highpass.js +0 -10
- package/dist/attributes/audio/filters/implementations/highpass.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/lowpass.d.ts +0 -12
- package/dist/attributes/audio/filters/implementations/lowpass.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/lowpass.js +0 -10
- package/dist/attributes/audio/filters/implementations/lowpass.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/speed.d.ts +0 -18
- package/dist/attributes/audio/filters/implementations/speed.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/speed.js +0 -6
- package/dist/attributes/audio/filters/implementations/speed.js.map +0 -1
- package/dist/attributes/audio/filters/implementations/tremolo.d.ts +0 -12
- package/dist/attributes/audio/filters/implementations/tremolo.d.ts.map +0 -1
- package/dist/attributes/audio/filters/implementations/tremolo.js +0 -10
- package/dist/attributes/audio/filters/implementations/tremolo.js.map +0 -1
- package/dist/attributes/audio/filters/index.d.ts +0 -22
- package/dist/attributes/audio/filters/index.d.ts.map +0 -1
- package/dist/attributes/audio/filters/index.js +0 -8
- package/dist/attributes/audio/filters/index.js.map +0 -1
- package/dist/attributes/audio/filters/registry.d.ts +0 -36
- package/dist/attributes/audio/filters/registry.d.ts.map +0 -1
- package/dist/attributes/audio/filters/registry.js +0 -82
- package/dist/attributes/audio/filters/registry.js.map +0 -1
- package/dist/attributes/audio/filters/union.d.ts +0 -18
- package/dist/attributes/audio/filters/union.d.ts.map +0 -1
- package/dist/attributes/audio/filters/union.js +0 -28
- package/dist/attributes/audio/filters/union.js.map +0 -1
- package/dist/attributes/shape/sksl-uniforms.d.ts +0 -146
- package/dist/attributes/shape/sksl-uniforms.d.ts.map +0 -1
- package/dist/attributes/shape/sksl-uniforms.js +0 -0
- package/dist/attributes/shape/sksl-uniforms.js.map +0 -1
- package/dist/browser/chunks/chunk-AOT33LMS.js +0 -13
- package/dist/browser/chunks/chunk-AOT33LMS.js.map +0 -7
- package/dist/browser/chunks/chunk-GKM6UZJR.js +0 -6
- package/dist/browser/chunks/chunk-GKM6UZJR.js.map +0 -7
- package/dist/browser/chunks/chunk-LKUYVFU3.js.map +0 -7
- package/dist/browser/chunks/chunk-ZRPZPWZU.js +0 -3
- package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +0 -7
- package/dist/component/api.d.ts +0 -508
- package/dist/component/api.d.ts.map +0 -1
- package/dist/component/api.js +0 -4
- package/dist/component/api.js.map +0 -1
- package/dist/component/builtins/audio.d.ts +0 -26
- package/dist/component/builtins/audio.d.ts.map +0 -1
- package/dist/component/builtins/audio.js +0 -41
- package/dist/component/builtins/audio.js.map +0 -1
- package/dist/component/builtins/canvas3d.d.ts +0 -98
- package/dist/component/builtins/canvas3d.d.ts.map +0 -1
- package/dist/component/builtins/canvas3d.js +0 -21
- package/dist/component/builtins/canvas3d.js.map +0 -1
- package/dist/component/builtins/composite.d.ts +0 -56
- package/dist/component/builtins/composite.d.ts.map +0 -1
- package/dist/component/builtins/composite.js +0 -25
- package/dist/component/builtins/composite.js.map +0 -1
- package/dist/component/builtins/geometry.d.ts +0 -505
- package/dist/component/builtins/geometry.d.ts.map +0 -1
- package/dist/component/builtins/geometry.js +0 -107
- package/dist/component/builtins/geometry.js.map +0 -1
- package/dist/component/builtins/layout.d.ts +0 -88
- package/dist/component/builtins/layout.d.ts.map +0 -1
- package/dist/component/builtins/layout.js +0 -84
- package/dist/component/builtins/layout.js.map +0 -1
- package/dist/component/builtins/media.d.ts +0 -95
- package/dist/component/builtins/media.d.ts.map +0 -1
- package/dist/component/builtins/media.js +0 -149
- package/dist/component/builtins/media.js.map +0 -1
- package/dist/component/builtins/providers.d.ts +0 -23
- package/dist/component/builtins/providers.d.ts.map +0 -1
- package/dist/component/builtins/providers.js +0 -30
- package/dist/component/builtins/providers.js.map +0 -1
- package/dist/component/builtins/text.d.ts +0 -193
- package/dist/component/builtins/text.d.ts.map +0 -1
- package/dist/component/builtins/text.js +0 -113
- package/dist/component/builtins/text.js.map +0 -1
- package/dist/component/builtins/three.d.ts +0 -1085
- package/dist/component/builtins/three.d.ts.map +0 -1
- package/dist/component/builtins/three.js +0 -265
- package/dist/component/builtins/three.js.map +0 -1
- package/dist/component/clip-of.d.ts +0 -5
- package/dist/component/clip-of.d.ts.map +0 -1
- package/dist/component/clip-of.js +0 -33
- package/dist/component/clip-of.js.map +0 -1
- package/dist/component/commands-for.d.ts +0 -19
- package/dist/component/commands-for.d.ts.map +0 -1
- package/dist/component/commands-for.js +0 -5
- package/dist/component/commands-for.js.map +0 -1
- package/dist/component/component-audio.d.ts +0 -9
- package/dist/component/component-audio.d.ts.map +0 -1
- package/dist/component/component-audio.js +0 -18
- package/dist/component/component-audio.js.map +0 -1
- package/dist/component/component2d.d.ts +0 -9
- package/dist/component/component2d.d.ts.map +0 -1
- package/dist/component/component2d.js +0 -239
- package/dist/component/component2d.js.map +0 -1
- package/dist/component/component3d.d.ts +0 -9
- package/dist/component/component3d.d.ts.map +0 -1
- package/dist/component/component3d.js +0 -99
- package/dist/component/component3d.js.map +0 -1
- package/dist/component/factory.d.ts +0 -63
- package/dist/component/factory.d.ts.map +0 -1
- package/dist/component/factory.js +0 -313
- package/dist/component/factory.js.map +0 -1
- package/dist/component/modules/aim.d.ts +0 -30
- package/dist/component/modules/aim.d.ts.map +0 -1
- package/dist/component/modules/aim.js +0 -39
- package/dist/component/modules/aim.js.map +0 -1
- package/dist/component/modules/corners.d.ts +0 -13
- package/dist/component/modules/corners.d.ts.map +0 -1
- package/dist/component/modules/corners.js +0 -12
- package/dist/component/modules/corners.js.map +0 -1
- package/dist/component/modules/flow.d.ts +0 -26
- package/dist/component/modules/flow.d.ts.map +0 -1
- package/dist/component/modules/flow.js +0 -55
- package/dist/component/modules/flow.js.map +0 -1
- package/dist/component/modules/material.d.ts +0 -40
- package/dist/component/modules/material.d.ts.map +0 -1
- package/dist/component/modules/material.js +0 -75
- package/dist/component/modules/material.js.map +0 -1
- package/dist/component/modules/paint.d.ts +0 -71
- package/dist/component/modules/paint.d.ts.map +0 -1
- package/dist/component/modules/paint.js +0 -106
- package/dist/component/modules/paint.js.map +0 -1
- package/dist/component/modules/shapes.d.ts +0 -31
- package/dist/component/modules/shapes.d.ts.map +0 -1
- package/dist/component/modules/shapes.js +0 -43
- package/dist/component/modules/shapes.js.map +0 -1
- package/dist/component/modules/text-layout.d.ts +0 -26
- package/dist/component/modules/text-layout.d.ts.map +0 -1
- package/dist/component/modules/text-layout.js +0 -57
- package/dist/component/modules/text-layout.js.map +0 -1
- package/dist/component/modules/text-style.d.ts +0 -48
- package/dist/component/modules/text-style.d.ts.map +0 -1
- package/dist/component/modules/text-style.js +0 -63
- package/dist/component/modules/text-style.js.map +0 -1
- package/dist/component/modules/three-entries.d.ts +0 -23
- package/dist/component/modules/three-entries.d.ts.map +0 -1
- package/dist/component/modules/three-entries.js +0 -41
- package/dist/component/modules/three-entries.js.map +0 -1
- package/dist/component/modules/view3d.d.ts +0 -55
- package/dist/component/modules/view3d.d.ts.map +0 -1
- package/dist/component/modules/view3d.js +0 -160
- package/dist/component/modules/view3d.js.map +0 -1
- package/dist/component/timeline.d.ts +0 -22
- package/dist/component/timeline.d.ts.map +0 -1
- package/dist/component/timeline.js +0 -128
- package/dist/component/timeline.js.map +0 -1
- package/dist/component/type-def.d.ts +0 -26
- package/dist/component/type-def.d.ts.map +0 -1
- package/dist/component/type-def.js +0 -16
- package/dist/component/type-def.js.map +0 -1
- package/dist/component/types.d.ts +0 -91
- package/dist/component/types.d.ts.map +0 -1
- package/dist/component/types.js +0 -88
- package/dist/component/types.js.map +0 -1
- package/dist/component/views.d.ts +0 -121
- package/dist/component/views.d.ts.map +0 -1
- package/dist/component/views.js +0 -413
- package/dist/component/views.js.map +0 -1
- package/dist/document/withdraw.d.ts +0 -28
- package/dist/document/withdraw.d.ts.map +0 -1
- package/dist/document/withdraw.js +0 -61
- package/dist/document/withdraw.js.map +0 -1
- package/dist/jsx/jsx-dev-runtime.d.ts +0 -3
- package/dist/jsx/jsx-dev-runtime.d.ts.map +0 -1
- package/dist/jsx/jsx-dev-runtime.js +0 -3
- package/dist/jsx/jsx-dev-runtime.js.map +0 -1
- package/dist/jsx/jsx-runtime.d.ts +0 -27
- package/dist/jsx/jsx-runtime.d.ts.map +0 -1
- package/dist/jsx/jsx-runtime.js +0 -26
- package/dist/jsx/jsx-runtime.js.map +0 -1
- package/dist/nodes/2d/node-lifecycle.d.ts +0 -46
- package/dist/nodes/2d/node-lifecycle.d.ts.map +0 -1
- package/dist/nodes/2d/node-lifecycle.js +0 -264
- package/dist/nodes/2d/node-lifecycle.js.map +0 -1
- package/dist/nodes/2d/node-motion.d.ts +0 -56
- package/dist/nodes/2d/node-motion.d.ts.map +0 -1
- package/dist/nodes/2d/node-motion.js +0 -86
- package/dist/nodes/2d/node-motion.js.map +0 -1
- package/dist/nodes/2d/node-render.d.ts +0 -44
- package/dist/nodes/2d/node-render.d.ts.map +0 -1
- package/dist/nodes/2d/node-render.js +0 -80
- package/dist/nodes/2d/node-render.js.map +0 -1
- package/dist/nodes/2d/node-space.d.ts +0 -63
- package/dist/nodes/2d/node-space.d.ts.map +0 -1
- package/dist/nodes/2d/node-space.js +0 -131
- package/dist/nodes/2d/node-space.js.map +0 -1
- package/dist/nodes/2d/node-transform.d.ts +0 -55
- package/dist/nodes/2d/node-transform.d.ts.map +0 -1
- package/dist/nodes/2d/node-transform.js +0 -73
- package/dist/nodes/2d/node-transform.js.map +0 -1
- package/dist/nodes/2d/node2d.d.ts +0 -1111
- package/dist/nodes/2d/node2d.d.ts.map +0 -1
- package/dist/nodes/2d/node2d.js +0 -1665
- package/dist/nodes/2d/node2d.js.map +0 -1
- package/dist/nodes/2d/paint-node.d.ts +0 -142
- package/dist/nodes/2d/paint-node.d.ts.map +0 -1
- package/dist/nodes/2d/paint-node.js +0 -232
- package/dist/nodes/2d/paint-node.js.map +0 -1
- package/dist/nodes/audio/audio-bus.d.ts +0 -28
- package/dist/nodes/audio/audio-bus.d.ts.map +0 -1
- package/dist/nodes/audio/audio-bus.js +0 -33
- package/dist/nodes/audio/audio-bus.js.map +0 -1
- package/dist/nodes/audio/index.d.ts +0 -4
- package/dist/nodes/audio/index.d.ts.map +0 -1
- package/dist/nodes/audio/index.js +0 -2
- package/dist/nodes/audio/index.js.map +0 -1
- package/dist/nodes/audio/node-audio.d.ts +0 -107
- package/dist/nodes/audio/node-audio.d.ts.map +0 -1
- package/dist/nodes/audio/node-audio.js +0 -179
- package/dist/nodes/audio/node-audio.js.map +0 -1
- package/dist/nodes/audio/sound-node.d.ts +0 -41
- package/dist/nodes/audio/sound-node.d.ts.map +0 -1
- package/dist/nodes/audio/sound-node.js +0 -71
- package/dist/nodes/audio/sound-node.js.map +0 -1
- package/dist/nodes/geometry/boolean-node.d.ts +0 -28
- package/dist/nodes/geometry/boolean-node.d.ts.map +0 -1
- package/dist/nodes/geometry/boolean-node.js +0 -81
- package/dist/nodes/geometry/boolean-node.js.map +0 -1
- package/dist/nodes/geometry/bounds-shape-node.d.ts +0 -149
- package/dist/nodes/geometry/bounds-shape-node.d.ts.map +0 -1
- package/dist/nodes/geometry/bounds-shape-node.js +0 -181
- package/dist/nodes/geometry/bounds-shape-node.js.map +0 -1
- package/dist/nodes/geometry/box-path-node.d.ts +0 -89
- package/dist/nodes/geometry/box-path-node.d.ts.map +0 -1
- package/dist/nodes/geometry/box-path-node.js +0 -116
- package/dist/nodes/geometry/box-path-node.js.map +0 -1
- package/dist/nodes/geometry/ellipse-node.d.ts +0 -18
- package/dist/nodes/geometry/ellipse-node.d.ts.map +0 -1
- package/dist/nodes/geometry/ellipse-node.js +0 -45
- package/dist/nodes/geometry/ellipse-node.js.map +0 -1
- package/dist/nodes/geometry/group-bounds.d.ts +0 -56
- package/dist/nodes/geometry/group-bounds.d.ts.map +0 -1
- package/dist/nodes/geometry/group-bounds.js +0 -87
- package/dist/nodes/geometry/group-bounds.js.map +0 -1
- package/dist/nodes/geometry/mask-node.d.ts +0 -33
- package/dist/nodes/geometry/mask-node.d.ts.map +0 -1
- package/dist/nodes/geometry/mask-node.js +0 -66
- package/dist/nodes/geometry/mask-node.js.map +0 -1
- package/dist/nodes/geometry/path-node.d.ts +0 -26
- package/dist/nodes/geometry/path-node.d.ts.map +0 -1
- package/dist/nodes/geometry/path-node.js +0 -58
- package/dist/nodes/geometry/path-node.js.map +0 -1
- package/dist/nodes/geometry/polygon-node.d.ts +0 -26
- package/dist/nodes/geometry/polygon-node.d.ts.map +0 -1
- package/dist/nodes/geometry/polygon-node.js +0 -47
- package/dist/nodes/geometry/polygon-node.js.map +0 -1
- package/dist/nodes/geometry/polygram-node.d.ts +0 -33
- package/dist/nodes/geometry/polygram-node.d.ts.map +0 -1
- package/dist/nodes/geometry/polygram-node.js +0 -52
- package/dist/nodes/geometry/polygram-node.js.map +0 -1
- package/dist/nodes/geometry/rect-node.d.ts +0 -38
- package/dist/nodes/geometry/rect-node.d.ts.map +0 -1
- package/dist/nodes/geometry/rect-node.js +0 -56
- package/dist/nodes/geometry/rect-node.js.map +0 -1
- package/dist/nodes/geometry/shape-node.d.ts +0 -71
- package/dist/nodes/geometry/shape-node.d.ts.map +0 -1
- package/dist/nodes/geometry/shape-node.js +0 -140
- package/dist/nodes/geometry/shape-node.js.map +0 -1
- package/dist/nodes/geometry/shape-outline.d.ts +0 -93
- package/dist/nodes/geometry/shape-outline.d.ts.map +0 -1
- package/dist/nodes/geometry/shape-outline.js +0 -470
- package/dist/nodes/geometry/shape-outline.js.map +0 -1
- package/dist/nodes/index.d.ts +0 -53
- package/dist/nodes/index.d.ts.map +0 -1
- package/dist/nodes/index.js +0 -35
- package/dist/nodes/index.js.map +0 -1
- package/dist/nodes/layout/camera-node.d.ts +0 -80
- package/dist/nodes/layout/camera-node.d.ts.map +0 -1
- package/dist/nodes/layout/camera-node.js +0 -153
- package/dist/nodes/layout/camera-node.js.map +0 -1
- package/dist/nodes/layout/orbit-camera-node.d.ts +0 -80
- package/dist/nodes/layout/orbit-camera-node.d.ts.map +0 -1
- package/dist/nodes/layout/orbit-camera-node.js +0 -118
- package/dist/nodes/layout/orbit-camera-node.js.map +0 -1
- package/dist/nodes/layout/rotated-box.d.ts +0 -20
- package/dist/nodes/layout/rotated-box.d.ts.map +0 -1
- package/dist/nodes/layout/rotated-box.js +0 -76
- package/dist/nodes/layout/rotated-box.js.map +0 -1
- package/dist/nodes/media/video-node.d.ts +0 -229
- package/dist/nodes/media/video-node.d.ts.map +0 -1
- package/dist/nodes/media/video-node.js +0 -350
- package/dist/nodes/media/video-node.js.map +0 -1
- package/dist/nodes/node/declare-paints.d.ts +0 -19
- package/dist/nodes/node/declare-paints.d.ts.map +0 -1
- package/dist/nodes/node/declare-paints.js +0 -27
- package/dist/nodes/node/declare-paints.js.map +0 -1
- package/dist/nodes/node/node-editor-state.d.ts +0 -53
- package/dist/nodes/node/node-editor-state.d.ts.map +0 -1
- package/dist/nodes/node/node-editor-state.js +0 -23
- package/dist/nodes/node/node-editor-state.js.map +0 -1
- package/dist/nodes/node/node-reactive.d.ts +0 -89
- package/dist/nodes/node/node-reactive.d.ts.map +0 -1
- package/dist/nodes/node/node-reactive.js +0 -135
- package/dist/nodes/node/node-reactive.js.map +0 -1
- package/dist/nodes/node/node-time.d.ts +0 -39
- package/dist/nodes/node/node-time.d.ts.map +0 -1
- package/dist/nodes/node/node-time.js +0 -14
- package/dist/nodes/node/node-time.js.map +0 -1
- package/dist/nodes/node/node-walk.d.ts +0 -46
- package/dist/nodes/node/node-walk.d.ts.map +0 -1
- package/dist/nodes/node/node-walk.js +0 -74
- package/dist/nodes/node/node-walk.js.map +0 -1
- package/dist/nodes/node/node.d.ts +0 -445
- package/dist/nodes/node/node.d.ts.map +0 -1
- package/dist/nodes/node/node.js +0 -745
- package/dist/nodes/node/node.js.map +0 -1
- package/dist/nodes/node/text-defaults.d.ts +0 -32
- package/dist/nodes/node/text-defaults.d.ts.map +0 -1
- package/dist/nodes/node/text-defaults.js +0 -37
- package/dist/nodes/node/text-defaults.js.map +0 -1
- package/dist/nodes/root/canvas2d-node.d.ts +0 -163
- package/dist/nodes/root/canvas2d-node.d.ts.map +0 -1
- package/dist/nodes/root/canvas2d-node.js +0 -264
- package/dist/nodes/root/canvas2d-node.js.map +0 -1
- package/dist/nodes/root/provider-node.d.ts +0 -47
- package/dist/nodes/root/provider-node.d.ts.map +0 -1
- package/dist/nodes/root/provider-node.js +0 -63
- package/dist/nodes/root/provider-node.js.map +0 -1
- package/dist/nodes/root/theme-provider-node.d.ts +0 -29
- package/dist/nodes/root/theme-provider-node.d.ts.map +0 -1
- package/dist/nodes/root/theme-provider-node.js +0 -43
- package/dist/nodes/root/theme-provider-node.js.map +0 -1
- package/dist/nodes/text/default-text-style-node.d.ts +0 -103
- package/dist/nodes/text/default-text-style-node.d.ts.map +0 -1
- package/dist/nodes/text/default-text-style-node.js +0 -146
- package/dist/nodes/text/default-text-style-node.js.map +0 -1
- package/dist/nodes/text/number-format.d.ts +0 -66
- package/dist/nodes/text/number-format.d.ts.map +0 -1
- package/dist/nodes/text/number-format.js +0 -227
- package/dist/nodes/text/number-format.js.map +0 -1
- package/dist/nodes/text/number-node.d.ts +0 -94
- package/dist/nodes/text/number-node.d.ts.map +0 -1
- package/dist/nodes/text/number-node.js +0 -86
- package/dist/nodes/text/number-node.js.map +0 -1
- package/dist/nodes/text/number-pattern.d.ts +0 -51
- package/dist/nodes/text/number-pattern.d.ts.map +0 -1
- package/dist/nodes/text/number-pattern.js +0 -77
- package/dist/nodes/text/number-pattern.js.map +0 -1
- package/dist/nodes/text/richtext-node.d.ts +0 -68
- package/dist/nodes/text/richtext-node.d.ts.map +0 -1
- package/dist/nodes/text/richtext-node.js +0 -78
- package/dist/nodes/text/richtext-node.js.map +0 -1
- package/dist/nodes/text/text-base.d.ts +0 -118
- package/dist/nodes/text/text-base.d.ts.map +0 -1
- package/dist/nodes/text/text-base.js +0 -153
- package/dist/nodes/text/text-base.js.map +0 -1
- package/dist/nodes/text/text-layout.d.ts +0 -87
- package/dist/nodes/text/text-layout.d.ts.map +0 -1
- package/dist/nodes/text/text-layout.js +0 -368
- package/dist/nodes/text/text-layout.js.map +0 -1
- package/dist/nodes/text/text-node.d.ts +0 -84
- package/dist/nodes/text/text-node.d.ts.map +0 -1
- package/dist/nodes/text/text-node.js +0 -188
- package/dist/nodes/text/text-node.js.map +0 -1
- package/dist/nodes/text/text-selection.d.ts +0 -125
- package/dist/nodes/text/text-selection.d.ts.map +0 -1
- package/dist/nodes/text/text-selection.js +0 -209
- package/dist/nodes/text/text-selection.js.map +0 -1
- package/dist/nodes/three/camera-nodes.d.ts +0 -109
- package/dist/nodes/three/camera-nodes.d.ts.map +0 -1
- package/dist/nodes/three/camera-nodes.js +0 -112
- package/dist/nodes/three/camera-nodes.js.map +0 -1
- package/dist/nodes/three/canvas3d-node.d.ts +0 -295
- package/dist/nodes/three/canvas3d-node.d.ts.map +0 -1
- package/dist/nodes/three/canvas3d-node.js +0 -486
- package/dist/nodes/three/canvas3d-node.js.map +0 -1
- package/dist/nodes/three/drawable-nodes.d.ts +0 -173
- package/dist/nodes/three/drawable-nodes.d.ts.map +0 -1
- package/dist/nodes/three/drawable-nodes.js +0 -284
- package/dist/nodes/three/drawable-nodes.js.map +0 -1
- package/dist/nodes/three/environment-nodes.d.ts +0 -106
- package/dist/nodes/three/environment-nodes.d.ts.map +0 -1
- package/dist/nodes/three/environment-nodes.js +0 -134
- package/dist/nodes/three/environment-nodes.js.map +0 -1
- package/dist/nodes/three/geometry-nodes.d.ts +0 -197
- package/dist/nodes/three/geometry-nodes.d.ts.map +0 -1
- package/dist/nodes/three/geometry-nodes.js +0 -322
- package/dist/nodes/three/geometry-nodes.js.map +0 -1
- package/dist/nodes/three/grid-geometry3d.d.ts +0 -62
- package/dist/nodes/three/grid-geometry3d.d.ts.map +0 -1
- package/dist/nodes/three/grid-geometry3d.js +0 -114
- package/dist/nodes/three/grid-geometry3d.js.map +0 -1
- package/dist/nodes/three/group3d.d.ts +0 -23
- package/dist/nodes/three/group3d.d.ts.map +0 -1
- package/dist/nodes/three/group3d.js +0 -21
- package/dist/nodes/three/group3d.js.map +0 -1
- package/dist/nodes/three/light-nodes.d.ts +0 -120
- package/dist/nodes/three/light-nodes.d.ts.map +0 -1
- package/dist/nodes/three/light-nodes.js +0 -173
- package/dist/nodes/three/light-nodes.js.map +0 -1
- package/dist/nodes/three/mesh3d.d.ts +0 -117
- package/dist/nodes/three/mesh3d.d.ts.map +0 -1
- package/dist/nodes/three/mesh3d.js +0 -147
- package/dist/nodes/three/mesh3d.js.map +0 -1
- package/dist/nodes/three/node3d.d.ts +0 -230
- package/dist/nodes/three/node3d.d.ts.map +0 -1
- package/dist/nodes/three/node3d.js +0 -337
- package/dist/nodes/three/node3d.js.map +0 -1
- package/dist/render/descriptors/latex.d.ts +0 -6
- package/dist/render/descriptors/latex.d.ts.map +0 -1
- package/dist/render/descriptors/latex.js +0 -2
- package/dist/render/descriptors/latex.js.map +0 -1
- package/dist/tween/seekable.d.ts +0 -81
- package/dist/tween/seekable.d.ts.map +0 -1
- package/dist/tween/seekable.js +0 -137
- package/dist/tween/seekable.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text-layout.js","sourceRoot":"","sources":["../../../src/nodes/text/text-layout.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAShD,OAAO,EAAE,kBAAkB,EAAsB,MAAM,kBAAkB,CAAC;AA0C1E,MAAM,UAAU,SAAS,CAAC,CAAa,EAAE,GAAe;IACpD,OAAO,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;AACnD,CAAC;AAED,4IAA4I;AAC5I,MAAM,UAAU,aAAa,CAAC,CAAa,EAAE,GAAe,EAAE,WAA4B,EAAE,KAAuB;IAC/G,yEAAyE;IACzE,sEAAsE;IACtE,IAAI,GAAG,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACtD,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC;QACnB,MAAM,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC;QACpB,OAAO;YACH,KAAK,EAAE,OAAO,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,IAAI,KAAK,CAAC;YAC3F,MAAM,EAAE,OAAO,EAAE,KAAK,QAAQ,CAAC,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CAAC;QAC5B,IAAI,GAAG,CAAC,UAAU;YAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;QAChE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACtB,KAAK,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM;YAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC9D,CAAC;AACL,CAAC","sourcesContent":["import type { AssetScope } from \"@/assets/scope\";\r\nimport type { Size2D, SizeInput } from \"@/attributes/layout/size\";\r\nimport type { FillResolved } from \"@/attributes/shape/fill/union\";\r\nimport { pathOps } from \"@/attributes/shape/path/ops\";\r\nimport type { StrokeResolved } from \"@/attributes/shape/stroke/stroke\";\r\nimport { textOps } from \"@/attributes/text/ops\";\r\nimport type {\r\n FontStyle, ResolvedTextRun, ResolvedTextSpan, TextAlign, TextCase, TextDecoration, TextSpan, VerticalAlign,\r\n} from \"@/attributes/text/types\";\r\nimport type { RichTextState } from \"@/render/descriptors/richtext\";\r\nimport type { SizeConstraints } from \"@/layout/constraints\";\r\nimport type { PathData } from \"@/render/descriptors/path\";\r\nimport type { TextSegment, TextState } from \"@/render/descriptors/text\";\r\nimport type { MeasureContext2D } from \"@/render/measure-context\";\r\nimport { AUTOFIT_PROBE_SIZE, type TextSelection } from \"./text-selection\";\r\n\r\n/**\r\n * Setting a string in a face: measuring the block, cutting it into styled\r\n * pieces, and the descriptor it draws as. Plain functions over resolved values,\r\n * shared by `TextBase` and the components' `TextLayout` module, so a glyph node\r\n * shapes one way whichever it is.\r\n */\r\n\r\n/** The shaping fields a glyph node reads, resolved. */\r\nexport interface TextValues {\r\n readonly fontFamily: string;\r\n readonly fontSize: number | \"autofit\";\r\n readonly fontWeight: number;\r\n readonly fontStyle: FontStyle;\r\n readonly letterSpacing: number;\r\n readonly lineHeight: number;\r\n readonly textAlign: TextAlign;\r\n readonly verticalAlign: VerticalAlign;\r\n readonly textDecoration: TextDecoration;\r\n readonly textCase: TextCase;\r\n readonly minFontSize: number;\r\n readonly fill: unknown;\r\n readonly stroke: unknown;\r\n readonly start: number;\r\n readonly end: number;\r\n readonly width: SizeInput;\r\n readonly height: SizeInput;\r\n}\r\n\r\n/** Where the string comes from, and what styles parts of it. */\r\nexport interface TextSource {\r\n readonly text: string;\r\n readonly wraps: boolean;\r\n /** The path the glyphs ride, for text-on-path. */\r\n readonly glyphPath: PathData | null;\r\n /** Live per-range overrides: `Text`'s selections. */\r\n readonly selections: readonly TextSelection[];\r\n /** Stretches a document styles apart from the node: `Text`'s `runs`. */\r\n readonly runs: readonly ResolvedTextRun[];\r\n}\r\n\r\nexport function casedText(s: TextValues, src: TextSource): string {\r\n return textOps.applyCase(src.text, s.textCase);\r\n}\r\n\r\n/** The block's size: hugged to its glyphs, filled across, and its own height even when it fills, so a hugging ancestor sees its content. */\r\nexport function measureGlyphs(s: TextValues, src: TextSource, constraints: SizeConstraints, scope: MeasureContext2D): Size2D {\r\n // Text-on-path: the visual extent is the path's bounding box, not a text\r\n // line box. Size the node to the path (node-local coords, like Path).\r\n if (src.glyphPath != null) {\r\n const { width, height } = pathOps.size(src.glyphPath);\r\n const wm = s.width;\r\n const hm = s.height;\r\n return {\r\n width: typeof wm === \"number\" ? wm : wm === \"hug\" ? width : (constraints.maxWidth ?? width),\r\n height: typeof hm === \"number\" ? hm : hm === \"hug\" ? height : (constraints.maxHeight ?? height),\r\n };\r\n }\r\n\r\n const measureFontSize = s.fontSize === \"autofit\" ? 16 : s.fontSize;\r\n const paragraphs = casedText(s, src).split(\"\\n\");\r\n\r\n // A styled run changes the box, which is why measuring cannot read the\r\n // node's five font fields and stop there: one word set two sizes up makes\r\n // the line taller and the block wider. So when selections are live the\r\n // intrinsic size is summed across the pieces, each in its own style.\r\n const styled = textSegments(s, src);\r\n const lineStyles = styled === null\r\n ? null\r\n : measureStyledLines(styled, {\r\n fontFamily: s.fontFamily,\r\n fontSize: measureFontSize,\r\n fontStyle: s.fontStyle,\r\n fontWeight: s.fontWeight,\r\n letterSpacing: s.letterSpacing,\r\n });\r\n\r\n const lineH = measureFontSize * s.lineHeight;\r\n const intrinsicW = lineStyles\r\n ? Math.max(...lineStyles.map(line => line.runs.reduce(\r\n (w, run) => w + scope.measureText(run.text, run.fontSize, run.fontFamily, run.fontWeight, run.letterSpacing, run.fontStyle).width,\r\n 0,\r\n )))\r\n : Math.max(...paragraphs.map(l => scope.measureText(l, measureFontSize, s.fontFamily, s.fontWeight, s.letterSpacing, s.fontStyle).width));\r\n\r\n const wm = s.width;\r\n const hm = s.height;\r\n const resolvedW = typeof wm === \"number\" ? wm : wm === \"hug\" ? intrinsicW : constraints.maxWidth ?? 0;\r\n\r\n // When wrap is on and the box has a finite width narrower than the text,\r\n // height needs to account for the extra lines produced by wrapping. Each\r\n // line is as tall as its tallest run.\r\n const wraps = src.wraps && resolvedW > 0;\r\n const lineSizes = lineStyles === null\r\n ? null\r\n : wraps\r\n ? wrappedLineSizes(lineStyles, resolvedW, scope)\r\n : lineStyles.map(line => Math.max(...line.runs.map(run => run.fontSize)));\r\n const intrinsicH = lineSizes\r\n ? lineSizes.reduce((h, size) => h + size * s.lineHeight, 0)\r\n : (wraps\r\n ? paragraphs.reduce((n, p) => n + countWrappedLines(p, resolvedW, measureFontSize, s.fontFamily, s.fontWeight, scope, s.letterSpacing, s.fontStyle), 0)\r\n : paragraphs.length) * lineH;\r\n\r\n return { width: resolvedW, height: typeof hm === \"number\" ? hm : intrinsicH };\r\n}\r\n\r\n/**\r\n * The string cut at every style boundary, each piece's overrides resolved by the\r\n * overlap rule: later selections win for transform, paint and font; opacity\r\n * multiplies. Also folds in the Write On reveal window. `null` when neither is\r\n * active, so rendering keeps its single-op path; and always `null` on a path,\r\n * where the string is laid along it as one run.\r\n */\r\nexport function textSegments(s: TextValues, src: TextSource): TextSegment[] | null {\r\n if (src.glyphPath != null) return null;\r\n const active = src.selections.filter(sel => sel.ranges.length > 0 && !sel.isIdentity);\r\n const runs = src.runs.filter(r => r.end > r.start);\r\n const text = casedText(s, src);\r\n if (text.length === 0) return null;\r\n\r\n // Write On: a glyph has no path to trim, so `start`/`end` are a\r\n // character-reveal window instead: opacity over a range of characters.\r\n const hasReveal = s.start > 0 || s.end < 1;\r\n if (active.length === 0 && runs.length === 0 && !hasReveal) return null;\r\n\r\n // A hard cut at whole characters, one at a time, the way DaVinci's Write On does.\r\n const revealStart = Math.round(s.start * text.length);\r\n const revealEnd = Math.round(s.end * text.length);\r\n\r\n // `'autofit'` settles on a size the block is measured into, which no single\r\n // piece can be asked for, so pieces shape at the probe size a selection's\r\n // `fontSize` override starts from.\r\n const nodeFontSize = typeof s.fontSize === \"number\" ? s.fontSize : AUTOFIT_PROBE_SIZE;\r\n const fill = s.fill as FillResolved[];\r\n const stroke = s.stroke as StrokeResolved[];\r\n\r\n const cuts = new Set<number>([0, text.length]);\r\n for (const run of runs) { cuts.add(run.start); cuts.add(run.end); }\r\n for (const sel of active) {\r\n for (const r of sel.ranges) { cuts.add(r.start); cuts.add(r.end); }\r\n }\r\n if (hasReveal) {\r\n cuts.add(revealStart);\r\n cuts.add(revealEnd);\r\n }\r\n const points = [...cuts].filter(c => c >= 0 && c <= text.length).sort((a, b) => a - b);\r\n\r\n const segments: TextSegment[] = [];\r\n for (let i = 0; i < points.length - 1; i++) {\r\n const start = points[i];\r\n const end = points[i + 1];\r\n if (end <= start) continue;\r\n\r\n // Every shaping field is stated, so the paragraph builder and the caret\r\n // read a piece the same way.\r\n const seg: TextSegment = {\r\n text: text.slice(start, end),\r\n fontFamily: s.fontFamily,\r\n fontSize: nodeFontSize,\r\n fontStyle: s.fontStyle,\r\n fontWeight: s.fontWeight,\r\n letterSpacing: s.letterSpacing,\r\n textDecoration: s.textDecoration,\r\n opacity: 1,\r\n x: 0,\r\n y: 0,\r\n scale: 1,\r\n rotation: 0,\r\n fill,\r\n stroke,\r\n };\r\n\r\n // The document's styling first, so a selection animates from it.\r\n for (const run of runs) {\r\n if (start < run.start || end > run.end) continue;\r\n if (run.fontFamily !== undefined) seg.fontFamily = run.fontFamily;\r\n if (run.fontSize !== undefined) seg.fontSize = run.fontSize;\r\n if (run.fontStyle !== undefined) seg.fontStyle = run.fontStyle;\r\n if (run.fontWeight !== undefined) seg.fontWeight = run.fontWeight;\r\n if (run.letterSpacing !== undefined) seg.letterSpacing = run.letterSpacing;\r\n if (run.textDecoration !== undefined) seg.textDecoration = run.textDecoration;\r\n if (run.fill !== undefined) seg.fill = run.fill;\r\n if (run.stroke !== undefined) seg.stroke = run.stroke;\r\n }\r\n\r\n // Creation order: opacity multiplies, others last-wins. A shaping field a\r\n // selection still holds at the node's own value is one it never touched,\r\n // and must not undo a run's.\r\n for (const sel of active) {\r\n if (!sel.ranges.some(r => start >= r.start && end <= r.end)) continue;\r\n const o = sel.overrides;\r\n seg.opacity *= o.opacity;\r\n seg.x = o.x;\r\n seg.y = o.y;\r\n seg.scale = o.scale;\r\n seg.rotation = o.rotation;\r\n if (o.fontFamily !== s.fontFamily) seg.fontFamily = o.fontFamily;\r\n if (o.fontSize !== nodeFontSize) seg.fontSize = o.fontSize;\r\n if (o.fontStyle !== s.fontStyle) seg.fontStyle = o.fontStyle;\r\n if (o.fontWeight !== s.fontWeight) seg.fontWeight = o.fontWeight;\r\n if (o.letterSpacing !== s.letterSpacing) seg.letterSpacing = o.letterSpacing;\r\n if (o.fill !== null) seg.fill = o.fill;\r\n if (o.stroke !== null) seg.stroke = o.stroke;\r\n }\r\n\r\n if (hasReveal && !(start >= revealStart && end <= revealEnd)) seg.opacity = 0;\r\n segments.push(seg);\r\n }\r\n return segments;\r\n}\r\n\r\n/** The descriptor the block draws as, in a box of `size`. Picking's caret geometry reads the same one. */\r\nexport function textState(s: TextValues, src: TextSource, size: Size2D | undefined): Partial<TextState> {\r\n return {\r\n text: casedText(s, src),\r\n fontSize: s.fontSize,\r\n fontFamily: s.fontFamily,\r\n fontWeight: s.fontWeight,\r\n fontStyle: s.fontStyle,\r\n letterSpacing: s.letterSpacing,\r\n lineHeight: s.lineHeight,\r\n textAlign: s.textAlign,\r\n verticalAlign: s.verticalAlign,\r\n textDecoration: s.textDecoration,\r\n wrap: src.wraps,\r\n minFontSize: s.minFontSize,\r\n width: size?.width ?? 0,\r\n height: size?.height ?? 0,\r\n segments: textSegments(s, src) ?? undefined,\r\n path: src.glyphPath,\r\n };\r\n}\r\n\r\n/**\r\n * The node's own face, plus whatever a piece sets in another, and the pieces'\r\n * paints. Naming a family here is what lets it load before layout, rather than\r\n * being discovered by measuring against the fallback face.\r\n */\r\nexport function declareGlyphAssets(s: TextValues, src: TextSource, assets: Pick<AssetScope, \"font\" | \"fill\">): void {\r\n // Nothing may name a family at all; an `undefined` key is not a font to load.\r\n if (s.fontFamily) assets.font(s.fontFamily, s.fontWeight);\r\n for (const segment of textSegments(s, src) ?? []) {\r\n const family = segment.fontFamily ?? s.fontFamily;\r\n if (family) assets.font(family, segment.fontWeight);\r\n assets.fill(segment.fill ?? []);\r\n for (const stroke of segment.stroke ?? []) assets.fill(stroke.fill);\r\n }\r\n}\r\n\r\n/** One shaped piece of a line, as measuring needs it: its text and the face it is set in. */\r\ninterface StyledRun {\r\n text: string;\r\n fontFamily: string;\r\n fontSize: number;\r\n fontStyle: FontStyle;\r\n fontWeight: number;\r\n letterSpacing: number;\r\n}\r\n\r\n/** The segments as lines of runs, split at every newline; an empty line keeps the node's own face. */\r\nfunction measureStyledLines(segments: TextSegment[], fallback: Omit<StyledRun, \"text\">): { runs: StyledRun[] }[] {\r\n const lines: { runs: StyledRun[] }[] = [{ runs: [] }];\r\n for (const segment of segments) {\r\n const style: Omit<StyledRun, \"text\"> = {\r\n fontFamily: segment.fontFamily ?? fallback.fontFamily,\r\n fontSize: segment.fontSize ?? fallback.fontSize,\r\n fontStyle: segment.fontStyle ?? fallback.fontStyle,\r\n fontWeight: segment.fontWeight,\r\n letterSpacing: segment.letterSpacing,\r\n };\r\n const parts = segment.text.split(\"\\n\");\r\n for (let i = 0; i < parts.length; i++) {\r\n if (i > 0) lines.push({ runs: [] });\r\n lines[lines.length - 1].runs.push({ text: parts[i], ...style });\r\n }\r\n }\r\n for (const line of lines) {\r\n if (line.runs.length === 0) line.runs.push({ ...fallback, text: \"\" });\r\n }\r\n return lines;\r\n}\r\n\r\n/** Each wrapped line's tallest run, breaking at whitespace the way the paragraph builder does. */\r\nfunction wrappedLineSizes(lines: { runs: StyledRun[] }[], maxWidth: number, scope: MeasureContext2D): number[] {\r\n const sizes: number[] = [];\r\n for (const line of lines) {\r\n const tokens: { width: number; size: number; space: boolean }[] = [];\r\n for (const run of line.runs) {\r\n for (const part of run.text.split(/(\\s+)/)) {\r\n if (part.length === 0) continue;\r\n const space = /^\\s+$/.test(part);\r\n const width = scope.measureText(part, run.fontSize, run.fontFamily, run.fontWeight, run.letterSpacing, run.fontStyle).width;\r\n const last = tokens[tokens.length - 1];\r\n if (last && !last.space && !space) {\r\n last.width += width;\r\n last.size = Math.max(last.size, run.fontSize);\r\n } else {\r\n tokens.push({ width, size: run.fontSize, space });\r\n }\r\n }\r\n }\r\n if (tokens.length === 0) {\r\n sizes.push(Math.max(...line.runs.map(run => run.fontSize)));\r\n continue;\r\n }\r\n let lineW = tokens[0].width;\r\n let size = tokens[0].size;\r\n for (const token of tokens.slice(1)) {\r\n if (lineW + token.width <= maxWidth) {\r\n lineW += token.width;\r\n size = Math.max(size, token.size);\r\n } else {\r\n sizes.push(size);\r\n lineW = token.space ? 0 : token.width;\r\n size = token.space ? 0 : token.size;\r\n }\r\n }\r\n sizes.push(size > 0 ? size : Math.max(...line.runs.map(run => run.fontSize)));\r\n }\r\n return sizes;\r\n}\r\n\r\nfunction countWrappedLines(\r\n paragraph: string,\r\n maxWidth: number,\r\n fontSize: number,\r\n fontFamily: string,\r\n fontWeight: number,\r\n scope: MeasureContext2D,\r\n letterSpacing = 0,\r\n fontStyle: FontStyle = \"normal\",\r\n): number {\r\n if (paragraph.length === 0) return 1;\r\n if (scope.measureText(paragraph, fontSize, fontFamily, fontWeight, letterSpacing, fontStyle).width <= maxWidth) return 1;\r\n const words = paragraph.split(/(\\s+)/).filter(w => w.length > 0);\r\n let lines = 1;\r\n let lineW = 0;\r\n for (const word of words) {\r\n const w = scope.measureText(word, fontSize, fontFamily, fontWeight, letterSpacing, fontStyle).width;\r\n if (lineW === 0) {\r\n lineW = w;\r\n } else if (lineW + w <= maxWidth) {\r\n lineW += w;\r\n } else {\r\n lines++;\r\n lineW = /^\\s+$/.test(word) ? 0 : w;\r\n }\r\n }\r\n return lines;\r\n}\r\n\r\n/** What a rich-text node reads: spans, and the face they inherit from. */\r\nexport interface RichValues {\r\n readonly spans: readonly TextSpan[];\r\n readonly fontFamily: string;\r\n readonly fontSize: number;\r\n readonly fontWeight: number;\r\n readonly fontStyle: FontStyle;\r\n readonly letterSpacing: number;\r\n readonly lineHeight: number;\r\n readonly textAlign: TextAlign;\r\n readonly fill: unknown;\r\n readonly stroke: unknown;\r\n readonly width: SizeInput;\r\n readonly height: SizeInput;\r\n}\r\n\r\n/** Every span flattened to a run, each field it leaves unset taken from the node. */\r\nexport function richRuns(s: RichValues): ResolvedTextSpan[] {\r\n return textOps.flatten(s.spans, {\r\n fontFamily: s.fontFamily,\r\n fontSize: s.fontSize,\r\n fontWeight: s.fontWeight,\r\n fontStyle: s.fontStyle,\r\n letterSpacing: s.letterSpacing,\r\n fill: s.fill as FillResolved[],\r\n stroke: s.stroke as StrokeResolved[],\r\n });\r\n}\r\n\r\n/** Lines broken only at `\\n`, each as tall as its tallest run; an empty node keeps one line of its own size. */\r\nexport function measureRich(s: RichValues, constraints: SizeConstraints, scope: MeasureContext2D): Size2D {\r\n let lineW = 0;\r\n let maxLineH = 0;\r\n let totalW = 0;\r\n let totalH = 0;\r\n const finishLine = () => {\r\n if (lineW > totalW) totalW = lineW;\r\n totalH += maxLineH;\r\n lineW = 0;\r\n maxLineH = 0;\r\n };\r\n for (const run of richRuns(s)) {\r\n const lh = run.fontSize * s.lineHeight;\r\n const segments = run.text.split(\"\\n\");\r\n for (let i = 0; i < segments.length; i++) {\r\n if (i > 0) finishLine();\r\n lineW += scope.measureText(segments[i], run.fontSize, run.fontFamily, run.fontWeight, run.letterSpacing, run.fontStyle).width;\r\n if (lh > maxLineH) maxLineH = lh;\r\n }\r\n }\r\n finishLine();\r\n if (totalH === 0) totalH = s.fontSize * s.lineHeight;\r\n const wm = s.width;\r\n const hm = s.height;\r\n return {\r\n width: typeof wm === \"number\" ? wm : wm === \"hug\" ? totalW : constraints.maxWidth ?? 0,\r\n height: typeof hm === \"number\" ? hm : hm === \"hug\" ? totalH : constraints.maxHeight ?? 0,\r\n };\r\n}\r\n\r\nexport function richState(s: RichValues, size: Size2D | undefined): Partial<RichTextState> {\r\n return { spans: richRuns(s), lineHeight: s.lineHeight, textAlign: s.textAlign, width: size?.width ?? 0, height: size?.height ?? 0 };\r\n}\r\n\r\nexport function declareRichAssets(s: RichValues, assets: Pick<AssetScope, \"font\" | \"fill\">): void {\r\n for (const run of richRuns(s)) {\r\n if (run.fontFamily) assets.font(run.fontFamily, run.fontWeight);\r\n assets.fill(run.fill);\r\n for (const stroke of run.stroke) assets.fill(stroke.fill);\r\n }\r\n}\r\n"]}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import type { ResolvedTextRun, TextRun } from "../../attributes/text/types.js";
|
|
2
|
-
import { NodeConfig } from "../../nodes/2d/node2d.js";
|
|
3
|
-
import { PathData } from "../../render/descriptors/path.js";
|
|
4
|
-
import { PathBuilder } from "../../render/descriptors/path-builder.js";
|
|
5
|
-
import { TextSelection } from "./text-selection.js";
|
|
6
|
-
import { TextBase, TextBaseProps } from "./text-base.js";
|
|
7
|
-
import { type Command, type CommandArgs } from "../../tween/command.js";
|
|
8
|
-
export interface TextProps extends TextBaseProps {
|
|
9
|
-
text: string;
|
|
10
|
-
/** Wrap onto more lines once the text runs out of width. */
|
|
11
|
-
wrap: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Wrap the text around a path (text-on-path). Accepts the same value shapes
|
|
14
|
-
* as the {@link Path} node's `d`: an SVG path string, a `PathCommand[]`, or a
|
|
15
|
-
* {@link PathBuilder}. When set, `wrap` and multi-line (`\n`) are ignored
|
|
16
|
-
* (single line), and text selections are not applied.
|
|
17
|
-
*/
|
|
18
|
-
path: PathData | PathBuilder;
|
|
19
|
-
/**
|
|
20
|
-
* Stretches of `text` styled apart from the node — see {@link TextRun}.
|
|
21
|
-
* Where two overlap the later one wins; offsets past the end of the string
|
|
22
|
-
* style nothing. Ignored on a `path`, like selections.
|
|
23
|
-
*/
|
|
24
|
-
runs: TextRun[];
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Copy somebody typed, set in a face.
|
|
28
|
-
*
|
|
29
|
-
* The shaping, measuring and drawing are {@link TextBase}'s, shared with every
|
|
30
|
-
* other node that puts glyphs on the canvas. What is here is what belongs to a
|
|
31
|
-
* string an *author owns*: the string itself, whether its lines break, the path
|
|
32
|
-
* it can be wrapped around, the two commands that add to it, and the selection
|
|
33
|
-
* API that styles part of it.
|
|
34
|
-
*/
|
|
35
|
-
export declare class Text extends TextBase<TextProps> {
|
|
36
|
-
readonly text: string;
|
|
37
|
-
readonly wrap: boolean;
|
|
38
|
-
readonly path: PathData | null;
|
|
39
|
-
readonly runs: ResolvedTextRun[];
|
|
40
|
-
constructor(props: NodeConfig<Text, TextProps>);
|
|
41
|
-
displayText(): string;
|
|
42
|
-
protected get wrapsText(): boolean;
|
|
43
|
-
protected get glyphPath(): PathData | null;
|
|
44
|
-
protected styledRuns(): readonly TextSelection[];
|
|
45
|
-
protected styleRuns(): readonly ResolvedTextRun[];
|
|
46
|
-
protected applyDefaultSize(props?: NodeConfig<Text, TextProps>): void;
|
|
47
|
-
append(args: CommandArgs<{
|
|
48
|
-
text: string;
|
|
49
|
-
}> & {
|
|
50
|
-
duration: number;
|
|
51
|
-
}): Command<TextProps>;
|
|
52
|
-
prepend(args: CommandArgs<{
|
|
53
|
-
text: string;
|
|
54
|
-
}> & {
|
|
55
|
-
duration: number;
|
|
56
|
-
}): Command<TextProps>;
|
|
57
|
-
/** Live selections in creation order. Later ones win on overlapping glyphs. */
|
|
58
|
-
private _selections;
|
|
59
|
-
/** @internal Called by {@link TextSelection} on construction. */
|
|
60
|
-
_registerSelection(selection: TextSelection): void;
|
|
61
|
-
/**
|
|
62
|
-
* Select an occurrence of `text`. By default the first occurrence; pass
|
|
63
|
-
* `{ index }` to target the nth (0-based).
|
|
64
|
-
*
|
|
65
|
-
* @example title().find("hello").to({ opacity: 0.5 }, 1);
|
|
66
|
-
*/
|
|
67
|
-
find(text: string, opts?: {
|
|
68
|
-
index?: number;
|
|
69
|
-
}): TextSelection;
|
|
70
|
-
/** Select every match of `regex`. A non-global regex matches once. */
|
|
71
|
-
match(regex: RegExp): TextSelection;
|
|
72
|
-
/** Select the nth `\n`-delimited line (0-based), excluding the newline. */
|
|
73
|
-
line(n: number): TextSelection;
|
|
74
|
-
/** Select every whitespace-delimited word. */
|
|
75
|
-
words(): TextSelection;
|
|
76
|
-
/** Select the nth whitespace-delimited word (0-based). */
|
|
77
|
-
word(n: number): TextSelection;
|
|
78
|
-
/** Select the raw character range `[start, end)`. */
|
|
79
|
-
slice(start: number, end: number): TextSelection;
|
|
80
|
-
/** Select characters for which `predicate` returns true; adjacent hits merge. */
|
|
81
|
-
filter(predicate: (char: string, index: number) => boolean): TextSelection;
|
|
82
|
-
private _wordRanges;
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=text-node.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text-node.d.ts","sourceRoot":"","sources":["../../../src/nodes/text/text-node.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAIxE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM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AC,IAAI,EAAE,WAAW,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,SAAS,CAAC;IAOvF,+EAA+E;IAC/E,OAAO,CAAC,WAAW,CAAuB;IAE1C,iEAAiE;IACjE,kBAAkB,CAAC,SAAS,EAAE,aAAa,GAAG,IAAI;IAIlD;;;;;OAKG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,aAAa;IAgB5D,sEAAsE;IACtE,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa;IAYnC,2EAA2E;IAC3E,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,aAAa;IAW9B,8CAA8C;IAC9C,KAAK,IAAI,aAAa;IAItB,0DAA0D;IAC1D,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,aAAa;IAK9B,qDAAqD;IACrD,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa;IAIhD,iFAAiF;IACjF,MAAM,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,GAAG,aAAa;IAe1E,OAAO,CAAC,WAAW;CAStB"}
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { textProperty } from "../../attributes/properties/typed.js";
|
|
8
|
-
import { fillOps } from "../../attributes/shape/fill/registry.js";
|
|
9
|
-
import { strokeOps } from "../../attributes/shape/stroke/stroke.js";
|
|
10
|
-
import { property } from "../../attributes/properties/decorator.js";
|
|
11
|
-
import { PathBuilder } from "../../render/descriptors/path-builder.js";
|
|
12
|
-
import { TextSelection } from "./text-selection.js";
|
|
13
|
-
import { TextBase } from "./text-base.js";
|
|
14
|
-
import { command } from "../../tween/command-decorator.js";
|
|
15
|
-
/** Coerce the loosely-typed `path` input into stored {@link PathData} (or null). */
|
|
16
|
-
function resolveTextPath(value) {
|
|
17
|
-
if (value == null)
|
|
18
|
-
return null;
|
|
19
|
-
return value instanceof PathBuilder ? value.toCommands() : value;
|
|
20
|
-
}
|
|
21
|
-
function resolveTextRuns(value) {
|
|
22
|
-
if (!Array.isArray(value))
|
|
23
|
-
return [];
|
|
24
|
-
return value.map(({ fill, stroke, ...run }) => ({
|
|
25
|
-
...run,
|
|
26
|
-
...(fill === undefined ? {} : { fill: fillOps.resolve(fill) }),
|
|
27
|
-
...(stroke === undefined ? {} : { stroke: strokeOps.resolve(stroke) }),
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Copy somebody typed, set in a face.
|
|
32
|
-
*
|
|
33
|
-
* The shaping, measuring and drawing are {@link TextBase}'s, shared with every
|
|
34
|
-
* other node that puts glyphs on the canvas. What is here is what belongs to a
|
|
35
|
-
* string an *author owns*: the string itself, whether its lines break, the path
|
|
36
|
-
* it can be wrapped around, the two commands that add to it, and the selection
|
|
37
|
-
* API that styles part of it.
|
|
38
|
-
*/
|
|
39
|
-
export class Text extends TextBase {
|
|
40
|
-
constructor(props) {
|
|
41
|
-
super(props);
|
|
42
|
-
}
|
|
43
|
-
displayText() {
|
|
44
|
-
return this.text;
|
|
45
|
-
}
|
|
46
|
-
get wrapsText() {
|
|
47
|
-
return this.wrap;
|
|
48
|
-
}
|
|
49
|
-
get glyphPath() {
|
|
50
|
-
return this.path;
|
|
51
|
-
}
|
|
52
|
-
styledRuns() {
|
|
53
|
-
return this._selections;
|
|
54
|
-
}
|
|
55
|
-
styleRuns() {
|
|
56
|
-
return this.runs;
|
|
57
|
-
}
|
|
58
|
-
// Text fills rather than hugs on the axis something else has to settle:
|
|
59
|
-
// `autofit` measures glyphs against the allotted box (the base's rule), and
|
|
60
|
-
// `wrap` needs a width to break lines against.
|
|
61
|
-
applyDefaultSize(props) {
|
|
62
|
-
const autofit = props?.fontSize === 'autofit';
|
|
63
|
-
this.applyProp("height", props?.height ?? (autofit ? "fill" : "hug"));
|
|
64
|
-
this.applyProp("width", props?.width ?? (autofit || props?.wrap ? "fill" : "hug"));
|
|
65
|
-
}
|
|
66
|
-
append(args) {
|
|
67
|
-
const text = args.data.text;
|
|
68
|
-
return this.to({ data: { text: this.text + text }, duration: args.duration, easing: args.easing });
|
|
69
|
-
}
|
|
70
|
-
prepend(args) {
|
|
71
|
-
const text = args.data.text;
|
|
72
|
-
return this.to({ data: { text: text + this.text }, duration: args.duration, easing: args.easing });
|
|
73
|
-
}
|
|
74
|
-
// ---- Text selection ---------------------------------------------------
|
|
75
|
-
/** Live selections in creation order. Later ones win on overlapping glyphs. */
|
|
76
|
-
_selections = [];
|
|
77
|
-
/** @internal Called by {@link TextSelection} on construction. */
|
|
78
|
-
_registerSelection(selection) {
|
|
79
|
-
this._selections.push(selection);
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Select an occurrence of `text`. By default the first occurrence; pass
|
|
83
|
-
* `{ index }` to target the nth (0-based).
|
|
84
|
-
*
|
|
85
|
-
* @example title().find("hello").to({ opacity: 0.5 }, 1);
|
|
86
|
-
*/
|
|
87
|
-
find(text, opts) {
|
|
88
|
-
const source = this.text;
|
|
89
|
-
const ranges = [];
|
|
90
|
-
if (text.length > 0) {
|
|
91
|
-
let from = 0;
|
|
92
|
-
let i;
|
|
93
|
-
while ((i = source.indexOf(text, from)) !== -1) {
|
|
94
|
-
ranges.push({ start: i, end: i + text.length });
|
|
95
|
-
from = i + text.length;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
const index = opts?.index ?? 0;
|
|
99
|
-
const picked = ranges[index] ? [ranges[index]] : [];
|
|
100
|
-
return new TextSelection(this, picked);
|
|
101
|
-
}
|
|
102
|
-
/** Select every match of `regex`. A non-global regex matches once. */
|
|
103
|
-
match(regex) {
|
|
104
|
-
const flags = regex.flags.includes("g") ? regex.flags : regex.flags + "g";
|
|
105
|
-
const re = new RegExp(regex.source, flags);
|
|
106
|
-
const ranges = [];
|
|
107
|
-
let m;
|
|
108
|
-
while ((m = re.exec(this.text)) !== null) {
|
|
109
|
-
if (m[0].length === 0) {
|
|
110
|
-
re.lastIndex++;
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
113
|
-
ranges.push({ start: m.index, end: m.index + m[0].length });
|
|
114
|
-
}
|
|
115
|
-
return new TextSelection(this, ranges);
|
|
116
|
-
}
|
|
117
|
-
/** Select the nth `\n`-delimited line (0-based), excluding the newline. */
|
|
118
|
-
line(n) {
|
|
119
|
-
const lines = this.text.split("\n");
|
|
120
|
-
let cursor = 0;
|
|
121
|
-
for (let i = 0; i < lines.length; i++) {
|
|
122
|
-
const len = lines[i].length;
|
|
123
|
-
if (i === n)
|
|
124
|
-
return new TextSelection(this, [{ start: cursor, end: cursor + len }]);
|
|
125
|
-
cursor += len + 1; // + the consumed "\n"
|
|
126
|
-
}
|
|
127
|
-
return new TextSelection(this, []);
|
|
128
|
-
}
|
|
129
|
-
/** Select every whitespace-delimited word. */
|
|
130
|
-
words() {
|
|
131
|
-
return new TextSelection(this, this._wordRanges());
|
|
132
|
-
}
|
|
133
|
-
/** Select the nth whitespace-delimited word (0-based). */
|
|
134
|
-
word(n) {
|
|
135
|
-
const r = this._wordRanges()[n];
|
|
136
|
-
return new TextSelection(this, r ? [r] : []);
|
|
137
|
-
}
|
|
138
|
-
/** Select the raw character range `[start, end)`. */
|
|
139
|
-
slice(start, end) {
|
|
140
|
-
return new TextSelection(this, [{ start, end }]);
|
|
141
|
-
}
|
|
142
|
-
/** Select characters for which `predicate` returns true; adjacent hits merge. */
|
|
143
|
-
filter(predicate) {
|
|
144
|
-
const ranges = [];
|
|
145
|
-
let runStart = -1;
|
|
146
|
-
for (let i = 0; i < this.text.length; i++) {
|
|
147
|
-
if (predicate(this.text[i], i)) {
|
|
148
|
-
if (runStart === -1)
|
|
149
|
-
runStart = i;
|
|
150
|
-
}
|
|
151
|
-
else if (runStart !== -1) {
|
|
152
|
-
ranges.push({ start: runStart, end: i });
|
|
153
|
-
runStart = -1;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
if (runStart !== -1)
|
|
157
|
-
ranges.push({ start: runStart, end: this.text.length });
|
|
158
|
-
return new TextSelection(this, ranges);
|
|
159
|
-
}
|
|
160
|
-
_wordRanges() {
|
|
161
|
-
const ranges = [];
|
|
162
|
-
const re = /\S+/g;
|
|
163
|
-
let m;
|
|
164
|
-
while ((m = re.exec(this.text)) !== null) {
|
|
165
|
-
ranges.push({ start: m.index, end: m.index + m[0].length });
|
|
166
|
-
}
|
|
167
|
-
return ranges;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
__decorate([
|
|
171
|
-
textProperty()
|
|
172
|
-
], Text.prototype, "text", void 0);
|
|
173
|
-
__decorate([
|
|
174
|
-
property({ default: false })
|
|
175
|
-
], Text.prototype, "wrap", void 0);
|
|
176
|
-
__decorate([
|
|
177
|
-
property({ default: null, mapper: resolveTextPath })
|
|
178
|
-
], Text.prototype, "path", void 0);
|
|
179
|
-
__decorate([
|
|
180
|
-
property({ default: [], mapper: resolveTextRuns, animatable: false })
|
|
181
|
-
], Text.prototype, "runs", void 0);
|
|
182
|
-
__decorate([
|
|
183
|
-
command({ args: [{ key: "text", kind: "text", default: "", multiline: true }] })
|
|
184
|
-
], Text.prototype, "append", null);
|
|
185
|
-
__decorate([
|
|
186
|
-
command({ args: [{ key: "text", kind: "text", default: "", multiline: true }] })
|
|
187
|
-
], Text.prototype, "prepend", null);
|
|
188
|
-
//# sourceMappingURL=text-node.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text-node.js","sourceRoot":"","sources":["../../../src/nodes/text/text-node.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAG7D,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAa,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAiB,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAsBpD,oFAAoF;AACpF,SAAS,eAAe,CAAC,KAAgD;IACrE,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IAC/B,OAAO,KAAK,YAAY,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AACrE,CAAC;AAED,SAAS,eAAe,CAAC,KAAmC;IACxD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACrC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;QAC5C,GAAG,GAAG;QACN,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,IA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E,eAAe,EAAE,CAAC;kCACd;AAEtB;IADhB,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;kCAC7B;AAoCzC;IADC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;kCAIhF;AAGD;IADC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;mCAIhF","sourcesContent":["import { textProperty } from \"@/attributes/properties/typed\";\r\nimport type { ResolvedTextRun, TextRun } from \"@/attributes/text/types\";\r\nimport { fillOps } from \"@/attributes/shape/fill/registry\";\r\nimport { strokeOps } from \"@/attributes/shape/stroke/stroke\";\r\nimport { property } from \"@/attributes/properties/decorator\";\r\nimport { NodeConfig } from \"@/nodes/2d/node2d\";\r\nimport { PathData } from \"@/render/descriptors/path\";\r\nimport { PathBuilder } from \"@/render/descriptors/path-builder\";\r\nimport { TextRange, TextSelection } from \"./text-selection\";\r\nimport { TextBase, TextBaseProps } from \"./text-base\";\r\nimport { type Command, type CommandArgs } from \"@/tween/command\";\r\nimport { command } from \"@/tween/command-decorator\";\r\n\r\n\r\nexport interface TextProps extends TextBaseProps {\r\n text: string;\r\n /** Wrap onto more lines once the text runs out of width. */\r\n wrap: boolean;\r\n /**\r\n * Wrap the text around a path (text-on-path). Accepts the same value shapes\r\n * as the {@link Path} node's `d`: an SVG path string, a `PathCommand[]`, or a\r\n * {@link PathBuilder}. When set, `wrap` and multi-line (`\\n`) are ignored\r\n * (single line), and text selections are not applied.\r\n */\r\n path: PathData | PathBuilder;\r\n /**\r\n * Stretches of `text` styled apart from the node — see {@link TextRun}.\r\n * Where two overlap the later one wins; offsets past the end of the string\r\n * style nothing. Ignored on a `path`, like selections.\r\n */\r\n runs: TextRun[];\r\n}\r\n\r\n/** Coerce the loosely-typed `path` input into stored {@link PathData} (or null). */\r\nfunction resolveTextPath(value: PathData | PathBuilder | null | undefined): PathData | null {\r\n if (value == null) return null;\r\n return value instanceof PathBuilder ? value.toCommands() : value;\r\n}\r\n\r\nfunction resolveTextRuns(value: TextRun[] | null | undefined): ResolvedTextRun[] {\r\n if (!Array.isArray(value)) return [];\r\n return value.map(({ fill, stroke, ...run }) => ({\r\n ...run,\r\n ...(fill === undefined ? {} : { fill: fillOps.resolve(fill) }),\r\n ...(stroke === undefined ? {} : { stroke: strokeOps.resolve(stroke) }),\r\n }));\r\n}\r\n\r\n\r\n/**\r\n * Copy somebody typed, set in a face.\r\n *\r\n * The shaping, measuring and drawing are {@link TextBase}'s, shared with every\r\n * other node that puts glyphs on the canvas. What is here is what belongs to a\r\n * string an *author owns*: the string itself, whether its lines break, the path\r\n * it can be wrapped around, the two commands that add to it, and the selection\r\n * API that styles part of it.\r\n */\r\nexport class Text extends TextBase<TextProps> {\r\n\r\n @textProperty() declare readonly text: string;\r\n @property({ default: false }) declare readonly wrap: boolean;\r\n @property({ default: null, mapper: resolveTextPath })\r\n declare readonly path: PathData | null;\r\n @property({ default: [], mapper: resolveTextRuns, animatable: false })\r\n declare readonly runs: ResolvedTextRun[];\r\n\r\n constructor(props: NodeConfig<Text, TextProps>) {\r\n super(props);\r\n }\r\n\r\n override displayText(): string {\r\n return this.text;\r\n }\r\n\r\n protected override get wrapsText(): boolean {\r\n return this.wrap;\r\n }\r\n\r\n protected override get glyphPath(): PathData | null {\r\n return this.path;\r\n }\r\n\r\n protected override styledRuns(): readonly TextSelection[] {\r\n return this._selections;\r\n }\r\n\r\n protected override styleRuns(): readonly ResolvedTextRun[] {\r\n return this.runs;\r\n }\r\n\r\n // Text fills rather than hugs on the axis something else has to settle:\r\n // `autofit` measures glyphs against the allotted box (the base's rule), and\r\n // `wrap` needs a width to break lines against.\r\n protected override applyDefaultSize(props?: NodeConfig<Text, TextProps>): void {\r\n const autofit = props?.fontSize === 'autofit';\r\n this.applyProp(\"height\", props?.height ?? (autofit ? \"fill\" : \"hug\"));\r\n this.applyProp(\"width\", props?.width ?? (autofit || props?.wrap ? \"fill\" : \"hug\"));\r\n }\r\n\r\n @command({ args: [{ key: \"text\", kind: \"text\", default: \"\", multiline: true }] })\r\n append(args: CommandArgs<{ text: string }> & { duration: number }): Command<TextProps> {\r\n const text = (args.data as { text: string }).text;\r\n return this.to({ data: { text: this.text + text }, duration: args.duration, easing: args.easing });\r\n }\r\n\r\n @command({ args: [{ key: \"text\", kind: \"text\", default: \"\", multiline: true }] })\r\n prepend(args: CommandArgs<{ text: string }> & { duration: number }): Command<TextProps> {\r\n const text = (args.data as { text: string }).text;\r\n return this.to({ data: { text: text + this.text }, duration: args.duration, easing: args.easing });\r\n }\r\n\r\n // ---- Text selection ---------------------------------------------------\r\n\r\n /** Live selections in creation order. Later ones win on overlapping glyphs. */\r\n private _selections: TextSelection[] = [];\r\n\r\n /** @internal Called by {@link TextSelection} on construction. */\r\n _registerSelection(selection: TextSelection): void {\r\n this._selections.push(selection);\r\n }\r\n\r\n /**\r\n * Select an occurrence of `text`. By default the first occurrence; pass\r\n * `{ index }` to target the nth (0-based).\r\n *\r\n * @example title().find(\"hello\").to({ opacity: 0.5 }, 1);\r\n */\r\n find(text: string, opts?: { index?: number }): TextSelection {\r\n const source = this.text;\r\n const ranges: TextRange[] = [];\r\n if (text.length > 0) {\r\n let from = 0;\r\n let i: number;\r\n while ((i = source.indexOf(text, from)) !== -1) {\r\n ranges.push({ start: i, end: i + text.length });\r\n from = i + text.length;\r\n }\r\n }\r\n const index = opts?.index ?? 0;\r\n const picked = ranges[index] ? [ranges[index]] : [];\r\n return new TextSelection(this, picked);\r\n }\r\n\r\n /** Select every match of `regex`. A non-global regex matches once. */\r\n match(regex: RegExp): TextSelection {\r\n const flags = regex.flags.includes(\"g\") ? regex.flags : regex.flags + \"g\";\r\n const re = new RegExp(regex.source, flags);\r\n const ranges: TextRange[] = [];\r\n let m: RegExpExecArray | null;\r\n while ((m = re.exec(this.text)) !== null) {\r\n if (m[0].length === 0) { re.lastIndex++; continue; }\r\n ranges.push({ start: m.index, end: m.index + m[0].length });\r\n }\r\n return new TextSelection(this, ranges);\r\n }\r\n\r\n /** Select the nth `\\n`-delimited line (0-based), excluding the newline. */\r\n line(n: number): TextSelection {\r\n const lines = this.text.split(\"\\n\");\r\n let cursor = 0;\r\n for (let i = 0; i < lines.length; i++) {\r\n const len = lines[i].length;\r\n if (i === n) return new TextSelection(this, [{ start: cursor, end: cursor + len }]);\r\n cursor += len + 1; // + the consumed \"\\n\"\r\n }\r\n return new TextSelection(this, []);\r\n }\r\n\r\n /** Select every whitespace-delimited word. */\r\n words(): TextSelection {\r\n return new TextSelection(this, this._wordRanges());\r\n }\r\n\r\n /** Select the nth whitespace-delimited word (0-based). */\r\n word(n: number): TextSelection {\r\n const r = this._wordRanges()[n];\r\n return new TextSelection(this, r ? [r] : []);\r\n }\r\n\r\n /** Select the raw character range `[start, end)`. */\r\n slice(start: number, end: number): TextSelection {\r\n return new TextSelection(this, [{ start, end }]);\r\n }\r\n\r\n /** Select characters for which `predicate` returns true; adjacent hits merge. */\r\n filter(predicate: (char: string, index: number) => boolean): TextSelection {\r\n const ranges: TextRange[] = [];\r\n let runStart = -1;\r\n for (let i = 0; i < this.text.length; i++) {\r\n if (predicate(this.text[i], i)) {\r\n if (runStart === -1) runStart = i;\r\n } else if (runStart !== -1) {\r\n ranges.push({ start: runStart, end: i });\r\n runStart = -1;\r\n }\r\n }\r\n if (runStart !== -1) ranges.push({ start: runStart, end: this.text.length });\r\n return new TextSelection(this, ranges);\r\n }\r\n\r\n private _wordRanges(): TextRange[] {\r\n const ranges: TextRange[] = [];\r\n const re = /\\S+/g;\r\n let m: RegExpExecArray | null;\r\n while ((m = re.exec(this.text)) !== null) {\r\n ranges.push({ start: m.index, end: m.index + m[0].length });\r\n }\r\n return ranges;\r\n }\r\n}\r\n"]}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { EasingFunction } from "../../tween/ease/type.js";
|
|
2
|
-
import { TweenStepper } from "../../tween/stepper.js";
|
|
3
|
-
import { type AnimationTarget } from "../../tween/to-command.js";
|
|
4
|
-
import { Fill } from "../../attributes/shape/fill/chain.js";
|
|
5
|
-
import { FillResolved } from "../../attributes/shape/fill/union.js";
|
|
6
|
-
import { Stroke, StrokeResolved } from "../../attributes/shape/stroke/stroke.js";
|
|
7
|
-
import type { FontStyle } from "../../attributes/text/types.js";
|
|
8
|
-
import type { Text } from "./text-node.js";
|
|
9
|
-
/**
|
|
10
|
-
* The size a selection's `fontSize` starts from on an `'autofit'` node.
|
|
11
|
-
*
|
|
12
|
-
* The same 100 the segmented layout probes with (`layoutTextSegments`), so a
|
|
13
|
-
* selection that never touches its size reports the number that block is
|
|
14
|
-
* actually shaped at rather than a second, different guess.
|
|
15
|
-
*/
|
|
16
|
-
export declare const AUTOFIT_PROBE_SIZE = 100;
|
|
17
|
-
import { type Command, type CommandArgs } from "../../tween/command.js";
|
|
18
|
-
/** A half-open character range `[start, end)` of a Text node's string. */
|
|
19
|
-
export interface TextRange {
|
|
20
|
-
start: number;
|
|
21
|
-
end: number;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Properties a {@link TextSelection} can animate. Transform/opacity/font fields
|
|
25
|
-
* are numeric; `fill`/`stroke` accept any author-facing paint and are resolved
|
|
26
|
-
* before tweening (mirroring how {@link Text} resolves its own paint).
|
|
27
|
-
*
|
|
28
|
-
* `fontFamily` and `fontStyle` are the two that cannot tween, and they are here
|
|
29
|
-
* anyway: what a selection is for is styling a run differently from its
|
|
30
|
-
* neighbours, and a model that can change a word's weight but not its face is
|
|
31
|
-
* one an editor has to work around rather than with. They switch at the end of a
|
|
32
|
-
* step rather than interpolating - see {@link TextSelection._prepareStep} - for
|
|
33
|
-
* the same reason a blend mode does: there is no half-way between two typefaces,
|
|
34
|
-
* and inventing one would be a frame of text set in neither.
|
|
35
|
-
*/
|
|
36
|
-
export interface TextSelectionProps {
|
|
37
|
-
opacity: number;
|
|
38
|
-
x: number;
|
|
39
|
-
y: number;
|
|
40
|
-
scale: number;
|
|
41
|
-
rotation: number;
|
|
42
|
-
fontFamily: string;
|
|
43
|
-
fontSize: number;
|
|
44
|
-
fontStyle: FontStyle;
|
|
45
|
-
fontWeight: number;
|
|
46
|
-
letterSpacing: number;
|
|
47
|
-
fill: Fill;
|
|
48
|
-
stroke: Stroke;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Live, resolved override state for a selection, read by the Text node each
|
|
52
|
-
* frame to build per-piece segments. `fill`/`stroke` are `null` until set,
|
|
53
|
-
* meaning "inherit the node's paint".
|
|
54
|
-
*/
|
|
55
|
-
export interface SelectionOverrides {
|
|
56
|
-
opacity: number;
|
|
57
|
-
x: number;
|
|
58
|
-
y: number;
|
|
59
|
-
scale: number;
|
|
60
|
-
rotation: number;
|
|
61
|
-
fontFamily: string;
|
|
62
|
-
fontSize: number;
|
|
63
|
-
fontStyle: FontStyle;
|
|
64
|
-
fontWeight: number;
|
|
65
|
-
letterSpacing: number;
|
|
66
|
-
fill: FillResolved[] | null;
|
|
67
|
-
stroke: StrokeResolved[] | null;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* A sub-range of a {@link Text} node's glyphs that can be animated
|
|
71
|
-
* independently. Returned by the node's selector methods (`find`, `match`,
|
|
72
|
-
* `line`, `word`, `words`, `slice`, `filter`).
|
|
73
|
-
*
|
|
74
|
-
* Implements {@link AnimationTarget} so `selection.to({ ... }, duration)`
|
|
75
|
-
* plugs straight into the existing `Command` / `parallel` / `sequence`
|
|
76
|
-
* machinery — each tween writes resolved values into {@link overrides}, which
|
|
77
|
-
* the node reads when splitting its text into rendered pieces.
|
|
78
|
-
*
|
|
79
|
-
* @example
|
|
80
|
-
* textRef().find("hello").to({ opacity: 0.5, y: -10 }, 1);
|
|
81
|
-
*/
|
|
82
|
-
export declare class TextSelection implements AnimationTarget<TextSelectionProps> {
|
|
83
|
-
readonly node: Text;
|
|
84
|
-
readonly ranges: TextRange[];
|
|
85
|
-
/**
|
|
86
|
-
* Current resolved overrides for this selection. Numeric fields default to
|
|
87
|
-
* the node's current values (so a partial tween starts from the node's
|
|
88
|
-
* style); `fill`/`stroke` start as `null` (inherit) until tweened.
|
|
89
|
-
*/
|
|
90
|
-
readonly overrides: SelectionOverrides;
|
|
91
|
-
constructor(node: Text, ranges: TextRange[]);
|
|
92
|
-
/** True when this selection has no overrides differing from the node default. */
|
|
93
|
-
get isIdentity(): boolean;
|
|
94
|
-
/**
|
|
95
|
-
* Write overrides straight onto the selection - no tween, no command.
|
|
96
|
-
*
|
|
97
|
-
* `to()` is the animation door and this is the *styling* one: an editor that
|
|
98
|
-
* paints one word red is stating what the run **is**, not scheduling it, and
|
|
99
|
-
* a zero-length `to()` would say the same thing while also landing a step on
|
|
100
|
-
* the node's timeline for something that never moves. Paints are resolved
|
|
101
|
-
* here exactly as `to()` resolves them, so a run styled this way and a run
|
|
102
|
-
* tweened to the same value hold identical resolved arrays.
|
|
103
|
-
*
|
|
104
|
-
* Returns `this`, so a range and its style read as one expression.
|
|
105
|
-
*/
|
|
106
|
-
set(props: Partial<TextSelectionProps>): this;
|
|
107
|
-
to<D extends Partial<TextSelectionProps> = Partial<TextSelectionProps>>(args: CommandArgs<D> & {
|
|
108
|
-
duration: number;
|
|
109
|
-
}): Command<TextSelectionProps>;
|
|
110
|
-
/**
|
|
111
|
-
* Resolve one `to()` step into a flat {@link TweenStepper}. Numeric props
|
|
112
|
-
* (opacity/x/y/scale/rotation/fontWeight/letterSpacing) interpolate
|
|
113
|
-
* directly; `fill`/`stroke` resolve their target once and lerp via the
|
|
114
|
-
* shared fill/stroke array lerps — mirroring {@link Node2D._prepareStep}.
|
|
115
|
-
*/
|
|
116
|
-
_prepareStep(to: Partial<TextSelectionProps>, duration: number, easing?: EasingFunction): TweenStepper;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Clamp ranges to `[0, length]`, drop empties, sort by start, and merge any
|
|
120
|
-
* that touch or overlap so each glyph is covered once per selection. The
|
|
121
|
-
* relative order selections were *created* in is preserved across selections by
|
|
122
|
-
* the node's registry, not here.
|
|
123
|
-
*/
|
|
124
|
-
export declare function normalizeRanges(ranges: TextRange[], length: number): TextRange[];
|
|
125
|
-
//# sourceMappingURL=text-selection.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text-selection.d.ts","sourceRoot":"","sources":["../../../src/nodes/text/text-selection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAa,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,cAAc,EAAa,MAAM,kCAAkC,CAAC;AACrF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,MAAM,CAAC;AACtC,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGjE,0EAA0E;AAC1E,MAAM,WAAW,SAAS;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,kBAAkB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,CAA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