storybook 10.2.0-alpha.9 → 10.2.0-beta.0

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 (97) hide show
  1. package/dist/_browser-chunks/{Color-E5XDEOX4.js → Color-XESOIGZP.js} +57 -3
  2. package/dist/_browser-chunks/chunk-AFVOZMXQ.js +23 -0
  3. package/dist/_browser-chunks/{chunk-3PJE6VLG.js → chunk-ASKQZAOS.js} +1 -12
  4. package/dist/_browser-chunks/chunk-IYCKG66Y.js +171 -0
  5. package/dist/_browser-chunks/chunk-LCHBOIHN.js +64 -0
  6. package/dist/_browser-chunks/{chunk-IPA5A322.js → chunk-MEXTPDJG.js} +1 -1
  7. package/dist/_browser-chunks/{chunk-54PNNATT.js → chunk-NQJGOFZV.js} +18 -1
  8. package/dist/_browser-chunks/{chunk-VUZYLZ4B.js → chunk-QOXZ7W26.js} +31 -15
  9. package/dist/_browser-chunks/{chunk-LOTN4ZCW.js → chunk-SI6AKD4S.js} +2 -2
  10. package/dist/_browser-chunks/chunk-YK43Z22A.js +263 -0
  11. package/dist/_node-chunks/{builder-manager-FTCODGJP.js → builder-manager-JEJE63VV.js} +15 -12
  12. package/dist/_node-chunks/camelcase-HALRJETF.js +62 -0
  13. package/dist/_node-chunks/{chunk-3Y5VHKPI.js → chunk-3SKE4CCB.js} +9 -9
  14. package/dist/_node-chunks/chunk-4UYAC7Y2.js +18 -0
  15. package/dist/_node-chunks/{chunk-NYUFS6LX.js → chunk-6UAQEBJX.js} +10 -10
  16. package/dist/_node-chunks/{chunk-SPOUBCPJ.js → chunk-72K4WVI5.js} +18 -14
  17. package/dist/_node-chunks/{chunk-FGI35IGB.js → chunk-7ZX5CX6B.js} +15 -69
  18. package/dist/_node-chunks/{chunk-6SH5SI6S.js → chunk-ADTWC7QJ.js} +7 -7
  19. package/dist/_node-chunks/{chunk-OUDQWDHY.js → chunk-APUXGW3Y.js} +7 -7
  20. package/dist/_node-chunks/{chunk-PZCWRKQE.js → chunk-AXDM43NU.js} +6 -6
  21. package/dist/_node-chunks/{chunk-73GYSTNZ.js → chunk-B422K4XV.js} +6 -6
  22. package/dist/_node-chunks/{chunk-WTQGSYRO.js → chunk-BJOXVTWM.js} +12 -571
  23. package/dist/_node-chunks/{chunk-LRBEW57O.js → chunk-BLGRU6F5.js} +7 -7
  24. package/dist/_node-chunks/{chunk-6ABJZZWS.js → chunk-CG47ALAV.js} +7 -7
  25. package/dist/_node-chunks/chunk-FH4FRUMP.js +23 -0
  26. package/dist/_node-chunks/{chunk-RF3L36MK.js → chunk-GBZ23FIZ.js} +125 -73
  27. package/dist/_node-chunks/{chunk-MWWAQ5S4.js → chunk-IZ3ATSWZ.js} +5262 -1480
  28. package/dist/_node-chunks/{chunk-SBPB3VWI.js → chunk-IZFEBWVB.js} +6 -6
  29. package/dist/_node-chunks/{chunk-33XC4R6P.js → chunk-KL5CKFPT.js} +9 -9
  30. package/dist/_node-chunks/{chunk-D4TCQXIF.js → chunk-MLXCYULR.js} +7 -7
  31. package/dist/_node-chunks/{chunk-LB74XOLW.js → chunk-MV2QM7P3.js} +6 -6
  32. package/dist/_node-chunks/chunk-PHX5XNP7.js +144 -0
  33. package/dist/_node-chunks/{chunk-XZ6V3G6J.js → chunk-QL6L57W7.js} +533 -143
  34. package/dist/_node-chunks/{chunk-IIBBQZLT.js → chunk-RPBXVPRB.js} +6 -6
  35. package/dist/_node-chunks/{chunk-BQX766MA.js → chunk-UH2GWMFP.js} +260 -162
  36. package/dist/_node-chunks/chunk-WNGL2VRJ.js +126 -0
  37. package/dist/_node-chunks/{chunk-CO7N5AG7.js → chunk-XAL452XB.js} +36 -14
  38. package/dist/_node-chunks/{chunk-YN6FEZAF.js → chunk-YVXXMWQO.js} +7 -7
  39. package/dist/_node-chunks/chunk-YYDL7JOC.js +61 -0
  40. package/dist/_node-chunks/{chunk-3DPKKQ6P.js → chunk-Z7FLE2TR.js} +6 -6
  41. package/dist/_node-chunks/{globby-AXGFF6I5.js → globby-4D4NBVG7.js} +11 -20
  42. package/dist/_node-chunks/{lib-ESB7KQ6D.js → lib-RM2DWHZQ.js} +7 -7
  43. package/dist/_node-chunks/{mdx-N42X6CFJ-XXQ6YIDF.js → mdx-N42X6CFJ-RAL72UTP.js} +8 -8
  44. package/dist/_node-chunks/{p-limit-P6ND7SUA.js → p-limit-6PUJQL5X.js} +18 -14
  45. package/dist/babel/index.js +10 -10
  46. package/dist/bin/core.js +12 -12
  47. package/dist/bin/dispatcher.js +11 -11
  48. package/dist/bin/loader.js +9 -9
  49. package/dist/cli/index.d.ts +1504 -424
  50. package/dist/cli/index.js +18 -18
  51. package/dist/common/index.d.ts +1319 -271
  52. package/dist/common/index.js +19 -19
  53. package/dist/components/index.d.ts +4 -1
  54. package/dist/components/index.js +228 -227
  55. package/dist/core-events/index.d.ts +23 -7
  56. package/dist/core-events/index.js +5 -1
  57. package/dist/core-server/index.d.ts +105 -3
  58. package/dist/core-server/index.js +992 -613
  59. package/dist/core-server/presets/common-manager.js +208 -160
  60. package/dist/core-server/presets/common-override-preset.js +11 -11
  61. package/dist/core-server/presets/common-preset.js +558 -4534
  62. package/dist/csf/index.d.ts +147 -15
  63. package/dist/csf/index.js +52 -23
  64. package/dist/csf-tools/index.d.ts +19 -1
  65. package/dist/csf-tools/index.js +11 -9
  66. package/dist/docs-tools/index.d.ts +2 -2
  67. package/dist/docs-tools/index.js +4 -5
  68. package/dist/manager/globals-runtime.js +2749 -6907
  69. package/dist/manager/runtime.js +2939 -2295
  70. package/dist/manager-api/index.d.ts +89 -21
  71. package/dist/manager-api/index.js +82 -23
  72. package/dist/mocking-utils/index.js +8 -8
  73. package/dist/node-logger/index.d.ts +1453 -108
  74. package/dist/node-logger/index.js +9 -9
  75. package/dist/preview/runtime.js +784 -5059
  76. package/dist/preview-api/index.d.ts +26 -1
  77. package/dist/preview-api/index.js +11 -8
  78. package/dist/router/index.js +5 -4
  79. package/dist/server-errors.js +11 -11
  80. package/dist/telemetry/index.d.ts +14 -2
  81. package/dist/telemetry/index.js +23 -22
  82. package/dist/theming/index.d.ts +5 -5
  83. package/dist/theming/index.js +21 -2
  84. package/dist/types/index.d.ts +21 -9
  85. package/dist/viewport/index.d.ts +5 -3
  86. package/dist/viewport/index.js +12 -3
  87. package/package.json +27 -26
  88. package/dist/_browser-chunks/chunk-2NDLAB5X.js +0 -363
  89. package/dist/_browser-chunks/chunk-CLSHX4VX.js +0 -4140
  90. package/dist/_browser-chunks/chunk-HPYUT3WS.js +0 -199
  91. package/dist/_browser-chunks/chunk-XCZK5QUJ.js +0 -0
  92. package/dist/_node-chunks/camelcase-5XDKQT3J.js +0 -37
  93. package/dist/_node-chunks/chunk-GXQRT5M6.js +0 -61
  94. package/dist/_node-chunks/chunk-MOQRBTWA.js +0 -70
  95. package/dist/_node-chunks/chunk-PRNP2HO6.js +0 -23
  96. package/dist/_node-chunks/chunk-VKMYOVNS.js +0 -18
  97. package/dist/_node-chunks/dist-YRSVYE5A.js +0 -121
