@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
package/src/font-style.ts
CHANGED
|
@@ -8,6 +8,9 @@ export interface ParsedFontStyle {
|
|
|
8
8
|
italic: boolean
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
/** A face by its family and style names, with the weight and slant it draws at. */
|
|
12
|
+
export interface FontFaceStyle extends FontFamilyStyle, ParsedFontStyle {}
|
|
13
|
+
|
|
11
14
|
/**
|
|
12
15
|
* The standard weights by the names Google Fonts gives them, which most fonts and Figma's font
|
|
13
16
|
* list use; a font's own names can differ ("Semi Bold", "Book", "Heavy").
|
|
@@ -100,9 +103,14 @@ export function normalizeFontFamily(family: string): string {
|
|
|
100
103
|
return family.replace(/\s+(Variable|\d+(?:pt|px|em))$/i, '')
|
|
101
104
|
}
|
|
102
105
|
|
|
106
|
+
/** The name of the standard weight nearest `weight`, from Thin at 100 to Black at 900. */
|
|
107
|
+
function weightName(weight: number): string {
|
|
108
|
+
const nearest = Math.min(900, Math.max(100, Math.round(weight / 100) * 100))
|
|
109
|
+
return FONT_WEIGHT_NAMES[nearest] ?? 'Regular'
|
|
110
|
+
}
|
|
111
|
+
|
|
103
112
|
export function faceLoadKey(weight: number, italic = false): string {
|
|
104
|
-
const
|
|
105
|
-
const label = FONT_WEIGHT_NAMES[rounded] ?? 'Regular'
|
|
113
|
+
const label = weightName(weight)
|
|
106
114
|
return italic ? `${label} Italic` : label
|
|
107
115
|
}
|
|
108
116
|
|
|
@@ -111,7 +119,7 @@ export function faceLoadKey(weight: number, italic = false): string {
|
|
|
111
119
|
* for the regular weight), for a face whose font has not said its own.
|
|
112
120
|
*/
|
|
113
121
|
export function standardStyleName(weight: number, italic = false): string {
|
|
114
|
-
const label =
|
|
122
|
+
const label = weightName(weight)
|
|
115
123
|
if (!italic) return label
|
|
116
124
|
return label === 'Regular' ? 'Italic' : `${label} Italic`
|
|
117
125
|
}
|
|
@@ -143,13 +151,18 @@ export interface NamedFace {
|
|
|
143
151
|
/**
|
|
144
152
|
* The style a face loads and draws as. A name that only spells its weight and slant ("Semi Bold",
|
|
145
153
|
* "Italic") loads as the weight's key, so whichever font of the family draws that weight draws
|
|
146
|
-
* it
|
|
147
|
-
*
|
|
154
|
+
* it, and so does an italic face's name that spells its weight alone, as an italic font names
|
|
155
|
+
* its instance "Bold"; any other name ("Book", "Condensed Bold", "Retina") is a face the weight
|
|
156
|
+
* cannot pick, and it loads and draws by that name.
|
|
148
157
|
*/
|
|
149
158
|
export function faceStyleKey({ fontWeight, italic, fontStyle }: NamedFace): string {
|
|
150
159
|
const key = faceLoadKey(fontWeight, italic)
|
|
151
160
|
if (!fontStyle) return key
|
|
152
161
|
const spelling = styleSpelling(fontStyle)
|
|
153
|
-
const
|
|
154
|
-
|
|
162
|
+
const slants = italic ? [true, false] : [false]
|
|
163
|
+
const weightNames = slants.flatMap((slant) => [
|
|
164
|
+
faceLoadKey(fontWeight, slant),
|
|
165
|
+
standardStyleName(fontWeight, slant)
|
|
166
|
+
])
|
|
167
|
+
return weightNames.map(styleSpelling).includes(spelling) ? key : fontStyle
|
|
155
168
|
}
|
package/src/generated/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { SceneGraph } from '../graph'
|
|
|
3
3
|
import type { NodeType, SceneNode } from '../types'
|
|
4
4
|
import type { GeneratedFrameKind } from './kind'
|
|
5
5
|
import { SHAPE_WITH_TEXT_KIND } from './shape-with-text'
|
|
6
|
+
import { SPEC_KIND } from './spec'
|
|
6
7
|
import { STICKY_KIND } from './sticky'
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -17,7 +18,8 @@ import { STICKY_KIND } from './sticky'
|
|
|
17
18
|
const GENERATED_FRAME_KINDS = {
|
|
18
19
|
SHAPE_WITH_TEXT: SHAPE_WITH_TEXT_KIND,
|
|
19
20
|
STICKY: STICKY_KIND,
|
|
20
|
-
CONNECTOR: CONNECTOR_KIND
|
|
21
|
+
CONNECTOR: CONNECTOR_KIND,
|
|
22
|
+
SPEC: SPEC_KIND
|
|
21
23
|
} satisfies Partial<Record<NodeType, GeneratedFrameKind>>
|
|
22
24
|
|
|
23
25
|
/** The layer types that are generated frames, for tables that must cover each of them. */
|
|
@@ -38,14 +40,40 @@ export function isGeneratedFrame<N extends Pick<SceneNode, 'type'>>(
|
|
|
38
40
|
return GENERATED_FRAME_TYPES.has(node.type)
|
|
39
41
|
}
|
|
40
42
|
|
|
41
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* Whether `child` of the generated frame `frame` is a layer of its own, which the frame embeds
|
|
45
|
+
* rather than draws (`GeneratedFrameKind.embeds`).
|
|
46
|
+
*/
|
|
47
|
+
export function embedsLayer(frame: SceneNode, child: SceneNode): boolean {
|
|
48
|
+
return generatedFrameKind(frame)?.embeds?.(child) ?? false
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The generated frame a layer belongs to, if it is one of the sublayers the frame draws: none for
|
|
53
|
+
* a layer in or under one the frame embeds.
|
|
54
|
+
*/
|
|
42
55
|
export function generatedFrameOwner(graph: SceneGraph, node: SceneNode): SceneNode | undefined {
|
|
43
|
-
|
|
56
|
+
if (!node.parentId) return undefined
|
|
57
|
+
// The frame's child the layer is or sits in, which tells whether the frame embeds it.
|
|
58
|
+
let child = node
|
|
59
|
+
const frame = graph.closest(node.parentId, (candidate) => {
|
|
60
|
+
if (isGeneratedFrame(candidate)) return true
|
|
61
|
+
child = candidate
|
|
62
|
+
return false
|
|
63
|
+
})
|
|
64
|
+
return frame && !embedsLayer(frame, child) ? frame : undefined
|
|
44
65
|
}
|
|
45
66
|
|
|
46
|
-
/**
|
|
47
|
-
|
|
48
|
-
|
|
67
|
+
/**
|
|
68
|
+
* The text a generated frame edits in place: a sticky note's body, a connector's label, or the
|
|
69
|
+
* block of a spec that holds `sublayer`.
|
|
70
|
+
*/
|
|
71
|
+
export function generatedFrameText(
|
|
72
|
+
graph: SceneGraph,
|
|
73
|
+
node: SceneNode,
|
|
74
|
+
sublayer?: SceneNode
|
|
75
|
+
): SceneNode | undefined {
|
|
76
|
+
return generatedFrameKind(node)?.text(graph, node, sublayer)
|
|
49
77
|
}
|
|
50
78
|
|
|
51
79
|
/**
|
|
@@ -61,16 +89,37 @@ export function withGeneratedFrameSize(
|
|
|
61
89
|
return { ...kind.sized(changes, node), ...changes }
|
|
62
90
|
}
|
|
63
91
|
|
|
64
|
-
/**
|
|
92
|
+
/** A deck's slides, and the rows and grid that lay them out: their size and place are the deck's. */
|
|
93
|
+
export const DECK_TYPES: ReadonlySet<NodeType> = new Set<NodeType>([
|
|
94
|
+
'SLIDE',
|
|
95
|
+
'SLIDE_ROW',
|
|
96
|
+
'SLIDE_GRID'
|
|
97
|
+
])
|
|
98
|
+
|
|
99
|
+
/** Whether a layer is placed by its X and Y: any but a deck's slides, rows, and grid. */
|
|
100
|
+
export function layerMoves(node: Pick<SceneNode, 'type'>): boolean {
|
|
101
|
+
return !DECK_TYPES.has(node.type)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** Whether a layer turns: any layer but a generated frame that stays upright, or a deck's slides. */
|
|
65
105
|
export function layerRotates(node: Pick<SceneNode, 'type'>): boolean {
|
|
66
|
-
return generatedFrameKind(node)?.rotates ?? true
|
|
106
|
+
return !DECK_TYPES.has(node.type) && (generatedFrameKind(node)?.rotates ?? true)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Whether a layer's auto layout is the person's to arrange, with its outlines and spacing
|
|
111
|
+
* handles: not a generated frame's, which places its own sublayers, nor a deck's rows and grid.
|
|
112
|
+
*/
|
|
113
|
+
export function layoutIsArranged(node: Pick<SceneNode, 'type'>): boolean {
|
|
114
|
+
return !DECK_TYPES.has(node.type) && !generatedFrameKind(node)
|
|
67
115
|
}
|
|
68
116
|
|
|
69
117
|
/** Whether a layer's resize handles and W and H fields resize it freely. */
|
|
70
118
|
export function layerResizes(node: Pick<SceneNode, 'type'>): boolean {
|
|
71
|
-
return generatedFrameKind(node)?.resizes ?? true
|
|
119
|
+
return !DECK_TYPES.has(node.type) && (generatedFrameKind(node)?.resizes ?? true)
|
|
72
120
|
}
|
|
73
121
|
|
|
74
122
|
export type { GeneratedFrameKind } from './kind'
|
|
75
123
|
export * from './shape-with-text'
|
|
124
|
+
export * from './spec'
|
|
76
125
|
export * from './sticky'
|
package/src/generated/kind.ts
CHANGED
|
@@ -8,14 +8,28 @@ import type { SceneNode } from '../types'
|
|
|
8
8
|
export interface GeneratedFrameKind {
|
|
9
9
|
/** Whether the frame still has its template's layers; one that lost them is a plain frame. */
|
|
10
10
|
complete(graph: SceneGraph, frame: SceneNode): boolean
|
|
11
|
-
/**
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The text a user types into in place: on double-click or Enter, and as a script's `text`. A
|
|
13
|
+
* frame with several texts, such as a spec's blocks, gives the one holding `sublayer`, the
|
|
14
|
+
* sublayer a double-click landed on, and its first without one.
|
|
15
|
+
*/
|
|
16
|
+
text(graph: SceneGraph, frame: SceneNode, sublayer?: SceneNode): SceneNode | undefined
|
|
17
|
+
/**
|
|
18
|
+
* Whether `child`, one of the frame's own children, is a layer of its own rather than one the
|
|
19
|
+
* frame draws: selected, drilled into, and edited as anywhere else, as a spec's instance is.
|
|
20
|
+
*/
|
|
21
|
+
embeds?(child: SceneNode): boolean
|
|
13
22
|
/** Whether the frame turns; FigJam keeps sticky notes upright. */
|
|
14
23
|
rotates: boolean
|
|
15
24
|
/** Whether the frame's resize handles and W and H fields resize it freely. */
|
|
16
25
|
resizes: boolean
|
|
17
26
|
/** Whether it takes its name from its text until the user names it, as a sticky note does. */
|
|
18
27
|
namedByText: boolean
|
|
28
|
+
/**
|
|
29
|
+
* What a double-click into its text selects: all of it, as FigJam selects a note's body, or
|
|
30
|
+
* a caret where the click landed, as in a document.
|
|
31
|
+
*/
|
|
32
|
+
textSelection: 'all' | 'caret'
|
|
19
33
|
/**
|
|
20
34
|
* What a width or height set on `frame` from outside layout also sets on it, such as the height
|
|
21
35
|
* a shape with text was given, which layout grows it from.
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import type { SceneGraph } from '../graph'
|
|
2
|
+
import type { Color } from '../primitives'
|
|
3
|
+
import { readSpecBlock } from '../specs/model'
|
|
4
|
+
import type { SpecBlockKind } from '../specs/schema'
|
|
5
|
+
import { percentLength } from '../text/lengths'
|
|
6
|
+
import type { Effect, Fill, SceneNode, Stroke } from '../types'
|
|
7
|
+
import type { GeneratedFrameKind } from './kind'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A spec as OpenPencil draws it: a white page of fixed width that grows to fit its blocks, one
|
|
11
|
+
* sublayer per block of its Markdown, stacked by a vertical auto layout.
|
|
12
|
+
*/
|
|
13
|
+
export const SPEC_WIDTH = 720
|
|
14
|
+
const SPEC_PADDING_X = 56
|
|
15
|
+
const SPEC_PADDING_Y = 48
|
|
16
|
+
const SPEC_BLOCK_GAP = 16
|
|
17
|
+
const SPEC_RADIUS = 16
|
|
18
|
+
|
|
19
|
+
export const SPEC_FONT_FAMILY = 'Inter'
|
|
20
|
+
export const SPEC_FONT_SIZE = 16
|
|
21
|
+
export const SPEC_FONT_WEIGHT = 400
|
|
22
|
+
export const SPEC_CODE_FONT_FAMILY = 'Roboto Mono'
|
|
23
|
+
export const SPEC_CODE_FONT_SIZE = 14
|
|
24
|
+
const SPEC_CODE_PADDING = 16
|
|
25
|
+
const SPEC_CODE_RADIUS = 8
|
|
26
|
+
|
|
27
|
+
const INK: Color = { r: 0.118, g: 0.118, b: 0.118, a: 1 }
|
|
28
|
+
const MUTED_INK: Color = { r: 0.459, g: 0.459, b: 0.459, a: 1 }
|
|
29
|
+
const CODE_BACKGROUND: Color = { r: 0.96, g: 0.96, b: 0.96, a: 1 }
|
|
30
|
+
const RULE: Color = { r: 0.9, g: 0.9, b: 0.9, a: 1 }
|
|
31
|
+
const WHITE: Color = { r: 1, g: 1, b: 1, a: 1 }
|
|
32
|
+
|
|
33
|
+
function solid(color: Color): Fill {
|
|
34
|
+
return { type: 'SOLID', color: { ...color }, opacity: 1, visible: true }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function hairline(): Stroke {
|
|
38
|
+
return { ...solid(RULE), weight: 1, align: 'INSIDE' }
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function shadow(y: number, radius: number, alpha: number): Effect {
|
|
42
|
+
return {
|
|
43
|
+
type: 'DROP_SHADOW',
|
|
44
|
+
color: { r: 0, g: 0, b: 0, a: alpha },
|
|
45
|
+
offset: { x: 0, y },
|
|
46
|
+
radius,
|
|
47
|
+
spread: 0,
|
|
48
|
+
visible: true,
|
|
49
|
+
blendMode: 'NORMAL',
|
|
50
|
+
showShadowBehindNode: false
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** The spec's own fields: the page, its padding, and the auto layout that stacks its blocks. */
|
|
55
|
+
export function specFrameFields(): Partial<SceneNode> {
|
|
56
|
+
return {
|
|
57
|
+
layoutMode: 'VERTICAL',
|
|
58
|
+
primaryAxisAlign: 'MIN',
|
|
59
|
+
counterAxisAlign: 'MIN',
|
|
60
|
+
primaryAxisSizing: 'HUG',
|
|
61
|
+
counterAxisSizing: 'FIXED',
|
|
62
|
+
itemSpacing: SPEC_BLOCK_GAP,
|
|
63
|
+
paddingTop: SPEC_PADDING_Y,
|
|
64
|
+
paddingBottom: SPEC_PADDING_Y,
|
|
65
|
+
paddingLeft: SPEC_PADDING_X,
|
|
66
|
+
paddingRight: SPEC_PADDING_X,
|
|
67
|
+
cornerRadius: SPEC_RADIUS,
|
|
68
|
+
clipsContent: false,
|
|
69
|
+
fills: [solid(WHITE)],
|
|
70
|
+
effects: [shadow(1, 3, 0.08), shadow(4, 12, 0.06)]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** A prose block's text: as wide as the page allows and as tall as its text. */
|
|
75
|
+
export function specTextFields(kind: SpecBlockKind): Partial<SceneNode> {
|
|
76
|
+
const code = kind === 'code' || kind === 'raw'
|
|
77
|
+
return {
|
|
78
|
+
fontFamily: code ? SPEC_CODE_FONT_FAMILY : SPEC_FONT_FAMILY,
|
|
79
|
+
fontWeight: SPEC_FONT_WEIGHT,
|
|
80
|
+
fontSize: code ? SPEC_CODE_FONT_SIZE : SPEC_FONT_SIZE,
|
|
81
|
+
lineHeight: percentLength(150),
|
|
82
|
+
textAlignHorizontal: 'LEFT',
|
|
83
|
+
textAlignVertical: 'TOP',
|
|
84
|
+
textAutoResize: 'HEIGHT',
|
|
85
|
+
layoutAlignSelf: 'STRETCH',
|
|
86
|
+
fills: [solid(kind === 'raw' || kind === 'quote' ? MUTED_INK : INK)],
|
|
87
|
+
italic: kind === 'quote'
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** Heading sizes by level, 1 to 6; levels past the list take the last. */
|
|
92
|
+
const HEADING_SIZES = [32, 24, 20, 17, 16, 16] as const
|
|
93
|
+
|
|
94
|
+
/** A heading's own style, which its text is set in and its Markdown is written relative to. */
|
|
95
|
+
export function specHeadingFields(
|
|
96
|
+
level: number
|
|
97
|
+
): Pick<SceneNode, 'fontSize' | 'fontWeight' | 'lineHeight'> {
|
|
98
|
+
const size = HEADING_SIZES[Math.min(Math.max(level, 1), HEADING_SIZES.length) - 1]
|
|
99
|
+
return { fontSize: size, fontWeight: level <= 2 ? 700 : 600, lineHeight: percentLength(130) }
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** The frame a code block's text sits in. */
|
|
103
|
+
export function specCodeFrameFields(): Partial<SceneNode> {
|
|
104
|
+
return {
|
|
105
|
+
layoutMode: 'VERTICAL',
|
|
106
|
+
primaryAxisSizing: 'HUG',
|
|
107
|
+
counterAxisSizing: 'FIXED',
|
|
108
|
+
layoutAlignSelf: 'STRETCH',
|
|
109
|
+
paddingTop: SPEC_CODE_PADDING,
|
|
110
|
+
paddingBottom: SPEC_CODE_PADDING,
|
|
111
|
+
paddingLeft: SPEC_CODE_PADDING,
|
|
112
|
+
paddingRight: SPEC_CODE_PADDING,
|
|
113
|
+
cornerRadius: SPEC_CODE_RADIUS,
|
|
114
|
+
clipsContent: true,
|
|
115
|
+
fills: [solid(CODE_BACKGROUND)]
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const SPEC_TABLE_CELL_PADDING_X = 12
|
|
120
|
+
const SPEC_TABLE_CELL_PADDING_Y = 8
|
|
121
|
+
const SPEC_TABLE_FONT_SIZE = 14
|
|
122
|
+
const SPEC_TABLE_SWATCH = 14
|
|
123
|
+
|
|
124
|
+
/** A `::tokens` table: rows stacked as wide as the page, in a rounded outline. */
|
|
125
|
+
export function specTableFields(): Partial<SceneNode> {
|
|
126
|
+
return {
|
|
127
|
+
layoutMode: 'VERTICAL',
|
|
128
|
+
primaryAxisSizing: 'HUG',
|
|
129
|
+
counterAxisSizing: 'FIXED',
|
|
130
|
+
layoutAlignSelf: 'STRETCH',
|
|
131
|
+
itemSpacing: 0,
|
|
132
|
+
cornerRadius: SPEC_CODE_RADIUS,
|
|
133
|
+
clipsContent: true,
|
|
134
|
+
fills: [],
|
|
135
|
+
strokes: [hairline()]
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** A row of a table, its cells side by side; the header row is shaded as code is. */
|
|
140
|
+
export function specTableRowFields(header: boolean): Partial<SceneNode> {
|
|
141
|
+
return {
|
|
142
|
+
layoutMode: 'HORIZONTAL',
|
|
143
|
+
primaryAxisSizing: 'FIXED',
|
|
144
|
+
counterAxisSizing: 'HUG',
|
|
145
|
+
counterAxisAlign: 'CENTER',
|
|
146
|
+
layoutAlignSelf: 'STRETCH',
|
|
147
|
+
itemSpacing: 0,
|
|
148
|
+
fills: header ? [solid(CODE_BACKGROUND)] : []
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** A cell of a table: an equal share of its row, its contents side by side. */
|
|
153
|
+
export function specTableCellFields(): Partial<SceneNode> {
|
|
154
|
+
return {
|
|
155
|
+
layoutMode: 'HORIZONTAL',
|
|
156
|
+
primaryAxisSizing: 'FIXED',
|
|
157
|
+
counterAxisSizing: 'HUG',
|
|
158
|
+
counterAxisAlign: 'CENTER',
|
|
159
|
+
layoutGrow: 1,
|
|
160
|
+
itemSpacing: 8,
|
|
161
|
+
paddingTop: SPEC_TABLE_CELL_PADDING_Y,
|
|
162
|
+
paddingBottom: SPEC_TABLE_CELL_PADDING_Y,
|
|
163
|
+
paddingLeft: SPEC_TABLE_CELL_PADDING_X,
|
|
164
|
+
paddingRight: SPEC_TABLE_CELL_PADDING_X,
|
|
165
|
+
fills: []
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** A cell's words; a header's are muted and a value's set in the code face. */
|
|
170
|
+
export function specTableTextFields(cell: 'header' | 'name' | 'value'): Partial<SceneNode> {
|
|
171
|
+
return {
|
|
172
|
+
fontFamily: cell === 'value' ? SPEC_CODE_FONT_FAMILY : SPEC_FONT_FAMILY,
|
|
173
|
+
fontWeight: cell === 'header' ? 600 : SPEC_FONT_WEIGHT,
|
|
174
|
+
fontSize: SPEC_TABLE_FONT_SIZE,
|
|
175
|
+
lineHeight: percentLength(150),
|
|
176
|
+
textAutoResize: 'WIDTH_AND_HEIGHT',
|
|
177
|
+
fills: [solid(cell === 'header' ? MUTED_INK : INK)]
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/** The swatch before a colour's value in a table. */
|
|
182
|
+
export function specTableSwatchFields(color: Color): Partial<SceneNode> {
|
|
183
|
+
return {
|
|
184
|
+
width: SPEC_TABLE_SWATCH,
|
|
185
|
+
height: SPEC_TABLE_SWATCH,
|
|
186
|
+
cornerRadius: 3,
|
|
187
|
+
fills: [{ type: 'SOLID', color: { ...color, a: 1 }, opacity: color.a, visible: true }],
|
|
188
|
+
strokes: [hairline()]
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/** A horizontal rule: a hairline as wide as the page. */
|
|
193
|
+
export function specRuleFields(): Partial<SceneNode> {
|
|
194
|
+
return { height: 1, layoutAlignSelf: 'STRETCH', fills: [solid(RULE)] }
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/** The text a block's sublayer is edited through: the sublayer itself or the text inside it. */
|
|
198
|
+
function blockText(graph: SceneGraph, layer: SceneNode): SceneNode | undefined {
|
|
199
|
+
if (layer.type === 'TEXT') return layer
|
|
200
|
+
return graph.getChildren(layer.id).find((child) => child.type === 'TEXT')
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const PROSE: ReadonlySet<SpecBlockKind> = new Set(['heading', 'paragraph', 'list', 'quote', 'code'])
|
|
204
|
+
|
|
205
|
+
/** The spec's sublayer that `node` is or sits in. */
|
|
206
|
+
export function specBlockLayer(
|
|
207
|
+
graph: SceneGraph,
|
|
208
|
+
spec: SceneNode,
|
|
209
|
+
node: SceneNode
|
|
210
|
+
): SceneNode | undefined {
|
|
211
|
+
return graph.closest(node.id, (candidate) => candidate.parentId === spec.id)
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/** The text of a spec's block typed into in place, or none for blocks drawn otherwise. */
|
|
215
|
+
export function specBlockText(graph: SceneGraph, layer: SceneNode): SceneNode | undefined {
|
|
216
|
+
const block = readSpecBlock(layer)
|
|
217
|
+
return block && PROSE.has(block.kind) ? blockText(graph, layer) : undefined
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* A spec is edited block by block, in the text of the block a double-click lands on; it resizes
|
|
222
|
+
* only in width, its height following its blocks.
|
|
223
|
+
*/
|
|
224
|
+
export const SPEC_KIND: GeneratedFrameKind = {
|
|
225
|
+
complete: () => true,
|
|
226
|
+
text: (graph, frame, sublayer) => {
|
|
227
|
+
if (sublayer) {
|
|
228
|
+
const layer = specBlockLayer(graph, frame, sublayer)
|
|
229
|
+
return layer ? specBlockText(graph, layer) : undefined
|
|
230
|
+
}
|
|
231
|
+
for (const layer of graph.getChildren(frame.id)) {
|
|
232
|
+
const text = specBlockText(graph, layer)
|
|
233
|
+
if (text) return text
|
|
234
|
+
}
|
|
235
|
+
return undefined
|
|
236
|
+
},
|
|
237
|
+
// An instance block is an instance as anywhere else; Markdown records what is done to it.
|
|
238
|
+
embeds: (child) => readSpecBlock(child)?.kind === 'instance',
|
|
239
|
+
rotates: true,
|
|
240
|
+
resizes: true,
|
|
241
|
+
namedByText: false,
|
|
242
|
+
textSelection: 'caret'
|
|
243
|
+
}
|
package/src/generated/sticky.ts
CHANGED
|
@@ -147,7 +147,8 @@ export const STICKY_KIND: GeneratedFrameKind = {
|
|
|
147
147
|
text: (graph, frame) => stickySublayers(graph, frame)?.body,
|
|
148
148
|
rotates: false,
|
|
149
149
|
resizes: false,
|
|
150
|
-
namedByText: true
|
|
150
|
+
namedByText: true,
|
|
151
|
+
textSelection: 'all'
|
|
151
152
|
}
|
|
152
153
|
|
|
153
154
|
export interface StickyContent {
|
package/src/geometry.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { arrowCapOverflow } from './arrow-caps'
|
|
2
|
+
import { drawnBlurRadius, widestBlurRadius } from './blur'
|
|
3
|
+
import Matrix, { type Mat3 } from './matrix'
|
|
2
4
|
import { joinedSegmentPairs, leavingDirection } from './paths/network'
|
|
3
5
|
import type { Rect, Vector } from './primitives'
|
|
4
6
|
import type {
|
|
@@ -11,7 +13,7 @@ import type {
|
|
|
11
13
|
VectorNetwork
|
|
12
14
|
} from './types'
|
|
13
15
|
|
|
14
|
-
export { cubicPoint } from './cubic'
|
|
16
|
+
export { computeAccurateBounds, cubicExtrema, cubicPoint } from './cubic'
|
|
15
17
|
|
|
16
18
|
export function degToRad(degrees: number): number {
|
|
17
19
|
return (degrees * Math.PI) / 180
|
|
@@ -21,6 +23,9 @@ export function radToDeg(radians: number): number {
|
|
|
21
23
|
return (radians * 180) / Math.PI
|
|
22
24
|
}
|
|
23
25
|
|
|
26
|
+
/** Bezier handle length, as a share of the radius, for a quarter circle. */
|
|
27
|
+
export const KAPPA = (4 / 3) * (Math.SQRT2 - 1)
|
|
28
|
+
|
|
24
29
|
const FULL_TURN = 2 * Math.PI
|
|
25
30
|
|
|
26
31
|
/** Layers whose shadows Figma never spreads: a text, boolean, star, polygon or vector. */
|
|
@@ -159,6 +164,39 @@ function boundsToRect(bounds: BoundsAccumulator): Rect {
|
|
|
159
164
|
return bounds.minX === Infinity ? { x: 0, y: 0, width: 0, height: 0 } : visualBoundsToRect(bounds)
|
|
160
165
|
}
|
|
161
166
|
|
|
167
|
+
/** The box around interleaved `x, y` coordinates, or null when there are none. */
|
|
168
|
+
export function coordinateBounds(coords: readonly number[]): VisualBounds | null {
|
|
169
|
+
const bounds = createBoundsAccumulator()
|
|
170
|
+
for (let i = 0; i < coords.length; i += 2) includePoint(bounds, coords[i], coords[i + 1])
|
|
171
|
+
return bounds.minX === Infinity ? null : bounds
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/** The box around `points`, or null when there are none. */
|
|
175
|
+
export function pointBounds(points: Iterable<Vector>): VisualBounds | null {
|
|
176
|
+
const bounds = createBoundsAccumulator()
|
|
177
|
+
for (const point of points) includePoint(bounds, point.x, point.y)
|
|
178
|
+
return bounds.minX === Infinity ? null : bounds
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/** The axis-aligned box around `rect` once `matrix` maps it, so rotation and skew count. */
|
|
182
|
+
export function transformedRectBounds(matrix: Mat3, rect: Rect): VisualBounds {
|
|
183
|
+
const right = rect.x + rect.width
|
|
184
|
+
const bottom = rect.y + rect.height
|
|
185
|
+
const corners = Matrix.mapPoints(matrix, [
|
|
186
|
+
rect.x,
|
|
187
|
+
rect.y,
|
|
188
|
+
right,
|
|
189
|
+
rect.y,
|
|
190
|
+
right,
|
|
191
|
+
bottom,
|
|
192
|
+
rect.x,
|
|
193
|
+
bottom
|
|
194
|
+
])
|
|
195
|
+
const bounds = createBoundsAccumulator()
|
|
196
|
+
for (let i = 0; i < corners.length; i += 2) includePoint(bounds, corners[i], corners[i + 1])
|
|
197
|
+
return bounds
|
|
198
|
+
}
|
|
199
|
+
|
|
162
200
|
export function computeBounds(items: Iterable<Rect>): Rect {
|
|
163
201
|
const bounds = createBoundsAccumulator()
|
|
164
202
|
for (const item of items) includeRect(bounds, item)
|
|
@@ -216,7 +254,8 @@ const SIDE_STROKE_TYPES: ReadonlySet<string> = new Set<SceneNode['type']>([
|
|
|
216
254
|
'COMPONENT',
|
|
217
255
|
'INSTANCE',
|
|
218
256
|
'SECTION',
|
|
219
|
-
'GROUP'
|
|
257
|
+
'GROUP',
|
|
258
|
+
'SLIDE'
|
|
220
259
|
])
|
|
221
260
|
|
|
222
261
|
/**
|
|
@@ -227,6 +266,17 @@ export function drawsStrokeSides(node: StrokeSidesInput): boolean {
|
|
|
227
266
|
return node.independentStrokeWeights === true && (!node.type || SIDE_STROKE_TYPES.has(node.type))
|
|
228
267
|
}
|
|
229
268
|
|
|
269
|
+
/**
|
|
270
|
+
* Whether `stroke` draws anything on `node`. A zero weight draws nothing, as in Figma, unless the
|
|
271
|
+
* node strokes each side by its own weight.
|
|
272
|
+
*/
|
|
273
|
+
export function drawsStroke(
|
|
274
|
+
node: StrokeSidesInput,
|
|
275
|
+
stroke: Pick<Stroke, 'visible' | 'weight'>
|
|
276
|
+
): boolean {
|
|
277
|
+
return stroke.visible && (stroke.weight > 0 || drawsStrokeSides(node))
|
|
278
|
+
}
|
|
279
|
+
|
|
230
280
|
/** The share of a stroke's weight that lies outside the shape it outlines. */
|
|
231
281
|
export function strokeAlignShare(align: Stroke['align']): number {
|
|
232
282
|
if (align === 'OUTSIDE') return 1
|
|
@@ -355,93 +405,6 @@ function miterRatio(network: VectorNetwork, join: StrokeJoin | undefined, limit
|
|
|
355
405
|
return ratio
|
|
356
406
|
}
|
|
357
407
|
|
|
358
|
-
/**
|
|
359
|
-
* The blur radius Figma draws: a negative one, which only a bound variable can give, draws as no
|
|
360
|
-
* blur, though the layer keeps the value.
|
|
361
|
-
*/
|
|
362
|
-
export function drawnBlurRadius(radius: number): number {
|
|
363
|
-
return Math.max(0, radius)
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
/**
|
|
367
|
-
* The widest radius an effect blurs by: its radius, or the larger end of a progressive blur,
|
|
368
|
-
* which can start wider than it ends. Bounds and padding that must hold the whole blur use it.
|
|
369
|
-
*/
|
|
370
|
-
export function widestBlurRadius(effect: Pick<Effect, 'radius' | 'progressive'>): number {
|
|
371
|
-
return Math.max(effect.radius, effect.progressive?.startRadius ?? effect.radius)
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
const BLUR_SIGMA_PER_RADIUS = 0.43
|
|
375
|
-
|
|
376
|
-
/**
|
|
377
|
-
* The Gaussian sigma that draws a Figma blur radius as Figma does. Measured on Figma 126 exports,
|
|
378
|
-
* layer blur, both shadows, and background blur fall off as a Gaussian of 0.43 × radius; Figma's
|
|
379
|
-
* SVG export writes radius / 2, which is wider (`packages/core/tests/canvas/blur.test.ts`).
|
|
380
|
-
*/
|
|
381
|
-
export function blurSigma(radius: number): number {
|
|
382
|
-
return drawnBlurRadius(radius) * BLUR_SIGMA_PER_RADIUS
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
/** Skia's Gaussian kernels end at 3 sigma. */
|
|
386
|
-
const KERNEL_SIGMAS = 3
|
|
387
|
-
|
|
388
|
-
/**
|
|
389
|
-
* How far past what it blurs a Gaussian of `sigma` leaves ink on screen: where Skia's kernel
|
|
390
|
-
* ends, and one more pixel holds its rounding.
|
|
391
|
-
*/
|
|
392
|
-
export function kernelReach(sigma: number): number {
|
|
393
|
-
return sigma > 0 ? Math.ceil(KERNEL_SIGMAS * sigma) + 1 : 0
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
/** How far past what it blurs a Figma blur of `radius` leaves ink on screen (`kernelReach`). */
|
|
397
|
-
export function blurReach(radius: number): number {
|
|
398
|
-
return kernelReach(blurSigma(radius))
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
/**
|
|
402
|
-
* The distance, in sigmas, past a straight edge blurred by a Gaussian at which the edge's share
|
|
403
|
-
* drops to `share`: the inverse of the normal tail Q, by Abramowitz and Stegun 26.2.23, which is
|
|
404
|
-
* within 0.00045 of it.
|
|
405
|
-
*/
|
|
406
|
-
function gaussianTailDistance(share: number): number {
|
|
407
|
-
if (share <= 0) {
|
|
408
|
-
return Number.POSITIVE_INFINITY
|
|
409
|
-
}
|
|
410
|
-
if (share >= 0.5) {
|
|
411
|
-
return 0
|
|
412
|
-
}
|
|
413
|
-
const s = Math.sqrt(-2 * Math.log(share))
|
|
414
|
-
return (
|
|
415
|
-
s -
|
|
416
|
-
(2.515517 + 0.802853 * s + 0.010328 * s * s) /
|
|
417
|
-
(1 + 1.432788 * s + 0.189269 * s * s + 0.001308 * s * s * s)
|
|
418
|
-
)
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
const COLOR_LEVELS = 255
|
|
422
|
-
|
|
423
|
-
/**
|
|
424
|
-
* How far past its shape a drop shadow of `radius` and colour alpha `alpha` leaves ink on
|
|
425
|
-
* screen. Skia blurs the shape into an 8-bit mask and scales it by `alpha`, so a mask level shows
|
|
426
|
-
* once `alpha` times it rounds to a level: an opaque or half-opaque shadow shows its faintest
|
|
427
|
-
* level, out to where the kernel ends, and a fainter one ends sooner. Measured on CPU raster, the
|
|
428
|
-
* ink ends at 3.0 sigma for alpha 1 and 0.5, 2.4 for 0.25, and 2.1 for 0.1.
|
|
429
|
-
*/
|
|
430
|
-
export function shadowReach(radius: number, alpha: number): number {
|
|
431
|
-
const sigma = blurSigma(radius)
|
|
432
|
-
const faintestShownLevel = Math.ceil(0.5 / Math.max(alpha, 1 / COLOR_LEVELS))
|
|
433
|
-
const sigmas = Math.min(
|
|
434
|
-
KERNEL_SIGMAS,
|
|
435
|
-
gaussianTailDistance((faintestShownLevel - 1) / COLOR_LEVELS)
|
|
436
|
-
)
|
|
437
|
-
return Math.ceil(sigmas * sigma) + 1
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
/** The Figma blur radius that draws a Gaussian of `sigma`, the inverse of `blurSigma`. */
|
|
441
|
-
export function blurRadiusForSigma(sigma: number): number {
|
|
442
|
-
return Math.max(0, sigma) / BLUR_SIGMA_PER_RADIUS
|
|
443
|
-
}
|
|
444
|
-
|
|
445
408
|
/**
|
|
446
409
|
* How far a layer's shadows and blurs reach past each side as Figma's render bounds count them:
|
|
447
410
|
* a blur by its radius, a shadow by its radius and spread, moved by its offset. Ink on screen
|