@syntrologie/adapt-overlays 2.8.0-canary.8 → 2.8.0
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/WorkflowWidget.d.ts.map +1 -1
- package/dist/WorkflowWidget.js +7 -6
- package/dist/editor.d.ts.map +1 -1
- package/dist/editor.js +3 -4
- package/dist/highlight.d.ts +2 -0
- package/dist/highlight.d.ts.map +1 -1
- package/dist/highlight.js +23 -7
- package/dist/modal.d.ts.map +1 -1
- package/dist/modal.js +12 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +20 -1
- package/dist/sanitizer.d.ts.map +1 -1
- package/dist/sanitizer.js +9 -0
- package/dist/schema.d.ts +104 -20
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +5 -5
- package/dist/summarize.d.ts.map +1 -1
- package/dist/summarize.js +3 -4
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +16 -6
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkflowWidget.d.ts","sourceRoot":"","sources":["../src/WorkflowWidget.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAYH,UAAU,YAAY;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,eAAe;IACvB,MAAM,EAAE;QACN,SAAS,EAAE,CACT,MAAM,EAAE;YAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;SAAE,EACjD,QAAQ,EAAE,CAAC,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MA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wBAAgB,mBAAmB,CAAC,EAAE,OAAO,EAAE,EAAE,wBAAwB,2CAsQxE;AAMD;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,EAAE,eAiBrC,CAAC"}
|
package/dist/WorkflowWidget.js
CHANGED
|
@@ -25,7 +25,7 @@ import { WorkflowTracker } from './WorkflowTracker';
|
|
|
25
25
|
* Show a toast notification for a workflow tour.
|
|
26
26
|
* Creates a DOM element, appends it to the container, and auto-removes after 4 seconds.
|
|
27
27
|
*/
|
|
28
|
-
function showWorkflowToast(
|
|
28
|
+
function showWorkflowToast(notification) {
|
|
29
29
|
const toast = document.createElement('div');
|
|
30
30
|
toast.setAttribute('data-testid', 'workflow-toast');
|
|
31
31
|
toast.className = 'se-fixed se-bottom-4 se-right-4 se-z-50';
|
|
@@ -59,7 +59,9 @@ function showWorkflowToast(container, notification) {
|
|
|
59
59
|
bodyEl.textContent = notification.body;
|
|
60
60
|
toast.appendChild(bodyEl);
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
// Append to document.body so the toast is visible at the viewport level
|
|
63
|
+
// (the container is inside shadow DOM, where position:fixed is scoped)
|
|
64
|
+
document.body.appendChild(toast);
|
|
63
65
|
// Auto-remove after 4 seconds
|
|
64
66
|
let removeTimer;
|
|
65
67
|
const fadeTimer = setTimeout(() => {
|
|
@@ -173,12 +175,11 @@ export function WorkflowWidgetInner({ runtime }) {
|
|
|
173
175
|
for (const [tourId, { meta }] of tourWorkflows) {
|
|
174
176
|
if (!notifiedRef.current.has(tourId) &&
|
|
175
177
|
meta.notification &&
|
|
176
|
-
containerRef.current &&
|
|
177
178
|
!dismissed.includes(tourId) &&
|
|
178
179
|
!completed[tourId]) {
|
|
179
180
|
notifiedRef.current.add(tourId);
|
|
180
181
|
stateNs?.set?.('notified', [...notifiedRef.current]);
|
|
181
|
-
const cleanup = showWorkflowToast(
|
|
182
|
+
const cleanup = showWorkflowToast(meta.notification);
|
|
182
183
|
toastCleanupsRef.current.push(cleanup);
|
|
183
184
|
}
|
|
184
185
|
}
|
|
@@ -213,8 +214,8 @@ export function WorkflowWidgetInner({ runtime }) {
|
|
|
213
214
|
notifiedRef.current.add(tourId);
|
|
214
215
|
stateNs?.set?.('notified', [...notifiedRef.current]);
|
|
215
216
|
const workflow = currentWorkflows.get(tourId);
|
|
216
|
-
if (workflow?.meta.notification
|
|
217
|
-
const cleanup = showWorkflowToast(
|
|
217
|
+
if (workflow?.meta.notification) {
|
|
218
|
+
const cleanup = showWorkflowToast(workflow.meta.notification);
|
|
218
219
|
toastCleanupsRef.current.push(cleanup);
|
|
219
220
|
}
|
|
220
221
|
}
|
package/dist/editor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../src/editor.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAqBH,OAAO,KAAK,EAAE,gBAAgB,EAAY,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../src/editor.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAqBH,OAAO,KAAK,EAAE,gBAAgB,EAAY,MAAM,SAAS,CAAC;AA0N1D,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,gBAAgB,2CAif5E;AAED;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;CAOlB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;CAAe,CAAC;AAExC,eAAe,cAAc,CAAC"}
|
package/dist/editor.js
CHANGED
|
@@ -10,15 +10,14 @@ import { DetectionBadge, DismissedSection, EditorBody, EditorCard, EditorFooter,
|
|
|
10
10
|
import { MessageSquare, Route, Sparkles, Square, Tag, Zap } from 'lucide-react';
|
|
11
11
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
12
12
|
import { summarizeOverlayItem } from './summarize';
|
|
13
|
-
/** Extract the CSS selector string from an anchorId
|
|
13
|
+
/** Extract the CSS selector string from an anchorId object. */
|
|
14
14
|
function resolveAnchorSelector(anchorId) {
|
|
15
15
|
if (!anchorId)
|
|
16
16
|
return '';
|
|
17
17
|
if (typeof anchorId === 'string')
|
|
18
18
|
return anchorId;
|
|
19
|
-
if (typeof anchorId === 'object'
|
|
20
|
-
return anchorId.selector;
|
|
21
|
-
}
|
|
19
|
+
if (typeof anchorId === 'object')
|
|
20
|
+
return anchorId.selector ?? '';
|
|
22
21
|
return '';
|
|
23
22
|
}
|
|
24
23
|
/** Extract the target route from an AnchorId object, ignoring wildcard '**'. */
|
package/dist/highlight.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export interface HighlightOptions {
|
|
|
14
14
|
blocking?: boolean;
|
|
15
15
|
onClickOutside?: boolean;
|
|
16
16
|
onEsc?: boolean;
|
|
17
|
+
/** Called when the user actively dismisses (click outside / Esc). NOT called on programmatic destroy(). */
|
|
18
|
+
onDismiss?: () => void;
|
|
17
19
|
}
|
|
18
20
|
export declare function showHighlight(anchorEl: HTMLElement, overlayRoot: HTMLElement, opts?: HighlightOptions): HighlightHandle;
|
|
19
21
|
//# sourceMappingURL=highlight.d.ts.map
|
package/dist/highlight.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["../src/highlight.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,MAAM,MAAM,eAAe,GAAG;IAAE,OAAO,IAAI,IAAI,CAAA;CAAE,CAAC;AAElD,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["../src/highlight.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,MAAM,MAAM,eAAe,GAAG;IAAE,OAAO,IAAI,IAAI,CAAA;CAAE,CAAC;AAElD,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2GAA2G;IAC3G,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,WAAW,EACrB,WAAW,EAAE,WAAW,EACxB,IAAI,CAAC,EAAE,gBAAgB,GACtB,eAAe,CAyLjB"}
|
package/dist/highlight.js
CHANGED
|
@@ -64,10 +64,13 @@ export function showHighlight(anchorEl, overlayRoot, opts) {
|
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
66
|
const rect = anchorEl.getBoundingClientRect();
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const
|
|
67
|
+
// Use unclamped coordinates so the ring and clip-path track the anchor's
|
|
68
|
+
// true position. When the anchor is partially off-screen the browser
|
|
69
|
+
// naturally clips the fixed-position ring at the viewport edge.
|
|
70
|
+
const x = rect.left - padding;
|
|
71
|
+
const y = rect.top - padding;
|
|
72
|
+
const w = rect.width + padding * 2;
|
|
73
|
+
const h = rect.height + padding * 2;
|
|
71
74
|
Object.assign(ring.style, {
|
|
72
75
|
left: `${x}px`,
|
|
73
76
|
top: `${y}px`,
|
|
@@ -126,8 +129,10 @@ export function showHighlight(anchorEl, overlayRoot, opts) {
|
|
|
126
129
|
window.addEventListener('scroll', onScroll, true);
|
|
127
130
|
window.addEventListener('resize', onResize);
|
|
128
131
|
const onKey = (e) => {
|
|
129
|
-
if (e.key === 'Escape' && onEsc)
|
|
132
|
+
if (e.key === 'Escape' && onEsc) {
|
|
133
|
+
opts?.onDismiss?.();
|
|
130
134
|
handle.destroy();
|
|
135
|
+
}
|
|
131
136
|
};
|
|
132
137
|
if (onEsc) {
|
|
133
138
|
window.addEventListener('keydown', onKey);
|
|
@@ -138,6 +143,7 @@ export function showHighlight(anchorEl, overlayRoot, opts) {
|
|
|
138
143
|
event.stopPropagation();
|
|
139
144
|
}
|
|
140
145
|
else if (onClickOutside) {
|
|
146
|
+
opts?.onDismiss?.();
|
|
141
147
|
handle.destroy();
|
|
142
148
|
}
|
|
143
149
|
};
|
|
@@ -154,8 +160,18 @@ export function showHighlight(anchorEl, overlayRoot, opts) {
|
|
|
154
160
|
scrim.style.pointerEvents = 'none';
|
|
155
161
|
scrim.style.opacity = '0';
|
|
156
162
|
setTimeout(() => {
|
|
157
|
-
|
|
158
|
-
|
|
163
|
+
try {
|
|
164
|
+
scrim.remove();
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
/* already detached */
|
|
168
|
+
}
|
|
169
|
+
try {
|
|
170
|
+
ring.remove();
|
|
171
|
+
}
|
|
172
|
+
catch {
|
|
173
|
+
/* already detached */
|
|
174
|
+
}
|
|
159
175
|
}, 220);
|
|
160
176
|
},
|
|
161
177
|
};
|
package/dist/modal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../src/modal.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAkB,WAAW,EAAE,MAAM,SAAS,CAAC;AAW3E;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,cAAc,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../src/modal.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAkB,WAAW,EAAE,MAAM,SAAS,CAAC;AAW3E;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,cAAc,CAAC,WAAW,CAkOpD,CAAC"}
|
package/dist/modal.js
CHANGED
|
@@ -192,8 +192,18 @@ export const executeModal = async (action, context) => {
|
|
|
192
192
|
modal.style.transform = 'translate(-50%, -50%) scale(0.95)';
|
|
193
193
|
scrimEl.style.opacity = '0';
|
|
194
194
|
setTimeout(() => {
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
try {
|
|
196
|
+
modal.remove();
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
/* already detached */
|
|
200
|
+
}
|
|
201
|
+
try {
|
|
202
|
+
scrimEl.remove();
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
/* already detached */
|
|
206
|
+
}
|
|
197
207
|
}, 200);
|
|
198
208
|
context.publishEvent('action.modal_dismissed', {
|
|
199
209
|
actionClicked,
|
package/dist/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EAEX,eAAe,EACf,WAAW,EACX,aAAa,EACd,MAAM,SAAS,CAAC;AAIjB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;AAGrC,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAMvE;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EAEX,eAAe,EACf,WAAW,EACX,aAAa,EACd,MAAM,SAAS,CAAC;AAIjB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;AAGrC,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAMvE;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,eAAe,CAsE5D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,cAAc,CAAC,WAAW,CA0GpD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,cAAc,CAAC,WAAW,CAoGpD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,cAAc,CAAC,aAAa,CAwFxD,CAAC;AAMF;;;GAGG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;EAQZ,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBnB,CAAC"}
|
package/dist/runtime.js
CHANGED
|
@@ -27,6 +27,12 @@ export const executeHighlight = async (action, context) => {
|
|
|
27
27
|
console.warn(`[adaptive-overlays] Anchor not found after waiting: ${action.anchorId.selector}`);
|
|
28
28
|
return { cleanup: () => { } };
|
|
29
29
|
}
|
|
30
|
+
// Skip re-application if the user previously dismissed this highlight.
|
|
31
|
+
// The dismissed attribute is set by onDismiss (user click-outside / Esc)
|
|
32
|
+
// and survives config-driven revert+reapply cycles.
|
|
33
|
+
if (anchorEl.getAttribute('data-syntro-highlight-dismissed')) {
|
|
34
|
+
return { cleanup: () => { } };
|
|
35
|
+
}
|
|
30
36
|
// Self-guard: destroy any existing highlight on this anchor to prevent duplicates
|
|
31
37
|
// (batch re-apply on navigation can call this executor multiple times for the same anchor)
|
|
32
38
|
const existing = anchorEl.getAttribute('data-syntro-highlight');
|
|
@@ -57,6 +63,9 @@ export const executeHighlight = async (action, context) => {
|
|
|
57
63
|
blocking: action.blocking ?? false,
|
|
58
64
|
onClickOutside: action.onClickOutside ?? true,
|
|
59
65
|
onEsc: action.onEsc ?? true,
|
|
66
|
+
onDismiss: () => {
|
|
67
|
+
anchorEl.setAttribute('data-syntro-highlight-dismissed', 'true');
|
|
68
|
+
},
|
|
60
69
|
});
|
|
61
70
|
context.publishEvent('action.applied', {
|
|
62
71
|
id: context.generateId(),
|
|
@@ -67,6 +76,7 @@ export const executeHighlight = async (action, context) => {
|
|
|
67
76
|
cleanup: () => {
|
|
68
77
|
handle.destroy();
|
|
69
78
|
anchorEl.removeAttribute('data-syntro-highlight');
|
|
79
|
+
anchorEl.removeAttribute('data-syntro-highlight-dismissed');
|
|
70
80
|
},
|
|
71
81
|
};
|
|
72
82
|
};
|
|
@@ -166,6 +176,8 @@ export const executePulse = async (action, context) => {
|
|
|
166
176
|
return {
|
|
167
177
|
cleanup: () => {
|
|
168
178
|
clearTimeout(timeoutId);
|
|
179
|
+
if (!anchorEl.isConnected)
|
|
180
|
+
return;
|
|
169
181
|
anchorEl.style.animation = originalAnimation;
|
|
170
182
|
anchorEl.removeAttribute('data-syntro-pulse');
|
|
171
183
|
},
|
|
@@ -247,7 +259,14 @@ export const executeBadge = async (action, context) => {
|
|
|
247
259
|
});
|
|
248
260
|
return {
|
|
249
261
|
cleanup: () => {
|
|
250
|
-
|
|
262
|
+
try {
|
|
263
|
+
badge.remove();
|
|
264
|
+
}
|
|
265
|
+
catch {
|
|
266
|
+
/* already detached */
|
|
267
|
+
}
|
|
268
|
+
if (!anchorEl.isConnected)
|
|
269
|
+
return;
|
|
251
270
|
if (originalPosition !== undefined) {
|
|
252
271
|
anchorEl.style.position = originalPosition;
|
|
253
272
|
}
|
package/dist/sanitizer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitizer.d.ts","sourceRoot":"","sources":["../src/sanitizer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"sanitizer.d.ts","sourceRoot":"","sources":["../src/sanitizer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAiCH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAqDjD"}
|
package/dist/sanitizer.js
CHANGED
|
@@ -24,6 +24,15 @@ const ALLOWED_TAGS = new Set([
|
|
|
24
24
|
'sub',
|
|
25
25
|
'a',
|
|
26
26
|
'button',
|
|
27
|
+
// SVG elements (for inline Lucide icons in config HTML)
|
|
28
|
+
'svg',
|
|
29
|
+
'path',
|
|
30
|
+
'circle',
|
|
31
|
+
'line',
|
|
32
|
+
'polyline',
|
|
33
|
+
'polygon',
|
|
34
|
+
'rect',
|
|
35
|
+
'g',
|
|
27
36
|
]);
|
|
28
37
|
export function sanitizeHtml(html) {
|
|
29
38
|
// Try native Sanitizer API first
|
package/dist/schema.d.ts
CHANGED
|
@@ -11,7 +11,16 @@ import { z } from 'zod';
|
|
|
11
11
|
export declare const configSchema: z.ZodObject<{
|
|
12
12
|
/** Highlight configurations */
|
|
13
13
|
highlights: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
14
|
-
anchorId: z.
|
|
14
|
+
anchorId: z.ZodObject<{
|
|
15
|
+
selector: z.ZodString;
|
|
16
|
+
route: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
17
|
+
}, "strict", z.ZodTypeAny, {
|
|
18
|
+
selector: string;
|
|
19
|
+
route: string | string[];
|
|
20
|
+
}, {
|
|
21
|
+
selector: string;
|
|
22
|
+
route: string | string[];
|
|
23
|
+
}>;
|
|
15
24
|
summary: z.ZodString;
|
|
16
25
|
style: z.ZodOptional<z.ZodObject<{
|
|
17
26
|
color: z.ZodOptional<z.ZodString>;
|
|
@@ -31,7 +40,10 @@ export declare const configSchema: z.ZodObject<{
|
|
|
31
40
|
}>>;
|
|
32
41
|
}, "strip", z.ZodTypeAny, {
|
|
33
42
|
summary: string;
|
|
34
|
-
anchorId:
|
|
43
|
+
anchorId: {
|
|
44
|
+
selector: string;
|
|
45
|
+
route: string | string[];
|
|
46
|
+
};
|
|
35
47
|
style?: {
|
|
36
48
|
color?: string | undefined;
|
|
37
49
|
paddingPx?: number | undefined;
|
|
@@ -40,7 +52,10 @@ export declare const configSchema: z.ZodObject<{
|
|
|
40
52
|
} | undefined;
|
|
41
53
|
}, {
|
|
42
54
|
summary: string;
|
|
43
|
-
anchorId:
|
|
55
|
+
anchorId: {
|
|
56
|
+
selector: string;
|
|
57
|
+
route: string | string[];
|
|
58
|
+
};
|
|
44
59
|
style?: {
|
|
45
60
|
color?: string | undefined;
|
|
46
61
|
paddingPx?: number | undefined;
|
|
@@ -50,7 +65,16 @@ export declare const configSchema: z.ZodObject<{
|
|
|
50
65
|
}>, "many">>;
|
|
51
66
|
/** Tooltip configurations */
|
|
52
67
|
tooltips: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
53
|
-
anchorId: z.
|
|
68
|
+
anchorId: z.ZodObject<{
|
|
69
|
+
selector: z.ZodString;
|
|
70
|
+
route: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
71
|
+
}, "strict", z.ZodTypeAny, {
|
|
72
|
+
selector: string;
|
|
73
|
+
route: string | string[];
|
|
74
|
+
}, {
|
|
75
|
+
selector: string;
|
|
76
|
+
route: string | string[];
|
|
77
|
+
}>;
|
|
54
78
|
summary: z.ZodString;
|
|
55
79
|
content: z.ZodObject<{
|
|
56
80
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -84,7 +108,10 @@ export declare const configSchema: z.ZodObject<{
|
|
|
84
108
|
placement: z.ZodOptional<z.ZodEnum<["top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "left", "left-start", "left-end", "right", "right-start", "right-end"]>>;
|
|
85
109
|
}, "strip", z.ZodTypeAny, {
|
|
86
110
|
summary: string;
|
|
87
|
-
anchorId:
|
|
111
|
+
anchorId: {
|
|
112
|
+
selector: string;
|
|
113
|
+
route: string | string[];
|
|
114
|
+
};
|
|
88
115
|
content: {
|
|
89
116
|
body: string;
|
|
90
117
|
title?: string | undefined;
|
|
@@ -97,7 +124,10 @@ export declare const configSchema: z.ZodObject<{
|
|
|
97
124
|
placement?: "bottom" | "left" | "right" | "top" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end" | undefined;
|
|
98
125
|
}, {
|
|
99
126
|
summary: string;
|
|
100
|
-
anchorId:
|
|
127
|
+
anchorId: {
|
|
128
|
+
selector: string;
|
|
129
|
+
route: string | string[];
|
|
130
|
+
};
|
|
101
131
|
content: {
|
|
102
132
|
body: string;
|
|
103
133
|
title?: string | undefined;
|
|
@@ -111,33 +141,63 @@ export declare const configSchema: z.ZodObject<{
|
|
|
111
141
|
}>, "many">>;
|
|
112
142
|
/** Badge configurations */
|
|
113
143
|
badges: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
114
|
-
anchorId: z.
|
|
144
|
+
anchorId: z.ZodObject<{
|
|
145
|
+
selector: z.ZodString;
|
|
146
|
+
route: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
147
|
+
}, "strict", z.ZodTypeAny, {
|
|
148
|
+
selector: string;
|
|
149
|
+
route: string | string[];
|
|
150
|
+
}, {
|
|
151
|
+
selector: string;
|
|
152
|
+
route: string | string[];
|
|
153
|
+
}>;
|
|
115
154
|
summary: z.ZodString;
|
|
116
155
|
content: z.ZodString;
|
|
117
156
|
position: z.ZodOptional<z.ZodEnum<["top-left", "top-right", "bottom-left", "bottom-right"]>>;
|
|
118
157
|
}, "strip", z.ZodTypeAny, {
|
|
119
158
|
summary: string;
|
|
120
|
-
anchorId:
|
|
159
|
+
anchorId: {
|
|
160
|
+
selector: string;
|
|
161
|
+
route: string | string[];
|
|
162
|
+
};
|
|
121
163
|
content: string;
|
|
122
164
|
position?: "top-left" | "top-right" | "bottom-left" | "bottom-right" | undefined;
|
|
123
165
|
}, {
|
|
124
166
|
summary: string;
|
|
125
|
-
anchorId:
|
|
167
|
+
anchorId: {
|
|
168
|
+
selector: string;
|
|
169
|
+
route: string | string[];
|
|
170
|
+
};
|
|
126
171
|
content: string;
|
|
127
172
|
position?: "top-left" | "top-right" | "bottom-left" | "bottom-right" | undefined;
|
|
128
173
|
}>, "many">>;
|
|
129
174
|
/** Pulse configurations */
|
|
130
175
|
pulses: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
131
|
-
anchorId: z.
|
|
176
|
+
anchorId: z.ZodObject<{
|
|
177
|
+
selector: z.ZodString;
|
|
178
|
+
route: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
179
|
+
}, "strict", z.ZodTypeAny, {
|
|
180
|
+
selector: string;
|
|
181
|
+
route: string | string[];
|
|
182
|
+
}, {
|
|
183
|
+
selector: string;
|
|
184
|
+
route: string | string[];
|
|
185
|
+
}>;
|
|
132
186
|
summary: z.ZodString;
|
|
133
187
|
duration: z.ZodOptional<z.ZodNumber>;
|
|
134
188
|
}, "strip", z.ZodTypeAny, {
|
|
135
189
|
summary: string;
|
|
136
|
-
anchorId:
|
|
190
|
+
anchorId: {
|
|
191
|
+
selector: string;
|
|
192
|
+
route: string | string[];
|
|
193
|
+
};
|
|
137
194
|
duration?: number | undefined;
|
|
138
195
|
}, {
|
|
139
196
|
summary: string;
|
|
140
|
-
anchorId:
|
|
197
|
+
anchorId: {
|
|
198
|
+
selector: string;
|
|
199
|
+
route: string | string[];
|
|
200
|
+
};
|
|
141
201
|
duration?: number | undefined;
|
|
142
202
|
}>, "many">>;
|
|
143
203
|
/** Modal configurations */
|
|
@@ -279,7 +339,10 @@ export declare const configSchema: z.ZodObject<{
|
|
|
279
339
|
}, "strip", z.ZodTypeAny, {
|
|
280
340
|
highlights?: {
|
|
281
341
|
summary: string;
|
|
282
|
-
anchorId:
|
|
342
|
+
anchorId: {
|
|
343
|
+
selector: string;
|
|
344
|
+
route: string | string[];
|
|
345
|
+
};
|
|
283
346
|
style?: {
|
|
284
347
|
color?: string | undefined;
|
|
285
348
|
paddingPx?: number | undefined;
|
|
@@ -289,7 +352,10 @@ export declare const configSchema: z.ZodObject<{
|
|
|
289
352
|
}[] | undefined;
|
|
290
353
|
tooltips?: {
|
|
291
354
|
summary: string;
|
|
292
|
-
anchorId:
|
|
355
|
+
anchorId: {
|
|
356
|
+
selector: string;
|
|
357
|
+
route: string | string[];
|
|
358
|
+
};
|
|
293
359
|
content: {
|
|
294
360
|
body: string;
|
|
295
361
|
title?: string | undefined;
|
|
@@ -303,13 +369,19 @@ export declare const configSchema: z.ZodObject<{
|
|
|
303
369
|
}[] | undefined;
|
|
304
370
|
badges?: {
|
|
305
371
|
summary: string;
|
|
306
|
-
anchorId:
|
|
372
|
+
anchorId: {
|
|
373
|
+
selector: string;
|
|
374
|
+
route: string | string[];
|
|
375
|
+
};
|
|
307
376
|
content: string;
|
|
308
377
|
position?: "top-left" | "top-right" | "bottom-left" | "bottom-right" | undefined;
|
|
309
378
|
}[] | undefined;
|
|
310
379
|
pulses?: {
|
|
311
380
|
summary: string;
|
|
312
|
-
anchorId:
|
|
381
|
+
anchorId: {
|
|
382
|
+
selector: string;
|
|
383
|
+
route: string | string[];
|
|
384
|
+
};
|
|
313
385
|
duration?: number | undefined;
|
|
314
386
|
}[] | undefined;
|
|
315
387
|
modals?: {
|
|
@@ -349,7 +421,10 @@ export declare const configSchema: z.ZodObject<{
|
|
|
349
421
|
}, {
|
|
350
422
|
highlights?: {
|
|
351
423
|
summary: string;
|
|
352
|
-
anchorId:
|
|
424
|
+
anchorId: {
|
|
425
|
+
selector: string;
|
|
426
|
+
route: string | string[];
|
|
427
|
+
};
|
|
353
428
|
style?: {
|
|
354
429
|
color?: string | undefined;
|
|
355
430
|
paddingPx?: number | undefined;
|
|
@@ -359,7 +434,10 @@ export declare const configSchema: z.ZodObject<{
|
|
|
359
434
|
}[] | undefined;
|
|
360
435
|
tooltips?: {
|
|
361
436
|
summary: string;
|
|
362
|
-
anchorId:
|
|
437
|
+
anchorId: {
|
|
438
|
+
selector: string;
|
|
439
|
+
route: string | string[];
|
|
440
|
+
};
|
|
363
441
|
content: {
|
|
364
442
|
body: string;
|
|
365
443
|
title?: string | undefined;
|
|
@@ -373,13 +451,19 @@ export declare const configSchema: z.ZodObject<{
|
|
|
373
451
|
}[] | undefined;
|
|
374
452
|
badges?: {
|
|
375
453
|
summary: string;
|
|
376
|
-
anchorId:
|
|
454
|
+
anchorId: {
|
|
455
|
+
selector: string;
|
|
456
|
+
route: string | string[];
|
|
457
|
+
};
|
|
377
458
|
content: string;
|
|
378
459
|
position?: "top-left" | "top-right" | "bottom-left" | "bottom-right" | undefined;
|
|
379
460
|
}[] | undefined;
|
|
380
461
|
pulses?: {
|
|
381
462
|
summary: string;
|
|
382
|
-
anchorId:
|
|
463
|
+
anchorId: {
|
|
464
|
+
selector: string;
|
|
465
|
+
route: string | string[];
|
|
466
|
+
};
|
|
383
467
|
duration?: number | undefined;
|
|
384
468
|
}[] | undefined;
|
|
385
469
|
modals?: {
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,YAAY;IACvB,+BAA+B
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,YAAY;IACvB,+BAA+B;;;;;;;;;;;;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AAoR,CAAC;;;;4BAAuH,CAAC;;;;;4BAAkJ,CAAC;;;;;;4BAAwM,CAAC;2BAAyC,CAAC;;6BAA2D,CAAC;kCAA6C,CAAC;oCAAqE,CAAC;;;;qBAA4G,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAAhrG,CAAC;;;;yBAAgH,CAAC;;;4BAA2E,CAAC;4BAA0C,CAAC;6BAA2C,CAAC;6BAA2C,CAAC;;;;;;;;;4BAAoR,CAAC;;;;4BAAuH,CAAC;;;;;4BAAkJ,CAAC;;;;;;4BAAwM,CAAC;2BAAyC,CAAC;;6BAA2D,CAAC;kCAA6C,CAAC;oCAAqE,CAAC;;;;qBAA4G,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAA8c,CAAC;;;;yBAAgH,CAAC;;;4BAA2E,CAAC;4BAA0C,CAAC;6BAA2C,CAAC;6BAA2C,CAAC;;;;;;;;;4BAAoR,CAAC;;;;4BAAuH,CAAC;;;;;4BAAkJ,CAAC;;;;;;4BAAwM,CAAC;2BAAyC,CAAC;;6BAA2D,CAAC;kCAA6C,CAAC;oCAAqE,CAAC;;;;qBAA4G,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;GApBpr8D,CAAC;AAatF,eAAO,MAAM,WAAW;;;;GAMvB,CAAC"}
|
package/dist/schema.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Zod schema for validating overlays app configuration.
|
|
5
5
|
*/
|
|
6
|
-
import { TriggerWhenZ } from '@syntrologie/sdk-contracts';
|
|
6
|
+
import { AnchorIdZ, TriggerWhenZ } from '@syntrologie/sdk-contracts';
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
/**
|
|
9
9
|
* Overlays app config schema.
|
|
@@ -13,7 +13,7 @@ export const configSchema = z.object({
|
|
|
13
13
|
/** Highlight configurations */
|
|
14
14
|
highlights: z
|
|
15
15
|
.array(z.object({
|
|
16
|
-
anchorId:
|
|
16
|
+
anchorId: AnchorIdZ,
|
|
17
17
|
summary: z.string(),
|
|
18
18
|
style: z
|
|
19
19
|
.object({
|
|
@@ -28,7 +28,7 @@ export const configSchema = z.object({
|
|
|
28
28
|
/** Tooltip configurations */
|
|
29
29
|
tooltips: z
|
|
30
30
|
.array(z.object({
|
|
31
|
-
anchorId:
|
|
31
|
+
anchorId: AnchorIdZ,
|
|
32
32
|
summary: z.string(),
|
|
33
33
|
content: z.object({
|
|
34
34
|
title: z.string().optional(),
|
|
@@ -62,7 +62,7 @@ export const configSchema = z.object({
|
|
|
62
62
|
/** Badge configurations */
|
|
63
63
|
badges: z
|
|
64
64
|
.array(z.object({
|
|
65
|
-
anchorId:
|
|
65
|
+
anchorId: AnchorIdZ,
|
|
66
66
|
summary: z.string(),
|
|
67
67
|
content: z.string(),
|
|
68
68
|
position: z.enum(['top-left', 'top-right', 'bottom-left', 'bottom-right']).optional(),
|
|
@@ -71,7 +71,7 @@ export const configSchema = z.object({
|
|
|
71
71
|
/** Pulse configurations */
|
|
72
72
|
pulses: z
|
|
73
73
|
.array(z.object({
|
|
74
|
-
anchorId:
|
|
74
|
+
anchorId: AnchorIdZ,
|
|
75
75
|
summary: z.string(),
|
|
76
76
|
duration: z.number().optional(),
|
|
77
77
|
}))
|
package/dist/summarize.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarize.d.ts","sourceRoot":"","sources":["../src/summarize.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"summarize.d.ts","sourceRoot":"","sources":["../src/summarize.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAY/C;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAezD;AAYD;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,cAAc,EAC1B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,MAAM,CAuCR"}
|
package/dist/summarize.js
CHANGED
|
@@ -4,15 +4,14 @@
|
|
|
4
4
|
* Pure functions — no DOM access, just string formatting from config data.
|
|
5
5
|
*/
|
|
6
6
|
const MAX_TEXT_LEN = 40;
|
|
7
|
-
/** Extract the CSS selector string from an anchorId
|
|
7
|
+
/** Extract the CSS selector string from an anchorId object. */
|
|
8
8
|
function resolveAnchorSelector(anchorId) {
|
|
9
9
|
if (!anchorId)
|
|
10
10
|
return '';
|
|
11
11
|
if (typeof anchorId === 'string')
|
|
12
12
|
return anchorId;
|
|
13
|
-
if (typeof anchorId === 'object'
|
|
14
|
-
return anchorId.selector;
|
|
15
|
-
}
|
|
13
|
+
if (typeof anchorId === 'object')
|
|
14
|
+
return anchorId.selector ?? '';
|
|
16
15
|
return '';
|
|
17
16
|
}
|
|
18
17
|
/**
|
package/dist/tooltip.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../src/tooltip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAQL,KAAK,SAAS,EAGf,MAAM,kBAAkB,CAAC;AAI1B,MAAM,MAAM,aAAa,GAAG;IAAE,OAAO,IAAI,IAAI,CAAC;IAAC,EAAE,EAAE,WAAW,CAAA;CAAE,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,GAAG,OAAO,CAAC;IAC1C,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAyCD,wBAAgB,WAAW,CACzB,QAAQ,EAAE,WAAW,EACrB,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,cAAc,GACnB,aAAa,
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../src/tooltip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAQL,KAAK,SAAS,EAGf,MAAM,kBAAkB,CAAC;AAI1B,MAAM,MAAM,aAAa,GAAG;IAAE,OAAO,IAAI,IAAI,CAAC;IAAC,EAAE,EAAE,WAAW,CAAA;CAAE,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,GAAG,OAAO,CAAC;IAC1C,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAyCD,wBAAgB,WAAW,CACzB,QAAQ,EAAE,WAAW,EACrB,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,cAAc,GACnB,aAAa,CA8Qf"}
|
package/dist/tooltip.js
CHANGED
|
@@ -39,11 +39,14 @@ function getAnchorReference(anchorEl) {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
export function showTooltip(anchorEl, overlayRoot, opts) {
|
|
42
|
-
// Scroll anchor into view for
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
// Scroll anchor into view only for immediate tooltips — hover/click tooltips
|
|
43
|
+
// are triggered by user interaction so the element is already in view.
|
|
44
|
+
if (!opts.trigger || opts.trigger === 'immediate') {
|
|
45
|
+
const rect = anchorEl.getBoundingClientRect();
|
|
46
|
+
const isLargeElement = rect.width > window.innerWidth * 0.8 || rect.height > window.innerHeight * 0.8;
|
|
47
|
+
if (!isLargeElement) {
|
|
48
|
+
anchorEl.scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'center' });
|
|
49
|
+
}
|
|
47
50
|
}
|
|
48
51
|
const div = document.createElement('div');
|
|
49
52
|
div.className = 'syntro-tooltip';
|
|
@@ -262,7 +265,14 @@ export function showTooltip(anchorEl, overlayRoot, opts) {
|
|
|
262
265
|
}
|
|
263
266
|
div.style.pointerEvents = 'none';
|
|
264
267
|
div.style.opacity = '0';
|
|
265
|
-
setTimeout(() =>
|
|
268
|
+
setTimeout(() => {
|
|
269
|
+
try {
|
|
270
|
+
div.remove();
|
|
271
|
+
}
|
|
272
|
+
catch {
|
|
273
|
+
/* already detached */
|
|
274
|
+
}
|
|
275
|
+
}, 200);
|
|
266
276
|
},
|
|
267
277
|
};
|
|
268
278
|
return handle;
|
package/package.json
CHANGED