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.
Files changed (77) 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/builder-manager/index.cjs +379 -378
  16. package/dist/builder-manager/index.d.ts +567 -2
  17. package/dist/builder-manager/index.js +280 -279
  18. package/dist/cli/bin/index.cjs +1 -1
  19. package/dist/cli/bin/index.js +1 -1
  20. package/dist/common/index.cjs +87 -79
  21. package/dist/common/index.d.ts +2 -2
  22. package/dist/common/index.js +725 -716
  23. package/dist/component-testing/preview.cjs +12 -12
  24. package/dist/component-testing/preview.d.ts +2 -2
  25. package/dist/component-testing/preview.js +7 -7
  26. package/dist/components/index.cjs +1899 -1895
  27. package/dist/components/index.js +1343 -1339
  28. package/dist/controls/index.cjs +16 -16
  29. package/dist/controls/index.d.ts +1 -36
  30. package/dist/controls/preview.cjs +17 -17
  31. package/dist/controls/preview.d.ts +34 -546
  32. package/dist/controls/preview.js +3 -3
  33. package/dist/csf/index.cjs +1210 -95
  34. package/dist/csf/index.d.ts +59 -18
  35. package/dist/csf/index.js +1214 -90
  36. package/dist/csf-tools/index.cjs +2 -1
  37. package/dist/csf-tools/index.js +2 -2
  38. package/dist/highlight/index.cjs +15 -15
  39. package/dist/highlight/index.d.ts +1 -12
  40. package/dist/highlight/index.js +4 -4
  41. package/dist/highlight/preview.cjs +63 -63
  42. package/dist/highlight/preview.d.ts +11 -546
  43. package/dist/highlight/preview.js +11 -10
  44. package/dist/manager/globals-runtime.js +31934 -31888
  45. package/dist/manager-api/index.cjs +1 -1
  46. package/dist/manager-api/index.js +1 -1
  47. package/dist/measure/index.cjs +12 -472
  48. package/dist/measure/index.d.ts +1 -566
  49. package/dist/measure/index.js +0 -464
  50. package/dist/measure/preview.cjs +127 -127
  51. package/dist/measure/preview.d.ts +11 -546
  52. package/dist/measure/preview.js +117 -117
  53. package/dist/outline/index.cjs +12 -524
  54. package/dist/outline/index.d.ts +1 -566
  55. package/dist/outline/index.js +0 -500
  56. package/dist/outline/preview.cjs +32 -32
  57. package/dist/outline/preview.d.ts +11 -546
  58. package/dist/outline/preview.js +27 -27
  59. package/dist/preview/runtime.js +9415 -9379
  60. package/dist/preview-api/index.cjs +1228 -1261
  61. package/dist/preview-api/index.d.ts +6 -8
  62. package/dist/preview-api/index.js +927 -963
  63. package/dist/telemetry/index.cjs +1477 -1288
  64. package/dist/telemetry/index.js +1503 -1314
  65. package/dist/test/index.cjs +4437 -4394
  66. package/dist/test/index.js +3776 -3733
  67. package/dist/test/preview.cjs +42 -42
  68. package/dist/test/preview.d.ts +12 -550
  69. package/dist/test/preview.js +36 -36
  70. package/dist/types/index.d.ts +5 -3
  71. package/dist/viewport/index.cjs +17 -24
  72. package/dist/viewport/index.d.ts +9 -532
  73. package/dist/viewport/index.js +9 -16
  74. package/dist/viewport/preview.cjs +22 -22
  75. package/dist/viewport/preview.d.ts +45 -552
  76. package/dist/viewport/preview.js +8 -8
  77. package/package.json +1 -1
