@pygmalionjs/pygmalion 0.8.0 → 0.9.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 (130) hide show
  1. package/binding-source.d.ts +25 -0
  2. package/dist-lib/{CameraLayer-nkNrazn8.js → CameraLayer-BdOko8XE.js} +17 -17
  3. package/dist-lib/pygmalion.js +24599 -12746
  4. package/dist-lib/{runtime-DdYnT6k4.js → runtime-Dxb-IaLN.js} +12427 -11116
  5. package/dist-lib/style.css +1 -1
  6. package/dist-lib/testing.js +10 -10
  7. package/dist-lib/types/binding/catalog.d.ts +10 -0
  8. package/dist-lib/types/binding/contracts.d.ts +202 -0
  9. package/dist-lib/types/binding/documentCommands.d.ts +38 -0
  10. package/dist-lib/types/binding/index.d.ts +6 -0
  11. package/dist-lib/types/binding/preview.d.ts +37 -0
  12. package/dist-lib/types/binding/source.d.ts +109 -0
  13. package/dist-lib/types/binding/useDataProjection.d.ts +9 -0
  14. package/dist-lib/types/binding/validate.d.ts +8 -0
  15. package/dist-lib/types/core/runtime.d.ts +6 -0
  16. package/dist-lib/types/document/appearance.d.ts +112 -0
  17. package/dist-lib/types/document/assets.d.ts +204 -0
  18. package/dist-lib/types/document/components.d.ts +169 -0
  19. package/dist-lib/types/document/contracts.d.ts +171 -0
  20. package/dist-lib/types/document/engine.d.ts +20 -0
  21. package/dist-lib/types/document/exportSettings.d.ts +45 -0
  22. package/dist-lib/types/document/geometry.d.ts +11 -0
  23. package/dist-lib/types/document/layout.d.ts +53 -0
  24. package/dist-lib/types/document/prototype.d.ts +424 -0
  25. package/dist-lib/types/document/prototypeReferences.d.ts +3 -0
  26. package/dist-lib/types/document/richText.d.ts +185 -0
  27. package/dist-lib/types/document/styles.d.ts +216 -0
  28. package/dist-lib/types/document/svgImport.d.ts +17 -0
  29. package/dist-lib/types/document/vector.d.ts +222 -0
  30. package/dist-lib/types/editor/designCompiler.d.ts +7 -0
  31. package/dist-lib/types/editor/designImport.d.ts +7 -0
  32. package/dist-lib/types/editor/inspect.d.ts +8 -0
  33. package/dist-lib/types/editor/revisionCatalogInstall.d.ts +1 -1
  34. package/dist-lib/types/editor/screenInteractions.d.ts +3 -3
  35. package/dist-lib/types/editor/store.d.ts +1 -1
  36. package/dist-lib/types/editor/surfaceDemands.d.ts +3 -1
  37. package/dist-lib/types/host/project.d.ts +44 -0
  38. package/dist-lib/types/host/registryConnections.d.ts +11 -0
  39. package/dist-lib/types/host/sourceFilePlan.d.ts +15 -0
  40. package/dist-lib/types/host/sourceWriteback.d.ts +50 -0
  41. package/dist-lib/types/lib.d.ts +101 -3
  42. package/dist-lib/types/token-library/bindings.d.ts +62 -0
  43. package/dist-lib/types/token-library/contracts.d.ts +117 -0
  44. package/dist-lib/types/token-library/engine.d.ts +13 -0
  45. package/dist-lib/types/workspace/WorkspaceShell.d.ts +9 -0
  46. package/dist-lib/types/workspace/application/ApplicationWorkspace.d.ts +3 -0
  47. package/dist-lib/types/workspace/configuration.d.ts +39 -0
  48. package/dist-lib/types/workspace/contracts.d.ts +64 -0
  49. package/dist-lib/types/workspace/controller.d.ts +35 -0
  50. package/dist-lib/types/workspace/documentSessions.d.ts +42 -0
  51. package/dist-lib/types/workspace/edit/AppearancePanel.d.ts +23 -0
  52. package/dist-lib/types/workspace/edit/ArrangeLayers.d.ts +10 -0
  53. package/dist-lib/types/workspace/edit/AssetsPanel.d.ts +16 -0
  54. package/dist-lib/types/workspace/edit/CanvasGuides.d.ts +19 -0
  55. package/dist-lib/types/workspace/edit/ComponentPanel.d.ts +11 -0
  56. package/dist-lib/types/workspace/edit/DataPanel.d.ts +16 -0
  57. package/dist-lib/types/workspace/edit/DesignWorkspace.d.ts +10 -0
  58. package/dist-lib/types/workspace/edit/LayerTree.d.ts +14 -0
  59. package/dist-lib/types/workspace/edit/LayoutPanel.d.ts +13 -0
  60. package/dist-lib/types/workspace/edit/PrototypePanel.d.ts +12 -0
  61. package/dist-lib/types/workspace/edit/ScopeTransferDialog.d.ts +40 -0
  62. package/dist-lib/types/workspace/edit/SelectionHandles.d.ts +52 -0
  63. package/dist-lib/types/workspace/edit/StylesPanel.d.ts +8 -0
  64. package/dist-lib/types/workspace/edit/TextEditor.d.ts +50 -0
  65. package/dist-lib/types/workspace/edit/VectorEditor.d.ts +89 -0
  66. package/dist-lib/types/workspace/edit/VectorToolbar.d.ts +5 -0
  67. package/dist-lib/types/workspace/edit/canvasGuideModel.d.ts +102 -0
  68. package/dist-lib/types/workspace/edit/clipboard.d.ts +35 -0
  69. package/dist-lib/types/workspace/edit/duplicateMetadata.d.ts +2 -0
  70. package/dist-lib/types/workspace/edit/geometryHandles.d.ts +224 -0
  71. package/dist-lib/types/workspace/edit/layerArrangement.d.ts +39 -0
  72. package/dist-lib/types/workspace/edit/layerMoves.d.ts +44 -0
  73. package/dist-lib/types/workspace/edit/projection.d.ts +12 -0
  74. package/dist-lib/types/workspace/edit/scopeTransfer.d.ts +96 -0
  75. package/dist-lib/types/workspace/edit/textStyles.d.ts +75 -0
  76. package/dist-lib/types/workspace/edit/vectorTools.d.ts +136 -0
  77. package/dist-lib/types/workspace/legacyModeAdapter.d.ts +13 -0
  78. package/dist-lib/types/workspace/source/ResponsiveLayoutPanel.d.ts +20 -0
  79. package/dist-lib/types/workspace/source/SourceReview.d.ts +11 -0
  80. package/dist-lib/types/workspace/source/appearanceSource.d.ts +19 -0
  81. package/dist-lib/types/workspace/source/compiler.d.ts +5 -0
  82. package/dist-lib/types/workspace/source/contracts.d.ts +156 -0
  83. package/dist-lib/types/workspace/source/controller.d.ts +50 -0
  84. package/dist-lib/types/workspace/source/documentRevision.d.ts +2 -0
  85. package/dist-lib/types/workspace/source/draftPreviewClient.d.ts +13 -0
  86. package/dist-lib/types/workspace/source/draftRecipe.d.ts +30 -0
  87. package/dist-lib/types/workspace/source/flowContracts.d.ts +72 -0
  88. package/dist-lib/types/workspace/source/prototypeSource.d.ts +4 -0
  89. package/dist-lib/types/workspace/source/responsive.d.ts +13 -0
  90. package/dist-lib/types/workspace/source/responsiveContracts.d.ts +78 -0
  91. package/dist-lib/types/workspace/source/structure.d.ts +21 -0
  92. package/dist-lib/types/workspace/source/textSource.d.ts +28 -0
  93. package/dist-lib/types/workspace/tokens/TokenLibraryContext.d.ts +11 -0
  94. package/dist-lib/types/workspace/tokens/TokenLibraryWorkspace.d.ts +14 -0
  95. package/dist-lib/types/workspace/tokens/contracts.d.ts +74 -0
  96. package/dist-lib/types/workspace/tokens/controller.d.ts +44 -0
  97. package/dist-lib/types/workspace/view/PrototypePlayer.d.ts +17 -0
  98. package/dist-lib/types/workspace/view/StoryboardWorkspace.d.ts +3 -0
  99. package/dist-lib/types/workspace/view/prototypePlayback.d.ts +46 -0
  100. package/draft-preview.d.ts +54 -0
  101. package/inspect.d.ts +2 -0
  102. package/node/design-session.mjs +3 -0
  103. package/node/inspect-plugin.mjs +3 -1
  104. package/node/inspect-writeback.mjs +18 -2
  105. package/node/preview-artifact-store.mjs +10 -7
  106. package/node/source-archive.mjs +88 -0
  107. package/node/source-bindings.mjs +65 -0
  108. package/node/source-file-lock.mjs +15 -0
  109. package/node/source-file-plan.mjs +162 -0
  110. package/node/source-file-proofs.mjs +44 -0
  111. package/node/source-responsive-codec.d.mts +17 -0
  112. package/node/source-responsive-codec.mjs +133 -0
  113. package/node/source-responsive.mjs +189 -0
  114. package/node/source-structure-reconcile.mjs +186 -0
  115. package/node/source-structure-wrapper-codec.d.mts +20 -0
  116. package/node/source-structure-wrapper-codec.mjs +205 -0
  117. package/node/source-structure.mjs +404 -0
  118. package/node/token-source-references.mjs +136 -0
  119. package/node/workspace-draft-preview-plugin.mjs +70 -0
  120. package/node/workspace-draft-preview.mjs +231 -0
  121. package/node/workspace-source-identity.d.mts +1 -0
  122. package/node/workspace-source-identity.mjs +21 -0
  123. package/node/workspace-source-plan.mjs +195 -0
  124. package/package.json +52 -6
  125. package/source-files.d.ts +35 -0
  126. package/source-responsive.d.ts +10 -0
  127. package/source-structure.d.ts +155 -0
  128. package/workspace-source-plan.d.ts +44 -0
  129. package/docs/coverage-contracts.md +0 -431
  130. package/docs/screen-state-contract.md +0 -252
