waygraph 0.12.35 → 0.12.36

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/cli.js CHANGED
@@ -889,7 +889,8 @@ async function installOverlay(page, title) {
889
889
  if (ring) ring.style.opacity = "0";
890
890
  if (ringLabel) ringLabel.style.opacity = "0";
891
891
  if (window.__wgHideFocusVeil) window.__wgHideFocusVeil();
892
- if (window.__wgClearZoom) window.__wgClearZoom();
892
+ // Do NOT clear camera zoom here - zoomOut:false keeps scale between
893
+ // rings; only resetCameraZoom / teardown call __wgClearZoom.
893
894
  };
894
895
  // Screen Studio-style camera: scale <body>, keep overlays on <html> fixed.
895
896
  window.__wgCamera = { scale: 1, cx: 0, cy: 0 };
@@ -1618,7 +1619,11 @@ async function cycleHighlightRings(page, highlights, gatesFast, opts) {
1618
1619
  }
1619
1620
  }
1620
1621
  await stopLiveFollow();
1621
- await resetCameraZoom(page);
1622
+ // Keep camera if the last ring (or phase default) asked zoomOut:false.
1623
+ const last = list.length > 0 ? list[list.length - 1] : null;
1624
+ if (!last || last.zoomOut !== false) {
1625
+ await resetCameraZoom(page);
1626
+ }
1622
1627
  if (list.length === 0) {
1623
1628
  await hideRing(page);
1624
1629
  }
@@ -2345,6 +2350,7 @@ async function teardownOverlay(page) {
2345
2350
  window.__wgRingTrack = null;
2346
2351
  }
2347
2352
  window.__wgNarrateOwnsRing = false;
2353
+ if (window.__wgClearZoom) window.__wgClearZoom();
2348
2354
  for (const id of ["wg-panel", "wg-ring", "wg-ring-label", "wg-cursor", "wg-click-pulse", "wg-banner", "wg-todo-modal", "wg-focus-veil"]) {
2349
2355
  const el = document.getElementById(id);
2350
2356
  if (el) el.remove();
@@ -20,6 +20,7 @@ export const NavCartBlock = defineNavClickBlock<CartPage>({
20
20
  ctx.todos(["Find the product", "Add to cart", "Open cart"]);
21
21
  ctx.todoIndex(2);
22
22
  ctx.zoom(1.4);
23
+ ctx.zoomOut(false);
23
24
  ctx.highlights({
24
25
  cart: {
25
26
  selector: ".shopping_cart_link",
@@ -66,6 +66,7 @@ export const AddToCartBlock = defineEffectBlock<Checkpoint<string>, ItemInCart>(
66
66
  ctx.banner("In the cart");
67
67
  ctx.todos(["Find the product", "Add to cart", "Open cart"]);
68
68
  ctx.todoIndex(1);
69
+ ctx.zoomOut(false);
69
70
  ctx.ring("badge", {
70
71
  selector: InventorySel.cartBadge,
71
72
  label: "Cart badge",
@@ -73,6 +74,7 @@ export const AddToCartBlock = defineEffectBlock<Checkpoint<string>, ItemInCart>(
73
74
  focus: true,
74
75
  color: "#86efac",
75
76
  zoom: 1.6,
77
+ zoomOut: false,
76
78
  followMouse: true,
77
79
  duration: true,
78
80
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waygraph",
3
- "version": "0.12.35",
3
+ "version": "0.12.36",
4
4
  "type": "module",
5
5
  "description": "A typed graph of reusable Blocks for driving a browser through E2E flows.",
6
6
  "license": "MIT",
@@ -20,6 +20,7 @@ export const NavCartBlock = defineNavClickBlock<CartPage>({
20
20
  ctx.todos(["Find the product", "Add to cart", "Open cart"]);
21
21
  ctx.todoIndex(2);
22
22
  ctx.zoom(1.4);
23
+ ctx.zoomOut(false);
23
24
  ctx.highlights({
24
25
  cart: {
25
26
  selector: ".shopping_cart_link",
@@ -66,6 +66,7 @@ export const AddToCartBlock = defineEffectBlock<Checkpoint<string>, ItemInCart>(
66
66
  ctx.banner("In the cart");
67
67
  ctx.todos(["Find the product", "Add to cart", "Open cart"]);
68
68
  ctx.todoIndex(1);
69
+ ctx.zoomOut(false);
69
70
  ctx.ring("badge", {
70
71
  selector: InventorySel.cartBadge,
71
72
  label: "Cart badge",
@@ -73,6 +74,7 @@ export const AddToCartBlock = defineEffectBlock<Checkpoint<string>, ItemInCart>(
73
74
  focus: true,
74
75
  color: "#86efac",
75
76
  zoom: 1.6,
77
+ zoomOut: false,
76
78
  followMouse: true,
77
79
  duration: true,
78
80
  });