@storybook/react 11.0.0-alpha.0 → 11.0.0-alpha.1
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/_browser-chunks/{chunk-64GECWYS.js → chunk-PZ4OU6H4.js} +1 -1
- package/dist/_browser-chunks/{chunk-7HUHAOMV.js → chunk-XACQAYAZ.js} +12 -4
- package/dist/_node-chunks/{chunk-R6ESE7F3.js → chunk-GFBGFJ4J.js} +8 -6
- package/dist/docgen/docgen-worker.js +7 -7
- package/dist/entry-preview.js +1 -1
- package/dist/index.js +2 -2
- package/dist/preset.js +1200 -8
- package/dist/preview.js +2 -2
- package/package.json +3 -3
|
@@ -107,7 +107,7 @@ var { FRAMEWORK_OPTIONS } = global, ErrorBoundary = class extends ReactComponent
|
|
|
107
107
|
let { hasError } = this.state, { children } = this.props;
|
|
108
108
|
return hasError ? null : children;
|
|
109
109
|
}
|
|
110
|
-
}, Wrapper = FRAMEWORK_OPTIONS?.strictMode ? StrictMode : Fragment, actQueue = [], isActing = !1, processActQueue = async () => {
|
|
110
|
+
}, Wrapper = FRAMEWORK_OPTIONS?.strictMode ? StrictMode : Fragment, actQueue = [], isActing = !1, remountCounts = /* @__PURE__ */ new WeakMap(), processActQueue = async () => {
|
|
111
111
|
if (isActing || actQueue.length === 0)
|
|
112
112
|
return;
|
|
113
113
|
isActing = !0;
|
|
@@ -121,9 +121,17 @@ async function renderToCanvas({
|
|
|
121
121
|
showException,
|
|
122
122
|
forceRemount
|
|
123
123
|
}, canvasElement) {
|
|
124
|
-
let { renderElement, unmountElement } = await import("@storybook/react-dom-shim"), Story = unboundStoryFn,
|
|
125
|
-
forceRemount && unmountElement(canvasElement);
|
|
126
|
-
let
|
|
124
|
+
let { renderElement, unmountElement } = await import("@storybook/react-dom-shim"), Story = unboundStoryFn, isPortableStory = storyContext.parameters.__isPortableStory;
|
|
125
|
+
forceRemount && (isPortableStory ? unmountElement(canvasElement) : remountCounts.set(canvasElement, (remountCounts.get(canvasElement) ?? 0) + 1));
|
|
126
|
+
let content = isPortableStory ? React3.createElement(Story, { ...storyContext }) : React3.createElement(
|
|
127
|
+
ErrorBoundary,
|
|
128
|
+
{
|
|
129
|
+
key: `${storyContext.id}-${remountCounts.get(canvasElement) ?? 0}`,
|
|
130
|
+
showMain,
|
|
131
|
+
showException
|
|
132
|
+
},
|
|
133
|
+
React3.createElement(Story, { ...storyContext })
|
|
134
|
+
), element = Wrapper ? React3.createElement(Wrapper, null, content) : content, act = await getAct({ disableAct: storyContext.viewMode === "docs" });
|
|
127
135
|
return await new Promise(async (resolve, reject) => {
|
|
128
136
|
actQueue.push(async () => {
|
|
129
137
|
try {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_moh6ij0aoc from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_moh6ij0aoc from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_moh6ij0aoc from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_moh6ij0aoc.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_moh6ij0aoc.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_moh6ij0aoc.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -16825,6 +16825,8 @@ function buildReactComponentDocgenFromResolved({
|
|
|
16825
16825
|
}
|
|
16826
16826
|
|
|
16827
16827
|
export {
|
|
16828
|
+
__commonJS,
|
|
16829
|
+
__toESM,
|
|
16828
16830
|
extractArgTypes,
|
|
16829
16831
|
invalidateCache,
|
|
16830
16832
|
cachedReadFileSync,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_moh6ij0aoc from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_moh6ij0aoc from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_moh6ij0aoc from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_moh6ij0aoc.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_moh6ij0aoc.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_moh6ij0aoc.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
extractArgTypes,
|
|
16
16
|
posix,
|
|
17
17
|
resolveStoryFileComponents
|
|
18
|
-
} from "../_node-chunks/chunk-
|
|
18
|
+
} from "../_node-chunks/chunk-GFBGFJ4J.js";
|
|
19
19
|
|
|
20
20
|
// src/docgen/docgen-worker.ts
|
|
21
21
|
import { createLazyDocgenMiddleware } from "storybook/internal/common";
|
package/dist/entry-preview.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__definePreview
|
|
3
|
-
} from "./_browser-chunks/chunk-
|
|
3
|
+
} from "./_browser-chunks/chunk-PZ4OU6H4.js";
|
|
4
4
|
import {
|
|
5
5
|
entry_preview_exports,
|
|
6
6
|
renderToCanvas
|
|
7
|
-
} from "./_browser-chunks/chunk-
|
|
7
|
+
} from "./_browser-chunks/chunk-XACQAYAZ.js";
|
|
8
8
|
import {
|
|
9
9
|
entry_preview_argtypes_exports
|
|
10
10
|
} from "./_browser-chunks/chunk-5GZAZJC7.js";
|