@pairdraw/core 0.17.0 → 0.19.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/effects.d.ts +5 -11
- package/dist/canvas/effects.d.ts.map +1 -1
- package/dist/canvas/effects.js +25 -30
- package/dist/canvas/effects.js.map +1 -1
- package/dist/canvas/labels/hit-test.d.ts +5 -0
- package/dist/canvas/labels/hit-test.d.ts.map +1 -1
- package/dist/canvas/labels/hit-test.js +1 -1
- package/dist/canvas/labels/hit-test.js.map +1 -1
- package/dist/canvas/labels/paragraph-cache.d.ts.map +1 -1
- package/dist/canvas/labels/paragraph-cache.js +3 -2
- package/dist/canvas/labels/paragraph-cache.js.map +1 -1
- package/dist/canvas/labels/selection.js +3 -2
- package/dist/canvas/labels/selection.js.map +1 -1
- package/dist/canvas/labels/style.d.ts +1 -1
- package/dist/canvas/node-edit-overlay.js +2 -2
- package/dist/canvas/node-edit-overlay.js.map +1 -1
- package/dist/canvas/outline-stroke.d.ts.map +1 -1
- package/dist/canvas/outline-stroke.js.map +1 -1
- package/dist/canvas/overlays/index.d.ts +2 -2
- package/dist/canvas/overlays/index.js +2 -2
- package/dist/canvas/overlays/prototype.d.ts +2 -5
- package/dist/canvas/overlays/prototype.d.ts.map +1 -1
- package/dist/canvas/overlays/prototype.js +3 -19
- package/dist/canvas/overlays/prototype.js.map +1 -1
- package/dist/canvas/overlays/selection.d.ts +1 -2
- package/dist/canvas/overlays/selection.d.ts.map +1 -1
- package/dist/canvas/overlays/selection.js +4 -37
- package/dist/canvas/overlays/selection.js.map +1 -1
- package/dist/canvas/region-hatch.js +3 -2
- package/dist/canvas/region-hatch.js.map +1 -1
- package/dist/canvas/renderer/colors.d.ts.map +1 -1
- package/dist/canvas/renderer/colors.js +36 -18
- package/dist/canvas/renderer/colors.js.map +1 -1
- package/dist/canvas/renderer/font-waiters.d.ts +9 -0
- package/dist/canvas/renderer/font-waiters.d.ts.map +1 -0
- package/dist/canvas/renderer/font-waiters.js +26 -0
- package/dist/canvas/renderer/font-waiters.js.map +1 -0
- package/dist/canvas/renderer/fonts.d.ts +4 -2
- package/dist/canvas/renderer/fonts.d.ts.map +1 -1
- package/dist/canvas/renderer/fonts.js +25 -10
- package/dist/canvas/renderer/fonts.js.map +1 -1
- package/dist/canvas/renderer/lifecycle.d.ts.map +1 -1
- package/dist/canvas/renderer/lifecycle.js +6 -9
- package/dist/canvas/renderer/lifecycle.js.map +1 -1
- package/dist/canvas/renderer/methods.d.ts +4 -5
- package/dist/canvas/renderer/methods.d.ts.map +1 -1
- package/dist/canvas/renderer/methods.js +1 -4
- package/dist/canvas/renderer/methods.js.map +1 -1
- package/dist/canvas/renderer/paints.d.ts.map +1 -1
- package/dist/canvas/renderer/paints.js +0 -6
- package/dist/canvas/renderer/paints.js.map +1 -1
- package/dist/canvas/renderer/pipeline.d.ts.map +1 -1
- package/dist/canvas/renderer/pipeline.js +20 -2
- package/dist/canvas/renderer/pipeline.js.map +1 -1
- package/dist/canvas/renderer/retained-backing.js +4 -4
- package/dist/canvas/renderer/retained-backing.js.map +1 -1
- package/dist/canvas/renderer/state.js +1 -1
- package/dist/canvas/renderer/state.js.map +1 -1
- package/dist/canvas/renderer/tiles/controller.d.ts +2 -0
- package/dist/canvas/renderer/tiles/controller.d.ts.map +1 -1
- package/dist/canvas/renderer/tiles/controller.js +8 -0
- package/dist/canvas/renderer/tiles/controller.js.map +1 -1
- package/dist/canvas/renderer/tiles/surface-pool.js +1 -1
- package/dist/canvas/renderer/tiles/surface-pool.js.map +1 -1
- package/dist/canvas/renderer/visual-bounds.d.ts.map +1 -1
- package/dist/canvas/renderer/visual-bounds.js +7 -5
- package/dist/canvas/renderer/visual-bounds.js.map +1 -1
- package/dist/canvas/renderer.d.ts +26 -7
- package/dist/canvas/renderer.d.ts.map +1 -1
- package/dist/canvas/renderer.js +50 -11
- package/dist/canvas/renderer.js.map +1 -1
- package/dist/canvas/rulers.d.ts +8 -1
- package/dist/canvas/rulers.d.ts.map +1 -1
- package/dist/canvas/rulers.js +30 -5
- package/dist/canvas/rulers.js.map +1 -1
- package/dist/canvas/scene.d.ts +2 -1
- package/dist/canvas/scene.d.ts.map +1 -1
- package/dist/canvas/scene.js +90 -54
- package/dist/canvas/scene.js.map +1 -1
- package/dist/canvas/shadows/shape.js +1 -1
- package/dist/canvas/shadows/shape.js.map +1 -1
- package/dist/canvas/shadows/silhouette.d.ts.map +1 -1
- package/dist/canvas/shadows/silhouette.js +4 -2
- package/dist/canvas/shadows/silhouette.js.map +1 -1
- package/dist/canvas/shadows.d.ts.map +1 -1
- package/dist/canvas/shadows.js +3 -2
- package/dist/canvas/shadows.js.map +1 -1
- package/dist/canvas/text/derived.d.ts +1 -2
- package/dist/canvas/text/derived.d.ts.map +1 -1
- package/dist/canvas/text/derived.js +1 -7
- package/dist/canvas/text/derived.js.map +1 -1
- package/dist/canvas/text/emoji/index.js +1 -1
- package/dist/canvas/text/emoji/raster.d.ts.map +1 -1
- package/dist/canvas/text/emoji/raster.js +14 -10
- package/dist/canvas/text/emoji/raster.js.map +1 -1
- package/dist/canvas/text/font-families.d.ts +4 -3
- package/dist/canvas/text/font-families.d.ts.map +1 -1
- package/dist/canvas/text/font-families.js +13 -9
- package/dist/canvas/text/font-families.js.map +1 -1
- package/dist/canvas/text/index.d.ts +1 -3
- package/dist/canvas/text/index.d.ts.map +1 -1
- package/dist/canvas/text/index.js +2 -9
- package/dist/canvas/text/index.js.map +1 -1
- package/dist/canvas/text/layout/build.d.ts.map +1 -1
- package/dist/canvas/text/layout/build.js +25 -9
- package/dist/canvas/text/layout/build.js.map +1 -1
- package/dist/canvas/text/layout/index.d.ts.map +1 -1
- package/dist/canvas/text/layout/index.js +8 -4
- package/dist/canvas/text/layout/index.js.map +1 -1
- package/dist/canvas/text/layout/lines.js +5 -3
- package/dist/canvas/text/layout/lines.js.map +1 -1
- package/dist/canvas/text/paragraph/index.d.ts +5 -0
- package/dist/canvas/text/paragraph/index.d.ts.map +1 -1
- package/dist/canvas/text/paragraph/index.js +18 -9
- package/dist/canvas/text/paragraph/index.js.map +1 -1
- package/dist/canvas/text/paragraph/inputs.d.ts +1 -1
- package/dist/canvas/text/paragraph/inputs.d.ts.map +1 -1
- package/dist/canvas/text/paragraph/inputs.js +9 -2
- package/dist/canvas/text/paragraph/inputs.js.map +1 -1
- package/dist/canvas/text/placed.js +3 -3
- package/dist/canvas/text/placed.js.map +1 -1
- package/dist/canvas/text/renderer.d.ts +2 -0
- package/dist/canvas/text/renderer.d.ts.map +1 -1
- package/dist/canvas/text/shape.d.ts +4 -3
- package/dist/canvas/text/shape.d.ts.map +1 -1
- package/dist/canvas/text/shape.js +9 -22
- package/dist/canvas/text/shape.js.map +1 -1
- package/dist/constants.d.ts +6 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +6 -2
- package/dist/constants.js.map +1 -1
- package/dist/design-jsx/renderer.d.ts.map +1 -1
- package/dist/editor/bridges/clipboard.d.ts +1 -0
- package/dist/editor/bridges/clipboard.js +1 -0
- package/dist/editor/bridges/clipboard.js.map +1 -1
- package/dist/editor/bridges/components.d.ts +2 -0
- package/dist/editor/bridges/components.d.ts.map +1 -1
- package/dist/editor/bridges/components.js +2 -0
- package/dist/editor/bridges/components.js.map +1 -1
- package/dist/editor/bridges/frames.d.ts +4 -3
- package/dist/editor/bridges/frames.d.ts.map +1 -1
- package/dist/editor/bridges/frames.js +6 -4
- package/dist/editor/bridges/frames.js.map +1 -1
- package/dist/editor/bridges/structure.d.ts +1 -0
- package/dist/editor/bridges/structure.d.ts.map +1 -1
- package/dist/editor/bridges/structure.js +1 -0
- package/dist/editor/bridges/structure.js.map +1 -1
- package/dist/editor/bridges/undo.d.ts +1 -1
- package/dist/editor/clipboard/detach.js +2 -2
- package/dist/editor/clipboard/detach.js.map +1 -1
- package/dist/editor/clipboard/paste/properties.js +1 -1
- package/dist/editor/clipboard/paste/target.js +2 -2
- package/dist/editor/clipboard/paste/target.js.map +1 -1
- package/dist/editor/clipboard/snapshot.d.ts +3 -0
- package/dist/editor/clipboard/snapshot.d.ts.map +1 -1
- package/dist/editor/clipboard/snapshot.js +2 -0
- package/dist/editor/clipboard/snapshot.js.map +1 -1
- package/dist/editor/clipboard/variables.d.ts.map +1 -1
- package/dist/editor/clipboard/variables.js +14 -1
- package/dist/editor/clipboard/variables.js.map +1 -1
- package/dist/editor/clipboard.d.ts +1 -0
- package/dist/editor/clipboard.d.ts.map +1 -1
- package/dist/editor/clipboard.js +122 -16
- package/dist/editor/clipboard.js.map +1 -1
- package/dist/editor/component-sync.d.ts +10 -1
- package/dist/editor/component-sync.d.ts.map +1 -1
- package/dist/editor/component-sync.js +25 -8
- package/dist/editor/component-sync.js.map +1 -1
- package/dist/editor/components/authoring/text-edit.d.ts.map +1 -1
- package/dist/editor/components/authoring/text-edit.js +11 -2
- package/dist/editor/components/authoring/text-edit.js.map +1 -1
- package/dist/editor/components/authoring/visibility-edit.d.ts.map +1 -1
- package/dist/editor/components/authoring/visibility-edit.js +7 -3
- package/dist/editor/components/authoring/visibility-edit.js.map +1 -1
- package/dist/editor/components/instances.d.ts +2 -0
- package/dist/editor/components/instances.d.ts.map +1 -1
- package/dist/editor/components/instances.js +37 -7
- package/dist/editor/components/instances.js.map +1 -1
- package/dist/editor/components/properties.d.ts.map +1 -1
- package/dist/editor/components/properties.js +3 -0
- package/dist/editor/components/properties.js.map +1 -1
- package/dist/editor/components/slots/authoring.js +2 -1
- package/dist/editor/components/slots/authoring.js.map +1 -1
- package/dist/editor/components.d.ts +2 -0
- package/dist/editor/components.d.ts.map +1 -1
- package/dist/editor/create.d.ts +18 -4
- package/dist/editor/create.d.ts.map +1 -1
- package/dist/editor/create.js +43 -6
- package/dist/editor/create.js.map +1 -1
- package/dist/editor/guides.d.ts.map +1 -1
- package/dist/editor/guides.js +20 -13
- package/dist/editor/guides.js.map +1 -1
- package/dist/editor/history/document-change.d.ts +19 -3
- package/dist/editor/history/document-change.d.ts.map +1 -1
- package/dist/editor/history/document-change.js +94 -8
- package/dist/editor/history/document-change.js.map +1 -1
- package/dist/editor/history/edit.d.ts.map +1 -1
- package/dist/editor/history/edit.js +56 -12
- package/dist/editor/history/edit.js.map +1 -1
- package/dist/editor/history/position.js +1 -4
- package/dist/editor/history/position.js.map +1 -1
- package/dist/editor/history/sources.d.ts +14 -0
- package/dist/editor/history/sources.d.ts.map +1 -0
- package/dist/editor/history/sources.js +24 -0
- package/dist/editor/history/sources.js.map +1 -0
- package/dist/editor/index.d.ts +2 -2
- package/dist/editor/index.js +1 -1
- package/dist/editor/layout-mode.d.ts.map +1 -1
- package/dist/editor/layout-mode.js +16 -1
- package/dist/editor/layout-mode.js.map +1 -1
- package/dist/editor/node-preview.d.ts.map +1 -1
- package/dist/editor/node-preview.js +26 -7
- package/dist/editor/node-preview.js.map +1 -1
- package/dist/editor/nodes.d.ts.map +1 -1
- package/dist/editor/nodes.js +33 -10
- package/dist/editor/nodes.js.map +1 -1
- package/dist/editor/nudge.d.ts.map +1 -1
- package/dist/editor/nudge.js +12 -2
- package/dist/editor/nudge.js.map +1 -1
- package/dist/editor/pages.d.ts +2 -1
- package/dist/editor/pages.d.ts.map +1 -1
- package/dist/editor/pages.js +94 -15
- package/dist/editor/pages.js.map +1 -1
- package/dist/editor/play/states.d.ts.map +1 -1
- package/dist/editor/play/states.js +0 -5
- package/dist/editor/play/states.js.map +1 -1
- package/dist/editor/read-only/actions.js +3 -0
- package/dist/editor/read-only/actions.js.map +1 -1
- package/dist/editor/selection/hit-test.d.ts +2 -1
- package/dist/editor/selection/hit-test.d.ts.map +1 -1
- package/dist/editor/selection/hit-test.js +29 -4
- package/dist/editor/selection/hit-test.js.map +1 -1
- package/dist/editor/selection.d.ts +2 -2
- package/dist/editor/selection.d.ts.map +1 -1
- package/dist/editor/shapes/pen.js +6 -2
- package/dist/editor/shapes/pen.js.map +1 -1
- package/dist/editor/shapes.d.ts.map +1 -1
- package/dist/editor/shapes.js +2 -1
- package/dist/editor/shapes.js.map +1 -1
- package/dist/editor/structure/auto-layout-wrap.d.ts.map +1 -1
- package/dist/editor/structure/auto-layout-wrap.js +12 -0
- package/dist/editor/structure/auto-layout-wrap.js.map +1 -1
- package/dist/editor/structure/boolean.js +1 -1
- package/dist/editor/structure/group/bounds.d.ts +4 -2
- package/dist/editor/structure/group/bounds.d.ts.map +1 -1
- package/dist/editor/structure/group/bounds.js +17 -4
- package/dist/editor/structure/group/bounds.js.map +1 -1
- package/dist/editor/structure/rename.d.ts +2 -3
- package/dist/editor/structure/rename.d.ts.map +1 -1
- package/dist/editor/structure/rename.js +2 -5
- package/dist/editor/structure/rename.js.map +1 -1
- package/dist/editor/structure/reorder.d.ts.map +1 -1
- package/dist/editor/structure/reorder.js +20 -9
- package/dist/editor/structure/reorder.js.map +1 -1
- package/dist/editor/structure/state.js +1 -1
- package/dist/editor/structure.d.ts +1 -0
- package/dist/editor/structure.d.ts.map +1 -1
- package/dist/editor/structure.js +76 -20
- package/dist/editor/structure.js.map +1 -1
- package/dist/editor/text/hyperlink.d.ts.map +1 -1
- package/dist/editor/text/hyperlink.js +1 -1
- package/dist/editor/text/hyperlink.js.map +1 -1
- package/dist/editor/text/name.d.ts +13 -5
- package/dist/editor/text/name.d.ts.map +1 -1
- package/dist/editor/text/name.js +47 -17
- package/dist/editor/text/name.js.map +1 -1
- package/dist/editor/text/pending-layout.d.ts +2 -1
- package/dist/editor/text/pending-layout.d.ts.map +1 -1
- package/dist/editor/text/pending-layout.js +33 -6
- package/dist/editor/text/pending-layout.js.map +1 -1
- package/dist/editor/text/selection-style.d.ts +1 -0
- package/dist/editor/text/selection-style.d.ts.map +1 -1
- package/dist/editor/text/selection-style.js +16 -4
- package/dist/editor/text/selection-style.js.map +1 -1
- package/dist/editor/text.d.ts +5 -0
- package/dist/editor/text.d.ts.map +1 -1
- package/dist/editor/text.js +70 -3
- package/dist/editor/text.js.map +1 -1
- package/dist/editor/types.d.ts +18 -1
- package/dist/editor/types.d.ts.map +1 -1
- package/dist/editor/undo.d.ts.map +1 -1
- package/dist/editor/undo.js +14 -2
- package/dist/editor/undo.js.map +1 -1
- package/dist/editor/variable-bindings.d.ts.map +1 -1
- package/dist/editor/variable-bindings.js +21 -2
- package/dist/editor/variable-bindings.js.map +1 -1
- package/dist/editor/variables.d.ts +1 -1
- package/dist/editor/variables.d.ts.map +1 -1
- package/dist/editor/variables.js +7 -8
- package/dist/editor/variables.js.map +1 -1
- package/dist/editor/viewport.d.ts +11 -2
- package/dist/editor/viewport.d.ts.map +1 -1
- package/dist/editor/viewport.js +61 -21
- package/dist/editor/viewport.js.map +1 -1
- package/dist/editor/views/actions.d.ts.map +1 -1
- package/dist/editor/views/actions.js +13 -5
- package/dist/editor/views/actions.js.map +1 -1
- package/dist/editor/views/present.d.ts +6 -4
- package/dist/editor/views/present.d.ts.map +1 -1
- package/dist/editor/views/present.js +12 -10
- package/dist/editor/views/present.js.map +1 -1
- package/dist/editor/views/types.d.ts +11 -5
- package/dist/editor/views/types.d.ts.map +1 -1
- package/dist/figma-api/accessor-utils.d.ts.map +1 -1
- package/dist/figma-api/accessor-utils.js +4 -1
- package/dist/figma-api/accessor-utils.js.map +1 -1
- package/dist/figma-api/accessors/basic.d.ts.map +1 -1
- package/dist/figma-api/accessors/basic.js +41 -21
- package/dist/figma-api/accessors/basic.js.map +1 -1
- package/dist/figma-api/accessors/layout.d.ts.map +1 -1
- package/dist/figma-api/accessors/layout.js +37 -7
- package/dist/figma-api/accessors/layout.js.map +1 -1
- package/dist/figma-api/accessors/reactions.d.ts +11 -0
- package/dist/figma-api/accessors/reactions.d.ts.map +1 -0
- package/dist/figma-api/accessors/reactions.js +30 -0
- package/dist/figma-api/accessors/reactions.js.map +1 -0
- package/dist/figma-api/accessors/strokes.d.ts.map +1 -1
- package/dist/figma-api/accessors/strokes.js +12 -4
- package/dist/figma-api/accessors/strokes.js.map +1 -1
- package/dist/figma-api/accessors/text/index.d.ts.map +1 -1
- package/dist/figma-api/accessors/text/index.js +3 -1
- package/dist/figma-api/accessors/text/index.js.map +1 -1
- package/dist/figma-api/accessors/vector.d.ts.map +1 -1
- package/dist/figma-api/accessors/vector.js +1 -1
- package/dist/figma-api/accessors/vector.js.map +1 -1
- package/dist/figma-api/accessors/visual.d.ts +6 -5
- package/dist/figma-api/accessors/visual.d.ts.map +1 -1
- package/dist/figma-api/accessors/visual.js +20 -17
- package/dist/figma-api/accessors/visual.js.map +1 -1
- package/dist/figma-api/components.d.ts.map +1 -1
- package/dist/figma-api/components.js +2 -1
- package/dist/figma-api/components.js.map +1 -1
- package/dist/figma-api/finite.d.ts +27 -0
- package/dist/figma-api/finite.d.ts.map +1 -0
- package/dist/figma-api/finite.js +69 -0
- package/dist/figma-api/finite.js.map +1 -0
- package/dist/figma-api/fonts/list.d.ts +13 -0
- package/dist/figma-api/fonts/list.d.ts.map +1 -0
- package/dist/figma-api/fonts/list.js +25 -0
- package/dist/figma-api/fonts/list.js.map +1 -0
- package/dist/figma-api/index.d.ts +63 -10
- package/dist/figma-api/index.d.ts.map +1 -1
- package/dist/figma-api/index.js +104 -17
- package/dist/figma-api/index.js.map +1 -1
- package/dist/figma-api/overrides.d.ts +6 -1
- package/dist/figma-api/overrides.d.ts.map +1 -1
- package/dist/figma-api/overrides.js +2 -2
- package/dist/figma-api/overrides.js.map +1 -1
- package/dist/figma-api/pending-layout.d.ts +12 -2
- package/dist/figma-api/pending-layout.d.ts.map +1 -1
- package/dist/figma-api/pending-layout.js +41 -1
- package/dist/figma-api/pending-layout.js.map +1 -1
- package/dist/figma-api/pending-sync.d.ts +19 -0
- package/dist/figma-api/pending-sync.d.ts.map +1 -0
- package/dist/figma-api/pending-sync.js +52 -0
- package/dist/figma-api/pending-sync.js.map +1 -0
- package/dist/figma-api/proxy.d.ts +15 -2
- package/dist/figma-api/proxy.d.ts.map +1 -1
- package/dist/figma-api/proxy.js +23 -3
- package/dist/figma-api/proxy.js.map +1 -1
- package/dist/figma-api/reactions.d.ts +104 -0
- package/dist/figma-api/reactions.d.ts.map +1 -0
- package/dist/figma-api/reactions.js +157 -0
- package/dist/figma-api/reactions.js.map +1 -0
- package/dist/figma-api/render-bounds.d.ts.map +1 -1
- package/dist/figma-api/render-bounds.js +4 -4
- package/dist/figma-api/render-bounds.js.map +1 -1
- package/dist/figma-api/serialization.js +12 -2
- package/dist/figma-api/serialization.js.map +1 -1
- package/dist/figma-api/slots.d.ts +7 -1
- package/dist/figma-api/slots.d.ts.map +1 -1
- package/dist/figma-api/slots.js +12 -4
- package/dist/figma-api/slots.js.map +1 -1
- package/dist/figma-api/strokes.d.ts +5 -2
- package/dist/figma-api/strokes.d.ts.map +1 -1
- package/dist/figma-api/strokes.js +12 -19
- package/dist/figma-api/strokes.js.map +1 -1
- package/dist/figma-api/text/bindings.js +1 -1
- package/dist/figma-api/text/index.d.ts +2 -3
- package/dist/figma-api/text/index.d.ts.map +1 -1
- package/dist/figma-api/text/index.js +2 -12
- package/dist/figma-api/text/index.js.map +1 -1
- package/dist/figma-api/variables/bindings.js +1 -1
- package/dist/figma-api/variables/variable.d.ts.map +1 -1
- package/dist/figma-api/variables/variable.js +2 -2
- package/dist/figma-api/variables/variable.js.map +1 -1
- package/dist/geometry/connectors.js +2 -14
- package/dist/geometry/connectors.js.map +1 -1
- package/dist/geometry/figma.d.ts +6 -1
- package/dist/geometry/figma.d.ts.map +1 -1
- package/dist/geometry/figma.js +8 -1
- package/dist/geometry/figma.js.map +1 -1
- package/dist/geometry/index.d.ts +3 -3
- package/dist/geometry/index.js +2 -2
- package/dist/geometry/scene.d.ts +3 -1
- package/dist/geometry/scene.d.ts.map +1 -1
- package/dist/geometry/scene.js +16 -1
- package/dist/geometry/scene.js.map +1 -1
- package/dist/geometry/types.d.ts +7 -1
- package/dist/geometry/types.d.ts.map +1 -1
- package/dist/icons/api.d.ts +3 -2
- package/dist/icons/api.d.ts.map +1 -1
- package/dist/icons/api.js +12 -12
- package/dist/icons/api.js.map +1 -1
- package/dist/icons/provider.d.ts +4 -3
- package/dist/icons/provider.d.ts.map +1 -1
- package/dist/icons/provider.js +6 -13
- package/dist/icons/provider.js.map +1 -1
- package/dist/icons/schema.d.ts +33 -1
- package/dist/icons/schema.d.ts.map +1 -1
- package/dist/icons/schema.js +30 -1
- package/dist/icons/schema.js.map +1 -1
- package/dist/icons/svg/presentation.d.ts +8 -1
- package/dist/icons/svg/presentation.d.ts.map +1 -1
- package/dist/icons/svg/presentation.js +21 -3
- package/dist/icons/svg/presentation.js.map +1 -1
- package/dist/icons/svg/text.js +1 -1
- package/dist/icons/svg/text.js.map +1 -1
- package/dist/icons/svg.d.ts +8 -3
- package/dist/icons/svg.d.ts.map +1 -1
- package/dist/icons/svg.js +15 -13
- package/dist/icons/svg.js.map +1 -1
- package/dist/icons/types.d.ts +1 -19
- package/dist/icons/types.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/io/formats/design-tokens/css/read.js +1 -1
- package/dist/io/formats/design-tokens/decode.js +1 -1
- package/dist/io/formats/design-tokens/plan/index.js +4 -2
- package/dist/io/formats/design-tokens/plan/index.js.map +1 -1
- package/dist/io/formats/design-tokens/plan/styles.d.ts +9 -1
- package/dist/io/formats/design-tokens/plan/styles.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/plan/styles.js +23 -3
- package/dist/io/formats/design-tokens/plan/styles.js.map +1 -1
- package/dist/io/formats/design-tokens/styles.d.ts +9 -1
- package/dist/io/formats/design-tokens/styles.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/styles.js +41 -4
- package/dist/io/formats/design-tokens/styles.js.map +1 -1
- package/dist/io/formats/design-tokens/types.d.ts +5 -0
- package/dist/io/formats/design-tokens/types.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/types.js +1 -0
- package/dist/io/formats/design-tokens/types.js.map +1 -1
- package/dist/io/formats/drawio/export.d.ts.map +1 -1
- package/dist/io/formats/drawio/export.js +10 -0
- package/dist/io/formats/drawio/export.js.map +1 -1
- package/dist/io/formats/drawio/index.d.ts.map +1 -1
- package/dist/io/formats/drawio/index.js +32 -1
- package/dist/io/formats/drawio/index.js.map +1 -1
- package/dist/io/formats/drawio/shapes.d.ts +10 -5
- package/dist/io/formats/drawio/shapes.d.ts.map +1 -1
- package/dist/io/formats/drawio/shapes.js +10 -6
- package/dist/io/formats/drawio/shapes.js.map +1 -1
- package/dist/io/formats/drawio/warnings.d.ts +11 -0
- package/dist/io/formats/drawio/warnings.d.ts.map +1 -0
- package/dist/io/formats/drawio/warnings.js +23 -0
- package/dist/io/formats/drawio/warnings.js.map +1 -0
- package/dist/io/formats/fig/export/setup.d.ts.map +1 -1
- package/dist/io/formats/fig/export/setup.js +8 -4
- package/dist/io/formats/fig/export/setup.js.map +1 -1
- package/dist/io/formats/fig/export/variables.d.ts.map +1 -1
- package/dist/io/formats/fig/export/variables.js +2 -2
- package/dist/io/formats/fig/export/variables.js.map +1 -1
- package/dist/io/formats/fig/index.d.ts +2 -2
- package/dist/io/formats/fig/index.js +2 -2
- package/dist/io/formats/fig/read.d.ts +9 -2
- package/dist/io/formats/fig/read.d.ts.map +1 -1
- package/dist/io/formats/fig/read.js +44 -20
- package/dist/io/formats/fig/read.js.map +1 -1
- package/dist/io/formats/html/index.d.ts.map +1 -1
- package/dist/io/formats/html/index.js +2 -6
- package/dist/io/formats/html/index.js.map +1 -1
- package/dist/io/formats/pdf/dom.d.ts +10 -1
- package/dist/io/formats/pdf/dom.d.ts.map +1 -1
- package/dist/io/formats/pdf/dom.js +96 -2
- package/dist/io/formats/pdf/dom.js.map +1 -1
- package/dist/io/formats/pdf/export.js +3 -2
- package/dist/io/formats/pdf/export.js.map +1 -1
- package/dist/io/formats/pdf/prepare.js +1 -1
- package/dist/io/formats/pen/fonts.d.ts +14 -0
- package/dist/io/formats/pen/fonts.d.ts.map +1 -0
- package/dist/io/formats/pen/fonts.js +39 -0
- package/dist/io/formats/pen/fonts.js.map +1 -0
- package/dist/io/formats/pen/index.d.ts.map +1 -1
- package/dist/io/formats/pen/index.js +25 -6
- package/dist/io/formats/pen/index.js.map +1 -1
- package/dist/io/formats/raster/headless.d.ts +3 -3
- package/dist/io/formats/raster/headless.d.ts.map +1 -1
- package/dist/io/formats/raster/headless.js +25 -14
- package/dist/io/formats/raster/headless.js.map +1 -1
- package/dist/io/formats/raster/index.d.ts +2 -2
- package/dist/io/formats/raster/index.js +2 -2
- package/dist/io/formats/raster/render.d.ts +8 -2
- package/dist/io/formats/raster/render.d.ts.map +1 -1
- package/dist/io/formats/raster/render.js +42 -8
- package/dist/io/formats/raster/render.js.map +1 -1
- package/dist/io/formats/svg/export.d.ts.map +1 -1
- package/dist/io/formats/svg/export.js +28 -24
- package/dist/io/formats/svg/export.js.map +1 -1
- package/dist/io/formats/svg/paths.d.ts +8 -2
- package/dist/io/formats/svg/paths.d.ts.map +1 -1
- package/dist/io/formats/svg/paths.js +11 -3
- package/dist/io/formats/svg/paths.js.map +1 -1
- package/dist/io/formats/svg/strokes.d.ts.map +1 -1
- package/dist/io/formats/svg/strokes.js +2 -5
- package/dist/io/formats/svg/strokes.js.map +1 -1
- package/dist/io/formats/svg/text/export.d.ts.map +1 -1
- package/dist/io/formats/svg/text/export.js +19 -1
- package/dist/io/formats/svg/text/export.js.map +1 -1
- package/dist/io/formats/svg/text/import.d.ts.map +1 -1
- package/dist/io/formats/svg/text/import.js +2 -1
- package/dist/io/formats/svg/text/import.js.map +1 -1
- package/dist/io/formats.d.ts.map +1 -1
- package/dist/io/formats.js +3 -1
- package/dist/io/formats.js.map +1 -1
- package/dist/io/registry.d.ts +2 -0
- package/dist/io/registry.d.ts.map +1 -1
- package/dist/io/registry.js +5 -0
- package/dist/io/registry.js.map +1 -1
- package/dist/io/subgraph.d.ts.map +1 -1
- package/dist/io/subgraph.js +5 -2
- package/dist/io/subgraph.js.map +1 -1
- package/dist/io/types.d.ts +2 -0
- package/dist/io/types.d.ts.map +1 -1
- package/dist/kiwi/fig/population/client.d.ts.map +1 -1
- package/dist/kiwi/fig/population/client.js +63 -45
- package/dist/kiwi/fig/population/client.js.map +1 -1
- package/dist/kiwi/fig/population/delta.d.ts +34 -3
- package/dist/kiwi/fig/population/delta.d.ts.map +1 -1
- package/dist/kiwi/fig/population/delta.js +99 -16
- package/dist/kiwi/fig/population/delta.js.map +1 -1
- package/dist/kiwi/fig/population/edits.d.ts +51 -0
- package/dist/kiwi/fig/population/edits.d.ts.map +1 -0
- package/dist/kiwi/fig/population/edits.js +169 -0
- package/dist/kiwi/fig/population/edits.js.map +1 -0
- package/dist/kiwi/fig/session/archive/access.d.ts +3 -0
- package/dist/kiwi/fig/session/archive/access.d.ts.map +1 -1
- package/dist/kiwi/fig/session/archive/access.js +8 -1
- package/dist/kiwi/fig/session/archive/access.js.map +1 -1
- package/dist/kiwi/fig/session/archive/changes.d.ts +2 -1
- package/dist/kiwi/fig/session/archive/changes.d.ts.map +1 -1
- package/dist/kiwi/fig/session/archive/changes.js +12 -5
- package/dist/kiwi/fig/session/archive/changes.js.map +1 -1
- package/dist/kiwi/fig/session/document-state.d.ts +7 -1
- package/dist/kiwi/fig/session/document-state.d.ts.map +1 -1
- package/dist/kiwi/fig/session/document-state.js +16 -2
- package/dist/kiwi/fig/session/document-state.js.map +1 -1
- package/dist/kiwi/fig/session/protocol.d.ts +31 -3
- package/dist/kiwi/fig/session/protocol.d.ts.map +1 -1
- package/dist/kiwi/fig/session/worker.js +33 -8
- package/dist/kiwi/fig/session/worker.js.map +1 -1
- package/dist/layout/apply.d.ts +6 -1
- package/dist/layout/apply.d.ts.map +1 -1
- package/dist/layout/apply.js +39 -14
- package/dist/layout/apply.js.map +1 -1
- package/dist/layout/arrange/boxes.d.ts.map +1 -1
- package/dist/layout/arrange/boxes.js +31 -0
- package/dist/layout/arrange/boxes.js.map +1 -1
- package/dist/layout/flow-edges.d.ts +26 -0
- package/dist/layout/flow-edges.d.ts.map +1 -0
- package/dist/layout/flow-edges.js +105 -0
- package/dist/layout/flow-edges.js.map +1 -0
- package/dist/layout/grid.d.ts.map +1 -1
- package/dist/layout/grid.js +9 -5
- package/dist/layout/grid.js.map +1 -1
- package/dist/layout/text-auto-resize.d.ts.map +1 -1
- package/dist/layout/text-auto-resize.js +9 -4
- package/dist/layout/text-auto-resize.js.map +1 -1
- package/dist/layout/text-measurement.d.ts +15 -1
- package/dist/layout/text-measurement.d.ts.map +1 -1
- package/dist/layout/text-measurement.js +40 -4
- package/dist/layout/text-measurement.js.map +1 -1
- package/dist/layout/variables.d.ts +1 -1
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +35 -35
- package/dist/layout.js.map +1 -1
- package/dist/library/asset-keys.d.ts +3 -2
- package/dist/library/asset-keys.d.ts.map +1 -1
- package/dist/library/asset-keys.js +4 -3
- package/dist/library/asset-keys.js.map +1 -1
- package/dist/library/copied-references.d.ts +8 -3
- package/dist/library/copied-references.d.ts.map +1 -1
- package/dist/library/copied-references.js +15 -5
- package/dist/library/copied-references.js.map +1 -1
- package/dist/library/materialize.js +1 -1
- package/dist/library/materialize.js.map +1 -1
- package/dist/library/schema.js.map +1 -1
- package/dist/library/snapshot.d.ts.map +1 -1
- package/dist/library/snapshot.js +11 -2
- package/dist/library/snapshot.js.map +1 -1
- package/dist/lint/linter.d.ts.map +1 -1
- package/dist/lint/linter.js +11 -2
- package/dist/lint/linter.js.map +1 -1
- package/dist/pairdraw-api/variables.d.ts.map +1 -1
- package/dist/pairdraw-api/variables.js +0 -2
- package/dist/pairdraw-api/variables.js.map +1 -1
- package/dist/profiler/hud-controller.d.ts +4 -3
- package/dist/profiler/hud-controller.d.ts.map +1 -1
- package/dist/profiler/hud-controller.js +7 -5
- package/dist/profiler/hud-controller.js.map +1 -1
- package/dist/profiler/hud-renderer.d.ts +5 -2
- package/dist/profiler/hud-renderer.d.ts.map +1 -1
- package/dist/profiler/hud-renderer.js +8 -5
- package/dist/profiler/hud-renderer.js.map +1 -1
- package/dist/profiler/render-profiler.d.ts +3 -2
- package/dist/profiler/render-profiler.d.ts.map +1 -1
- package/dist/profiler/render-profiler.js +3 -2
- package/dist/profiler/render-profiler.js.map +1 -1
- package/dist/rpc/variables-command.d.ts.map +1 -1
- package/dist/rpc/variables-command.js +4 -2
- package/dist/rpc/variables-command.js.map +1 -1
- package/dist/text/character-style.d.ts +11 -1
- package/dist/text/character-style.d.ts.map +1 -1
- package/dist/text/character-style.js +27 -5
- package/dist/text/character-style.js.map +1 -1
- package/dist/text/coverage.d.ts.map +1 -1
- package/dist/text/coverage.js +16 -14
- package/dist/text/coverage.js.map +1 -1
- package/dist/text/editor.d.ts.map +1 -1
- package/dist/text/editor.js +3 -8
- package/dist/text/editor.js.map +1 -1
- package/dist/text/fallbacks.d.ts +26 -3
- package/dist/text/fallbacks.d.ts.map +1 -1
- package/dist/text/fallbacks.js +135 -18
- package/dist/text/fallbacks.js.map +1 -1
- package/dist/text/font/catalog.d.ts +4 -0
- package/dist/text/font/catalog.d.ts.map +1 -1
- package/dist/text/font/catalog.js +8 -0
- package/dist/text/font/catalog.js.map +1 -1
- package/dist/text/font/collection.d.ts +13 -0
- package/dist/text/font/collection.d.ts.map +1 -0
- package/dist/text/font/collection.js +51 -0
- package/dist/text/font/collection.js.map +1 -0
- package/dist/text/font/faces.d.ts +2 -1
- package/dist/text/font/faces.d.ts.map +1 -1
- package/dist/text/font/faces.js +9 -5
- package/dist/text/font/faces.js.map +1 -1
- package/dist/text/font/glyphs.d.ts +14 -3
- package/dist/text/font/glyphs.d.ts.map +1 -1
- package/dist/text/font/glyphs.js +22 -5
- package/dist/text/font/glyphs.js.map +1 -1
- package/dist/text/font/local.js +2 -2
- package/dist/text/font/local.js.map +1 -1
- package/dist/text/font/manager.d.ts +50 -6
- package/dist/text/font/manager.d.ts.map +1 -1
- package/dist/text/font/manager.js +178 -32
- package/dist/text/font/manager.js.map +1 -1
- package/dist/text/font/style.d.ts +7 -2
- package/dist/text/font/style.d.ts.map +1 -1
- package/dist/text/font/style.js +31 -3
- package/dist/text/font/style.js.map +1 -1
- package/dist/text/index.d.ts +5 -4
- package/dist/text/index.js +5 -4
- package/dist/text/outlines.d.ts.map +1 -1
- package/dist/text/outlines.js +71 -71
- package/dist/text/outlines.js.map +1 -1
- package/dist/text/path/caret.d.ts +2 -4
- package/dist/text/path/caret.d.ts.map +1 -1
- package/dist/text/path/caret.js.map +1 -1
- package/dist/text/prepare.d.ts +5 -1
- package/dist/text/prepare.d.ts.map +1 -1
- package/dist/text/prepare.js +26 -3
- package/dist/text/prepare.js.map +1 -1
- package/dist/text/style-runs.d.ts +14 -2
- package/dist/text/style-runs.d.ts.map +1 -1
- package/dist/text/style-runs.js +22 -14
- package/dist/text/style-runs.js.map +1 -1
- package/dist/text/web-font/assets.d.ts.map +1 -1
- package/dist/text/web-font/assets.js +13 -21
- package/dist/text/web-font/assets.js.map +1 -1
- package/dist/text/web-font/resolver.d.ts.map +1 -1
- package/dist/text/web-font/resolver.js +4 -1
- package/dist/text/web-font/resolver.js.map +1 -1
- package/dist/tools/analyze/overlaps/helpers.d.ts.map +1 -1
- package/dist/tools/analyze/overlaps/helpers.js +9 -1
- package/dist/tools/analyze/overlaps/helpers.js.map +1 -1
- package/dist/tools/analyze/overlaps/index.d.ts.map +1 -1
- package/dist/tools/analyze/overlaps/index.js +27 -5
- package/dist/tools/analyze/overlaps/index.js.map +1 -1
- package/dist/tools/codegen/component-map.js +3 -3
- package/dist/tools/codegen/component-map.js.map +1 -1
- package/dist/tools/create/basic.d.ts.map +1 -1
- package/dist/tools/create/basic.js +5 -4
- package/dist/tools/create/basic.js.map +1 -1
- package/dist/tools/create/components.d.ts +2 -1
- package/dist/tools/create/components.d.ts.map +1 -1
- package/dist/tools/create/components.js +27 -1
- package/dist/tools/create/components.js.map +1 -1
- package/dist/tools/create/html.d.ts.map +1 -1
- package/dist/tools/create/html.js +4 -2
- package/dist/tools/create/html.js.map +1 -1
- package/dist/tools/create/icons.d.ts.map +1 -1
- package/dist/tools/create/icons.js +14 -6
- package/dist/tools/create/icons.js.map +1 -1
- package/dist/tools/create/mermaid.d.ts.map +1 -1
- package/dist/tools/create/mermaid.js +2 -0
- package/dist/tools/create/mermaid.js.map +1 -1
- package/dist/tools/create/render.d.ts.map +1 -1
- package/dist/tools/create/render.js +2 -0
- package/dist/tools/create/render.js.map +1 -1
- package/dist/tools/create/script.js +3 -1
- package/dist/tools/create/script.js.map +1 -1
- package/dist/tools/create/svg.d.ts.map +1 -1
- package/dist/tools/create/svg.js +4 -1
- package/dist/tools/create/svg.js.map +1 -1
- package/dist/tools/create/vector.d.ts.map +1 -1
- package/dist/tools/create/vector.js +13 -10
- package/dist/tools/create/vector.js.map +1 -1
- package/dist/tools/create.d.ts +2 -2
- package/dist/tools/create.js +2 -2
- package/dist/tools/image-ai/apply.js +1 -1
- package/dist/tools/image-ai/generate.d.ts.map +1 -1
- package/dist/tools/image-ai/generate.js +3 -0
- package/dist/tools/image-ai/generate.js.map +1 -1
- package/dist/tools/modify/effects.d.ts.map +1 -1
- package/dist/tools/modify/effects.js +5 -3
- package/dist/tools/modify/effects.js.map +1 -1
- package/dist/tools/modify/matching.d.ts.map +1 -1
- package/dist/tools/modify/matching.js +9 -6
- package/dist/tools/modify/matching.js.map +1 -1
- package/dist/tools/modify/paint.d.ts.map +1 -1
- package/dist/tools/modify/paint.js +7 -5
- package/dist/tools/modify/paint.js.map +1 -1
- package/dist/tools/modify/reactions.d.ts +6 -0
- package/dist/tools/modify/reactions.d.ts.map +1 -0
- package/dist/tools/modify/reactions.js +35 -0
- package/dist/tools/modify/reactions.js.map +1 -0
- package/dist/tools/modify/text.d.ts.map +1 -1
- package/dist/tools/modify/text.js +28 -8
- package/dist/tools/modify/text.js.map +1 -1
- package/dist/tools/modify.d.ts +2 -1
- package/dist/tools/modify.js +2 -1
- package/dist/tools/read/components.js +20 -22
- package/dist/tools/read/components.js.map +1 -1
- package/dist/tools/read/fonts.js +1 -1
- package/dist/tools/read/fonts.js.map +1 -1
- package/dist/tools/read/libraries.d.ts.map +1 -1
- package/dist/tools/read/libraries.js +18 -4
- package/dist/tools/read/libraries.js.map +1 -1
- package/dist/tools/read/nodes.d.ts.map +1 -1
- package/dist/tools/read/nodes.js +38 -16
- package/dist/tools/read/nodes.js.map +1 -1
- package/dist/tools/read/pages.d.ts.map +1 -1
- package/dist/tools/read/pages.js +4 -3
- package/dist/tools/read/pages.js.map +1 -1
- package/dist/tools/read/query.js +1 -0
- package/dist/tools/read/query.js.map +1 -1
- package/dist/tools/read/reactions.d.ts +6 -0
- package/dist/tools/read/reactions.d.ts.map +1 -0
- package/dist/tools/read/reactions.js +24 -0
- package/dist/tools/read/reactions.js.map +1 -0
- package/dist/tools/read/space.js +1 -1
- package/dist/tools/read.d.ts +2 -1
- package/dist/tools/read.js +2 -1
- package/dist/tools/registry/extended.d.ts.map +1 -1
- package/dist/tools/registry/extended.js +6 -1
- package/dist/tools/registry/extended.js.map +1 -1
- package/dist/tools/schema.d.ts +30 -5
- package/dist/tools/schema.d.ts.map +1 -1
- package/dist/tools/schema.js +125 -7
- package/dist/tools/schema.js.map +1 -1
- package/dist/tools/stock-photo/apply.js +8 -9
- package/dist/tools/stock-photo/apply.js.map +1 -1
- package/dist/tools/structure/batch.d.ts.map +1 -1
- package/dist/tools/structure/batch.js +86 -90
- package/dist/tools/structure/batch.js.map +1 -1
- package/dist/tools/variables/values.d.ts.map +1 -1
- package/dist/tools/variables/values.js +4 -2
- package/dist/tools/variables/values.js.map +1 -1
- package/dist/tools/vector/export.d.ts.map +1 -1
- package/dist/tools/vector/export.js +5 -2
- package/dist/tools/vector/export.js.map +1 -1
- package/dist/vector/fill-geometry.d.ts +4 -1
- package/dist/vector/fill-geometry.d.ts.map +1 -1
- package/dist/vector/fill-geometry.js +8 -5
- package/dist/vector/fill-geometry.js.map +1 -1
- package/dist/vector/index.js +1 -1
- package/dist/vector/index.js.map +1 -1
- package/dist/vector/path-helpers.d.ts +1 -1
- package/dist/vector/path-helpers.d.ts.map +1 -1
- package/dist/vector/path-helpers.js +24 -7
- package/dist/vector/path-helpers.js.map +1 -1
- package/dist/vector/placement.js +1 -1
- package/dist/vector/placement.js.map +1 -1
- package/dist/vector/vectorize/preprocess.js +1 -1
- package/dist/vector/vectorize/preprocess.js.map +1 -1
- package/package.json +10 -10
- package/src/canvas/effects.ts +29 -33
- package/src/canvas/labels/hit-test.ts +6 -2
- package/src/canvas/labels/paragraph-cache.ts +2 -1
- package/src/canvas/labels/selection.ts +3 -3
- package/src/canvas/node-edit-overlay.ts +3 -2
- package/src/canvas/outline-stroke.ts +2 -6
- package/src/canvas/overlays/index.ts +0 -1
- package/src/canvas/overlays/prototype.ts +5 -27
- package/src/canvas/overlays/selection.ts +4 -52
- package/src/canvas/region-hatch.ts +7 -2
- package/src/canvas/renderer/colors.ts +41 -26
- package/src/canvas/renderer/font-waiters.ts +25 -0
- package/src/canvas/renderer/fonts.ts +42 -18
- package/src/canvas/renderer/lifecycle.ts +8 -10
- package/src/canvas/renderer/methods.ts +9 -13
- package/src/canvas/renderer/paints.ts +0 -10
- package/src/canvas/renderer/pipeline.ts +29 -3
- package/src/canvas/renderer/retained-backing.ts +4 -4
- package/src/canvas/renderer/state.ts +1 -1
- package/src/canvas/renderer/tiles/controller.ts +8 -0
- package/src/canvas/renderer/tiles/surface-pool.ts +1 -1
- package/src/canvas/renderer/visual-bounds.ts +7 -6
- package/src/canvas/renderer.ts +43 -11
- package/src/canvas/rulers.ts +55 -26
- package/src/canvas/scene.ts +127 -77
- package/src/canvas/shadows/shape.ts +1 -1
- package/src/canvas/shadows/silhouette.ts +4 -2
- package/src/canvas/shadows.ts +4 -2
- package/src/canvas/text/derived.ts +0 -9
- package/src/canvas/text/emoji/raster.ts +14 -10
- package/src/canvas/text/font-families.ts +14 -7
- package/src/canvas/text/index.ts +3 -9
- package/src/canvas/text/layout/build.ts +35 -18
- package/src/canvas/text/layout/index.ts +15 -6
- package/src/canvas/text/layout/lines.ts +10 -4
- package/src/canvas/text/paragraph/index.ts +19 -10
- package/src/canvas/text/paragraph/inputs.ts +4 -2
- package/src/canvas/text/placed.ts +2 -2
- package/src/canvas/text/renderer.ts +2 -0
- package/src/canvas/text/shape.ts +20 -31
- package/src/constants.ts +6 -1
- package/src/editor/bridges/clipboard.ts +1 -0
- package/src/editor/bridges/components.ts +2 -0
- package/src/editor/bridges/frames.ts +6 -4
- package/src/editor/bridges/structure.ts +1 -0
- package/src/editor/clipboard/detach.ts +3 -3
- package/src/editor/clipboard/paste/target.ts +2 -2
- package/src/editor/clipboard/snapshot.ts +7 -0
- package/src/editor/clipboard/variables.ts +20 -0
- package/src/editor/clipboard.ts +133 -14
- package/src/editor/component-sync.ts +28 -7
- package/src/editor/components/authoring/text-edit.ts +15 -2
- package/src/editor/components/authoring/visibility-edit.ts +11 -3
- package/src/editor/components/instances.ts +61 -11
- package/src/editor/components/properties.ts +10 -0
- package/src/editor/components/slots/authoring.ts +4 -1
- package/src/editor/create.ts +58 -8
- package/src/editor/guides.ts +27 -12
- package/src/editor/history/document-change.ts +115 -7
- package/src/editor/history/edit.ts +62 -14
- package/src/editor/history/position.ts +1 -4
- package/src/editor/history/sources.ts +25 -0
- package/src/editor/index.ts +3 -1
- package/src/editor/layout-mode.ts +20 -1
- package/src/editor/node-preview.ts +44 -8
- package/src/editor/nodes.ts +52 -12
- package/src/editor/nudge.ts +16 -2
- package/src/editor/pages.ts +100 -17
- package/src/editor/play/states.ts +0 -7
- package/src/editor/read-only/actions.ts +4 -0
- package/src/editor/selection/hit-test.ts +37 -4
- package/src/editor/shapes/pen.ts +6 -3
- package/src/editor/shapes.ts +2 -1
- package/src/editor/structure/auto-layout-wrap.ts +26 -0
- package/src/editor/structure/group/bounds.ts +22 -4
- package/src/editor/structure/rename.ts +2 -6
- package/src/editor/structure/reorder.ts +26 -8
- package/src/editor/structure.ts +88 -24
- package/src/editor/text/hyperlink.ts +2 -1
- package/src/editor/text/name.ts +51 -15
- package/src/editor/text/pending-layout.ts +42 -4
- package/src/editor/text/selection-style.ts +17 -3
- package/src/editor/text.ts +86 -4
- package/src/editor/types.ts +19 -0
- package/src/editor/undo.ts +21 -2
- package/src/editor/variable-bindings.ts +22 -2
- package/src/editor/variables.ts +10 -6
- package/src/editor/viewport.ts +55 -21
- package/src/editor/views/actions.ts +17 -7
- package/src/editor/views/present.ts +20 -11
- package/src/editor/views/types.ts +11 -5
- package/src/figma-api/accessor-utils.ts +4 -1
- package/src/figma-api/accessors/basic.ts +54 -18
- package/src/figma-api/accessors/layout.ts +46 -7
- package/src/figma-api/accessors/reactions.ts +29 -0
- package/src/figma-api/accessors/strokes.ts +28 -8
- package/src/figma-api/accessors/text/index.ts +4 -0
- package/src/figma-api/accessors/vector.ts +3 -1
- package/src/figma-api/accessors/visual.ts +25 -28
- package/src/figma-api/components.ts +9 -7
- package/src/figma-api/finite.ts +102 -0
- package/src/figma-api/fonts/list.ts +24 -0
- package/src/figma-api/index.ts +170 -19
- package/src/figma-api/overrides.ts +1 -1
- package/src/figma-api/pending-layout.ts +50 -1
- package/src/figma-api/pending-sync.ts +61 -0
- package/src/figma-api/proxy.ts +35 -2
- package/src/figma-api/reactions.ts +212 -0
- package/src/figma-api/render-bounds.ts +13 -4
- package/src/figma-api/serialization.ts +16 -2
- package/src/figma-api/slots.ts +12 -3
- package/src/figma-api/strokes.ts +16 -12
- package/src/figma-api/text/index.ts +9 -15
- package/src/figma-api/variables/variable.ts +3 -2
- package/src/geometry/connectors.ts +2 -12
- package/src/geometry/figma.ts +9 -0
- package/src/geometry/index.ts +2 -1
- package/src/geometry/scene.ts +19 -0
- package/src/geometry/types.ts +8 -0
- package/src/global.d.ts +6 -0
- package/src/icons/api.ts +27 -16
- package/src/icons/provider.ts +9 -20
- package/src/icons/schema.ts +31 -0
- package/src/icons/svg/presentation.ts +27 -3
- package/src/icons/svg/text.ts +1 -1
- package/src/icons/svg.ts +21 -19
- package/src/icons/types.ts +0 -14
- package/src/io/formats/design-tokens/plan/index.ts +7 -1
- package/src/io/formats/design-tokens/plan/styles.ts +40 -4
- package/src/io/formats/design-tokens/styles.ts +60 -3
- package/src/io/formats/design-tokens/types.ts +3 -0
- package/src/io/formats/drawio/export.ts +11 -0
- package/src/io/formats/drawio/index.ts +36 -1
- package/src/io/formats/drawio/shapes.ts +13 -9
- package/src/io/formats/drawio/warnings.ts +27 -0
- package/src/io/formats/fig/export/setup.ts +16 -14
- package/src/io/formats/fig/export/variables.ts +7 -8
- package/src/io/formats/fig/index.ts +1 -0
- package/src/io/formats/fig/read.ts +66 -23
- package/src/io/formats/html/index.ts +2 -6
- package/src/io/formats/pdf/dom.ts +125 -3
- package/src/io/formats/pdf/export.ts +3 -2
- package/src/io/formats/pen/fonts.ts +45 -0
- package/src/io/formats/pen/index.ts +30 -6
- package/src/io/formats/raster/headless.ts +40 -14
- package/src/io/formats/raster/index.ts +3 -0
- package/src/io/formats/raster/render.ts +66 -8
- package/src/io/formats/svg/export.ts +24 -25
- package/src/io/formats/svg/paths.ts +11 -2
- package/src/io/formats/svg/strokes.ts +8 -2
- package/src/io/formats/svg/text/export.ts +23 -0
- package/src/io/formats/svg/text/import.ts +2 -1
- package/src/io/formats.ts +3 -1
- package/src/io/registry.ts +12 -0
- package/src/io/subgraph.ts +3 -1
- package/src/io/types.ts +2 -0
- package/src/kiwi/fig/population/client.ts +77 -43
- package/src/kiwi/fig/population/delta.ts +141 -18
- package/src/kiwi/fig/population/edits.ts +235 -0
- package/src/kiwi/fig/session/archive/access.ts +15 -0
- package/src/kiwi/fig/session/archive/changes.ts +27 -6
- package/src/kiwi/fig/session/document-state.ts +23 -1
- package/src/kiwi/fig/session/protocol.ts +26 -1
- package/src/kiwi/fig/session/worker.ts +38 -11
- package/src/layout/apply.ts +52 -10
- package/src/layout/arrange/boxes.ts +36 -0
- package/src/layout/flow-edges.ts +139 -0
- package/src/layout/grid.ts +14 -4
- package/src/layout/text-auto-resize.ts +13 -4
- package/src/layout/text-measurement.ts +46 -3
- package/src/layout.ts +60 -66
- package/src/library/asset-keys.ts +4 -3
- package/src/library/copied-references.ts +29 -5
- package/src/library/materialize.ts +1 -1
- package/src/library/schema.ts +1 -1
- package/src/library/snapshot.ts +12 -2
- package/src/lint/linter.ts +12 -2
- package/src/pairdraw-api/variables.ts +1 -3
- package/src/profiler/hud-controller.ts +8 -6
- package/src/profiler/hud-renderer.ts +9 -6
- package/src/profiler/render-profiler.ts +4 -3
- package/src/rpc/variables-command.ts +6 -5
- package/src/text/character-style.ts +29 -9
- package/src/text/coverage.ts +29 -15
- package/src/text/editor.ts +3 -8
- package/src/text/fallbacks.ts +163 -22
- package/src/text/font/catalog.ts +10 -0
- package/src/text/font/collection.ts +60 -0
- package/src/text/font/faces.ts +9 -5
- package/src/text/font/glyphs.ts +29 -4
- package/src/text/font/local.ts +2 -2
- package/src/text/font/manager.ts +220 -49
- package/src/text/font/style.ts +52 -3
- package/src/text/index.ts +1 -0
- package/src/text/outlines.ts +106 -90
- package/src/text/path/caret.ts +3 -4
- package/src/text/prepare.ts +51 -2
- package/src/text/style-runs.ts +43 -16
- package/src/text/web-font/assets.ts +11 -15
- package/src/text/web-font/resolver.ts +7 -1
- package/src/tools/analyze/overlaps/helpers.ts +18 -1
- package/src/tools/analyze/overlaps/index.ts +37 -6
- package/src/tools/codegen/component-map.ts +3 -3
- package/src/tools/create/basic.ts +6 -4
- package/src/tools/create/components.ts +33 -0
- package/src/tools/create/html.ts +3 -1
- package/src/tools/create/icons.ts +16 -6
- package/src/tools/create/mermaid.ts +2 -0
- package/src/tools/create/render.ts +2 -0
- package/src/tools/create/script.ts +5 -1
- package/src/tools/create/svg.ts +4 -1
- package/src/tools/create/vector.ts +20 -10
- package/src/tools/create.ts +1 -0
- package/src/tools/image-ai/generate.ts +3 -0
- package/src/tools/modify/effects.ts +11 -4
- package/src/tools/modify/matching.ts +10 -6
- package/src/tools/modify/paint.ts +13 -5
- package/src/tools/modify/reactions.ts +40 -0
- package/src/tools/modify/text.ts +53 -20
- package/src/tools/modify.ts +1 -0
- package/src/tools/read/components.ts +28 -25
- package/src/tools/read/fonts.ts +1 -1
- package/src/tools/read/libraries.ts +24 -4
- package/src/tools/read/nodes.ts +47 -17
- package/src/tools/read/pages.ts +7 -3
- package/src/tools/read/query.ts +2 -0
- package/src/tools/read/reactions.ts +21 -0
- package/src/tools/read.ts +1 -0
- package/src/tools/registry/extended.ts +6 -0
- package/src/tools/schema.ts +166 -6
- package/src/tools/stock-photo/apply.ts +17 -5
- package/src/tools/structure/batch.ts +84 -98
- package/src/tools/variables/values.ts +6 -3
- package/src/tools/vector/export.ts +5 -1
- package/src/vector/fill-geometry.ts +11 -5
- package/src/vector/index.ts +1 -1
- package/src/vector/path-helpers.ts +34 -8
- package/src/vector/placement.ts +1 -1
- package/src/vector/vectorize/preprocess.ts +1 -1
|
@@ -4,6 +4,7 @@ import type { Fill, NodeType, SceneGraph, SceneNode, Stroke } from '@pairdraw/sc
|
|
|
4
4
|
import { strokeOverflow as strokeReach } from '@pairdraw/scene-graph/geometry'
|
|
5
5
|
import Matrix from '@pairdraw/scene-graph/matrix'
|
|
6
6
|
import type { Rect } from '@pairdraw/scene-graph/primitives'
|
|
7
|
+
import { textLinesReach } from '@pairdraw/scene-graph/text'
|
|
7
8
|
|
|
8
9
|
import { paintBooleanOperation } from '#core/canvas/boolean'
|
|
9
10
|
import { renderMaskedChildIds } from '#core/canvas/masks'
|
|
@@ -274,11 +275,12 @@ export function silhouetteBounds(
|
|
|
274
275
|
includeChildren: boolean
|
|
275
276
|
): Rect | null {
|
|
276
277
|
const overflow = strokeOverflow(node)
|
|
278
|
+
const lines = textLinesReach(node)
|
|
277
279
|
const own: Rect = {
|
|
278
280
|
x: -overflow,
|
|
279
|
-
y: -overflow,
|
|
281
|
+
y: lines.minY - overflow,
|
|
280
282
|
width: node.width + overflow * 2,
|
|
281
|
-
height:
|
|
283
|
+
height: lines.maxY - lines.minY + overflow * 2
|
|
282
284
|
}
|
|
283
285
|
if (!includeChildren || !isLayerContainer(node)) return own
|
|
284
286
|
return unionRect(own, childrenBounds(graph, node))
|
package/src/canvas/shadows.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { Canvas, ImageFilter } from 'canvaskit-wasm'
|
|
2
2
|
|
|
3
3
|
import type { BlendMode, ShadowEffect, SceneGraph, SceneNode } from '@pairdraw/scene-graph'
|
|
4
|
+
import { blurSigma } from '@pairdraw/scene-graph/geometry'
|
|
4
5
|
import Matrix from '@pairdraw/scene-graph/matrix'
|
|
5
6
|
|
|
6
7
|
import { nodeOrientationMatrix } from '#core/geometry'
|
|
7
8
|
|
|
8
9
|
import { needsIsolatedBlendLayer, setPaintBlendMode } from './blend'
|
|
9
10
|
import { makeBooleanOperationPath } from './boolean'
|
|
10
|
-
import {
|
|
11
|
+
import { renderNoiseEffects } from './effects'
|
|
11
12
|
import type { SkiaRenderer } from './renderer'
|
|
12
13
|
import {
|
|
13
14
|
castsFromOwnShape,
|
|
@@ -128,7 +129,8 @@ function drawSilhouetteDropShadow(
|
|
|
128
129
|
canvas.restore()
|
|
129
130
|
paint.delete()
|
|
130
131
|
if (morphology) {
|
|
131
|
-
filter.
|
|
132
|
+
// The filter built with the morphology is ours; a zero sigma hands back none.
|
|
133
|
+
filter?.delete()
|
|
132
134
|
morphology.delete()
|
|
133
135
|
}
|
|
134
136
|
}
|
|
@@ -47,12 +47,6 @@ export function snapDerivedGlyphBaseline(y: number): number {
|
|
|
47
47
|
return Math.round(y)
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
export function shouldUseHardDerivedGlyphCoverage(
|
|
51
|
-
node: Pick<SceneNode, 'fontSize' | 'fontWeight'>
|
|
52
|
-
): boolean {
|
|
53
|
-
return node.fontSize === 20 && node.fontWeight === 400
|
|
54
|
-
}
|
|
55
|
-
|
|
56
50
|
/**
|
|
57
51
|
* Path-text glyphs carry non-zero Figma `Glyph.rotation` (radians). Used to
|
|
58
52
|
* disable axis-aligned assumptions (baseline snap, underline decorations).
|
|
@@ -349,15 +343,12 @@ export function drawDerivedText(
|
|
|
349
343
|
const path = paintsLayerSpace ? layerSpaceGlyphPath(r, emPath, glyph, glyphY) : emPath
|
|
350
344
|
canvas.save()
|
|
351
345
|
if (!paintsLayerSpace) applyGlyphEmTransform(canvas, glyph, glyphY)
|
|
352
|
-
const shouldUseHardCoverage = shouldUseHardDerivedGlyphCoverage(node)
|
|
353
|
-
if (shouldUseHardCoverage) r.fillPaint.setAntiAlias(false)
|
|
354
346
|
const character = glyph.firstCharacter ?? markerCharacters.get(index)
|
|
355
347
|
const run =
|
|
356
348
|
character === undefined
|
|
357
349
|
? undefined
|
|
358
350
|
: node.styleRuns.find((run) => character >= run.start && character < run.start + run.length)
|
|
359
351
|
drawGlyphOutline(r, canvas, path, savedTextEligible ? run?.style.fills : undefined)
|
|
360
|
-
if (shouldUseHardCoverage) r.fillPaint.setAntiAlias(true)
|
|
361
352
|
if (path !== emPath) path.delete()
|
|
362
353
|
canvas.restore()
|
|
363
354
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CanvasKit, Image, TypefaceFontProvider } from 'canvaskit-wasm'
|
|
2
2
|
|
|
3
3
|
import { NOTO_COLOR_EMOJI_FAMILY } from '#core/text/emoji'
|
|
4
|
+
import { makeParagraphBuilder } from '#core/text/font/collection'
|
|
4
5
|
|
|
5
6
|
/** Emoji are drawn from square images this many pixels wide, as Figma draws its own. */
|
|
6
7
|
export const EMOJI_IMAGE_SIZE = 160
|
|
@@ -48,8 +49,6 @@ export function rasterizeNotoEmoji(
|
|
|
48
49
|
provider: TypefaceFontProvider,
|
|
49
50
|
text: string
|
|
50
51
|
): Image | null {
|
|
51
|
-
const surface = ck.MakeSurface(EMOJI_IMAGE_SIZE, EMOJI_IMAGE_SIZE)
|
|
52
|
-
if (!surface) return null
|
|
53
52
|
const style = new ck.ParagraphStyle({
|
|
54
53
|
textStyle: {
|
|
55
54
|
fontFamilies: [NOTO_COLOR_EMOJI_FAMILY],
|
|
@@ -57,7 +56,7 @@ export function rasterizeNotoEmoji(
|
|
|
57
56
|
color: ck.BLACK
|
|
58
57
|
}
|
|
59
58
|
})
|
|
60
|
-
const builder = ck
|
|
59
|
+
const builder = makeParagraphBuilder(ck, style, provider)
|
|
61
60
|
try {
|
|
62
61
|
builder.addText(text)
|
|
63
62
|
const paragraph = builder.build()
|
|
@@ -66,17 +65,22 @@ export function rasterizeNotoEmoji(
|
|
|
66
65
|
const advance = paragraph.getMaxIntrinsicWidth()
|
|
67
66
|
if (advance <= 0) return null
|
|
68
67
|
const scale = EMOJI_IMAGE_SIZE / advance
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
const surface = ck.MakeSurface(EMOJI_IMAGE_SIZE, EMOJI_IMAGE_SIZE)
|
|
69
|
+
if (!surface) return null
|
|
70
|
+
try {
|
|
71
|
+
const canvas = surface.getCanvas()
|
|
72
|
+
canvas.clear(ck.TRANSPARENT)
|
|
73
|
+
canvas.translate(0, (EMOJI_IMAGE_SIZE - paragraph.getHeight() * scale) / 2)
|
|
74
|
+
canvas.scale(scale, scale)
|
|
75
|
+
canvas.drawParagraph(paragraph, 0, 0)
|
|
76
|
+
return surface.makeImageSnapshot()
|
|
77
|
+
} finally {
|
|
78
|
+
surface.dispose()
|
|
79
|
+
}
|
|
75
80
|
} finally {
|
|
76
81
|
paragraph.delete()
|
|
77
82
|
}
|
|
78
83
|
} finally {
|
|
79
84
|
builder.delete()
|
|
80
|
-
surface.delete()
|
|
81
85
|
}
|
|
82
86
|
}
|
|
@@ -45,6 +45,11 @@ export function drawnFontVariations(font: DrawnFontAxes): FontVariation[] {
|
|
|
45
45
|
]
|
|
46
46
|
: font.variations
|
|
47
47
|
const axes = new Map([...named, ...set].map(({ axis, value }) => [axis, value]))
|
|
48
|
+
// A family with no face loaded is drawn in its fallbacks, and a variable fallback takes the
|
|
49
|
+
// text's weight on its axis unless the text sets one, rather than emboldening its default one.
|
|
50
|
+
if (!axes.has('wght') && !loadedFace(font.family, font.weight, font.italic, font.style)) {
|
|
51
|
+
axes.set('wght', font.weight)
|
|
52
|
+
}
|
|
48
53
|
return [...axes].map(([axis, value]) => ({ axis, value }))
|
|
49
54
|
}
|
|
50
55
|
|
|
@@ -83,6 +88,7 @@ export function loadedFace(
|
|
|
83
88
|
italic: boolean,
|
|
84
89
|
style = faceLoadKey(weight, italic)
|
|
85
90
|
): LoadedFace | null {
|
|
91
|
+
if (!fontManager.isLoaded(family)) return null
|
|
86
92
|
if (fontManager.isStyleLoaded(family, style)) return { weight, italic, style }
|
|
87
93
|
for (const slant of [italic, !italic]) {
|
|
88
94
|
for (const candidate of fontWeightMatchOrder(weight)) {
|
|
@@ -96,19 +102,20 @@ export function loadedFace(
|
|
|
96
102
|
|
|
97
103
|
/**
|
|
98
104
|
* The families a paragraph's text falls back through, by their own names: its family, the
|
|
99
|
-
* default family, the
|
|
105
|
+
* default family, the fallbacks of scripts written in letters (Arabic, Hebrew, Thai,
|
|
106
|
+
* Devanagari) and CJK, then emoji, so a character a script's font has
|
|
100
107
|
* stays in that font. Fonts are read by these names; CanvasKit is asked for them as
|
|
101
108
|
* {@link resolveParagraphFontFamilies} names them.
|
|
102
109
|
*/
|
|
103
110
|
export function paragraphSourceFamilies(
|
|
104
111
|
primary: string,
|
|
105
|
-
|
|
112
|
+
letterFallbacks: readonly string[] = fontManager.getLetterFallbackFamilies(),
|
|
106
113
|
cjkFallbacks: readonly string[] = fontManager.getCJKFallbackFamilies()
|
|
107
114
|
): string[] {
|
|
108
115
|
return uniq([
|
|
109
116
|
primary,
|
|
110
117
|
...(primary === DEFAULT_FONT_FAMILY ? [] : [DEFAULT_FONT_FAMILY]),
|
|
111
|
-
...
|
|
118
|
+
...letterFallbacks,
|
|
112
119
|
...cjkFallbacks,
|
|
113
120
|
EMOJI_METRICS_FAMILY
|
|
114
121
|
])
|
|
@@ -129,13 +136,13 @@ function renderFamilies(family: string, style: string): string[] {
|
|
|
129
136
|
export function resolveParagraphFontFamilies(
|
|
130
137
|
primary: string,
|
|
131
138
|
face: { weight: number; italic: boolean; style: string },
|
|
132
|
-
|
|
139
|
+
letterFallbacks: readonly string[] = fontManager.getLetterFallbackFamilies(),
|
|
133
140
|
cjkFallbacks: readonly string[] = fontManager.getCJKFallbackFamilies()
|
|
134
141
|
): string[] {
|
|
135
142
|
// The face the family draws it in, which may be the nearest one loaded.
|
|
136
143
|
const drawn = loadedFace(primary, face.weight, face.italic, face.style)
|
|
137
144
|
const renderPrimary = renderFamilies(primary, drawn?.style ?? face.style)
|
|
138
|
-
const
|
|
145
|
+
const renderLetterFallbacks = letterFallbacks.flatMap((family) =>
|
|
139
146
|
renderFamilies(family, 'Regular')
|
|
140
147
|
)
|
|
141
148
|
const renderCJKFallbacks = cjkFallbacks.flatMap((family) => renderFamilies(family, 'Regular'))
|
|
@@ -143,7 +150,7 @@ export function resolveParagraphFontFamilies(
|
|
|
143
150
|
primary,
|
|
144
151
|
...renderPrimary,
|
|
145
152
|
'',
|
|
146
|
-
...
|
|
153
|
+
...renderLetterFallbacks,
|
|
147
154
|
'',
|
|
148
155
|
...renderCJKFallbacks
|
|
149
156
|
].join('\0')
|
|
@@ -152,7 +159,7 @@ export function resolveParagraphFontFamilies(
|
|
|
152
159
|
const resolved = uniq([
|
|
153
160
|
...renderPrimary,
|
|
154
161
|
...(primary === DEFAULT_FONT_FAMILY ? [] : [DEFAULT_FONT_FAMILY]),
|
|
155
|
-
...
|
|
162
|
+
...renderLetterFallbacks,
|
|
156
163
|
...renderCJKFallbacks,
|
|
157
164
|
EMOJI_METRICS_FAMILY
|
|
158
165
|
])
|
package/src/canvas/text/index.ts
CHANGED
|
@@ -158,7 +158,9 @@ function observedGlyphReadiness(r: TextRenderer, node: SceneNode): NodeFontReadi
|
|
|
158
158
|
void fontResolver.demandForNode(demand, node.id, r.onFontResolutionSettled)
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
|
|
161
|
+
// An export draws once: a face that has not arrived by then is not coming, and the characters
|
|
162
|
+
// it would have covered keep the text's own fonts rather than leaving the layer blank.
|
|
163
|
+
if (pending) return r.exportFontsSettled ? 'substituted' : 'pending'
|
|
162
164
|
// Once no fallback is left for a character, the text draws with the fonts it has, the font's
|
|
163
165
|
// missing-glyph box standing in for that character, rather than not at all.
|
|
164
166
|
return exhausted ? 'substituted' : 'ready'
|
|
@@ -239,11 +241,3 @@ export function buildTextPicture(r: TextRenderer, node: SceneNode): Uint8Array |
|
|
|
239
241
|
picture.delete()
|
|
240
242
|
return bytes ?? null
|
|
241
243
|
}
|
|
242
|
-
|
|
243
|
-
/** Offset that places laid-out text of `contentHeight` in the node box by vertical alignment. */
|
|
244
|
-
export function textVerticalOffset(node: SceneNode, contentHeight: number): number {
|
|
245
|
-
const available = Math.max(0, node.height - contentHeight)
|
|
246
|
-
if (node.textAlignVertical === 'CENTER') return available / 2
|
|
247
|
-
if (node.textAlignVertical === 'BOTTOM') return available
|
|
248
|
-
return 0
|
|
249
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Paragraph } from 'canvaskit-wasm'
|
|
2
2
|
|
|
3
|
-
import type { CharacterStyleOverride, StyleRun } from '@pairdraw/scene-graph'
|
|
3
|
+
import type { CharacterStyleOverride, StyleRun, TextLength } from '@pairdraw/scene-graph'
|
|
4
4
|
import { rangeFontStyle } from '@pairdraw/scene-graph/shared-styles'
|
|
5
5
|
import {
|
|
6
6
|
hasParagraphSpacing,
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
textListItems,
|
|
11
11
|
textParagraphRanges,
|
|
12
12
|
lineHeightPixels,
|
|
13
|
+
lineStepPixels,
|
|
13
14
|
topLevelNumberDigits,
|
|
14
15
|
type TextListItem,
|
|
15
16
|
type TextParagraphRange
|
|
@@ -29,6 +30,7 @@ import type { ParagraphNode } from '#core/canvas/text/paragraph/inputs'
|
|
|
29
30
|
import type { TextRenderer } from '#core/canvas/text/renderer'
|
|
30
31
|
import { utf8Length } from '#core/canvas/text/utf8'
|
|
31
32
|
import { DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE } from '#core/constants'
|
|
33
|
+
import { autoWidthWrapWidth } from '#core/layout/text-measurement'
|
|
32
34
|
import { shownText } from '#core/text/case'
|
|
33
35
|
import { glyphAdvanceSync } from '#core/text/font/glyphs'
|
|
34
36
|
import { textFontFace } from '#core/text/requirements/collect'
|
|
@@ -62,8 +64,12 @@ function sliceStyleRuns(runs: readonly StyleRun[], start: number, end: number):
|
|
|
62
64
|
|
|
63
65
|
/** Line heights by paragraph index, `lead` places before the text: each run's, the text's elsewhere. */
|
|
64
66
|
function lineHeightRuns(node: ParagraphNode, lead: number): LineHeightRun[] {
|
|
67
|
+
// A line height of zero lays lines out as auto; a percent one under half a pixel steps them
|
|
68
|
+
// by none, as Figma does.
|
|
69
|
+
const step = (lineHeight: TextLength | null, fontSize: number) =>
|
|
70
|
+
lineHeightPixels(lineHeight, fontSize) ? lineStepPixels(lineHeight, fontSize) : null
|
|
65
71
|
// A percent line height follows the font size of the characters it spaces.
|
|
66
|
-
const own = (fontSize = node.fontSize) =>
|
|
72
|
+
const own = (fontSize = node.fontSize) => step(node.lineHeight, fontSize)
|
|
67
73
|
const runs: LineHeightRun[] = []
|
|
68
74
|
const add = (start: number, end: number, lineHeight: number | null) => {
|
|
69
75
|
const last = runs.at(-1)
|
|
@@ -76,9 +82,7 @@ function lineHeightRuns(node: ParagraphNode, lead: number): LineHeightRun[] {
|
|
|
76
82
|
if (position < run.start) add(position + lead, run.start + lead, own())
|
|
77
83
|
const runSize = run.style.fontSize ?? node.fontSize
|
|
78
84
|
const lineHeight =
|
|
79
|
-
run.style.lineHeight !== undefined
|
|
80
|
-
? lineHeightPixels(run.style.lineHeight, runSize) || null
|
|
81
|
-
: own(runSize)
|
|
85
|
+
run.style.lineHeight !== undefined ? step(run.style.lineHeight, runSize) : own(runSize)
|
|
82
86
|
add(run.start + lead, run.start + run.length + lead, lineHeight)
|
|
83
87
|
position = run.start + run.length
|
|
84
88
|
}
|
|
@@ -142,12 +146,23 @@ function needsParagraphLayout(node: ParagraphNode): boolean {
|
|
|
142
146
|
}
|
|
143
147
|
|
|
144
148
|
function layoutForNode(layout: TextLayout, node: ParagraphNode): void {
|
|
145
|
-
if (node.textAutoResize
|
|
146
|
-
layout.layout(1e6)
|
|
147
|
-
layout.layout(Math.max(node.width || 1, Math.ceil(layout.getLongestLine())))
|
|
148
|
-
} else {
|
|
149
|
+
if (node.textAutoResize !== 'WIDTH_AND_HEIGHT') {
|
|
149
150
|
layout.layout(resolveParagraphLayoutWidth(node))
|
|
151
|
+
return
|
|
150
152
|
}
|
|
153
|
+
const wrapWidth = resolveParagraphLayoutWidth(node)
|
|
154
|
+
if (truncatesAtMaxWidth(node)) {
|
|
155
|
+
layout.layout(Math.min(node.width || wrapWidth, wrapWidth))
|
|
156
|
+
return
|
|
157
|
+
}
|
|
158
|
+
layout.layout(wrapWidth)
|
|
159
|
+
const widestLine = Math.ceil(layout.getLongestLine())
|
|
160
|
+
const width = Math.min(wrapWidth, Math.max(node.width || 1, widestLine))
|
|
161
|
+
if (width !== wrapWidth) layout.layout(width)
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function truncatesAtMaxWidth(node: ParagraphNode): boolean {
|
|
165
|
+
return node.textTruncation === 'ENDING' && autoWidthWrapWidth(node) !== undefined
|
|
151
166
|
}
|
|
152
167
|
|
|
153
168
|
interface ListStyle {
|
|
@@ -356,14 +371,14 @@ function createTextLayout(
|
|
|
356
371
|
color: Float32Array | undefined,
|
|
357
372
|
options: ParagraphBuildOptions
|
|
358
373
|
): TextLayout {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
374
|
+
if (needsParagraphLayout(node)) return buildBlocks(r, node, color, options)
|
|
375
|
+
const truncation = buildTruncateOpts(node)
|
|
376
|
+
return TextLayout.ofParagraph(
|
|
377
|
+
r.ck,
|
|
378
|
+
buildSkParagraph(r, node, color, options, truncation.ellipsis ? { truncation } : undefined),
|
|
379
|
+
shownText(node).length,
|
|
380
|
+
paragraphLines(r, node, color, options)
|
|
381
|
+
)
|
|
367
382
|
}
|
|
368
383
|
|
|
369
384
|
/** How many laid-out line boxes fit the fixed height, preserving the first line. */
|
|
@@ -381,8 +396,10 @@ export function buildParagraph(
|
|
|
381
396
|
options: ParagraphBuildOptions = {}
|
|
382
397
|
): TextLayout {
|
|
383
398
|
const layout = createTextLayout(r, node, color, options)
|
|
399
|
+
// A box set to truncate clips to the lines its height holds, which is the auto-resize mode a
|
|
400
|
+
// panel offers; an imported text may instead truncate only where `textTruncation` says so.
|
|
384
401
|
const heightTruncation =
|
|
385
|
-
node.textTruncation === 'ENDING' &&
|
|
402
|
+
(node.textTruncation === 'ENDING' || node.textAutoResize === 'TRUNCATE') &&
|
|
386
403
|
node.height > 0 &&
|
|
387
404
|
(node.maxLines == null || node.maxLines <= 0)
|
|
388
405
|
let fittingLines: number | undefined
|
|
@@ -235,12 +235,20 @@ export class TextLayout {
|
|
|
235
235
|
const metrics = block.paragraph.getLineMetrics()
|
|
236
236
|
const boxes = this.placements.get(block)?.boxes
|
|
237
237
|
const blockEnd = block.start + block.length
|
|
238
|
+
// Skia starts the empty line after a closing line break at that break; a line starts where
|
|
239
|
+
// the one before it ends, its line break included.
|
|
240
|
+
let previousEnd = block.start
|
|
238
241
|
for (const [lineIndex, line] of metrics.entries()) {
|
|
239
242
|
const lastOfBlock = lineIndex === metrics.length - 1
|
|
240
243
|
const endsAtNewline = lastOfBlock && blockIndex < visible.length - 1
|
|
241
244
|
// A first-line indent is room before the text, not part of the line.
|
|
242
245
|
const indent = lineIndex === 0 ? block.leadWidth : 0
|
|
243
246
|
const box = boxes?.[lineIndex]
|
|
247
|
+
const startIndex = Math.max(previousEnd, this.toTextIndex(block, line.startIndex))
|
|
248
|
+
const endIncludingNewline = endsAtNewline
|
|
249
|
+
? blockEnd + 1
|
|
250
|
+
: this.toTextIndex(block, line.endIncludingNewline)
|
|
251
|
+
previousEnd = endIncludingNewline
|
|
244
252
|
this.lines.push({
|
|
245
253
|
...line,
|
|
246
254
|
...(box && {
|
|
@@ -248,12 +256,13 @@ export class TextLayout {
|
|
|
248
256
|
descent: box.height - box.ascent,
|
|
249
257
|
height: box.height
|
|
250
258
|
}),
|
|
251
|
-
startIndex
|
|
252
|
-
endIndex: this.toTextIndex(block, line.endIndex),
|
|
253
|
-
endExcludingWhitespaces:
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
259
|
+
startIndex,
|
|
260
|
+
endIndex: Math.max(startIndex, this.toTextIndex(block, line.endIndex)),
|
|
261
|
+
endExcludingWhitespaces: Math.max(
|
|
262
|
+
startIndex,
|
|
263
|
+
this.toTextIndex(block, line.endExcludingWhitespaces)
|
|
264
|
+
),
|
|
265
|
+
endIncludingNewline,
|
|
257
266
|
isHardBreak: endsAtNewline || line.isHardBreak,
|
|
258
267
|
width: block.empty ? 0 : line.width - indent,
|
|
259
268
|
left: line.left + block.x + (block.rtl ? 0 : indent),
|
|
@@ -105,7 +105,7 @@ export function figmaLineBox(
|
|
|
105
105
|
const runNatural = metric(rect[3] - rect[1])
|
|
106
106
|
// A first-line indent is a placeholder with no height.
|
|
107
107
|
if (runNatural <= 0) continue
|
|
108
|
-
height = Math.max(height,
|
|
108
|
+
height = Math.max(height, run.lineHeight ?? Math.round(runNatural))
|
|
109
109
|
if (runNatural > natural) {
|
|
110
110
|
natural = runNatural
|
|
111
111
|
// The newline that makes an empty line stands on the line above, so its box is
|
|
@@ -260,16 +260,22 @@ export function placeLines<Block extends LineBlock>(
|
|
|
260
260
|
const boxes = lineBoxes(ck, blocks, metrics)
|
|
261
261
|
if (!boxes) return null
|
|
262
262
|
const all = boxes.flat()
|
|
263
|
-
|
|
263
|
+
// A paragraph steps lines by whole pixels, so lines alike at a whole-pixel height already
|
|
264
|
+
// stand where Figma puts them.
|
|
265
|
+
const height = all[0].height
|
|
266
|
+
const alike = allSame(all.map((box) => box.height)) && allSame(all.map((box) => box.ascent))
|
|
267
|
+
if (alike && allSame([height, Math.round(height)])) return null
|
|
264
268
|
|
|
265
|
-
//
|
|
269
|
+
// Figma steps lines by their exact heights and puts each baseline on a whole pixel, so a
|
|
270
|
+
// baseline stands the whole pixels between those below the first (Figma desktop 126).
|
|
266
271
|
const first = all[0]
|
|
267
272
|
const last = all[all.length - 1]
|
|
273
|
+
const start = Math.round(first.ascent)
|
|
268
274
|
let below = 0
|
|
269
275
|
const baselines = blocks.map((block, index) =>
|
|
270
276
|
boxes[index].map((box, line) => {
|
|
271
277
|
if (index > 0 || line > 0) below += box.height + (line === 0 ? block.spaceBefore : 0)
|
|
272
|
-
return first.ascent + below
|
|
278
|
+
return first.ascent + Math.round(first.ascent + below) - start
|
|
273
279
|
})
|
|
274
280
|
)
|
|
275
281
|
const placed = new Map<Block, BlockPlacement & { y: number }>()
|
|
@@ -29,26 +29,35 @@ import {
|
|
|
29
29
|
} from '#core/canvas/text/paint'
|
|
30
30
|
import type { TextRenderer } from '#core/canvas/text/renderer'
|
|
31
31
|
import { DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE } from '#core/constants'
|
|
32
|
+
import { autoWidthWrapWidth } from '#core/layout/text-measurement'
|
|
32
33
|
import { shownTextSlice } from '#core/text/case'
|
|
33
34
|
import { ELLIPSIS } from '#core/text/ellipsis'
|
|
35
|
+
import { makeParagraphBuilder } from '#core/text/font/collection'
|
|
34
36
|
import { fontManager } from '#core/text/font/manager'
|
|
35
37
|
|
|
36
38
|
import type { ParagraphNode } from './inputs'
|
|
37
39
|
|
|
38
40
|
export function resolveParagraphLayoutWidth(node: ParagraphNode, maxWidth?: number): number {
|
|
39
41
|
if (maxWidth !== undefined) return maxWidth
|
|
40
|
-
if (node.textAutoResize === 'WIDTH_AND_HEIGHT')
|
|
42
|
+
if (node.textAutoResize === 'WIDTH_AND_HEIGHT') {
|
|
43
|
+
return autoWidthWrapWidth(node) ?? 1e6
|
|
44
|
+
}
|
|
41
45
|
return node.width || 1e6
|
|
42
46
|
}
|
|
43
47
|
|
|
48
|
+
/**
|
|
49
|
+
* The lines a truncating box shows: what `maxLines` allows, else as many as its height holds, as
|
|
50
|
+
* Figma keeps the last and ends it with an ellipsis. A text box set to truncate truncates even
|
|
51
|
+
* where nothing turned on `textTruncation`, which is how the auto-resize mode is chosen.
|
|
52
|
+
*/
|
|
44
53
|
export function buildTruncateOpts(node: ParagraphNode): { maxLines?: number; ellipsis?: string } {
|
|
45
|
-
if (node.textTruncation !== 'ENDING') return {}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (node.maxLines
|
|
49
|
-
|
|
54
|
+
if (node.textTruncation !== 'ENDING' && node.textAutoResize !== 'TRUNCATE') return {}
|
|
55
|
+
// A box that truncates only by its height is measured as it is, then capped by the lines that
|
|
56
|
+
// fit and built again with that count.
|
|
57
|
+
if (node.maxLines == null || node.maxLines <= 0) {
|
|
58
|
+
return node.textAutoResize === 'TRUNCATE' ? {} : { ellipsis: ELLIPSIS }
|
|
50
59
|
}
|
|
51
|
-
return
|
|
60
|
+
return { maxLines: node.maxLines, ellipsis: ELLIPSIS }
|
|
52
61
|
}
|
|
53
62
|
|
|
54
63
|
function getParagraphTextAlign(
|
|
@@ -286,7 +295,7 @@ export function buildSkParagraph(
|
|
|
286
295
|
const baseFontSize = node.fontSize || DEFAULT_FONT_SIZE
|
|
287
296
|
const baseLineHeight = lineHeightPixels(node.lineHeight, baseFontSize)
|
|
288
297
|
const cjkFallbacks = fontManager.getCJKFallbackFamilies()
|
|
289
|
-
const
|
|
298
|
+
const letterFallbacks = fontManager.getLetterFallbackFamilies()
|
|
290
299
|
const textDirection = resolveNodeTextDirection(node)
|
|
291
300
|
|
|
292
301
|
const truncateOpts = block.truncation ?? buildTruncateOpts(node)
|
|
@@ -295,7 +304,7 @@ export function buildSkParagraph(
|
|
|
295
304
|
resolveParagraphFontFamilies(
|
|
296
305
|
primary,
|
|
297
306
|
{ weight: face.fontWeight, italic: face.italic, style: faceStyleKey(face) },
|
|
298
|
-
|
|
307
|
+
letterFallbacks,
|
|
299
308
|
cjkFallbacks
|
|
300
309
|
)
|
|
301
310
|
const nodeKey = faceStyleKey(node)
|
|
@@ -337,7 +346,7 @@ export function buildSkParagraph(
|
|
|
337
346
|
})
|
|
338
347
|
|
|
339
348
|
if (!r.fontProvider) throw new Error('Font provider not initialized')
|
|
340
|
-
const builder = ck
|
|
349
|
+
const builder = makeParagraphBuilder(ck, paraStyle, r.fontProvider)
|
|
341
350
|
|
|
342
351
|
let background: Paint | undefined
|
|
343
352
|
try {
|
|
@@ -37,12 +37,14 @@ export const PARAGRAPH_INPUT_KEYS = [
|
|
|
37
37
|
'hangingList',
|
|
38
38
|
'textAutoResize',
|
|
39
39
|
'width',
|
|
40
|
-
'height'
|
|
40
|
+
'height',
|
|
41
|
+
'minWidth',
|
|
42
|
+
'maxWidth'
|
|
41
43
|
] as const satisfies readonly (keyof SceneNode)[]
|
|
42
44
|
|
|
43
45
|
export type ParagraphNode = Pick<SceneNode, (typeof PARAGRAPH_INPUT_KEYS)[number]>
|
|
44
46
|
|
|
45
|
-
const BOX_SIZE_KEYS = new Set<keyof SceneNode>(['width', 'height'])
|
|
47
|
+
const BOX_SIZE_KEYS = new Set<keyof SceneNode>(['width', 'height', 'minWidth', 'maxWidth'])
|
|
46
48
|
|
|
47
49
|
/**
|
|
48
50
|
* The paragraph inputs that decide how text shapes: which glyphs it needs and how big it is at a
|
|
@@ -127,12 +127,12 @@ function featuresOf(node: SceneNode, run: StyleRun | undefined): ShapingFeature[
|
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
129
|
* The style a family of the paragraph is drawn in: the face its own family draws the asked style
|
|
130
|
-
* in, and Regular for the
|
|
130
|
+
* in, and Regular for the script fallbacks, as the paragraph asks CanvasKit for them.
|
|
131
131
|
*/
|
|
132
132
|
function sourceStyle(family: string, font: ReturnType<typeof fontAt>): string | null {
|
|
133
133
|
const scriptFallback =
|
|
134
134
|
family !== font.family &&
|
|
135
|
-
(fontManager.
|
|
135
|
+
(fontManager.getLetterFallbackFamilies().includes(family) ||
|
|
136
136
|
fontManager.getCJKFallbackFamilies().includes(family))
|
|
137
137
|
if (scriptFallback) return fontManager.isStyleLoaded(family, 'Regular') ? 'Regular' : null
|
|
138
138
|
return loadedStyle(family, font.drawn.weight, font.drawn.italic, font.drawn.style)
|
|
@@ -11,6 +11,8 @@ export interface FontReadinessRenderer {
|
|
|
11
11
|
ck?: CanvasKit
|
|
12
12
|
fontProvider?: TypefaceFontProvider | null
|
|
13
13
|
fontsLoaded?: boolean
|
|
14
|
+
/** The renderer has finished preparing its fonts, so a face still pending will not arrive. */
|
|
15
|
+
exportFontsSettled?: boolean
|
|
14
16
|
onFontResolutionSettled?: FontResolutionSettled
|
|
15
17
|
trackFontDemand?: (node: SceneNode, key: string) => void
|
|
16
18
|
}
|
package/src/canvas/text/shape.ts
CHANGED
|
@@ -9,8 +9,9 @@ import {
|
|
|
9
9
|
type TextDecorationRecord
|
|
10
10
|
} from '@pairdraw/fig/node-change'
|
|
11
11
|
import type { SceneGraph, SceneNode } from '@pairdraw/scene-graph'
|
|
12
|
+
import { textVerticalOffset } from '@pairdraw/scene-graph/text'
|
|
12
13
|
|
|
13
|
-
import { buildParagraph
|
|
14
|
+
import { buildParagraph } from '#core/canvas/text'
|
|
14
15
|
import { textDecorationRects, type DecoratedGlyph } from '#core/canvas/text/decorations'
|
|
15
16
|
import { outlineInk, savedGlyphInk } from '#core/canvas/text/ink'
|
|
16
17
|
import { COMBINING_KEYCAP, keycapFrame } from '#core/canvas/text/keycap'
|
|
@@ -147,15 +148,18 @@ export function shapeText(
|
|
|
147
148
|
const outlined = glyphs.every((glyph) => glyph.commands)
|
|
148
149
|
return {
|
|
149
150
|
glyphs: outlined ? glyphs : glyphs.map((glyph) => ({ ...glyph, commands: null })),
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
151
|
+
// Figma saves no baseline for the empty line after a closing line break.
|
|
152
|
+
baselines: metrics
|
|
153
|
+
.filter((line, index) => index === 0 || line.startIndex < text.length)
|
|
154
|
+
.map((line) => ({
|
|
155
|
+
firstCharacter: line.startIndex,
|
|
156
|
+
endCharacter: Math.min(line.endIncludingNewline, text.length),
|
|
157
|
+
position: { x: line.left, y: line.baseline + offsetY },
|
|
158
|
+
width: line.width,
|
|
159
|
+
lineY: line.baseline - line.ascent + offsetY,
|
|
160
|
+
lineHeight: line.height,
|
|
161
|
+
lineAscent: line.ascent
|
|
162
|
+
})),
|
|
159
163
|
logicalIndexToCharacterOffsetMap: completeCharacterOffsets(characterOffsets)
|
|
160
164
|
}
|
|
161
165
|
} finally {
|
|
@@ -191,36 +195,21 @@ function needsShaping(graph: SceneGraph): boolean {
|
|
|
191
195
|
return false
|
|
192
196
|
}
|
|
193
197
|
|
|
194
|
-
/** How many shaping calls share each provider made for them; the last one to finish deletes it. */
|
|
195
|
-
const shaperProviderUsers = new Map<TypefaceFontProvider, number>()
|
|
196
|
-
|
|
197
198
|
/**
|
|
198
|
-
* Run `use` with text shaped as the canvas lays it out
|
|
199
|
-
*
|
|
200
|
-
*
|
|
199
|
+
* Run `use` with text shaped as the canvas lays it out, from the font provider the canvas of
|
|
200
|
+
* `canvasKit` draws from, or one a caller attached and registered faces on for layout alone.
|
|
201
|
+
* Each call holds a share of that provider, so overlapping calls shape from the same one and the
|
|
202
|
+
* last to finish releases it; a provider with no share left is deleted.
|
|
201
203
|
*/
|
|
202
204
|
export async function withTextShaper<T>(
|
|
203
205
|
canvasKit: CanvasKit,
|
|
204
206
|
use: (shape: (node: SceneNode) => ShapedText | null) => Promise<T>
|
|
205
207
|
): Promise<T> {
|
|
206
|
-
const
|
|
207
|
-
const provider = attached ?? canvasKit.TypefaceFontProvider.Make()
|
|
208
|
-
if (!attached) fontManager.attachProvider(canvasKit, provider)
|
|
209
|
-
const shared = !attached || shaperProviderUsers.has(provider)
|
|
210
|
-
if (shared) shaperProviderUsers.set(provider, (shaperProviderUsers.get(provider) ?? 0) + 1)
|
|
208
|
+
const provider = fontManager.acquireProvider(canvasKit)
|
|
211
209
|
try {
|
|
212
210
|
return await use((node) => shapeText(canvasKit, provider, node))
|
|
213
211
|
} finally {
|
|
214
|
-
|
|
215
|
-
const users = (shaperProviderUsers.get(provider) ?? 1) - 1
|
|
216
|
-
if (users > 0) {
|
|
217
|
-
shaperProviderUsers.set(provider, users)
|
|
218
|
-
} else {
|
|
219
|
-
shaperProviderUsers.delete(provider)
|
|
220
|
-
fontManager.detachProvider(provider)
|
|
221
|
-
provider.delete()
|
|
222
|
-
}
|
|
223
|
-
}
|
|
212
|
+
fontManager.releaseProvider(provider)
|
|
224
213
|
}
|
|
225
214
|
}
|
|
226
215
|
|
package/src/constants.ts
CHANGED
|
@@ -58,13 +58,13 @@ export const PEN_ANCHOR_RADIUS = 4
|
|
|
58
58
|
export const PEN_CLOSE_RADIUS_BOOST = 2
|
|
59
59
|
export const PEN_PATH_STROKE_WIDTH = 2
|
|
60
60
|
export const PARENT_OUTLINE_ALPHA = 0.5
|
|
61
|
-
export const PARENT_OUTLINE_DASH = 4
|
|
62
61
|
export const DEFAULT_FONT_FAMILY = 'Inter'
|
|
63
62
|
export const DEFAULT_FONT_SIZE = 14
|
|
64
63
|
export const DEFAULT_STROKE_MITER_LIMIT = 4
|
|
65
64
|
/** Figma's stroke weight for a node that has not been given one. */
|
|
66
65
|
export const LABEL_FONT_SIZE = 11
|
|
67
66
|
export const SIZE_FONT_SIZE = 10
|
|
67
|
+
export const HUD_FONT_SIZE = 10
|
|
68
68
|
export const VALUE_FONT_SIZE = 11
|
|
69
69
|
|
|
70
70
|
export const HANDLE_HALF_SIZE = 3
|
|
@@ -273,11 +273,16 @@ export const SECTION_DEFAULT_STROKE: Stroke = {
|
|
|
273
273
|
|
|
274
274
|
export const SECTION_CORNER_RADIUS = 2
|
|
275
275
|
|
|
276
|
+
/** Effect filters a renderer keeps: a slider drag would otherwise keep every value it passed. */
|
|
277
|
+
export const EFFECT_FILTER_CACHE_ENTRIES = 64
|
|
278
|
+
|
|
276
279
|
export const ZOOM_DIVISOR = 50
|
|
277
280
|
export const ZOOM_SCALE_MIN = 0.75
|
|
278
281
|
export const ZOOM_SCALE_MAX = 1.25
|
|
279
282
|
|
|
280
283
|
export const PEN_CLOSE_THRESHOLD = 8
|
|
284
|
+
/** Points a pen path needs before a press on its first point closes it: two make a closed shape, as in Figma. */
|
|
285
|
+
export const PEN_CLOSE_MIN_POINTS = 2
|
|
281
286
|
/**
|
|
282
287
|
* Screen pixels a pencil sample may stray from the line through its neighbours before the curve
|
|
283
288
|
* keeps it, so a stroke drawn zoomed in keeps more detail.
|