@open-pencil/scene-graph 0.17.0 → 0.18.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/arrow-caps.d.ts +14 -17
- package/dist/arrow-caps.d.ts.map +1 -1
- package/dist/arrow-caps.js +1 -2
- package/dist/asset-keys.d.ts +5 -8
- package/dist/asset-keys.d.ts.map +1 -1
- package/dist/asset-keys.js +2 -3
- package/dist/behaviours/index.d.ts +6 -4
- package/dist/behaviours/index.js +6 -4
- package/dist/behaviours/kinds.d.ts +38 -15
- package/dist/behaviours/kinds.d.ts.map +1 -1
- package/dist/behaviours/kinds.js +134 -12
- package/dist/behaviours/kinds.js.map +1 -1
- package/dist/behaviours/layers.d.ts +3 -6
- package/dist/behaviours/layers.d.ts.map +1 -1
- package/dist/behaviours/layers.js +1 -2
- package/dist/behaviours/listing.d.ts +58 -0
- package/dist/behaviours/listing.d.ts.map +1 -0
- package/dist/behaviours/listing.js +98 -0
- package/dist/behaviours/listing.js.map +1 -0
- package/dist/behaviours/model.d.ts +19 -16
- package/dist/behaviours/model.d.ts.map +1 -1
- package/dist/behaviours/model.js +14 -6
- package/dist/behaviours/model.js.map +1 -1
- package/dist/behaviours/schema.d.ts +150 -17
- package/dist/behaviours/schema.d.ts.map +1 -1
- package/dist/behaviours/schema.js +19 -5
- package/dist/behaviours/schema.js.map +1 -1
- package/dist/behaviours/spec.d.ts +3 -6
- package/dist/behaviours/spec.d.ts.map +1 -1
- package/dist/behaviours/spec.js +7 -4
- package/dist/behaviours/spec.js.map +1 -1
- package/dist/behaviours/transition.d.ts +20 -0
- package/dist/behaviours/transition.d.ts.map +1 -0
- package/dist/behaviours/transition.js +35 -0
- package/dist/behaviours/transition.js.map +1 -0
- package/dist/bindings.js +2 -3
- package/dist/blur.d.ts +35 -0
- package/dist/blur.d.ts.map +1 -0
- package/dist/blur.js +69 -0
- package/dist/blur.js.map +1 -0
- package/dist/buffered-events.d.ts +3 -6
- package/dist/buffered-events.d.ts.map +1 -1
- package/dist/buffered-events.js +1 -2
- package/dist/buffered-events.js.map +1 -1
- package/dist/checkpoint.d.ts +3 -6
- package/dist/checkpoint.d.ts.map +1 -1
- package/dist/checkpoint.js +4 -3
- package/dist/checkpoint.js.map +1 -1
- package/dist/clipping.d.ts +4 -7
- package/dist/clipping.d.ts.map +1 -1
- package/dist/clipping.js +4 -16
- package/dist/clipping.js.map +1 -1
- package/dist/color/contrast.d.ts +4 -7
- package/dist/color/contrast.d.ts.map +1 -1
- package/dist/color/contrast.js +2 -3
- package/dist/color/index.d.ts +21 -20
- package/dist/color/index.d.ts.map +1 -1
- package/dist/color/index.js +16 -27
- package/dist/color/index.js.map +1 -1
- package/dist/color/management.d.ts +50 -25
- package/dist/color/management.d.ts.map +1 -1
- package/dist/color/management.js +155 -151
- package/dist/color/management.js.map +1 -1
- package/dist/color/normalize.d.ts +1 -4
- package/dist/color/normalize.d.ts.map +1 -1
- package/dist/color/normalize.js +1 -2
- package/dist/color/okhcl.d.ts +36 -21
- package/dist/color/okhcl.d.ts.map +1 -1
- package/dist/color/okhcl.js +57 -42
- package/dist/color/okhcl.js.map +1 -1
- package/dist/color/schema.d.ts +6 -4
- package/dist/color/schema.d.ts.map +1 -1
- package/dist/color/schema.js +12 -4
- package/dist/color/schema.js.map +1 -1
- package/dist/comments/document.d.ts +3 -6
- package/dist/comments/document.d.ts.map +1 -1
- package/dist/comments/document.js +1 -2
- package/dist/comments/index.js +2 -2
- package/dist/comments/list.d.ts +5 -8
- package/dist/comments/list.d.ts.map +1 -1
- package/dist/comments/list.js +1 -2
- package/dist/comments/merge.d.ts +2 -5
- package/dist/comments/merge.d.ts.map +1 -1
- package/dist/comments/merge.js +1 -2
- package/dist/comments/schema.d.ts +2 -5
- package/dist/comments/schema.d.ts.map +1 -1
- package/dist/comments/schema.js +1 -2
- package/dist/comments/threads.d.ts +16 -19
- package/dist/comments/threads.d.ts.map +1 -1
- package/dist/comments/threads.js +8 -3
- package/dist/comments/threads.js.map +1 -1
- package/dist/components/exposure.d.ts +4 -7
- package/dist/components/exposure.d.ts.map +1 -1
- package/dist/components/exposure.js +1 -2
- package/dist/components/properties.d.ts +13 -16
- package/dist/components/properties.d.ts.map +1 -1
- package/dist/components/properties.js +3 -4
- package/dist/components/variants.d.ts +5 -8
- package/dist/components/variants.d.ts.map +1 -1
- package/dist/components/variants.js +1 -2
- package/dist/connectors/controls.d.ts +6 -9
- package/dist/connectors/controls.d.ts.map +1 -1
- package/dist/connectors/controls.js +2 -3
- package/dist/connectors/create.d.ts +3 -6
- package/dist/connectors/create.d.ts.map +1 -1
- package/dist/connectors/create.js +2 -3
- package/dist/connectors/elbow.js +0 -1
- package/dist/connectors/gaps.d.ts +1 -4
- package/dist/connectors/gaps.d.ts.map +1 -1
- package/dist/connectors/gaps.js +1 -2
- package/dist/connectors/hit.d.ts +1 -4
- package/dist/connectors/hit.d.ts.map +1 -1
- package/dist/connectors/hit.js +3 -4
- package/dist/connectors/index.d.ts +3 -3
- package/dist/connectors/index.js +6 -6
- package/dist/connectors/label.d.ts +4 -7
- package/dist/connectors/label.d.ts.map +1 -1
- package/dist/connectors/label.js +1 -2
- package/dist/connectors/layout.d.ts +8 -10
- package/dist/connectors/layout.d.ts.map +1 -1
- package/dist/connectors/layout.js +12 -10
- package/dist/connectors/layout.js.map +1 -1
- package/dist/connectors/pieces.d.ts +2 -5
- package/dist/connectors/pieces.d.ts.map +1 -1
- package/dist/connectors/pieces.js +3 -4
- package/dist/connectors/pieces.js.map +1 -1
- package/dist/connectors/route.d.ts +2 -5
- package/dist/connectors/route.d.ts.map +1 -1
- package/dist/connectors/route.js +4 -5
- package/dist/connectors/sides.d.ts +3 -6
- package/dist/connectors/sides.d.ts.map +1 -1
- package/dist/connectors/sides.js +2 -3
- package/dist/connectors/sublayers.d.ts +21 -24
- package/dist/connectors/sublayers.d.ts.map +1 -1
- package/dist/connectors/sublayers.js +3 -3
- package/dist/connectors/sublayers.js.map +1 -1
- package/dist/constants.d.ts +13 -16
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -2
- package/dist/constraints.d.ts +6 -8
- package/dist/constraints.d.ts.map +1 -1
- package/dist/constraints.js +3 -3
- package/dist/constraints.js.map +1 -1
- package/dist/coordinate.d.ts +27 -29
- package/dist/coordinate.d.ts.map +1 -1
- package/dist/coordinate.js +19 -38
- package/dist/coordinate.js.map +1 -1
- package/dist/copy.d.ts +36 -24
- package/dist/copy.d.ts.map +1 -1
- package/dist/copy.js +33 -4
- package/dist/copy.js.map +1 -1
- package/dist/corners.d.ts +9 -9
- package/dist/corners.d.ts.map +1 -1
- package/dist/corners.js +4 -3
- package/dist/corners.js.map +1 -1
- package/dist/css/blend.d.ts +1 -4
- package/dist/css/blend.d.ts.map +1 -1
- package/dist/css/blend.js +1 -2
- package/dist/css/grid.d.ts +1 -4
- package/dist/css/grid.d.ts.map +1 -1
- package/dist/css/grid.js +3 -4
- package/dist/css/index.d.ts +2 -1
- package/dist/css/index.js +3 -2
- package/dist/css/layout.d.ts +7 -10
- package/dist/css/layout.d.ts.map +1 -1
- package/dist/css/layout.js +2 -3
- package/dist/css/motion.d.ts +9 -0
- package/dist/css/motion.d.ts.map +1 -0
- package/dist/css/motion.js +59 -0
- package/dist/css/motion.js.map +1 -0
- package/dist/css/shadows.d.ts +4 -6
- package/dist/css/shadows.d.ts.map +1 -1
- package/dist/css/shadows.js +9 -9
- package/dist/css/shadows.js.map +1 -1
- package/dist/css/text.d.ts +8 -11
- package/dist/css/text.d.ts.map +1 -1
- package/dist/css/text.js +1 -2
- package/dist/css/transform.d.ts +6 -9
- package/dist/css/transform.d.ts.map +1 -1
- package/dist/css/transform.js +2 -3
- package/dist/css/values.d.ts +11 -13
- package/dist/css/values.d.ts.map +1 -1
- package/dist/css/values.js +5 -6
- package/dist/css/values.js.map +1 -1
- package/dist/cubic.d.ts +11 -5
- package/dist/cubic.d.ts.map +1 -1
- package/dist/cubic.js +71 -3
- package/dist/cubic.js.map +1 -1
- package/dist/events.js +1 -2
- package/dist/export-format.d.ts +5 -8
- package/dist/export-format.d.ts.map +1 -1
- package/dist/export-format.js +4 -3
- package/dist/export-format.js.map +1 -1
- package/dist/export-scale.d.ts +4 -7
- package/dist/export-scale.d.ts.map +1 -1
- package/dist/export-scale.js +1 -2
- package/dist/fields/appearance.d.ts +3 -6
- package/dist/fields/appearance.d.ts.map +1 -1
- package/dist/fields/appearance.js +1 -2
- package/dist/fields/geometry.d.ts +2 -5
- package/dist/fields/geometry.d.ts.map +1 -1
- package/dist/fields/geometry.js +1 -2
- package/dist/fields/index.d.ts +2 -2
- package/dist/fields/index.js +3 -3
- package/dist/fields/layout.d.ts +5 -6
- package/dist/fields/layout.d.ts.map +1 -1
- package/dist/fields/layout.js +10 -3
- package/dist/fields/layout.js.map +1 -1
- package/dist/fields/text.d.ts +5 -8
- package/dist/fields/text.d.ts.map +1 -1
- package/dist/fields/text.js +1 -2
- package/dist/fig-compression.d.ts +3 -6
- package/dist/fig-compression.d.ts.map +1 -1
- package/dist/fig-compression.js +1 -2
- package/dist/figjam/index.js +1 -1
- package/dist/figjam/palette.d.ts +21 -23
- package/dist/figjam/palette.d.ts.map +1 -1
- package/dist/figjam/palette.js +3 -4
- package/dist/figjam/text.d.ts +10 -13
- package/dist/figjam/text.d.ts.map +1 -1
- package/dist/figjam/text.js +1 -2
- package/dist/font-style.d.ts +18 -18
- package/dist/font-style.d.ts.map +1 -1
- package/dist/font-style.js +12 -8
- package/dist/font-style.js.map +1 -1
- package/dist/generated/index.d.ts +35 -15
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +50 -12
- package/dist/generated/index.js.map +1 -1
- package/dist/generated/kind.d.ts +17 -6
- package/dist/generated/kind.d.ts.map +1 -1
- package/dist/generated/shape-with-text.d.ts +10 -13
- package/dist/generated/shape-with-text.d.ts.map +1 -1
- package/dist/generated/shape-with-text.js +3 -3
- package/dist/generated/shape-with-text.js.map +1 -1
- package/dist/generated/spec.d.ts +45 -0
- package/dist/generated/spec.d.ts.map +1 -0
- package/dist/generated/spec.js +281 -0
- package/dist/generated/spec.js.map +1 -0
- package/dist/generated/sticky.d.ts +23 -26
- package/dist/generated/sticky.d.ts.map +1 -1
- package/dist/generated/sticky.js +4 -4
- package/dist/generated/sticky.js.map +1 -1
- package/dist/geometry.d.ts +47 -68
- package/dist/geometry.d.ts.map +1 -1
- package/dist/geometry.js +53 -77
- package/dist/geometry.js.map +1 -1
- package/dist/gradient.d.ts +15 -18
- package/dist/gradient.d.ts.map +1 -1
- package/dist/gradient.js +1 -2
- package/dist/graph.d.ts +33 -11
- package/dist/graph.d.ts.map +1 -1
- package/dist/graph.js +85 -28
- package/dist/graph.js.map +1 -1
- package/dist/group-bounds.d.ts +15 -14
- package/dist/group-bounds.d.ts.map +1 -1
- package/dist/group-bounds.js +41 -12
- package/dist/group-bounds.js.map +1 -1
- package/dist/guides.d.ts +5 -8
- package/dist/guides.d.ts.map +1 -1
- package/dist/guides.js +2 -3
- package/dist/hit-test.d.ts +20 -12
- package/dist/hit-test.d.ts.map +1 -1
- package/dist/hit-test.js +69 -38
- package/dist/hit-test.js.map +1 -1
- package/dist/icons/fit.d.ts +2 -4
- package/dist/icons/fit.d.ts.map +1 -1
- package/dist/icons/fit.js +1 -2
- package/dist/icons/glyph.d.ts +3 -5
- package/dist/icons/glyph.d.ts.map +1 -1
- package/dist/icons/glyph.js +3 -4
- package/dist/icons/index.d.ts +1 -1
- package/dist/icons/index.js +2 -2
- package/dist/icons/model.d.ts +8 -11
- package/dist/icons/model.d.ts.map +1 -1
- package/dist/icons/model.js +1 -2
- package/dist/icons/schema.d.ts +8 -11
- package/dist/icons/schema.d.ts.map +1 -1
- package/dist/icons/schema.js +1 -2
- package/dist/ids.d.ts +2 -5
- package/dist/ids.d.ts.map +1 -1
- package/dist/ids.js +3 -4
- package/dist/images.d.ts +20 -21
- package/dist/images.d.ts.map +1 -1
- package/dist/images.js +7 -6
- package/dist/images.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/instances/assignments.js +1 -2
- package/dist/instances/content-marks.js +98 -0
- package/dist/instances/content-marks.js.map +1 -0
- package/dist/instances/content-size.js +2 -3
- package/dist/instances/copies.js +2 -3
- package/dist/instances/cycles.d.ts +3 -6
- package/dist/instances/cycles.d.ts.map +1 -1
- package/dist/instances/cycles.js +1 -2
- package/dist/instances/deleted.d.ts +23 -0
- package/dist/instances/deleted.d.ts.map +1 -0
- package/dist/instances/deleted.js +82 -0
- package/dist/instances/deleted.js.map +1 -0
- package/dist/instances/fields.d.ts +5 -8
- package/dist/instances/fields.d.ts.map +1 -1
- package/dist/instances/fields.js +11 -7
- package/dist/instances/fields.js.map +1 -1
- package/dist/instances/index.d.ts +21 -20
- package/dist/instances/index.d.ts.map +1 -1
- package/dist/instances/index.js +116 -20
- package/dist/instances/index.js.map +1 -1
- package/dist/instances/kept-overrides.js +4 -5
- package/dist/instances/lookup.d.ts +17 -0
- package/dist/instances/lookup.d.ts.map +1 -0
- package/dist/instances/lookup.js +48 -0
- package/dist/instances/lookup.js.map +1 -0
- package/dist/instances/main-component.d.ts +2 -5
- package/dist/instances/main-component.d.ts.map +1 -1
- package/dist/instances/main-component.js +1 -2
- package/dist/instances/matching.js +1 -2
- package/dist/instances/overrides.d.ts +23 -26
- package/dist/instances/overrides.d.ts.map +1 -1
- package/dist/instances/overrides.js +1 -2
- package/dist/instances/placement.js +3 -4
- package/dist/instances/protection.js +3 -4
- package/dist/instances/source-walk.js +1 -2
- package/dist/instances/swap.js +7 -8
- package/dist/instances/sync.js +91 -18
- package/dist/instances/sync.js.map +1 -1
- package/dist/instances/vector-geometry.js +2 -3
- package/dist/layout/aspect-ratio.d.ts +7 -9
- package/dist/layout/aspect-ratio.d.ts.map +1 -1
- package/dist/layout/aspect-ratio.js +1 -2
- package/dist/layout/flow.d.ts +13 -0
- package/dist/layout/flow.d.ts.map +1 -0
- package/dist/layout/flow.js +35 -0
- package/dist/layout/flow.js.map +1 -0
- package/dist/layout/guides.d.ts +13 -16
- package/dist/layout/guides.d.ts.map +1 -1
- package/dist/layout/guides.js +4 -5
- package/dist/layout/guides.js.map +1 -1
- package/dist/layout/index.d.ts +6 -4
- package/dist/layout/index.js +7 -5
- package/dist/layout/keywords.d.ts +7 -9
- package/dist/layout/keywords.d.ts.map +1 -1
- package/dist/layout/keywords.js +8 -3
- package/dist/layout/keywords.js.map +1 -1
- package/dist/layout/limits.d.ts +13 -16
- package/dist/layout/limits.d.ts.map +1 -1
- package/dist/layout/limits.js +1 -2
- package/dist/layout/sizing.d.ts +18 -12
- package/dist/layout/sizing.d.ts.map +1 -1
- package/dist/layout/sizing.js +18 -3
- package/dist/layout/sizing.js.map +1 -1
- package/dist/layout/spacing.d.ts +7 -4
- package/dist/layout/spacing.d.ts.map +1 -1
- package/dist/layout/spacing.js +11 -3
- package/dist/layout/spacing.js.map +1 -1
- package/dist/layout/stacking.d.ts +8 -0
- package/dist/layout/stacking.d.ts.map +1 -0
- package/dist/layout/stacking.js +12 -0
- package/dist/layout/stacking.js.map +1 -0
- package/dist/layout/strokes.d.ts +1 -4
- package/dist/layout/strokes.d.ts.map +1 -1
- package/dist/layout/strokes.js +1 -2
- package/dist/layout/writes.js +1 -2
- package/dist/layout/writes.js.map +1 -1
- package/dist/masks.d.ts +4 -7
- package/dist/masks.d.ts.map +1 -1
- package/dist/masks.js +1 -2
- package/dist/matrix.d.ts +3 -4
- package/dist/matrix.d.ts.map +1 -1
- package/dist/matrix.js +11 -3
- package/dist/matrix.js.map +1 -1
- package/dist/mesh/geometry.d.ts +80 -0
- package/dist/mesh/geometry.d.ts.map +1 -0
- package/dist/mesh/geometry.js +430 -0
- package/dist/mesh/geometry.js.map +1 -0
- package/dist/mesh/index.d.ts +4 -0
- package/dist/mesh/index.js +4 -0
- package/dist/mesh/model.d.ts +25 -0
- package/dist/mesh/model.d.ts.map +1 -0
- package/dist/mesh/model.js +39 -0
- package/dist/mesh/model.js.map +1 -0
- package/dist/mesh/schema.d.ts +188 -0
- package/dist/mesh/schema.d.ts.map +1 -0
- package/dist/mesh/schema.js +55 -0
- package/dist/mesh/schema.js.map +1 -0
- package/dist/motion/apply.d.ts +42 -0
- package/dist/motion/apply.d.ts.map +1 -0
- package/dist/motion/apply.js +98 -0
- package/dist/motion/apply.js.map +1 -0
- package/dist/motion/edit.d.ts +53 -0
- package/dist/motion/edit.d.ts.map +1 -0
- package/dist/motion/edit.js +125 -0
- package/dist/motion/edit.js.map +1 -0
- package/dist/motion/effects.js +86 -0
- package/dist/motion/effects.js.map +1 -0
- package/dist/motion/evaluate.d.ts +33 -0
- package/dist/motion/evaluate.d.ts.map +1 -0
- package/dist/motion/evaluate.js +160 -0
- package/dist/motion/evaluate.js.map +1 -0
- package/dist/motion/fields.d.ts +69 -0
- package/dist/motion/fields.d.ts.map +1 -0
- package/dist/motion/fields.js +132 -0
- package/dist/motion/fields.js.map +1 -0
- package/dist/motion/index.d.ts +16 -0
- package/dist/motion/index.js +15 -0
- package/dist/motion/keyable.d.ts +32 -0
- package/dist/motion/keyable.d.ts.map +1 -0
- package/dist/motion/keyable.js +120 -0
- package/dist/motion/keyable.js.map +1 -0
- package/dist/motion/outline.d.ts +35 -0
- package/dist/motion/outline.d.ts.map +1 -0
- package/dist/motion/outline.js +59 -0
- package/dist/motion/outline.js.map +1 -0
- package/dist/motion/presets/index.d.ts +20 -0
- package/dist/motion/presets/index.d.ts.map +1 -0
- package/dist/motion/presets/index.js +166 -0
- package/dist/motion/presets/index.js.map +1 -0
- package/dist/motion/presets/settings.d.ts +43 -0
- package/dist/motion/presets/settings.d.ts.map +1 -0
- package/dist/motion/presets/settings.js +254 -0
- package/dist/motion/presets/settings.js.map +1 -0
- package/dist/motion/presets/stagger.d.ts +69 -0
- package/dist/motion/presets/stagger.d.ts.map +1 -0
- package/dist/motion/presets/stagger.js +185 -0
- package/dist/motion/presets/stagger.js.map +1 -0
- package/dist/motion/schema.d.ts +185 -0
- package/dist/motion/schema.d.ts.map +1 -0
- package/dist/motion/schema.js +62 -0
- package/dist/motion/schema.js.map +1 -0
- package/dist/motion/segment.d.ts +25 -0
- package/dist/motion/segment.d.ts.map +1 -0
- package/dist/motion/segment.js +73 -0
- package/dist/motion/segment.js.map +1 -0
- package/dist/motion/spec.d.ts +26 -0
- package/dist/motion/spec.d.ts.map +1 -0
- package/dist/motion/spec.js +175 -0
- package/dist/motion/spec.js.map +1 -0
- package/dist/motion/timeline.d.ts +16 -0
- package/dist/motion/timeline.d.ts.map +1 -0
- package/dist/motion/timeline.js +53 -0
- package/dist/motion/timeline.js.map +1 -0
- package/dist/motion/types.d.ts +49 -0
- package/dist/motion/types.d.ts.map +1 -0
- package/dist/motion/variables.d.ts +9 -0
- package/dist/motion/variables.d.ts.map +1 -0
- package/dist/motion/variables.js +25 -0
- package/dist/motion/variables.js.map +1 -0
- package/dist/mutation-impact.d.ts +9 -10
- package/dist/mutation-impact.d.ts.map +1 -1
- package/dist/mutation-impact.js +19 -9
- package/dist/mutation-impact.js.map +1 -1
- package/dist/node-defaults.d.ts +15 -14
- package/dist/node-defaults.d.ts.map +1 -1
- package/dist/node-defaults.js +153 -55
- package/dist/node-defaults.js.map +1 -1
- package/dist/order-keys.d.ts +8 -9
- package/dist/order-keys.d.ts.map +1 -1
- package/dist/order-keys.js +10 -2
- package/dist/order-keys.js.map +1 -1
- package/dist/outline/flatten.d.ts +3 -6
- package/dist/outline/flatten.d.ts.map +1 -1
- package/dist/outline/flatten.js +3 -4
- package/dist/outline/heads.js +1 -2
- package/dist/outline/hit.d.ts +2 -5
- package/dist/outline/hit.d.ts.map +1 -1
- package/dist/outline/hit.js +5 -6
- package/dist/outline/index.js +3 -3
- package/dist/outline/point.d.ts +4 -7
- package/dist/outline/point.d.ts.map +1 -1
- package/dist/outline/point.js +2 -3
- package/dist/outline/shapes.d.ts +4 -7
- package/dist/outline/shapes.d.ts.map +1 -1
- package/dist/outline/shapes.js +2 -3
- package/dist/paints/index.d.ts +5 -3
- package/dist/paints/index.js +5 -3
- package/dist/paints/pattern.d.ts +6 -5
- package/dist/paints/pattern.d.ts.map +1 -1
- package/dist/paints/pattern.js +34 -3
- package/dist/paints/pattern.js.map +1 -1
- package/dist/paints/schema.d.ts +4 -7
- package/dist/paints/schema.d.ts.map +1 -1
- package/dist/paints/schema.js +3 -4
- package/dist/paints/shows.d.ts +4 -4
- package/dist/paints/shows.d.ts.map +1 -1
- package/dist/paints/shows.js +9 -3
- package/dist/paints/shows.js.map +1 -1
- package/dist/paints/solid.d.ts +8 -0
- package/dist/paints/solid.d.ts.map +1 -0
- package/dist/paints/solid.js +17 -0
- package/dist/paints/solid.js.map +1 -0
- package/dist/paints/stills.d.ts +74 -0
- package/dist/paints/stills.d.ts.map +1 -0
- package/dist/paints/stills.js +117 -0
- package/dist/paints/stills.js.map +1 -0
- package/dist/parse-path.d.ts +12 -9
- package/dist/parse-path.d.ts.map +1 -1
- package/dist/parse-path.js +13 -3
- package/dist/parse-path.js.map +1 -1
- package/dist/paths/arc.d.ts +6 -9
- package/dist/paths/arc.d.ts.map +1 -1
- package/dist/paths/arc.js +1 -2
- package/dist/paths/index.d.ts +1 -1
- package/dist/paths/index.js +1 -1
- package/dist/paths/network.d.ts +13 -16
- package/dist/paths/network.d.ts.map +1 -1
- package/dist/paths/network.js +1 -2
- package/dist/paths/sink.d.ts +5 -8
- package/dist/paths/sink.d.ts.map +1 -1
- package/dist/paths/sink.js +1 -2
- package/dist/paths/smooth-corners.d.ts +3 -6
- package/dist/paths/smooth-corners.d.ts.map +1 -1
- package/dist/paths/smooth-corners.js +1 -2
- package/dist/plugin-data/field.d.ts +15 -18
- package/dist/plugin-data/field.d.ts.map +1 -1
- package/dist/plugin-data/field.js +3 -2
- package/dist/plugin-data/field.js.map +1 -1
- package/dist/plugin-data/fields.d.ts +104 -11
- package/dist/plugin-data/fields.d.ts.map +1 -1
- package/dist/plugin-data/fields.js +43 -13
- package/dist/plugin-data/fields.js.map +1 -1
- package/dist/plugin-data/index.d.ts +2 -2
- package/dist/plugin-data/index.js +2 -2
- package/dist/polygon.d.ts +8 -8
- package/dist/polygon.d.ts.map +1 -1
- package/dist/polygon.js +7 -7
- package/dist/polygon.js.map +1 -1
- package/dist/preview.d.ts +3 -5
- package/dist/preview.d.ts.map +1 -1
- package/dist/preview.js +2 -3
- package/dist/primitives/index.d.ts +7 -9
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +1 -2
- package/dist/primitives/schema.d.ts +3 -6
- package/dist/primitives/schema.d.ts.map +1 -1
- package/dist/primitives/schema.js +1 -2
- package/dist/resize.d.ts +19 -14
- package/dist/resize.d.ts.map +1 -1
- package/dist/resize.js +38 -8
- package/dist/resize.js.map +1 -1
- package/dist/scaling/index.d.ts +2 -2
- package/dist/scaling/index.js +2 -2
- package/dist/scaling/node.d.ts +2 -4
- package/dist/scaling/node.d.ts.map +1 -1
- package/dist/scaling/node.js +30 -11
- package/dist/scaling/node.js.map +1 -1
- package/dist/scaling/snapshot.d.ts +5 -8
- package/dist/scaling/snapshot.d.ts.map +1 -1
- package/dist/scaling/snapshot.js +1 -2
- package/dist/scaling/tree.d.ts +6 -9
- package/dist/scaling/tree.d.ts.map +1 -1
- package/dist/scaling/tree.js +2 -3
- package/dist/shaders/index.d.ts +2 -3
- package/dist/shaders/index.js +2 -3
- package/dist/shaders/model.d.ts +54 -21
- package/dist/shaders/model.d.ts.map +1 -1
- package/dist/shaders/model.js +103 -35
- package/dist/shaders/model.js.map +1 -1
- package/dist/shaders/schema.d.ts +16 -9
- package/dist/shaders/schema.d.ts.map +1 -1
- package/dist/shaders/schema.js +12 -3
- package/dist/shaders/schema.js.map +1 -1
- package/dist/shape-with-text/document.js +264 -0
- package/dist/shape-with-text/document.js.map +1 -0
- package/dist/shape-with-text/fit.d.ts +6 -9
- package/dist/shape-with-text/fit.d.ts.map +1 -1
- package/dist/shape-with-text/fit.js +1 -2
- package/dist/shape-with-text/geometry.d.ts +16 -7
- package/dist/shape-with-text/geometry.d.ts.map +1 -1
- package/dist/shape-with-text/geometry.js +105 -46
- package/dist/shape-with-text/geometry.js.map +1 -1
- package/dist/shape-with-text/index.d.ts +2 -2
- package/dist/shape-with-text/index.js +3 -3
- package/dist/shape-with-text/kinds.d.ts +4 -7
- package/dist/shape-with-text/kinds.d.ts.map +1 -1
- package/dist/shape-with-text/kinds.js +1 -2
- package/dist/shared-style-index.d.ts +19 -0
- package/dist/shared-style-index.d.ts.map +1 -0
- package/dist/shared-style-index.js +71 -0
- package/dist/shared-style-index.js.map +1 -0
- package/dist/shared-styles.d.ts +18 -20
- package/dist/shared-styles.d.ts.map +1 -1
- package/dist/shared-styles.js +20 -12
- package/dist/shared-styles.js.map +1 -1
- package/dist/slides/drop.d.ts +29 -0
- package/dist/slides/drop.d.ts.map +1 -0
- package/dist/slides/drop.js +80 -0
- package/dist/slides/drop.js.map +1 -0
- package/dist/slides/index.d.ts +56 -0
- package/dist/slides/index.d.ts.map +1 -0
- package/dist/slides/index.js +137 -0
- package/dist/slides/index.js.map +1 -0
- package/dist/slides/motion.d.ts +71 -0
- package/dist/slides/motion.d.ts.map +1 -0
- package/dist/slides/motion.js +167 -0
- package/dist/slides/motion.js.map +1 -0
- package/dist/slides/playback.d.ts +62 -0
- package/dist/slides/playback.d.ts.map +1 -0
- package/dist/slides/playback.js +220 -0
- package/dist/slides/playback.js.map +1 -0
- package/dist/slides/types.d.ts +59 -0
- package/dist/slides/types.d.ts.map +1 -0
- package/dist/slides/types.js +38 -0
- package/dist/slides/types.js.map +1 -0
- package/dist/slots/authoring.d.ts +6 -9
- package/dist/slots/authoring.d.ts.map +1 -1
- package/dist/slots/authoring.js +2 -3
- package/dist/slots/content.d.ts +5 -8
- package/dist/slots/content.d.ts.map +1 -1
- package/dist/slots/content.js +4 -5
- package/dist/slots/frames.d.ts +7 -9
- package/dist/slots/frames.d.ts.map +1 -1
- package/dist/slots/frames.js +3 -4
- package/dist/slots/frames.js.map +1 -1
- package/dist/slots/index.js +1 -1
- package/dist/slots/limits.d.ts +4 -7
- package/dist/slots/limits.d.ts.map +1 -1
- package/dist/slots/limits.js +1 -2
- package/dist/snap.d.ts +4 -7
- package/dist/snap.d.ts.map +1 -1
- package/dist/snap.js +7 -8
- package/dist/source-metadata.d.ts +1 -4
- package/dist/source-metadata.d.ts.map +1 -1
- package/dist/source-metadata.js +1 -2
- package/dist/specs/index.d.ts +3 -0
- package/dist/specs/index.js +3 -0
- package/dist/specs/model.d.ts +20 -0
- package/dist/specs/model.d.ts.map +1 -0
- package/dist/specs/model.js +32 -0
- package/dist/specs/model.js.map +1 -0
- package/dist/specs/schema.d.ts +24 -0
- package/dist/specs/schema.d.ts.map +1 -0
- package/dist/specs/schema.js +32 -0
- package/dist/specs/schema.js.map +1 -0
- package/dist/statuses/impact.d.ts +2 -5
- package/dist/statuses/impact.d.ts.map +1 -1
- package/dist/statuses/impact.js +2 -3
- package/dist/statuses/index.d.ts +1 -1
- package/dist/statuses/index.js +2 -2
- package/dist/statuses/node.d.ts +4 -7
- package/dist/statuses/node.d.ts.map +1 -1
- package/dist/statuses/node.js +1 -2
- package/dist/statuses/schema.d.ts +7 -9
- package/dist/statuses/schema.d.ts.map +1 -1
- package/dist/statuses/schema.js +1 -2
- package/dist/statuses/workflow.d.ts +9 -12
- package/dist/statuses/workflow.d.ts.map +1 -1
- package/dist/statuses/workflow.js +2 -3
- package/dist/strokes.d.ts +8 -10
- package/dist/strokes.d.ts.map +1 -1
- package/dist/strokes.js +2 -3
- package/dist/text/auto-resize.d.ts +4 -6
- package/dist/text/auto-resize.d.ts.map +1 -1
- package/dist/text/auto-resize.js +1 -2
- package/dist/text/direction.d.ts +10 -10
- package/dist/text/direction.d.ts.map +1 -1
- package/dist/text/direction.js +13 -14
- package/dist/text/direction.js.map +1 -1
- package/dist/text/index.d.ts +3 -2
- package/dist/text/index.js +6 -5
- package/dist/text/lengths.d.ts +9 -12
- package/dist/text/lengths.d.ts.map +1 -1
- package/dist/text/lengths.js +1 -2
- package/dist/text/lists.d.ts +17 -13
- package/dist/text/lists.d.ts.map +1 -1
- package/dist/text/lists.js +15 -4
- package/dist/text/lists.js.map +1 -1
- package/dist/text/name.d.ts +19 -0
- package/dist/text/name.d.ts.map +1 -0
- package/dist/text/name.js +37 -0
- package/dist/text/name.js.map +1 -0
- package/dist/text/overflow.d.ts +5 -7
- package/dist/text/overflow.d.ts.map +1 -1
- package/dist/text/overflow.js +1 -2
- package/dist/text/paragraphs.d.ts +20 -23
- package/dist/text/paragraphs.d.ts.map +1 -1
- package/dist/text/paragraphs.js +8 -5
- package/dist/text/paragraphs.js.map +1 -1
- package/dist/text/path.js +1 -2
- package/dist/text/picture.d.ts +3 -6
- package/dist/text/picture.d.ts.map +1 -1
- package/dist/text/picture.js +2 -3
- package/dist/text/references.d.ts +3 -6
- package/dist/text/references.d.ts.map +1 -1
- package/dist/text/references.js +2 -4
- package/dist/text/references.js.map +1 -1
- package/dist/text/runs.d.ts +6 -9
- package/dist/text/runs.d.ts.map +1 -1
- package/dist/text/runs.js +1 -2
- package/dist/text/schema.d.ts +1 -4
- package/dist/text/schema.d.ts.map +1 -1
- package/dist/text/schema.js +1 -2
- package/dist/thumbnail.d.ts +20 -0
- package/dist/thumbnail.d.ts.map +1 -0
- package/dist/thumbnail.js +46 -0
- package/dist/thumbnail.js.map +1 -0
- package/dist/transfer/apply.d.ts +2 -5
- package/dist/transfer/apply.d.ts.map +1 -1
- package/dist/transfer/apply.js +16 -6
- package/dist/transfer/apply.js.map +1 -1
- package/dist/transfer/copied.d.ts +11 -9
- package/dist/transfer/copied.d.ts.map +1 -1
- package/dist/transfer/copied.js +5 -6
- package/dist/transfer/copied.js.map +1 -1
- package/dist/transfer/dependencies.d.ts +10 -10
- package/dist/transfer/dependencies.d.ts.map +1 -1
- package/dist/transfer/dependencies.js +21 -10
- package/dist/transfer/dependencies.js.map +1 -1
- package/dist/transfer/history.d.ts +1 -4
- package/dist/transfer/history.d.ts.map +1 -1
- package/dist/transfer/history.js +3 -2
- package/dist/transfer/history.js.map +1 -1
- package/dist/transfer/identity.js +19 -5
- package/dist/transfer/identity.js.map +1 -1
- package/dist/transfer/index.d.ts +5 -4
- package/dist/transfer/index.js +6 -5
- package/dist/transfer/library.d.ts +43 -0
- package/dist/transfer/library.d.ts.map +1 -0
- package/dist/transfer/library.js +122 -0
- package/dist/transfer/library.js.map +1 -0
- package/dist/transfer/nodes.d.ts +2 -5
- package/dist/transfer/nodes.d.ts.map +1 -1
- package/dist/transfer/nodes.js +15 -4
- package/dist/transfer/nodes.js.map +1 -1
- package/dist/transfer/plan.d.ts +11 -5
- package/dist/transfer/plan.d.ts.map +1 -1
- package/dist/transfer/plan.js +52 -8
- package/dist/transfer/plan.js.map +1 -1
- package/dist/transfer/references.js +1 -2
- package/dist/transfer/remove.d.ts +1 -4
- package/dist/transfer/remove.d.ts.map +1 -1
- package/dist/transfer/remove.js +8 -3
- package/dist/transfer/remove.js.map +1 -1
- package/dist/transfer/resources.d.ts +2 -5
- package/dist/transfer/resources.d.ts.map +1 -1
- package/dist/transfer/resources.js +3 -4
- package/dist/transfer/validation.js +9 -6
- package/dist/transfer/validation.js.map +1 -1
- package/dist/transfer/variables.d.ts +3 -6
- package/dist/transfer/variables.d.ts.map +1 -1
- package/dist/transfer/variables.js +4 -4
- package/dist/transfer/variables.js.map +1 -1
- package/dist/types.d.ts +261 -134
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +47 -3
- package/dist/types.js.map +1 -1
- package/dist/undo.d.ts +5 -8
- package/dist/undo.d.ts.map +1 -1
- package/dist/undo.js +9 -3
- package/dist/undo.js.map +1 -1
- package/dist/variables/bindings.d.ts +29 -25
- package/dist/variables/bindings.d.ts.map +1 -1
- package/dist/variables/bindings.js +184 -55
- package/dist/variables/bindings.js.map +1 -1
- package/dist/variables/corners.d.ts +1 -4
- package/dist/variables/corners.d.ts.map +1 -1
- package/dist/variables/corners.js +1 -2
- package/dist/variables/easing.d.ts +53 -0
- package/dist/variables/easing.d.ts.map +1 -0
- package/dist/variables/easing.js +321 -0
- package/dist/variables/easing.js.map +1 -0
- package/dist/variables/fields.d.ts +21 -14
- package/dist/variables/fields.d.ts.map +1 -1
- package/dist/variables/fields.js +24 -6
- package/dist/variables/fields.js.map +1 -1
- package/dist/variables/formula/check.d.ts +2 -5
- package/dist/variables/formula/check.d.ts.map +1 -1
- package/dist/variables/formula/check.js +2 -3
- package/dist/variables/formula/evaluate.d.ts +1 -4
- package/dist/variables/formula/evaluate.d.ts.map +1 -1
- package/dist/variables/formula/evaluate.js +3 -4
- package/dist/variables/formula/index.d.ts +8 -8
- package/dist/variables/formula/index.d.ts.map +1 -1
- package/dist/variables/formula/index.js +29 -13
- package/dist/variables/formula/index.js.map +1 -1
- package/dist/variables/formula/parse.js +5 -6
- package/dist/variables/formula/print.d.ts +2 -5
- package/dist/variables/formula/print.d.ts.map +1 -1
- package/dist/variables/formula/print.js +4 -5
- package/dist/variables/formula/schema.d.ts +2 -5
- package/dist/variables/formula/schema.d.ts.map +1 -1
- package/dist/variables/formula/schema.js +6 -7
- package/dist/variables/formula/signatures.d.ts +4 -7
- package/dist/variables/formula/signatures.d.ts.map +1 -1
- package/dist/variables/formula/signatures.js +1 -2
- package/dist/variables/formula/signatures.js.map +1 -1
- package/dist/variables/formula/tokens.d.ts +5 -8
- package/dist/variables/formula/tokens.d.ts.map +1 -1
- package/dist/variables/formula/tokens.js +1 -2
- package/dist/variables/formula/tree.d.ts +8 -11
- package/dist/variables/formula/tree.d.ts.map +1 -1
- package/dist/variables/formula/tree.js +1 -2
- package/dist/variables/formula/tree.js.map +1 -1
- package/dist/variables/index.d.ts +42 -27
- package/dist/variables/index.d.ts.map +1 -1
- package/dist/variables/index.js +78 -29
- package/dist/variables/index.js.map +1 -1
- package/dist/variables/lookup.d.ts +11 -7
- package/dist/variables/lookup.d.ts.map +1 -1
- package/dist/variables/lookup.js +25 -4
- package/dist/variables/lookup.js.map +1 -1
- package/dist/variables/motion.d.ts +43 -0
- package/dist/variables/motion.d.ts.map +1 -0
- package/dist/variables/motion.js +106 -0
- package/dist/variables/motion.js.map +1 -0
- package/dist/variables/paints.d.ts +25 -19
- package/dist/variables/paints.d.ts.map +1 -1
- package/dist/variables/paints.js +28 -15
- package/dist/variables/paints.js.map +1 -1
- package/dist/variables/resolution.d.ts +22 -19
- package/dist/variables/resolution.d.ts.map +1 -1
- package/dist/variables/resolution.js +23 -14
- package/dist/variables/resolution.js.map +1 -1
- package/dist/variables/schema.d.ts +62 -7
- package/dist/variables/schema.d.ts.map +1 -1
- package/dist/variables/schema.js +39 -5
- package/dist/variables/schema.js.map +1 -1
- package/dist/variables/style-bindings.d.ts +21 -0
- package/dist/variables/style-bindings.d.ts.map +1 -0
- package/dist/variables/style-bindings.js +82 -0
- package/dist/variables/style-bindings.js.map +1 -0
- package/dist/variables/subtree.js +1 -2
- package/dist/variables/text.d.ts +2 -5
- package/dist/variables/text.d.ts.map +1 -1
- package/dist/variables/text.js +3 -4
- package/dist/variables/token.d.ts +5 -8
- package/dist/variables/token.d.ts.map +1 -1
- package/dist/variables/token.js +1 -2
- package/dist/variables/units.js +3 -5
- package/dist/variables/units.js.map +1 -1
- package/dist/variables/value.d.ts +4 -7
- package/dist/variables/value.d.ts.map +1 -1
- package/dist/variables/value.js +4 -5
- package/dist/variant-name.d.ts +2 -5
- package/dist/variant-name.d.ts.map +1 -1
- package/dist/variant-name.js +1 -2
- package/dist/variant-properties.d.ts +4 -7
- package/dist/variant-properties.d.ts.map +1 -1
- package/dist/variant-properties.js +2 -3
- package/dist/vector-network.d.ts +17 -20
- package/dist/vector-network.d.ts.map +1 -1
- package/dist/vector-network.js +4 -5
- package/package.json +42 -5
- package/src/behaviours/index.ts +2 -0
- package/src/behaviours/kinds.ts +108 -2
- package/src/behaviours/listing.ts +142 -0
- package/src/behaviours/model.ts +23 -2
- package/src/behaviours/schema.ts +19 -2
- package/src/behaviours/spec.ts +5 -0
- package/src/behaviours/transition.ts +46 -0
- package/src/blur.ts +88 -0
- package/src/checkpoint.ts +2 -0
- package/src/clipping.ts +3 -4
- package/src/color/index.ts +15 -24
- package/src/color/management.ts +144 -168
- package/src/color/okhcl.ts +62 -43
- package/src/color/schema.ts +13 -0
- package/src/comments/threads.ts +8 -1
- package/src/connectors/layout.ts +10 -3
- package/src/connectors/sublayers.ts +2 -1
- package/src/constraints.ts +2 -1
- package/src/coordinate.ts +17 -25
- package/src/copy.ts +38 -0
- package/src/corners.ts +3 -0
- package/src/css/index.ts +1 -0
- package/src/css/motion.ts +51 -0
- package/src/css/shadows.ts +7 -6
- package/src/css/values.ts +7 -3
- package/src/cubic.ts +57 -1
- package/src/export-format.ts +11 -1
- package/src/fields/layout.ts +9 -0
- package/src/font-style.ts +20 -7
- package/src/generated/index.ts +58 -9
- package/src/generated/kind.ts +16 -2
- package/src/generated/shape-with-text.ts +1 -0
- package/src/generated/spec.ts +243 -0
- package/src/generated/sticky.ts +2 -1
- package/src/geometry.ts +52 -89
- package/src/graph.ts +93 -15
- package/src/group-bounds.ts +54 -13
- package/src/hit-test.ts +78 -33
- package/src/images.ts +4 -1
- package/src/instances/content-marks.ts +124 -0
- package/src/instances/deleted.ts +115 -0
- package/src/instances/fields.ts +9 -3
- package/src/instances/index.ts +165 -17
- package/src/instances/lookup.ts +61 -0
- package/src/instances/sync.ts +108 -11
- package/src/layout/flow.ts +36 -0
- package/src/layout/index.ts +2 -0
- package/src/layout/keywords.ts +7 -1
- package/src/layout/sizing.ts +30 -0
- package/src/layout/spacing.ts +12 -0
- package/src/layout/stacking.ts +14 -0
- package/src/matrix.ts +11 -1
- package/src/mesh/geometry.ts +422 -0
- package/src/mesh/index.ts +3 -0
- package/src/mesh/model.ts +50 -0
- package/src/mesh/schema.ts +81 -0
- package/src/motion/apply.ts +156 -0
- package/src/motion/edit.ts +148 -0
- package/src/motion/effects.ts +166 -0
- package/src/motion/evaluate.ts +181 -0
- package/src/motion/fields.ts +136 -0
- package/src/motion/index.ts +13 -0
- package/src/motion/keyable.ts +141 -0
- package/src/motion/outline.ts +72 -0
- package/src/motion/presets/index.ts +257 -0
- package/src/motion/presets/settings.ts +221 -0
- package/src/motion/presets/stagger.ts +242 -0
- package/src/motion/schema.ts +66 -0
- package/src/motion/segment.ts +83 -0
- package/src/motion/spec.ts +225 -0
- package/src/motion/timeline.ts +48 -0
- package/src/motion/types.ts +45 -0
- package/src/motion/variables.ts +33 -0
- package/src/mutation-impact.ts +23 -7
- package/src/node-defaults.ts +152 -53
- package/src/order-keys.ts +16 -2
- package/src/paints/index.ts +2 -0
- package/src/paints/pattern.ts +55 -0
- package/src/paints/shows.ts +9 -0
- package/src/paints/solid.ts +10 -0
- package/src/paints/stills.ts +186 -0
- package/src/parse-path.ts +15 -0
- package/src/plugin-data/field.ts +3 -0
- package/src/plugin-data/fields.ts +54 -4
- package/src/polygon.ts +6 -4
- package/src/resize.ts +32 -20
- package/src/scaling/index.ts +1 -1
- package/src/scaling/node.ts +43 -6
- package/src/shaders/index.ts +0 -1
- package/src/shaders/model.ts +133 -45
- package/src/shaders/schema.ts +13 -1
- package/src/shape-with-text/document.ts +170 -0
- package/src/shape-with-text/geometry.ts +98 -29
- package/src/shared-style-index.ts +106 -0
- package/src/shared-styles.ts +21 -14
- package/src/slides/drop.ts +94 -0
- package/src/slides/index.ts +133 -0
- package/src/slides/motion.ts +203 -0
- package/src/slides/playback.ts +242 -0
- package/src/slides/types.ts +94 -0
- package/src/slots/frames.ts +2 -3
- package/src/specs/index.ts +2 -0
- package/src/specs/model.ts +40 -0
- package/src/specs/schema.ts +43 -0
- package/src/text/direction.ts +13 -23
- package/src/text/index.ts +1 -0
- package/src/text/lists.ts +20 -7
- package/src/text/name.ts +39 -0
- package/src/text/paragraphs.ts +10 -3
- package/src/text/references.ts +3 -3
- package/src/thumbnail.ts +52 -0
- package/src/transfer/apply.ts +16 -3
- package/src/transfer/copied.ts +7 -2
- package/src/transfer/dependencies.ts +27 -12
- package/src/transfer/history.ts +2 -0
- package/src/transfer/identity.ts +34 -2
- package/src/transfer/index.ts +6 -0
- package/src/transfer/library.ts +177 -0
- package/src/transfer/nodes.ts +28 -0
- package/src/transfer/plan.ts +96 -10
- package/src/transfer/remove.ts +6 -2
- package/src/transfer/validation.ts +15 -7
- package/src/transfer/variables.ts +8 -2
- package/src/types.ts +182 -15
- package/src/undo.ts +10 -1
- package/src/variables/bindings.ts +292 -51
- package/src/variables/easing.ts +281 -0
- package/src/variables/fields.ts +30 -3
- package/src/variables/formula/index.ts +33 -14
- package/src/variables/formula/signatures.ts +6 -2
- package/src/variables/formula/tree.ts +3 -3
- package/src/variables/index.ts +90 -37
- package/src/variables/lookup.ts +25 -2
- package/src/variables/motion.ts +151 -0
- package/src/variables/paints.ts +29 -7
- package/src/variables/resolution.ts +26 -6
- package/src/variables/schema.ts +41 -0
- package/src/variables/style-bindings.ts +137 -0
- package/src/variables/units.ts +2 -3
- package/dist/shaders/still.d.ts +0 -18
- package/dist/shaders/still.d.ts.map +0 -1
- package/dist/shaders/still.js +0 -36
- package/dist/shaders/still.js.map +0 -1
- package/src/shaders/still.ts +0 -41
package/dist/css/blend.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { BlendMode } from "../types.js";
|
|
2
|
-
//#region src/css/blend.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Each blend mode as CSS names it, for `mix-blend-mode` and `background-blend-mode`. Linear
|
|
5
4
|
* burn and linear dodge are the `plus-` modes, which `mix-blend-mode` takes and
|
|
6
5
|
* `background-blend-mode` does not.
|
|
7
6
|
*/
|
|
8
|
-
declare const CSS_BLEND_MODE: Partial<Record<BlendMode, string>>;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { CSS_BLEND_MODE };
|
|
7
|
+
export declare const CSS_BLEND_MODE: Partial<Record<BlendMode, string>>;
|
|
11
8
|
//# sourceMappingURL=blend.d.ts.map
|
package/dist/css/blend.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blend.d.ts","names":[],"sources":["../../src/css/blend.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"blend.d.ts","names":[],"sources":["../../src/css/blend.ts"],"mappings":";;;;;;qBAOa,gBAAgB,QAAQ,OAAO"}
|
package/dist/css/blend.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/css/blend.ts
|
|
2
2
|
/**
|
|
3
3
|
* Each blend mode as CSS names it, for `mix-blend-mode` and `background-blend-mode`. Linear
|
|
4
4
|
* burn and linear dodge are the `plus-` modes, which `mix-blend-mode` takes and
|
|
@@ -24,7 +24,6 @@ const CSS_BLEND_MODE = {
|
|
|
24
24
|
COLOR: "color",
|
|
25
25
|
LUMINOSITY: "luminosity"
|
|
26
26
|
};
|
|
27
|
-
//#endregion
|
|
28
27
|
export { CSS_BLEND_MODE };
|
|
29
28
|
|
|
30
29
|
//# sourceMappingURL=blend.js.map
|
package/dist/css/grid.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { GridTrack } from "../types.js";
|
|
2
|
-
//#region src/css/grid.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* The tracks of a CSS track list, such as `repeat(3, minmax(0, 1fr)) 120px auto`, at most
|
|
5
4
|
* `MAX_GRID_TRACKS` of them however the list nests `repeat()`.
|
|
6
5
|
*/
|
|
7
|
-
declare function parseCSSGridTracks(value: string): GridTrack[];
|
|
8
|
-
//#endregion
|
|
9
|
-
export { parseCSSGridTracks };
|
|
6
|
+
export declare function parseCSSGridTracks(value: string): GridTrack[];
|
|
10
7
|
//# sourceMappingURL=grid.d.ts.map
|
package/dist/css/grid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid.d.ts","names":[],"sources":["../../src/css/grid.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"grid.d.ts","names":[],"sources":["../../src/css/grid.ts"],"mappings":";;;;;wBA6GgB,mBAAmB,gBAAgB"}
|
package/dist/css/grid.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import valueParser from "postcss-value-parser";
|
|
2
|
+
import { appendAll } from "@open-pencil/std/arrays";
|
|
1
3
|
import { MAX_GRID_TRACKS } from "../layout/limits.js";
|
|
2
4
|
import { parseCSSNumber } from "./values.js";
|
|
3
|
-
|
|
4
|
-
import valueParser from "postcss-value-parser";
|
|
5
|
-
//#region src/css/grid.ts
|
|
5
|
+
// src/css/grid.ts
|
|
6
6
|
/** Bounds a `repeat()` count, which a typo could make huge. */
|
|
7
7
|
const MAX_REPEATED_TRACKS = 100;
|
|
8
8
|
/** `auto`, and sizes a grid track cannot express, size to their content rather than to 0. */
|
|
@@ -90,7 +90,6 @@ function tracksOf(nodes) {
|
|
|
90
90
|
function parseCSSGridTracks(value) {
|
|
91
91
|
return tracksOf(valueParser(value).nodes);
|
|
92
92
|
}
|
|
93
|
-
//#endregion
|
|
94
93
|
export { parseCSSGridTracks };
|
|
95
94
|
|
|
96
95
|
//# sourceMappingURL=grid.js.map
|
package/dist/css/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { CSS_BLEND_MODE } from "./blend.js";
|
|
2
2
|
import { parseCSSGridTracks } from "./grid.js";
|
|
3
3
|
import { CSSAspectRatio, parseCSSAlignItems, parseCSSAlignSelf, parseCSSAspectRatio, parseCSSFlexDirection, parseCSSJustifyContent } from "./layout.js";
|
|
4
|
+
import { parseCSSEasing, parseCSSTime } from "./motion.js";
|
|
4
5
|
import { parseCSSShadows } from "./shadows.js";
|
|
5
6
|
import { CSSFontFamily, CSS_GENERIC_FONT_FAMILIES, cssFontFamilyName, parseCSSFontFamilies, parseCSSFontFamily, parseCSSLetterSpacing, parseCSSLineHeight, resolveCSSFontFamily } from "./text.js";
|
|
6
7
|
import { CSSTransformBox, CSSTransformStyle, parseCSSTransform, parseCSSTransformOrigin, parseCSSTransforms } from "./transform.js";
|
|
7
8
|
import { dimension, parseCSSColor, parseCSSNumber, parseCSSURLReferences, parseCSSURLs, parseFragmentReference, parsePaintFallback, splitCSSLayers, splitCSSValue } from "./values.js";
|
|
8
|
-
export { type CSSAspectRatio, type CSSFontFamily, type CSSTransformBox, type CSSTransformStyle, CSS_BLEND_MODE, CSS_GENERIC_FONT_FAMILIES, cssFontFamilyName, dimension, parseCSSAlignItems, parseCSSAlignSelf, parseCSSAspectRatio, parseCSSColor, parseCSSFlexDirection, parseCSSFontFamilies, parseCSSFontFamily, parseCSSGridTracks, parseCSSJustifyContent, parseCSSLetterSpacing, parseCSSLineHeight, parseCSSNumber, parseCSSShadows, parseCSSTransform, parseCSSTransformOrigin, parseCSSTransforms, parseCSSURLReferences, parseCSSURLs, parseFragmentReference, parsePaintFallback, resolveCSSFontFamily, splitCSSLayers, splitCSSValue };
|
|
9
|
+
export { type CSSAspectRatio, type CSSFontFamily, type CSSTransformBox, type CSSTransformStyle, CSS_BLEND_MODE, CSS_GENERIC_FONT_FAMILIES, cssFontFamilyName, dimension, parseCSSAlignItems, parseCSSAlignSelf, parseCSSAspectRatio, parseCSSColor, parseCSSEasing, parseCSSFlexDirection, parseCSSFontFamilies, parseCSSFontFamily, parseCSSGridTracks, parseCSSJustifyContent, parseCSSLetterSpacing, parseCSSLineHeight, parseCSSNumber, parseCSSShadows, parseCSSTime, parseCSSTransform, parseCSSTransformOrigin, parseCSSTransforms, parseCSSURLReferences, parseCSSURLs, parseFragmentReference, parsePaintFallback, resolveCSSFontFamily, splitCSSLayers, splitCSSValue };
|
package/dist/css/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { CSS_BLEND_MODE } from "./blend.js";
|
|
2
|
-
import { dimension, parseCSSColor, parseCSSNumber, parseCSSURLReferences, parseCSSURLs, parseFragmentReference, parsePaintFallback, splitCSSLayers, splitCSSValue } from "./values.js";
|
|
3
2
|
import { parseCSSGridTracks } from "./grid.js";
|
|
4
3
|
import { parseCSSAlignItems, parseCSSAlignSelf, parseCSSAspectRatio, parseCSSFlexDirection, parseCSSJustifyContent } from "./layout.js";
|
|
4
|
+
import { parseCSSEasing, parseCSSTime } from "./motion.js";
|
|
5
5
|
import { parseCSSShadows } from "./shadows.js";
|
|
6
6
|
import { CSS_GENERIC_FONT_FAMILIES, cssFontFamilyName, parseCSSFontFamilies, parseCSSFontFamily, parseCSSLetterSpacing, parseCSSLineHeight, resolveCSSFontFamily } from "./text.js";
|
|
7
7
|
import { parseCSSTransform, parseCSSTransformOrigin, parseCSSTransforms } from "./transform.js";
|
|
8
|
-
|
|
8
|
+
import { dimension, parseCSSColor, parseCSSNumber, parseCSSURLReferences, parseCSSURLs, parseFragmentReference, parsePaintFallback, splitCSSLayers, splitCSSValue } from "./values.js";
|
|
9
|
+
export { CSS_BLEND_MODE, CSS_GENERIC_FONT_FAMILIES, cssFontFamilyName, dimension, parseCSSAlignItems, parseCSSAlignSelf, parseCSSAspectRatio, parseCSSColor, parseCSSEasing, parseCSSFlexDirection, parseCSSFontFamilies, parseCSSFontFamily, parseCSSGridTracks, parseCSSJustifyContent, parseCSSLetterSpacing, parseCSSLineHeight, parseCSSNumber, parseCSSShadows, parseCSSTime, parseCSSTransform, parseCSSTransformOrigin, parseCSSTransforms, parseCSSURLReferences, parseCSSURLs, parseFragmentReference, parsePaintFallback, resolveCSSFontFamily, splitCSSLayers, splitCSSValue };
|
package/dist/css/layout.d.ts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { LayoutAlign, LayoutAlignSelf, LayoutCounterAlign } from "../types.js";
|
|
2
1
|
import { AutoLayoutDirection } from "../layout/keywords.js";
|
|
3
|
-
|
|
2
|
+
import { LayoutAlign, LayoutAlignSelf, LayoutCounterAlign } from "../types.js";
|
|
4
3
|
/** A stack direction from `flex-direction`; the reversed directions have no auto layout. */
|
|
5
|
-
declare function parseCSSFlexDirection(value: string | undefined): AutoLayoutDirection | undefined;
|
|
4
|
+
export declare function parseCSSFlexDirection(value: string | undefined): AutoLayoutDirection | undefined;
|
|
6
5
|
/**
|
|
7
6
|
* Primary axis alignment from `justify-content`; `normal` packs flex items at the start. Design
|
|
8
7
|
* JSX's `between` is not CSS, which browsers ignore, so it is not read here.
|
|
9
8
|
*/
|
|
10
|
-
declare function parseCSSJustifyContent(value: string | undefined): LayoutAlign | undefined;
|
|
9
|
+
export declare function parseCSSJustifyContent(value: string | undefined): LayoutAlign | undefined;
|
|
11
10
|
/** Cross axis alignment from `align-items`; `normal` stretches flex items. */
|
|
12
|
-
declare function parseCSSAlignItems(value: string | undefined): LayoutCounterAlign | undefined;
|
|
11
|
+
export declare function parseCSSAlignItems(value: string | undefined): LayoutCounterAlign | undefined;
|
|
13
12
|
/** One flex item's cross axis alignment from `align-self`; `normal` stretches it. */
|
|
14
|
-
declare function parseCSSAlignSelf(value: string | undefined): LayoutAlignSelf | undefined;
|
|
13
|
+
export declare function parseCSSAlignSelf(value: string | undefined): LayoutAlignSelf | undefined;
|
|
15
14
|
/** An `aspect-ratio`: width over height, and whether an `auto` stands beside it. */
|
|
16
|
-
interface CSSAspectRatio {
|
|
15
|
+
export interface CSSAspectRatio {
|
|
17
16
|
ratio: number;
|
|
18
17
|
/** With `auto`, the ratio sizes the content box, whatever `box-sizing` says. */
|
|
19
18
|
auto: boolean;
|
|
@@ -23,7 +22,5 @@ interface CSSAspectRatio {
|
|
|
23
22
|
* side of a slash, with an `auto` on either side or none. Null for `auto` alone and for a ratio
|
|
24
23
|
* with a zero, negative, or infinite side.
|
|
25
24
|
*/
|
|
26
|
-
declare function parseCSSAspectRatio(value: string | undefined): CSSAspectRatio | null;
|
|
27
|
-
//#endregion
|
|
28
|
-
export { CSSAspectRatio, parseCSSAlignItems, parseCSSAlignSelf, parseCSSAspectRatio, parseCSSFlexDirection, parseCSSJustifyContent };
|
|
25
|
+
export declare function parseCSSAspectRatio(value: string | undefined): CSSAspectRatio | null;
|
|
29
26
|
//# sourceMappingURL=layout.d.ts.map
|
package/dist/css/layout.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","names":[],"sources":["../../src/css/layout.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"layout.d.ts","names":[],"sources":["../../src/css/layout.ts"],"mappings":";;;wBA2BgB,sBAAsB,4BAA4B;;;;;wBASlD,uBAAuB,4BAA4B;;wBAOnD,mBAAmB,4BAA4B;;wBAM/C,kBAAkB,4BAA4B;;iBAM7C;EACf;;EAEA;;;;;;;wBAQc,oBAAoB,4BAA4B"}
|
package/dist/css/layout.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { parseAutoLayoutDirection, parseCounterAxisAlign, parseLayoutAlignSelf, parsePrimaryAxisAlign } from "../layout/keywords.js";
|
|
2
1
|
import valueParser from "postcss-value-parser";
|
|
3
|
-
|
|
2
|
+
import { parseAutoLayoutDirection, parseCounterAxisAlign, parseLayoutAlignSelf, parsePrimaryAxisAlign } from "../layout/keywords.js";
|
|
3
|
+
// src/css/layout.ts
|
|
4
4
|
/**
|
|
5
5
|
* The one alignment keyword a CSS box alignment value names, or `undefined` when it names
|
|
6
6
|
* something auto layout cannot express. An overflow position (`safe center`) is dropped, and
|
|
@@ -64,7 +64,6 @@ function positiveRatio(ratio, auto) {
|
|
|
64
64
|
auto
|
|
65
65
|
} : null;
|
|
66
66
|
}
|
|
67
|
-
//#endregion
|
|
68
67
|
export { parseCSSAlignItems, parseCSSAlignSelf, parseCSSAspectRatio, parseCSSFlexDirection, parseCSSJustifyContent };
|
|
69
68
|
|
|
70
69
|
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Easing } from "../types.js";
|
|
2
|
+
/** A CSS `<time>` in seconds: `250ms` or `0.25s`; a bare number is seconds. Null otherwise. */
|
|
3
|
+
export declare function parseCSSTime(value: string): number | null;
|
|
4
|
+
/**
|
|
5
|
+
* A CSS easing function as an easing: a keyword Figma has a preset for, `ease`, or
|
|
6
|
+
* `cubic-bezier(x1, y1, x2, y2)` with both x between 0 and 1. Null for anything else.
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseCSSEasing(value: string): Easing | null;
|
|
9
|
+
//# sourceMappingURL=motion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"motion.d.ts","names":[],"sources":["../../src/css/motion.ts"],"mappings":";;wBAOgB,aAAa;;;;;wBAoBb,eAAe,gBAAgB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import valueParser from "postcss-value-parser";
|
|
2
|
+
import { easingForBezier, easingPreset } from "../variables/easing.js";
|
|
3
|
+
import { dimension } from "./values.js";
|
|
4
|
+
// src/css/motion.ts
|
|
5
|
+
/** A CSS `<time>` in seconds: `250ms` or `0.25s`; a bare number is seconds. Null otherwise. */
|
|
6
|
+
function parseCSSTime(value) {
|
|
7
|
+
const parsed = dimension(value.trim());
|
|
8
|
+
if (!parsed) return null;
|
|
9
|
+
if (parsed.unit === "ms") return parsed.number / 1e3;
|
|
10
|
+
return parsed.unit === "s" || parsed.unit === "" ? parsed.number : null;
|
|
11
|
+
}
|
|
12
|
+
/** The CSS keywords that name one of Figma's curves, and `step-end`, which holds. */
|
|
13
|
+
const KEYWORD_CURVES = {
|
|
14
|
+
linear: "LINEAR",
|
|
15
|
+
"ease-in": "EASE_IN",
|
|
16
|
+
"ease-out": "OUT_CUBIC",
|
|
17
|
+
"ease-in-out": "INOUT_CUBIC",
|
|
18
|
+
"step-end": "HOLD"
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* A CSS easing function as an easing: a keyword Figma has a preset for, `ease`, or
|
|
22
|
+
* `cubic-bezier(x1, y1, x2, y2)` with both x between 0 and 1. Null for anything else.
|
|
23
|
+
*/
|
|
24
|
+
function parseCSSEasing(value) {
|
|
25
|
+
const nodes = valueParser(value.trim()).nodes.filter((node) => node.type !== "space");
|
|
26
|
+
const [node] = nodes;
|
|
27
|
+
if (nodes.length !== 1) return null;
|
|
28
|
+
if (node.type === "word") {
|
|
29
|
+
const keyword = node.value.toLowerCase();
|
|
30
|
+
if (keyword === "ease") return {
|
|
31
|
+
easing: "CUSTOM_CUBIC",
|
|
32
|
+
bezier: {
|
|
33
|
+
x1: .25,
|
|
34
|
+
y1: .1,
|
|
35
|
+
x2: .25,
|
|
36
|
+
y2: 1
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const curve = KEYWORD_CURVES[keyword];
|
|
40
|
+
return curve ? easingPreset(curve) : null;
|
|
41
|
+
}
|
|
42
|
+
if (node.type !== "function" || node.value.toLowerCase() !== "cubic-bezier") return null;
|
|
43
|
+
const parts = node.nodes.filter((part) => part.type !== "space");
|
|
44
|
+
const separated = parts.every((part, index) => index % 2 === 0 ? part.type === "word" : part.type === "div" && part.value === ",");
|
|
45
|
+
if (parts.length !== 7 || !separated) return null;
|
|
46
|
+
const numbers = parts.filter((_, index) => index % 2 === 0).map((part) => dimension(part.value));
|
|
47
|
+
if (numbers.some((number) => number?.unit !== "")) return null;
|
|
48
|
+
const [x1, y1, x2, y2] = numbers.map((number) => number?.number ?? 0);
|
|
49
|
+
if (x1 < 0 || x1 > 1 || x2 < 0 || x2 > 1) return null;
|
|
50
|
+
return easingForBezier({
|
|
51
|
+
x1,
|
|
52
|
+
y1,
|
|
53
|
+
x2,
|
|
54
|
+
y2
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
export { parseCSSEasing, parseCSSTime };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=motion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"motion.js","names":[],"sources":["../../src/css/motion.ts"],"sourcesContent":["import valueParser from 'postcss-value-parser'\n\nimport type { Easing } from '../types'\nimport { easingForBezier, easingPreset } from '../variables/easing'\nimport { dimension } from './values'\n\n/** A CSS `<time>` in seconds: `250ms` or `0.25s`; a bare number is seconds. Null otherwise. */\nexport function parseCSSTime(value: string): number | null {\n const parsed = dimension(value.trim())\n if (!parsed) return null\n if (parsed.unit === 'ms') return parsed.number / 1000\n return parsed.unit === 's' || parsed.unit === '' ? parsed.number : null\n}\n\n/** The CSS keywords that name one of Figma's curves, and `step-end`, which holds. */\nconst KEYWORD_CURVES: Partial<Record<string, Easing['easing']>> = {\n linear: 'LINEAR',\n 'ease-in': 'EASE_IN',\n 'ease-out': 'OUT_CUBIC',\n 'ease-in-out': 'INOUT_CUBIC',\n 'step-end': 'HOLD'\n}\n\n/**\n * A CSS easing function as an easing: a keyword Figma has a preset for, `ease`, or\n * `cubic-bezier(x1, y1, x2, y2)` with both x between 0 and 1. Null for anything else.\n */\nexport function parseCSSEasing(value: string): Easing | null {\n const nodes = valueParser(value.trim()).nodes.filter((node) => node.type !== 'space')\n const [node] = nodes\n if (nodes.length !== 1) return null\n if (node.type === 'word') {\n const keyword = node.value.toLowerCase()\n if (keyword === 'ease')\n return { easing: 'CUSTOM_CUBIC', bezier: { x1: 0.25, y1: 0.1, x2: 0.25, y2: 1 } }\n const curve = KEYWORD_CURVES[keyword]\n return curve ? easingPreset(curve) : null\n }\n if (node.type !== 'function' || node.value.toLowerCase() !== 'cubic-bezier') return null\n // Exactly four numbers between commas: nothing else, such as a fifth argument or a function.\n const parts = node.nodes.filter((part) => part.type !== 'space')\n const separated = parts.every((part, index) =>\n index % 2 === 0 ? part.type === 'word' : part.type === 'div' && part.value === ','\n )\n if (parts.length !== 7 || !separated) return null\n const numbers = parts.filter((_, index) => index % 2 === 0).map((part) => dimension(part.value))\n if (numbers.some((number) => number?.unit !== '')) return null\n const [x1, y1, x2, y2] = numbers.map((number) => number?.number ?? 0)\n if (x1 < 0 || x1 > 1 || x2 < 0 || x2 > 1) return null\n return easingForBezier({ x1, y1, x2, y2 })\n}\n"],"mappings":";;;;;AAOA,SAAgB,aAAa,OAA8B;CACzD,MAAM,SAAS,UAAU,MAAM,KAAK,CAAC;CACrC,IAAI,CAAC,QAAQ,OAAO;CACpB,IAAI,OAAO,SAAS,MAAM,OAAO,OAAO,SAAS;CACjD,OAAO,OAAO,SAAS,OAAO,OAAO,SAAS,KAAK,OAAO,SAAS;AACrE;;AAGA,MAAM,iBAA4D;CAChE,QAAQ;CACR,WAAW;CACX,YAAY;CACZ,eAAe;CACf,YAAY;AACd;;;;;AAMA,SAAgB,eAAe,OAA8B;CAC3D,MAAM,QAAQ,YAAY,MAAM,KAAK,CAAC,CAAC,CAAC,MAAM,QAAQ,SAAS,KAAK,SAAS,OAAO;CACpF,MAAM,CAAC,QAAQ;CACf,IAAI,MAAM,WAAW,GAAG,OAAO;CAC/B,IAAI,KAAK,SAAS,QAAQ;EACxB,MAAM,UAAU,KAAK,MAAM,YAAY;EACvC,IAAI,YAAY,QACd,OAAO;GAAE,QAAQ;GAAgB,QAAQ;IAAE,IAAI;IAAM,IAAI;IAAK,IAAI;IAAM,IAAI;GAAE;EAAE;EAClF,MAAM,QAAQ,eAAe;EAC7B,OAAO,QAAQ,aAAa,KAAK,IAAI;CACvC;CACA,IAAI,KAAK,SAAS,cAAc,KAAK,MAAM,YAAY,MAAM,gBAAgB,OAAO;CAEpF,MAAM,QAAQ,KAAK,MAAM,QAAQ,SAAS,KAAK,SAAS,OAAO;CAC/D,MAAM,YAAY,MAAM,OAAO,MAAM,UACnC,QAAQ,MAAM,IAAI,KAAK,SAAS,SAAS,KAAK,SAAS,SAAS,KAAK,UAAU,GACjF;CACA,IAAI,MAAM,WAAW,KAAK,CAAC,WAAW,OAAO;CAC7C,MAAM,UAAU,MAAM,QAAQ,GAAG,UAAU,QAAQ,MAAM,CAAC,CAAC,CAAC,KAAK,SAAS,UAAU,KAAK,KAAK,CAAC;CAC/F,IAAI,QAAQ,MAAM,WAAW,QAAQ,SAAS,EAAE,GAAG,OAAO;CAC1D,MAAM,CAAC,IAAI,IAAI,IAAI,MAAM,QAAQ,KAAK,WAAW,QAAQ,UAAU,CAAC;CACpE,IAAI,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,GAAG,OAAO;CACjD,OAAO,gBAAgB;EAAE;EAAI;EAAI;EAAI;CAAG,CAAC;AAC3C"}
|
package/dist/css/shadows.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { Effect } from "../types.js";
|
|
2
|
-
//#region src/css/shadows.d.ts
|
|
1
|
+
import { ColorProfile, Effect } from "../types.js";
|
|
3
2
|
/**
|
|
4
3
|
* The shadows of a CSS `box-shadow` or `text-shadow` list, such as
|
|
5
|
-
* `0 4px 8px rgb(0 0 0 / 0.2), inset 0 1px #fff`: drop shadows, and inner shadows for `inset
|
|
4
|
+
* `0 4px 8px rgb(0 0 0 / 0.2), inset 0 1px #fff`: drop shadows, and inner shadows for `inset`,
|
|
5
|
+
* their colors read into `profile`.
|
|
6
6
|
*/
|
|
7
|
-
declare function parseCSSShadows(value: string | undefined): Effect[];
|
|
8
|
-
//#endregion
|
|
9
|
-
export { parseCSSShadows };
|
|
7
|
+
export declare function parseCSSShadows(value: string | undefined, profile: ColorProfile): Effect[];
|
|
10
8
|
//# sourceMappingURL=shadows.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadows.d.ts","names":[],"sources":["../../src/css/shadows.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"shadows.d.ts","names":[],"sources":["../../src/css/shadows.ts"],"mappings":";;;;;;wBAiDgB,gBAAgB,2BAA2B,SAAS,eAAe"}
|
package/dist/css/shadows.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import valueParser from "postcss-value-parser";
|
|
2
|
+
import { tryParseColor } from "../color/management.js";
|
|
1
3
|
import { BLACK } from "../constants.js";
|
|
2
|
-
import { tryParseColor } from "../color/index.js";
|
|
3
4
|
import { cssLayerNodes, parseCSSNumber } from "./values.js";
|
|
4
|
-
|
|
5
|
-
//#region src/css/shadows.ts
|
|
5
|
+
// src/css/shadows.ts
|
|
6
6
|
/**
|
|
7
7
|
* One layer: `inset`, two to four lengths, and a color in any order. Without a color it is
|
|
8
8
|
* black, as `currentColor` usually is; a layer with anything else, such as `none`, is dropped.
|
|
9
9
|
*/
|
|
10
|
-
function shadowOf(nodes) {
|
|
10
|
+
function shadowOf(nodes, profile) {
|
|
11
11
|
let inset = false;
|
|
12
12
|
let color = null;
|
|
13
13
|
const lengths = [];
|
|
@@ -21,7 +21,7 @@ function shadowOf(nodes) {
|
|
|
21
21
|
lengths.push(length);
|
|
22
22
|
continue;
|
|
23
23
|
}
|
|
24
|
-
const parsed = tryParseColor(valueParser.stringify(node));
|
|
24
|
+
const parsed = tryParseColor(valueParser.stringify(node), profile);
|
|
25
25
|
if (!parsed || color) return [];
|
|
26
26
|
color = parsed;
|
|
27
27
|
}
|
|
@@ -41,13 +41,13 @@ function shadowOf(nodes) {
|
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* The shadows of a CSS `box-shadow` or `text-shadow` list, such as
|
|
44
|
-
* `0 4px 8px rgb(0 0 0 / 0.2), inset 0 1px #fff`: drop shadows, and inner shadows for `inset
|
|
44
|
+
* `0 4px 8px rgb(0 0 0 / 0.2), inset 0 1px #fff`: drop shadows, and inner shadows for `inset`,
|
|
45
|
+
* their colors read into `profile`.
|
|
45
46
|
*/
|
|
46
|
-
function parseCSSShadows(value) {
|
|
47
|
+
function parseCSSShadows(value, profile) {
|
|
47
48
|
if (!value) return [];
|
|
48
|
-
return cssLayerNodes(valueParser(value).nodes).flatMap(shadowOf);
|
|
49
|
+
return cssLayerNodes(valueParser(value).nodes).flatMap((layer) => shadowOf(layer, profile));
|
|
49
50
|
}
|
|
50
|
-
//#endregion
|
|
51
51
|
export { parseCSSShadows };
|
|
52
52
|
|
|
53
53
|
//# sourceMappingURL=shadows.js.map
|
package/dist/css/shadows.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadows.js","names":[],"sources":["../../src/css/shadows.ts"],"sourcesContent":["import valueParser, { type Node } from 'postcss-value-parser'\n\nimport { tryParseColor } from '../color'\nimport { BLACK } from '../constants'\nimport type { Color } from '../primitives'\nimport type { Effect } from '../types'\nimport { cssLayerNodes, parseCSSNumber } from './values'\n\n/**\n * One layer: `inset`, two to four lengths, and a color in any order. Without a color it is\n * black, as `currentColor` usually is; a layer with anything else, such as `none`, is dropped.\n */\nfunction shadowOf(nodes: Node[]): Effect[] {\n let inset = false\n let color: Color | null = null\n const lengths: number[] = []\n for (const node of nodes) {\n if (node.type === 'word' && node.value.toLowerCase() === 'inset') {\n inset = true\n continue\n }\n const length = node.type === 'word' ? parseCSSNumber(node.value) : null\n if (length !== null) {\n lengths.push(length)\n continue\n }\n const parsed = tryParseColor(valueParser.stringify(node))\n if (!parsed || color) return []\n color = parsed\n }\n if (lengths.length < 2 || lengths.length > 4 || color?.a === 0) return []\n const [x = 0, y = 0, radius = 0, spread = 0] = lengths\n return [\n {\n type: inset ? 'INNER_SHADOW' : 'DROP_SHADOW',\n color: color ?? { ...BLACK },\n offset: { x, y },\n radius,\n spread,\n visible: true\n }\n ]\n}\n\n/**\n * The shadows of a CSS `box-shadow` or `text-shadow` list, such as\n * `0 4px 8px rgb(0 0 0 / 0.2), inset 0 1px #fff`: drop shadows, and inner shadows for `inset`.\n */\nexport function parseCSSShadows(value: string | undefined): Effect[] {\n if (!value) return []\n return cssLayerNodes(valueParser(value).nodes).flatMap(shadowOf)\n}\n"],"mappings":";;;;;;;;;AAYA,SAAS,SAAS,
|
|
1
|
+
{"version":3,"file":"shadows.js","names":[],"sources":["../../src/css/shadows.ts"],"sourcesContent":["import valueParser, { type Node } from 'postcss-value-parser'\n\nimport { tryParseColor } from '../color'\nimport { BLACK } from '../constants'\nimport type { Color } from '../primitives'\nimport type { ColorProfile, Effect } from '../types'\nimport { cssLayerNodes, parseCSSNumber } from './values'\n\n/**\n * One layer: `inset`, two to four lengths, and a color in any order. Without a color it is\n * black, as `currentColor` usually is; a layer with anything else, such as `none`, is dropped.\n */\nfunction shadowOf(nodes: Node[], profile: ColorProfile): Effect[] {\n let inset = false\n let color: Color | null = null\n const lengths: number[] = []\n for (const node of nodes) {\n if (node.type === 'word' && node.value.toLowerCase() === 'inset') {\n inset = true\n continue\n }\n const length = node.type === 'word' ? parseCSSNumber(node.value) : null\n if (length !== null) {\n lengths.push(length)\n continue\n }\n const parsed = tryParseColor(valueParser.stringify(node), profile)\n if (!parsed || color) return []\n color = parsed\n }\n if (lengths.length < 2 || lengths.length > 4 || color?.a === 0) return []\n const [x = 0, y = 0, radius = 0, spread = 0] = lengths\n return [\n {\n type: inset ? 'INNER_SHADOW' : 'DROP_SHADOW',\n color: color ?? { ...BLACK },\n offset: { x, y },\n radius,\n spread,\n visible: true\n }\n ]\n}\n\n/**\n * The shadows of a CSS `box-shadow` or `text-shadow` list, such as\n * `0 4px 8px rgb(0 0 0 / 0.2), inset 0 1px #fff`: drop shadows, and inner shadows for `inset`,\n * their colors read into `profile`.\n */\nexport function parseCSSShadows(value: string | undefined, profile: ColorProfile): Effect[] {\n if (!value) return []\n return cssLayerNodes(valueParser(value).nodes).flatMap((layer) => shadowOf(layer, profile))\n}\n"],"mappings":";;;;;;;;;AAYA,SAAS,SAAS,OAAe,SAAiC;CAChE,IAAI,QAAQ;CACZ,IAAI,QAAsB;CAC1B,MAAM,UAAoB,CAAC;CAC3B,KAAK,MAAM,QAAQ,OAAO;EACxB,IAAI,KAAK,SAAS,UAAU,KAAK,MAAM,YAAY,MAAM,SAAS;GAChE,QAAQ;GACR;EACF;EACA,MAAM,SAAS,KAAK,SAAS,SAAS,eAAe,KAAK,KAAK,IAAI;EACnE,IAAI,WAAW,MAAM;GACnB,QAAQ,KAAK,MAAM;GACnB;EACF;EACA,MAAM,SAAS,cAAc,YAAY,UAAU,IAAI,GAAG,OAAO;EACjE,IAAI,CAAC,UAAU,OAAO,OAAO,CAAC;EAC9B,QAAQ;CACV;CACA,IAAI,QAAQ,SAAS,KAAK,QAAQ,SAAS,KAAK,OAAO,MAAM,GAAG,OAAO,CAAC;CACxE,MAAM,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,SAAS,KAAK;CAC/C,OAAO,CACL;EACE,MAAM,QAAQ,iBAAiB;EAC/B,OAAO,SAAS,EAAE,GAAG,MAAM;EAC3B,QAAQ;GAAE;GAAG;EAAE;EACf;EACA;EACA,SAAS;CACX,CACF;AACF;;;;;;AAOA,SAAgB,gBAAgB,OAA2B,SAAiC;CAC1F,IAAI,CAAC,OAAO,OAAO,CAAC;CACpB,OAAO,cAAc,YAAY,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,UAAU,SAAS,OAAO,OAAO,CAAC;AAC5F"}
|
package/dist/css/text.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TextLength } from "../types.js";
|
|
2
|
-
//#region src/css/text.d.ts
|
|
3
2
|
/** A family of a CSS `font-family` list: its name, and whether it was a quoted string. */
|
|
4
|
-
interface CSSFontFamily {
|
|
3
|
+
export interface CSSFontFamily {
|
|
5
4
|
name: string;
|
|
6
5
|
quoted: boolean;
|
|
7
6
|
}
|
|
@@ -9,41 +8,39 @@ interface CSSFontFamily {
|
|
|
9
8
|
* Every family of a CSS `font-family` list in order, without quotes and escapes, as
|
|
10
9
|
* `parseCSSFontFamily` reads the first.
|
|
11
10
|
*/
|
|
12
|
-
declare function parseCSSFontFamilies(value: string | undefined): CSSFontFamily[];
|
|
11
|
+
export declare function parseCSSFontFamilies(value: string | undefined): CSSFontFamily[];
|
|
13
12
|
/**
|
|
14
13
|
* The real family a family of a `font-family` list names: a generic one, such as `sans-serif`,
|
|
15
14
|
* mapped to a real one, and any other name as it is. A quoted name is never a generic.
|
|
16
15
|
*/
|
|
17
|
-
declare function cssFontFamilyName(family: CSSFontFamily): string;
|
|
16
|
+
export declare function cssFontFamilyName(family: CSSFontFamily): string;
|
|
18
17
|
/**
|
|
19
18
|
* The first family of a CSS `font-family` list, without its quotes and escapes. A family is a quoted
|
|
20
19
|
* string or unquoted words, which join with single spaces; a quote opens a string only at the start
|
|
21
20
|
* of the family, so a name list such as draw.io's keeps `O'Reilly`. Null for an empty list.
|
|
22
21
|
*/
|
|
23
|
-
declare function parseCSSFontFamily(value: string | undefined): string | null;
|
|
22
|
+
export declare function parseCSSFontFamily(value: string | undefined): string | null;
|
|
24
23
|
/**
|
|
25
24
|
* Real families for CSS generic families, which name no font but whatever the browser picks for
|
|
26
25
|
* them, and for `-apple-system` and `BlinkMacSystemFont`, which browsers read as `system-ui`.
|
|
27
26
|
* Keyed by lowercase name; the rest of the generics, such as `cursive`, draw in the sans-serif one.
|
|
28
27
|
*/
|
|
29
|
-
declare const CSS_GENERIC_FONT_FAMILIES: Readonly<Record<string, string>>;
|
|
28
|
+
export declare const CSS_GENERIC_FONT_FAMILIES: Readonly<Record<string, string>>;
|
|
30
29
|
/**
|
|
31
30
|
* The family a CSS `font-family` list sets text in: its first family, with a generic family
|
|
32
31
|
* such as `sans-serif` or `system-ui` mapped to a real one. A quoted name is a family's own name,
|
|
33
32
|
* never a generic. Null for an empty list.
|
|
34
33
|
*/
|
|
35
|
-
declare function resolveCSSFontFamily(value: string | undefined): string | null;
|
|
34
|
+
export declare function resolveCSSFontFamily(value: string | undefined): string | null;
|
|
36
35
|
/**
|
|
37
36
|
* A CSS `line-height` as a text length: a unitless multiple, `em`, or a percent follows the font size,
|
|
38
37
|
* as a percent does in Figma; pixels stay pixels; `normal` is automatic, a null. Undefined for a
|
|
39
38
|
* value it cannot read.
|
|
40
39
|
*/
|
|
41
|
-
declare function parseCSSLineHeight(value: string | undefined): TextLength | null | undefined;
|
|
40
|
+
export declare function parseCSSLineHeight(value: string | undefined): TextLength | null | undefined;
|
|
42
41
|
/**
|
|
43
42
|
* A CSS `letter-spacing` as a text length: `em` is a percent of the font size, pixels stay pixels,
|
|
44
43
|
* and `normal` is none. Undefined for a value it cannot read.
|
|
45
44
|
*/
|
|
46
|
-
declare function parseCSSLetterSpacing(value: string | undefined): TextLength | undefined;
|
|
47
|
-
//#endregion
|
|
48
|
-
export { CSSFontFamily, CSS_GENERIC_FONT_FAMILIES, cssFontFamilyName, parseCSSFontFamilies, parseCSSFontFamily, parseCSSLetterSpacing, parseCSSLineHeight, resolveCSSFontFamily };
|
|
45
|
+
export declare function parseCSSLetterSpacing(value: string | undefined): TextLength | undefined;
|
|
49
46
|
//# sourceMappingURL=text.d.ts.map
|
package/dist/css/text.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","names":[],"sources":["../../src/css/text.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"text.d.ts","names":[],"sources":["../../src/css/text.ts"],"mappings":";;iBA+BiB;EACf;EACA;;;;;;wBAuBc,qBAAqB,4BAA4B;;;;;wBAgBjD,kBAAkB,QAAQ;;;;;;wBAU1B,mBAAmB;;;;;;qBActB,2BAA2B,SAAS;;;;;;wBAsBjC,qBAAqB;;;;;;wBAUrB,mBAAmB,4BAA4B;;;;;wBAe/C,sBAAsB,4BAA4B"}
|
package/dist/css/text.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DEFAULT_FONT_FAMILY } from "../constants.js";
|
|
2
2
|
import { percentLength, pixelLength } from "../text/lengths.js";
|
|
3
3
|
import { dimension, parseCSSNumber } from "./values.js";
|
|
4
|
-
|
|
4
|
+
// src/css/text.ts
|
|
5
5
|
/** A CSS escape: hex digits and one optional whitespace, an escaped line break, or any one character. */
|
|
6
6
|
const CSS_ESCAPE = /\\(?:([0-9a-fA-F]{1,6})(?:\r\n|[ \t\n\r\f])?|(?:\r\n|[\n\r\f])|([\s\S]))?/gu;
|
|
7
7
|
/** The largest Unicode code point. */
|
|
@@ -137,7 +137,6 @@ function parseCSSLetterSpacing(value) {
|
|
|
137
137
|
const pixels = parseCSSNumber(trimmed);
|
|
138
138
|
return pixels === null ? void 0 : pixelLength(pixels);
|
|
139
139
|
}
|
|
140
|
-
//#endregion
|
|
141
140
|
export { CSS_GENERIC_FONT_FAMILIES, cssFontFamilyName, parseCSSFontFamilies, parseCSSFontFamily, parseCSSLetterSpacing, parseCSSLineHeight, resolveCSSFontFamily };
|
|
142
141
|
|
|
143
142
|
//# sourceMappingURL=text.js.map
|
package/dist/css/transform.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { Vector } from "../primitives/index.js";
|
|
2
1
|
import { Mat3 } from "../matrix.js";
|
|
3
|
-
|
|
2
|
+
import { Vector } from "../primitives/index.js";
|
|
4
3
|
/** The size percentages in a transform resolve against: the element's border box. */
|
|
5
|
-
interface CSSTransformBox {
|
|
4
|
+
export interface CSSTransformBox {
|
|
6
5
|
width: number;
|
|
7
6
|
height: number;
|
|
8
7
|
}
|
|
9
8
|
/** The properties that transform an element, as CSS applies them: translate, rotate, scale, transform. */
|
|
10
|
-
interface CSSTransformStyle {
|
|
9
|
+
export interface CSSTransformStyle {
|
|
11
10
|
transform?: string;
|
|
12
11
|
translate?: string;
|
|
13
12
|
rotate?: string;
|
|
@@ -17,18 +16,16 @@ interface CSSTransformStyle {
|
|
|
17
16
|
* A CSS `transform` as a 2D matrix about the transform origin, with percentages resolved against
|
|
18
17
|
* `box`. The identity for `none`; null when it turns out of the plane or cannot be read.
|
|
19
18
|
*/
|
|
20
|
-
declare function parseCSSTransform(value: string | undefined, box: CSSTransformBox): Mat3 | null;
|
|
19
|
+
export declare function parseCSSTransform(value: string | undefined, box: CSSTransformBox): Mat3 | null;
|
|
21
20
|
/**
|
|
22
21
|
* The 2D matrix about the transform origin that an element's `translate`, `rotate`, `scale`, and
|
|
23
22
|
* `transform` make together, applied in that order as CSS applies them. Null when one of them
|
|
24
23
|
* turns out of the plane or cannot be read.
|
|
25
24
|
*/
|
|
26
|
-
declare function parseCSSTransforms(style: CSSTransformStyle, box: CSSTransformBox): Mat3 | null;
|
|
25
|
+
export declare function parseCSSTransforms(style: CSSTransformStyle, box: CSSTransformBox): Mat3 | null;
|
|
27
26
|
/**
|
|
28
27
|
* Where a CSS `transform-origin` puts the point an element transforms about, from its border
|
|
29
28
|
* box's top left corner. Its center when it is unset or cannot be read.
|
|
30
29
|
*/
|
|
31
|
-
declare function parseCSSTransformOrigin(value: string | undefined, box: CSSTransformBox): Vector;
|
|
32
|
-
//#endregion
|
|
33
|
-
export { CSSTransformBox, CSSTransformStyle, parseCSSTransform, parseCSSTransformOrigin, parseCSSTransforms };
|
|
30
|
+
export declare function parseCSSTransformOrigin(value: string | undefined, box: CSSTransformBox): Vector;
|
|
34
31
|
//# sourceMappingURL=transform.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","names":[],"sources":["../../src/css/transform.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"transform.d.ts","names":[],"sources":["../../src/css/transform.ts"],"mappings":";;;iBAOiB;EACf;EACA;;;iBAIe;EACf;EACA;EACA;EACA;;;;;;wBAgKc,kBAAkB,2BAA2B,KAAK,kBAAkB;;;;;;wBAoCpE,mBAAmB,OAAO,mBAAmB,KAAK,kBAAkB;;;;;wBAiCpE,wBAAwB,2BAA2B,KAAK,kBAAkB"}
|
package/dist/css/transform.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import valueParser from "postcss-value-parser";
|
|
1
2
|
import Matrix from "../matrix.js";
|
|
2
3
|
import { dimension, splitCSSValue } from "./values.js";
|
|
3
|
-
|
|
4
|
-
//#region src/css/transform.ts
|
|
4
|
+
// src/css/transform.ts
|
|
5
5
|
const ANGLE_UNITS = {
|
|
6
6
|
deg: Math.PI / 180,
|
|
7
7
|
rad: 1,
|
|
@@ -314,7 +314,6 @@ function parseCSSTransformOrigin(value, box) {
|
|
|
314
314
|
y: oy
|
|
315
315
|
};
|
|
316
316
|
}
|
|
317
|
-
//#endregion
|
|
318
317
|
export { parseCSSTransform, parseCSSTransformOrigin, parseCSSTransforms };
|
|
319
318
|
|
|
320
319
|
//# sourceMappingURL=transform.js.map
|
package/dist/css/values.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Color } from "../primitives/index.js";
|
|
2
|
-
|
|
2
|
+
import { ColorProfile } from "../types.js";
|
|
3
3
|
/** A CSS dimension's number and lowercase unit, or null. */
|
|
4
|
-
declare function dimension(value: string): {
|
|
4
|
+
export declare function dimension(value: string): {
|
|
5
5
|
number: number;
|
|
6
6
|
unit: string;
|
|
7
7
|
} | null;
|
|
@@ -9,30 +9,28 @@ declare function dimension(value: string): {
|
|
|
9
9
|
* A CSS number in pixels: unitless, `px`, or `rem`. Null for `auto`, for units that depend on
|
|
10
10
|
* what the value applies to (`%`, `em`, `vh`), and for anything that is not a number.
|
|
11
11
|
*/
|
|
12
|
-
declare function parseCSSNumber(value: string | undefined): number | null;
|
|
13
|
-
/** A CSS color that paints something
|
|
14
|
-
declare function parseCSSColor(value: string | undefined): Color | null;
|
|
12
|
+
export declare function parseCSSNumber(value: string | undefined): number | null;
|
|
13
|
+
/** A CSS color that paints something, as components in `profile`; null for an invalid or transparent one. */
|
|
14
|
+
export declare function parseCSSColor(value: string | undefined, profile?: ColorProfile): Color | null;
|
|
15
15
|
/** The layers of a comma-separated CSS list as text, each its parts joined by single spaces. */
|
|
16
|
-
declare function splitCSSLayers(value: string): string[];
|
|
16
|
+
export declare function splitCSSLayers(value: string): string[];
|
|
17
17
|
/** The space-separated parts of a CSS value, keeping functions such as `rgb(0, 0, 0)` whole. */
|
|
18
|
-
declare function splitCSSValue(value: string): string[];
|
|
18
|
+
export declare function splitCSSValue(value: string): string[];
|
|
19
19
|
/**
|
|
20
20
|
* The id of the element a reference points to in its own document, as `href="#mark"` and
|
|
21
21
|
* `url(#clip)` point, decoded; null for a reference to another file or without a fragment.
|
|
22
22
|
*/
|
|
23
|
-
declare function parseFragmentReference(reference: string | null | undefined): string | null;
|
|
23
|
+
export declare function parseFragmentReference(reference: string | null | undefined): string | null;
|
|
24
24
|
/** What each `url()` in a CSS value points at, quoted or not, such as an image's data URL. */
|
|
25
|
-
declare function parseCSSURLs(value: string | undefined): string[];
|
|
25
|
+
export declare function parseCSSURLs(value: string | undefined): string[];
|
|
26
26
|
/**
|
|
27
27
|
* What a paint written as `url(#id) fallback` falls back to when its reference cannot be used:
|
|
28
28
|
* the value without its `url()`, or undefined when nothing follows it, which paints nothing.
|
|
29
29
|
*/
|
|
30
|
-
declare function parsePaintFallback(value: string): string | undefined;
|
|
30
|
+
export declare function parsePaintFallback(value: string): string | undefined;
|
|
31
31
|
/**
|
|
32
32
|
* The ids a CSS value points at with local `url(#id)` references, as `clip-path`, `mask`,
|
|
33
33
|
* `filter`, and SVG paints do, quoted or not.
|
|
34
34
|
*/
|
|
35
|
-
declare function parseCSSURLReferences(value: string | undefined): string[];
|
|
36
|
-
//#endregion
|
|
37
|
-
export { dimension, parseCSSColor, parseCSSNumber, parseCSSURLReferences, parseCSSURLs, parseFragmentReference, parsePaintFallback, splitCSSLayers, splitCSSValue };
|
|
35
|
+
export declare function parseCSSURLReferences(value: string | undefined): string[];
|
|
38
36
|
//# sourceMappingURL=values.d.ts.map
|
package/dist/css/values.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.d.ts","names":[],"sources":["../../src/css/values.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"values.d.ts","names":[],"sources":["../../src/css/values.ts"],"mappings":";;;wBASgB,UAAU;EAAkB;EAAgB;;;;;;wBAc5C,eAAe;;wBAkBf,cACd,2BACA,UAAS,eACR;;wBA0Ba,eAAe;;wBAOf,cAAc;;;;;wBAUd,uBAAuB;;wBAQvB,aAAa;;;;;wBAgBb,mBAAmB;;;;;wBAenB,sBAAsB"}
|
package/dist/css/values.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { tryParseColor } from "../color/index.js";
|
|
2
1
|
import { compact } from "es-toolkit";
|
|
3
2
|
import valueParser from "postcss-value-parser";
|
|
4
3
|
import { decode, parsePath } from "ufo";
|
|
5
|
-
|
|
4
|
+
import { tryParseColor } from "../color/management.js";
|
|
5
|
+
// src/css/values.ts
|
|
6
6
|
/** A CSS dimension's number and lowercase unit, or null. */
|
|
7
7
|
function dimension(value) {
|
|
8
8
|
const parsed = valueParser.unit(value);
|
|
@@ -32,10 +32,10 @@ function parseCSSNumber(value) {
|
|
|
32
32
|
default: return null;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
/** A CSS color that paints something
|
|
36
|
-
function parseCSSColor(value) {
|
|
35
|
+
/** A CSS color that paints something, as components in `profile`; null for an invalid or transparent one. */
|
|
36
|
+
function parseCSSColor(value, profile = "srgb") {
|
|
37
37
|
if (!value) return null;
|
|
38
|
-
const color = tryParseColor(value.trim());
|
|
38
|
+
const color = tryParseColor(value.trim(), profile);
|
|
39
39
|
return color && color.a > 0 ? color : null;
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
@@ -96,7 +96,6 @@ function parsePaintFallback(value) {
|
|
|
96
96
|
function parseCSSURLReferences(value) {
|
|
97
97
|
return compact(parseCSSURLs(value).map(parseFragmentReference));
|
|
98
98
|
}
|
|
99
|
-
//#endregion
|
|
100
99
|
export { cssLayerNodes, dimension, parseCSSColor, parseCSSNumber, parseCSSURLReferences, parseCSSURLs, parseFragmentReference, parsePaintFallback, splitCSSLayers, splitCSSValue };
|
|
101
100
|
|
|
102
101
|
//# sourceMappingURL=values.js.map
|
package/dist/css/values.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.js","names":[],"sources":["../../src/css/values.ts"],"sourcesContent":["import { compact } from 'es-toolkit'\nimport valueParser, { type Node } from 'postcss-value-parser'\nimport { decode, parsePath } from 'ufo'\n\nimport { tryParseColor } from '../color'\nimport type { Color } from '../primitives'\n\n/** A CSS dimension's number and lowercase unit, or null. */\nexport function dimension(value: string): { number: number; unit: string } | null {\n const parsed = valueParser.unit(value)\n if (!parsed) return null\n const number = Number(parsed.number)\n return Number.isFinite(number) ? { number, unit: parsed.unit.toLowerCase() } : null\n}\n\n/** Pixels in a rem, as browsers use by default. */\nconst ROOT_FONT_SIZE = 16\n\n/**\n * A CSS number in pixels: unitless, `px`, or `rem`. Null for `auto`, for units that depend on\n * what the value applies to (`%`, `em`, `vh`), and for anything that is not a number.\n */\nexport function parseCSSNumber(value: string | undefined): number | null {\n if (!value) return null\n const dimension = valueParser.unit(value.trim())\n if (!dimension) return null\n const number = Number(dimension.number)\n if (!Number.isFinite(number)) return null\n switch (dimension.unit.toLowerCase()) {\n case '':\n case 'px':\n return number\n case 'rem':\n return number * ROOT_FONT_SIZE\n default:\n return null\n }\n}\n\n/** A CSS color that paints something
|
|
1
|
+
{"version":3,"file":"values.js","names":[],"sources":["../../src/css/values.ts"],"sourcesContent":["import { compact } from 'es-toolkit'\nimport valueParser, { type Node } from 'postcss-value-parser'\nimport { decode, parsePath } from 'ufo'\n\nimport { tryParseColor } from '../color'\nimport type { Color } from '../primitives'\nimport type { ColorProfile } from '../types'\n\n/** A CSS dimension's number and lowercase unit, or null. */\nexport function dimension(value: string): { number: number; unit: string } | null {\n const parsed = valueParser.unit(value)\n if (!parsed) return null\n const number = Number(parsed.number)\n return Number.isFinite(number) ? { number, unit: parsed.unit.toLowerCase() } : null\n}\n\n/** Pixels in a rem, as browsers use by default. */\nconst ROOT_FONT_SIZE = 16\n\n/**\n * A CSS number in pixels: unitless, `px`, or `rem`. Null for `auto`, for units that depend on\n * what the value applies to (`%`, `em`, `vh`), and for anything that is not a number.\n */\nexport function parseCSSNumber(value: string | undefined): number | null {\n if (!value) return null\n const dimension = valueParser.unit(value.trim())\n if (!dimension) return null\n const number = Number(dimension.number)\n if (!Number.isFinite(number)) return null\n switch (dimension.unit.toLowerCase()) {\n case '':\n case 'px':\n return number\n case 'rem':\n return number * ROOT_FONT_SIZE\n default:\n return null\n }\n}\n\n/** A CSS color that paints something, as components in `profile`; null for an invalid or transparent one. */\nexport function parseCSSColor(\n value: string | undefined,\n profile: ColorProfile = 'srgb'\n): Color | null {\n if (!value) return null\n const color = tryParseColor(value.trim(), profile)\n return color && color.a > 0 ? color : null\n}\n\n/**\n * The layers of a comma-separated CSS list, such as `box-shadow` or `background-image`, split at\n * its top-level commas, each without its spaces and comments.\n */\nexport function cssLayerNodes(nodes: readonly Node[]): Node[][] {\n const layers: Node[][] = []\n let current: Node[] = []\n for (const node of nodes) {\n if (node.type === 'div' && node.value === ',') {\n layers.push(current)\n current = []\n } else if (node.type !== 'space' && node.type !== 'comment') {\n current.push(node)\n }\n }\n layers.push(current)\n return layers\n}\n\n/** The layers of a comma-separated CSS list as text, each its parts joined by single spaces. */\nexport function splitCSSLayers(value: string): string[] {\n return cssLayerNodes(valueParser(value).nodes).map((layer) =>\n layer.map((node) => valueParser.stringify(node)).join(' ')\n )\n}\n\n/** The space-separated parts of a CSS value, keeping functions such as `rgb(0, 0, 0)` whole. */\nexport function splitCSSValue(value: string): string[] {\n return valueParser(value)\n .nodes.filter((node) => node.type !== 'space' && node.type !== 'comment')\n .map((node) => valueParser.stringify(node))\n}\n\n/**\n * The id of the element a reference points to in its own document, as `href=\"#mark\"` and\n * `url(#clip)` point, decoded; null for a reference to another file or without a fragment.\n */\nexport function parseFragmentReference(reference: string | null | undefined): string | null {\n if (!reference) return null\n const { pathname, search, hash } = parsePath(reference.trim())\n if (pathname || search || hash.length < 2) return null\n return decode(hash.slice(1))\n}\n\n/** What each `url()` in a CSS value points at, quoted or not, such as an image's data URL. */\nexport function parseCSSURLs(value: string | undefined): string[] {\n const urls: string[] = []\n if (!value) return urls\n valueParser(value).walk((node) => {\n if (node.type !== 'function' || node.value.toLowerCase() !== 'url') return true\n const target = node.nodes.at(0)?.value\n if (target) urls.push(target)\n return false\n })\n return urls\n}\n\n/**\n * What a paint written as `url(#id) fallback` falls back to when its reference cannot be used:\n * the value without its `url()`, or undefined when nothing follows it, which paints nothing.\n */\nexport function parsePaintFallback(value: string): string | undefined {\n const rest = valueParser\n .stringify(\n valueParser(value).nodes.filter(\n (node) => node.type !== 'function' || node.value.toLowerCase() !== 'url'\n )\n )\n .trim()\n return rest || undefined\n}\n\n/**\n * The ids a CSS value points at with local `url(#id)` references, as `clip-path`, `mask`,\n * `filter`, and SVG paints do, quoted or not.\n */\nexport function parseCSSURLReferences(value: string | undefined): string[] {\n return compact(parseCSSURLs(value).map(parseFragmentReference))\n}\n"],"mappings":";;;;;;AASA,SAAgB,UAAU,OAAwD;CAChF,MAAM,SAAS,YAAY,KAAK,KAAK;CACrC,IAAI,CAAC,QAAQ,OAAO;CACpB,MAAM,SAAS,OAAO,OAAO,MAAM;CACnC,OAAO,OAAO,SAAS,MAAM,IAAI;EAAE;EAAQ,MAAM,OAAO,KAAK,YAAY;CAAE,IAAI;AACjF;;AAGA,MAAM,iBAAiB;;;;;AAMvB,SAAgB,eAAe,OAA0C;CACvE,IAAI,CAAC,OAAO,OAAO;CACnB,MAAM,YAAY,YAAY,KAAK,MAAM,KAAK,CAAC;CAC/C,IAAI,CAAC,WAAW,OAAO;CACvB,MAAM,SAAS,OAAO,UAAU,MAAM;CACtC,IAAI,CAAC,OAAO,SAAS,MAAM,GAAG,OAAO;CACrC,QAAQ,UAAU,KAAK,YAAY,GAAnC;EACE,KAAK;EACL,KAAK,MACH,OAAO;EACT,KAAK,OACH,OAAO,SAAS;EAClB,SACE,OAAO;CACX;AACF;;AAGA,SAAgB,cACd,OACA,UAAwB,QACV;CACd,IAAI,CAAC,OAAO,OAAO;CACnB,MAAM,QAAQ,cAAc,MAAM,KAAK,GAAG,OAAO;CACjD,OAAO,SAAS,MAAM,IAAI,IAAI,QAAQ;AACxC;;;;;AAMA,SAAgB,cAAc,OAAkC;CAC9D,MAAM,SAAmB,CAAC;CAC1B,IAAI,UAAkB,CAAC;CACvB,KAAK,MAAM,QAAQ,OACjB,IAAI,KAAK,SAAS,SAAS,KAAK,UAAU,KAAK;EAC7C,OAAO,KAAK,OAAO;EACnB,UAAU,CAAC;CACb,OAAO,IAAI,KAAK,SAAS,WAAW,KAAK,SAAS,WAChD,QAAQ,KAAK,IAAI;CAGrB,OAAO,KAAK,OAAO;CACnB,OAAO;AACT;;AAGA,SAAgB,eAAe,OAAyB;CACtD,OAAO,cAAc,YAAY,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,UAClD,MAAM,KAAK,SAAS,YAAY,UAAU,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,CAC3D;AACF;;AAGA,SAAgB,cAAc,OAAyB;CACrD,OAAO,YAAY,KAAK,CAAC,CACtB,MAAM,QAAQ,SAAS,KAAK,SAAS,WAAW,KAAK,SAAS,SAAS,CAAC,CACxE,KAAK,SAAS,YAAY,UAAU,IAAI,CAAC;AAC9C;;;;;AAMA,SAAgB,uBAAuB,WAAqD;CAC1F,IAAI,CAAC,WAAW,OAAO;CACvB,MAAM,EAAE,UAAU,QAAQ,SAAS,UAAU,UAAU,KAAK,CAAC;CAC7D,IAAI,YAAY,UAAU,KAAK,SAAS,GAAG,OAAO;CAClD,OAAO,OAAO,KAAK,MAAM,CAAC,CAAC;AAC7B;;AAGA,SAAgB,aAAa,OAAqC;CAChE,MAAM,OAAiB,CAAC;CACxB,IAAI,CAAC,OAAO,OAAO;CACnB,YAAY,KAAK,CAAC,CAAC,MAAM,SAAS;EAChC,IAAI,KAAK,SAAS,cAAc,KAAK,MAAM,YAAY,MAAM,OAAO,OAAO;EAC3E,MAAM,SAAS,KAAK,MAAM,GAAG,CAAC,CAAC,EAAE;EACjC,IAAI,QAAQ,KAAK,KAAK,MAAM;EAC5B,OAAO;CACT,CAAC;CACD,OAAO;AACT;;;;;AAMA,SAAgB,mBAAmB,OAAmC;CAQpE,OAPa,YACV,UACC,YAAY,KAAK,CAAC,CAAC,MAAM,QACtB,SAAS,KAAK,SAAS,cAAc,KAAK,MAAM,YAAY,MAAM,KACrE,CACF,CAAC,CACA,KACO,KAAK,KAAA;AACjB;;;;;AAMA,SAAgB,sBAAsB,OAAqC;CACzE,OAAO,QAAQ,aAAa,KAAK,CAAC,CAAC,IAAI,sBAAsB,CAAC;AAChE"}
|
package/dist/cubic.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import { Vector } from "./primitives/index.js";
|
|
2
|
-
|
|
1
|
+
import { Rect, Vector } from "./primitives/index.js";
|
|
2
|
+
import { VectorNetwork } from "./types.js";
|
|
3
3
|
/** The point at `t` along the cubic from `p0` to `p3` with control points `p1` and `p2`. */
|
|
4
|
-
declare function cubicPoint(p0: Vector, p1: Vector, p2: Vector, p3: Vector, t: number): Vector;
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export declare function cubicPoint(p0: Vector, p1: Vector, p2: Vector, p3: Vector, t: number): Vector;
|
|
5
|
+
/**
|
|
6
|
+
* Where a cubic's coordinate along one axis turns, as curve parameters strictly inside 0 to 1:
|
|
7
|
+
* the roots of its derivative, a·t² + b·t + c with a = -p0 + 3p1 - 3p2 + p3, b = 2(p0 - 2p1 + p2)
|
|
8
|
+
* and c = p1 - p0.
|
|
9
|
+
*/
|
|
10
|
+
export declare function cubicExtrema(p0: number, p1: number, p2: number, p3: number): number[];
|
|
11
|
+
/** The tight box around a vector network: its vertices and how far its curves reach between them. */
|
|
12
|
+
export declare function computeAccurateBounds(network: VectorNetwork): Rect;
|
|
7
13
|
//# sourceMappingURL=cubic.d.ts.map
|