@open-pencil/scene-graph 0.18.0-beta.1 → 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 +4 -3
- package/dist/behaviours/index.js +6 -5
- package/dist/behaviours/kinds.d.ts +38 -15
- package/dist/behaviours/kinds.d.ts.map +1 -1
- package/dist/behaviours/kinds.js +119 -4
- 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 +16 -18
- package/dist/behaviours/schema.d.ts.map +1 -1
- package/dist/behaviours/schema.js +2 -3
- package/dist/behaviours/spec.d.ts +3 -6
- package/dist/behaviours/spec.d.ts.map +1 -1
- package/dist/behaviours/spec.js +4 -5
- package/dist/behaviours/transition.d.ts +6 -9
- package/dist/behaviours/transition.d.ts.map +1 -1
- package/dist/behaviours/transition.js +1 -2
- 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 +2 -3
- 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 +13 -15
- package/dist/color/index.d.ts.map +1 -1
- package/dist/color/index.js +3 -4
- package/dist/color/management.d.ts +11 -14
- package/dist/color/management.d.ts.map +1 -1
- package/dist/color/management.js +2 -3
- 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 +16 -19
- package/dist/color/okhcl.d.ts.map +1 -1
- package/dist/color/okhcl.js +3 -4
- package/dist/color/schema.d.ts +4 -7
- package/dist/color/schema.d.ts.map +1 -1
- package/dist/color/schema.js +2 -3
- 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 +1 -2
- 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 +31 -25
- package/dist/copy.d.ts.map +1 -1
- package/dist/copy.js +13 -5
- package/dist/copy.js.map +1 -1
- package/dist/corners.d.ts +8 -10
- package/dist/corners.d.ts.map +1 -1
- package/dist/corners.js +1 -2
- 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 +4 -5
- package/dist/css/index.js +2 -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 +2 -5
- package/dist/css/motion.d.ts.map +1 -1
- package/dist/css/motion.js +2 -3
- package/dist/css/shadows.d.ts +1 -4
- package/dist/css/shadows.d.ts.map +1 -1
- package/dist/css/shadows.js +3 -4
- 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 +9 -12
- package/dist/css/values.d.ts.map +1 -1
- package/dist/css/values.js +2 -3
- 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.js +1 -1
- package/dist/fields/layout.d.ts +4 -7
- package/dist/fields/layout.d.ts.map +1 -1
- package/dist/fields/layout.js +1 -2
- 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 +5 -5
- package/dist/font-style.js.map +1 -1
- package/dist/generated/index.d.ts +32 -16
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +37 -9
- 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 +43 -69
- package/dist/geometry.d.ts.map +1 -1
- package/dist/geometry.js +44 -76
- 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 +4 -7
- package/dist/graph.d.ts.map +1 -1
- package/dist/graph.js +26 -19
- package/dist/graph.js.map +1 -1
- package/dist/group-bounds.d.ts +10 -12
- package/dist/group-bounds.d.ts.map +1 -1
- package/dist/group-bounds.js +5 -6
- 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 +51 -31
- 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 +3 -4
- 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 +9 -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 +69 -12
- 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 +27 -14
- 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 +3 -6
- package/dist/layout/flow.d.ts.map +1 -1
- package/dist/layout/flow.js +6 -5
- package/dist/layout/flow.js.map +1 -1
- 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 +3 -2
- package/dist/layout/index.js +6 -5
- package/dist/layout/keywords.d.ts +7 -9
- package/dist/layout/keywords.d.ts.map +1 -1
- package/dist/layout/keywords.js +1 -2
- 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 +11 -13
- package/dist/layout/sizing.d.ts.map +1 -1
- package/dist/layout/sizing.js +1 -2
- package/dist/layout/spacing.d.ts +2 -5
- package/dist/layout/spacing.d.ts.map +1 -1
- package/dist/layout/spacing.js +1 -2
- 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 +21 -24
- package/dist/mesh/geometry.d.ts.map +1 -1
- package/dist/mesh/geometry.js +3 -14
- package/dist/mesh/geometry.js.map +1 -1
- package/dist/mesh/index.d.ts +1 -1
- package/dist/mesh/index.js +1 -1
- package/dist/mesh/model.d.ts +5 -8
- package/dist/mesh/model.d.ts.map +1 -1
- package/dist/mesh/model.js +2 -3
- package/dist/mesh/schema.d.ts +10 -13
- package/dist/mesh/schema.d.ts.map +1 -1
- package/dist/mesh/schema.js +3 -4
- 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 +7 -10
- package/dist/mutation-impact.d.ts.map +1 -1
- package/dist/mutation-impact.js +2 -3
- package/dist/node-defaults.d.ts +14 -15
- package/dist/node-defaults.d.ts.map +1 -1
- package/dist/node-defaults.js +133 -51
- 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 +2 -2
- package/dist/paints/index.js +4 -4
- package/dist/paints/pattern.d.ts +6 -9
- package/dist/paints/pattern.d.ts.map +1 -1
- package/dist/paints/pattern.js +1 -2
- 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 +3 -6
- package/dist/paints/shows.d.ts.map +1 -1
- package/dist/paints/shows.js +1 -2
- package/dist/paints/solid.d.ts +1 -4
- package/dist/paints/solid.d.ts.map +1 -1
- package/dist/paints/solid.js +1 -2
- package/dist/paints/stills.d.ts +17 -17
- package/dist/paints/stills.d.ts.map +1 -1
- package/dist/paints/stills.js +22 -18
- package/dist/paints/stills.js.map +1 -1
- 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 +1 -2
- package/dist/plugin-data/fields.d.ts +37 -11
- package/dist/plugin-data/fields.d.ts.map +1 -1
- package/dist/plugin-data/fields.js +35 -10
- 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 +13 -15
- package/dist/resize.d.ts.map +1 -1
- package/dist/resize.js +5 -6
- package/dist/scaling/node.d.ts +2 -5
- package/dist/scaling/node.d.ts.map +1 -1
- package/dist/scaling/node.js +4 -5
- 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 -2
- package/dist/shaders/index.js +2 -2
- package/dist/shaders/model.d.ts +54 -13
- package/dist/shaders/model.d.ts.map +1 -1
- package/dist/shaders/model.js +98 -7
- package/dist/shaders/model.js.map +1 -1
- package/dist/shaders/schema.d.ts +15 -8
- package/dist/shaders/schema.d.ts.map +1 -1
- package/dist/shaders/schema.js +11 -2
- package/dist/shaders/schema.js.map +1 -1
- package/dist/shape-with-text/document.js +9 -21
- package/dist/shape-with-text/document.js.map +1 -1
- 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 +7 -10
- package/dist/shape-with-text/geometry.d.ts.map +1 -1
- package/dist/shape-with-text/geometry.js +4 -7
- package/dist/shape-with-text/geometry.js.map +1 -1
- package/dist/shape-with-text/index.js +1 -1
- 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 +2 -4
- package/dist/shared-style-index.d.ts.map +1 -1
- package/dist/shared-style-index.js +1 -2
- package/dist/shared-style-index.js.map +1 -1
- package/dist/shared-styles.d.ts +17 -19
- package/dist/shared-styles.d.ts.map +1 -1
- package/dist/shared-styles.js +5 -6
- package/dist/slides/drop.d.ts +5 -8
- package/dist/slides/drop.d.ts.map +1 -1
- package/dist/slides/drop.js +1 -2
- package/dist/slides/index.d.ts +19 -19
- package/dist/slides/index.d.ts.map +1 -1
- package/dist/slides/index.js +8 -5
- package/dist/slides/index.js.map +1 -1
- package/dist/slides/motion.d.ts +32 -16
- package/dist/slides/motion.d.ts.map +1 -1
- package/dist/slides/motion.js +30 -5
- package/dist/slides/motion.js.map +1 -1
- package/dist/slides/playback.d.ts +24 -21
- package/dist/slides/playback.d.ts.map +1 -1
- package/dist/slides/playback.js +45 -13
- package/dist/slides/playback.js.map +1 -1
- package/dist/slides/types.d.ts +8 -11
- package/dist/slides/types.d.ts.map +1 -1
- package/dist/slides/types.js +1 -2
- 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 +1 -2
- 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 +5 -8
- package/dist/text/direction.d.ts.map +1 -1
- package/dist/text/direction.js +1 -2
- package/dist/text/index.d.ts +2 -2
- package/dist/text/index.js +5 -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 +4 -7
- package/dist/text/name.d.ts.map +1 -1
- package/dist/text/name.js +1 -2
- 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 +1 -2
- 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 +4 -7
- package/dist/thumbnail.d.ts.map +1 -1
- package/dist/thumbnail.js +1 -2
- package/dist/transfer/apply.d.ts +2 -5
- package/dist/transfer/apply.d.ts.map +1 -1
- package/dist/transfer/apply.js +2 -3
- package/dist/transfer/copied.d.ts +5 -8
- package/dist/transfer/copied.d.ts.map +1 -1
- package/dist/transfer/copied.js +3 -4
- package/dist/transfer/dependencies.d.ts +6 -9
- package/dist/transfer/dependencies.d.ts.map +1 -1
- package/dist/transfer/dependencies.js +13 -11
- 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 +1 -2
- package/dist/transfer/identity.js +1 -2
- package/dist/transfer/index.d.ts +3 -3
- package/dist/transfer/index.js +6 -6
- package/dist/transfer/library.d.ts +5 -7
- package/dist/transfer/library.d.ts.map +1 -1
- package/dist/transfer/library.js +32 -12
- package/dist/transfer/library.js.map +1 -1
- package/dist/transfer/nodes.d.ts +2 -5
- package/dist/transfer/nodes.d.ts.map +1 -1
- package/dist/transfer/nodes.js +8 -6
- package/dist/transfer/nodes.js.map +1 -1
- package/dist/transfer/plan.d.ts +2 -5
- package/dist/transfer/plan.d.ts.map +1 -1
- package/dist/transfer/plan.js +2 -3
- 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 +2 -3
- 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 +1 -2
- package/dist/transfer/variables.d.ts +3 -6
- package/dist/transfer/variables.d.ts.map +1 -1
- package/dist/transfer/variables.js +2 -3
- package/dist/types.d.ts +191 -142
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +15 -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 +24 -25
- package/dist/variables/bindings.d.ts.map +1 -1
- package/dist/variables/bindings.js +28 -23
- 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 +24 -19
- package/dist/variables/easing.d.ts.map +1 -1
- package/dist/variables/easing.js +17 -17
- package/dist/variables/easing.js.map +1 -1
- 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 +6 -8
- package/dist/variables/formula/index.d.ts.map +1 -1
- package/dist/variables/formula/index.js +4 -5
- 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 +5 -6
- package/dist/variables/formula/signatures.d.ts +3 -6
- package/dist/variables/formula/signatures.d.ts.map +1 -1
- package/dist/variables/formula/signatures.js +1 -2
- 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 +6 -9
- 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 +30 -32
- package/dist/variables/index.d.ts.map +1 -1
- package/dist/variables/index.js +17 -18
- package/dist/variables/lookup.d.ts +11 -7
- package/dist/variables/lookup.d.ts.map +1 -1
- package/dist/variables/lookup.js +24 -3
- package/dist/variables/lookup.js.map +1 -1
- package/dist/variables/motion.d.ts +9 -12
- package/dist/variables/motion.d.ts.map +1 -1
- package/dist/variables/motion.js +3 -4
- package/dist/variables/paints.d.ts +18 -20
- package/dist/variables/paints.d.ts.map +1 -1
- package/dist/variables/paints.js +4 -5
- package/dist/variables/resolution.d.ts +22 -19
- package/dist/variables/resolution.d.ts.map +1 -1
- package/dist/variables/resolution.js +13 -5
- package/dist/variables/resolution.js.map +1 -1
- package/dist/variables/schema.d.ts +9 -12
- package/dist/variables/schema.d.ts.map +1 -1
- package/dist/variables/schema.js +3 -4
- package/dist/variables/style-bindings.d.ts +11 -13
- package/dist/variables/style-bindings.d.ts.map +1 -1
- package/dist/variables/style-bindings.js +2 -3
- 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 +23 -5
- package/src/behaviours/index.ts +1 -0
- package/src/behaviours/kinds.ts +103 -1
- package/src/behaviours/listing.ts +142 -0
- package/src/behaviours/model.ts +21 -0
- package/src/blur.ts +88 -0
- package/src/clipping.ts +3 -4
- package/src/comments/threads.ts +8 -1
- package/src/connectors/layout.ts +10 -3
- package/src/connectors/sublayers.ts +2 -1
- package/src/coordinate.ts +17 -25
- package/src/copy.ts +15 -6
- package/src/cubic.ts +57 -1
- package/src/export-format.ts +11 -1
- package/src/font-style.ts +12 -4
- package/src/generated/index.ts +43 -6
- 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 +39 -88
- package/src/graph.ts +21 -6
- package/src/hit-test.ts +66 -26
- 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 +7 -3
- package/src/instances/index.ts +94 -5
- package/src/instances/lookup.ts +61 -0
- package/src/instances/sync.ts +15 -0
- package/src/layout/flow.ts +5 -3
- package/src/layout/index.ts +1 -0
- package/src/layout/stacking.ts +14 -0
- package/src/matrix.ts +11 -1
- package/src/mesh/geometry.ts +2 -13
- 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/node-defaults.ts +131 -49
- package/src/order-keys.ts +16 -2
- package/src/paints/stills.ts +16 -12
- package/src/parse-path.ts +15 -0
- package/src/plugin-data/fields.ts +40 -3
- package/src/polygon.ts +6 -4
- package/src/shaders/model.ts +124 -6
- package/src/shaders/schema.ts +12 -0
- package/src/shape-with-text/document.ts +7 -12
- package/src/shape-with-text/geometry.ts +1 -4
- package/src/slides/index.ts +8 -0
- package/src/slides/motion.ts +35 -1
- package/src/slides/playback.ts +51 -9
- 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/lists.ts +20 -7
- package/src/text/paragraphs.ts +10 -3
- package/src/transfer/dependencies.ts +17 -11
- package/src/transfer/library.ts +36 -12
- package/src/transfer/nodes.ts +8 -0
- package/src/types.ts +71 -8
- package/src/undo.ts +10 -1
- package/src/variables/bindings.ts +33 -16
- package/src/variables/easing.ts +16 -17
- package/src/variables/fields.ts +30 -3
- package/src/variables/lookup.ts +24 -1
- package/src/variables/resolution.ts +15 -1
- package/src/variables/units.ts +2 -3
package/dist/layout/guides.d.ts
CHANGED
|
@@ -1,41 +1,38 @@
|
|
|
1
1
|
import { Color } from "../primitives/index.js";
|
|
2
2
|
import { LayoutGrid, SceneNode } from "../types.js";
|
|
3
|
-
|
|
4
|
-
interface LayoutGuideLine {
|
|
3
|
+
export interface LayoutGuideLine {
|
|
5
4
|
axis: 'x' | 'y';
|
|
6
5
|
position: number;
|
|
7
6
|
}
|
|
8
7
|
/** The most lines one guide draws or snaps to on an axis. */
|
|
9
|
-
declare const MAX_LAYOUT_GUIDE_LINES = 10000;
|
|
8
|
+
export declare const MAX_LAYOUT_GUIDE_LINES = 10000;
|
|
10
9
|
/** Figma's Auto count, as its archive stores it: as many sections as fit. */
|
|
11
|
-
declare const AUTO_LAYOUT_GRID_COUNT = 2147483647;
|
|
10
|
+
export declare const AUTO_LAYOUT_GRID_COUNT = 2147483647;
|
|
12
11
|
/** Whether a guide's count is Auto: the archive's value, or the plugin API's `Infinity` or `null`. */
|
|
13
|
-
declare function isAutoGridCount(count: number | null | undefined): boolean;
|
|
12
|
+
export declare function isAutoGridCount(count: number | null | undefined): boolean;
|
|
14
13
|
/**
|
|
15
14
|
* A guide's count, set in Figma's plugin shape (`count`) or read from a file (`numSections`); an
|
|
16
15
|
* edit's `count` wins over the count the file had. Auto is {@link AUTO_LAYOUT_GRID_COUNT}.
|
|
17
16
|
*/
|
|
18
|
-
declare function layoutGridCount(grid: LayoutGrid): number;
|
|
17
|
+
export declare function layoutGridCount(grid: LayoutGrid): number;
|
|
19
18
|
/** Figma's color for a new guide: red at 10%. */
|
|
20
|
-
declare const DEFAULT_LAYOUT_GRID_COLOR: Readonly<Color>;
|
|
19
|
+
export declare const DEFAULT_LAYOUT_GRID_COLOR: Readonly<Color>;
|
|
21
20
|
/** A guide's pattern in Figma's plugin names, from either shape: the archive's `STRIPES` along an `axis`. */
|
|
22
|
-
declare function layoutGridPattern(grid: Pick<LayoutGrid, 'pattern' | 'axis'>): 'COLUMNS' | 'ROWS' | 'GRID';
|
|
21
|
+
export declare function layoutGridPattern(grid: Pick<LayoutGrid, 'pattern' | 'axis'>): 'COLUMNS' | 'ROWS' | 'GRID';
|
|
23
22
|
/**
|
|
24
23
|
* A guide's alignment, from either shape. One set without any stretches, as the plugin API and
|
|
25
24
|
* export have read it; a file's guide always has one, as Figma drops a guide without it.
|
|
26
25
|
*/
|
|
27
|
-
declare function layoutGridAlignment(grid: Pick<LayoutGrid, 'alignment' | 'type'>): 'MIN' | 'CENTER' | 'MAX' | 'STRETCH';
|
|
26
|
+
export declare function layoutGridAlignment(grid: Pick<LayoutGrid, 'alignment' | 'type'>): 'MIN' | 'CENTER' | 'MAX' | 'STRETCH';
|
|
28
27
|
/** Whether a file's guide record names an alignment; Figma drops one that does not (live). */
|
|
29
|
-
declare function hasLayoutGridAlignment(grid: Partial<Pick<LayoutGrid, 'alignment' | 'type'>>): boolean;
|
|
28
|
+
export declare function hasLayoutGridAlignment(grid: Partial<Pick<LayoutGrid, 'alignment' | 'type'>>): boolean;
|
|
30
29
|
/** A guide's color, Figma's new-guide red for one set without any. */
|
|
31
|
-
declare function layoutGridColor(grid: Pick<LayoutGrid, 'color'>): Color;
|
|
32
|
-
interface LayoutGuideSection {
|
|
30
|
+
export declare function layoutGridColor(grid: Pick<LayoutGrid, 'color'>): Color;
|
|
31
|
+
export interface LayoutGuideSection {
|
|
33
32
|
axis: 'x' | 'y';
|
|
34
33
|
start: number;
|
|
35
34
|
end: number;
|
|
36
35
|
}
|
|
37
|
-
declare function layoutGuideSections(node: Pick<SceneNode, 'width' | 'height'>, grid: LayoutGrid): LayoutGuideSection[];
|
|
38
|
-
declare function layoutGuideLines(node: Pick<SceneNode, 'width' | 'height'>, grid: LayoutGrid): LayoutGuideLine[];
|
|
39
|
-
//#endregion
|
|
40
|
-
export { AUTO_LAYOUT_GRID_COUNT, DEFAULT_LAYOUT_GRID_COLOR, LayoutGuideLine, LayoutGuideSection, MAX_LAYOUT_GUIDE_LINES, hasLayoutGridAlignment, isAutoGridCount, layoutGridAlignment, layoutGridColor, layoutGridCount, layoutGridPattern, layoutGuideLines, layoutGuideSections };
|
|
36
|
+
export declare function layoutGuideSections(node: Pick<SceneNode, 'width' | 'height'>, grid: LayoutGrid): LayoutGuideSection[];
|
|
37
|
+
export declare function layoutGuideLines(node: Pick<SceneNode, 'width' | 'height'>, grid: LayoutGrid): LayoutGuideLine[];
|
|
41
38
|
//# sourceMappingURL=guides.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guides.d.ts","names":[],"sources":["../../src/layout/guides.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"guides.d.ts","names":[],"sources":["../../src/layout/guides.ts"],"mappings":";;iBAGiB;EACf;EACA;;;qBAIW;;qBAGA;;wBAGG,gBAAgB;;;;;wBAQhB,gBAAgB,MAAM;;qBAMzB,2BAA2B,SAAS;;wBAQjC,kBACd,MAAM,KAAK;;;;;wBAYG,oBACd,MAAM,KAAK;;wBAMG,uBACd,MAAM,QAAQ,KAAK;;wBAML,gBAAgB,MAAM,KAAK,uBAAuB;iBA4CjD;EACf;EACA;EACA;;wBAGc,oBACd,MAAM,KAAK,gCACX,MAAM,aACL;wBAea,iBAAiB,MAAM,KAAK,gCAAgC,MAAM,aAAU"}
|
package/dist/layout/guides.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
// src/layout/guides.ts
|
|
2
2
|
/** The most lines one guide draws or snaps to on an axis. */
|
|
3
3
|
const MAX_LAYOUT_GUIDE_LINES = 1e4;
|
|
4
4
|
/** Figma's Auto count, as its archive stores it: as many sections as fit. */
|
|
5
|
-
const AUTO_LAYOUT_GRID_COUNT =
|
|
5
|
+
const AUTO_LAYOUT_GRID_COUNT = 0x7fffffff;
|
|
6
6
|
/** Whether a guide's count is Auto: the archive's value, or the plugin API's `Infinity` or `null`. */
|
|
7
7
|
function isAutoGridCount(count) {
|
|
8
|
-
return count === null || count ===
|
|
8
|
+
return count === null || count === 1e400 || (count ?? 0) >= 0x7fffffff;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* A guide's count, set in Figma's plugin shape (`count`) or read from a file (`numSections`); an
|
|
@@ -50,7 +50,7 @@ const alignment = layoutGridAlignment;
|
|
|
50
50
|
*/
|
|
51
51
|
function sectionCount(nodeSize, grid) {
|
|
52
52
|
const value = layoutGridCount(grid);
|
|
53
|
-
if (value ===
|
|
53
|
+
if (value === 0x7fffffff) {
|
|
54
54
|
const size = grid.sectionSize ?? 0;
|
|
55
55
|
if (alignment(grid) === "STRETCH" || size <= 0) return 0;
|
|
56
56
|
const gutter = grid.gutterSize ?? 0;
|
|
@@ -119,7 +119,6 @@ function layoutGuideLines(node, grid) {
|
|
|
119
119
|
});
|
|
120
120
|
return lines;
|
|
121
121
|
}
|
|
122
|
-
//#endregion
|
|
123
122
|
export { AUTO_LAYOUT_GRID_COUNT, DEFAULT_LAYOUT_GRID_COLOR, MAX_LAYOUT_GUIDE_LINES, hasLayoutGridAlignment, isAutoGridCount, layoutGridAlignment, layoutGridColor, layoutGridCount, layoutGridPattern, layoutGuideLines, layoutGuideSections };
|
|
124
123
|
|
|
125
124
|
//# sourceMappingURL=guides.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guides.js","names":[],"sources":["../../src/layout/guides.ts"],"sourcesContent":["import type { Color } from '../primitives'\nimport type { LayoutGrid, SceneNode } from '../types'\n\nexport interface LayoutGuideLine {\n axis: 'x' | 'y'\n position: number\n}\n\n/** The most lines one guide draws or snaps to on an axis. */\nexport const MAX_LAYOUT_GUIDE_LINES = 10_000\n\n/** Figma's Auto count, as its archive stores it: as many sections as fit. */\nexport const AUTO_LAYOUT_GRID_COUNT = 2_147_483_647\n\n/** Whether a guide's count is Auto: the archive's value, or the plugin API's `Infinity` or `null`. */\nexport function isAutoGridCount(count: number | null | undefined): boolean {\n return count === null || count === Infinity || (count ?? 0) >= AUTO_LAYOUT_GRID_COUNT\n}\n\n/**\n * A guide's count, set in Figma's plugin shape (`count`) or read from a file (`numSections`); an\n * edit's `count` wins over the count the file had. Auto is {@link AUTO_LAYOUT_GRID_COUNT}.\n */\nexport function layoutGridCount(grid: LayoutGrid): number {\n const count = grid.count === undefined ? grid.numSections : grid.count\n return isAutoGridCount(count) ? AUTO_LAYOUT_GRID_COUNT : (count ?? 1)\n}\n\n/** Figma's color for a new guide: red at 10%. */\nexport const DEFAULT_LAYOUT_GRID_COLOR: Readonly<Color> = Object.freeze({\n r: 1,\n g: 0,\n b: 0,\n a: 0.1\n})\n\n/** A guide's pattern in Figma's plugin names, from either shape: the archive's `STRIPES` along an `axis`. */\nexport function layoutGridPattern(\n grid: Pick<LayoutGrid, 'pattern' | 'axis'>\n): 'COLUMNS' | 'ROWS' | 'GRID' {\n if (grid.pattern === 'GRID' || grid.pattern === 'ROWS' || grid.pattern === 'COLUMNS') {\n return grid.pattern\n }\n return grid.axis === 'Y' ? 'ROWS' : 'COLUMNS'\n}\n\n/**\n * A guide's alignment, from either shape. One set without any stretches, as the plugin API and\n * export have read it; a file's guide always has one, as Figma drops a guide without it.\n */\nexport function layoutGridAlignment(\n grid: Pick<LayoutGrid, 'alignment' | 'type'>\n): 'MIN' | 'CENTER' | 'MAX' | 'STRETCH' {\n return grid.alignment ?? grid.type ?? 'STRETCH'\n}\n\n/** Whether a file's guide record names an alignment; Figma drops one that does not (live). */\nexport function hasLayoutGridAlignment(\n grid: Partial<Pick<LayoutGrid, 'alignment' | 'type'>>\n): boolean {\n return grid.type !== undefined || grid.alignment !== undefined\n}\n\n/** A guide's color, Figma's new-guide red for one set without any. */\nexport function layoutGridColor(grid: Pick<LayoutGrid, 'color'>): Color {\n return { ...(grid.color ?? DEFAULT_LAYOUT_GRID_COLOR) }\n}\n\nconst pattern = layoutGridPattern\nconst alignment = layoutGridAlignment\n\n/**\n * How many sections a guide draws. Auto fits as many fixed sections as the frame holds, counting\n * the offset once from the aligned edge, as Figma desktop 126 draws them.\n */\nfunction sectionCount(nodeSize: number, grid: LayoutGrid): number {\n const value = layoutGridCount(grid)\n if (value === AUTO_LAYOUT_GRID_COUNT) {\n const size = grid.sectionSize ?? 0\n if (alignment(grid) === 'STRETCH' || size <= 0) return 0\n const gutter = grid.gutterSize ?? 0\n const offset = alignment(grid) === 'CENTER' ? 0 : (grid.offset ?? 0)\n return Math.min(\n MAX_LAYOUT_GUIDE_LINES,\n Math.max(0, Math.floor((nodeSize - offset + gutter) / (size + gutter)))\n )\n }\n if (!Number.isFinite(value)) return 0\n return Math.min(MAX_LAYOUT_GUIDE_LINES, Math.max(0, Math.floor(value)))\n}\n\nfunction sectionSize(nodeSize: number, grid: LayoutGrid, count: number): number {\n const fixed = grid.sectionSize ?? 0\n if (alignment(grid) !== 'STRETCH') return fixed\n const gutter = grid.gutterSize ?? 0\n const offset = grid.offset ?? 0\n return (nodeSize - offset * 2 - Math.max(0, count - 1) * gutter) / count\n}\n\nfunction start(nodeSize: number, grid: LayoutGrid, size: number, count: number): number {\n const gutter = grid.gutterSize ?? 0\n const offset = grid.offset ?? 0\n const span = count * size + Math.max(0, count - 1) * gutter\n if (alignment(grid) === 'CENTER') return (nodeSize - span) / 2 + offset\n if (alignment(grid) === 'MAX') return nodeSize - span - offset\n return offset\n}\n\nexport interface LayoutGuideSection {\n axis: 'x' | 'y'\n start: number\n end: number\n}\n\nexport function layoutGuideSections(\n node: Pick<SceneNode, 'width' | 'height'>,\n grid: LayoutGrid\n): LayoutGuideSection[] {\n if (grid.visible === false || pattern(grid) === 'GRID') return []\n const axis = pattern(grid) === 'ROWS' ? 'y' : 'x'\n const nodeSize = axis === 'x' ? node.width : node.height\n const count = sectionCount(nodeSize, grid)\n const size = sectionSize(nodeSize, grid, count)\n if (count <= 0 || size <= 0) return []\n const first = start(nodeSize, grid, size, count)\n const step = size + (grid.gutterSize ?? 0)\n return Array.from({ length: count }, (_, index) => {\n const sectionStart = first + index * step\n return { axis, start: sectionStart, end: sectionStart + size }\n })\n}\n\nexport function layoutGuideLines(node: Pick<SceneNode, 'width' | 'height'>, grid: LayoutGrid) {\n if (grid.visible === false) return []\n const gridPattern = pattern(grid)\n const lines: LayoutGuideLine[] = []\n if (gridPattern === 'GRID') {\n const size = grid.sectionSize ?? 0\n if (size <= 0) return lines\n for (\n let index = 0, x = grid.offset ?? 0;\n x <= node.width && index < MAX_LAYOUT_GUIDE_LINES;\n index++, x += size\n ) {\n lines.push({ axis: 'x', position: x })\n }\n for (\n let index = 0, y = grid.offset ?? 0;\n y <= node.height && index < MAX_LAYOUT_GUIDE_LINES;\n index++, y += size\n ) {\n lines.push({ axis: 'y', position: y })\n }\n return lines\n }\n\n const sections = layoutGuideSections(node, grid)\n for (const section of sections) {\n lines.push(\n { axis: section.axis, position: section.start },\n { axis: section.axis, position: section.end }\n )\n }\n return lines\n}\n"],"mappings":";;AASA,MAAa,yBAAyB;;AAGtC,MAAa,yBAAyB;;AAGtC,SAAgB,gBAAgB,OAA2C;CACzE,OAAO,UAAU,QAAQ,UAAU,
|
|
1
|
+
{"version":3,"file":"guides.js","names":[],"sources":["../../src/layout/guides.ts"],"sourcesContent":["import type { Color } from '../primitives'\nimport type { LayoutGrid, SceneNode } from '../types'\n\nexport interface LayoutGuideLine {\n axis: 'x' | 'y'\n position: number\n}\n\n/** The most lines one guide draws or snaps to on an axis. */\nexport const MAX_LAYOUT_GUIDE_LINES = 10_000\n\n/** Figma's Auto count, as its archive stores it: as many sections as fit. */\nexport const AUTO_LAYOUT_GRID_COUNT = 2_147_483_647\n\n/** Whether a guide's count is Auto: the archive's value, or the plugin API's `Infinity` or `null`. */\nexport function isAutoGridCount(count: number | null | undefined): boolean {\n return count === null || count === Infinity || (count ?? 0) >= AUTO_LAYOUT_GRID_COUNT\n}\n\n/**\n * A guide's count, set in Figma's plugin shape (`count`) or read from a file (`numSections`); an\n * edit's `count` wins over the count the file had. Auto is {@link AUTO_LAYOUT_GRID_COUNT}.\n */\nexport function layoutGridCount(grid: LayoutGrid): number {\n const count = grid.count === undefined ? grid.numSections : grid.count\n return isAutoGridCount(count) ? AUTO_LAYOUT_GRID_COUNT : (count ?? 1)\n}\n\n/** Figma's color for a new guide: red at 10%. */\nexport const DEFAULT_LAYOUT_GRID_COLOR: Readonly<Color> = Object.freeze({\n r: 1,\n g: 0,\n b: 0,\n a: 0.1\n})\n\n/** A guide's pattern in Figma's plugin names, from either shape: the archive's `STRIPES` along an `axis`. */\nexport function layoutGridPattern(\n grid: Pick<LayoutGrid, 'pattern' | 'axis'>\n): 'COLUMNS' | 'ROWS' | 'GRID' {\n if (grid.pattern === 'GRID' || grid.pattern === 'ROWS' || grid.pattern === 'COLUMNS') {\n return grid.pattern\n }\n return grid.axis === 'Y' ? 'ROWS' : 'COLUMNS'\n}\n\n/**\n * A guide's alignment, from either shape. One set without any stretches, as the plugin API and\n * export have read it; a file's guide always has one, as Figma drops a guide without it.\n */\nexport function layoutGridAlignment(\n grid: Pick<LayoutGrid, 'alignment' | 'type'>\n): 'MIN' | 'CENTER' | 'MAX' | 'STRETCH' {\n return grid.alignment ?? grid.type ?? 'STRETCH'\n}\n\n/** Whether a file's guide record names an alignment; Figma drops one that does not (live). */\nexport function hasLayoutGridAlignment(\n grid: Partial<Pick<LayoutGrid, 'alignment' | 'type'>>\n): boolean {\n return grid.type !== undefined || grid.alignment !== undefined\n}\n\n/** A guide's color, Figma's new-guide red for one set without any. */\nexport function layoutGridColor(grid: Pick<LayoutGrid, 'color'>): Color {\n return { ...(grid.color ?? DEFAULT_LAYOUT_GRID_COLOR) }\n}\n\nconst pattern = layoutGridPattern\nconst alignment = layoutGridAlignment\n\n/**\n * How many sections a guide draws. Auto fits as many fixed sections as the frame holds, counting\n * the offset once from the aligned edge, as Figma desktop 126 draws them.\n */\nfunction sectionCount(nodeSize: number, grid: LayoutGrid): number {\n const value = layoutGridCount(grid)\n if (value === AUTO_LAYOUT_GRID_COUNT) {\n const size = grid.sectionSize ?? 0\n if (alignment(grid) === 'STRETCH' || size <= 0) return 0\n const gutter = grid.gutterSize ?? 0\n const offset = alignment(grid) === 'CENTER' ? 0 : (grid.offset ?? 0)\n return Math.min(\n MAX_LAYOUT_GUIDE_LINES,\n Math.max(0, Math.floor((nodeSize - offset + gutter) / (size + gutter)))\n )\n }\n if (!Number.isFinite(value)) return 0\n return Math.min(MAX_LAYOUT_GUIDE_LINES, Math.max(0, Math.floor(value)))\n}\n\nfunction sectionSize(nodeSize: number, grid: LayoutGrid, count: number): number {\n const fixed = grid.sectionSize ?? 0\n if (alignment(grid) !== 'STRETCH') return fixed\n const gutter = grid.gutterSize ?? 0\n const offset = grid.offset ?? 0\n return (nodeSize - offset * 2 - Math.max(0, count - 1) * gutter) / count\n}\n\nfunction start(nodeSize: number, grid: LayoutGrid, size: number, count: number): number {\n const gutter = grid.gutterSize ?? 0\n const offset = grid.offset ?? 0\n const span = count * size + Math.max(0, count - 1) * gutter\n if (alignment(grid) === 'CENTER') return (nodeSize - span) / 2 + offset\n if (alignment(grid) === 'MAX') return nodeSize - span - offset\n return offset\n}\n\nexport interface LayoutGuideSection {\n axis: 'x' | 'y'\n start: number\n end: number\n}\n\nexport function layoutGuideSections(\n node: Pick<SceneNode, 'width' | 'height'>,\n grid: LayoutGrid\n): LayoutGuideSection[] {\n if (grid.visible === false || pattern(grid) === 'GRID') return []\n const axis = pattern(grid) === 'ROWS' ? 'y' : 'x'\n const nodeSize = axis === 'x' ? node.width : node.height\n const count = sectionCount(nodeSize, grid)\n const size = sectionSize(nodeSize, grid, count)\n if (count <= 0 || size <= 0) return []\n const first = start(nodeSize, grid, size, count)\n const step = size + (grid.gutterSize ?? 0)\n return Array.from({ length: count }, (_, index) => {\n const sectionStart = first + index * step\n return { axis, start: sectionStart, end: sectionStart + size }\n })\n}\n\nexport function layoutGuideLines(node: Pick<SceneNode, 'width' | 'height'>, grid: LayoutGrid) {\n if (grid.visible === false) return []\n const gridPattern = pattern(grid)\n const lines: LayoutGuideLine[] = []\n if (gridPattern === 'GRID') {\n const size = grid.sectionSize ?? 0\n if (size <= 0) return lines\n for (\n let index = 0, x = grid.offset ?? 0;\n x <= node.width && index < MAX_LAYOUT_GUIDE_LINES;\n index++, x += size\n ) {\n lines.push({ axis: 'x', position: x })\n }\n for (\n let index = 0, y = grid.offset ?? 0;\n y <= node.height && index < MAX_LAYOUT_GUIDE_LINES;\n index++, y += size\n ) {\n lines.push({ axis: 'y', position: y })\n }\n return lines\n }\n\n const sections = layoutGuideSections(node, grid)\n for (const section of sections) {\n lines.push(\n { axis: section.axis, position: section.start },\n { axis: section.axis, position: section.end }\n )\n }\n return lines\n}\n"],"mappings":";;AASA,MAAa,yBAAyB;;AAGtC,MAAa,yBAAyB;;AAGtC,SAAgB,gBAAgB,OAA2C;CACzE,OAAO,UAAU,QAAQ,UAAU,UAAa,SAAS,MAAA;AAC3D;;;;;AAMA,SAAgB,gBAAgB,MAA0B;CACxD,MAAM,QAAQ,KAAK,UAAU,KAAA,IAAY,KAAK,cAAc,KAAK;CACjE,OAAO,gBAAgB,KAAK,IAAI,yBAA0B,SAAS;AACrE;;AAGA,MAAa,4BAA6C,OAAO,OAAO;CACtE,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACL,CAAC;;AAGD,SAAgB,kBACd,MAC6B;CAC7B,IAAI,KAAK,YAAY,UAAU,KAAK,YAAY,UAAU,KAAK,YAAY,WACzE,OAAO,KAAK;CAEd,OAAO,KAAK,SAAS,MAAM,SAAS;AACtC;;;;;AAMA,SAAgB,oBACd,MACsC;CACtC,OAAO,KAAK,aAAa,KAAK,QAAQ;AACxC;;AAGA,SAAgB,uBACd,MACS;CACT,OAAO,KAAK,SAAS,KAAA,KAAa,KAAK,cAAc,KAAA;AACvD;;AAGA,SAAgB,gBAAgB,MAAwC;CACtE,OAAO,EAAE,GAAI,KAAK,SAAS,0BAA2B;AACxD;AAEA,MAAM,UAAU;AAChB,MAAM,YAAY;;;;;AAMlB,SAAS,aAAa,UAAkB,MAA0B;CAChE,MAAM,QAAQ,gBAAgB,IAAI;CAClC,IAAI,UAAA,YAAkC;EACpC,MAAM,OAAO,KAAK,eAAe;EACjC,IAAI,UAAU,IAAI,MAAM,aAAa,QAAQ,GAAG,OAAO;EACvD,MAAM,SAAS,KAAK,cAAc;EAClC,MAAM,SAAS,UAAU,IAAI,MAAM,WAAW,IAAK,KAAK,UAAU;EAClE,OAAO,KAAK,IACV,wBACA,KAAK,IAAI,GAAG,KAAK,OAAO,WAAW,SAAS,WAAW,OAAO,OAAO,CAAC,CACxE;CACF;CACA,IAAI,CAAC,OAAO,SAAS,KAAK,GAAG,OAAO;CACpC,OAAO,KAAK,IAAI,wBAAwB,KAAK,IAAI,GAAG,KAAK,MAAM,KAAK,CAAC,CAAC;AACxE;AAEA,SAAS,YAAY,UAAkB,MAAkB,OAAuB;CAC9E,MAAM,QAAQ,KAAK,eAAe;CAClC,IAAI,UAAU,IAAI,MAAM,WAAW,OAAO;CAC1C,MAAM,SAAS,KAAK,cAAc;CAElC,QAAQ,YADO,KAAK,UAAU,KACF,IAAI,KAAK,IAAI,GAAG,QAAQ,CAAC,IAAI,UAAU;AACrE;AAEA,SAAS,MAAM,UAAkB,MAAkB,MAAc,OAAuB;CACtF,MAAM,SAAS,KAAK,cAAc;CAClC,MAAM,SAAS,KAAK,UAAU;CAC9B,MAAM,OAAO,QAAQ,OAAO,KAAK,IAAI,GAAG,QAAQ,CAAC,IAAI;CACrD,IAAI,UAAU,IAAI,MAAM,UAAU,QAAQ,WAAW,QAAQ,IAAI;CACjE,IAAI,UAAU,IAAI,MAAM,OAAO,OAAO,WAAW,OAAO;CACxD,OAAO;AACT;AAQA,SAAgB,oBACd,MACA,MACsB;CACtB,IAAI,KAAK,YAAY,SAAS,QAAQ,IAAI,MAAM,QAAQ,OAAO,CAAC;CAChE,MAAM,OAAO,QAAQ,IAAI,MAAM,SAAS,MAAM;CAC9C,MAAM,WAAW,SAAS,MAAM,KAAK,QAAQ,KAAK;CAClD,MAAM,QAAQ,aAAa,UAAU,IAAI;CACzC,MAAM,OAAO,YAAY,UAAU,MAAM,KAAK;CAC9C,IAAI,SAAS,KAAK,QAAQ,GAAG,OAAO,CAAC;CACrC,MAAM,QAAQ,MAAM,UAAU,MAAM,MAAM,KAAK;CAC/C,MAAM,OAAO,QAAQ,KAAK,cAAc;CACxC,OAAO,MAAM,KAAK,EAAE,QAAQ,MAAM,IAAI,GAAG,UAAU;EACjD,MAAM,eAAe,QAAQ,QAAQ;EACrC,OAAO;GAAE;GAAM,OAAO;GAAc,KAAK,eAAe;EAAK;CAC/D,CAAC;AACH;AAEA,SAAgB,iBAAiB,MAA2C,MAAkB;CAC5F,IAAI,KAAK,YAAY,OAAO,OAAO,CAAC;CACpC,MAAM,cAAc,QAAQ,IAAI;CAChC,MAAM,QAA2B,CAAC;CAClC,IAAI,gBAAgB,QAAQ;EAC1B,MAAM,OAAO,KAAK,eAAe;EACjC,IAAI,QAAQ,GAAG,OAAO;EACtB,KACE,IAAI,QAAQ,GAAG,IAAI,KAAK,UAAU,GAClC,KAAK,KAAK,SAAS,QAAA,KACnB,SAAS,KAAK,MAEd,MAAM,KAAK;GAAE,MAAM;GAAK,UAAU;EAAE,CAAC;EAEvC,KACE,IAAI,QAAQ,GAAG,IAAI,KAAK,UAAU,GAClC,KAAK,KAAK,UAAU,QAAA,KACpB,SAAS,KAAK,MAEd,MAAM,KAAK;GAAE,MAAM;GAAK,UAAU;EAAE,CAAC;EAEvC,OAAO;CACT;CAEA,MAAM,WAAW,oBAAoB,MAAM,IAAI;CAC/C,KAAK,MAAM,WAAW,UACpB,MAAM,KACJ;EAAE,MAAM,QAAQ;EAAM,UAAU,QAAQ;CAAM,GAC9C;EAAE,MAAM,QAAQ;EAAM,UAAU,QAAQ;CAAI,CAC9C;CAEF,OAAO;AACT"}
|
package/dist/layout/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { AutoLayoutDirection, paddingFromShorthand, parseAutoLayoutDirection, parseCounterAxisAlign, parseLayoutAlignSelf, parsePrimaryAxisAlign } from "./keywords.js";
|
|
2
1
|
import { aspectRatioLockEditable, enforcedAspectRatio, lockedAspectRatioTarget, recapturedAspectRatio, sizeKeepingAspectRatio } from "./aspect-ratio.js";
|
|
3
2
|
import { flowChildren, inLayoutFlow, isEmptyBoolean } from "./flow.js";
|
|
4
3
|
import { AUTO_LAYOUT_GRID_COUNT, DEFAULT_LAYOUT_GRID_COLOR, LayoutGuideLine, LayoutGuideSection, MAX_LAYOUT_GUIDE_LINES, hasLayoutGridAlignment, isAutoGridCount, layoutGridAlignment, layoutGridColor, layoutGridCount, layoutGridPattern, layoutGuideLines, layoutGuideSections } from "./guides.js";
|
|
4
|
+
import { AutoLayoutDirection, paddingFromShorthand, parseAutoLayoutDirection, parseCounterAxisAlign, parseLayoutAlignSelf, parsePrimaryAxisAlign } from "./keywords.js";
|
|
5
5
|
import { MAX_FONT_SIZE, MAX_GRID_LINE, MAX_GRID_SPAN, MAX_GRID_TRACKS, MAX_LAYOUT_ANGLE, MAX_LAYOUT_FACTOR, MAX_LAYOUT_LENGTH, MAX_LAYOUT_SPACING, MAX_TEXT_LENGTH, clampFontSize, clampGridTracks, clampLayoutLength, clampLayoutPosition } from "./limits.js";
|
|
6
6
|
import { LayoutSizingAxis, autoLayoutSizingFields, fillSizingFields, heldHugAxes, layoutSizing, layoutSizingError, layoutSizingInParent, layoutSizingOptions, layoutSizingUpdates, textAutoResizeFor } from "./sizing.js";
|
|
7
7
|
import { counterAxisSpacingOf, primaryAxisSpacingOf } from "./spacing.js";
|
|
8
|
+
import { paintOrder } from "./stacking.js";
|
|
8
9
|
import { includedStrokeWeights } from "./strokes.js";
|
|
9
|
-
export { AUTO_LAYOUT_GRID_COUNT, AutoLayoutDirection, DEFAULT_LAYOUT_GRID_COLOR, LayoutGuideLine, LayoutGuideSection, LayoutSizingAxis, MAX_FONT_SIZE, MAX_GRID_LINE, MAX_GRID_SPAN, MAX_GRID_TRACKS, MAX_LAYOUT_ANGLE, MAX_LAYOUT_FACTOR, MAX_LAYOUT_GUIDE_LINES, MAX_LAYOUT_LENGTH, MAX_LAYOUT_SPACING, MAX_TEXT_LENGTH, aspectRatioLockEditable, autoLayoutSizingFields, clampFontSize, clampGridTracks, clampLayoutLength, clampLayoutPosition, counterAxisSpacingOf, enforcedAspectRatio, fillSizingFields, flowChildren, hasLayoutGridAlignment, heldHugAxes, inLayoutFlow, includedStrokeWeights, isAutoGridCount, isEmptyBoolean, layoutGridAlignment, layoutGridColor, layoutGridCount, layoutGridPattern, layoutGuideLines, layoutGuideSections, layoutSizing, layoutSizingError, layoutSizingInParent, layoutSizingOptions, layoutSizingUpdates, lockedAspectRatioTarget, paddingFromShorthand, parseAutoLayoutDirection, parseCounterAxisAlign, parseLayoutAlignSelf, parsePrimaryAxisAlign, primaryAxisSpacingOf, recapturedAspectRatio, sizeKeepingAspectRatio, textAutoResizeFor };
|
|
10
|
+
export { AUTO_LAYOUT_GRID_COUNT, AutoLayoutDirection, DEFAULT_LAYOUT_GRID_COLOR, LayoutGuideLine, LayoutGuideSection, LayoutSizingAxis, MAX_FONT_SIZE, MAX_GRID_LINE, MAX_GRID_SPAN, MAX_GRID_TRACKS, MAX_LAYOUT_ANGLE, MAX_LAYOUT_FACTOR, MAX_LAYOUT_GUIDE_LINES, MAX_LAYOUT_LENGTH, MAX_LAYOUT_SPACING, MAX_TEXT_LENGTH, aspectRatioLockEditable, autoLayoutSizingFields, clampFontSize, clampGridTracks, clampLayoutLength, clampLayoutPosition, counterAxisSpacingOf, enforcedAspectRatio, fillSizingFields, flowChildren, hasLayoutGridAlignment, heldHugAxes, inLayoutFlow, includedStrokeWeights, isAutoGridCount, isEmptyBoolean, layoutGridAlignment, layoutGridColor, layoutGridCount, layoutGridPattern, layoutGuideLines, layoutGuideSections, layoutSizing, layoutSizingError, layoutSizingInParent, layoutSizingOptions, layoutSizingUpdates, lockedAspectRatioTarget, paddingFromShorthand, paintOrder, parseAutoLayoutDirection, parseCounterAxisAlign, parseLayoutAlignSelf, parsePrimaryAxisAlign, primaryAxisSpacingOf, recapturedAspectRatio, sizeKeepingAspectRatio, textAutoResizeFor };
|
package/dist/layout/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { flowChildren, inLayoutFlow, isEmptyBoolean } from "./flow.js";
|
|
2
1
|
import { aspectRatioLockEditable, enforcedAspectRatio, lockedAspectRatioTarget, recapturedAspectRatio, sizeKeepingAspectRatio } from "./aspect-ratio.js";
|
|
3
|
-
import {
|
|
4
|
-
import { MAX_FONT_SIZE, MAX_GRID_LINE, MAX_GRID_SPAN, MAX_GRID_TRACKS, MAX_LAYOUT_ANGLE, MAX_LAYOUT_FACTOR, MAX_LAYOUT_LENGTH, MAX_LAYOUT_SPACING, MAX_TEXT_LENGTH, clampFontSize, clampGridTracks, clampLayoutLength, clampLayoutPosition } from "./limits.js";
|
|
5
|
-
import { paddingFromShorthand, parseAutoLayoutDirection, parseCounterAxisAlign, parseLayoutAlignSelf, parsePrimaryAxisAlign } from "./keywords.js";
|
|
2
|
+
import { flowChildren, inLayoutFlow, isEmptyBoolean } from "./flow.js";
|
|
6
3
|
import { AUTO_LAYOUT_GRID_COUNT, DEFAULT_LAYOUT_GRID_COLOR, MAX_LAYOUT_GUIDE_LINES, hasLayoutGridAlignment, isAutoGridCount, layoutGridAlignment, layoutGridColor, layoutGridCount, layoutGridPattern, layoutGuideLines, layoutGuideSections } from "./guides.js";
|
|
4
|
+
import { paddingFromShorthand, parseAutoLayoutDirection, parseCounterAxisAlign, parseLayoutAlignSelf, parsePrimaryAxisAlign } from "./keywords.js";
|
|
5
|
+
import { MAX_FONT_SIZE, MAX_GRID_LINE, MAX_GRID_SPAN, MAX_GRID_TRACKS, MAX_LAYOUT_ANGLE, MAX_LAYOUT_FACTOR, MAX_LAYOUT_LENGTH, MAX_LAYOUT_SPACING, MAX_TEXT_LENGTH, clampFontSize, clampGridTracks, clampLayoutLength, clampLayoutPosition } from "./limits.js";
|
|
6
|
+
import { autoLayoutSizingFields, fillSizingFields, heldHugAxes, layoutSizing, layoutSizingError, layoutSizingInParent, layoutSizingOptions, layoutSizingUpdates, textAutoResizeFor } from "./sizing.js";
|
|
7
7
|
import { counterAxisSpacingOf, primaryAxisSpacingOf } from "./spacing.js";
|
|
8
|
+
import { paintOrder } from "./stacking.js";
|
|
8
9
|
import { includedStrokeWeights } from "./strokes.js";
|
|
9
|
-
export { AUTO_LAYOUT_GRID_COUNT, DEFAULT_LAYOUT_GRID_COLOR, MAX_FONT_SIZE, MAX_GRID_LINE, MAX_GRID_SPAN, MAX_GRID_TRACKS, MAX_LAYOUT_ANGLE, MAX_LAYOUT_FACTOR, MAX_LAYOUT_GUIDE_LINES, MAX_LAYOUT_LENGTH, MAX_LAYOUT_SPACING, MAX_TEXT_LENGTH, aspectRatioLockEditable, autoLayoutSizingFields, clampFontSize, clampGridTracks, clampLayoutLength, clampLayoutPosition, counterAxisSpacingOf, enforcedAspectRatio, fillSizingFields, flowChildren, hasLayoutGridAlignment, heldHugAxes, inLayoutFlow, includedStrokeWeights, isAutoGridCount, isEmptyBoolean, layoutGridAlignment, layoutGridColor, layoutGridCount, layoutGridPattern, layoutGuideLines, layoutGuideSections, layoutSizing, layoutSizingError, layoutSizingInParent, layoutSizingOptions, layoutSizingUpdates, lockedAspectRatioTarget, paddingFromShorthand, parseAutoLayoutDirection, parseCounterAxisAlign, parseLayoutAlignSelf, parsePrimaryAxisAlign, primaryAxisSpacingOf, recapturedAspectRatio, sizeKeepingAspectRatio, textAutoResizeFor };
|
|
10
|
+
export { AUTO_LAYOUT_GRID_COUNT, DEFAULT_LAYOUT_GRID_COLOR, MAX_FONT_SIZE, MAX_GRID_LINE, MAX_GRID_SPAN, MAX_GRID_TRACKS, MAX_LAYOUT_ANGLE, MAX_LAYOUT_FACTOR, MAX_LAYOUT_GUIDE_LINES, MAX_LAYOUT_LENGTH, MAX_LAYOUT_SPACING, MAX_TEXT_LENGTH, aspectRatioLockEditable, autoLayoutSizingFields, clampFontSize, clampGridTracks, clampLayoutLength, clampLayoutPosition, counterAxisSpacingOf, enforcedAspectRatio, fillSizingFields, flowChildren, hasLayoutGridAlignment, heldHugAxes, inLayoutFlow, includedStrokeWeights, isAutoGridCount, isEmptyBoolean, layoutGridAlignment, layoutGridColor, layoutGridCount, layoutGridPattern, layoutGuideLines, layoutGuideSections, layoutSizing, layoutSizingError, layoutSizingInParent, layoutSizingOptions, layoutSizingUpdates, lockedAspectRatioTarget, paddingFromShorthand, paintOrder, parseAutoLayoutDirection, parseCounterAxisAlign, parseLayoutAlignSelf, parsePrimaryAxisAlign, primaryAxisSpacingOf, recapturedAspectRatio, sizeKeepingAspectRatio, textAutoResizeFor };
|
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
import { LayoutAlign, LayoutAlignSelf, LayoutCounterAlign, SceneNode } from "../types.js";
|
|
2
|
-
//#region src/layout/keywords.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Auto layout as the formats that author it spell it: flexbox keywords from CSS, design JSX,
|
|
5
4
|
* and `.pen` files. Each format keeps its own syntax and defaults; what a keyword means for the
|
|
6
5
|
* scene graph is decided here once, so `space-between` or `baseline` cannot mean one thing in
|
|
7
6
|
* one format and fall back to start in another.
|
|
8
7
|
*/
|
|
9
|
-
type AutoLayoutDirection = 'HORIZONTAL' | 'VERTICAL';
|
|
8
|
+
export type AutoLayoutDirection = 'HORIZONTAL' | 'VERTICAL';
|
|
10
9
|
/** The stack direction a `flex-direction`-like keyword names, or `undefined` for any other. */
|
|
11
|
-
declare function parseAutoLayoutDirection(value: string | undefined): AutoLayoutDirection | undefined;
|
|
10
|
+
export declare function parseAutoLayoutDirection(value: string | undefined): AutoLayoutDirection | undefined;
|
|
12
11
|
/**
|
|
13
12
|
* Primary axis alignment from a `justify-content` keyword. Auto layout has no
|
|
14
13
|
* `space-around` or `space-evenly`, so those, like unknown keywords, give `undefined`.
|
|
15
14
|
*/
|
|
16
|
-
declare function parsePrimaryAxisAlign(value: string | undefined): LayoutAlign | undefined;
|
|
15
|
+
export declare function parsePrimaryAxisAlign(value: string | undefined): LayoutAlign | undefined;
|
|
17
16
|
/** Cross axis alignment of a stack's children from an `align-items` keyword. */
|
|
18
|
-
declare function parseCounterAxisAlign(value: string | undefined): LayoutCounterAlign | undefined;
|
|
17
|
+
export declare function parseCounterAxisAlign(value: string | undefined): LayoutCounterAlign | undefined;
|
|
19
18
|
/** One child's cross axis alignment from an `align-self` keyword; `auto` follows the parent. */
|
|
20
|
-
declare function parseLayoutAlignSelf(value: string | undefined): LayoutAlignSelf | undefined;
|
|
19
|
+
export declare function parseLayoutAlignSelf(value: string | undefined): LayoutAlignSelf | undefined;
|
|
21
20
|
type PaddingFields = Pick<SceneNode, 'paddingTop' | 'paddingRight' | 'paddingBottom' | 'paddingLeft'>;
|
|
22
21
|
/** Padding from one to four values in CSS shorthand order: top, right, bottom, left. */
|
|
23
|
-
declare function paddingFromShorthand(values: readonly number[]): PaddingFields;
|
|
24
|
-
|
|
25
|
-
export { AutoLayoutDirection, paddingFromShorthand, parseAutoLayoutDirection, parseCounterAxisAlign, parseLayoutAlignSelf, parsePrimaryAxisAlign };
|
|
22
|
+
export declare function paddingFromShorthand(values: readonly number[]): PaddingFields;
|
|
23
|
+
export {};
|
|
26
24
|
//# sourceMappingURL=keywords.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keywords.d.ts","names":[],"sources":["../../src/layout/keywords.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"keywords.d.ts","names":[],"sources":["../../src/layout/keywords.ts"],"mappings":";;;;;;;YAQY;;wBA6BI,yBACd,4BACC;;;;;wBASa,sBAAsB,4BAA4B;;wBAQlD,sBAAsB,4BAA4B;;wBASlD,qBAAqB,4BAA4B;KAI5D,gBAAgB,KACnB;;wBAKc,qBAAqB,4BAA4B"}
|
package/dist/layout/keywords.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/layout/keywords.ts
|
|
2
2
|
const DIRECTIONS = /* @__PURE__ */ new Map([
|
|
3
3
|
["row", "HORIZONTAL"],
|
|
4
4
|
["horizontal", "HORIZONTAL"],
|
|
@@ -59,7 +59,6 @@ function paddingFromShorthand(values) {
|
|
|
59
59
|
paddingLeft: left
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
-
//#endregion
|
|
63
62
|
export { paddingFromShorthand, parseAutoLayoutDirection, parseCounterAxisAlign, parseLayoutAlignSelf, parsePrimaryAxisAlign };
|
|
64
63
|
|
|
65
64
|
//# sourceMappingURL=keywords.js.map
|
package/dist/layout/limits.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { GridTrack } from "../types.js";
|
|
2
|
-
//#region src/layout/limits.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Bounds for the numbers layout computes with and for the values it writes back.
|
|
5
4
|
*
|
|
@@ -10,31 +9,29 @@ import { GridTrack } from "../types.js";
|
|
|
10
9
|
* clamps to these bounds, and tool schemas reject values outside them.
|
|
11
10
|
*/
|
|
12
11
|
/** The largest size or position, in pixels, that a layout value may carry. */
|
|
13
|
-
declare const MAX_LAYOUT_LENGTH = 1000000;
|
|
12
|
+
export declare const MAX_LAYOUT_LENGTH = 1000000;
|
|
14
13
|
/** The largest gap, padding, or stroke a layout value may carry, in pixels. */
|
|
15
|
-
declare const MAX_LAYOUT_SPACING = 100000;
|
|
14
|
+
export declare const MAX_LAYOUT_SPACING = 100000;
|
|
16
15
|
/** The largest number of tracks one grid template may name. */
|
|
17
|
-
declare const MAX_GRID_TRACKS = 1000;
|
|
16
|
+
export declare const MAX_GRID_TRACKS = 1000;
|
|
18
17
|
/** The last grid line a placement may name; line 0 leaves placement to auto-flow. */
|
|
19
|
-
declare const MAX_GRID_LINE = 1000;
|
|
18
|
+
export declare const MAX_GRID_LINE = 1000;
|
|
20
19
|
/** The most tracks one grid item may span. */
|
|
21
|
-
declare const MAX_GRID_SPAN = 1000;
|
|
20
|
+
export declare const MAX_GRID_SPAN = 1000;
|
|
22
21
|
/** The largest rotation, in degrees, a layout or transform may carry. */
|
|
23
|
-
declare const MAX_LAYOUT_ANGLE = 360000;
|
|
22
|
+
export declare const MAX_LAYOUT_ANGLE = 360000;
|
|
24
23
|
/** The largest font size, in pixels, text may be set in. */
|
|
25
|
-
declare const MAX_FONT_SIZE = 10000;
|
|
24
|
+
export declare const MAX_FONT_SIZE = 10000;
|
|
26
25
|
/** The largest ratio a layout factor, such as a flex grow share, may carry. */
|
|
27
|
-
declare const MAX_LAYOUT_FACTOR = 1000;
|
|
26
|
+
export declare const MAX_LAYOUT_FACTOR = 1000;
|
|
28
27
|
/** The largest line height or letter spacing, in pixels or percent, a text may carry. */
|
|
29
|
-
declare const MAX_TEXT_LENGTH = 10000;
|
|
28
|
+
export declare const MAX_TEXT_LENGTH = 10000;
|
|
30
29
|
/** A length that cannot be negative, such as a size, padding, gap, or radius. */
|
|
31
|
-
declare function clampLayoutLength(value: number, max?: number): number;
|
|
30
|
+
export declare function clampLayoutLength(value: number, max?: number): number;
|
|
32
31
|
/** A coordinate that may be negative, such as a position. */
|
|
33
|
-
declare function clampLayoutPosition(value: number, max?: number): number;
|
|
32
|
+
export declare function clampLayoutPosition(value: number, max?: number): number;
|
|
34
33
|
/** A font size in pixels, at least one and at most `MAX_FONT_SIZE`; fractions are kept. */
|
|
35
|
-
declare function clampFontSize(value: number): number;
|
|
34
|
+
export declare function clampFontSize(value: number): number;
|
|
36
35
|
/** A grid template's tracks, with at most `MAX_GRID_TRACKS` of them and no negative sizes. */
|
|
37
|
-
declare function clampGridTracks(tracks: readonly GridTrack[]): GridTrack[];
|
|
38
|
-
//#endregion
|
|
39
|
-
export { MAX_FONT_SIZE, MAX_GRID_LINE, MAX_GRID_SPAN, MAX_GRID_TRACKS, MAX_LAYOUT_ANGLE, MAX_LAYOUT_FACTOR, MAX_LAYOUT_LENGTH, MAX_LAYOUT_SPACING, MAX_TEXT_LENGTH, clampFontSize, clampGridTracks, clampLayoutLength, clampLayoutPosition };
|
|
36
|
+
export declare function clampGridTracks(tracks: readonly GridTrack[]): GridTrack[];
|
|
40
37
|
//# sourceMappingURL=limits.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limits.d.ts","names":[],"sources":["../../src/layout/limits.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"limits.d.ts","names":[],"sources":["../../src/layout/limits.ts"],"mappings":";;;;;;;;;;;qBAaa;;qBAGA;;qBAGA;;qBAGA;;qBAGA;;qBAGA;;qBAGA;;qBAGA;;qBAGA;;wBAGG,kBAAkB,eAAe;;wBAMjC,oBAAoB,eAAe;;wBAMnC,cAAc;;wBAMd,gBAAgB,iBAAiB,cAAc"}
|
package/dist/layout/limits.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/layout/limits.ts
|
|
2
2
|
/**
|
|
3
3
|
* Bounds for the numbers layout computes with and for the values it writes back.
|
|
4
4
|
*
|
|
@@ -48,7 +48,6 @@ function clampGridTracks(tracks) {
|
|
|
48
48
|
value: clampLayoutLength(track.value)
|
|
49
49
|
}));
|
|
50
50
|
}
|
|
51
|
-
//#endregion
|
|
52
51
|
export { MAX_FONT_SIZE, MAX_GRID_LINE, MAX_GRID_SPAN, MAX_GRID_TRACKS, MAX_LAYOUT_ANGLE, MAX_LAYOUT_FACTOR, MAX_LAYOUT_LENGTH, MAX_LAYOUT_SPACING, MAX_TEXT_LENGTH, clampFontSize, clampGridTracks, clampLayoutLength, clampLayoutPosition };
|
|
53
52
|
|
|
54
53
|
//# sourceMappingURL=limits.js.map
|
package/dist/layout/sizing.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SceneGraph } from "../graph.js";
|
|
2
2
|
import { LayoutSizing, SceneNode, TextAutoResize } from "../types.js";
|
|
3
|
-
//#region src/layout/sizing.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* How a node sizes along one screen axis, as Figma's `layoutSizingHorizontal` and
|
|
6
5
|
* `layoutSizingVertical` report it. Fill is stored on the child, the way Figma stores it:
|
|
@@ -9,32 +8,32 @@ import { LayoutSizing, SceneNode, TextAutoResize } from "../types.js";
|
|
|
9
8
|
* `primaryAxisSizing` and `counterAxisSizing` for an auto-layout frame, `textAutoResize`
|
|
10
9
|
* for text.
|
|
11
10
|
*/
|
|
12
|
-
type LayoutSizingAxis = 'HORIZONTAL' | 'VERTICAL';
|
|
11
|
+
export type LayoutSizingAxis = 'HORIZONTAL' | 'VERTICAL';
|
|
13
12
|
type AutoLayoutMode = Exclude<SceneNode['layoutMode'], 'NONE'>;
|
|
14
13
|
/** The node's sizing along `axis`: fill from its parent, else its own hug, else fixed. */
|
|
15
|
-
declare function layoutSizing(graph: SceneGraph, node: SceneNode, axis: LayoutSizingAxis): LayoutSizing;
|
|
14
|
+
export declare function layoutSizing(graph: SceneGraph, node: SceneNode, axis: LayoutSizingAxis): LayoutSizing;
|
|
16
15
|
/** `layoutSizing` for code that holds the parent rather than the graph. */
|
|
17
|
-
declare function layoutSizingInParent(parentNode: SceneNode | undefined, node: SceneNode, axis: LayoutSizingAxis): LayoutSizing;
|
|
16
|
+
export declare function layoutSizingInParent(parentNode: SceneNode | undefined, node: SceneNode, axis: LayoutSizingAxis): LayoutSizing;
|
|
18
17
|
/** The sizings this node accepts on either axis, in Figma's order. */
|
|
19
|
-
declare function layoutSizingOptions(graph: SceneGraph, node: SceneNode): LayoutSizing[];
|
|
18
|
+
export declare function layoutSizingOptions(graph: SceneGraph, node: SceneNode): LayoutSizing[];
|
|
20
19
|
/** Figma's reason for refusing `value` on this node, or `undefined` when it applies. */
|
|
21
|
-
declare function layoutSizingError(graph: SceneGraph, node: SceneNode, value: LayoutSizing): string | undefined;
|
|
20
|
+
export declare function layoutSizingError(graph: SceneGraph, node: SceneNode, value: LayoutSizing): string | undefined;
|
|
22
21
|
/** The text auto-resize that hugs the content along the axes given. */
|
|
23
|
-
declare function textAutoResizeFor(hugsWidth: boolean, hugsHeight: boolean): TextAutoResize;
|
|
22
|
+
export declare function textAutoResizeFor(hugsWidth: boolean, hugsHeight: boolean): TextAutoResize;
|
|
24
23
|
/**
|
|
25
24
|
* The fields that set the node's sizing along `axis` to `value`, as Figma's setter writes
|
|
26
25
|
* them. A value Figma refuses yields no updates; `layoutSizingError` says why.
|
|
27
26
|
*/
|
|
28
|
-
declare function layoutSizingUpdates(graph: SceneGraph, node: SceneNode, axis: LayoutSizingAxis, value: LayoutSizing): Partial<SceneNode>;
|
|
27
|
+
export declare function layoutSizingUpdates(graph: SceneGraph, node: SceneNode, axis: LayoutSizingAxis, value: LayoutSizing): Partial<SceneNode>;
|
|
29
28
|
/**
|
|
30
29
|
* The fields that make a child fill `axis` of a parent laid out as `parentLayout`, for a node
|
|
31
30
|
* an importer builds before it joins the graph. Under a parent without auto layout, such as a
|
|
32
31
|
* staging parent the node leaves when placed, both are set, so it fills whichever axis its
|
|
33
32
|
* eventual parent stacks along.
|
|
34
33
|
*/
|
|
35
|
-
declare function fillSizingFields(parentLayout: SceneNode['layoutMode'], axis: LayoutSizingAxis): Partial<Pick<SceneNode, 'layoutGrow' | 'layoutAlignSelf'>>;
|
|
34
|
+
export declare function fillSizingFields(parentLayout: SceneNode['layoutMode'], axis: LayoutSizingAxis): Partial<Pick<SceneNode, 'layoutGrow' | 'layoutAlignSelf'>>;
|
|
36
35
|
/** An auto-layout frame's own sizing when it hugs or fixes its width and height. */
|
|
37
|
-
declare function autoLayoutSizingFields(direction: AutoLayoutMode, width: 'FIXED' | 'HUG', height: 'FIXED' | 'HUG'): Pick<SceneNode, 'primaryAxisSizing' | 'counterAxisSizing'>;
|
|
36
|
+
export declare function autoLayoutSizingFields(direction: AutoLayoutMode, width: 'FIXED' | 'HUG', height: 'FIXED' | 'HUG'): Pick<SceneNode, 'primaryAxisSizing' | 'counterAxisSizing'>;
|
|
38
37
|
/**
|
|
39
38
|
* The axes a frame hugs but keeps its size on, as Figma keeps them. With nothing in its flow,
|
|
40
39
|
* no visible layer that is not placed absolutely, it keeps every axis it hugs: a new frame keeps
|
|
@@ -42,7 +41,6 @@ declare function autoLayoutSizingFields(direction: AutoLayoutMode, width: 'FIXED
|
|
|
42
41
|
* counter axis it also keeps its size when every child in its flow fills that axis and none has
|
|
43
42
|
* content of its own to hug.
|
|
44
43
|
*/
|
|
45
|
-
declare function heldHugAxes(graph: SceneGraph, frame: SceneNode): ('width' | 'height')[];
|
|
46
|
-
|
|
47
|
-
export { LayoutSizingAxis, autoLayoutSizingFields, fillSizingFields, heldHugAxes, layoutSizing, layoutSizingError, layoutSizingInParent, layoutSizingOptions, layoutSizingUpdates, textAutoResizeFor };
|
|
44
|
+
export declare function heldHugAxes(graph: SceneGraph, frame: SceneNode): ('width' | 'height')[];
|
|
45
|
+
export {};
|
|
48
46
|
//# sourceMappingURL=sizing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sizing.d.ts","names":[],"sources":["../../src/layout/sizing.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sizing.d.ts","names":[],"sources":["../../src/layout/sizing.ts"],"mappings":";;;;;;;;;;YAYY;KAEP,iBAAiB,QAAQ;;wBAgDd,aACd,OAAO,YACP,MAAM,WACN,MAAM,mBACL;;wBAKa,qBACd,YAAY,uBACZ,MAAM,WACN,MAAM,mBACL;;wBASa,oBAAoB,OAAO,YAAY,MAAM,YAAY;;wBAOzD,kBACd,OAAO,YACP,MAAM,WACN,OAAO;;wBAoBO,kBAAkB,oBAAoB,sBAAsB;;;;;wBAyB5D,oBACd,OAAO,YACP,MAAM,WACN,MAAM,kBACN,OAAO,eACN,QAAQ;;;;;;;wBA+BK,iBACd,cAAc,yBACd,MAAM,mBACL,QAAQ,KAAK;;wBAMA,uBACd,WAAW,gBACX,wBACA,0BACC,KAAK;;;;;;;;wBAeQ,YAAY,OAAO,YAAY,OAAO"}
|
package/dist/layout/sizing.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { flowChildren } from "./flow.js";
|
|
2
|
-
|
|
2
|
+
// src/layout/sizing.ts
|
|
3
3
|
function primaryAxis(mode) {
|
|
4
4
|
return mode === "VERTICAL" ? "VERTICAL" : "HORIZONTAL";
|
|
5
5
|
}
|
|
@@ -131,7 +131,6 @@ function heldHugAxes(graph, frame) {
|
|
|
131
131
|
if (flow.length === 0) return hugged;
|
|
132
132
|
return flow.every((child) => child.layoutMode === "NONE" && child.type !== "TEXT" && (child.layoutAlignSelf === "STRETCH" || child.layoutAlignSelf === "AUTO" && frame.counterAxisAlign === "STRETCH")) && frame.counterAxisSizing === "HUG" ? [counter] : [];
|
|
133
133
|
}
|
|
134
|
-
//#endregion
|
|
135
134
|
export { autoLayoutSizingFields, fillSizingFields, heldHugAxes, layoutSizing, layoutSizingError, layoutSizingInParent, layoutSizingOptions, layoutSizingUpdates, textAutoResizeFor };
|
|
136
135
|
|
|
137
136
|
//# sourceMappingURL=sizing.js.map
|
package/dist/layout/spacing.d.ts
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { SceneNode } from "../types.js";
|
|
2
|
-
//#region src/layout/spacing.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* The space between wrapped lines of an auto layout. A frame without its own follows the item
|
|
5
4
|
* spacing, as Figma's `counterAxisSpacing: null` does.
|
|
6
5
|
*/
|
|
7
|
-
declare function counterAxisSpacingOf(node: Pick<SceneNode, 'counterAxisSpacing' | 'itemSpacing'>): number;
|
|
6
|
+
export declare function counterAxisSpacingOf(node: Pick<SceneNode, 'counterAxisSpacing' | 'itemSpacing'>): number;
|
|
8
7
|
/**
|
|
9
8
|
* The space an auto layout keeps between its items along its axis. Space between takes the place
|
|
10
9
|
* of the gap, as in Figma. A generated frame keeps it as the least space between its sublayers,
|
|
11
10
|
* as a sticky note keeps its author clear of a long body.
|
|
12
11
|
*/
|
|
13
|
-
declare function primaryAxisSpacingOf(node: Pick<SceneNode, 'type' | 'primaryAxisAlign' | 'itemSpacing'>): number;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { counterAxisSpacingOf, primaryAxisSpacingOf };
|
|
12
|
+
export declare function primaryAxisSpacingOf(node: Pick<SceneNode, 'type' | 'primaryAxisAlign' | 'itemSpacing'>): number;
|
|
16
13
|
//# sourceMappingURL=spacing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spacing.d.ts","names":[],"sources":["../../src/layout/spacing.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"spacing.d.ts","names":[],"sources":["../../src/layout/spacing.ts"],"mappings":";;;;;wBAOgB,qBACd,MAAM,KAAK;;;;;;wBAUG,qBACd,MAAM,KAAK"}
|
package/dist/layout/spacing.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isGeneratedFrame } from "../generated/index.js";
|
|
2
|
-
|
|
2
|
+
// src/layout/spacing.ts
|
|
3
3
|
/**
|
|
4
4
|
* The space between wrapped lines of an auto layout. A frame without its own follows the item
|
|
5
5
|
* spacing, as Figma's `counterAxisSpacing: null` does.
|
|
@@ -15,7 +15,6 @@ function counterAxisSpacingOf(node) {
|
|
|
15
15
|
function primaryAxisSpacingOf(node) {
|
|
16
16
|
return node.primaryAxisAlign === "SPACE_BETWEEN" && !isGeneratedFrame(node) ? 0 : node.itemSpacing;
|
|
17
17
|
}
|
|
18
|
-
//#endregion
|
|
19
18
|
export { counterAxisSpacingOf, primaryAxisSpacingOf };
|
|
20
19
|
|
|
21
20
|
//# sourceMappingURL=spacing.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SceneNode } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* A layer's children in the order they are drawn, the first at the bottom. An auto layout frame
|
|
4
|
+
* that stacks its first layer on top (`itemReverseZIndex`, Figma's "first on top" and Sketch's
|
|
5
|
+
* stack layering) draws them last to first; the flag means nothing outside auto layout.
|
|
6
|
+
*/
|
|
7
|
+
export declare function paintOrder(node: Pick<SceneNode, 'childIds' | 'itemReverseZIndex' | 'layoutMode'>): readonly string[];
|
|
8
|
+
//# sourceMappingURL=stacking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stacking.d.ts","names":[],"sources":["../../src/layout/stacking.ts"],"mappings":";;;;;;wBAOgB,WACd,MAAM,KAAK"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/layout/stacking.ts
|
|
2
|
+
/**
|
|
3
|
+
* A layer's children in the order they are drawn, the first at the bottom. An auto layout frame
|
|
4
|
+
* that stacks its first layer on top (`itemReverseZIndex`, Figma's "first on top" and Sketch's
|
|
5
|
+
* stack layering) draws them last to first; the flag means nothing outside auto layout.
|
|
6
|
+
*/
|
|
7
|
+
function paintOrder(node) {
|
|
8
|
+
return node.itemReverseZIndex && node.layoutMode !== "NONE" ? node.childIds.toReversed() : node.childIds;
|
|
9
|
+
}
|
|
10
|
+
export { paintOrder };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=stacking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stacking.js","names":[],"sources":["../../src/layout/stacking.ts"],"sourcesContent":["import type { SceneNode } from '../types'\n\n/**\n * A layer's children in the order they are drawn, the first at the bottom. An auto layout frame\n * that stacks its first layer on top (`itemReverseZIndex`, Figma's \"first on top\" and Sketch's\n * stack layering) draws them last to first; the flag means nothing outside auto layout.\n */\nexport function paintOrder(\n node: Pick<SceneNode, 'childIds' | 'itemReverseZIndex' | 'layoutMode'>\n): readonly string[] {\n return node.itemReverseZIndex && node.layoutMode !== 'NONE'\n ? node.childIds.toReversed()\n : node.childIds\n}\n"],"mappings":";;;;;;AAOA,SAAgB,WACd,MACmB;CACnB,OAAO,KAAK,qBAAqB,KAAK,eAAe,SACjD,KAAK,SAAS,WAAW,IACzB,KAAK;AACX"}
|
package/dist/layout/strokes.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { SceneNode } from "../types.js";
|
|
2
|
-
//#region src/layout/strokes.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* The stroke a frame counts inside its padding, per side: its visible INSIDE strokes when its
|
|
5
4
|
* strokes are included in layout, as Figma lays it out and as a CSS border takes room.
|
|
6
5
|
*/
|
|
7
|
-
declare function includedStrokeWeights(node: SceneNode): Record<'top' | 'right' | 'bottom' | 'left', number>;
|
|
8
|
-
//#endregion
|
|
9
|
-
export { includedStrokeWeights };
|
|
6
|
+
export declare function includedStrokeWeights(node: SceneNode): Record<'top' | 'right' | 'bottom' | 'left', number>;
|
|
10
7
|
//# sourceMappingURL=strokes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strokes.d.ts","names":[],"sources":["../../src/layout/strokes.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"strokes.d.ts","names":[],"sources":["../../src/layout/strokes.ts"],"mappings":";;;;;wBAMgB,sBACd,MAAM,YACL"}
|
package/dist/layout/strokes.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/layout/strokes.ts
|
|
2
2
|
/**
|
|
3
3
|
* The stroke a frame counts inside its padding, per side: its visible INSIDE strokes when its
|
|
4
4
|
* strokes are included in layout, as Figma lays it out and as a CSS border takes room.
|
|
@@ -24,7 +24,6 @@ function includedStrokeWeights(node) {
|
|
|
24
24
|
left: node.borderLeftWeight
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
//#endregion
|
|
28
27
|
export { includedStrokeWeights };
|
|
29
28
|
|
|
30
29
|
//# sourceMappingURL=strokes.js.map
|
package/dist/layout/writes.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SIZE_FIELDS, TRANSFORM_FIELDS } from "../fields/geometry.js";
|
|
2
|
-
|
|
2
|
+
// src/layout/writes.ts
|
|
3
3
|
/** The layout results a format keeps apart from what it saved once an edit moves or sizes. */
|
|
4
4
|
const EDITED_GEOMETRY_FIELDS = /* @__PURE__ */ new Set([...TRANSFORM_FIELDS, ...SIZE_FIELDS]);
|
|
5
5
|
/**
|
|
@@ -49,7 +49,6 @@ var LayoutWrites = class {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
//#endregion
|
|
53
52
|
export { LayoutWrites };
|
|
54
53
|
|
|
55
54
|
//# sourceMappingURL=writes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writes.js","names":[],"sources":["../../src/layout/writes.ts"],"sourcesContent":["import { SIZE_FIELDS, TRANSFORM_FIELDS } from '../fields/geometry'\nimport type { SceneNode } from '../types'\n\n/** The layout results a format keeps apart from what it saved once an edit moves or sizes. */\nconst EDITED_GEOMETRY_FIELDS: ReadonlySet<keyof SceneNode> = new Set([\n ...TRANSFORM_FIELDS,\n ...SIZE_FIELDS\n])\n\ninterface LayerWrites {\n before: Partial<SceneNode>\n changed: Set<keyof SceneNode>\n /** Geometry an edit's layout wrote, rather than layout of what the document already holds. */\n edited: Set<keyof SceneNode>\n}\n\n/**\n * What one layout run writes to each layer: the values before its first write, and the keys it\n * actually changed. Layout passes can size a layer and size it back, such as a frame laid out on\n * its own and then by its parent, so a key that changed and came back is left out of the update.\n */\nexport class LayoutWrites {\n private readonly layers = new Map<string, LayerWrites>()\n\n /** Call before `changes` are applied to `node`; `edit` when an edit's layout writes them. */\n record(node: SceneNode, changes: Partial<SceneNode>, edit: boolean): void {\n let layer = this.layers.get(node.id)\n if (!layer) {\n layer = { before: {}, changed: new Set(), edited: new Set() }\n this.layers.set(node.id, layer)\n }\n for (const key of Object.keys(changes) as (keyof SceneNode)[]) {\n if (!Object.hasOwn(layer.before, key)) Object.assign(layer.before, { [key]: node[key] })\n if (!Object.is(node[key], changes[key])) layer.changed.add(key)\n if (edit && EDITED_GEOMETRY_FIELDS.has(key)) layer.edited.add(key)\n }\n }\n\n /**\n * Each written layer's update: the values layout changed and kept, and values it wrote as they\n * already were, which a preview's commit writes to publish what it showed. With it come the\n * geometry fields of that update an edit's layout wrote, which count as edited.\n */\n *updates(\n getNode: (id: string) => SceneNode | undefined\n ): Generator<[SceneNode, Partial<SceneNode>, (keyof SceneNode)[]]> {\n for (const [id, { before, changed, edited }] of this.layers) {\n const node = getNode(id)\n if (!node) continue\n const changes: Partial<SceneNode> = {}\n for (const key of Object.keys(before) as (keyof SceneNode)[]) {\n if (changed.has(key) && Object.is(node[key], before[key])) continue\n Object.assign(changes, { [key]: node[key] })\n }\n const keys = Object.keys(changes) as (keyof SceneNode)[]\n if (keys.length > 0) yield [node, changes, keys.filter((key) => edited.has(key))]\n }\n }\n}\n"],"mappings":";;;AAIA,MAAM,yCAAuD,IAAI,IAAI,CACnE,GAAG,kBACH,GAAG,WACL,CAAC;;;;;;AAcD,IAAa,eAAb,MAA0B;
|
|
1
|
+
{"version":3,"file":"writes.js","names":[],"sources":["../../src/layout/writes.ts"],"sourcesContent":["import { SIZE_FIELDS, TRANSFORM_FIELDS } from '../fields/geometry'\nimport type { SceneNode } from '../types'\n\n/** The layout results a format keeps apart from what it saved once an edit moves or sizes. */\nconst EDITED_GEOMETRY_FIELDS: ReadonlySet<keyof SceneNode> = new Set([\n ...TRANSFORM_FIELDS,\n ...SIZE_FIELDS\n])\n\ninterface LayerWrites {\n before: Partial<SceneNode>\n changed: Set<keyof SceneNode>\n /** Geometry an edit's layout wrote, rather than layout of what the document already holds. */\n edited: Set<keyof SceneNode>\n}\n\n/**\n * What one layout run writes to each layer: the values before its first write, and the keys it\n * actually changed. Layout passes can size a layer and size it back, such as a frame laid out on\n * its own and then by its parent, so a key that changed and came back is left out of the update.\n */\nexport class LayoutWrites {\n private readonly layers = new Map<string, LayerWrites>()\n\n /** Call before `changes` are applied to `node`; `edit` when an edit's layout writes them. */\n record(node: SceneNode, changes: Partial<SceneNode>, edit: boolean): void {\n let layer = this.layers.get(node.id)\n if (!layer) {\n layer = { before: {}, changed: new Set(), edited: new Set() }\n this.layers.set(node.id, layer)\n }\n for (const key of Object.keys(changes) as (keyof SceneNode)[]) {\n if (!Object.hasOwn(layer.before, key)) Object.assign(layer.before, { [key]: node[key] })\n if (!Object.is(node[key], changes[key])) layer.changed.add(key)\n if (edit && EDITED_GEOMETRY_FIELDS.has(key)) layer.edited.add(key)\n }\n }\n\n /**\n * Each written layer's update: the values layout changed and kept, and values it wrote as they\n * already were, which a preview's commit writes to publish what it showed. With it come the\n * geometry fields of that update an edit's layout wrote, which count as edited.\n */\n *updates(\n getNode: (id: string) => SceneNode | undefined\n ): Generator<[SceneNode, Partial<SceneNode>, (keyof SceneNode)[]]> {\n for (const [id, { before, changed, edited }] of this.layers) {\n const node = getNode(id)\n if (!node) continue\n const changes: Partial<SceneNode> = {}\n for (const key of Object.keys(before) as (keyof SceneNode)[]) {\n if (changed.has(key) && Object.is(node[key], before[key])) continue\n Object.assign(changes, { [key]: node[key] })\n }\n const keys = Object.keys(changes) as (keyof SceneNode)[]\n if (keys.length > 0) yield [node, changes, keys.filter((key) => edited.has(key))]\n }\n }\n}\n"],"mappings":";;;AAIA,MAAM,yCAAuD,IAAI,IAAI,CACnE,GAAG,kBACH,GAAG,WACL,CAAC;;;;;;AAcD,IAAa,eAAb,MAA0B;CACP,yBAAS,IAAI,IAAyB;;CAGvD,OAAO,MAAiB,SAA6B,MAAqB;EACxE,IAAI,QAAQ,KAAK,OAAO,IAAI,KAAK,EAAE;EACnC,IAAI,CAAC,OAAO;GACV,QAAQ;IAAE,QAAQ,CAAC;IAAG,yBAAS,IAAI,IAAI;IAAG,wBAAQ,IAAI,IAAI;GAAE;GAC5D,KAAK,OAAO,IAAI,KAAK,IAAI,KAAK;EAChC;EACA,KAAK,MAAM,OAAO,OAAO,KAAK,OAAO,GAA0B;GAC7D,IAAI,CAAC,OAAO,OAAO,MAAM,QAAQ,GAAG,GAAG,OAAO,OAAO,MAAM,QAAQ,GAAG,MAAM,KAAK,KAAK,CAAC;GACvF,IAAI,CAAC,OAAO,GAAG,KAAK,MAAM,QAAQ,IAAI,GAAG,MAAM,QAAQ,IAAI,GAAG;GAC9D,IAAI,QAAQ,uBAAuB,IAAI,GAAG,GAAG,MAAM,OAAO,IAAI,GAAG;EACnE;CACF;;;;;;CAOA,CAAC,QACC,SACiE;EACjE,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,SAAS,aAAa,KAAK,QAAQ;GAC3D,MAAM,OAAO,QAAQ,EAAE;GACvB,IAAI,CAAC,MAAM;GACX,MAAM,UAA8B,CAAC;GACrC,KAAK,MAAM,OAAO,OAAO,KAAK,MAAM,GAA0B;IAC5D,IAAI,QAAQ,IAAI,GAAG,KAAK,OAAO,GAAG,KAAK,MAAM,OAAO,IAAI,GAAG;IAC3D,OAAO,OAAO,SAAS,GAAG,MAAM,KAAK,KAAK,CAAC;GAC7C;GACA,MAAM,OAAO,OAAO,KAAK,OAAO;GAChC,IAAI,KAAK,SAAS,GAAG,MAAM;IAAC;IAAM;IAAS,KAAK,QAAQ,QAAQ,OAAO,IAAI,GAAG,CAAC;GAAC;EAClF;CACF;AACF"}
|
package/dist/masks.d.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { SceneNode } from "./types.js";
|
|
2
|
-
//#region src/masks.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* The layer as it masks: an outline mask masks with its shape alone, so Figma ignores how opaque
|
|
5
4
|
* its fills are, and the canvas and hit testing take them as opaque.
|
|
6
5
|
*/
|
|
7
|
-
declare function asMaskShape(node: SceneNode): SceneNode;
|
|
6
|
+
export declare function asMaskShape(node: SceneNode): SceneNode;
|
|
8
7
|
/** Whether a layer masks its siblings: a mask that is shown, since a hidden mask masks nothing. */
|
|
9
|
-
declare function isVisibleMask(node: Pick<SceneNode, 'visible' | 'isMask'>): boolean;
|
|
8
|
+
export declare function isVisibleMask(node: Pick<SceneNode, 'visible' | 'isMask'>): boolean;
|
|
10
9
|
/**
|
|
11
10
|
* A run of masks and the siblings they mask, as indices into the children: the masks are
|
|
12
11
|
* `[start, maskedStart)` and what they mask `[maskedStart, end)`, which may be empty.
|
|
13
12
|
*/
|
|
14
|
-
interface MaskRun {
|
|
13
|
+
export interface MaskRun {
|
|
15
14
|
readonly start: number;
|
|
16
15
|
readonly maskedStart: number;
|
|
17
16
|
readonly end: number;
|
|
@@ -22,7 +21,5 @@ interface MaskRun {
|
|
|
22
21
|
* a run of its own; a sibling that is hidden or a hidden mask is masked like any other (Figma
|
|
23
22
|
* desktop, live). Children before the first mask are not in any run.
|
|
24
23
|
*/
|
|
25
|
-
declare function maskRuns<T>(children: readonly T[], isMask: (child: T) => boolean): MaskRun[];
|
|
26
|
-
//#endregion
|
|
27
|
-
export { MaskRun, asMaskShape, isVisibleMask, maskRuns };
|
|
24
|
+
export declare function maskRuns<T>(children: readonly T[], isMask: (child: T) => boolean): MaskRun[];
|
|
28
25
|
//# sourceMappingURL=masks.d.ts.map
|
package/dist/masks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masks.d.ts","names":[],"sources":["../src/masks.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"masks.d.ts","names":[],"sources":["../src/masks.ts"],"mappings":";;;;;wBAMgB,YAAY,MAAM,YAAY;;wBAS9B,cAAc,MAAM,KAAK;;;;;iBAQxB;WACN;WACA;WACA;;;;;;;;wBASK,SAAS,GAAG,mBAAmB,KAAK,SAAS,OAAO,gBAAgB"}
|
package/dist/masks.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/masks.ts
|
|
2
2
|
/**
|
|
3
3
|
* The layer as it masks: an outline mask masks with its shape alone, so Figma ignores how opaque
|
|
4
4
|
* its fills are, and the canvas and hit testing take them as opaque.
|
|
@@ -47,7 +47,6 @@ function maskRuns(children, isMask) {
|
|
|
47
47
|
}
|
|
48
48
|
return runs;
|
|
49
49
|
}
|
|
50
|
-
//#endregion
|
|
51
50
|
export { asMaskShape, isVisibleMask, maskRuns };
|
|
52
51
|
|
|
53
52
|
//# sourceMappingURL=masks.js.map
|
package/dist/matrix.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Matrix as Matrix$1, Vector } from "./primitives/index.js";
|
|
2
|
-
|
|
3
|
-
type Mat3 = number[];
|
|
2
|
+
export type Mat3 = number[];
|
|
4
3
|
declare const Matrix: {
|
|
5
4
|
identity: () => Mat3;
|
|
6
5
|
multiply: (...ms: Mat3[]) => Mat3;
|
|
@@ -11,7 +10,7 @@ declare const Matrix: {
|
|
|
11
10
|
mapPoints: (matrix: Mat3, ptArr: number[]) => number[];
|
|
12
11
|
mapPoint: (m: Mat3, p: Vector) => Vector;
|
|
13
12
|
fromAffine: (t: Matrix$1) => Mat3;
|
|
13
|
+
toAffine: ([m00, m01, m02, m10, m11, m12]: Mat3) => Matrix$1;
|
|
14
14
|
};
|
|
15
|
-
|
|
16
|
-
export { Mat3, Matrix as default };
|
|
15
|
+
export { Matrix as default };
|
|
17
16
|
//# sourceMappingURL=matrix.d.ts.map
|