@pygmalionjs/pygmalion 0.17.0 → 0.19.0

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.
Files changed (35) hide show
  1. package/README.md +71 -0
  2. package/dist-lib/{CameraLayer-Clqgdcjb.js → CameraLayer-Bv1TqRim.js} +1 -1
  3. package/dist-lib/pygmalion.js +17841 -16123
  4. package/dist-lib/{runtime-B8Qu1ung.js → runtime-DlZpODq8.js} +45 -45
  5. package/dist-lib/style.css +1 -1
  6. package/dist-lib/testing.js +5 -5
  7. package/dist-lib/types/document/textLayout.d.ts +77 -0
  8. package/dist-lib/types/lib.d.ts +11 -1
  9. package/dist-lib/types/token-library/bindings.d.ts +44 -0
  10. package/dist-lib/types/workspace/edit/ArrangeLayers.d.ts +5 -1
  11. package/dist-lib/types/workspace/edit/CanvasGuides.d.ts +5 -1
  12. package/dist-lib/types/workspace/edit/ClipboardRelationshipDialog.d.ts +21 -0
  13. package/dist-lib/types/workspace/edit/PrototypeWiring.d.ts +4 -0
  14. package/dist-lib/types/workspace/edit/SelectionHandles.d.ts +10 -2
  15. package/dist-lib/types/workspace/edit/VectorEditor.d.ts +12 -1
  16. package/dist-lib/types/workspace/edit/clipboard.d.ts +1 -0
  17. package/dist-lib/types/workspace/edit/clipboardGraph.d.ts +9 -0
  18. package/dist-lib/types/workspace/edit/clipboardPrototype.d.ts +55 -0
  19. package/dist-lib/types/workspace/edit/clipboardStyles.d.ts +46 -0
  20. package/dist-lib/types/workspace/edit/clipboardTransfer.d.ts +38 -0
  21. package/dist-lib/types/workspace/edit/editorCanvas.d.ts +6 -1
  22. package/dist-lib/types/workspace/edit/geometryHandles.d.ts +13 -1
  23. package/dist-lib/types/workspace/edit/layerArrangement.d.ts +4 -1
  24. package/dist-lib/types/workspace/edit/preparedTextFace.d.ts +31 -0
  25. package/dist-lib/types/workspace/edit/projection.d.ts +23 -1
  26. package/dist-lib/types/workspace/edit/prototypeWiringModel.d.ts +2 -1
  27. package/dist-lib/types/workspace/edit/staticTextRaster.d.ts +4 -15
  28. package/dist-lib/types/workspace/edit/textLayoutBrowser.d.ts +3 -0
  29. package/dist-lib/types/workspace/edit/textLayoutPlan.d.ts +12 -0
  30. package/dist-lib/types/workspace/edit/textLayoutProjection.d.ts +28 -0
  31. package/dist-lib/types/workspace/edit/textLayoutRuntime.d.ts +20 -0
  32. package/dist-lib/types/workspace/edit/useDesignClipboardPaste.d.ts +19 -0
  33. package/dist-lib/types/workspace/edit/useTextLayout.d.ts +19 -0
  34. package/dist-lib/types/workspace/edit/vectorTools.d.ts +9 -5
  35. package/package.json +1 -1
package/README.md CHANGED
@@ -529,6 +529,77 @@ stored typography and library origin. This metadata browser neither discovers
529
529
  installed fonts nor downloads faces; selecting a layer retains the existing
530
530
  style application and editing controls.
531
531
 
