storybook 9.0.0-alpha.20 → 9.0.0-alpha.21

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 (72) hide show
  1. package/assets/server/base-preview-head.html +1 -3
  2. package/dist/actions/decorator.js +34 -38
  3. package/dist/actions/index.cjs +1 -4
  4. package/dist/actions/index.js +1 -4
  5. package/dist/actions/preview.cjs +1 -4
  6. package/dist/actions/preview.js +1 -4
  7. package/dist/babel/index.cjs +822 -816
  8. package/dist/babel/index.js +822 -816
  9. package/dist/backgrounds/index.cjs +16 -16
  10. package/dist/backgrounds/index.js +14 -14
  11. package/dist/backgrounds/preview.cjs +34 -34
  12. package/dist/backgrounds/preview.js +29 -29
  13. package/dist/bin/index.cjs +67 -65
  14. package/dist/bin/index.js +61 -59
  15. package/dist/builder-manager/index.cjs +482 -472
  16. package/dist/builder-manager/index.js +283 -273
  17. package/dist/channels/index.js +941 -919
  18. package/dist/cli/bin/index.cjs +1 -1
  19. package/dist/cli/bin/index.js +1 -1
  20. package/dist/cli/index.cjs +61752 -7591
  21. package/dist/cli/index.d.ts +22 -14
  22. package/dist/cli/index.js +61775 -7614
  23. package/dist/common/index.cjs +16015 -8979
  24. package/dist/common/index.d.ts +30 -1
  25. package/dist/common/index.js +16105 -9063
  26. package/dist/components/index.cjs +3694 -3643
  27. package/dist/components/index.d.ts +5 -2
  28. package/dist/components/index.js +2352 -2294
  29. package/dist/core-server/index.cjs +3540 -3540
  30. package/dist/core-server/index.js +730 -730
  31. package/dist/core-server/presets/common-manager.js +2642 -2592
  32. package/dist/core-server/presets/common-preset.cjs +723 -715
  33. package/dist/core-server/presets/common-preset.js +10 -2
  34. package/dist/docs-tools/index.js +640 -632
  35. package/dist/highlight/index.cjs +16 -16
  36. package/dist/highlight/index.d.ts +45 -1
  37. package/dist/highlight/index.js +2 -2
  38. package/dist/highlight/preview.cjs +522 -68
  39. package/dist/highlight/preview.js +508 -56
  40. package/dist/instrumenter/index.js +1179 -1170
  41. package/dist/manager/globals-module-info.cjs +1 -0
  42. package/dist/manager/globals-module-info.js +1 -0
  43. package/dist/manager/globals-runtime.js +19385 -19190
  44. package/dist/manager/runtime.js +2084 -2079
  45. package/dist/manager-api/index.cjs +352 -352
  46. package/dist/manager-api/index.js +1694 -1663
  47. package/dist/manager-errors.js +41 -37
  48. package/dist/measure/index.cjs +99 -97
  49. package/dist/measure/index.js +95 -93
  50. package/dist/measure/preview.cjs +127 -125
  51. package/dist/measure/preview.js +125 -123
  52. package/dist/outline/index.cjs +41 -41
  53. package/dist/outline/index.js +12 -12
  54. package/dist/outline/preview.cjs +23 -23
  55. package/dist/outline/preview.js +7 -7
  56. package/dist/preview/runtime.js +13577 -12959
  57. package/dist/preview-api/index.cjs +0 -1
  58. package/dist/preview-api/index.d.ts +120 -385
  59. package/dist/preview-api/index.js +827 -812
  60. package/dist/preview-errors.cjs +65 -51
  61. package/dist/preview-errors.d.ts +6 -2
  62. package/dist/preview-errors.js +176 -142
  63. package/dist/server-errors.cjs +105 -72
  64. package/dist/server-errors.d.ts +9 -1
  65. package/dist/server-errors.js +87 -54
  66. package/dist/telemetry/index.cjs +374 -370
  67. package/dist/telemetry/index.js +460 -456
  68. package/dist/test/index.js +9831 -9743
  69. package/dist/test/preview.d.ts +0 -6
  70. package/dist/test/preview.js +3628 -3568
  71. package/dist/types/index.d.ts +72 -6
  72. package/package.json +1 -1
@@ -6,7 +6,7 @@ var st = (e, t) => {
6
6
  };
