@pygmalionjs/pygmalion 0.8.0 → 0.8.1
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/dist-lib/{CameraLayer-nkNrazn8.js → CameraLayer-B2D29VXQ.js} +1 -1
- package/dist-lib/pygmalion.js +3 -3
- package/dist-lib/{runtime-DdYnT6k4.js → runtime-BAy8W1mJ.js} +19 -8
- package/dist-lib/testing.js +2 -2
- package/dist-lib/types/editor/surfaceDemands.d.ts +3 -1
- package/docs/coverage-contracts.md +18 -5
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
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-BAy8W1mJ.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})`;
|
package/dist-lib/pygmalion.js
CHANGED
|
@@ -2,10 +2,10 @@ var Sl = Object.defineProperty;
|
|
|
2
2
|
var Nl = (t, e, n) => e in t ? Sl(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
3
|
var Zn = (t, e, n) => Nl(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
4
|
import { jsxs as u, jsx as s, Fragment as Ue } from "react/jsx-runtime";
|
|
5
|
-
import { u as $r, a as dt, i as Il, o as Ge, b as je, r as Cl, f as Pl, c as kl, d as $l, F as Rl, e as Ml, l as jo, g as qi, h as Xi, s as Ms, j as _o, k as Es, m as El, n as vo, p as Al, q as Fl, R as As, t as Tl, v as Ll, w as Dl, x as Ol, y as zl, S as jl, z as _l, L as Bo, A as Ji, B as Bl, C as zn, D as Hl, E as Fs, G as Ts, M as Yr, H as Wl, I as Zi, J as yo, K as Gn, N as Ir, O as jn, P as Yn, Q as es, T as Vl, U as Kl, V as Yl, W as Qi, X as Ls, Y as Gl, Z as ts, _ as ns, $ as Cr, a0 as Ul, a1 as ql, a2 as ea, a3 as Xl, a4 as Jl, a5 as Zl, a6 as Ql, a7 as ec, a8 as tc, a9 as nc, aa as rc, ab as oc, ac as ta, ad as sc, ae as Ds, af as ic, ag as Os, ah as ac, ai as zs, aj as lc, ak as cc, al as dc, am as uc, an as na, ao as fc, ap as pc, aq as hc, ar as ra, as as mc, at as wo, au as js, av as gc, aw as bc, ax as xc, ay as _s, az as So, aA as vc, aB as yc, aC as wc, aD as Ho, aE as rs, aF as Sc, aG as Qr, aH as Nc, aI as Ic, aJ as Cc, aK as Pc, aL as Bs, aM as kc, aN as $c, aO as Rc, aP as Mc } from "./runtime-
|
|
6
|
-
import { aQ as wm, aR as Sm, aS as Nm, aT as Im, aU as Cm, aV as Pm, aW as km, aX as $m, aY as Rm, aZ as Mm, a_ as Em, a$ as Am, b0 as Fm, b1 as Tm, b2 as Lm, b3 as Dm, b4 as Om, b5 as zm, b6 as jm, b7 as _m, b8 as Bm, b9 as Hm, ba as Wm, bb as Vm, bc as Km, bd as Ym, be as Gm, bf as Um, bg as qm, bh as Xm, bi as Jm, bj as Zm, bk as Qm, bl as eg, bm as tg, bn as ng, bo as rg, bp as og, bq as sg, br as ig, bs as ag, bt as lg, bu as cg, bv as dg, bw as ug, bx as fg } from "./runtime-
|
|
5
|
+
import { u as $r, a as dt, i as Il, o as Ge, b as je, r as Cl, f as Pl, c as kl, d as $l, F as Rl, e as Ml, l as jo, g as qi, h as Xi, s as Ms, j as _o, k as Es, m as El, n as vo, p as Al, q as Fl, R as As, t as Tl, v as Ll, w as Dl, x as Ol, y as zl, S as jl, z as _l, L as Bo, A as Ji, B as Bl, C as zn, D as Hl, E as Fs, G as Ts, M as Yr, H as Wl, I as Zi, J as yo, K as Gn, N as Ir, O as jn, P as Yn, Q as es, T as Vl, U as Kl, V as Yl, W as Qi, X as Ls, Y as Gl, Z as ts, _ as ns, $ as Cr, a0 as Ul, a1 as ql, a2 as ea, a3 as Xl, a4 as Jl, a5 as Zl, a6 as Ql, a7 as ec, a8 as tc, a9 as nc, aa as rc, ab as oc, ac as ta, ad as sc, ae as Ds, af as ic, ag as Os, ah as ac, ai as zs, aj as lc, ak as cc, al as dc, am as uc, an as na, ao as fc, ap as pc, aq as hc, ar as ra, as as mc, at as wo, au as js, av as gc, aw as bc, ax as xc, ay as _s, az as So, aA as vc, aB as yc, aC as wc, aD as Ho, aE as rs, aF as Sc, aG as Qr, aH as Nc, aI as Ic, aJ as Cc, aK as Pc, aL as Bs, aM as kc, aN as $c, aO as Rc, aP as Mc } from "./runtime-BAy8W1mJ.js";
|
|
6
|
+
import { aQ as wm, aR as Sm, aS as Nm, aT as Im, aU as Cm, aV as Pm, aW as km, aX as $m, aY as Rm, aZ as Mm, a_ as Em, a$ as Am, b0 as Fm, b1 as Tm, b2 as Lm, b3 as Dm, b4 as Om, b5 as zm, b6 as jm, b7 as _m, b8 as Bm, b9 as Hm, ba as Wm, bb as Vm, bc as Km, bd as Ym, be as Gm, bf as Um, bg as qm, bh as Xm, bi as Jm, bj as Zm, bk as Qm, bl as eg, bm as tg, bn as ng, bo as rg, bp as og, bq as sg, br as ig, bs as ag, bt as lg, bu as cg, bv as dg, bw as ug, bx as fg } from "./runtime-BAy8W1mJ.js";
|
|
7
7
|
import { useSyncExternalStore as et, useCallback as Ht, useRef as Ae, useState as Y, useEffect as q, useReducer as oa, useMemo as xt, memo as sa, createElement as Pr, useLayoutEffect as dr, useContext as Ec } from "react";
|
|
8
|
-
import { CameraLayer as Ac } from "./CameraLayer-
|
|
8
|
+
import { CameraLayer as Ac } from "./CameraLayer-B2D29VXQ.js";
|
|
9
9
|
import { createPortal as ia } from "react-dom";
|
|
10
10
|
import { resolveRoutePreviewArtifactStatus as Fc, resolveStaticRoutePreviewSurface as Tc } from "./routePreviewStatus-DTr-UJhV.js";
|
|
11
11
|
function gn(t) {
|
|
@@ -11962,7 +11962,7 @@ function Jy(t) {
|
|
|
11962
11962
|
});
|
|
11963
11963
|
};
|
|
11964
11964
|
for (const l of t.declaredScreens) {
|
|
11965
|
-
const d = l.coverageRoutes ?? [], f = typeof l.componentName == "string" && l.componentName.length > 0 ? l.componentName : null;
|
|
11965
|
+
const d = l.coverageRoutes ?? [], f = typeof l.componentName == "string" && l.componentName.trim().length > 0 ? l.componentName : null, h = typeof l.route == "string" && l.route.trim().length > 0 ? _s(l.route) : null;
|
|
11966
11966
|
if (f != null && e && !e.has(f)) {
|
|
11967
11967
|
n.push({
|
|
11968
11968
|
severity: "error",
|
|
@@ -11973,7 +11973,7 @@ function Jy(t) {
|
|
|
11973
11973
|
});
|
|
11974
11974
|
continue;
|
|
11975
11975
|
}
|
|
11976
|
-
const
|
|
11976
|
+
const y = f != null ? "fixture" : "mapping", g = /* @__PURE__ */ new Set();
|
|
11977
11977
|
for (const m of d) {
|
|
11978
11978
|
if (typeof m != "string" || m.trim().length === 0) {
|
|
11979
11979
|
n.push({
|
|
@@ -11997,12 +11997,23 @@ function Jy(t) {
|
|
|
11997
11997
|
});
|
|
11998
11998
|
continue;
|
|
11999
11999
|
}
|
|
12000
|
-
|
|
12000
|
+
if (!g.has(S.path)) {
|
|
12001
|
+
if (g.add(S.path), f == null && h == null) {
|
|
12002
|
+
n.push({
|
|
12003
|
+
severity: "error",
|
|
12004
|
+
code: "missing-render-source",
|
|
12005
|
+
screenId: l.id,
|
|
12006
|
+
route: m,
|
|
12007
|
+
message: `Screen ${l.id} maps route ${m} but has no preview route or component fixture. Supply a nonempty route or a registered component before claiming representation.`
|
|
12008
|
+
});
|
|
12009
|
+
continue;
|
|
12010
|
+
}
|
|
12011
|
+
u(S, l, y);
|
|
12012
|
+
}
|
|
12001
12013
|
}
|
|
12002
|
-
if (
|
|
12003
|
-
|
|
12004
|
-
|
|
12005
|
-
y.has(m.path) || Yy(m.path, g) && (y.add(m.path), u(m, l, "preview"));
|
|
12014
|
+
if (h != null)
|
|
12015
|
+
for (const m of r)
|
|
12016
|
+
g.has(m.path) || Yy(m.path, h) && (g.add(m.path), u(m, l, "preview"));
|
|
12006
12017
|
}
|
|
12007
12018
|
return { candidates: r.filter((l) => !a.has(l.path)).map((l) => ({
|
|
12008
12019
|
kind: "route",
|
|
@@ -19433,7 +19444,7 @@ function gw(t) {
|
|
|
19433
19444
|
stamped: u ? i.isStampedFrozenPreview(u.root) : null
|
|
19434
19445
|
},
|
|
19435
19446
|
lodState: a.__debugFrameLodState(),
|
|
19436
|
-
readFramesNow: (await import("./CameraLayer-
|
|
19447
|
+
readFramesNow: (await import("./CameraLayer-B2D29VXQ.js")).__debugReadEditorFrames(t).find((h) => h.id === n)
|
|
19437
19448
|
};
|
|
19438
19449
|
},
|
|
19439
19450
|
/** Flow-session delivery states for headless diagnosis of the captureless supply. */
|
package/dist-lib/testing.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bh as l, aE as u } from "./runtime-
|
|
2
|
-
import { aN as b, by as w, bz as E, bA as P, aJ as $, ad as q } from "./runtime-
|
|
1
|
+
import { bh as l, aE as u } from "./runtime-BAy8W1mJ.js";
|
|
2
|
+
import { aN as b, by as w, bz as E, bA as P, aJ as $, ad as q } from "./runtime-BAy8W1mJ.js";
|
|
3
3
|
const v = {
|
|
4
4
|
mirror: ["status", "refresh", "refs"],
|
|
5
5
|
session: ["open", "check", "previewVisual", "applyVisual", "revertVisual"],
|
|
@@ -200,8 +200,10 @@ export interface RouteRepresentation {
|
|
|
200
200
|
* - `unregistered-component` — the screen's `componentName` is not among
|
|
201
201
|
* `registeredComponents`: its fixture registration is gone.
|
|
202
202
|
* - `empty-mapping` — a `coverageRoutes` entry is blank.
|
|
203
|
+
* - `missing-render-source` — a mapped screen has neither a nonempty preview
|
|
204
|
+
* route nor a component fixture to render.
|
|
203
205
|
*/
|
|
204
|
-
export type RouteCoverageDiagnosticCode = 'unknown-route' | 'unregistered-component' | 'empty-mapping';
|
|
206
|
+
export type RouteCoverageDiagnosticCode = 'unknown-route' | 'unregistered-component' | 'empty-mapping' | 'missing-render-source';
|
|
205
207
|
export interface RouteCoverageDiagnostic {
|
|
206
208
|
severity: 'error';
|
|
207
209
|
code: RouteCoverageDiagnosticCode;
|
|
@@ -9,11 +9,12 @@ merges:
|
|
|
9
9
|
2. **Classification.** Is every user scenario verified exactly once, and by
|
|
10
10
|
which declaration?
|
|
11
11
|
|
|
12
|
-
They are different questions with different answers. A preview URL
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
They are different questions with different answers. A declared preview URL
|
|
13
|
+
identifies where a screen should render; these static checks do not execute
|
|
14
|
+
that screen or verify a user interaction. A scenario claim identifies the
|
|
15
|
+
declaration responsible for a scenario; it says nothing about routes nobody
|
|
16
|
+
declared. The package answers each with its own functions, and a green answer
|
|
17
|
+
to one never stands in for the other.
|
|
17
18
|
|
|
18
19
|
Everything here runs in plain Node: no DOM, no Vite server, no editor mount,
|
|
19
20
|
no network. The functions are pure; they take declarations and return
|
|
@@ -127,6 +128,18 @@ mapping that names something missing must never keep covering.
|
|
|
127
128
|
| `unknown-route` | A `coverageRoutes` entry matches no discovered route; it was removed or renamed | `screenId`, `route`, `componentName?` |
|
|
128
129
|
| `unregistered-component` | The screen's `componentName` is not among `registeredComponents` | `screenId`, `componentName` |
|
|
129
130
|
| `empty-mapping` | A `coverageRoutes` entry is blank | `screenId`, `route` |
|
|
131
|
+
| `missing-render-source` | A mapping has no nonempty preview route or component fixture | `screenId`, `route` |
|
|
132
|
+
|
|
133
|
+
Starting in 0.8.1, `coverageRoutes` alone never represents a route. A mapped
|
|
134
|
+
screen must also supply a nonempty preview `route` or a component fixture.
|
|
135
|
+
Empty or whitespace-only preview routes do not implicitly represent `/`.
|
|
136
|
+
Pass `registeredComponents` to check that every named fixture is registered.
|
|
137
|
+
|
|
138
|
+
A mapping without a render source produces `missing-render-source` and adds
|
|
139
|
+
no representation. If no other valid screen represents that source route, it
|
|
140
|
+
stays among the candidates. If another screen does represent it, the invalid
|
|
141
|
+
mapping still produces a diagnostic: a gate must inspect both `diagnostics`
|
|
142
|
+
and the candidates' verdicts, even when `candidates` is empty.
|
|
130
143
|
|
|
131
144
|
`enumerateRouteCandidates(input)` returns `audit.candidates` alone, for a
|
|
132
145
|
caller that only needs the holes.
|