@pygmalionjs/pygmalion 0.6.20 → 0.6.22

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/README.md CHANGED
@@ -82,6 +82,22 @@ export default defineConfig({
82
82
  });
83
83
  ```
84
84
 
85
+ Frameworks that expose webpack loaders through a JavaScript-only pipeline can
86
+ ask the inspect loader to strip TypeScript after source instrumentation. A
87
+ Turbopack rule should set `transpile: true` while keeping the original file
88
+ extension, so relative TSX module resolution keeps the host's source identity:
89
+
90
+ ```ts
91
+ {
92
+ './src/**/*.tsx': {
93
+ loaders: [{
94
+ loader: require.resolve('@pygmalionjs/pygmalion/webpack-loader'),
95
+ options: { root: process.cwd(), sourceDirectory: 'src', transpile: true },
96
+ }],
97
+ },
98
+ }
99
+ ```
100
+
85
101
  When the mirror preview reloads the host Vite configuration,
86
102
  `PYGMALION_PREVIEW_MODE=1` prevents the integration plugins from starting
87
103
  recursively.
@@ -229,6 +245,33 @@ parameter, a motion preview, or behavior-only QA. Rendered CSS and Web
229
245
  Animations targets are automatically available in the right-panel Motion
230
246
  controls with play, pause, reset, target isolation, and phase scrubbing.
231
247
 
248
+ ### Keep product routes separate from preview entry routes
249
+
250
+ Authentication and fixture gateways belong to the host application. When a
251
+ screen needs one, keep `route` as the canonical product address and declare the
252
+ routed gateway as `previewRoute`:
253
+
254
+ ```ts
255
+ {
256
+ id: 'screen:account-security',
257
+ name: 'Account security',
258
+ section: 'Account',
259
+ route: '/account/security',
260
+ previewRoute: '/__preview__/account/security',
261
+ }
262
+ ```
263
+
264
+ Pygmalion boots, captures, caches, and interacts through `previewRoute`, while
265
+ inventory, coverage, and source identity continue to use `route`. The gateway
266
+ should be development-only, keep credentials out of URLs and client manifests,
267
+ and render or redirect to the real routed screen rather than a separately
268
+ assembled component fixture. Changing the gateway invalidates that frame's
269
+ preview cache automatically.
270
+
271
+ Declared `screenFlows` support the same split. Put the canonical starting
272
+ address in `route` and the host gateway in `previewRoute`; the flow boots the
273
+ gateway and still reports the canonical route to capture preparation.
274
+
232
275
  Keep user journeys explicit instead of relying only on source navigation
233
276
  inference. Paths expand into adjacent graph edges, and source-discovered edges
234
277
  are still merged underneath them:
@@ -1611,10 +1611,10 @@ function uu(t, e, n) {
1611
1611
  if (d = !1, !g.isDisposed) {
1612
1612
  var m = !1, S = f;
1613
1613
  g.track(function() {
1614
- var y = Vc(!1, function() {
1614
+ var _ = Vc(!1, function() {
1615
1615
  return t(g);
1616
1616
  });
1617
- m = l || !h(f, y), f = y;
1617
+ m = l || !h(f, _), f = _;
1618
1618
  }), (l && n.fireImmediately || !l && m) && a(f, S, g), l = !1;
1619
1619
  }
1620
1620
  }
@@ -1721,9 +1721,9 @@ var bu = 0, yu = /* @__PURE__ */ (function(t) {
1721
1721
  } catch (x) {
1722
1722
  return p(x);
1723
1723
  }
1724
- _(A);
1724
+ y(A);
1725
1725
  }
1726
- function y(O) {
1726
+ function _(O) {
1727
1727
  f = void 0;
1728
1728
  var A;
1729
1729
  try {
@@ -1731,14 +1731,14 @@ var bu = 0, yu = /* @__PURE__ */ (function(t) {
1731
1731
  } catch (x) {
1732
1732
  return p(x);
1733
1733
  }
1734
- _(A);
1734
+ y(A);
1735
1735
  }
1736
- function _(O) {
1736
+ function y(O) {
1737
1737
  if ($(O == null ? void 0 : O.then)) {
1738
- O.then(_, p);
1738
+ O.then(y, p);
1739
1739
  return;
1740
1740
  }
1741
- return O.done ? g(O.value) : (f = Promise.resolve(O.value), f.then(S, y));
1741
+ return O.done ? g(O.value) : (f = Promise.resolve(O.value), f.then(S, _));
1742
1742
  }
1743
1743
  S(void 0);
1744
1744
  });
@@ -2355,10 +2355,10 @@ var Pu = {}, De = "add", dn = "delete", os = /* @__PURE__ */ (function() {
2355
2355
  }
2356
2356
  }
2357
2357
  for (var h = ct(o.entries()), g; !(g = h()).done; ) {
2358
- var p = g.value, m = p[0], S = p[1], y = i.data_.has(m);
2358
+ var p = g.value, m = p[0], S = p[1], _ = i.data_.has(m);
2359
2359
  if (i.set(m, S), i.data_.has(m)) {
2360
- var _ = i.data_.get(m);
2361
- s.set(m, _), y || (a = !0);
2360
+ var y = i.data_.get(m);
2361
+ s.set(m, y), _ || (a = !0);
2362
2362
  }
2363
2363
  }
2364
2364
  if (!a)
@@ -3275,16 +3275,16 @@ function Ju() {
3275
3275
  m = s({
3276
3276
  inst: { value: p, getSnapshot: g }
3277
3277
  });
3278
- var S = m[0].inst, y = m[1];
3278
+ var S = m[0].inst, _ = m[1];
3279
3279
  return c(
3280
3280
  function() {
3281
- S.value = p, S.getSnapshot = g, n(S) && y({ inst: S });
3281
+ S.value = p, S.getSnapshot = g, n(S) && _({ inst: S });
3282
3282
  },
3283
3283
  [h, p, g]
3284
3284
  ), a(
3285
3285
  function() {
3286
- return n(S) && y({ inst: S }), h(function() {
3287
- n(S) && y({ inst: S });
3286
+ return n(S) && _({ inst: S }), h(function() {
3287
+ n(S) && _({ inst: S });
3288
3288
  });
3289
3289
  },
3290
3290
  [h]
@@ -4810,7 +4810,7 @@ function qi(t, e = {}) {
4810
4810
  Math.min(i, c)
4811
4811
  );
4812
4812
  if (o.length > 1) {
4813
- const p = o.map((S) => S.width).sort((S, y) => y - S), m = p[0] + n + p[1];
4813
+ const p = o.map((S) => S.width).sort((S, _) => _ - S), m = p[0] + n + p[1];
4814
4814
  m <= i && (u = Math.max(u, m));
4815
4815
  }
4816
4816
  const l = [];
@@ -4871,9 +4871,9 @@ function Jl(t, e = {}) {
4871
4871
  };
4872
4872
  S += x.width + n;
4873
4873
  }
4874
- const y = Math.max(1, g * p), _ = g / Math.max(1, p), O = Math.abs(
4875
- Math.log(_ / r)
4876
- ), A = Math.max(0, 1 - a / y);
4874
+ const _ = Math.max(1, g * p), y = g / Math.max(1, p), O = Math.abs(
4875
+ Math.log(y / r)
4876
+ ), A = Math.max(0, 1 - a / _);
4877
4877
  c.push({
4878
4878
  frames: m,
4879
4879
  width: g,
@@ -5530,7 +5530,7 @@ function Kp(t, e) {
5530
5530
  }
5531
5531
  for (const [p, m] of Object.entries(f.props)) {
5532
5532
  const S = (o = h.props) == null ? void 0 : o[p];
5533
- (!S || !S.some((y) => Object.is(y, m))) && n.push({
5533
+ (!S || !S.some((_) => Object.is(_, m))) && n.push({
5534
5534
  severity: "error",
5535
5535
  cardId: s.id,
5536
5536
  message: `option "${f.label}" sets ${p}=${JSON.stringify(m)} outside the adapter's vocabulary`
