@pygmalionjs/pygmalion 0.6.11 → 0.6.12

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.
@@ -8615,14 +8615,15 @@ class Dh {
8615
8615
  ${e}`;
8616
8616
  }
8617
8617
  /**
8618
- * Declared state variants sharing a scenario on one canvas, in declaration
8619
- * order. Folding never crosses canvases: a scenario that also names a
8620
- * screen on another canvas (a flow's entry point, say) keeps that screen
8621
- * as a normal frame there otherwise a canvas could fold down to nothing.
8618
+ * Declared state variants sharing a scenario on one canvas and in the
8619
+ * current runtime, in declaration order. Folding never crosses either
8620
+ * boundary: a state from another canvas or runtime is not an alternate the
8621
+ * reader can reveal here, and letting it hold the slot can fold the current
8622
+ * runtime down to nothing.
8622
8623
  */
8623
8624
  screenStateGroup(e, n) {
8624
8625
  return this.pages.filter(
8625
- (r) => r.scenario === e && (r.canvas ?? "default") === n && r.route != null && r.importLayers === !0
8626
+ (r) => r.scenario === e && (r.canvas ?? "default") === n && r.route != null && r.importLayers === !0 && this.isInSelectedRuntime(r)
8626
8627
  );
8627
8628
  }
8628
8629
  /** The group member holding the group's canvas slot, or null for non-groups. */
@@ -2,8 +2,8 @@ var dm = Object.defineProperty;
2
2
  var um = (e, t, n) => t in e ? dm(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var vn = (e, t, n) => um(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import { jsx as a, jsxs as g, Fragment as He } from "react/jsx-runtime";
5
- import { R as hi, u as fm, b as hm, c as Ya, d as Gd, g as ut, f as mm, m as Dt, e as f, h as Lt, r as hn, i as Ws, j as er, k as Ga, l as In, n as Xd, o as Ir, p as pm, q as Yn, t as We, v as gm, w as bm, x as xm, y as vm, z as ym, A as wm, B as Sm, C as Hs, D as Nm, E as Im, G as Cm, H as Pm, I as $m, J as Mm, S as Em, K as km, L as Jd, M as Am, O as Us, P as Rm, Q as Tm, T as Fm, U as Lm, V as _m, W as sl, X as al, Y as Qd, Z as Zd, _ as zm, $ as cl, a0 as Dm, a1 as eu, a2 as Om, a3 as jm, a4 as Bm, a5 as Wm, a6 as Hm, a7 as Um, a8 as tu, a9 as Vm, aa as Km, ab as ee, ac as ll, ad as dl, ae as qm, af as ps, ag as Ym, ah as Qo, ai as Vs, aj as Gm, ak as nu, al as Xm, am as Jm, an as Qm, s as Zm, ao as ep, ap as ru, aq as mi, ar as tp, as as np, at as ou, au as iu, av as Ks, aw as su, ax as rp, ay as op, az as ul, aA as ip, aB as sp, aC as fl, aD as ap, aE as cp, aF as lp, aG as dp, aH as gs, aI as up, aJ as fp, aK as hp, aL as mp, aM as pp, aN as gp, aO as bp, aP as xp, a as vp, aQ as yp, aR as wp, aS as Sp, aT as Np, aU as Ip, aV as Cp, aW as Pp, aX as $p, aY as Mp, aZ as Ep, a_ as kp, a$ as Ap, b0 as Rp, b1 as qr, b2 as hl, b3 as Tp, b4 as Fp, b5 as Lp, b6 as _p, b7 as ml } from "./FrozenRoutePreview-CPnB5j1D.js";
6
- import { b8 as mN, b9 as pN, ba as gN, bb as bN, bc as xN, bd as vN, be as yN, bf as wN, bg as SN, bh as NN, bi as IN, bj as CN, bk as PN, bl as $N, bm as MN, bn as EN, bo as kN } from "./FrozenRoutePreview-CPnB5j1D.js";
5
+ import { R as hi, u as fm, b as hm, c as Ya, d as Gd, g as ut, f as mm, m as Dt, e as f, h as Lt, r as hn, i as Ws, j as er, k as Ga, l as In, n as Xd, o as Ir, p as pm, q as Yn, t as We, v as gm, w as bm, x as xm, y as vm, z as ym, A as wm, B as Sm, C as Hs, D as Nm, E as Im, G as Cm, H as Pm, I as $m, J as Mm, S as Em, K as km, L as Jd, M as Am, O as Us, P as Rm, Q as Tm, T as Fm, U as Lm, V as _m, W as sl, X as al, Y as Qd, Z as Zd, _ as zm, $ as cl, a0 as Dm, a1 as eu, a2 as Om, a3 as jm, a4 as Bm, a5 as Wm, a6 as Hm, a7 as Um, a8 as tu, a9 as Vm, aa as Km, ab as ee, ac as ll, ad as dl, ae as qm, af as ps, ag as Ym, ah as Qo, ai as Vs, aj as Gm, ak as nu, al as Xm, am as Jm, an as Qm, s as Zm, ao as ep, ap as ru, aq as mi, ar as tp, as as np, at as ou, au as iu, av as Ks, aw as su, ax as rp, ay as op, az as ul, aA as ip, aB as sp, aC as fl, aD as ap, aE as cp, aF as lp, aG as dp, aH as gs, aI as up, aJ as fp, aK as hp, aL as mp, aM as pp, aN as gp, aO as bp, aP as xp, a as vp, aQ as yp, aR as wp, aS as Sp, aT as Np, aU as Ip, aV as Cp, aW as Pp, aX as $p, aY as Mp, aZ as Ep, a_ as kp, a$ as Ap, b0 as Rp, b1 as qr, b2 as hl, b3 as Tp, b4 as Fp, b5 as Lp, b6 as _p, b7 as ml } from "./FrozenRoutePreview-CGxN_gIm.js";
6
+ import { b8 as mN, b9 as pN, ba as gN, bb as bN, bc as xN, bd as vN, be as yN, bf as wN, bg as SN, bh as NN, bi as IN, bj as CN, bk as PN, bl as $N, bm as MN, bn as EN, bo as kN } from "./FrozenRoutePreview-CGxN_gIm.js";
7
7
  import { useRef as ke, useLayoutEffect as Cr, useSyncExternalStore as qe, useCallback as kt, useReducer as au, useEffect as ie, memo as cu, createElement as ho, useState as Q, useMemo as wt } from "react";
8
8
  import { createPortal as zp } from "react-dom";
9
9
  const Xa = {
@@ -3295,14 +3295,14 @@ function Zi(e = {}) {
3295
3295
  }
3296
3296
  async function k(_, D) {
3297
3297
  if (e.prepare) return e.prepare(_, D);
3298
- const { getDesignImportController: j } = await import("./FrozenRoutePreview-CPnB5j1D.js").then((I) => I.bq), C = j();
3298
+ const { getDesignImportController: j } = await import("./FrozenRoutePreview-CGxN_gIm.js").then((I) => I.bq), C = j();
3299
3299
  if (!C)
3300
3300
  throw new Error("The design import controller is not available.");
3301
3301
  return C.prepareScreenCapture(_, D);
3302
3302
  }
3303
3303
  async function L(_, D) {
3304
3304
  if (e.settle) return e.settle(_, D);
3305
- const { settleScreen: j } = await import("./FrozenRoutePreview-CPnB5j1D.js").then((C) => C.bp);
3305
+ const { settleScreen: j } = await import("./FrozenRoutePreview-CGxN_gIm.js").then((C) => C.bp);
3306
3306
  return j(_, D);
3307
3307
  }
3308
3308
  async function P(_, D) {
@@ -14758,12 +14758,17 @@ function Mh({
14758
14758
  declared: t,
14759
14759
  active: n = !1
14760
14760
  }) {
14761
- return t === 0 ? null : /* @__PURE__ */ a(
14761
+ if (t === 0) return null;
14762
+ const r = Math.max(0, t - e), o = t === 1 ? "page" : "pages", s = r ? `${t} ${o}. ${e} are on the canvas; ${r} alternate ${r === 1 ? "state is" : "states are"} available in the right panel.` : void 0;
14763
+ return /* @__PURE__ */ a(
14762
14764
  "span",
14763
14765
  {
14766
+ "data-frame-count": t,
14767
+ "data-folded-state-count": r || void 0,
14768
+ "aria-label": s ?? `${t} ${o}`,
14764
14769
  className: `shrink-0 rounded-full px-1.5 py-0.5 text-[9px] tabular-nums ${n ? "bg-white/80 text-[#1b64da]" : "bg-[#f2f4f6] text-[#8b95a1]"}`,
14765
- title: e === t ? void 0 : `${t - e} more in this lane, held back by a screen state`,
14766
- children: e === t ? e : `${e}/${t}`
14770
+ title: s,
14771
+ children: t
14767
14772
  }
14768
14773
  );
14769
14774
  }
@@ -15459,8 +15464,9 @@ const wd = We(function({
15459
15464
  page: t
15460
15465
  }) {
15461
15466
  if (!t.scenario || t.route == null) return null;
15462
- const n = f.pages.filter(
15463
- (i) => i.route != null && i.importLayers === !0 && i.scenario === t.scenario
15467
+ const n = f.screenStateGroup(
15468
+ t.scenario,
15469
+ t.canvas ?? "default"
15464
15470
  );
15465
15471
  if (n.length < 2) return null;
15466
15472
  const r = n[0], o = n.length === 2 && r.stateKind == null && n[1].stateKind != null ? n[1] : null;
@@ -21206,8 +21212,8 @@ const aN = {
21206
21212
  Promise.resolve().then(() => ga),
21207
21213
  Promise.resolve().then(() => Ib),
21208
21214
  Promise.resolve().then(() => Zp),
21209
- import("./FrozenRoutePreview-CPnB5j1D.js").then((u) => u.bs),
21210
- import("./FrozenRoutePreview-CPnB5j1D.js").then((u) => u.br)
21215
+ import("./FrozenRoutePreview-CGxN_gIm.js").then((u) => u.bs),
21216
+ import("./FrozenRoutePreview-CGxN_gIm.js").then((u) => u.br)
21211
21217
  ]), s = i.getMountedShadowPreviewHandle(e), c = f.pages.find(
21212
21218
  (u) => u.id === e
21213
21219
  );
@@ -1,4 +1,4 @@
1
- import { F as s, N as a, e as r, s as i, a as t } from "./FrozenRoutePreview-CPnB5j1D.js";
1
+ import { F as s, N as a, e as r, s as i, a as t } from "./FrozenRoutePreview-CGxN_gIm.js";
2
2
  export {
3
3
  s as FrozenRoutePreviewView,
4
4
  a as NodeModel,
@@ -351,10 +351,11 @@ export declare class EditorStore {
351
351
  private screenStateSelections;
352
352
  private screenStateSlotKey;
353
353
  /**
354
- * Declared state variants sharing a scenario on one canvas, in declaration
355
- * order. Folding never crosses canvases: a scenario that also names a
356
- * screen on another canvas (a flow's entry point, say) keeps that screen
357
- * as a normal frame there otherwise a canvas could fold down to nothing.
354
+ * Declared state variants sharing a scenario on one canvas and in the
355
+ * current runtime, in declaration order. Folding never crosses either
356
+ * boundary: a state from another canvas or runtime is not an alternate the
357
+ * reader can reveal here, and letting it hold the slot can fold the current
358
+ * runtime down to nothing.
358
359
  */
359
360
  screenStateGroup(scenario: string, canvas: string): PageModel[];
360
361
  /** The group member holding the group's canvas slot, or null for non-groups. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pygmalionjs/pygmalion",
3
- "version": "0.6.11",
3
+ "version": "0.6.12",
4
4
  "description": "Code-backed DOM design sandbox and visual QA editor",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {