storybook 10.0.0-beta.6 → 10.0.0-beta.8

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 (80) hide show
  1. package/dist/_browser-chunks/{chunk-YQV3EGQ5.js → chunk-OQ6NCFPL.js} +38 -15
  2. package/dist/_browser-chunks/{chunk-O5R5CGFA.js → chunk-TMDZCWME.js} +1 -2
  3. package/dist/_node-chunks/{builder-manager-V33CQT2M.js → builder-manager-Y34L3HC4.js} +30 -15
  4. package/dist/_node-chunks/camelcase-W6EWLMZP.js +18 -0
  5. package/dist/_node-chunks/{chunk-A7CUP23N.js → chunk-3VCGPS3V.js} +7 -7
  6. package/dist/_node-chunks/{chunk-EAOPWIKA.js → chunk-4QSDBUYK.js} +8 -8
  7. package/dist/_node-chunks/{chunk-UYKQJMQY.js → chunk-4SIVISOF.js} +21 -27
  8. package/dist/_node-chunks/{chunk-MLBTKECD.js → chunk-5SPDSTWP.js} +7 -7
  9. package/dist/_node-chunks/{chunk-VQH4ZFTS.js → chunk-6NAUDAPE.js} +8 -8
  10. package/dist/_node-chunks/{chunk-NUVGSFQI.js → chunk-6SXRGPL6.js} +7 -7
  11. package/dist/_node-chunks/{chunk-2DMFI367.js → chunk-7JZFWQN4.js} +72 -8
  12. package/dist/_node-chunks/{chunk-IINJT47N.js → chunk-7Q5EKYUL.js} +7 -7
  13. package/dist/_node-chunks/{chunk-B3AMFGAL.js → chunk-AND2M2X5.js} +7 -7
  14. package/dist/_node-chunks/{chunk-RIPA4LFD.js → chunk-AZWKFSEJ.js} +108 -76
  15. package/dist/_node-chunks/{chunk-7NJGTQ3W.js → chunk-CL53RP5L.js} +8 -8
  16. package/dist/_node-chunks/{chunk-BNOZ3EKF.js → chunk-CZLW5B2W.js} +7 -7
  17. package/dist/_node-chunks/{chunk-DC7OWBHB.js → chunk-DRNU7FEF.js} +12 -12
  18. package/dist/_node-chunks/{chunk-VSC6LSCQ.js → chunk-EMCS3ZKS.js} +6 -6
  19. package/dist/_node-chunks/{chunk-EY5PTUZL.js → chunk-F43CI3CD.js} +10 -10
  20. package/dist/_node-chunks/{chunk-XZTBG2TG.js → chunk-FRTUAT3V.js} +6 -6
  21. package/dist/_node-chunks/{chunk-JNHUDBJL.js → chunk-HRBWZFVH.js} +7 -7
  22. package/dist/_node-chunks/{chunk-55VWKF63.js → chunk-IE2VBA4V.js} +9 -9
  23. package/dist/_node-chunks/{chunk-5IEY46LQ.js → chunk-JEIQPNWQ.js} +7 -7
  24. package/dist/_node-chunks/{chunk-NKZ4UPPV.js → chunk-JG7IEUS3.js} +7 -7
  25. package/dist/_node-chunks/{chunk-HEBHWRWL.js → chunk-LKGWQEHR.js} +7 -7
  26. package/dist/_node-chunks/{chunk-6PTV7XGR.js → chunk-MIJKYKSO.js} +264 -109
  27. package/dist/_node-chunks/{chunk-F3PO67U3.js → chunk-O33XSHQE.js} +7 -7
  28. package/dist/_node-chunks/{chunk-HPFXREVG.js → chunk-SOIRRZYG.js} +7 -7
  29. package/dist/_node-chunks/chunk-T46D5USU.js +18 -0
  30. package/dist/_node-chunks/{chunk-NJXBURX7.js → chunk-T5VNV7FG.js} +7 -7
  31. package/dist/_node-chunks/{chunk-E6TLN2J2.js → chunk-TL5UYDH2.js} +7 -7
  32. package/dist/_node-chunks/{chunk-JOXYGIZK.js → chunk-UORO6DG4.js} +9 -9
  33. package/dist/_node-chunks/chunk-USP6T4QU.js +62 -0
  34. package/dist/_node-chunks/{chunk-7WH7AGOR.js → chunk-WS3L7DA7.js} +7 -7
  35. package/dist/_node-chunks/{chunk-4TOI4VSK.js → chunk-YMZK6547.js} +7 -7
  36. package/dist/_node-chunks/{dist-CGGAYWME.js → dist-RINWIIFC.js} +9 -9
  37. package/dist/_node-chunks/{globby-3IFB7BJC.js → globby-G3CLKE4Y.js} +9 -9
  38. package/dist/_node-chunks/{lib-IT6OBSID.js → lib-67I574Z7.js} +7 -7
  39. package/dist/_node-chunks/{mdx-N42X6CFJ-WM36SSZ6.js → mdx-N42X6CFJ-6DP2YFMY.js} +8 -8
  40. package/dist/_node-chunks/{p-limit-3V5XIKA7.js → p-limit-JBOY5PGK.js} +7 -7
  41. package/dist/_node-chunks/{plugin-3YREMMJJ.js → plugin-2IR6AOYP.js} +10 -10
  42. package/dist/_node-chunks/{plugin-GJUBUKCT.js → plugin-5XCSTKS6.js} +10 -10
  43. package/dist/_node-chunks/{webpack-inject-mocker-runtime-plugin-DCJQFJQ5.js → webpack-inject-mocker-runtime-plugin-5FUND5HJ.js} +10 -10
  44. package/dist/_node-chunks/{webpack-mock-plugin-XJNFAHBI.js → webpack-mock-plugin-JVWSZ2PI.js} +9 -9
  45. package/dist/babel/index.js +11 -11
  46. package/dist/bin/core.js +11 -11
  47. package/dist/bin/dispatcher.js +11 -11
  48. package/dist/bin/loader.js +8 -8
  49. package/dist/cli/index.js +20 -20
  50. package/dist/common/index.js +20 -21
  51. package/dist/components/index.js +7 -3
  52. package/dist/core-server/index.js +90 -63
  53. package/dist/core-server/presets/common-manager.js +575 -531
  54. package/dist/core-server/presets/common-override-preset.js +9 -9
  55. package/dist/core-server/presets/common-preset.js +22 -22
  56. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +9 -9
  57. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +10 -10
  58. package/dist/csf/index.d.ts +9 -4
  59. package/dist/csf/index.js +37 -8
  60. package/dist/csf-tools/index.d.ts +13 -6
  61. package/dist/csf-tools/index.js +9 -9
  62. package/dist/manager/globals-runtime.js +73 -34
  63. package/dist/manager/runtime.js +501 -257
  64. package/dist/manager-api/index.d.ts +11 -6
  65. package/dist/manager-api/index.js +69 -34
  66. package/dist/node-logger/index.js +14 -14
  67. package/dist/preview/globals.js +1 -1
  68. package/dist/preview/runtime.js +97 -63
  69. package/dist/preview-api/index.d.ts +70 -71
  70. package/dist/preview-api/index.js +1 -1
  71. package/dist/server-errors.js +10 -10
  72. package/dist/telemetry/index.js +23 -24
  73. package/dist/types/index.d.ts +24 -7
  74. package/dist/viewport/index.d.ts +36 -4
  75. package/dist/viewport/index.js +1 -1
  76. package/package.json +1 -33
  77. package/dist/_node-chunks/camelcase-BZ55OCHI.js +0 -18
  78. package/dist/_node-chunks/chunk-FDDJHDCE.js +0 -62
  79. package/dist/_node-chunks/chunk-R5DIBOM6.js +0 -18
  80. package/dist/_node-chunks/chunk-TJIMCNYJ.js +0 -80
