@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodes.js","names":["required"],"sources":["../../src/transfer/nodes.ts"],"sourcesContent":["import { cloneNodeProps } from '../copy'\nimport { overriddenBindingField, remapInstanceOverrideState } from '../instances/overrides'\nimport { referencedStyleIds } from '../shared-styles'\nimport { styleRunReferences } from '../text/references'\nimport type { ComponentPropertyType, SceneNode } from '../types'\nimport { requireTransferReference as required } from './references'\nimport { remappedResourceReferences } from './resources'\nimport type { VariableTransferReferences } from './variables'\n\nexport function semanticTransferReferences(node: SceneNode): string[] {\n const runs = styleRunReferences(node.styleRuns)\n return [\n ...(node.componentId ? [node.componentId] : []),\n ...Object.values(node.boundVariables),\n ...runs.variables,\n ...referencedStyleIds(node),\n ...Object.entries(node.componentPropertyAssignments).flatMap(([id, value]) => [id, value]),\n ...node.componentPropertyReferences.map((reference) => reference.propertyId),\n ...node.componentPropertyDefinitions.flatMap((definition) => [\n definition.id,\n ...(definition.type === 'INSTANCE_SWAP' && definition.defaultValue\n ? [definition.defaultValue]\n : [])\n ]),\n ...node.instanceOverrides.descendants.keys(),\n ...[\n ...node.instanceOverrides.self,\n ...[...node.instanceOverrides.descendants.values()].flatMap((fields) => [...fields])\n ].flatMap(([field, value]) =>\n typeof value === 'string' &&\n (field === 'componentId' ||\n field === 'sourceComponentId' ||\n overriddenBindingField(field) !== null)\n ? [value]\n : []\n )\n ]\n}\n\nexport interface NodeTransferReferences extends VariableTransferReferences {\n nodes: ReadonlyMap<string, string>\n styles: ReadonlyMap<string, string>\n properties: ReadonlyMap<string, string>\n propertyTypes: ReadonlyMap<string, ComponentPropertyType>\n}\n\n/** Prepare runtime references without rewriting original format identities or ordinary text. */\nexport function prepareNodeTransfer(\n source: SceneNode,\n refs: NodeTransferReferences\n): Partial<SceneNode> {\n const node = (id: string) => required(refs.nodes, id, 'node')\n const variable = (id: string) => required(refs.variables, id, 'variable')\n const property = (id: string) => required(refs.properties, id, 'property')\n const style = (id: string) => required(refs.styles, id, 'style')\n const propertyValue = (id: string, value: string): string => {\n const type = refs.propertyTypes.get(id)\n if (!type) throw new Error(`Missing property transfer type: ${id}`)\n return type === 'INSTANCE_SWAP' && value ? node(value) : value\n }\n const values = (entries: Record<string, string>) =>\n Object.fromEntries(\n Object.entries(entries).map(([id, value]) => [property(id), propertyValue(id, value)])\n )\n const result = cloneNodeProps(source, null)\n result.componentId = source.componentId ? node(source.componentId) : null\n result.instanceOverrides = remapInstanceOverrideState(source.instanceOverrides, {\n node,\n variable,\n collection: (id) => refs.collections.get(id),\n property: (id) => refs.properties.get(id)\n })\n Object.assign(\n result,\n remappedResourceReferences(source, {\n variable,\n collection: (id) => required(refs.collections, id, 'collection'),\n mode: (id) => required(refs.modes, id, 'mode'),\n style,\n // A link to a layer the transfer leaves behind keeps naming it.\n layer: (id) => refs.nodes.get(id) ?? id\n })\n )\n // A connector keeps the layers it was attached to when they are left behind; the end becomes\n // free where nothing by that ID exists, as a pasted Figma connector does.\n for (const field of ['connectorStart', 'connectorEnd'] as const) {\n const endpoint = result[field]\n if (endpoint?.nodeId) endpoint.nodeId = refs.nodes.get(endpoint.nodeId) ?? endpoint.nodeId\n }\n result.componentPropertyDefinitions = source.componentPropertyDefinitions.map((definition) => ({\n ...structuredClone(definition),\n id: property(definition.id),\n defaultValue: propertyValue(definition.id, definition.defaultValue)\n }))\n // A reference to a property that neither the transfer nor its destination defines names nothing.\n result.componentPropertyReferences = source.componentPropertyReferences.flatMap((reference) => {\n const propertyId = refs.properties.get(reference.propertyId)\n return propertyId ? [{ ...reference, propertyId }] : []\n })\n result.componentPropertyAssignments = values(source.componentPropertyAssignments)\n // Variant values are keyed by display names, unlike definition-ID assignments.\n result.componentPropertyValues = { ...source.componentPropertyValues }\n return result\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"nodes.js","names":["required"],"sources":["../../src/transfer/nodes.ts"],"sourcesContent":["import { readBehaviour, withBehaviour } from '../behaviours/model'\nimport { mapTransitionVariables, transitionVariableIds } from '../behaviours/transition'\nimport { cloneNodeProps } from '../copy'\nimport { overriddenBindingField, remapInstanceOverrideState } from '../instances/overrides'\nimport { keyframeVariableIds, mapKeyframeVariables } from '../motion/variables'\nimport { referencedStyleIds } from '../shared-styles'\nimport { mapSlideVariables, slideVariableIds } from '../slides/motion'\nimport { styleRunReferences } from '../text/references'\nimport type { ComponentPropertyType, SceneNode } from '../types'\nimport { requireTransferReference as required } from './references'\nimport { remappedResourceReferences } from './resources'\nimport type { VariableTransferReferences } from './variables'\n\nexport function semanticTransferReferences(node: SceneNode): string[] {\n const runs = styleRunReferences(node.styleRuns)\n const behaviour = readBehaviour(node)\n return [\n ...(node.componentId ? [node.componentId] : []),\n ...Object.values(node.boundVariables),\n ...(behaviour ? transitionVariableIds(behaviour) : []),\n ...slideVariableIds(node),\n ...keyframeVariableIds(node),\n ...runs.variables,\n ...referencedStyleIds(node),\n ...Object.entries(node.componentPropertyAssignments).flatMap(([id, value]) => [id, value]),\n ...node.componentPropertyReferences.map((reference) => reference.propertyId),\n ...node.componentPropertyDefinitions.flatMap((definition) => [\n definition.id,\n ...(definition.type === 'INSTANCE_SWAP' && definition.defaultValue\n ? [definition.defaultValue]\n : [])\n ]),\n ...node.instanceOverrides.descendants.keys(),\n ...[\n ...node.instanceOverrides.self,\n ...[...node.instanceOverrides.descendants.values()].flatMap((fields) => [...fields])\n ].flatMap(([field, value]) =>\n typeof value === 'string' &&\n (field === 'componentId' ||\n field === 'sourceComponentId' ||\n overriddenBindingField(field) !== null)\n ? [value]\n : []\n )\n ]\n}\n\nexport interface NodeTransferReferences extends VariableTransferReferences {\n nodes: ReadonlyMap<string, string>\n styles: ReadonlyMap<string, string>\n properties: ReadonlyMap<string, string>\n propertyTypes: ReadonlyMap<string, ComponentPropertyType>\n}\n\n/** Prepare runtime references without rewriting original format identities or ordinary text. */\nexport function prepareNodeTransfer(\n source: SceneNode,\n refs: NodeTransferReferences\n): Partial<SceneNode> {\n const node = (id: string) => required(refs.nodes, id, 'node')\n const variable = (id: string) => required(refs.variables, id, 'variable')\n const property = (id: string) => required(refs.properties, id, 'property')\n const style = (id: string) => required(refs.styles, id, 'style')\n const propertyValue = (id: string, value: string): string => {\n const type = refs.propertyTypes.get(id)\n if (!type) throw new Error(`Missing property transfer type: ${id}`)\n return type === 'INSTANCE_SWAP' && value ? node(value) : value\n }\n const values = (entries: Record<string, string>) =>\n Object.fromEntries(\n Object.entries(entries).map(([id, value]) => [property(id), propertyValue(id, value)])\n )\n const result = cloneNodeProps(source, null)\n result.componentId = source.componentId ? node(source.componentId) : null\n result.instanceOverrides = remapInstanceOverrideState(source.instanceOverrides, {\n node,\n variable,\n collection: (id) => refs.collections.get(id),\n property: (id) => refs.properties.get(id)\n })\n Object.assign(\n result,\n remappedResourceReferences(source, {\n variable,\n collection: (id) => required(refs.collections, id, 'collection'),\n mode: (id) => required(refs.modes, id, 'mode'),\n style,\n // A link to a layer the transfer leaves behind keeps naming it.\n layer: (id) => refs.nodes.get(id) ?? id\n })\n )\n // A connector keeps the layers it was attached to when they are left behind; the end becomes\n // free where nothing by that ID exists, as a pasted Figma connector does.\n for (const field of ['connectorStart', 'connectorEnd'] as const) {\n const endpoint = result[field]\n if (endpoint?.nodeId) endpoint.nodeId = refs.nodes.get(endpoint.nodeId) ?? endpoint.nodeId\n }\n result.componentPropertyDefinitions = source.componentPropertyDefinitions.map((definition) => ({\n ...structuredClone(definition),\n id: property(definition.id),\n defaultValue: propertyValue(definition.id, definition.defaultValue)\n }))\n // A reference to a property that neither the transfer nor its destination defines names nothing.\n result.componentPropertyReferences = source.componentPropertyReferences.flatMap((reference) => {\n const propertyId = refs.properties.get(reference.propertyId)\n return propertyId ? [{ ...reference, propertyId }] : []\n })\n result.componentPropertyAssignments = values(source.componentPropertyAssignments)\n // A behaviour's transition follows the variables the copy brings; one it left behind is let go,\n // and the transition keeps its own value.\n const behaviour = readBehaviour(source)\n if (behaviour && transitionVariableIds(behaviour).length > 0)\n result.pluginData = withBehaviour(\n source,\n mapTransitionVariables(behaviour, (id) => refs.variables.get(id))\n )\n // So do a slide's transition and a layer's animation.\n if (slideVariableIds(source).length > 0)\n Object.assign(\n result,\n mapSlideVariables(source, (id) => refs.variables.get(id))\n )\n // So do a layer's keyframes.\n if (keyframeVariableIds(source).length > 0)\n Object.assign(\n result,\n mapKeyframeVariables(source, (id) => refs.variables.get(id))\n )\n // Variant values are keyed by display names, unlike definition-ID assignments.\n result.componentPropertyValues = { ...source.componentPropertyValues }\n return result\n}\n"],"mappings":";;;;;;;;;;;AAaA,SAAgB,2BAA2B,MAA2B;CACpE,MAAM,OAAO,mBAAmB,KAAK,SAAS;CAC9C,MAAM,YAAY,cAAc,IAAI;CACpC,OAAO;EACL,GAAI,KAAK,cAAc,CAAC,KAAK,WAAW,IAAI,CAAC;EAC7C,GAAG,OAAO,OAAO,KAAK,cAAc;EACpC,GAAI,YAAY,sBAAsB,SAAS,IAAI,CAAC;E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I,EAAE,CAAC,CAClE;CAEF,IAAI,iBAAiB,MAAM,CAAC,CAAC,SAAS,GACpC,OAAO,OACL,QACA,kBAAkB,SAAS,OAAO,KAAK,UAAU,IAAI,EAAE,CAAC,CAC1D;CAEF,IAAI,oBAAoB,MAAM,CAAC,CAAC,SAAS,GACvC,OAAO,OACL,QACA,qBAAqB,SAAS,OAAO,KAAK,UAAU,IAAI,EAAE,CAAC,CAC7D;CAEF,OAAO,0BAA0B,EAAE,GAAG,OAAO,wBAAwB;CACrE,OAAO;AACT"}
|
package/dist/transfer/plan.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { SceneGraph } from "../graph.js";
|
|
2
2
|
import { NodeType, SceneNode, Variable, VariableCollection } from "../types.js";
|
|
3
|
-
|
|
4
|
-
interface GraphTransferInput {
|
|
3
|
+
export interface GraphTransferInput {
|
|
5
4
|
source: SceneGraph;
|
|
6
5
|
rootIds: readonly string[];
|
|
7
6
|
dependencyPageIds: readonly string[];
|
|
@@ -9,10 +8,19 @@ interface GraphTransferInput {
|
|
|
9
8
|
parentId: string;
|
|
10
9
|
}
|
|
11
10
|
/** Preflight a self-contained fragment; allocation does not insert anything into the target. */
|
|
12
|
-
declare function prepareGraphTransfer(input: GraphTransferInput): {
|
|
11
|
+
export declare function prepareGraphTransfer(input: GraphTransferInput): {
|
|
13
12
|
images: Map<string, Uint8Array<ArrayBuffer>>;
|
|
14
13
|
variables: Variable[];
|
|
15
14
|
collections: VariableCollection[];
|
|
15
|
+
joined: {
|
|
16
|
+
collectionId: string;
|
|
17
|
+
variableId: string;
|
|
18
|
+
}[];
|
|
19
|
+
reused: {
|
|
20
|
+
collections: string[];
|
|
21
|
+
variables: string[];
|
|
22
|
+
styles: string[];
|
|
23
|
+
};
|
|
16
24
|
nodeIds: Map<string, string>;
|
|
17
25
|
rootIds: string[];
|
|
18
26
|
dependencyPageIds: string[];
|
|
@@ -23,6 +31,4 @@ declare function prepareGraphTransfer(input: GraphTransferInput): {
|
|
|
23
31
|
props: Partial<SceneNode>;
|
|
24
32
|
}[];
|
|
25
33
|
};
|
|
26
|
-
//#endregion
|
|
27
|
-
export { GraphTransferInput, prepareGraphTransfer };
|
|
28
34
|
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.ts","names":[],"sources":["../../src/transfer/plan.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"plan.d.ts","names":[],"sources":["../../src/transfer/plan.ts"],"mappings":";;iBAYiB;EACf,QAAQ;EACR;EACA;EACA,QAAQ;EACR;;;wBAsEc,qBAAqB,OAAO"}
|
package/dist/transfer/plan.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { sharedStyleLayers } from "../shared-styles.js";
|
|
2
|
+
import { libraryModeOf, matchLibraryResources, withoutLibraryKey } from "./library.js";
|
|
2
3
|
import { prepareNodeTransfer } from "./nodes.js";
|
|
3
4
|
import { prepareVariableTransfer } from "./variables.js";
|
|
4
|
-
|
|
5
|
+
// src/transfer/plan.ts
|
|
5
6
|
/** A transferred style's props under the ID the transfer gives it. */
|
|
6
7
|
function withStyleId(node, props, styles) {
|
|
7
8
|
const id = node.sharedStyleType !== null && node.source.id ? styles.get(node.source.id) : void 0;
|
|
@@ -14,6 +15,43 @@ function withStyleId(node, props, styles) {
|
|
|
14
15
|
}
|
|
15
16
|
};
|
|
16
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* The variables and collections a transfer adds, given what the target holds of them: nothing
|
|
20
|
+
* for a copy it holds, and a variable new to a library collection it holds joins that one. A
|
|
21
|
+
* copy that cannot take the place of the target's becomes the target's own, without its key,
|
|
22
|
+
* and a library collection new to the target remembers each library mode, so that a later
|
|
23
|
+
* transfer of it pairs its modes exactly.
|
|
24
|
+
*/
|
|
25
|
+
function libraryResources(prepared, sourceCollections, references, reuse) {
|
|
26
|
+
const mapped = (id) => references.variables.get(id) ?? references.collections.get(id);
|
|
27
|
+
const local = new Set([...reuse.local].map(mapped));
|
|
28
|
+
const reused = {
|
|
29
|
+
collections: [...new Set(reuse.collections.values())],
|
|
30
|
+
variables: [...new Set(reuse.variables.values())],
|
|
31
|
+
styles: [...new Set(reuse.styles.values())]
|
|
32
|
+
};
|
|
33
|
+
const heldCollections = new Set(reused.collections);
|
|
34
|
+
const heldVariables = new Set(reused.variables);
|
|
35
|
+
const own = (item) => local.has(item.id) ? withoutLibraryKey(item) : item;
|
|
36
|
+
const libraryModes = new Map(sourceCollections.flatMap((collection) => collection.key ? collection.modes.map((mode) => [references.modes.get(mode.modeId), libraryModeOf(mode)]) : []));
|
|
37
|
+
const collections = prepared.collections.filter((collection) => !heldCollections.has(collection.id)).map(own).map((collection) => collection.key ? {
|
|
38
|
+
...collection,
|
|
39
|
+
modes: collection.modes.map((mode) => ({
|
|
40
|
+
...mode,
|
|
41
|
+
libraryModeId: libraryModes.get(mode.modeId)
|
|
42
|
+
}))
|
|
43
|
+
} : collection);
|
|
44
|
+
const variables = prepared.variables.filter((variable) => !heldVariables.has(variable.id)).map(own);
|
|
45
|
+
return {
|
|
46
|
+
variables,
|
|
47
|
+
collections,
|
|
48
|
+
joined: variables.filter((variable) => heldCollections.has(variable.collectionId)).map((variable) => ({
|
|
49
|
+
collectionId: variable.collectionId,
|
|
50
|
+
variableId: variable.id
|
|
51
|
+
})),
|
|
52
|
+
reused
|
|
53
|
+
};
|
|
54
|
+
}
|
|
17
55
|
/** Preflight a self-contained fragment; allocation does not insert anything into the target. */
|
|
18
56
|
function prepareGraphTransfer(input) {
|
|
19
57
|
const { source, target, parentId } = input;
|
|
@@ -32,6 +70,13 @@ function prepareGraphTransfer(input) {
|
|
|
32
70
|
reserved.add(id);
|
|
33
71
|
return id;
|
|
34
72
|
};
|
|
73
|
+
const targetStyles = sharedStyleLayers(target);
|
|
74
|
+
const reuse = matchLibraryResources(target, {
|
|
75
|
+
collections: source.variableCollections.values(),
|
|
76
|
+
variables: source.variables.values(),
|
|
77
|
+
styles: sharedStyleLayers(source).values()
|
|
78
|
+
}, targetStyles);
|
|
79
|
+
const reusedStyle = (node) => node.sharedStyleType !== null && !!node.source.id && reuse.styles.has(node.source.id);
|
|
35
80
|
const ordered = [];
|
|
36
81
|
const seen = /* @__PURE__ */ new Set();
|
|
37
82
|
const visit = (id) => {
|
|
@@ -39,15 +84,16 @@ function prepareGraphTransfer(input) {
|
|
|
39
84
|
const node = source.getNode(id);
|
|
40
85
|
if (!node) throw new Error(`Missing transfer source ${id}`);
|
|
41
86
|
seen.add(id);
|
|
87
|
+
if (reusedStyle(node)) return;
|
|
42
88
|
ordered.push(node);
|
|
43
89
|
for (const child of node.childIds) visit(child);
|
|
44
90
|
};
|
|
45
91
|
for (const id of [...input.dependencyPageIds, ...input.rootIds]) visit(id);
|
|
46
92
|
const nodes = new Map(ordered.map((node) => [node.id, allocate()]));
|
|
47
|
-
const variables = new Map([...source.variables.keys()].map((id) => [id, allocate()]));
|
|
48
|
-
const collections = new Map([...source.variableCollections.keys()].map((id) => [id, allocate()]));
|
|
93
|
+
const variables = new Map([...source.variables.keys()].map((id) => [id, reuse.variables.get(id) ?? allocate()]));
|
|
94
|
+
const collections = new Map([...source.variableCollections.keys()].map((id) => [id, reuse.collections.get(id) ?? allocate()]));
|
|
49
95
|
const modes = /* @__PURE__ */ new Map();
|
|
50
|
-
for (const collection of source.variableCollections.values()) for (const mode of collection.modes) if (!modes.has(mode.modeId)) modes.set(mode.modeId, allocate());
|
|
96
|
+
for (const collection of source.variableCollections.values()) for (const mode of collection.modes) if (!modes.has(mode.modeId)) modes.set(mode.modeId, reuse.modes.get(mode.modeId) ?? allocate());
|
|
51
97
|
const properties = /* @__PURE__ */ new Map();
|
|
52
98
|
const propertyTypes = /* @__PURE__ */ new Map();
|
|
53
99
|
for (const node of ordered) for (const definition of node.componentPropertyDefinitions) {
|
|
@@ -55,8 +101,7 @@ function prepareGraphTransfer(input) {
|
|
|
55
101
|
propertyTypes.set(definition.id, definition.type);
|
|
56
102
|
if (!properties.has(definition.id)) properties.set(definition.id, allocate());
|
|
57
103
|
}
|
|
58
|
-
const
|
|
59
|
-
const styles = /* @__PURE__ */ new Map();
|
|
104
|
+
const styles = new Map(reuse.styles);
|
|
60
105
|
for (const node of ordered) {
|
|
61
106
|
const id = node.source.id;
|
|
62
107
|
if (node.sharedStyleType === null || !id) continue;
|
|
@@ -71,7 +116,7 @@ function prepareGraphTransfer(input) {
|
|
|
71
116
|
propertyTypes,
|
|
72
117
|
styles
|
|
73
118
|
};
|
|
74
|
-
const resources = prepareVariableTransfer([...source.variables.values()], [...source.variableCollections.values()], references);
|
|
119
|
+
const resources = libraryResources(prepareVariableTransfer([...source.variables.values()], [...source.variableCollections.values()], references), [...source.variableCollections.values()], references, reuse);
|
|
75
120
|
const mapped = (id) => {
|
|
76
121
|
const value = nodes.get(id);
|
|
77
122
|
if (!value) throw new Error(`Missing transfer node mapping ${id}`);
|
|
@@ -98,7 +143,6 @@ function prepareGraphTransfer(input) {
|
|
|
98
143
|
images: new Map([...source.images].map(([hash, bytes]) => [hash, bytes.slice()]))
|
|
99
144
|
};
|
|
100
145
|
}
|
|
101
|
-
//#endregion
|
|
102
146
|
export { prepareGraphTransfer };
|
|
103
147
|
|
|
104
148
|
//# sourceMappingURL=plan.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.js","names":[],"sources":["../../src/transfer/plan.ts"],"sourcesContent":["import type { SceneGraph } from '../graph'\nimport { sharedStyleLayers } from '../shared-styles'\nimport type { ComponentPropertyType, SceneNode } from '../types'\nimport { prepareNodeTransfer } from './nodes'\nimport { prepareVariableTransfer } from './variables'\n\nexport interface GraphTransferInput {\n source: SceneGraph\n rootIds: readonly string[]\n dependencyPageIds: readonly string[]\n target: SceneGraph\n parentId: string\n}\n\n/** A transferred style's props under the ID the transfer gives it. */\nfunction withStyleId(\n node: SceneNode,\n props: Partial<SceneNode>,\n styles: ReadonlyMap<string, string>\n): Partial<SceneNode> {\n const id =\n node.sharedStyleType !== null && node.source.id ? styles.get(node.source.id) : undefined\n if (!id || id === node.source.id) return props\n return { ...props, source: { ...(props.source ?? node.source), id } }\n}\n\n/** Preflight a self-contained fragment; allocation does not insert anything into the target. */\nexport function prepareGraphTransfer(input: GraphTransferInput) {\n const { source, target, parentId } = input\n if (!target.getNode(parentId)) throw new Error(`Missing transfer parent ${parentId}`)\n const reserved = new Set([\n ...target.nodes.keys(),\n ...target.variables.keys(),\n ...target.variableCollections.keys()\n ])\n for (const collection of target.variableCollections.values())\n for (const mode of collection.modes) reserved.add(mode.modeId)\n let sequence = 0\n const namespace = crypto.randomUUID()\n const allocate = (): string => {\n let id = `${namespace}:${sequence++}`\n while (reserved.has(id)) id = `${namespace}:${sequence++}`\n reserved.add(id)\n return id\n }\n const ordered: SceneNode[] = []\n const seen = new Set<string>()\n const visit = (id: string): void => {\n if (seen.has(id)) throw new Error(`Repeated transfer node ${id}`)\n const node = source.getNode(id)\n if (!node) throw new Error(`Missing transfer source ${id}`)\n seen.add(id)\n ordered.push(node)\n for (const child of node.childIds) visit(child)\n }\n for (const id of [...input.dependencyPageIds, ...input.rootIds]) visit(id)\n const nodes = new Map(ordered.map((node) => [node.id, allocate()]))\n const variables = new Map([...source.variables.keys()].map((id) => [id, allocate()]))\n const collections = new Map([...source.variableCollections.keys()].map((id) => [id, allocate()]))\n const modes = new Map<string, string>()\n for (const collection of source.variableCollections.values()) {\n for (const mode of collection.modes)\n if (!modes.has(mode.modeId)) modes.set(mode.modeId, allocate())\n }\n const properties = new Map<string, string>()\n const propertyTypes = new Map<string, ComponentPropertyType>()\n for (const node of ordered)\n for (const definition of node.componentPropertyDefinitions) {\n if (propertyTypes.has(definition.id) && propertyTypes.get(definition.id) !== definition.type)\n throw new Error(`Conflicting property type ${definition.id}`)\n propertyTypes.set(definition.id, definition.type)\n if (!properties.has(definition.id)) properties.set(definition.id, allocate())\n }\n // Layers name a style by the style's own ID, which a transferred style keeps unless the\n // target already holds another style by it: IDs read from Figma are only unique in one file.\n const targetStyles = sharedStyleLayers(target)\n const styles = new Map<string, string>()\n for (const node of ordered) {\n const id = node.source.id\n if (node.sharedStyleType === null || !id) continue\n styles.set(id, targetStyles.has(id) ? allocate() : id)\n }\n const references = {\n nodes,\n variables,\n collections,\n modes,\n properties,\n propertyTypes,\n styles\n }\n const resources = prepareVariableTransfer(\n [...source.variables.values()],\n [...source.variableCollections.values()],\n references\n )\n const mapped = (id: string): string => {\n const value = nodes.get(id)\n if (!value) throw new Error(`Missing transfer node mapping ${id}`)\n return value\n }\n const roots = new Set(input.rootIds)\n const dependencies = new Set(input.dependencyPageIds)\n const destinationParent = (node: SceneNode): string => {\n if (roots.has(node.id)) return parentId\n if (dependencies.has(node.id)) return target.rootId\n return mapped(node.parentId ?? '')\n }\n return {\n nodeIds: nodes,\n rootIds: input.rootIds.map(mapped),\n dependencyPageIds: input.dependencyPageIds.map(mapped),\n nodes: ordered.map((node) => ({\n id: mapped(node.id),\n type: node.type,\n parentId: destinationParent(node),\n props: withStyleId(node, prepareNodeTransfer(node, references), styles)\n })),\n ...resources,\n images: new Map([...source.images].map(([hash, bytes]) => [hash, bytes.slice()]))\n }\n}\n"],"mappings":";;;;;AAeA,SAAS,YACP,MACA,OACA,QACoB;CACpB,MAAM,KACJ,KAAK,oBAAoB,QAAQ,KAAK,OAAO,KAAK,OAAO,IAAI,KAAK,OAAO,EAAE,IAAI,KAAA;CACjF,IAAI,CAAC,MAAM,OAAO,KAAK,OAAO,IAAI,OAAO;CACzC,OAAO;EAAE,GAAG;EAAO,QAAQ;GAAE,GAAI,MAAM,UAAU,KAAK;GAAS;EAAG;CAAE;AACtE;;AAGA,SAAgB,qBAAqB,OAA2B;CAC9D,MAAM,EAAE,QAAQ,QAAQ,aAAa;CACrC,IAAI,CAAC,OAAO,QAAQ,QAAQ,GAAG,MAAM,IAAI,MAAM,2BAA2B,UAAU;CACpF,MAAM,2BAAW,IAAI,IAAI;EACvB,GAAG,OAAO,MAAM,KAAK;EACrB,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OAAO;EAC/B,IAAI,aAAa,IAAI,KAAK,EAAE,GAAG,OAAO,OAAO;EAC7C,OAAO,OAAO,KAAK,YAAY,EAAE;CACnC;CACA,OAAO;EACL,SAAS;EACT,SAAS,MAAM,QAAQ,IAAI,MAAM;EACjC,mBAAmB,MAAM,kBAAkB,IAAI,MAAM;EACrD,OAAO,QAAQ,KAAK,UAAU;GAC5B,IAAI,OAAO,KAAK,EAAE;GAClB,MAAM,KAAK;GACX,UAAU,kBAAkB,IAAI;GAChC,OAAO,YAAY,MAAM,oBAAoB,MAAM,UAAU,GAAG,MAAM;EACxE,EAAE;EACF,GAAG;EACH,QAAQ,IAAI,IAAI,CAAC,GAAG,OAAO,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,WAAW,CAAC,MAAM,MAAM,MAAM,CAAC,CAAC,CAAC;CAClF;AACF"}
|
|
1
|
+
{"version":3,"file":"plan.js","names":[],"sources":["../../src/transfer/plan.ts"],"sourcesContent":["import type { SceneGraph } from '../graph'\nimport { sharedStyleLayers } from '../shared-styles'\nimport type { ComponentPropertyType, SceneNode, Variable, VariableCollection } from '../types'\nimport {\n libraryModeOf,\n matchLibraryResources,\n withoutLibraryKey,\n type LibraryReuse\n} from './library'\nimport { prepareNodeTransfer } from './nodes'\nimport { prepareVariableTransfer, type VariableTransferReferences } from './variables'\n\nexport interface GraphTransferInput {\n source: SceneGraph\n rootIds: readonly string[]\n dependencyPageIds: readonly string[]\n target: SceneGraph\n parentId: string\n}\n\n/** A transferred style's props under the ID the transfer gives it. */\nfunction withStyleId(\n node: SceneNode,\n props: Partial<SceneNode>,\n styles: ReadonlyMap<string, string>\n): Partial<SceneNode> {\n const id =\n node.sharedStyleType !== null && node.source.id ? styles.get(node.source.id) : undefined\n if (!id || id === node.source.id) return props\n return { ...props, source: { ...(props.source ?? node.source), id } }\n}\n\n/**\n * The variables and collections a transfer adds, given what the target holds of them: nothing\n * for a copy it holds, and a variable new to a library collection it holds joins that one. A\n * copy that cannot take the place of the target's becomes the target's own, without its key,\n * and a library collection new to the target remembers each library mode, so that a later\n * transfer of it pairs its modes exactly.\n */\nfunction libraryResources(\n prepared: { variables: Variable[]; collections: VariableCollection[] },\n sourceCollections: readonly VariableCollection[],\n references: VariableTransferReferences,\n reuse: LibraryReuse\n) {\n const mapped = (id: string) => references.variables.get(id) ?? references.collections.get(id)\n const local = new Set([...reuse.local].map(mapped))\n const reused = {\n collections: [...new Set(reuse.collections.values())],\n variables: [...new Set(reuse.variables.values())],\n styles: [...new Set(reuse.styles.values())]\n }\n const heldCollections = new Set(reused.collections)\n const heldVariables = new Set(reused.variables)\n const own = <T extends { id: string; key?: string; version?: string }>(item: T): T =>\n local.has(item.id) ? withoutLibraryKey(item) : item\n const libraryModes = new Map(\n sourceCollections.flatMap((collection) =>\n collection.key\n ? collection.modes.map((mode) => [references.modes.get(mode.modeId), libraryModeOf(mode)])\n : []\n )\n )\n const collections = prepared.collections\n .filter((collection) => !heldCollections.has(collection.id))\n .map(own)\n .map((collection) =>\n collection.key\n ? {\n ...collection,\n modes: collection.modes.map((mode) => ({\n ...mode,\n libraryModeId: libraryModes.get(mode.modeId)\n }))\n }\n : collection\n )\n const variables = prepared.variables\n .filter((variable) => !heldVariables.has(variable.id))\n .map(own)\n const joined = variables\n .filter((variable) => heldCollections.has(variable.collectionId))\n .map((variable) => ({ collectionId: variable.collectionId, variableId: variable.id }))\n return { variables, collections, joined, reused }\n}\n\n/** Preflight a self-contained fragment; allocation does not insert anything into the target. */\nexport function prepareGraphTransfer(input: GraphTransferInput) {\n const { source, target, parentId } = input\n if (!target.getNode(parentId)) throw new Error(`Missing transfer parent ${parentId}`)\n const reserved = new Set([\n ...target.nodes.keys(),\n ...target.variables.keys(),\n ...target.variableCollections.keys()\n ])\n for (const collection of target.variableCollections.values())\n for (const mode of collection.modes) reserved.add(mode.modeId)\n let sequence = 0\n const namespace = crypto.randomUUID()\n const allocate = (): string => {\n let id = `${namespace}:${sequence++}`\n while (reserved.has(id)) id = `${namespace}:${sequence++}`\n reserved.add(id)\n return id\n }\n const targetStyles = sharedStyleLayers(target)\n const reuse = matchLibraryResources(\n target,\n {\n collections: source.variableCollections.values(),\n variables: source.variables.values(),\n styles: sharedStyleLayers(source).values()\n },\n targetStyles\n )\n const reusedStyle = (node: SceneNode) =>\n node.sharedStyleType !== null && !!node.source.id && reuse.styles.has(node.source.id)\n const ordered: SceneNode[] = []\n const seen = new Set<string>()\n const visit = (id: string): void => {\n if (seen.has(id)) throw new Error(`Repeated transfer node ${id}`)\n const node = source.getNode(id)\n if (!node) throw new Error(`Missing transfer source ${id}`)\n seen.add(id)\n // Layers name the target's copy of a library style it already holds instead.\n if (reusedStyle(node)) return\n ordered.push(node)\n for (const child of node.childIds) visit(child)\n }\n for (const id of [...input.dependencyPageIds, ...input.rootIds]) visit(id)\n const nodes = new Map(ordered.map((node) => [node.id, allocate()]))\n const variables = new Map(\n [...source.variables.keys()].map((id) => [id, reuse.variables.get(id) ?? allocate()])\n )\n const collections = new Map(\n [...source.variableCollections.keys()].map((id) => [\n id,\n reuse.collections.get(id) ?? allocate()\n ])\n )\n const modes = new Map<string, string>()\n for (const collection of source.variableCollections.values()) {\n for (const mode of collection.modes)\n if (!modes.has(mode.modeId))\n modes.set(mode.modeId, reuse.modes.get(mode.modeId) ?? allocate())\n }\n const properties = new Map<string, string>()\n const propertyTypes = new Map<string, ComponentPropertyType>()\n for (const node of ordered)\n for (const definition of node.componentPropertyDefinitions) {\n if (propertyTypes.has(definition.id) && propertyTypes.get(definition.id) !== definition.type)\n throw new Error(`Conflicting property type ${definition.id}`)\n propertyTypes.set(definition.id, definition.type)\n if (!properties.has(definition.id)) properties.set(definition.id, allocate())\n }\n // Layers name a style by the style's own ID, which a transferred style keeps unless the\n // target already holds another style by it: IDs read from Figma are only unique in one file.\n const styles = new Map(reuse.styles)\n for (const node of ordered) {\n const id = node.source.id\n if (node.sharedStyleType === null || !id) continue\n styles.set(id, targetStyles.has(id) ? allocate() : id)\n }\n const references = {\n nodes,\n variables,\n collections,\n modes,\n properties,\n propertyTypes,\n styles\n }\n const resources = libraryResources(\n prepareVariableTransfer(\n [...source.variables.values()],\n [...source.variableCollections.values()],\n references\n ),\n [...source.variableCollections.values()],\n references,\n reuse\n )\n const mapped = (id: string): string => {\n const value = nodes.get(id)\n if (!value) throw new Error(`Missing transfer node mapping ${id}`)\n return value\n }\n const roots = new Set(input.rootIds)\n const dependencies = new Set(input.dependencyPageIds)\n const destinationParent = (node: SceneNode): string => {\n if (roots.has(node.id)) return parentId\n if (dependencies.has(node.id)) return target.rootId\n return mapped(node.parentId ?? '')\n }\n return {\n nodeIds: nodes,\n rootIds: input.rootIds.map(mapped),\n dependencyPageIds: input.dependencyPageIds.map(mapped),\n nodes: ordered.map((node) => ({\n id: mapped(node.id),\n type: node.type,\n parentId: destinationParent(node),\n props: withStyleId(node, prepareNodeTransfer(node, references), styles)\n })),\n ...resources,\n images: new Map([...source.images].map(([hash, bytes]) => [hash, bytes.slice()]))\n }\n}\n"],"mappings":";;;;;;AAqBA,SAAS,YACP,MACA,OACA,QACoB;CACpB,MAAM,KACJ,KAAK,oBAAoB,QAAQ,KAAK,OAAO,KAAK,OAAO,IAAI,KAAK,OAAO,EAAE,IAAI,KAAA;CACjF,IAAI,CAAC,MAAM,OAAO,KAAK,OAAO,IAAI,OAAO;CACzC,OAAO;EAAE,GAAG;EAAO,QAAQ;GAAE,GAAI,MAAM,UAAU,KAAK;GAAS;EAAG;CAAE;AACtE;;;;;;;;AASA,SAAS,iBACP,UACA,mBACA,YACA,OACA;CACA,MAAM,UAAU,OAAe,WAAW,UAAU,IAAI,EAAE,KAAK,WAAW,YAAY,IAAI,EAAE;CAC5F,MAAM,QAAQ,IAAI,IAAI,CAAC,GAAG,MAAM,KAAK,CAAC,CAAC,IAAI,MAAM,CAAC;CAClD,MAAM,SAAS;EACb,aAAa,CAAC,GAAG,IAAI,IAAI,MAAM,YAAY,OAAO,CAAC,CAAC;EACpD,WAAW,CAAC,GAAG,IAA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CAAC,GAAG,OAAO,UAAU,OAAO,CAAC,GAC7B,CAAC,GAAG,OAAO,oBAAoB,OAAO,CAAC,GACvC,UACF,GACA,CAAC,GAAG,OAAO,oBAAoB,OAAO,CAAC,GACvC,YACA,KACF;CACA,MAAM,UAAU,OAAuB;EACrC,MAAM,QAAQ,MAAM,IAAI,EAAE;EAC1B,IAAI,CAAC,OAAO,MAAM,IAAI,MAAM,iCAAiC,IAAI;EACjE,OAAO;CACT;CACA,MAAM,QAAQ,IAAI,IAAI,MAAM,OAAO;CACnC,MAAM,eAAe,IAAI,IAAI,MAAM,iBAAiB;CACpD,MAAM,qBAAqB,SAA4B;EACrD,IAAI,MAAM,IAAI,KAAK,EAAE,GAAG,OAAO;EAC/B,IAAI,aAAa,IAAI,KAAK,EAAE,GAAG,OAAO,OAAO;EAC7C,OAAO,OAAO,KAAK,YAAY,EAAE;CACnC;CACA,OAAO;EACL,SAAS;EACT,SAAS,MAAM,QAAQ,IAAI,MAAM;EACjC,mBAAmB,MAAM,kBAAkB,IAAI,MAAM;EACrD,OAAO,QAAQ,KAAK,UAAU;GAC5B,IAAI,OAAO,KAAK,EAAE;GAClB,MAAM,KAAK;GACX,UAAU,kBAAkB,IAAI;GAChC,OAAO,YAAY,MAAM,oBAAoB,MAAM,UAAU,GAAG,MAAM;EACxE,EAAE;EACF,GAAG;EACH,QAAQ,IAAI,IAAI,CAAC,GAAG,OAAO,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,WAAW,CAAC,MAAM,MAAM,MAAM,CAAC,CAAC,CAAC;CAClF;AACF"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
// src/transfer/references.ts
|
|
2
2
|
function requireTransferReference(ids, id, kind) {
|
|
3
3
|
const value = ids.get(id);
|
|
4
4
|
if (!value) throw new Error(`Missing ${kind} transfer mapping: ${id}`);
|
|
5
5
|
return value;
|
|
6
6
|
}
|
|
7
|
-
//#endregion
|
|
8
7
|
export { requireTransferReference };
|
|
9
8
|
|
|
10
9
|
//# sourceMappingURL=references.js.map
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { SceneGraph } from "../graph.js";
|
|
2
2
|
import { GraphTransferPlan } from "./apply.js";
|
|
3
|
-
//#region src/transfer/remove.d.ts
|
|
4
3
|
/** Refuse to remove transferred content that has acquired external dependents. */
|
|
5
|
-
declare function removeGraphTransfer(graph: SceneGraph, plan: GraphTransferPlan): void;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { removeGraphTransfer };
|
|
4
|
+
export declare function removeGraphTransfer(graph: SceneGraph, plan: GraphTransferPlan): void;
|
|
8
5
|
//# sourceMappingURL=remove.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove.d.ts","names":[],"sources":["../../src/transfer/remove.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"remove.d.ts","names":[],"sources":["../../src/transfer/remove.ts"],"mappings":";;;wBAKgB,oBAAoB,OAAO,YAAY,MAAM"}
|
package/dist/transfer/remove.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { leaveHeldCollections } from "./apply.js";
|
|
1
2
|
import { semanticTransferReferences } from "./nodes.js";
|
|
2
|
-
|
|
3
|
+
// src/transfer/remove.ts
|
|
3
4
|
/** Refuse to remove transferred content that has acquired external dependents. */
|
|
4
5
|
function removeGraphTransfer(graph, plan) {
|
|
5
6
|
const nodes = new Set(plan.nodes.map((node) => node.id));
|
|
@@ -18,9 +19,14 @@ function removeGraphTransfer(graph, plan) {
|
|
|
18
19
|
}
|
|
19
20
|
if (semanticTransferReferences(node).some(referencesOwned)) throw new Error(`Transferred content is referenced by ${node.id}`);
|
|
20
21
|
}
|
|
21
|
-
for (const variable of graph.variables.values())
|
|
22
|
+
for (const variable of graph.variables.values()) {
|
|
23
|
+
if (variables.has(variable.id)) continue;
|
|
24
|
+
if (referencesOwned(variable.valuesByMode)) throw new Error("Transferred variable has external aliases");
|
|
25
|
+
if (collections.has(variable.collectionId)) throw new Error("Transferred collection holds non-owned variables");
|
|
26
|
+
}
|
|
22
27
|
graph.withBufferedEvents(() => {
|
|
23
28
|
for (const node of plan.nodes.toReversed()) graph.deleteNode(node.id);
|
|
29
|
+
leaveHeldCollections(graph, plan);
|
|
24
30
|
for (const id of variables) {
|
|
25
31
|
graph.willChangeVariable(id);
|
|
26
32
|
graph.variables.delete(id);
|
|
@@ -31,7 +37,6 @@ function removeGraphTransfer(graph, plan) {
|
|
|
31
37
|
}
|
|
32
38
|
});
|
|
33
39
|
}
|
|
34
|
-
//#endregion
|
|
35
40
|
export { removeGraphTransfer };
|
|
36
41
|
|
|
37
42
|
//# sourceMappingURL=remove.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove.js","names":[],"sources":["../../src/transfer/remove.ts"],"sourcesContent":["import type { SceneGraph } from '../graph'\nimport type
|
|
1
|
+
{"version":3,"file":"remove.js","names":[],"sources":["../../src/transfer/remove.ts"],"sourcesContent":["import type { SceneGraph } from '../graph'\nimport { leaveHeldCollections, type GraphTransferPlan } from './apply'\nimport { semanticTransferReferences } from './nodes'\n\n/** Refuse to remove transferred content that has acquired external dependents. */\nexport function removeGraphTransfer(graph: SceneGraph, plan: GraphTransferPlan): void {\n const nodes = new Set(plan.nodes.map((node) => node.id))\n const variables = new Set(plan.variables.map((variable) => variable.id))\n const collections = new Set(plan.collections.map((collection) => collection.id))\n const referencesOwned = (value: unknown): boolean => {\n if (typeof value === 'string')\n return nodes.has(value) || variables.has(value) || collections.has(value)\n if (!value || typeof value !== 'object' || ArrayBuffer.isView(value)) return false\n if (value instanceof Map)\n return [...value].some(([key, item]) => referencesOwned(key) || referencesOwned(item))\n return Object.values(value).some(referencesOwned)\n }\n for (const node of graph.getAllNodes()) {\n if (nodes.has(node.id)) {\n if (node.childIds.some((id) => !nodes.has(id)))\n throw new Error('Transferred node has non-owned children')\n continue\n }\n if (semanticTransferReferences(node).some(referencesOwned))\n throw new Error(`Transferred content is referenced by ${node.id}`)\n }\n for (const variable of graph.variables.values()) {\n if (variables.has(variable.id)) continue\n if (referencesOwned(variable.valuesByMode))\n throw new Error('Transferred variable has external aliases')\n if (collections.has(variable.collectionId))\n throw new Error('Transferred collection holds non-owned variables')\n }\n graph.withBufferedEvents(() => {\n for (const node of plan.nodes.toReversed()) graph.deleteNode(node.id)\n leaveHeldCollections(graph, plan)\n for (const id of variables) {\n graph.willChangeVariable(id)\n graph.variables.delete(id)\n }\n for (const id of collections) {\n graph.willChangeCollection(id)\n graph.variableCollections.delete(id)\n }\n })\n}\n"],"mappings":";;;;AAKA,SAAgB,oBAAoB,OAAmB,MAA+B;CACpF,MAAM,QAAQ,IAAI,IAAI,KAAK,MAAM,KAAK,SAAS,KAAK,EAAE,CAAC;CACvD,MAAM,YAAY,IAAI,IAAI,KAAK,UAAU,KAAK,aAAa,SAAS,EAAE,CAAC;CACvE,MAAM,cAAc,IAAI,IAAI,KAAK,YAAY,KAAK,eAAe,WAAW,EAAE,CAAC;CAC/E,MAAM,mBAAmB,UAA4B;EACnD,IAAI,OAAO,UAAU,UACnB,OAAO,MAAM,IAAI,KAAK,KAAK,UAAU,IAAI,KAAK,KAAK,YAAY,IAAI,KAAK;EAC1E,IAAI,CAAC,SAAS,OAAO,UAAU,YAAY,YAAY,OAAO,KAAK,GAAG,OAAO;EAC7E,IAAI,iBAAiB,KACnB,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,UAAU,gBAAgB,GAAG,KAAK,gBAAgB,IAAI,CAAC;EACvF,OAAO,OAAO,OAAO,KAAK,CAAC,CAAC,KAAK,eAAe;CAClD;CACA,KAAK,MAAM,QAAQ,MAAM,YAAY,GAAG;EACtC,IAAI,MAAM,IAAI,KAAK,EAAE,GAAG;GACtB,IAAI,KAAK,SAAS,MAAM,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC,GAC3C,MAAM,IAAI,MAAM,yCAAyC;GAC3D;EACF;EACA,IAAI,2BAA2B,IAAI,CAAC,CAAC,KAAK,eAAe,GACvD,MAAM,IAAI,MAAM,wCAAwC,KAAK,IAAI;CACrE;CACA,KAAK,MAAM,YAAY,MAAM,UAAU,OAAO,GAAG;EAC/C,IAAI,UAAU,IAAI,SAAS,EAAE,GAAG;EAChC,IAAI,gBAAgB,SAAS,YAAY,GACvC,MAAM,IAAI,MAAM,2CAA2C;EAC7D,IAAI,YAAY,IAAI,SAAS,YAAY,GACvC,MAAM,IAAI,MAAM,kDAAkD;CACtE;CACA,MAAM,yBAAyB;EAC7B,KAAK,MAAM,QAAQ,KAAK,MAAM,WAAW,GAAG,MAAM,WAAW,KAAK,EAAE;EACpE,qBAAqB,OAAO,IAAI;EAChC,KAAK,MAAM,MAAM,WAAW;GAC1B,MAAM,mBAAmB,EAAE;GAC3B,MAAM,UAAU,OAAO,EAAE;EAC3B;EACA,KAAK,MAAM,MAAM,aAAa;GAC5B,MAAM,qBAAqB,EAAE;GAC7B,MAAM,oBAAoB,OAAO,EAAE;EACrC;CACF,CAAC;AACH"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { SceneNode } from "../types.js";
|
|
2
|
-
//#region src/transfer/resources.d.ts
|
|
3
2
|
/** How a layer's references to variables, collections, modes, and styles are renamed. */
|
|
4
|
-
interface ResourceReferences {
|
|
3
|
+
export interface ResourceReferences {
|
|
5
4
|
variable: (id: string) => string;
|
|
6
5
|
collection: (id: string) => string;
|
|
7
6
|
mode: (id: string) => string;
|
|
@@ -15,7 +14,5 @@ interface ResourceReferences {
|
|
|
15
14
|
* ranges and vector regions use. Only the fields that change are returned. Instance overrides
|
|
16
15
|
* name layers too, so their callers rename them with the layers.
|
|
17
16
|
*/
|
|
18
|
-
declare function remappedResourceReferences(node: SceneNode, references: ResourceReferences): Partial<SceneNode>;
|
|
19
|
-
//#endregion
|
|
20
|
-
export { ResourceReferences, remappedResourceReferences };
|
|
17
|
+
export declare function remappedResourceReferences(node: SceneNode, references: ResourceReferences): Partial<SceneNode>;
|
|
21
18
|
//# sourceMappingURL=resources.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.d.ts","names":[],"sources":["../../src/transfer/resources.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"resources.d.ts","names":[],"sources":["../../src/transfer/resources.ts"],"mappings":";;iBAOiB;EACf,WAAW;EACX,aAAa;EACb,OAAO;EACP,QAAQ;;EAER,SAAS;;;;;;;;wBASK,2BACd,MAAM,WACN,YAAY,qBACX,QAAQ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { remapStyleRunReferences } from "../text/references.js";
|
|
2
|
-
import { STYLE_LINK_FIELDS } from "../shared-styles.js";
|
|
3
1
|
import { isEqual } from "es-toolkit";
|
|
4
|
-
|
|
2
|
+
import { STYLE_LINK_FIELDS } from "../shared-styles.js";
|
|
3
|
+
import { remapStyleRunReferences } from "../text/references.js";
|
|
4
|
+
// src/transfer/resources.ts
|
|
5
5
|
/**
|
|
6
6
|
* `node`'s references to variables, collections, modes, and styles, renamed as a copy into
|
|
7
7
|
* another document renames them: its bindings, the modes it sets, the styles it and its text
|
|
@@ -32,7 +32,6 @@ function remappedResourceReferences(node, references) {
|
|
|
32
32
|
};
|
|
33
33
|
return Object.fromEntries(Object.entries(remapped).filter(([field, value]) => !isEqual(value, node[field])));
|
|
34
34
|
}
|
|
35
|
-
//#endregion
|
|
36
35
|
export { remappedResourceReferences };
|
|
37
36
|
|
|
38
37
|
//# sourceMappingURL=resources.js.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { createDefaultNode } from "../node-defaults.js";
|
|
2
|
+
import { sharedStyleLayers } from "../shared-styles.js";
|
|
3
|
+
import { heldTransferCollections, variableIdentityReferences } from "./identity.js";
|
|
2
4
|
import { prepareNodeTransfer } from "./nodes.js";
|
|
3
|
-
|
|
4
|
-
//#region src/transfer/validation.ts
|
|
5
|
+
// src/transfer/validation.ts
|
|
5
6
|
/** Revalidate mutable plan references without allocating or registering destination nodes. */
|
|
6
7
|
function validateTransferReferences(target, plan) {
|
|
7
8
|
const nodes = new Map(plan.nodes.map((entry) => [entry.id, createDefaultNode(() => entry.id, entry.type, entry.props)]));
|
|
@@ -14,13 +15,16 @@ function validateTransferReferences(target, plan) {
|
|
|
14
15
|
properties.set(definition.id, definition.id);
|
|
15
16
|
propertyTypes.set(definition.id, definition.type);
|
|
16
17
|
}
|
|
17
|
-
const
|
|
18
|
+
const planCollections = [...plan.collections, ...heldTransferCollections(target, plan)];
|
|
19
|
+
const collections = new Map(planCollections.map((collection) => [collection.id, collection]));
|
|
20
|
+
const heldStyles = sharedStyleLayers(target);
|
|
21
|
+
for (const id of plan.reused.styles) if (!heldStyles.has(id)) throw new Error(`Missing reused transfer style ${id}`);
|
|
18
22
|
const references = {
|
|
19
23
|
nodes: identities,
|
|
20
|
-
styles: new Map([...nodes.values()].flatMap((node) => node.sharedStyleType !== null && node.source.id ? [[node.source.id, node.source.id]] : [])),
|
|
24
|
+
styles: new Map([...plan.reused.styles.map((id) => [id, id]), ...[...nodes.values()].flatMap((node) => node.sharedStyleType !== null && node.source.id ? [[node.source.id, node.source.id]] : [])]),
|
|
21
25
|
properties,
|
|
22
26
|
propertyTypes,
|
|
23
|
-
...variableIdentityReferences(plan.variables, plan.
|
|
27
|
+
...variableIdentityReferences(plan.variables, planCollections, plan.reused.variables)
|
|
24
28
|
};
|
|
25
29
|
for (const node of nodes.values()) {
|
|
26
30
|
prepareNodeTransfer(node, references);
|
|
@@ -33,7 +37,6 @@ function validateTransferReferences(target, plan) {
|
|
|
33
37
|
if (plan.dependencyPageIds.includes(entry.id) && (entry.type !== "CANVAS" || !entry.props.internalOnly || entry.parentId !== target.rootId)) throw new Error(`Invalid transfer dependency page ${entry.id}`);
|
|
34
38
|
}
|
|
35
39
|
}
|
|
36
|
-
//#endregion
|
|
37
40
|
export { validateTransferReferences };
|
|
38
41
|
|
|
39
42
|
//# sourceMappingURL=validation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","names":[],"sources":["../../src/transfer/validation.ts"],"sourcesContent":["import type { SceneGraph } from '../graph'\nimport { createDefaultNode } from '../node-defaults'\nimport type { ComponentPropertyType } from '../types'\nimport type { GraphTransferPlan } from './apply'\nimport { variableIdentityReferences } from './identity'\nimport { prepareNodeTransfer } from './nodes'\n\n/** Revalidate mutable plan references without allocating or registering destination nodes. */\nexport function validateTransferReferences(target: SceneGraph, plan: GraphTransferPlan): void {\n const nodes = new Map(\n plan.nodes.map((entry) => [\n entry.id,\n createDefaultNode(() => entry.id, entry.type, entry.props)\n ])\n )\n const identities = new Map([...nodes.keys()].map((id) => [id, id]))\n const properties = new Map<string, string>()\n const propertyTypes = new Map<string, ComponentPropertyType>()\n for (const node of nodes.values())\n for (const definition of node.componentPropertyDefinitions) {\n const previous = propertyTypes.get(definition.id)\n if (previous && previous !== definition.type)\n throw new Error(`Conflicting transfer property ${definition.id}`)\n properties.set(definition.id, definition.id)\n propertyTypes.set(definition.id, definition.type)\n }\n const collections = new Map(
|
|
1
|
+
{"version":3,"file":"validation.js","names":[],"sources":["../../src/transfer/validation.ts"],"sourcesContent":["import type { SceneGraph } from '../graph'\nimport { createDefaultNode } from '../node-defaults'\nimport { sharedStyleLayers } from '../shared-styles'\nimport type { ComponentPropertyType } from '../types'\nimport type { GraphTransferPlan } from './apply'\nimport { heldTransferCollections, variableIdentityReferences } from './identity'\nimport { prepareNodeTransfer } from './nodes'\n\n/** Revalidate mutable plan references without allocating or registering destination nodes. */\nexport function validateTransferReferences(target: SceneGraph, plan: GraphTransferPlan): void {\n const nodes = new Map(\n plan.nodes.map((entry) => [\n entry.id,\n createDefaultNode(() => entry.id, entry.type, entry.props)\n ])\n )\n const identities = new Map([...nodes.keys()].map((id) => [id, id]))\n const properties = new Map<string, string>()\n const propertyTypes = new Map<string, ComponentPropertyType>()\n for (const node of nodes.values())\n for (const definition of node.componentPropertyDefinitions) {\n const previous = propertyTypes.get(definition.id)\n if (previous && previous !== definition.type)\n throw new Error(`Conflicting transfer property ${definition.id}`)\n properties.set(definition.id, definition.id)\n propertyTypes.set(definition.id, definition.type)\n }\n const planCollections = [...plan.collections, ...heldTransferCollections(target, plan)]\n const collections = new Map(planCollections.map((collection) => [collection.id, collection]))\n const heldStyles = sharedStyleLayers(target)\n for (const id of plan.reused.styles)\n if (!heldStyles.has(id)) throw new Error(`Missing reused transfer style ${id}`)\n const styles = new Map([\n ...plan.reused.styles.map((id) => [id, id] as const),\n ...[...nodes.values()].flatMap((node) =>\n node.sharedStyleType !== null && node.source.id\n ? [[node.source.id, node.source.id] as const]\n : []\n )\n ])\n const references = {\n nodes: identities,\n styles,\n properties,\n propertyTypes,\n ...variableIdentityReferences(plan.variables, planCollections, plan.reused.variables)\n }\n for (const node of nodes.values()) {\n prepareNodeTransfer(node, references)\n for (const [collection, mode] of Object.entries(node.variableModes)) {\n if (!collections.get(collection)?.modes.some((entry) => entry.modeId === mode))\n throw new Error(`Invalid node variable mode ${node.id}`)\n }\n }\n const roots = new Set([...plan.rootIds, ...plan.dependencyPageIds])\n if (roots.size !== plan.rootIds.length + plan.dependencyPageIds.length)\n throw new Error('Repeated transfer root')\n for (const entry of plan.nodes) {\n if (roots.has(entry.id) === nodes.has(entry.parentId))\n throw new Error(`Invalid transfer root topology ${entry.id}`)\n if (\n plan.dependencyPageIds.includes(entry.id) &&\n (entry.type !== 'CANVAS' || !entry.props.internalOnly || entry.parentId !== target.rootId)\n )\n throw new Error(`Invalid transfer dependency page ${entry.id}`)\n }\n}\n"],"mappings":";;;;;;AASA,SAAgB,2BAA2B,QAAoB,MAA+B;CAC5F,MAAM,QAAQ,IAAI,IAChB,KAAK,MAAM,KAAK,UAAU,CACxB,MAAM,IACN,wBAAwB,MAAM,IAAI,MAAM,MAAM,MAAM,KAAK,CAC3D,CAAC,CACH;CACA,MAAM,aAAa,IAAI,IAAI,CAAC,GAAG,MAAM,KAAK,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,E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AAC,EAAE,MAAM,MAAM,UAAU,MAAM,WAAW,IAAI,GAC3E,MAAM,IAAI,MAAM,8BAA8B,KAAK,IAAI;CAE7D;CACA,MAAM,wBAAQ,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS,GAAG,KAAK,iBAAiB,CAAC;CAClE,IAAI,MAAM,SAAS,KAAK,QAAQ,SAAS,KAAK,kBAAkB,QAC9D,MAAM,IAAI,MAAM,wBAAwB;CAC1C,KAAK,MAAM,SAAS,KAAK,OAAO;EAC9B,IAAI,MAAM,IAAI,MAAM,EAAE,MAAM,MAAM,IAAI,MAAM,QAAQ,GAClD,MAAM,IAAI,MAAM,kCAAkC,MAAM,IAAI;EAC9D,IACE,KAAK,kBAAkB,SAAS,MAAM,EAAE,MACvC,MAAM,SAAS,YAAY,CAAC,MAAM,MAAM,gBAAgB,MAAM,aAAa,OAAO,SAEnF,MAAM,IAAI,MAAM,oCAAoC,MAAM,IAAI;CAClE;AACF"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { SceneGraph } from "../graph.js";
|
|
2
2
|
import { Variable, VariableCollection } from "../types.js";
|
|
3
|
-
|
|
4
|
-
interface VariableTransferReferences {
|
|
3
|
+
export interface VariableTransferReferences {
|
|
5
4
|
variables: ReadonlyMap<string, string>;
|
|
6
5
|
collections: ReadonlyMap<string, string>;
|
|
7
6
|
modes: ReadonlyMap<string, string>;
|
|
8
7
|
}
|
|
9
8
|
/** Prepare isolated resource copies; never mutate the source or destination graph. */
|
|
10
|
-
declare function prepareVariableTransfer(variables: readonly Variable[], collections: readonly VariableCollection[], references: VariableTransferReferences): {
|
|
9
|
+
export declare function prepareVariableTransfer(variables: readonly Variable[], collections: readonly VariableCollection[], references: VariableTransferReferences): {
|
|
11
10
|
variables: Variable[];
|
|
12
11
|
collections: VariableCollection[];
|
|
13
12
|
};
|
|
@@ -16,7 +15,5 @@ declare function prepareVariableTransfer(variables: readonly Variable[], collect
|
|
|
16
15
|
* collection comes from the first of its `sources` that has it, and its variables with it; a
|
|
17
16
|
* variable it lacks there comes from the next. A collection keeps only the variables copied.
|
|
18
17
|
*/
|
|
19
|
-
declare function copyVariableTables(target: SceneGraph, ids: ReadonlySet<string>, collectionIds: Iterable<string>, sources: (collectionId: string) => readonly SceneGraph[]): void;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { VariableTransferReferences, copyVariableTables, prepareVariableTransfer };
|
|
18
|
+
export declare function copyVariableTables(target: SceneGraph, ids: ReadonlySet<string>, collectionIds: Iterable<string>, sources: (collectionId: string) => readonly SceneGraph[]): void;
|
|
22
19
|
//# sourceMappingURL=variables.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variables.d.ts","names":[],"sources":["../../src/transfer/variables.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"variables.d.ts","names":[],"sources":["../../src/transfer/variables.ts"],"mappings":";;iBAOiB;EACf,WAAW;EACX,aAAa;EACb,OAAO;;;wBA2CO,wBACd,oBAAoB,YACpB,sBAAsB,sBACtB,YAAY;EACT,WAAW;EAAY,aAAa;;;;;;;wBAyCzB,mBACd,QAAQ,YACR,KAAK,qBACL,eAAe,kBACf,UAAU,kCAAkC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { uniq } from "es-toolkit";
|
|
1
2
|
import { mapVariableValueReferences } from "../variables/value.js";
|
|
2
3
|
import { requireTransferReference } from "./references.js";
|
|
3
|
-
|
|
4
|
-
//#region src/transfer/variables.ts
|
|
4
|
+
// src/transfer/variables.ts
|
|
5
5
|
function assertUniqueMappings(ids, kind) {
|
|
6
6
|
if (new Set(ids.values()).size !== ids.size) throw new Error(`Colliding ${kind} transfer mappings`);
|
|
7
7
|
}
|
|
@@ -16,7 +16,8 @@ function assertResourceOwnership(variables, collections) {
|
|
|
16
16
|
}
|
|
17
17
|
for (const variable of variables) {
|
|
18
18
|
const collection = sets.get(variable.collectionId);
|
|
19
|
-
if (!collection
|
|
19
|
+
if (!collection) throw new Error(`Missing collection membership for ${variable.id}`);
|
|
20
|
+
if (collection.variableIds.includes(variable.id) === !!variable.deleted) throw new Error(variable.deleted ? `Deleted variable ${variable.id} listed in ${collection.id}` : `Missing collection membership for ${variable.id}`);
|
|
20
21
|
const modes = new Set(collection.modes.map((mode) => mode.modeId));
|
|
21
22
|
for (const mode of Object.keys(variable.valuesByMode)) if (!modes.has(mode)) throw new Error(`Unknown mode ${mode} for ${variable.id}`);
|
|
22
23
|
}
|
|
@@ -69,7 +70,6 @@ function copyVariableTables(target, ids, collectionIds, sources) {
|
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
|
-
//#endregion
|
|
73
73
|
export { copyVariableTables, prepareVariableTransfer };
|
|
74
74
|
|
|
75
75
|
//# sourceMappingURL=variables.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variables.js","names":["mapped"],"sources":["../../src/transfer/variables.ts"],"sourcesContent":["import { uniq } from 'es-toolkit'\n\nimport type { SceneGraph } from '../graph'\nimport type { Variable, VariableCollection, VariableValue } from '../types'\nimport { mapVariableValueReferences } from '../variables/value'\nimport { requireTransferReference as mapped } from './references'\n\nexport interface VariableTransferReferences {\n variables: ReadonlyMap<string, string>\n collections: ReadonlyMap<string, string>\n modes: ReadonlyMap<string, string>\n}\n\nfunction assertUniqueMappings(ids: ReadonlyMap<string, string>, kind: string): void {\n if (new Set(ids.values()).size !== ids.size)\n throw new Error(`Colliding ${kind} transfer mappings`)\n}\n\nfunction assertResourceOwnership(\n variables: readonly Variable[],\n collections: readonly VariableCollection[]\n): void {\n const sets = new Map(collections.map((collection) => [collection.id, collection]))\n const tokens = new Map(variables.map((variable) => [variable.id, variable]))\n if (sets.size !== collections.length || tokens.size !== variables.length)\n throw new Error('Duplicate source variable resource')\n for (const collection of collections) {\n const modes = new Set(collection.modes.map((mode) => mode.modeId))\n if (!modes.has(collection.defaultModeId) || modes.size !== collection.modes.length)\n throw new Error(`Invalid modes for collection ${collection.id}`)\n for (const id of collection.variableIds) {\n if (tokens.get(id)?.collectionId !== collection.id)\n throw new Error(`Invalid variable membership ${id} in ${collection.id}`)\n }\n }\n for (const variable of variables) {\n const collection = sets.get(variable.collectionId)\n if (!collection
|
|
1
|
+
{"version":3,"file":"variables.js","names":["mapped"],"sources":["../../src/transfer/variables.ts"],"sourcesContent":["import { uniq } from 'es-toolkit'\n\nimport type { SceneGraph } from '../graph'\nimport type { Variable, VariableCollection, VariableValue } from '../types'\nimport { mapVariableValueReferences } from '../variables/value'\nimport { requireTransferReference as mapped } from './references'\n\nexport interface VariableTransferReferences {\n variables: ReadonlyMap<string, string>\n collections: ReadonlyMap<string, string>\n modes: ReadonlyMap<string, string>\n}\n\nfunction assertUniqueMappings(ids: ReadonlyMap<string, string>, kind: string): void {\n if (new Set(ids.values()).size !== ids.size)\n throw new Error(`Colliding ${kind} transfer mappings`)\n}\n\nfunction assertResourceOwnership(\n variables: readonly Variable[],\n collections: readonly VariableCollection[]\n): void {\n const sets = new Map(collections.map((collection) => [collection.id, collection]))\n const tokens = new Map(variables.map((variable) => [variable.id, variable]))\n if (sets.size !== collections.length || tokens.size !== variables.length)\n throw new Error('Duplicate source variable resource')\n for (const collection of collections) {\n const modes = new Set(collection.modes.map((mode) => mode.modeId))\n if (!modes.has(collection.defaultModeId) || modes.size !== collection.modes.length)\n throw new Error(`Invalid modes for collection ${collection.id}`)\n for (const id of collection.variableIds) {\n if (tokens.get(id)?.collectionId !== collection.id)\n throw new Error(`Invalid variable membership ${id} in ${collection.id}`)\n }\n }\n for (const variable of variables) {\n const collection = sets.get(variable.collectionId)\n if (!collection) throw new Error(`Missing collection membership for ${variable.id}`)\n // A collection lists only its live variables; a deleted one still transfers with its bindings.\n if (collection.variableIds.includes(variable.id) === !!variable.deleted)\n throw new Error(\n variable.deleted\n ? `Deleted variable ${variable.id} listed in ${collection.id}`\n : `Missing collection membership for ${variable.id}`\n )\n const modes = new Set(collection.modes.map((mode) => mode.modeId))\n for (const mode of Object.keys(variable.valuesByMode)) {\n if (!modes.has(mode)) throw new Error(`Unknown mode ${mode} for ${variable.id}`)\n }\n }\n}\n\n/** Prepare isolated resource copies; never mutate the source or destination graph. */\nexport function prepareVariableTransfer(\n variables: readonly Variable[],\n collections: readonly VariableCollection[],\n references: VariableTransferReferences\n): { variables: Variable[]; collections: VariableCollection[] } {\n assertResourceOwnership(variables, collections)\n assertUniqueMappings(references.variables, 'variable')\n assertUniqueMappings(references.collections, 'collection')\n assertUniqueMappings(references.modes, 'mode')\n const value = (input: VariableValue): VariableValue =>\n mapVariableValueReferences(\n input,\n (id) => mapped(references.variables, id, 'variable alias'),\n (id) => references.modes.get(id) ?? id\n )\n return {\n collections: collections.map((collection) => ({\n ...structuredClone(collection),\n id: mapped(references.collections, collection.id, 'collection'),\n defaultModeId: mapped(references.modes, collection.defaultModeId, 'mode'),\n modes: collection.modes.map((mode) => ({\n ...mode,\n modeId: mapped(references.modes, mode.modeId, 'mode')\n })),\n variableIds: collection.variableIds.map((id) => mapped(references.variables, id, 'variable'))\n })),\n variables: variables.map((variable) => ({\n ...structuredClone(variable),\n id: mapped(references.variables, variable.id, 'variable'),\n collectionId: mapped(references.collections, variable.collectionId, 'collection'),\n valuesByMode: Object.fromEntries(\n Object.entries(variable.valuesByMode).map(([mode, input]) => [\n mapped(references.modes, mode, 'mode'),\n value(input)\n ])\n )\n }))\n }\n}\n\n/**\n * Copies the variables `ids` and the collections `collectionIds` into `target`, IDs kept. Each\n * collection comes from the first of its `sources` that has it, and its variables with it; a\n * variable it lacks there comes from the next. A collection keeps only the variables copied.\n */\nexport function copyVariableTables(\n target: SceneGraph,\n ids: ReadonlySet<string>,\n collectionIds: Iterable<string>,\n sources: (collectionId: string) => readonly SceneGraph[]\n): void {\n for (const collectionId of collectionIds) {\n const graphs = sources(collectionId)\n const first = <T>(read: (graph: SceneGraph) => T | undefined): T | undefined =>\n graphs.map(read).find((found) => found !== undefined)\n const collection = first((graph) => graph.variableCollections.get(collectionId))\n if (!collection) continue\n const members = uniq(\n graphs.flatMap((graph) => graph.variableCollections.get(collectionId)?.variableIds ?? [])\n ).filter((id) => ids.has(id))\n target.variableCollections.set(collectionId, {\n ...structuredClone(collection),\n variableIds: members\n })\n for (const id of members) {\n const variable = first((graph) => graph.variables.get(id))\n if (variable) target.variables.set(id, structuredClone(variable))\n }\n }\n}\n"],"mappings":";;;;AAaA,SAAS,qBAAqB,KAAkC,MAAoB;CAClF,IAAI,IAAI,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,SAAS,IAAI,MACrC,MAAM,IAAI,MAAM,aAAa,KAAK,mBAAmB;AACzD;AAEA,SAAS,wBACP,WACA,aACM;CACN,MAAM,OAAO,IAAI,IAAI,YAAY,KAAK,eAAe,CAAC,WAAW,IAAI,UAAU,CAAC,CAAC;CACjF,MAAM,SAAS,IAAI,IAAI,UAAU,KAAK,aAAa,CAAC,SAAS,IAAI,QAAQ,CAAC,CAAC;CAC3E,IAAI,KAAK,SAAS,YAAY,UAAU,OAAO,SAAS,UAAU,QAChE,MAAM,IAAI,MAAM,oCAAoC;CACtD,KAAK,MAAM,cAAc,aAAa;EACpC,MAAM,QAAQ,IAAI,IAAI,WAAW,MAAM,KAAK,SAAS,KAAK,MAAM,CAAC;EACjE,IAAI,CAAC,MAAM,IAAI,WAAW,aAAa,KAAK,MAAM,SAAS,WAAW,MAAM,QAC1E,MAAM,IAAI,MAAM,gCAAgC,WAAW,IAAI;EACjE,KAAK,MAAM,MAAM,WAAW,aAC1B,IAAI,OAAO,IAAI,EAAE,CAAC,EAAE,iBAAiB,WAAW,IAC9C,MAAM,IAAI,MAAM,+BAA+B,GAAG,MAAM,WAAW,IAAI;CAE7E;CACA,KAAK,MAAM,YAAY,WAAW;EAChC,MAAM,aAAa,KAAK,IAAI,SAAS,YAAY;EACjD,IAAI,CAAC,YAAY,MAAM,IAAI,MAAM,qCAAqC,SAAS,IAAI;EAEnF,IAAI,WAAW,YAAY,SAAS,SAAS,EAAE,MAAM,CAAC,CAA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