@storybook/addon-docs 10.2.0-alpha.1 → 10.2.0-alpha.10
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/{Color-ASIRERSW.js → Color-6BZIO3FS.js} +14 -14
- package/dist/_browser-chunks/{DocsRenderer-GHJI37HO.js → DocsRenderer-LL677BLK.js} +1 -1
- package/dist/_browser-chunks/{chunk-DDRHE7EB.js → chunk-AAVP3AE4.js} +10 -10
- package/dist/_browser-chunks/{chunk-UUESKCKV.js → chunk-S4QKU6I5.js} +2 -2
- package/dist/_browser-chunks/{chunk-A242L54C.js → chunk-SL3VIQZ3.js} +0 -7
- package/dist/_node-chunks/{chunk-CBKT5XUX.js → chunk-2AMBYFOA.js} +10 -10
- package/dist/_node-chunks/{chunk-OBFRARTH.js → chunk-JOA4L436.js} +762 -762
- package/dist/_node-chunks/{chunk-PBPABQD4.js → chunk-W5EZ2JLN.js} +6 -6
- package/dist/_node-chunks/{chunk-3I43UR4Y.js → chunk-ZSZBTQUU.js} +10 -10
- package/dist/_node-chunks/{mdx-plugin-IWKZADK4.js → mdx-plugin-OX2BZW75.js} +24 -24
- package/dist/_node-chunks/{rehype-external-links-VMNWOUNT.js → rehype-external-links-JPRWE46L.js} +12 -12
- package/dist/_node-chunks/{rehype-slug-JH43HCVQ.js → rehype-slug-6JL7OKAU.js} +13 -13
- package/dist/angular/index.js +1 -1
- package/dist/blocks.d.ts +3 -7
- package/dist/blocks.js +177 -281
- package/dist/ember/index.js +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +2 -2
- package/dist/manager.js +37 -29
- package/dist/mdx-loader.js +10 -10
- package/dist/preset.js +11 -11
- package/dist/preview.js +2 -2
- package/package.json +7 -11
package/dist/ember/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -140,8 +140,6 @@ type SourceBlockParameters = {
|
|
|
140
140
|
/**
|
|
141
141
|
* The formatting used on source code. Both true and 'dedent' have the same effect of removing any
|
|
142
142
|
* extraneous indentation. Supports all valid prettier parser names.
|
|
143
|
-
*
|
|
144
|
-
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-source#format
|
|
145
143
|
*/
|
|
146
144
|
format?: boolean | 'dedent' | string;
|
|
147
145
|
/** Source code language */
|
package/dist/index.js
CHANGED
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
} from "./_browser-chunks/chunk-OATZR77O.js";
|
|
4
4
|
import {
|
|
5
5
|
preview_exports
|
|
6
|
-
} from "./_browser-chunks/chunk-
|
|
7
|
-
import "./_browser-chunks/chunk-
|
|
6
|
+
} from "./_browser-chunks/chunk-S4QKU6I5.js";
|
|
7
|
+
import "./_browser-chunks/chunk-SL3VIQZ3.js";
|
|
8
8
|
|
|
9
9
|
// src/index.ts
|
|
10
10
|
import { definePreviewAddon } from "storybook/internal/csf";
|
package/dist/manager.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Source
|
|
3
|
-
} from "./_browser-chunks/chunk-
|
|
4
|
-
import "./_browser-chunks/chunk-
|
|
3
|
+
} from "./_browser-chunks/chunk-AAVP3AE4.js";
|
|
4
|
+
import "./_browser-chunks/chunk-SL3VIQZ3.js";
|
|
5
5
|
|
|
6
6
|
// src/manager.tsx
|
|
7
7
|
import React, { useEffect, useState } from "react";
|
|
@@ -13,6 +13,39 @@ import { ignoreSsrWarning, styled, useTheme } from "storybook/theming";
|
|
|
13
13
|
var ADDON_ID = "storybook/docs", PANEL_ID = `${ADDON_ID}/panel`, PARAM_KEY = "docs", SNIPPET_RENDERED = `${ADDON_ID}/snippet-rendered`;
|
|
14
14
|
|
|
15
15
|
// src/manager.tsx
|
|
16
|
+
var CodePanel = ({
|
|
17
|
+
active,
|
|
18
|
+
lastEvent,
|
|
19
|
+
currentStoryId
|
|
20
|
+
}) => {
|
|
21
|
+
let [codeSnippet, setSourceCode] = useState({
|
|
22
|
+
source: lastEvent?.source,
|
|
23
|
+
format: lastEvent?.format ?? void 0
|
|
24
|
+
}), parameter = useParameter(PARAM_KEY, {
|
|
25
|
+
source: { code: "" },
|
|
26
|
+
theme: "dark"
|
|
27
|
+
});
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
setSourceCode({
|
|
30
|
+
source: void 0,
|
|
31
|
+
format: void 0
|
|
32
|
+
});
|
|
33
|
+
}, [currentStoryId]), useChannel({
|
|
34
|
+
[SNIPPET_RENDERED]: ({ source, format }) => {
|
|
35
|
+
setSourceCode({ source, format });
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
let isDark = useTheme().base !== "light";
|
|
39
|
+
return React.createElement(AddonPanel, { active: !!active }, React.createElement(SourceStyles, null, React.createElement(
|
|
40
|
+
Source,
|
|
41
|
+
{
|
|
42
|
+
...parameter.source,
|
|
43
|
+
code: parameter.source?.code || codeSnippet.source || parameter.source?.originalSource,
|
|
44
|
+
format: codeSnippet.format,
|
|
45
|
+
dark: isDark
|
|
46
|
+
}
|
|
47
|
+
)));
|
|
48
|
+
};
|
|
16
49
|
addons.register(ADDON_ID, (api) => {
|
|
17
50
|
addons.add(PANEL_ID, {
|
|
18
51
|
title: "Code",
|
|
@@ -34,33 +67,8 @@ addons.register(ADDON_ID, (api) => {
|
|
|
34
67
|
disabled: (parameters) => !parameters?.docs?.codePanel,
|
|
35
68
|
match: ({ viewMode }) => viewMode === "story",
|
|
36
69
|
render: ({ active }) => {
|
|
37
|
-
let channel = api.getChannel(), currentStory = api.getCurrentStoryData(), lastEvent = channel?.last(SNIPPET_RENDERED)?.[0]
|
|
38
|
-
|
|
39
|
-
format: lastEvent?.format ?? void 0
|
|
40
|
-
}), parameter = useParameter(PARAM_KEY, {
|
|
41
|
-
source: { code: "" },
|
|
42
|
-
theme: "dark"
|
|
43
|
-
});
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
setSourceCode({
|
|
46
|
-
source: void 0,
|
|
47
|
-
format: void 0
|
|
48
|
-
});
|
|
49
|
-
}, [currentStory?.id]), useChannel({
|
|
50
|
-
[SNIPPET_RENDERED]: ({ source, format }) => {
|
|
51
|
-
setSourceCode({ source, format });
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
let isDark = useTheme().base !== "light";
|
|
55
|
-
return React.createElement(AddonPanel, { active: !!active }, React.createElement(SourceStyles, null, React.createElement(
|
|
56
|
-
Source,
|
|
57
|
-
{
|
|
58
|
-
...parameter.source,
|
|
59
|
-
code: parameter.source?.code || codeSnippet.source || parameter.source?.originalSource,
|
|
60
|
-
format: codeSnippet.format,
|
|
61
|
-
dark: isDark
|
|
62
|
-
}
|
|
63
|
-
)));
|
|
70
|
+
let channel = api.getChannel(), currentStory = api.getCurrentStoryData(), lastEvent = channel?.last(SNIPPET_RENDERED)?.[0];
|
|
71
|
+
return React.createElement(CodePanel, { currentStoryId: currentStory?.id, lastEvent, active });
|
|
64
72
|
}
|
|
65
73
|
});
|
|
66
74
|
});
|
package/dist/mdx-loader.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_1w2xlnkxb79 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_1w2xlnkxb79 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_1w2xlnkxb79 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_1w2xlnkxb79.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_1w2xlnkxb79.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_1w2xlnkxb79.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
compile
|
|
14
|
-
} from "./_node-chunks/chunk-
|
|
15
|
-
import "./_node-chunks/chunk-
|
|
16
|
-
import "./_node-chunks/chunk-
|
|
17
|
-
import "./_node-chunks/chunk-
|
|
14
|
+
} from "./_node-chunks/chunk-JOA4L436.js";
|
|
15
|
+
import "./_node-chunks/chunk-ZSZBTQUU.js";
|
|
16
|
+
import "./_node-chunks/chunk-2AMBYFOA.js";
|
|
17
|
+
import "./_node-chunks/chunk-W5EZ2JLN.js";
|
|
18
18
|
|
|
19
19
|
// src/mdx-loader.ts
|
|
20
20
|
var DEFAULT_RENDERER = `
|
package/dist/preset.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_1w2xlnkxb79 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_1w2xlnkxb79 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_1w2xlnkxb79 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_1w2xlnkxb79.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_1w2xlnkxb79.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_1w2xlnkxb79.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
-
import "./_node-chunks/chunk-
|
|
12
|
+
import "./_node-chunks/chunk-W5EZ2JLN.js";
|
|
13
13
|
|
|
14
14
|
// src/preset.ts
|
|
15
15
|
import { isAbsolute as isAbsolute2 } from "node:path";
|
|
@@ -19,7 +19,7 @@ import { logger } from "storybook/internal/node-logger";
|
|
|
19
19
|
// ../../core/src/shared/utils/module.ts
|
|
20
20
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
21
21
|
|
|
22
|
-
//
|
|
22
|
+
// ../../../node_modules/exsolve/dist/index.mjs
|
|
23
23
|
import assert from "node:assert";
|
|
24
24
|
import v8 from "node:v8";
|
|
25
25
|
import { format, inspect } from "node:util";
|
|
@@ -143,7 +143,7 @@ var hasOwnProperty = {}.hasOwnProperty;
|
|
|
143
143
|
var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace], own = {}.hasOwnProperty;
|
|
144
144
|
var isWindows = process.platform === "win32", globalCache = globalThis.__EXSOLVE_CACHE__ ||= /* @__PURE__ */ new Map();
|
|
145
145
|
|
|
146
|
-
//
|
|
146
|
+
// ../../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs
|
|
147
147
|
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
148
148
|
function normalizeWindowsPath(input = "") {
|
|
149
149
|
return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
@@ -227,7 +227,7 @@ var getResolvedReact = async (options) => {
|
|
|
227
227
|
};
|
|
228
228
|
};
|
|
229
229
|
async function webpack(webpackConfig = {}, options) {
|
|
230
|
-
let { module = {} } = webpackConfig, { csfPluginOptions = {}, mdxPluginOptions = {} } = options, enrichCsf = await options.presets.apply("experimental_enrichCsf"), rehypeSlug = (await import("./_node-chunks/rehype-slug-
|
|
230
|
+
let { module = {} } = webpackConfig, { csfPluginOptions = {}, mdxPluginOptions = {} } = options, enrichCsf = await options.presets.apply("experimental_enrichCsf"), rehypeSlug = (await import("./_node-chunks/rehype-slug-6JL7OKAU.js")).default, rehypeExternalLinks = (await import("./_node-chunks/rehype-external-links-JPRWE46L.js")).default, mdxLoaderOptions = await options.presets.apply("mdxLoaderOptions", {
|
|
231
231
|
...mdxPluginOptions,
|
|
232
232
|
mdxCompileOptions: {
|
|
233
233
|
providerImportSource: import.meta.resolve("@storybook/addon-docs/mdx-react-shim"),
|
|
@@ -303,7 +303,7 @@ var docs = (input = {}, options) => {
|
|
|
303
303
|
}, addons = [
|
|
304
304
|
import.meta.resolve("@storybook/react-dom-shim/preset")
|
|
305
305
|
], viteFinal = async (config, options) => {
|
|
306
|
-
let { plugins = [] } = config, { mdxPlugin } = await import("./_node-chunks/mdx-plugin-
|
|
306
|
+
let { plugins = [] } = config, { mdxPlugin } = await import("./_node-chunks/mdx-plugin-OX2BZW75.js"), { react, reactDom, mdx } = await getResolvedReact(options), packageDeduplicationPlugin = {
|
|
307
307
|
name: "storybook:package-deduplication",
|
|
308
308
|
enforce: "pre",
|
|
309
309
|
config: () => ({
|
package/dist/preview.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/addon-docs",
|
|
3
|
-
"version": "10.2.0-alpha.
|
|
3
|
+
"version": "10.2.0-alpha.10",
|
|
4
4
|
"description": "Storybook Docs: Document UI components automatically with stories and MDX",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -78,15 +78,11 @@
|
|
|
78
78
|
"*.d.ts",
|
|
79
79
|
"!src/**/*"
|
|
80
80
|
],
|
|
81
|
-
"scripts": {
|
|
82
|
-
"check": "jiti ../../../scripts/check/check-package.ts",
|
|
83
|
-
"prep": "jiti ../../../scripts/build/build-package.ts"
|
|
84
|
-
},
|
|
85
81
|
"dependencies": {
|
|
86
82
|
"@mdx-js/react": "^3.0.0",
|
|
87
|
-
"@storybook/csf-plugin": "10.2.0-alpha.
|
|
88
|
-
"@storybook/icons": "^2.0.
|
|
89
|
-
"@storybook/react-dom-shim": "10.2.0-alpha.
|
|
83
|
+
"@storybook/csf-plugin": "10.2.0-alpha.10",
|
|
84
|
+
"@storybook/icons": "^2.0.1",
|
|
85
|
+
"@storybook/react-dom-shim": "10.2.0-alpha.10",
|
|
90
86
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
91
87
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
92
88
|
"ts-dedent": "^2.0.0"
|
|
@@ -97,7 +93,7 @@
|
|
|
97
93
|
"@types/color-convert": "^2.0.0",
|
|
98
94
|
"@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
99
95
|
"color-convert": "^2.0.1",
|
|
100
|
-
"es-toolkit": "^1.
|
|
96
|
+
"es-toolkit": "^1.43.0",
|
|
101
97
|
"github-slugger": "^2.0.0",
|
|
102
98
|
"markdown-to-jsx": "^7.7.2",
|
|
103
99
|
"memoizerific": "^1.11.3",
|
|
@@ -109,11 +105,11 @@
|
|
|
109
105
|
"rehype-slug": "^6.0.0",
|
|
110
106
|
"telejson": "8.0.0",
|
|
111
107
|
"tocbot": "^4.20.1",
|
|
112
|
-
"typescript": "^5.
|
|
108
|
+
"typescript": "^5.9.3",
|
|
113
109
|
"vite": "^7.0.4"
|
|
114
110
|
},
|
|
115
111
|
"peerDependencies": {
|
|
116
|
-
"storybook": "^10.2.0-alpha.
|
|
112
|
+
"storybook": "^10.2.0-alpha.10"
|
|
117
113
|
},
|
|
118
114
|
"publishConfig": {
|
|
119
115
|
"access": "public"
|