@@ -4,9 +4,6 @@ import {
4
4
  import {
5
5
  require_color_convert
6
6
  } from "./chunk-VIJ7SQRO.js";
7
- import {
8
- debounce
9
- } from "./chunk-HPYUT3WS.js";
10
7
  import "./chunk-NZMVUW5T.js";
11
8
  import {
12
9
  __toESM
@@ -18,6 +15,63 @@ import React, { useCallback, useEffect, useMemo, useState } from "react";
18
15
  import { Button, Form, PopoverProvider } from "storybook/internal/components";
19
16
  import { MarkupIcon } from "@storybook/icons";
20
17
 
18
+ // ../../node_modules/es-toolkit/dist/function/debounce.mjs
19
+ function debounce(func, debounceMs, { signal, edges } = {}) {
20
+ let pendingThis, pendingArgs = null, leading = edges != null && edges.includes("leading"), trailing = edges == null || edges.includes("trailing"), invoke = () => {
21
+ pendingArgs !== null && (func.apply(pendingThis, pendingArgs), pendingThis = void 0, pendingArgs = null);
22
+ }, onTimerEnd = () => {
23
+ trailing && invoke(), cancel();
24
+ }, timeoutId = null, schedule = () => {
25
+ timeoutId != null && clearTimeout(timeoutId), timeoutId = setTimeout(() => {
26
+ timeoutId = null, onTimerEnd();
27
+ }, debounceMs);
28
+ }, cancelTimer = () => {
29
+ timeoutId !== null && (clearTimeout(timeoutId), timeoutId = null);
30
+ }, cancel = () => {
31
+ cancelTimer(), pendingThis = void 0, pendingArgs = null;
32
+ }, flush = () => {
33
+ invoke();
34
+ }, debounced = function(...args) {
35
+ if (signal?.aborted)
36
+ return;
37
+ pendingThis = this, pendingArgs = args;
38
+ let isFirstCall = timeoutId == null;
39
+ schedule(), leading && isFirstCall && invoke();
40
+ };
41
+ return debounced.schedule = schedule, debounced.cancel = cancel, debounced.flush = flush, signal?.addEventListener("abort", cancel, { once: !0 }), debounced;
42
+ }
43
+
44
+ // ../../node_modules/es-toolkit/dist/function/partial.mjs
45
+ function partial(func, ...partialArgs) {
46
+ return partialImpl(func, placeholderSymbol, ...partialArgs);
47
+ }
48
+ function partialImpl(func, placeholder, ...partialArgs) {
49
+ let partialed = function(...providedArgs) {
50
+ let providedArgsIndex = 0, substitutedArgs = partialArgs.slice().map((arg) => arg === placeholder ? providedArgs[providedArgsIndex++] : arg), remainingArgs = providedArgs.slice(providedArgsIndex);
51
+ return func.apply(this, substitutedArgs.concat(remainingArgs));
52
+ };
53
+ return func.prototype && (partialed.prototype = Object.create(func.prototype)), partialed;
54
+ }
55
+ var placeholderSymbol = Symbol("partial.placeholder");
56
+ partial.placeholder = placeholderSymbol;
57
+
58
+ // ../../node_modules/es-toolkit/dist/function/partialRight.mjs
59
+ function partialRight(func, ...partialArgs) {
60
+ return partialRightImpl(func, placeholderSymbol2, ...partialArgs);
61
+ }
62
+ function partialRightImpl(func, placeholder, ...partialArgs) {
63
+ let partialedRight = function(...providedArgs) {
64
+ let placeholderLength = partialArgs.filter((arg) => arg === placeholder).length, rangeLength = Math.max(providedArgs.length - placeholderLength, 0), remainingArgs = providedArgs.slice(0, rangeLength), providedArgsIndex = rangeLength, substitutedArgs = partialArgs.slice().map((arg) => arg === placeholder ? providedArgs[providedArgsIndex++] : arg);
65
+ return func.apply(this, remainingArgs.concat(substitutedArgs));
66
+ };
67
+ return func.prototype && (partialedRight.prototype = Object.create(func.prototype)), partialedRight;
68
+ }
69
+ var placeholderSymbol2 = Symbol("partialRight.placeholder");
70
+ partialRight.placeholder = placeholderSymbol2;
71
+
72
+ // ../../node_modules/es-toolkit/dist/function/retry.mjs
73
+ var DEFAULT_RETRIES = Number.POSITIVE_INFINITY;
74
+
21
75
  // ../../node_modules/react-colorful/dist/index.mjs
22
76
  import e, { useRef as r, useMemo as t, useEffect as n, useState as o, useCallback as a, useLayoutEffect as l } from "react";
23
77
  function u() {
@@ -0,0 +1,23 @@
1
+ // src/shared/constants/tags.ts
2
+ var Tag = {
3
+ /** Indicates that autodocs should be generated for this component */
4
+ AUTODOCS: "autodocs",
5
+ /** MDX documentation attached to a component's stories file */
6
+ ATTACHED_MDX: "attached-mdx",
7
+ /** Standalone MDX documentation not attached to stories */
8
+ UNATTACHED_MDX: "unattached-mdx",
9
+ /** Story has a play function */
10
+ PLAY_FN: "play-fn",
11
+ /** Story has a test function */
12
+ TEST_FN: "test-fn",
13
+ /** Development environment tag */
14
+ DEV: "dev",
15
+ /** Test environment tag */
16
+ TEST: "test",
17
+ /** Manifest generation tag */
18
+ MANIFEST: "manifest"
19
+ };
20
+
21
+ export {
22
+ Tag
23
+ };
@@ -259,19 +259,8 @@ var INITIAL_VIEWPORTS = {
259
259
  }
260
260
  };
261
261
 
262
- // src/viewport/responsiveViewport.tsx
263
- var responsiveViewport = {
264
- name: "Reset viewport",
265
- styles: {
266
- height: "100%",
267
- width: "100%"
268
- },
269
- type: "desktop"
270
- };
271
-
272
262
  export {
273
263
  INITIAL_VIEWPORTS,
274
264
  DEFAULT_VIEWPORT,
275
- MINIMAL_VIEWPORTS,
276
- responsiveViewport
265
+ MINIMAL_VIEWPORTS
277
266
  };
@@ -0,0 +1,171 @@
1
+ import {
2
+ noop
3
+ } from "./chunk-NZMVUW5T.js";
4
+ import {
5
+ argumentsTag,
6
+ arrayBufferTag,
7
+ arrayTag,
8
+ bigInt64ArrayTag,
9
+ bigUint64ArrayTag,
10
+ booleanTag,
11
+ dataViewTag,
12
+ dateTag,
13
+ errorTag,
14
+ float32ArrayTag,
15
+ float64ArrayTag,
16
+ functionTag,
17
+ getSymbols,
18
+ getTag,
19
+ int16ArrayTag,
20
+ int32ArrayTag,
21
+ int8ArrayTag,
22
+ isPlainObject,
23
+ mapTag,
24
+ numberTag,
25
+ objectTag,
26
+ regexpTag,
27
+ setTag,
28
+ stringTag,
29
+ symbolTag,
30
+ uint16ArrayTag,
31
+ uint32ArrayTag,
32
+ uint8ArrayTag,
33
+ uint8ClampedArrayTag
34
+ } from "./chunk-LCHBOIHN.js";
35
+
36
+ // ../../node_modules/es-toolkit/dist/compat/util/eq.mjs
37
+ function eq(value, other) {
38
+ return value === other || Number.isNaN(value) && Number.isNaN(other);
39
+ }
40
+
41
+ // ../../node_modules/es-toolkit/dist/predicate/isEqualWith.mjs
42
+ function isEqualWith(a, b, areValuesEqual) {
43
+ return isEqualWithImpl(a, b, void 0, void 0, void 0, void 0, areValuesEqual);
44
+ }
45
+ function isEqualWithImpl(a, b, property, aParent, bParent, stack, areValuesEqual) {
46
+ let result = areValuesEqual(a, b, property, aParent, bParent, stack);
47
+ if (result !== void 0)
48
+ return result;
49
+ if (typeof a == typeof b)
50
+ switch (typeof a) {
51
+ case "bigint":
52
+ case "string":
53
+ case "boolean":
54
+ case "symbol":
55
+ case "undefined":
56
+ return a === b;
57
+ case "number":
58
+ return a === b || Object.is(a, b);
59
+ case "function":
60
+ return a === b;
61
+ case "object":
62
+ return areObjectsEqual(a, b, stack, areValuesEqual);
63
+ }
64
+ return areObjectsEqual(a, b, stack, areValuesEqual);
65
+ }
66
+ function areObjectsEqual(a, b, stack, areValuesEqual) {
67
+ if (Object.is(a, b))
68
+ return !0;
69
+ let aTag = getTag(a), bTag = getTag(b);
70
+ if (aTag === argumentsTag && (aTag = objectTag), bTag === argumentsTag && (bTag = objectTag), aTag !== bTag)
71
+ return !1;
72
+ switch (aTag) {
73
+ case stringTag:
74
+ return a.toString() === b.toString();
75
+ case numberTag: {
76
+ let x = a.valueOf(), y = b.valueOf();
77
+ return eq(x, y);
78
+ }
79
+ case booleanTag:
80
+ case dateTag:
81
+ case symbolTag:
82
+ return Object.is(a.valueOf(), b.valueOf());
83
+ case regexpTag:
84
+ return a.source === b.source && a.flags === b.flags;
85
+ case functionTag:
86
+ return a === b;
87
+ }
88
+ stack = stack ?? /* @__PURE__ */ new Map();
89
+ let aStack = stack.get(a), bStack = stack.get(b);
90
+ if (aStack != null && bStack != null)
91
+ return aStack === b;
92
+ stack.set(a, b), stack.set(b, a);
93
+ try {
94
+ switch (aTag) {
95
+ case mapTag: {
96
+ if (a.size !== b.size)
97
+ return !1;
98
+ for (let [key, value] of a.entries())
99
+ if (!b.has(key) || !isEqualWithImpl(value, b.get(key), key, a, b, stack, areValuesEqual))
100
+ return !1;
101
+ return !0;
102
+ }
103
+ case setTag: {
104
+ if (a.size !== b.size)
105
+ return !1;
106
+ let aValues = Array.from(a.values()), bValues = Array.from(b.values());
107
+ for (let i = 0; i < aValues.length; i++) {
108
+ let aValue = aValues[i], index = bValues.findIndex((bValue) => isEqualWithImpl(aValue, bValue, void 0, a, b, stack, areValuesEqual));
109
+ if (index === -1)
110
+ return !1;
111
+ bValues.splice(index, 1);
112
+ }
113
+ return !0;
114
+ }
115
+ case arrayTag:
116
+ case uint8ArrayTag:
117
+ case uint8ClampedArrayTag:
118
+ case uint16ArrayTag:
119
+ case uint32ArrayTag:
120
+ case bigUint64ArrayTag:
121
+ case int8ArrayTag:
122
+ case int16ArrayTag:
123
+ case int32ArrayTag:
124
+ case bigInt64ArrayTag:
125
+ case float32ArrayTag:
126
+ case float64ArrayTag: {
127
+ if (typeof Buffer < "u" && Buffer.isBuffer(a) !== Buffer.isBuffer(b) || a.length !== b.length)
128
+ return !1;
129
+ for (let i = 0; i < a.length; i++)
130
+ if (!isEqualWithImpl(a[i], b[i], i, a, b, stack, areValuesEqual))
131
+ return !1;
132
+ return !0;
133
+ }
134
+ case arrayBufferTag:
135
+ return a.byteLength !== b.byteLength ? !1 : areObjectsEqual(new Uint8Array(a), new Uint8Array(b), stack, areValuesEqual);
136
+ case dataViewTag:
137
+ return a.byteLength !== b.byteLength || a.byteOffset !== b.byteOffset ? !1 : areObjectsEqual(new Uint8Array(a), new Uint8Array(b), stack, areValuesEqual);
138
+ case errorTag:
139
+ return a.name === b.name && a.message === b.message;
140
+ case objectTag: {
141
+ if (!(areObjectsEqual(a.constructor, b.constructor, stack, areValuesEqual) || isPlainObject(a) && isPlainObject(b)))
142
+ return !1;
143
+ let aKeys = [...Object.keys(a), ...getSymbols(a)], bKeys = [...Object.keys(b), ...getSymbols(b)];
144
+ if (aKeys.length !== bKeys.length)
145
+ return !1;
146
+ for (let i = 0; i < aKeys.length; i++) {
147
+ let propKey = aKeys[i], aProp = a[propKey];
148
+ if (!Object.hasOwn(b, propKey))
149
+ return !1;
150
+ let bProp = b[propKey];
151
+ if (!isEqualWithImpl(aProp, bProp, propKey, a, b, stack, areValuesEqual))
152
+ return !1;
153
+ }
154
+ return !0;
155
+ }
156
+ default:
157
+ return !1;
158
+ }
159
+ } finally {
160
+ stack.delete(a), stack.delete(b);
161
+ }
162
+ }
163
+
164
+ // ../../node_modules/es-toolkit/dist/predicate/isEqual.mjs
165
+ function isEqual(a, b) {
166
+ return isEqualWith(a, b, noop);
167
+ }
168
+
169
+ export {
170
+ isEqual
171
+ };
@@ -0,0 +1,64 @@
1
+ // ../../node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
2
+ function isPlainObject(value) {
3
+ if (!value || typeof value != "object")
4
+ return !1;
5
+ let proto = Object.getPrototypeOf(value);
6
+ return proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null ? Object.prototype.toString.call(value) === "[object Object]" : !1;
7
+ }
8
+
9
+ // ../../node_modules/es-toolkit/dist/predicate/isPrimitive.mjs
10
+ function isPrimitive(value) {
11
+ return value == null || typeof value != "object" && typeof value != "function";
12
+ }
13
+
14
+ // ../../node_modules/es-toolkit/dist/predicate/isTypedArray.mjs
15
+ function isTypedArray(x) {
16
+ return ArrayBuffer.isView(x) && !(x instanceof DataView);
17
+ }
18
+
19
+ // ../../node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs
20
+ function getSymbols(object) {
21
+ return Object.getOwnPropertySymbols(object).filter((symbol) => Object.prototype.propertyIsEnumerable.call(object, symbol));
22
+ }
23
+
24
+ // ../../node_modules/es-toolkit/dist/compat/_internal/getTag.mjs
25
+ function getTag(value) {
26
+ return value == null ? value === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(value);
27
+ }
28
+
29
+ // ../../node_modules/es-toolkit/dist/compat/_internal/tags.mjs
30
+ var regexpTag = "[object RegExp]", stringTag = "[object String]", numberTag = "[object Number]", booleanTag = "[object Boolean]", argumentsTag = "[object Arguments]", symbolTag = "[object Symbol]", dateTag = "[object Date]", mapTag = "[object Map]", setTag = "[object Set]", arrayTag = "[object Array]", functionTag = "[object Function]", arrayBufferTag = "[object ArrayBuffer]", objectTag = "[object Object]", errorTag = "[object Error]", dataViewTag = "[object DataView]", uint8ArrayTag = "[object Uint8Array]", uint8ClampedArrayTag = "[object Uint8ClampedArray]", uint16ArrayTag = "[object Uint16Array]", uint32ArrayTag = "[object Uint32Array]", bigUint64ArrayTag = "[object BigUint64Array]", int8ArrayTag = "[object Int8Array]", int16ArrayTag = "[object Int16Array]", int32ArrayTag = "[object Int32Array]", bigInt64ArrayTag = "[object BigInt64Array]", float32ArrayTag = "[object Float32Array]", float64ArrayTag = "[object Float64Array]";
31
+
32
+ export {
33
+ isPrimitive,
34
+ isTypedArray,
35
+ getSymbols,
36
+ getTag,
37
+ regexpTag,
38
+ stringTag,
39
+ numberTag,
40
+ booleanTag,
41
+ argumentsTag,
42
+ symbolTag,
43
+ dateTag,
44
+ mapTag,
45
+ setTag,
46
+ arrayTag,
47
+ functionTag,
48
+ arrayBufferTag,
49
+ objectTag,
50
+ errorTag,
51
+ dataViewTag,
52
+ uint8ArrayTag,
53
+ uint8ClampedArrayTag,
54
+ uint16ArrayTag,
55
+ uint32ArrayTag,
56
+ bigUint64ArrayTag,
57
+ int8ArrayTag,
58
+ int16ArrayTag,
59
+ int32ArrayTag,
60
+ bigInt64ArrayTag,
61
+ float32ArrayTag,
62
+ float64ArrayTag,
63
+ isPlainObject
64
+ };
@@ -40,7 +40,7 @@ async function waitForAnimations(signal) {
40
40
  if (timedOut || signal?.aborted)
41
41
  return;
42
42
  let runningAnimations = animationRoots.flatMap((el) => el?.getAnimations?.() || []).filter((a) => a.playState === "running" && !isInfiniteAnimation(a));
43
- runningAnimations.length > 0 && (await Promise.all(runningAnimations.map((a) => a.finished)), await checkAnimationsFinished());
43
+ runningAnimations.length > 0 && (await Promise.allSettled(runningAnimations.map(async (a) => a.finished)), await checkAnimationsFinished());
44
44
  };
45
45
  checkAnimationsFinished().then(resolve);
46
46
  }, 100);
