waygraph 0.15.54 → 0.16.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/README.md +8 -3
- package/bin/waygraph +2 -2
- package/dist/analysis/check.d.ts +38 -0
- package/dist/analysis/check.js +87 -0
- package/dist/analysis/coverage-gap.d.ts +1 -1
- package/dist/analysis/coverage-gap.js +14 -37
- package/dist/analysis/flow-source.d.ts +9 -0
- package/dist/analysis/flow-source.js +25 -0
- package/dist/analysis/graph.d.ts +10 -14
- package/dist/analysis/graph.js +48 -371
- package/dist/analysis/map-check.js +4 -39
- package/dist/analysis/practices-check.d.ts +1 -1
- package/dist/analysis/practices-check.js +24 -45
- package/dist/cli/args.d.ts +23 -0
- package/dist/cli/args.js +20 -0
- package/dist/{cli.d.ts → cli/cli.d.ts} +0 -1
- package/dist/{cli.js → cli/cli.js} +10 -9
- package/dist/{commands → cli/commands}/agent-dive-scaffold.js +35 -64
- package/dist/cli/commands/agent-dive.js +42 -0
- package/dist/cli/commands/browser.d.ts +2 -0
- package/dist/cli/commands/browser.js +109 -0
- package/dist/{commands → cli/commands}/check.d.ts +0 -1
- package/dist/cli/commands/check.js +104 -0
- package/dist/cli/commands/codemod-checkpoints.d.ts +18 -0
- package/dist/cli/commands/codemod-checkpoints.js +186 -0
- package/dist/cli/commands/codemod-flows.d.ts +18 -0
- package/dist/cli/commands/codemod-flows.js +284 -0
- package/dist/cli/commands/codemod-stubs.d.ts +10 -0
- package/dist/cli/commands/codemod-stubs.js +187 -0
- package/dist/{commands → cli/commands}/extensions.js +5 -4
- package/dist/{commands → cli/commands}/init.js +1 -2
- package/dist/{commands → cli/commands}/list.js +9 -7
- package/dist/cli/commands/manifest.d.ts +2 -0
- package/dist/cli/commands/manifest.js +20 -0
- package/dist/cli/commands/map.js +57 -0
- package/dist/cli/commands/pilot.d.ts +2 -0
- package/dist/cli/commands/pilot.js +102 -0
- package/dist/{commands → cli/commands}/run.d.ts +0 -1
- package/dist/cli/commands/run.js +64 -0
- package/dist/cli/commands/session-ops.d.ts +3 -0
- package/dist/cli/commands/session-ops.js +257 -0
- package/dist/cli/commands/session.js +132 -0
- package/dist/{commands → cli/commands}/test.js +11 -14
- package/dist/cli/commands/traverse.js +105 -0
- package/dist/{commands → cli/commands}/try.js +29 -25
- package/dist/{commands → cli/commands}/upgrade.js +40 -4
- package/dist/cli/flags.d.ts +193 -16
- package/dist/cli/flags.js +179 -234
- package/dist/cli/run-chain.d.ts +1 -0
- package/dist/cli/run-chain.js +42 -7
- package/dist/cli/usage.d.ts +1 -1
- package/dist/cli/usage.js +21 -53
- package/dist/cli/util.d.ts +2 -2
- package/dist/cli/util.js +2 -3
- package/dist/{highlights → demo/narration}/css.d.ts +1 -1
- package/dist/{highlights → demo/narration}/css.js +2 -3
- package/dist/{highlights → demo/narration}/demo-pace.d.ts +4 -12
- package/dist/{highlights → demo/narration}/demo-pace.js +5 -11
- package/dist/{highlights → demo/narration}/device.d.ts +4 -4
- package/dist/{highlights → demo/narration}/device.js +1 -1
- package/dist/demo/narration/merge.d.ts +10 -0
- package/dist/demo/narration/merge.js +67 -0
- package/dist/demo/narration/narration.d.ts +39 -0
- package/dist/{highlights/run-phase.js → demo/narration/narration.js} +25 -94
- package/dist/{highlights → demo/narration}/shorthand.d.ts +1 -1
- package/dist/demo/narration/stub-ctx.d.ts +8 -0
- package/dist/demo/narration/stub-ctx.js +164 -0
- package/dist/{highlights → demo/narration}/style.d.ts +1 -7
- package/dist/{highlights → demo/narration}/style.js +1 -41
- package/dist/{highlights → demo/narration}/todo-dock.d.ts +8 -8
- package/dist/{highlights → demo/narration}/todo-dock.js +13 -30
- package/dist/demo/overlay/auto-chrome.d.ts +7 -0
- package/dist/demo/overlay/auto-chrome.js +97 -0
- package/dist/demo/overlay/cursor.d.ts +19 -0
- package/dist/demo/overlay/cursor.js +142 -0
- package/dist/demo/overlay/device-stage.d.ts +26 -0
- package/dist/demo/overlay/device-stage.js +396 -0
- package/dist/demo/overlay/inpage/banner.d.ts +2 -0
- package/dist/demo/overlay/inpage/banner.js +160 -0
- package/dist/demo/overlay/inpage/caption.d.ts +2 -0
- package/dist/demo/overlay/inpage/caption.js +24 -0
- package/dist/demo/overlay/inpage/core.d.ts +2 -0
- package/dist/demo/overlay/inpage/core.js +345 -0
- package/dist/demo/overlay/inpage/device-chip.d.ts +1 -0
- package/dist/demo/overlay/inpage/device-chip.js +191 -0
- package/dist/demo/overlay/inpage/network.d.ts +10 -0
- package/dist/demo/overlay/inpage/network.js +189 -0
- package/dist/demo/overlay/inpage/panel-chrome.d.ts +1 -0
- package/dist/demo/overlay/inpage/panel-chrome.js +203 -0
- package/dist/demo/overlay/inpage/stamp.d.ts +1 -0
- package/dist/demo/overlay/inpage/stamp.js +46 -0
- package/dist/demo/overlay/inpage/swipe-zoom.d.ts +1 -0
- package/dist/demo/overlay/inpage/swipe-zoom.js +220 -0
- package/dist/demo/overlay/inpage/todos.d.ts +2 -0
- package/dist/demo/overlay/inpage/todos.js +293 -0
- package/dist/demo/overlay/locator-theater.d.ts +25 -0
- package/dist/demo/overlay/locator-theater.js +76 -0
- package/dist/demo/overlay/network-capture.d.ts +22 -0
- package/dist/demo/overlay/network-capture.js +127 -0
- package/dist/demo/overlay/overlay-css.d.ts +3 -0
- package/dist/demo/overlay/overlay-css.js +369 -0
- package/dist/demo/overlay/overlay-stage.d.ts +31 -0
- package/dist/demo/overlay/overlay-stage.js +106 -0
- package/dist/demo/overlay/overlay.d.ts +10 -0
- package/dist/demo/overlay/overlay.js +89 -0
- package/dist/{pilot-overlay/overlay-fixtures.d.ts → demo/overlay/phase-fixtures.d.ts} +2 -2
- package/dist/{pilot-overlay/overlay-fixtures.js → demo/overlay/phase-fixtures.js} +2 -2
- package/dist/{pilot-overlay/action-ring.js → demo/overlay/pilot/actions.js} +2 -1
- package/dist/{pilot-overlay → demo/overlay/pilot}/fixtures.d.ts +6 -5
- package/dist/{pilot-overlay → demo/overlay/pilot}/fixtures.js +19 -18
- package/dist/{pilot-overlay → demo/overlay/pilot}/shell.d.ts +2 -2
- package/dist/{pilot-overlay → demo/overlay/pilot}/shell.js +13 -22
- package/dist/demo/overlay/reattach.d.ts +7 -0
- package/dist/demo/overlay/reattach.js +23 -0
- package/dist/demo/overlay/rings.d.ts +61 -0
- package/dist/demo/overlay/rings.js +422 -0
- package/dist/{ui → demo/overlay/ui}/components/ring.js +2 -2
- package/dist/{ui → demo/overlay/ui}/overlay.css +4 -4
- package/dist/{ui → demo/overlay/ui}/shadow.d.ts +1 -1
- package/dist/{ui → demo/overlay/ui}/shadow.js +39 -2
- package/dist/demo/stepper/after.d.ts +3 -0
- package/dist/demo/stepper/after.js +103 -0
- package/dist/demo/stepper/banner-log.d.ts +35 -0
- package/dist/demo/stepper/banner-log.js +65 -0
- package/dist/demo/stepper/before.d.ts +4 -0
- package/dist/demo/stepper/before.js +110 -0
- package/dist/demo/stepper/demo-log.d.ts +48 -0
- package/dist/demo/stepper/demo-log.js +292 -0
- package/dist/demo/stepper/gate.d.ts +11 -0
- package/dist/demo/stepper/gate.js +78 -0
- package/dist/demo/stepper/interaction-patch.d.ts +4 -0
- package/dist/demo/stepper/interaction-patch.js +323 -0
- package/dist/demo/stepper/pacing.d.ts +21 -0
- package/dist/demo/stepper/pacing.js +23 -0
- package/dist/demo/stepper/panel-after.d.ts +17 -0
- package/dist/demo/stepper/panel-after.js +166 -0
- package/dist/demo/stepper/panel-before.d.ts +12 -0
- package/dist/demo/stepper/panel-before.js +241 -0
- package/dist/demo/stepper/slides.d.ts +23 -0
- package/dist/demo/stepper/slides.js +233 -0
- package/dist/demo/stepper/step-panels.d.ts +69 -0
- package/dist/demo/stepper/step-panels.js +172 -0
- package/dist/demo/stepper/stepper.d.ts +24 -0
- package/dist/demo/stepper/stepper.js +122 -0
- package/dist/demo/stepper/teardown.d.ts +47 -0
- package/dist/demo/stepper/teardown.js +178 -0
- package/dist/demo/stepper/todo-advance.d.ts +15 -0
- package/dist/demo/stepper/todo-advance.js +110 -0
- package/dist/demo/stepper/view.d.ts +58 -0
- package/dist/demo/stepper/view.js +31 -0
- package/dist/demo/types.d.ts +85 -0
- package/dist/demo/verbose-log.js +15 -0
- package/dist/engine/block/action-page.d.ts +53 -0
- package/dist/engine/block/action-page.js +1 -0
- package/dist/{types.d.ts → engine/block/block.d.ts} +102 -142
- package/dist/{core → engine/block}/block.js +12 -130
- package/dist/engine/block/branch.d.ts +17 -0
- package/dist/engine/block/branch.js +40 -0
- package/dist/{core → engine/block}/compose.d.ts +9 -7
- package/dist/{core → engine/block}/compose.js +1 -1
- package/dist/engine/block/dialog.d.ts +13 -0
- package/dist/engine/block/dialog.js +37 -0
- package/dist/{core/blocks → engine/block/kinds}/api.d.ts +16 -12
- package/dist/{core/blocks → engine/block/kinds}/api.js +26 -18
- package/dist/{core/blocks → engine/block/kinds}/effect.d.ts +13 -18
- package/dist/engine/block/kinds/effect.js +17 -0
- package/dist/{core/blocks → engine/block/kinds}/method.d.ts +17 -29
- package/dist/{core/blocks → engine/block/kinds}/method.js +6 -21
- package/dist/{core/blocks → engine/block/kinds}/nav.d.ts +21 -31
- package/dist/{core/blocks → engine/block/kinds}/nav.js +6 -12
- package/dist/{core/blocks → engine/block/kinds}/page.d.ts +14 -20
- package/dist/{core/blocks → engine/block/kinds}/page.js +5 -7
- package/dist/engine/checkpoint/checkpoint.d.ts +22 -0
- package/dist/engine/checkpoint/checkpoint.js +8 -0
- package/dist/engine/checkpoint/route.d.ts +28 -0
- package/dist/engine/checkpoint/route.js +28 -0
- package/dist/{core → engine}/config.d.ts +7 -2
- package/dist/engine/config.js +6 -0
- package/dist/engine/engine.d.ts +45 -0
- package/dist/{core → engine}/engine.js +6 -10
- package/dist/engine/env.d.ts +59 -0
- package/dist/engine/env.js +83 -0
- package/dist/{errors.d.ts → engine/errors.d.ts} +22 -22
- package/dist/{errors.js → engine/errors.js} +22 -22
- package/dist/{core → engine/flow}/branch-regression.d.ts +7 -7
- package/dist/{core → engine/flow}/branch-regression.js +4 -3
- package/dist/engine/flow/flow.d.ts +162 -0
- package/dist/engine/flow/flow.js +244 -0
- package/dist/engine/flow/map-branch.d.ts +9 -0
- package/dist/engine/flow/map-branch.js +57 -0
- package/dist/{core → engine/flow}/map-builder.d.ts +34 -54
- package/dist/engine/flow/map-builder.js +242 -0
- package/dist/engine/flow/map-steps.d.ts +30 -0
- package/dist/engine/flow/map-steps.js +87 -0
- package/dist/{core → engine}/locate.d.ts +1 -1
- package/dist/{core → engine}/locate.js +1 -2
- package/dist/{mem-stub.d.ts → engine/mem/mem-stub.d.ts} +9 -8
- package/dist/{mem-stub.js → engine/mem/mem-stub.js} +2 -2
- package/dist/{mem-page.d.ts → engine/mem/mem.d.ts} +1 -1
- package/dist/{mem-page.js → engine/mem/mem.js} +2 -1
- package/dist/engine/page-gone.d.ts +5 -0
- package/dist/engine/page-gone.js +20 -0
- package/dist/engine/run/connect.d.ts +28 -0
- package/dist/{types.js → engine/run/connect.js} +11 -10
- package/dist/engine/run/events.d.ts +67 -0
- package/dist/engine/run/events.js +90 -0
- package/dist/engine/run/hooks.d.ts +16 -0
- package/dist/engine/run/hooks.js +8 -0
- package/dist/engine/run/launch.d.ts +13 -0
- package/dist/engine/run/launch.js +27 -0
- package/dist/{core/run-graph.d.ts → engine/run/run.d.ts} +8 -12
- package/dist/{core/run-graph.js → engine/run/run.js} +22 -12
- package/dist/engine/stub/pace.d.ts +12 -0
- package/dist/engine/stub/pace.js +2 -0
- package/dist/engine/stub/ring.d.ts +130 -0
- package/dist/engine/stub/ring.js +41 -0
- package/dist/engine/stub/stub.d.ts +268 -0
- package/dist/engine/stub/stub.js +1 -0
- package/dist/engine/stub/todos.d.ts +104 -0
- package/dist/engine/stub/todos.js +2 -0
- package/dist/engine/stub/viewport.d.ts +26 -0
- package/dist/engine/stub/viewport.js +2 -0
- package/dist/{trait.d.ts → engine/trait/trait.d.ts} +1 -1
- package/dist/{trait.js → engine/trait/trait.js} +1 -1
- package/dist/index.d.ts +88 -36
- package/dist/index.js +46 -19
- package/dist/live/auto/auto.d.ts +22 -0
- package/dist/live/auto/auto.js +207 -0
- package/dist/{session/auto-explore.d.ts → live/auto/explore.d.ts} +4 -14
- package/dist/{session/auto-explore.js → live/auto/explore.js} +21 -127
- package/dist/live/auto/mem.d.ts +11 -0
- package/dist/live/auto/mem.js +85 -0
- package/dist/live/auto/menu.d.ts +30 -0
- package/dist/live/auto/menu.js +335 -0
- package/dist/live/auto-session/auto-session.d.ts +113 -0
- package/dist/live/auto-session/auto-session.js +452 -0
- package/dist/live/auto-session/console.d.ts +4 -0
- package/dist/live/auto-session/console.js +41 -0
- package/dist/live/auto-session/files.d.ts +44 -0
- package/dist/live/auto-session/files.js +145 -0
- package/dist/{auto-session → live/auto-session}/helpers.d.ts +9 -5
- package/dist/{auto-session → live/auto-session}/helpers.js +18 -1
- package/dist/live/auto-session/inspect.d.ts +4 -0
- package/dist/live/auto-session/inspect.js +75 -0
- package/dist/{session/auto-session-ipc.d.ts → live/auto-session/ipc.d.ts} +8 -25
- package/dist/{session/auto-session-ipc.js → live/auto-session/ipc.js} +36 -161
- package/dist/live/auto-session/open-browser.d.ts +6 -0
- package/dist/live/auto-session/open-browser.js +47 -0
- package/dist/{session/browser.d.ts → live/auto-session/start.d.ts} +1 -2
- package/dist/{session/browser.js → live/auto-session/start.js} +2 -3
- package/dist/{pilot-overlay → live/pilot}/panel.d.ts +1 -1
- package/dist/{pilot-overlay → live/pilot}/panel.js +23 -31
- package/dist/{session → live/pilot}/pilot.d.ts +3 -3
- package/dist/{session → live/pilot}/pilot.js +5 -4
- package/dist/{traverse/run.d.ts → live/traverse/traverse.d.ts} +1 -1
- package/dist/live/traverse/traverse.js +212 -0
- package/dist/live/traverse/worker.d.ts +37 -0
- package/dist/live/traverse/worker.js +200 -0
- package/dist/manifest/manifest.d.ts +52 -0
- package/dist/manifest/manifest.js +93 -0
- package/dist/manifest/map-imports.d.ts +7 -0
- package/dist/manifest/map-imports.js +22 -0
- package/dist/manifest/maps.d.ts +33 -0
- package/dist/manifest/maps.js +62 -0
- package/dist/manifest/pack.d.ts +21 -0
- package/dist/manifest/pack.js +109 -0
- package/dist/manifest/project.d.ts +60 -0
- package/dist/manifest/project.js +101 -0
- package/dist/{session/block-inject.js → manifest/roots.js} +1 -18
- package/dist/manifest/scan.d.ts +19 -0
- package/dist/manifest/scan.js +57 -0
- package/dist/manifest/source.d.ts +23 -0
- package/dist/manifest/source.js +86 -0
- package/dist/runner/mode.d.ts +71 -0
- package/dist/runner/mode.js +1 -0
- package/dist/runner/modes/branches.d.ts +5 -0
- package/dist/runner/modes/branches.js +37 -0
- package/dist/runner/modes/demo.d.ts +3 -0
- package/dist/runner/modes/demo.js +13 -0
- package/dist/runner/modes/report.d.ts +2 -0
- package/dist/runner/modes/report.js +54 -0
- package/dist/runner/modes/run.d.ts +2 -0
- package/dist/runner/modes/run.js +3 -0
- package/dist/runner/options.d.ts +31 -0
- package/dist/runner/options.js +42 -0
- package/dist/runner/plan/find.d.ts +18 -0
- package/dist/runner/plan/find.js +65 -0
- package/dist/runner/plan/plan.d.ts +11 -0
- package/dist/runner/plan/plan.js +97 -0
- package/dist/runner/plan/seed-mem.d.ts +12 -0
- package/dist/runner/plan/seed-mem.js +98 -0
- package/dist/runner/plan/spec.d.ts +5 -0
- package/dist/runner/plan/spec.js +17 -0
- package/dist/runner/play-steps.d.ts +2 -0
- package/dist/runner/play-steps.js +59 -0
- package/dist/runner/runner.d.ts +4 -0
- package/dist/runner/runner.js +64 -0
- package/dist/runner/session.d.ts +9 -0
- package/dist/runner/session.js +87 -0
- package/dist/{browser.js → runtime/browser.js} +4 -2
- package/dist/{env-file.js → runtime/env-file.js} +7 -12
- package/dist/{extensions.d.ts → runtime/extensions.d.ts} +1 -5
- package/dist/{extensions.js → runtime/extensions.js} +2 -1
- package/dist/runtime/full-launch.d.ts +1 -0
- package/dist/runtime/full-launch.js +34 -0
- package/dist/runtime/global-flag.d.ts +5 -0
- package/dist/runtime/global-flag.js +18 -0
- package/dist/{playwright-config.d.ts → runtime/playwright-config.d.ts} +1 -1
- package/dist/{playwright.config.js → runtime/playwright.config.js} +3 -2
- package/dist/runtime/run-log.d.ts +2 -0
- package/dist/runtime/run-log.js +17 -0
- package/dist/{video-dir.js → runtime/video-dir.js} +3 -2
- package/dist/{config.d.ts → runtime/waygraph-config.d.ts} +6 -9
- package/dist/{config.js → runtime/waygraph-config.js} +21 -51
- package/dist/{webserver.js → runtime/webserver.js} +5 -30
- package/examples/routed-demo/config/waygraph.config.ts +20 -0
- package/examples/routed-demo/package.json +1 -4
- package/examples/routed-demo/scripts/fixture-server.mjs +1 -1
- package/examples/routed-demo/src/flows/routed-demo-map.flow.ts +2 -4
- package/examples/routed-demo/src/flows/routed-demo.flow.ts +1 -2
- package/examples/routed-demo/src/map/(app_base)/dashboard/_methods/click-widget.block.ts +5 -4
- package/examples/routed-demo/src/map/(app_base)/dashboard/_nav.block.ts +3 -3
- package/examples/routed-demo/src/map/(app_base)/dashboard/_page.block.ts +3 -3
- package/examples/routed-demo/src/map/(external)/docs/_nav.block.ts +3 -3
- package/examples/routed-demo/src/map/(external)/docs/_page.block.ts +3 -3
- package/examples/routed-demo/src/states/routed-demo.states.ts +5 -3
- package/examples/routed-demo/tests/routed-demo.spec.ts +4 -4
- package/examples/routed-demo/tsconfig.json +1 -1
- package/examples/saucedemo/docs/CONVENTION.md +4 -5
- package/examples/saucedemo/docs/HELPERS.md +11 -11
- package/examples/saucedemo/src/blocks/SITE-MAP.md +0 -1
- package/examples/saucedemo/src/blocks/saucedemo-web/NAV.md +1 -5
- package/examples/saucedemo/src/blocks/saucedemo-web/cart/nav-cart.block.ts +3 -3
- package/examples/saucedemo/src/blocks/saucedemo-web/cart/nav-checkout-info.block.ts +3 -3
- package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-one/methods/fill-first-name.method.block.ts +5 -4
- package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-one/methods/fill-last-name.method.block.ts +5 -4
- package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-one/methods/fill-postal-code.method.block.ts +5 -4
- package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-one/methods/submit-checkout-info.method.block.ts +5 -4
- package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-two/methods/finish-order.method.block.ts +5 -8
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory/inventory.page.block.ts +3 -3
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory/methods/add-all-to-cart.method.block.ts +4 -6
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory/methods/add-to-cart.effect.block.ts +35 -43
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory/methods/remove-all-from-cart.method.block.ts +4 -6
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory/methods/remove-from-cart.effect.block.ts +4 -3
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory/nav-item-detail.block.ts +3 -3
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory-item/nav-back-to-inventory.block.ts +3 -3
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory-item/nav-back-to-products.block.ts +3 -3
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory-item/nav-continue-shopping.block.ts +3 -3
- package/examples/saucedemo/src/blocks/saucedemo-web/methods/fill-password.method.block.ts +5 -4
- package/examples/saucedemo/src/blocks/saucedemo-web/methods/fill-username.method.block.ts +5 -4
- package/examples/saucedemo/src/blocks/saucedemo-web/methods/submit-login.method.block.ts +4 -5
- package/examples/saucedemo/src/blocks/saucedemo-web/methods/submit-logout.method.block.ts +5 -4
- package/examples/saucedemo/src/blocks/saucedemo-web/nav-login.block.ts +3 -3
- package/examples/saucedemo/src/flows/api-demo.flow.ts +12 -10
- package/examples/saucedemo/src/states/checkout.states.ts +21 -11
- package/examples/saucedemo/src/stubs/device-showcase.ts +8 -10
- package/examples/saucedemo/tests/auto-graph.spec.ts +4 -12
- package/package.json +14 -6
- package/templates/agents/waygraph-planner.agent.md +2 -2
- package/templates/quickstart/docs/CONVENTION.md +4 -4
- package/templates/quickstart/docs/HELPERS.md +10 -8
- package/templates/quickstart/package.json +0 -3
- package/templates/quickstart/src/blocks/SITE-MAP.md +0 -1
- package/templates/quickstart/src/blocks/saucedemo-web/NAV.md +1 -5
- package/templates/quickstart/src/blocks/saucedemo-web/cart/nav-cart.block.ts +3 -3
- package/templates/quickstart/src/blocks/saucedemo-web/cart/nav-checkout-info.block.ts +3 -3
- package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-one/methods/fill-first-name.method.block.ts +5 -4
- package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-one/methods/fill-last-name.method.block.ts +5 -4
- package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-one/methods/fill-postal-code.method.block.ts +5 -4
- package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-one/methods/submit-checkout-info.method.block.ts +5 -4
- package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-two/methods/finish-order.method.block.ts +5 -8
- package/templates/quickstart/src/blocks/saucedemo-web/inventory/inventory.page.block.ts +3 -3
- package/templates/quickstart/src/blocks/saucedemo-web/inventory/methods/add-all-to-cart.method.block.ts +4 -6
- package/templates/quickstart/src/blocks/saucedemo-web/inventory/methods/add-to-cart.effect.block.ts +35 -43
- package/templates/quickstart/src/blocks/saucedemo-web/inventory/methods/remove-all-from-cart.method.block.ts +4 -6
- package/templates/quickstart/src/blocks/saucedemo-web/inventory/methods/remove-from-cart.effect.block.ts +4 -3
- package/templates/quickstart/src/blocks/saucedemo-web/inventory/nav-item-detail.block.ts +3 -3
- package/templates/quickstart/src/blocks/saucedemo-web/inventory-item/nav-back-to-inventory.block.ts +3 -3
- package/templates/quickstart/src/blocks/saucedemo-web/inventory-item/nav-back-to-products.block.ts +3 -3
- package/templates/quickstart/src/blocks/saucedemo-web/inventory-item/nav-continue-shopping.block.ts +3 -3
- package/templates/quickstart/src/blocks/saucedemo-web/methods/fill-password.method.block.ts +5 -4
- package/templates/quickstart/src/blocks/saucedemo-web/methods/fill-username.method.block.ts +5 -4
- package/templates/quickstart/src/blocks/saucedemo-web/methods/submit-login.method.block.ts +4 -5
- package/templates/quickstart/src/blocks/saucedemo-web/methods/submit-logout.method.block.ts +5 -4
- package/templates/quickstart/src/blocks/saucedemo-web/nav-login.block.ts +3 -3
- package/templates/quickstart/src/flows/api-demo.flow.ts +12 -10
- package/templates/quickstart/src/states/checkout.states.ts +21 -11
- package/templates/quickstart/src/stubs/device-showcase.ts +8 -10
- package/templates/scaffold/README.md +2 -1
- package/templates/scaffold/STRUCTURE.md +5 -4
- package/templates/scaffold/config/waygraph.config.ts +1 -0
- package/templates/scaffold/gitignore +1 -0
- package/templates/scaffold/src/flows/README.md +2 -2
- package/templates/scaffold/src/map/(app_base)/docs/_nav.block.ts +3 -3
- package/templates/scaffold/src/map/(app_base)/docs/_page.block.ts +3 -3
- package/templates/scaffold/src/map/(app_base)/home/_methods/add-item.effect.block.ts +4 -4
- package/templates/scaffold/src/map/(app_base)/home/_methods/assert-hello.method.block.ts +3 -3
- package/templates/scaffold/src/map/(app_base)/home/_methods/assert-item-added.method.block.ts +3 -3
- package/templates/scaffold/src/map/(app_base)/home/_methods/clear-cart.method.block.ts +5 -4
- package/templates/scaffold/src/map/(app_base)/home/_methods/remove-item.effect.block.ts +4 -4
- package/templates/scaffold/src/map/(app_base)/home/_nav.block.ts +3 -3
- package/templates/scaffold/src/map/(app_base)/home/_page.block.ts +3 -3
- package/templates/scaffold/src/map/(app_base)/home/nav-verification-link.block.ts +4 -4
- package/templates/scaffold/src/map/(external)/hoppscotch/_keys.ts +21 -0
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/assert-response-body.method.block.ts +4 -4
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/assert-response-header.method.block.ts +4 -4
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/assert-status.method.block.ts +4 -4
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/pick-extension-interceptor.method.block.ts +5 -4
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/read-response-body.method.block.ts +6 -5
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/read-response-headers.method.block.ts +6 -5
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/send-request.method.block.ts +5 -4
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/set-bearer-token.method.block.ts +6 -5
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/set-headers.method.block.ts +6 -5
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/set-json-body.method.block.ts +6 -5
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/set-method.method.block.ts +6 -5
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/set-query-params.method.block.ts +6 -5
- package/templates/scaffold/src/map/(external)/hoppscotch/_methods/set-url.method.block.ts +6 -5
- package/templates/scaffold/src/map/(external)/hoppscotch/_nav.block.ts +3 -3
- package/templates/scaffold/src/map/(external)/hoppscotch/_page.block.ts +3 -3
- package/templates/scaffold/src/map/(external)/hoppscotch/_states.ts +6 -0
- package/templates/scaffold/src/map/(external)/hoppscotch/settings/_nav.block.ts +3 -3
- package/templates/scaffold/src/map/(external)/mailpit/_keys.ts +13 -0
- package/templates/scaffold/src/map/(external)/mailpit/_methods/assert-email-content.method.block.ts +4 -4
- package/templates/scaffold/src/map/(external)/mailpit/_methods/assert-email-received.method.block.ts +4 -4
- package/templates/scaffold/src/map/(external)/mailpit/_methods/extract-email-link.method.block.ts +6 -5
- package/templates/scaffold/src/map/(external)/mailpit/_methods/open-message.method.block.ts +6 -5
- package/templates/scaffold/src/map/(external)/mailpit/_nav.block.ts +3 -3
- package/templates/scaffold/src/map/(external)/mailpit/_page.block.ts +3 -3
- package/templates/scaffold/src/map/(external)/mailpit/_states.ts +9 -0
- package/templates/scaffold/src/map/README.md +7 -0
- package/templates/scaffold/src/states/README.md +4 -1
- package/templates/scaffold/src/states/demo.mem-keys.ts +1 -29
- package/templates/scaffold/src/states/demo.states.ts +14 -20
- package/templates/scaffold/tests/hoppscotch.spec.ts +1 -11
- package/templates/scaffold/tests/mail-verify.spec.ts +2 -2
- package/templates/skills/waygraph-blind-pilot.skill.md +2 -6
- package/templates/skills/waygraph-convention.skill.md +23 -14
- package/templates/skills/waygraph-pilot.skill.md +7 -4
- package/dist/auto-session/session.d.ts +0 -193
- package/dist/auto-session/session.js +0 -719
- package/dist/auto-session/verbose-log.js +0 -16
- package/dist/auto-session.d.ts +0 -2
- package/dist/auto-session.js +0 -3
- package/dist/cli/discover.d.ts +0 -40
- package/dist/cli/discover.js +0 -148
- package/dist/commands/agent-dive.js +0 -52
- package/dist/commands/check.js +0 -192
- package/dist/commands/map.js +0 -29
- package/dist/commands/run.js +0 -104
- package/dist/commands/session.js +0 -600
- package/dist/commands/traverse.js +0 -177
- package/dist/core/block.d.ts +0 -109
- package/dist/core/blocks/effect.js +0 -23
- package/dist/core/config.js +0 -17
- package/dist/core/engine.d.ts +0 -198
- package/dist/core/flow.d.ts +0 -294
- package/dist/core/flow.js +0 -432
- package/dist/core/map-builder.js +0 -383
- package/dist/core.d.ts +0 -14
- package/dist/core.js +0 -15
- package/dist/highlights/merge.d.ts +0 -8
- package/dist/highlights/merge.js +0 -173
- package/dist/highlights/run-phase.d.ts +0 -43
- package/dist/highlights/stub-ctx.d.ts +0 -10
- package/dist/highlights/stub-ctx.js +0 -331
- package/dist/highlights/types.d.ts +0 -613
- package/dist/highlights.d.ts +0 -9
- package/dist/highlights.js +0 -10
- package/dist/pilot-overlay.d.ts +0 -5
- package/dist/pilot-overlay.js +0 -6
- package/dist/runner/banner-log.js +0 -63
- package/dist/runner/chain-run.js +0 -102
- package/dist/runner/cursor.js +0 -140
- package/dist/runner/demo-log.js +0 -316
- package/dist/runner/device-stage.d.ts +0 -9
- package/dist/runner/device-stage.js +0 -420
- package/dist/runner/discovery.js +0 -105
- package/dist/runner/index.js +0 -2
- package/dist/runner/inpage/banner.d.ts +0 -21
- package/dist/runner/inpage/banner.js +0 -156
- package/dist/runner/inpage/caption.d.ts +0 -3
- package/dist/runner/inpage/caption.js +0 -23
- package/dist/runner/inpage/core.d.ts +0 -4
- package/dist/runner/inpage/core.js +0 -316
- package/dist/runner/inpage/device.d.ts +0 -3
- package/dist/runner/inpage/device.js +0 -211
- package/dist/runner/inpage/network.d.ts +0 -15
- package/dist/runner/inpage/network.js +0 -217
- package/dist/runner/inpage/panel-chrome.js +0 -192
- package/dist/runner/inpage/stamp.js +0 -46
- package/dist/runner/inpage/swipe-zoom.js +0 -220
- package/dist/runner/inpage/todos.js +0 -337
- package/dist/runner/interaction-patch.js +0 -384
- package/dist/runner/main.js +0 -469
- package/dist/runner/network-capture.d.ts +0 -9
- package/dist/runner/network-capture.js +0 -126
- package/dist/runner/overlay-css.d.ts +0 -3
- package/dist/runner/overlay-css.js +0 -377
- package/dist/runner/overlay-install.js +0 -90
- package/dist/runner/overlay-stage.js +0 -110
- package/dist/runner/rings.js +0 -514
- package/dist/runner/seed-mem.js +0 -110
- package/dist/runner/slides.js +0 -278
- package/dist/runner/step-mode.js +0 -703
- package/dist/runner/step-panels.js +0 -729
- package/dist/runner/teardown.js +0 -202
- package/dist/runner/todo-dock.js +0 -142
- package/dist/session/auto-explore-run.d.ts +0 -40
- package/dist/session/auto-explore-run.js +0 -707
- package/dist/session/step-overlay.d.ts +0 -37
- package/dist/session/step-overlay.js +0 -244
- package/dist/traverse/run.js +0 -423
- package/examples/routed-demo/playwright.config.ts +0 -21
- package/examples/saucedemo/src/blocks/saucedemo-web/ff-owner-auth.block.ts +0 -22
- package/templates/quickstart/src/blocks/saucedemo-web/ff-owner-auth.block.ts +0 -22
- /package/dist/{commands → cli/commands}/agent-dive-scaffold.d.ts +0 -0
- /package/dist/{commands → cli/commands}/agent-dive.d.ts +0 -0
- /package/dist/{commands → cli/commands}/extensions.d.ts +0 -0
- /package/dist/{commands → cli/commands}/init.d.ts +0 -0
- /package/dist/{commands → cli/commands}/list.d.ts +0 -0
- /package/dist/{commands → cli/commands}/map.d.ts +0 -0
- /package/dist/{commands → cli/commands}/session.d.ts +0 -0
- /package/dist/{commands → cli/commands}/test.d.ts +0 -0
- /package/dist/{commands → cli/commands}/traverse.d.ts +0 -0
- /package/dist/{commands → cli/commands}/try.d.ts +0 -0
- /package/dist/{commands → cli/commands}/upgrade.d.ts +0 -0
- /package/dist/{highlights → demo/narration}/shorthand.js +0 -0
- /package/dist/{session/overlay-beacon.d.ts → demo/overlay/beacon.d.ts} +0 -0
- /package/dist/{session/overlay-beacon.js → demo/overlay/beacon.js} +0 -0
- /package/dist/{pilot-overlay/action-ring.d.ts → demo/overlay/pilot/actions.d.ts} +0 -0
- /package/dist/{ui → demo/overlay/ui}/components/ring.d.ts +0 -0
- /package/dist/{ui → demo/overlay/ui}/stylesheet.d.ts +0 -0
- /package/dist/{ui → demo/overlay/ui}/stylesheet.js +0 -0
- /package/dist/{ui → demo/overlay/ui}/tokens.d.ts +0 -0
- /package/dist/{ui → demo/overlay/ui}/tokens.js +0 -0
- /package/dist/{highlights → demo}/types.js +0 -0
- /package/dist/{auto-session → demo}/verbose-log.d.ts +0 -0
- /package/dist/{selector.d.ts → engine/trait/selector.d.ts} +0 -0
- /package/dist/{selector.js → engine/trait/selector.js} +0 -0
- /package/dist/{traverse → live/traverse}/coverage.d.ts +0 -0
- /package/dist/{traverse → live/traverse}/coverage.js +0 -0
- /package/dist/{traverse → live/traverse}/lease.d.ts +0 -0
- /package/dist/{traverse → live/traverse}/lease.js +0 -0
- /package/dist/{session/block-inject.d.ts → manifest/roots.d.ts} +0 -0
- /package/dist/{blocks-select.d.ts → manifest/select.d.ts} +0 -0
- /package/dist/{blocks-select.js → manifest/select.js} +0 -0
- /package/dist/{browser.d.ts → runtime/browser.d.ts} +0 -0
- /package/dist/{env-file.d.ts → runtime/env-file.d.ts} +0 -0
- /package/dist/{playwright-config.js → runtime/playwright-config.js} +0 -0
- /package/dist/{playwright.config.d.ts → runtime/playwright.config.d.ts} +0 -0
- /package/dist/{video-dir.d.ts → runtime/video-dir.d.ts} +0 -0
- /package/dist/{webserver.d.ts → runtime/webserver.d.ts} +0 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
export function addNetworkEntry(entry) {
|
|
2
|
+
// No-op outside a demo/pilot/auto run - ensureShadowRoot() (and its __wgById/__wgAdd globals)
|
|
3
|
+
// is never installed for a plain `waygraph run`/Playwright test, and this must not throw there.
|
|
4
|
+
if (typeof __wgById !== "function" || typeof __wgAdd !== "function" || typeof __wgEl !== "function")
|
|
5
|
+
return;
|
|
6
|
+
function methodClass(method) {
|
|
7
|
+
const m = (method || "GET").toUpperCase();
|
|
8
|
+
if (m === "GET")
|
|
9
|
+
return "get";
|
|
10
|
+
if (m === "POST")
|
|
11
|
+
return "post";
|
|
12
|
+
if (m === "PUT" || m === "PATCH")
|
|
13
|
+
return "put";
|
|
14
|
+
if (m === "DELETE")
|
|
15
|
+
return "delete";
|
|
16
|
+
return "other";
|
|
17
|
+
}
|
|
18
|
+
function toCurl(e) {
|
|
19
|
+
let cmd = "curl -X " + (e.method || "GET") + " '" + String(e.url || "").replace(/'/g, "'\\''") + "'";
|
|
20
|
+
const headers = e.reqHeaders || {};
|
|
21
|
+
for (const k of Object.keys(headers)) {
|
|
22
|
+
if (/^:/.test(k))
|
|
23
|
+
continue; // HTTP/2 pseudo-headers - not valid curl -H input
|
|
24
|
+
cmd += " \\\n -H '" + k + ": " + String(headers[k]).replace(/'/g, "'\\''") + "'";
|
|
25
|
+
}
|
|
26
|
+
if (e.reqBody)
|
|
27
|
+
cmd += " \\\n --data '" + String(e.reqBody).replace(/'/g, "'\\''") + "'";
|
|
28
|
+
return cmd;
|
|
29
|
+
}
|
|
30
|
+
function renderHeaders(headers) {
|
|
31
|
+
const h = headers || {};
|
|
32
|
+
const keys = Object.keys(h);
|
|
33
|
+
if (keys.length === 0)
|
|
34
|
+
return __wgEl("div", { class: "wg-net-empty" }, "(none)");
|
|
35
|
+
return __wgEl("table", { class: "wg-net-headers" }, keys.map((k) => __wgEl("tr", null, __wgEl("td", null, k), __wgEl("td", null, String(h[k])))));
|
|
36
|
+
}
|
|
37
|
+
function renderBody(body) {
|
|
38
|
+
if (body === undefined || body === null || body === "")
|
|
39
|
+
return __wgEl("div", { class: "wg-net-empty" }, "(empty)");
|
|
40
|
+
let text = body;
|
|
41
|
+
try {
|
|
42
|
+
text = JSON.stringify(JSON.parse(body), null, 2);
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
/* not JSON - show raw */
|
|
46
|
+
}
|
|
47
|
+
return __wgEl("pre", { class: "wg-net-body" }, String(text).slice(0, 4000));
|
|
48
|
+
}
|
|
49
|
+
function section(heading, ...content) {
|
|
50
|
+
return __wgEl("div", { class: "wg-net-detail-section" }, __wgEl("h4", null, heading), ...content);
|
|
51
|
+
}
|
|
52
|
+
function renderDetail(e) {
|
|
53
|
+
return [
|
|
54
|
+
section("Request headers", renderHeaders(e.reqHeaders)),
|
|
55
|
+
e.reqBody ? section("Request body", renderBody(e.reqBody)) : null,
|
|
56
|
+
section("Response headers", renderHeaders(e.resHeaders)),
|
|
57
|
+
section("Response body", renderBody(e.resBody)),
|
|
58
|
+
section("cURL", __wgEl("pre", { class: "wg-net-body wg-net-curl" }, toCurl(e)), __wgEl("button", { class: "wg-net-copy", data: { copy: "1" }, attrs: { type: "button" } }, "Copy as cURL")),
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
let panel = __wgById("wg-network-log");
|
|
62
|
+
if (!panel) {
|
|
63
|
+
panel = document.createElement("div");
|
|
64
|
+
panel.id = "wg-network-log";
|
|
65
|
+
panel.setAttribute("data-wg-ui", "1");
|
|
66
|
+
const header = document.createElement("div");
|
|
67
|
+
header.className = "wg-net-header";
|
|
68
|
+
const title = document.createElement("span");
|
|
69
|
+
title.className = "wg-net-title";
|
|
70
|
+
title.textContent = "Network";
|
|
71
|
+
const count = document.createElement("span");
|
|
72
|
+
count.className = "wg-net-count";
|
|
73
|
+
count.textContent = "0";
|
|
74
|
+
const toggle = document.createElement("button");
|
|
75
|
+
toggle.type = "button";
|
|
76
|
+
toggle.className = "wg-net-collapse";
|
|
77
|
+
toggle.textContent = "−"; // minus
|
|
78
|
+
toggle.addEventListener("click", (ev) => {
|
|
79
|
+
ev.stopPropagation();
|
|
80
|
+
panel.classList.toggle("wg-net-collapsed");
|
|
81
|
+
toggle.textContent = panel.classList.contains("wg-net-collapsed") ? "+" : "−";
|
|
82
|
+
});
|
|
83
|
+
header.appendChild(title);
|
|
84
|
+
header.appendChild(count);
|
|
85
|
+
header.appendChild(toggle);
|
|
86
|
+
const list = document.createElement("ol");
|
|
87
|
+
list.className = "wg-net-list";
|
|
88
|
+
panel.appendChild(header);
|
|
89
|
+
panel.appendChild(list);
|
|
90
|
+
__wgAdd(panel);
|
|
91
|
+
}
|
|
92
|
+
const w = window;
|
|
93
|
+
w.__wgNetworkEntries = w.__wgNetworkEntries || [];
|
|
94
|
+
w.__wgNetworkEntries.push(entry);
|
|
95
|
+
while (w.__wgNetworkEntries.length > 30)
|
|
96
|
+
w.__wgNetworkEntries.shift();
|
|
97
|
+
const list = panel.querySelector(".wg-net-list");
|
|
98
|
+
if (!list)
|
|
99
|
+
return;
|
|
100
|
+
const row = document.createElement("li");
|
|
101
|
+
row.className = "wg-net-row";
|
|
102
|
+
row.dataset.ok = entry.ok ? "1" : "0";
|
|
103
|
+
let path = entry.url;
|
|
104
|
+
try {
|
|
105
|
+
const u = new URL(String(entry.url));
|
|
106
|
+
path = u.pathname + u.search;
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
/* not an absolute URL - show as given */
|
|
110
|
+
}
|
|
111
|
+
__wgSet(row, __wgEl("span", { class: "wg-net-method wg-net-method-" + methodClass(entry.method) }, (entry.method || "GET").toUpperCase()), __wgEl("span", { class: "wg-net-path", title: String(entry.url) }, path), __wgEl("span", { class: "wg-net-status" }, String(entry.status ?? "")), entry.ms !== undefined ? __wgEl("span", { class: "wg-net-ms" }, entry.ms + "ms") : null);
|
|
112
|
+
row.addEventListener("click", () => {
|
|
113
|
+
const open = row.classList.contains("wg-net-open");
|
|
114
|
+
__wgQA(".wg-net-row.wg-net-open").forEach((r) => {
|
|
115
|
+
r.classList.remove("wg-net-open");
|
|
116
|
+
const d = r.nextElementSibling;
|
|
117
|
+
if (d && d.classList && d.classList.contains("wg-net-detail"))
|
|
118
|
+
d.remove();
|
|
119
|
+
});
|
|
120
|
+
if (open)
|
|
121
|
+
return;
|
|
122
|
+
row.classList.add("wg-net-open");
|
|
123
|
+
const detail = document.createElement("li");
|
|
124
|
+
detail.className = "wg-net-detail";
|
|
125
|
+
__wgSet(detail, renderDetail(entry));
|
|
126
|
+
const copyBtn = detail.querySelector("[data-copy]");
|
|
127
|
+
if (copyBtn) {
|
|
128
|
+
copyBtn.addEventListener("click", (ev) => {
|
|
129
|
+
ev.stopPropagation();
|
|
130
|
+
const text = toCurl(entry);
|
|
131
|
+
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
132
|
+
navigator.clipboard.writeText(text).catch(() => { });
|
|
133
|
+
}
|
|
134
|
+
copyBtn.textContent = "Copied!";
|
|
135
|
+
setTimeout(() => {
|
|
136
|
+
copyBtn.textContent = "Copy as cURL";
|
|
137
|
+
}, 1200);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
row.after(detail);
|
|
141
|
+
});
|
|
142
|
+
list.appendChild(row);
|
|
143
|
+
while (list.children.length > 30 && list.firstChild)
|
|
144
|
+
list.removeChild(list.firstChild);
|
|
145
|
+
const countEl = panel.querySelector(".wg-net-count");
|
|
146
|
+
if (countEl)
|
|
147
|
+
countEl.textContent = String(w.__wgNetworkEntries.length);
|
|
148
|
+
// Always captured, only shown when explicitly turned on (ctx.showNetworkTab(); default hidden -
|
|
149
|
+
// see StubCtx's own doc comment) - the DOM/row still gets built either way, so toggling visible
|
|
150
|
+
// later shows the full history immediately, not just entries captured after that point.
|
|
151
|
+
if (w.__wgNetworkTabVisible) {
|
|
152
|
+
panel.classList.remove("wg-out");
|
|
153
|
+
void panel.offsetWidth;
|
|
154
|
+
panel.classList.add("wg-in");
|
|
155
|
+
void row.offsetWidth;
|
|
156
|
+
row.classList.add("wg-in");
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Shows or hides the network-tab panel - capture keeps happening either way (addNetworkEntry
|
|
161
|
+
* always builds the DOM row; this only toggles whether the panel itself is visible). Safe to call
|
|
162
|
+
* before any entry exists yet - it just remembers the flag for addNetworkEntry to check later.
|
|
163
|
+
*/
|
|
164
|
+
export function setNetworkTabVisible(visible) {
|
|
165
|
+
if (typeof __wgById !== "function")
|
|
166
|
+
return;
|
|
167
|
+
window.__wgNetworkTabVisible = !!visible;
|
|
168
|
+
const panel = __wgById("wg-network-log");
|
|
169
|
+
if (!panel)
|
|
170
|
+
return;
|
|
171
|
+
if (visible) {
|
|
172
|
+
panel.classList.remove("wg-out");
|
|
173
|
+
panel.classList.add("wg-in");
|
|
174
|
+
__wgQA(".wg-net-row").forEach((r) => r.classList.add("wg-in"));
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
panel.classList.remove("wg-in");
|
|
178
|
+
panel.classList.add("wg-out");
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/** Clears every captured entry and removes the panel - a fresh navigation/session starting over. */
|
|
182
|
+
export function clearNetworkLog() {
|
|
183
|
+
if (typeof __wgById !== "function")
|
|
184
|
+
return;
|
|
185
|
+
window.__wgNetworkEntries = [];
|
|
186
|
+
const panel = __wgById("wg-network-log");
|
|
187
|
+
if (panel)
|
|
188
|
+
panel.remove();
|
|
189
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function installPanelChrome(): void;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
// In-page (runs inside the browser via page.evaluate, must stay self-contained): the step panel's Hide/Show chrome and mini Next.
|
|
2
|
+
export function installPanelChrome() {
|
|
3
|
+
// Hide/Show for #wg-panel - call after every panel content refresh.
|
|
4
|
+
// Collapsed = "N / M · block" + Next (when not auto). Never pass
|
|
5
|
+
// forceCollapsed:false - omit so Hide/localStorage wins.
|
|
6
|
+
window.__wgWirePanelChrome = (panel, storageKey, chromeTitle, opts) => {
|
|
7
|
+
if (!panel)
|
|
8
|
+
return;
|
|
9
|
+
opts = opts || {};
|
|
10
|
+
const ensureChrome = () => {
|
|
11
|
+
let chrome = panel.querySelector(":scope > .wg-chrome");
|
|
12
|
+
if (!chrome) {
|
|
13
|
+
const body = document.createElement("div");
|
|
14
|
+
body.className = "wg-body";
|
|
15
|
+
while (panel.firstChild)
|
|
16
|
+
body.appendChild(panel.firstChild);
|
|
17
|
+
chrome = document.createElement("div");
|
|
18
|
+
chrome.className = "wg-chrome";
|
|
19
|
+
const titleEl = document.createElement("span");
|
|
20
|
+
titleEl.className = "wg-chrome-title";
|
|
21
|
+
titleEl.textContent = chromeTitle || "waygraph demo";
|
|
22
|
+
const actions = document.createElement("div");
|
|
23
|
+
actions.className = "wg-chrome-actions";
|
|
24
|
+
const nextBtn = document.createElement("button");
|
|
25
|
+
nextBtn.type = "button";
|
|
26
|
+
nextBtn.className = "wg-mini-next";
|
|
27
|
+
nextBtn.setAttribute("data-wg-mini-next", "1");
|
|
28
|
+
nextBtn.textContent = "Next ▶";
|
|
29
|
+
const btn = document.createElement("button");
|
|
30
|
+
btn.type = "button";
|
|
31
|
+
btn.className = "wg-hide-btn";
|
|
32
|
+
btn.setAttribute("data-wg-toggle", "1");
|
|
33
|
+
btn.textContent = "Hide";
|
|
34
|
+
actions.appendChild(nextBtn);
|
|
35
|
+
actions.appendChild(btn);
|
|
36
|
+
chrome.appendChild(titleEl);
|
|
37
|
+
chrome.appendChild(actions);
|
|
38
|
+
panel.appendChild(chrome);
|
|
39
|
+
panel.appendChild(body);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
// Yap slides ship a bare chrome - ensure actions + mini Next exist.
|
|
43
|
+
let actions = chrome.querySelector(".wg-chrome-actions");
|
|
44
|
+
if (!actions) {
|
|
45
|
+
actions = document.createElement("div");
|
|
46
|
+
actions.className = "wg-chrome-actions";
|
|
47
|
+
const hide = chrome.querySelector("[data-wg-toggle]");
|
|
48
|
+
if (hide)
|
|
49
|
+
actions.appendChild(hide);
|
|
50
|
+
chrome.appendChild(actions);
|
|
51
|
+
}
|
|
52
|
+
if (!actions.querySelector("[data-wg-mini-next]")) {
|
|
53
|
+
const nextBtn = document.createElement("button");
|
|
54
|
+
nextBtn.type = "button";
|
|
55
|
+
nextBtn.className = "wg-mini-next";
|
|
56
|
+
nextBtn.setAttribute("data-wg-mini-next", "1");
|
|
57
|
+
nextBtn.textContent = "Next ▶";
|
|
58
|
+
actions.insertBefore(nextBtn, actions.firstChild);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
ensureChrome();
|
|
62
|
+
const stepLabel = opts.stepLabel || panel.dataset.wgStepLabel || "";
|
|
63
|
+
if (stepLabel)
|
|
64
|
+
panel.dataset.wgStepLabel = stepLabel;
|
|
65
|
+
if (opts.fastForward !== undefined) {
|
|
66
|
+
panel.dataset.wgFastForward = opts.fastForward ? "1" : "0";
|
|
67
|
+
}
|
|
68
|
+
if (opts.isApi !== undefined) {
|
|
69
|
+
panel.dataset.wgIsApi = opts.isApi ? "1" : "0";
|
|
70
|
+
}
|
|
71
|
+
const buildFfIcon = () => {
|
|
72
|
+
const span = document.createElement("span");
|
|
73
|
+
span.className = "wg-ff-icon";
|
|
74
|
+
span.setAttribute("aria-hidden", "true");
|
|
75
|
+
span.append(__wgSvg('<svg viewBox="0 0 16 16" fill="none">' +
|
|
76
|
+
'<path class="wg-ff-chev" d="M2 3l5 5-5 5" stroke="#c9a6ff" stroke-width="1.8" ' +
|
|
77
|
+
'stroke-linecap="round" stroke-linejoin="round"/>' +
|
|
78
|
+
'<path class="wg-ff-chev" d="M8 3l5 5-5 5" stroke="#c9a6ff" stroke-width="1.8" ' +
|
|
79
|
+
'stroke-linecap="round" stroke-linejoin="round"/></svg>'));
|
|
80
|
+
return span;
|
|
81
|
+
};
|
|
82
|
+
// Terminal icon: the current step is an API check (defineApiBlock) - no DOM change, no
|
|
83
|
+
// ring of its own, so without this it's an unexplained instant step with nothing visibly
|
|
84
|
+
// happening on the page at all (worse than a fast-forward block, which at least has the
|
|
85
|
+
// FF icon marking it as different).
|
|
86
|
+
const buildApiIcon = () => {
|
|
87
|
+
const span = document.createElement("span");
|
|
88
|
+
span.className = "wg-api-icon";
|
|
89
|
+
span.setAttribute("aria-hidden", "true");
|
|
90
|
+
span.append(__wgSvg('<svg viewBox="0 0 16 16" fill="none">' +
|
|
91
|
+
'<rect x="1" y="2" width="14" height="12" rx="1.5" stroke="#7dd3fc" stroke-width="1.3"/>' +
|
|
92
|
+
'<path d="M3.5 5.5l2.5 2.5-2.5 2.5" stroke="#7dd3fc" stroke-width="1.3" ' +
|
|
93
|
+
'stroke-linecap="round" stroke-linejoin="round"/>' +
|
|
94
|
+
'<path d="M7.5 10.5h4" stroke="#7dd3fc" stroke-width="1.3" stroke-linecap="round"/></svg>'));
|
|
95
|
+
return span;
|
|
96
|
+
};
|
|
97
|
+
const syncMiniNext = (hidden) => {
|
|
98
|
+
const miniNext = panel.querySelector("[data-wg-mini-next]");
|
|
99
|
+
if (!miniNext)
|
|
100
|
+
return;
|
|
101
|
+
let auto = false;
|
|
102
|
+
try {
|
|
103
|
+
auto = localStorage.getItem("wg-autoplay") === "1";
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
/* ignore */
|
|
107
|
+
}
|
|
108
|
+
const runBtn = __wgById("wg-run");
|
|
109
|
+
const show = !!hidden && !auto && !!runBtn;
|
|
110
|
+
miniNext.classList.toggle("wg-mini-next-show", show);
|
|
111
|
+
if (runBtn) {
|
|
112
|
+
miniNext.textContent = runBtn.textContent || "Next ▶";
|
|
113
|
+
miniNext.disabled = !!runBtn.disabled;
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
miniNext.disabled = true;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
const apply = (hidden, persist) => {
|
|
120
|
+
panel.classList.toggle("wg-collapsed", hidden);
|
|
121
|
+
panel.setAttribute("data-wg-collapsed", hidden ? "1" : "0");
|
|
122
|
+
const t = panel.querySelector("[data-wg-toggle]");
|
|
123
|
+
const titleEl = panel.querySelector(".wg-chrome-title");
|
|
124
|
+
const label = panel.dataset.wgStepLabel || stepLabel;
|
|
125
|
+
const isFf = panel.dataset.wgFastForward === "1";
|
|
126
|
+
const isApi = panel.dataset.wgIsApi === "1";
|
|
127
|
+
if (titleEl) {
|
|
128
|
+
const text = hidden
|
|
129
|
+
? (label || chromeTitle || "waygraph demo")
|
|
130
|
+
: (chromeTitle || "waygraph demo");
|
|
131
|
+
titleEl.textContent = "";
|
|
132
|
+
if (hidden && isFf)
|
|
133
|
+
titleEl.appendChild(buildFfIcon());
|
|
134
|
+
if (hidden && isApi)
|
|
135
|
+
titleEl.appendChild(buildApiIcon());
|
|
136
|
+
titleEl.appendChild(document.createTextNode(text));
|
|
137
|
+
}
|
|
138
|
+
if (t)
|
|
139
|
+
t.textContent = hidden ? "Show" : "Hide";
|
|
140
|
+
syncMiniNext(hidden);
|
|
141
|
+
if (persist !== false) {
|
|
142
|
+
try {
|
|
143
|
+
localStorage.setItem(storageKey, hidden ? "1" : "0");
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
/* private mode */
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
let hidden = false;
|
|
151
|
+
if (opts.forceCollapsed === true) {
|
|
152
|
+
hidden = true;
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
try {
|
|
156
|
+
hidden = localStorage.getItem(storageKey) === "1";
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
/* ignore */
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
// force mini does not overwrite Hide preference in storage.
|
|
163
|
+
apply(hidden, opts.forceCollapsed === true ? false : true);
|
|
164
|
+
const toggle = panel.querySelector("[data-wg-toggle]");
|
|
165
|
+
if (toggle && !toggle.dataset.wgWired) {
|
|
166
|
+
toggle.dataset.wgWired = "1";
|
|
167
|
+
toggle.addEventListener("click", (e) => {
|
|
168
|
+
e.stopPropagation();
|
|
169
|
+
apply(!panel.classList.contains("wg-collapsed"), true);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
const miniNext = panel.querySelector("[data-wg-mini-next]");
|
|
173
|
+
if (miniNext && !miniNext.dataset.wgWired) {
|
|
174
|
+
miniNext.dataset.wgWired = "1";
|
|
175
|
+
miniNext.addEventListener("click", (e) => {
|
|
176
|
+
e.stopPropagation();
|
|
177
|
+
const runBtn = __wgById("wg-run");
|
|
178
|
+
if (runBtn && !runBtn.disabled) {
|
|
179
|
+
runBtn.click();
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
if (typeof window.__wgNext === "function")
|
|
183
|
+
window.__wgNext({});
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
const autoCb = __wgById("wg-autoplay-cb");
|
|
187
|
+
if (autoCb && !autoCb.dataset.wgMiniWired) {
|
|
188
|
+
autoCb.dataset.wgMiniWired = "1";
|
|
189
|
+
autoCb.addEventListener("change", () => {
|
|
190
|
+
syncMiniNext(panel.classList.contains("wg-collapsed"));
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
const cur = panel.querySelector("#wg-modules .wg-mod-current");
|
|
194
|
+
if (cur && typeof cur.scrollIntoView === "function") {
|
|
195
|
+
try {
|
|
196
|
+
cur.scrollIntoView({ inline: "center", block: "nearest", behavior: "smooth" });
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
cur.scrollIntoView(false);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function installStamp(): void;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// In-page (runs inside the browser via page.evaluate, must stay self-contained): readiness stamps agents read to know a panel painted.
|
|
2
|
+
export function installStamp() {
|
|
3
|
+
// Blind-agent overlay beacons: every modal root gets data-wg-ui /
|
|
4
|
+
// data-wg-modal / data-wg-ready so tests can fail on a blank panel.
|
|
5
|
+
window.__wgStampModal = (el, kind, meta) => {
|
|
6
|
+
if (!el)
|
|
7
|
+
return;
|
|
8
|
+
meta = meta || {};
|
|
9
|
+
el.setAttribute("data-wg-ui", "1");
|
|
10
|
+
el.setAttribute("data-wg-modal", kind || "panel");
|
|
11
|
+
if (meta.phase != null)
|
|
12
|
+
el.setAttribute("data-wg-phase", String(meta.phase));
|
|
13
|
+
if (meta.step != null)
|
|
14
|
+
el.setAttribute("data-wg-step", String(meta.step));
|
|
15
|
+
if (meta.total != null)
|
|
16
|
+
el.setAttribute("data-wg-total", String(meta.total));
|
|
17
|
+
if (meta.block != null)
|
|
18
|
+
el.setAttribute("data-wg-block", String(meta.block));
|
|
19
|
+
el.setAttribute("data-wg-collapsed", el.classList.contains("wg-collapsed") ? "1" : "0");
|
|
20
|
+
el.setAttribute("data-wg-ready", meta.ready === false ? "0" : "1");
|
|
21
|
+
};
|
|
22
|
+
window.__wgOverlayBeacon = () => {
|
|
23
|
+
return Array.from(__wgQA("[data-wg-ui=\"1\"]")).map((el) => {
|
|
24
|
+
const r = el.getBoundingClientRect();
|
|
25
|
+
const st = getComputedStyle(el);
|
|
26
|
+
return {
|
|
27
|
+
id: el.id || null,
|
|
28
|
+
modal: el.getAttribute("data-wg-modal"),
|
|
29
|
+
ready: el.getAttribute("data-wg-ready") === "1",
|
|
30
|
+
phase: el.getAttribute("data-wg-phase"),
|
|
31
|
+
step: el.getAttribute("data-wg-step"),
|
|
32
|
+
block: el.getAttribute("data-wg-block"),
|
|
33
|
+
collapsed: el.getAttribute("data-wg-collapsed") === "1" ||
|
|
34
|
+
el.classList.contains("wg-collapsed"),
|
|
35
|
+
opacity: st.opacity,
|
|
36
|
+
textLen: (el.innerText || "").trim().length,
|
|
37
|
+
w: Math.round(r.width),
|
|
38
|
+
h: Math.round(r.height),
|
|
39
|
+
visible: r.width > 0 && r.height > 0 && Number(st.opacity) > 0.05,
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
const existingBanner = __wgById("wg-banner");
|
|
44
|
+
if (existingBanner)
|
|
45
|
+
window.__wgStampModal(existingBanner, "banner", { ready: true });
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function installSwipeZoom(): void;
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
// In-page (runs inside the browser via page.evaluate, must stay self-contained): swipe trails and ring zoom.
|
|
2
|
+
export function installSwipeZoom() {
|
|
3
|
+
/**
|
|
4
|
+
* Finger swipe trail for touch theater (orientation rotate / device change).
|
|
5
|
+
* opts: { dir: 'left'|'right'|'up'|'down', label?, ms? }
|
|
6
|
+
* Returns duration waited (ms) via Promise when called from page.evaluate async.
|
|
7
|
+
*/
|
|
8
|
+
window.__wgSwipeTrail = (opts) => {
|
|
9
|
+
const o = opts || {};
|
|
10
|
+
const dir = o.dir === "right" || o.dir === "up" || o.dir === "down" ? o.dir : "left";
|
|
11
|
+
const ms = Math.max(280, Math.min(1400, Number(o.ms) || 720));
|
|
12
|
+
const label = o.label ||
|
|
13
|
+
(dir === "left" || dir === "right" ? "swipe" : "swipe") +
|
|
14
|
+
(o.hint ? " \u00b7 " + o.hint : "");
|
|
15
|
+
let layer = __wgById("wg-swipe-layer");
|
|
16
|
+
if (layer && layer._wgTimer) {
|
|
17
|
+
clearTimeout(layer._wgTimer);
|
|
18
|
+
layer._wgTimer = undefined;
|
|
19
|
+
}
|
|
20
|
+
if (layer)
|
|
21
|
+
layer.remove();
|
|
22
|
+
layer = document.createElement("div");
|
|
23
|
+
layer.id = "wg-swipe-layer";
|
|
24
|
+
layer.setAttribute("data-wg-ui", "1");
|
|
25
|
+
const finger = document.createElement("div");
|
|
26
|
+
finger.className = "wg-swipe-finger";
|
|
27
|
+
const lab = document.createElement("div");
|
|
28
|
+
lab.className = "wg-swipe-label";
|
|
29
|
+
lab.textContent = label;
|
|
30
|
+
layer.appendChild(lab);
|
|
31
|
+
layer.appendChild(finger);
|
|
32
|
+
__wgAdd(layer);
|
|
33
|
+
const vw = window.innerWidth || 390;
|
|
34
|
+
const vh = window.innerHeight || 844;
|
|
35
|
+
const pad = Math.min(vw, vh) * 0.18;
|
|
36
|
+
let x0;
|
|
37
|
+
let y0;
|
|
38
|
+
let x1;
|
|
39
|
+
let y1;
|
|
40
|
+
if (dir === "left") {
|
|
41
|
+
x0 = vw - pad;
|
|
42
|
+
x1 = pad;
|
|
43
|
+
y0 = y1 = vh * 0.52;
|
|
44
|
+
}
|
|
45
|
+
else if (dir === "right") {
|
|
46
|
+
x0 = pad;
|
|
47
|
+
x1 = vw - pad;
|
|
48
|
+
y0 = y1 = vh * 0.52;
|
|
49
|
+
}
|
|
50
|
+
else if (dir === "up") {
|
|
51
|
+
x0 = x1 = vw * 0.5;
|
|
52
|
+
y0 = vh - pad;
|
|
53
|
+
y1 = pad;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
x0 = x1 = vw * 0.5;
|
|
57
|
+
y0 = pad;
|
|
58
|
+
y1 = vh - pad;
|
|
59
|
+
}
|
|
60
|
+
finger.style.left = x0 + "px";
|
|
61
|
+
finger.style.top = y0 + "px";
|
|
62
|
+
finger.style.opacity = "1";
|
|
63
|
+
void layer.offsetWidth;
|
|
64
|
+
layer.classList.add("wg-in");
|
|
65
|
+
const steps = 12;
|
|
66
|
+
const stepMs = Math.floor(ms / steps);
|
|
67
|
+
let i = 0;
|
|
68
|
+
const tick = () => {
|
|
69
|
+
i += 1;
|
|
70
|
+
const t = Math.min(1, i / steps);
|
|
71
|
+
const e = t * t * (3 - 2 * t);
|
|
72
|
+
const x = x0 + (x1 - x0) * e;
|
|
73
|
+
const y = y0 + (y1 - y0) * e;
|
|
74
|
+
finger.style.left = x + "px";
|
|
75
|
+
finger.style.top = y + "px";
|
|
76
|
+
const dot = document.createElement("div");
|
|
77
|
+
dot.className = "wg-swipe-dot";
|
|
78
|
+
dot.style.left = x + "px";
|
|
79
|
+
dot.style.top = y + "px";
|
|
80
|
+
dot.style.opacity = String(0.85 - t * 0.55);
|
|
81
|
+
layer.appendChild(dot);
|
|
82
|
+
requestAnimationFrame(() => {
|
|
83
|
+
dot.style.transition = "opacity .45s ease, transform .45s ease";
|
|
84
|
+
dot.style.opacity = "0";
|
|
85
|
+
dot.style.transform = "scale(1.8)";
|
|
86
|
+
});
|
|
87
|
+
if (i < steps) {
|
|
88
|
+
layer._wgTimer = setTimeout(tick, stepMs);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
finger.style.opacity = "0";
|
|
92
|
+
layer.classList.remove("wg-in");
|
|
93
|
+
layer._wgTimer = setTimeout(() => {
|
|
94
|
+
const el = __wgById("wg-swipe-layer");
|
|
95
|
+
if (el)
|
|
96
|
+
el.remove();
|
|
97
|
+
}, 380);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
layer._wgTimer = setTimeout(tick, 40);
|
|
101
|
+
return ms + 120;
|
|
102
|
+
};
|
|
103
|
+
window.__wgClearZoom = () => {
|
|
104
|
+
// Strip leftover element transforms from older zoom path.
|
|
105
|
+
document.querySelectorAll("[data-wg-zoomed=\"1\"]").forEach((el) => {
|
|
106
|
+
el.style.removeProperty("transform");
|
|
107
|
+
el.style.removeProperty("transform-origin");
|
|
108
|
+
el.style.removeProperty("transition");
|
|
109
|
+
el.style.removeProperty("z-index");
|
|
110
|
+
el.style.removeProperty("position");
|
|
111
|
+
delete el.dataset.wgZoomed;
|
|
112
|
+
});
|
|
113
|
+
// Undo any prior shell-camera experiment - restore device fit scale only.
|
|
114
|
+
const shell = __wgById("wg-device-shell");
|
|
115
|
+
if (shell && shell.dataset.wgCamBase != null) {
|
|
116
|
+
shell.style.transform = shell.dataset.wgCamBase;
|
|
117
|
+
if (shell.dataset.wgCamOrigin) {
|
|
118
|
+
shell.style.transformOrigin = shell.dataset.wgCamOrigin;
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
shell.style.transformOrigin = "center center";
|
|
122
|
+
}
|
|
123
|
+
delete shell.dataset.wgCamBase;
|
|
124
|
+
delete shell.dataset.wgCamOrigin;
|
|
125
|
+
delete shell.dataset.wgCamZoom;
|
|
126
|
+
}
|
|
127
|
+
window.__wgZoomLevel = 1;
|
|
128
|
+
window.__wgZoomSel = "";
|
|
129
|
+
if (window.__wgSetZoomBadge)
|
|
130
|
+
window.__wgSetZoomBadge(1, "");
|
|
131
|
+
};
|
|
132
|
+
const ZOOM_ICO = '<svg viewBox="0 0 24 24" fill="none" stroke="#c9a6ff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">' +
|
|
133
|
+
'<circle cx="11" cy="11" r="7"/><path d="M20 20l-3.5-3.5"/></svg>';
|
|
134
|
+
window.__wgSetZoomBadge = (scale, sel) => {
|
|
135
|
+
const n = Number(scale);
|
|
136
|
+
const level = Number.isFinite(n) && n > 0 ? n : 1;
|
|
137
|
+
let badge = __wgById("wg-zoom-badge");
|
|
138
|
+
if (!badge) {
|
|
139
|
+
badge = document.createElement("div");
|
|
140
|
+
badge.id = "wg-zoom-badge";
|
|
141
|
+
badge.setAttribute("data-wg-ui", "1");
|
|
142
|
+
__wgAdd(badge);
|
|
143
|
+
}
|
|
144
|
+
const zoomed = level > 1.001 || level < 0.999;
|
|
145
|
+
badge.dataset.zoomed = zoomed ? "1" : "0";
|
|
146
|
+
const txt = level.toFixed(2) + "\u00d7";
|
|
147
|
+
__wgSet(badge, __wgEl("span", { class: "wg-zoom-ico" }, __wgSvg(ZOOM_ICO)), __wgEl("span", { class: "wg-zoom-val" }, txt));
|
|
148
|
+
badge.classList.add("wg-in");
|
|
149
|
+
window.__wgZoomLevel = level;
|
|
150
|
+
window.__wgZoomSel = sel || "";
|
|
151
|
+
};
|
|
152
|
+
window.__wgEnsureZoomBadge = () => {
|
|
153
|
+
if (window.__wgSetZoomBadge) {
|
|
154
|
+
window.__wgSetZoomBadge(window.__wgZoomLevel || 1, window.__wgZoomSel || "");
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
window.__wgSetTypingBadge = (on, label) => {
|
|
158
|
+
let badge = __wgById("wg-typing-badge");
|
|
159
|
+
if (!on) {
|
|
160
|
+
if (badge) {
|
|
161
|
+
badge.classList.remove("wg-in");
|
|
162
|
+
setTimeout(() => {
|
|
163
|
+
const b = __wgById("wg-typing-badge");
|
|
164
|
+
if (b && !b.classList.contains("wg-in"))
|
|
165
|
+
b.remove();
|
|
166
|
+
}, 220);
|
|
167
|
+
}
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (!badge) {
|
|
171
|
+
badge = document.createElement("div");
|
|
172
|
+
badge.id = "wg-typing-badge";
|
|
173
|
+
badge.setAttribute("data-wg-ui", "1");
|
|
174
|
+
__wgAdd(badge);
|
|
175
|
+
}
|
|
176
|
+
const text = label ? String(label).slice(0, 40) : "typing";
|
|
177
|
+
__wgSet(badge, __wgEl("span", { class: "wg-ty-dots" }, "\u25cf\u25cf\u25cf"), __wgEl("span", null, "typing \u00b7 " + text));
|
|
178
|
+
void badge.offsetWidth;
|
|
179
|
+
badge.classList.add("wg-in");
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* Zoom HUD only - never CSS-scale the target or the device shell.
|
|
183
|
+
* Shell camera zoom fought device-theater fit-scale (broke ring follow
|
|
184
|
+
* + uneven border-radius). Element scale mangled cart rows. Emphasis
|
|
185
|
+
* is ring + focus veil; badge still shows authored zoom level.
|
|
186
|
+
*/
|
|
187
|
+
window.__wgApplyZoom = (sel, scale) => {
|
|
188
|
+
document.querySelectorAll("[data-wg-zoomed=\"1\"]").forEach((el) => {
|
|
189
|
+
el.style.removeProperty("transform");
|
|
190
|
+
el.style.removeProperty("transform-origin");
|
|
191
|
+
el.style.removeProperty("transition");
|
|
192
|
+
el.style.removeProperty("z-index");
|
|
193
|
+
el.style.removeProperty("position");
|
|
194
|
+
delete el.dataset.wgZoomed;
|
|
195
|
+
});
|
|
196
|
+
const shell = __wgById("wg-device-shell");
|
|
197
|
+
if (shell && shell.dataset.wgCamBase != null) {
|
|
198
|
+
shell.style.transform = shell.dataset.wgCamBase;
|
|
199
|
+
shell.style.transformOrigin = shell.dataset.wgCamOrigin || "center center";
|
|
200
|
+
delete shell.dataset.wgCamBase;
|
|
201
|
+
delete shell.dataset.wgCamOrigin;
|
|
202
|
+
delete shell.dataset.wgCamZoom;
|
|
203
|
+
}
|
|
204
|
+
const n = Number(scale);
|
|
205
|
+
if (!Number.isFinite(n) || n <= 1.001) {
|
|
206
|
+
window.__wgZoomLevel = 1;
|
|
207
|
+
window.__wgZoomSel = "";
|
|
208
|
+
if (window.__wgSetZoomBadge)
|
|
209
|
+
window.__wgSetZoomBadge(1, "");
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
window.__wgZoomLevel = n;
|
|
213
|
+
window.__wgZoomSel = sel || "";
|
|
214
|
+
if (window.__wgSetZoomBadge)
|
|
215
|
+
window.__wgSetZoomBadge(n, sel || "");
|
|
216
|
+
};
|
|
217
|
+
// Mount zoom HUD immediately so demos always show 1.00x.
|
|
218
|
+
if (window.__wgEnsureZoomBadge)
|
|
219
|
+
window.__wgEnsureZoomBadge();
|
|
220
|
+
}
|