@pygmalionjs/pygmalion 0.17.0 → 0.18.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.
- package/README.md +50 -0
- package/dist-lib/pygmalion.js +13019 -11963
- package/dist-lib/style.css +1 -1
- package/dist-lib/types/document/textLayout.d.ts +77 -0
- package/dist-lib/types/lib.d.ts +11 -1
- package/dist-lib/types/workspace/edit/ClipboardRelationshipDialog.d.ts +21 -0
- package/dist-lib/types/workspace/edit/clipboard.d.ts +1 -0
- package/dist-lib/types/workspace/edit/clipboardGraph.d.ts +9 -0
- package/dist-lib/types/workspace/edit/clipboardPrototype.d.ts +55 -0
- package/dist-lib/types/workspace/edit/clipboardStyles.d.ts +46 -0
- package/dist-lib/types/workspace/edit/clipboardTransfer.d.ts +38 -0
- package/dist-lib/types/workspace/edit/preparedTextFace.d.ts +31 -0
- package/dist-lib/types/workspace/edit/staticTextRaster.d.ts +4 -15
- package/dist-lib/types/workspace/edit/textLayoutBrowser.d.ts +3 -0
- package/dist-lib/types/workspace/edit/textLayoutPlan.d.ts +12 -0
- package/dist-lib/types/workspace/edit/textLayoutRuntime.d.ts +20 -0
- package/dist-lib/types/workspace/edit/useDesignClipboardPaste.d.ts +19 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -529,6 +529,56 @@ 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
|
+
These snapshots do not yet drive Workspace selection handles, parent layout or
|
|
578
|
+
the built-in multiline exporter. Callers must preserve the captured lifetime and
|
|
579
|
+
apply scene transforms and clips when consuming them. Measurement never rewrites
|
|
580
|
+
canonical width/height, adds an undo entry or changes source files.
|
|
581
|
+
|
|
532
582
|
## Local development
|
|
533
583
|
|
|
534
584
|
```bash
|