storybook 9.1.0-alpha.3 → 9.1.0-alpha.5

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 (70) hide show
  1. package/dist/actions/index.cjs +16 -16
  2. package/dist/actions/index.d.ts +1 -38
  3. package/dist/actions/index.js +12 -12
  4. package/dist/actions/preview.cjs +25 -25
  5. package/dist/actions/preview.d.ts +37 -547
  6. package/dist/actions/preview.js +18 -18
  7. package/dist/backgrounds/index.cjs +12 -144
  8. package/dist/backgrounds/index.d.ts +1 -591
  9. package/dist/backgrounds/index.js +0 -130
  10. package/dist/backgrounds/preview.cjs +63 -63
  11. package/dist/backgrounds/preview.d.ts +40 -542
  12. package/dist/backgrounds/preview.js +47 -47
  13. package/dist/bin/index.cjs +50 -50
  14. package/dist/bin/index.js +50 -50
  15. package/dist/cli/bin/index.cjs +1 -1
  16. package/dist/cli/bin/index.js +1 -1
  17. package/dist/common/index.cjs +755 -756
  18. package/dist/common/index.d.ts +9 -5
  19. package/dist/common/index.js +700 -700
  20. package/dist/component-testing/preview.cjs +12 -12
  21. package/dist/component-testing/preview.d.ts +2 -2
  22. package/dist/component-testing/preview.js +7 -7
  23. package/dist/controls/index.cjs +16 -16
  24. package/dist/controls/index.d.ts +1 -36
  25. package/dist/controls/preview.cjs +17 -17
  26. package/dist/controls/preview.d.ts +34 -546
  27. package/dist/controls/preview.js +3 -3
  28. package/dist/csf/index.cjs +1210 -95
  29. package/dist/csf/index.d.ts +59 -18
  30. package/dist/csf/index.js +1214 -90
  31. package/dist/csf-tools/index.cjs +2 -1
  32. package/dist/csf-tools/index.js +2 -2
  33. package/dist/highlight/index.cjs +15 -15
  34. package/dist/highlight/index.d.ts +1 -12
  35. package/dist/highlight/index.js +4 -4
  36. package/dist/highlight/preview.cjs +63 -63
  37. package/dist/highlight/preview.d.ts +11 -546
  38. package/dist/highlight/preview.js +11 -10
  39. package/dist/manager/globals-runtime.js +29776 -29777
  40. package/dist/manager-api/index.cjs +1 -1
  41. package/dist/manager-api/index.js +1 -1
  42. package/dist/measure/index.cjs +12 -472
  43. package/dist/measure/index.d.ts +1 -566
  44. package/dist/measure/index.js +0 -464
  45. package/dist/measure/preview.cjs +104 -104
  46. package/dist/measure/preview.d.ts +11 -546
  47. package/dist/measure/preview.js +105 -105
  48. package/dist/outline/index.cjs +12 -524
  49. package/dist/outline/index.d.ts +1 -566
  50. package/dist/outline/index.js +0 -500
  51. package/dist/outline/preview.cjs +32 -32
  52. package/dist/outline/preview.d.ts +11 -546
  53. package/dist/outline/preview.js +27 -27
  54. package/dist/preview/runtime.js +8259 -8266
  55. package/dist/preview-api/index.cjs +1228 -1261
  56. package/dist/preview-api/index.d.ts +6 -8
  57. package/dist/preview-api/index.js +927 -963
  58. package/dist/telemetry/index.cjs +1 -1
  59. package/dist/telemetry/index.js +1 -1
  60. package/dist/test/preview.cjs +42 -42
  61. package/dist/test/preview.d.ts +12 -550
  62. package/dist/test/preview.js +36 -36
  63. package/dist/types/index.d.ts +5 -3
  64. package/dist/viewport/index.cjs +17 -24
  65. package/dist/viewport/index.d.ts +9 -532
  66. package/dist/viewport/index.js +9 -16
  67. package/dist/viewport/preview.cjs +22 -22
  68. package/dist/viewport/preview.d.ts +45 -552
  69. package/dist/viewport/preview.js +8 -8
  70. package/package.json +1 -1
@@ -4,26 +4,26 @@ var ft = Object.getOwnPropertyDescriptor;
4
4
  var ct = Object.getOwnPropertyNames;
5
5
  var mt = Object.prototype.hasOwnProperty;
6
6
  var r = (e, t) => v(e, "name", { value: t, configurable: !0 });