532
+ ### Paste layers with styles and prototype connections
533
+
534
+ Workspace copy includes the selected graph, its referenced component definitions
535
+ and variant sets, and the styles and prototype declarations that graph uses.
536
+ Pasting creates new local identities automatically when all relationships fit.
537
+ Name conflicts and connections outside the copied graph open a dialog before
538
+ changing the document. Resolve names, choose whether to keep copied flow starts,
539
+ and select existing destination screens. Internal IDs do not need manual editing.
540
+ An existing style may be reused only through an explicit selection that matches
541
+ its complete value and library origin. Target presentation settings are retained.
542
+ Copied flow starts can be explicitly omitted; keeping a starting screen below a
543
+ nested container is refused.
544
+
545
+ Programmatic consumers use `copyDesignSubtreesWithRelationships(document,
546
+ selection, { flowPolicy: 'selected-starts' | 'none' })`, the matching serialization
547
+ and parsing functions, and `pasteDesignSubtreesWithRelationships`. The paste
548
+ options require complete `styles` and `prototype` relationship maps for a version
549
+ 2 envelope. The resulting plan contains every node, asset and owned sidecar;
550
+ `applyDesignTransferPaste(transaction, currentDocument, plan)` checks the target
551
+ fingerprint before replacing it in one undoable transaction. Changes to the
552
+ document, page, source or mode invalidate an open Workspace paste.
553
+
554
+ Plain content still emits version 1. The original version 1 APIs keep their
555
+ existing relationship refusal behavior. Both formats preserve component override
556
+ addresses through the existing structural codec. Variable-library bindings,
557
+ data/source bindings and unknown document sidecars still require their own
558
+ explicit adapters. Clipboard transfer does not write a token library, fetch a
559
+ remote asset or apply implementation source.
560
+
561
+ ### Measure an authored plain-text occurrence
562
+
563
+ `createTextLayoutPlan` captures one visible resolved text occurrence with an
564
+ explicit document revision key and instance/row address. `createTextLayoutRuntime`
565
+ uses the exact font preparation and registered face resolver to measure that
566
+ plan in a browser. It returns immutable local CSS-pixel bounds, line baselines,
567
+ UTF-16 grapheme ranges and face/environment identity. Fixed, auto-width and
568
+ auto-height modes follow the existing text surface. Native shaping remains on
569
+ the complete paragraph; character ranges only observe the resulting geometry.
570
+
571
+ Each acquisition rechecks face registration, including cache hits. Concurrent
572
+ readers share work, cancellation respects remaining readers, and successful
573
+ entries use a bounded cache. Dispose the runtime when its font environment ends.
574
+ Mixed text, bidi, connected/repeated content, unresolved typography and
575
+ source-rendered text return named diagnostics in this first measurement API.
576
+
577
+ When both font capabilities are supplied, Workspace shares a disposable measured
578
+ scene between the canvas, selection handles, snapping, guides, alignment and
579
+ prototype wiring. Auto-height text keeps its authored minimum height when its
580
+ width changes; auto-width text owns both dimensions. Inspector sizes follow the
581
+ measured scene and derived dimensions cannot be overwritten by resize controls.
582
+ Pending or unavailable derived bounds stay unavailable to geometry commands.
583
+ Changing the document, page, source, mode or font registration cancels stale
584
+ geometry work and gestures. Late measurements never reset a camera the user moved.
585
+
586
+ This integration supports plain text under the existing bounded layout solver.
587
+ Non-start constraints under text-resized ancestors, mixed text and dynamic
588
+ prototype playback still need additional geometry integration. The built-in
589
+ multiline exporter is also separate work. Measurement never rewrites canonical
590
+ width/height, adds an undo entry or changes source files.
591
+
592
+ ### Inspect an existing variable binding
593
+
594
+ `resolveVariableModeForNode` and `resolveVariableModeForInstance` return the
595
+ requested collection mode and the scope that supplied it. Instance addresses
596
+ use the existing opaque override address; consumers do not reconstruct paths.
597
+ `planVariableOccurrence` captures one actual bound occurrence, its token
598
+ resolution (including the authored mode), scalar value and literal patch without
599
+ refreshing unrelated nodes. `projectVariableScalar` exposes the same validation
600
+ and own-node or sparse-override projection used by refresh. These reads do not
601
+ write either document or enable variable-library clipboard transfer.
602
+
532
603
  ## Local development
533
604
 
534
605
  ```bash
@@ -1,5 +1,5 @@
1
1
  import { jsx as p } from "react/jsx-runtime";
2
- import { n as C, R as g, aM as P, ck as R, cl as k, Y as E, cm as I, a7 as m, a4 as b } from "./runtime-B8Qu1ung.js";
2
+ import { n as C, R as g, aM as P, ck as R, cl as k, Y as E, cm as I, a7 as m, a4 as b } from "./runtime-DlZpODq8.js";
3
3
  import { useRef as L, useLayoutEffect as h } from "react";
4
4
  function v(n) {
5
5
  return `translate(${n.panX}px, ${n.panY}px) scale(${n.zoom})`;