@@ -62,7 +62,24 @@ function partition(arr, isInTruthy) {
62
62
  return [truthy, falsy];
63
63
  }
64
64
 
65
+ // ../../node_modules/es-toolkit/dist/array/countBy.mjs
66
+ function countBy(arr, mapper) {
67
+ let result = {};
68
+ for (let i = 0; i < arr.length; i++) {
69
+ let item = arr[i], key = mapper(item);
70
+ result[key] = (result[key] ?? 0) + 1;
71
+ }
72
+ return result;
73
+ }
74
+
75
+ // ../../node_modules/es-toolkit/dist/array/uniq.mjs
76
+ function uniq(arr) {
77
+ return [...new Set(arr)];
78
+ }
79
+
65
80
  export {
66
81
  dequal,
67
- partition
82
+ countBy,
83
+ partition,
84
+ uniq
68
85
  };
@@ -2,14 +2,20 @@ import {
2
2
  isTestEnvironment,
3
3
  pauseAnimations,
4
4
  waitForAnimations
5
- } from "./chunk-IPA5A322.js";
5
+ } from "./chunk-MEXTPDJG.js";
6
+ import {
7
+ Tag
8
+ } from "./chunk-AFVOZMXQ.js";
6
9
  import {
7
10
  require_main
8
11
  } from "./chunk-XLJZ7AOP.js";