@@ -362,7 +362,8 @@ var D = /* @__PURE__ */ f((s, e) => {
362
362
  let x;
363
363
  if (c.types.isVariableDeclarator(l) ? x = c.types.isTSAsExpression(l.init) || c.types.isTSSatisfiesExpression(l.init) ? l.init.
364
364
  expression : l.init : x = l, c.types.isCallExpression(x) && c.types.isMemberExpression(x.callee) && c.types.isIdentifier(x.callee.
365
- property) && x.callee.property.name === "story" && (p = !0, x = x.arguments[0]), e._metaIsFactory && !p)
365
+ property) && (x.callee.property.name === "story" || x.callee.property.name === "extend") && (p = !0, x = x.arguments[0]), e._metaIsFactory &&
366
+ !p)
366
367
  throw new M(
367
368
  "expected factory story",
368
369
  x,
@@ -340,8 +340,8 @@ var v = /* @__PURE__ */ f((s, e) => {
340
340
  ) : e._storyAnnotations[d] = {};
341
341
  let x;
342
342
  if (c.isVariableDeclarator(l) ? x = c.isTSAsExpression(l.init) || c.isTSSatisfiesExpression(l.init) ? l.init.expression : l.init :
343
- x = l, c.isCallExpression(x) && c.isMemberExpression(x.callee) && c.isIdentifier(x.callee.property) && x.callee.property.name ===
344
- "story" && (p = !0, x = x.arguments[0]), e._metaIsFactory && !p)
343
+ x = l, c.isCallExpression(x) && c.isMemberExpression(x.callee) && c.isIdentifier(x.callee.property) && (x.callee.property.name ===
344
+ "story" || x.callee.property.name === "extend") && (p = !0, x = x.arguments[0]), e._metaIsFactory && !p)
345
345
  throw new B(
346
346
  "expected factory story",
347
347
  x,
@@ -1,28 +1,28 @@
1
1
  "use strict";
2
2
  var r = Object.defineProperty;
3
- var G = Object.getOwnPropertyDescriptor;
3
+ var i = Object.getOwnPropertyDescriptor;
4
4
  var n = Object.getOwnPropertyNames;
5
5
  var T = Object.prototype.hasOwnProperty;
6
6
  var L = (o, t) => {
7
- for (var H in t)
8
- r(o, H, { get: t[H], enumerable: !0 });
9
- }, c = (o, t, H, s) => {
7
+ for (var I in t)
8
+ r(o, I, { get: t[I], enumerable: !0 });
9
+ }, c = (o, t, I, E) => {
10
10
  if (t && typeof t == "object" || typeof t == "function")
11
- for (let e of n(t))
12
- !T.call(o, e) && e !== H && r(o, e, { get: () => t[e], enumerable: !(s = G(t, e)) || s.enumerable });
11
+ for (let H of n(t))
12
+ !T.call(o, H) && H !== I && r(o, H, { get: () => t[H], enumerable: !(E = i(t, H)) || E.enumerable });
13
13
  return o;
14
14
  };
15
- var h = (o) => c(r({}, "__esModule", { value: !0 }), o);
15
+ var x = (o) => c(r({}, "__esModule", { value: !0 }), o);
16
16
 
17
17
  // src/highlight/index.ts
18
- var x = {};
19
- L(x, {
20
- HIGHLIGHT: () => E,
21
- REMOVE_HIGHLIGHT: () => _,
22
- RESET_HIGHLIGHT: () => i,
23
- SCROLL_INTO_VIEW: () => p
18
+ var O = {};
19
+ L(O, {
20
+ HIGHLIGHT: () => _,
21
+ REMOVE_HIGHLIGHT: () => s,
22
+ RESET_HIGHLIGHT: () => p,
23
+ SCROLL_INTO_VIEW: () => G
24
24
  });
25
- module.exports = h(x);
25
+ module.exports = x(O);
26
26
 
27
27
  // src/highlight/constants.ts
28
- var I = "storybook/highlight", E = `${I}/add`, _ = `${I}/remove`, i = `${I}/reset`, p = `${I}/scroll-into-view`;
28
+ var e = "storybook/highlight", _ = `${e}/add`, s = `${e}/remove`, p = `${e}/reset`, G = `${e}/scroll-into-view`;
@@ -11,17 +11,6 @@ declare const iconPaths: {
11
11
  };
12
12
  type IconName = keyof typeof iconPaths;
13
13
 
14
- interface HighlightParameters {
15
- /**
16
- * Highlight configuration
17
- *
18
- * @see https://storybook.js.org/docs/essentials/highlight#parameters
19
- */
20
- highlight: {
21
- /** Remove the addon panel and disable the addon's behavior */
22
- disable?: boolean;
23
- };
24
- }
25
14
  interface HighlightMenuItem {
26
15
  /** Unique identifier for the menu item */
27
16
  id: string;
@@ -70,4 +59,4 @@ interface ClickEventDetails {
70
59
  };
71
60
  }
72
61
 
73
- export { type ClickEventDetails, HIGHLIGHT, type HighlightMenuItem, type HighlightOptions, type HighlightParameters, REMOVE_HIGHLIGHT, RESET_HIGHLIGHT, SCROLL_INTO_VIEW };
62
+ export { type ClickEventDetails, HIGHLIGHT, type HighlightMenuItem, type HighlightOptions, REMOVE_HIGHLIGHT, RESET_HIGHLIGHT, SCROLL_INTO_VIEW };
@@ -1,8 +1,8 @@
1
1
  // src/highlight/constants.ts
2
- var t = "storybook/highlight", o = `${t}/add`, e = `${t}/remove`, H = `${t}/reset`, I = `${t}/scroll-into-view`;
2
+ var t = "storybook/highlight", o = `${t}/add`, H = `${t}/remove`, I = `${t}/reset`, e = `${t}/scroll-into-view`;
3
3
  export {
4
4
  o as HIGHLIGHT,
5
- e as REMOVE_HIGHLIGHT,
6
- H as RESET_HIGHLIGHT,
7
- I as SCROLL_INTO_VIEW
5
+ H as REMOVE_HIGHLIGHT,
6
+ I as RESET_HIGHLIGHT,
7
+ e as SCROLL_INTO_VIEW
8
8
  };
@@ -1,36 +1,36 @@
1
1
  "use strict";
2
- var R = Object.defineProperty;
3
- var me = Object.getOwnPropertyDescriptor;
4
- var he = Object.getOwnPropertyNames;
5
- var ge = Object.prototype.hasOwnProperty;
6
- var d = (t, e) => R(t, "name", { value: e, configurable: !0 });
7
- var fe = (t, e) => {
2
+ var _ = Object.defineProperty;
3
+ var he = Object.getOwnPropertyDescriptor;
4
+ var ge = Object.getOwnPropertyNames;
5
+ var fe = Object.prototype.hasOwnProperty;
6
+ var d = (t, e) => _(t, "name", { value: e, configurable: !0 });
7
+ var ye = (t, e) => {
8
8
  for (var l in e)
9
- R(t, l, { get: e[l], enumerable: !0 });
10
- }, ye = (t, e, l, c) => {
9
+ _(t, l, { get: e[l], enumerable: !0 });
10
+ }, be = (t, e, l, c) => {
11
11
  if (e && typeof e == "object" || typeof e == "function")
12
- for (let r of he(e))
13
- !ge.call(t, r) && r !== l && R(t, r, { get: () => e[r], enumerable: !(c = me(e, r)) || c.enumerable });
12
+ for (let r of ge(e))
13
+ !fe.call(t, r) && r !== l && _(t, r, { get: () => e[r], enumerable: !(c = he(e, r)) || c.enumerable });
14
14
  return t;
15
15
  };
16
- var be = (t) => ye(R({}, "__esModule", { value: !0 }), t);
16
+ var xe = (t) => be(_({}, "__esModule", { value: !0 }), t);
17
17
 
18
18
  // src/highlight/preview.ts
19
- var He = {};
20
- fe(He, {
21
- default: () => ve
19
+ var Me = {};
20
+ ye(Me, {
21
+ default: () => He
22
22
  });
23
- module.exports = be(He);
24
- var B = require("storybook/preview-api");
23
+ module.exports = xe(Me);
24
+ var ae = require("storybook/internal/csf"), Z = require("storybook/preview-api");
25
25
 
26
26
  // src/highlight/useHighlights.ts
27
27
  var ce = require("storybook/internal/core-events");
28
28
 
29
29
  // src/highlight/constants.ts
30
- var D = "storybook/highlight", J = `${D}/add`, Q = `${D}/remove`, ee = `${D}/reset`, te = `${D}/scroll-into-view`, z = 2147483647, L = 28;
30
+ var R = "storybook/highlight", J = `${R}/add`, Q = `${R}/remove`, ee = `${R}/reset`, te = `${R}/scroll-into-view`, G = 2147483647, T = 28;
31
31
 
32
32
  // src/highlight/icons.ts
33
- var P = {
33
+ var z = {
34
34
  chevronLeft: [
35
35
  "M9.10355 10.1464C9.29882 10.3417 9.29882 10.6583 9.10355 10.8536C8.90829 11.0488 8.59171 11.0488 8.39645 10.8536L4.89645 7.35355C4.7011\
36
36
  8 7.15829 4.70118 6.84171 4.89645 6.64645L8.39645 3.14645C8.59171 2.95118 8.90829 2.95118 9.10355 3.14645C9.29882 3.34171 9.29882 3.65829 9.\
@@ -52,8 +52,8 @@ var P = {
52
52
  };
53
53
 
54
54
  // src/highlight/utils.ts
55
- var xe = "svg,path,rect,circle,line,polyline,polygon,ellipse,text".split(","), b = /* @__PURE__ */ d((t, e = {}, l) => {
56
- let c = xe.includes(t) ? document.createElementNS("http://www.w3.org/2000/svg", t) : document.createElement(t);
55
+ var Ee = "svg,path,rect,circle,line,polyline,polygon,ellipse,text".split(","), b = /* @__PURE__ */ d((t, e = {}, l) => {
56
+ let c = Ee.includes(t) ? document.createElementNS("http://www.w3.org/2000/svg", t) : document.createElement(t);
57
57
  return Object.entries(e).forEach(([r, p]) => {
58
58
  /[A-Z]/.test(r) ? (r === "onClick" && (c.addEventListener("click", p), c.addEventListener("keydown", (u) => {
59
59
  (u.key === "Enter" || u.key === " ") && (u.preventDefault(), p());
@@ -67,10 +67,10 @@ var xe = "svg,path,rect,circle,line,polyline,polygon,ellipse,text".split(","), b
67
67
  c.appendChild(document.createTextNode(String(r)));
68
68
  }
69
69
  }), c;
70
- }, "createElement"), k = /* @__PURE__ */ d((t) => P[t] && b(
70
+ }, "createElement"), k = /* @__PURE__ */ d((t) => z[t] && b(
71
71
  "svg",
72
72
  { width: "14", height: "14", viewBox: "0 0 14 14", xmlns: "http://www.w3.org/2000/svg" },
73
- P[t].map(
73
+ z[t].map(
74
74
  (e) => b("path", {
75
75
  fill: "currentColor",
76
76
  "fill-rule": "evenodd",
@@ -103,13 +103,13 @@ var xe = "svg,path,rect,circle,line,polyline,polygon,ellipse,text".split(","), b
103
103
  ...l,
104
104
  menu: Array.isArray(e) ? e.every(Array.isArray) ? e : [e] : void 0
105
105
  };
106
- }, "normalizeOptions"), Ee = /* @__PURE__ */ d((t) => t instanceof Function, "isFunction"), S = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(),
107
- N = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ d((t) => {
106
+ }, "normalizeOptions"), we = /* @__PURE__ */ d((t) => t instanceof Function, "isFunction"), S = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(),
107
+ D = /* @__PURE__ */ new Map(), L = /* @__PURE__ */ d((t) => {
108
108
  let e = Symbol();
109
109
  return C.set(e, []), S.set(e, t), { get: /* @__PURE__ */ d(() => S.get(e), "get"), set: /* @__PURE__ */ d((u) => {
110
- let m = S.get(e), f = Ee(u) ? u(m) : u;
110
+ let m = S.get(e), f = we(u) ? u(m) : u;
111
111
  f !== m && (S.set(e, f), C.get(e)?.forEach((E) => {
112
- N.get(E)?.(), N.set(E, E(f));
112
+ D.get(E)?.(), D.set(E, E(f));
113
113
  }));
114
114
  }, "set"), subscribe: /* @__PURE__ */ d((u) => (C.get(e)?.push(u), () => {
115
115
  let m = C.get(e);
@@ -119,10 +119,10 @@ N = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ d((t) => {
119
119
  );
120
120
  }), "subscribe"), teardown: /* @__PURE__ */ d(() => {
121
121
  C.get(e)?.forEach((u) => {
122
- N.get(u)?.(), N.delete(u);
122
+ D.get(u)?.(), D.delete(u);
123
123
  }), C.delete(e), S.delete(e);
124
124
  }, "teardown") };
125
- }, "useStore"), X = /* @__PURE__ */ d((t) => {
125
+ }, "useStore"), P = /* @__PURE__ */ d((t) => {
126
126
  let e = document.getElementById("storybook-root"), l = /* @__PURE__ */ new Map();
127
127
  for (let c of t) {
128
128
  let { priority: r = 0 } = c;
@@ -162,14 +162,14 @@ menu: u }]) => {
162
162
  width: E,
163
163
  height: w
164
164
  };
165
- }).sort((e, l) => l.width * l.height - e.width * e.height), "mapBoxes"), V = /* @__PURE__ */ d((t, e) => {
165
+ }).sort((e, l) => l.width * l.height - e.width * e.height), "mapBoxes"), X = /* @__PURE__ */ d((t, e) => {
166
166
  let l = t.getBoundingClientRect(), { x: c, y: r } = e;
167
167
  return l?.top && l?.left && c >= l.left && c <= l.left + l.width && r >= l.top && r <= l.top + l.height;
168
- }, "isOverMenu"), Y = /* @__PURE__ */ d((t, e, l) => {
168
+ }, "isOverMenu"), V = /* @__PURE__ */ d((t, e, l) => {
169
169
  if (!e || !l)
170
170
  return !1;
171
171
  let { left: c, top: r, width: p, height: u } = t;
172
- u < L && (r = r - Math.round((L - u) / 2), u = L), p < L && (c = c - Math.round((L - p) / 2), p = L), e.style.position === "fixed" && (c +=
172
+ u < T && (r = r - Math.round((T - u) / 2), u = T), p < T && (c = c - Math.round((T - p) / 2), p = T), e.style.position === "fixed" && (c +=
173
173
  window.scrollX, r += window.scrollY);
174
174
  let { x: m, y: f } = l;
175
175
  return m >= c && m <= c + p && f >= r && f <= r + u;
@@ -186,7 +186,7 @@ menu: u }]) => {
186
186
  ...A !== c && { left: `${A}px` },
187
187
  ...I !== r && { top: `${I}px` }
188
188
  });
189
- }, "keepInViewport"), Z = /* @__PURE__ */ d((t) => {
189
+ }, "keepInViewport"), Y = /* @__PURE__ */ d((t) => {
190
190
  window.HTMLElement.prototype.hasOwnProperty("showPopover") && t.showPopover();
191
191
  }, "showPopover"), ie = /* @__PURE__ */ d((t) => {
192
192
  window.HTMLElement.prototype.hasOwnProperty("showPopover") && t.hidePopover();
@@ -207,20 +207,20 @@ menu: u }]) => {
207
207
  }), "getEventDetails");
208
208
 
209
209
  // src/highlight/useHighlights.ts
210
- var g = "storybook-highlights-menu", le = "storybook-highlights-root", we = "storybook-root", de = /* @__PURE__ */ d((t) => {
210
+ var g = "storybook-highlights-menu", le = "storybook-highlights-root", ve = "storybook-root", de = /* @__PURE__ */ d((t) => {
211
211
  if (globalThis.__STORYBOOK_HIGHLIGHT_INITIALIZED)
212
212
  return;
213
213
  globalThis.__STORYBOOK_HIGHLIGHT_INITIALIZED = !0;
214
- let { document: e } = globalThis, l = T([]), c = T(/* @__PURE__ */ new Map()), r = T([]), p = T(), u = T(), m = T([]), f = T([]), E = T(),
215
- w = T(), v = e.getElementById(le);
214
+ let { document: e } = globalThis, l = L([]), c = L(/* @__PURE__ */ new Map()), r = L([]), p = L(), u = L(), m = L([]), f = L([]), E = L(),
215
+ w = L(), v = e.getElementById(le);
216
216
  l.subscribe(() => {
217
217
  v || (v = b("div", { id: le }), e.body.appendChild(v));
218
218
  }), l.subscribe((s) => {
219
- let o = e.getElementById(we);
219
+ let o = e.getElementById(ve);
220
220
  if (!o)
221
221
  return;
222
- c.set(X(s));
223
- let n = new MutationObserver(() => c.set(X(s)));
222
+ c.set(P(s));
223
+ let n = new MutationObserver(() => c.set(P(s)));
224
224
  return n.observe(o, { subtree: !0, childList: !0 }), () => {
225
225
  n.disconnect();
226
226
  };
@@ -289,10 +289,10 @@ var g = "storybook-highlights-menu", le = "storybook-highlights-root", we = "sto
289
289
  let n = /* @__PURE__ */ d((a) => {
290
290
  requestAnimationFrame(() => {
291
291
  let i = e.getElementById(g), h = { x: a.pageX, y: a.pageY };
292
- if (i && !V(i, h)) {
292
+ if (i && !X(i, h)) {
293
293
  let x = o.filter((y) => {
294
294
  let M = H.get(y.element);
295
- return Y(y, M, h);
295
+ return V(y, M, h);
296
296
  });
297
297
  p.set(x.length ? h : void 0), m.set(x);
298
298
  }
@@ -302,10 +302,10 @@ var g = "storybook-highlights-menu", le = "storybook-highlights-root", we = "sto
302
302
  });
303
303
  let A = /* @__PURE__ */ d(() => {
304
304
  let s = e.getElementById(g), o = u.get();
305
- !o || s && V(s, o) || f.set((n) => {
305
+ !o || s && X(s, o) || f.set((n) => {
306
306
  let a = r.get().filter((y) => {
307
307
  let M = H.get(y.element);
308
- return Y(y, M, o);
308
+ return V(y, M, o);
309
309
  }), i = n.filter((y) => a.includes(y)), h = a.filter((y) => !n.includes(y)), x = n.length - i.length;
310
310
  return h.length || x ? [...i, ...h] : n;
311
311
  });
@@ -328,7 +328,7 @@ var g = "storybook-highlights-menu", le = "storybook-highlights-root", we = "sto
328
328
  ...y ? i.hoverStyles : {},
329
329
  ...x ? i.focusStyles : {},
330
330
  position: getComputedStyle(i.element).position === "fixed" ? "fixed" : "absolute",
331
- zIndex: z - 10,
331
+ zIndex: G - 10,
332
332
  top: `${i.top}px`,
333
333
  left: `${i.left}px`,
334
334
  width: `${i.width}px`,
@@ -344,11 +344,11 @@ var g = "storybook-highlights-menu", le = "storybook-highlights-root", we = "sto
344
344
  }), Object.assign(h.children[0].style, {
345
345
  width: "100%",
346
346
  height: "100%",
347
- minHeight: `${L}px`,
348
- minWidth: `${L}px`,
347
+ minHeight: `${T}px`,
348
+ minWidth: `${T}px`,
349
349
  boxSizing: "content-box",
350
350
  padding: h.style.outlineWidth || "0px"
351
- }), Z(h);
351
+ }), Y(h);
352
352
  }
353
353
  });
354
354
  }, "updateBoxStyles");
@@ -366,7 +366,7 @@ var g = "storybook-highlights-menu", le = "storybook-highlights-root", we = "sto
366
366
  `
367
367
  #${g} {
368
368
  position: absolute;
369
- z-index: ${z};
369
+ z-index: ${G};
370
370
  width: 300px;
371
371
  padding: 0px;
372
372
  margin: 15px 0 0 0;
@@ -471,7 +471,7 @@ ue", Helvetica, Arial, sans-serif;
471
471
  n.map((i) => {
472
472
  let h = n.length > 1 && !!i.menu?.some(
473
473
  (M) => M.some(
474
- (O) => !O.selectors || O.selectors.some((_) => i.selectors.includes(_))
474
+ (O) => !O.selectors || O.selectors.some((B) => i.selectors.includes(B))
475
475
  )
476
476
  ), x = h ? {
477
477
  class: "selectable",
@@ -504,14 +504,14 @@ ue", Helvetica, Arial, sans-serif;
504
504
  "ul",
505
505
  { class: "menu-items" },
506
506
  x.map(
507
- ({ id: y, title: M, description: O, iconLeft: _, iconRight: U, clickEvent: K }) => {
508
- let G = K && (() => t.emit(K, y, re(i)));
507
+ ({ id: y, title: M, description: O, iconLeft: B, iconRight: U, clickEvent: K }) => {
508
+ let F = K && (() => t.emit(K, y, re(i)));
509
509
  return b("li", {}, [
510
510
  b(
511
- G ? "button" : "div",
512
- G ? { class: "menu-item", type: "button", onClick: G } : { class: "menu-item" },
511
+ F ? "button" : "div",
512
+ F ? { class: "menu-item", type: "button", onClick: F } : { class: "menu-item" },
513
513
  [
514
- _ ? k(_) : null,
514
+ B ? k(B) : null,
515
515
  b("div", { class: "menu-item-content" }, [
516
516
  b(O ? "strong" : "span", {}, [M]),
517
517
  O && b("span", {}, [O])
@@ -533,22 +533,22 @@ ue", Helvetica, Arial, sans-serif;
533
533
  display: "block",
534
534
  left: `${s.style.position === "fixed" ? a.x - window.scrollX : a.x}px`,
535
535
  top: `${s.style.position === "fixed" ? a.y - window.scrollY : a.y}px`
536
- }), Z(s), requestAnimationFrame(() => se(s, a, { topOffset: 15, centered: !0 }))) : (ie(s), Object.assign(s.style, { display: "none" }));
536
+ }), Y(s), requestAnimationFrame(() => se(s, a, { topOffset: 15, centered: !0 }))) : (ie(s), Object.assign(s.style, { display: "none" }));
537
537
  }, "renderMenu");
538
538
  m.subscribe(j), w.subscribe(j);
539
- let ae = /* @__PURE__ */ d((s) => {
539
+ let pe = /* @__PURE__ */ d((s) => {
540
540
  let o = oe(s);
541
541
  l.set((n) => {
542
542
  let a = o.id ? n.filter((i) => i.id !== o.id) : n;
543
543
  return o.selectors?.length ? [...a, o] : a;
544
544
  });
545
- }, "addHighlight"), F = /* @__PURE__ */ d((s) => {
545
+ }, "addHighlight"), N = /* @__PURE__ */ d((s) => {
546
546
  s && l.set((o) => o.filter((n) => n.id !== s));
547
547
  }, "removeHighlight"), q = /* @__PURE__ */ d(() => {
548
548
  l.set([]), c.set(/* @__PURE__ */ new Map()), r.set([]), p.set(void 0), u.set(void 0), m.set([]), f.set([]), E.set(void 0), w.set(void 0);
549
- }, "resetState"), W, pe = /* @__PURE__ */ d((s, o) => {
549
+ }, "resetState"), W, ue = /* @__PURE__ */ d((s, o) => {
550
550
  let n = "scrollIntoView-highlight";
551
- clearTimeout(W), F(n);
551
+ clearTimeout(W), N(n);
552
552
  let a = e.querySelector(s);
553
553
  if (!a) {
554
554
  console.warn(`Cannot scroll into view: ${s} not found`);
@@ -576,15 +576,15 @@ ue", Helvetica, Arial, sans-serif;
576
576
  100% { outline: 2px solid #1EA7FD00; }
577
577
  }`
578
578
  }
579
- ]), W = setTimeout(() => F(n), 3500);
580
- }, "scrollIntoView"), ue = /* @__PURE__ */ d((s) => {
579
+ ]), W = setTimeout(() => N(n), 3500);
580
+ }, "scrollIntoView"), me = /* @__PURE__ */ d((s) => {
581
581
  requestAnimationFrame(() => u.set({ x: s.pageX, y: s.pageY }));
582
582
  }, "onMouseMove");
583
- e.body.addEventListener("mousemove", ue), t.on(J, ae), t.on(Q, F), t.on(ee, q), t.on(te, pe), t.on(ce.STORY_RENDER_PHASE_CHANGED, ({ newPhase: s }) => {
583
+ e.body.addEventListener("mousemove", me), t.on(J, pe), t.on(Q, N), t.on(ee, q), t.on(te, ue), t.on(ce.STORY_RENDER_PHASE_CHANGED, ({ newPhase: s }) => {
584
584
  s === "loading" && q();
585
585
  });
586
586
  }, "useHighlights");
587
587
 
588
588
  // src/highlight/preview.ts
589
- globalThis?.FEATURES?.highlight && B.addons?.ready && B.addons.ready().then(de);
590
- var ve = /* @__PURE__ */ d(() => (0, B.definePreview)({}), "default");
589
+ globalThis?.FEATURES?.highlight && Z.addons?.ready && Z.addons.ready().then(de);
590
+ var He = /* @__PURE__ */ d(() => (0, ae.definePreviewAddon)({}), "default");