storybook 10.1.0-alpha.12 → 10.1.0-alpha.14

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 (99) hide show
  1. package/dist/_browser-chunks/{chunk-74YHFU5B.js → chunk-2XZMBGTA.js} +1 -1
  2. package/dist/_browser-chunks/{chunk-EBHB6RPS.js → chunk-FQ7SLVLR.js} +6 -1
  3. package/dist/_browser-chunks/{chunk-X3DUQ5RA.js → chunk-GFY5R5EY.js} +1 -1
  4. package/dist/_browser-chunks/{chunk-WXP2XJ3O.js → chunk-P4F4UVXX.js} +1 -0
  5. package/dist/_browser-chunks/{chunk-BE2DAXKJ.js → chunk-SS2NHR7W.js} +4 -1
  6. package/dist/_browser-chunks/{syntaxhighlighter-WKBQ5RC7.js → syntaxhighlighter-IQDEPFLK.js} +1 -1
  7. package/dist/_node-chunks/{builder-manager-YUOHSIUB.js → builder-manager-FQ5J6V3U.js} +32 -22
  8. package/dist/_node-chunks/{chunk-B6JWY6PC.js → camelcase-VGUYV77Z.js} +8 -8
  9. package/dist/_node-chunks/{chunk-FZLRAH4N.js → chunk-2JR3QBT2.js} +7 -7
  10. package/dist/_node-chunks/chunk-3EBH66BB.js +23 -0
  11. package/dist/_node-chunks/{chunk-E5FJS66Z.js → chunk-4ZFHN3ZY.js} +6 -6
  12. package/dist/_node-chunks/{chunk-5HV3B5OP.js → chunk-63PL4NNE.js} +1104 -13
  13. package/dist/_node-chunks/{chunk-NAOYEL54.js → chunk-A4KENTXT.js} +7 -7
  14. package/dist/_node-chunks/{chunk-4FT2DHGE.js → chunk-ALIA3J6S.js} +44 -10
  15. package/dist/_node-chunks/{chunk-WFLWJO24.js → chunk-C2HKH2XQ.js} +5710 -2414
  16. package/dist/_node-chunks/{chunk-WA6KZQZ2.js → chunk-DQNBAQYT.js} +6 -6
  17. package/dist/_node-chunks/{chunk-JARUEMEP.js → chunk-F74UHHR6.js} +7 -7
  18. package/dist/_node-chunks/{chunk-WUXQMQCB.js → chunk-H5XWXVWR.js} +6 -6
  19. package/dist/_node-chunks/{chunk-OP3INKUD.js → chunk-JMP7YFX2.js} +6 -6
  20. package/dist/_node-chunks/{chunk-DWXTZT3D.js → chunk-JZR4DHG2.js} +19 -7
  21. package/dist/_node-chunks/{chunk-QCO2ZM7F.js → chunk-KEA7CVMZ.js} +122 -32
  22. package/dist/_node-chunks/{chunk-DUXPWBOK.js → chunk-KF3WTAEP.js} +7 -7
  23. package/dist/_node-chunks/{chunk-2D2IODUU.js → chunk-LPPM7L5D.js} +51 -71
  24. package/dist/_node-chunks/{chunk-2DMESZFJ.js → chunk-MJUDR7HQ.js} +7 -7
  25. package/dist/_node-chunks/chunk-NPB4THZQ.js +18 -0
  26. package/dist/_node-chunks/chunk-NZBK3DSJ.js +29 -0
  27. package/dist/_node-chunks/{chunk-5KLIDWFN.js → chunk-Q2QUNQK6.js} +7 -7
  28. package/dist/_node-chunks/{chunk-EZWWR7AR.js → chunk-TMCKISJR.js} +101 -118
  29. package/dist/_node-chunks/chunk-TWK7AR3U.js +6024 -0
  30. package/dist/_node-chunks/{chunk-CZ5GHJCC.js → chunk-V7CXWJXC.js} +7 -7
  31. package/dist/_node-chunks/chunk-W4F3T6CY.js +3781 -0
  32. package/dist/_node-chunks/{chunk-SEMIAAWG.js → chunk-WACDSFMO.js} +9 -9
  33. package/dist/_node-chunks/{chunk-A4APXFQ2.js → chunk-WVXZFQQU.js} +14 -8
  34. package/dist/_node-chunks/chunk-XBPE4PT7.js +78 -0
  35. package/dist/_node-chunks/chunk-YMM6BYF2.js +61 -0
  36. package/dist/_node-chunks/{chunk-XXPJ7XR3.js → chunk-ZGZKNZ5S.js} +6 -6
  37. package/dist/_node-chunks/{dist-DS2B5A3J.js → dist-DR3AP3RJ.js} +9 -9
  38. package/dist/_node-chunks/{globby-6THB7HVX.js → globby-D4FPSHY2.js} +9 -9
  39. package/dist/_node-chunks/{lib-5NKX4YGG.js → lib-ZEFOVNTK.js} +7 -7
  40. package/dist/_node-chunks/{mdx-N42X6CFJ-ZLT3QOFF.js → mdx-N42X6CFJ-PJF3ICCG.js} +8 -8
  41. package/dist/_node-chunks/{p-limit-PDMWNG7W.js → p-limit-CYQOFYPV.js} +7 -7
  42. package/dist/babel/index.js +10 -11
  43. package/dist/bin/core.js +33 -26
  44. package/dist/bin/dispatcher.js +31 -20
  45. package/dist/bin/loader.js +10 -13
  46. package/dist/cli/index.d.ts +1479 -133
  47. package/dist/cli/index.js +30 -5159
  48. package/dist/common/index.d.ts +139 -62
  49. package/dist/common/index.js +66 -51
  50. package/dist/components/index.d.ts +136 -26
  51. package/dist/components/index.js +3163 -2859
  52. package/dist/core-server/index.d.ts +3 -2
  53. package/dist/core-server/index.js +112 -1486
  54. package/dist/core-server/presets/common-manager.js +5 -5
  55. package/dist/core-server/presets/common-override-preset.js +9 -9
  56. package/dist/core-server/presets/common-preset.js +272 -81
  57. package/dist/csf/index.js +2 -2
  58. package/dist/csf-tools/index.js +9 -9
  59. package/dist/manager/globals-runtime.js +21557 -21133
  60. package/dist/manager/manager-stores.d.ts +1 -0
  61. package/dist/manager/manager-stores.js +23 -0
  62. package/dist/manager/runtime.js +6695 -720
  63. package/dist/manager-api/index.d.ts +1802 -1
  64. package/dist/manager-api/index.js +105 -11
  65. package/dist/manager-errors.d.ts +6 -0
  66. package/dist/manager-errors.js +2 -2
  67. package/dist/mocking-utils/index.d.ts +1126 -0
  68. package/dist/{_node-chunks/chunk-ZXSD6L3S.js → mocking-utils/index.js} +441 -16
  69. package/dist/node-logger/index.d.ts +192 -24
  70. package/dist/node-logger/index.js +23 -3148
  71. package/dist/preview/runtime.js +35 -3
  72. package/dist/preview-api/index.d.ts +69 -68
  73. package/dist/preview-api/index.js +2 -2
  74. package/dist/preview-errors.d.ts +6 -0
  75. package/dist/preview-errors.js +2 -2
  76. package/dist/server-errors.d.ts +31 -1
  77. package/dist/server-errors.js +17 -10
  78. package/dist/telemetry/index.d.ts +24 -3
  79. package/dist/telemetry/index.js +25 -24
  80. package/dist/types/index.d.ts +71 -8
  81. package/dist/types/index.js +25 -1
  82. package/package.json +11 -9
  83. package/dist/_node-chunks/camelcase-JREIL7NV.js +0 -18
  84. package/dist/_node-chunks/chunk-FDXFVHIL.js +0 -1114
  85. package/dist/_node-chunks/chunk-HZG65SU3.js +0 -34
  86. package/dist/_node-chunks/chunk-IXVYNBMD.js +0 -18
  87. package/dist/_node-chunks/chunk-LIH7MTP7.js +0 -3214
  88. package/dist/_node-chunks/chunk-N5GIRUP5.js +0 -1047
  89. package/dist/_node-chunks/chunk-O5DA7YLO.js +0 -3171
  90. package/dist/_node-chunks/chunk-QYQIZBS6.js +0 -26
  91. package/dist/_node-chunks/chunk-TS2UUH2J.js +0 -301
  92. package/dist/_node-chunks/chunk-Y4E6IGQF.js +0 -61
  93. package/dist/_node-chunks/chunk-ZL3AFKRX.js +0 -1029
  94. package/dist/_node-chunks/plugin-6XMWOGPO.js +0 -123
  95. package/dist/_node-chunks/plugin-LTOXVT6A.js +0 -109
  96. package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-2SFE5LQS.js +0 -46582
  97. package/dist/_node-chunks/webpack-mock-plugin-CX5J2U56.js +0 -92
  98. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +0 -32
  99. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +0 -28