@@ -6108,8 +6108,8 @@ function qs(t, e, n, r, i, o, s) {
6108
6108
  sourceProps: Sr(
6109
6109
  t.getAttribute("data-pygmalion-own-props")
6110
6110
  )
6111
- }, y = p != null && g === "expand" && ((V = o.collapseInstance) == null ? void 0 : V.call(o, p)) === !0 && !Yd(t, o) && Gd(t, p) && !qd(t);
6112
- if (p && (g === "collapse" || y))
6111
+ }, _ = p != null && g === "expand" && ((V = o.collapseInstance) == null ? void 0 : V.call(o, p)) === !0 && !Yd(t, o) && Gd(t, p) && !qd(t);
6112
+ if (p && (g === "collapse" || _))
6113
6113
  return Gt("component", {
6114
6114
  name: p.name,
6115
6115
  componentName: p.name,
@@ -6121,10 +6121,10 @@ function qs(t, e, n, r, i, o, s) {
6121
6121
  ...S,
6122
6122
  ...Qi(f, e, l.display, h)
6123
6123
  });
6124
- const _ = Ud(t, u, p == null ? void 0 : p.name);
6124
+ const y = Ud(t, u, p == null ? void 0 : p.name);
6125
6125
  if (Rd.has(u) && (o.mediaMode ?? "placeholder") === "placeholder")
6126
6126
  return Gt("rows", {
6127
- name: _,
6127
+ name: y,
6128
6128
  widthMode: "fixed",
6129
6129
  width: Math.max(4, Math.round(f.width / h)),
6130
6130
  heightMode: "fixed",
@@ -6140,7 +6140,7 @@ function qs(t, e, n, r, i, o, s) {
6140
6140
  const O = l.display === "flex" || l.display === "inline-flex", A = O && l.flexDirection.startsWith("row") ? "columns" : "rows", x = Ae(A === "columns" ? l.columnGap : l.rowGap), P = Math.round(
6141
6141
  (Ae(l.paddingTop) + Ae(l.paddingRight) + Ae(l.paddingBottom) + Ae(l.paddingLeft)) / 4
6142
6142
  ), D = Ae(l.borderTopWidth), k = Gt(A, {
6143
- name: _,
6143
+ name: y,
6144
6144
  ...Qi(f, e, l.display, h),
6145
6145
  gap: Number.isFinite(x) ? x : 0,
6146
6146
  padding: P,
@@ -7058,12 +7058,12 @@ function _f(t, e, n = {}) {
7058
7058
  for (const p of e)
7059
7059
  for (const m of t.pages) {
7060
7060
  if (((l = n.include) == null ? void 0 : l.call(n, m, p)) === !1) continue;
7061
- const S = (d = n.transformPage) == null ? void 0 : d.call(n, m, p), y = ((f = n.createPageId) == null ? void 0 : f.call(n, m, p)) ?? `${m.id}:viewport:${p.id}`, _ = ((h = n.createPageName) == null ? void 0 : h.call(n, m, p)) ?? `${m.name} · ${p.label}`, O = ((g = n.createSection) == null ? void 0 : g.call(n, m, p)) ?? `${m.section} · ${p.label}`;
7061
+ const S = (d = n.transformPage) == null ? void 0 : d.call(n, m, p), _ = ((f = n.createPageId) == null ? void 0 : f.call(n, m, p)) ?? `${m.id}:viewport:${p.id}`, y = ((h = n.createPageName) == null ? void 0 : h.call(n, m, p)) ?? `${m.name} · ${p.label}`, O = ((g = n.createSection) == null ? void 0 : g.call(n, m, p)) ?? `${m.section} · ${p.label}`;
7062
7062
  i.push({
7063
7063
  ...m,
7064
7064
  ...S,
7065
- id: y,
7066
- name: _,
7065
+ id: _,
7066
+ name: y,
7067
7067
  section: O,
7068
7068
  width: Math.round(p.width),
7069
7069
  height: Math.round(p.height),
@@ -7076,7 +7076,7 @@ function _f(t, e, n = {}) {
7076
7076
  id: `${A.id}:viewport:${p.id}`,
7077
7077
  name: `${A.name} · ${p.label}`,
7078
7078
  section: O,
7079
- pageId: y
7079
+ pageId: _
7080
7080
  });
7081
7081
  }
7082
7082
  const s = i.map((p) => p.id), a = o.map((p) => p.id), c = Le(s), u = Le(a);
@@ -7103,76 +7103,76 @@ function Sf({
7103
7103
  captureRequirements: i
7104
7104
  }) {
7105
7105
  var S;
7106
- const o = t.map((y) => {
7107
- var _, O;
7106
+ const o = t.map((_) => {
7107
+ var y, O;
7108
7108
  return {
7109
- ...y,
7110
- preset: r != null && r.preset || y.preset ? oa(r == null ? void 0 : r.preset, y.preset) : void 0,
7111
- assertions: (_ = r == null ? void 0 : r.assertions) != null && _.length || (O = y.assertions) != null && O.length ? [
7109
+ ..._,
7110
+ preset: r != null && r.preset || _.preset ? oa(r == null ? void 0 : r.preset, _.preset) : void 0,
7111
+ assertions: (y = r == null ? void 0 : r.assertions) != null && y.length || (O = _.assertions) != null && O.length ? [
7112
7112
  ...((r == null ? void 0 : r.assertions) ?? []).map(lo),
7113
- ...(y.assertions ?? []).map(lo)
7113
+ ...(_.assertions ?? []).map(lo)
7114
7114
  ] : void 0
7115
7115
  };
7116
- }), s = e.map((y) => y.id), a = new Set(s), c = o.map((y) => y.id), u = [
7117
- ...Le(s).map((y) => `Duplicate scenario ID:${y}`),
7118
- ...Le(c).map((y) => `Duplicate screen case IDs:${y}`)
7116
+ }), s = e.map((_) => _.id), a = new Set(s), c = o.map((_) => _.id), u = [
7117
+ ...Le(s).map((_) => `Duplicate scenario ID:${_}`),
7118
+ ...Le(c).map((_) => `Duplicate screen case IDs:${_}`)
7119
7119
  ], l = /* @__PURE__ */ new Map();
7120
- for (const y of o) {
7121
- i != null && i.preset && !y.preset && u.push(`screen "${y.id}"There are no required presets.`), i != null && i.assertions && !((S = y.assertions) != null && S.length) && u.push(`screen "${y.id}" is missing a required assertion.`);
7122
- for (const _ of y.scenarioIds ?? []) {
7123
- if (!a.has(_)) {
7124
- u.push(`screen "${y.id}"Scenario without${_}see`);
7120
+ for (const _ of o) {
7121
+ i != null && i.preset && !_.preset && u.push(`screen "${_.id}"There are no required presets.`), i != null && i.assertions && !((S = _.assertions) != null && S.length) && u.push(`screen "${_.id}" is missing a required assertion.`);
7122
+ for (const y of _.scenarioIds ?? []) {
7123
+ if (!a.has(y)) {
7124
+ u.push(`screen "${_.id}"Scenario without${y}see`);
7125
7125
  continue;
7126
7126
  }
7127
- const O = l.get(_);
7127
+ const O = l.get(y);
7128
7128
  if (O) {
7129
- u.push(`scenario${_}Go to screen "${O}", "${y.id}"Duplicate classification in`);
7129
+ u.push(`scenario${y}Go to screen "${O}", "${_.id}"Duplicate classification in`);
7130
7130
  continue;
7131
7131
  }
7132
- l.set(_, y.id);
7132
+ l.set(y, _.id);
7133
7133
  }
7134
7134
  }
7135
7135
  const d = /* @__PURE__ */ new Set();
7136
- for (const y of n) {
7137
- if (!a.has(y.id)) {
7138
- u.push(`Scenario without non-visual classification${y.id}see`);
7136
+ for (const _ of n) {
7137
+ if (!a.has(_.id)) {
7138
+ u.push(`Scenario without non-visual classification${_.id}see`);
7139
7139
  continue;
7140
7140
  }
7141
- if (l.has(y.id)) {
7142
- u.push(`scenario${y.id}Overlapping classification of visual and non-visual actions`);
7141
+ if (l.has(_.id)) {
7142
+ u.push(`scenario${_.id}Overlapping classification of visual and non-visual actions`);
7143
7143
  continue;
7144
7144
  }
7145
- if (d.has(y.id)) {
7146
- u.push(`scenario${y.id}Non-visual classification overlap of`);
7145
+ if (d.has(_.id)) {
7146
+ u.push(`scenario${_.id}Non-visual classification overlap of`);
7147
7147
  continue;
7148
7148
  }
7149
- d.add(y.id);
7149
+ d.add(_.id);
7150
7150
  }
7151
- const f = s.filter((y) => !l.has(y) && !d.has(y));
7151
+ const f = s.filter((_) => !l.has(_) && !d.has(_));
7152
7152
  if (f.length && u.push(`Unclassified Scenario:${f.join(", ")}`), u.length)
7153
7153
  throw new Error(`[Pygmalion] Screens scenario classification error${u.join(`
7154
7154
  `)}`);
7155
- const h = new Map(e.map((y) => [y.id, y])), g = o.map((y) => ({
7156
- id: `state:${y.id}`,
7157
- name: y.name,
7158
- section: y.section,
7159
- pageId: y.id,
7160
- sourcePath: y.sourcePath,
7161
- codeName: y.codeName ?? y.state,
7162
- flow: y.flow,
7163
- scenarioId: y.scenarioId,
7164
- description: [y.scenario, y.state].filter(Boolean).join(" · ")
7165
- })), p = [...l.entries()].map(([y, _]) => {
7166
- const O = h.get(y);
7155
+ const h = new Map(e.map((_) => [_.id, _])), g = o.map((_) => ({
7156
+ id: `state:${_.id}`,
7157
+ name: _.name,
7158
+ section: _.section,
7159
+ pageId: _.id,
7160
+ sourcePath: _.sourcePath,
7161
+ codeName: _.codeName ?? _.state,
7162
+ flow: _.flow,
7163
+ scenarioId: _.scenarioId,
7164
+ description: [_.scenario, _.state].filter(Boolean).join(" · ")
7165
+ })), p = [...l.entries()].map(([_, y]) => {
7166
+ const O = h.get(_);
7167
7167
  return {
7168
- id: `scenario:${y}`,
7169
- name: O.name ?? y,
7168
+ id: `scenario:${_}`,
7169
+ name: O.name ?? _,
7170
7170
  section: O.section,
7171
- pageId: _,
7171
+ pageId: y,
7172
7172
  sourcePath: O.sourcePath,
7173
7173
  codeName: O.codeName,
7174
7174
  flow: O.flow,
7175
- scenarioId: y,
7175
+ scenarioId: _,
7176
7176
  description: O.description
7177
7177
  };
7178
7178
  }), m = [...g, ...p];
@@ -7185,8 +7185,8 @@ function Sf({
7185
7185
  // and no canonical id look uncovered.
7186
7186
  pages: o.map(
7187
7187
  ({
7188
- sourcePath: y,
7189
- codeName: _,
7188
+ sourcePath: _,
7189
+ codeName: y,
7190
7190
  coverageRoutes: O,
7191
7191
  ...A
7192
7192
  }) => A
@@ -7382,17 +7382,17 @@ function Nf(t, e = {}) {
7382
7382
  var h, g, p;
7383
7383
  const l = [], d = [], f = [];
7384
7384
  for (const m of ot) {
7385
- const S = t.collections[m], y = new Set(S.pages.map((_) => _.id));
7386
- d.push(...S.assets.map((_) => `${m}:${_.id}`)), f.push(...S.pages.map((_) => `${m}:${_.id}`)), S.assets.length !== S.expectedCount && l.push(`${m}: expected ${S.expectedCount}, imported ${S.assets.length}`);
7387
- for (const _ of S.assets)
7388
- y.has(_.pageId) || l.push(`${m}:${_.id}: unknown pageId ${_.pageId}`);
7389
- for (const _ of S.pages) {
7390
- m === "screens" && ((h = _.interactions) != null && h.length || (g = _.assertions) != null && g.length || _.preset) && !_.route && l.push(`${m}:${_.id}: capture contract requires a route preview`), _.preset && !vn(_.preset) && l.push(`${m}:${_.id}: preset must contain only finite JSON-serializable data`), _.environment && !vn(_.environment) && l.push(`${m}:${_.id}: environment must contain only finite JSON-serializable data`);
7391
- for (const O of _.assertions ?? [])
7392
- O.selector.trim() || l.push(`${m}:${_.id}: assertion selector is required`), O.label.trim() || l.push(`${m}:${_.id}: assertion label is required`), O.attribute && !O.attribute.name.trim() && l.push(`${m}:${_.id}: assertion attribute name is required`);
7393
- !_.route && !_.componentName && !((p = _.gallery) != null && p.length) && l.push(`${m}:${_.id}: componentName, gallery, or route is required`), _.frameSizeMode != null && _.frameSizeMode !== "fixed" && _.frameSizeMode !== "content" && l.push(`${m}:${_.id}: frameSizeMode must be fixed or content`), _.heightMode != null && _.heightMode !== "fixed" && _.heightMode !== "document" && l.push(`${m}:${_.id}: heightMode must be fixed or document`), _.maxHeight != null && (!Number.isFinite(_.maxHeight) || _.maxHeight <= 0) && l.push(`${m}:${_.id}: maxHeight must be a positive finite number`), _.componentName && !n[_.componentName] && l.push(`${m}:${_.id}: missing registry component ${_.componentName}`);
7394
- for (const O of _.gallery ?? [])
7395
- n[O] || l.push(`${m}:${_.id}: missing gallery component ${O}`);
7385
+ const S = t.collections[m], _ = new Set(S.pages.map((y) => y.id));
7386
+ d.push(...S.assets.map((y) => `${m}:${y.id}`)), f.push(...S.pages.map((y) => `${m}:${y.id}`)), S.assets.length !== S.expectedCount && l.push(`${m}: expected ${S.expectedCount}, imported ${S.assets.length}`);
7387
+ for (const y of S.assets)
7388
+ _.has(y.pageId) || l.push(`${m}:${y.id}: unknown pageId ${y.pageId}`);
7389
+ for (const y of S.pages) {
7390
+ m === "screens" && ((h = y.interactions) != null && h.length || (g = y.assertions) != null && g.length || y.preset) && !y.route && l.push(`${m}:${y.id}: capture contract requires a route preview`), y.previewRoute != null && ((typeof y.previewRoute != "string" || !y.previewRoute.trim()) && l.push(`${m}:${y.id}: previewRoute must be a non-empty route`), y.route || l.push(`${m}:${y.id}: previewRoute requires a canonical route`)), y.preset && !vn(y.preset) && l.push(`${m}:${y.id}: preset must contain only finite JSON-serializable data`), y.environment && !vn(y.environment) && l.push(`${m}:${y.id}: environment must contain only finite JSON-serializable data`);
7391
+ for (const O of y.assertions ?? [])
7392
+ O.selector.trim() || l.push(`${m}:${y.id}: assertion selector is required`), O.label.trim() || l.push(`${m}:${y.id}: assertion label is required`), O.attribute && !O.attribute.name.trim() && l.push(`${m}:${y.id}: assertion attribute name is required`);
7393
+ !y.route && !y.componentName && !((p = y.gallery) != null && p.length) && l.push(`${m}:${y.id}: componentName, gallery, or route is required`), y.frameSizeMode != null && y.frameSizeMode !== "fixed" && y.frameSizeMode !== "content" && l.push(`${m}:${y.id}: frameSizeMode must be fixed or content`), y.heightMode != null && y.heightMode !== "fixed" && y.heightMode !== "document" && l.push(`${m}:${y.id}: heightMode must be fixed or document`), y.maxHeight != null && (!Number.isFinite(y.maxHeight) || y.maxHeight <= 0) && l.push(`${m}:${y.id}: maxHeight must be a positive finite number`), y.componentName && !n[y.componentName] && l.push(`${m}:${y.id}: missing registry component ${y.componentName}`);
7394
+ for (const O of y.gallery ?? [])
7395
+ n[O] || l.push(`${m}:${y.id}: missing gallery component ${O}`);
7396
7396
  }
7397
7397
  }
7398
7398
  for (const m of Le(d)) l.push(`duplicate asset id ${m}`);
@@ -7403,7 +7403,7 @@ ${l.join(`
7403
7403
  };
7404
7404
  c();
7405
7405
  const u = async (l, d, f) => {
7406
- var y, _, O;
7406
+ var _, y, O;
7407
7407
  const h = [];
7408
7408
  let g = !d.preset;
7409
7409
  if (d.preset)
@@ -7435,7 +7435,7 @@ ${l.join(`
7435
7435
  message: `An error occurred while applying the screen preset:${String(A).slice(0, 160)}`
7436
7436
  });
7437
7437
  }
7438
- let p = wf(((y = d.interactions) == null ? void 0 : y.length) ?? 0), m = Of(((_ = d.assertions) == null ? void 0 : _.length) ?? 0);
7438
+ let p = wf(((_ = d.interactions) == null ? void 0 : _.length) ?? 0), m = Of(((y = d.assertions) == null ? void 0 : y.length) ?? 0);
7439
7439
  h.length === 0 && ((O = f == null ? void 0 : f.onBeforeInteractions) == null || O.call(f), p = await Nr(
7440
7440
  l,
7441
7441
  d.interactions ?? [],
@@ -7476,6 +7476,7 @@ ${l.join(`
7476
7476
  componentName: d.componentName,
7477
7477
  gallery: d.gallery ? [...d.gallery] : void 0,
7478
7478
  route: d.route,
7479
+ previewRoute: d.previewRoute,
7479
7480
  path: d.path,
7480
7481
  publish: d.publish,
7481
7482
  width: d.width,
@@ -7538,17 +7539,17 @@ ${l.join(`
7538
7539
  return null;
7539
7540
  }
7540
7541
  if (!(m != null && m.body) || !S) return null;
7541
- const y = Date.now();
7542
- let _ = Date.now(), O = m.body.querySelectorAll("*").length;
7542
+ const _ = Date.now();
7543
+ let y = Date.now(), O = m.body.querySelectorAll("*").length;
7543
7544
  const A = S.MutationObserver, x = new A(() => {
7544
- _ = Date.now(), O = m.body.querySelectorAll("*").length;
7545
+ y = Date.now(), O = m.body.querySelectorAll("*").length;
7545
7546
  });
7546
7547
  x.observe(m.body, { childList: !0, subtree: !0, attributes: !0, characterData: !0 });
7547
7548
  try {
7548
7549
  await new Promise((D) => {
7549
7550
  const k = () => {
7550
7551
  const z = Date.now(), V = m.body.querySelectorAll("*").length;
7551
- if (V !== O && (O = V, _ = z), V >= g && z - _ >= f || z - y >= h) {
7552
+ if (V !== O && (O = V, y = z), V >= g && z - y >= f || z - _ >= h) {
7552
7553
  D();
7553
7554
  return;
7554
7555
  }
@@ -7658,11 +7659,11 @@ function Rf(t) {
7658
7659
  if (!g) continue;
7659
7660
  const p = If(g);
7660
7661
  if (!p) continue;
7661
- const m = (p.x - s.x) / r - f.x, S = (p.y - s.y) / r - f.y, y = p.width / r - f.width, _ = p.height / r - f.height, O = Math.max(
7662
+ const m = (p.x - s.x) / r - f.x, S = (p.y - s.y) / r - f.y, _ = p.width / r - f.width, y = p.height / r - f.height, O = Math.max(
7662
7663
  Math.abs(m),
7663
7664
  Math.abs(S),
7664
- Math.abs(y),
7665
- Math.abs(_)
7665
+ Math.abs(_),
7666
+ Math.abs(y)
7666
7667
  );
7667
7668
  a += 1, !(O <= Pf) && (c = Math.max(c, O), u.push({
7668
7669
  nodeId: h.id,
@@ -7682,8 +7683,8 @@ function Rf(t) {
7682
7683
  },
7683
7684
  dx: Math.round(m),
7684
7685
  dy: Math.round(S),
7685
- dwidth: Math.round(y),
7686
- dheight: Math.round(_),
7686
+ dwidth: Math.round(_),
7687
+ dheight: Math.round(y),
7687
7688
  drift: Math.round(O)
7688
7689
  }));
7689
7690
  }
@@ -8992,6 +8993,7 @@ ${e}`;
8992
8993
  canvas: s.canvas,
8993
8994
  section: s.section,
8994
8995
  route: s.route,
8996
+ previewRoute: s.previewRoute,
8995
8997
  path: s.path,
8996
8998
  publish: s.publish ?? s.route == null,
8997
8999
  importLayers: s.importLayers,
@@ -10624,7 +10626,7 @@ function Vh({
10624
10626
  }), c = yt(() => {
10625
10627
  }), u = yt(i);
10626
10628
  u.current = i;
10627
- const l = yt(0), [d, f] = or([]), [h, g] = or("none"), p = ir.frozenPreviewOverrideCss(t), m = ir.frozenPreviewCssRules(), S = ir.frozenPreviewMutations(), y = JSON.stringify({ cssRules: m, mutations: S }), _ = () => {
10629
+ const l = yt(0), [d, f] = or([]), [h, g] = or("none"), p = ir.frozenPreviewOverrideCss(t), m = ir.frozenPreviewCssRules(), S = ir.frozenPreviewMutations(), _ = JSON.stringify({ cssRules: m, mutations: S }), y = () => {
10628
10630
  var vt, Ce;
10629
10631
  const O = (vt = s.current) == null ? void 0 : vt.contentDocument;
10630
10632
  if (!(O != null && O.head)) return;
@@ -10757,9 +10759,9 @@ function Vh({
10757
10759
  (N) => JSON.stringify(N) === JSON.stringify(V) ? N : V
10758
10760
  ), o == null || o(V);
10759
10761
  };
10760
- return di(() => (_(), () => {
10762
+ return di(() => (y(), () => {
10761
10763
  l.current += 1, a.current();
10762
- }), [p, e, y]), di(
10764
+ }), [p, e, _]), di(
10763
10765
  () => () => {
10764
10766
  c.current();
10765
10767
  },
@@ -10781,7 +10783,7 @@ function Vh({
10781
10783
  className: "block border-0 bg-white",
10782
10784
  style: { width: "100%", height: n, pointerEvents: "none" },
10783
10785
  onLoad: () => {
10784
- _();
10786
+ y();
10785
10787
  const O = s.current;
10786
10788
  if (!O) return;
10787
10789
  c.current();