@holostaff/sdk 0.4.0 → 0.4.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/dist/widget.d.ts +27 -17
- package/dist/widget.d.ts.map +1 -1
- package/dist/widget.js +194 -65
- package/dist/widget.js.map +1 -1
- package/package.json +1 -1
package/dist/widget.d.ts
CHANGED
|
@@ -1,20 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Widget —
|
|
2
|
+
* Widget — the intervention card.
|
|
3
3
|
*
|
|
4
4
|
* Listens to the SSE command channel for `fire_intervention` events
|
|
5
|
-
* and renders
|
|
6
|
-
* dismiss / engage
|
|
5
|
+
* and renders the copilot's message as a card in the host page,
|
|
6
|
+
* reporting dismiss / engage / ignore outcomes back to /outcome.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* - Single visible widget at a time. A new event while one is open
|
|
12
|
-
* replaces it (and reports 'ignored' for the prior).
|
|
13
|
-
* - No theming. Inline-styled floating pill, fixed lower-right.
|
|
8
|
+
* Appearance & lifecycle (redesigned with UX best practices after the
|
|
9
|
+
* first live dogfood session — the v1 pill could linger after its
|
|
10
|
+
* outcome resolved and carried no copilot identity):
|
|
14
11
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
12
|
+
* - IDENTITY FIRST. Every card leads with the copilot's avatar and
|
|
13
|
+
* name — the visitor always knows who is speaking. Missing avatar
|
|
14
|
+
* degrades to an initial-letter monogram, never an empty box.
|
|
15
|
+
* - RELEVANT OR SILENT. The server stamps the route the decision
|
|
16
|
+
* was made for; if the visitor has navigated since (stale fire),
|
|
17
|
+
* the card is not rendered and the outcome reports 'ignored'.
|
|
18
|
+
* - ANIMATED IN, ANIMATED OUT, THEN GONE. Entry: fade + 12px rise
|
|
19
|
+
* (240ms ease-out). Exit: fade + fall (180ms), and the DOM node is
|
|
20
|
+
* removed on transition end — no ghost cards. `prefers-reduced-
|
|
21
|
+
* motion` skips both.
|
|
22
|
+
* - ATTENTION IS BORROWED, NOT STOLEN. aria-live=polite (no focus
|
|
23
|
+
* steal), auto-ignore after 30s — but the timer PAUSES while the
|
|
24
|
+
* visitor hovers or focuses the card and resumes on leave, so
|
|
25
|
+
* reading slowly never counts as ignoring.
|
|
26
|
+
* - ONE CARD AT A TIME. A new fire animates the old card out (as
|
|
27
|
+
* 'ignored') before the new one enters.
|
|
28
|
+
* - Shadow-DOM isolated: host CSS can't bleed in, ours can't bleed
|
|
29
|
+
* out.
|
|
30
|
+
*
|
|
31
|
+
* Outcomes: ✕ → 'dismissed' · "Got it" → 'engaged' · 30s of unpaused
|
|
32
|
+
* inattention or stale-route skip → 'ignored'.
|
|
18
33
|
*/
|
|
19
34
|
import { type TransportConfig } from './transport.js';
|
|
20
35
|
export interface WidgetBindingDeps {
|
|
@@ -29,10 +44,5 @@ export interface WidgetBindingDeps {
|
|
|
29
44
|
export interface WidgetBinding {
|
|
30
45
|
dispose(): void;
|
|
31
46
|
}
|
|
32
|
-
/**
|
|
33
|
-
* Start the widget subsystem. Subscribes to the SSE `fire_intervention`
|
|
34
|
-
* event and shows the text pill when one arrives. Idempotent in the
|
|
35
|
-
* sense that the SDK singleton ensures one binding per session.
|
|
36
|
-
*/
|
|
37
47
|
export declare function startWidget(deps: WidgetBindingDeps): WidgetBinding;
|
|
38
48
|
//# sourceMappingURL=widget.d.ts.map
|
package/dist/widget.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../src/widget.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../src/widget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAW/D,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,eAAe,CAAA;IACpB,sFAAsF;IACtF,YAAY,EAAE,MAAM,MAAM,CAAA;IAC1B,mEAAmE;IACnE,SAAS,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACxC,gEAAgE;IAChE,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;CAC3B;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,IAAI,IAAI,CAAA;CAChB;AAaD,wBAAgB,WAAW,CAAC,IAAI,EAAE,iBAAiB,GAAG,aAAa,CAoElE"}
|
package/dist/widget.js
CHANGED
|
@@ -1,36 +1,55 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Widget —
|
|
2
|
+
* Widget — the intervention card.
|
|
3
3
|
*
|
|
4
4
|
* Listens to the SSE command channel for `fire_intervention` events
|
|
5
|
-
* and renders
|
|
6
|
-
* dismiss / engage
|
|
5
|
+
* and renders the copilot's message as a card in the host page,
|
|
6
|
+
* reporting dismiss / engage / ignore outcomes back to /outcome.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* - Single visible widget at a time. A new event while one is open
|
|
12
|
-
* replaces it (and reports 'ignored' for the prior).
|
|
13
|
-
* - No theming. Inline-styled floating pill, fixed lower-right.
|
|
8
|
+
* Appearance & lifecycle (redesigned with UX best practices after the
|
|
9
|
+
* first live dogfood session — the v1 pill could linger after its
|
|
10
|
+
* outcome resolved and carried no copilot identity):
|
|
14
11
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
12
|
+
* - IDENTITY FIRST. Every card leads with the copilot's avatar and
|
|
13
|
+
* name — the visitor always knows who is speaking. Missing avatar
|
|
14
|
+
* degrades to an initial-letter monogram, never an empty box.
|
|
15
|
+
* - RELEVANT OR SILENT. The server stamps the route the decision
|
|
16
|
+
* was made for; if the visitor has navigated since (stale fire),
|
|
17
|
+
* the card is not rendered and the outcome reports 'ignored'.
|
|
18
|
+
* - ANIMATED IN, ANIMATED OUT, THEN GONE. Entry: fade + 12px rise
|
|
19
|
+
* (240ms ease-out). Exit: fade + fall (180ms), and the DOM node is
|
|
20
|
+
* removed on transition end — no ghost cards. `prefers-reduced-
|
|
21
|
+
* motion` skips both.
|
|
22
|
+
* - ATTENTION IS BORROWED, NOT STOLEN. aria-live=polite (no focus
|
|
23
|
+
* steal), auto-ignore after 30s — but the timer PAUSES while the
|
|
24
|
+
* visitor hovers or focuses the card and resumes on leave, so
|
|
25
|
+
* reading slowly never counts as ignoring.
|
|
26
|
+
* - ONE CARD AT A TIME. A new fire animates the old card out (as
|
|
27
|
+
* 'ignored') before the new one enters.
|
|
28
|
+
* - Shadow-DOM isolated: host CSS can't bleed in, ours can't bleed
|
|
29
|
+
* out.
|
|
30
|
+
*
|
|
31
|
+
* Outcomes: ✕ → 'dismissed' · "Got it" → 'engaged' · 30s of unpaused
|
|
32
|
+
* inattention or stale-route skip → 'ignored'.
|
|
18
33
|
*/
|
|
19
34
|
import { postJson } from './transport.js';
|
|
20
|
-
/** Auto-
|
|
35
|
+
/** Auto-ignore timeout — runtime doc §9.1 'ignored' outcome. */
|
|
21
36
|
const AUTO_DISMISS_MS = 30000;
|
|
37
|
+
const ENTER_MS = 240;
|
|
38
|
+
const EXIT_MS = 180;
|
|
22
39
|
/** Container id — single instance per page. */
|
|
23
40
|
const CONTAINER_ID = 'holostaff-widget-root';
|
|
24
|
-
/**
|
|
25
|
-
* Start the widget subsystem. Subscribes to the SSE `fire_intervention`
|
|
26
|
-
* event and shows the text pill when one arrives. Idempotent in the
|
|
27
|
-
* sense that the SDK singleton ensures one binding per session.
|
|
28
|
-
*/
|
|
29
41
|
export function startWidget(deps) {
|
|
30
42
|
if (typeof window === 'undefined' || !deps.source) {
|
|
31
43
|
return { dispose: () => { } };
|
|
32
44
|
}
|
|
33
45
|
let currentWidget = null;
|
|
46
|
+
const reportOutcome = (interventionId, outcome) => {
|
|
47
|
+
void postJson(deps.cfg, `/api/runtime/sessions/${deps.getSessionId()}/outcome`, {
|
|
48
|
+
...deps.buildBody(),
|
|
49
|
+
interventionId,
|
|
50
|
+
outcome,
|
|
51
|
+
});
|
|
52
|
+
};
|
|
34
53
|
const onFire = (rawEvent) => {
|
|
35
54
|
let parsed = null;
|
|
36
55
|
try {
|
|
@@ -44,12 +63,22 @@ export function startWidget(deps) {
|
|
|
44
63
|
}
|
|
45
64
|
if (!parsed)
|
|
46
65
|
return;
|
|
47
|
-
// Modality gate — only text is
|
|
66
|
+
// Modality gate — only text is renderable in this build.
|
|
48
67
|
if (parsed.modality !== 'text') {
|
|
49
68
|
deps.cfg.onError?.(new Error(`Modality '${parsed.modality}' is not supported in this SDK build`), { method: 'WIDGET', path: '(fire_intervention)' });
|
|
50
69
|
return;
|
|
51
70
|
}
|
|
52
|
-
//
|
|
71
|
+
// Stale-fire guard: the decision was made for a route the visitor
|
|
72
|
+
// has already left. Showing it now would be a non-sequitur — skip
|
|
73
|
+
// the render, close the loop as 'ignored'.
|
|
74
|
+
if (parsed.route) {
|
|
75
|
+
const decidedPath = parsed.route.split('?')[0];
|
|
76
|
+
if (decidedPath && decidedPath !== window.location.pathname) {
|
|
77
|
+
reportOutcome(parsed.interventionId, 'ignored');
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// One card at a time — retire the old one as 'ignored'.
|
|
53
82
|
if (currentWidget) {
|
|
54
83
|
currentWidget.reportAndClose('ignored');
|
|
55
84
|
}
|
|
@@ -73,59 +102,131 @@ export function startWidget(deps) {
|
|
|
73
102
|
function renderWidget(deps, event, onClosed) {
|
|
74
103
|
const container = ensureContainer();
|
|
75
104
|
const root = container.shadowRoot;
|
|
76
|
-
//
|
|
105
|
+
// Defensive single-card invariant.
|
|
77
106
|
root.innerHTML = '';
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
107
|
+
const reducedMotion = typeof window.matchMedia === 'function'
|
|
108
|
+
&& window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
109
|
+
const card = document.createElement('div');
|
|
110
|
+
card.className = 'card enter';
|
|
111
|
+
card.setAttribute('role', 'status');
|
|
112
|
+
card.setAttribute('aria-live', 'polite');
|
|
113
|
+
card.setAttribute('data-intervention-id', event.interventionId);
|
|
114
|
+
// -- Header: avatar + name + dismiss ---------------------------------
|
|
115
|
+
const head = document.createElement('div');
|
|
116
|
+
head.className = 'head';
|
|
117
|
+
const copilotName = event.copilot?.name?.trim() || 'Copilot';
|
|
118
|
+
const avatarUrl = event.copilot?.avatar?.trim() || '';
|
|
119
|
+
if (avatarUrl) {
|
|
120
|
+
const avatar = document.createElement('img');
|
|
121
|
+
avatar.className = 'avatar';
|
|
122
|
+
avatar.src = avatarUrl;
|
|
123
|
+
avatar.alt = '';
|
|
124
|
+
avatar.referrerPolicy = 'no-referrer';
|
|
125
|
+
// Broken avatar URL → swap in the monogram rather than the
|
|
126
|
+
// browser's broken-image glyph.
|
|
127
|
+
avatar.addEventListener('error', () => {
|
|
128
|
+
avatar.replaceWith(monogram(copilotName));
|
|
129
|
+
});
|
|
130
|
+
head.appendChild(avatar);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
head.appendChild(monogram(copilotName));
|
|
134
|
+
}
|
|
135
|
+
const name = document.createElement('div');
|
|
136
|
+
name.className = 'name';
|
|
137
|
+
name.textContent = copilotName;
|
|
138
|
+
head.appendChild(name);
|
|
139
|
+
const dismissBtn = document.createElement('button');
|
|
140
|
+
dismissBtn.className = 'x';
|
|
141
|
+
dismissBtn.type = 'button';
|
|
142
|
+
dismissBtn.setAttribute('aria-label', 'Dismiss');
|
|
143
|
+
dismissBtn.textContent = '✕';
|
|
144
|
+
head.appendChild(dismissBtn);
|
|
145
|
+
// -- Message + actions ------------------------------------------------
|
|
83
146
|
const message = document.createElement('div');
|
|
84
147
|
message.className = 'message';
|
|
85
148
|
message.textContent = event.content || event.goal;
|
|
86
149
|
const actions = document.createElement('div');
|
|
87
150
|
actions.className = 'actions';
|
|
88
|
-
const dismissBtn = document.createElement('button');
|
|
89
|
-
dismissBtn.className = 'btn dismiss';
|
|
90
|
-
dismissBtn.type = 'button';
|
|
91
|
-
dismissBtn.textContent = 'Dismiss';
|
|
92
151
|
const engageBtn = document.createElement('button');
|
|
93
152
|
engageBtn.className = 'btn engage';
|
|
94
153
|
engageBtn.type = 'button';
|
|
95
154
|
engageBtn.textContent = 'Got it';
|
|
96
|
-
actions.appendChild(dismissBtn);
|
|
97
155
|
actions.appendChild(engageBtn);
|
|
98
|
-
|
|
99
|
-
|
|
156
|
+
card.appendChild(head);
|
|
157
|
+
card.appendChild(message);
|
|
158
|
+
card.appendChild(actions);
|
|
100
159
|
root.appendChild(styleNode());
|
|
101
|
-
root.appendChild(
|
|
160
|
+
root.appendChild(card);
|
|
161
|
+
// Entry animation — next frame so the transition actually runs.
|
|
162
|
+
if (reducedMotion) {
|
|
163
|
+
card.classList.remove('enter');
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
requestAnimationFrame(() => requestAnimationFrame(() => card.classList.remove('enter')));
|
|
167
|
+
}
|
|
168
|
+
// -- Auto-ignore timer: pauses on hover/focus, resumes on leave ------
|
|
102
169
|
let closed = false;
|
|
103
|
-
let
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
|
|
170
|
+
let remainingMs = AUTO_DISMISS_MS;
|
|
171
|
+
let deadlineTimer = null;
|
|
172
|
+
let timerStartedAt = 0;
|
|
173
|
+
const startTimer = () => {
|
|
174
|
+
if (closed)
|
|
175
|
+
return;
|
|
176
|
+
timerStartedAt = Date.now();
|
|
177
|
+
deadlineTimer = setTimeout(() => instance.reportAndClose('ignored'), remainingMs);
|
|
178
|
+
};
|
|
179
|
+
const pauseTimer = () => {
|
|
180
|
+
if (deadlineTimer == null)
|
|
181
|
+
return;
|
|
182
|
+
clearTimeout(deadlineTimer);
|
|
183
|
+
deadlineTimer = null;
|
|
184
|
+
remainingMs = Math.max(1000, remainingMs - (Date.now() - timerStartedAt));
|
|
185
|
+
};
|
|
186
|
+
card.addEventListener('mouseenter', pauseTimer);
|
|
187
|
+
card.addEventListener('focusin', pauseTimer);
|
|
188
|
+
card.addEventListener('mouseleave', startTimer);
|
|
189
|
+
card.addEventListener('focusout', startTimer);
|
|
190
|
+
startTimer();
|
|
191
|
+
const sendOutcome = (outcome) => {
|
|
192
|
+
void postJson(deps.cfg, `/api/runtime/sessions/${deps.getSessionId()}/outcome`, {
|
|
108
193
|
...deps.buildBody(),
|
|
109
194
|
interventionId: event.interventionId,
|
|
110
195
|
outcome,
|
|
111
|
-
};
|
|
112
|
-
void postJson(deps.cfg, `/api/runtime/sessions/${deps.getSessionId()}/outcome`, body);
|
|
196
|
+
});
|
|
113
197
|
};
|
|
114
198
|
const close = (outcome) => {
|
|
115
199
|
if (closed)
|
|
116
200
|
return;
|
|
117
201
|
closed = true;
|
|
118
|
-
if (
|
|
119
|
-
clearTimeout(
|
|
120
|
-
|
|
202
|
+
if (deadlineTimer != null) {
|
|
203
|
+
clearTimeout(deadlineTimer);
|
|
204
|
+
deadlineTimer = null;
|
|
121
205
|
}
|
|
122
206
|
if (outcome)
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
207
|
+
sendOutcome(outcome);
|
|
208
|
+
const remove = () => {
|
|
209
|
+
try {
|
|
210
|
+
root.removeChild(card);
|
|
211
|
+
}
|
|
212
|
+
catch { /* removed already */ }
|
|
213
|
+
onClosed();
|
|
214
|
+
};
|
|
215
|
+
if (reducedMotion) {
|
|
216
|
+
remove();
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
card.classList.add('exit');
|
|
220
|
+
// transitionend can be swallowed if the tab is hidden — back it
|
|
221
|
+
// up with a timeout so the node ALWAYS leaves the DOM.
|
|
222
|
+
let removed = false;
|
|
223
|
+
const once = () => { if (!removed) {
|
|
224
|
+
removed = true;
|
|
225
|
+
remove();
|
|
226
|
+
} };
|
|
227
|
+
card.addEventListener('transitionend', once, { once: true });
|
|
228
|
+
setTimeout(once, EXIT_MS + 80);
|
|
126
229
|
}
|
|
127
|
-
catch { /* removed already */ }
|
|
128
|
-
onClosed();
|
|
129
230
|
};
|
|
130
231
|
dismissBtn.addEventListener('click', () => close('dismissed'));
|
|
131
232
|
engageBtn.addEventListener('click', () => close('engaged'));
|
|
@@ -136,6 +237,12 @@ function renderWidget(deps, event, onClosed) {
|
|
|
136
237
|
};
|
|
137
238
|
return instance;
|
|
138
239
|
}
|
|
240
|
+
function monogram(name) {
|
|
241
|
+
const el = document.createElement('div');
|
|
242
|
+
el.className = 'avatar mono';
|
|
243
|
+
el.textContent = (name.trim()[0] ?? '?').toUpperCase();
|
|
244
|
+
return el;
|
|
245
|
+
}
|
|
139
246
|
function ensureContainer() {
|
|
140
247
|
let el = document.getElementById(CONTAINER_ID);
|
|
141
248
|
if (el)
|
|
@@ -149,33 +256,55 @@ function ensureContainer() {
|
|
|
149
256
|
}
|
|
150
257
|
function styleNode() {
|
|
151
258
|
const node = document.createElement('style');
|
|
152
|
-
//
|
|
259
|
+
// Shadow-DOM scoped; no host page leakage either direction.
|
|
153
260
|
node.textContent = `
|
|
154
|
-
.
|
|
261
|
+
.card {
|
|
155
262
|
pointer-events: auto;
|
|
156
|
-
|
|
263
|
+
width: 340px;
|
|
264
|
+
max-width: calc(100vw - 32px);
|
|
157
265
|
background: #111;
|
|
158
266
|
color: #fafafa;
|
|
159
|
-
border-radius:
|
|
267
|
+
border-radius: 16px;
|
|
160
268
|
box-shadow: 0 12px 32px rgba(0,0,0,0.32), 0 2px 8px rgba(0,0,0,0.12);
|
|
161
|
-
padding: 14px
|
|
162
|
-
font: 14px/1.
|
|
269
|
+
padding: 12px 14px 12px;
|
|
270
|
+
font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
|
|
271
|
+
opacity: 1;
|
|
272
|
+
transform: translateY(0);
|
|
273
|
+
transition: opacity ${ENTER_MS}ms ease-out, transform ${ENTER_MS}ms ease-out;
|
|
163
274
|
}
|
|
164
|
-
.
|
|
165
|
-
.
|
|
275
|
+
.card.enter { opacity: 0; transform: translateY(12px); }
|
|
276
|
+
.card.exit { opacity: 0; transform: translateY(12px); transition-duration: ${EXIT_MS}ms; }
|
|
277
|
+
.head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
|
|
278
|
+
.avatar {
|
|
279
|
+
width: 36px; height: 36px; border-radius: 50%;
|
|
280
|
+
object-fit: cover; flex: none;
|
|
281
|
+
background: #2a2a2a;
|
|
282
|
+
}
|
|
283
|
+
.avatar.mono {
|
|
284
|
+
display: flex; align-items: center; justify-content: center;
|
|
285
|
+
color: #9ab8ff; font-weight: 600; font-size: 16px;
|
|
286
|
+
}
|
|
287
|
+
.name { font-weight: 600; font-size: 13px; color: #e8e8e8; flex: 1; }
|
|
288
|
+
.x {
|
|
289
|
+
appearance: none; border: 0; background: transparent;
|
|
290
|
+
color: #8a8a8a; font-size: 13px; line-height: 1;
|
|
291
|
+
padding: 6px; margin: -6px -4px -6px 0; border-radius: 8px;
|
|
292
|
+
cursor: pointer; flex: none;
|
|
293
|
+
}
|
|
294
|
+
.x:hover { color: #fff; background: rgba(255,255,255,0.08); }
|
|
295
|
+
.message { margin: 0 2px 12px; color: #f2f2f2; }
|
|
296
|
+
.actions { display: flex; justify-content: flex-end; }
|
|
166
297
|
.btn {
|
|
167
|
-
appearance: none;
|
|
168
|
-
border:
|
|
169
|
-
|
|
170
|
-
border-radius: 8px;
|
|
171
|
-
font: inherit;
|
|
172
|
-
font-size: 13px;
|
|
298
|
+
appearance: none; border: 0;
|
|
299
|
+
padding: 7px 14px; border-radius: 9px;
|
|
300
|
+
font: inherit; font-size: 13px; font-weight: 500;
|
|
173
301
|
cursor: pointer;
|
|
174
302
|
}
|
|
175
|
-
.btn.dismiss { background: transparent; color: #c7c7c7; }
|
|
176
|
-
.btn.dismiss:hover { color: #fff; }
|
|
177
303
|
.btn.engage { background: #4f8bff; color: #fff; }
|
|
178
304
|
.btn.engage:hover { background: #6aa0ff; }
|
|
305
|
+
.btn:focus-visible, .x:focus-visible {
|
|
306
|
+
outline: 2px solid #9ab8ff; outline-offset: 2px;
|
|
307
|
+
}
|
|
179
308
|
`;
|
|
180
309
|
return node;
|
|
181
310
|
}
|
package/dist/widget.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.js","sourceRoot":"","sources":["../src/widget.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"widget.js","sourceRoot":"","sources":["../src/widget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,QAAQ,EAAwB,MAAM,gBAAgB,CAAA;AAG/D,gEAAgE;AAChE,MAAM,eAAe,GAAG,KAAM,CAAA;AAC9B,MAAM,QAAQ,GAAG,GAAG,CAAA;AACpB,MAAM,OAAO,GAAG,GAAG,CAAA;AAEnB,+CAA+C;AAC/C,MAAM,YAAY,GAAG,uBAAuB,CAAA;AA2B5C,MAAM,UAAU,WAAW,CAAC,IAAuB;IACjD,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QAClD,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,CAAA;IAC9B,CAAC;IAED,IAAI,aAAa,GAA0B,IAAI,CAAA;IAE/C,MAAM,aAAa,GAAG,CAAC,cAAsB,EAAE,OAA4B,EAAQ,EAAE;QACnF,KAAK,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,yBAAyB,IAAI,CAAC,YAAY,EAAE,UAAU,EAAE;YAC9E,GAAG,IAAI,CAAC,SAAS,EAAE;YACnB,cAAc;YACd,OAAO;SACR,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,MAAM,MAAM,GAAG,CAAC,QAAsB,EAAQ,EAAE;QAC9C,IAAI,MAAM,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.1",
|
|
4
4
|
"description": "Holostaff SDK — lifetime identity, stage detection, custom signal probes, and the intervention widget for the Holostaff runtime.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://docs.holostaff.ai",
|