7
- var ut = (e, t) => {
7
+ var pt = (e, t) => {
8
8
  for (var o in t)
9
9
  v(e, o, { get: t[o], enumerable: !0 });
10
- }, ht = (e, t, o, i) => {
10
+ }, ut = (e, t, o, i) => {
11
11
  if (t && typeof t == "object" || typeof t == "function")
12
12
  for (let n of ct(t))
13
13
  !mt.call(e, n) && n !== o && v(e, n, { get: () => t[n], enumerable: !(i = ft(t, n)) || i.enumerable });
14
14
  return e;
15
15
  };
16
- var pt = (e) => ht(v({}, "__esModule", { value: !0 }), e);
16
+ var dt = (e) => ut(v({}, "__esModule", { value: !0 }), e);
17
17
 
18
18
  // src/measure/preview.ts
19
19
  var Pt = {};
20
- ut(Pt, {
20
+ pt(Pt, {
21
21
  decorators: () => J,
22
22
  default: () => At,
23
23
  initialGlobals: () => tt
24
24
  });
25
- module.exports = pt(Pt);
26
- var Q = require("storybook/preview-api");
25
+ module.exports = dt(Pt);
26
+ var Q = require("storybook/internal/csf");
27
27
 
28
28
  // src/measure/constants.ts
29
29
  var R = "storybook/measure-addon", Ft = `${R}/tool`, F = "measureEnabled", Wt = {
@@ -36,13 +36,13 @@ var R = "storybook/measure-addon", Ft = `${R}/tool`, F = "measureEnabled", Wt =
36
36
  var P = require("storybook/preview-api");
37
37
 
38
38
  // src/measure/box-model/canvas.ts
39
- var y = require("@storybook/global");
39
+ var E = require("@storybook/global");
40
40
 
41
41
  // ../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
42
- var dt = process.env.NODE_ENV === "production", D = "Invariant failed";
42
+ var ht = process.env.NODE_ENV === "production", D = "Invariant failed";
43
43
  function M(e, t) {
44
44
  if (!e) {
45
- if (dt)
45
+ if (ht)
46
46
  throw new Error(D);
47
47
  var o = typeof t == "function" ? t() : t, i = o ? "".concat(D, ": ").concat(o) : D;
48
48
  throw new Error(i);
@@ -52,23 +52,23 @@ r(M, "invariant");
52
52
 
53
53
  // src/measure/box-model/canvas.ts
54
54
  function W() {
55
- let e = y.global.document.documentElement, t = Math.max(e.scrollHeight, e.offsetHeight);
55
+ let e = E.global.document.documentElement, t = Math.max(e.scrollHeight, e.offsetHeight);
56
56
  return { width: Math.max(e.scrollWidth, e.offsetWidth), height: t };
57
57
  }
58
58
  r(W, "getDocumentWidthAndHeight");
59
59
  function gt() {
60
- let e = y.global.document.createElement("canvas");
60
+ let e = E.global.document.createElement("canvas");
61
61
  e.id = "storybook-addon-measure";
62
62
  let t = e.getContext("2d");
63
63
  M(t != null);
64
64
  let { width: o, height: i } = W();
65
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", y.global.document.body.appendChild(e), { canvas: e, context: t, width: o, height: i };
66
+ 7", e.style.pointerEvents = "none", E.global.document.body.appendChild(e), { canvas: e, context: t, width: o, height: i };
67
67
  }
68
68
  r(gt, "createCanvas");
69
69
  function k(e, t, { width: o, height: i }) {
70
70
  e.style.width = `${o}px`, e.style.height = `${i}px`;
71
- let n = y.global.window.devicePixelRatio;
71
+ let n = E.global.window.devicePixelRatio;
72
72
  e.width = Math.floor(o * n), e.height = Math.floor(i * n), t.scale(n, n);
73
73
  }
74
74
  r(k, "setCanvasWidthAndHeight");
@@ -112,32 +112,32 @@ function N(e, { x: t, y: o, w: i, h: n, r: l }) {
112
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
113
  }
114
114
  r(N, "roundedRect");
115
- function bt(e, { padding: t, border: o, width: i, height: n, top: l, left: a }) {
116
- 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 = l + o.top + t.top;
117
- 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 :
118
- e === "center" && (c += s / 2, u += f / 2), { x: c, y: u };
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
119
  }
120
120
  r(bt, "positionCoordinate");
121
- function wt(e, t, { margin: o, border: i, padding: n }, l, a) {
122
- let s = /* @__PURE__ */ r((h) => 0, "shift"), f = 0, c = 0, u = a ? 1 : 0.5, p = a ? l * 2 : 0;
123
- return e === "padding" ? s = /* @__PURE__ */ r((h) => n[h] * u + p, "shift") : e === "border" ? s = /* @__PURE__ */ r((h) => n[h] + i[h] *
124
- u + p, "shift") : e === "margin" && (s = /* @__PURE__ */ r((h) => n[h] + i[h] + o[h] * u + p, "shift")), t === "top" ? c = -s("top") : t ===
125
- "right" ? f = s("right") : t === "bottom" ? c = s("bottom") : t === "left" && (f = -s("left")), { offsetX: f, offsetY: c };
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
126
  }
127
127
  r(wt, "offset");
128
- function Lt(e, t) {
128
+ function yt(e, t) {
129
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
130
  }
131
- r(Lt, "collide");
132
- function Et(e, t, o) {
131
+ r(yt, "collide");
132
+ function Lt(e, t, o) {
133
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
134
  "left" && (t.x = o.x - o.w / 2 - b - t.w / 2), { x: t.x, y: t.y };
135
135
  }
136
- r(Et, "overlapAdjustment");
137
- function O(e, t, { x: o, y: i, w: n, h: l }, a) {
136
+ r(Lt, "overlapAdjustment");
137
+ function O(e, t, { x: o, y: i, w: n, h: l }, s) {
138
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(a, 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(a, o, i), { x: o, y: i, w: n, h: l };
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
141
  }
142
142
  r(O, "textWithRect");
143
143
  function I(e, t) {
@@ -146,17 +146,17 @@ function I(e, t) {
146
146
  return { w: n, h: l };
147
147
  }
148
148
  r(I, "configureText");
149
- function yt(e, t, { type: o, position: i = "center", text: n }, l, a = !1) {
150
- let { x: s, y: f } = bt(i, t), { offsetX: c, offsetY: u } = wt(o, i, t, b + 1, a);
151
- s += c, f += u;
152
- let { w: p, h } = I(e, n);
153
- if (l && Lt({ x: s, y: f, w: p, h }, l)) {
154
- let C = Et(i, { x: s, y: f, w: p, h }, l);
155
- s = C.x, f = C.y;
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
156
  }
157
- return O(e, o, { x: s, y: f, w: p, h }, n);
157
+ return O(e, o, { x: a, y: f, w: d, h: u }, n);
158
158
  }
159
- r(yt, "drawLabel");
159
+ r(Et, "drawLabel");
160
160
  function St(e, { w: t, h: o }) {
161
161
  let i = t * 0.5 + b, n = o * 0.5 + b;
162
162
  return {
@@ -166,23 +166,23 @@ function St(e, { w: t, h: o }) {
166
166
  }
167
167
  r(St, "floatingOffset");
168
168
  function Ct(e, t, { type: o, text: i }) {
169
- let { floatingAlignment: n, extremities: l } = t, a = l[n.x], s = l[n.y], { w: f, h: c } = I(e, i), { offsetX: u, offsetY: p } = St(n, {
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
170
  w: f,
171
171
  h: c
172
172
  });
173
- return a += u, s += p, O(e, o, { x: a, y: s, w: f, h: c }, i);
173
+ return s += p, a += d, O(e, o, { x: s, y: a, w: f, h: c }, i);
174
174
  }
175
175
  r(Ct, "drawFloatingLabel");
176
176
  function S(e, t, o, i) {
177
177
  let n = [];
178
- o.forEach((l, a) => {
179
- let s = i && l.position === "center" ? Ct(e, t, l) : yt(e, t, l, n[a - 1], i);
180
- n[a] = s;
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
181
  });
182
182
  }
183
183
  r(S, "drawStack");
184
184
  function _(e, t, o, i) {
185
- let n = o.reduce((l, a) => (Object.prototype.hasOwnProperty.call(l, a.position) || (l[a.position] = []), l[a.position]?.push(a), l), {});
185
+ let n = o.reduce((l, s) => (Object.prototype.hasOwnProperty.call(l, s.position) || (l[s.position] = []), l[s.position]?.push(s), l), {});
186
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
187
  e, t, n.center, i);
188
188
  }
@@ -195,14 +195,14 @@ var x = {
195
195
  padding: "#93c47d8c",
196
196
  content: "#6fa8dca8"
197
197
  }, q = 30;
198
- function d(e) {
198
+ function h(e) {
199
199
  return parseInt(e.replace("px", ""), 10);
200
200
  }
201
- r(d, "pxToNumber");
202
- function L(e) {
201
+ r(h, "pxToNumber");
202
+ function y(e) {
203
203
  return Number.isInteger(e) ? e : e.toFixed(2);
204
204
  }
205
- r(L, "round");
205
+ r(y, "round");
206
206
  function A(e) {
207
207
  return e.filter((t) => t.text !== 0 && t.text !== "0");
208
208
  }
@@ -226,12 +226,12 @@ function vt(e) {
226
226
  }
227
227
  r(vt, "floatingAlignment");
228
228
  function Rt(e) {
229
- let t = g.global.getComputedStyle(e), { top: o, left: i, right: n, bottom: l, width: a, height: s } = e.getBoundingClientRect(), {
229
+ let t = g.global.getComputedStyle(e), { top: o, left: i, right: n, bottom: l, width: s, height: a } = e.getBoundingClientRect(), {
230
230
  marginTop: f,
231
231
  marginBottom: c,
232
- marginLeft: u,
233
- marginRight: p,
234
- paddingTop: h,
232
+ marginLeft: p,
233
+ marginRight: d,
234
+ paddingTop: u,
235
235
  paddingBottom: C,
236
236
  paddingLeft: et,
237
237
  paddingRight: ot,
@@ -241,85 +241,85 @@ function Rt(e) {
241
241
  borderRightWidth: rt
242
242
  } = t;
243
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 E = {
245
- top: d(f),
246
- bottom: d(c),
247
- left: d(u),
248
- right: d(p)
249
- }, at = {
250
- top: d(h),
251
- bottom: d(C),
252
- left: d(et),
253
- right: d(ot)
244
+ let L = {
245
+ top: h(f),
246
+ bottom: h(c),
247
+ left: h(p),
248
+ right: h(d)
254
249
  }, st = {
255
- top: d(it),
256
- bottom: d(nt),
257
- left: d(lt),
258
- right: d(rt)
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
259
  }, H = {
260
- top: o - E.top,
261
- bottom: l + E.bottom,
262
- left: i - E.left,
263
- right: n + E.right
260
+ top: o - L.top,
261
+ bottom: l + L.bottom,
262
+ left: i - L.left,
263
+ right: n + L.right
264
264
  };
265
265
  return {
266
- margin: E,
267
- padding: at,
268
- border: st,
266
+ margin: L,
267
+ padding: st,
268
+ border: at,
269
269
  top: o,
270
270
  left: i,
271
271
  bottom: l,
272
272
  right: n,
273
- width: a,
274
- height: s,
273
+ width: s,
274
+ height: a,
275
275
  extremities: H,
276
276
  floatingAlignment: vt(H)
277
277
  };
278
278
  }
279
279
  r(Rt, "measureElement");
280
- function Mt(e, { margin: t, width: o, height: i, top: n, left: l, bottom: a, right: s }) {
280
+ function Mt(e, { margin: t, width: o, height: i, top: n, left: l, bottom: s, right: a }) {
281
281
  let f = i + t.bottom + t.top;
282
- e.fillStyle = x.margin, e.fillRect(l, n - t.top, o, t.top), e.fillRect(s, n - t.top, t.right, f), e.fillRect(l, a, o, t.bottom), e.fillRect(
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
283
  l - t.left, n - t.top, t.left, f);
284
284
  let c = [
285
285
  {
286
286
  type: "margin",
287
- text: L(t.top),
287
+ text: y(t.top),
288
288
  position: "top"
289
289
  },
290
290
  {
291
291
  type: "margin",
292
- text: L(t.right),
292
+ text: y(t.right),
293
293
  position: "right"
294
294
  },
295
295
  {
296
296
  type: "margin",
297
- text: L(t.bottom),
297
+ text: y(t.bottom),
298
298
  position: "bottom"
299
299
  },
300
300
  {
301
301
  type: "margin",
302
- text: L(t.left),
302
+ text: y(t.left),
303
303
  position: "left"
304
304
  }
305
305
  ];
306
306
  return A(c);
307
307
  }
308
308
  r(Mt, "drawMargin");
309
- function xt(e, { padding: t, border: o, width: i, height: n, top: l, left: a, bottom: s, right: f }) {
310
- let c = i - o.left - o.right, u = n - t.top - t.bottom - o.top - o.bottom;
311
- e.fillStyle = x.padding, e.fillRect(a + o.left, l + o.top, c, t.top), e.fillRect(
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
312
  f - t.right - o.right,
313
313
  l + t.top + o.top,
314
314
  t.right,
315
- u
315
+ p
316
316
  ), e.fillRect(
317
- a + o.left,
318
- s - t.bottom - o.bottom,
317
+ s + o.left,
318
+ a - t.bottom - o.bottom,
319
319
  c,
320
320
  t.bottom
321
- ), e.fillRect(a + o.left, l + t.top + o.top, t.left, u);
322
- let p = [
321
+ ), e.fillRect(s + o.left, l + t.top + o.top, t.left, p);
322
+ let d = [
323
323
  {
324
324
  type: "padding",
325
325
  text: t.top,
@@ -341,13 +341,13 @@ function xt(e, { padding: t, border: o, width: i, height: n, top: l, left: a, bo
341
341
  position: "left"
342
342
  }
343
343
  ];
344
- return A(p);
344
+ return A(d);
345
345
  }
346
346
  r(xt, "drawPadding");
347
- function Tt(e, { border: t, width: o, height: i, top: n, left: l, bottom: a, right: s }) {
347
+ function Tt(e, { border: t, width: o, height: i, top: n, left: l, bottom: s, right: a }) {
348
348
  let f = i - t.top - t.bottom;
349
- e.fillStyle = x.border, e.fillRect(l, n, o, t.top), e.fillRect(l, a - t.bottom, o, t.bottom), e.fillRect(l, n + t.top, t.left, f), e.fillRect(
350
- s - t.right, n + t.top, t.right, f);
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
351
  let c = [
352
352
  {
353
353
  type: "border",
@@ -373,18 +373,18 @@ function Tt(e, { border: t, width: o, height: i, top: n, left: l, bottom: a, rig
373
373
  return A(c);
374
374
  }
375
375
  r(Tt, "drawBorder");
376
- function Dt(e, { padding: t, border: o, width: i, height: n, top: l, left: a }) {
377
- let s = i - o.left - o.right - t.left - t.right, f = n - t.top - t.bottom - o.top - o.bottom;
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
378
  return e.fillStyle = x.content, e.fillRect(
379
- a + o.left + t.left,
379
+ s + o.left + t.left,
380
380
  l + o.top + t.top,
381
- s,
381
+ a,
382
382
  f
383
383
  ), [
384
384
  {
385
385
  type: "content",
386
386
  position: "center",
387
- text: `${L(s)} x ${L(f)}`
387
+ text: `${y(a)} x ${y(f)}`
388
388
  }
389
389
  ];
390
390
  }
@@ -392,12 +392,12 @@ r(Dt, "drawContent");
392
392
  function kt(e) {
393
393
  return (t) => {
394
394
  if (e && t) {
395
- let o = Rt(e), i = Mt(t, o), n = xt(t, o), l = Tt(t, o), a = Dt(t, o), s = o.width <= q * 3 || o.height <= q;
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
396
  _(
397
397
  t,
398
398
  o,
399
- [...a, ...n, ...l, ...i],
400
- s
399
+ [...s, ...n, ...l, ...i],
400
+ a
401
401
  );
402
402
  }
403
403
  };
@@ -413,8 +413,8 @@ var G = require("@storybook/global");
413
413
  var U = /* @__PURE__ */ r((e, t) => {
414
414
  let o = G.global.document.elementFromPoint(e, t), i = /* @__PURE__ */ r((l) => {
415
415
  if (l && l.shadowRoot) {
416
- let a = l.shadowRoot.elementFromPoint(e, t);
417
- return l.isEqualNode(a) ? l : a.shadowRoot ? i(a) : a;
416
+ let s = l.shadowRoot.elementFromPoint(e, t);
417
+ return l.isEqualNode(s) ? l : s.shadowRoot ? i(s) : s;
418
418
  }
419
419
  return l;
420
420
  }, "crawlShadows");
@@ -460,7 +460,7 @@ resize", n), K(T.x, T.y)), () => {
460
460
  // src/measure/preview.ts
461
461
  var J = globalThis.FEATURES?.measure ? [Z] : [], tt = {
462
462
  [F]: !1
463
- }, At = /* @__PURE__ */ r(() => (0, Q.definePreview)({
463
+ }, At = /* @__PURE__ */ r(() => (0, Q.definePreviewAddon)({
464
464
  decorators: J,
465
465
  initialGlobals: tt
466
466
  }), "default");