@syntrologie/adapt-overlays 2.8.0-canary.9 → 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 +6 -2
- package/dist/highlight.d.ts.map +1 -1
- package/dist/highlight.js +12 -2
- 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 +11 -6
- package/dist/sanitizer.d.ts.map +1 -1
- package/dist/sanitizer.js +9 -0
- package/dist/summarize.d.ts.map +1 -1
- package/dist/summarize.js +6 -2
- 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,MAAM,EAAE,OAAO,CAAC,CAAC;YAAC,EAAE,EAAE,MAAM,CAAA;SAAE,KAAK,IAAI,KACrF,MAAM,IAA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AO,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
|
@@ -12,9 +12,13 @@ import { useCallback, useEffect, useRef, useState } from 'react';
|
|
|
12
12
|
import { summarizeOverlayItem } from './summarize';
|
|
13
13
|
/** Extract the CSS selector string from an anchorId object. */
|
|
14
14
|
function resolveAnchorSelector(anchorId) {
|
|
15
|
-
if (!anchorId
|
|
15
|
+
if (!anchorId)
|
|
16
16
|
return '';
|
|
17
|
-
|
|
17
|
+
if (typeof anchorId === 'string')
|
|
18
|
+
return anchorId;
|
|
19
|
+
if (typeof anchorId === 'object')
|
|
20
|
+
return anchorId.selector ?? '';
|
|
21
|
+
return '';
|
|
18
22
|
}
|
|
19
23
|
/** Extract the target route from an AnchorId object, ignoring wildcard '**'. */
|
|
20
24
|
function resolveAnchorRoute(anchorId) {
|
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;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,
|
|
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
|
@@ -160,8 +160,18 @@ export function showHighlight(anchorEl, overlayRoot, opts) {
|
|
|
160
160
|
scrim.style.pointerEvents = 'none';
|
|
161
161
|
scrim.style.opacity = '0';
|
|
162
162
|
setTimeout(() => {
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
try {
|
|
164
|
+
scrim.remove();
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
/* already detached */
|
|
168
|
+
}
|
|
169
|
+
try {
|
|
170
|
+
ring.remove();
|
|
171
|
+
}
|
|
172
|
+
catch {
|
|
173
|
+
/* already detached */
|
|
174
|
+
}
|
|
165
175
|
}, 220);
|
|
166
176
|
},
|
|
167
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
|
@@ -76,11 +76,7 @@ export const executeHighlight = async (action, context) => {
|
|
|
76
76
|
cleanup: () => {
|
|
77
77
|
handle.destroy();
|
|
78
78
|
anchorEl.removeAttribute('data-syntro-highlight');
|
|
79
|
-
|
|
80
|
-
// Cleanup runs during revert+reapply cycles (e.g., editor panel switch),
|
|
81
|
-
// and clearing it would allow the highlight to retrigger after user dismissed it.
|
|
82
|
-
// The dismissed marker is only cleared when the anchor element itself is removed
|
|
83
|
-
// (e.g., SPA navigation to a different page).
|
|
79
|
+
anchorEl.removeAttribute('data-syntro-highlight-dismissed');
|
|
84
80
|
},
|
|
85
81
|
};
|
|
86
82
|
};
|
|
@@ -180,6 +176,8 @@ export const executePulse = async (action, context) => {
|
|
|
180
176
|
return {
|
|
181
177
|
cleanup: () => {
|
|
182
178
|
clearTimeout(timeoutId);
|
|
179
|
+
if (!anchorEl.isConnected)
|
|
180
|
+
return;
|
|
183
181
|
anchorEl.style.animation = originalAnimation;
|
|
184
182
|
anchorEl.removeAttribute('data-syntro-pulse');
|
|
185
183
|
},
|
|
@@ -261,7 +259,14 @@ export const executeBadge = async (action, context) => {
|
|
|
261
259
|
});
|
|
262
260
|
return {
|
|
263
261
|
cleanup: () => {
|
|
264
|
-
|
|
262
|
+
try {
|
|
263
|
+
badge.remove();
|
|
264
|
+
}
|
|
265
|
+
catch {
|
|
266
|
+
/* already detached */
|
|
267
|
+
}
|
|
268
|
+
if (!anchorEl.isConnected)
|
|
269
|
+
return;
|
|
265
270
|
if (originalPosition !== undefined) {
|
|
266
271
|
anchorEl.style.position = originalPosition;
|
|
267
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/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
|
@@ -6,9 +6,13 @@
|
|
|
6
6
|
const MAX_TEXT_LEN = 40;
|
|
7
7
|
/** Extract the CSS selector string from an anchorId object. */
|
|
8
8
|
function resolveAnchorSelector(anchorId) {
|
|
9
|
-
if (!anchorId
|
|
9
|
+
if (!anchorId)
|
|
10
10
|
return '';
|
|
11
|
-
|
|
11
|
+
if (typeof anchorId === 'string')
|
|
12
|
+
return anchorId;
|
|
13
|
+
if (typeof anchorId === 'object')
|
|
14
|
+
return anchorId.selector ?? '';
|
|
15
|
+
return '';
|
|
12
16
|
}
|
|
13
17
|
/**
|
|
14
18
|
* Convert a CSS selector into a human-friendly element description.
|
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