@pygmalionjs/pygmalion 0.16.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.
Files changed (28) hide show
  1. package/README.md +84 -3
  2. package/dist-lib/{CameraLayer-BNw26sgR.js → CameraLayer-Clqgdcjb.js} +1 -1
  3. package/dist-lib/pygmalion.js +13962 -12665
  4. package/dist-lib/{runtime-Bo5tncK_.js → runtime-B8Qu1ung.js} +3 -2
  5. package/dist-lib/style.css +1 -1
  6. package/dist-lib/testing.js +2 -2
  7. package/dist-lib/types/document/exportSettings.d.ts +4 -1
  8. package/dist-lib/types/document/textLayout.d.ts +77 -0
  9. package/dist-lib/types/lib.d.ts +12 -1
  10. package/dist-lib/types/workspace/configuration.d.ts +3 -0
  11. package/dist-lib/types/workspace/edit/AssetsPanel.d.ts +3 -1
  12. package/dist-lib/types/workspace/edit/ClipboardRelationshipDialog.d.ts +21 -0
  13. package/dist-lib/types/workspace/edit/NodeExportPanel.d.ts +3 -1
  14. package/dist-lib/types/workspace/edit/TextStyleCatalog.d.ts +6 -0
  15. package/dist-lib/types/workspace/edit/clipboard.d.ts +1 -0
  16. package/dist-lib/types/workspace/edit/clipboardGraph.d.ts +9 -0
  17. package/dist-lib/types/workspace/edit/clipboardPrototype.d.ts +55 -0
  18. package/dist-lib/types/workspace/edit/clipboardStyles.d.ts +46 -0
  19. package/dist-lib/types/workspace/edit/clipboardTransfer.d.ts +38 -0
  20. package/dist-lib/types/workspace/edit/preparedTextFace.d.ts +31 -0
  21. package/dist-lib/types/workspace/edit/rasterCanvas.d.ts +6 -0
  22. package/dist-lib/types/workspace/edit/rasterExport.d.ts +9 -1
  23. package/dist-lib/types/workspace/edit/staticTextRaster.d.ts +39 -0
  24. package/dist-lib/types/workspace/edit/textLayoutBrowser.d.ts +3 -0
  25. package/dist-lib/types/workspace/edit/textLayoutPlan.d.ts +12 -0
  26. package/dist-lib/types/workspace/edit/textLayoutRuntime.d.ts +20 -0
  27. package/dist-lib/types/workspace/edit/useDesignClipboardPaste.d.ts +19 -0
  28. package/package.json +1 -1
package/README.md CHANGED
@@ -494,9 +494,90 @@ sample; the SDK does not guess that sample from a canonical placeholder.
494
494
 
495
495
  The existing family/weight `TextFontLoader` API remains available. Browser
496
496
  `document.fonts.check()` success alone does not establish an exact face or glyph
497
- coverage. The preparation capability does not download fonts implicitly, change
498
- text geometry, or enable text raster/SVG output; those output boundaries remain
499
- explicit. Dispose the runtime when its font environment is no longer used.
497
+ coverage. The preparation capability does not download fonts implicitly or change
498
+ text geometry. Dispose the runtime when its font environment is no longer used.
499
+
500
+ ### Export authored text and inspect file styles
501
+
502
+ The browser `createDesignRasterRenderer({ textFontPreparation, resolvePreparedFace })`
503
+ factory reuses that explicit preparation runtime for a selected static text
504
+ layer. The face resolver maps the prepared environment and face identity to its
505
+ exact registered `FontFace` object. Missing, replaced or ambiguous registrations
506
+ are refused. Workspace connects `textFontPreparation` and
507
+ `textRasterFaceResolver` to its inspector and asset export controls. Text
508
+ requires a fixed positive box, one unwrapped paragraph, explicit family, size,
509
+ weight, line height and zero letter spacing, one solid color, and a registered
510
+ browser face matching the declared style and weight. The provider attests exact
511
+ face identity and sample coverage; browser fallback or synthesized styling is
512
+ not accepted as that evidence.
513
+
514
+ PNG, JPG and WebP retain the layer box and existing output size limits. Text
515
+ with mixed runs, automatic sizing, layout-dependent placement, source/bound
516
+ content, decorations, effects or unresolved colors is refused. SVG text and
517
+ frames containing text remain unsupported by the built-in exporter. The
518
+ existing `renderDesignRaster` geometry renderer remains available without a
519
+ font provider. Raster success never enables a source writer.
520
+
521
+ `exportDesignNode` accepts an optional fifth `{ signal }` argument. Workspace
522
+ cancels pending output when the layer, document, target, page or mode changes,
523
+ including a rapid departure and return before a render. Export never adds a
524
+ history entry or applies implementation source.
525
+
526
+ With no layer selected, the properties sidebar lists the file's authored text
527
+ styles, grouped by their slash-separated names. Expanding a style displays its
528
+ stored typography and library origin. This metadata browser neither discovers
529
+ installed fonts nor downloads faces; selecting a layer retains the existing
530
+ style application and editing controls.
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.
500
581
 
501
582
  ## Local development
502
583
 
@@ -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-Bo5tncK_.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-B8Qu1ung.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})`;