storybook 9.1.0-alpha.2 → 9.1.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/actions/index.cjs +16 -16
  2. package/dist/actions/index.d.ts +1 -38
  3. package/dist/actions/index.js +12 -12
  4. package/dist/actions/preview.cjs +25 -25
  5. package/dist/actions/preview.d.ts +37 -547
  6. package/dist/actions/preview.js +18 -18
  7. package/dist/backgrounds/index.cjs +12 -144
  8. package/dist/backgrounds/index.d.ts +1 -591
  9. package/dist/backgrounds/index.js +0 -130
  10. package/dist/backgrounds/preview.cjs +63 -63
  11. package/dist/backgrounds/preview.d.ts +40 -542
  12. package/dist/backgrounds/preview.js +47 -47
  13. package/dist/bin/index.cjs +50 -50
  14. package/dist/bin/index.js +50 -50
  15. package/dist/builder-manager/index.cjs +379 -378
  16. package/dist/builder-manager/index.d.ts +567 -2
  17. package/dist/builder-manager/index.js +280 -279
  18. package/dist/cli/bin/index.cjs +1 -1
  19. package/dist/cli/bin/index.js +1 -1
  20. package/dist/common/index.cjs +87 -79
  21. package/dist/common/index.d.ts +2 -2
  22. package/dist/common/index.js +725 -716
  23. package/dist/component-testing/preview.cjs +12 -12
  24. package/dist/component-testing/preview.d.ts +2 -2
  25. package/dist/component-testing/preview.js +7 -7
  26. package/dist/components/index.cjs +1899 -1895
  27. package/dist/components/index.js +1343 -1339
  28. package/dist/controls/index.cjs +16 -16
  29. package/dist/controls/index.d.ts +1 -36
  30. package/dist/controls/preview.cjs +17 -17
  31. package/dist/controls/preview.d.ts +34 -546
  32. package/dist/controls/preview.js +3 -3
  33. package/dist/csf/index.cjs +1210 -95
  34. package/dist/csf/index.d.ts +59 -18
  35. package/dist/csf/index.js +1214 -90
  36. package/dist/csf-tools/index.cjs +2 -1
  37. package/dist/csf-tools/index.js +2 -2
  38. package/dist/highlight/index.cjs +15 -15
  39. package/dist/highlight/index.d.ts +1 -12
  40. package/dist/highlight/index.js +4 -4
  41. package/dist/highlight/preview.cjs +63 -63
  42. package/dist/highlight/preview.d.ts +11 -546
  43. package/dist/highlight/preview.js +11 -10
  44. package/dist/manager/globals-runtime.js +31934 -31888
  45. package/dist/manager-api/index.cjs +1 -1
  46. package/dist/manager-api/index.js +1 -1
  47. package/dist/measure/index.cjs +12 -472
  48. package/dist/measure/index.d.ts +1 -566
  49. package/dist/measure/index.js +0 -464
  50. package/dist/measure/preview.cjs +127 -127
  51. package/dist/measure/preview.d.ts +11 -546
  52. package/dist/measure/preview.js +117 -117
  53. package/dist/outline/index.cjs +12 -524
  54. package/dist/outline/index.d.ts +1 -566
  55. package/dist/outline/index.js +0 -500
  56. package/dist/outline/preview.cjs +32 -32
  57. package/dist/outline/preview.d.ts +11 -546
  58. package/dist/outline/preview.js +27 -27
  59. package/dist/preview/runtime.js +9415 -9379
  60. package/dist/preview-api/index.cjs +1228 -1261
  61. package/dist/preview-api/index.d.ts +6 -8
  62. package/dist/preview-api/index.js +927 -963
  63. package/dist/telemetry/index.cjs +1477 -1288
  64. package/dist/telemetry/index.js +1503 -1314
  65. package/dist/test/index.cjs +4437 -4394
  66. package/dist/test/index.js +3776 -3733
  67. package/dist/test/preview.cjs +42 -42
  68. package/dist/test/preview.d.ts +12 -550
  69. package/dist/test/preview.js +36 -36
  70. package/dist/types/index.d.ts +5 -3
  71. package/dist/viewport/index.cjs +17 -24
  72. package/dist/viewport/index.d.ts +9 -532
  73. package/dist/viewport/index.js +9 -16
  74. package/dist/viewport/preview.cjs +22 -22
  75. package/dist/viewport/preview.d.ts +45 -552
  76. package/dist/viewport/preview.js +8 -8
  77. package/package.json +1 -1
