@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/dist/color/okhcl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"okhcl.js","names":[],"sources":["../../src/color/okhcl.ts"],"sourcesContent":["import { converter
|
|
1
|
+
{"version":3,"file":"okhcl.js","names":[],"sources":["../../src/color/okhcl.ts"],"sourcesContent":["import { converter } from 'culori'\n\nimport { copyFill, copyStroke } from '../copy'\nimport { readAllPluginData, withAllPluginData } from '../plugin-data/field'\nimport { OPEN_PENCIL_PLUGIN_DATA } from '../plugin-data/fields'\nimport type { Color } from '../primitives'\nimport type { ColorProfile, PluginDataEntry, SceneNode } from '../types'\nimport { fitIntoProfile } from './management'\n\nexport interface OkHCLColor {\n h: number\n c: number\n l: number\n a?: number\n}\n\nexport interface OkHCLPayload {\n version: 1\n kind: 'fill' | 'stroke'\n index: number\n color: OkHCLColor\n}\n\nconst toOkHCL = converter('oklch')\n\nfunction clampUnit(value: number): number {\n if (value < 0) return 0\n if (value > 1) return 1\n return value\n}\n\nfunction normalizeHue(value: number): number {\n const hue = value % 360\n return hue < 0 ? hue + 360 : hue\n}\n\nfunction normalizeOkHCLColor(color: OkHCLColor): OkHCLColor {\n return {\n h: normalizeHue(color.h),\n c: Math.max(0, color.c),\n l: clampUnit(color.l),\n a: clampUnit(color.a ?? 1)\n }\n}\n\n/**\n * `color` as components in `profile`, and whether the profile could not show it: a color past the\n * gamut is brought inside by reducing chroma, keeping lightness and hue, as {@link fitIntoProfile}\n * brings any color inside.\n */\nexport function okhclInProfile(\n color: OkHCLColor,\n profile: ColorProfile\n): { color: Color; clipped: boolean } {\n const { l, c, h, a } = normalizeOkHCLColor(color)\n return fitIntoProfile({ mode: 'oklch', l, c, h, alpha: a ?? 1 }, profile)\n}\n\n/** Coordinates in `profile`, so callers can store colours in the document's profile. */\nexport function okhclToRGBA(color: OkHCLColor, profile: ColorProfile = 'srgb'): Color {\n return okhclInProfile(color, profile).color\n}\n\n/** Reads `color` as coordinates in `profile`, the inverse of {@link okhclToRGBA}. */\nexport function rgbaToOkHCL(color: Color, profile: ColorProfile = 'srgb'): OkHCLColor {\n const oklch = toOkHCL(\n profile === 'display-p3'\n ? { mode: 'p3', r: color.r, g: color.g, b: color.b, alpha: color.a }\n : { mode: 'rgb', r: color.r, g: color.g, b: color.b, alpha: color.a }\n )\n return normalizeOkHCLColor({\n h: oklch.h ?? 0,\n c: oklch.c,\n l: oklch.l,\n a: oklch.alpha ?? color.a\n })\n}\n\nexport function serializeOkHCLPayload(payload: OkHCLPayload): string {\n return OPEN_PENCIL_PLUGIN_DATA.okhcl.encode(payload)\n}\n\nexport function parseOkHCLPayload(value: string): OkHCLPayload | null {\n return OPEN_PENCIL_PLUGIN_DATA.okhcl.decode(value) ?? null\n}\n\nfunction createOkHCLPayload(\n kind: 'fill' | 'stroke',\n index: number,\n color: OkHCLColor\n): OkHCLPayload {\n return {\n version: 1,\n kind,\n index,\n color: normalizeOkHCLColor(color)\n }\n}\n\n/** The node's plugin data with the payload for one paint replaced, or removed without `color`. */\nfunction withOkHCLPayload(\n node: SceneNode,\n kind: 'fill' | 'stroke',\n index: number,\n color?: OkHCLColor\n): PluginDataEntry[] {\n const payloads = getNodeOkHCLPayloads(node).filter(\n (payload) => payload.kind !== kind || payload.index !== index\n )\n if (color) payloads.push(createOkHCLPayload(kind, index, color))\n return withAllPluginData(node.pluginData, OPEN_PENCIL_PLUGIN_DATA.okhcl, payloads)\n}\n\nexport function setNodeFillOkHCL(\n node: SceneNode,\n index: number,\n color: OkHCLColor,\n profile: ColorProfile = 'srgb'\n): Partial<SceneNode> {\n const fills = node.fills.map(copyFill)\n if (index < 0 || index >= fills.length) throw new Error(`Fill ${index} not found`)\n const fill = fills[index]\n const rgba = okhclToRGBA(color, profile)\n fills[index] = {\n ...fill,\n color: rgba,\n opacity: rgba.a\n }\n\n return {\n fills,\n pluginData: withOkHCLPayload(node, 'fill', index, color)\n }\n}\n\nexport function setNodeStrokeOkHCL(\n node: SceneNode,\n index: number,\n color: OkHCLColor,\n profile: ColorProfile = 'srgb'\n): Partial<SceneNode> {\n const strokes = node.strokes.map(copyStroke)\n if (index < 0 || index >= strokes.length) throw new Error(`Stroke ${index} not found`)\n const stroke = strokes[index]\n const rgba = okhclToRGBA(color, profile)\n strokes[index] = {\n ...stroke,\n color: rgba,\n opacity: rgba.a\n }\n\n return {\n strokes,\n pluginData: withOkHCLPayload(node, 'stroke', index, color)\n }\n}\n\nexport function clearNodeFillOkHCL(node: SceneNode, index: number): Partial<SceneNode> {\n return { pluginData: withOkHCLPayload(node, 'fill', index) }\n}\n\nexport function clearNodeStrokeOkHCL(node: SceneNode, index: number): Partial<SceneNode> {\n return { pluginData: withOkHCLPayload(node, 'stroke', index) }\n}\n\nexport function getNodeOkHCLPayloads(node: SceneNode): OkHCLPayload[] {\n return readAllPluginData(node.pluginData, OPEN_PENCIL_PLUGIN_DATA.okhcl)\n}\n\nexport function getFillOkHCL(node: SceneNode, index: number): OkHCLPayload | null {\n return (\n getNodeOkHCLPayloads(node).find(\n (payload) => payload.kind === 'fill' && payload.index === index\n ) ?? null\n )\n}\n\nexport function getStrokeOkHCL(node: SceneNode, index: number): OkHCLPayload | null {\n return (\n getNodeOkHCLPayloads(node).find(\n (payload) => payload.kind === 'stroke' && payload.index === index\n ) ?? null\n )\n}\n\n/** Whether two colors differ by less than half a step of 8 bits in every component. */\nfunction sameColor(left: Color, right: Color): boolean {\n const step = 1 / 510\n return (['r', 'g', 'b', 'a'] as const).every((key) => Math.abs(left[key] - right[key]) <= step)\n}\n\n/**\n * The OkHCL color a paint was last edited in, while it still makes the paint's stored color. The\n * stored color is what draws and what files keep; any other edit to it, such as a hex value, the\n * eyedropper, a plugin, or a new color profile, leaves the OkHCL value describing an older color.\n */\nexport function paintOkHCL(\n node: SceneNode,\n kind: 'fill' | 'stroke',\n index: number,\n profile: ColorProfile\n): OkHCLColor | null {\n const payload = kind === 'fill' ? getFillOkHCL(node, index) : getStrokeOkHCL(node, index)\n const paint = index < 0 ? undefined : (kind === 'fill' ? node.fills : node.strokes).at(index)\n if (!payload || !paint) return null\n return sameColor(okhclToRGBA(payload.color, profile), paint.color) ? payload.color : null\n}\n\n/**\n * Keeps `color` as the OkHCL color a paint is edited in without changing the paint, for picking\n * the OkHCL format: the paint keeps its exact stored color.\n */\nexport function rememberPaintOkHCL(\n node: SceneNode,\n kind: 'fill' | 'stroke',\n index: number,\n color: OkHCLColor\n): Partial<SceneNode> {\n return { pluginData: withOkHCLPayload(node, kind, index, color) }\n}\n"],"mappings":"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"}
|
package/dist/color/schema.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
|
|
3
|
-
declare const colorSchema: v.ObjectSchema<{
|
|
2
|
+
export declare const colorSchema: v.ObjectSchema<{
|
|
4
3
|
readonly r: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>;
|
|
5
4
|
readonly g: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>;
|
|
6
5
|
readonly b: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>;
|
|
7
6
|
readonly a: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>;
|
|
8
7
|
}, undefined>;
|
|
9
|
-
|
|
10
|
-
export
|
|
8
|
+
/** A document's color profile, as files, libraries, and collaboration record it. */
|
|
9
|
+
export declare const colorProfileSchema: v.PicklistSchema<("srgb" | "display-p3")[], undefined>;
|
|
10
|
+
/** The profiles an export can ask for, as Figma names them. */
|
|
11
|
+
export declare const EXPORT_COLOR_PROFILE_NAMES: readonly ["DOCUMENT", "SRGB", "DISPLAY_P3_V4"];
|
|
12
|
+
export declare const exportColorProfileSchema: v.PicklistSchema<readonly ["DOCUMENT", "SRGB", "DISPLAY_P3_V4"], undefined>;
|
|
11
13
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","names":[],"sources":["../../src/color/schema.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","names":[],"sources":["../../src/color/schema.ts"],"mappings":";qBAKa,aAAW,EAAA;;;;;;;qBAQX,oBAAkB,EAAA;;qBAGlB;qBAMA,0BAAwB,EAAA"}
|
package/dist/color/schema.js
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import { finiteNumberSchema } from "../primitives/schema.js";
|
|
2
1
|
import * as v from "valibot";
|
|
3
|
-
|
|
2
|
+
import { finiteNumberSchema } from "../primitives/schema.js";
|
|
3
|
+
// src/color/schema.ts
|
|
4
4
|
const colorSchema = v.object({
|
|
5
5
|
r: finiteNumberSchema,
|
|
6
6
|
g: finiteNumberSchema,
|
|
7
7
|
b: finiteNumberSchema,
|
|
8
8
|
a: finiteNumberSchema
|
|
9
9
|
});
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/** A document's color profile, as files, libraries, and collaboration record it. */
|
|
11
|
+
const colorProfileSchema = v.picklist(["srgb", "display-p3"]);
|
|
12
|
+
/** The profiles an export can ask for, as Figma names them. */
|
|
13
|
+
const EXPORT_COLOR_PROFILE_NAMES = [
|
|
14
|
+
"DOCUMENT",
|
|
15
|
+
"SRGB",
|
|
16
|
+
"DISPLAY_P3_V4"
|
|
17
|
+
];
|
|
18
|
+
const exportColorProfileSchema = v.picklist(EXPORT_COLOR_PROFILE_NAMES);
|
|
19
|
+
export { EXPORT_COLOR_PROFILE_NAMES, colorProfileSchema, colorSchema, exportColorProfileSchema };
|
|
12
20
|
|
|
13
21
|
//# sourceMappingURL=schema.js.map
|
package/dist/color/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","names":[],"sources":["../../src/color/schema.ts"],"sourcesContent":["import * as v from 'valibot'\n\nimport { finiteNumberSchema } from '../primitives/schema'\n\nexport const colorSchema = v.object({\n r: finiteNumberSchema,\n g: finiteNumberSchema,\n b: finiteNumberSchema,\n a: finiteNumberSchema\n})\n"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"schema.js","names":[],"sources":["../../src/color/schema.ts"],"sourcesContent":["import * as v from 'valibot'\n\nimport { finiteNumberSchema } from '../primitives/schema'\nimport type { ColorProfile, ExportColorProfile } from '../types'\n\nexport const colorSchema = v.object({\n r: finiteNumberSchema,\n g: finiteNumberSchema,\n b: finiteNumberSchema,\n a: finiteNumberSchema\n})\n\n/** A document's color profile, as files, libraries, and collaboration record it. */\nexport const colorProfileSchema = v.picklist(['srgb', 'display-p3'] satisfies ColorProfile[])\n\n/** The profiles an export can ask for, as Figma names them. */\nexport const EXPORT_COLOR_PROFILE_NAMES = [\n 'DOCUMENT',\n 'SRGB',\n 'DISPLAY_P3_V4'\n] as const satisfies readonly ExportColorProfile[]\n\nexport const exportColorProfileSchema = v.picklist(EXPORT_COLOR_PROFILE_NAMES)\n"],"mappings":";;;AAKA,MAAa,cAAc,EAAE,OAAO;CAClC,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACL,CAAC;;AAGD,MAAa,qBAAqB,EAAE,SAAS,CAAC,QAAQ,YAAY,CAA0B;;AAG5F,MAAa,6BAA6B;CACxC;CACA;CACA;AACF;AAEA,MAAa,2BAA2B,EAAE,SAAS,0BAA0B"}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import { SceneGraph } from "../graph.js";
|
|
2
2
|
import { CommentThread, PluginDataEntry } from "../types.js";
|
|
3
|
-
//#region src/comments/document.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* A document's comment threads, deleted ones included. Comments are part of the document: they
|
|
6
5
|
* live in OpenPencil's plugin data on the document node, so they travel with the `.fig` file,
|
|
7
6
|
* its storage copy and a collaboration room, and Figma or an older OpenPencil open the file as
|
|
8
7
|
* before.
|
|
9
8
|
*/
|
|
10
|
-
declare function readComments(graph: SceneGraph): CommentThread[];
|
|
9
|
+
export declare function readComments(graph: SceneGraph): CommentThread[];
|
|
11
10
|
/**
|
|
12
11
|
* Stores the threads on the document node. This is a document change, so the document asks to
|
|
13
12
|
* be saved, but not an undo step: undoing a layer edit never takes back a comment.
|
|
14
13
|
*/
|
|
15
|
-
declare function writeComments(graph: SceneGraph, threads: readonly CommentThread[]): void;
|
|
14
|
+
export declare function writeComments(graph: SceneGraph, threads: readonly CommentThread[]): void;
|
|
16
15
|
/**
|
|
17
16
|
* `entries` holding the comments of `live` instead of their own. Undo and redo restore the
|
|
18
17
|
* document node with this, so they leave comments as they are now.
|
|
19
18
|
*/
|
|
20
|
-
declare function withLiveComments(entries: readonly PluginDataEntry[], live: readonly PluginDataEntry[]): PluginDataEntry[];
|
|
21
|
-
//#endregion
|
|
22
|
-
export { readComments, withLiveComments, writeComments };
|
|
19
|
+
export declare function withLiveComments(entries: readonly PluginDataEntry[], live: readonly PluginDataEntry[]): PluginDataEntry[];
|
|
23
20
|
//# sourceMappingURL=document.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.d.ts","names":[],"sources":["../../src/comments/document.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"document.d.ts","names":[],"sources":["../../src/comments/document.ts"],"mappings":";;;;;;;;wBAkBgB,aAAa,OAAO,aAAa;;;;;wBAQjC,cAAc,OAAO,YAAY,kBAAkB;;;;;wBAgBnD,iBACd,kBAAkB,mBAClB,eAAe,oBACd"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isPluginDataEntry, readPluginData, withPluginData, withoutPluginData } from "../plugin-data/field.js";
|
|
2
2
|
import { OPEN_PENCIL_PLUGIN_DATA } from "../plugin-data/fields.js";
|
|
3
|
-
|
|
3
|
+
// src/comments/document.ts
|
|
4
4
|
const { comments } = OPEN_PENCIL_PLUGIN_DATA;
|
|
5
5
|
/**
|
|
6
6
|
* A document's comment threads, deleted ones included. Comments are part of the document: they
|
|
@@ -27,7 +27,6 @@ function writeComments(graph, threads) {
|
|
|
27
27
|
function withLiveComments(entries, live) {
|
|
28
28
|
return [...withoutPluginData(entries, [comments]), ...live.filter((entry) => isPluginDataEntry(entry, comments))];
|
|
29
29
|
}
|
|
30
|
-
//#endregion
|
|
31
30
|
export { readComments, withLiveComments, writeComments };
|
|
32
31
|
|
|
33
32
|
//# sourceMappingURL=document.js.map
|
package/dist/comments/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { commentThreadsSchema } from "./schema.js";
|
|
2
1
|
import { readComments, withLiveComments, writeComments } from "./document.js";
|
|
3
|
-
import { byCreatedAt, commentAnchor, commentPosition, commentTimestamp, createCommentReply, createCommentThread, deleteCommentReply, deleteCommentThread, editCommentThread, findLiveCommentThread, liveReplies, replyToCommentThread, resolveCommentThread, takesPartInThread } from "./threads.js";
|
|
4
2
|
import { COMMENT_SORTS, commentThreadNumbers, listCommentThreads } from "./list.js";
|
|
5
3
|
import { hasNewerComments, mergeCommentThreads } from "./merge.js";
|
|
4
|
+
import { byCreatedAt, commentAnchor, commentPosition, commentTimestamp, createCommentReply, createCommentThread, deleteCommentReply, deleteCommentThread, editCommentThread, findLiveCommentThread, liveReplies, replyToCommentThread, resolveCommentThread, takesPartInThread } from "./threads.js";
|
|
5
|
+
import { commentThreadsSchema } from "./schema.js";
|
|
6
6
|
export { COMMENT_SORTS, byCreatedAt, commentAnchor, commentPosition, commentThreadNumbers, commentThreadsSchema, commentTimestamp, createCommentReply, createCommentThread, deleteCommentReply, deleteCommentThread, editCommentThread, findLiveCommentThread, hasNewerComments, listCommentThreads, liveReplies, mergeCommentThreads, readComments, replyToCommentThread, resolveCommentThread, takesPartInThread, withLiveComments, writeComments };
|
package/dist/comments/list.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { CommentThread } from "../types.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
interface CommentListOptions {
|
|
2
|
+
export declare const COMMENT_SORTS: readonly ["newest", "oldest"];
|
|
3
|
+
export type CommentSort = (typeof COMMENT_SORTS)[number];
|
|
4
|
+
export interface CommentListOptions {
|
|
6
5
|
query: string;
|
|
7
6
|
showResolved: boolean;
|
|
8
7
|
/** Only threads on `pageId`. */
|
|
@@ -17,9 +16,7 @@ interface CommentListOptions {
|
|
|
17
16
|
* Each thread's number, counted in the order threads were started, as Figma numbers them in its
|
|
18
17
|
* list. Deleted threads keep their place so the numbers people refer to do not shift.
|
|
19
18
|
*/
|
|
20
|
-
declare function commentThreadNumbers(threads: readonly CommentThread[]): Map<string, number>;
|
|
19
|
+
export declare function commentThreadNumbers(threads: readonly CommentThread[]): Map<string, number>;
|
|
21
20
|
/** The threads the comments list shows for its search, filters and order. */
|
|
22
|
-
declare function listCommentThreads(threads: readonly CommentThread[], options: CommentListOptions): CommentThread[];
|
|
23
|
-
//#endregion
|
|
24
|
-
export { COMMENT_SORTS, CommentListOptions, CommentSort, commentThreadNumbers, listCommentThreads };
|
|
21
|
+
export declare function listCommentThreads(threads: readonly CommentThread[], options: CommentListOptions): CommentThread[];
|
|
25
22
|
//# sourceMappingURL=list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","names":[],"sources":["../../src/comments/list.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.d.ts","names":[],"sources":["../../src/comments/list.ts"],"mappings":";qBAGa;YACD,sBAAsB;iBAEjB;EACf;EACA;;EAEA;EACA;;EAEA;EACA;EACA,MAAM;;;;;;wBAaQ,qBAAqB,kBAAkB,kBAAkB;;wBAMzD,mBACd,kBAAkB,iBAClB,SAAS,qBACR"}
|
package/dist/comments/list.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { byCreatedAt, liveReplies, takesPartInThread } from "./threads.js";
|
|
2
|
-
|
|
2
|
+
// src/comments/list.ts
|
|
3
3
|
const COMMENT_SORTS = ["newest", "oldest"];
|
|
4
4
|
function matches(thread, query) {
|
|
5
5
|
const words = [
|
|
@@ -27,7 +27,6 @@ function listCommentThreads(threads, options) {
|
|
|
27
27
|
const direction = options.sort === "newest" ? -1 : 1;
|
|
28
28
|
return listed.sort((a, b) => direction * byCreatedAt(a, b));
|
|
29
29
|
}
|
|
30
|
-
//#endregion
|
|
31
30
|
export { COMMENT_SORTS, commentThreadNumbers, listCommentThreads };
|
|
32
31
|
|
|
33
32
|
//# sourceMappingURL=list.js.map
|
package/dist/comments/merge.d.ts
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { CommentThread } from "../types.js";
|
|
2
|
-
//#region src/comments/merge.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Two copies of a document's comments become one. Nothing is lost: threads and replies are
|
|
5
4
|
* joined by id, and for a thread both copies changed, the newer edit wins while replies from
|
|
6
5
|
* both are kept. Deleted threads and replies stay deleted.
|
|
7
6
|
*/
|
|
8
|
-
declare function mergeCommentThreads(local: readonly CommentThread[], remote: readonly CommentThread[]): CommentThread[];
|
|
7
|
+
export declare function mergeCommentThreads(local: readonly CommentThread[], remote: readonly CommentThread[]): CommentThread[];
|
|
9
8
|
/**
|
|
10
9
|
* Whether `local` holds anything `remote` lacks: a thread or reply it does not have, a newer edit,
|
|
11
10
|
* or a deletion. Merging is then needed; otherwise `remote` already says everything.
|
|
12
11
|
*/
|
|
13
|
-
declare function hasNewerComments(local: readonly CommentThread[], remote: readonly CommentThread[]): boolean;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { hasNewerComments, mergeCommentThreads };
|
|
12
|
+
export declare function hasNewerComments(local: readonly CommentThread[], remote: readonly CommentThread[]): boolean;
|
|
16
13
|
//# sourceMappingURL=merge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge.d.ts","names":[],"sources":["../../src/comments/merge.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"merge.d.ts","names":[],"sources":["../../src/comments/merge.ts"],"mappings":";;;;;;wBAqBgB,oBACd,gBAAgB,iBAChB,iBAAiB,kBAChB;;;;;wBAuBa,iBACd,gBAAgB,iBAChB,iBAAiB"}
|
package/dist/comments/merge.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { byCreatedAt } from "./threads.js";
|
|
2
|
-
|
|
2
|
+
// src/comments/merge.ts
|
|
3
3
|
function mergeReplies(first, second) {
|
|
4
4
|
const byId = /* @__PURE__ */ new Map();
|
|
5
5
|
for (const reply of [...first, ...second]) {
|
|
@@ -52,7 +52,6 @@ function hasNewerComments(local, remote) {
|
|
|
52
52
|
});
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
//#endregion
|
|
56
55
|
export { hasNewerComments, mergeCommentThreads };
|
|
57
56
|
|
|
58
57
|
//# sourceMappingURL=merge.js.map
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { CommentThread } from "../types.js";
|
|
2
1
|
import * as v from "valibot";
|
|
3
|
-
|
|
2
|
+
import { CommentThread } from "../types.js";
|
|
4
3
|
/** A list of comment threads as files and rooms hold them; threads that cannot be read are left out. */
|
|
5
|
-
declare const commentThreadsSchema: v.GenericSchema<unknown, CommentThread[]>;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { commentThreadsSchema };
|
|
4
|
+
export declare const commentThreadsSchema: v.GenericSchema<unknown, CommentThread[]>;
|
|
8
5
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","names":[],"sources":["../../src/comments/schema.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","names":[],"sources":["../../src/comments/schema.ts"],"mappings":";;;qBAyCa,sBAAsB,EAAE,uBAAuB"}
|
package/dist/comments/schema.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
|
|
2
|
+
// src/comments/schema.ts
|
|
3
3
|
const commentAuthorColorSchema = v.fallback(v.optional(v.object({
|
|
4
4
|
r: v.number(),
|
|
5
5
|
g: v.number(),
|
|
@@ -45,7 +45,6 @@ const commentThreadsSchema = v.pipe(v.array(v.unknown()), v.transform((items) =>
|
|
|
45
45
|
updatedAt: thread.updatedAt || thread.createdAt
|
|
46
46
|
}];
|
|
47
47
|
})));
|
|
48
|
-
//#endregion
|
|
49
48
|
export { commentThreadsSchema };
|
|
50
49
|
|
|
51
50
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import { Color, Vector } from "../primitives/index.js";
|
|
2
1
|
import { SceneGraph } from "../graph.js";
|
|
2
|
+
import { Color, Vector } from "../primitives/index.js";
|
|
3
3
|
import { CommentReply, CommentThread, SceneNode } from "../types.js";
|
|
4
|
-
//#region src/comments/threads.d.ts
|
|
5
4
|
/** Who writes a comment: their name and, in a collaboration room, their color. */
|
|
6
|
-
interface CommentAuthor {
|
|
5
|
+
export interface CommentAuthor {
|
|
7
6
|
name: string;
|
|
8
7
|
color?: Color;
|
|
9
8
|
/** The agent writing, when one writes rather than the person. */
|
|
10
9
|
agent?: string;
|
|
11
10
|
}
|
|
12
11
|
/** When a comment is written or changed, as stored: an ISO timestamp. */
|
|
13
|
-
declare function commentTimestamp(): string;
|
|
12
|
+
export declare function commentTimestamp(): string;
|
|
14
13
|
/** Oldest first, the order threads and replies are shown and numbered in. */
|
|
15
|
-
declare function byCreatedAt(a: {
|
|
14
|
+
export declare function byCreatedAt(a: {
|
|
16
15
|
createdAt: string;
|
|
17
16
|
}, b: {
|
|
18
17
|
createdAt: string;
|
|
19
18
|
}): number;
|
|
20
19
|
/** A thread's replies, without the deleted ones kept as tombstones. */
|
|
21
|
-
declare function liveReplies(thread: CommentThread): CommentReply[];
|
|
20
|
+
export declare function liveReplies(thread: CommentThread): CommentReply[];
|
|
22
21
|
/** Whether `author` started the thread or replied to it, as Figma's "Only your threads" counts. */
|
|
23
|
-
declare function takesPartInThread(thread: CommentThread, author: string): boolean;
|
|
22
|
+
export declare function takesPartInThread(thread: CommentThread, author: string): boolean;
|
|
24
23
|
/** The thread with `id`, unless it is missing or deleted. */
|
|
25
|
-
declare function findLiveCommentThread(threads: readonly CommentThread[], id: string): CommentThread | undefined;
|
|
24
|
+
export declare function findLiveCommentThread(threads: readonly CommentThread[], id: string): CommentThread | undefined;
|
|
26
25
|
/**
|
|
27
26
|
* Where a pin at a canvas point is kept: on the top-level layer under it, or on `node`'s when
|
|
28
27
|
* given, so it follows that layer; on the canvas when nothing is there.
|
|
29
28
|
*/
|
|
30
|
-
declare function commentAnchor(graph: SceneGraph, pageId: string, at: Vector, node?: SceneNode): {
|
|
29
|
+
export declare function commentAnchor(graph: SceneGraph, pageId: string, at: Vector, node?: SceneNode): {
|
|
31
30
|
nodeId: string | null;
|
|
32
31
|
nodeName: string | null;
|
|
33
32
|
offsetX: number;
|
|
@@ -36,9 +35,9 @@ declare function commentAnchor(graph: SceneGraph, pageId: string, at: Vector, no
|
|
|
36
35
|
y: number;
|
|
37
36
|
};
|
|
38
37
|
/** Where a thread's pin is now: on its layer while that layer exists, else where it was left. */
|
|
39
|
-
declare function commentPosition(graph: SceneGraph, thread: CommentThread): Vector;
|
|
38
|
+
export declare function commentPosition(graph: SceneGraph, thread: CommentThread): Vector;
|
|
40
39
|
/** A new thread pinned at a canvas point of a page. */
|
|
41
|
-
declare function createCommentThread(graph: SceneGraph, options: {
|
|
40
|
+
export declare function createCommentThread(graph: SceneGraph, options: {
|
|
42
41
|
pageId: string;
|
|
43
42
|
at: Vector;
|
|
44
43
|
/** Pin it on this layer's top-level layer rather than on whatever is at `at`. */
|
|
@@ -47,15 +46,13 @@ declare function createCommentThread(graph: SceneGraph, options: {
|
|
|
47
46
|
text: string;
|
|
48
47
|
now: string;
|
|
49
48
|
}): CommentThread;
|
|
50
|
-
declare function createCommentReply(author: CommentAuthor, text: string, now: string): CommentReply;
|
|
49
|
+
export declare function createCommentReply(author: CommentAuthor, text: string, now: string): CommentReply;
|
|
51
50
|
/** The threads with one changed and marked as edited at `now`, for merging with other copies. */
|
|
52
|
-
declare function editCommentThread(threads: readonly CommentThread[], id: string, now: string, edit: (thread: CommentThread) => CommentThread): CommentThread[];
|
|
51
|
+
export declare function editCommentThread(threads: readonly CommentThread[], id: string, now: string, edit: (thread: CommentThread) => CommentThread): CommentThread[];
|
|
53
52
|
/** A reply ends up in the thread and reopens it, as answering a resolved comment does. */
|
|
54
|
-
declare function replyToCommentThread(thread: CommentThread, reply: CommentReply): CommentThread;
|
|
55
|
-
declare function resolveCommentThread(thread: CommentThread, resolved: boolean, now: string): CommentThread;
|
|
53
|
+
export declare function replyToCommentThread(thread: CommentThread, reply: CommentReply): CommentThread;
|
|
54
|
+
export declare function resolveCommentThread(thread: CommentThread, resolved: boolean, now: string): CommentThread;
|
|
56
55
|
/** Deleted threads and replies stay as tombstones, so a stale copy cannot bring them back. */
|
|
57
|
-
declare function deleteCommentThread(thread: CommentThread): CommentThread;
|
|
58
|
-
declare function deleteCommentReply(thread: CommentThread, replyId: string): CommentThread;
|
|
59
|
-
//#endregion
|
|
60
|
-
export { CommentAuthor, byCreatedAt, commentAnchor, commentPosition, commentTimestamp, createCommentReply, createCommentThread, deleteCommentReply, deleteCommentThread, editCommentThread, findLiveCommentThread, liveReplies, replyToCommentThread, resolveCommentThread, takesPartInThread };
|
|
56
|
+
export declare function deleteCommentThread(thread: CommentThread): CommentThread;
|
|
57
|
+
export declare function deleteCommentReply(thread: CommentThread, replyId: string): CommentThread;
|
|
61
58
|
//# sourceMappingURL=threads.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"threads.d.ts","names":[],"sources":["../../src/comments/threads.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"threads.d.ts","names":[],"sources":["../../src/comments/threads.ts"],"mappings":";;;;iBAKiB;EACf;EACA,QAAQ;;EAER;;;wBAac;;wBAKA,YAAY;EAAK;GAAqB;EAAK;;;wBAK3C,YAAY,QAAQ,gBAAgB;;wBAKpC,kBAAkB,QAAQ,eAAe;;wBAKzC,sBACd,kBAAkB,iBAClB,aACC;;;;;wBA2Ba,cAAc,OAAO,YAAY,gBAAgB,IAAI,QAAQ,OAAO;;;;;;;;;wBAepE,gBAAgB,OAAO,YAAY,QAAQ,gBAAgB;;wBAQ3D,oBACd,OAAO,YACP;EACE;EACA,IAAI;;EAEJ,OAAO;EACP,QAAQ;EACR;EACA;IAED;wBAkBa,mBAAmB,QAAQ,eAAe,cAAc,cAAc;;wBAYtE,kBACd,kBAAkB,iBAClB,YACA,aACA,OAAO,QAAQ,kBAAkB,gBAChC;;wBAKa,qBAAqB,QAAQ,eAAe,OAAO,eAAe;wBAIlE,qBACd,QAAQ,eACR,mBACA,cACC;;wBAKa,oBAAoB,QAAQ,gBAAgB;wBAI5C,mBAAmB,QAAQ,eAAe,kBAAkB"}
|
package/dist/comments/threads.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/comments/threads.ts
|
|
2
2
|
/**
|
|
3
3
|
* A new thread's or reply's ID: a UUID, so a server that keeps comments, as Cloud does, takes the
|
|
4
4
|
* ID the editor chose and a retried request finds the comment it already made. Files from older
|
|
@@ -29,9 +29,15 @@ function findLiveCommentThread(threads, id) {
|
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* The layer a comment on `node` is kept on: its top-level layer, as Figma attaches comments, or
|
|
32
|
-
* within a section the section's own child, as frames move about inside it.
|
|
32
|
+
* within a section the section's own child, as frames move about inside it. On a spec it is the
|
|
33
|
+
* block, as a spec's blocks move as the blocks above them change.
|
|
33
34
|
*/
|
|
34
35
|
function commentLayer(graph, node, pageId) {
|
|
36
|
+
const spec = graph.closest(node.id, (layer) => layer.type === "SPEC");
|
|
37
|
+
if (spec) {
|
|
38
|
+
if (spec.id === node.id) return spec;
|
|
39
|
+
return graph.closest(node.id, (layer) => layer.parentId === spec.id) ?? spec;
|
|
40
|
+
}
|
|
35
41
|
const isSection = (id) => !!id && graph.getNode(id)?.type === "SECTION";
|
|
36
42
|
return graph.closest(node.id, (layer) => layer.parentId === pageId || isSection(layer.parentId)) ?? node;
|
|
37
43
|
}
|
|
@@ -132,7 +138,6 @@ function deleteCommentReply(thread, replyId) {
|
|
|
132
138
|
} : entry)
|
|
133
139
|
};
|
|
134
140
|
}
|
|
135
|
-
//#endregion
|
|
136
141
|
export { byCreatedAt, commentAnchor, commentPosition, commentTimestamp, createCommentReply, createCommentThread, deleteCommentReply, deleteCommentThread, editCommentThread, findLiveCommentThread, liveReplies, replyToCommentThread, resolveCommentThread, takesPartInThread };
|
|
137
142
|
|
|
138
143
|
//# sourceMappingURL=threads.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"threads.js","names":[],"sources":["../../src/comments/threads.ts"],"sourcesContent":["import type { SceneGraph } from '../graph'\nimport type { Color, Vector } from '../primitives'\nimport type { CommentReply, CommentThread, SceneNode } from '../types'\n\n/** Who writes a comment: their name and, in a collaboration room, their color. */\nexport interface CommentAuthor {\n name: string\n color?: Color\n /** The agent writing, when one writes rather than the person. */\n agent?: string\n}\n\n/**\n * A new thread's or reply's ID: a UUID, so a server that keeps comments, as Cloud does, takes the\n * ID the editor chose and a retried request finds the comment it already made. Files from older\n * versions keep their own IDs.\n */\nfunction newCommentId(): string {\n return crypto.randomUUID()\n}\n\n/** When a comment is written or changed, as stored: an ISO timestamp. */\nexport function commentTimestamp(): string {\n return new Date().toISOString()\n}\n\n/** Oldest first, the order threads and replies are shown and numbered in. */\nexport function byCreatedAt(a: { createdAt: string }, b: { createdAt: string }): number {\n return a.createdAt.localeCompare(b.createdAt)\n}\n\n/** A thread's replies, without the deleted ones kept as tombstones. */\nexport function liveReplies(thread: CommentThread): CommentReply[] {\n return thread.replies.filter((entry) => !entry.deleted)\n}\n\n/** Whether `author` started the thread or replied to it, as Figma's \"Only your threads\" counts. */\nexport function takesPartInThread(thread: CommentThread, author: string): boolean {\n return thread.author === author || liveReplies(thread).some((entry) => entry.author === author)\n}\n\n/** The thread with `id`, unless it is missing or deleted. */\nexport function findLiveCommentThread(\n threads: readonly CommentThread[],\n id: string\n): CommentThread | undefined {\n return threads.find((thread) => thread.id === id && !thread.deleted)\n}\n\n/**\n * The layer a comment on `node` is kept on: its top-level layer, as Figma attaches comments, or\n * within a section the section's own child, as frames move about inside it.\n */\nfunction commentLayer(graph: SceneGraph, node: SceneNode, pageId: string): SceneNode {\n const isSection = (id: string | null) => !!id && graph.getNode(id)?.type === 'SECTION'\n return (\n graph.closest(node.id, (layer) => layer.parentId === pageId || isSection(layer.parentId)) ??\n node\n )\n}\n\n/**\n * Where a pin at a canvas point is kept: on the top-level layer under it, or on `node`'s when\n * given, so it follows that layer; on the canvas when nothing is there.\n */\nexport function commentAnchor(graph: SceneGraph, pageId: string, at: Vector, node?: SceneNode) {\n const target = node ?? graph.hitTest(at.x, at.y, pageId)\n const layer = target ? commentLayer(graph, target, pageId) : null\n const abs = layer ? graph.getAbsolutePosition(layer.id) : null\n return {\n nodeId: layer?.id ?? null,\n nodeName: layer?.name ?? null,\n offsetX: abs ? at.x - abs.x : 0,\n offsetY: abs ? at.y - abs.y : 0,\n x: at.x,\n y: at.y\n }\n}\n\n/** Where a thread's pin is now: on its layer while that layer exists, else where it was left. */\nexport function commentPosition(graph: SceneGraph, thread: CommentThread): Vector {\n const node = thread.nodeId ? graph.getNode(thread.nodeId) : undefined\n if (!node) return { x: thread.x, y: thread.y }\n const abs = graph.getAbsolutePosition(node.id)\n return { x: abs.x + (thread.offsetX ?? 0), y: abs.y + (thread.offsetY ?? 0) }\n}\n\n/** A new thread pinned at a canvas point of a page. */\nexport function createCommentThread(\n graph: SceneGraph,\n options: {\n pageId: string\n at: Vector\n /** Pin it on this layer's top-level layer rather than on whatever is at `at`. */\n node?: SceneNode\n author: CommentAuthor\n text: string\n now: string\n }\n): CommentThread {\n const { pageId, at, node, author, text, now } = options\n return {\n id: newCommentId(),\n pageId,\n pageName: graph.getNode(pageId)?.name,\n ...commentAnchor(graph, pageId, at, node),\n author: author.name,\n authorColor: author.color,\n ...(author.agent ? { agent: author.agent } : {}),\n text,\n createdAt: now,\n updatedAt: now,\n resolved: false,\n replies: []\n }\n}\n\nexport function createCommentReply(author: CommentAuthor, text: string, now: string): CommentReply {\n return {\n id: newCommentId(),\n author: author.name,\n authorColor: author.color,\n ...(author.agent ? { agent: author.agent } : {}),\n text,\n createdAt: now\n }\n}\n\n/** The threads with one changed and marked as edited at `now`, for merging with other copies. */\nexport function editCommentThread(\n threads: readonly CommentThread[],\n id: string,\n now: string,\n edit: (thread: CommentThread) => CommentThread\n): CommentThread[] {\n return threads.map((thread) => (thread.id === id ? { ...edit(thread), updatedAt: now } : thread))\n}\n\n/** A reply ends up in the thread and reopens it, as answering a resolved comment does. */\nexport function replyToCommentThread(thread: CommentThread, reply: CommentReply): CommentThread {\n return { ...thread, resolved: false, resolvedAt: null, replies: [...thread.replies, reply] }\n}\n\nexport function resolveCommentThread(\n thread: CommentThread,\n resolved: boolean,\n now: string\n): CommentThread {\n return { ...thread, resolved, resolvedAt: resolved ? now : null }\n}\n\n/** Deleted threads and replies stay as tombstones, so a stale copy cannot bring them back. */\nexport function deleteCommentThread(thread: CommentThread): CommentThread {\n return { ...thread, deleted: true }\n}\n\nexport function deleteCommentReply(thread: CommentThread, replyId: string): CommentThread {\n return {\n ...thread,\n replies: thread.replies.map((entry) =>\n entry.id === replyId ? { ...entry, deleted: true } : entry\n )\n }\n}\n"],"mappings":";;;;;;AAiBA,SAAS,eAAuB;CAC9B,OAAO,OAAO,WAAW;AAC3B;;AAGA,SAAgB,mBAA2B;CACzC,wBAAO,IAAI,KAAK,EAAA,CAAE,YAAY;AAChC;;AAGA,SAAgB,YAAY,GAA0B,GAAkC;CACtF,OAAO,EAAE,UAAU,cAAc,EAAE,SAAS;AAC9C;;AAGA,SAAgB,YAAY,QAAuC;CACjE,OAAO,OAAO,QAAQ,QAAQ,UAAU,CAAC,MAAM,OAAO;AACxD;;AAGA,SAAgB,kBAAkB,QAAuB,QAAyB;CAChF,OAAO,OAAO,WAAW,UAAU,YAAY,MAAM,CAAC,CAAC,MAAM,UAAU,MAAM,WAAW,MAAM;AAChG;;AAGA,SAAgB,sBACd,SACA,IAC2B;CAC3B,OAAO,QAAQ,MAAM,WAAW,OAAO,OAAO,MAAM,CAAC,OAAO,OAAO;AACrE
|
|
1
|
+
{"version":3,"file":"threads.js","names":[],"sources":["../../src/comments/threads.ts"],"sourcesContent":["import type { SceneGraph } from '../graph'\nimport type { Color, Vector } from '../primitives'\nimport type { CommentReply, CommentThread, SceneNode } from '../types'\n\n/** Who writes a comment: their name and, in a collaboration room, their color. */\nexport interface CommentAuthor {\n name: string\n color?: Color\n /** The agent writing, when one writes rather than the person. */\n agent?: string\n}\n\n/**\n * A new thread's or reply's ID: a UUID, so a server that keeps comments, as Cloud does, takes the\n * ID the editor chose and a retried request finds the comment it already made. Files from older\n * versions keep their own IDs.\n */\nfunction newCommentId(): string {\n return crypto.randomUUID()\n}\n\n/** When a comment is written or changed, as stored: an ISO timestamp. */\nexport function commentTimestamp(): string {\n return new Date().toISOString()\n}\n\n/** Oldest first, the order threads and replies are shown and numbered in. */\nexport function byCreatedAt(a: { createdAt: string }, b: { createdAt: string }): number {\n return a.createdAt.localeCompare(b.createdAt)\n}\n\n/** A thread's replies, without the deleted ones kept as tombstones. */\nexport function liveReplies(thread: CommentThread): CommentReply[] {\n return thread.replies.filter((entry) => !entry.deleted)\n}\n\n/** Whether `author` started the thread or replied to it, as Figma's \"Only your threads\" counts. */\nexport function takesPartInThread(thread: CommentThread, author: string): boolean {\n return thread.author === author || liveReplies(thread).some((entry) => entry.author === author)\n}\n\n/** The thread with `id`, unless it is missing or deleted. */\nexport function findLiveCommentThread(\n threads: readonly CommentThread[],\n id: string\n): CommentThread | undefined {\n return threads.find((thread) => thread.id === id && !thread.deleted)\n}\n\n/**\n * The layer a comment on `node` is kept on: its top-level layer, as Figma attaches comments, or\n * within a section the section's own child, as frames move about inside it. On a spec it is the\n * block, as a spec's blocks move as the blocks above them change.\n */\nfunction commentLayer(graph: SceneGraph, node: SceneNode, pageId: string): SceneNode {\n // A spec keeps its comments wherever it sits, nested in a frame or not.\n const spec = graph.closest(node.id, (layer) => layer.type === 'SPEC')\n if (spec) {\n if (spec.id === node.id) return spec\n return graph.closest(node.id, (layer) => layer.parentId === spec.id) ?? spec\n }\n const isSection = (id: string | null) => !!id && graph.getNode(id)?.type === 'SECTION'\n return (\n graph.closest(node.id, (layer) => layer.parentId === pageId || isSection(layer.parentId)) ??\n node\n )\n}\n\n/**\n * Where a pin at a canvas point is kept: on the top-level layer under it, or on `node`'s when\n * given, so it follows that layer; on the canvas when nothing is there.\n */\nexport function commentAnchor(graph: SceneGraph, pageId: string, at: Vector, node?: SceneNode) {\n const target = node ?? graph.hitTest(at.x, at.y, pageId)\n const layer = target ? commentLayer(graph, target, pageId) : null\n const abs = layer ? graph.getAbsolutePosition(layer.id) : null\n return {\n nodeId: layer?.id ?? null,\n nodeName: layer?.name ?? null,\n offsetX: abs ? at.x - abs.x : 0,\n offsetY: abs ? at.y - abs.y : 0,\n x: at.x,\n y: at.y\n }\n}\n\n/** Where a thread's pin is now: on its layer while that layer exists, else where it was left. */\nexport function commentPosition(graph: SceneGraph, thread: CommentThread): Vector {\n const node = thread.nodeId ? graph.getNode(thread.nodeId) : undefined\n if (!node) return { x: thread.x, y: thread.y }\n const abs = graph.getAbsolutePosition(node.id)\n return { x: abs.x + (thread.offsetX ?? 0), y: abs.y + (thread.offsetY ?? 0) }\n}\n\n/** A new thread pinned at a canvas point of a page. */\nexport function createCommentThread(\n graph: SceneGraph,\n options: {\n pageId: string\n at: Vector\n /** Pin it on this layer's top-level layer rather than on whatever is at `at`. */\n node?: SceneNode\n author: CommentAuthor\n text: string\n now: string\n }\n): CommentThread {\n const { pageId, at, node, author, text, now } = options\n return {\n id: newCommentId(),\n pageId,\n pageName: graph.getNode(pageId)?.name,\n ...commentAnchor(graph, pageId, at, node),\n author: author.name,\n authorColor: author.color,\n ...(author.agent ? { agent: author.agent } : {}),\n text,\n createdAt: now,\n updatedAt: now,\n resolved: false,\n replies: []\n }\n}\n\nexport function createCommentReply(author: CommentAuthor, text: string, now: string): CommentReply {\n return {\n id: newCommentId(),\n author: author.name,\n authorColor: author.color,\n ...(author.agent ? { agent: author.agent } : {}),\n text,\n createdAt: now\n }\n}\n\n/** The threads with one changed and marked as edited at `now`, for merging with other copies. */\nexport function editCommentThread(\n threads: readonly CommentThread[],\n id: string,\n now: string,\n edit: (thread: CommentThread) => CommentThread\n): CommentThread[] {\n return threads.map((thread) => (thread.id === id ? { ...edit(thread), updatedAt: now } : thread))\n}\n\n/** A reply ends up in the thread and reopens it, as answering a resolved comment does. */\nexport function replyToCommentThread(thread: CommentThread, reply: CommentReply): CommentThread {\n return { ...thread, resolved: false, resolvedAt: null, replies: [...thread.replies, reply] }\n}\n\nexport function resolveCommentThread(\n thread: CommentThread,\n resolved: boolean,\n now: string\n): CommentThread {\n return { ...thread, resolved, resolvedAt: resolved ? now : null }\n}\n\n/** Deleted threads and replies stay as tombstones, so a stale copy cannot bring them back. */\nexport function deleteCommentThread(thread: CommentThread): CommentThread {\n return { ...thread, deleted: true }\n}\n\nexport function deleteCommentReply(thread: CommentThread, replyId: string): CommentThread {\n return {\n ...thread,\n replies: thread.replies.map((entry) =>\n entry.id === replyId ? { ...entry, deleted: true } : entry\n )\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
import { SceneGraph } from "../graph.js";
|
|
2
2
|
import { SceneNode } from "../types.js";
|
|
3
|
-
//#region src/components/exposure.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Instances a component can expose: those in its own layers, not inside another instance,
|
|
6
5
|
* whose content belongs to that instance's component.
|
|
7
6
|
*/
|
|
8
|
-
declare function exposableInstances(graph: SceneGraph, componentId: string): SceneNode[];
|
|
7
|
+
export declare function exposableInstances(graph: SceneGraph, componentId: string): SceneNode[];
|
|
9
8
|
/**
|
|
10
9
|
* The layers of an instance that stand for exposed nested instances of its component, in
|
|
11
10
|
* layer order. Each is matched to its source the way instance sync matches children.
|
|
12
11
|
*/
|
|
13
|
-
declare function exposedInstances(graph: SceneGraph, instance: SceneNode): SceneNode[];
|
|
12
|
+
export declare function exposedInstances(graph: SceneGraph, instance: SceneNode): SceneNode[];
|
|
14
13
|
/** Why Figma refuses to expose an instance, or null when it may be exposed. */
|
|
15
|
-
type InstanceExposureIssue = 'not-in-component' | 'not-primary' | 'nothing-to-expose';
|
|
14
|
+
export type InstanceExposureIssue = 'not-in-component' | 'not-primary' | 'nothing-to-expose';
|
|
16
15
|
/**
|
|
17
16
|
* Whether an instance may be exposed, under Figma's rules: it sits in a component's own layers
|
|
18
17
|
* (an instance's copy follows its source) and its component has properties or exposes nested
|
|
19
18
|
* instances itself.
|
|
20
19
|
*/
|
|
21
|
-
declare function instanceExposureIssue(graph: SceneGraph, instance: SceneNode): InstanceExposureIssue | null;
|
|
22
|
-
//#endregion
|
|
23
|
-
export { InstanceExposureIssue, exposableInstances, exposedInstances, instanceExposureIssue };
|
|
20
|
+
export declare function instanceExposureIssue(graph: SceneGraph, instance: SceneNode): InstanceExposureIssue | null;
|
|
24
21
|
//# sourceMappingURL=exposure.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exposure.d.ts","names":[],"sources":["../../src/components/exposure.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"exposure.d.ts","names":[],"sources":["../../src/components/exposure.ts"],"mappings":";;;;;;wBAUgB,mBAAmB,OAAO,YAAY,sBAAsB;;;;;wBAgB5D,iBAAiB,OAAO,YAAY,UAAU,YAAY;;YAa9D;;;;;;wBAOI,sBACd,OAAO,YACP,UAAU,YACT"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { instanceMainComponent } from "../instances/main-component.js";
|
|
2
2
|
import { walkInstanceSources } from "../instances/source-walk.js";
|
|
3
3
|
import { componentPropertyDefinitions } from "./properties.js";
|
|
4
|
-
|
|
4
|
+
// src/components/exposure.ts
|
|
5
5
|
/**
|
|
6
6
|
* Instances a component can expose: those in its own layers, not inside another instance,
|
|
7
7
|
* whose content belongs to that instance's component.
|
|
@@ -45,7 +45,6 @@ function instanceExposureIssue(graph, instance) {
|
|
|
45
45
|
const component = instanceMainComponent(graph, instance);
|
|
46
46
|
return componentPropertyDefinitions(graph, instance).length > 0 || !!component && exposableInstances(graph, component.id).some((node) => node.isExposedInstance) ? null : "nothing-to-expose";
|
|
47
47
|
}
|
|
48
|
-
//#endregion
|
|
49
48
|
export { exposableInstances, exposedInstances, instanceExposureIssue };
|
|
50
49
|
|
|
51
50
|
//# sourceMappingURL=exposure.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { SceneGraph } from "../graph.js";
|
|
2
2
|
import { ComponentPropertyDefinition, ComponentPropertyReferenceField, SceneNode } from "../types.js";
|
|
3
|
-
|
|
4
|
-
interface ComponentPropertyTarget {
|
|
3
|
+
export interface ComponentPropertyTarget {
|
|
5
4
|
node: SceneNode;
|
|
6
5
|
field: ComponentPropertyReferenceField;
|
|
7
6
|
source: SceneNode;
|
|
@@ -10,16 +9,16 @@ interface ComponentPropertyTarget {
|
|
|
10
9
|
* The component that defines a main component's properties: its set when it is a variant,
|
|
11
10
|
* since variants own no properties of their own (desktop 126), else the component itself.
|
|
12
11
|
*/
|
|
13
|
-
declare function propertyOwner(graph: SceneGraph, component: SceneNode): SceneNode;
|
|
14
|
-
declare function componentPropertyOwners(graph: SceneGraph, instance: SceneNode): SceneNode[];
|
|
15
|
-
declare function componentPropertyDefinitions(graph: SceneGraph, instance: SceneNode): ComponentPropertyDefinition[];
|
|
16
|
-
declare function resolveComponentPropertyValue(graph: SceneGraph, value: string): SceneNode | null;
|
|
17
|
-
declare function findComponentPropertyTarget(graph: SceneGraph, instance: SceneNode, propertyId: string): ComponentPropertyTarget | null;
|
|
18
|
-
declare function findComponentPropertyTargets(graph: SceneGraph, instance: SceneNode, propertyId: string): ComponentPropertyTarget[];
|
|
19
|
-
declare function applyComponentPropertyValue(graph: SceneGraph, instanceId: string, definition: ComponentPropertyDefinition, value: string): SceneNode | null;
|
|
20
|
-
declare function reapplyComponentPropertyAssignments(graph: SceneGraph, instanceId: string): ComponentPropertyDefinition[];
|
|
21
|
-
declare function recordAssignmentOverride(graph: SceneGraph, instanceId: string, propertyId: string): void;
|
|
22
|
-
declare function removeComponentProperty(graph: SceneGraph, ownerId: string, propertyId: string): boolean;
|
|
12
|
+
export declare function propertyOwner(graph: SceneGraph, component: SceneNode): SceneNode;
|
|
13
|
+
export declare function componentPropertyOwners(graph: SceneGraph, instance: SceneNode): SceneNode[];
|
|
14
|
+
export declare function componentPropertyDefinitions(graph: SceneGraph, instance: SceneNode): ComponentPropertyDefinition[];
|
|
15
|
+
export declare function resolveComponentPropertyValue(graph: SceneGraph, value: string): SceneNode | null;
|
|
16
|
+
export declare function findComponentPropertyTarget(graph: SceneGraph, instance: SceneNode, propertyId: string): ComponentPropertyTarget | null;
|
|
17
|
+
export declare function findComponentPropertyTargets(graph: SceneGraph, instance: SceneNode, propertyId: string): ComponentPropertyTarget[];
|
|
18
|
+
export declare function applyComponentPropertyValue(graph: SceneGraph, instanceId: string, definition: ComponentPropertyDefinition, value: string): SceneNode | null;
|
|
19
|
+
export declare function reapplyComponentPropertyAssignments(graph: SceneGraph, instanceId: string): ComponentPropertyDefinition[];
|
|
20
|
+
export declare function recordAssignmentOverride(graph: SceneGraph, instanceId: string, propertyId: string): void;
|
|
21
|
+
export declare function removeComponentProperty(graph: SceneGraph, ownerId: string, propertyId: string): boolean;
|
|
23
22
|
/**
|
|
24
23
|
* Moves the boolean, text, instance swap, and slot properties a set's variants define themselves
|
|
25
24
|
* onto the set, under their IDs, so the layers and instances naming them still do: a variant's
|
|
@@ -27,9 +26,7 @@ declare function removeComponentProperty(graph: SceneGraph, ownerId: string, pro
|
|
|
27
26
|
* set (desktop 126). A property the set already has under that ID is not added again. Returns
|
|
28
27
|
* the IDs of the set and the variants it changed.
|
|
29
28
|
*/
|
|
30
|
-
declare function moveVariantPropertiesToSet(graph: SceneGraph, setId: string): string[];
|
|
29
|
+
export declare function moveVariantPropertiesToSet(graph: SceneGraph, setId: string): string[];
|
|
31
30
|
/** A new component property ID, in the `prop:` form the editor, plugin API, and design JSX share. */
|
|
32
|
-
declare function createComponentPropertyId(): string;
|
|
33
|
-
//#endregion
|
|
34
|
-
export { ComponentPropertyTarget, applyComponentPropertyValue, componentPropertyDefinitions, componentPropertyOwners, createComponentPropertyId, findComponentPropertyTarget, findComponentPropertyTargets, moveVariantPropertiesToSet, propertyOwner, reapplyComponentPropertyAssignments, recordAssignmentOverride, removeComponentProperty, resolveComponentPropertyValue };
|
|
31
|
+
export declare function createComponentPropertyId(): string;
|
|
35
32
|
//# sourceMappingURL=properties.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"properties.d.ts","names":[],"sources":["../../src/components/properties.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"properties.d.ts","names":[],"sources":["../../src/components/properties.ts"],"mappings":";;iBAYiB;EACf,MAAM;EACN,OAAO;EACP,QAAQ;;;;;;wBAOM,cAAc,OAAO,YAAY,WAAW,YAAY;wBAKxD,wBAAwB,OAAO,YAAY,UAAU,YAAY;wBAQjE,6BACd,OAAO,YACP,UAAU,YACT;wBAUa,8BAA8B,OAAO,YAAY,gBAAgB;wBAkBjE,4BACd,OAAO,YACP,UAAU,WACV,qBACC;wBAIa,6BACd,OAAO,YACP,UAAU,WACV,qBACC;wBA4Ea,4BACd,OAAO,YACP,oBACA,YAAY,6BACZ,gBACC;wBAwBa,oCACd,OAAO,YACP,qBACC;wBAmBa,yBACd,OAAO,YACP,oBACA;wBAsDc,wBACd,OAAO,YACP,iBACA;;;;;;;;wBA8Bc,2BAA2B,OAAO,YAAY;;wBA+B9C"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { randomHex } from "@open-pencil/std/random";
|
|
2
2
|
import { findInstanceAncestor, instanceMainComponent } from "../instances/main-component.js";
|
|
3
|
+
import { assignmentOverrideField, setInstanceOverride } from "../instances/overrides.js";
|
|
3
4
|
import { walkInstanceSources } from "../instances/source-walk.js";
|
|
4
|
-
|
|
5
|
-
//#region src/components/properties.ts
|
|
5
|
+
// src/components/properties.ts
|
|
6
6
|
/**
|
|
7
7
|
* The component that defines a main component's properties: its set when it is a variant,
|
|
8
8
|
* since variants own no properties of their own (desktop 126), else the component itself.
|
|
@@ -175,7 +175,6 @@ function moveVariantPropertiesToSet(graph, setId) {
|
|
|
175
175
|
function createComponentPropertyId() {
|
|
176
176
|
return `prop:${randomHex(8)}`;
|
|
177
177
|
}
|
|
178
|
-
//#endregion
|
|
179
178
|
export { applyComponentPropertyValue, componentPropertyDefinitions, componentPropertyOwners, createComponentPropertyId, findComponentPropertyTarget, findComponentPropertyTargets, moveVariantPropertiesToSet, propertyOwner, reapplyComponentPropertyAssignments, recordAssignmentOverride, removeComponentProperty, resolveComponentPropertyValue };
|
|
180
179
|
|
|
181
180
|
//# sourceMappingURL=properties.js.map
|