storybook 9.1.0-alpha.5 → 9.1.0-alpha.7

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