waygraph 0.15.27 → 0.15.28
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/highlights/css.js +2 -44
- package/dist/pilot-overlay.d.ts +0 -18
- package/dist/pilot-overlay.js +27 -32
- package/dist/runner/overlay-css.js +7 -18
- package/dist/step-overlay.js +2 -46
- package/dist/ui/components/banner.d.ts +2 -0
- package/dist/ui/components/banner.js +10 -0
- package/dist/ui/components/cursor.d.ts +2 -0
- package/dist/ui/components/cursor.js +19 -0
- package/dist/ui/components/ring.d.ts +4 -0
- package/dist/ui/components/ring.js +44 -0
- package/dist/ui/compose.d.ts +4 -0
- package/dist/ui/compose.js +7 -0
- package/dist/ui/tokens.d.ts +31 -0
- package/dist/ui/tokens.js +21 -0
- package/examples/saucedemo/.waygraph-auto/2324269a.log +0 -0
- package/examples/saucedemo/.waygraph-auto/42e014d1.log +0 -0
- package/examples/saucedemo/.waygraph-auto/6706ead4.log +0 -0
- package/examples/saucedemo/.waygraph-auto/7773a809.log +0 -0
- package/examples/saucedemo/.waygraph-auto/c60cc55e.log +0 -0
- package/examples/saucedemo/.waygraph-auto/da6ebb31.log +0 -0
- package/examples/saucedemo/.waygraph-auto/e03cfd8e.log +0 -0
- package/examples/saucedemo/.waygraph-auto/f2943898.log +0 -0
- package/package.json +1 -1
package/dist/highlights/css.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ringCss } from "../ui/components/ring.js";
|
|
1
2
|
// Split out of the former 2,100-line highlights.ts (see src/ARCHITECTURE.md). Behavior unchanged.
|
|
2
3
|
/**
|
|
3
4
|
* The `#wg-ring` / `#wg-ring-label` CSS (tone/size/weight variants) - the
|
|
@@ -12,47 +13,4 @@
|
|
|
12
13
|
* renders them belongs alongside it for the same reason. `cli.ts` imports
|
|
13
14
|
* this constant instead of keeping its own duplicate copy.
|
|
14
15
|
*/
|
|
15
|
-
export const WAYGRAPH_RING_CSS =
|
|
16
|
-
"border:2.5px solid #7C3AED;border-radius:10px;" +
|
|
17
|
-
// Opacity fade only - NEVER transition border-color/box-shadow. Tone swaps
|
|
18
|
-
// (auto gray -> planned purple -> warning yellow) must snap instantly;
|
|
19
|
-
// color transitions read as a muddy gray/purple/yellow morph on ring 2+.
|
|
20
|
-
"box-shadow:0 0 0 4px rgba(124,58,237,.16);transition:opacity .3s ease;}" +
|
|
21
|
-
// Planned (stubs / fixtures / YAP / instruction.highlights) = purple.
|
|
22
|
-
// Automation (verify fallback, unmatched fill/click) = gray - operators
|
|
23
|
-
// can ignore engine checks and watch purple + semantic tones.
|
|
24
|
-
"#wg-ring[data-tone=planned]{border-color:#7C3AED;box-shadow:0 0 0 4px rgba(124,58,237,.16);}" +
|
|
25
|
-
"#wg-ring[data-tone=auto]{border-color:#9CA3AF;box-shadow:0 0 0 4px rgba(156,163,175,.28);}" +
|
|
26
|
-
"#wg-ring[data-tone=info]{border-color:#3B82F6;box-shadow:0 0 0 4px rgba(59,130,246,.22);}" +
|
|
27
|
-
"#wg-ring[data-tone=warning]{border-color:#EAB308;box-shadow:0 0 0 4px rgba(234,179,8,.22);}" +
|
|
28
|
-
"#wg-ring[data-tone=danger]{border-color:#EF4444;box-shadow:0 0 0 4px rgba(239,68,68,.22);}" +
|
|
29
|
-
"#wg-ring[data-tone=success]{border-color:#22C55E;box-shadow:0 0 0 4px rgba(34,197,94,.22);}" +
|
|
30
|
-
// Real, direct user request: a visible color distinction between a real
|
|
31
|
-
// Playwright-driven action (auto gray, unchanged) and a pure DOM
|
|
32
|
-
// inspection (this - orange).
|
|
33
|
-
"#wg-ring[data-tone=orange]{border-color:#F97316;box-shadow:0 0 0 4px rgba(249,115,22,.22);}" +
|
|
34
|
-
// A real element, not a ::after pseudo-element - a pseudo-element's
|
|
35
|
-
// position is CSS-relative to the ring's own box (left:0 always meant
|
|
36
|
-
// "the ring's own left edge"), so it had no way to be clamped back onto
|
|
37
|
-
// screen when that box sat near a viewport edge - the label's text just
|
|
38
|
-
// ran off, invisibly, with no overflow guard at all. A real sibling can
|
|
39
|
-
// be measured (its actual rendered width) and repositioned in JS -
|
|
40
|
-
// pushed back onto screen, same width, never shrunk. See
|
|
41
|
-
// window.__wgPositionRing in cli.ts's own installOverlay.
|
|
42
|
-
"#wg-ring-label{position:fixed;z-index:2147483646;pointer-events:none;opacity:0;" +
|
|
43
|
-
"max-width:min(360px,70vw);white-space:normal;padding:6px 10px;border-radius:7px;background:#7C3AED;color:#fff;" +
|
|
44
|
-
"font:600 12px/1.35 system-ui,sans-serif;transition:opacity .3s ease;}" +
|
|
45
|
-
"#wg-ring-label[data-tone=planned]{background:#7C3AED;color:#fff;}" +
|
|
46
|
-
"#wg-ring-label[data-tone=auto]{background:#6B7280;color:#fff;}" +
|
|
47
|
-
"#wg-ring-label[data-tone=info]{background:#2563EB;color:#fff;}" +
|
|
48
|
-
"#wg-ring-label[data-tone=warning]{background:#EAB308;color:#1c1917;}" +
|
|
49
|
-
"#wg-ring-label[data-tone=danger]{background:#DC2626;color:#fff;}" +
|
|
50
|
-
"#wg-ring-label[data-tone=success]{background:#16A34A;color:#fff;}" +
|
|
51
|
-
"#wg-ring-label[data-tone=orange]{background:#EA580C;color:#fff;}" +
|
|
52
|
-
// size: ring pad + label font; weight: label boldness
|
|
53
|
-
"#wg-ring[data-size=sm]{border-width:1.5px;border-radius:8px;}" +
|
|
54
|
-
"#wg-ring[data-size=lg]{border-width:4px;border-radius:12px;}" +
|
|
55
|
-
"#wg-ring-label[data-size=sm]{font-size:10px;line-height:1.25;padding:4px 7px;border-radius:5px;}" +
|
|
56
|
-
"#wg-ring-label[data-size=lg]{font-size:16px;line-height:1.35;padding:8px 14px;border-radius:9px;max-width:min(480px,85vw);}" +
|
|
57
|
-
"#wg-ring-label[data-weight=bold]{font-weight:800;}" +
|
|
58
|
-
"#wg-ring-label[data-weight=normal]{font-weight:600;}";
|
|
16
|
+
export const WAYGRAPH_RING_CSS = ringCss();
|
package/dist/pilot-overlay.d.ts
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A small, self-contained on-page indicator for a live AutoSession -
|
|
3
|
-
* "this browser is being driven by Waygraph," plus an expandable panel
|
|
4
|
-
* showing the session's own current live menu. Real, direct user request:
|
|
5
|
-
* a headful Pilot session looks like an ordinary browser tab with no
|
|
6
|
-
* indication anything is driving it, which matters once a human might be
|
|
7
|
-
* co-driving the same visible session (see `AutoSession.resync()`'s own
|
|
8
|
-
* doc comment for the related state-desync problem that scenario causes).
|
|
9
|
-
*
|
|
10
|
-
* Deliberately NOT built on `src/cli.ts`'s own demo-panel/banner overlay
|
|
11
|
-
* system, for the same reason `pilot-v1`'s narrate-mode ring renderer
|
|
12
|
-
* wasn't either (see the git history at tag
|
|
13
|
-
* `waygraph-pilot-v1-logs-prettified`): `cli.ts` runs `main().catch(...)`
|
|
14
|
-
* unconditionally at module load with no `import.meta.url` guard, so
|
|
15
|
-
* importing anything from it here would trigger the whole CLI's argument
|
|
16
|
-
* dispatch as a side effect of loading a library module - unsafe. This
|
|
17
|
-
* ships its own small, purpose-built badge + panel instead.
|
|
18
|
-
*/
|
|
19
1
|
import type { BrowserContext, Page } from "@playwright/test";
|
|
20
2
|
import type { SessionSnapshot } from "./auto-session.js";
|
|
21
3
|
import { type HighlightTone, type DevicePreset, type DeviceState, type TodoDockUiOpts } from "./highlights.js";
|
package/dist/pilot-overlay.js
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A small, self-contained on-page indicator for a live AutoSession -
|
|
3
|
+
* "this browser is being driven by Waygraph," plus an expandable panel
|
|
4
|
+
* showing the session's own current live menu. Real, direct user request:
|
|
5
|
+
* a headful Pilot session looks like an ordinary browser tab with no
|
|
6
|
+
* indication anything is driving it, which matters once a human might be
|
|
7
|
+
* co-driving the same visible session (see `AutoSession.resync()`'s own
|
|
8
|
+
* doc comment for the related state-desync problem that scenario causes).
|
|
9
|
+
*
|
|
10
|
+
* Deliberately NOT built on `src/cli.ts`'s own demo-panel/banner overlay
|
|
11
|
+
* system, for the same reason `pilot-v1`'s narrate-mode ring renderer
|
|
12
|
+
* wasn't either (see the git history at tag
|
|
13
|
+
* `waygraph-pilot-v1-logs-prettified`): `cli.ts` runs `main().catch(...)`
|
|
14
|
+
* unconditionally at module load with no `import.meta.url` guard, so
|
|
15
|
+
* importing anything from it here would trigger the whole CLI's argument
|
|
16
|
+
* dispatch as a side effect of loading a library module - unsafe. This
|
|
17
|
+
* ships its own small, purpose-built badge + panel instead.
|
|
18
|
+
*/
|
|
19
|
+
import { pilotFxRingCss } from "./ui/components/ring.js";
|
|
20
|
+
import { SURFACE } from "./ui/tokens.js";
|
|
1
21
|
import { WAYGRAPH_RING_CSS, normalizeHighlightTone, normalizeHighlightSize, normalizeHighlightWeight, formatHighlightCaption, resolveDeviceState, resolveTodoDockUi, } from "./highlights.js";
|
|
2
22
|
// Real, direct user request: this overlay's own colors were an improvised
|
|
3
23
|
// purple/white scheme (#a78bfa / #1a1033) that didn't match anything else -
|
|
@@ -22,7 +42,7 @@ const OVERLAY_CSS = `
|
|
|
22
42
|
}
|
|
23
43
|
#wg-pilot-panel {
|
|
24
44
|
display: none; margin-top: 6px; max-width: 420px; max-height: 320px;
|
|
25
|
-
overflow-y: auto; background:
|
|
45
|
+
overflow-y: auto; background: ${SURFACE}; color: #fff; border-radius: 8px;
|
|
26
46
|
box-shadow: 0 2px 8px rgba(0,0,0,0.25); padding: 8px 10px;
|
|
27
47
|
}
|
|
28
48
|
/* The graph tab renders a real Mermaid flowchart, which needs more room than
|
|
@@ -55,42 +75,17 @@ const OVERLAY_CSS = `
|
|
|
55
75
|
#wg-pilot-activity {
|
|
56
76
|
position: fixed; z-index: 2147483000; bottom: 12px; left: 12px;
|
|
57
77
|
font: 12px/1.4 ui-monospace, "SF Mono", Consolas, monospace;
|
|
58
|
-
background:
|
|
78
|
+
background: ${SURFACE}; color: #fff; padding: 6px 10px; border-radius: 8px;
|
|
59
79
|
box-shadow: 0 2px 8px rgba(0,0,0,0.25); white-space: nowrap; pointer-events: none;
|
|
60
80
|
opacity: 0; transform: translateY(4px); transition: opacity 0.15s, transform 0.15s;
|
|
61
81
|
}
|
|
62
82
|
#wg-pilot-activity.wg-pilot-toast-show { opacity: 1; transform: translateY(0); }
|
|
63
|
-
/* Agent-sent fixture rings
|
|
64
|
-
|
|
65
|
-
border:3px solid #7C3AED;border-radius:10px;box-sizing:border-box;
|
|
66
|
-
transition:opacity .12s ease,left .12s,top .12s,width .12s,height .12s;}
|
|
67
|
-
.wg-pilot-fx-ring[data-tone=planned]{border-color:#7C3AED;box-shadow:0 0 0 4px rgba(124,58,237,.16);}
|
|
68
|
-
.wg-pilot-fx-ring[data-tone=auto]{border-color:#9CA3AF;box-shadow:0 0 0 4px rgba(156,163,175,.28);}
|
|
69
|
-
.wg-pilot-fx-ring[data-tone=info]{border-color:#3B82F6;box-shadow:0 0 0 4px rgba(59,130,246,.22);}
|
|
70
|
-
.wg-pilot-fx-ring[data-tone=warning]{border-color:#EAB308;box-shadow:0 0 0 4px rgba(234,179,8,.22);}
|
|
71
|
-
.wg-pilot-fx-ring[data-tone=danger]{border-color:#EF4444;box-shadow:0 0 0 4px rgba(239,68,68,.22);}
|
|
72
|
-
.wg-pilot-fx-ring[data-tone=success]{border-color:#22C55E;box-shadow:0 0 0 4px rgba(34,197,94,.22);}
|
|
73
|
-
.wg-pilot-fx-ring[data-tone=orange]{border-color:#F97316;box-shadow:0 0 0 4px rgba(249,115,22,.22);}
|
|
74
|
-
.wg-pilot-fx-label{position:fixed;z-index:2147483645;pointer-events:none;opacity:0;
|
|
75
|
-
font:600 12px/1.3 ui-sans-serif,system-ui,sans-serif;padding:5px 9px;border-radius:6px;
|
|
76
|
-
max-width:min(360px,80vw);box-shadow:0 2px 8px rgba(0,0,0,.25);white-space:nowrap;
|
|
77
|
-
overflow:hidden;text-overflow:ellipsis;transition:opacity .12s ease;}
|
|
78
|
-
.wg-pilot-fx-label[data-tone=planned]{background:#7C3AED;color:#fff;}
|
|
79
|
-
.wg-pilot-fx-label[data-tone=auto]{background:#6B7280;color:#fff;}
|
|
80
|
-
.wg-pilot-fx-label[data-tone=info]{background:#2563EB;color:#fff;}
|
|
81
|
-
.wg-pilot-fx-label[data-tone=warning]{background:#EAB308;color:#1c1917;}
|
|
82
|
-
.wg-pilot-fx-label[data-tone=danger]{background:#DC2626;color:#fff;}
|
|
83
|
-
.wg-pilot-fx-label[data-tone=success]{background:#16A34A;color:#fff;}
|
|
84
|
-
.wg-pilot-fx-label[data-tone=orange]{background:#EA580C;color:#fff;}
|
|
85
|
-
.wg-pilot-fx-ring[data-size=sm]{border-width:1.5px;border-radius:8px;}
|
|
86
|
-
.wg-pilot-fx-ring[data-size=lg]{border-width:4px;border-radius:12px;}
|
|
87
|
-
.wg-pilot-fx-label[data-size=sm]{font-size:10px;padding:4px 7px;}
|
|
88
|
-
.wg-pilot-fx-label[data-size=lg]{font-size:16px;padding:8px 14px;}
|
|
89
|
-
.wg-pilot-fx-label[data-weight=bold]{font-weight:800;}
|
|
83
|
+
/* Agent-sent fixture rings: generated from ui/tokens (tones shared with #wg-ring). */
|
|
84
|
+
${pilotFxRingCss()}
|
|
90
85
|
#wg-pilot-fx-todos{
|
|
91
86
|
position:fixed;z-index:2147483645;top:72px;max-width:280px;max-height:calc(100vh - 100px);overflow:auto;
|
|
92
87
|
font:12px/1.4 ui-sans-serif,system-ui,sans-serif;color:#fff;
|
|
93
|
-
background
|
|
88
|
+
background:${SURFACE};border-radius:10px;padding:10px 12px;
|
|
94
89
|
box-shadow:0 2px 10px rgba(0,0,0,.3);pointer-events:auto;
|
|
95
90
|
transition:opacity .25s ease;
|
|
96
91
|
}
|
|
@@ -113,7 +108,7 @@ const OVERLAY_CSS = `
|
|
|
113
108
|
/* Zoom HUD (demo parity - badge only; no CSS scale of the page). */
|
|
114
109
|
#wg-pilot-fx-zoom{position:fixed;z-index:2147483646;bottom:14px;right:14px;
|
|
115
110
|
display:flex;align-items:center;gap:7px;padding:6px 11px 6px 8px;
|
|
116
|
-
border-radius:999px;background
|
|
111
|
+
border-radius:999px;background:${SURFACE};color:#f0e8ff;
|
|
117
112
|
border:1px solid rgba(250,204,21,.6);box-shadow:0 6px 18px rgba(0,0,0,.4);
|
|
118
113
|
font:700 12px/1.2 system-ui,sans-serif;pointer-events:none;}
|
|
119
114
|
#wg-pilot-fx-zoom .wg-pilot-fx-zoom-ico{width:18px;height:18px;display:flex;align-items:center;justify-content:center;
|
|
@@ -122,7 +117,7 @@ const OVERLAY_CSS = `
|
|
|
122
117
|
#wg-pilot-fx-zoom .wg-pilot-fx-zoom-val{color:#fde68a;font-variant-numeric:tabular-nums;font-weight:800;min-width:3.2em;}
|
|
123
118
|
#wg-pilot-fx-zoom[data-zoomed="1"]{border-color:#fbbf24;}
|
|
124
119
|
#wg-pilot-fx-device{position:fixed;z-index:2147483646;top:14px;right:14px;
|
|
125
|
-
padding:8px 12px;border-radius:10px;background
|
|
120
|
+
padding:8px 12px;border-radius:10px;background:${SURFACE};color:#f0e8ff;
|
|
126
121
|
border:1px solid rgba(124,58,237,.55);font:700 12px/1.2 system-ui,sans-serif;
|
|
127
122
|
pointer-events:none;box-shadow:0 6px 18px rgba(0,0,0,.35);}
|
|
128
123
|
#wg-pilot-fx-device[data-preset=mobile]{border-color:#3B82F6;}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// Moved verbatim from the former CHAIN_RUNNER_SCRIPT template string in cli.ts (see src/ARCHITECTURE.md).
|
|
2
2
|
// Runs inside the target project's own waygraph copy - keep it dependency-light and self-contained.
|
|
3
3
|
import { WAYGRAPH_RING_CSS } from "../highlights.js";
|
|
4
|
+
import { cursorCss } from "../ui/components/cursor.js";
|
|
5
|
+
import { SURFACE } from "../ui/tokens.js";
|
|
4
6
|
|
|
5
7
|
// ---------------------------------------------------------------------------
|
|
6
8
|
// WAYGRAPH_STEP=1 - human-verification overlay: one Block at a time, a
|
|
@@ -26,20 +28,7 @@ export const RING_CSS =
|
|
|
26
28
|
// Travel duration is JS-driven per call via --wg-cursor-ms, same reason
|
|
27
29
|
// the clip engine's own comment gives: a hardcoded CSS duration would
|
|
28
30
|
// make the speed param a no-op.
|
|
29
|
-
|
|
30
|
-
"left:0;top:0;opacity:0;margin:0;" +
|
|
31
|
-
"transition:transform var(--wg-cursor-ms,600ms) cubic-bezier(.22,1,.36,1),opacity .2s ease;" +
|
|
32
|
-
"filter:drop-shadow(0 2px 4px rgba(12,12,26,.4));}" +
|
|
33
|
-
"#wg-click-pulse{position:fixed;z-index:2147483647;width:14px;height:14px;" +
|
|
34
|
-
"margin-left:-7px;margin-top:-7px;border-radius:50%;pointer-events:none;opacity:0;" +
|
|
35
|
-
"border:2px solid #7C3AED;background:rgba(124,58,237,.25);}" +
|
|
36
|
-
"#wg-click-pulse[data-tone=auto]{border-color:#9CA3AF;background:rgba(156,163,175,.28);}" +
|
|
37
|
-
"#wg-click-pulse[data-tone=info]{border-color:#3B82F6;background:rgba(59,130,246,.28);}" +
|
|
38
|
-
"#wg-click-pulse[data-tone=warning]{border-color:#EAB308;background:rgba(234,179,8,.28);}" +
|
|
39
|
-
"#wg-click-pulse[data-tone=danger]{border-color:#EF4444;background:rgba(239,68,68,.28);}" +
|
|
40
|
-
"#wg-click-pulse[data-tone=success]{border-color:#22C55E;background:rgba(34,197,94,.28);}" +
|
|
41
|
-
"#wg-click-pulse.wg-pulse{animation:wg-pulse .5s ease-out;}" +
|
|
42
|
-
"@keyframes wg-pulse{0%{opacity:.9;transform:scale(.4);}100%{opacity:0;transform:scale(2.4);}}" +
|
|
31
|
+
cursorCss() +
|
|
43
32
|
// Spotlight: dim everything except the highlight target (focus: true).
|
|
44
33
|
"#wg-focus-veil{position:fixed;z-index:2147483644;pointer-events:none;" +
|
|
45
34
|
"border-radius:12px;box-shadow:0 0 0 9999px rgba(8,4,20,.62);" +
|
|
@@ -62,7 +51,7 @@ export const RING_CSS =
|
|
|
62
51
|
"#wg-swipe-layer.wg-in .wg-swipe-label{opacity:1;}" +
|
|
63
52
|
"#wg-panel{position:fixed;z-index:2147483647;left:50%;bottom:12px;transform:translateX(-50%);" +
|
|
64
53
|
"max-width:min(92vw,640px);max-height:calc(100vh - 24px);overflow-y:auto;box-sizing:border-box;" +
|
|
65
|
-
"background:
|
|
54
|
+
"background:" + SURFACE + ";color:#fff;border-radius:14px;" +
|
|
66
55
|
"padding:16px 20px;font:14px/1.4 system-ui,sans-serif;box-shadow:0 12px 30px rgba(0,0,0,.35);" +
|
|
67
56
|
// .06s was tuned back when the panel was removed and recreated on
|
|
68
57
|
// EVERY step - fast was the only way to avoid feeling laggy. Now that
|
|
@@ -106,7 +95,7 @@ export const RING_CSS =
|
|
|
106
95
|
// Click a dock to slide left <-> right (WAYGRAPH_TODO_POS / --todo-left|right).
|
|
107
96
|
".wg-todo-dock,#wg-todo-dock{position:fixed;z-index:2147483646;top:72px;left:14px;" +
|
|
108
97
|
"width:min(280px,42vw);max-height:calc(100vh - 100px);overflow:auto;box-sizing:border-box;" +
|
|
109
|
-
"padding:10px 12px;background:
|
|
98
|
+
"padding:10px 12px;background:" + SURFACE + ";color:#fff;border-radius:12px;" +
|
|
110
99
|
"border:1px solid rgba(124,58,237,.45);box-shadow:0 8px 24px rgba(0,0,0,.35);" +
|
|
111
100
|
"pointer-events:auto;cursor:pointer;" +
|
|
112
101
|
"transition:transform .4s cubic-bezier(.22,1,.36,1),top .35s ease,opacity .25s ease,z-index 0s;transform:translateX(0);}" +
|
|
@@ -147,7 +136,7 @@ export const RING_CSS =
|
|
|
147
136
|
// Always-on zoom HUD - bottom-right (top-left is crowded: todos + banners).
|
|
148
137
|
"#wg-zoom-badge{position:fixed;z-index:2147483646;bottom:14px;right:14px;" +
|
|
149
138
|
"display:flex;align-items:center;gap:7px;padding:6px 11px 6px 8px;" +
|
|
150
|
-
"border-radius:999px;background:
|
|
139
|
+
"border-radius:999px;background:" + SURFACE + ";color:#f0e8ff;" +
|
|
151
140
|
"border:1px solid rgba(250,204,21,.6);box-shadow:0 6px 18px rgba(0,0,0,.4);" +
|
|
152
141
|
"font:700 12px/1.2 system-ui,sans-serif;pointer-events:none;" +
|
|
153
142
|
"opacity:1;transform:translateY(0);}" +
|
|
@@ -255,7 +244,7 @@ export const RING_CSS =
|
|
|
255
244
|
"#wg-modules .wg-mod-current{background:#7C3AED;color:#fff;}" +
|
|
256
245
|
"#wg-modules .wg-mod-upcoming{background:transparent;color:#5a4a80;border:1px solid #3a2a60;}" +
|
|
257
246
|
"#wg-banner{position:fixed;z-index:2147483647;top:14px;max-width:320px;" +
|
|
258
|
-
"background:
|
|
247
|
+
"background:" + SURFACE + ";color:#fff;border-radius:12px;padding:10px 16px;" +
|
|
259
248
|
"font:14px/1.4 system-ui,sans-serif;box-shadow:0 8px 20px rgba(0,0,0,.3);" +
|
|
260
249
|
"border:1px solid rgba(124,58,237,.4);cursor:pointer;user-select:none;}" +
|
|
261
250
|
"#wg-banner[data-pos=left]{left:14px;right:auto;transform:none;}" +
|
package/dist/step-overlay.js
CHANGED
|
@@ -1,49 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// Opacity only - tone color must snap (no gray/purple/yellow morph).
|
|
4
|
-
"transition:opacity .3s ease;}" +
|
|
5
|
-
// Automation = gray; semantic tones for authored highlights.
|
|
6
|
-
"#wg-ring[data-tone=planned]{border-color:#7C3AED;box-shadow:0 0 0 4px rgba(124,58,237,.16);}" +
|
|
7
|
-
"#wg-ring[data-tone=auto]{border-color:#9CA3AF;box-shadow:0 0 0 4px rgba(156,163,175,.28);}" +
|
|
8
|
-
"#wg-ring[data-tone=info]{border-color:#3B82F6;box-shadow:0 0 0 4px rgba(59,130,246,.22);}" +
|
|
9
|
-
"#wg-ring[data-tone=warning]{border-color:#EAB308;box-shadow:0 0 0 4px rgba(234,179,8,.22);}" +
|
|
10
|
-
"#wg-ring[data-tone=danger]{border-color:#EF4444;box-shadow:0 0 0 4px rgba(239,68,68,.22);}" +
|
|
11
|
-
"#wg-ring[data-tone=success]{border-color:#22C55E;box-shadow:0 0 0 4px rgba(34,197,94,.22);}" +
|
|
12
|
-
"#wg-ring-label{position:fixed;z-index:2147483646;pointer-events:none;opacity:0;" +
|
|
13
|
-
"white-space:nowrap;padding:4px 9px;border-radius:7px;background:#7C3AED;color:#fff;" +
|
|
14
|
-
"font:600 12px/1.2 system-ui,sans-serif;transition:opacity .3s ease;}" +
|
|
15
|
-
"#wg-ring-label[data-tone=planned]{background:#7C3AED;color:#fff;}" +
|
|
16
|
-
"#wg-ring-label[data-tone=auto]{background:#6B7280;color:#fff;}" +
|
|
17
|
-
"#wg-ring-label[data-tone=info]{background:#2563EB;color:#fff;}" +
|
|
18
|
-
"#wg-ring-label[data-tone=warning]{background:#EAB308;color:#1c1917;}" +
|
|
19
|
-
"#wg-ring-label[data-tone=danger]{background:#DC2626;color:#fff;}" +
|
|
20
|
-
"#wg-ring-label[data-tone=success]{background:#16A34A;color:#fff;}" +
|
|
21
|
-
"#wg-ring[data-size=sm]{border-width:1.5px;border-radius:8px;}" +
|
|
22
|
-
"#wg-ring[data-size=lg]{border-width:4px;border-radius:12px;}" +
|
|
23
|
-
"#wg-ring-label[data-size=sm]{font-size:10px;line-height:1.25;padding:4px 7px;border-radius:5px;}" +
|
|
24
|
-
"#wg-ring-label[data-size=lg]{font-size:16px;line-height:1.35;padding:8px 14px;border-radius:9px;}" +
|
|
25
|
-
"#wg-ring-label[data-weight=bold]{font-weight:800;}" +
|
|
26
|
-
"#wg-ring-label[data-weight=normal]{font-weight:600;}" +
|
|
27
|
-
"#wg-cursor{position:fixed;z-index:2147483647;width:24px;height:24px;pointer-events:none;" +
|
|
28
|
-
"left:0;top:0;opacity:0;margin:0;" +
|
|
29
|
-
"transition:transform var(--wg-cursor-ms,600ms) cubic-bezier(.22,1,.36,1),opacity .2s ease;" +
|
|
30
|
-
"filter:drop-shadow(0 2px 4px rgba(12,12,26,.4));}" +
|
|
31
|
-
"#wg-click-pulse{position:fixed;z-index:2147483647;width:14px;height:14px;" +
|
|
32
|
-
"margin-left:-7px;margin-top:-7px;border-radius:50%;pointer-events:none;opacity:0;" +
|
|
33
|
-
"border:2px solid #7C3AED;background:rgba(124,58,237,.25);}" +
|
|
34
|
-
"#wg-click-pulse[data-tone=auto]{border-color:#9CA3AF;background:rgba(156,163,175,.28);}" +
|
|
35
|
-
"#wg-click-pulse[data-tone=info]{border-color:#3B82F6;background:rgba(59,130,246,.28);}" +
|
|
36
|
-
"#wg-click-pulse[data-tone=warning]{border-color:#EAB308;background:rgba(234,179,8,.28);}" +
|
|
37
|
-
"#wg-click-pulse[data-tone=danger]{border-color:#EF4444;background:rgba(239,68,68,.28);}" +
|
|
38
|
-
"#wg-click-pulse[data-tone=success]{border-color:#22C55E;background:rgba(34,197,94,.28);}" +
|
|
39
|
-
"#wg-click-pulse.wg-pulse{animation:wg-pulse .5s ease-out;}" +
|
|
40
|
-
"@keyframes wg-pulse{0%{opacity:.9;transform:scale(.4);}100%{opacity:0;transform:scale(2.4);}}" +
|
|
41
|
-
"#wg-banner{position:fixed;z-index:2147483647;top:14px;left:14px;" +
|
|
42
|
-
"background:rgba(20,10,40,.94);color:#fff;border-radius:12px;padding:10px 16px;" +
|
|
43
|
-
"font:14px/1.4 system-ui,sans-serif;box-shadow:0 8px 20px rgba(0,0,0,.3);" +
|
|
44
|
-
"border:1px solid rgba(124,58,237,.4);}" +
|
|
45
|
-
"#wg-banner .wg-banner-tag{display:block;font-size:10px;font-weight:700;color:#c9a6ff;" +
|
|
46
|
-
"letter-spacing:.05em;text-transform:uppercase;margin-bottom:2px;}";
|
|
1
|
+
import { composeStepOverlay } from "./ui/compose.js";
|
|
2
|
+
const RING_CSS = composeStepOverlay();
|
|
47
3
|
const FAVICON = "data:image/svg+xml," +
|
|
48
4
|
encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><circle cx='16' cy='16' r='14' fill='#7C3AED'/></svg>");
|
|
49
5
|
export async function installDemoChrome(page, title = "waygraph auto", options = {}) {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ACCENT_SOFT, SURFACE } from "../tokens.js";
|
|
2
|
+
/** Top-left demo banner (`#wg-banner`). */
|
|
3
|
+
export function bannerCss() {
|
|
4
|
+
return ("#wg-banner{position:fixed;z-index:2147483647;top:14px;left:14px;" +
|
|
5
|
+
`background:${SURFACE};color:#fff;border-radius:12px;padding:10px 16px;` +
|
|
6
|
+
"font:14px/1.4 system-ui,sans-serif;box-shadow:0 8px 20px rgba(0,0,0,.3);" +
|
|
7
|
+
"border:1px solid rgba(124,58,237,.4);}" +
|
|
8
|
+
`#wg-banner .wg-banner-tag{display:block;font-size:10px;font-weight:700;color:${ACCENT_SOFT};` +
|
|
9
|
+
"letter-spacing:.05em;text-transform:uppercase;margin-bottom:2px;}");
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TONES } from "../tokens.js";
|
|
2
|
+
/** Travelling mouse cursor + click ripple (`#wg-cursor`, `#wg-click-pulse`). */
|
|
3
|
+
export function cursorCss() {
|
|
4
|
+
const p = TONES.planned;
|
|
5
|
+
const pulseTones = ["auto", "info", "warning", "danger", "success"]
|
|
6
|
+
.map((n) => `#wg-click-pulse[data-tone=${n}]{border-color:${TONES[n].ring};background:${TONES[n].pulse};}`)
|
|
7
|
+
.join("");
|
|
8
|
+
return ("#wg-cursor{position:fixed;z-index:2147483647;width:24px;height:24px;pointer-events:none;" +
|
|
9
|
+
"left:0;top:0;opacity:0;margin:0;" +
|
|
10
|
+
// Travel time is JS-driven via --wg-cursor-ms (a hardcoded duration would make speed a no-op).
|
|
11
|
+
"transition:transform var(--wg-cursor-ms,600ms) cubic-bezier(.22,1,.36,1),opacity .2s ease;" +
|
|
12
|
+
"filter:drop-shadow(0 2px 4px rgba(12,12,26,.4));}" +
|
|
13
|
+
"#wg-click-pulse{position:fixed;z-index:2147483647;width:14px;height:14px;" +
|
|
14
|
+
"margin-left:-7px;margin-top:-7px;border-radius:50%;pointer-events:none;opacity:0;" +
|
|
15
|
+
`border:2px solid ${p.ring};background:${p.pulse};}` +
|
|
16
|
+
pulseTones +
|
|
17
|
+
"#wg-click-pulse.wg-pulse{animation:wg-pulse .5s ease-out;}" +
|
|
18
|
+
"@keyframes wg-pulse{0%{opacity:.9;transform:scale(.4);}100%{opacity:0;transform:scale(2.4);}}");
|
|
19
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** The highlight ring + its label (`#wg-ring`, `#wg-ring-label`): tone / size / weight variants. */
|
|
2
|
+
export declare function ringCss(): string;
|
|
3
|
+
/** Agent-sent pilot fixture rings/labels (`.wg-pilot-fx-ring|label`), same tones as the demo ring. */
|
|
4
|
+
export declare function pilotFxRingCss(): string;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { TONES } from "../tokens.js";
|
|
2
|
+
const toneNames = Object.keys(TONES);
|
|
3
|
+
/** Tone rules for `sel[data-tone=x]{...}` from the token table. */
|
|
4
|
+
function toneRules(sel, decl, only) {
|
|
5
|
+
return (only ?? toneNames).map((n) => `${sel}[data-tone=${n}]{${decl(TONES[n])}}`).join("");
|
|
6
|
+
}
|
|
7
|
+
/** The highlight ring + its label (`#wg-ring`, `#wg-ring-label`): tone / size / weight variants. */
|
|
8
|
+
export function ringCss() {
|
|
9
|
+
const p = TONES.planned;
|
|
10
|
+
return ("#wg-ring{position:fixed;z-index:2147483646;pointer-events:none;opacity:0;" +
|
|
11
|
+
`border:2.5px solid ${p.ring};border-radius:10px;` +
|
|
12
|
+
// Opacity fade only - NEVER transition border-color/box-shadow: tone swaps must snap.
|
|
13
|
+
`box-shadow:0 0 0 4px ${p.glow};transition:opacity .3s ease;}` +
|
|
14
|
+
toneRules("#wg-ring", (t) => `border-color:${t.ring};box-shadow:0 0 0 4px ${t.glow};`) +
|
|
15
|
+
// A real element (not ::after) so JS can measure it and clamp it back onto the screen.
|
|
16
|
+
"#wg-ring-label{position:fixed;z-index:2147483646;pointer-events:none;opacity:0;" +
|
|
17
|
+
`max-width:min(360px,70vw);white-space:normal;padding:6px 10px;border-radius:7px;background:${p.labelBg};color:${p.labelFg};` +
|
|
18
|
+
"font:600 12px/1.35 system-ui,sans-serif;transition:opacity .3s ease;}" +
|
|
19
|
+
toneRules("#wg-ring-label", (t) => `background:${t.labelBg};color:${t.labelFg};`) +
|
|
20
|
+
"#wg-ring[data-size=sm]{border-width:1.5px;border-radius:8px;}" +
|
|
21
|
+
"#wg-ring[data-size=lg]{border-width:4px;border-radius:12px;}" +
|
|
22
|
+
"#wg-ring-label[data-size=sm]{font-size:10px;line-height:1.25;padding:4px 7px;border-radius:5px;}" +
|
|
23
|
+
"#wg-ring-label[data-size=lg]{font-size:16px;line-height:1.35;padding:8px 14px;border-radius:9px;max-width:min(480px,85vw);}" +
|
|
24
|
+
"#wg-ring-label[data-weight=bold]{font-weight:800;}" +
|
|
25
|
+
"#wg-ring-label[data-weight=normal]{font-weight:600;}");
|
|
26
|
+
}
|
|
27
|
+
/** Agent-sent pilot fixture rings/labels (`.wg-pilot-fx-ring|label`), same tones as the demo ring. */
|
|
28
|
+
export function pilotFxRingCss() {
|
|
29
|
+
const p = TONES.planned;
|
|
30
|
+
return (".wg-pilot-fx-ring{position:fixed;z-index:2147483645;pointer-events:none;opacity:0;" +
|
|
31
|
+
`border:3px solid ${p.ring};border-radius:10px;box-sizing:border-box;` +
|
|
32
|
+
"transition:opacity .12s ease,left .12s,top .12s,width .12s,height .12s;}" +
|
|
33
|
+
toneRules(".wg-pilot-fx-ring", (t) => `border-color:${t.ring};box-shadow:0 0 0 4px ${t.glow};`) +
|
|
34
|
+
".wg-pilot-fx-label{position:fixed;z-index:2147483645;pointer-events:none;opacity:0;" +
|
|
35
|
+
"font:600 12px/1.3 ui-sans-serif,system-ui,sans-serif;padding:5px 9px;border-radius:6px;" +
|
|
36
|
+
"max-width:min(360px,80vw);box-shadow:0 2px 8px rgba(0,0,0,.25);white-space:nowrap;" +
|
|
37
|
+
"overflow:hidden;text-overflow:ellipsis;transition:opacity .12s ease;}" +
|
|
38
|
+
toneRules(".wg-pilot-fx-label", (t) => `background:${t.labelBg};color:${t.labelFg};`) +
|
|
39
|
+
".wg-pilot-fx-ring[data-size=sm]{border-width:1.5px;border-radius:8px;}" +
|
|
40
|
+
".wg-pilot-fx-ring[data-size=lg]{border-width:4px;border-radius:12px;}" +
|
|
41
|
+
".wg-pilot-fx-label[data-size=sm]{font-size:10px;padding:4px 7px;}" +
|
|
42
|
+
".wg-pilot-fx-label[data-size=lg]{font-size:16px;padding:8px 14px;}" +
|
|
43
|
+
".wg-pilot-fx-label[data-weight=bold]{font-weight:800;}");
|
|
44
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { bannerCss } from "./components/banner.js";
|
|
2
|
+
import { cursorCss } from "./components/cursor.js";
|
|
3
|
+
import { pilotFxRingCss, ringCss } from "./components/ring.js";
|
|
4
|
+
/** Surface bundles: each surface asks only for the components it paints. */
|
|
5
|
+
export const composeRing = () => ringCss();
|
|
6
|
+
export const composeStepOverlay = () => ringCss() + cursorCss() + bannerCss();
|
|
7
|
+
export const composePilotFx = () => ringCss() + pilotFxRingCss();
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Design tokens for every waygraph overlay surface (demo stepper, pilot badge/panel,
|
|
3
|
+
* step overlay). The one place a colour changes: components in ./components build their
|
|
4
|
+
* CSS from these, so surfaces cannot drift apart.
|
|
5
|
+
*/
|
|
6
|
+
export type ToneName = "planned" | "auto" | "info" | "warning" | "danger" | "success" | "orange";
|
|
7
|
+
export interface Tone {
|
|
8
|
+
/** Ring border + click-pulse border. */
|
|
9
|
+
ring: string;
|
|
10
|
+
/** Ring halo (box-shadow) colour. */
|
|
11
|
+
glow: string;
|
|
12
|
+
/** Click-pulse fill. */
|
|
13
|
+
pulse: string;
|
|
14
|
+
/** Label background / foreground. */
|
|
15
|
+
labelBg: string;
|
|
16
|
+
labelFg: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const TONES: Record<ToneName, Tone>;
|
|
19
|
+
/** Dark surface shared by panels, banner, docks, HUD chips. */
|
|
20
|
+
export declare const SURFACE = "rgba(20,10,40,.94)";
|
|
21
|
+
export declare const ACCENT = "#7C3AED";
|
|
22
|
+
/** Secondary accent used on the dark surface (section titles, kinds). */
|
|
23
|
+
export declare const ACCENT_SOFT = "#c9a6ff";
|
|
24
|
+
/** Stacking order: one scale instead of magic numbers. */
|
|
25
|
+
export declare const Z: {
|
|
26
|
+
readonly top: 2147483647;
|
|
27
|
+
readonly ring: 2147483646;
|
|
28
|
+
readonly fx: 2147483645;
|
|
29
|
+
readonly focus: 2147483644;
|
|
30
|
+
readonly dock: 2147483000;
|
|
31
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Design tokens for every waygraph overlay surface (demo stepper, pilot badge/panel,
|
|
3
|
+
* step overlay). The one place a colour changes: components in ./components build their
|
|
4
|
+
* CSS from these, so surfaces cannot drift apart.
|
|
5
|
+
*/
|
|
6
|
+
export const TONES = {
|
|
7
|
+
planned: { ring: "#7C3AED", glow: "rgba(124,58,237,.16)", pulse: "rgba(124,58,237,.25)", labelBg: "#7C3AED", labelFg: "#fff" },
|
|
8
|
+
auto: { ring: "#9CA3AF", glow: "rgba(156,163,175,.28)", pulse: "rgba(156,163,175,.28)", labelBg: "#6B7280", labelFg: "#fff" },
|
|
9
|
+
info: { ring: "#3B82F6", glow: "rgba(59,130,246,.22)", pulse: "rgba(59,130,246,.28)", labelBg: "#2563EB", labelFg: "#fff" },
|
|
10
|
+
warning: { ring: "#EAB308", glow: "rgba(234,179,8,.22)", pulse: "rgba(234,179,8,.28)", labelBg: "#EAB308", labelFg: "#1c1917" },
|
|
11
|
+
danger: { ring: "#EF4444", glow: "rgba(239,68,68,.22)", pulse: "rgba(239,68,68,.28)", labelBg: "#DC2626", labelFg: "#fff" },
|
|
12
|
+
success: { ring: "#22C55E", glow: "rgba(34,197,94,.22)", pulse: "rgba(34,197,94,.28)", labelBg: "#16A34A", labelFg: "#fff" },
|
|
13
|
+
orange: { ring: "#F97316", glow: "rgba(249,115,22,.22)", pulse: "rgba(249,115,22,.28)", labelBg: "#EA580C", labelFg: "#fff" },
|
|
14
|
+
};
|
|
15
|
+
/** Dark surface shared by panels, banner, docks, HUD chips. */
|
|
16
|
+
export const SURFACE = "rgba(20,10,40,.94)";
|
|
17
|
+
export const ACCENT = "#7C3AED";
|
|
18
|
+
/** Secondary accent used on the dark surface (section titles, kinds). */
|
|
19
|
+
export const ACCENT_SOFT = "#c9a6ff";
|
|
20
|
+
/** Stacking order: one scale instead of magic numbers. */
|
|
21
|
+
export const Z = { top: 2147483647, ring: 2147483646, fx: 2147483645, focus: 2147483644, dock: 2147483000 };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|