@@ -5,13 +5,13 @@ import {
5
5
  } from "../_browser-chunks/chunk-UD6FQLAF.js";
6
6
  import {
7
7
  StatusTypeIdMismatchError
8
- } from "../_browser-chunks/chunk-X3DUQ5RA.js";
8
+ } from "../_browser-chunks/chunk-GFY5R5EY.js";
9
9
  import {
10
10
  StatusTypeIdMismatchError as StatusTypeIdMismatchError2
11
- } from "../_browser-chunks/chunk-74YHFU5B.js";
11
+ } from "../_browser-chunks/chunk-2XZMBGTA.js";
12
12
  import {
13
13
  StorybookError
14
- } from "../_browser-chunks/chunk-EBHB6RPS.js";
14
+ } from "../_browser-chunks/chunk-FQ7SLVLR.js";
15
15
  import {
16
16
  countBy,
17
17
  dequal,
@@ -885,12 +885,12 @@ var parseUrl = (url) => {
885
885
  updateRef: async (id, data) => {
886
886
  let { [id]: ref, ...updated } = api.getRefs();
887
887
  updated[id] = { ...ref, ...data };
888
- let ordered = Object.keys(initialState).reduce((obj, key) => (obj[key] = updated[key], obj), {});
888
+ let ordered = Object.keys(initialState2).reduce((obj, key) => (obj[key] = updated[key], obj), {});
889
889
  await store2.setState({
890
890
  refs: ordered
891
891
  });
892
892
  }
893
- }, refs = !singleStory && global2.REFS || {}, initialState = refs;
893
+ }, refs = !singleStory && global2.REFS || {}, initialState2 = refs;
894
894
  return runCheck && new Promise(async (resolve) => {
895
895
  for (let ref of Object.values(refs))
896
896
  await api.checkRef({ ...ref, stories: {} });
@@ -898,7 +898,7 @@ var parseUrl = (url) => {
898
898
  }), {
899
899
  api,
900
900
  state: {
901
- refs: initialState
901
+ refs: initialState2
902
902
  }
903
903
  };
904
904
  };
