storybook 9.0.0-alpha.11 → 9.0.0-alpha.13

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.
Files changed (93) hide show
  1. package/assets/docs/addon-backgrounds.gif +0 -0
  2. package/assets/docs/highlight.png +0 -0
  3. package/bin/index.cjs +2 -2
  4. package/dist/actions/preview.d.ts +0 -1
  5. package/dist/backgrounds/index.cjs +148 -0
  6. package/dist/backgrounds/index.d.ts +91 -0
  7. package/dist/backgrounds/index.js +130 -0
  8. package/dist/backgrounds/preview.cjs +143 -0
  9. package/dist/backgrounds/preview.d.ts +54 -0
  10. package/dist/backgrounds/preview.js +127 -0
  11. package/dist/bin/index.cjs +49 -61
  12. package/dist/bin/index.js +49 -61
  13. package/dist/builder-manager/index.cjs +390 -380
  14. package/dist/builder-manager/index.js +489 -479
  15. package/dist/channels/index.cjs +17 -17
  16. package/dist/channels/index.js +3 -3
  17. package/dist/cli/bin/index.cjs +225 -225
  18. package/dist/cli/bin/index.js +234 -234
  19. package/dist/cli/index.cjs +1904 -1909
  20. package/dist/cli/index.d.ts +3 -7
  21. package/dist/cli/index.js +734 -739
  22. package/dist/common/index.cjs +2401 -2388
  23. package/dist/common/index.d.ts +1 -13
  24. package/dist/common/index.js +2609 -2596
  25. package/dist/components/index.cjs +5701 -5946
  26. package/dist/components/index.d.ts +3 -254
  27. package/dist/components/index.js +7271 -13724
  28. package/dist/controls/preview.d.ts +0 -1
  29. package/dist/core-events/index.cjs +91 -106
  30. package/dist/core-events/index.d.ts +2 -80
  31. package/dist/core-events/index.js +79 -94
  32. package/dist/core-server/index.cjs +5221 -5122
  33. package/dist/core-server/index.d.ts +32 -23
  34. package/dist/core-server/index.js +6511 -6412
  35. package/dist/core-server/presets/common-manager.js +9815 -12
  36. package/dist/core-server/presets/common-preset.cjs +2817 -2989
  37. package/dist/core-server/presets/common-preset.js +2896 -3068
  38. package/dist/csf/index.d.ts +0 -2
  39. package/dist/csf-tools/index.cjs +0 -8
  40. package/dist/csf-tools/index.d.ts +0 -4
  41. package/dist/csf-tools/index.js +0 -8
  42. package/dist/docs-tools/index.cjs +626 -600
  43. package/dist/docs-tools/index.js +613 -587
  44. package/dist/highlight/index.cjs +27 -0
  45. package/dist/highlight/index.d.ts +17 -0
  46. package/dist/highlight/index.js +7 -0
  47. package/dist/highlight/preview.cjs +81 -0
  48. package/dist/highlight/preview.d.ts +54 -0
  49. package/dist/highlight/preview.js +67 -0
  50. package/dist/instrumenter/index.cjs +70 -60
  51. package/dist/instrumenter/index.d.ts +8 -7
  52. package/dist/instrumenter/index.js +98 -88
  53. package/dist/manager/globals-module-info.cjs +21 -33
  54. package/dist/manager/globals-module-info.js +6 -18
  55. package/dist/manager/globals-runtime.js +22671 -22006
  56. package/dist/manager/runtime.js +4996 -4581
  57. package/dist/manager-api/index.cjs +1289 -1384
  58. package/dist/manager-api/index.d.ts +109 -114
  59. package/dist/manager-api/index.js +920 -1021
  60. package/dist/measure/index.cjs +474 -0
  61. package/dist/measure/index.d.ts +66 -0
  62. package/dist/measure/index.js +462 -0
  63. package/dist/measure/preview.cjs +464 -0
  64. package/dist/measure/preview.d.ts +59 -0
  65. package/dist/measure/preview.js +448 -0
  66. package/dist/outline/index.cjs +528 -0
  67. package/dist/outline/index.d.ts +66 -0
  68. package/dist/outline/index.js +500 -0
  69. package/dist/outline/preview.cjs +518 -0
  70. package/dist/outline/preview.d.ts +59 -0
  71. package/dist/outline/preview.js +486 -0
  72. package/dist/preview/runtime.js +14340 -13357
  73. package/dist/preview-api/index.cjs +1201 -1321
  74. package/dist/preview-api/index.d.ts +66 -120
  75. package/dist/preview-api/index.js +1546 -1665
  76. package/dist/telemetry/index.d.ts +1 -1
  77. package/dist/test/index.cjs +1547 -1546
  78. package/dist/test/index.js +2308 -2307
  79. package/dist/test/preview.cjs +1906 -1905
  80. package/dist/test/preview.d.ts +0 -6
  81. package/dist/test/preview.js +1439 -1438
  82. package/dist/test/spy.cjs +65 -64
  83. package/dist/test/spy.js +59 -58
  84. package/dist/types/index.cjs +11 -12
  85. package/dist/types/index.d.ts +502 -298
  86. package/dist/types/index.js +1 -2
  87. package/dist/viewport/preview.d.ts +0 -1
  88. package/package.json +124 -19
  89. package/dist/actions/manager.js +0 -1196
  90. package/dist/component-testing/manager.js +0 -3099
  91. package/dist/controls/manager.js +0 -5545
  92. package/dist/viewport/manager.js +0 -400
  93. /package/dist/{component-testing/manager.css → core-server/presets/common-manager.css} +0 -0
