storybook 9.1.0-alpha.2 → 9.1.0-alpha.4
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/actions/index.cjs +16 -16
- package/dist/actions/index.d.ts +1 -38
- package/dist/actions/index.js +12 -12
- package/dist/actions/preview.cjs +25 -25
- package/dist/actions/preview.d.ts +37 -547
- package/dist/actions/preview.js +18 -18
- package/dist/backgrounds/index.cjs +12 -144
- package/dist/backgrounds/index.d.ts +1 -591
- package/dist/backgrounds/index.js +0 -130
- package/dist/backgrounds/preview.cjs +63 -63
- package/dist/backgrounds/preview.d.ts +40 -542
- package/dist/backgrounds/preview.js +47 -47
- package/dist/bin/index.cjs +50 -50
- package/dist/bin/index.js +50 -50
- package/dist/builder-manager/index.cjs +379 -378
- package/dist/builder-manager/index.d.ts +567 -2
- package/dist/builder-manager/index.js +280 -279
- package/dist/cli/bin/index.cjs +1 -1
- package/dist/cli/bin/index.js +1 -1
- package/dist/common/index.cjs +87 -79
- package/dist/common/index.d.ts +2 -2
- package/dist/common/index.js +725 -716
- package/dist/component-testing/preview.cjs +12 -12
- package/dist/component-testing/preview.d.ts +2 -2
- package/dist/component-testing/preview.js +7 -7
- package/dist/components/index.cjs +1899 -1895
- package/dist/components/index.js +1343 -1339
- package/dist/controls/index.cjs +16 -16
- package/dist/controls/index.d.ts +1 -36
- package/dist/controls/preview.cjs +17 -17
- package/dist/controls/preview.d.ts +34 -546
- package/dist/controls/preview.js +3 -3
- package/dist/csf/index.cjs +1210 -95
- package/dist/csf/index.d.ts +59 -18
- package/dist/csf/index.js +1214 -90
- package/dist/csf-tools/index.cjs +2 -1
- package/dist/csf-tools/index.js +2 -2
- package/dist/highlight/index.cjs +15 -15
- package/dist/highlight/index.d.ts +1 -12
- package/dist/highlight/index.js +4 -4
- package/dist/highlight/preview.cjs +63 -63
- package/dist/highlight/preview.d.ts +11 -546
- package/dist/highlight/preview.js +11 -10
- package/dist/manager/globals-runtime.js +31934 -31888
- package/dist/manager-api/index.cjs +1 -1
- package/dist/manager-api/index.js +1 -1
- package/dist/measure/index.cjs +12 -472
- package/dist/measure/index.d.ts +1 -566
- package/dist/measure/index.js +0 -464
- package/dist/measure/preview.cjs +127 -127
- package/dist/measure/preview.d.ts +11 -546
- package/dist/measure/preview.js +117 -117
- package/dist/outline/index.cjs +12 -524
- package/dist/outline/index.d.ts +1 -566
- package/dist/outline/index.js +0 -500
- package/dist/outline/preview.cjs +32 -32
- package/dist/outline/preview.d.ts +11 -546
- package/dist/outline/preview.js +27 -27
- package/dist/preview/runtime.js +9415 -9379
- package/dist/preview-api/index.cjs +1228 -1261
- package/dist/preview-api/index.d.ts +6 -8
- package/dist/preview-api/index.js +927 -963
- package/dist/telemetry/index.cjs +1477 -1288
- package/dist/telemetry/index.js +1503 -1314
- package/dist/test/index.cjs +4437 -4394
- package/dist/test/index.js +3776 -3733
- package/dist/test/preview.cjs +42 -42
- package/dist/test/preview.d.ts +12 -550
- package/dist/test/preview.js +36 -36
- package/dist/types/index.d.ts +5 -3
- package/dist/viewport/index.cjs +17 -24
- package/dist/viewport/index.d.ts +9 -532
- package/dist/viewport/index.js +9 -16
- package/dist/viewport/preview.cjs +22 -22
- package/dist/viewport/preview.d.ts +45 -552
- package/dist/viewport/preview.js +8 -8
- package/package.json +1 -1
package/dist/measure/preview.js
CHANGED
|
@@ -2,10 +2,10 @@ var it = Object.defineProperty;
|
|
|
2
2
|
var r = (e, t) => it(e, "name", { value: t, configurable: !0 });
|
|
3
3
|
|
|
4
4
|
// src/measure/preview.ts
|
|
5
|
-
import {
|
|
5
|
+
import { definePreviewAddon as St } from "storybook/internal/csf";
|
|
6
6
|
|
|
7
7
|
// src/measure/constants.ts
|
|
8
|
-
var C = "storybook/measure-addon", Mt = `${C}/tool`,
|
|
8
|
+
var C = "storybook/measure-addon", Mt = `${C}/tool`, P = "measureEnabled", xt = {
|
|
9
9
|
RESULT: `${C}/result`,
|
|
10
10
|
REQUEST: `${C}/request`,
|
|
11
11
|
CLEAR: `${C}/clear`
|
|
@@ -76,7 +76,7 @@ function z() {
|
|
|
76
76
|
r(z, "destroy");
|
|
77
77
|
|
|
78
78
|
// src/measure/box-model/visualizer.ts
|
|
79
|
-
import { global as
|
|
79
|
+
import { global as g } from "@storybook/global";
|
|
80
80
|
|
|
81
81
|
// src/measure/box-model/labels.ts
|
|
82
82
|
var w = {
|
|
@@ -85,84 +85,84 @@ var w = {
|
|
|
85
85
|
padding: "#93c47d",
|
|
86
86
|
content: "#6fa8dc",
|
|
87
87
|
text: "#232020"
|
|
88
|
-
},
|
|
88
|
+
}, b = 6;
|
|
89
89
|
function X(e, { x: t, y: o, w: i, h: n, r: l }) {
|
|
90
90
|
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 +
|
|
91
91
|
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();
|
|
92
92
|
}
|
|
93
93
|
r(X, "roundedRect");
|
|
94
|
-
function
|
|
95
|
-
let
|
|
96
|
-
return e === "top" ? c +=
|
|
97
|
-
e === "center" && (c +=
|
|
98
|
-
}
|
|
99
|
-
r(
|
|
100
|
-
function
|
|
101
|
-
let
|
|
102
|
-
return e === "padding" ?
|
|
103
|
-
|
|
104
|
-
"right" ? f =
|
|
105
|
-
}
|
|
106
|
-
r(
|
|
94
|
+
function st(e, { padding: t, border: o, width: i, height: n, top: l, left: s }) {
|
|
95
|
+
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;
|
|
96
|
+
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 :
|
|
97
|
+
e === "center" && (c += a / 2, p += f / 2), { x: c, y: p };
|
|
98
|
+
}
|
|
99
|
+
r(st, "positionCoordinate");
|
|
100
|
+
function at(e, t, { margin: o, border: i, padding: n }, l, s) {
|
|
101
|
+
let a = /* @__PURE__ */ r((u) => 0, "shift"), f = 0, c = 0, p = s ? 1 : 0.5, d = s ? l * 2 : 0;
|
|
102
|
+
return e === "padding" ? a = /* @__PURE__ */ r((u) => n[u] * p + d, "shift") : e === "border" ? a = /* @__PURE__ */ r((u) => n[u] + i[u] *
|
|
103
|
+
p + d, "shift") : e === "margin" && (a = /* @__PURE__ */ r((u) => n[u] + i[u] + o[u] * p + d, "shift")), t === "top" ? c = -a("top") : t ===
|
|
104
|
+
"right" ? f = a("right") : t === "bottom" ? c = a("bottom") : t === "left" && (f = -a("left")), { offsetX: f, offsetY: c };
|
|
105
|
+
}
|
|
106
|
+
r(at, "offset");
|
|
107
107
|
function ft(e, t) {
|
|
108
108
|
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;
|
|
109
109
|
}
|
|
110
110
|
r(ft, "collide");
|
|
111
111
|
function ct(e, t, o) {
|
|
112
|
-
return e === "top" ? t.y = o.y - o.h -
|
|
113
|
-
"left" && (t.x = o.x - o.w / 2 -
|
|
112
|
+
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 ===
|
|
113
|
+
"left" && (t.x = o.x - o.w / 2 - b - t.w / 2), { x: t.x, y: t.y };
|
|
114
114
|
}
|
|
115
115
|
r(ct, "overlapAdjustment");
|
|
116
|
-
function $(e, t, { x: o, y: i, w: n, h: l },
|
|
116
|
+
function $(e, t, { x: o, y: i, w: n, h: l }, s) {
|
|
117
117
|
return X(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,
|
|
118
|
-
e.fillText(
|
|
119
|
-
w.text, e.fillText(
|
|
118
|
+
e.fillText(s, o, i), X(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 =
|
|
119
|
+
w.text, e.fillText(s, o, i), { x: o, y: i, w: n, h: l };
|
|
120
120
|
}
|
|
121
121
|
r($, "textWithRect");
|
|
122
122
|
function N(e, t) {
|
|
123
123
|
e.font = "600 12px monospace", e.textBaseline = "middle", e.textAlign = "center";
|
|
124
|
-
let o = e.measureText(t), i = o.actualBoundingBoxAscent + o.actualBoundingBoxDescent, n = o.width +
|
|
124
|
+
let o = e.measureText(t), i = o.actualBoundingBoxAscent + o.actualBoundingBoxDescent, n = o.width + b * 2, l = i + b * 2;
|
|
125
125
|
return { w: n, h: l };
|
|
126
126
|
}
|
|
127
127
|
r(N, "configureText");
|
|
128
|
-
function mt(e, t, { type: o, position: i = "center", text: n }, l,
|
|
129
|
-
let { x:
|
|
130
|
-
|
|
131
|
-
let { w: d, h } = N(e, n);
|
|
132
|
-
if (l && ft({ x:
|
|
133
|
-
let S = ct(i, { x:
|
|
134
|
-
|
|
128
|
+
function mt(e, t, { type: o, position: i = "center", text: n }, l, s = !1) {
|
|
129
|
+
let { x: a, y: f } = st(i, t), { offsetX: c, offsetY: p } = at(o, i, t, b + 1, s);
|
|
130
|
+
a += c, f += p;
|
|
131
|
+
let { w: d, h: u } = N(e, n);
|
|
132
|
+
if (l && ft({ x: a, y: f, w: d, h: u }, l)) {
|
|
133
|
+
let S = ct(i, { x: a, y: f, w: d, h: u }, l);
|
|
134
|
+
a = S.x, f = S.y;
|
|
135
135
|
}
|
|
136
|
-
return $(e, o, { x:
|
|
136
|
+
return $(e, o, { x: a, y: f, w: d, h: u }, n);
|
|
137
137
|
}
|
|
138
138
|
r(mt, "drawLabel");
|
|
139
|
-
function
|
|
140
|
-
let i = t * 0.5 +
|
|
139
|
+
function pt(e, { w: t, h: o }) {
|
|
140
|
+
let i = t * 0.5 + b, n = o * 0.5 + b;
|
|
141
141
|
return {
|
|
142
142
|
offsetX: (e.x === "left" ? -1 : 1) * i,
|
|
143
143
|
offsetY: (e.y === "top" ? -1 : 1) * n
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
|
-
r(
|
|
147
|
-
function
|
|
148
|
-
let { floatingAlignment: n, extremities: l } = t,
|
|
146
|
+
r(pt, "floatingOffset");
|
|
147
|
+
function ut(e, t, { type: o, text: i }) {
|
|
148
|
+
let { floatingAlignment: n, extremities: l } = t, s = l[n.x], a = l[n.y], { w: f, h: c } = N(e, i), { offsetX: p, offsetY: d } = pt(n, {
|
|
149
149
|
w: f,
|
|
150
150
|
h: c
|
|
151
151
|
});
|
|
152
|
-
return
|
|
152
|
+
return s += p, a += d, $(e, o, { x: s, y: a, w: f, h: c }, i);
|
|
153
153
|
}
|
|
154
|
-
r(
|
|
155
|
-
function
|
|
154
|
+
r(ut, "drawFloatingLabel");
|
|
155
|
+
function E(e, t, o, i) {
|
|
156
156
|
let n = [];
|
|
157
|
-
o.forEach((l,
|
|
158
|
-
let
|
|
159
|
-
n[
|
|
157
|
+
o.forEach((l, s) => {
|
|
158
|
+
let a = i && l.position === "center" ? ut(e, t, l) : mt(e, t, l, n[s - 1], i);
|
|
159
|
+
n[s] = a;
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
|
-
r(
|
|
162
|
+
r(E, "drawStack");
|
|
163
163
|
function O(e, t, o, i) {
|
|
164
|
-
let n = o.reduce((l,
|
|
165
|
-
n.top &&
|
|
164
|
+
let n = o.reduce((l, s) => (Object.prototype.hasOwnProperty.call(l, s.position) || (l[s.position] = []), l[s.position]?.push(s), l), {});
|
|
165
|
+
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(
|
|
166
166
|
e, t, n.center, i);
|
|
167
167
|
}
|
|
168
168
|
r(O, "labelStacks");
|
|
@@ -174,24 +174,24 @@ var M = {
|
|
|
174
174
|
padding: "#93c47d8c",
|
|
175
175
|
content: "#6fa8dca8"
|
|
176
176
|
}, I = 30;
|
|
177
|
-
function
|
|
177
|
+
function h(e) {
|
|
178
178
|
return parseInt(e.replace("px", ""), 10);
|
|
179
179
|
}
|
|
180
|
-
r(
|
|
181
|
-
function
|
|
180
|
+
r(h, "pxToNumber");
|
|
181
|
+
function y(e) {
|
|
182
182
|
return Number.isInteger(e) ? e : e.toFixed(2);
|
|
183
183
|
}
|
|
184
|
-
r(
|
|
184
|
+
r(y, "round");
|
|
185
185
|
function k(e) {
|
|
186
186
|
return e.filter((t) => t.text !== 0 && t.text !== "0");
|
|
187
187
|
}
|
|
188
188
|
r(k, "filterZeroValues");
|
|
189
189
|
function dt(e) {
|
|
190
190
|
let t = {
|
|
191
|
-
top:
|
|
192
|
-
bottom:
|
|
193
|
-
left:
|
|
194
|
-
right:
|
|
191
|
+
top: g.window.scrollY,
|
|
192
|
+
bottom: g.window.scrollY + g.window.innerHeight,
|
|
193
|
+
left: g.window.scrollX,
|
|
194
|
+
right: g.window.scrollX + g.window.innerWidth
|
|
195
195
|
}, o = {
|
|
196
196
|
top: Math.abs(t.top - e.top),
|
|
197
197
|
bottom: Math.abs(t.bottom - e.bottom),
|
|
@@ -204,13 +204,13 @@ function dt(e) {
|
|
|
204
204
|
};
|
|
205
205
|
}
|
|
206
206
|
r(dt, "floatingAlignment");
|
|
207
|
-
function
|
|
208
|
-
let t =
|
|
207
|
+
function ht(e) {
|
|
208
|
+
let t = g.getComputedStyle(e), { top: o, left: i, right: n, bottom: l, width: s, height: a } = e.getBoundingClientRect(), {
|
|
209
209
|
marginTop: f,
|
|
210
210
|
marginBottom: c,
|
|
211
|
-
marginLeft:
|
|
211
|
+
marginLeft: p,
|
|
212
212
|
marginRight: d,
|
|
213
|
-
paddingTop:
|
|
213
|
+
paddingTop: u,
|
|
214
214
|
paddingBottom: S,
|
|
215
215
|
paddingLeft: K,
|
|
216
216
|
paddingRight: Z,
|
|
@@ -219,85 +219,85 @@ function pt(e) {
|
|
|
219
219
|
borderLeftWidth: tt,
|
|
220
220
|
borderRightWidth: et
|
|
221
221
|
} = t;
|
|
222
|
-
o = o +
|
|
223
|
-
let
|
|
224
|
-
top:
|
|
225
|
-
bottom:
|
|
226
|
-
left: p
|
|
227
|
-
right:
|
|
222
|
+
o = o + g.window.scrollY, i = i + g.window.scrollX, l = l + g.window.scrollY, n = n + g.window.scrollX;
|
|
223
|
+
let L = {
|
|
224
|
+
top: h(f),
|
|
225
|
+
bottom: h(c),
|
|
226
|
+
left: h(p),
|
|
227
|
+
right: h(d)
|
|
228
228
|
}, ot = {
|
|
229
|
-
top:
|
|
230
|
-
bottom:
|
|
231
|
-
left:
|
|
232
|
-
right:
|
|
229
|
+
top: h(u),
|
|
230
|
+
bottom: h(S),
|
|
231
|
+
left: h(K),
|
|
232
|
+
right: h(Z)
|
|
233
233
|
}, nt = {
|
|
234
|
-
top:
|
|
235
|
-
bottom:
|
|
236
|
-
left:
|
|
237
|
-
right:
|
|
238
|
-
},
|
|
239
|
-
top: o -
|
|
240
|
-
bottom: l +
|
|
241
|
-
left: i -
|
|
242
|
-
right: n +
|
|
234
|
+
top: h(J),
|
|
235
|
+
bottom: h(Q),
|
|
236
|
+
left: h(tt),
|
|
237
|
+
right: h(et)
|
|
238
|
+
}, A = {
|
|
239
|
+
top: o - L.top,
|
|
240
|
+
bottom: l + L.bottom,
|
|
241
|
+
left: i - L.left,
|
|
242
|
+
right: n + L.right
|
|
243
243
|
};
|
|
244
244
|
return {
|
|
245
|
-
margin:
|
|
245
|
+
margin: L,
|
|
246
246
|
padding: ot,
|
|
247
247
|
border: nt,
|
|
248
248
|
top: o,
|
|
249
249
|
left: i,
|
|
250
250
|
bottom: l,
|
|
251
251
|
right: n,
|
|
252
|
-
width:
|
|
253
|
-
height:
|
|
254
|
-
extremities:
|
|
255
|
-
floatingAlignment: dt(
|
|
252
|
+
width: s,
|
|
253
|
+
height: a,
|
|
254
|
+
extremities: A,
|
|
255
|
+
floatingAlignment: dt(A)
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
|
-
r(
|
|
259
|
-
function
|
|
258
|
+
r(ht, "measureElement");
|
|
259
|
+
function gt(e, { margin: t, width: o, height: i, top: n, left: l, bottom: s, right: a }) {
|
|
260
260
|
let f = i + t.bottom + t.top;
|
|
261
|
-
e.fillStyle = M.margin, e.fillRect(l, n - t.top, o, t.top), e.fillRect(
|
|
261
|
+
e.fillStyle = M.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(
|
|
262
262
|
l - t.left, n - t.top, t.left, f);
|
|
263
263
|
let c = [
|
|
264
264
|
{
|
|
265
265
|
type: "margin",
|
|
266
|
-
text:
|
|
266
|
+
text: y(t.top),
|
|
267
267
|
position: "top"
|
|
268
268
|
},
|
|
269
269
|
{
|
|
270
270
|
type: "margin",
|
|
271
|
-
text:
|
|
271
|
+
text: y(t.right),
|
|
272
272
|
position: "right"
|
|
273
273
|
},
|
|
274
274
|
{
|
|
275
275
|
type: "margin",
|
|
276
|
-
text:
|
|
276
|
+
text: y(t.bottom),
|
|
277
277
|
position: "bottom"
|
|
278
278
|
},
|
|
279
279
|
{
|
|
280
280
|
type: "margin",
|
|
281
|
-
text:
|
|
281
|
+
text: y(t.left),
|
|
282
282
|
position: "left"
|
|
283
283
|
}
|
|
284
284
|
];
|
|
285
285
|
return k(c);
|
|
286
286
|
}
|
|
287
|
-
r(
|
|
288
|
-
function
|
|
289
|
-
let c = i - o.left - o.right,
|
|
290
|
-
e.fillStyle = M.padding, e.fillRect(
|
|
287
|
+
r(gt, "drawMargin");
|
|
288
|
+
function bt(e, { padding: t, border: o, width: i, height: n, top: l, left: s, bottom: a, right: f }) {
|
|
289
|
+
let c = i - o.left - o.right, p = n - t.top - t.bottom - o.top - o.bottom;
|
|
290
|
+
e.fillStyle = M.padding, e.fillRect(s + o.left, l + o.top, c, t.top), e.fillRect(
|
|
291
291
|
f - t.right - o.right,
|
|
292
292
|
l + t.top + o.top,
|
|
293
293
|
t.right,
|
|
294
|
-
|
|
294
|
+
p
|
|
295
295
|
), e.fillRect(
|
|
296
|
-
|
|
297
|
-
|
|
296
|
+
s + o.left,
|
|
297
|
+
a - t.bottom - o.bottom,
|
|
298
298
|
c,
|
|
299
299
|
t.bottom
|
|
300
|
-
), e.fillRect(
|
|
300
|
+
), e.fillRect(s + o.left, l + t.top + o.top, t.left, p);
|
|
301
301
|
let d = [
|
|
302
302
|
{
|
|
303
303
|
type: "padding",
|
|
@@ -322,11 +322,11 @@ function gt(e, { padding: t, border: o, width: i, height: n, top: l, left: a, bo
|
|
|
322
322
|
];
|
|
323
323
|
return k(d);
|
|
324
324
|
}
|
|
325
|
-
r(
|
|
326
|
-
function wt(e, { border: t, width: o, height: i, top: n, left: l, bottom:
|
|
325
|
+
r(bt, "drawPadding");
|
|
326
|
+
function wt(e, { border: t, width: o, height: i, top: n, left: l, bottom: s, right: a }) {
|
|
327
327
|
let f = i - t.top - t.bottom;
|
|
328
|
-
e.fillStyle = M.border, e.fillRect(l, n, o, t.top), e.fillRect(l,
|
|
329
|
-
|
|
328
|
+
e.fillStyle = M.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(
|
|
329
|
+
a - t.right, n + t.top, t.right, f);
|
|
330
330
|
let c = [
|
|
331
331
|
{
|
|
332
332
|
type: "border",
|
|
@@ -352,48 +352,48 @@ function wt(e, { border: t, width: o, height: i, top: n, left: l, bottom: a, rig
|
|
|
352
352
|
return k(c);
|
|
353
353
|
}
|
|
354
354
|
r(wt, "drawBorder");
|
|
355
|
-
function
|
|
356
|
-
let
|
|
355
|
+
function yt(e, { padding: t, border: o, width: i, height: n, top: l, left: s }) {
|
|
356
|
+
let a = i - o.left - o.right - t.left - t.right, f = n - t.top - t.bottom - o.top - o.bottom;
|
|
357
357
|
return e.fillStyle = M.content, e.fillRect(
|
|
358
|
-
|
|
358
|
+
s + o.left + t.left,
|
|
359
359
|
l + o.top + t.top,
|
|
360
|
-
|
|
360
|
+
a,
|
|
361
361
|
f
|
|
362
362
|
), [
|
|
363
363
|
{
|
|
364
364
|
type: "content",
|
|
365
365
|
position: "center",
|
|
366
|
-
text: `${
|
|
366
|
+
text: `${y(a)} x ${y(f)}`
|
|
367
367
|
}
|
|
368
368
|
];
|
|
369
369
|
}
|
|
370
|
-
r(
|
|
371
|
-
function
|
|
370
|
+
r(yt, "drawContent");
|
|
371
|
+
function Lt(e) {
|
|
372
372
|
return (t) => {
|
|
373
373
|
if (e && t) {
|
|
374
|
-
let o =
|
|
374
|
+
let o = ht(e), i = gt(t, o), n = bt(t, o), l = wt(t, o), s = yt(t, o), a = o.width <= I * 3 || o.height <= I;
|
|
375
375
|
O(
|
|
376
376
|
t,
|
|
377
377
|
o,
|
|
378
|
-
[...
|
|
379
|
-
|
|
378
|
+
[...s, ...n, ...l, ...i],
|
|
379
|
+
a
|
|
380
380
|
);
|
|
381
381
|
}
|
|
382
382
|
};
|
|
383
383
|
}
|
|
384
|
-
r(
|
|
384
|
+
r(Lt, "drawBoxModel");
|
|
385
385
|
function _(e) {
|
|
386
|
-
Y(
|
|
386
|
+
Y(Lt(e));
|
|
387
387
|
}
|
|
388
388
|
r(_, "drawSelectedElement");
|
|
389
389
|
|
|
390
390
|
// src/measure/util.ts
|
|
391
|
-
import { global as
|
|
391
|
+
import { global as Et } from "@storybook/global";
|
|
392
392
|
var q = /* @__PURE__ */ r((e, t) => {
|
|
393
|
-
let o =
|
|
393
|
+
let o = Et.document.elementFromPoint(e, t), i = /* @__PURE__ */ r((l) => {
|
|
394
394
|
if (l && l.shadowRoot) {
|
|
395
|
-
let
|
|
396
|
-
return l.isEqualNode(
|
|
395
|
+
let s = l.shadowRoot.elementFromPoint(e, t);
|
|
396
|
+
return l.isEqualNode(s) ? l : s.shadowRoot ? i(s) : s;
|
|
397
397
|
}
|
|
398
398
|
return l;
|
|
399
399
|
}, "crawlShadows");
|
|
@@ -438,7 +438,7 @@ resize", n), U(x.x, x.y)), () => {
|
|
|
438
438
|
|
|
439
439
|
// src/measure/preview.ts
|
|
440
440
|
var Ct = globalThis.FEATURES?.measure ? [V] : [], vt = {
|
|
441
|
-
[
|
|
441
|
+
[P]: !1
|
|
442
442
|
}, te = /* @__PURE__ */ r(() => St({
|
|
443
443
|
decorators: Ct,
|
|
444
444
|
initialGlobals: vt
|