@@ -5831,7 +5831,7 @@ function K(s, e) {
5831
5831
  d(K, "invariant");
5832
5832
 
5833
5833
  // package.json
5834
- var Ot = "9.1.0-alpha.2";
5834
+ var Ot = "9.1.0-alpha.4";
5835
5835
 
5836
5836
  // src/cli/build.ts
5837
5837
  var nr = require("storybook/internal/common"), qe = require("storybook/internal/core-server");
@@ -5847,7 +5847,7 @@ function H(s, e) {
5847
5847
  d(H, "invariant");
5848
5848
 
5849
5849
  // package.json
5850
- var vt = "9.1.0-alpha.2";
5850
+ var vt = "9.1.0-alpha.4";
5851
5851
 
5852
5852
  // src/cli/build.ts
5853
5853
  import { cache as cs } from "storybook/internal/common";
@@ -18670,56 +18670,56 @@ module.exports = Be(cO);
18670
18670
 
18671
18671
  // src/common/versions.ts
18672
18672
  var qe = {
18673
- "@storybook/addon-a11y": "9.1.0-alpha.2",
18674
- "@storybook/addon-actions": "9.1.0-alpha.2",
18675
- "@storybook/addon-backgrounds": "9.1.0-alpha.2",
18676
- "@storybook/addon-controls": "9.1.0-alpha.2",
18677
- "@storybook/addon-docs": "9.1.0-alpha.2",
18678
- "@storybook/addon-jest": "9.1.0-alpha.2",
18679
- "@storybook/addon-links": "9.1.0-alpha.2",
18680
- "@storybook/addon-measure": "9.1.0-alpha.2",
18681
- "@storybook/addon-onboarding": "9.1.0-alpha.2",
18682
- "@storybook/addon-outline": "9.1.0-alpha.2",
18683
- "storybook-addon-pseudo-states": "9.1.0-alpha.2",
18684
- "@storybook/addon-themes": "9.1.0-alpha.2",
18685
- "@storybook/addon-toolbars": "9.1.0-alpha.2",
18686
- "@storybook/addon-viewport": "9.1.0-alpha.2",
18687
- "@storybook/addon-vitest": "9.1.0-alpha.2",
18688
- "@storybook/builder-vite": "9.1.0-alpha.2",
18689
- "@storybook/builder-webpack5": "9.1.0-alpha.2",
18690
- storybook: "9.1.0-alpha.2",
18691
- "@storybook/angular": "9.1.0-alpha.2",
18692
- "@storybook/ember": "9.1.0-alpha.2",
18693
- "@storybook/html-vite": "9.1.0-alpha.2",
18694
- "@storybook/nextjs": "9.1.0-alpha.2",
18695
- "@storybook/nextjs-vite": "9.1.0-alpha.2",
18696
- "@storybook/preact-vite": "9.1.0-alpha.2",
18697
- "@storybook/react-native-web-vite": "9.1.0-alpha.2",
18698
- "@storybook/react-vite": "9.1.0-alpha.2",
18699
- "@storybook/react-webpack5": "9.1.0-alpha.2",
18700
- "@storybook/server-webpack5": "9.1.0-alpha.2",
18701
- "@storybook/svelte-vite": "9.1.0-alpha.2",
18702
- "@storybook/sveltekit": "9.1.0-alpha.2",
18703
- "@storybook/vue3-vite": "9.1.0-alpha.2",
18704
- "@storybook/web-components-vite": "9.1.0-alpha.2",
18705
- sb: "9.1.0-alpha.2",
18706
- "@storybook/cli": "9.1.0-alpha.2",
18707
- "@storybook/codemod": "9.1.0-alpha.2",
18708
- "@storybook/core-webpack": "9.1.0-alpha.2",
18709
- "create-storybook": "9.1.0-alpha.2",
18710
- "@storybook/csf-plugin": "9.1.0-alpha.2",
18711
- "eslint-plugin-storybook": "9.1.0-alpha.2",
18712
- "@storybook/react-dom-shim": "9.1.0-alpha.2",
18713
- "@storybook/preset-create-react-app": "9.1.0-alpha.2",
18714
- "@storybook/preset-react-webpack": "9.1.0-alpha.2",
18715
- "@storybook/preset-server-webpack": "9.1.0-alpha.2",
18716
- "@storybook/html": "9.1.0-alpha.2",
18717
- "@storybook/preact": "9.1.0-alpha.2",
18718
- "@storybook/react": "9.1.0-alpha.2",
18719
- "@storybook/server": "9.1.0-alpha.2",
18720
- "@storybook/svelte": "9.1.0-alpha.2",
18721
- "@storybook/vue3": "9.1.0-alpha.2",
18722
- "@storybook/web-components": "9.1.0-alpha.2"
18673
+ "@storybook/addon-a11y": "9.1.0-alpha.4",
18674
+ "@storybook/addon-actions": "9.1.0-alpha.4",
18675
+ "@storybook/addon-backgrounds": "9.1.0-alpha.4",
18676
+ "@storybook/addon-controls": "9.1.0-alpha.4",
18677
+ "@storybook/addon-docs": "9.1.0-alpha.4",
18678
+ "@storybook/addon-jest": "9.1.0-alpha.4",
18679
+ "@storybook/addon-links": "9.1.0-alpha.4",
18680
+ "@storybook/addon-measure": "9.1.0-alpha.4",
18681
+ "@storybook/addon-onboarding": "9.1.0-alpha.4",
18682
+ "@storybook/addon-outline": "9.1.0-alpha.4",
18683
+ "storybook-addon-pseudo-states": "9.1.0-alpha.4",
18684
+ "@storybook/addon-themes": "9.1.0-alpha.4",
18685
+ "@storybook/addon-toolbars": "9.1.0-alpha.4",
18686
+ "@storybook/addon-viewport": "9.1.0-alpha.4",
18687
+ "@storybook/addon-vitest": "9.1.0-alpha.4",
18688
+ "@storybook/builder-vite": "9.1.0-alpha.4",
18689
+ "@storybook/builder-webpack5": "9.1.0-alpha.4",
18690
+ storybook: "9.1.0-alpha.4",
18691
+ "@storybook/angular": "9.1.0-alpha.4",
18692
+ "@storybook/ember": "9.1.0-alpha.4",
18693
+ "@storybook/html-vite": "9.1.0-alpha.4",
18694
+ "@storybook/nextjs": "9.1.0-alpha.4",
18695
+ "@storybook/nextjs-vite": "9.1.0-alpha.4",
18696
+ "@storybook/preact-vite": "9.1.0-alpha.4",
18697
+ "@storybook/react-native-web-vite": "9.1.0-alpha.4",
18698
+ "@storybook/react-vite": "9.1.0-alpha.4",
18699
+ "@storybook/react-webpack5": "9.1.0-alpha.4",
18700
+ "@storybook/server-webpack5": "9.1.0-alpha.4",
18701
+ "@storybook/svelte-vite": "9.1.0-alpha.4",
18702
+ "@storybook/sveltekit": "9.1.0-alpha.4",
18703
+ "@storybook/vue3-vite": "9.1.0-alpha.4",
18704
+ "@storybook/web-components-vite": "9.1.0-alpha.4",
18705
+ sb: "9.1.0-alpha.4",
18706
+ "@storybook/cli": "9.1.0-alpha.4",
18707
+ "@storybook/codemod": "9.1.0-alpha.4",
18708
+ "@storybook/core-webpack": "9.1.0-alpha.4",
18709
+ "create-storybook": "9.1.0-alpha.4",
18710
+ "@storybook/csf-plugin": "9.1.0-alpha.4",
18711
+ "eslint-plugin-storybook": "9.1.0-alpha.4",
18712
+ "@storybook/react-dom-shim": "9.1.0-alpha.4",
18713
+ "@storybook/preset-create-react-app": "9.1.0-alpha.4",
18714
+ "@storybook/preset-react-webpack": "9.1.0-alpha.4",
18715
+ "@storybook/preset-server-webpack": "9.1.0-alpha.4",
18716
+ "@storybook/html": "9.1.0-alpha.4",
18717
+ "@storybook/preact": "9.1.0-alpha.4",
18718
+ "@storybook/react": "9.1.0-alpha.4",
18719
+ "@storybook/server": "9.1.0-alpha.4",
18720
+ "@storybook/svelte": "9.1.0-alpha.4",
18721
+ "@storybook/vue3": "9.1.0-alpha.4",
18722
+ "@storybook/web-components": "9.1.0-alpha.4"
18723
18723
  };
18724
18724
 
18725
18725
  // src/common/presets.ts
@@ -24034,7 +24034,14 @@ var tB = [
24034
24034
  "@storybook/addon-svelte-csf",
24035
24035
  "@storybook/addon-coverage",
24036
24036
  "@storybook/addon-webpack5-compiler-babel",
24037
- "@storybook/addon-webpack5-compiler-swc"
24037
+ "@storybook/addon-webpack5-compiler-swc",
24038
+ // Storybook for React Native related packages
24039
+ // TODO: For Storybook 10, we should check about possible automigrations
24040
+ "@storybook/addon-ondevice-actions",
24041
+ "@storybook/addon-ondevice-backgrounds",
24042
+ "@storybook/addon-ondevice-controls",
24043
+ "@storybook/addon-ondevice-notes",
24044
+ "@storybook/react-native"
24038
24045
  ];
24039
24046
 
24040
24047
  // src/common/utils/get-storybook-info.ts
@@ -27611,54 +27618,55 @@ function Ux(t) {
27611
27618
  ).join("").replace(/^./, (e) => e.toLowerCase());
27612
27619
  }
27613
27620
  s(Ux, "getAnnotationsName");
27614
- async function Wp(t) {
27621
+ async function Wp(t, A) {
27622
+ let e = {
27623
+ // core addons will have a function as default export in index entrypoint
27624
+ importPath: t,
27625
+ importName: Ux(t),
27626
+ isCoreAddon: Oa(t)
27627
+ };
27628
+ e.isCoreAddon || (e.importPath = `${t}/preview`);
27615
27629
  try {
27616
- let A = {
27617
- // core addons will have a function as default export in index entrypoint
27618
- importPath: t,
27619
- importName: Ux(t),
27620
- isCoreAddon: Oa(t)
27621
- };
27622
- return t === "@storybook/addon-essentials" || (A.isCoreAddon || (A.importPath = `${t}/preview`), require.resolve(zp.default.join(t, "pre\
27623
- view"))), A;
27630
+ require.resolve(zp.default.join(t, "preview"), { paths: [A] });
27624
27631
  } catch {
27632
+ return null;
27625
27633
  }
27626
- return null;
27634
+ return e;
27627
27635
  }
27628
27636
  s(Wp, "getAddonAnnotations");
27629
27637
 
27630
27638
  // src/common/utils/sync-main-preview-addons.ts
27631
27639
  var _x = console;
27632
- async function Gx(t, A) {
27633
- let e = await (0, fi.readConfig)(A), r = await Vp(t, e);
27634
- await (0, fi.writeConfig)(r);
27640
+ async function Gx(t, A, e) {
27641
+ let r = await (0, fi.readConfig)(A), i = await Vp(t, r, e);
27642
+ await (0, fi.writeConfig)(i);
27635
27643
  }
27636
27644
  s(Gx, "syncStorybookAddons");
27637
- async function Vp(t, A) {
27645
+ async function Vp(t, A, e) {
27638
27646
  if (!(0, fi.isCsfFactoryPreview)(A))
27639
27647
  return A;
27640
- let r = HI(t);
27641
- if (!r)
27648
+ let i = HI(t);
27649
+ if (!i)
27642
27650
  return A;
27643
- let i = [], n = A.getFieldNode(["addons"]);
27644
- for (let o of r) {
27645
- let g = await Wp(o);
27646
- if (g) {
27651
+ let n = [], o = A.getFieldNode(["addons"]);
27652
+ for (let g of i) {
27653
+ let C = await Wp(g, e);
27654
+ if (C) {
27647
27655
  if (A._ast.program.body.find(
27648
- (c) => yr.types.isImportDeclaration(c) && c.source.value === g.importPath
27656
+ (E) => yr.types.isImportDeclaration(E) && E.source.value === C.importPath
27649
27657
  ))
27650
27658
  continue;
27651
- (!n || yr.types.isArrayExpression(n) && !n.elements.some(
27652
- (c) => yr.types.isIdentifier(c) && c.name === g.importName
27653
- )) && (i.push(o), g.isCoreAddon ? (A.setImport(g.importName, g.importPath), A.appendNodeToArray(
27659
+ (!o || yr.types.isArrayExpression(o) && !o.elements.some(
27660
+ (E) => yr.types.isIdentifier(E) && E.name === C.importName
27661
+ )) && (n.push(g), C.isCoreAddon ? (A.setImport(C.importName, C.importPath), A.appendNodeToArray(
27654
27662
  ["addons"],
27655
- yr.types.callExpression(yr.types.identifier(g.importName), [])
27656
- )) : (A.setImport({ namespace: g.importName }, g.importPath), A.appendNodeToArray(["addons"], yr.types.identifier(g.importName))));
27663
+ yr.types.callExpression(yr.types.identifier(C.importName), [])
27664
+ )) : (A.setImport({ namespace: C.importName }, C.importPath), A.appendNodeToArray(["addons"], yr.types.identifier(C.importName))));
27657
27665
  }
27658
27666
  }
27659
- return i.length > 0 && _x.info(
27667
+ return n.length > 0 && _x.info(
27660
27668
  `Synchronizing addons from main config in ${jI.default.cyan(A.fileName)}:
27661
- ${i.map(jI.default.magenta).join(", ")}`
27669
+ ${n.map(jI.default.magenta).join(", ")}`
27662
27670
  ), A;
27663
27671
  }
27664
27672
  s(Vp, "getSyncedStorybookAddons");
@@ -940,8 +940,8 @@ declare const posix: (localPath: string, seperator?: string) => string;
940
940
 
941
941
  declare const getAddonNames: (mainConfig: StorybookConfig) => string[];
942
942
 
943
- declare function syncStorybookAddons(mainConfig: StorybookConfig, previewConfigPath: string): Promise<void>;
944
- declare function getSyncedStorybookAddons(mainConfig: StorybookConfig, previewConfig: ConfigFile): Promise<ConfigFile>;
943
+ declare function syncStorybookAddons(mainConfig: StorybookConfig, previewConfigPath: string, configDir: string): Promise<void>;
944
+ declare function getSyncedStorybookAddons(mainConfig: StorybookConfig, previewConfig: ConfigFile, configDir: string): Promise<ConfigFile>;
945
945
 
946
946
  /**
947
947
  * Helper function to scan for files matching a glob pattern and transform them