@storybook/addon-docs 10.1.0-alpha.1 → 10.1.0-alpha.11
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-CRYBIEDD.js +168 -0
- package/dist/_node-chunks/{chunk-ZUONB4NC.js → chunk-ETYU6ZWB.js} +13 -19
- package/dist/_node-chunks/chunk-PF5AWRIF.js +22630 -0
- package/dist/_node-chunks/chunk-ZRMSQWBE.js +196 -0
- package/dist/_node-chunks/mdx-plugin-655B5P4B.js +1032 -0
- package/dist/_node-chunks/rehype-external-links-V53KQFON.js +121 -0
- package/dist/_node-chunks/{rehype-slug-BU5JP743.js → rehype-slug-GNVPIIPH.js} +24 -58
- package/dist/angular/index.js +3 -5
- package/dist/blocks.d.ts +5 -2
- package/dist/blocks.js +4660 -6643
- package/dist/ember/index.js +3 -5
- package/dist/index.d.ts +8 -1
- package/dist/index.js +4 -6
- package/dist/manager.js +11 -22
- package/dist/mdx-loader.js +13 -19
- package/dist/preset.js +161 -454
- 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-AV2VT7UZ.js +0 -231
- package/dist/_node-chunks/chunk-SD2N3D7I.js +0 -36332
- package/dist/_node-chunks/chunk-Z4H2MKFK.js +0 -248
- package/dist/_node-chunks/mdx-plugin-2AVHNGP4.js +0 -1654
- package/dist/_node-chunks/rehype-external-links-4APV7Y23.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.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as storybook_internal_csf from 'storybook/internal/csf';
|
|
2
|
-
import { ReactElement, ComponentType } from 'react';
|
|
2
|
+
import React$1, { ReactElement, ComponentType } from 'react';
|
|
3
3
|
import { Renderer, DocsContextProps, ModuleExport, ModuleExports, DocsRenderFunction } from 'storybook/internal/types';
|
|
4
4
|
import { ThemeVars } from 'storybook/theming';
|
|
5
5
|
|
|
@@ -260,6 +260,13 @@ declare class DocsRenderer<TRenderer extends Renderer> {
|
|
|
260
260
|
constructor();
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
+
declare module 'mdx/types' {
|
|
264
|
+
namespace JSX {
|
|
265
|
+
type Element = React$1.JSX.Element;
|
|
266
|
+
type ElementClass = React$1.JSX.ElementClass;
|
|
267
|
+
type IntrinsicElements = React$1.JSX.IntrinsicElements;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
263
270
|
declare const _default: () => storybook_internal_csf.PreviewAddon<DocsTypes>;
|
|
264
271
|
|
|
265
272
|
export { DocsRenderer, type DocsTypes, _default as default };
|
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_lch4wox9a5 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_lch4wox9a5 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_lch4wox9a5 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_lch4wox9a5.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_lch4wox9a5.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_lch4wox9a5.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-ZUONB4NC.js";
|
|
14
|
+
} from "./_node-chunks/chunk-PF5AWRIF.js";
|
|
15
|
+
import "./_node-chunks/chunk-ZRMSQWBE.js";
|
|
16
|
+
import "./_node-chunks/chunk-CRYBIEDD.js";
|
|
17
|
+
import "./_node-chunks/chunk-ETYU6ZWB.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
|