@open-pencil/scene-graph 0.16.0 → 0.17.0-beta.1
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 +35 -14
- package/dist/arrow-caps.d.ts.map +1 -1
- package/dist/arrow-caps.js +289 -55
- package/dist/arrow-caps.js.map +1 -1
- package/dist/asset-keys.d.ts +17 -0
- package/dist/asset-keys.d.ts.map +1 -0
- package/dist/asset-keys.js.map +1 -0
- package/dist/behaviours/index.d.ts +6 -0
- package/dist/behaviours/index.js +6 -0
- package/dist/behaviours/kinds.d.ts +56 -0
- package/dist/behaviours/kinds.d.ts.map +1 -0
- package/dist/behaviours/kinds.js.map +1 -0
- package/dist/behaviours/layers.d.ts +16 -0
- package/dist/behaviours/layers.d.ts.map +1 -0
- package/dist/behaviours/layers.js +42 -0
- package/dist/behaviours/layers.js.map +1 -0
- package/dist/behaviours/model.d.ts +45 -0
- package/dist/behaviours/model.d.ts.map +1 -0
- package/dist/behaviours/model.js +149 -0
- package/dist/behaviours/model.js.map +1 -0
- package/dist/behaviours/schema.d.ts +114 -0
- package/dist/behaviours/schema.d.ts.map +1 -0
- package/dist/behaviours/schema.js +71 -0
- package/dist/behaviours/schema.js.map +1 -0
- package/dist/behaviours/spec.d.ts +26 -0
- package/dist/behaviours/spec.d.ts.map +1 -0
- package/dist/{chunks/behaviours → behaviours}/spec.js +4 -28
- package/dist/behaviours/spec.js.map +1 -0
- package/dist/bindings.js.map +1 -0
- package/dist/buffered-events.d.ts +21 -0
- package/dist/buffered-events.d.ts.map +1 -0
- package/dist/buffered-events.js.map +1 -0
- package/dist/checkpoint.d.ts +13 -0
- package/dist/checkpoint.d.ts.map +1 -0
- package/dist/checkpoint.js.map +1 -0
- package/dist/clipping.d.ts +31 -0
- package/dist/clipping.d.ts.map +1 -0
- package/dist/clipping.js +125 -0
- package/dist/clipping.js.map +1 -0
- package/dist/color/contrast.d.ts +17 -0
- package/dist/color/contrast.d.ts.map +1 -0
- package/dist/{chunks/color → color}/contrast.js +2 -24
- package/dist/color/contrast.js.map +1 -0
- package/dist/color/index.d.ts +38 -0
- package/dist/color/index.d.ts.map +1 -0
- package/dist/color/index.js +110 -0
- package/dist/color/index.js.map +1 -0
- package/dist/color/management.d.ts +32 -0
- package/dist/color/management.d.ts.map +1 -0
- package/dist/color/management.js +187 -0
- package/dist/color/management.js.map +1 -0
- package/dist/color/normalize.d.ts +6 -0
- package/dist/color/normalize.d.ts.map +1 -0
- package/dist/color/normalize.js +15 -0
- package/dist/color/normalize.js.map +1 -0
- package/dist/color/okhcl.d.ts +33 -0
- package/dist/color/okhcl.d.ts.map +1 -0
- package/dist/color/okhcl.js +146 -0
- package/dist/color/okhcl.js.map +1 -0
- package/dist/color/schema.d.ts +11 -0
- package/dist/color/schema.d.ts.map +1 -0
- package/dist/color/schema.js +13 -0
- package/dist/color/schema.js.map +1 -0
- package/dist/comments/document.d.ts +23 -0
- package/dist/comments/document.d.ts.map +1 -0
- package/dist/{chunks/comments → comments}/document.js +2 -1
- package/dist/comments/document.js.map +1 -0
- package/dist/comments/index.d.ts +6 -0
- package/dist/comments/index.js +6 -0
- package/dist/comments/list.d.ts +25 -0
- package/dist/comments/list.d.ts.map +1 -0
- package/dist/comments/list.js +33 -0
- package/dist/comments/list.js.map +1 -0
- package/dist/comments/merge.d.ts +16 -0
- package/dist/comments/merge.d.ts.map +1 -0
- package/dist/{chunks/comments → comments}/merge.js +1 -1
- package/dist/comments/merge.js.map +1 -0
- package/dist/comments/schema.d.ts +8 -0
- package/dist/comments/schema.d.ts.map +1 -0
- package/dist/comments/schema.js +50 -0
- package/dist/comments/schema.js.map +1 -0
- package/dist/comments/threads.d.ts +59 -0
- package/dist/comments/threads.d.ts.map +1 -0
- package/dist/{chunks/comments/list.js → comments/threads.js} +3 -53
- package/dist/comments/threads.js.map +1 -0
- package/dist/components/exposure.d.ts +24 -0
- package/dist/components/exposure.d.ts.map +1 -0
- package/dist/components/exposure.js +51 -0
- package/dist/components/exposure.js.map +1 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +4 -0
- package/dist/components/properties.d.ts +20 -0
- package/dist/components/properties.d.ts.map +1 -0
- package/dist/components/properties.js +125 -0
- package/dist/components/properties.js.map +1 -0
- package/dist/components/variants.d.ts +27 -0
- package/dist/components/variants.d.ts.map +1 -0
- package/dist/components/variants.js.map +1 -0
- package/dist/connectors/controls.d.ts +34 -0
- package/dist/connectors/controls.d.ts.map +1 -0
- package/dist/connectors/controls.js +196 -0
- package/dist/connectors/controls.js.map +1 -0
- package/dist/connectors/create.d.ts +23 -0
- package/dist/connectors/create.d.ts.map +1 -0
- package/dist/connectors/create.js +33 -0
- package/dist/connectors/create.js.map +1 -0
- package/dist/connectors/elbow.js +191 -0
- package/dist/connectors/elbow.js.map +1 -0
- package/dist/connectors/gaps.d.ts +10 -0
- package/dist/connectors/gaps.d.ts.map +1 -0
- package/dist/connectors/gaps.js +86 -0
- package/dist/connectors/gaps.js.map +1 -0
- package/dist/connectors/hit.d.ts +11 -0
- package/dist/connectors/hit.d.ts.map +1 -0
- package/dist/connectors/hit.js +53 -0
- package/dist/connectors/hit.js.map +1 -0
- package/dist/connectors/index.d.ts +11 -0
- package/dist/connectors/index.js +11 -0
- package/dist/connectors/label.d.ts +32 -0
- package/dist/connectors/label.d.ts.map +1 -0
- package/dist/connectors/label.js +213 -0
- package/dist/connectors/label.js.map +1 -0
- package/dist/connectors/layout.d.ts +46 -0
- package/dist/connectors/layout.d.ts.map +1 -0
- package/dist/connectors/layout.js +234 -0
- package/dist/connectors/layout.js.map +1 -0
- package/dist/connectors/pieces.d.ts +22 -0
- package/dist/connectors/pieces.d.ts.map +1 -0
- package/dist/connectors/pieces.js +159 -0
- package/dist/connectors/pieces.js.map +1 -0
- package/dist/connectors/route.d.ts +23 -0
- package/dist/connectors/route.d.ts.map +1 -0
- package/dist/connectors/route.js +107 -0
- package/dist/connectors/route.js.map +1 -0
- package/dist/connectors/sides.d.ts +23 -0
- package/dist/connectors/sides.d.ts.map +1 -0
- package/dist/connectors/sides.js +98 -0
- package/dist/connectors/sides.js.map +1 -0
- package/dist/connectors/sublayers.d.ts +76 -0
- package/dist/connectors/sublayers.d.ts.map +1 -0
- package/dist/connectors/sublayers.js +208 -0
- package/dist/connectors/sublayers.js.map +1 -0
- package/dist/constants.d.ts +11 -2
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +25 -1
- package/dist/constants.js.map +1 -0
- package/dist/coordinate.d.ts +94 -2
- package/dist/coordinate.d.ts.map +1 -0
- package/dist/coordinate.js +268 -1
- package/dist/coordinate.js.map +1 -0
- package/dist/copy.d.ts +49 -2
- package/dist/copy.d.ts.map +1 -0
- package/dist/copy.js +270 -2
- package/dist/copy.js.map +1 -0
- package/dist/css/grid.d.ts +7 -0
- package/dist/css/grid.d.ts.map +1 -0
- package/dist/{chunks/css → css}/grid.js +2 -33
- package/dist/css/grid.js.map +1 -0
- package/dist/css/index.d.ts +6 -0
- package/dist/css/index.js +6 -0
- package/dist/css/layout.d.ts +17 -0
- package/dist/css/layout.d.ts.map +1 -0
- package/dist/css/layout.js +45 -0
- package/dist/css/layout.js.map +1 -0
- package/dist/css/shadows.d.ts +10 -0
- package/dist/css/shadows.d.ts.map +1 -0
- package/dist/css/shadows.js +64 -0
- package/dist/css/shadows.js.map +1 -0
- package/dist/css/text.d.ts +22 -0
- package/dist/css/text.d.ts.map +1 -0
- package/dist/css/text.js +76 -0
- package/dist/css/text.js.map +1 -0
- package/dist/css/values.d.ts +14 -0
- package/dist/css/values.d.ts.map +1 -0
- package/dist/css/values.js +36 -0
- package/dist/css/values.js.map +1 -0
- package/dist/events.js.map +1 -0
- package/dist/export-format.d.ts +12 -0
- package/dist/export-format.d.ts.map +1 -0
- package/dist/export-format.js +22 -0
- package/dist/export-format.js.map +1 -0
- package/dist/export-scale.d.ts +14 -0
- package/dist/export-scale.d.ts.map +1 -0
- package/dist/export-scale.js +19 -0
- package/dist/export-scale.js.map +1 -0
- package/dist/fields/appearance.d.ts +9 -0
- package/dist/fields/appearance.d.ts.map +1 -0
- package/dist/fields/appearance.js +36 -0
- package/dist/fields/appearance.js.map +1 -0
- package/dist/fields/geometry.d.ts +7 -0
- package/dist/fields/geometry.d.ts.map +1 -0
- package/dist/fields/geometry.js.map +1 -0
- package/dist/fields/index.d.ts +5 -0
- package/dist/fields/index.js +5 -0
- package/dist/fields/layout.d.ts +10 -0
- package/dist/fields/layout.d.ts.map +1 -0
- package/dist/fields/layout.js +49 -0
- package/dist/fields/layout.js.map +1 -0
- package/dist/fields/text.d.ts +11 -0
- package/dist/fields/text.d.ts.map +1 -0
- package/dist/fields/text.js +63 -0
- package/dist/fields/text.js.map +1 -0
- package/dist/fig-compression.d.ts +11 -0
- package/dist/fig-compression.d.ts.map +1 -0
- package/dist/fig-compression.js +15 -0
- package/dist/fig-compression.js.map +1 -0
- package/dist/figjam/index.d.ts +3 -0
- package/dist/figjam/index.js +3 -0
- package/dist/figjam/palette.d.ts +259 -0
- package/dist/figjam/palette.d.ts.map +1 -0
- package/dist/figjam/palette.js +411 -0
- package/dist/figjam/palette.js.map +1 -0
- package/dist/figjam/text.d.ts +70 -0
- package/dist/figjam/text.d.ts.map +1 -0
- package/dist/figjam/text.js +95 -0
- package/dist/figjam/text.js.map +1 -0
- package/dist/font-style.d.ts +46 -0
- package/dist/font-style.d.ts.map +1 -0
- package/dist/font-style.js +127 -0
- package/dist/font-style.js.map +1 -0
- package/dist/generated/index.d.ts +44 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/index.js +58 -0
- package/dist/generated/index.js.map +1 -0
- package/dist/generated/kind.d.ts +27 -0
- package/dist/generated/kind.d.ts.map +1 -0
- package/dist/generated/shape-with-text.d.ts +38 -0
- package/dist/generated/shape-with-text.d.ts.map +1 -0
- package/dist/generated/shape-with-text.js +118 -0
- package/dist/generated/shape-with-text.js.map +1 -0
- package/dist/generated/sticky.d.ts +128 -0
- package/dist/generated/sticky.d.ts.map +1 -0
- package/dist/generated/sticky.js +233 -0
- package/dist/generated/sticky.js.map +1 -0
- package/dist/geometry.d.ts +105 -2
- package/dist/geometry.d.ts.map +1 -0
- package/dist/geometry.js +374 -2
- package/dist/geometry.js.map +1 -0
- package/dist/gradient.d.ts +9 -2
- package/dist/gradient.d.ts.map +1 -1
- package/dist/gradient.js +13 -1
- package/dist/gradient.js.map +1 -1
- package/dist/graph.d.ts +177 -0
- package/dist/graph.d.ts.map +1 -0
- package/dist/graph.js +613 -0
- package/dist/graph.js.map +1 -0
- package/dist/group-bounds.d.ts +42 -0
- package/dist/group-bounds.d.ts.map +1 -0
- package/dist/{chunks/group-bounds.js → group-bounds.js} +56 -14
- package/dist/group-bounds.js.map +1 -0
- package/dist/guides.d.ts +19 -2
- package/dist/guides.d.ts.map +1 -0
- package/dist/guides.js.map +1 -1
- package/dist/hit-test.d.ts +48 -2
- package/dist/hit-test.d.ts.map +1 -0
- package/dist/hit-test.js +34 -29
- package/dist/hit-test.js.map +1 -1
- package/dist/icons/glyph.d.ts +22 -0
- package/dist/icons/glyph.d.ts.map +1 -0
- package/dist/{chunks/icons → icons}/glyph.js +2 -40
- package/dist/icons/glyph.js.map +1 -0
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.js +4 -0
- package/dist/icons/model.d.ts +29 -0
- package/dist/icons/model.d.ts.map +1 -0
- package/dist/icons/model.js +51 -0
- package/dist/icons/model.js.map +1 -0
- package/dist/icons/schema.d.ts +31 -0
- package/dist/icons/schema.d.ts.map +1 -0
- package/dist/icons/schema.js +28 -0
- package/dist/icons/schema.js.map +1 -0
- package/dist/ids.d.ts +12 -0
- package/dist/ids.d.ts.map +1 -0
- package/dist/ids.js +31 -0
- package/dist/ids.js.map +1 -0
- package/dist/images.d.ts +39 -2
- package/dist/images.d.ts.map +1 -0
- package/dist/images.js +67 -9
- package/dist/images.js.map +1 -1
- package/dist/index.d.ts +5 -7
- package/dist/index.js +5 -23
- package/dist/instances/assignments.js +89 -0
- package/dist/instances/assignments.js.map +1 -0
- package/dist/instances/content-size.js +60 -0
- package/dist/instances/content-size.js.map +1 -0
- package/dist/instances/copies.js +161 -0
- package/dist/instances/copies.js.map +1 -0
- package/dist/instances/cycles.d.ts +20 -0
- package/dist/instances/cycles.d.ts.map +1 -0
- package/dist/instances/cycles.js +53 -0
- package/dist/instances/cycles.js.map +1 -0
- package/dist/instances/fields.d.ts +18 -0
- package/dist/instances/fields.d.ts.map +1 -0
- package/dist/instances/fields.js +82 -0
- package/dist/instances/fields.js.map +1 -0
- package/dist/instances/index.d.ts +40 -0
- package/dist/instances/index.d.ts.map +1 -0
- package/dist/instances/index.js +174 -0
- package/dist/instances/index.js.map +1 -0
- package/dist/instances/main-component.d.ts +11 -0
- package/dist/instances/main-component.d.ts.map +1 -0
- package/dist/instances/main-component.js +42 -0
- package/dist/instances/main-component.js.map +1 -0
- package/dist/instances/overrides.d.ts +48 -0
- package/dist/instances/overrides.d.ts.map +1 -0
- package/dist/instances/overrides.js +142 -0
- package/dist/instances/overrides.js.map +1 -0
- package/dist/instances/placement.js +30 -0
- package/dist/instances/placement.js.map +1 -0
- package/dist/instances/source-walk.js +31 -0
- package/dist/instances/source-walk.js.map +1 -0
- package/dist/instances/sync.js +275 -0
- package/dist/instances/sync.js.map +1 -0
- package/dist/instances/vector-geometry.js +70 -0
- package/dist/instances/vector-geometry.js.map +1 -0
- package/dist/layout/aspect-ratio.d.ts +27 -0
- package/dist/layout/aspect-ratio.d.ts.map +1 -0
- package/dist/layout/aspect-ratio.js +45 -0
- package/dist/layout/aspect-ratio.js.map +1 -0
- package/dist/layout/guides.d.ts +25 -0
- package/dist/layout/guides.d.ts.map +1 -0
- package/dist/layout/guides.js +105 -0
- package/dist/layout/guides.js.map +1 -0
- package/dist/layout/index.d.ts +5 -0
- package/dist/{layout.js → layout/index.js} +4 -3
- package/dist/layout/keywords.d.ts +26 -0
- package/dist/layout/keywords.d.ts.map +1 -0
- package/dist/layout/keywords.js +59 -0
- package/dist/layout/keywords.js.map +1 -0
- package/dist/layout/sizing.d.ts +40 -0
- package/dist/layout/sizing.d.ts.map +1 -0
- package/dist/layout/sizing.js +122 -0
- package/dist/layout/sizing.js.map +1 -0
- package/dist/layout/writes.js +55 -0
- package/dist/layout/writes.js.map +1 -0
- package/dist/matrix.d.ts +16 -2
- package/dist/matrix.d.ts.map +1 -0
- package/dist/matrix.js +119 -1
- package/dist/matrix.js.map +1 -0
- package/dist/mutation-impact.d.ts +23 -0
- package/dist/mutation-impact.d.ts.map +1 -0
- package/dist/mutation-impact.js +67 -0
- package/dist/mutation-impact.js.map +1 -0
- package/dist/node-defaults.d.ts +22 -2
- package/dist/node-defaults.d.ts.map +1 -0
- package/dist/node-defaults.js +254 -2
- package/dist/node-defaults.js.map +1 -0
- package/dist/paints/index.d.ts +2 -0
- package/dist/paints/index.js +2 -0
- package/dist/paints/schema.d.ts +77 -0
- package/dist/paints/schema.d.ts.map +1 -0
- package/dist/paints/schema.js +56 -0
- package/dist/paints/schema.js.map +1 -0
- package/dist/parse-path.d.ts +9 -1
- package/dist/parse-path.d.ts.map +1 -1
- package/dist/parse-path.js +39 -2
- package/dist/parse-path.js.map +1 -1
- package/dist/plugin-data/field.d.ts +47 -0
- package/dist/plugin-data/field.d.ts.map +1 -0
- package/dist/plugin-data/field.js +73 -0
- package/dist/plugin-data/field.js.map +1 -0
- package/dist/plugin-data/fields.d.ts +142 -0
- package/dist/plugin-data/fields.d.ts.map +1 -0
- package/dist/plugin-data/fields.js +153 -0
- package/dist/plugin-data/fields.js.map +1 -0
- package/dist/plugin-data/index.d.ts +3 -0
- package/dist/plugin-data/index.js +3 -0
- package/dist/polygon.d.ts +4 -2
- package/dist/polygon.d.ts.map +1 -1
- package/dist/polygon.js +17 -2
- package/dist/polygon.js.map +1 -1
- package/dist/preview.d.ts +12 -2
- package/dist/preview.d.ts.map +1 -0
- package/dist/preview.js +62 -1
- package/dist/preview.js.map +1 -0
- package/dist/{primitives2.d.ts → primitives/index.d.ts} +4 -3
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +2 -0
- package/dist/primitives/schema.d.ts +18 -0
- package/dist/primitives/schema.d.ts.map +1 -0
- package/dist/primitives/schema.js +19 -0
- package/dist/primitives/schema.js.map +1 -0
- package/dist/random.js +24 -1
- package/dist/random.js.map +1 -0
- package/dist/resize.d.ts +6 -4
- package/dist/resize.d.ts.map +1 -1
- package/dist/resize.js +287 -2
- package/dist/resize.js.map +1 -0
- package/dist/scaling/index.d.ts +3 -0
- package/dist/scaling/index.js +3 -0
- package/dist/scaling/node.d.ts +6 -0
- package/dist/scaling/node.d.ts.map +1 -0
- package/dist/scaling/node.js +148 -0
- package/dist/scaling/node.js.map +1 -0
- package/dist/scaling/tree.d.ts +7 -0
- package/dist/scaling/tree.d.ts.map +1 -0
- package/dist/scaling/tree.js +47 -0
- package/dist/scaling/tree.js.map +1 -0
- package/dist/shaders/index.d.ts +4 -0
- package/dist/shaders/index.js +4 -0
- package/dist/shaders/model.d.ts +41 -0
- package/dist/shaders/model.d.ts.map +1 -0
- package/dist/shaders/model.js +71 -0
- package/dist/shaders/model.js.map +1 -0
- package/dist/shaders/schema.d.ts +41 -0
- package/dist/shaders/schema.d.ts.map +1 -0
- package/dist/shaders/schema.js +36 -0
- package/dist/shaders/schema.js.map +1 -0
- package/dist/shaders/still.d.ts +18 -0
- package/dist/shaders/still.d.ts.map +1 -0
- package/dist/shaders/still.js +36 -0
- package/dist/shaders/still.js.map +1 -0
- package/dist/shape-with-text/fit.d.ts +28 -0
- package/dist/shape-with-text/fit.d.ts.map +1 -0
- package/dist/shape-with-text/fit.js +271 -0
- package/dist/shape-with-text/fit.js.map +1 -0
- package/dist/shape-with-text/geometry.d.ts +20 -0
- package/dist/shape-with-text/geometry.d.ts.map +1 -0
- package/dist/shape-with-text/geometry.js +539 -0
- package/dist/shape-with-text/geometry.js.map +1 -0
- package/dist/shape-with-text/index.d.ts +4 -0
- package/dist/shape-with-text/index.js +4 -0
- package/dist/shape-with-text/kinds.d.ts +20 -0
- package/dist/shape-with-text/kinds.d.ts.map +1 -0
- package/dist/shape-with-text/kinds.js +86 -0
- package/dist/shape-with-text/kinds.js.map +1 -0
- package/dist/shared-styles.d.ts +38 -0
- package/dist/shared-styles.d.ts.map +1 -0
- package/dist/shared-styles.js +125 -0
- package/dist/shared-styles.js.map +1 -0
- package/dist/slots/authoring.d.ts +27 -0
- package/dist/slots/authoring.d.ts.map +1 -0
- package/dist/slots/authoring.js +77 -0
- package/dist/slots/authoring.js.map +1 -0
- package/dist/slots/content.d.ts +41 -0
- package/dist/slots/content.d.ts.map +1 -0
- package/dist/slots/content.js +103 -0
- package/dist/slots/content.js.map +1 -0
- package/dist/slots/frames.d.ts +38 -0
- package/dist/slots/frames.d.ts.map +1 -0
- package/dist/slots/frames.js +113 -0
- package/dist/slots/frames.js.map +1 -0
- package/dist/slots/index.d.ts +5 -0
- package/dist/slots/index.js +5 -0
- package/dist/slots/limits.d.ts +14 -0
- package/dist/slots/limits.d.ts.map +1 -0
- package/dist/slots/limits.js +28 -0
- package/dist/slots/limits.js.map +1 -0
- package/dist/snap.d.ts +21 -2
- package/dist/snap.d.ts.map +1 -0
- package/dist/snap.js +109 -1
- package/dist/snap.js.map +1 -0
- package/dist/source-metadata.js +10 -1
- package/dist/source-metadata.js.map +1 -0
- package/dist/statuses/impact.d.ts +18 -0
- package/dist/statuses/impact.d.ts.map +1 -0
- package/dist/statuses/impact.js +33 -0
- package/dist/statuses/impact.js.map +1 -0
- package/dist/statuses/index.d.ts +5 -0
- package/dist/statuses/index.js +5 -0
- package/dist/statuses/node.d.ts +22 -0
- package/dist/statuses/node.d.ts.map +1 -0
- package/dist/statuses/node.js +47 -0
- package/dist/statuses/node.js.map +1 -0
- package/dist/statuses/schema.d.ts +59 -0
- package/dist/statuses/schema.d.ts.map +1 -0
- package/dist/statuses/schema.js +27 -0
- package/dist/statuses/schema.js.map +1 -0
- package/dist/statuses/workflow.d.ts +120 -0
- package/dist/statuses/workflow.d.ts.map +1 -0
- package/dist/statuses/workflow.js +135 -0
- package/dist/statuses/workflow.js.map +1 -0
- package/dist/{text-direction.d.ts → text/direction.d.ts} +2 -2
- package/dist/text/direction.d.ts.map +1 -0
- package/dist/{text-direction.js → text/direction.js} +1 -1
- package/dist/text/direction.js.map +1 -0
- package/dist/text/index.d.ts +7 -0
- package/dist/text/index.js +7 -0
- package/dist/text/lengths.d.ts +19 -0
- package/dist/text/lengths.d.ts.map +1 -0
- package/dist/text/lengths.js +40 -0
- package/dist/text/lengths.js.map +1 -0
- package/dist/text/lists.d.ts +44 -0
- package/dist/text/lists.d.ts.map +1 -0
- package/dist/text/lists.js +100 -0
- package/dist/text/lists.js.map +1 -0
- package/dist/text/overflow.d.ts +11 -0
- package/dist/text/overflow.d.ts.map +1 -0
- package/dist/text/overflow.js +13 -0
- package/dist/text/overflow.js.map +1 -0
- package/dist/text/paragraphs.d.ts +62 -0
- package/dist/text/paragraphs.d.ts.map +1 -0
- package/dist/text/paragraphs.js +166 -0
- package/dist/text/paragraphs.js.map +1 -0
- package/dist/{text-picture.d.ts → text/picture.d.ts} +2 -2
- package/dist/text/picture.d.ts.map +1 -0
- package/dist/text/picture.js +41 -0
- package/dist/text/picture.js.map +1 -0
- package/dist/text/references.d.ts +21 -0
- package/dist/text/references.d.ts.map +1 -0
- package/dist/text/references.js +43 -0
- package/dist/text/references.js.map +1 -0
- package/dist/text/schema.d.ts +10 -0
- package/dist/text/schema.d.ts.map +1 -0
- package/dist/text/schema.js +11 -0
- package/dist/text/schema.js.map +1 -0
- package/dist/transfer/apply.d.ts +9 -0
- package/dist/transfer/apply.d.ts.map +1 -0
- package/dist/transfer/apply.js +65 -0
- package/dist/transfer/apply.js.map +1 -0
- package/dist/transfer/copied.d.ts +14 -0
- package/dist/transfer/copied.d.ts.map +1 -0
- package/dist/transfer/copied.js +52 -0
- package/dist/transfer/copied.js.map +1 -0
- package/dist/transfer/history.d.ts +8 -0
- package/dist/transfer/history.d.ts.map +1 -0
- package/dist/transfer/history.js +32 -0
- package/dist/transfer/history.js.map +1 -0
- package/dist/transfer/identity.js +12 -0
- package/dist/transfer/identity.js.map +1 -0
- package/dist/transfer/index.d.ts +8 -0
- package/dist/transfer/index.js +8 -0
- package/dist/transfer/nodes.d.ts +14 -0
- package/dist/transfer/nodes.d.ts.map +1 -0
- package/dist/transfer/nodes.js +74 -0
- package/dist/transfer/nodes.js.map +1 -0
- package/dist/transfer/plan.d.ts +29 -0
- package/dist/transfer/plan.d.ts.map +1 -0
- package/dist/transfer/plan.js +106 -0
- package/dist/transfer/plan.js.map +1 -0
- package/dist/transfer/references.js +10 -0
- package/dist/transfer/references.js.map +1 -0
- package/dist/transfer/remove.d.ts +8 -0
- package/dist/transfer/remove.d.ts.map +1 -0
- package/dist/transfer/remove.js +34 -0
- package/dist/transfer/remove.js.map +1 -0
- package/dist/transfer/validation.js +39 -0
- package/dist/transfer/validation.js.map +1 -0
- package/dist/transfer/variables.d.ts +15 -0
- package/dist/transfer/variables.d.ts.map +1 -0
- package/dist/transfer/variables.js +52 -0
- package/dist/transfer/variables.js.map +1 -0
- package/dist/types.d.ts +169 -2007
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +89 -2
- package/dist/types.js.map +1 -0
- package/dist/undo.d.ts +93 -2
- package/dist/undo.d.ts.map +1 -0
- package/dist/undo.js +235 -1
- package/dist/undo.js.map +1 -0
- package/dist/variables/bindings.d.ts +60 -0
- package/dist/variables/bindings.d.ts.map +1 -0
- package/dist/variables/bindings.js +224 -0
- package/dist/variables/bindings.js.map +1 -0
- package/dist/variables/corners.d.ts +12 -0
- package/dist/variables/corners.d.ts.map +1 -0
- package/dist/variables/corners.js +38 -0
- package/dist/variables/corners.js.map +1 -0
- package/dist/variables/fields.d.ts +25 -0
- package/dist/variables/fields.d.ts.map +1 -0
- package/dist/variables/fields.js +69 -0
- package/dist/variables/fields.js.map +1 -0
- package/dist/variables/formula/check.d.ts +14 -0
- package/dist/variables/formula/check.d.ts.map +1 -0
- package/dist/variables/formula/check.js +73 -0
- package/dist/variables/formula/check.js.map +1 -0
- package/dist/variables/formula/evaluate.d.ts +7 -0
- package/dist/variables/formula/evaluate.d.ts.map +1 -0
- package/dist/variables/formula/evaluate.js +30 -0
- package/dist/variables/formula/evaluate.js.map +1 -0
- package/dist/variables/formula/index.d.ts +21 -0
- package/dist/variables/formula/index.d.ts.map +1 -0
- package/dist/variables/formula/index.js +77 -0
- package/dist/variables/formula/index.js.map +1 -0
- package/dist/variables/formula/parse.js +141 -0
- package/dist/variables/formula/parse.js.map +1 -0
- package/dist/variables/formula/print.d.ts +25 -0
- package/dist/variables/formula/print.d.ts.map +1 -0
- package/dist/variables/formula/print.js +105 -0
- package/dist/variables/formula/print.js.map +1 -0
- package/dist/variables/formula/schema.d.ts +7 -0
- package/dist/variables/formula/schema.d.ts.map +1 -0
- package/dist/variables/formula/schema.js +62 -0
- package/dist/variables/formula/schema.js.map +1 -0
- package/dist/variables/formula/signatures.d.ts +9 -0
- package/dist/variables/formula/signatures.d.ts.map +1 -0
- package/dist/variables/formula/signatures.js +238 -0
- package/dist/variables/formula/signatures.js.map +1 -0
- package/dist/variables/formula/tokens.d.ts +26 -0
- package/dist/variables/formula/tokens.d.ts.map +1 -0
- package/dist/variables/formula/tokens.js +82 -0
- package/dist/variables/formula/tokens.js.map +1 -0
- package/dist/variables/formula/tree.d.ts +22 -0
- package/dist/variables/formula/tree.d.ts.map +1 -0
- package/dist/variables/formula/tree.js +35 -0
- package/dist/variables/formula/tree.js.map +1 -0
- package/dist/variables/index.d.ts +41 -0
- package/dist/variables/index.d.ts.map +1 -0
- package/dist/variables/index.js +223 -0
- package/dist/variables/index.js.map +1 -0
- package/dist/variables/resolution.d.ts +39 -0
- package/dist/variables/resolution.d.ts.map +1 -0
- package/dist/variables/resolution.js +154 -0
- package/dist/variables/resolution.js.map +1 -0
- package/dist/variables/schema.d.ts +40 -0
- package/dist/variables/schema.d.ts.map +1 -0
- package/dist/variables/schema.js +32 -0
- package/dist/variables/schema.js.map +1 -0
- package/dist/variables/text.d.ts +16 -0
- package/dist/variables/text.d.ts.map +1 -0
- package/dist/variables/text.js +49 -0
- package/dist/variables/text.js.map +1 -0
- package/dist/variables/token.d.ts +18 -0
- package/dist/variables/token.d.ts.map +1 -0
- package/dist/variables/token.js +39 -0
- package/dist/variables/token.js.map +1 -0
- package/dist/variables/units.js +19 -0
- package/dist/variables/units.js.map +1 -0
- package/dist/variables/value.d.ts +12 -0
- package/dist/variables/value.d.ts.map +1 -0
- package/dist/variables/value.js +70 -0
- package/dist/variables/value.js.map +1 -0
- package/dist/vector-network.d.ts +65 -2
- package/dist/vector-network.d.ts.map +1 -0
- package/dist/vector-network.js +375 -2
- package/dist/vector-network.js.map +1 -0
- package/package.json +297 -137
- package/src/arrow-caps.ts +282 -62
- package/src/behaviours/index.ts +5 -0
- package/src/behaviours/layers.ts +1 -1
- package/src/behaviours/model.ts +3 -11
- package/src/behaviours/schema.ts +44 -9
- package/src/behaviours/spec.ts +4 -49
- package/src/checkpoint.ts +1 -1
- package/src/clipping.ts +112 -0
- package/src/color/index.ts +1 -0
- package/src/color/schema.ts +10 -0
- package/src/comments/document.ts +1 -1
- package/src/comments/index.ts +5 -0
- package/src/comments/schema.ts +51 -0
- package/src/comments/threads.ts +1 -1
- package/src/components/exposure.ts +1 -1
- package/src/components/index.ts +8 -0
- package/src/components/properties.ts +2 -2
- package/src/components/variants.ts +1 -1
- package/src/connectors/controls.ts +229 -0
- package/src/connectors/create.ts +48 -0
- package/src/connectors/elbow.ts +235 -0
- package/src/connectors/gaps.ts +72 -0
- package/src/connectors/hit.ts +60 -0
- package/src/connectors/index.ts +28 -0
- package/src/connectors/label.ts +238 -0
- package/src/connectors/layout.ts +280 -0
- package/src/connectors/pieces.ts +144 -0
- package/src/connectors/route.ts +148 -0
- package/src/connectors/sides.ts +94 -0
- package/src/connectors/sublayers.ts +203 -0
- package/src/coordinate.ts +10 -3
- package/src/copy.ts +63 -17
- package/src/css/index.ts +1 -0
- package/src/css/text.ts +84 -0
- package/src/export-format.ts +1 -1
- package/src/fields/appearance.ts +35 -0
- package/src/fields/index.ts +4 -0
- package/src/fields/layout.ts +48 -0
- package/src/fields/text.ts +29 -0
- package/src/fig-compression.ts +9 -0
- package/src/figjam/index.ts +2 -0
- package/src/figjam/palette.ts +445 -0
- package/src/figjam/text.ts +83 -0
- package/src/font-style.ts +58 -14
- package/src/generated/index.ts +76 -0
- package/src/generated/kind.ts +24 -0
- package/src/generated/shape-with-text.ts +131 -0
- package/src/generated/sticky.ts +213 -0
- package/src/geometry.ts +40 -130
- package/src/gradient.ts +14 -0
- package/src/graph.ts +825 -0
- package/src/group-bounds.ts +59 -12
- package/src/guides.ts +1 -1
- package/src/hit-test.ts +52 -21
- package/src/icons/index.ts +3 -0
- package/src/icons/model.ts +9 -0
- package/src/icons/schema.ts +19 -3
- package/src/ids.ts +34 -0
- package/src/images.ts +71 -8
- package/src/index.ts +2 -976
- package/src/instances/assignments.ts +116 -0
- package/src/instances/content-size.ts +23 -2
- package/src/instances/copies.ts +7 -10
- package/src/instances/cycles.ts +1 -1
- package/src/instances/fields.ts +39 -92
- package/src/{instances.ts → instances/index.ts} +13 -15
- package/src/instances/main-component.ts +43 -1
- package/src/{instance-overrides.ts → instances/overrides.ts} +31 -1
- package/src/instances/placement.ts +1 -1
- package/src/instances/source-walk.ts +3 -9
- package/src/instances/sync.ts +30 -140
- package/src/instances/vector-geometry.ts +3 -3
- package/src/layout/aspect-ratio.ts +1 -1
- package/src/layout/sizing.ts +1 -1
- package/src/layout/writes.ts +59 -0
- package/src/matrix.ts +1 -1
- package/src/mutation-impact.ts +1 -1
- package/src/node-defaults.ts +41 -2
- package/src/paints/index.ts +1 -0
- package/src/paints/schema.ts +67 -0
- package/src/parse-path.ts +49 -4
- package/src/plugin-data/fields.ts +54 -75
- package/src/plugin-data/index.ts +2 -0
- package/src/polygon.ts +17 -0
- package/src/preview.ts +1 -1
- package/src/{primitives.ts → primitives/index.ts} +2 -0
- package/src/primitives/schema.ts +14 -0
- package/src/resize.ts +32 -6
- package/src/scaling/node.ts +10 -6
- package/src/scaling/tree.ts +2 -1
- package/src/shaders/index.ts +3 -0
- package/src/shaders/schema.ts +3 -3
- package/src/shape-with-text/fit.ts +154 -0
- package/src/shape-with-text/geometry.ts +496 -0
- package/src/shape-with-text/index.ts +10 -0
- package/src/shape-with-text/kinds.ts +86 -0
- package/src/shared-styles.ts +89 -18
- package/src/slots/authoring.ts +1 -1
- package/src/slots/content.ts +8 -5
- package/src/slots/frames.ts +3 -3
- package/src/slots/index.ts +4 -0
- package/src/slots/limits.ts +1 -1
- package/src/snap.ts +3 -1
- package/src/statuses/impact.ts +38 -0
- package/src/statuses/index.ts +4 -0
- package/src/statuses/node.ts +63 -0
- package/src/statuses/schema.ts +39 -0
- package/src/statuses/workflow.ts +121 -0
- package/src/text/index.ts +3 -0
- package/src/text/lengths.ts +34 -0
- package/src/text/overflow.ts +12 -0
- package/src/text/schema.ts +7 -0
- package/src/transfer/apply.ts +1 -1
- package/src/transfer/copied.ts +72 -0
- package/src/transfer/history.ts +1 -1
- package/src/transfer/index.ts +1 -0
- package/src/transfer/nodes.ts +11 -14
- package/src/transfer/plan.ts +1 -1
- package/src/transfer/remove.ts +1 -1
- package/src/transfer/validation.ts +1 -1
- package/src/transfer/variables.ts +7 -6
- package/src/types.ts +218 -13
- package/src/undo.ts +64 -2
- package/src/variables/bindings.ts +44 -55
- package/src/variables/corners.ts +39 -0
- package/src/variables/fields.ts +38 -0
- package/src/variables/formula/check.ts +99 -0
- package/src/variables/formula/evaluate.ts +33 -0
- package/src/variables/formula/index.ts +129 -0
- package/src/variables/formula/parse.ts +160 -0
- package/src/variables/formula/print.ts +167 -0
- package/src/variables/formula/schema.ts +77 -0
- package/src/variables/formula/signatures.ts +266 -0
- package/src/variables/formula/tokens.ts +114 -0
- package/src/variables/formula/tree.ts +53 -0
- package/src/{variables.ts → variables/index.ts} +52 -145
- package/src/variables/resolution.ts +293 -0
- package/src/variables/schema.ts +31 -0
- package/src/variables/text.ts +51 -0
- package/src/variables/token.ts +27 -1
- package/src/variables/value.ts +92 -0
- package/src/vector-network.ts +263 -22
- package/dist/chunks/asset-keys.js.map +0 -1
- package/dist/chunks/behaviours/kinds.js.map +0 -1
- package/dist/chunks/behaviours/layers.js +0 -611
- package/dist/chunks/behaviours/layers.js.map +0 -1
- package/dist/chunks/behaviours/spec.js.map +0 -1
- package/dist/chunks/bindings.js.map +0 -1
- package/dist/chunks/buffered-events.js.map +0 -1
- package/dist/chunks/checkpoint.js.map +0 -1
- package/dist/chunks/color/contrast.js.map +0 -1
- package/dist/chunks/color/index.js +0 -1662
- package/dist/chunks/color/index.js.map +0 -1
- package/dist/chunks/comments/document.js.map +0 -1
- package/dist/chunks/comments/list.js.map +0 -1
- package/dist/chunks/comments/merge.js.map +0 -1
- package/dist/chunks/components/exposure.js +0 -2291
- package/dist/chunks/components/exposure.js.map +0 -1
- package/dist/chunks/components/variants.js.map +0 -1
- package/dist/chunks/coordinate.js +0 -385
- package/dist/chunks/coordinate.js.map +0 -1
- package/dist/chunks/css/grid.js.map +0 -1
- package/dist/chunks/css/index.js +0 -160
- package/dist/chunks/css/index.js.map +0 -1
- package/dist/chunks/events.js.map +0 -1
- package/dist/chunks/fields/geometry.js.map +0 -1
- package/dist/chunks/font-style.js +0 -96
- package/dist/chunks/font-style.js.map +0 -1
- package/dist/chunks/group-bounds.js.map +0 -1
- package/dist/chunks/icons/glyph.js.map +0 -1
- package/dist/chunks/index.js +0 -2430
- package/dist/chunks/index.js.map +0 -1
- package/dist/color.d.ts +0 -78
- package/dist/color.d.ts.map +0 -1
- package/dist/color.js +0 -3
- package/dist/constants2.d.ts +0 -11
- package/dist/constants2.d.ts.map +0 -1
- package/dist/css.d.ts +0 -39
- package/dist/css.d.ts.map +0 -1
- package/dist/css.js +0 -3
- package/dist/images2.d.ts +0 -16
- package/dist/images2.d.ts.map +0 -1
- package/dist/instances.d.ts +0 -2
- package/dist/instances.js +0 -2
- package/dist/layout.d.ts +0 -2
- package/dist/matrix2.d.ts +0 -16
- package/dist/matrix2.d.ts.map +0 -1
- package/dist/primitives.d.ts +0 -2
- package/dist/primitives.js +0 -0
- package/dist/primitives2.d.ts.map +0 -1
- package/dist/text-direction.d.ts.map +0 -1
- package/dist/text-direction.js.map +0 -1
- package/dist/text-picture.d.ts.map +0 -1
- package/dist/text-picture.js +0 -2
- package/dist/text.d.ts +0 -2
- package/dist/text.js +0 -3
- package/dist/types2.d.ts +0 -2
- package/dist/undo2.d.ts +0 -73
- package/dist/undo2.d.ts.map +0 -1
- package/dist/variables.d.ts +0 -2
- package/dist/variables.js +0 -2
- /package/dist/{chunks/asset-keys.js → asset-keys.js} +0 -0
- /package/dist/{chunks/behaviours → behaviours}/kinds.js +0 -0
- /package/dist/{chunks/bindings.js → bindings.js} +0 -0
- /package/dist/{chunks/buffered-events.js → buffered-events.js} +0 -0
- /package/dist/{chunks/checkpoint.js → checkpoint.js} +0 -0
- /package/dist/{chunks/components → components}/variants.js +0 -0
- /package/dist/{chunks/events.js → events.js} +0 -0
- /package/dist/{chunks/fields → fields}/geometry.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.d.ts","names":[],"sources":["../../src/transfer/history.ts"],"mappings":";;;;iBAKgB,wBACd,OAAO,YACP,UAAU,oBACT"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { cloneNodeProps } from "../copy.js";
|
|
2
|
+
//#region src/transfer/history.ts
|
|
3
|
+
/** Capture post-placement state for redo; this does not authorize deleting shared resources. */
|
|
4
|
+
function captureTransferredState(graph, original) {
|
|
5
|
+
const requireValue = (value, kind, id) => {
|
|
6
|
+
if (value === void 0) throw new Error(`Missing transferred ${kind} ${id}`);
|
|
7
|
+
return value;
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
nodeIds: new Map(original.nodeIds),
|
|
11
|
+
rootIds: [...original.rootIds],
|
|
12
|
+
dependencyPageIds: [...original.dependencyPageIds],
|
|
13
|
+
nodes: original.nodes.map((entry) => {
|
|
14
|
+
const node = requireValue(graph.getNode(entry.id), "node", entry.id);
|
|
15
|
+
if (!node.parentId) throw new Error(`Missing transferred parent ${entry.id}`);
|
|
16
|
+
return {
|
|
17
|
+
id: node.id,
|
|
18
|
+
type: node.type,
|
|
19
|
+
parentId: node.parentId,
|
|
20
|
+
props: cloneNodeProps(node, null)
|
|
21
|
+
};
|
|
22
|
+
}),
|
|
23
|
+
variables: original.variables.map((variable) => structuredClone(requireValue(graph.variables.get(variable.id), "variable", variable.id))),
|
|
24
|
+
collections: original.collections.map((collection) => structuredClone(requireValue(graph.variableCollections.get(collection.id), "collection", collection.id))),
|
|
25
|
+
activeModes: new Map(original.collections.map((collection) => [collection.id, requireValue(graph.activeMode.get(collection.id), "active mode", collection.id)])),
|
|
26
|
+
images: new Map([...original.images.keys()].map((hash) => [hash, requireValue(graph.images.get(hash), "image", hash).slice()]))
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { captureTransferredState };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.js","names":[],"sources":["../../src/transfer/history.ts"],"sourcesContent":["import { cloneNodeProps } from '../copy'\nimport type { SceneGraph } from '../graph'\nimport type { GraphTransferPlan } from './apply'\n\n/** Capture post-placement state for redo; this does not authorize deleting shared resources. */\nexport function captureTransferredState(\n graph: SceneGraph,\n original: GraphTransferPlan\n): GraphTransferPlan {\n const requireValue = <T>(value: T | undefined, kind: string, id: string): T => {\n if (value === undefined) throw new Error(`Missing transferred ${kind} ${id}`)\n return value\n }\n return {\n nodeIds: new Map(original.nodeIds),\n rootIds: [...original.rootIds],\n dependencyPageIds: [...original.dependencyPageIds],\n nodes: original.nodes.map((entry) => {\n const node = requireValue(graph.getNode(entry.id), 'node', entry.id)\n if (!node.parentId) throw new Error(`Missing transferred parent ${entry.id}`)\n return {\n id: node.id,\n type: node.type,\n parentId: node.parentId,\n props: cloneNodeProps(node, null)\n }\n }),\n variables: original.variables.map((variable) =>\n structuredClone(requireValue(graph.variables.get(variable.id), 'variable', variable.id))\n ),\n collections: original.collections.map((collection) =>\n structuredClone(\n requireValue(graph.variableCollections.get(collection.id), 'collection', collection.id)\n )\n ),\n activeModes: new Map(\n original.collections.map((collection) => [\n collection.id,\n requireValue(graph.activeMode.get(collection.id), 'active mode', collection.id)\n ])\n ),\n images: new Map(\n [...original.images.keys()].map((hash) => [\n hash,\n requireValue(graph.images.get(hash), 'image', hash).slice()\n ])\n )\n }\n}\n"],"mappings":";;;AAKA,SAAgB,wBACd,OACA,UACmB;CACnB,MAAM,gBAAmB,OAAsB,MAAc,OAAkB;EAC7E,IAAI,UAAU,KAAA,GAAW,MAAM,IAAI,MAAM,uBAAuB,KAAK,GAAG,IAAI;EAC5E,OAAO;CACT;CACA,OAAO;EACL,SAAS,IAAI,IAAI,SAAS,OAAO;EACjC,SAAS,CAAC,GAAG,SAAS,OAAO;EAC7B,mBAAmB,CAAC,GAAG,SAAS,iBAAiB;EACjD,OAAO,SAAS,MAAM,KAAK,UAAU;GACnC,MAAM,OAAO,aAAa,MAAM,QAAQ,MAAM,EAAE,GAAG,QAAQ,MAAM,EAAE;GACnE,IAAI,CAAC,KAAK,UAAU,MAAM,IAAI,MAAM,8BAA8B,MAAM,IAAI;GAC5E,OAAO;IACL,IAAI,KAAK;IACT,MAAM,KAAK;IACX,UAAU,KAAK;IACf,OAAO,eAAe,MAAM,IAAI;GAClC;EACF,CAAC;EACD,WAAW,SAAS,UAAU,KAAK,aACjC,gBAAgB,aAAa,MAAM,UAAU,IAAI,SAAS,EAAE,GAAG,YAAY,SAAS,EAAE,CAAC,CACzF;EACA,aAAa,SAAS,YAAY,KAAK,eACrC,gBACE,aAAa,MAAM,oBAAoB,IAAI,WAAW,EAAE,GAAG,cAAc,WAAW,EAAE,CACxF,CACF;EACA,aAAa,IAAI,IACf,SAAS,YAAY,KAAK,eAAe,CACvC,WAAW,IACX,aAAa,MAAM,WAAW,IAAI,WAAW,EAAE,GAAG,eAAe,WAAW,EAAE,CAChF,CAAC,CACH;EACA,QAAQ,IAAI,IACV,CAAC,GAAG,SAAS,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,CACxC,MACA,aAAa,MAAM,OAAO,IAAI,IAAI,GAAG,SAAS,IAAI,CAAC,CAAC,MAAM,CAC5D,CAAC,CACH;CACF;AACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/transfer/identity.ts
|
|
2
|
+
function variableIdentityReferences(variables, collections) {
|
|
3
|
+
return {
|
|
4
|
+
variables: new Map(variables.map((variable) => [variable.id, variable.id])),
|
|
5
|
+
collections: new Map(collections.map((collection) => [collection.id, collection.id])),
|
|
6
|
+
modes: new Map(collections.flatMap((collection) => collection.modes.map((mode) => [mode.modeId, mode.modeId])))
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { variableIdentityReferences };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.js","names":[],"sources":["../../src/transfer/identity.ts"],"sourcesContent":["import type { Variable, VariableCollection } from '../types'\n\nexport function variableIdentityReferences(\n variables: readonly Variable[],\n collections: readonly VariableCollection[]\n) {\n return {\n variables: new Map(variables.map((variable) => [variable.id, variable.id])),\n collections: new Map(collections.map((collection) => [collection.id, collection.id])),\n modes: new Map(\n collections.flatMap((collection) =>\n collection.modes.map((mode) => [mode.modeId, mode.modeId] as const)\n )\n )\n }\n}\n"],"mappings":";AAEA,SAAgB,2BACd,WACA,aACA;CACA,OAAO;EACL,WAAW,IAAI,IAAI,UAAU,KAAK,aAAa,CAAC,SAAS,IAAI,SAAS,EAAE,CAAC,CAAC;EAC1E,aAAa,IAAI,IAAI,YAAY,KAAK,eAAe,CAAC,WAAW,IAAI,WAAW,EAAE,CAAC,CAAC;EACpF,OAAO,IAAI,IACT,YAAY,SAAS,eACnB,WAAW,MAAM,KAAK,SAAS,CAAC,KAAK,QAAQ,KAAK,MAAM,CAAU,CACpE,CACF;CACF;AACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GraphTransferInput, prepareGraphTransfer } from "./plan.js";
|
|
2
|
+
import { GraphTransferPlan, applyGraphTransfer } from "./apply.js";
|
|
3
|
+
import { removeGraphTransfer } from "./remove.js";
|
|
4
|
+
import { captureTransferredState } from "./history.js";
|
|
5
|
+
import { VariableTransferReferences, prepareVariableTransfer } from "./variables.js";
|
|
6
|
+
import { NodeTransferReferences, prepareNodeTransfer } from "./nodes.js";
|
|
7
|
+
import { remapCopiedReferences } from "./copied.js";
|
|
8
|
+
export { type GraphTransferInput, type GraphTransferPlan, type NodeTransferReferences, type VariableTransferReferences, applyGraphTransfer, captureTransferredState, prepareGraphTransfer, prepareNodeTransfer, prepareVariableTransfer, remapCopiedReferences, removeGraphTransfer };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { prepareNodeTransfer } from "./nodes.js";
|
|
2
|
+
import { removeGraphTransfer } from "./remove.js";
|
|
3
|
+
import { captureTransferredState } from "./history.js";
|
|
4
|
+
import { prepareVariableTransfer } from "./variables.js";
|
|
5
|
+
import { applyGraphTransfer } from "./apply.js";
|
|
6
|
+
import { prepareGraphTransfer } from "./plan.js";
|
|
7
|
+
import { remapCopiedReferences } from "./copied.js";
|
|
8
|
+
export { applyGraphTransfer, captureTransferredState, prepareGraphTransfer, prepareNodeTransfer, prepareVariableTransfer, remapCopiedReferences, removeGraphTransfer };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentPropertyType, SceneNode } from "../types.js";
|
|
2
|
+
import { VariableTransferReferences } from "./variables.js";
|
|
3
|
+
//#region src/transfer/nodes.d.ts
|
|
4
|
+
interface NodeTransferReferences extends VariableTransferReferences {
|
|
5
|
+
nodes: ReadonlyMap<string, string>;
|
|
6
|
+
styles: ReadonlyMap<string, string>;
|
|
7
|
+
properties: ReadonlyMap<string, string>;
|
|
8
|
+
propertyTypes: ReadonlyMap<string, ComponentPropertyType>;
|
|
9
|
+
}
|
|
10
|
+
/** Prepare runtime references without rewriting original format identities or ordinary text. */
|
|
11
|
+
declare function prepareNodeTransfer(source: SceneNode, refs: NodeTransferReferences): Partial<SceneNode>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { NodeTransferReferences, prepareNodeTransfer };
|
|
14
|
+
//# sourceMappingURL=nodes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodes.d.ts","names":[],"sources":["../../src/transfer/nodes.ts"],"mappings":";;;UAsCiB,+BAA+B;EAC9C,OAAO;EACP,QAAQ;EACR,YAAY;EACZ,eAAe,oBAAoB;;;iBAIrB,oBACd,QAAQ,WACR,MAAM,yBACL,QAAQ"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { overriddenBindingField, remapInstanceOverrideState } from "../instances/overrides.js";
|
|
2
|
+
import { cloneNodeProps } from "../copy.js";
|
|
3
|
+
import { remapStyleRunReferences, styleRunReferences } from "../text/references.js";
|
|
4
|
+
import { referencedStyleIds } from "../shared-styles.js";
|
|
5
|
+
import { requireTransferReference } from "./references.js";
|
|
6
|
+
//#region src/transfer/nodes.ts
|
|
7
|
+
function semanticTransferReferences(node) {
|
|
8
|
+
const runs = styleRunReferences(node.styleRuns);
|
|
9
|
+
return [
|
|
10
|
+
...node.componentId ? [node.componentId] : [],
|
|
11
|
+
...Object.values(node.boundVariables),
|
|
12
|
+
...runs.variables,
|
|
13
|
+
...referencedStyleIds(node),
|
|
14
|
+
...Object.entries(node.componentPropertyAssignments).flatMap(([id, value]) => [id, value]),
|
|
15
|
+
...node.componentPropertyReferences.map((reference) => reference.propertyId),
|
|
16
|
+
...node.componentPropertyDefinitions.flatMap((definition) => [definition.id, ...definition.type === "INSTANCE_SWAP" && definition.defaultValue ? [definition.defaultValue] : []]),
|
|
17
|
+
...node.instanceOverrides.descendants.keys(),
|
|
18
|
+
...[...node.instanceOverrides.self, ...[...node.instanceOverrides.descendants.values()].flatMap((fields) => [...fields])].flatMap(([field, value]) => typeof value === "string" && (field === "componentId" || field === "sourceComponentId" || overriddenBindingField(field) !== null) ? [value] : [])
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
/** Prepare runtime references without rewriting original format identities or ordinary text. */
|
|
22
|
+
function prepareNodeTransfer(source, refs) {
|
|
23
|
+
const node = (id) => requireTransferReference(refs.nodes, id, "node");
|
|
24
|
+
const variable = (id) => requireTransferReference(refs.variables, id, "variable");
|
|
25
|
+
const property = (id) => requireTransferReference(refs.properties, id, "property");
|
|
26
|
+
const style = (id) => requireTransferReference(refs.styles, id, "style");
|
|
27
|
+
const propertyValue = (id, value) => {
|
|
28
|
+
const type = refs.propertyTypes.get(id);
|
|
29
|
+
if (!type) throw new Error(`Missing property transfer type: ${id}`);
|
|
30
|
+
return type === "INSTANCE_SWAP" && value ? node(value) : value;
|
|
31
|
+
};
|
|
32
|
+
const values = (entries) => Object.fromEntries(Object.entries(entries).map(([id, value]) => [property(id), propertyValue(id, value)]));
|
|
33
|
+
const result = cloneNodeProps(source, null);
|
|
34
|
+
result.componentId = source.componentId ? node(source.componentId) : null;
|
|
35
|
+
result.instanceOverrides = remapInstanceOverrideState(source.instanceOverrides, {
|
|
36
|
+
node,
|
|
37
|
+
variable
|
|
38
|
+
});
|
|
39
|
+
result.boundVariables = Object.fromEntries(Object.entries(source.boundVariables).map(([field, id]) => [field, variable(id)]));
|
|
40
|
+
result.variableModes = Object.fromEntries(Object.entries(source.variableModes).map(([collection, mode]) => [requireTransferReference(refs.collections, collection, "collection"), requireTransferReference(refs.modes, mode, "mode")]));
|
|
41
|
+
for (const field of [
|
|
42
|
+
"fillStyleId",
|
|
43
|
+
"strokeStyleId",
|
|
44
|
+
"textStyleId",
|
|
45
|
+
"effectStyleId",
|
|
46
|
+
"gridStyleId"
|
|
47
|
+
]) result[field] = source[field] ? style(source[field]) : null;
|
|
48
|
+
if (result.styleRuns) result.styleRuns = remapStyleRunReferences(result.styleRuns, {
|
|
49
|
+
variable,
|
|
50
|
+
style,
|
|
51
|
+
node: (id) => refs.nodes.get(id) ?? id
|
|
52
|
+
});
|
|
53
|
+
for (const field of ["connectorStart", "connectorEnd"]) {
|
|
54
|
+
const endpoint = result[field];
|
|
55
|
+
if (endpoint?.nodeId) endpoint.nodeId = refs.nodes.get(endpoint.nodeId) ?? endpoint.nodeId;
|
|
56
|
+
}
|
|
57
|
+
for (const region of result.vectorNetwork?.regions ?? []) if (region.fillStyleId) region.fillStyleId = style(region.fillStyleId);
|
|
58
|
+
result.componentPropertyDefinitions = source.componentPropertyDefinitions.map((definition) => ({
|
|
59
|
+
...structuredClone(definition),
|
|
60
|
+
id: property(definition.id),
|
|
61
|
+
defaultValue: propertyValue(definition.id, definition.defaultValue)
|
|
62
|
+
}));
|
|
63
|
+
result.componentPropertyReferences = source.componentPropertyReferences.map((reference) => ({
|
|
64
|
+
...reference,
|
|
65
|
+
propertyId: property(reference.propertyId)
|
|
66
|
+
}));
|
|
67
|
+
result.componentPropertyAssignments = values(source.componentPropertyAssignments);
|
|
68
|
+
result.componentPropertyValues = { ...source.componentPropertyValues };
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
export { prepareNodeTransfer, semanticTransferReferences };
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=nodes.js.map
|
|
@@ -0,0 +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 { remapStyleRunReferences, styleRunReferences } from '../text/references'\nimport type { ComponentPropertyType, SceneNode } from '../types'\nimport { requireTransferReference as required } from './references'\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 })\n result.boundVariables = Object.fromEntries(\n Object.entries(source.boundVariables).map(([field, id]) => [field, variable(id)])\n )\n result.variableModes = Object.fromEntries(\n Object.entries(source.variableModes).map(([collection, mode]) => [\n required(refs.collections, collection, 'collection'),\n required(refs.modes, mode, 'mode')\n ])\n )\n for (const field of [\n 'fillStyleId',\n 'strokeStyleId',\n 'textStyleId',\n 'effectStyleId',\n 'gridStyleId'\n ] as const) {\n result[field] = source[field] ? style(source[field]) : null\n }\n if (result.styleRuns) {\n // A link to a layer the transfer leaves behind keeps naming it.\n result.styleRuns = remapStyleRunReferences(result.styleRuns, {\n variable,\n style,\n node: (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 for (const region of result.vectorNetwork?.regions ?? [])\n if (region.fillStyleId) region.fillStyleId = style(region.fillStyleId)\n result.componentPropertyDefinitions = source.componentPropertyDefinitions.map((definition) => ({\n ...structuredClone(definition),\n id: property(definition.id),\n defaultValue: propertyValue(definition.id, definition.defaultValue)\n }))\n result.componentPropertyReferences = source.componentPropertyReferences.map((reference) => ({\n ...reference,\n propertyId: property(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":";;;;;;AAQA,SAAgB,2BAA2B,MAA2B;CACpE,MAAM,OAAO,mBAAmB,KAAK,SAAS;CAC9C,OAAO;EACL,GAAI,KAAK,cAAc,CAAC,KAAK,WAAW,IAAI,CAAC;EAC7C,GAAG,OAAO,OAAO,KAAK,cAAc;EACpC,GAAG,KA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AAS,UAAU,UAAU;CAC3C,EAAE;CACF,OAAO,+BAA+B,OAAO,OAAO,4BAA4B;CAEhF,OAAO,0BAA0B,EAAE,GAAG,OAAO,wBAAwB;CACrE,OAAO;AACT"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SceneGraph } from "../graph.js";
|
|
2
|
+
import { NodeType, SceneNode, Variable, VariableCollection } from "../types.js";
|
|
3
|
+
//#region src/transfer/plan.d.ts
|
|
4
|
+
interface GraphTransferInput {
|
|
5
|
+
source: SceneGraph;
|
|
6
|
+
rootIds: readonly string[];
|
|
7
|
+
dependencyPageIds: readonly string[];
|
|
8
|
+
target: SceneGraph;
|
|
9
|
+
parentId: string;
|
|
10
|
+
}
|
|
11
|
+
/** Preflight a self-contained fragment; allocation does not insert anything into the target. */
|
|
12
|
+
declare function prepareGraphTransfer(input: GraphTransferInput): {
|
|
13
|
+
activeModes: Map<string, string>;
|
|
14
|
+
images: Map<string, Uint8Array<ArrayBuffer>>;
|
|
15
|
+
variables: Variable[];
|
|
16
|
+
collections: VariableCollection[];
|
|
17
|
+
nodeIds: Map<string, string>;
|
|
18
|
+
rootIds: string[];
|
|
19
|
+
dependencyPageIds: string[];
|
|
20
|
+
nodes: {
|
|
21
|
+
id: string;
|
|
22
|
+
type: NodeType;
|
|
23
|
+
parentId: string;
|
|
24
|
+
props: Partial<SceneNode>;
|
|
25
|
+
}[];
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { GraphTransferInput, prepareGraphTransfer };
|
|
29
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.d.ts","names":[],"sources":["../../src/transfer/plan.ts"],"mappings":";;;UAMiB;EACf,QAAQ;EACR;EACA;EACA,QAAQ;EACR;;;iBAgBc,qBAAqB,OAAO"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { requireTransferReference } from "./references.js";
|
|
2
|
+
import { prepareNodeTransfer } from "./nodes.js";
|
|
3
|
+
import { prepareVariableTransfer } from "./variables.js";
|
|
4
|
+
//#region src/transfer/plan.ts
|
|
5
|
+
/** A transferred style's props under the ID the transfer gives it. */
|
|
6
|
+
function withStyleId(node, props, styles) {
|
|
7
|
+
const id = node.sharedStyleType !== null && node.source.id ? styles.get(node.source.id) : void 0;
|
|
8
|
+
if (!id || id === node.source.id) return props;
|
|
9
|
+
return {
|
|
10
|
+
...props,
|
|
11
|
+
source: {
|
|
12
|
+
...props.source ?? node.source,
|
|
13
|
+
id
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/** Preflight a self-contained fragment; allocation does not insert anything into the target. */
|
|
18
|
+
function prepareGraphTransfer(input) {
|
|
19
|
+
const { source, target, parentId } = input;
|
|
20
|
+
if (!target.getNode(parentId)) throw new Error(`Missing transfer parent ${parentId}`);
|
|
21
|
+
const reserved = /* @__PURE__ */ new Set([
|
|
22
|
+
...target.nodes.keys(),
|
|
23
|
+
...target.variables.keys(),
|
|
24
|
+
...target.variableCollections.keys()
|
|
25
|
+
]);
|
|
26
|
+
for (const collection of target.variableCollections.values()) for (const mode of collection.modes) reserved.add(mode.modeId);
|
|
27
|
+
let sequence = 0;
|
|
28
|
+
const namespace = crypto.randomUUID();
|
|
29
|
+
const allocate = () => {
|
|
30
|
+
let id = `${namespace}:${sequence++}`;
|
|
31
|
+
while (reserved.has(id)) id = `${namespace}:${sequence++}`;
|
|
32
|
+
reserved.add(id);
|
|
33
|
+
return id;
|
|
34
|
+
};
|
|
35
|
+
const ordered = [];
|
|
36
|
+
const seen = /* @__PURE__ */ new Set();
|
|
37
|
+
const visit = (id) => {
|
|
38
|
+
if (seen.has(id)) throw new Error(`Repeated transfer node ${id}`);
|
|
39
|
+
const node = source.getNode(id);
|
|
40
|
+
if (!node) throw new Error(`Missing transfer source ${id}`);
|
|
41
|
+
seen.add(id);
|
|
42
|
+
ordered.push(node);
|
|
43
|
+
for (const child of node.childIds) visit(child);
|
|
44
|
+
};
|
|
45
|
+
for (const id of [...input.dependencyPageIds, ...input.rootIds]) visit(id);
|
|
46
|
+
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()]));
|
|
49
|
+
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());
|
|
51
|
+
const properties = /* @__PURE__ */ new Map();
|
|
52
|
+
const propertyTypes = /* @__PURE__ */ new Map();
|
|
53
|
+
for (const node of ordered) for (const definition of node.componentPropertyDefinitions) {
|
|
54
|
+
if (propertyTypes.has(definition.id) && propertyTypes.get(definition.id) !== definition.type) throw new Error(`Conflicting property type ${definition.id}`);
|
|
55
|
+
propertyTypes.set(definition.id, definition.type);
|
|
56
|
+
if (!properties.has(definition.id)) properties.set(definition.id, allocate());
|
|
57
|
+
}
|
|
58
|
+
const targetStyleIds = /* @__PURE__ */ new Set();
|
|
59
|
+
for (const node of target.getAllNodes()) if (node.sharedStyleType !== null && node.source.id) targetStyleIds.add(node.source.id);
|
|
60
|
+
const styles = /* @__PURE__ */ new Map();
|
|
61
|
+
for (const node of ordered) {
|
|
62
|
+
const id = node.source.id;
|
|
63
|
+
if (node.sharedStyleType === null || !id) continue;
|
|
64
|
+
styles.set(id, targetStyleIds.has(id) ? allocate() : id);
|
|
65
|
+
}
|
|
66
|
+
const references = {
|
|
67
|
+
nodes,
|
|
68
|
+
variables,
|
|
69
|
+
collections,
|
|
70
|
+
modes,
|
|
71
|
+
properties,
|
|
72
|
+
propertyTypes,
|
|
73
|
+
styles
|
|
74
|
+
};
|
|
75
|
+
const resources = prepareVariableTransfer([...source.variables.values()], [...source.variableCollections.values()], references);
|
|
76
|
+
const mapped = (id) => {
|
|
77
|
+
const value = nodes.get(id);
|
|
78
|
+
if (!value) throw new Error(`Missing transfer node mapping ${id}`);
|
|
79
|
+
return value;
|
|
80
|
+
};
|
|
81
|
+
const roots = new Set(input.rootIds);
|
|
82
|
+
const dependencies = new Set(input.dependencyPageIds);
|
|
83
|
+
const destinationParent = (node) => {
|
|
84
|
+
if (roots.has(node.id)) return parentId;
|
|
85
|
+
if (dependencies.has(node.id)) return target.rootId;
|
|
86
|
+
return mapped(node.parentId ?? "");
|
|
87
|
+
};
|
|
88
|
+
return {
|
|
89
|
+
nodeIds: nodes,
|
|
90
|
+
rootIds: input.rootIds.map(mapped),
|
|
91
|
+
dependencyPageIds: input.dependencyPageIds.map(mapped),
|
|
92
|
+
nodes: ordered.map((node) => ({
|
|
93
|
+
id: mapped(node.id),
|
|
94
|
+
type: node.type,
|
|
95
|
+
parentId: destinationParent(node),
|
|
96
|
+
props: withStyleId(node, prepareNodeTransfer(node, references), styles)
|
|
97
|
+
})),
|
|
98
|
+
...resources,
|
|
99
|
+
activeModes: new Map([...source.activeMode].map(([collection, mode]) => [requireTransferReference(collections, collection, "collection"), requireTransferReference(modes, mode, "mode")])),
|
|
100
|
+
images: new Map([...source.images].map(([hash, bytes]) => [hash, bytes.slice()]))
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
//#endregion
|
|
104
|
+
export { prepareGraphTransfer };
|
|
105
|
+
|
|
106
|
+
//# sourceMappingURL=plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.js","names":[],"sources":["../../src/transfer/plan.ts"],"sourcesContent":["import type { SceneGraph } from '../graph'\nimport type { ComponentPropertyType, SceneNode } from '../types'\nimport { prepareNodeTransfer } from './nodes'\nimport { requireTransferReference } from './references'\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 targetStyleIds = new Set<string>()\n for (const node of target.getAllNodes())\n if (node.sharedStyleType !== null && node.source.id) targetStyleIds.add(node.source.id)\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, targetStyleIds.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 activeModes: new Map(\n [...source.activeMode].map(([collection, mode]) => [\n requireTransferReference(collections, collection, 'collection'),\n requireTransferReference(modes, mode, 'mode')\n ])\n ),\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;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,CAAC,GAC7B,CAAC,GAAG,OAAO,oBAAoB,OAAO,CAAC,GACvC,UACF;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,aAAa,IAAI,IACf,CAAC,GAAG,OAAO,UAAU,CAAC,CAAC,KAAK,CAAC,YAAY,UAAU,CACjD,yBAAyB,aAAa,YAAY,YAAY,GAC9D,yBAAyB,OAAO,MAAM,MAAM,CAC9C,CAAC,CACH;EACA,QAAQ,IAAI,IAAI,CAAC,GAAG,OAAO,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,WAAW,CAAC,MAAM,MAAM,MAAM,CAAC,CAAC,CAAC;CAClF;AACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/transfer/references.ts
|
|
2
|
+
function requireTransferReference(ids, id, kind) {
|
|
3
|
+
const value = ids.get(id);
|
|
4
|
+
if (!value) throw new Error(`Missing ${kind} transfer mapping: ${id}`);
|
|
5
|
+
return value;
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { requireTransferReference };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=references.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"references.js","names":[],"sources":["../../src/transfer/references.ts"],"sourcesContent":["export function requireTransferReference(\n ids: ReadonlyMap<string, string>,\n id: string,\n kind: string\n): string {\n const value = ids.get(id)\n if (!value) throw new Error(`Missing ${kind} transfer mapping: ${id}`)\n return value\n}\n"],"mappings":";AAAA,SAAgB,yBACd,KACA,IACA,MACQ;CACR,MAAM,QAAQ,IAAI,IAAI,EAAE;CACxB,IAAI,CAAC,OAAO,MAAM,IAAI,MAAM,WAAW,KAAK,qBAAqB,IAAI;CACrE,OAAO;AACT"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SceneGraph } from "../graph.js";
|
|
2
|
+
import { GraphTransferPlan } from "./apply.js";
|
|
3
|
+
//#region src/transfer/remove.d.ts
|
|
4
|
+
/** Refuse to remove transferred content that has acquired external dependents. */
|
|
5
|
+
declare function removeGraphTransfer(graph: SceneGraph, plan: GraphTransferPlan): void;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { removeGraphTransfer };
|
|
8
|
+
//# sourceMappingURL=remove.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove.d.ts","names":[],"sources":["../../src/transfer/remove.ts"],"mappings":";;;;iBAKgB,oBAAoB,OAAO,YAAY,MAAM"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { semanticTransferReferences } from "./nodes.js";
|
|
2
|
+
//#region src/transfer/remove.ts
|
|
3
|
+
/** Refuse to remove transferred content that has acquired external dependents. */
|
|
4
|
+
function removeGraphTransfer(graph, plan) {
|
|
5
|
+
const nodes = new Set(plan.nodes.map((node) => node.id));
|
|
6
|
+
const variables = new Set(plan.variables.map((variable) => variable.id));
|
|
7
|
+
const collections = new Set(plan.collections.map((collection) => collection.id));
|
|
8
|
+
const referencesOwned = (value) => {
|
|
9
|
+
if (typeof value === "string") return nodes.has(value) || variables.has(value) || collections.has(value);
|
|
10
|
+
if (!value || typeof value !== "object" || ArrayBuffer.isView(value)) return false;
|
|
11
|
+
if (value instanceof Map) return [...value].some(([key, item]) => referencesOwned(key) || referencesOwned(item));
|
|
12
|
+
return Object.values(value).some(referencesOwned);
|
|
13
|
+
};
|
|
14
|
+
for (const node of graph.getAllNodes()) {
|
|
15
|
+
if (nodes.has(node.id)) {
|
|
16
|
+
if (node.childIds.some((id) => !nodes.has(id))) throw new Error("Transferred node has non-owned children");
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
if (semanticTransferReferences(node).some(referencesOwned)) throw new Error(`Transferred content is referenced by ${node.id}`);
|
|
20
|
+
}
|
|
21
|
+
for (const variable of graph.variables.values()) if (!variables.has(variable.id) && referencesOwned(variable.valuesByMode)) throw new Error("Transferred variable has external aliases");
|
|
22
|
+
graph.withBufferedEvents(() => {
|
|
23
|
+
for (const node of plan.nodes.toReversed()) graph.deleteNode(node.id);
|
|
24
|
+
for (const id of variables) graph.variables.delete(id);
|
|
25
|
+
for (const id of collections) {
|
|
26
|
+
graph.variableCollections.delete(id);
|
|
27
|
+
graph.activeMode.delete(id);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { removeGraphTransfer };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=remove.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove.js","names":[],"sources":["../../src/transfer/remove.ts"],"sourcesContent":["import type { SceneGraph } from '../graph'\nimport 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) && referencesOwned(variable.valuesByMode))\n throw new Error('Transferred variable has external aliases')\n }\n graph.withBufferedEvents(() => {\n for (const node of plan.nodes.toReversed()) graph.deleteNode(node.id)\n for (const id of variables) graph.variables.delete(id)\n for (const id of collections) {\n graph.variableCollections.delete(id)\n graph.activeMode.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,GAC5C,IAAI,CAAC,UAAU,IAAI,SAAS,EAAE,KAAK,gBAAgB,SAAS,YAAY,GACtE,MAAM,IAAI,MAAM,2CAA2C;CAE/D,MAAM,yBAAyB;EAC7B,KAAK,MAAM,QAAQ,KAAK,MAAM,WAAW,GAAG,MAAM,WAAW,KAAK,EAAE;EACpE,KAAK,MAAM,MAAM,WAAW,MAAM,UAAU,OAAO,EAAE;EACrD,KAAK,MAAM,MAAM,aAAa;GAC5B,MAAM,oBAAoB,OAAO,EAAE;GACnC,MAAM,WAAW,OAAO,EAAE;EAC5B;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { createDefaultNode } from "../node-defaults.js";
|
|
2
|
+
import { prepareNodeTransfer } from "./nodes.js";
|
|
3
|
+
import { variableIdentityReferences } from "./identity.js";
|
|
4
|
+
//#region src/transfer/validation.ts
|
|
5
|
+
/** Revalidate mutable plan references without allocating or registering destination nodes. */
|
|
6
|
+
function validateTransferReferences(target, plan) {
|
|
7
|
+
const nodes = new Map(plan.nodes.map((entry) => [entry.id, createDefaultNode(() => entry.id, entry.type, entry.props)]));
|
|
8
|
+
const identities = new Map([...nodes.keys()].map((id) => [id, id]));
|
|
9
|
+
const properties = /* @__PURE__ */ new Map();
|
|
10
|
+
const propertyTypes = /* @__PURE__ */ new Map();
|
|
11
|
+
for (const node of nodes.values()) for (const definition of node.componentPropertyDefinitions) {
|
|
12
|
+
const previous = propertyTypes.get(definition.id);
|
|
13
|
+
if (previous && previous !== definition.type) throw new Error(`Conflicting transfer property ${definition.id}`);
|
|
14
|
+
properties.set(definition.id, definition.id);
|
|
15
|
+
propertyTypes.set(definition.id, definition.type);
|
|
16
|
+
}
|
|
17
|
+
const collections = new Map(plan.collections.map((collection) => [collection.id, collection]));
|
|
18
|
+
const references = {
|
|
19
|
+
nodes: identities,
|
|
20
|
+
styles: new Map([...nodes.values()].flatMap((node) => node.sharedStyleType !== null && node.source.id ? [[node.source.id, node.source.id]] : [])),
|
|
21
|
+
properties,
|
|
22
|
+
propertyTypes,
|
|
23
|
+
...variableIdentityReferences(plan.variables, plan.collections)
|
|
24
|
+
};
|
|
25
|
+
for (const node of nodes.values()) {
|
|
26
|
+
prepareNodeTransfer(node, references);
|
|
27
|
+
for (const [collection, mode] of Object.entries(node.variableModes)) if (!collections.get(collection)?.modes.some((entry) => entry.modeId === mode)) throw new Error(`Invalid node variable mode ${node.id}`);
|
|
28
|
+
}
|
|
29
|
+
const roots = /* @__PURE__ */ new Set([...plan.rootIds, ...plan.dependencyPageIds]);
|
|
30
|
+
if (roots.size !== plan.rootIds.length + plan.dependencyPageIds.length) throw new Error("Repeated transfer root");
|
|
31
|
+
for (const entry of plan.nodes) {
|
|
32
|
+
if (roots.has(entry.id) === nodes.has(entry.parentId)) throw new Error(`Invalid transfer root topology ${entry.id}`);
|
|
33
|
+
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
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { validateTransferReferences };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +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(plan.collections.map((collection) => [collection.id, collection]))\n const styles = new Map(\n [...nodes.values()].flatMap((node) =>\n node.sharedStyleType !== null && node.source.id ? [[node.source.id, node.source.id]] : []\n )\n )\n const references = {\n nodes: identities,\n styles,\n properties,\n propertyTypes,\n ...variableIdentityReferences(plan.variables, plan.collections)\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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CAAC,YAAY,IAAI,UAAU,CAAC,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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Variable, VariableCollection } from "../types.js";
|
|
2
|
+
//#region src/transfer/variables.d.ts
|
|
3
|
+
interface VariableTransferReferences {
|
|
4
|
+
variables: ReadonlyMap<string, string>;
|
|
5
|
+
collections: ReadonlyMap<string, string>;
|
|
6
|
+
modes: ReadonlyMap<string, string>;
|
|
7
|
+
}
|
|
8
|
+
/** Prepare isolated resource copies; never mutate the source or destination graph. */
|
|
9
|
+
declare function prepareVariableTransfer(variables: readonly Variable[], collections: readonly VariableCollection[], references: VariableTransferReferences): {
|
|
10
|
+
variables: Variable[];
|
|
11
|
+
collections: VariableCollection[];
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { VariableTransferReferences, prepareVariableTransfer };
|
|
15
|
+
//# sourceMappingURL=variables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variables.d.ts","names":[],"sources":["../../src/transfer/variables.ts"],"mappings":";;UAIiB;EACf,WAAW;EACX,aAAa;EACb,OAAO;;;iBAqCO,wBACd,oBAAoB,YACpB,sBAAsB,sBACtB,YAAY;EACT,WAAW;EAAY,aAAa"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { mapVariableValueReferences } from "../variables/value.js";
|
|
2
|
+
import { requireTransferReference } from "./references.js";
|
|
3
|
+
//#region src/transfer/variables.ts
|
|
4
|
+
function assertUniqueMappings(ids, kind) {
|
|
5
|
+
if (new Set(ids.values()).size !== ids.size) throw new Error(`Colliding ${kind} transfer mappings`);
|
|
6
|
+
}
|
|
7
|
+
function assertResourceOwnership(variables, collections) {
|
|
8
|
+
const sets = new Map(collections.map((collection) => [collection.id, collection]));
|
|
9
|
+
const tokens = new Map(variables.map((variable) => [variable.id, variable]));
|
|
10
|
+
if (sets.size !== collections.length || tokens.size !== variables.length) throw new Error("Duplicate source variable resource");
|
|
11
|
+
for (const collection of collections) {
|
|
12
|
+
const modes = new Set(collection.modes.map((mode) => mode.modeId));
|
|
13
|
+
if (!modes.has(collection.defaultModeId) || modes.size !== collection.modes.length) throw new Error(`Invalid modes for collection ${collection.id}`);
|
|
14
|
+
for (const id of collection.variableIds) if (tokens.get(id)?.collectionId !== collection.id) throw new Error(`Invalid variable membership ${id} in ${collection.id}`);
|
|
15
|
+
}
|
|
16
|
+
for (const variable of variables) {
|
|
17
|
+
const collection = sets.get(variable.collectionId);
|
|
18
|
+
if (!collection?.variableIds.includes(variable.id)) throw new Error(`Missing collection membership for ${variable.id}`);
|
|
19
|
+
const modes = new Set(collection.modes.map((mode) => mode.modeId));
|
|
20
|
+
for (const mode of Object.keys(variable.valuesByMode)) if (!modes.has(mode)) throw new Error(`Unknown mode ${mode} for ${variable.id}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/** Prepare isolated resource copies; never mutate the source or destination graph. */
|
|
24
|
+
function prepareVariableTransfer(variables, collections, references) {
|
|
25
|
+
assertResourceOwnership(variables, collections);
|
|
26
|
+
assertUniqueMappings(references.variables, "variable");
|
|
27
|
+
assertUniqueMappings(references.collections, "collection");
|
|
28
|
+
assertUniqueMappings(references.modes, "mode");
|
|
29
|
+
const value = (input) => mapVariableValueReferences(input, (id) => requireTransferReference(references.variables, id, "variable alias"), (id) => references.modes.get(id) ?? id);
|
|
30
|
+
return {
|
|
31
|
+
collections: collections.map((collection) => ({
|
|
32
|
+
...structuredClone(collection),
|
|
33
|
+
id: requireTransferReference(references.collections, collection.id, "collection"),
|
|
34
|
+
defaultModeId: requireTransferReference(references.modes, collection.defaultModeId, "mode"),
|
|
35
|
+
modes: collection.modes.map((mode) => ({
|
|
36
|
+
...mode,
|
|
37
|
+
modeId: requireTransferReference(references.modes, mode.modeId, "mode")
|
|
38
|
+
})),
|
|
39
|
+
variableIds: collection.variableIds.map((id) => requireTransferReference(references.variables, id, "variable"))
|
|
40
|
+
})),
|
|
41
|
+
variables: variables.map((variable) => ({
|
|
42
|
+
...structuredClone(variable),
|
|
43
|
+
id: requireTransferReference(references.variables, variable.id, "variable"),
|
|
44
|
+
collectionId: requireTransferReference(references.collections, variable.collectionId, "collection"),
|
|
45
|
+
valuesByMode: Object.fromEntries(Object.entries(variable.valuesByMode).map(([mode, input]) => [requireTransferReference(references.modes, mode, "mode"), value(input)]))
|
|
46
|
+
}))
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { prepareVariableTransfer };
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=variables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variables.js","names":["mapped"],"sources":["../../src/transfer/variables.ts"],"sourcesContent":["import 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?.variableIds.includes(variable.id))\n throw new Error(`Missing collection membership for ${variable.id}`)\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"],"mappings":";;;AAUA,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,YAAY,SAAS,SAAS,EAAE,GAC/C,MAAM,IAAI,MAAM,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