@storybook/addon-docs 10.1.0-alpha.8 → 10.1.0-beta.0
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-S5NAVK5F.js +1096 -0
- package/dist/_browser-chunks/{DocsRenderer-HT7GNKAR.js → DocsRenderer-GHJI37HO.js} +2 -2
- package/dist/_browser-chunks/{chunk-MM7DTO55.js → chunk-A242L54C.js} +10 -16
- package/dist/_browser-chunks/chunk-CYSK6WYR.js +7 -0
- package/dist/_browser-chunks/chunk-DDRHE7EB.js +949 -0
- package/dist/_browser-chunks/{chunk-74ZUTOZN.js → chunk-OATZR77O.js} +9 -22
- package/dist/_browser-chunks/chunk-UUESKCKV.js +31 -0
- package/dist/_node-chunks/{chunk-QSBD55JK.js → chunk-OGE4GWLB.js} +13 -19
- package/dist/_node-chunks/chunk-PRNIBEEO.js +196 -0
- package/dist/_node-chunks/chunk-SEBYU7IP.js +168 -0
- package/dist/_node-chunks/chunk-SZXCUVK4.js +22630 -0
- package/dist/_node-chunks/mdx-plugin-NLBBLG32.js +1032 -0
- package/dist/_node-chunks/rehype-external-links-V2D4HT5U.js +121 -0
- package/dist/_node-chunks/{rehype-slug-X6WEPBMC.js → rehype-slug-U5W6TP4H.js} +24 -58
- package/dist/angular/index.js +3 -5
- package/dist/blocks.d.ts +5 -2
- package/dist/blocks.js +4658 -6651
- package/dist/ember/index.js +3 -5
- package/dist/index.js +4 -6
- package/dist/manager.js +11 -22
- package/dist/mdx-loader.js +13 -19
- package/dist/preset.js +160 -453
- package/dist/preview.js +2 -2
- package/package.json +6 -6
- package/dist/_browser-chunks/Color-64QXVMR3.js +0 -1675
- package/dist/_browser-chunks/chunk-DMNQCVA2.js +0 -12
- package/dist/_browser-chunks/chunk-UZFOWTVP.js +0 -974
- package/dist/_browser-chunks/chunk-YDZYZRYC.js +0 -39
- package/dist/_node-chunks/chunk-D63L7OCA.js +0 -231
- package/dist/_node-chunks/chunk-DB6BS7Z4.js +0 -36332
- package/dist/_node-chunks/chunk-Z5MUJETX.js +0 -248
- package/dist/_node-chunks/mdx-plugin-KCQDNOVO.js +0 -1654
- package/dist/_node-chunks/rehype-external-links-LSUHFLUY.js +0 -168
package/dist/ember/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
__name
|
|
3
|
-
} from "../_browser-chunks/chunk-MM7DTO55.js";
|
|
1
|
+
import "../_browser-chunks/chunk-A242L54C.js";
|
|
4
2
|
|
|
5
3
|
// src/ember/index.ts
|
|
6
|
-
var setJSONDoc =
|
|
4
|
+
var setJSONDoc = (jsondoc) => {
|
|
7
5
|
globalThis.__EMBER_GENERATED_DOC_JSON__ = jsondoc;
|
|
8
|
-
}
|
|
6
|
+
};
|
|
9
7
|
export {
|
|
10
8
|
setJSONDoc
|
|
11
9
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DocsRenderer
|
|
3
|
-
} from "./_browser-chunks/chunk-
|
|
3
|
+
} from "./_browser-chunks/chunk-OATZR77O.js";
|
|
4
4
|
import {
|
|
5
5
|
preview_exports
|
|
6
|
-
} from "./_browser-chunks/chunk-
|
|
7
|
-
import
|
|
8
|
-
__name
|
|
9
|
-
} from "./_browser-chunks/chunk-MM7DTO55.js";
|
|
6
|
+
} from "./_browser-chunks/chunk-UUESKCKV.js";
|
|
7
|
+
import "./_browser-chunks/chunk-A242L54C.js";
|
|
10
8
|
|
|
11
9
|
// src/index.ts
|
|
12
10
|
import { definePreviewAddon } from "storybook/internal/csf";
|
|
13
|
-
var index_default =
|
|
11
|
+
var index_default = () => definePreviewAddon(preview_exports);
|
|
14
12
|
export {
|
|
15
13
|
DocsRenderer,
|
|
16
14
|
index_default as default
|
package/dist/manager.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Source
|
|
3
|
-
} from "./_browser-chunks/chunk-
|
|
4
|
-
import
|
|
5
|
-
__name
|
|
6
|
-
} from "./_browser-chunks/chunk-MM7DTO55.js";
|
|
3
|
+
} from "./_browser-chunks/chunk-DDRHE7EB.js";
|
|
4
|
+
import "./_browser-chunks/chunk-A242L54C.js";
|
|
7
5
|
|
|
8
6
|
// src/manager.tsx
|
|
9
7
|
import React, { useEffect, useState } from "react";
|
|
@@ -12,10 +10,7 @@ import { addons, types, useChannel, useParameter } from "storybook/manager-api";
|
|
|
12
10
|
import { ignoreSsrWarning, styled, useTheme } from "storybook/theming";
|
|
13
11
|
|
|
14
12
|
// ../../core/src/docs-tools/shared.ts
|
|
15
|
-
var ADDON_ID = "storybook/docs"
|
|
16
|
-
var PANEL_ID = `${ADDON_ID}/panel`;
|
|
17
|
-
var PARAM_KEY = `docs`;
|
|
18
|
-
var SNIPPET_RENDERED = `${ADDON_ID}/snippet-rendered`;
|
|
13
|
+
var ADDON_ID = "storybook/docs", PANEL_ID = `${ADDON_ID}/panel`, PARAM_KEY = "docs", SNIPPET_RENDERED = `${ADDON_ID}/snippet-rendered`;
|
|
19
14
|
|
|
20
15
|
// src/manager.tsx
|
|
21
16
|
addons.register(ADDON_ID, (api) => {
|
|
@@ -36,17 +31,13 @@ addons.register(ADDON_ID, (api) => {
|
|
|
36
31
|
* },
|
|
37
32
|
* ```
|
|
38
33
|
*/
|
|
39
|
-
disabled:
|
|
40
|
-
match:
|
|
41
|
-
render:
|
|
42
|
-
|
|
43
|
-
const currentStory = api.getCurrentStoryData();
|
|
44
|
-
const lastEvent = channel?.last(SNIPPET_RENDERED)?.[0];
|
|
45
|
-
const [codeSnippet, setSourceCode] = useState({
|
|
34
|
+
disabled: (parameters) => !parameters?.docs?.codePanel,
|
|
35
|
+
match: ({ viewMode }) => viewMode === "story",
|
|
36
|
+
render: ({ active }) => {
|
|
37
|
+
let channel = api.getChannel(), currentStory = api.getCurrentStoryData(), lastEvent = channel?.last(SNIPPET_RENDERED)?.[0], [codeSnippet, setSourceCode] = useState({
|
|
46
38
|
source: lastEvent?.source,
|
|
47
39
|
format: lastEvent?.format ?? void 0
|
|
48
|
-
})
|
|
49
|
-
const parameter = useParameter(PARAM_KEY, {
|
|
40
|
+
}), parameter = useParameter(PARAM_KEY, {
|
|
50
41
|
source: { code: "" },
|
|
51
42
|
theme: "dark"
|
|
52
43
|
});
|
|
@@ -55,14 +46,12 @@ addons.register(ADDON_ID, (api) => {
|
|
|
55
46
|
source: void 0,
|
|
56
47
|
format: void 0
|
|
57
48
|
});
|
|
58
|
-
}, [currentStory?.id])
|
|
59
|
-
useChannel({
|
|
49
|
+
}, [currentStory?.id]), useChannel({
|
|
60
50
|
[SNIPPET_RENDERED]: ({ source, format }) => {
|
|
61
51
|
setSourceCode({ source, format });
|
|
62
52
|
}
|
|
63
53
|
});
|
|
64
|
-
|
|
65
|
-
const isDark = theme.base !== "light";
|
|
54
|
+
let isDark = useTheme().base !== "light";
|
|
66
55
|
return React.createElement(AddonPanel, { active: !!active }, React.createElement(SourceStyles, null, React.createElement(
|
|
67
56
|
Source,
|
|
68
57
|
{
|
|
@@ -72,7 +61,7 @@ addons.register(ADDON_ID, (api) => {
|
|
|
72
61
|
dark: isDark
|
|
73
62
|
}
|
|
74
63
|
)));
|
|
75
|
-
}
|
|
64
|
+
}
|
|
76
65
|
});
|
|
77
66
|
});
|
|
78
67
|
var SourceStyles = styled.div(() => ({
|
package/dist/mdx-loader.js
CHANGED
|
@@ -1,41 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_2pgro2geduh from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_2pgro2geduh from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_2pgro2geduh from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_2pgro2geduh.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_2pgro2geduh.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_2pgro2geduh.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
|
|
18
|
-
__name
|
|
19
|
-
} from "./_node-chunks/chunk-QSBD55JK.js";
|
|
14
|
+
} from "./_node-chunks/chunk-SZXCUVK4.js";
|
|
15
|
+
import "./_node-chunks/chunk-PRNIBEEO.js";
|
|
16
|
+
import "./_node-chunks/chunk-SEBYU7IP.js";
|
|
17
|
+
import "./_node-chunks/chunk-OGE4GWLB.js";
|
|
20
18
|
|
|
21
19
|
// src/mdx-loader.ts
|
|
22
20
|
var DEFAULT_RENDERER = `
|
|
23
21
|
import React from 'react';
|
|
24
22
|
`;
|
|
25
23
|
async function loader(content) {
|
|
26
|
-
|
|
27
|
-
const options = { ...this.getOptions(), filepath: this.resourcePath };
|
|
24
|
+
let callback = this.async(), options = { ...this.getOptions(), filepath: this.resourcePath };
|
|
28
25
|
try {
|
|
29
|
-
|
|
30
|
-
const code = `${DEFAULT_RENDERER}
|
|
26
|
+
let result = await compile(content, options), code = `${DEFAULT_RENDERER}
|
|
31
27
|
${result}`;
|
|
32
28
|
return callback(null, code);
|
|
33
29
|
} catch (err) {
|
|
34
|
-
console.error("Error loading:", this.resourcePath);
|
|
35
|
-
return callback(err);
|
|
30
|
+
return console.error("Error loading:", this.resourcePath), callback(err);
|
|
36
31
|
}
|
|
37
32
|
}
|
|
38
|
-
__name(loader, "loader");
|
|
39
33
|
var mdx_loader_default = loader;
|
|
40
34
|
export {
|
|
41
35
|
mdx_loader_default as default
|