@@ -0,0 +1,462 @@
1
+ var H = Object.defineProperty;
2
+ var l = (e, t) => H(e, "name", { value: t, configurable: !0 });
3
+ var st = (e, t) => {
4
+ for (var o in t)
5
+ H(e, o, { get: t[o], enumerable: !0 });
6
+ };
7
+
8
+ // src/measure/index.ts
9
+ import { definePreview as Dt } from "storybook/preview-api";
10
+
11
+ // src/measure/preview.ts
12
+ var P = {};
13
+ st(P, {
14
+ decorators: () => Q,
15
+ default: () => xt,
16
+ initialGlobals: () => J
17
+ });
18
+ import { definePreview as Mt } from "storybook/preview-api";
19
+
20
+ // src/measure/constants.ts
21
+ var C = "storybook/measure-addon", Tt = `${C}/tool`, W = "measureEnabled", Pt = {
22
+ RESULT: `${C}/result`,
23
+ REQUEST: `${C}/request`,
24
+ CLEAR: `${C}/clear`
25
+ };
26
+
27
+ // src/measure/withMeasure.ts
28
+ import { useEffect as V } from "storybook/preview-api";
29
+
30
+ // src/measure/box-model/canvas.ts
31
+ import { global as R } from "@storybook/global";
32
+
33
+ // ../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
34
+ var ft = !1, D = "Invariant failed";
35
+ function v(e, t) {
36
+ if (!e) {
37
+ if (ft)
38
+ throw new Error(D);
39
+ var o = typeof t == "function" ? t() : t, i = o ? "".concat(D, ": ").concat(o) : D;
40
+ throw new Error(i);
41
+ }
42
+ }
43
+ l(v, "invariant");
44
+
45
+ // src/measure/box-model/canvas.ts
46
+ function F() {
47
+ let e = R.document.documentElement, t = Math.max(e.scrollHeight, e.offsetHeight);
48
+ return { width: Math.max(e.scrollWidth, e.offsetWidth), height: t };
49
+ }
50
+ l(F, "getDocumentWidthAndHeight");
51
+ function ct() {
52
+ let e = R.document.createElement("canvas");
53
+ e.id = "storybook-addon-measure";
54
+ let t = e.getContext("2d");
55
+ v(t != null);
56
+ let { width: o, height: i } = F();
57
+ return k(e, t, { width: o, height: i }), e.style.position = "absolute", e.style.left = "0", e.style.top = "0", e.style.zIndex = "214748364\
58
+ 7", e.style.pointerEvents = "none", R.document.body.appendChild(e), { canvas: e, context: t, width: o, height: i };
59
+ }
60
+ l(ct, "createCanvas");
61
+ function k(e, t, { width: o, height: i }) {
62
+ e.style.width = `${o}px`, e.style.height = `${i}px`;
63
+ let n = R.window.devicePixelRatio;
64
+ e.width = Math.floor(o * n), e.height = Math.floor(i * n), t.scale(n, n);
65
+ }
66
+ l(k, "setCanvasWidthAndHeight");
67
+ var m = {};
68
+ function Y() {
69
+ m.canvas || (m = ct());
70
+ }
71
+ l(Y, "init");
72
+ function B() {
73
+ m.context && m.context.clearRect(0, 0, m.width ?? 0, m.height ?? 0);
74
+ }
75
+ l(B, "clear");
76
+ function z(e) {
77
+ B(), e(m.context);
78
+ }
79
+ l(z, "draw");
80
+ function X() {
81
+ v(m.canvas, "Canvas should exist in the state."), v(m.context, "Context should exist in the state."), k(m.canvas, m.context, { width: 0, height: 0 });
82
+ let { width: e, height: t } = F();
83
+ k(m.canvas, m.context, { width: e, height: t }), m.width = e, m.height = t;
84
+ }
85
+ l(X, "rescale");
86
+ function $() {
87
+ m.canvas && (B(), m.canvas.parentNode?.removeChild(m.canvas), m = {});
88
+ }
89
+ l($, "destroy");
90
+
91
+ // src/measure/box-model/visualizer.ts
92
+ import { global as b } from "@storybook/global";
93
+
94
+ // src/measure/box-model/labels.ts
95
+ var w = {
96
+ margin: "#f6b26b",
97
+ border: "#ffe599",
98
+ padding: "#93c47d",
99
+ content: "#6fa8dc",
100
+ text: "#232020"
101
+ }, g = 6;
102
+ function N(e, { x: t, y: o, w: i, h: n, r }) {
103
+ t = t - i / 2, o = o - n / 2, i < 2 * r && (r = i / 2), n < 2 * r && (r = n / 2), e.beginPath(), e.moveTo(t + r, o), e.arcTo(t + i, o, t +
104
+ i, o + n, r), e.arcTo(t + i, o + n, t, o + n, r), e.arcTo(t, o + n, t, o, r), e.arcTo(t, o, t + i, o, r), e.closePath();
105
+ }
106
+ l(N, "roundedRect");
107
+ function mt(e, { padding: t, border: o, width: i, height: n, top: r, left: a }) {
108
+ let s = i - o.left - o.right - t.left - t.right, f = n - t.top - t.bottom - o.top - o.bottom, c = a + o.left + t.left, d = r + o.top + t.top;
109
+ return e === "top" ? c += s / 2 : e === "right" ? (c += s, d += f / 2) : e === "bottom" ? (c += s / 2, d += f) : e === "left" ? d += f / 2 :
110
+ e === "center" && (c += s / 2, d += f / 2), { x: c, y: d };
111
+ }
112
+ l(mt, "positionCoordinate");
113
+ function dt(e, t, { margin: o, border: i, padding: n }, r, a) {
114
+ let s = /* @__PURE__ */ l((p) => 0, "shift"), f = 0, c = 0, d = a ? 1 : 0.5, u = a ? r * 2 : 0;
115
+ return e === "padding" ? s = /* @__PURE__ */ l((p) => n[p] * d + u, "shift") : e === "border" ? s = /* @__PURE__ */ l((p) => n[p] + i[p] *
116
+ d + u, "shift") : e === "margin" && (s = /* @__PURE__ */ l((p) => n[p] + i[p] + o[p] * d + u, "shift")), t === "top" ? c = -s("top") : t ===
117
+ "right" ? f = s("right") : t === "bottom" ? c = s("bottom") : t === "left" && (f = -s("left")), { offsetX: f, offsetY: c };
118
+ }
119
+ l(dt, "offset");
120
+ function pt(e, t) {
121
+ return Math.abs(e.x - t.x) < Math.abs(e.w + t.w) / 2 && Math.abs(e.y - t.y) < Math.abs(e.h + t.h) / 2;
122
+ }
123
+ l(pt, "collide");
124
+ function ut(e, t, o) {
125
+ return e === "top" ? t.y = o.y - o.h - g : e === "right" ? t.x = o.x + o.w / 2 + g + t.w / 2 : e === "bottom" ? t.y = o.y + o.h + g : e ===
126
+ "left" && (t.x = o.x - o.w / 2 - g - t.w / 2), { x: t.x, y: t.y };
127
+ }
128
+ l(ut, "overlapAdjustment");
129
+ function O(e, t, { x: o, y: i, w: n, h: r }, a) {
130
+ return N(e, { x: o, y: i, w: n, h: r, r: 3 }), e.fillStyle = `${w[t]}dd`, e.fill(), e.strokeStyle = w[t], e.stroke(), e.fillStyle = w.text,
131
+ e.fillText(a, o, i), N(e, { x: o, y: i, w: n, h: r, r: 3 }), e.fillStyle = `${w[t]}dd`, e.fill(), e.strokeStyle = w[t], e.stroke(), e.fillStyle =
132
+ w.text, e.fillText(a, o, i), { x: o, y: i, w: n, h: r };
133
+ }
134
+ l(O, "textWithRect");
135
+ function I(e, t) {
136
+ e.font = "600 12px monospace", e.textBaseline = "middle", e.textAlign = "center";
137
+ let o = e.measureText(t), i = o.actualBoundingBoxAscent + o.actualBoundingBoxDescent, n = o.width + g * 2, r = i + g * 2;
138
+ return { w: n, h: r };
139
+ }
140
+ l(I, "configureText");
141
+ function ht(e, t, { type: o, position: i = "center", text: n }, r, a = !1) {
142
+ let { x: s, y: f } = mt(i, t), { offsetX: c, offsetY: d } = dt(o, i, t, g + 1, a);
143
+ s += c, f += d;
144
+ let { w: u, h: p } = I(e, n);
145
+ if (r && pt({ x: s, y: f, w: u, h: p }, r)) {
146
+ let S = ut(i, { x: s, y: f, w: u, h: p }, r);
147
+ s = S.x, f = S.y;
148
+ }
149
+ return O(e, o, { x: s, y: f, w: u, h: p }, n);
150
+ }
151
+ l(ht, "drawLabel");
152
+ function bt(e, { w: t, h: o }) {
153
+ let i = t * 0.5 + g, n = o * 0.5 + g;
154
+ return {
155
+ offsetX: (e.x === "left" ? -1 : 1) * i,
156
+ offsetY: (e.y === "top" ? -1 : 1) * n
157
+ };
158
+ }
159
+ l(bt, "floatingOffset");
160
+ function gt(e, t, { type: o, text: i }) {
161
+ let { floatingAlignment: n, extremities: r } = t, a = r[n.x], s = r[n.y], { w: f, h: c } = I(e, i), { offsetX: d, offsetY: u } = bt(n, {
162
+ w: f,
163
+ h: c
164
+ });
165
+ return a += d, s += u, O(e, o, { x: a, y: s, w: f, h: c }, i);
166
+ }
167
+ l(gt, "drawFloatingLabel");
168
+ function E(e, t, o, i) {
169
+ let n = [];
170
+ o.forEach((r, a) => {
171
+ let s = i && r.position === "center" ? gt(e, t, r) : ht(e, t, r, n[a - 1], i);
172
+ n[a] = s;
173
+ });
174
+ }
175
+ l(E, "drawStack");
176
+ function _(e, t, o, i) {
177
+ let n = o.reduce((r, a) => (Object.prototype.hasOwnProperty.call(r, a.position) || (r[a.position] = []), r[a.position]?.push(a), r), {});
178
+ n.top && E(e, t, n.top, i), n.right && E(e, t, n.right, i), n.bottom && E(e, t, n.bottom, i), n.left && E(e, t, n.left, i), n.center && E(
179
+ e, t, n.center, i);
180
+ }
181
+ l(_, "labelStacks");
182
+
183
+ // src/measure/box-model/visualizer.ts
184
+ var M = {
185
+ margin: "#f6b26ba8",
186
+ border: "#ffe599a8",
187
+ padding: "#93c47d8c",
188
+ content: "#6fa8dca8"
189
+ }, q = 30;
190
+ function h(e) {
191
+ return parseInt(e.replace("px", ""), 10);
192
+ }
193
+ l(h, "pxToNumber");
194
+ function L(e) {
195
+ return Number.isInteger(e) ? e : e.toFixed(2);
196
+ }
197
+ l(L, "round");
198
+ function T(e) {
199
+ return e.filter((t) => t.text !== 0 && t.text !== "0");
200
+ }
201
+ l(T, "filterZeroValues");
202
+ function wt(e) {
203
+ let t = {
204
+ top: b.window.scrollY,
205
+ bottom: b.window.scrollY + b.window.innerHeight,
206
+ left: b.window.scrollX,
207
+ right: b.window.scrollX + b.window.innerWidth
208
+ }, o = {
209
+ top: Math.abs(t.top - e.top),
210
+ bottom: Math.abs(t.bottom - e.bottom),
211
+ left: Math.abs(t.left - e.left),
212
+ right: Math.abs(t.right - e.right)
213
+ };
214
+ return {
215
+ x: o.left > o.right ? "left" : "right",
216
+ y: o.top > o.bottom ? "top" : "bottom"
217
+ };
218
+ }
219
+ l(wt, "floatingAlignment");
220
+ function Lt(e) {
221
+ let t = b.getComputedStyle(e), { top: o, left: i, right: n, bottom: r, width: a, height: s } = e.getBoundingClientRect(), {
222
+ marginTop: f,
223
+ marginBottom: c,
224
+ marginLeft: d,
225
+ marginRight: u,
226
+ paddingTop: p,
227
+ paddingBottom: S,
228
+ paddingLeft: tt,
229
+ paddingRight: et,
230
+ borderBottomWidth: ot,
231
+ borderTopWidth: nt,
232
+ borderLeftWidth: it,
233
+ borderRightWidth: rt
234
+ } = t;
235
+ o = o + b.window.scrollY, i = i + b.window.scrollX, r = r + b.window.scrollY, n = n + b.window.scrollX;
236
+ let y = {
237
+ top: h(f),
238
+ bottom: h(c),
239
+ left: h(d),
240
+ right: h(u)
241
+ }, lt = {
242
+ top: h(p),
243
+ bottom: h(S),
244
+ left: h(tt),
245
+ right: h(et)
246
+ }, at = {
247
+ top: h(nt),
248
+ bottom: h(ot),
249
+ left: h(it),
250
+ right: h(rt)
251
+ }, A = {
252
+ top: o - y.top,
253
+ bottom: r + y.bottom,
254
+ left: i - y.left,
255
+ right: n + y.right
256
+ };
257
+ return {
258
+ margin: y,
259
+ padding: lt,
260
+ border: at,
261
+ top: o,
262
+ left: i,
263
+ bottom: r,
264
+ right: n,
265
+ width: a,
266
+ height: s,
267
+ extremities: A,
268
+ floatingAlignment: wt(A)
269
+ };
270
+ }
271
+ l(Lt, "measureElement");
272
+ function yt(e, { margin: t, width: o, height: i, top: n, left: r, bottom: a, right: s }) {
273
+ let f = i + t.bottom + t.top;
274
+ e.fillStyle = M.margin, e.fillRect(r, n - t.top, o, t.top), e.fillRect(s, n - t.top, t.right, f), e.fillRect(r, a, o, t.bottom), e.fillRect(
275
+ r - t.left, n - t.top, t.left, f);
276
+ let c = [
277
+ {
278
+ type: "margin",
279
+ text: L(t.top),
280
+ position: "top"
281
+ },
282
+ {
283
+ type: "margin",
284
+ text: L(t.right),
285
+ position: "right"
286
+ },
287
+ {
288
+ type: "margin",
289
+ text: L(t.bottom),
290
+ position: "bottom"
291
+ },
292
+ {
293
+ type: "margin",
294
+ text: L(t.left),
295
+ position: "left"
296
+ }
297
+ ];
298
+ return T(c);
299
+ }
300
+ l(yt, "drawMargin");
301
+ function Et(e, { padding: t, border: o, width: i, height: n, top: r, left: a, bottom: s, right: f }) {
302
+ let c = i - o.left - o.right, d = n - t.top - t.bottom - o.top - o.bottom;
303
+ e.fillStyle = M.padding, e.fillRect(a + o.left, r + o.top, c, t.top), e.fillRect(
304
+ f - t.right - o.right,
305
+ r + t.top + o.top,
306
+ t.right,
307
+ d
308
+ ), e.fillRect(
309
+ a + o.left,
310
+ s - t.bottom - o.bottom,
311
+ c,
312
+ t.bottom
313
+ ), e.fillRect(a + o.left, r + t.top + o.top, t.left, d);
314
+ let u = [
315
+ {
316
+ type: "padding",
317
+ text: t.top,
318
+ position: "top"
319
+ },
320
+ {
321
+ type: "padding",
322
+ text: t.right,
323
+ position: "right"
324
+ },
325
+ {
326
+ type: "padding",
327
+ text: t.bottom,
328
+ position: "bottom"
329
+ },
330
+ {
331
+ type: "padding",
332
+ text: t.left,
333
+ position: "left"
334
+ }
335
+ ];
336
+ return T(u);
337
+ }
338
+ l(Et, "drawPadding");
339
+ function St(e, { border: t, width: o, height: i, top: n, left: r, bottom: a, right: s }) {
340
+ let f = i - t.top - t.bottom;
341
+ e.fillStyle = M.border, e.fillRect(r, n, o, t.top), e.fillRect(r, a - t.bottom, o, t.bottom), e.fillRect(r, n + t.top, t.left, f), e.fillRect(
342
+ s - t.right, n + t.top, t.right, f);
343
+ let c = [
344
+ {
345
+ type: "border",
346
+ text: t.top,
347
+ position: "top"
348
+ },
349
+ {
350
+ type: "border",
351
+ text: t.right,
352
+ position: "right"
353
+ },
354
+ {
355
+ type: "border",
356
+ text: t.bottom,
357
+ position: "bottom"
358
+ },
359
+ {
360
+ type: "border",
361
+ text: t.left,
362
+ position: "left"
363
+ }
364
+ ];
365
+ return T(c);
366
+ }
367
+ l(St, "drawBorder");
368
+ function Ct(e, { padding: t, border: o, width: i, height: n, top: r, left: a }) {
369
+ let s = i - o.left - o.right - t.left - t.right, f = n - t.top - t.bottom - o.top - o.bottom;
370
+ return e.fillStyle = M.content, e.fillRect(
371
+ a + o.left + t.left,
372
+ r + o.top + t.top,
373
+ s,
374
+ f
375
+ ), [
376
+ {
377
+ type: "content",
378
+ position: "center",
379
+ text: `${L(s)} x ${L(f)}`
380
+ }
381
+ ];
382
+ }
383
+ l(Ct, "drawContent");
384
+ function vt(e) {
385
+ return (t) => {
386
+ if (e && t) {
387
+ let o = Lt(e), i = yt(t, o), n = Et(t, o), r = St(t, o), a = Ct(t, o), s = o.width <= q * 3 || o.height <= q;
388
+ _(
389
+ t,
390
+ o,
391
+ [...a, ...n, ...r, ...i],
392
+ s
393
+ );
394
+ }
395
+ };
396
+ }
397
+ l(vt, "drawBoxModel");
398
+ function j(e) {
399
+ z(vt(e));
400
+ }
401
+ l(j, "drawSelectedElement");
402
+
403
+ // src/measure/util.ts
404
+ import { global as Rt } from "@storybook/global";
405
+ var G = /* @__PURE__ */ l((e, t) => {
406
+ let o = Rt.document.elementFromPoint(e, t), i = /* @__PURE__ */ l((r) => {
407
+ if (r && r.shadowRoot) {
408
+ let a = r.shadowRoot.elementFromPoint(e, t);
409
+ return r.isEqualNode(a) ? r : a.shadowRoot ? i(a) : a;
410
+ }
411
+ return r;
412
+ }, "crawlShadows");
413
+ return i(o) || o;
414
+ }, "deepElementFromPoint");
415
+
416
+ // src/measure/withMeasure.ts
417
+ var K, x = { x: 0, y: 0 };
418
+ function U(e, t) {
419
+ K = G(e, t), j(K);
420
+ }
421
+ l(U, "findAndDrawElement");
422
+ var Z = /* @__PURE__ */ l((e, t) => {
423
+ let { measureEnabled: o } = t.globals || {};
424
+ return V(() => {
425
+ let i = /* @__PURE__ */ l((n) => {
426
+ window.requestAnimationFrame(() => {
427
+ n.stopPropagation(), x.x = n.clientX, x.y = n.clientY;
428
+ });
429
+ }, "onPointerMove");
430
+ return document.addEventListener("pointermove", i), () => {
431
+ document.removeEventListener("pointermove", i);
432
+ };
433
+ }, []), V(() => {
434
+ let i = /* @__PURE__ */ l((r) => {
435
+ window.requestAnimationFrame(() => {
436
+ r.stopPropagation(), U(r.clientX, r.clientY);
437
+ });
438
+ }, "onPointerOver"), n = /* @__PURE__ */ l(() => {
439
+ window.requestAnimationFrame(() => {
440
+ X();
441
+ });
442
+ }, "onResize");
443
+ return t.viewMode === "story" && o && (document.addEventListener("pointerover", i), Y(), window.addEventListener("resize", n), U(x.x, x.
444
+ y)), () => {
445
+ window.removeEventListener("resize", n), $();
446
+ };
447
+ }, [o, t.viewMode]), e();
448
+ }, "withMeasure");
449
+
450
+ // src/measure/preview.ts
451
+ var Q = [Z], J = {
452
+ [W]: !1
453
+ }, xt = /* @__PURE__ */ l(() => Mt({
454
+ decorators: Q,
455
+ initialGlobals: J
456
+ }), "default");
457
+
458
+ // src/measure/index.ts
459
+ var le = /* @__PURE__ */ l(() => Dt(P), "default");
460
+ export {
461
+ le as default
462
+ };