@@ -0,0 +1,25 @@
1
+ import type { BindingSourcePlan } from './dist-lib/types/binding/source.js';
2
+
3
+ export interface SourceBindingProofOptions {
4
+ sourceRevision: string;
5
+ files: ReadonlyMap<string, string> | Readonly<Record<string, string>>;
6
+ /** Explicit files the host permits this design operation to change. */
7
+ allowedFiles: readonly string[];
8
+ /** DTO/schema and other host-owned exclusions take precedence over allowed files. */
9
+ excludedSourcePrefixes?: readonly string[];
10
+ }
11
+
12
+ export interface SourceBindingProofDiagnostic {
13
+ severity: 'error';
14
+ code: 'binding-source-plan-invalid' | 'binding-source-policy-invalid' | 'binding-source-empty'
15
+ | 'binding-source-proof-invalid' | 'binding-source-file-excluded' | 'binding-source-file-missing'
16
+ | 'binding-source-stale' | 'binding-source-overlap' | 'binding-source-anchor-invalid';
17
+ message: string;
18
+ file?: string;
19
+ }
20
+
21
+ /** Verify evidence without writing source or accepting a literal-prop inspection payload. */
22
+ export declare function validateSourceBindingProofs(plan: BindingSourcePlan, options: SourceBindingProofOptions): {
23
+ valid: boolean;
24
+ diagnostics: SourceBindingProofDiagnostic[];
25
+ };
@@ -1,13 +1,13 @@
1
1
  import { jsx as p } from "react/jsx-runtime";