@@ -117728,7 +117728,9 @@ var Center = styled.span(
117728
117728
  flex: 1,
117729
117729
  textAlign: "left",
117730
117730
  display: "flex",
117731
- flexDirection: "column"
117731
+ flexDirection: "column",
117732
+ minWidth: 0
117733
+ // required for overflow
117732
117734
  },
117733
117735
  ({ isIndented }) => isIndented ? { marginLeft: 24 } : {}
117734
117736
  );
@@ -117756,6 +117758,8 @@ var Left = styled.span(
117756
117758
  var Item = styled.div(
117757
117759
  ({ theme: theme3 }) => ({
117758
117760
  width: "100%",
117761
+ minWidth: 0,
117762
+ // required for overflow
117759
117763
  border: "none",
117760
117764
  borderRadius: theme3.appBorderRadius,
117761
117765
  background: "none",
@@ -146170,6 +146174,7 @@ var transformSetStoriesStoryDataToPreparedStoryIndex = /* @__PURE__ */ __name((s
146170
146174
  const { argTypes, args, initialArgs } = story;
146171
146175
  acc[id] = {
146172
146176
  type: "story",
146177
+ subtype: "story",
146173
146178
  ...base,
146174
146179
  parameters: parameters2,
146175
146180
  argTypes,
@@ -146247,19 +146252,18 @@ var transformStoryIndexToStoriesHash = /* @__PURE__ */ __name((input2, { provide
146247
146252
  index4 = index4.v === 3 ? transformStoryIndexV3toV4(index4) : index4;
146248
146253
  index4 = index4.v === 4 ? transformStoryIndexV4toV5(index4) : index4;
146249
146254
  index4 = index4;
146250
- const entryValues = Object.values(index4.entries).filter((entry) => {
146251
- let result = true;
146252
- const storyStatuses = allStatuses[entry.id] ?? {};
146253
- if (Object.values(storyStatuses).some(({ value }) => value === "status-value:error")) {
146254
- return result;
146255
+ const indexEntries = Object.values(index4.entries);
146256
+ const filterFunctions = Object.values(filters);
146257
+ const entryValues = indexEntries.filter((entry) => {
146258
+ const statuses = allStatuses[entry.id] ?? {};
146259
+ if (Object.values(statuses).some(({ value }) => value === "status-value:error")) {
146260
+ return true;
146255
146261
  }
146256
- Object.values(filters).forEach((filter) => {
146257
- if (result === false) {
146258
- return;
146259
- }
146260
- result = filter({ ...entry, statuses: storyStatuses });
146261
- });
146262
- return result;
146262
+ if (filterFunctions.every((fn4) => fn4({ ...entry, statuses }))) {
146263
+ return true;
146264
+ }
146265
+ const children = indexEntries.filter((item) => "parent" in item && item.parent === entry.id);
146266
+ return children.some((child) => filterFunctions.every((fn4) => fn4({ ...child, statuses })));
146263
146267
  });
146264
146268
  const { sidebar = {} } = provider.getConfig();
146265
146269
  const { showRoots, collapsedRoots = [], renderLabel } = sidebar;
@@ -146282,7 +146286,7 @@ var transformStoryIndexToStoriesHash = /* @__PURE__ */ __name((input2, { provide
146282
146286
  throw new Error(
146283
146287
  dedent`
146284
146288
  Invalid part '${name}', leading to id === parentId ('${id}'), inside title '${title}'
146285
-
146289
+
146286
146290
  Did you create a path that uses the separator char accidentally, such as 'Vue <docs/>' where '/' is a separator char? See https://github.com/storybookjs/storybook/issues/6128
146287
146291
  `
146288
146292
  );
@@ -146333,36 +146337,60 @@ var transformStoryIndexToStoriesHash = /* @__PURE__ */ __name((input2, { provide
146333
146337
  }
146334
146338
  });
146335
146339
  acc[item.id] = {
146336
- type: "story",
146337
146340
  tags: [],
146338
146341
  ...item,
146339
146342
  depth: paths.length,
146340
- parent: paths[paths.length - 1],
146343
+ parent: "parent" in item ? item.parent : paths[paths.length - 1],
146341
146344
  renderLabel,
146342
146345
  prepared: !!item.parameters
146343
146346
  };
146344
146347
  return acc;
146345
146348
  }, {});
146346
146349
  function addItem(acc, item) {
146347
- if (acc[item.id]) {
146348
- return acc;
146349
- }
146350
- acc[item.id] = item;
146351
- if (item.type === "root" || item.type === "group" || item.type === "component") {
146352
- item.children.forEach((childId) => addItem(acc, storiesHashOutOfOrder[childId]));
146353
- item.tags = item.children.reduce((currentTags, childId) => {
146354
- const child = acc[childId];
146355
- return currentTags === null ? child.tags : intersect_default(currentTags, child.tags);
146356
- }, null);
146350
+ if (!acc[item.id]) {
146351
+ acc[item.id] = item;
146352
+ if ("children" in item && item.children) {
146353
+ item.children.forEach((childId) => addItem(acc, storiesHashOutOfOrder[childId]));
146354
+ item.tags = item.children.reduce((currentTags, childId) => {
146355
+ return currentTags === null ? acc[childId].tags : intersect_default(currentTags, acc[childId].tags);
146356
+ }, null) || [];
146357
+ }
146357
146358
  }
146358
146359
  if (item.type === "component") {
146359
- item.importPath = acc[item.children[0]].importPath;
146360
+ const firstChild = acc[item.children[0]];
146361
+ if (firstChild && "importPath" in firstChild) {
146362
+ item.importPath = firstChild.importPath;
146363
+ }
146360
146364
  }
146361
146365
  return acc;
146362
146366
  }
146363
146367
  __name(addItem, "addItem");
146364
- const orphanHash = Object.values(storiesHashOutOfOrder).filter((i2) => i2.type !== "root" && !i2.parent).reduce(addItem, {});
146365
- return Object.values(storiesHashOutOfOrder).filter((i2) => i2.type === "root").reduce(addItem, orphanHash);
146368
+ let storiesHash = Object.values(storiesHashOutOfOrder).filter((i2) => i2.type !== "root" && !i2.parent).reduce((acc, item) => addItem(acc, item), {});
146369
+ storiesHash = Object.values(storiesHashOutOfOrder).filter((i2) => i2.type === "root").reduce(addItem, storiesHash);
146370
+ storiesHash = Object.values(storiesHash).reduce((acc, item) => {
146371
+ if (item.type === "story" && item.subtype === "test") {
146372
+ const story = acc[item.parent];
146373
+ const component = acc[story.parent];
146374
+ acc[component.id] = {
146375
+ ...component,
146376
+ // Remove test from the component node as it will be attached to the story node instead
146377
+ children: component.children && component.children.filter((id) => id !== item.id)
146378
+ };
146379
+ acc[story.id] = {
146380
+ ...story,
146381
+ // Add test to the story node
146382
+ children: (story.children || []).concat(item.id)
146383
+ };
146384
+ acc[item.id] = {
146385
+ ...item,
146386
+ depth: item.depth + 1
146387
+ };
146388
+ } else {
146389
+ acc[item.id] = item;
146390
+ }
146391
+ return acc;
146392
+ }, {});
146393
+ return storiesHash;
146366
146394
  }, "transformStoryIndexToStoriesHash");
146367
146395
  var addPreparedStories = /* @__PURE__ */ __name((newHash, oldHash) => {
146368
146396
  if (!oldHash) {
@@ -146372,6 +146400,9 @@ var addPreparedStories = /* @__PURE__ */ __name((newHash, oldHash) => {
146372
146400
  Object.entries(newHash).map(([id, newEntry]) => {
146373
146401
  const oldEntry = oldHash[id];
146374
146402
  if (newEntry.type === "story" && oldEntry?.type === "story" && oldEntry.prepared) {
146403
+ if ("children" in oldEntry) {
146404
+ delete oldEntry.children;
146405
+ }
146375
146406
  return [id, { ...oldEntry, ...newEntry, prepared: true }];
146376
146407
  }
146377
146408
  return [id, newEntry];
@@ -146978,6 +147009,13 @@ var init6 = /* @__PURE__ */ __name(({ store: store2, provider, singleStory }) =>
146978
147009
  }
146979
147010
  return showToolbar;
146980
147011
  },
147012
+ getShowPanelWithCustomisations(showPanel) {
147013
+ const state3 = store2.getState();
147014
+ if (isFunction5(state3.layoutCustomisations.showPanel)) {
147015
+ return state3.layoutCustomisations.showPanel(state3, showPanel) ?? showPanel;
147016
+ }
147017
+ return showPanel;
147018
+ },
146981
147019
  getNavSizeWithCustomisations(navSize) {
146982
147020
  const state3 = store2.getState();
146983
147021
  if (isFunction5(state3.layoutCustomisations.showSidebar)) {
@@ -147081,7 +147119,6 @@ __export(open_in_editor_exports, {
147081
147119
  init: () => init8
147082
147120
  });
147083
147121
  var import_react65 = __toESM(require_react(), 1);
147084
- init_theming();
147085
147122
  var init8 = /* @__PURE__ */ __name(({ provider, fullAPI }) => {
147086
147123
  const api = {
147087
147124
  openInEditor(payload) {
@@ -147103,6 +147140,7 @@ var init8 = /* @__PURE__ */ __name(({ provider, fullAPI }) => {
147103
147140
  api,
147104
147141
  state: state3,
147105
147142
  init: /* @__PURE__ */ __name(async () => {
147143
+ const { color: color2 } = await Promise.resolve().then(() => (init_theming(), theming_exports));
147106
147144
  provider.channel?.on(OPEN_IN_EDITOR_RESPONSE, (payload) => {
147107
147145
  if (payload.error !== null) {
147108
147146
  fullAPI.addNotification({
@@ -147111,7 +147149,7 @@ var init8 = /* @__PURE__ */ __name(({ provider, fullAPI }) => {
147111
147149
  headline: "Failed to open in editor",
147112
147150
  subHeadline: payload.error || "Check the Storybook process on the command line for more details."
147113
147151
  },
147114
- icon: import_react65.default.createElement(FailedIcon, { color: color.negative }),
147152
+ icon: import_react65.default.createElement(FailedIcon, { color: color2.negative }),
147115
147153
  duration: 8e3
147116
147154
  });
147117
147155
  }
@@ -147973,8 +148011,9 @@ var init12 = /* @__PURE__ */ __name(({
147973
148011
  }
147974
148012
  if (node2.type === "story") {
147975
148013
  results.push(node2.id);
147976
- } else if ("children" in node2) {
147977
- node2.children.forEach((childId) => findChildEntriesRecursively(childId, results));
148014
+ }
148015
+ if ("children" in node2) {
148016
+ node2.children?.forEach((childId) => findChildEntriesRecursively(childId, results));
147978
148017
  }
147979
148018
  return results;
147980
148019
  }, "findChildEntriesRecursively");
@@ -148489,7 +148528,7 @@ var import_memoizerific10 = __toESM(require_memoizerific(), 1);
148489
148528
  var import_semver = __toESM(require_semver2(), 1);
148490
148529
 
148491
148530
  // src/manager-api/version.ts
148492
- var version = "10.0.0-beta.6";
148531
+ var version = "10.0.0-beta.8";
148493
148532
 
148494
148533
  // src/manager-api/modules/versions.ts
148495
148534
  var { VERSIONCHECK } = scope;