@pygmalionjs/pygmalion 0.14.0 → 0.16.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 (45) hide show
  1. package/README.md +22 -0
  2. package/dist-lib/{CameraLayer-CGW_FPQS.js → CameraLayer-BNw26sgR.js} +10 -10
  3. package/dist-lib/pygmalion.js +16093 -14331
  4. package/dist-lib/{runtime-DkCf4iKe.js → runtime-Bo5tncK_.js} +1919 -1878
  5. package/dist-lib/style.css +1 -1
  6. package/dist-lib/testing.js +8 -8
  7. package/dist-lib/types/document/appearance.d.ts +5 -2
  8. package/dist-lib/types/document/assets.d.ts +12 -4
  9. package/dist-lib/types/document/imagePaintGeometry.d.ts +23 -0
  10. package/dist-lib/types/document/pages.d.ts +48 -0
  11. package/dist-lib/types/document/pagesMetadata.d.ts +16 -0
  12. package/dist-lib/types/document/richText.d.ts +10 -0
  13. package/dist-lib/types/document/textFontPreparation.d.ts +36 -0
  14. package/dist-lib/types/lib.d.ts +11 -1
  15. package/dist-lib/types/workspace/configuration.d.ts +3 -0
  16. package/dist-lib/types/workspace/contracts.d.ts +6 -0
  17. package/dist-lib/types/workspace/controller.d.ts +1 -0
  18. package/dist-lib/types/workspace/edit/ArrangeLayers.d.ts +2 -1
  19. package/dist-lib/types/workspace/edit/AssetsPanel.d.ts +3 -2
  20. package/dist-lib/types/workspace/edit/CanvasGuides.d.ts +6 -3
  21. package/dist-lib/types/workspace/edit/EditViewport.d.ts +6 -0
  22. package/dist-lib/types/workspace/edit/EditorCommandMenu.d.ts +18 -0
  23. package/dist-lib/types/workspace/edit/ImageCropEditor.d.ts +13 -0
  24. package/dist-lib/types/workspace/edit/LayerTree.d.ts +5 -1
  25. package/dist-lib/types/workspace/edit/LayoutPanel.d.ts +2 -1
  26. package/dist-lib/types/workspace/edit/NodeExportPanel.d.ts +10 -0
  27. package/dist-lib/types/workspace/edit/PagesPanel.d.ts +12 -0
  28. package/dist-lib/types/workspace/edit/PanelResizeHandle.d.ts +12 -0
  29. package/dist-lib/types/workspace/edit/PrototypePanel.d.ts +5 -1
  30. package/dist-lib/types/workspace/edit/PrototypeWiring.d.ts +18 -0
  31. package/dist-lib/types/workspace/edit/SelectionHandles.d.ts +8 -4
  32. package/dist-lib/types/workspace/edit/TextEditor.d.ts +7 -1
  33. package/dist-lib/types/workspace/edit/canvasGuideModel.d.ts +16 -0
  34. package/dist-lib/types/workspace/edit/clipboard.d.ts +1 -0
  35. package/dist-lib/types/workspace/edit/editorCanvas.d.ts +1 -1
  36. package/dist-lib/types/workspace/edit/geometryHandles.d.ts +10 -3
  37. package/dist-lib/types/workspace/edit/prototypeWiringModel.d.ts +47 -0
  38. package/dist-lib/types/workspace/edit/rasterExport.d.ts +5 -0
  39. package/dist-lib/types/workspace/edit/textFontOccurrences.d.ts +34 -0
  40. package/dist-lib/types/workspace/edit/textFontRuntime.d.ts +15 -0
  41. package/dist-lib/types/workspace/edit/useTextFontPreparation.d.ts +12 -0
  42. package/dist-lib/types/workspace/view/prototypeMotionInterruption.d.ts +47 -0
  43. package/dist-lib/types/workspace/view/prototypePlayback.d.ts +8 -0
  44. package/dist-lib/types/workspace/view/storyboardCanvas.d.ts +16 -1
  45. package/package.json +1 -1
package/README.md CHANGED
@@ -476,6 +476,28 @@ Process-group cleanup supports macOS and Linux. Catalog generation callbacks
476
476
  receive an isolated archive for the exact requested commit; cancelling one