2
- import { a as C, R as P, at as g, bB as R, bC as b, C as E, bD as k, P as m, K as I } from "./runtime-DdYnT6k4.js";
2
+ import { j as g, R as C, aI as P, ce as R, cf as E, U as I, cg as k, a3 as m, a0 as b } from "./runtime-Dxb-IaLN.js";
3
3
  import { useRef as L, useLayoutEffect as h } from "react";
4
- function v(n) {
4
+ function f(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
8
  return r || k(n, e, i) ? void 0 : "none";
9
9
  }
10
- function f(n, e) {
10
+ function v(n, e) {
11
11
  return x(
12
12
  n.editMode,
13
13
  n.tool,
@@ -18,7 +18,7 @@ function f(n, e) {
18
18
  const l = /* @__PURE__ */ new WeakMap();
19
19
  function z(n, e, i, r) {
20
20
  if (e.route == null) return 0;
21
- const t = I(e) ?? e.route, a = e.width ?? 390, o = e.height ?? 600, c = n.declarations.getPreviewIdentityEpoch();
21
+ const t = b(e) ?? e.route, a = e.width ?? 390, o = e.height ?? 600, c = n.declarations.getPreviewIdentityEpoch();
22
22
  let s = l.get(e);
23
23
  (!s || s.revision !== i || s.epoch !== c || s.route !== t || s.width !== a || s.height !== o) && (s = {
24
24
  revision: i,
@@ -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 W(n) {
44
+ function B(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: E(t)
64
+ height: I(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
- b(t) || n.schedulers.previewIntent.hasPreviewIntent(t.id),
70
+ E(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,20 +77,20 @@ function w(n) {
77
77
  )
78
78
  }));
79
79
  }
80
- let B = 0;
81
- function $({
80
+ let O = 0;
81
+ function D({
82
82
  children: n,
83
83
  interactionFrameId: e = null
84
84
  }) {
85
- const i = C(), r = i.store, t = L(null);
85
+ const i = g(), r = i.store, t = L(null);
86
86
  return h(() => {
87
87
  const a = t.current;
88
88
  if (!a) return;
89
- const o = new P(`CameraLayer#${++B}`, () => {
89
+ const o = new C(`CameraLayer#${++O}`, () => {
90
90
  o.isDisposed || c();
91
91
  }), c = () => {
92
92
  o.track(() => {
93
- a.style.transform = v(r), a.style.pointerEvents = f(r, e) ?? "";
93
+ a.style.transform = f(r), a.style.pointerEvents = v(r, e) ?? "";
94
94
  });
95
95
  };
96
96
  return c(), () => o.dispose();
@@ -106,7 +106,7 @@ function $({
106
106
  // The live-screen budget follows the camera: the active frame first,
107
107
  // then the frames nearest the viewport take the remaining slots.
108
108
  onRecompute: ({ frames: o, camera: c, viewport: s }) => {
109
- const { liveScreens: d } = i.schedulers, { activeId: u, siblingIds: y, groupSize: S } = g(() => ({
109
+ const { liveScreens: d } = i.schedulers, { activeId: u, siblingIds: y, groupSize: S } = P(() => ({
110
110
  activeId: r.activePageId,
111
111
  siblingIds: r.activeScreenStateSiblingIds,
112
112
  groupSize: r.activeScreenStateGroup.length
@@ -142,18 +142,18 @@ function $({
142
142
  position: "absolute",
143
143
  left: 0,
144
144
  top: 0,
145
- transform: v(r),
145
+ transform: f(r),
146
146
  transformOrigin: "0 0",
147
147
  transition: "none",
148
148
  willChange: "transform",
149
- pointerEvents: f(r, e)
149
+ pointerEvents: v(r, e)
150
150
  },
151
151
  children: n
152
152
  }
153
153
  );
154
154
  }
155
155
  export {
156
- $ as CameraLayer,
157
- W as __debugReadEditorFrames,
156
+ D as CameraLayer,
157
+ B as __debugReadEditorFrames,
158
158
  x as resolveCameraPointerEvents
159
159
  };