@repere/core 0.1.0 → 0.1.2
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/index.js +202 -153
- package/dist/utils/PositionTracker.d.ts +1 -0
- package/dist/utils/PositionTracker.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
var c = /* @__PURE__ */ ((e) => (e.TopLeft = "top-left", e.TopCenter = "top-center", e.TopRight = "top-right", e.RightCenter = "right-center", e.BottomRight = "bottom-right", e.BottomCenter = "bottom-center", e.BottomLeft = "bottom-left", e.LeftCenter = "left-center", e))(c || {});
|
|
2
|
-
const
|
|
3
|
-
class
|
|
2
|
+
const m = c.TopRight;
|
|
3
|
+
class y {
|
|
4
4
|
state = /* @__PURE__ */ new Map();
|
|
5
|
-
isDismissed(
|
|
6
|
-
return this.state.get(
|
|
5
|
+
isDismissed(t) {
|
|
6
|
+
return this.state.get(t)?.isDismissed ?? !1;
|
|
7
7
|
}
|
|
8
|
-
dismiss(
|
|
9
|
-
this.state.set(
|
|
10
|
-
id:
|
|
8
|
+
dismiss(t) {
|
|
9
|
+
this.state.set(t, {
|
|
10
|
+
id: t,
|
|
11
11
|
isDismissed: !0
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
reset(
|
|
15
|
-
this.state.delete(
|
|
14
|
+
reset(t) {
|
|
15
|
+
this.state.delete(t);
|
|
16
16
|
}
|
|
17
17
|
resetAll() {
|
|
18
18
|
this.state.clear();
|
|
@@ -22,7 +22,7 @@ class m {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
var d = /* @__PURE__ */ ((e) => (e.Fade = "fade", e.Scale = "scale", e.Grow = "grow", e.Shrink = "shrink", e.SlideUp = "slide-up", e.SlideDown = "slide-down", e.SlideLeft = "slide-left", e.SlideRight = "slide-right", e.None = "none", e))(d || {});
|
|
25
|
-
const
|
|
25
|
+
const h = {
|
|
26
26
|
[d.SlideDown]: {
|
|
27
27
|
initial: { y: -20, opacity: 0 },
|
|
28
28
|
animate: { y: 0, opacity: 1 },
|
|
@@ -72,142 +72,142 @@ const f = {
|
|
|
72
72
|
function u(e) {
|
|
73
73
|
return e ? typeof e == "string" ? { variant: e } : e : null;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
const
|
|
77
|
-
return !
|
|
78
|
-
variant:
|
|
79
|
-
duration:
|
|
80
|
-
delay:
|
|
81
|
-
ease:
|
|
82
|
-
} :
|
|
75
|
+
function w(e, t) {
|
|
76
|
+
const i = u(e), s = u(t);
|
|
77
|
+
return !i && !s ? null : i ? s ? {
|
|
78
|
+
variant: s.variant ?? i.variant,
|
|
79
|
+
duration: s.duration ?? i.duration,
|
|
80
|
+
delay: s.delay ?? i.delay,
|
|
81
|
+
ease: s.ease ?? i.ease
|
|
82
|
+
} : i : s;
|
|
83
83
|
}
|
|
84
84
|
function b(e) {
|
|
85
|
-
const
|
|
86
|
-
if (!
|
|
87
|
-
const
|
|
88
|
-
return
|
|
89
|
-
variants:
|
|
85
|
+
const t = u(e);
|
|
86
|
+
if (!t) return null;
|
|
87
|
+
const i = h[t.variant];
|
|
88
|
+
return i ? {
|
|
89
|
+
variants: i,
|
|
90
90
|
transition: {
|
|
91
|
-
duration: (
|
|
91
|
+
duration: (t.duration || 300) / 1e3,
|
|
92
92
|
// Convert ms to seconds
|
|
93
|
-
delay: (
|
|
94
|
-
ease:
|
|
93
|
+
delay: (t.delay || 0) / 1e3,
|
|
94
|
+
ease: t.ease || [0.4, 0, 0.2, 1]
|
|
95
95
|
// cubic-bezier
|
|
96
96
|
}
|
|
97
|
-
} : (console.warn(`[Repere] Unknown animation variant: ${
|
|
97
|
+
} : (console.warn(`[Repere] Unknown animation variant: ${t.variant}`), null);
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
const
|
|
101
|
-
const
|
|
102
|
-
return
|
|
103
|
-
},
|
|
99
|
+
function x(e, t) {
|
|
100
|
+
const i = (o) => {
|
|
101
|
+
const n = o.match(/(-?\d+)%/);
|
|
102
|
+
return n ? parseFloat(n[1]) : 0;
|
|
103
|
+
}, s = i(e.x), r = i(e.y), a = (o = 0) => r === 0 && o === 0 ? `translate(${s}%, 0)` : o === 0 ? `translate(${s}%, ${r}%)` : `translate(${s}%, calc(${r}% + ${o}px))`;
|
|
104
104
|
return {
|
|
105
105
|
initial: {
|
|
106
|
-
...
|
|
107
|
-
transform:
|
|
106
|
+
...t.initial,
|
|
107
|
+
transform: a(t.initial.y || 0)
|
|
108
108
|
},
|
|
109
109
|
animate: {
|
|
110
|
-
...
|
|
111
|
-
transform:
|
|
110
|
+
...t.animate,
|
|
111
|
+
transform: a(t.animate.y || 0)
|
|
112
112
|
},
|
|
113
113
|
exit: {
|
|
114
|
-
...
|
|
115
|
-
transform:
|
|
114
|
+
...t.exit,
|
|
115
|
+
transform: a(t.exit.y || 0)
|
|
116
116
|
}
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
if (!e && !
|
|
121
|
-
const
|
|
119
|
+
function k(e, t) {
|
|
120
|
+
if (!e && !t) return {};
|
|
121
|
+
const i = e?.variants, s = e?.transition, r = t?.variants, a = t?.transition, o = a?.ease ?? s?.ease ?? [0.4, 0, 0.2, 1], n = Array.isArray(o) ? `cubic-bezier(${o.join(", ")})` : o;
|
|
122
122
|
return {
|
|
123
123
|
// Initial state (when opening starts) - from onOpen animation
|
|
124
|
-
"--repere-initial-opacity":
|
|
125
|
-
"--repere-initial-x": `${
|
|
126
|
-
"--repere-initial-y": `${
|
|
127
|
-
"--repere-initial-scale":
|
|
124
|
+
"--repere-initial-opacity": i?.initial.opacity ?? 0,
|
|
125
|
+
"--repere-initial-x": `${i?.initial.x ?? 0}px`,
|
|
126
|
+
"--repere-initial-y": `${i?.initial.y ?? 0}px`,
|
|
127
|
+
"--repere-initial-scale": i?.initial.scale ?? 1,
|
|
128
128
|
// Animate state (fully open) - from onOpen animation
|
|
129
|
-
"--repere-animate-opacity":
|
|
130
|
-
"--repere-animate-x": `${
|
|
131
|
-
"--repere-animate-y": `${
|
|
132
|
-
"--repere-animate-scale":
|
|
129
|
+
"--repere-animate-opacity": i?.animate.opacity ?? 1,
|
|
130
|
+
"--repere-animate-x": `${i?.animate.x ?? 0}px`,
|
|
131
|
+
"--repere-animate-y": `${i?.animate.y ?? 0}px`,
|
|
132
|
+
"--repere-animate-scale": i?.animate.scale ?? 1,
|
|
133
133
|
// Exit state (when closing) - from onClose animation
|
|
134
134
|
"--repere-exit-opacity": r?.exit.opacity ?? 0,
|
|
135
135
|
"--repere-exit-x": `${r?.exit.x ?? 0}px`,
|
|
136
136
|
"--repere-exit-y": `${r?.exit.y ?? 0}px`,
|
|
137
137
|
"--repere-exit-scale": r?.exit.scale ?? 1,
|
|
138
138
|
// Transition timing
|
|
139
|
-
"--repere-transition-duration": `${
|
|
140
|
-
"--repere-transition-timing":
|
|
139
|
+
"--repere-transition-duration": `${a?.duration ?? s?.duration ?? 0.3}s`,
|
|
140
|
+
"--repere-transition-timing": n
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
-
function v(e,
|
|
144
|
-
const
|
|
145
|
-
return Math.max(
|
|
143
|
+
function v(e, t) {
|
|
144
|
+
const i = e?.transition.duration ?? 0, s = t?.transition.duration ?? 0;
|
|
145
|
+
return Math.max(i, s) * 1e3;
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
return new Promise((
|
|
147
|
+
function T(e) {
|
|
148
|
+
return new Promise((t) => setTimeout(t, e));
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
if (
|
|
152
|
-
return
|
|
153
|
-
if (
|
|
150
|
+
function g(e, t) {
|
|
151
|
+
if (t instanceof RegExp)
|
|
152
|
+
return t.test(e);
|
|
153
|
+
if (t === e)
|
|
154
154
|
return !0;
|
|
155
|
-
if (
|
|
156
|
-
const
|
|
157
|
-
return new RegExp(`^${
|
|
155
|
+
if (t.includes("*")) {
|
|
156
|
+
const i = t.replace(/[.+?^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*");
|
|
157
|
+
return new RegExp(`^${i}$`).test(e);
|
|
158
158
|
}
|
|
159
159
|
return !1;
|
|
160
160
|
}
|
|
161
|
-
class
|
|
161
|
+
class I {
|
|
162
162
|
store;
|
|
163
163
|
debug;
|
|
164
|
-
constructor(
|
|
165
|
-
this.store =
|
|
164
|
+
constructor(t, i = {}) {
|
|
165
|
+
this.store = t, this.debug = i.debug ?? !1;
|
|
166
166
|
}
|
|
167
167
|
/**
|
|
168
168
|
* Find all pages that match the current path
|
|
169
169
|
* This supports wildcards - e.g., path="*" will match all pages
|
|
170
170
|
*/
|
|
171
|
-
findMatchingPages(
|
|
172
|
-
const
|
|
171
|
+
findMatchingPages(t, i) {
|
|
172
|
+
const s = t.filter((r) => typeof r.path == "function" ? r.path(i) : g(i, r.path));
|
|
173
173
|
return this.debug && console.log(
|
|
174
174
|
"[BeaconManager] Path:",
|
|
175
|
-
|
|
175
|
+
i,
|
|
176
176
|
"Matched pages:",
|
|
177
|
-
|
|
178
|
-
),
|
|
177
|
+
s.map((r) => r.id).join(", ") || "none"
|
|
178
|
+
), s;
|
|
179
179
|
}
|
|
180
180
|
/**
|
|
181
181
|
* Get all active (non-dismissed) beacons for the current path
|
|
182
182
|
* Includes beacons from all matching pages (supports wildcards)
|
|
183
183
|
*/
|
|
184
|
-
async getActiveBeacons(
|
|
185
|
-
const
|
|
186
|
-
if (
|
|
184
|
+
async getActiveBeacons(t, i) {
|
|
185
|
+
const s = this.findMatchingPages(t, i);
|
|
186
|
+
if (s.length === 0)
|
|
187
187
|
return this.debug && console.log("[BeaconManager] No matching pages found"), [];
|
|
188
188
|
this.debug && console.log(
|
|
189
189
|
"[BeaconManager] Found",
|
|
190
|
-
|
|
190
|
+
s.length,
|
|
191
191
|
"matching page(s):",
|
|
192
|
-
|
|
192
|
+
s.map((n) => n.id).join(", ")
|
|
193
193
|
);
|
|
194
|
-
const r = [],
|
|
195
|
-
for (const
|
|
196
|
-
for (const l of
|
|
197
|
-
if (
|
|
194
|
+
const r = [], a = /* @__PURE__ */ new Set();
|
|
195
|
+
for (const n of s)
|
|
196
|
+
for (const l of n.beacons) {
|
|
197
|
+
if (a.has(l.id)) {
|
|
198
198
|
this.debug && console.warn(
|
|
199
|
-
`[BeaconManager] Duplicate beacon ID "${l.id}" in page "${
|
|
199
|
+
`[BeaconManager] Duplicate beacon ID "${l.id}" in page "${n.id}", skipping`
|
|
200
200
|
);
|
|
201
201
|
continue;
|
|
202
202
|
}
|
|
203
|
-
|
|
203
|
+
a.add(l.id), r.push(l);
|
|
204
204
|
}
|
|
205
|
-
const
|
|
206
|
-
for (const
|
|
205
|
+
const o = [];
|
|
206
|
+
for (const n of r)
|
|
207
207
|
await Promise.resolve(
|
|
208
|
-
this.store.isDismissed(
|
|
209
|
-
) ? this.debug && console.log("[BeaconManager] Beacon",
|
|
210
|
-
return this.debug && console.log("[BeaconManager] Active beacons:",
|
|
208
|
+
this.store.isDismissed(n.id)
|
|
209
|
+
) ? this.debug && console.log("[BeaconManager] Beacon", n.id, "is dismissed") : o.push(n);
|
|
210
|
+
return this.debug && console.log("[BeaconManager] Active beacons:", o.length), o;
|
|
211
211
|
}
|
|
212
212
|
/**
|
|
213
213
|
* Get the store instance
|
|
@@ -216,43 +216,43 @@ class T {
|
|
|
216
216
|
return this.store;
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
-
function
|
|
220
|
-
const { x:
|
|
221
|
-
let
|
|
222
|
-
switch (
|
|
219
|
+
function f(e, t = c.TopRight, i = { x: 0, y: 0 }) {
|
|
220
|
+
const { x: s = 0, y: r = 0 } = i;
|
|
221
|
+
let a = 0, o = 0, n = "0", l = "0";
|
|
222
|
+
switch (t) {
|
|
223
223
|
// Top positions
|
|
224
224
|
case c.TopLeft:
|
|
225
|
-
|
|
225
|
+
a = e.top + window.scrollY, o = e.left + window.scrollX, n = "-50%", l = "-100%";
|
|
226
226
|
break;
|
|
227
227
|
case c.TopCenter:
|
|
228
|
-
|
|
228
|
+
a = e.top + window.scrollY, o = e.left + window.scrollX + e.width / 2, n = "-50%", l = "-100%";
|
|
229
229
|
break;
|
|
230
230
|
case c.TopRight:
|
|
231
|
-
|
|
231
|
+
a = e.top + window.scrollY, o = e.right + window.scrollX, n = "-50%", l = "-100%";
|
|
232
232
|
break;
|
|
233
233
|
// Right positions
|
|
234
234
|
case c.RightCenter:
|
|
235
|
-
|
|
235
|
+
a = e.top + window.scrollY + e.height / 2, o = e.right + window.scrollX, n = "0", l = "-50%";
|
|
236
236
|
break;
|
|
237
237
|
// Bottom positions
|
|
238
238
|
case c.BottomLeft:
|
|
239
|
-
|
|
239
|
+
a = e.bottom + window.scrollY, o = e.left + window.scrollX, n = "-50%", l = "0";
|
|
240
240
|
break;
|
|
241
241
|
case c.BottomCenter:
|
|
242
|
-
|
|
242
|
+
a = e.bottom + window.scrollY, o = e.left + window.scrollX + e.width / 2, n = "-50%", l = "0";
|
|
243
243
|
break;
|
|
244
244
|
case c.BottomRight:
|
|
245
|
-
|
|
245
|
+
a = e.bottom + window.scrollY, o = e.right + window.scrollX, n = "-50%", l = "0";
|
|
246
246
|
break;
|
|
247
247
|
// Left positions
|
|
248
248
|
case c.LeftCenter:
|
|
249
|
-
|
|
249
|
+
a = e.top + window.scrollY + e.height / 2, o = e.left + window.scrollX, n = "-100%", l = "-50%";
|
|
250
250
|
break;
|
|
251
251
|
}
|
|
252
|
-
return
|
|
253
|
-
top:
|
|
254
|
-
left:
|
|
255
|
-
translate: { x:
|
|
252
|
+
return a += r, o += s, {
|
|
253
|
+
top: a,
|
|
254
|
+
left: o,
|
|
255
|
+
translate: { x: n, y: l }
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
258
|
class L {
|
|
@@ -262,68 +262,114 @@ class L {
|
|
|
262
262
|
resizeObserver = null;
|
|
263
263
|
mutationObserver = null;
|
|
264
264
|
debug = !1;
|
|
265
|
-
constructor(
|
|
266
|
-
this.debug =
|
|
265
|
+
constructor(t = !1) {
|
|
266
|
+
this.debug = t;
|
|
267
267
|
}
|
|
268
268
|
/**
|
|
269
269
|
* Subscribe to position updates for an element
|
|
270
270
|
*/
|
|
271
|
-
subscribe(
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
selector:
|
|
275
|
-
position:
|
|
271
|
+
subscribe(t, i, s, r = {}) {
|
|
272
|
+
const a = t;
|
|
273
|
+
this.tracked.has(a) || this.tracked.set(a, {
|
|
274
|
+
selector: t,
|
|
275
|
+
position: i,
|
|
276
276
|
offset: r.offset,
|
|
277
277
|
zIndex: r.zIndex ?? 9999,
|
|
278
278
|
delay: r.delay,
|
|
279
|
-
callbacks: /* @__PURE__ */ new
|
|
279
|
+
callbacks: /* @__PURE__ */ new Map(),
|
|
280
280
|
element: null,
|
|
281
|
-
|
|
282
|
-
})
|
|
283
|
-
|
|
284
|
-
|
|
281
|
+
delayTimeoutIds: /* @__PURE__ */ new Map()
|
|
282
|
+
});
|
|
283
|
+
const o = this.tracked.get(a);
|
|
284
|
+
return o ? (o.callbacks.set(s, {
|
|
285
|
+
callback: s,
|
|
286
|
+
needsInitialDelay: (r.delay ?? 0) > 0
|
|
287
|
+
}), this.tracked.size === 1 && this.startListening(), this.scheduleInitialUpdate(a, s), () => {
|
|
288
|
+
const n = this.tracked.get(a);
|
|
289
|
+
if (n) {
|
|
290
|
+
const l = n.delayTimeoutIds.get(s);
|
|
291
|
+
if (l !== void 0 && (clearTimeout(l), n.delayTimeoutIds.delete(s)), n.callbacks.delete(s), n.callbacks.size === 0) {
|
|
292
|
+
for (const [, p] of n.delayTimeoutIds)
|
|
293
|
+
clearTimeout(p);
|
|
294
|
+
n.delayTimeoutIds.clear(), this.tracked.delete(a), this.tracked.size === 0 && this.stopListening();
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}) : () => {
|
|
285
298
|
};
|
|
286
299
|
}
|
|
287
|
-
scheduleInitialUpdate(i) {
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
300
|
+
scheduleInitialUpdate(t, i) {
|
|
301
|
+
const s = this.tracked.get(t);
|
|
302
|
+
if (!s) return;
|
|
303
|
+
const r = s.callbacks.get(i);
|
|
304
|
+
if (r)
|
|
305
|
+
if (r.needsInitialDelay && s.delay && s.delay > 0) {
|
|
306
|
+
this.debug && console.log(
|
|
307
|
+
`[PositionTracker] Delaying initial position calculation for ${t} by ${s.delay}ms`
|
|
308
|
+
);
|
|
309
|
+
const a = setTimeout(() => {
|
|
310
|
+
this.debug && console.log(
|
|
311
|
+
`[PositionTracker] Calculating position for ${t} after delay`
|
|
312
|
+
);
|
|
313
|
+
const o = s.callbacks.get(i);
|
|
314
|
+
o && (o.needsInitialDelay = !1), s.delayTimeoutIds.delete(i), this.updatePositionForCallback(t, i);
|
|
315
|
+
}, s.delay);
|
|
316
|
+
s.delayTimeoutIds.set(i, a);
|
|
317
|
+
} else
|
|
318
|
+
this.updatePositionForCallback(t, i);
|
|
319
|
+
}
|
|
320
|
+
updatePositionForCallback(t, i) {
|
|
321
|
+
const s = this.tracked.get(t);
|
|
322
|
+
if (!s) return;
|
|
323
|
+
const r = document.querySelector(s.selector);
|
|
324
|
+
if (!r) {
|
|
325
|
+
this.debug && console.log(`[PositionTracker] Element not found: ${s.selector}`), s.element = null, i(null);
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
s.element = r;
|
|
329
|
+
const a = r.getBoundingClientRect(), n = {
|
|
330
|
+
...f(
|
|
331
|
+
a,
|
|
332
|
+
s.position,
|
|
333
|
+
s.offset
|
|
334
|
+
),
|
|
335
|
+
position: "fixed",
|
|
336
|
+
zIndex: s.zIndex
|
|
337
|
+
};
|
|
338
|
+
this.debug && console.log(
|
|
339
|
+
`[PositionTracker] Updated position for ${s.selector}:`,
|
|
340
|
+
n
|
|
341
|
+
), i(n);
|
|
296
342
|
}
|
|
297
|
-
updatePosition(
|
|
298
|
-
const
|
|
299
|
-
if (!
|
|
300
|
-
const
|
|
301
|
-
if (!
|
|
302
|
-
this.debug && console.log(`[PositionTracker] Element not found: ${
|
|
303
|
-
for (const
|
|
304
|
-
|
|
343
|
+
updatePosition(t) {
|
|
344
|
+
const i = this.tracked.get(t);
|
|
345
|
+
if (!i) return;
|
|
346
|
+
const s = document.querySelector(i.selector);
|
|
347
|
+
if (!s) {
|
|
348
|
+
this.debug && console.log(`[PositionTracker] Element not found: ${i.selector}`), i.element = null;
|
|
349
|
+
for (const [n, l] of i.callbacks)
|
|
350
|
+
l.needsInitialDelay || n(null);
|
|
305
351
|
return;
|
|
306
352
|
}
|
|
307
|
-
|
|
308
|
-
const r =
|
|
309
|
-
...
|
|
353
|
+
i.element = s;
|
|
354
|
+
const r = s.getBoundingClientRect(), o = {
|
|
355
|
+
...f(
|
|
310
356
|
r,
|
|
311
|
-
|
|
312
|
-
|
|
357
|
+
i.position,
|
|
358
|
+
i.offset
|
|
313
359
|
),
|
|
314
360
|
position: "fixed",
|
|
315
|
-
zIndex:
|
|
361
|
+
zIndex: i.zIndex
|
|
316
362
|
};
|
|
317
363
|
this.debug && console.log(
|
|
318
|
-
`[PositionTracker] Updated position for ${
|
|
319
|
-
|
|
364
|
+
`[PositionTracker] Updated position for ${i.selector}:`,
|
|
365
|
+
o
|
|
320
366
|
);
|
|
321
|
-
for (const
|
|
322
|
-
|
|
367
|
+
for (const [n, l] of i.callbacks)
|
|
368
|
+
l.needsInitialDelay || n(o);
|
|
323
369
|
}
|
|
324
370
|
updateAllPositions = () => {
|
|
325
|
-
for (const [
|
|
326
|
-
this.updatePosition(
|
|
371
|
+
for (const [t] of this.tracked)
|
|
372
|
+
this.updatePosition(t);
|
|
327
373
|
};
|
|
328
374
|
startListening() {
|
|
329
375
|
this.scrollListener = this.updateAllPositions, window.addEventListener("scroll", this.scrollListener, !0), this.resizeListener = this.updateAllPositions, window.addEventListener("resize", this.resizeListener), "ResizeObserver" in window && (this.resizeObserver = new ResizeObserver(this.updateAllPositions)), this.mutationObserver = new MutationObserver(() => {
|
|
@@ -340,22 +386,25 @@ class L {
|
|
|
340
386
|
* Clean up all listeners and subscriptions
|
|
341
387
|
*/
|
|
342
388
|
destroy() {
|
|
343
|
-
for (const [,
|
|
344
|
-
|
|
389
|
+
for (const [, t] of this.tracked) {
|
|
390
|
+
for (const [, i] of t.delayTimeoutIds)
|
|
391
|
+
clearTimeout(i);
|
|
392
|
+
t.delayTimeoutIds.clear();
|
|
393
|
+
}
|
|
345
394
|
this.stopListening(), this.tracked.clear();
|
|
346
395
|
}
|
|
347
396
|
}
|
|
348
397
|
export {
|
|
349
398
|
d as Animation,
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
399
|
+
I as BeaconManager,
|
|
400
|
+
m as DEFAULT_POSITION,
|
|
401
|
+
y as MemoryStore,
|
|
353
402
|
c as Position,
|
|
354
403
|
L as PositionTracker,
|
|
355
404
|
v as calculateDismissDuration,
|
|
356
|
-
|
|
405
|
+
x as combineTranslateWithAnimation,
|
|
357
406
|
b as getAnimationConfig,
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
407
|
+
k as getPopoverAnimationStyles,
|
|
408
|
+
w as mergeAnimationConfigs,
|
|
409
|
+
T as waitForAnimations
|
|
361
410
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PositionTracker.d.ts","sourceRoot":"","sources":["../../src/utils/PositionTracker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGlD,MAAM,MAAM,gBAAgB,GAAG,CAC7B,QAAQ,EAAE,wBAAwB,GAAG,IAAI,KACtC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"PositionTracker.d.ts","sourceRoot":"","sources":["../../src/utils/PositionTracker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGlD,MAAM,MAAM,gBAAgB,GAAG,CAC7B,QAAQ,EAAE,wBAAwB,GAAG,IAAI,KACtC,IAAI,CAAC;AAkBV;;;GAGG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,OAAO,CAAqC;IACpD,OAAO,CAAC,cAAc,CAA6B;IACnD,OAAO,CAAC,cAAc,CAA6B;IACnD,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,gBAAgB,CAAiC;IACzD,OAAO,CAAC,KAAK,CAAS;gBAEV,KAAK,UAAQ;IAIzB;;OAEG;IACH,SAAS,CACP,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,GAAE;QACP,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;KACX,GACL,MAAM,IAAI;IAiEb,OAAO,CAAC,qBAAqB;IA0C7B,OAAO,CAAC,yBAAyB;IAuCjC,OAAO,CAAC,cAAc;IAiDtB,OAAO,CAAC,kBAAkB,CAIxB;IAEF,OAAO,CAAC,cAAc;IAyBtB,OAAO,CAAC,aAAa;IAkBrB;;OAEG;IACH,OAAO;CAYR"}
|