@@ -1874,6 +1874,10 @@ var init11 = ({
1874
1874
  let { storyId, refId } = store2.getState();
1875
1875
  return api.getData(storyId, refId);
1876
1876
  },
1877
+ getIndex: () => {
1878
+ let { internal_index } = store2.getState();
1879
+ return internal_index;
1880
+ },
1877
1881
  getParameters: (storyIdOrCombo, parameterName) => {
1878
1882
  let { storyId, refId } = typeof storyIdOrCombo == "string" ? { storyId: storyIdOrCombo, refId: void 0 } : storyIdOrCombo, data = api.getData(storyId, refId);
1879
1883
  if (["story", "docs"].includes(data?.type)) {
@@ -2325,7 +2329,7 @@ import { global as global8 } from "@storybook/global";
2325
2329
  import semver from "semver";
2326
2330
 
2327
2331
  // src/manager-api/version.ts
2328
- var version = "10.1.0-alpha.12";
2332
+ var version = "10.1.0-alpha.14";
2329
2333
 
2330
2334
  // src/manager-api/modules/versions.ts
2331
2335
  var { VERSIONCHECK } = global8, getVersionCheckData = (0, import_memoizerific2.default)(1)(() => {
@@ -2357,17 +2361,19 @@ var { VERSIONCHECK } = global8, getVersionCheckData = (0, import_memoizerific2.d
2357
2361
  return current && semver.prerelease(current.version) && next ? latest && semver.gt(latest.version, next.version) ? latest : next : latest;
2358
2362
  },
2359
2363
  // TODO: Move this to it's own "info" module later
2360
- getDocsUrl: ({ subpath, versioned, renderer }) => {
2364
+ getDocsUrl: ({ asset, subpath, versioned, renderer }) => {
2361
2365
  let {
2362
2366
  versions: { latest, current }
2363
- } = store2.getState(), url = "https://storybook.js.org/docs/";
2364
- if (versioned && current?.version && latest?.version) {
2367
+ } = store2.getState(), url = `https://storybook.js.org/${asset ? "docs-assets" : "docs"}/`;
2368
+ if (asset && current?.version)
2369
+ url += `${semver.major(current.version)}.${semver.minor(current.version)}/`;
2370
+ else if (versioned && current?.version && latest?.version) {
2365
2371
  let versionDiff = semver.diff(latest.version, current.version);
2366
2372
  versionDiff === "patch" || versionDiff === null || // assume latest version when current version is a 0.0.0 canary
2367
2373
  semver.satisfies(current.version, "0.0.0", { includePrerelease: !0 }) || (url += `${semver.major(current.version)}.${semver.minor(current.version)}/`);
2368
2374
  }
2369
2375
  let [cleanedSubpath, hash] = subpath?.split("#") || [];
2370
- if (cleanedSubpath && (url += `${cleanedSubpath}/`), renderer && typeof global8.STORYBOOK_RENDERER < "u") {
2376
+ if (cleanedSubpath && (url += asset ? cleanedSubpath : `${cleanedSubpath}/`), renderer && typeof global8.STORYBOOK_RENDERER < "u") {
2371
2377
  let rendererName = global8.STORYBOOK_RENDERER;
2372
2378
  rendererName && (url += `?renderer=${normalizeRendererName(rendererName)}`);
2373
2379
  }
@@ -2868,6 +2874,92 @@ var testProviderStore = createTestProviderStore({
2868
2874
  useTestProviderStore,
2869
2875
  universalTestProviderStore
2870
2876
  } = testProviderStore;
2877
+
2878
+ // src/shared/checklist-store/checklistData.state.ts
2879
+ var initialState = {
2880
+ items: {
2881
+ accessibilityTests: { status: "open" },
2882
+ autodocs: { status: "open" },
2883
+ ciTests: { status: "open" },
2884
+ controls: { status: "open" },
2885
+ coverage: { status: "open" },
2886
+ guidedTour: { status: "open" },
2887
+ installA11y: { status: "open" },
2888
+ installChromatic: { status: "open" },
2889
+ installDocs: { status: "open" },
2890
+ installVitest: { status: "open" },
2891
+ mdxDocs: { status: "open" },
2892
+ moreComponents: { status: "open" },
2893
+ moreStories: { status: "open" },
2894
+ onboardingSurvey: { status: "open" },
2895
+ organizeStories: { status: "open" },
2896
+ publishStorybook: { status: "open" },
2897
+ renderComponent: { status: "open" },
2898
+ runTests: { status: "open" },
2899
+ viewports: { status: "open" },
2900
+ visualTests: { status: "open" },
2901
+ whatsNewStorybook10: { status: "open" },
2902
+ writeInteractions: { status: "open" }
2903
+ },
2904
+ widget: {}
2905
+ };
2906
+
2907
+ // src/shared/checklist-store/index.ts
2908
+ var UNIVERSAL_CHECKLIST_STORE_OPTIONS = {
2909
+ id: "storybook/checklist",
2910
+ initialState
2911
+ }, createChecklistStore = (universalChecklistStore2) => ({
2912
+ getValue: (id) => universalChecklistStore2.getState().items[id] ?? { status: "open", mutedAt: void 0 },
2913
+ accept: (id) => {
2914
+ universalChecklistStore2.setState((state) => ({
2915
+ ...state,
2916
+ items: { ...state.items, [id]: { ...state.items[id], status: "accepted" } }
2917
+ }));
2918
+ },
2919
+ done: (id) => {
2920
+ universalChecklistStore2.setState((state) => ({
2921
+ ...state,
2922
+ items: { ...state.items, [id]: { ...state.items[id], status: "done" } }
2923
+ }));
2924
+ },
2925
+ skip: (id) => {
2926
+ universalChecklistStore2.setState((state) => ({
2927
+ ...state,
2928
+ items: { ...state.items, [id]: { ...state.items[id], status: "skipped" } }
2929
+ }));
2930
+ },
2931
+ reset: (id) => {
2932
+ universalChecklistStore2.setState((state) => ({
2933
+ ...state,
2934
+ items: { ...state.items, [id]: { ...state.items[id], status: "open" } }
2935
+ }));
2936
+ },
2937
+ mute: (itemIds) => {
2938
+ universalChecklistStore2.setState((state) => ({
2939
+ ...state,
2940
+ items: itemIds.reduce(
2941
+ (acc, id) => ({ ...acc, [id]: { ...state.items[id], mutedAt: Date.now() } }),
2942
+ state.items
2943
+ )
2944
+ }));
2945
+ },
2946
+ disable: (value) => {
2947
+ universalChecklistStore2.setState((state) => ({
2948
+ ...state,
2949
+ widget: { ...state.widget, disable: value },
2950
+ items: Object.entries(state.items).reduce(
2951
+ (acc, [id, value2]) => ({ ...acc, [id]: { ...value2, mutedAt: void 0 } }),
2952
+ state.items
2953
+ )
2954
+ }));
2955
+ }
2956
+ });
2957
+
2958
+ // src/manager-api/stores/checklist.ts
2959
+ var universalChecklistStore = UniversalStore.create({
2960
+ ...UNIVERSAL_CHECKLIST_STORE_OPTIONS,
2961
+ leader: globalThis.CONFIG_TYPE === "PRODUCTION"
2962
+ }), checklistStore = createChecklistStore(universalChecklistStore);
2871
2963
  export {
2872
2964
  ActiveTabs2 as ActiveTabs,
2873
2965
  ManagerConsumer as Consumer,
@@ -2888,8 +2980,10 @@ export {
2888
2980
  useStatusStore as experimental_useStatusStore,
2889
2981
  useTestProviderStore as experimental_useTestProviderStore,
2890
2982
  useUniversalStore as experimental_useUniversalStore,
2983
+ checklistStore as internal_checklistStore,
2891
2984
  fullStatusStore as internal_fullStatusStore,
2892
2985
  fullTestProviderStore as internal_fullTestProviderStore,
2986
+ universalChecklistStore as internal_universalChecklistStore,
2893
2987
  universalStatusStore as internal_universalStatusStore,
2894
2988
  universalTestProviderStore as internal_universalTestProviderStore,
2895
2989
  isMacLike,
@@ -561,6 +561,11 @@ declare abstract class StorybookError extends Error {
561
561
  readonly documentation: boolean | string | string[];
562
562
  /** Flag used to easily determine if the error originates from Storybook. */
563
563
  readonly fromStorybook: true;
564
+ /**
565
+ * Flag used to determine if the error is handled by us and should therefore not be shown to the
566
+ * user.
567
+ */
568
+ isHandledError: boolean;
564
569
  get fullErrorCode(): `SB_${string}_${string}`;
565
570
  /** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */
566
571
  get name(): string;
@@ -570,6 +575,7 @@ declare abstract class StorybookError extends Error {
570
575
  code: number;
571
576
  message: string;
572
577
  documentation?: boolean | string | string[];
578
+ isHandledError?: boolean;
573
579
  name: string;
574
580
  });
575
581
  /** Generates the error message along with additional documentation link (if applicable). */
@@ -3,8 +3,8 @@ import {
3
3
  ProviderDoesNotExtendBaseProviderError,
4
4
  StatusTypeIdMismatchError,
5
5
  UncaughtManagerError
6
- } from "./_browser-chunks/chunk-X3DUQ5RA.js";
7
- import "./_browser-chunks/chunk-EBHB6RPS.js";
6
+ } from "./_browser-chunks/chunk-GFY5R5EY.js";
7
+ import "./_browser-chunks/chunk-FQ7SLVLR.js";
8
8
  import "./_browser-chunks/chunk-A242L54C.js";
9
9
  export {
10
10
  Category,