@storybook/react 10.2.0-alpha.6 → 10.2.0-alpha.7

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  entry_preview_exports
3
- } from "./chunk-34HS64JJ.js";
3
+ } from "./chunk-GLRRNWDU.js";
4
4
  import {
5
5
  entry_preview_argtypes_exports
6
6
  } from "./chunk-DX2KEMQY.js";
@@ -158,7 +158,7 @@ var decorators = [
158
158
  (story, context) => {
159
159
  if (context.tags?.includes("test-fn") && !global2.FEATURES?.experimentalTestSyntax)
160
160
  throw new Error(
161
- "To use the experimental test function, you must enable the experimentalTestSyntax feature flag. See https://storybook.js.org/docs/10/api/main-config/main-config-features#experimentalTestSyntax"
161
+ "To use the experimental test function, you must enable the experimentalTestSyntax feature flag. See https://storybook.js.org/docs/api/main-config/main-config-features#experimentaltestsyntax"
162
162
  );
163
163
  return story();
164
164
  }
@@ -5,7 +5,7 @@ import {
5
5
  parameters,
6
6
  render,
7
7
  renderToCanvas
8
- } from "./_browser-chunks/chunk-34HS64JJ.js";
8
+ } from "./_browser-chunks/chunk-GLRRNWDU.js";
9
9
  import {
10
10
  applyDecorators
11
11
  } from "./_browser-chunks/chunk-DDIRQRCA.js";
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  __definePreview
3
- } from "./_browser-chunks/chunk-Q7AKY2FO.js";
3
+ } from "./_browser-chunks/chunk-BMWJYMA6.js";
4
4
  import {
5
5
  entry_preview_exports,
6
6
  renderToCanvas
7
- } from "./_browser-chunks/chunk-34HS64JJ.js";
7
+ } from "./_browser-chunks/chunk-GLRRNWDU.js";
8
8
  import {
9
9
  entry_preview_argtypes_exports
10
10
  } from "./_browser-chunks/chunk-DX2KEMQY.js";
package/dist/preset.js CHANGED
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_m3olc1eom9p from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_m3olc1eom9p from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_m3olc1eom9p from "node:module";
1
+ import CJS_COMPAT_NODE_URL_4pqbwn0lhtr from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_4pqbwn0lhtr from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_4pqbwn0lhtr from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_m3olc1eom9p.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_m3olc1eom9p.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_m3olc1eom9p.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_4pqbwn0lhtr.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_4pqbwn0lhtr.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_4pqbwn0lhtr.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -2998,13 +2998,13 @@ function getCodeSnippet(csf, storyName, componentName) {
2998
2998
  return t.isFunctionDeclaration(fn) ? fn : t.variableDeclaration("const", [t.variableDeclarator(t.identifier(storyName), fn)]);
2999
2999
  }
3000
3000
  invariant(componentName, "Could not generate snippet without component name.");
3001
- let invalidSpread = buildInvalidSpread(invalidEntries), name = t.jsxIdentifier(componentName), openingElAttrs = invalidSpread ? [...injectedAttrs, invalidSpread] : injectedAttrs, arrow = t.arrowFunctionExpression(
3001
+ let invalidSpread = buildInvalidSpread(invalidEntries), name = t.jsxIdentifier(componentName), openingElAttrs = invalidSpread ? [...injectedAttrs, invalidSpread] : injectedAttrs, children = toJsxChildren(merged.children), selfClosing = children.length === 0, arrow = t.arrowFunctionExpression(
3002
3002
  [],
3003
3003
  t.jsxElement(
3004
- t.jsxOpeningElement(name, openingElAttrs, !1),
3005
- t.jsxClosingElement(name),
3006
- toJsxChildren(merged.children),
3007
- !1
3004
+ t.jsxOpeningElement(name, openingElAttrs, selfClosing),
3005
+ selfClosing ? null : t.jsxClosingElement(name),
3006
+ children,
3007
+ selfClosing
3008
3008
  )
3009
3009
  );
3010
3010
  return t.variableDeclaration("const", [t.variableDeclarator(t.identifier(storyName), arrow)]);
package/dist/preview.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  __definePreview
3
- } from "./_browser-chunks/chunk-Q7AKY2FO.js";
4
- import "./_browser-chunks/chunk-34HS64JJ.js";
3
+ } from "./_browser-chunks/chunk-BMWJYMA6.js";
4
+ import "./_browser-chunks/chunk-GLRRNWDU.js";
5
5
  import "./_browser-chunks/chunk-DX2KEMQY.js";
6
6
  import "./_browser-chunks/chunk-CMP5DLKH.js";
7
7
  import "./_browser-chunks/chunk-DDIRQRCA.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/react",
3
- "version": "10.2.0-alpha.6",
3
+ "version": "10.2.0-alpha.7",
4
4
  "description": "Storybook React renderer",
5
5
  "keywords": [
6
6
  "storybook"
@@ -50,7 +50,7 @@
50
50
  ],
51
51
  "dependencies": {
52
52
  "@storybook/global": "^5.0.0",
53
- "@storybook/react-dom-shim": "10.2.0-alpha.6",
53
+ "@storybook/react-dom-shim": "10.2.0-alpha.7",
54
54
  "react-docgen": "^8.0.2"
55
55
  },
56
56
  "devDependencies": {
@@ -77,7 +77,7 @@
77
77
  "peerDependencies": {
78
78
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
79
79
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
80
- "storybook": "^10.2.0-alpha.6",
80
+ "storybook": "^10.2.0-alpha.7",
81
81
  "typescript": ">= 4.9.x"
82
82
  },
83
83
  "peerDependenciesMeta": {