9
12
  import {
10
13
  SNIPPET_RENDERED,
11
14
  combineParameters
12
- } from "./chunk-LOTN4ZCW.js";
15
+ } from "./chunk-SI6AKD4S.js";
16
+ import {
17
+ isEqual
18
+ } from "./chunk-IYCKG66Y.js";
13
19
  import {
14
20
  invariant
15
21
  } from "./chunk-IWQGIXJS.js";
@@ -19,11 +25,10 @@ import {
19
25
  import {
20
26
  mapValues,
21
27
  pickBy
22
- } from "./chunk-CLSHX4VX.js";
28
+ } from "./chunk-YK43Z22A.js";
23
29
  import {
24
- isEqual,
25
30
  isPlainObject
26
- } from "./chunk-2NDLAB5X.js";
31
+ } from "./chunk-LCHBOIHN.js";
27
32
  import {
28
33
  require_memoizerific
29
34
  } from "./chunk-ZCFV7BZB.js";
@@ -657,14 +662,26 @@ function mountDestructured(playFunction) {
657
662
  return playFunction != null && getUsedProps(playFunction).includes("mount");
658
663
  }
659
664
  function getUsedProps(fn) {
660
- let match = fn.toString().match(/[^(]*\(([^)]*)/);
661
- if (!match)
665
+ let [, args, body] = fn.toString().match(/[^(]*\(([^)]+)\)(?:.*{([^]+)})?/) || [];
666
+ if (!args)
662
667
  return [];
663
- let args = splitByComma(match[1]);
664
- if (!args.length)
668
+ let [firstArg] = splitByComma(args);
669
+ if (!firstArg)
665
670
  return [];
666
- let first = args[0];
667
- return first.startsWith("{") && first.endsWith("}") ? splitByComma(first.slice(1, -1).replace(/\s/g, "")).map((prop) => prop.replace(/:.*|=.*/g, "")) : [];
671
+ let [, destructuredProps] = firstArg.match(/^{([^]+)}$/) || [];
672
+ if (destructuredProps)
673
+ return splitByComma(stripComments(destructuredProps)).map(
674
+ (prop) => prop.replace(/:.*|=.*/g, "").trim()
675
+ );
676
+ if (!firstArg.match(/^[a-z_$][0-9a-z_$]*$/i))
677
+ return [];
678
+ let escapedArg = firstArg.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), [, destructuredArg] = body?.trim()?.match(new RegExp(`^(?:const|let|var)\\s*{([^}]+)}\\s*=\\s*${escapedArg};`)) || [];
679
+ return destructuredArg ? splitByComma(stripComments(destructuredArg)).map(
680
+ (prop) => prop.replace(/:.*|=.*/g, "").trim()
681
+ ) : [];
682
+ }
683
+ function stripComments(s) {
684
+ return s = s.replace(/\/\/.*$/gm, ""), s = s.replace(/\/\*[\s\S]*?\*\//g, ""), s;
668
685
  }
669
686
  function splitByComma(s) {
670
687
  let result = [], stack = [], start = 0;
@@ -794,7 +811,7 @@ function prepareMeta(componentAnnotations, projectAnnotations, moduleExport) {
794
811
  };
795
812
  }
796
813
  function preparePartialAnnotations(storyAnnotations, componentAnnotations, projectAnnotations) {
797
- let defaultTags = ["dev", "test"], extraTags = globalThis2.DOCS_OPTIONS?.autodocs === !0 ? ["autodocs"] : [], overrideTags = storyAnnotations?.tags?.includes("test-fn") ? ["!autodocs"] : [], tags = combineTags(
814
+ let defaultTags = [Tag.DEV, Tag.TEST], extraTags = globalThis2.DOCS_OPTIONS?.autodocs === !0 ? [Tag.AUTODOCS] : [], overrideTags = storyAnnotations?.tags?.includes(Tag.TEST_FN) ? [`!${Tag.AUTODOCS}`] : [], tags = combineTags(
798
815
  ...defaultTags,
799
816
  ...extraTags,
800
817
  ...projectAnnotations.tags ?? [],
@@ -2406,9 +2423,8 @@ function focusInInput(event) {
2406
2423
  let target = event.composedPath && event.composedPath()[0] || event.target;
2407
2424
  return /input|textarea/i.test(target.tagName) || target.getAttribute("contenteditable") !== null;
2408
2425
  }
2409
- var ATTACHED_MDX_TAG = "attached-mdx", UNATTACHED_MDX_TAG = "unattached-mdx";
2410
2426
  function isMdxEntry({ tags }) {
2411
- return tags?.includes(UNATTACHED_MDX_TAG) || tags?.includes(ATTACHED_MDX_TAG);
2427
+ return tags?.includes(Tag.UNATTACHED_MDX) || tags?.includes(Tag.ATTACHED_MDX);
2412
2428
  }
2413
2429
  function isStoryRender(r) {
2414
2430
  return r.type === "story";
@@ -2586,7 +2602,7 @@ var PreviewWithSelection = class extends Preview {
2586
2602
  initialGlobals,
2587
2603
  storyGlobals: {},
2588
2604
  userGlobals: globals
2589
- }), isCsfDocsRender(render) || render.entry.tags?.includes(ATTACHED_MDX_TAG)) {
2605
+ }), isCsfDocsRender(render) || render.entry.tags?.includes(Tag.ATTACHED_MDX)) {
2590
2606
  if (!render.csfFiles)
2591
2607
  throw new MdxFileWithNoCsfReferencesError({ storyId });
2592
2608
  ({ parameters } = this.storyStoreValue.preparedMetaFromCSFFile({
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  mapValues
3
- } from "./chunk-CLSHX4VX.js";
3
+ } from "./chunk-YK43Z22A.js";
4
4
  import {
5
5
  isPlainObject
6
- } from "./chunk-2NDLAB5X.js";
6
+ } from "./chunk-LCHBOIHN.js";
7
7
  import {
8
8
  __commonJS,
9
9
  __toESM