waygraph 0.12.15 → 0.12.16

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
@@ -235,7 +235,8 @@ snapshot, partitions edges by hash, and claims via in-process edge leases (audit
235
235
  `docs/proposals/traverse-ffcompose-rfc.md`.
236
236
 
237
237
  **Richer demo narration:** automation rings are **gray**; authored stubs/slides can use
238
- `tone: "info" | "warning" | "danger" | "success"` (iconified captions). Episode pacing:
238
+ `tone: "info" | "warning" | "danger" | "success"` (iconified captions), plus
239
+ `size: "sm" | "md" | "lg"` and `weight: "normal" | "bold"`. Episode pacing:
239
240
  `withDemoPace(flow, "fast" | "slow" | "normal" | "blitz")` or `withBlockPace(block, ...)`
240
241
  (FFCompose stays blitz). Living objectives: `docs/proposals/OBJECTIVES.md`.
241
242
  `spawnTab(entry, page, mem)` drives a genuinely separate second tab through its own
package/dist/cli.js CHANGED
@@ -213,6 +213,8 @@ import {
213
213
  hasAuthoredStubOnError,
214
214
  normalizeHighlightTone,
215
215
  normalizeDemoPace,
216
+ normalizeHighlightSize,
217
+ normalizeHighlightWeight,
216
218
  resolveStepDemoPace,
217
219
  } from "waygraph";
218
220
 
@@ -425,6 +427,13 @@ const RING_CSS =
425
427
  "#wg-ring-label[data-tone=warning]{background:#EAB308;color:#1c1917;}" +
426
428
  "#wg-ring-label[data-tone=danger]{background:#DC2626;color:#fff;}" +
427
429
  "#wg-ring-label[data-tone=success]{background:#16A34A;color:#fff;}" +
430
+ // size: ring pad + label font; weight: label boldness
431
+ "#wg-ring[data-size=sm]{border-width:1.5px;border-radius:8px;}" +
432
+ "#wg-ring[data-size=lg]{border-width:4px;border-radius:12px;}" +
433
+ "#wg-ring-label[data-size=sm]{font-size:10px;line-height:1.25;padding:4px 7px;border-radius:5px;}" +
434
+ "#wg-ring-label[data-size=lg]{font-size:16px;line-height:1.35;padding:8px 14px;border-radius:9px;max-width:min(480px,85vw);}" +
435
+ "#wg-ring-label[data-weight=bold]{font-weight:800;}" +
436
+ "#wg-ring-label[data-weight=normal]{font-weight:600;}" +
428
437
  // Mouse cursor icon that travels to a target before it's acted on, plus a
429
438
  // quick expanding ripple at the moment of a click - same idea as
430
439
  // help-center-clip-engine's #clip-cursor/#clip-ring (video-pipeline). The
@@ -662,7 +671,7 @@ async function installOverlay(page, title) {
662
671
  const cursor = document.getElementById("wg-cursor");
663
672
  if (cursor) cursor.style.opacity = "0";
664
673
  };
665
- window.__wgPositionRing = (box, label, tone) => {
674
+ window.__wgPositionRing = (box, label, tone, style) => {
666
675
  const ring = document.getElementById("wg-ring");
667
676
  const ringLabel = document.getElementById("wg-ring-label");
668
677
  if (!ring || !ringLabel) return;
@@ -671,15 +680,25 @@ async function installOverlay(page, title) {
671
680
  raw === "auto" || raw === "info" || raw === "warning" || raw === "danger" || raw === "success"
672
681
  ? raw
673
682
  : "planned";
683
+ const st = style && typeof style === "object" ? style : {};
684
+ const sizeRaw = (st.size || "md") + "";
685
+ const size =
686
+ sizeRaw === "sm" || sizeRaw === "lg" ? sizeRaw : "md";
687
+ const weightRaw = (st.weight || "normal") + "";
688
+ const weight = weightRaw === "bold" ? "bold" : "normal";
674
689
  ring.dataset.tone = t;
675
690
  ringLabel.dataset.tone = t;
691
+ ring.dataset.size = size;
692
+ ringLabel.dataset.size = size;
693
+ ringLabel.dataset.weight = weight;
694
+ const pad = size === "sm" ? 3 : size === "lg" ? 10 : 6;
676
695
  const margin = 6;
677
696
  const vw = window.innerWidth;
678
697
  const vh = window.innerHeight;
679
- let left = box.x - 6;
680
- let top = box.y - 6;
681
- const width = box.width + 12;
682
- const height = box.height + 12;
698
+ let left = box.x - pad;
699
+ let top = box.y - pad;
700
+ const width = box.width + pad * 2;
701
+ const height = box.height + pad * 2;
683
702
  if (left < margin) left = margin;
684
703
  if (top < margin) top = margin;
685
704
  if (left + width > vw - margin) left = Math.max(margin, vw - margin - width);
@@ -1058,7 +1077,10 @@ async function cycleHighlightRings(page, highlights, gatesFast, opts) {
1058
1077
  try {
1059
1078
  const box = await page.locator(h.selector).first().boundingBox();
1060
1079
  if (box) {
1061
- await showRing(page, box, h.label, h.tone || "planned");
1080
+ await showRing(page, box, h.label, h.tone || "planned", {
1081
+ size: h.size,
1082
+ weight: h.weight,
1083
+ });
1062
1084
  const authored = resolveFixtureDwellMs(h, { gatesFast });
1063
1085
  const legacyMs = i === list.length - 1 ? 200 : 900;
1064
1086
  const holdMs =
@@ -1080,7 +1102,10 @@ async function cycleHighlightRings(page, highlights, gatesFast, opts) {
1080
1102
  if (window.__wgHideRing) window.__wgHideRing();
1081
1103
  return;
1082
1104
  }
1083
- window.__wgPositionRing(el.getBoundingClientRect(), h.label, h.tone || "planned");
1105
+ window.__wgPositionRing(el.getBoundingClientRect(), h.label, h.tone || "planned", {
1106
+ size: h.size || "md",
1107
+ weight: h.weight || "normal",
1108
+ });
1084
1109
  };
1085
1110
  reposition();
1086
1111
  window.__wgRingTrack = reposition;
@@ -1425,13 +1450,17 @@ async function markStepRunning(page, _opts) {
1425
1450
  .catch(() => {});
1426
1451
  }
1427
1452
 
1428
- async function showRing(page, box, label, tone) {
1453
+ async function showRing(page, box, label, tone, style) {
1454
+ const size = normalizeHighlightSize(style && style.size);
1455
+ const weight = normalizeHighlightWeight(style && style.weight);
1429
1456
  await page
1430
1457
  .evaluate(
1431
- ({ box, label, tone }) => {
1432
- if (window.__wgPositionRing) window.__wgPositionRing(box, label, tone || "planned");
1458
+ ({ box, label, tone, size, weight }) => {
1459
+ if (window.__wgPositionRing) {
1460
+ window.__wgPositionRing(box, label, tone || "planned", { size, weight });
1461
+ }
1433
1462
  },
1434
- { box, label, tone: tone || "planned" },
1463
+ { box, label, tone: tone || "planned", size, weight },
1435
1464
  )
1436
1465
  .catch(() => {});
1437
1466
  }
@@ -1465,9 +1494,11 @@ async function captionForLocator(page, locator, stubs, fallback) {
1465
1494
  return {
1466
1495
  label: formatHighlightCaption(matched),
1467
1496
  tone: normalizeHighlightTone(matched.tone),
1497
+ size: normalizeHighlightSize(matched.size),
1498
+ weight: normalizeHighlightWeight(matched.weight),
1468
1499
  };
1469
1500
  }
1470
- return { label: fallback, tone: "auto" };
1501
+ return { label: fallback, tone: "auto", size: "md", weight: "normal" };
1471
1502
  }
1472
1503
 
1473
1504
  async function dwellMatchedStub(page, locator, stubs, pacing) {
@@ -1510,13 +1541,17 @@ async function presentSlides(page, slides, _gate, opts) {
1510
1541
  const s = slides[i];
1511
1542
  const caption = formatHighlightCaption(s);
1512
1543
  const slideTone = normalizeHighlightTone(s.tone);
1544
+ const slideStyle = {
1545
+ size: normalizeHighlightSize(s.size),
1546
+ weight: normalizeHighlightWeight(s.weight),
1547
+ };
1513
1548
  const isLast = i === slides.length - 1;
1514
1549
  const dwellMs = resolveFixtureDwellMs(s, { gatesFast, pace: demoPace });
1515
1550
  await installOverlay(page, title);
1516
1551
  if (s.selector) {
1517
1552
  try {
1518
1553
  const box = await page.locator(s.selector).first().boundingBox();
1519
- if (box) await showRing(page, box, caption, slideTone);
1554
+ if (box) await showRing(page, box, caption, slideTone, slideStyle);
1520
1555
  } catch {
1521
1556
  await hideRing(page);
1522
1557
  }
@@ -1828,7 +1863,10 @@ function instrumentInteractionHighlighting(page, mem, slowMo, pacing, stubBefore
1828
1863
  const stubs = (stubBeforeRef && stubBeforeRef.current) || [];
1829
1864
  const cap = await captionForLocator(page, this, stubs, fallback);
1830
1865
  await moveCursorTo(page, box, cursorMs(500));
1831
- await showRing(page, box, cap.label, cap.tone);
1866
+ await showRing(page, box, cap.label, cap.tone, {
1867
+ size: cap.size,
1868
+ weight: cap.weight,
1869
+ });
1832
1870
  await dwellMatchedStub(page, this, stubs, pacing);
1833
1871
  await new Promise((res) => setTimeout(res, skipTheater() ? 0 : 200));
1834
1872
  } else if (box) {
@@ -1900,7 +1938,10 @@ function instrumentInteractionHighlighting(page, mem, slowMo, pacing, stubBefore
1900
1938
  const cap = await captionForLocator(page, this, stubs, fallback);
1901
1939
  clickTone = cap.tone;
1902
1940
  clickPoint = await moveCursorTo(page, box, cursorMs(600));
1903
- await showRing(page, box, cap.label, cap.tone);
1941
+ await showRing(page, box, cap.label, cap.tone, {
1942
+ size: cap.size,
1943
+ weight: cap.weight,
1944
+ });
1904
1945
  await dwellMatchedStub(page, this, stubs, pacing);
1905
1946
  // "pop for a few seconds" - Dan's own phrase, matching the
1906
1947
  // zsign demo-engine's ring-before-click pattern in
@@ -2334,6 +2375,8 @@ async function runStepMode(engine, start, end, context, page, mem, resolved, slo
2334
2375
  duration: h.duration,
2335
2376
  fastMode: h.fastMode,
2336
2377
  tone: normalizeHighlightTone(h.tone),
2378
+ size: normalizeHighlightSize(h.size),
2379
+ weight: normalizeHighlightWeight(h.weight),
2337
2380
  }));
2338
2381
  await cycleHighlightRings(page, errHighlights, !!pacing.gatesFast, {
2339
2382
  defaultHoldMs: 2000,
@@ -2408,6 +2451,8 @@ async function runStepMode(engine, start, end, context, page, mem, resolved, slo
2408
2451
  duration: h.duration,
2409
2452
  fastMode: h.fastMode,
2410
2453
  tone: normalizeHighlightTone(h.tone),
2454
+ size: normalizeHighlightSize(h.size),
2455
+ weight: normalizeHighlightWeight(h.weight),
2411
2456
  }),
2412
2457
  );
2413
2458
  } else {
@@ -40,9 +40,19 @@ export interface WaygraphHighlightStub extends FixtureDurationFields {
40
40
  * - `info` blue · `warning` yellow · `danger` red · `success` green
41
41
  */
42
42
  tone?: HighlightTone;
43
+ /**
44
+ * Ring padding + label font scale: `sm` | `md` (default) | `lg`.
45
+ * Aliases: small/medium/large, s/m/l.
46
+ */
47
+ size?: HighlightSize;
48
+ /**
49
+ * Label font weight: `normal` (default) | `bold`.
50
+ * Aliases: regular, strong.
51
+ */
52
+ weight?: HighlightWeight;
43
53
  }
44
54
  /** Flow fixture patch: label required; selector optional (inherits from stub). */
45
- export type WaygraphHighlightFixture = Partial<Pick<WaygraphHighlightStub, "selector">> & Required<Pick<WaygraphHighlightStub, "label">> & Pick<WaygraphHighlightStub, "detail" | "tag" | "tone"> & FixtureDurationFields;
55
+ export type WaygraphHighlightFixture = Partial<Pick<WaygraphHighlightStub, "selector">> & Required<Pick<WaygraphHighlightStub, "label">> & Pick<WaygraphHighlightStub, "detail" | "tag" | "tone" | "size" | "weight"> & FixtureDurationFields;
46
56
  export type HighlightStubPhase = Record<string, WaygraphHighlightStub>;
47
57
  export type HighlightStubPhaseOrFn<Out extends Checkpoint<string>> = HighlightStubPhase | ((out: Out) => HighlightStubPhase);
48
58
  /**
@@ -57,14 +67,24 @@ export interface WaygraphSlide extends FixtureDurationFields {
57
67
  /** Optional ring while this slide is showing. */
58
68
  selector?: string;
59
69
  tone?: HighlightTone;
70
+ size?: HighlightSize;
71
+ weight?: HighlightWeight;
60
72
  }
61
73
  /**
62
74
  * Demo ring tones (iconified).
63
75
  * Automation (`auto`) is gray so authored planned/info/warning/danger/success stand out.
64
76
  */
65
77
  export type HighlightTone = "planned" | "auto" | "info" | "warning" | "danger" | "success";
78
+ /** Ring + label scale. */
79
+ export type HighlightSize = "sm" | "md" | "lg";
80
+ /** Label font weight. */
81
+ export type HighlightWeight = "normal" | "bold";
66
82
  /** Map author aliases (`error` -> danger) to a canonical tone. */
67
83
  export declare function normalizeHighlightTone(raw: unknown): HighlightTone;
84
+ /** Map size aliases to sm/md/lg. */
85
+ export declare function normalizeHighlightSize(raw: unknown): HighlightSize;
86
+ /** Map weight aliases to normal/bold. */
87
+ export declare function normalizeHighlightWeight(raw: unknown): HighlightWeight;
68
88
  /** Prefix label with a short ASCII icon for semantic tones. */
69
89
  export declare function toneIconPrefix(tone: HighlightTone): string;
70
90
  /**
@@ -35,6 +35,26 @@ export function normalizeHighlightTone(raw) {
35
35
  return "planned";
36
36
  return "planned";
37
37
  }
38
+ /** Map size aliases to sm/md/lg. */
39
+ export function normalizeHighlightSize(raw) {
40
+ if (typeof raw !== "string")
41
+ return "md";
42
+ const t = raw.trim().toLowerCase();
43
+ if (t === "sm" || t === "s" || t === "small" || t === "tiny")
44
+ return "sm";
45
+ if (t === "lg" || t === "l" || t === "large" || t === "big" || t === "xl")
46
+ return "lg";
47
+ return "md";
48
+ }
49
+ /** Map weight aliases to normal/bold. */
50
+ export function normalizeHighlightWeight(raw) {
51
+ if (typeof raw !== "string")
52
+ return "normal";
53
+ const t = raw.trim().toLowerCase();
54
+ if (t === "bold" || t === "strong" || t === "heavy" || t === "b")
55
+ return "bold";
56
+ return "normal";
57
+ }
38
58
  /** Prefix label with a short ASCII icon for semantic tones. */
39
59
  export function toneIconPrefix(tone) {
40
60
  const icon = TONE_ICONS[tone];
@@ -116,10 +136,24 @@ function pickDurationFields(base, patch) {
116
136
  out.fastMode = fastMode;
117
137
  return out;
118
138
  }
139
+ function pickStyleFields(base, patch) {
140
+ const out = {};
141
+ const tone = patch?.tone !== undefined ? patch.tone : base?.tone;
142
+ const size = patch?.size !== undefined ? patch.size : base?.size;
143
+ const weight = patch?.weight !== undefined ? patch.weight : base?.weight;
144
+ if (tone !== undefined)
145
+ out.tone = normalizeHighlightTone(tone);
146
+ if (size !== undefined)
147
+ out.size = normalizeHighlightSize(size);
148
+ if (weight !== undefined)
149
+ out.weight = normalizeHighlightWeight(weight);
150
+ return out;
151
+ }
119
152
  function mergeSlot(base, patch) {
120
153
  if (!base && !patch)
121
154
  return null;
122
155
  const dwell = pickDurationFields(base, patch);
156
+ const style = pickStyleFields(base, patch);
123
157
  if (!base && patch) {
124
158
  if (!patch.selector)
125
159
  return null;
@@ -128,12 +162,18 @@ function mergeSlot(base, patch) {
128
162
  label: patch.label,
129
163
  ...(patch.detail ? { detail: patch.detail } : {}),
130
164
  ...(patch.tag ? { tag: patch.tag } : {}),
131
- ...(patch.tone ? { tone: normalizeHighlightTone(patch.tone) } : {}),
165
+ ...style,
132
166
  ...dwell,
133
167
  };
134
168
  }
135
- if (base && !patch)
136
- return { ...base };
169
+ if (base && !patch) {
170
+ return {
171
+ ...base,
172
+ ...(base.tone ? { tone: normalizeHighlightTone(base.tone) } : {}),
173
+ ...(base.size ? { size: normalizeHighlightSize(base.size) } : {}),
174
+ ...(base.weight ? { weight: normalizeHighlightWeight(base.weight) } : {}),
175
+ };
176
+ }
137
177
  return {
138
178
  selector: patch.selector ?? base.selector,
139
179
  label: patch.label,
@@ -143,11 +183,7 @@ function mergeSlot(base, patch) {
143
183
  ? { detail: base.detail }
144
184
  : {}),
145
185
  ...(patch.tag !== undefined ? { tag: patch.tag } : base.tag ? { tag: base.tag } : {}),
146
- ...(patch.tone !== undefined
147
- ? { tone: normalizeHighlightTone(patch.tone) }
148
- : base.tone
149
- ? { tone: normalizeHighlightTone(base.tone) }
150
- : {}),
186
+ ...style,
151
187
  ...dwell,
152
188
  };
153
189
  }
package/dist/index.d.ts CHANGED
@@ -3,8 +3,8 @@ export { connect, checkpoint } from "./types.js";
3
3
  export { MemKey, MemPage, key, keyGroup } from "./mem-page.js";
4
4
  export { Trait, urlMatches, textEquals, visible } from "./trait.js";
5
5
  export { runGraph, spawnTab, narrate, Engine, start, end, branch, withVerify, modVerify, modVerifyAll, defineBlock, defineNavBlock, defineNavClickBlock, defineMethodBlock, defineActionBlock, definePageBlock, defineEffectBlock, defineMemEffectBlock, defineMemNavBlock, locate, composeBlock, fastForwardComposeBlock, isFastForwardBlock, preflight, withSessionReset, withTitle, withDemoPace, withBlockPace, withExpectedFailure, withHighlightFixtures, chainFlow, } from "./engine.js";
6
- export { resolveHighlightSlots, resolveSlides, resolveFixtureDwellMs, resolveSlideDwellMs, formatHighlightCaption, hasAuthoredStubAfter, hasAuthoredStubOnError, normalizeHighlightTone, normalizeDemoPace, toneIconPrefix, resolveStepDemoPace, FIXTURE_DURATION_MS_DEFAULT, FIXTURE_DURATION_FAST_MS_DEFAULT, FIXTURE_DURATION_SLOW_MS_DEFAULT, SLIDE_DURATION_MS_DEFAULT, SLIDE_DURATION_FAST_MS_DEFAULT, } from "./highlights.js";
7
- export type { WaygraphHighlightStub, WaygraphHighlightFixture, WaygraphSlide, FixtureDurationFields, HighlightStubPhase, HighlightStubPhaseName, HighlightFixtureMap, ResolvedHighlight, WaygraphHighlight, HighlightTone, DemoPace, } from "./highlights.js";
6
+ export { resolveHighlightSlots, resolveSlides, resolveFixtureDwellMs, resolveSlideDwellMs, formatHighlightCaption, hasAuthoredStubAfter, hasAuthoredStubOnError, normalizeHighlightTone, normalizeDemoPace, normalizeHighlightSize, normalizeHighlightWeight, toneIconPrefix, resolveStepDemoPace, FIXTURE_DURATION_MS_DEFAULT, FIXTURE_DURATION_FAST_MS_DEFAULT, FIXTURE_DURATION_SLOW_MS_DEFAULT, SLIDE_DURATION_MS_DEFAULT, SLIDE_DURATION_FAST_MS_DEFAULT, } from "./highlights.js";
7
+ export type { WaygraphHighlightStub, WaygraphHighlightFixture, WaygraphSlide, FixtureDurationFields, HighlightStubPhase, HighlightStubPhaseName, HighlightFixtureMap, ResolvedHighlight, WaygraphHighlight, HighlightTone, HighlightSize, HighlightWeight, DemoPace, } from "./highlights.js";
8
8
  export type { Flow, EngineConfig, ComposedBlock, FastForwardComposedBlock, RunGraphOptions, BlockInfo, NavBlock, NavBlockOptions, NavClickBlock, NavClickBlockOptions, MethodBlock, ActionBlock, PageBlock, PageBlockOptions, PageMethodEntry, EffectBlock, MemEffectBlock, MemNavBlock, } from "./engine.js";
9
9
  export type { ActionPage } from "./types.js";
10
10
  export { discoverGraph, toMermaid, findOrphanBlocks, findBlockPath } from "./graph.js";
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ export { connect, checkpoint } from "./types.js";
2
2
  export { MemKey, MemPage, key, keyGroup } from "./mem-page.js";
3
3
  export { Trait, urlMatches, textEquals, visible } from "./trait.js";
4
4
  export { runGraph, spawnTab, narrate, Engine, start, end, branch, withVerify, modVerify, modVerifyAll, defineBlock, defineNavBlock, defineNavClickBlock, defineMethodBlock, defineActionBlock, definePageBlock, defineEffectBlock, defineMemEffectBlock, defineMemNavBlock, locate, composeBlock, fastForwardComposeBlock, isFastForwardBlock, preflight, withSessionReset, withTitle, withDemoPace, withBlockPace, withExpectedFailure, withHighlightFixtures, chainFlow, } from "./engine.js";
5
- export { resolveHighlightSlots, resolveSlides, resolveFixtureDwellMs, resolveSlideDwellMs, formatHighlightCaption, hasAuthoredStubAfter, hasAuthoredStubOnError, normalizeHighlightTone, normalizeDemoPace, toneIconPrefix, resolveStepDemoPace, FIXTURE_DURATION_MS_DEFAULT, FIXTURE_DURATION_FAST_MS_DEFAULT, FIXTURE_DURATION_SLOW_MS_DEFAULT, SLIDE_DURATION_MS_DEFAULT, SLIDE_DURATION_FAST_MS_DEFAULT, } from "./highlights.js";
5
+ export { resolveHighlightSlots, resolveSlides, resolveFixtureDwellMs, resolveSlideDwellMs, formatHighlightCaption, hasAuthoredStubAfter, hasAuthoredStubOnError, normalizeHighlightTone, normalizeDemoPace, normalizeHighlightSize, normalizeHighlightWeight, toneIconPrefix, resolveStepDemoPace, FIXTURE_DURATION_MS_DEFAULT, FIXTURE_DURATION_FAST_MS_DEFAULT, FIXTURE_DURATION_SLOW_MS_DEFAULT, SLIDE_DURATION_MS_DEFAULT, SLIDE_DURATION_FAST_MS_DEFAULT, } from "./highlights.js";
6
6
  export { discoverGraph, toMermaid, findOrphanBlocks, findBlockPath } from "./graph.js";
7
7
  export { isFileSelectToken, parseBlocksSelect, matchBlocksSelect, globToRegExp, } from "./blocks-select.js";
8
8
  export { EdgeLeaseCoordinator } from "./traverse-lease.js";
@@ -15,6 +15,12 @@ const RING_CSS = "#wg-ring{position:fixed;z-index:2147483646;pointer-events:none
15
15
  "#wg-ring-label[data-tone=warning]{background:#EAB308;color:#1c1917;}" +
16
16
  "#wg-ring-label[data-tone=danger]{background:#DC2626;color:#fff;}" +
17
17
  "#wg-ring-label[data-tone=success]{background:#16A34A;color:#fff;}" +
18
+ "#wg-ring[data-size=sm]{border-width:1.5px;border-radius:8px;}" +
19
+ "#wg-ring[data-size=lg]{border-width:4px;border-radius:12px;}" +
20
+ "#wg-ring-label[data-size=sm]{font-size:10px;line-height:1.25;padding:4px 7px;border-radius:5px;}" +
21
+ "#wg-ring-label[data-size=lg]{font-size:16px;line-height:1.35;padding:8px 14px;border-radius:9px;}" +
22
+ "#wg-ring-label[data-weight=bold]{font-weight:800;}" +
23
+ "#wg-ring-label[data-weight=normal]{font-weight:600;}" +
18
24
  "#wg-cursor{position:fixed;z-index:2147483647;width:24px;height:24px;pointer-events:none;" +
19
25
  "left:0;top:0;opacity:0;margin:0;" +
20
26
  "transition:transform var(--wg-cursor-ms,600ms) cubic-bezier(.22,1,.36,1),opacity .2s ease;" +
@@ -93,7 +99,7 @@ export async function installDemoChrome(page, title = "waygraph auto", options =
93
99
  void pulse.offsetWidth;
94
100
  pulse.classList.add("wg-pulse");
95
101
  };
96
- window.__wgPositionRing = (box, label, tone) => {
102
+ window.__wgPositionRing = (box, label, tone, style) => {
97
103
  const ring = document.getElementById("wg-ring");
98
104
  const ringLabel = document.getElementById("wg-ring-label");
99
105
  if (!ring || !ringLabel)
@@ -106,12 +112,20 @@ export async function installDemoChrome(page, title = "waygraph auto", options =
106
112
  raw === "success"
107
113
  ? raw
108
114
  : "planned";
115
+ const sizeRaw = ((style && style.size) || "md") + "";
116
+ const size = sizeRaw === "sm" || sizeRaw === "lg" ? sizeRaw : "md";
117
+ const weightRaw = ((style && style.weight) || "normal") + "";
118
+ const weight = weightRaw === "bold" ? "bold" : "normal";
109
119
  ring.dataset.tone = t;
110
120
  ringLabel.dataset.tone = t;
111
- ring.style.left = box.x - 6 + "px";
112
- ring.style.top = box.y - 6 + "px";
113
- ring.style.width = box.width + 12 + "px";
114
- ring.style.height = box.height + 12 + "px";
121
+ ring.dataset.size = size;
122
+ ringLabel.dataset.size = size;
123
+ ringLabel.dataset.weight = weight;
124
+ const pad = size === "sm" ? 3 : size === "lg" ? 10 : 6;
125
+ ring.style.left = box.x - pad + "px";
126
+ ring.style.top = box.y - pad + "px";
127
+ ring.style.width = box.width + pad * 2 + "px";
128
+ ring.style.height = box.height + pad * 2 + "px";
115
129
  ring.style.opacity = "1";
116
130
  ringLabel.textContent = label;
117
131
  ringLabel.style.left = box.x + "px";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waygraph",
3
- "version": "0.12.15",
3
+ "version": "0.12.16",
4
4
  "type": "module",
5
5
  "description": "A typed graph of reusable Blocks for driving a browser through E2E flows.",
6
6
  "license": "MIT",