@storybook/addon-docs 11.0.0-beta.0 → 11.0.0-beta.2

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/blocks.js CHANGED
@@ -13,13 +13,78 @@ import {
13
13
  curriedTransparentize$1,
14
14
  rgba
15
15
  } from "./_browser-chunks/chunk-ONSQRTMU.js";
16
- import "./_browser-chunks/chunk-UAWMPV5J.js";
16
+ import {
17
+ __commonJS,
18
+ __toESM
19
+ } from "./_browser-chunks/chunk-UAWMPV5J.js";
20
+
21
+ // ../../../node_modules/@ngard/tiny-isequal/index.js
22
+ var require_tiny_isequal = __commonJS({
23
+ "../../../node_modules/@ngard/tiny-isequal/index.js"(exports) {
24
+ Object.defineProperty(exports, "__esModule", { value: !0 }), exports.isEqual = /* @__PURE__ */ (function() {
25
+ var e2 = Object.prototype.toString, r2 = Object.getPrototypeOf, t = Object.getOwnPropertySymbols ? function(e3) {
26
+ return Object.keys(e3).concat(Object.getOwnPropertySymbols(e3));
27
+ } : Object.keys;
28
+ return function(n2, a2) {
29
+ return (function n3(a3, c2, u2) {
30
+ var i2, s2, l2, o2 = e2.call(a3), f2 = e2.call(c2);
31
+ if (a3 === c2) return !0;
32
+ if (a3 == null || c2 == null) return !1;
33
+ if (u2.indexOf(a3) > -1 && u2.indexOf(c2) > -1) return !0;
34
+ if (u2.push(a3, c2), o2 != f2 || (i2 = t(a3), s2 = t(c2), i2.length != s2.length || i2.some(function(e3) {
35
+ return !n3(a3[e3], c2[e3], u2);
36
+ }))) return !1;
37
+ switch (o2.slice(8, -1)) {
38
+ case "Symbol":
39
+ return a3.valueOf() == c2.valueOf();
40
+ case "Date":
41
+ case "Number":
42
+ return +a3 == +c2 || +a3 != +a3 && +c2 != +c2;
43
+ case "RegExp":
44
+ case "Function":
45
+ case "String":
46
+ case "Boolean":
47
+ return "" + a3 == "" + c2;
48
+ case "Set":
49
+ case "Map":
50
+ i2 = a3.entries(), s2 = c2.entries();
51
+ do
52
+ if (!n3((l2 = i2.next()).value, s2.next().value, u2)) return !1;
53
+ while (!l2.done);
54
+ return !0;
55
+ case "ArrayBuffer":
56
+ a3 = new Uint8Array(a3), c2 = new Uint8Array(c2);
57
+ case "DataView":
58
+ a3 = new Uint8Array(a3.buffer), c2 = new Uint8Array(c2.buffer);
59
+ case "Float32Array":
60
+ case "Float64Array":
61
+ case "Int8Array":
62
+ case "Int16Array":
63
+ case "Int32Array":
64
+ case "Uint8Array":
65
+ case "Uint16Array":
66
+ case "Uint32Array":
67
+ case "Uint8ClampedArray":
68
+ case "Arguments":
69
+ case "Array":
70
+ if (a3.length != c2.length) return !1;
71
+ for (l2 = 0; l2 < a3.length; l2++) if ((l2 in a3 || l2 in c2) && (l2 in a3 != l2 in c2 || !n3(a3[l2], c2[l2], u2))) return !1;
72
+ return !0;
73
+ case "Object":
74
+ return n3(r2(a3), r2(c2), u2);
75
+ default:
76
+ return !1;
77
+ }
78
+ })(n2, a2, []);
79
+ };
80
+ })();
81
+ }
82
+ });
17
83
 
18
84
  // src/blocks/components/ArgsTable/ArgsTable.tsx
19
85
  import React23, { useCallback as useCallback6, useEffect as useEffect8, useRef as useRef5, useState as useState10 } from "react";
20
86
  import { once } from "storybook/internal/client-logger";
21
87
  import { Button as Button5, Link as Link3, ResetWrapper } from "storybook/internal/components";
22
- import { includeConditionalArg } from "storybook/internal/csf";
23
88
  import { DocumentIcon as DocumentIcon2, UndoIcon } from "@storybook/icons";
24
89
 
25
90
  // ../../../node_modules/es-toolkit/dist/predicate/isPrimitive.mjs