7
7
 
8
8
  // src/measure/index.ts
9
- import { definePreview as Dt } from "storybook/preview-api";
9
+ import { definePreview as Tt } from "storybook/preview-api";
10
10
 
11
11
  // src/measure/preview.ts
12
12
  var P = {};
@@ -18,52 +18,52 @@ st(P, {
18
18
  import { definePreview as Mt } from "storybook/preview-api";
19
19
 
20
20
  // src/measure/constants.ts
21
- var C = "storybook/measure-addon", Tt = `${C}/tool`, W = "measureEnabled", Pt = {
21
+ var C = "storybook/measure-addon", kt = `${C}/tool`, F = "measureEnabled", Pt = {
22
22
  RESULT: `${C}/result`,
23
23
  REQUEST: `${C}/request`,
24
24
  CLEAR: `${C}/clear`
25
25
  };
26
26
 
27
27
  // src/measure/withMeasure.ts
28
- import { useEffect as V } from "storybook/preview-api";
28
+ import { useEffect as U } from "storybook/preview-api";
29
29
 
30
30
  // src/measure/box-model/canvas.ts
31
31
  import { global as R } from "@storybook/global";
32
32
 
33
33
  // ../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
34
- var ft = !1, D = "Invariant failed";
34
+ var ft = !1, T = "Invariant failed";
35
35
  function v(e, t) {
36
36
  if (!e) {
37
37
  if (ft)
38
- throw new Error(D);
39
- var o = typeof t == "function" ? t() : t, i = o ? "".concat(D, ": ").concat(o) : D;
38
+ throw new Error(T);
39
+ var o = typeof t == "function" ? t() : t, i = o ? "".concat(T, ": ").concat(o) : T;
40
40
  throw new Error(i);
41
41
  }
42
42
  }
43
43
  l(v, "invariant");
44
44
 
45
45
  // src/measure/box-model/canvas.ts
46
- function F() {
46
+ function W() {
47
47
  let e = R.document.documentElement, t = Math.max(e.scrollHeight, e.offsetHeight);
48
48
  return { width: Math.max(e.scrollWidth, e.offsetWidth), height: t };
49
49
  }
50
- l(F, "getDocumentWidthAndHeight");
50
+ l(W, "getDocumentWidthAndHeight");
51
51
  function ct() {
52
52
  let e = R.document.createElement("canvas");
53
53
  e.id = "storybook-addon-measure";
54
54
  let t = e.getContext("2d");
55
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\
56
+ let { width: o, height: i } = W();
57
+ return D(e, t, { width: o, height: i }), e.style.position = "absolute", e.style.left = "0", e.style.top = "0", e.style.zIndex = "214748364\
58
58
  7", e.style.pointerEvents = "none", R.document.body.appendChild(e), { canvas: e, context: t, width: o, height: i };
59
59
  }
60
60
  l(ct, "createCanvas");
61
- function k(e, t, { width: o, height: i }) {
61
+ function D(e, t, { width: o, height: i }) {
62
62
  e.style.width = `${o}px`, e.style.height = `${i}px`;
63
63
  let n = R.window.devicePixelRatio;
64
64
  e.width = Math.floor(o * n), e.height = Math.floor(i * n), t.scale(n, n);
65
65
  }
66
- l(k, "setCanvasWidthAndHeight");
66
+ l(D, "setCanvasWidthAndHeight");
67
67
  var m = {};
68
68
  function Y() {
69
69
  m.canvas || (m = ct());
@@ -78,9 +78,9 @@ function z(e) {
78
78
  }
79
79
  l(z, "draw");
80
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;
81
+ v(m.canvas, "Canvas should exist in the state."), v(m.context, "Context should exist in the state."), D(m.canvas, m.context, { width: 0, height: 0 });
82
+ let { width: e, height: t } = W();
83
+ D(m.canvas, m.context, { width: e, height: t }), m.width = e, m.height = t;
84
84
  }
85
85
  l(X, "rescale");
86
86
  function $() {
@@ -105,27 +105,27 @@ function N(e, { x: t, y: o, w: i, h: n, r }) {
105
105
  }
106
106
  l(N, "roundedRect");
107
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 };
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, u = r + o.top + t.top;
109
+ return e === "top" ? c += s / 2 : e === "right" ? (c += s, u += f / 2) : e === "bottom" ? (c += s / 2, u += f) : e === "left" ? u += f / 2 :
110
+ e === "center" && (c += s / 2, u += f / 2), { x: c, y: u };
111
111
  }
112
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 ===
113
+ function ut(e, t, { margin: o, border: i, padding: n }, r, a) {
114
+ let s = /* @__PURE__ */ l((d) => 0, "shift"), f = 0, c = 0, u = a ? 1 : 0.5, h = a ? r * 2 : 0;
115
+ return e === "padding" ? s = /* @__PURE__ */ l((d) => n[d] * u + h, "shift") : e === "border" ? s = /* @__PURE__ */ l((d) => n[d] + i[d] *
116
+ u + h, "shift") : e === "margin" && (s = /* @__PURE__ */ l((d) => n[d] + i[d] + o[d] * u + h, "shift")), t === "top" ? c = -s("top") : t ===
117
117
  "right" ? f = s("right") : t === "bottom" ? c = s("bottom") : t === "left" && (f = -s("left")), { offsetX: f, offsetY: c };
118
118
  }
119
- l(dt, "offset");
120
- function pt(e, t) {
119
+ l(ut, "offset");
120
+ function dt(e, t) {
121
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
122
  }
123
- l(pt, "collide");
124
- function ut(e, t, o) {
123
+ l(dt, "collide");
124
+ function ht(e, t, o) {
125
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
126
  "left" && (t.x = o.x - o.w / 2 - g - t.w / 2), { x: t.x, y: t.y };
127
127
  }
128
- l(ut, "overlapAdjustment");
128
+ l(ht, "overlapAdjustment");
129
129
  function O(e, t, { x: o, y: i, w: n, h: r }, a) {
130
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
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 =
@@ -138,17 +138,17 @@ function I(e, t) {
138
138
  return { w: n, h: r };
139
139
  }
140
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);
141
+ function pt(e, t, { type: o, position: i = "center", text: n }, r, a = !1) {
142
+ let { x: s, y: f } = mt(i, t), { offsetX: c, offsetY: u } = ut(o, i, t, g + 1, a);
143
+ s += c, f += u;
144
+ let { w: h, h: d } = I(e, n);
145
+ if (r && dt({ x: s, y: f, w: h, h: d }, r)) {
146
+ let S = ht(i, { x: s, y: f, w: h, h: d }, r);
147
147
  s = S.x, f = S.y;
148
148
  }
149
- return O(e, o, { x: s, y: f, w: u, h: p }, n);
149
+ return O(e, o, { x: s, y: f, w: h, h: d }, n);
150
150
  }
151
- l(ht, "drawLabel");
151
+ l(pt, "drawLabel");
152
152
  function bt(e, { w: t, h: o }) {
153
153
  let i = t * 0.5 + g, n = o * 0.5 + g;
154
154
  return {
@@ -158,24 +158,24 @@ function bt(e, { w: t, h: o }) {
158
158
  }
159
159
  l(bt, "floatingOffset");
160
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, {
161
+ let { floatingAlignment: n, extremities: r } = t, a = r[n.x], s = r[n.y], { w: f, h: c } = I(e, i), { offsetX: u, offsetY: h } = bt(n, {
162
162
  w: f,
163
163
  h: c
164
164
  });
165
- return a += d, s += u, O(e, o, { x: a, y: s, w: f, h: c }, i);
165
+ return a += u, s += h, O(e, o, { x: a, y: s, w: f, h: c }, i);
166
166
  }
167
167
  l(gt, "drawFloatingLabel");
168
- function E(e, t, o, i) {
168
+ function y(e, t, o, i) {
169
169
  let n = [];
170
170
  o.forEach((r, a) => {
171
- let s = i && r.position === "center" ? gt(e, t, r) : ht(e, t, r, n[a - 1], i);
171
+ let s = i && r.position === "center" ? gt(e, t, r) : pt(e, t, r, n[a - 1], i);
172
172
  n[a] = s;
173
173
  });
174
174
  }
175
- l(E, "drawStack");
175
+ l(y, "drawStack");
176
176
  function _(e, t, o, i) {
177
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(
178
+ n.top && y(e, t, n.top, i), n.right && y(e, t, n.right, i), n.bottom && y(e, t, n.bottom, i), n.left && y(e, t, n.left, i), n.center && y(
179
179
  e, t, n.center, i);
180
180
  }
181
181
  l(_, "labelStacks");
@@ -187,18 +187,18 @@ var M = {
187
187
  padding: "#93c47d8c",
188
188
  content: "#6fa8dca8"
189
189
  }, q = 30;
190
- function h(e) {
190
+ function p(e) {
191
191
  return parseInt(e.replace("px", ""), 10);
192
192
  }
193
- l(h, "pxToNumber");
193
+ l(p, "pxToNumber");
194
194
  function L(e) {
195
195
  return Number.isInteger(e) ? e : e.toFixed(2);
196
196
  }
197
197
  l(L, "round");
198
- function T(e) {
198
+ function k(e) {
199
199
  return e.filter((t) => t.text !== 0 && t.text !== "0");
200
200
  }
201
- l(T, "filterZeroValues");
201
+ l(k, "filterZeroValues");
202
202
  function wt(e) {
203
203
  let t = {
204
204
  top: b.window.scrollY,
@@ -221,9 +221,9 @@ function Lt(e) {
221
221
  let t = b.getComputedStyle(e), { top: o, left: i, right: n, bottom: r, width: a, height: s } = e.getBoundingClientRect(), {
222
222
  marginTop: f,
223
223
  marginBottom: c,
224
- marginLeft: d,
225
- marginRight: u,
226
- paddingTop: p,
224
+ marginLeft: u,
225
+ marginRight: h,
226
+ paddingTop: d,
227
227
  paddingBottom: S,
228
228
  paddingLeft: tt,
229
229
  paddingRight: et,
@@ -233,29 +233,29 @@ function Lt(e) {
233
233
  borderRightWidth: rt
234
234
  } = t;
235
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)
236
+ let E = {
237
+ top: p(f),
238
+ bottom: p(c),
239
+ left: p(u),
240
+ right: p(h)
241
241
  }, lt = {
242
- top: h(p),
243
- bottom: h(S),
244
- left: h(tt),
245
- right: h(et)
242
+ top: p(d),
243
+ bottom: p(S),
244
+ left: p(tt),
245
+ right: p(et)
246
246
  }, at = {
247
- top: h(nt),
248
- bottom: h(ot),
249
- left: h(it),
250
- right: h(rt)
247
+ top: p(nt),
248
+ bottom: p(ot),
249
+ left: p(it),
250
+ right: p(rt)
251
251
  }, A = {
252
- top: o - y.top,
253
- bottom: r + y.bottom,
254
- left: i - y.left,
255
- right: n + y.right
252
+ top: o - E.top,
253
+ bottom: r + E.bottom,
254
+ left: i - E.left,
255
+ right: n + E.right
256
256
  };
257
257
  return {
258
- margin: y,
258
+ margin: E,
259
259
  padding: lt,
260
260
  border: at,
261
261
  top: o,
@@ -269,7 +269,7 @@ function Lt(e) {
269
269
  };
270
270
  }
271
271
  l(Lt, "measureElement");
272
- function yt(e, { margin: t, width: o, height: i, top: n, left: r, bottom: a, right: s }) {
272
+ function Et(e, { margin: t, width: o, height: i, top: n, left: r, bottom: a, right: s }) {
273
273
  let f = i + t.bottom + t.top;
274
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
275
  r - t.left, n - t.top, t.left, f);
@@ -295,23 +295,23 @@ function yt(e, { margin: t, width: o, height: i, top: n, left: r, bottom: a, rig
295
295
  position: "left"
296
296
  }
297
297
  ];
298
- return T(c);
298
+ return k(c);
299
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;
300
+ l(Et, "drawMargin");
301
+ function yt(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, u = n - t.top - t.bottom - o.top - o.bottom;
303
303
  e.fillStyle = M.padding, e.fillRect(a + o.left, r + o.top, c, t.top), e.fillRect(
304
304
  f - t.right - o.right,
305
305
  r + t.top + o.top,
306
306
  t.right,
307
- d
307
+ u
308
308
  ), e.fillRect(
309
309
  a + o.left,
310
310
  s - t.bottom - o.bottom,
311
311
  c,
312
312
  t.bottom
313
- ), e.fillRect(a + o.left, r + t.top + o.top, t.left, d);
314
- let u = [
313
+ ), e.fillRect(a + o.left, r + t.top + o.top, t.left, u);
314
+ let h = [
315
315
  {
316
316
  type: "padding",
317
317
  text: t.top,
@@ -333,9 +333,9 @@ function Et(e, { padding: t, border: o, width: i, height: n, top: r, left: a, bo
333
333
  position: "left"
334
334
  }
335
335
  ];
336
- return T(u);
336
+ return k(h);
337
337
  }
338
- l(Et, "drawPadding");
338
+ l(yt, "drawPadding");
339
339
  function St(e, { border: t, width: o, height: i, top: n, left: r, bottom: a, right: s }) {
340
340
  let f = i - t.top - t.bottom;
341
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(
@@ -362,7 +362,7 @@ function St(e, { border: t, width: o, height: i, top: n, left: r, bottom: a, rig
362
362
  position: "left"
363
363
  }
364
364
  ];
365
- return T(c);
365
+ return k(c);
366
366
  }
367
367
  l(St, "drawBorder");
368
368
  function Ct(e, { padding: t, border: o, width: i, height: n, top: r, left: a }) {
@@ -384,7 +384,7 @@ l(Ct, "drawContent");
384
384
  function vt(e) {
385
385
  return (t) => {
386
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;
387
+ let o = Lt(e), i = Et(t, o), n = yt(t, o), r = St(t, o), a = Ct(t, o), s = o.width <= q * 3 || o.height <= q;
388
388
  _(
389
389
  t,
390
390
  o,
@@ -414,49 +414,51 @@ var G = /* @__PURE__ */ l((e, t) => {
414
414
  }, "deepElementFromPoint");
415
415
 
416
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);
417
+ var V, x = { x: 0, y: 0 };
418
+ function K(e, t) {
419
+ V = G(e, t), j(V);
420
420
  }
421
- l(U, "findAndDrawElement");
421
+ l(K, "findAndDrawElement");
422
422
  var Z = /* @__PURE__ */ l((e, t) => {
423
423
  let { measureEnabled: o } = t.globals || {};
424
- return V(() => {
424
+ return U(() => {
425
+ if (typeof globalThis.document > "u")
426
+ return;
425
427
  let i = /* @__PURE__ */ l((n) => {
426
428
  window.requestAnimationFrame(() => {
427
429
  n.stopPropagation(), x.x = n.clientX, x.y = n.clientY;
428
430
  });
429
431
  }, "onPointerMove");
430
- return document.addEventListener("pointermove", i), () => {
431
- document.removeEventListener("pointermove", i);
432
+ return globalThis.document.addEventListener("pointermove", i), () => {
433
+ globalThis.document.removeEventListener("pointermove", i);
432
434
  };
433
- }, []), V(() => {
435
+ }, []), U(() => {
434
436
  let i = /* @__PURE__ */ l((r) => {
435
437
  window.requestAnimationFrame(() => {
436
- r.stopPropagation(), U(r.clientX, r.clientY);
438
+ r.stopPropagation(), K(r.clientX, r.clientY);
437
439
  });
438
440
  }, "onPointerOver"), n = /* @__PURE__ */ l(() => {
439
441
  window.requestAnimationFrame(() => {
440
442
  X();
441
443
  });
442
444
  }, "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), $();
445
+ return t.viewMode === "story" && o && (globalThis.document.addEventListener("pointerover", i), Y(), globalThis.window.addEventListener("\
446
+ resize", n), K(x.x, x.y)), () => {
447
+ globalThis.window.removeEventListener("resize", n), $();
446
448
  };
447
449
  }, [o, t.viewMode]), e();
448
450
  }, "withMeasure");
449
451
 
450
452
  // src/measure/preview.ts
451
- var Q = [Z], J = {
452
- [W]: !1
453
+ var Q = globalThis.FEATURES?.measure ? [Z] : [], J = {
454
+ [F]: !1
453
455
  }, xt = /* @__PURE__ */ l(() => Mt({
454
456
  decorators: Q,
455
457
  initialGlobals: J
456
458
  }), "default");
457
459
 
458
460
  // src/measure/index.ts
459
- var le = /* @__PURE__ */ l(() => Dt(P), "default");
461
+ var le = /* @__PURE__ */ l(() => Tt(P), "default");
460
462
  export {
461
463
  le as default
462
464
  };