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.
- package/assets/server/base-preview-head.html +1 -3
- package/dist/actions/decorator.js +34 -38
- package/dist/actions/index.cjs +1 -4
- package/dist/actions/index.js +1 -4
- package/dist/actions/preview.cjs +1 -4
- package/dist/actions/preview.js +1 -4
- package/dist/babel/index.cjs +822 -816
- package/dist/babel/index.js +822 -816
- package/dist/backgrounds/index.cjs +16 -16
- package/dist/backgrounds/index.js +14 -14
- package/dist/backgrounds/preview.cjs +34 -34
- package/dist/backgrounds/preview.js +29 -29
- package/dist/bin/index.cjs +67 -65
- package/dist/bin/index.js +61 -59
- package/dist/builder-manager/index.cjs +482 -472
- package/dist/builder-manager/index.js +283 -273
- package/dist/channels/index.js +941 -919
- package/dist/cli/bin/index.cjs +1 -1
- package/dist/cli/bin/index.js +1 -1
- package/dist/cli/index.cjs +61752 -7591
- package/dist/cli/index.d.ts +22 -14
- package/dist/cli/index.js +61775 -7614
- package/dist/common/index.cjs +16015 -8979
- package/dist/common/index.d.ts +30 -1
- package/dist/common/index.js +16105 -9063
- package/dist/components/index.cjs +3694 -3643
- package/dist/components/index.d.ts +5 -2
- package/dist/components/index.js +2352 -2294
- package/dist/core-server/index.cjs +3540 -3540
- package/dist/core-server/index.js +730 -730
- package/dist/core-server/presets/common-manager.js +2642 -2592
- package/dist/core-server/presets/common-preset.cjs +723 -715
- package/dist/core-server/presets/common-preset.js +10 -2
- package/dist/docs-tools/index.js +640 -632
- package/dist/highlight/index.cjs +16 -16
- package/dist/highlight/index.d.ts +45 -1
- package/dist/highlight/index.js +2 -2
- package/dist/highlight/preview.cjs +522 -68
- package/dist/highlight/preview.js +508 -56
- package/dist/instrumenter/index.js +1179 -1170
- package/dist/manager/globals-module-info.cjs +1 -0
- package/dist/manager/globals-module-info.js +1 -0
- package/dist/manager/globals-runtime.js +19385 -19190
- package/dist/manager/runtime.js +2084 -2079
- package/dist/manager-api/index.cjs +352 -352
- package/dist/manager-api/index.js +1694 -1663
- package/dist/manager-errors.js +41 -37
- package/dist/measure/index.cjs +99 -97
- package/dist/measure/index.js +95 -93
- package/dist/measure/preview.cjs +127 -125
- package/dist/measure/preview.js +125 -123
- package/dist/outline/index.cjs +41 -41
- package/dist/outline/index.js +12 -12
- package/dist/outline/preview.cjs +23 -23
- package/dist/outline/preview.js +7 -7
- package/dist/preview/runtime.js +13577 -12959
- package/dist/preview-api/index.cjs +0 -1
- package/dist/preview-api/index.d.ts +120 -385
- package/dist/preview-api/index.js +827 -812
- package/dist/preview-errors.cjs +65 -51
- package/dist/preview-errors.d.ts +6 -2
- package/dist/preview-errors.js +176 -142
- package/dist/server-errors.cjs +105 -72
- package/dist/server-errors.d.ts +9 -1
- package/dist/server-errors.js +87 -54
- package/dist/telemetry/index.cjs +374 -370
- package/dist/telemetry/index.js +460 -456
- package/dist/test/index.js +9831 -9743
- package/dist/test/preview.d.ts +0 -6
- package/dist/test/preview.js +3628 -3568
- package/dist/types/index.d.ts +72 -6
- package/package.json +1 -1
package/dist/measure/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var st = (e, t) => {
|
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
// src/measure/index.ts
|
|
9
|
-
import { definePreview as
|
|
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",
|
|
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
|
|
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,
|
|
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(
|
|
39
|
-
var o = typeof t == "function" ? t() : t, i = o ? "".concat(
|
|
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
|
|
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(
|
|
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 } =
|
|
57
|
-
return
|
|
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
|
|
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(
|
|
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."),
|
|
82
|
-
let { width: e, height: t } =
|
|
83
|
-
|
|
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,
|
|
109
|
-
return e === "top" ? c += s / 2 : e === "right" ? (c += s,
|
|
110
|
-
e === "center" && (c += s / 2,
|
|
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
|
|
114
|
-
let s = /* @__PURE__ */ l((
|
|
115
|
-
return e === "padding" ? s = /* @__PURE__ */ l((
|
|
116
|
-
|
|
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(
|
|
120
|
-
function
|
|
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(
|
|
124
|
-
function
|
|
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(
|
|
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
|
|
142
|
-
let { x: s, y: f } = mt(i, t), { offsetX: c, offsetY:
|
|
143
|
-
s += c, f +=
|
|
144
|
-
let { w:
|
|
145
|
-
if (r &&
|
|
146
|
-
let S =
|
|
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:
|
|
149
|
+
return O(e, o, { x: s, y: f, w: h, h: d }, n);
|
|
150
150
|
}
|
|
151
|
-
l(
|
|
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:
|
|
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 +=
|
|
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
|
|
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) :
|
|
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(
|
|
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 &&
|
|
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
|
|
190
|
+
function p(e) {
|
|
191
191
|
return parseInt(e.replace("px", ""), 10);
|
|
192
192
|
}
|
|
193
|
-
l(
|
|
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
|
|
198
|
+
function k(e) {
|
|
199
199
|
return e.filter((t) => t.text !== 0 && t.text !== "0");
|
|
200
200
|
}
|
|
201
|
-
l(
|
|
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:
|
|
225
|
-
marginRight:
|
|
226
|
-
paddingTop:
|
|
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
|
|
237
|
-
top:
|
|
238
|
-
bottom:
|
|
239
|
-
left:
|
|
240
|
-
right: h
|
|
236
|
+
let E = {
|
|
237
|
+
top: p(f),
|
|
238
|
+
bottom: p(c),
|
|
239
|
+
left: p(u),
|
|
240
|
+
right: p(h)
|
|
241
241
|
}, lt = {
|
|
242
|
-
top:
|
|
243
|
-
bottom:
|
|
244
|
-
left:
|
|
245
|
-
right:
|
|
242
|
+
top: p(d),
|
|
243
|
+
bottom: p(S),
|
|
244
|
+
left: p(tt),
|
|
245
|
+
right: p(et)
|
|
246
246
|
}, at = {
|
|
247
|
-
top:
|
|
248
|
-
bottom:
|
|
249
|
-
left:
|
|
250
|
-
right:
|
|
247
|
+
top: p(nt),
|
|
248
|
+
bottom: p(ot),
|
|
249
|
+
left: p(it),
|
|
250
|
+
right: p(rt)
|
|
251
251
|
}, A = {
|
|
252
|
-
top: o -
|
|
253
|
-
bottom: r +
|
|
254
|
-
left: i -
|
|
255
|
-
right: n +
|
|
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:
|
|
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
|
|
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
|
|
298
|
+
return k(c);
|
|
299
299
|
}
|
|
300
|
-
l(
|
|
301
|
-
function
|
|
302
|
-
let c = i - o.left - o.right,
|
|
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
|
-
|
|
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,
|
|
314
|
-
let
|
|
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
|
|
336
|
+
return k(h);
|
|
337
337
|
}
|
|
338
|
-
l(
|
|
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
|
|
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 =
|
|
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
|
|
418
|
-
function
|
|
419
|
-
|
|
417
|
+
var V, x = { x: 0, y: 0 };
|
|
418
|
+
function K(e, t) {
|
|
419
|
+
V = G(e, t), j(V);
|
|
420
420
|
}
|
|
421
|
-
l(
|
|
421
|
+
l(K, "findAndDrawElement");
|
|
422
422
|
var Z = /* @__PURE__ */ l((e, t) => {
|
|
423
423
|
let { measureEnabled: o } = t.globals || {};
|
|
424
|
-
return
|
|
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
|
-
}, []),
|
|
435
|
+
}, []), U(() => {
|
|
434
436
|
let i = /* @__PURE__ */ l((r) => {
|
|
435
437
|
window.requestAnimationFrame(() => {
|
|
436
|
-
r.stopPropagation(),
|
|
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("
|
|
444
|
-
|
|
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
|
-
[
|
|
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(() =>
|
|
461
|
+
var le = /* @__PURE__ */ l(() => Tt(P), "default");
|
|
460
462
|
export {
|
|
461
463
|
le as default
|
|
462
464
|
};
|