@open-pencil/scene-graph 0.17.0 → 0.18.0-beta.2
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/dist/arrow-caps.d.ts +14 -17
- package/dist/arrow-caps.d.ts.map +1 -1
- package/dist/arrow-caps.js +1 -2
- package/dist/asset-keys.d.ts +5 -8
- package/dist/asset-keys.d.ts.map +1 -1
- package/dist/asset-keys.js +2 -3
- package/dist/behaviours/index.d.ts +6 -4
- package/dist/behaviours/index.js +6 -4
- package/dist/behaviours/kinds.d.ts +38 -15
- package/dist/behaviours/kinds.d.ts.map +1 -1
- package/dist/behaviours/kinds.js +134 -12
- package/dist/behaviours/kinds.js.map +1 -1
- package/dist/behaviours/layers.d.ts +3 -6
- package/dist/behaviours/layers.d.ts.map +1 -1
- package/dist/behaviours/layers.js +1 -2
- package/dist/behaviours/listing.d.ts +58 -0
- package/dist/behaviours/listing.d.ts.map +1 -0
- package/dist/behaviours/listing.js +98 -0
- package/dist/behaviours/listing.js.map +1 -0
- package/dist/behaviours/model.d.ts +19 -16
- package/dist/behaviours/model.d.ts.map +1 -1
- package/dist/behaviours/model.js +14 -6
- package/dist/behaviours/model.js.map +1 -1
- package/dist/behaviours/schema.d.ts +150 -17
- package/dist/behaviours/schema.d.ts.map +1 -1
- package/dist/behaviours/schema.js +19 -5
- package/dist/behaviours/schema.js.map +1 -1
- package/dist/behaviours/spec.d.ts +3 -6
- package/dist/behaviours/spec.d.ts.map +1 -1
- package/dist/behaviours/spec.js +7 -4
- package/dist/behaviours/spec.js.map +1 -1
- package/dist/behaviours/transition.d.ts +20 -0
- package/dist/behaviours/transition.d.ts.map +1 -0
- package/dist/behaviours/transition.js +35 -0
- package/dist/behaviours/transition.js.map +1 -0
- package/dist/bindings.js +2 -3
- package/dist/blur.d.ts +35 -0
- package/dist/blur.d.ts.map +1 -0
- package/dist/blur.js +69 -0
- package/dist/blur.js.map +1 -0
- package/dist/buffered-events.d.ts +3 -6
- package/dist/buffered-events.d.ts.map +1 -1
- package/dist/buffered-events.js +1 -2
- package/dist/buffered-events.js.map +1 -1
- package/dist/checkpoint.d.ts +3 -6
- package/dist/checkpoint.d.ts.map +1 -1
- package/dist/checkpoint.js +4 -3
- package/dist/checkpoint.js.map +1 -1
- package/dist/clipping.d.ts +4 -7
- package/dist/clipping.d.ts.map +1 -1
- package/dist/clipping.js +4 -16
- package/dist/clipping.js.map +1 -1
- package/dist/color/contrast.d.ts +4 -7
- package/dist/color/contrast.d.ts.map +1 -1
- package/dist/color/contrast.js +2 -3
- package/dist/color/index.d.ts +21 -20
- package/dist/color/index.d.ts.map +1 -1
- package/dist/color/index.js +16 -27
- package/dist/color/index.js.map +1 -1
- package/dist/color/management.d.ts +50 -25
- package/dist/color/management.d.ts.map +1 -1
- package/dist/color/management.js +155 -151
- package/dist/color/management.js.map +1 -1
- package/dist/color/normalize.d.ts +1 -4
- package/dist/color/normalize.d.ts.map +1 -1
- package/dist/color/normalize.js +1 -2
- package/dist/color/okhcl.d.ts +36 -21
- package/dist/color/okhcl.d.ts.map +1 -1
- package/dist/color/okhcl.js +57 -42
- package/dist/color/okhcl.js.map +1 -1
- package/dist/color/schema.d.ts +6 -4
- package/dist/color/schema.d.ts.map +1 -1
- package/dist/color/schema.js +12 -4
- package/dist/color/schema.js.map +1 -1
- package/dist/comments/document.d.ts +3 -6
- package/dist/comments/document.d.ts.map +1 -1
- package/dist/comments/document.js +1 -2
- package/dist/comments/index.js +2 -2
- package/dist/comments/list.d.ts +5 -8
- package/dist/comments/list.d.ts.map +1 -1
- package/dist/comments/list.js +1 -2
- package/dist/comments/merge.d.ts +2 -5
- package/dist/comments/merge.d.ts.map +1 -1
- package/dist/comments/merge.js +1 -2
- package/dist/comments/schema.d.ts +2 -5
- package/dist/comments/schema.d.ts.map +1 -1
- package/dist/comments/schema.js +1 -2
- package/dist/comments/threads.d.ts +16 -19
- package/dist/comments/threads.d.ts.map +1 -1
- package/dist/comments/threads.js +8 -3
- package/dist/comments/threads.js.map +1 -1
- package/dist/components/exposure.d.ts +4 -7
- package/dist/components/exposure.d.ts.map +1 -1
- package/dist/components/exposure.js +1 -2
- package/dist/components/properties.d.ts +13 -16
- package/dist/components/properties.d.ts.map +1 -1
- package/dist/components/properties.js +3 -4
- package/dist/components/variants.d.ts +5 -8
- package/dist/components/variants.d.ts.map +1 -1
- package/dist/components/variants.js +1 -2
- package/dist/connectors/controls.d.ts +6 -9
- package/dist/connectors/controls.d.ts.map +1 -1
- package/dist/connectors/controls.js +2 -3
- package/dist/connectors/create.d.ts +3 -6
- package/dist/connectors/create.d.ts.map +1 -1
- package/dist/connectors/create.js +2 -3
- package/dist/connectors/elbow.js +0 -1
- package/dist/connectors/gaps.d.ts +1 -4
- package/dist/connectors/gaps.d.ts.map +1 -1
- package/dist/connectors/gaps.js +1 -2
- package/dist/connectors/hit.d.ts +1 -4
- package/dist/connectors/hit.d.ts.map +1 -1
- package/dist/connectors/hit.js +3 -4
- package/dist/connectors/index.d.ts +3 -3
- package/dist/connectors/index.js +6 -6
- package/dist/connectors/label.d.ts +4 -7
- package/dist/connectors/label.d.ts.map +1 -1
- package/dist/connectors/label.js +1 -2
- package/dist/connectors/layout.d.ts +8 -10
- package/dist/connectors/layout.d.ts.map +1 -1
- package/dist/connectors/layout.js +12 -10
- package/dist/connectors/layout.js.map +1 -1
- package/dist/connectors/pieces.d.ts +2 -5
- package/dist/connectors/pieces.d.ts.map +1 -1
- package/dist/connectors/pieces.js +3 -4
- package/dist/connectors/pieces.js.map +1 -1
- package/dist/connectors/route.d.ts +2 -5
- package/dist/connectors/route.d.ts.map +1 -1
- package/dist/connectors/route.js +4 -5
- package/dist/connectors/sides.d.ts +3 -6
- package/dist/connectors/sides.d.ts.map +1 -1
- package/dist/connectors/sides.js +2 -3
- package/dist/connectors/sublayers.d.ts +21 -24
- package/dist/connectors/sublayers.d.ts.map +1 -1
- package/dist/connectors/sublayers.js +3 -3
- package/dist/connectors/sublayers.js.map +1 -1
- package/dist/constants.d.ts +13 -16
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -2
- package/dist/constraints.d.ts +6 -8
- package/dist/constraints.d.ts.map +1 -1
- package/dist/constraints.js +3 -3
- package/dist/constraints.js.map +1 -1
- package/dist/coordinate.d.ts +27 -29
- package/dist/coordinate.d.ts.map +1 -1
- package/dist/coordinate.js +19 -38
- package/dist/coordinate.js.map +1 -1
- package/dist/copy.d.ts +36 -24
- package/dist/copy.d.ts.map +1 -1
- package/dist/copy.js +33 -4
- package/dist/copy.js.map +1 -1
- package/dist/corners.d.ts +9 -9
- package/dist/corners.d.ts.map +1 -1
- package/dist/corners.js +4 -3
- package/dist/corners.js.map +1 -1
- package/dist/css/blend.d.ts +1 -4
- package/dist/css/blend.d.ts.map +1 -1
- package/dist/css/blend.js +1 -2
- package/dist/css/grid.d.ts +1 -4
- package/dist/css/grid.d.ts.map +1 -1
- package/dist/css/grid.js +3 -4
- package/dist/css/index.d.ts +2 -1
- package/dist/css/index.js +3 -2
- package/dist/css/layout.d.ts +7 -10
- package/dist/css/layout.d.ts.map +1 -1
- package/dist/css/layout.js +2 -3
- package/dist/css/motion.d.ts +9 -0
- package/dist/css/motion.d.ts.map +1 -0
- package/dist/css/motion.js +59 -0
- package/dist/css/motion.js.map +1 -0
- package/dist/css/shadows.d.ts +4 -6
- package/dist/css/shadows.d.ts.map +1 -1
- package/dist/css/shadows.js +9 -9
- package/dist/css/shadows.js.map +1 -1
- package/dist/css/text.d.ts +8 -11
- package/dist/css/text.d.ts.map +1 -1
- package/dist/css/text.js +1 -2
- package/dist/css/transform.d.ts +6 -9
- package/dist/css/transform.d.ts.map +1 -1
- package/dist/css/transform.js +2 -3
- package/dist/css/values.d.ts +11 -13
- package/dist/css/values.d.ts.map +1 -1
- package/dist/css/values.js +5 -6
- package/dist/css/values.js.map +1 -1
- package/dist/cubic.d.ts +11 -5
- package/dist/cubic.d.ts.map +1 -1
- package/dist/cubic.js +71 -3
- package/dist/cubic.js.map +1 -1
- package/dist/events.js +1 -2
- package/dist/export-format.d.ts +5 -8
- package/dist/export-format.d.ts.map +1 -1
- package/dist/export-format.js +4 -3
- package/dist/export-format.js.map +1 -1
- package/dist/export-scale.d.ts +4 -7
- package/dist/export-scale.d.ts.map +1 -1
- package/dist/export-scale.js +1 -2
- package/dist/fields/appearance.d.ts +3 -6
- package/dist/fields/appearance.d.ts.map +1 -1
- package/dist/fields/appearance.js +1 -2
- package/dist/fields/geometry.d.ts +2 -5
- package/dist/fields/geometry.d.ts.map +1 -1
- package/dist/fields/geometry.js +1 -2
- package/dist/fields/index.d.ts +2 -2
- package/dist/fields/index.js +3 -3
- package/dist/fields/layout.d.ts +5 -6
- package/dist/fields/layout.d.ts.map +1 -1
- package/dist/fields/layout.js +10 -3
- package/dist/fields/layout.js.map +1 -1
- package/dist/fields/text.d.ts +5 -8
- package/dist/fields/text.d.ts.map +1 -1
- package/dist/fields/text.js +1 -2
- package/dist/fig-compression.d.ts +3 -6
- package/dist/fig-compression.d.ts.map +1 -1
- package/dist/fig-compression.js +1 -2
- package/dist/figjam/index.js +1 -1
- package/dist/figjam/palette.d.ts +21 -23
- package/dist/figjam/palette.d.ts.map +1 -1
- package/dist/figjam/palette.js +3 -4
- package/dist/figjam/text.d.ts +10 -13
- package/dist/figjam/text.d.ts.map +1 -1
- package/dist/figjam/text.js +1 -2
- package/dist/font-style.d.ts +18 -18
- package/dist/font-style.d.ts.map +1 -1
- package/dist/font-style.js +12 -8
- package/dist/font-style.js.map +1 -1
- package/dist/generated/index.d.ts +35 -15
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +50 -12
- package/dist/generated/index.js.map +1 -1
- package/dist/generated/kind.d.ts +17 -6
- package/dist/generated/kind.d.ts.map +1 -1
- package/dist/generated/shape-with-text.d.ts +10 -13
- package/dist/generated/shape-with-text.d.ts.map +1 -1
- package/dist/generated/shape-with-text.js +3 -3
- package/dist/generated/shape-with-text.js.map +1 -1
- package/dist/generated/spec.d.ts +45 -0
- package/dist/generated/spec.d.ts.map +1 -0
- package/dist/generated/spec.js +281 -0
- package/dist/generated/spec.js.map +1 -0
- package/dist/generated/sticky.d.ts +23 -26
- package/dist/generated/sticky.d.ts.map +1 -1
- package/dist/generated/sticky.js +4 -4
- package/dist/generated/sticky.js.map +1 -1
- package/dist/geometry.d.ts +47 -68
- package/dist/geometry.d.ts.map +1 -1
- package/dist/geometry.js +53 -77
- package/dist/geometry.js.map +1 -1
- package/dist/gradient.d.ts +15 -18
- package/dist/gradient.d.ts.map +1 -1
- package/dist/gradient.js +1 -2
- package/dist/graph.d.ts +33 -11
- package/dist/graph.d.ts.map +1 -1
- package/dist/graph.js +85 -28
- package/dist/graph.js.map +1 -1
- package/dist/group-bounds.d.ts +15 -14
- package/dist/group-bounds.d.ts.map +1 -1
- package/dist/group-bounds.js +41 -12
- package/dist/group-bounds.js.map +1 -1
- package/dist/guides.d.ts +5 -8
- package/dist/guides.d.ts.map +1 -1
- package/dist/guides.js +2 -3
- package/dist/hit-test.d.ts +20 -12
- package/dist/hit-test.d.ts.map +1 -1
- package/dist/hit-test.js +69 -38
- package/dist/hit-test.js.map +1 -1
- package/dist/icons/fit.d.ts +2 -4
- package/dist/icons/fit.d.ts.map +1 -1
- package/dist/icons/fit.js +1 -2
- package/dist/icons/glyph.d.ts +3 -5
- package/dist/icons/glyph.d.ts.map +1 -1
- package/dist/icons/glyph.js +3 -4
- package/dist/icons/index.d.ts +1 -1
- package/dist/icons/index.js +2 -2
- package/dist/icons/model.d.ts +8 -11
- package/dist/icons/model.d.ts.map +1 -1
- package/dist/icons/model.js +1 -2
- package/dist/icons/schema.d.ts +8 -11
- package/dist/icons/schema.d.ts.map +1 -1
- package/dist/icons/schema.js +1 -2
- package/dist/ids.d.ts +2 -5
- package/dist/ids.d.ts.map +1 -1
- package/dist/ids.js +3 -4
- package/dist/images.d.ts +20 -21
- package/dist/images.d.ts.map +1 -1
- package/dist/images.js +7 -6
- package/dist/images.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/instances/assignments.js +1 -2
- package/dist/instances/content-marks.js +98 -0
- package/dist/instances/content-marks.js.map +1 -0
- package/dist/instances/content-size.js +2 -3
- package/dist/instances/copies.js +2 -3
- package/dist/instances/cycles.d.ts +3 -6
- package/dist/instances/cycles.d.ts.map +1 -1
- package/dist/instances/cycles.js +1 -2
- package/dist/instances/deleted.d.ts +23 -0
- package/dist/instances/deleted.d.ts.map +1 -0
- package/dist/instances/deleted.js +82 -0
- package/dist/instances/deleted.js.map +1 -0
- package/dist/instances/fields.d.ts +5 -8
- package/dist/instances/fields.d.ts.map +1 -1
- package/dist/instances/fields.js +11 -7
- package/dist/instances/fields.js.map +1 -1
- package/dist/instances/index.d.ts +21 -20
- package/dist/instances/index.d.ts.map +1 -1
- package/dist/instances/index.js +116 -20
- package/dist/instances/index.js.map +1 -1
- package/dist/instances/kept-overrides.js +4 -5
- package/dist/instances/lookup.d.ts +17 -0
- package/dist/instances/lookup.d.ts.map +1 -0
- package/dist/instances/lookup.js +48 -0
- package/dist/instances/lookup.js.map +1 -0
- package/dist/instances/main-component.d.ts +2 -5
- package/dist/instances/main-component.d.ts.map +1 -1
- package/dist/instances/main-component.js +1 -2
- package/dist/instances/matching.js +1 -2
- package/dist/instances/overrides.d.ts +23 -26
- package/dist/instances/overrides.d.ts.map +1 -1
- package/dist/instances/overrides.js +1 -2
- package/dist/instances/placement.js +3 -4
- package/dist/instances/protection.js +3 -4
- package/dist/instances/source-walk.js +1 -2
- package/dist/instances/swap.js +7 -8
- package/dist/instances/sync.js +91 -18
- package/dist/instances/sync.js.map +1 -1
- package/dist/instances/vector-geometry.js +2 -3
- package/dist/layout/aspect-ratio.d.ts +7 -9
- package/dist/layout/aspect-ratio.d.ts.map +1 -1
- package/dist/layout/aspect-ratio.js +1 -2
- package/dist/layout/flow.d.ts +13 -0
- package/dist/layout/flow.d.ts.map +1 -0
- package/dist/layout/flow.js +35 -0
- package/dist/layout/flow.js.map +1 -0
- package/dist/layout/guides.d.ts +13 -16
- package/dist/layout/guides.d.ts.map +1 -1
- package/dist/layout/guides.js +4 -5
- package/dist/layout/guides.js.map +1 -1
- package/dist/layout/index.d.ts +6 -4
- package/dist/layout/index.js +7 -5
- package/dist/layout/keywords.d.ts +7 -9
- package/dist/layout/keywords.d.ts.map +1 -1
- package/dist/layout/keywords.js +8 -3
- package/dist/layout/keywords.js.map +1 -1
- package/dist/layout/limits.d.ts +13 -16
- package/dist/layout/limits.d.ts.map +1 -1
- package/dist/layout/limits.js +1 -2
- package/dist/layout/sizing.d.ts +18 -12
- package/dist/layout/sizing.d.ts.map +1 -1
- package/dist/layout/sizing.js +18 -3
- package/dist/layout/sizing.js.map +1 -1
- package/dist/layout/spacing.d.ts +7 -4
- package/dist/layout/spacing.d.ts.map +1 -1
- package/dist/layout/spacing.js +11 -3
- package/dist/layout/spacing.js.map +1 -1
- package/dist/layout/stacking.d.ts +8 -0
- package/dist/layout/stacking.d.ts.map +1 -0
- package/dist/layout/stacking.js +12 -0
- package/dist/layout/stacking.js.map +1 -0
- package/dist/layout/strokes.d.ts +1 -4
- package/dist/layout/strokes.d.ts.map +1 -1
- package/dist/layout/strokes.js +1 -2
- package/dist/layout/writes.js +1 -2
- package/dist/layout/writes.js.map +1 -1
- package/dist/masks.d.ts +4 -7
- package/dist/masks.d.ts.map +1 -1
- package/dist/masks.js +1 -2
- package/dist/matrix.d.ts +3 -4
- package/dist/matrix.d.ts.map +1 -1
- package/dist/matrix.js +11 -3
- package/dist/matrix.js.map +1 -1
- package/dist/mesh/geometry.d.ts +80 -0
- package/dist/mesh/geometry.d.ts.map +1 -0
- package/dist/mesh/geometry.js +430 -0
- package/dist/mesh/geometry.js.map +1 -0
- package/dist/mesh/index.d.ts +4 -0
- package/dist/mesh/index.js +4 -0
- package/dist/mesh/model.d.ts +25 -0
- package/dist/mesh/model.d.ts.map +1 -0
- package/dist/mesh/model.js +39 -0
- package/dist/mesh/model.js.map +1 -0
- package/dist/mesh/schema.d.ts +188 -0
- package/dist/mesh/schema.d.ts.map +1 -0
- package/dist/mesh/schema.js +55 -0
- package/dist/mesh/schema.js.map +1 -0
- package/dist/motion/apply.d.ts +42 -0
- package/dist/motion/apply.d.ts.map +1 -0
- package/dist/motion/apply.js +98 -0
- package/dist/motion/apply.js.map +1 -0
- package/dist/motion/edit.d.ts +53 -0
- package/dist/motion/edit.d.ts.map +1 -0
- package/dist/motion/edit.js +125 -0
- package/dist/motion/edit.js.map +1 -0
- package/dist/motion/effects.js +86 -0
- package/dist/motion/effects.js.map +1 -0
- package/dist/motion/evaluate.d.ts +33 -0
- package/dist/motion/evaluate.d.ts.map +1 -0
- package/dist/motion/evaluate.js +160 -0
- package/dist/motion/evaluate.js.map +1 -0
- package/dist/motion/fields.d.ts +69 -0
- package/dist/motion/fields.d.ts.map +1 -0
- package/dist/motion/fields.js +132 -0
- package/dist/motion/fields.js.map +1 -0
- package/dist/motion/index.d.ts +16 -0
- package/dist/motion/index.js +15 -0
- package/dist/motion/keyable.d.ts +32 -0
- package/dist/motion/keyable.d.ts.map +1 -0
- package/dist/motion/keyable.js +120 -0
- package/dist/motion/keyable.js.map +1 -0
- package/dist/motion/outline.d.ts +35 -0
- package/dist/motion/outline.d.ts.map +1 -0
- package/dist/motion/outline.js +59 -0
- package/dist/motion/outline.js.map +1 -0
- package/dist/motion/presets/index.d.ts +20 -0
- package/dist/motion/presets/index.d.ts.map +1 -0
- package/dist/motion/presets/index.js +166 -0
- package/dist/motion/presets/index.js.map +1 -0
- package/dist/motion/presets/settings.d.ts +43 -0
- package/dist/motion/presets/settings.d.ts.map +1 -0
- package/dist/motion/presets/settings.js +254 -0
- package/dist/motion/presets/settings.js.map +1 -0
- package/dist/motion/presets/stagger.d.ts +69 -0
- package/dist/motion/presets/stagger.d.ts.map +1 -0
- package/dist/motion/presets/stagger.js +185 -0
- package/dist/motion/presets/stagger.js.map +1 -0
- package/dist/motion/schema.d.ts +185 -0
- package/dist/motion/schema.d.ts.map +1 -0
- package/dist/motion/schema.js +62 -0
- package/dist/motion/schema.js.map +1 -0
- package/dist/motion/segment.d.ts +25 -0
- package/dist/motion/segment.d.ts.map +1 -0
- package/dist/motion/segment.js +73 -0
- package/dist/motion/segment.js.map +1 -0
- package/dist/motion/spec.d.ts +26 -0
- package/dist/motion/spec.d.ts.map +1 -0
- package/dist/motion/spec.js +175 -0
- package/dist/motion/spec.js.map +1 -0
- package/dist/motion/timeline.d.ts +16 -0
- package/dist/motion/timeline.d.ts.map +1 -0
- package/dist/motion/timeline.js +53 -0
- package/dist/motion/timeline.js.map +1 -0
- package/dist/motion/types.d.ts +49 -0
- package/dist/motion/types.d.ts.map +1 -0
- package/dist/motion/variables.d.ts +9 -0
- package/dist/motion/variables.d.ts.map +1 -0
- package/dist/motion/variables.js +25 -0
- package/dist/motion/variables.js.map +1 -0
- package/dist/mutation-impact.d.ts +9 -10
- package/dist/mutation-impact.d.ts.map +1 -1
- package/dist/mutation-impact.js +19 -9
- package/dist/mutation-impact.js.map +1 -1
- package/dist/node-defaults.d.ts +15 -14
- package/dist/node-defaults.d.ts.map +1 -1
- package/dist/node-defaults.js +153 -55
- package/dist/node-defaults.js.map +1 -1
- package/dist/order-keys.d.ts +8 -9
- package/dist/order-keys.d.ts.map +1 -1
- package/dist/order-keys.js +10 -2
- package/dist/order-keys.js.map +1 -1
- package/dist/outline/flatten.d.ts +3 -6
- package/dist/outline/flatten.d.ts.map +1 -1
- package/dist/outline/flatten.js +3 -4
- package/dist/outline/heads.js +1 -2
- package/dist/outline/hit.d.ts +2 -5
- package/dist/outline/hit.d.ts.map +1 -1
- package/dist/outline/hit.js +5 -6
- package/dist/outline/index.js +3 -3
- package/dist/outline/point.d.ts +4 -7
- package/dist/outline/point.d.ts.map +1 -1
- package/dist/outline/point.js +2 -3
- package/dist/outline/shapes.d.ts +4 -7
- package/dist/outline/shapes.d.ts.map +1 -1
- package/dist/outline/shapes.js +2 -3
- package/dist/paints/index.d.ts +5 -3
- package/dist/paints/index.js +5 -3
- package/dist/paints/pattern.d.ts +6 -5
- package/dist/paints/pattern.d.ts.map +1 -1
- package/dist/paints/pattern.js +34 -3
- package/dist/paints/pattern.js.map +1 -1
- package/dist/paints/schema.d.ts +4 -7
- package/dist/paints/schema.d.ts.map +1 -1
- package/dist/paints/schema.js +3 -4
- package/dist/paints/shows.d.ts +4 -4
- package/dist/paints/shows.d.ts.map +1 -1
- package/dist/paints/shows.js +9 -3
- package/dist/paints/shows.js.map +1 -1
- package/dist/paints/solid.d.ts +8 -0
- package/dist/paints/solid.d.ts.map +1 -0
- package/dist/paints/solid.js +17 -0
- package/dist/paints/solid.js.map +1 -0
- package/dist/paints/stills.d.ts +74 -0
- package/dist/paints/stills.d.ts.map +1 -0
- package/dist/paints/stills.js +117 -0
- package/dist/paints/stills.js.map +1 -0
- package/dist/parse-path.d.ts +12 -9
- package/dist/parse-path.d.ts.map +1 -1
- package/dist/parse-path.js +13 -3
- package/dist/parse-path.js.map +1 -1
- package/dist/paths/arc.d.ts +6 -9
- package/dist/paths/arc.d.ts.map +1 -1
- package/dist/paths/arc.js +1 -2
- package/dist/paths/index.d.ts +1 -1
- package/dist/paths/index.js +1 -1
- package/dist/paths/network.d.ts +13 -16
- package/dist/paths/network.d.ts.map +1 -1
- package/dist/paths/network.js +1 -2
- package/dist/paths/sink.d.ts +5 -8
- package/dist/paths/sink.d.ts.map +1 -1
- package/dist/paths/sink.js +1 -2
- package/dist/paths/smooth-corners.d.ts +3 -6
- package/dist/paths/smooth-corners.d.ts.map +1 -1
- package/dist/paths/smooth-corners.js +1 -2
- package/dist/plugin-data/field.d.ts +15 -18
- package/dist/plugin-data/field.d.ts.map +1 -1
- package/dist/plugin-data/field.js +3 -2
- package/dist/plugin-data/field.js.map +1 -1
- package/dist/plugin-data/fields.d.ts +104 -11
- package/dist/plugin-data/fields.d.ts.map +1 -1
- package/dist/plugin-data/fields.js +43 -13
- package/dist/plugin-data/fields.js.map +1 -1
- package/dist/plugin-data/index.d.ts +2 -2
- package/dist/plugin-data/index.js +2 -2
- package/dist/polygon.d.ts +8 -8
- package/dist/polygon.d.ts.map +1 -1
- package/dist/polygon.js +7 -7
- package/dist/polygon.js.map +1 -1
- package/dist/preview.d.ts +3 -5
- package/dist/preview.d.ts.map +1 -1
- package/dist/preview.js +2 -3
- package/dist/primitives/index.d.ts +7 -9
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +1 -2
- package/dist/primitives/schema.d.ts +3 -6
- package/dist/primitives/schema.d.ts.map +1 -1
- package/dist/primitives/schema.js +1 -2
- package/dist/resize.d.ts +19 -14
- package/dist/resize.d.ts.map +1 -1
- package/dist/resize.js +38 -8
- package/dist/resize.js.map +1 -1
- package/dist/scaling/index.d.ts +2 -2
- package/dist/scaling/index.js +2 -2
- package/dist/scaling/node.d.ts +2 -4
- package/dist/scaling/node.d.ts.map +1 -1
- package/dist/scaling/node.js +30 -11
- package/dist/scaling/node.js.map +1 -1
- package/dist/scaling/snapshot.d.ts +5 -8
- package/dist/scaling/snapshot.d.ts.map +1 -1
- package/dist/scaling/snapshot.js +1 -2
- package/dist/scaling/tree.d.ts +6 -9
- package/dist/scaling/tree.d.ts.map +1 -1
- package/dist/scaling/tree.js +2 -3
- package/dist/shaders/index.d.ts +2 -3
- package/dist/shaders/index.js +2 -3
- package/dist/shaders/model.d.ts +54 -21
- package/dist/shaders/model.d.ts.map +1 -1
- package/dist/shaders/model.js +103 -35
- package/dist/shaders/model.js.map +1 -1
- package/dist/shaders/schema.d.ts +16 -9
- package/dist/shaders/schema.d.ts.map +1 -1
- package/dist/shaders/schema.js +12 -3
- package/dist/shaders/schema.js.map +1 -1
- package/dist/shape-with-text/document.js +264 -0
- package/dist/shape-with-text/document.js.map +1 -0
- package/dist/shape-with-text/fit.d.ts +6 -9
- package/dist/shape-with-text/fit.d.ts.map +1 -1
- package/dist/shape-with-text/fit.js +1 -2
- package/dist/shape-with-text/geometry.d.ts +16 -7
- package/dist/shape-with-text/geometry.d.ts.map +1 -1
- package/dist/shape-with-text/geometry.js +105 -46
- package/dist/shape-with-text/geometry.js.map +1 -1
- package/dist/shape-with-text/index.d.ts +2 -2
- package/dist/shape-with-text/index.js +3 -3
- package/dist/shape-with-text/kinds.d.ts +4 -7
- package/dist/shape-with-text/kinds.d.ts.map +1 -1
- package/dist/shape-with-text/kinds.js +1 -2
- package/dist/shared-style-index.d.ts +19 -0
- package/dist/shared-style-index.d.ts.map +1 -0
- package/dist/shared-style-index.js +71 -0
- package/dist/shared-style-index.js.map +1 -0
- package/dist/shared-styles.d.ts +18 -20
- package/dist/shared-styles.d.ts.map +1 -1
- package/dist/shared-styles.js +20 -12
- package/dist/shared-styles.js.map +1 -1
- package/dist/slides/drop.d.ts +29 -0
- package/dist/slides/drop.d.ts.map +1 -0
- package/dist/slides/drop.js +80 -0
- package/dist/slides/drop.js.map +1 -0
- package/dist/slides/index.d.ts +56 -0
- package/dist/slides/index.d.ts.map +1 -0
- package/dist/slides/index.js +137 -0
- package/dist/slides/index.js.map +1 -0
- package/dist/slides/motion.d.ts +71 -0
- package/dist/slides/motion.d.ts.map +1 -0
- package/dist/slides/motion.js +167 -0
- package/dist/slides/motion.js.map +1 -0
- package/dist/slides/playback.d.ts +62 -0
- package/dist/slides/playback.d.ts.map +1 -0
- package/dist/slides/playback.js +220 -0
- package/dist/slides/playback.js.map +1 -0
- package/dist/slides/types.d.ts +59 -0
- package/dist/slides/types.d.ts.map +1 -0
- package/dist/slides/types.js +38 -0
- package/dist/slides/types.js.map +1 -0
- package/dist/slots/authoring.d.ts +6 -9
- package/dist/slots/authoring.d.ts.map +1 -1
- package/dist/slots/authoring.js +2 -3
- package/dist/slots/content.d.ts +5 -8
- package/dist/slots/content.d.ts.map +1 -1
- package/dist/slots/content.js +4 -5
- package/dist/slots/frames.d.ts +7 -9
- package/dist/slots/frames.d.ts.map +1 -1
- package/dist/slots/frames.js +3 -4
- package/dist/slots/frames.js.map +1 -1
- package/dist/slots/index.js +1 -1
- package/dist/slots/limits.d.ts +4 -7
- package/dist/slots/limits.d.ts.map +1 -1
- package/dist/slots/limits.js +1 -2
- package/dist/snap.d.ts +4 -7
- package/dist/snap.d.ts.map +1 -1
- package/dist/snap.js +7 -8
- package/dist/source-metadata.d.ts +1 -4
- package/dist/source-metadata.d.ts.map +1 -1
- package/dist/source-metadata.js +1 -2
- package/dist/specs/index.d.ts +3 -0
- package/dist/specs/index.js +3 -0
- package/dist/specs/model.d.ts +20 -0
- package/dist/specs/model.d.ts.map +1 -0
- package/dist/specs/model.js +32 -0
- package/dist/specs/model.js.map +1 -0
- package/dist/specs/schema.d.ts +24 -0
- package/dist/specs/schema.d.ts.map +1 -0
- package/dist/specs/schema.js +32 -0
- package/dist/specs/schema.js.map +1 -0
- package/dist/statuses/impact.d.ts +2 -5
- package/dist/statuses/impact.d.ts.map +1 -1
- package/dist/statuses/impact.js +2 -3
- package/dist/statuses/index.d.ts +1 -1
- package/dist/statuses/index.js +2 -2
- package/dist/statuses/node.d.ts +4 -7
- package/dist/statuses/node.d.ts.map +1 -1
- package/dist/statuses/node.js +1 -2
- package/dist/statuses/schema.d.ts +7 -9
- package/dist/statuses/schema.d.ts.map +1 -1
- package/dist/statuses/schema.js +1 -2
- package/dist/statuses/workflow.d.ts +9 -12
- package/dist/statuses/workflow.d.ts.map +1 -1
- package/dist/statuses/workflow.js +2 -3
- package/dist/strokes.d.ts +8 -10
- package/dist/strokes.d.ts.map +1 -1
- package/dist/strokes.js +2 -3
- package/dist/text/auto-resize.d.ts +4 -6
- package/dist/text/auto-resize.d.ts.map +1 -1
- package/dist/text/auto-resize.js +1 -2
- package/dist/text/direction.d.ts +10 -10
- package/dist/text/direction.d.ts.map +1 -1
- package/dist/text/direction.js +13 -14
- package/dist/text/direction.js.map +1 -1
- package/dist/text/index.d.ts +3 -2
- package/dist/text/index.js +6 -5
- package/dist/text/lengths.d.ts +9 -12
- package/dist/text/lengths.d.ts.map +1 -1
- package/dist/text/lengths.js +1 -2
- package/dist/text/lists.d.ts +17 -13
- package/dist/text/lists.d.ts.map +1 -1
- package/dist/text/lists.js +15 -4
- package/dist/text/lists.js.map +1 -1
- package/dist/text/name.d.ts +19 -0
- package/dist/text/name.d.ts.map +1 -0
- package/dist/text/name.js +37 -0
- package/dist/text/name.js.map +1 -0
- package/dist/text/overflow.d.ts +5 -7
- package/dist/text/overflow.d.ts.map +1 -1
- package/dist/text/overflow.js +1 -2
- package/dist/text/paragraphs.d.ts +20 -23
- package/dist/text/paragraphs.d.ts.map +1 -1
- package/dist/text/paragraphs.js +8 -5
- package/dist/text/paragraphs.js.map +1 -1
- package/dist/text/path.js +1 -2
- package/dist/text/picture.d.ts +3 -6
- package/dist/text/picture.d.ts.map +1 -1
- package/dist/text/picture.js +2 -3
- package/dist/text/references.d.ts +3 -6
- package/dist/text/references.d.ts.map +1 -1
- package/dist/text/references.js +2 -4
- package/dist/text/references.js.map +1 -1
- package/dist/text/runs.d.ts +6 -9
- package/dist/text/runs.d.ts.map +1 -1
- package/dist/text/runs.js +1 -2
- package/dist/text/schema.d.ts +1 -4
- package/dist/text/schema.d.ts.map +1 -1
- package/dist/text/schema.js +1 -2
- package/dist/thumbnail.d.ts +20 -0
- package/dist/thumbnail.d.ts.map +1 -0
- package/dist/thumbnail.js +46 -0
- package/dist/thumbnail.js.map +1 -0
- package/dist/transfer/apply.d.ts +2 -5
- package/dist/transfer/apply.d.ts.map +1 -1
- package/dist/transfer/apply.js +16 -6
- package/dist/transfer/apply.js.map +1 -1
- package/dist/transfer/copied.d.ts +11 -9
- package/dist/transfer/copied.d.ts.map +1 -1
- package/dist/transfer/copied.js +5 -6
- package/dist/transfer/copied.js.map +1 -1
- package/dist/transfer/dependencies.d.ts +10 -10
- package/dist/transfer/dependencies.d.ts.map +1 -1
- package/dist/transfer/dependencies.js +21 -10
- package/dist/transfer/dependencies.js.map +1 -1
- package/dist/transfer/history.d.ts +1 -4
- package/dist/transfer/history.d.ts.map +1 -1
- package/dist/transfer/history.js +3 -2
- package/dist/transfer/history.js.map +1 -1
- package/dist/transfer/identity.js +19 -5
- package/dist/transfer/identity.js.map +1 -1
- package/dist/transfer/index.d.ts +5 -4
- package/dist/transfer/index.js +6 -5
- package/dist/transfer/library.d.ts +43 -0
- package/dist/transfer/library.d.ts.map +1 -0
- package/dist/transfer/library.js +122 -0
- package/dist/transfer/library.js.map +1 -0
- package/dist/transfer/nodes.d.ts +2 -5
- package/dist/transfer/nodes.d.ts.map +1 -1
- package/dist/transfer/nodes.js +15 -4
- package/dist/transfer/nodes.js.map +1 -1
- package/dist/transfer/plan.d.ts +11 -5
- package/dist/transfer/plan.d.ts.map +1 -1
- package/dist/transfer/plan.js +52 -8
- package/dist/transfer/plan.js.map +1 -1
- package/dist/transfer/references.js +1 -2
- package/dist/transfer/remove.d.ts +1 -4
- package/dist/transfer/remove.d.ts.map +1 -1
- package/dist/transfer/remove.js +8 -3
- package/dist/transfer/remove.js.map +1 -1
- package/dist/transfer/resources.d.ts +2 -5
- package/dist/transfer/resources.d.ts.map +1 -1
- package/dist/transfer/resources.js +3 -4
- package/dist/transfer/validation.js +9 -6
- package/dist/transfer/validation.js.map +1 -1
- package/dist/transfer/variables.d.ts +3 -6
- package/dist/transfer/variables.d.ts.map +1 -1
- package/dist/transfer/variables.js +4 -4
- package/dist/transfer/variables.js.map +1 -1
- package/dist/types.d.ts +261 -134
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +47 -3
- package/dist/types.js.map +1 -1
- package/dist/undo.d.ts +5 -8
- package/dist/undo.d.ts.map +1 -1
- package/dist/undo.js +9 -3
- package/dist/undo.js.map +1 -1
- package/dist/variables/bindings.d.ts +29 -25
- package/dist/variables/bindings.d.ts.map +1 -1
- package/dist/variables/bindings.js +184 -55
- package/dist/variables/bindings.js.map +1 -1
- package/dist/variables/corners.d.ts +1 -4
- package/dist/variables/corners.d.ts.map +1 -1
- package/dist/variables/corners.js +1 -2
- package/dist/variables/easing.d.ts +53 -0
- package/dist/variables/easing.d.ts.map +1 -0
- package/dist/variables/easing.js +321 -0
- package/dist/variables/easing.js.map +1 -0
- package/dist/variables/fields.d.ts +21 -14
- package/dist/variables/fields.d.ts.map +1 -1
- package/dist/variables/fields.js +24 -6
- package/dist/variables/fields.js.map +1 -1
- package/dist/variables/formula/check.d.ts +2 -5
- package/dist/variables/formula/check.d.ts.map +1 -1
- package/dist/variables/formula/check.js +2 -3
- package/dist/variables/formula/evaluate.d.ts +1 -4
- package/dist/variables/formula/evaluate.d.ts.map +1 -1
- package/dist/variables/formula/evaluate.js +3 -4
- package/dist/variables/formula/index.d.ts +8 -8
- package/dist/variables/formula/index.d.ts.map +1 -1
- package/dist/variables/formula/index.js +29 -13
- package/dist/variables/formula/index.js.map +1 -1
- package/dist/variables/formula/parse.js +5 -6
- package/dist/variables/formula/print.d.ts +2 -5
- package/dist/variables/formula/print.d.ts.map +1 -1
- package/dist/variables/formula/print.js +4 -5
- package/dist/variables/formula/schema.d.ts +2 -5
- package/dist/variables/formula/schema.d.ts.map +1 -1
- package/dist/variables/formula/schema.js +6 -7
- package/dist/variables/formula/signatures.d.ts +4 -7
- package/dist/variables/formula/signatures.d.ts.map +1 -1
- package/dist/variables/formula/signatures.js +1 -2
- package/dist/variables/formula/signatures.js.map +1 -1
- package/dist/variables/formula/tokens.d.ts +5 -8
- package/dist/variables/formula/tokens.d.ts.map +1 -1
- package/dist/variables/formula/tokens.js +1 -2
- package/dist/variables/formula/tree.d.ts +8 -11
- package/dist/variables/formula/tree.d.ts.map +1 -1
- package/dist/variables/formula/tree.js +1 -2
- package/dist/variables/formula/tree.js.map +1 -1
- package/dist/variables/index.d.ts +42 -27
- package/dist/variables/index.d.ts.map +1 -1
- package/dist/variables/index.js +78 -29
- package/dist/variables/index.js.map +1 -1
- package/dist/variables/lookup.d.ts +11 -7
- package/dist/variables/lookup.d.ts.map +1 -1
- package/dist/variables/lookup.js +25 -4
- package/dist/variables/lookup.js.map +1 -1
- package/dist/variables/motion.d.ts +43 -0
- package/dist/variables/motion.d.ts.map +1 -0
- package/dist/variables/motion.js +106 -0
- package/dist/variables/motion.js.map +1 -0
- package/dist/variables/paints.d.ts +25 -19
- package/dist/variables/paints.d.ts.map +1 -1
- package/dist/variables/paints.js +28 -15
- package/dist/variables/paints.js.map +1 -1
- package/dist/variables/resolution.d.ts +22 -19
- package/dist/variables/resolution.d.ts.map +1 -1
- package/dist/variables/resolution.js +23 -14
- package/dist/variables/resolution.js.map +1 -1
- package/dist/variables/schema.d.ts +62 -7
- package/dist/variables/schema.d.ts.map +1 -1
- package/dist/variables/schema.js +39 -5
- package/dist/variables/schema.js.map +1 -1
- package/dist/variables/style-bindings.d.ts +21 -0
- package/dist/variables/style-bindings.d.ts.map +1 -0
- package/dist/variables/style-bindings.js +82 -0
- package/dist/variables/style-bindings.js.map +1 -0
- package/dist/variables/subtree.js +1 -2
- package/dist/variables/text.d.ts +2 -5
- package/dist/variables/text.d.ts.map +1 -1
- package/dist/variables/text.js +3 -4
- package/dist/variables/token.d.ts +5 -8
- package/dist/variables/token.d.ts.map +1 -1
- package/dist/variables/token.js +1 -2
- package/dist/variables/units.js +3 -5
- package/dist/variables/units.js.map +1 -1
- package/dist/variables/value.d.ts +4 -7
- package/dist/variables/value.d.ts.map +1 -1
- package/dist/variables/value.js +4 -5
- package/dist/variant-name.d.ts +2 -5
- package/dist/variant-name.d.ts.map +1 -1
- package/dist/variant-name.js +1 -2
- package/dist/variant-properties.d.ts +4 -7
- package/dist/variant-properties.d.ts.map +1 -1
- package/dist/variant-properties.js +2 -3
- package/dist/vector-network.d.ts +17 -20
- package/dist/vector-network.d.ts.map +1 -1
- package/dist/vector-network.js +4 -5
- package/package.json +42 -5
- package/src/behaviours/index.ts +2 -0
- package/src/behaviours/kinds.ts +108 -2
- package/src/behaviours/listing.ts +142 -0
- package/src/behaviours/model.ts +23 -2
- package/src/behaviours/schema.ts +19 -2
- package/src/behaviours/spec.ts +5 -0
- package/src/behaviours/transition.ts +46 -0
- package/src/blur.ts +88 -0
- package/src/checkpoint.ts +2 -0
- package/src/clipping.ts +3 -4
- package/src/color/index.ts +15 -24
- package/src/color/management.ts +144 -168
- package/src/color/okhcl.ts +62 -43
- package/src/color/schema.ts +13 -0
- package/src/comments/threads.ts +8 -1
- package/src/connectors/layout.ts +10 -3
- package/src/connectors/sublayers.ts +2 -1
- package/src/constraints.ts +2 -1
- package/src/coordinate.ts +17 -25
- package/src/copy.ts +38 -0
- package/src/corners.ts +3 -0
- package/src/css/index.ts +1 -0
- package/src/css/motion.ts +51 -0
- package/src/css/shadows.ts +7 -6
- package/src/css/values.ts +7 -3
- package/src/cubic.ts +57 -1
- package/src/export-format.ts +11 -1
- package/src/fields/layout.ts +9 -0
- package/src/font-style.ts +20 -7
- package/src/generated/index.ts +58 -9
- package/src/generated/kind.ts +16 -2
- package/src/generated/shape-with-text.ts +1 -0
- package/src/generated/spec.ts +243 -0
- package/src/generated/sticky.ts +2 -1
- package/src/geometry.ts +52 -89
- package/src/graph.ts +93 -15
- package/src/group-bounds.ts +54 -13
- package/src/hit-test.ts +78 -33
- package/src/images.ts +4 -1
- package/src/instances/content-marks.ts +124 -0
- package/src/instances/deleted.ts +115 -0
- package/src/instances/fields.ts +9 -3
- package/src/instances/index.ts +165 -17
- package/src/instances/lookup.ts +61 -0
- package/src/instances/sync.ts +108 -11
- package/src/layout/flow.ts +36 -0
- package/src/layout/index.ts +2 -0
- package/src/layout/keywords.ts +7 -1
- package/src/layout/sizing.ts +30 -0
- package/src/layout/spacing.ts +12 -0
- package/src/layout/stacking.ts +14 -0
- package/src/matrix.ts +11 -1
- package/src/mesh/geometry.ts +422 -0
- package/src/mesh/index.ts +3 -0
- package/src/mesh/model.ts +50 -0
- package/src/mesh/schema.ts +81 -0
- package/src/motion/apply.ts +156 -0
- package/src/motion/edit.ts +148 -0
- package/src/motion/effects.ts +166 -0
- package/src/motion/evaluate.ts +181 -0
- package/src/motion/fields.ts +136 -0
- package/src/motion/index.ts +13 -0
- package/src/motion/keyable.ts +141 -0
- package/src/motion/outline.ts +72 -0
- package/src/motion/presets/index.ts +257 -0
- package/src/motion/presets/settings.ts +221 -0
- package/src/motion/presets/stagger.ts +242 -0
- package/src/motion/schema.ts +66 -0
- package/src/motion/segment.ts +83 -0
- package/src/motion/spec.ts +225 -0
- package/src/motion/timeline.ts +48 -0
- package/src/motion/types.ts +45 -0
- package/src/motion/variables.ts +33 -0
- package/src/mutation-impact.ts +23 -7
- package/src/node-defaults.ts +152 -53
- package/src/order-keys.ts +16 -2
- package/src/paints/index.ts +2 -0
- package/src/paints/pattern.ts +55 -0
- package/src/paints/shows.ts +9 -0
- package/src/paints/solid.ts +10 -0
- package/src/paints/stills.ts +186 -0
- package/src/parse-path.ts +15 -0
- package/src/plugin-data/field.ts +3 -0
- package/src/plugin-data/fields.ts +54 -4
- package/src/polygon.ts +6 -4
- package/src/resize.ts +32 -20
- package/src/scaling/index.ts +1 -1
- package/src/scaling/node.ts +43 -6
- package/src/shaders/index.ts +0 -1
- package/src/shaders/model.ts +133 -45
- package/src/shaders/schema.ts +13 -1
- package/src/shape-with-text/document.ts +170 -0
- package/src/shape-with-text/geometry.ts +98 -29
- package/src/shared-style-index.ts +106 -0
- package/src/shared-styles.ts +21 -14
- package/src/slides/drop.ts +94 -0
- package/src/slides/index.ts +133 -0
- package/src/slides/motion.ts +203 -0
- package/src/slides/playback.ts +242 -0
- package/src/slides/types.ts +94 -0
- package/src/slots/frames.ts +2 -3
- package/src/specs/index.ts +2 -0
- package/src/specs/model.ts +40 -0
- package/src/specs/schema.ts +43 -0
- package/src/text/direction.ts +13 -23
- package/src/text/index.ts +1 -0
- package/src/text/lists.ts +20 -7
- package/src/text/name.ts +39 -0
- package/src/text/paragraphs.ts +10 -3
- package/src/text/references.ts +3 -3
- package/src/thumbnail.ts +52 -0
- package/src/transfer/apply.ts +16 -3
- package/src/transfer/copied.ts +7 -2
- package/src/transfer/dependencies.ts +27 -12
- package/src/transfer/history.ts +2 -0
- package/src/transfer/identity.ts +34 -2
- package/src/transfer/index.ts +6 -0
- package/src/transfer/library.ts +177 -0
- package/src/transfer/nodes.ts +28 -0
- package/src/transfer/plan.ts +96 -10
- package/src/transfer/remove.ts +6 -2
- package/src/transfer/validation.ts +15 -7
- package/src/transfer/variables.ts +8 -2
- package/src/types.ts +182 -15
- package/src/undo.ts +10 -1
- package/src/variables/bindings.ts +292 -51
- package/src/variables/easing.ts +281 -0
- package/src/variables/fields.ts +30 -3
- package/src/variables/formula/index.ts +33 -14
- package/src/variables/formula/signatures.ts +6 -2
- package/src/variables/formula/tree.ts +3 -3
- package/src/variables/index.ts +90 -37
- package/src/variables/lookup.ts +25 -2
- package/src/variables/motion.ts +151 -0
- package/src/variables/paints.ts +29 -7
- package/src/variables/resolution.ts +26 -6
- package/src/variables/schema.ts +41 -0
- package/src/variables/style-bindings.ts +137 -0
- package/src/variables/units.ts +2 -3
- package/dist/shaders/still.d.ts +0 -18
- package/dist/shaders/still.d.ts.map +0 -1
- package/dist/shaders/still.js +0 -36
- package/dist/shaders/still.js.map +0 -1
- package/src/shaders/still.ts +0 -41
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import type { SceneGraph } from '../graph'
|
|
2
|
+
import type { SceneNode } from '../types'
|
|
3
|
+
import type { SlideSettings } from './types'
|
|
4
|
+
|
|
5
|
+
export * from './drop'
|
|
6
|
+
export * from './motion'
|
|
7
|
+
export * from './playback'
|
|
8
|
+
export * from './types'
|
|
9
|
+
|
|
10
|
+
/** Figma's slide: 1920 by 1080, with 240 between slides and 600 between the rows of a grid. */
|
|
11
|
+
export const DEFAULT_SLIDE_SIZE = { width: 1920, height: 1080 } as const
|
|
12
|
+
|
|
13
|
+
/** The sizes a deck offers its slides, by shape; any other size is a custom one. */
|
|
14
|
+
export const SLIDE_SIZE_PRESETS = [
|
|
15
|
+
{ id: 'wide', width: 1920, height: 1080 },
|
|
16
|
+
{ id: 'standard', width: 1440, height: 1080 },
|
|
17
|
+
{ id: 'square', width: 1080, height: 1080 },
|
|
18
|
+
{ id: 'portrait', width: 1080, height: 1920 }
|
|
19
|
+
] as const
|
|
20
|
+
export type SlideSizePreset = (typeof SLIDE_SIZE_PRESETS)[number]
|
|
21
|
+
const SLIDE_GAP = 240
|
|
22
|
+
const ROW_GAP = 600
|
|
23
|
+
const SLIDES_PER_LINE = 20
|
|
24
|
+
|
|
25
|
+
const WHITE = { r: 1, g: 1, b: 1, a: 1 } as const
|
|
26
|
+
|
|
27
|
+
export function defaultSlideSettings(): SlideSettings {
|
|
28
|
+
return { skipped: false, notes: '', transition: null }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** What a slide keeps, whether or not it was ever set; null for any other layer. */
|
|
32
|
+
export function slideSettings(node: Pick<SceneNode, 'type' | 'slide'>): SlideSettings | null {
|
|
33
|
+
return node.type === 'SLIDE' ? (node.slide ?? defaultSlideSettings()) : null
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** The grid that holds a deck's slides on a page, if the page has one. */
|
|
37
|
+
export function slideGrid(graph: SceneGraph, pageId: string): SceneNode | undefined {
|
|
38
|
+
return graph.getChildren(pageId).find((node) => node.type === 'SLIDE_GRID')
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** A page's slides by row, in the order a deck presents them. */
|
|
42
|
+
export function slideRows(graph: SceneGraph, pageId: string): SceneNode[][] {
|
|
43
|
+
const grid = slideGrid(graph, pageId)
|
|
44
|
+
if (!grid) return []
|
|
45
|
+
return graph
|
|
46
|
+
.getChildren(grid.id)
|
|
47
|
+
.filter((row) => row.type === 'SLIDE_ROW')
|
|
48
|
+
.map((row) => graph.getChildren(row.id).filter((node) => node.type === 'SLIDE'))
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** The slide the deck moves on to from `slide`, passing by skipped slides, or undefined at the end. */
|
|
52
|
+
export function nextSlide(graph: SceneGraph, slide: SceneNode): SceneNode | undefined {
|
|
53
|
+
const page = slide.parentId
|
|
54
|
+
? graph.closest(slide.parentId, (node) => node.type === 'CANVAS')
|
|
55
|
+
: undefined
|
|
56
|
+
if (!page) return undefined
|
|
57
|
+
const slides = slideRows(graph, page.id).flat()
|
|
58
|
+
const index = slides.findIndex((node) => node.id === slide.id)
|
|
59
|
+
if (index === -1) return undefined
|
|
60
|
+
return slides.slice(index + 1).find((node) => !slideSettings(node)?.skipped)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Each slide's number, by ID, in the order a deck presents them: skipped slides have none and are
|
|
65
|
+
* not counted, as in Figma.
|
|
66
|
+
*/
|
|
67
|
+
export function slideNumbers(graph: SceneGraph, pageId: string): Map<string, number | null> {
|
|
68
|
+
let shown = 0
|
|
69
|
+
return new Map(
|
|
70
|
+
slideRows(graph, pageId)
|
|
71
|
+
.flat()
|
|
72
|
+
.map((slide) => [slide.id, slideSettings(slide)?.skipped ? null : ++shown])
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** Names a page's slides by their numbers, and a skipped one `-`, as Figma does. */
|
|
77
|
+
export function renumberSlides(graph: SceneGraph, pageId: string): void {
|
|
78
|
+
for (const [id, number] of slideNumbers(graph, pageId)) {
|
|
79
|
+
const name = number === null ? '-' : String(number)
|
|
80
|
+
if (graph.getNode(id)?.name !== name) graph.updateNode(id, { name })
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Adds the grid a deck's slides sit in to a page. */
|
|
85
|
+
export function createSlideGrid(graph: SceneGraph, pageId: string): SceneNode {
|
|
86
|
+
return graph.createNode('SLIDE_GRID', pageId, {
|
|
87
|
+
name: 'Presentation',
|
|
88
|
+
layoutMode: 'VERTICAL',
|
|
89
|
+
itemSpacing: ROW_GAP,
|
|
90
|
+
// Figma pads a grid before its slides only.
|
|
91
|
+
paddingTop: SLIDE_GAP,
|
|
92
|
+
paddingLeft: SLIDE_GAP,
|
|
93
|
+
primaryAxisSizing: 'HUG',
|
|
94
|
+
counterAxisSizing: 'HUG'
|
|
95
|
+
})
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** Adds a row, which Figma calls a section, to the end of a grid. */
|
|
99
|
+
export function createSlideRow(graph: SceneGraph, gridId: string): SceneNode {
|
|
100
|
+
return graph.createNode('SLIDE_ROW', gridId, {
|
|
101
|
+
name: 'Section',
|
|
102
|
+
layoutMode: 'HORIZONTAL',
|
|
103
|
+
layoutWrap: 'WRAP',
|
|
104
|
+
layoutAlignSelf: 'STRETCH',
|
|
105
|
+
itemSpacing: SLIDE_GAP,
|
|
106
|
+
counterAxisSpacing: SLIDE_GAP,
|
|
107
|
+
primaryAxisSizing: 'FIXED',
|
|
108
|
+
counterAxisSizing: 'HUG',
|
|
109
|
+
maxWidth: SLIDES_PER_LINE * (DEFAULT_SLIDE_SIZE.width + SLIDE_GAP) + SLIDE_GAP
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** Adds an empty slide to the end of a row, at the size of the slide before it. */
|
|
114
|
+
export function createSlide(graph: SceneGraph, rowId: string): SceneNode {
|
|
115
|
+
const before = graph.getChildren(rowId).findLast((node) => node.type === 'SLIDE')
|
|
116
|
+
const { width, height } = before ?? DEFAULT_SLIDE_SIZE
|
|
117
|
+
return graph.createNode('SLIDE', rowId, {
|
|
118
|
+
name: 'Slide',
|
|
119
|
+
width,
|
|
120
|
+
height,
|
|
121
|
+
clipsContent: true,
|
|
122
|
+
fills: [{ type: 'SOLID', color: { ...WHITE }, opacity: 1, visible: true }],
|
|
123
|
+
slide: defaultSlideSettings()
|
|
124
|
+
})
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** The slides a deck on `pageId` presents, in order: skipped ones are passed by. */
|
|
128
|
+
export function presentedSlides(graph: SceneGraph, pageId: string): string[] {
|
|
129
|
+
return slideRows(graph, pageId)
|
|
130
|
+
.flat()
|
|
131
|
+
.filter((slide) => !slideSettings(slide)?.skipped)
|
|
132
|
+
.map((slide) => slide.id)
|
|
133
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { compact } from 'es-toolkit/array'
|
|
2
|
+
|
|
3
|
+
import type { SceneGraph } from '../graph'
|
|
4
|
+
import type { SceneNode } from '../types'
|
|
5
|
+
import { easingPreset, easingSeconds } from '../variables/easing'
|
|
6
|
+
import {
|
|
7
|
+
mapMotionVariables,
|
|
8
|
+
motionVariableIds,
|
|
9
|
+
resolveMotion,
|
|
10
|
+
resolveTiming,
|
|
11
|
+
type ResolvedMotion
|
|
12
|
+
} from '../variables/motion'
|
|
13
|
+
import type { LayerAnimation, SlideTransition, SlideTransitionStyle } from './types'
|
|
14
|
+
|
|
15
|
+
/** The transition a slide starts with when one is added. */
|
|
16
|
+
export function defaultSlideTransition(): SlideTransition {
|
|
17
|
+
return {
|
|
18
|
+
style: 'DISSOLVE',
|
|
19
|
+
duration: 0.3,
|
|
20
|
+
easing: easingPreset('OUT_CUBIC'),
|
|
21
|
+
timing: { type: 'ON_CLICK' }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Figma's curve for layer animations, which its panel does not offer to change. */
|
|
26
|
+
const LAYER_ANIMATION_BEZIER = { x1: 0.17, y1: 0, x2: 0.2, y2: 1 }
|
|
27
|
+
|
|
28
|
+
/** The animation a layer starts with when one is added, as in Figma: it slides in from the left. */
|
|
29
|
+
export function defaultLayerAnimation(order: number): LayerAnimation {
|
|
30
|
+
return {
|
|
31
|
+
style: 'SLIDE_FROM_LEFT',
|
|
32
|
+
phase: 'IN',
|
|
33
|
+
trigger: 'ON_CLICK',
|
|
34
|
+
duration: 0.6,
|
|
35
|
+
easing: { easing: 'CUSTOM_CUBIC', bezier: { ...LAYER_ANIMATION_BEZIER } },
|
|
36
|
+
order
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** A slide's transition as it plays, with its variables read for the slide. */
|
|
41
|
+
export interface ResolvedSlideTransition extends ResolvedMotion {
|
|
42
|
+
style: SlideTransitionStyle
|
|
43
|
+
/** Seconds before the deck moves on by itself, or null when it waits for the presenter. */
|
|
44
|
+
delay: number | null
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function resolveSlideTransition(
|
|
48
|
+
graph: SceneGraph,
|
|
49
|
+
slide: SceneNode
|
|
50
|
+
): ResolvedSlideTransition | null {
|
|
51
|
+
const transition = slide.slide?.transition
|
|
52
|
+
if (!transition) return null
|
|
53
|
+
const { timing } = transition
|
|
54
|
+
return {
|
|
55
|
+
style: transition.style,
|
|
56
|
+
...resolveMotion(graph, transition, slide.id),
|
|
57
|
+
delay:
|
|
58
|
+
timing.type === 'AFTER_DELAY'
|
|
59
|
+
? resolveTiming(graph, timing.delayVariableId, slide.id, timing.delay)
|
|
60
|
+
: null
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** The variables a layer's slide transition and animation follow. */
|
|
65
|
+
export function slideVariableIds(node: Pick<SceneNode, 'slide' | 'animation'>): string[] {
|
|
66
|
+
const transition = node.slide?.transition
|
|
67
|
+
return [
|
|
68
|
+
...(transition ? motionVariableIds(transition) : []),
|
|
69
|
+
...compact([transition?.timing.type === 'AFTER_DELAY' && transition.timing.delayVariableId]),
|
|
70
|
+
...(node.animation ? motionVariableIds(node.animation) : [])
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* A layer's slide transition and animation following other variables, as a copy into another
|
|
76
|
+
* document names them; a variable `map` gives nothing for is let go, keeping the value.
|
|
77
|
+
*/
|
|
78
|
+
export function mapSlideVariables(
|
|
79
|
+
node: Pick<SceneNode, 'slide' | 'animation'>,
|
|
80
|
+
map: (variableId: string) => string | undefined
|
|
81
|
+
): Pick<SceneNode, 'slide' | 'animation'> {
|
|
82
|
+
const transition = node.slide?.transition
|
|
83
|
+
let slide = node.slide && structuredClone(node.slide)
|
|
84
|
+
if (slide && transition) {
|
|
85
|
+
const mapped = mapMotionVariables(transition, map)
|
|
86
|
+
if (transition.timing.type === 'AFTER_DELAY') {
|
|
87
|
+
const { delayVariableId, ...timing } = transition.timing
|
|
88
|
+
const delay = delayVariableId === undefined ? undefined : map(delayVariableId)
|
|
89
|
+
mapped.timing = delay === undefined ? timing : { ...timing, delayVariableId: delay }
|
|
90
|
+
}
|
|
91
|
+
slide = { ...slide, transition: mapped }
|
|
92
|
+
}
|
|
93
|
+
return { slide, animation: node.animation && mapMotionVariables(node.animation, map) }
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** A layer's animation, with the layer it moves. */
|
|
97
|
+
export interface AnimatedLayer {
|
|
98
|
+
id: string
|
|
99
|
+
animation: LayerAnimation
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* A step of a slide's build: its layers' animations, one after another. A step waits for the
|
|
104
|
+
* presenter, except a first one made only of `AFTER_PREVIOUS` animations, which plays as the slide
|
|
105
|
+
* appears.
|
|
106
|
+
*/
|
|
107
|
+
export interface BuildStep {
|
|
108
|
+
onClick: boolean
|
|
109
|
+
layers: AnimatedLayer[]
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** The animated layers of a slide, in the order they play: by `order`, then by layer order. */
|
|
113
|
+
export function animatedLayers(graph: SceneGraph, slideId: string): AnimatedLayer[] {
|
|
114
|
+
const layers: AnimatedLayer[] = []
|
|
115
|
+
const visit = (id: string) => {
|
|
116
|
+
for (const child of graph.getChildren(id)) {
|
|
117
|
+
if (child.animation) layers.push({ id: child.id, animation: child.animation })
|
|
118
|
+
visit(child.id)
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
visit(slideId)
|
|
122
|
+
// Array sort is stable, so equal orders keep layer order.
|
|
123
|
+
return layers.sort((a, b) => a.animation.order - b.animation.order)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** A slide's build: its animations grouped into the steps a presenter clicks through. */
|
|
127
|
+
export function slideBuild(graph: SceneGraph, slideId: string): BuildStep[] {
|
|
128
|
+
const steps: BuildStep[] = []
|
|
129
|
+
for (const layer of animatedLayers(graph, slideId)) {
|
|
130
|
+
const last = steps.at(-1)
|
|
131
|
+
if (layer.animation.trigger === 'AFTER_PREVIOUS' && last) last.layers.push(layer)
|
|
132
|
+
else steps.push({ onClick: layer.animation.trigger === 'ON_CLICK', layers: [layer] })
|
|
133
|
+
}
|
|
134
|
+
return steps
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* The slide a layer animates on, or undefined for a layer that cannot have an animation: one on no
|
|
139
|
+
* slide, a slide itself, or a layer inside an instance, whose component gives it its fields.
|
|
140
|
+
*/
|
|
141
|
+
export function animationSlide(graph: SceneGraph, layerId: string): SceneNode | undefined {
|
|
142
|
+
const node = graph.getNode(layerId)
|
|
143
|
+
if (!node?.parentId || node.type === 'SLIDE') return undefined
|
|
144
|
+
if (graph.closest(node.parentId, (item) => item.type === 'INSTANCE')) return undefined
|
|
145
|
+
return graph.closest(node.parentId, (item) => item.type === 'SLIDE') ?? undefined
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The layer an animation for `layerId` goes on, as Figma's Animate panel picks it: the layer
|
|
150
|
+
* itself, or for a layer inside an instance the outermost instance on the slide, which Figma
|
|
151
|
+
* animates instead. Undefined for a layer on no slide, or a slide.
|
|
152
|
+
*/
|
|
153
|
+
export function animationTarget(graph: SceneGraph, layerId: string): string | undefined {
|
|
154
|
+
const node = graph.getNode(layerId)
|
|
155
|
+
if (!node || node.type === 'SLIDE') return undefined
|
|
156
|
+
let target = layerId
|
|
157
|
+
let id = node.parentId
|
|
158
|
+
// A parent cycle in bad data ends the walk.
|
|
159
|
+
const seen = new Set<string>()
|
|
160
|
+
while (id && !seen.has(id)) {
|
|
161
|
+
seen.add(id)
|
|
162
|
+
const parent = graph.getNode(id)
|
|
163
|
+
if (!parent) return undefined
|
|
164
|
+
if (parent.type === 'SLIDE') return target
|
|
165
|
+
if (parent.type === 'INSTANCE') target = parent.id
|
|
166
|
+
id = parent.parentId
|
|
167
|
+
}
|
|
168
|
+
return undefined
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** A layer's step in a slide's build, timed: when it starts within its step, and how long it plays. */
|
|
172
|
+
export interface TimedLayer {
|
|
173
|
+
id: string
|
|
174
|
+
step: AnimatedLayer
|
|
175
|
+
/** Seconds after its step starts. */
|
|
176
|
+
start: number
|
|
177
|
+
seconds: number
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** A step of a slide's build with its layers timed one after another, and how long it plays. */
|
|
181
|
+
export interface TimedStep {
|
|
182
|
+
onClick: boolean
|
|
183
|
+
layers: TimedLayer[]
|
|
184
|
+
seconds: number
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* A slide's build with each step's layers timed as presenting plays them: one after another, each
|
|
189
|
+
* for its duration, or, eased by a spring, for as long as the spring takes to settle.
|
|
190
|
+
*/
|
|
191
|
+
export function timedBuild(graph: SceneGraph, slideId: string): TimedStep[] {
|
|
192
|
+
return slideBuild(graph, slideId).map((step) => {
|
|
193
|
+
let start = 0
|
|
194
|
+
const layers = step.layers.map((layer) => {
|
|
195
|
+
const motion = resolveMotion(graph, layer.animation, layer.id)
|
|
196
|
+
const seconds = easingSeconds(motion.easing, motion.duration)
|
|
197
|
+
const timed = { id: layer.id, step: layer, start, seconds }
|
|
198
|
+
start += seconds
|
|
199
|
+
return timed
|
|
200
|
+
})
|
|
201
|
+
return { onClick: step.onClick, layers, seconds: start }
|
|
202
|
+
})
|
|
203
|
+
}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { trackValueAt } from '../motion/evaluate'
|
|
2
|
+
import type { KeyframeTrack, KeyframeValue } from '../motion/types'
|
|
3
|
+
import type { Vector } from '../primitives'
|
|
4
|
+
import type { Easing } from '../types'
|
|
5
|
+
import type { LayerAnimation, SlideTransitionStyle } from './types'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* How a slide is drawn at a moment of a transition: moved by fractions of its own width and
|
|
9
|
+
* height, faded, and darkened towards black.
|
|
10
|
+
*/
|
|
11
|
+
export interface SlideFrame {
|
|
12
|
+
x: number
|
|
13
|
+
y: number
|
|
14
|
+
opacity: number
|
|
15
|
+
/** How dark: 0 is the slide as it is, 1 black. */
|
|
16
|
+
dim: number
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** The two slides of a transition, the one drawn first below the other. */
|
|
20
|
+
export interface TransitionFrames {
|
|
21
|
+
from: SlideFrame
|
|
22
|
+
to: SlideFrame
|
|
23
|
+
/** Which slide is drawn on top. */
|
|
24
|
+
above: 'from' | 'to'
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** How far the slide underneath moves in Slide in and Slide out, as Figma moves it. */
|
|
28
|
+
const PARALLAX = 0.25
|
|
29
|
+
/** How dark the slide underneath gets in Slide in and Slide out. */
|
|
30
|
+
const UNDERNEATH_DIM = 0.5
|
|
31
|
+
|
|
32
|
+
type Direction = readonly [number, number]
|
|
33
|
+
const RIGHTWARDS: Direction = [1, 0]
|
|
34
|
+
const LEFTWARDS: Direction = [-1, 0]
|
|
35
|
+
const DOWNWARDS: Direction = [0, 1]
|
|
36
|
+
const UPWARDS: Direction = [0, -1]
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The way a style moves its slides. A `FROM` side is the side the slide comes from. Figma's `OUT_TO`
|
|
40
|
+
* names are mirrored: its panel shows SLIDE_OUT_TO_LEFT as → and plays it moving right.
|
|
41
|
+
*/
|
|
42
|
+
function directionOf(style: SlideTransitionStyle): Direction {
|
|
43
|
+
if (style.endsWith('FROM_LEFT') || style.endsWith('OUT_TO_LEFT')) return RIGHTWARDS
|
|
44
|
+
if (style.endsWith('FROM_RIGHT') || style.endsWith('OUT_TO_RIGHT')) return LEFTWARDS
|
|
45
|
+
if (style.endsWith('FROM_TOP') || style.endsWith('OUT_TO_TOP')) return DOWNWARDS
|
|
46
|
+
return UPWARDS
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function clamp01(value: number): number {
|
|
50
|
+
return Math.min(1, Math.max(0, value))
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** A direction scaled by `amount`, with no negative zero where the direction has no part. */
|
|
54
|
+
function along(direction: Direction, amount: number): Vector {
|
|
55
|
+
return { x: direction[0] * amount || 0, y: direction[1] * amount || 0 }
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function frame(direction: Direction, offset: number, dim = 0, opacity = 1): SlideFrame {
|
|
59
|
+
return { ...along(direction, offset), opacity, dim: clamp01(dim) }
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const STILL: SlideFrame = { x: 0, y: 0, opacity: 1, dim: 0 }
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Where the slides of a transition are when its easing is at `position`: 0 at the start, 1 at the
|
|
66
|
+
* end, past 1 while a spring overshoots. Smart animate plays as Dissolve for now.
|
|
67
|
+
*/
|
|
68
|
+
export function transitionFrames(style: SlideTransitionStyle, position: number): TransitionFrames {
|
|
69
|
+
const p = position
|
|
70
|
+
if (style === 'NONE') return { from: STILL, to: STILL, above: 'to' }
|
|
71
|
+
if (style === 'DISSOLVE' || style === 'SMART_ANIMATE')
|
|
72
|
+
return { from: STILL, to: { ...STILL, opacity: clamp01(p) }, above: 'to' }
|
|
73
|
+
const direction = directionOf(style)
|
|
74
|
+
if (style.startsWith('PUSH_'))
|
|
75
|
+
return { from: frame(direction, p), to: frame(direction, p - 1), above: 'to' }
|
|
76
|
+
if (style.startsWith('MOVE_FROM_'))
|
|
77
|
+
return { from: STILL, to: frame(direction, p - 1), above: 'to' }
|
|
78
|
+
if (style.startsWith('MOVE_OUT_')) return { from: frame(direction, p), to: STILL, above: 'from' }
|
|
79
|
+
if (style.startsWith('SLIDE_FROM_')) {
|
|
80
|
+
return {
|
|
81
|
+
from: frame(direction, PARALLAX * p, UNDERNEATH_DIM * p),
|
|
82
|
+
to: frame(direction, p - 1),
|
|
83
|
+
above: 'to'
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
from: frame(direction, p),
|
|
88
|
+
to: frame(direction, PARALLAX * (p - 1), UNDERNEATH_DIM * (1 - p)),
|
|
89
|
+
above: 'from'
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** How far, in slide pixels, a layer slides on or off, whatever its size, as in Figma. */
|
|
94
|
+
export const LAYER_SLIDE_DISTANCE = 300
|
|
95
|
+
|
|
96
|
+
/** Where a layer animating onto or off its slide is drawn, relative to where it is. */
|
|
97
|
+
export interface LayerFrame {
|
|
98
|
+
x: number
|
|
99
|
+
y: number
|
|
100
|
+
opacity: number
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const LAYER_DIRECTIONS: Record<Exclude<LayerAnimation['style'], 'FADE'>, Direction> = {
|
|
104
|
+
SLIDE_FROM_LEFT: RIGHTWARDS,
|
|
105
|
+
SLIDE_FROM_RIGHT: LEFTWARDS,
|
|
106
|
+
SLIDE_FROM_TOP: DOWNWARDS,
|
|
107
|
+
SLIDE_FROM_BOTTOM: UPWARDS
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* A layer's animation as keyframe tracks over the `seconds` its step plays, eased by `easing`: a
|
|
112
|
+
* layer coming in fades in as it slides the last stretch to its place; one going out keeps
|
|
113
|
+
* moving the same way as it fades. A spring's step lasts as long as the spring takes to settle,
|
|
114
|
+
* so fitted into it the spring keeps its own pace.
|
|
115
|
+
*/
|
|
116
|
+
export function layerAnimationTracks(
|
|
117
|
+
animation: Pick<LayerAnimation, 'style' | 'phase'>,
|
|
118
|
+
easing: Easing,
|
|
119
|
+
seconds: number
|
|
120
|
+
): Record<string, KeyframeTrack> {
|
|
121
|
+
const coming = animation.phase === 'IN'
|
|
122
|
+
const track = (from: KeyframeValue, to: KeyframeValue): KeyframeTrack => ({
|
|
123
|
+
operation: 'SET',
|
|
124
|
+
keyframes: [
|
|
125
|
+
{ time: 0, value: from, easing },
|
|
126
|
+
{ time: seconds, value: to, easing }
|
|
127
|
+
]
|
|
128
|
+
})
|
|
129
|
+
const shown = (value: number): KeyframeValue => ({ type: 'FLOAT', value })
|
|
130
|
+
const tracks: Record<string, KeyframeTrack> = {
|
|
131
|
+
opacity: coming ? track(shown(0), shown(1)) : track(shown(1), shown(0))
|
|
132
|
+
}
|
|
133
|
+
if (animation.style === 'FADE') return tracks
|
|
134
|
+
const direction = LAYER_DIRECTIONS[animation.style]
|
|
135
|
+
const at = (offset: number): KeyframeValue => ({
|
|
136
|
+
type: 'VECTOR',
|
|
137
|
+
value: along(direction, offset)
|
|
138
|
+
})
|
|
139
|
+
tracks['motion/translation'] = coming
|
|
140
|
+
? track(at(-LAYER_SLIDE_DISTANCE), at(0))
|
|
141
|
+
: track(at(0), at(LAYER_SLIDE_DISTANCE))
|
|
142
|
+
return tracks
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** Where an animating layer is `elapsed` seconds into the `seconds` its step plays. */
|
|
146
|
+
export function layerFrameAt(
|
|
147
|
+
animation: Pick<LayerAnimation, 'style' | 'phase'>,
|
|
148
|
+
easing: Easing,
|
|
149
|
+
elapsed: number,
|
|
150
|
+
seconds: number
|
|
151
|
+
): LayerFrame {
|
|
152
|
+
const tracks = layerAnimationTracks(animation, easing, seconds)
|
|
153
|
+
const opacity = trackValueAt(tracks.opacity, elapsed)
|
|
154
|
+
const move =
|
|
155
|
+
animation.style === 'FADE' ? null : trackValueAt(tracks['motion/translation'], elapsed)
|
|
156
|
+
const offset = move?.type === 'VECTOR' ? move.value : { x: 0, y: 0 }
|
|
157
|
+
return {
|
|
158
|
+
x: offset.x,
|
|
159
|
+
y: offset.y,
|
|
160
|
+
opacity: clamp01(opacity?.type === 'FLOAT' ? opacity.value : 1)
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** Where a layer is drawn before its step has played, or after. */
|
|
165
|
+
export function layerAtRest(animation: Pick<LayerAnimation, 'phase'>, played: boolean): LayerFrame {
|
|
166
|
+
const shown = animation.phase === 'IN' ? played : !played
|
|
167
|
+
return { x: 0, y: 0, opacity: shown ? 1 : 0 }
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** The transitions Figma's panel offers, each but the first three in four directions. */
|
|
171
|
+
export const SLIDE_TRANSITION_KINDS = [
|
|
172
|
+
'NONE',
|
|
173
|
+
'SMART_ANIMATE',
|
|
174
|
+
'DISSOLVE',
|
|
175
|
+
'PUSH',
|
|
176
|
+
'SLIDE_IN',
|
|
177
|
+
'SLIDE_OUT',
|
|
178
|
+
'MOVE_IN',
|
|
179
|
+
'MOVE_OUT'
|
|
180
|
+
] as const
|
|
181
|
+
export type SlideTransitionKind = (typeof SLIDE_TRANSITION_KINDS)[number]
|
|
182
|
+
|
|
183
|
+
/** Which way a transition or a layer moves, as Figma's arrows show it. */
|
|
184
|
+
export const MOTION_DIRECTIONS = ['LEFT', 'RIGHT', 'DOWN', 'UP'] as const
|
|
185
|
+
export type MotionDirection = (typeof MOTION_DIRECTIONS)[number]
|
|
186
|
+
|
|
187
|
+
/** The record names' prefix for each kind that moves. */
|
|
188
|
+
const KIND_PREFIXES = {
|
|
189
|
+
PUSH: 'PUSH_FROM_',
|
|
190
|
+
SLIDE_IN: 'SLIDE_FROM_',
|
|
191
|
+
SLIDE_OUT: 'SLIDE_OUT_TO_',
|
|
192
|
+
MOVE_IN: 'MOVE_FROM_',
|
|
193
|
+
MOVE_OUT: 'MOVE_OUT_TO_'
|
|
194
|
+
} as const
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* The side a record names for a way of moving: what moves rightwards comes from the left, and,
|
|
198
|
+
* as Figma names them, an `OUT_TO_LEFT` moves rightwards too.
|
|
199
|
+
*/
|
|
200
|
+
const SIDES: Record<MotionDirection, 'LEFT' | 'RIGHT' | 'TOP' | 'BOTTOM'> = {
|
|
201
|
+
RIGHT: 'LEFT',
|
|
202
|
+
LEFT: 'RIGHT',
|
|
203
|
+
DOWN: 'TOP',
|
|
204
|
+
UP: 'BOTTOM'
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function directionName(direction: Direction): MotionDirection {
|
|
208
|
+
if (direction[0] > 0) return 'RIGHT'
|
|
209
|
+
if (direction[0] < 0) return 'LEFT'
|
|
210
|
+
return direction[1] > 0 ? 'DOWN' : 'UP'
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** A style's kind, as Figma's panel lists it. */
|
|
214
|
+
export function transitionKind(style: SlideTransitionStyle): SlideTransitionKind {
|
|
215
|
+
for (const [kind, prefix] of Object.entries(KIND_PREFIXES))
|
|
216
|
+
if (style.startsWith(prefix)) return kind as SlideTransitionKind
|
|
217
|
+
return style === 'NONE' || style === 'SMART_ANIMATE' ? style : 'DISSOLVE'
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** Which way a style moves its slides, or null for one that does not move them. */
|
|
221
|
+
export function transitionDirection(style: SlideTransitionStyle): MotionDirection | null {
|
|
222
|
+
return transitionKind(style) in KIND_PREFIXES ? directionName(directionOf(style)) : null
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/** The style of a kind moving `direction`; a kind that does not move ignores it. */
|
|
226
|
+
export function transitionStyle(
|
|
227
|
+
kind: SlideTransitionKind,
|
|
228
|
+
direction: MotionDirection
|
|
229
|
+
): SlideTransitionStyle {
|
|
230
|
+
if (kind === 'NONE' || kind === 'SMART_ANIMATE' || kind === 'DISSOLVE') return kind
|
|
231
|
+
return `${KIND_PREFIXES[kind]}${SIDES[direction]}` as SlideTransitionStyle
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/** Which way a layer animation moves its layer, or null for a fade. */
|
|
235
|
+
export function layerAnimationDirection(style: LayerAnimation['style']): MotionDirection | null {
|
|
236
|
+
return style === 'FADE' ? null : directionName(LAYER_DIRECTIONS[style])
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/** The layer animation that slides its layer `direction`, or fades it with null. */
|
|
240
|
+
export function layerAnimationStyle(direction: MotionDirection | null): LayerAnimation['style'] {
|
|
241
|
+
return direction ? `SLIDE_FROM_${SIDES[direction]}` : 'FADE'
|
|
242
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { Easing } from '../types'
|
|
2
|
+
|
|
3
|
+
/** How a slide gives way to the next, by Figma's names for its slide transitions. */
|
|
4
|
+
export const SLIDE_TRANSITION_STYLES = [
|
|
5
|
+
'NONE',
|
|
6
|
+
'DISSOLVE',
|
|
7
|
+
'SLIDE_FROM_LEFT',
|
|
8
|
+
'SLIDE_FROM_RIGHT',
|
|
9
|
+
'SLIDE_FROM_BOTTOM',
|
|
10
|
+
'SLIDE_FROM_TOP',
|
|
11
|
+
'PUSH_FROM_LEFT',
|
|
12
|
+
'PUSH_FROM_RIGHT',
|
|
13
|
+
'PUSH_FROM_BOTTOM',
|
|
14
|
+
'PUSH_FROM_TOP',
|
|
15
|
+
'MOVE_FROM_LEFT',
|
|
16
|
+
'MOVE_FROM_RIGHT',
|
|
17
|
+
'MOVE_FROM_TOP',
|
|
18
|
+
'MOVE_FROM_BOTTOM',
|
|
19
|
+
'SLIDE_OUT_TO_LEFT',
|
|
20
|
+
'SLIDE_OUT_TO_RIGHT',
|
|
21
|
+
'SLIDE_OUT_TO_TOP',
|
|
22
|
+
'SLIDE_OUT_TO_BOTTOM',
|
|
23
|
+
'MOVE_OUT_TO_LEFT',
|
|
24
|
+
'MOVE_OUT_TO_RIGHT',
|
|
25
|
+
'MOVE_OUT_TO_TOP',
|
|
26
|
+
'MOVE_OUT_TO_BOTTOM',
|
|
27
|
+
'SMART_ANIMATE'
|
|
28
|
+
] as const
|
|
29
|
+
export type SlideTransitionStyle = (typeof SLIDE_TRANSITION_STYLES)[number]
|
|
30
|
+
|
|
31
|
+
/** What moves the deck on from a slide: a click, or `delay` seconds passing. */
|
|
32
|
+
export type SlideTransitionTiming =
|
|
33
|
+
| { type: 'ON_CLICK' }
|
|
34
|
+
| {
|
|
35
|
+
type: 'AFTER_DELAY'
|
|
36
|
+
delay: number
|
|
37
|
+
/** The TIMING variable the delay follows while it exists; `delay` is kept beside it. */
|
|
38
|
+
delayVariableId?: string
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* How a deck moves on from a slide. It names no slide: the next one is the next in the grid. The
|
|
43
|
+
* duration and easing may follow TIMING and EASING variables, keeping their values beside them
|
|
44
|
+
* for when the variables are gone, as a behaviour's transition does.
|
|
45
|
+
*/
|
|
46
|
+
export interface SlideTransition {
|
|
47
|
+
style: SlideTransitionStyle
|
|
48
|
+
/** In seconds; a spring easing settles in its own time instead. */
|
|
49
|
+
duration: number
|
|
50
|
+
easing: Easing
|
|
51
|
+
durationVariableId?: string
|
|
52
|
+
easingVariableId?: string
|
|
53
|
+
timing: SlideTransitionTiming
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** How a layer comes onto or leaves its slide, by Figma's names: a slide moves from that side. */
|
|
57
|
+
export const LAYER_ANIMATION_STYLES = [
|
|
58
|
+
'FADE',
|
|
59
|
+
'SLIDE_FROM_LEFT',
|
|
60
|
+
'SLIDE_FROM_RIGHT',
|
|
61
|
+
'SLIDE_FROM_TOP',
|
|
62
|
+
'SLIDE_FROM_BOTTOM'
|
|
63
|
+
] as const
|
|
64
|
+
export type LayerAnimationStyle = (typeof LAYER_ANIMATION_STYLES)[number]
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* A layer's animation on its slide: a step of the slide's build. Steps play in `order`; one that
|
|
68
|
+
* plays `ON_CLICK` waits for the presenter, one that plays `AFTER_PREVIOUS` follows the step before
|
|
69
|
+
* it. It lives on the layer so a copied layer or slide keeps it, and a layer has one at most, as in
|
|
70
|
+
* Figma.
|
|
71
|
+
*/
|
|
72
|
+
export interface LayerAnimation {
|
|
73
|
+
style: LayerAnimationStyle
|
|
74
|
+
/** `IN` brings the layer on, so it is hidden until its step; `OUT` takes it away. */
|
|
75
|
+
phase: 'IN' | 'OUT'
|
|
76
|
+
trigger: 'ON_CLICK' | 'AFTER_PREVIOUS'
|
|
77
|
+
/** In seconds. */
|
|
78
|
+
duration: number
|
|
79
|
+
easing: Easing
|
|
80
|
+
durationVariableId?: string
|
|
81
|
+
easingVariableId?: string
|
|
82
|
+
/** Where the step plays among the slide's; ties play in layer order. */
|
|
83
|
+
order: number
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** What a slide keeps besides its layers. */
|
|
87
|
+
export interface SlideSettings {
|
|
88
|
+
/** Whether presenting passes the slide by; a skipped slide has no number either. */
|
|
89
|
+
skipped: boolean
|
|
90
|
+
/** The presenter's notes as plain text, a paragraph per line. */
|
|
91
|
+
notes: string
|
|
92
|
+
/** How the deck moves on from the slide, or null when it was never set. */
|
|
93
|
+
transition: SlideTransition | null
|
|
94
|
+
}
|
package/src/slots/frames.ts
CHANGED
|
@@ -18,9 +18,8 @@ export function ownsSlotContent(
|
|
|
18
18
|
propertyId = slotPropertyId(node)
|
|
19
19
|
): boolean {
|
|
20
20
|
if (!propertyId) return false
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
owner = owner.parentId ? graph.nodes.get(owner.parentId) : undefined
|
|
21
|
+
if (!node.parentId) return false
|
|
22
|
+
const owner = graph.closest(node.parentId, (ancestor) => ancestor.type === 'INSTANCE')
|
|
24
23
|
return !!owner && Object.hasOwn(owner.componentPropertyAssignments, propertyId)
|
|
25
24
|
}
|
|
26
25
|
|