477
477
  catalog request does not cancel generation shared with another caller.
478
478
 
479
+ ### Prepare declared text faces
480
+
481
+ An optional `WorkspaceTargetConfiguration.textFontPreparation` capability can
482
+ prepare fonts for the visible page and selected text layer. Create it with
483
+ `createTextFontPreparationRuntime(resolver)` and reuse it for the lifetime of
484
+ the declared font environment. The resolver receives the original family
485
+ expression, numeric weight, normal/italic style, exact text sample and an abort
486
+ signal. A ready result identifies the actual face and attests to that sample's
487
+ coverage; otherwise it returns a named unavailable or failed result.
488
+
489
+ The SDK shares identical pending requests, cancels abandoned readers, caches
490
+ successful results and offers retry without editing the document. Page changes
491
+ exclude hidden pages, and resolved component overrides retain their own font
492
+ requirements. Connected or source-rendered text needs an explicit rendered
493
+ sample; the SDK does not guess that sample from a canonical placeholder.
494
+
495
+ The existing family/weight `TextFontLoader` API remains available. Browser
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.
500
+
479
501
  ## Local development
480
502
 
481
503
  ```bash
@@ -1,11 +1,11 @@
1
1
  import { jsx as p } from "react/jsx-runtime";
2
- import { j as C, R as g, aI as P, ch as R, ci as E, U as I, cj as k, a3 as m, a0 as b } from "./runtime-DkCf4iKe.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-Bo5tncK_.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})`;
6
6
  }
7
7
  function x(n, e, i, r = !1) {
8
- return r || k(n, e, i) ? void 0 : "none";
8
+ return r || I(n, e, i) ? void 0 : "none";
9
9
  }
10
10
  function f(n, e) {
11
11
  return x(
@@ -41,7 +41,7 @@ function F(n, e, i, r) {
41
41
  const c = e.width ?? 390;
42
42
  return c > 0 ? o.width / c : null;
43
43
  }
44
- function B(n) {
44
+ function $(n) {
45
45
  return w(n).map((i) => {
46
46
  var t;
47
47
  const r = n.store.pages.find((a) => a.id === i.id);
@@ -61,13 +61,13 @@ function w(n) {
61
61
  x: t.x ?? 0,
62
62
  y: t.y ?? 0,
63
63
  width: t.width ?? 390,
64
- height: I(t)
64
+ height: E(t)
65
65
  },
66
66
  pinned: t.id === e.activePageId || (r == null ? void 0 : r.kind) === "frame" && r.id === t.id || // A standby variant renders its full surface hidden at the group's
67
67
  // slot, so the switch to it has nothing left to mount.
68
68
  e.isScreenStateStandby(t) || // Catalog sheets need a full first render to replace their 1x1 seed.
69
69
  // Their live DOM remains mounted afterwards; offscreen paint may be skipped.
70
- E(t) || n.schedulers.previewIntent.hasPreviewIntent(t.id),
70
+ k(t) || n.schedulers.previewIntent.hasPreviewIntent(t.id),
71
71
  weightBytes: z(n, t, i, t.id === e.activePageId),
72
72
  screenshotDensity: F(
73
73
  n,
@@ -77,8 +77,8 @@ function w(n) {
77
77
  )
78
78
  }));
79
79
  }
80
- let j = 0;
81
- function D({
80
+ let M = 0;
81
+ function B({
82
82
  children: n,
83
83
  interactionFrameId: e = null
84
84
  }) {
@@ -86,7 +86,7 @@ function D({
86
86
  return h(() => {
87
87
  const a = t.current;
88
88
  if (!a) return;
89
- const o = new g(`CameraLayer#${++j}`, () => {
89
+ const o = new g(`CameraLayer#${++M}`, () => {
90
90
  o.isDisposed || c();
91
91
  }), c = () => {
92
92
  o.track(() => {
@@ -153,7 +153,7 @@ function D({
153
153
  );
154
154
  }
155
155
  export {
156
- D as CameraLayer,
157
- B as __debugReadEditorFrames,
156
+ B as CameraLayer,
157
+ $ as __debugReadEditorFrames,
158
158
  x as resolveCameraPointerEvents
159
159
  };