@@ -183,6 +248,30 @@ var CASE_SPLIT_PATTERN = new RegExp("\\p{Lu}?\\p{Ll}+|[0-9]+|\\p{Lu}+(?!\\p{Ll})
183
248
  // src/blocks/components/ArgsTable/ArgsTable.tsx
184
249
  import { styled as styled18 } from "storybook/theming/emotion";
185
250
 
251
+ // ../../core/src/csf/includeConditionalArg.ts
252
+ var import_tiny_isequal = __toESM(require_tiny_isequal(), 1), count = (vals) => vals.map((v2) => typeof v2 < "u").filter(Boolean).length, testValue = (cond, value) => {
253
+ let { exists, eq: eq2, neq, truthy } = cond;
254
+ if (count([exists, eq2, neq, truthy]) > 1)
255
+ throw new Error(`Invalid conditional test ${JSON.stringify({ exists, eq: eq2, neq })}`);
256
+ if (typeof eq2 < "u")
257
+ return (0, import_tiny_isequal.isEqual)(value, eq2);
258
+ if (typeof neq < "u")
259
+ return !(0, import_tiny_isequal.isEqual)(value, neq);
260
+ if (typeof exists < "u") {
261
+ let valueExists = typeof value < "u";
262
+ return exists ? valueExists : !valueExists;
263
+ }
264
+ return (typeof truthy > "u" ? !0 : truthy) ? !!value : !value;
265
+ }, includeConditionalArg = (argType, args, globals) => {
266
+ if (!argType.if)
267
+ return !0;
268
+ let { arg, global: global2 } = argType.if;
269
+ if (count([arg, global2]) !== 1)
270
+ throw new Error(`Invalid conditional value ${JSON.stringify({ arg, global: global2 })}`);
271
+ let value = arg ? args[arg] : globals[global2];
272
+ return testValue(argType.if, value);
273
+ };
274
+
186
275
  // src/blocks/components/ArgsTable/ArgRow.tsx
187
276
  import React19 from "react";
188
277
  import { codeCommon as codeCommon3 } from "storybook/internal/components";
@@ -5685,12 +5774,12 @@ var LegacyArgTypes = (props) => {
5685
5774
  }, ArgTypesImpl = (props) => globalThis.FEATURES?.docgenServer ? React37.createElement(DocgenServiceArgTypes, { ...props }) : React37.createElement(LegacyArgTypes, { ...props }), ArgTypes = withMdxComponentOverride("ArgTypes", ArgTypesImpl);
5686
5775
 
5687
5776
  // src/blocks/blocks/Canvas.tsx
5688
- import React40, { useCallback as useCallback10, useContext as useContext6 } from "react";
5777
+ import React40, { useCallback as useCallback11, useContext as useContext6 } from "react";
5689
5778
  import { FORCE_REMOUNT } from "storybook/internal/core-events";
5690
5779
  import { InvalidBlockOfPropError as InvalidBlockOfPropError4 } from "storybook/internal/preview-errors";
5691
5780
 
5692
5781
  // src/blocks/blocks/Source.tsx
5693
- import React39, { useContext as useContext5, useMemo as useMemo4 } from "react";
5782
+ import React39, { useContext as useContext5, useMemo as useMemo5 } from "react";
5694
5783
  import { SourceType } from "storybook/internal/docs-tools";
5695
5784
  import { InvalidBlockOfPropError as InvalidBlockOfPropError3 } from "storybook/internal/preview-errors";
5696
5785
 
@@ -5699,14 +5788,14 @@ import React38, { createContext as createContext3, useEffect as useEffect13, use
5699
5788
  import { SNIPPET_RENDERED } from "storybook/internal/docs-tools";
5700
5789
 
5701
5790
  // ../../../node_modules/telejson/dist/chunk-EAFQLD22.mjs
5702
- var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __commonJS = (cb, mod) => function() {
5791
+ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __commonJS2 = (cb, mod) => function() {
5703
5792
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
5704
5793
  }, __copyProps = (to, from, except, desc) => {
5705
5794
  if (from && typeof from == "object" || typeof from == "function")
5706
5795
  for (let key of __getOwnPropNames(from))
5707
5796
  !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
5708
5797
  return to;
5709
- }, __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
5798
+ }, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
5710
5799
  // If the importer is in node compatibility mode or this is not an ESM
5711
5800
  // file that has been converted to a CommonJS file using a Babel-
5712
5801
  // compatible transform (i.e. "__esModule" has not been set), then set
@@ -5739,84 +5828,84 @@ function extractEventHiddenProperties(event) {
5739
5828
  }
5740
5829
 
5741
5830
  // ../../../node_modules/telejson/dist/index.mjs
5742
- var require_es_object_atoms = __commonJS({
5831
+ var require_es_object_atoms = __commonJS2({
5743
5832
  "node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js"(exports, module) {
5744
5833
  "use strict";
5745
5834
  module.exports = Object;
5746
5835
  }
5747
- }), require_es_errors = __commonJS({
5836
+ }), require_es_errors = __commonJS2({
5748
5837
  "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js"(exports, module) {
5749
5838
  "use strict";
5750
5839
  module.exports = Error;
5751
5840
  }
5752
- }), require_eval = __commonJS({
5841
+ }), require_eval = __commonJS2({
5753
5842
  "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js"(exports, module) {
5754
5843
  "use strict";
5755
5844
  module.exports = EvalError;
5756
5845
  }
5757
- }), require_range = __commonJS({
5846
+ }), require_range = __commonJS2({
5758
5847
  "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js"(exports, module) {
5759
5848
  "use strict";
5760
5849
  module.exports = RangeError;
5761
5850
  }
5762
- }), require_ref = __commonJS({
5851
+ }), require_ref = __commonJS2({
5763
5852
  "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js"(exports, module) {
5764
5853
  "use strict";
5765
5854
  module.exports = ReferenceError;
5766
5855
  }
5767
- }), require_syntax = __commonJS({
5856
+ }), require_syntax = __commonJS2({
5768
5857
  "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js"(exports, module) {
5769
5858
  "use strict";
5770
5859
  module.exports = SyntaxError;
5771
5860
  }
5772
- }), require_type = __commonJS({
5861
+ }), require_type = __commonJS2({
5773
5862
  "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js"(exports, module) {
5774
5863
  "use strict";
5775
5864
  module.exports = TypeError;
5776
5865
  }
5777
- }), require_uri = __commonJS({
5866
+ }), require_uri = __commonJS2({
5778
5867
  "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js"(exports, module) {
5779
5868
  "use strict";
5780
5869
  module.exports = URIError;
5781
5870
  }
5782
- }), require_abs = __commonJS({
5871
+ }), require_abs = __commonJS2({
5783
5872
  "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js"(exports, module) {
5784
5873
  "use strict";
5785
5874
  module.exports = Math.abs;
5786
5875
  }
5787
- }), require_floor = __commonJS({
5876
+ }), require_floor = __commonJS2({
5788
5877
  "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js"(exports, module) {
5789
5878
  "use strict";
5790
5879
  module.exports = Math.floor;
5791
5880
  }
5792
- }), require_max = __commonJS({
5881
+ }), require_max = __commonJS2({
5793
5882
  "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js"(exports, module) {
5794
5883
  "use strict";
5795
5884
  module.exports = Math.max;
5796
5885
  }
5797
- }), require_min = __commonJS({
5886
+ }), require_min = __commonJS2({
5798
5887
  "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js"(exports, module) {
5799
5888
  "use strict";
5800
5889
  module.exports = Math.min;
5801
5890
  }
5802
- }), require_pow = __commonJS({
5891
+ }), require_pow = __commonJS2({
5803
5892
  "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js"(exports, module) {
5804
5893
  "use strict";
5805
5894
  module.exports = Math.pow;
5806
5895
  }
5807
- }), require_round = __commonJS({
5896
+ }), require_round = __commonJS2({
5808
5897
  "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js"(exports, module) {
5809
5898
  "use strict";
5810
5899
  module.exports = Math.round;
5811
5900
  }
5812
- }), require_isNaN = __commonJS({
5901
+ }), require_isNaN = __commonJS2({
5813
5902
  "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js"(exports, module) {
5814
5903
  "use strict";
5815
5904
  module.exports = Number.isNaN || function(a2) {
5816
5905
  return a2 !== a2;
5817
5906
  };
5818
5907
  }
5819
- }), require_sign = __commonJS({
5908
+ }), require_sign = __commonJS2({
5820
5909
  "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js"(exports, module) {
5821
5910
  "use strict";
5822
5911
  var $isNaN = require_isNaN();
@@ -5824,12 +5913,12 @@ var require_es_object_atoms = __commonJS({
5824
5913
  return $isNaN(number) || number === 0 ? number : number < 0 ? -1 : 1;
5825
5914
  };
5826
5915
  }
5827
- }), require_gOPD = __commonJS({
5916
+ }), require_gOPD = __commonJS2({
5828
5917
  "node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js"(exports, module) {
5829
5918
  "use strict";
5830
5919
  module.exports = Object.getOwnPropertyDescriptor;
5831
5920
  }
5832
- }), require_gopd = __commonJS({
5921
+ }), require_gopd = __commonJS2({
5833
5922
  "node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js"(exports, module) {
5834
5923
  "use strict";
5835
5924
  var $gOPD = require_gOPD();
@@ -5841,7 +5930,7 @@ var require_es_object_atoms = __commonJS({
5841
5930
  }
5842
5931
  module.exports = $gOPD;
5843
5932
  }
5844
- }), require_es_define_property = __commonJS({
5933
+ }), require_es_define_property = __commonJS2({
5845
5934
  "node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js"(exports, module) {
5846
5935
  "use strict";
5847
5936
  var $defineProperty = Object.defineProperty || !1;
@@ -5853,7 +5942,7 @@ var require_es_object_atoms = __commonJS({
5853
5942
  }
5854
5943
  module.exports = $defineProperty;
5855
5944
  }
5856
- }), require_shams = __commonJS({
5945
+ }), require_shams = __commonJS2({
5857
5946
  "node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js"(exports, module) {
5858
5947
  "use strict";
5859
5948
  module.exports = function() {
@@ -5884,7 +5973,7 @@ var require_es_object_atoms = __commonJS({
5884
5973
  return !0;
5885
5974
  };
5886
5975
  }
5887
- }), require_has_symbols = __commonJS({
5976
+ }), require_has_symbols = __commonJS2({
5888
5977
  "node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js"(exports, module) {
5889
5978
  "use strict";
5890
5979
  var origSymbol = typeof Symbol < "u" && Symbol, hasSymbolSham = require_shams();
@@ -5892,18 +5981,18 @@ var require_es_object_atoms = __commonJS({
5892
5981
  return typeof origSymbol != "function" || typeof Symbol != "function" || typeof origSymbol("foo") != "symbol" || typeof /* @__PURE__ */ Symbol("bar") != "symbol" ? !1 : hasSymbolSham();
5893
5982
  };
5894
5983
  }
5895
- }), require_Reflect_getPrototypeOf = __commonJS({
5984
+ }), require_Reflect_getPrototypeOf = __commonJS2({
5896
5985
  "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js"(exports, module) {
5897
5986
  "use strict";
5898
5987
  module.exports = typeof Reflect < "u" && Reflect.getPrototypeOf || null;
5899
5988
  }
5900
- }), require_Object_getPrototypeOf = __commonJS({
5989
+ }), require_Object_getPrototypeOf = __commonJS2({
5901
5990
  "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js"(exports, module) {
5902
5991
  "use strict";
5903
5992
  var $Object = require_es_object_atoms();
5904
5993
  module.exports = $Object.getPrototypeOf || null;
5905
5994
  }
5906
- }), require_implementation = __commonJS({
5995
+ }), require_implementation = __commonJS2({
5907
5996
  "node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js"(exports, module) {
5908
5997
  "use strict";
5909
5998
  var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ", toStr = Object.prototype.toString, max = Math.max, funcType = "[object Function]", concatty = function(a2, b2) {
@@ -5947,34 +6036,34 @@ var require_es_object_atoms = __commonJS({
5947
6036
  return bound;
5948
6037
  };
5949
6038
  }
5950
- }), require_function_bind = __commonJS({
6039
+ }), require_function_bind = __commonJS2({
5951
6040
  "node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js"(exports, module) {
5952
6041
  "use strict";
5953
6042
  var implementation = require_implementation();
5954
6043
  module.exports = Function.prototype.bind || implementation;
5955
6044
  }
5956
- }), require_functionCall = __commonJS({
6045
+ }), require_functionCall = __commonJS2({
5957
6046
  "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js"(exports, module) {
5958
6047
  "use strict";
5959
6048
  module.exports = Function.prototype.call;
5960
6049
  }
5961
- }), require_functionApply = __commonJS({
6050
+ }), require_functionApply = __commonJS2({
5962
6051
  "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js"(exports, module) {
5963
6052
  "use strict";
5964
6053
  module.exports = Function.prototype.apply;
5965
6054
  }
5966
- }), require_reflectApply = __commonJS({
6055
+ }), require_reflectApply = __commonJS2({
5967
6056
  "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js"(exports, module) {
5968
6057
  "use strict";
5969
6058
  module.exports = typeof Reflect < "u" && Reflect && Reflect.apply;
5970
6059
  }
5971
- }), require_actualApply = __commonJS({
6060
+ }), require_actualApply = __commonJS2({
5972
6061
  "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js"(exports, module) {
5973
6062
  "use strict";
5974
6063
  var bind = require_function_bind(), $apply = require_functionApply(), $call = require_functionCall(), $reflectApply = require_reflectApply();
5975
6064
  module.exports = $reflectApply || bind.call($call, $apply);
5976
6065
  }
5977
- }), require_call_bind_apply_helpers = __commonJS({
6066
+ }), require_call_bind_apply_helpers = __commonJS2({
5978
6067
  "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js"(exports, module) {
5979
6068
  "use strict";
5980
6069
  var bind = require_function_bind(), $TypeError = require_type(), $call = require_functionCall(), $actualApply = require_actualApply();
@@ -5984,7 +6073,7 @@ var require_es_object_atoms = __commonJS({
5984
6073
  return $actualApply(bind, $call, args);
5985
6074
  };
5986
6075
  }
5987
- }), require_get = __commonJS({
6076
+ }), require_get = __commonJS2({
5988
6077
  "node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js"(exports, module) {
5989
6078
  "use strict";
5990
6079
  var callBind = require_call_bind_apply_helpers(), gOPD = require_gopd(), hasProtoAccessor;
@@ -6007,7 +6096,7 @@ var require_es_object_atoms = __commonJS({
6007
6096
  })
6008
6097
  ) : !1;
6009
6098
  }
6010
- }), require_get_proto = __commonJS({
6099
+ }), require_get_proto = __commonJS2({
6011
6100
  "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js"(exports, module) {
6012
6101
  "use strict";
6013
6102
  var reflectGetProto = require_Reflect_getPrototypeOf(), originalGetProto = require_Object_getPrototypeOf(), getDunderProto = require_get();
@@ -6021,13 +6110,13 @@ var require_es_object_atoms = __commonJS({
6021
6110
  return getDunderProto(O2);
6022
6111
  } : null;
6023
6112
  }
6024
- }), require_hasown = __commonJS({
6113
+ }), require_hasown = __commonJS2({
6025
6114
  "node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js"(exports, module) {
6026
6115
  "use strict";
6027
6116
  var call = Function.prototype.call, $hasOwn = Object.prototype.hasOwnProperty, bind = require_function_bind();
6028
6117
  module.exports = bind.call(call, $hasOwn);
6029
6118
  }
6030
- }), require_get_intrinsic = __commonJS({
6119
+ }), require_get_intrinsic = __commonJS2({
6031
6120
  "node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js"(exports, module) {
6032
6121
  "use strict";
6033
6122
  var undefined2, $Object = require_es_object_atoms(), $Error = require_es_errors(), $EvalError = require_eval(), $RangeError = require_range(), $ReferenceError = require_ref(), $SyntaxError = require_syntax(), $TypeError = require_type(), $URIError = require_uri(), abs = require_abs(), floor = require_floor(), max = require_max(), min = require_min(), pow = require_pow(), round = require_round(), sign = require_sign(), $Function = Function, getEvalledConstructor = function(expressionSyntax) {
@@ -6262,7 +6351,7 @@ var require_es_object_atoms = __commonJS({
6262
6351
  return value;
6263
6352
  };
6264
6353
  }
6265
- }), require_call_bound = __commonJS({
6354
+ }), require_call_bound = __commonJS2({
6266
6355
  "node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.js"(exports, module) {
6267
6356
  "use strict";
6268
6357
  var GetIntrinsic = require_get_intrinsic(), callBindBasic = require_call_bind_apply_helpers(), $indexOf = callBindBasic([GetIntrinsic("%String.prototype.indexOf%")]);
@@ -6277,7 +6366,7 @@ var require_es_object_atoms = __commonJS({
6277
6366
  ) : intrinsic;
6278
6367
  };
6279
6368
  }
6280
- }), require_shams2 = __commonJS({
6369
+ }), require_shams2 = __commonJS2({
6281
6370
  "node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js"(exports, module) {
6282
6371
  "use strict";
6283
6372
  var hasSymbols = require_shams();
@@ -6285,7 +6374,7 @@ var require_es_object_atoms = __commonJS({
6285
6374
  return hasSymbols() && !!Symbol.toStringTag;
6286
6375
  };
6287
6376
  }
6288
- }), require_is_regex = __commonJS({
6377
+ }), require_is_regex = __commonJS2({
6289
6378
  "node_modules/.pnpm/is-regex@1.2.1/node_modules/is-regex/index.js"(exports, module) {
6290
6379
  "use strict";
6291
6380
  var callBound = require_call_bound(), hasToStringTag = require_shams2()(), hasOwn = require_hasown(), gOPD = require_gopd(), fn;
@@ -6323,7 +6412,7 @@ var require_es_object_atoms = __commonJS({
6323
6412
  var $exec, isRegexMarker, throwRegexMarker, badStringifier, $toString, regexClass;
6324
6413
  module.exports = fn;
6325
6414
  }
6326
- }), require_is_function = __commonJS({
6415
+ }), require_is_function = __commonJS2({
6327
6416
  "node_modules/.pnpm/is-function@1.0.2/node_modules/is-function/index.js"(exports, module) {
6328
6417
  module.exports = isFunction3;
6329
6418
  var toString2 = Object.prototype.toString;
@@ -6335,7 +6424,7 @@ var require_es_object_atoms = __commonJS({
6335
6424
  (fn === window.setTimeout || fn === window.alert || fn === window.confirm || fn === window.prompt);
6336
6425
  }
6337
6426
  }
6338
- }), require_safe_regex_test = __commonJS({
6427
+ }), require_safe_regex_test = __commonJS2({
6339
6428
  "node_modules/.pnpm/safe-regex-test@1.1.0/node_modules/safe-regex-test/index.js"(exports, module) {
6340
6429
  "use strict";
6341
6430
  var callBound = require_call_bound(), isRegex = require_is_regex(), $exec = callBound("RegExp.prototype.exec"), $TypeError = require_type();
@@ -6347,7 +6436,7 @@ var require_es_object_atoms = __commonJS({
6347
6436
  };
6348
6437
  };
6349
6438
  }
6350
- }), require_is_symbol = __commonJS({
6439
+ }), require_is_symbol = __commonJS2({
6351
6440
  "node_modules/.pnpm/is-symbol@1.1.1/node_modules/is-symbol/index.js"(exports, module) {
6352
6441
  "use strict";
6353
6442
  var callBound = require_call_bound(), $toString = callBound("Object.prototype.toString"), hasSymbols = require_has_symbols()(), safeRegexTest = require_safe_regex_test();
@@ -6368,7 +6457,7 @@ var require_es_object_atoms = __commonJS({
6368
6457
  };
6369
6458
  var $symToStr, isSymString, isSymbolObject;
6370
6459
  }
6371
- }), import_is_regex = __toESM(require_is_regex()), import_is_function = __toESM(require_is_function()), import_is_symbol = __toESM(require_is_symbol());
6460
+ }), import_is_regex = __toESM2(require_is_regex()), import_is_function = __toESM2(require_is_function()), import_is_symbol = __toESM2(require_is_symbol());
6372
6461
  function isObject(val) {
6373
6462
  return val != null && typeof val == "object" && Array.isArray(val) === !1;
6374
6463
  }
@@ -6752,16 +6841,46 @@ var SourceContext = createContext3({ sources: {} }), UNKNOWN_ARGS_HASH = "--unkn
6752
6841
  }, []), React38.createElement(SourceContext.Provider, { value: { sources } }, children);
6753
6842
  };
6754
6843
 
6844
+ // src/blocks/blocks/useArgs.ts
6845
+ import { useCallback as useCallback9, useEffect as useEffect14, useState as useState16 } from "react";
6846
+ import {
6847
+ RESET_STORY_ARGS,
6848
+ STORY_ARGS_UPDATED,
6849
+ UPDATE_STORY_ARGS
6850
+ } from "storybook/internal/core-events";
6851
+ var useArgs = (story, context) => {
6852
+ let result = useArgsIfDefined(story, context);
6853
+ if (!result)
6854
+ throw new Error("No result when story was defined");
6855
+ return result;
6856
+ }, useArgsIfDefined = (story, context) => {
6857
+ let storyContext = story ? context.getStoryContext(story) : { args: {} }, { id: storyId } = story || { id: "none" }, [args, setArgs] = useState16(storyContext.args);
6858
+ useEffect14(() => {
6859
+ let onArgsUpdated = (changed) => {
6860
+ changed.storyId === storyId && setArgs(changed.args);
6861
+ };
6862
+ return context.channel.on(STORY_ARGS_UPDATED, onArgsUpdated), () => context.channel.off(STORY_ARGS_UPDATED, onArgsUpdated);
6863
+ }, [storyId, context.channel]);
6864
+ let updateArgs = useCallback9(
6865
+ (updatedArgs) => context.channel.emit(UPDATE_STORY_ARGS, { storyId, updatedArgs }),
6866
+ [storyId, context.channel]
6867
+ ), resetArgs = useCallback9(
6868
+ (argNames) => context.channel.emit(RESET_STORY_ARGS, { storyId, argNames }),
6869
+ [storyId, context.channel]
6870
+ );
6871
+ return story && [args, updateArgs, resetArgs];
6872
+ };
6873
+
6755
6874
  // src/blocks/blocks/use-service-story-docs.ts
6756
- import { useCallback as useCallback9 } from "react";
6875
+ import { useCallback as useCallback10, useMemo as useMemo4 } from "react";
6757
6876
  import {
6758
- selectSnippetForStory,
6759
- selectStoryDoc,
6760
- selectWarningForStory
6877
+ getPrintHole,
6878
+ selectLiveSnippetForStory,
6879
+ selectStoryDoc
6761
6880
  } from "storybook/open-service";
6762
6881
  import { getService as getService2 } from "storybook/preview-api";
6763
6882
  function useServiceStory(storyId, selector) {
6764
- let componentId = storyId.split("--")[0], service = getService2("core/story-docs", { internal: !0 }), boundSelector = useCallback9(
6883
+ let componentId = storyId.split("--")[0], service = getService2("core/story-docs", { internal: !0 }), boundSelector = useCallback10(
6765
6884
  (payload) => selector(payload, storyId),
6766
6885
  [selector, storyId]
6767
6886
  );
@@ -6775,18 +6894,23 @@ function useServiceStory(storyId, selector) {
6775
6894
  function useServiceStoryDoc(storyId) {
6776
6895
  return useServiceStory(storyId, selectStoryDoc);
6777
6896
  }
6778
- function useServiceStorySnippet(storyId) {
6779
- return useServiceStory(storyId, selectSnippetForStory);
6897
+ function useServiceStoryLiveSnippet(story, args) {
6898
+ let state = useServiceStory(story.id, selectStoryPayload), printHole = getPrintHole(story.parameters), data = useMemo4(
6899
+ () => selectLiveSnippetForStory(state.data, story.id, args, printHole),
6900
+ [state.data, story.id, args, printHole]
6901
+ );
6902
+ return useMemo4(() => ({ ...state, data }), [state, data]);
6780
6903
  }
6781
- function useServiceStoryWarning(storyId) {
6782
- return useServiceStory(storyId, selectWarningForStory);
6904
+ function selectStoryPayload(payload, storyId) {
6905
+ let story = payload?.stories[storyId];
6906
+ return payload && { ...payload, stories: story ? { [storyId]: { ...story } } : {} };
6783
6907
  }
6784
6908
 
6785
6909
  // src/blocks/blocks/useTransformCode.tsx
6786
- import { useEffect as useEffect14, useState as useState16 } from "react";
6910
+ import { useEffect as useEffect15, useState as useState17 } from "react";
6787
6911
  function useTransformCode(source, transform, storyContext) {
6788
- let [transformedCode, setTransformedCode] = useState16("Transforming..."), transformed = transform ? transform?.(source, storyContext) : source;
6789
- return useEffect14(() => {
6912
+ let [transformedCode, setTransformedCode] = useState17("Transforming..."), transformed = transform ? transform?.(source, storyContext) : source;
6913
+ return useEffect15(() => {
6790
6914
  async function getTransformedCode() {
6791
6915
  let transformResult = await transformed;
6792
6916
  transformResult !== transformedCode && setTransformedCode(transformResult);
@@ -6810,7 +6934,7 @@ var EMPTY_SOURCE_CONTEXT = { sources: {} }, getStorySource = (storyId, args, sou
6810
6934
  type === SourceType.AUTO && staticSnippet && isArgsStory ? serviceSnippet ? "service" : "emitted" : "original", code = sourceKind === "service" ? serviceSnippet : sourceKind === "emitted" ? snippet : sourceParameters.originalSource || "", hasTransformer = !!(transformFromProps ?? sourceParameters.transform), activeTransformer = transformFromProps ?? (sourceKind === "emitted" ? (rawCode) => rawCode : sourceParameters.transform), transformedCode = hasTransformer ? useTransformCode(code, activeTransformer, storyContext) : code;
6811
6935
  return sourceParameters.code !== void 0 ? sourceParameters.code : transformedCode;
6812
6936
  }, useSourceProps = (props, docsContext, sourceContext, serviceSnippet = "", serviceWarning) => {
6813
- let { of } = props, story = useMemo4(() => {
6937
+ let { of } = props, story = useMemo5(() => {
6814
6938
  if (of)
6815
6939
  return docsContext.resolveOf(of, ["story"]).story;
6816
6940
  try {
@@ -6845,8 +6969,15 @@ var EMPTY_SOURCE_CONTEXT = { sources: {} }, getStorySource = (storyId, args, sou
6845
6969
  dark,
6846
6970
  warning
6847
6971
  };
6848
- }, SourceWithStoryDocsSnippet = ({ storyId, docsContext, sourceContext, ...props }) => {
6849
- let serviceSnippet = useServiceStorySnippet(storyId).data ?? "", serviceWarning = useServiceStoryWarning(storyId).data, sourceProps = useSourceProps(
6972
+ }, SourceWithStoryDocsSnippet = ({ story, docsContext, sourceContext, ...props }) => {
6973
+ let [argsUpdate] = useArgs(story, docsContext), args = useMemo5(
6974
+ () => {
6975
+ let { unmappedArgs, initialArgs } = docsContext.getStoryContext(story);
6976
+ return { unmappedArgs: props.__forceInitialArgs ? initialArgs : unmappedArgs, initialArgs };
6977
+ },
6978
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- `argsUpdate` is the trigger
6979
+ [argsUpdate, story, docsContext, props.__forceInitialArgs]
6980
+ ), { data } = useServiceStoryLiveSnippet(story, args), serviceSnippet = data?.snippet ?? "", serviceWarning = data?.warning, sourceProps = useSourceProps(
6850
6981
  props,
6851
6982
  docsContext,
6852
6983
  sourceContext,
@@ -6855,7 +6986,7 @@ var EMPTY_SOURCE_CONTEXT = { sources: {} }, getStorySource = (storyId, args, sou
6855
6986
  );
6856
6987
  return React39.createElement(Source, { ...sourceProps });
6857
6988
  }, SourceWithStorySnippet = (props) => {
6858
- let { of } = props, sourceContext = useContext5(SourceContext), docsContext = useContext5(DocsContext), story = useMemo4(() => {
6989
+ let { of } = props, sourceContext = useContext5(SourceContext), docsContext = useContext5(DocsContext), story = useMemo5(() => {
6859
6990
  if (of)
6860
6991
  return docsContext.resolveOf(of, ["story"]).story;
6861
6992
  try {
@@ -6870,7 +7001,7 @@ var EMPTY_SOURCE_CONTEXT = { sources: {} }, getStorySource = (storyId, args, sou
6870
7001
  ...props,
6871
7002
  docsContext,
6872
7003
  sourceContext,
6873
- storyId: story.id
7004
+ story
6874
7005
  }
6875
7006
  );
6876
7007
  let sourceProps = useSourceProps(props, docsContext, sourceContext);
@@ -6885,7 +7016,7 @@ var CanvasImpl = (props) => {
6885
7016
  let docsContext = useContext6(DocsContext), sourceContext = useContext6(SourceContext), { of, source } = props;
6886
7017
  if ("of" in props && of === void 0)
6887
7018
  throw new InvalidBlockOfPropError4();
6888
- let { story } = useOf(of || "story", ["story"]), sourceProps = useSourceProps({ ...source, ...of && { of } }, docsContext, sourceContext), layout = props.layout ?? story.parameters.layout ?? story.parameters.docs?.canvas?.layout ?? "padded", withToolbar = props.withToolbar ?? story.parameters.docs?.canvas?.withToolbar ?? !1, additionalActions = props.additionalActions ?? story.parameters.docs?.canvas?.additionalActions, sourceState = props.sourceState ?? story.parameters.docs?.canvas?.sourceState ?? "hidden", className = props.className ?? story.parameters.docs?.canvas?.className, inline = props.story?.inline ?? story.parameters?.docs?.story?.inline ?? !1, handleReloadStory = useCallback10(() => {
7019
+ let { story } = useOf(of || "story", ["story"]), sourceProps = useSourceProps({ ...source, ...of && { of } }, docsContext, sourceContext), layout = props.layout ?? story.parameters.layout ?? story.parameters.docs?.canvas?.layout ?? "padded", withToolbar = props.withToolbar ?? story.parameters.docs?.canvas?.withToolbar ?? !1, additionalActions = props.additionalActions ?? story.parameters.docs?.canvas?.additionalActions, sourceState = props.sourceState ?? story.parameters.docs?.canvas?.sourceState ?? "hidden", className = props.className ?? story.parameters.docs?.canvas?.className, inline = props.story?.inline ?? story.parameters?.docs?.story?.inline ?? !1, handleReloadStory = useCallback11(() => {
6889
7020
  docsContext.channel.emit(FORCE_REMOUNT, { storyId: story.id });
6890
7021
  }, [docsContext.channel, story.id]);
6891
7022
  return React40.createElement(
@@ -6908,36 +7039,6 @@ var CanvasImpl = (props) => {
6908
7039
  import React41, { useContext as useContext8 } from "react";
6909
7040
  import { filterArgTypes as filterArgTypes2 } from "storybook/preview-api";
6910
7041
 
6911
- // src/blocks/blocks/useArgs.ts
6912
- import { useCallback as useCallback11, useEffect as useEffect15, useState as useState17 } from "react";
6913
- import {
6914
- RESET_STORY_ARGS,
6915
- STORY_ARGS_UPDATED,
6916
- UPDATE_STORY_ARGS
6917
- } from "storybook/internal/core-events";
6918
- var useArgs = (story, context) => {
6919
- let result = useArgsIfDefined(story, context);
6920
- if (!result)
6921
- throw new Error("No result when story was defined");
6922
- return result;
6923
- }, useArgsIfDefined = (story, context) => {
6924
- let storyContext = story ? context.getStoryContext(story) : { args: {} }, { id: storyId } = story || { id: "none" }, [args, setArgs] = useState17(storyContext.args);
6925
- useEffect15(() => {
6926
- let onArgsUpdated = (changed) => {
6927
- changed.storyId === storyId && setArgs(changed.args);
6928
- };
6929
- return context.channel.on(STORY_ARGS_UPDATED, onArgsUpdated), () => context.channel.off(STORY_ARGS_UPDATED, onArgsUpdated);
6930
- }, [storyId, context.channel]);
6931
- let updateArgs = useCallback11(
6932
- (updatedArgs) => context.channel.emit(UPDATE_STORY_ARGS, { storyId, updatedArgs }),
6933
- [storyId, context.channel]
6934
- ), resetArgs = useCallback11(
6935
- (argNames) => context.channel.emit(RESET_STORY_ARGS, { storyId, argNames }),
6936
- [storyId, context.channel]
6937
- );
6938
- return story && [args, updateArgs, resetArgs];
6939
- };
6940
-
6941
7042
  // src/blocks/blocks/useGlobals.ts
6942
7043
  import { useEffect as useEffect16, useState as useState18 } from "react";
6943
7044
  import { GLOBALS_UPDATED } from "storybook/internal/core-events";
@@ -7077,7 +7178,40 @@ import { InvalidBlockOfPropError as InvalidBlockOfPropError5 } from "storybook/i
7077
7178
 
7078
7179
  // src/blocks/blocks/Markdown.tsx
7079
7180
  import React43 from "react";
7080
- import { dedent } from "ts-dedent";
7181
+
7182
+ // ../../../node_modules/ts-dedent/esm/index.js
7183
+ function dedent(templ) {
7184
+ for (var values = [], _i = 1; _i < arguments.length; _i++)
7185
+ values[_i - 1] = arguments[_i];
7186
+ var strings = Array.from(typeof templ == "string" ? [templ] : templ);
7187
+ strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, "");
7188
+ var indentLengths = strings.reduce(function(arr, str) {
7189
+ var matches = str.match(/\n([\t ]+|(?!\s).)/g);
7190
+ return matches ? arr.concat(matches.map(function(match) {
7191
+ var _a, _b;
7192
+ return (_b = (_a = match.match(/[\t ]/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
7193
+ })) : arr;
7194
+ }, []);
7195
+ if (indentLengths.length) {
7196
+ var pattern_1 = new RegExp(`
7197
+ [ ]{` + Math.min.apply(Math, indentLengths) + "}", "g");
7198
+ strings = strings.map(function(str) {
7199
+ return str.replace(pattern_1, `
7200
+ `);
7201
+ });
7202
+ }
7203
+ strings[0] = strings[0].replace(/^\r?\n/, "");
7204
+ var string = strings[0];
7205
+ return values.forEach(function(value, i2) {
7206
+ var endentations = string.match(/(?:^|\n)( *)$/), endentation = endentations ? endentations[1] : "", indentedValue = value;
7207
+ typeof value == "string" && value.includes(`
7208
+ `) && (indentedValue = String(value).split(`
7209
+ `).map(function(str, i3) {
7210
+ return i3 === 0 ? str : "" + endentation + str;
7211
+ }).join(`
7212
+ `)), string += indentedValue + strings[i2 + 1];
7213
+ }), string;
7214
+ }
7081
7215
 
7082
7216
  // src/blocks/blocks/mdx.tsx
7083
7217
  import React42, { useContext as useContext9 } from "react";
@@ -7340,7 +7474,7 @@ var DescriptionType = /* @__PURE__ */ ((DescriptionType2) => (DescriptionType2.I
7340
7474
  import React54 from "react";
7341
7475
 
7342
7476
  // src/blocks/blocks/DocsContainer.tsx
7343
- import React45, { useEffect as useEffect17, useMemo as useMemo5 } from "react";
7477
+ import React45, { useEffect as useEffect17, useMemo as useMemo6 } from "react";
7344
7478
  import { ensure as ensureTheme, ThemeProvider } from "storybook/theming/emotion";
7345
7479
 
7346
7480
  // src/blocks/blocks/DocsSluggerContext.ts
@@ -7401,7 +7535,7 @@ var { document: document3, window: globalWindow3 } = globalThis, DocsContainer =
7401
7535
  theme,
7402
7536
  children
7403
7537
  }) => {
7404
- let slugger = useMemo5(() => createDocsSlugger(), []), toc, lang;
7538
+ let slugger = useMemo6(() => createDocsSlugger(), []), toc, lang;
7405
7539
  try {
7406
7540
  let metaParameters = context.resolveOf("meta", ["meta"]).preparedMeta.parameters;
7407
7541
  toc = metaParameters?.docs?.toc, lang = metaParameters?.docs?.lang || "en";