@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.
- package/binding-source.d.ts +25 -0
- package/dist-lib/{CameraLayer-nkNrazn8.js → CameraLayer-BdOko8XE.js} +17 -17
- package/dist-lib/pygmalion.js +24599 -12746
- package/dist-lib/{runtime-DdYnT6k4.js → runtime-Dxb-IaLN.js} +12427 -11116
- package/dist-lib/style.css +1 -1
- package/dist-lib/testing.js +10 -10
- package/dist-lib/types/binding/catalog.d.ts +10 -0
- package/dist-lib/types/binding/contracts.d.ts +202 -0
- package/dist-lib/types/binding/documentCommands.d.ts +38 -0
- package/dist-lib/types/binding/index.d.ts +6 -0
- package/dist-lib/types/binding/preview.d.ts +37 -0
- package/dist-lib/types/binding/source.d.ts +109 -0
- package/dist-lib/types/binding/useDataProjection.d.ts +9 -0
- package/dist-lib/types/binding/validate.d.ts +8 -0
- package/dist-lib/types/core/runtime.d.ts +6 -0
- package/dist-lib/types/document/appearance.d.ts +112 -0
- package/dist-lib/types/document/assets.d.ts +204 -0
- package/dist-lib/types/document/components.d.ts +169 -0
- package/dist-lib/types/document/contracts.d.ts +171 -0
- package/dist-lib/types/document/engine.d.ts +20 -0
- package/dist-lib/types/document/exportSettings.d.ts +45 -0
- package/dist-lib/types/document/geometry.d.ts +11 -0
- package/dist-lib/types/document/layout.d.ts +53 -0
- package/dist-lib/types/document/prototype.d.ts +424 -0
- package/dist-lib/types/document/prototypeReferences.d.ts +3 -0
- package/dist-lib/types/document/richText.d.ts +185 -0
- package/dist-lib/types/document/styles.d.ts +216 -0
- package/dist-lib/types/document/svgImport.d.ts +17 -0
- package/dist-lib/types/document/vector.d.ts +222 -0
- package/dist-lib/types/editor/designCompiler.d.ts +7 -0
- package/dist-lib/types/editor/designImport.d.ts +7 -0
- package/dist-lib/types/editor/inspect.d.ts +8 -0
- package/dist-lib/types/editor/revisionCatalogInstall.d.ts +1 -1
- package/dist-lib/types/editor/screenInteractions.d.ts +3 -3
- package/dist-lib/types/editor/store.d.ts +1 -1
- package/dist-lib/types/editor/surfaceDemands.d.ts +3 -1
- package/dist-lib/types/host/project.d.ts +44 -0
- package/dist-lib/types/host/registryConnections.d.ts +11 -0
- package/dist-lib/types/host/sourceFilePlan.d.ts +15 -0
- package/dist-lib/types/host/sourceWriteback.d.ts +50 -0
- package/dist-lib/types/lib.d.ts +101 -3
- package/dist-lib/types/token-library/bindings.d.ts +62 -0
- package/dist-lib/types/token-library/contracts.d.ts +117 -0
- package/dist-lib/types/token-library/engine.d.ts +13 -0
- package/dist-lib/types/workspace/WorkspaceShell.d.ts +9 -0
- package/dist-lib/types/workspace/application/ApplicationWorkspace.d.ts +3 -0
- package/dist-lib/types/workspace/configuration.d.ts +39 -0
- package/dist-lib/types/workspace/contracts.d.ts +64 -0
- package/dist-lib/types/workspace/controller.d.ts +35 -0
- package/dist-lib/types/workspace/documentSessions.d.ts +42 -0
- package/dist-lib/types/workspace/edit/AppearancePanel.d.ts +23 -0
- package/dist-lib/types/workspace/edit/ArrangeLayers.d.ts +10 -0
- package/dist-lib/types/workspace/edit/AssetsPanel.d.ts +16 -0
- package/dist-lib/types/workspace/edit/CanvasGuides.d.ts +19 -0
- package/dist-lib/types/workspace/edit/ComponentPanel.d.ts +11 -0
- package/dist-lib/types/workspace/edit/DataPanel.d.ts +16 -0
- package/dist-lib/types/workspace/edit/DesignWorkspace.d.ts +10 -0
- package/dist-lib/types/workspace/edit/LayerTree.d.ts +14 -0
- package/dist-lib/types/workspace/edit/LayoutPanel.d.ts +13 -0
- package/dist-lib/types/workspace/edit/PrototypePanel.d.ts +12 -0
- package/dist-lib/types/workspace/edit/ScopeTransferDialog.d.ts +40 -0
- package/dist-lib/types/workspace/edit/SelectionHandles.d.ts +52 -0
- package/dist-lib/types/workspace/edit/StylesPanel.d.ts +8 -0
- package/dist-lib/types/workspace/edit/TextEditor.d.ts +50 -0
- package/dist-lib/types/workspace/edit/VectorEditor.d.ts +89 -0
- package/dist-lib/types/workspace/edit/VectorToolbar.d.ts +5 -0
- package/dist-lib/types/workspace/edit/canvasGuideModel.d.ts +102 -0
- package/dist-lib/types/workspace/edit/clipboard.d.ts +35 -0
- package/dist-lib/types/workspace/edit/duplicateMetadata.d.ts +2 -0
- package/dist-lib/types/workspace/edit/geometryHandles.d.ts +224 -0
- package/dist-lib/types/workspace/edit/layerArrangement.d.ts +39 -0
- package/dist-lib/types/workspace/edit/layerMoves.d.ts +44 -0
- package/dist-lib/types/workspace/edit/projection.d.ts +12 -0
- package/dist-lib/types/workspace/edit/scopeTransfer.d.ts +96 -0
- package/dist-lib/types/workspace/edit/textStyles.d.ts +75 -0
- package/dist-lib/types/workspace/edit/vectorTools.d.ts +136 -0
- package/dist-lib/types/workspace/legacyModeAdapter.d.ts +13 -0
- package/dist-lib/types/workspace/source/ResponsiveLayoutPanel.d.ts +20 -0
- package/dist-lib/types/workspace/source/SourceReview.d.ts +11 -0
- package/dist-lib/types/workspace/source/appearanceSource.d.ts +19 -0
- package/dist-lib/types/workspace/source/compiler.d.ts +5 -0
- package/dist-lib/types/workspace/source/contracts.d.ts +156 -0
- package/dist-lib/types/workspace/source/controller.d.ts +50 -0
- package/dist-lib/types/workspace/source/documentRevision.d.ts +2 -0
- package/dist-lib/types/workspace/source/draftPreviewClient.d.ts +13 -0
- package/dist-lib/types/workspace/source/draftRecipe.d.ts +30 -0
- package/dist-lib/types/workspace/source/flowContracts.d.ts +72 -0
- package/dist-lib/types/workspace/source/prototypeSource.d.ts +4 -0
- package/dist-lib/types/workspace/source/responsive.d.ts +13 -0
- package/dist-lib/types/workspace/source/responsiveContracts.d.ts +78 -0
- package/dist-lib/types/workspace/source/structure.d.ts +21 -0
- package/dist-lib/types/workspace/source/textSource.d.ts +28 -0
- package/dist-lib/types/workspace/tokens/TokenLibraryContext.d.ts +11 -0
- package/dist-lib/types/workspace/tokens/TokenLibraryWorkspace.d.ts +14 -0
- package/dist-lib/types/workspace/tokens/contracts.d.ts +74 -0
- package/dist-lib/types/workspace/tokens/controller.d.ts +44 -0
- package/dist-lib/types/workspace/view/PrototypePlayer.d.ts +17 -0
- package/dist-lib/types/workspace/view/StoryboardWorkspace.d.ts +3 -0
- package/dist-lib/types/workspace/view/prototypePlayback.d.ts +46 -0
- package/draft-preview.d.ts +54 -0
- package/inspect.d.ts +2 -0
- package/node/design-session.mjs +3 -0
- package/node/inspect-plugin.mjs +3 -1
- package/node/inspect-writeback.mjs +18 -2
- package/node/preview-artifact-store.mjs +10 -7
- package/node/source-archive.mjs +88 -0
- package/node/source-bindings.mjs +65 -0
- package/node/source-file-lock.mjs +15 -0
- package/node/source-file-plan.mjs +162 -0
- package/node/source-file-proofs.mjs +44 -0
- package/node/source-responsive-codec.d.mts +17 -0
- package/node/source-responsive-codec.mjs +133 -0
- package/node/source-responsive.mjs +189 -0
- package/node/source-structure-reconcile.mjs +186 -0
- package/node/source-structure-wrapper-codec.d.mts +20 -0
- package/node/source-structure-wrapper-codec.mjs +205 -0
- package/node/source-structure.mjs +404 -0
- package/node/token-source-references.mjs +136 -0
- package/node/workspace-draft-preview-plugin.mjs +70 -0
- package/node/workspace-draft-preview.mjs +231 -0
- package/node/workspace-source-identity.d.mts +1 -0
- package/node/workspace-source-identity.mjs +21 -0
- package/node/workspace-source-plan.mjs +195 -0
- package/package.json +52 -6
- package/source-files.d.ts +35 -0
- package/source-responsive.d.ts +10 -0
- package/source-structure.d.ts +155 -0
- package/workspace-source-plan.d.ts +44 -0
- package/docs/coverage-contracts.md +0 -431
- 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 {
|
|
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
|
|
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
|
|
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 =
|
|
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
|
|
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:
|
|
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
|
-
|
|
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
|
|
81
|
-
function
|
|
80
|
+
let O = 0;
|
|
81
|
+
function D({
|
|
82
82
|
children: n,
|
|
83
83
|
interactionFrameId: e = null
|
|
84
84
|
}) {
|
|
85
|
-
const i =
|
|
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
|
|
89
|
+
const o = new C(`CameraLayer#${++O}`, () => {
|
|
90
90
|
o.isDisposed || c();
|
|
91
91
|
}), c = () => {
|
|
92
92
|
o.track(() => {
|
|
93
|
-
a.style.transform =
|
|
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 } =
|
|
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:
|
|
145
|
+
transform: f(r),
|
|
146
146
|
transformOrigin: "0 0",
|
|
147
147
|
transition: "none",
|
|
148
148
|
willChange: "transform",
|
|
149
|
-
pointerEvents:
|
|
149
|
+
pointerEvents: v(r, e)
|
|
150
150
|
},
|
|
151
151
|
children: n
|
|
152
152
|
}
|
|
153
153
|
);
|
|
154
154
|
}
|
|
155
155
|
export {
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
D as CameraLayer,
|
|
157
|
+
B as __debugReadEditorFrames,
|
|
158
158
|
x as resolveCameraPointerEvents
|
|
159
159
|
};
|