@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.
Files changed (33) hide show
  1. package/dist/_browser-chunks/Color-S5NAVK5F.js +1096 -0
  2. package/dist/_browser-chunks/{DocsRenderer-HT7GNKAR.js → DocsRenderer-GHJI37HO.js} +2 -2
  3. package/dist/_browser-chunks/{chunk-MM7DTO55.js → chunk-A242L54C.js} +10 -16
  4. package/dist/_browser-chunks/chunk-CYSK6WYR.js +7 -0
  5. package/dist/_browser-chunks/chunk-DDRHE7EB.js +949 -0
  6. package/dist/_browser-chunks/{chunk-74ZUTOZN.js → chunk-OATZR77O.js} +9 -22
  7. package/dist/_browser-chunks/chunk-UUESKCKV.js +31 -0
  8. package/dist/_node-chunks/{chunk-QSBD55JK.js → chunk-OGE4GWLB.js} +13 -19
  9. package/dist/_node-chunks/chunk-PRNIBEEO.js +196 -0
  10. package/dist/_node-chunks/chunk-SEBYU7IP.js +168 -0
  11. package/dist/_node-chunks/chunk-SZXCUVK4.js +22630 -0
  12. package/dist/_node-chunks/mdx-plugin-NLBBLG32.js +1032 -0
  13. package/dist/_node-chunks/rehype-external-links-V2D4HT5U.js +121 -0
  14. package/dist/_node-chunks/{rehype-slug-X6WEPBMC.js → rehype-slug-U5W6TP4H.js} +24 -58
  15. package/dist/angular/index.js +3 -5
  16. package/dist/blocks.d.ts +5 -2
  17. package/dist/blocks.js +4658 -6651
  18. package/dist/ember/index.js +3 -5
  19. package/dist/index.js +4 -6
  20. package/dist/manager.js +11 -22
  21. package/dist/mdx-loader.js +13 -19
  22. package/dist/preset.js +160 -453
  23. package/dist/preview.js +2 -2
  24. package/package.json +6 -6
  25. package/dist/_browser-chunks/Color-64QXVMR3.js +0 -1675
  26. package/dist/_browser-chunks/chunk-DMNQCVA2.js +0 -12
  27. package/dist/_browser-chunks/chunk-UZFOWTVP.js +0 -974
  28. package/dist/_browser-chunks/chunk-YDZYZRYC.js +0 -39
  29. package/dist/_node-chunks/chunk-D63L7OCA.js +0 -231
  30. package/dist/_node-chunks/chunk-DB6BS7Z4.js +0 -36332
  31. package/dist/_node-chunks/chunk-Z5MUJETX.js +0 -248
  32. package/dist/_node-chunks/mdx-plugin-KCQDNOVO.js +0 -1654
  33. package/dist/_node-chunks/rehype-external-links-LSUHFLUY.js +0 -168
@@ -1,168 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_ggcqbc9ld7l from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_ggcqbc9ld7l from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_ggcqbc9ld7l from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_ggcqbc9ld7l.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_ggcqbc9ld7l.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_ggcqbc9ld7l.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
- import {
13
- esm_default,
14
- parse
15
- } from "./chunk-Z5MUJETX.js";
16
- import {
17
- visit
18
- } from "./chunk-D63L7OCA.js";
19
- import {
20
- __name
21
- } from "./chunk-QSBD55JK.js";
22
-
23
- // ../../node_modules/hast-util-is-element/lib/index.js
24
- var convertElement = (
25
- // Note: overloads in JSDoc can’t yet use different `@template`s.
26
- /**
27
- * @type {(
28
- * (<Condition extends TestFunction>(test: Condition) => (element: unknown, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => element is Element & Predicate<Condition, Element>) &
29
- * (<Condition extends string>(test: Condition) => (element: unknown, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => element is Element & {tagName: Condition}) &
30
- * ((test?: null | undefined) => (element?: unknown, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => element is Element) &
31
- * ((test?: Test) => Check)
32
- * )}
33
- */
34
- /**
35
- * @param {Test | null | undefined} [test]
36
- * @returns {Check}
37
- */
38
- /* @__PURE__ */ __name(function(test) {
39
- if (test === null || test === void 0) {
40
- return element;
41
- }
42
- if (typeof test === "string") {
43
- return tagNameFactory(test);
44
- }
45
- if (typeof test === "object") {
46
- return anyFactory(test);
47
- }
48
- if (typeof test === "function") {
49
- return castFactory(test);
50
- }
51
- throw new Error("Expected function, string, or array as `test`");
52
- }, "convertElement")
53
- );
54
- function anyFactory(tests) {
55
- const checks = [];
56
- let index = -1;
57
- while (++index < tests.length) {
58
- checks[index] = convertElement(tests[index]);
59
- }
60
- return castFactory(any);
61
- function any(...parameters) {
62
- let index2 = -1;
63
- while (++index2 < checks.length) {
64
- if (checks[index2].apply(this, parameters)) return true;
65
- }
66
- return false;
67
- }
68
- __name(any, "any");
69
- }
70
- __name(anyFactory, "anyFactory");
71
- function tagNameFactory(check) {
72
- return castFactory(tagName);
73
- function tagName(element2) {
74
- return element2.tagName === check;
75
- }
76
- __name(tagName, "tagName");
77
- }
78
- __name(tagNameFactory, "tagNameFactory");
79
- function castFactory(testFunction) {
80
- return check;
81
- function check(value, index, parent) {
82
- return Boolean(
83
- looksLikeAnElement(value) && testFunction.call(
84
- this,
85
- value,
86
- typeof index === "number" ? index : void 0,
87
- parent || void 0
88
- )
89
- );
90
- }
91
- __name(check, "check");
92
- }
93
- __name(castFactory, "castFactory");
94
- function element(element2) {
95
- return Boolean(
96
- element2 && typeof element2 === "object" && "type" in element2 && element2.type === "element" && "tagName" in element2 && typeof element2.tagName === "string"
97
- );
98
- }
99
- __name(element, "element");
100
- function looksLikeAnElement(value) {
101
- return value !== null && typeof value === "object" && "type" in value && "tagName" in value;
102
- }
103
- __name(looksLikeAnElement, "looksLikeAnElement");
104
-
105
- // ../../node_modules/is-absolute-url/index.js
106
- var ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\d+\-.]*?:/;
107
- var WINDOWS_PATH_REGEX = /^[a-zA-Z]:\\/;
108
- function isAbsoluteUrl(url) {
109
- if (typeof url !== "string") {
110
- throw new TypeError(`Expected a \`string\`, got \`${typeof url}\``);
111
- }
112
- if (WINDOWS_PATH_REGEX.test(url)) {
113
- return false;
114
- }
115
- return ABSOLUTE_URL_REGEX.test(url);
116
- }
117
- __name(isAbsoluteUrl, "isAbsoluteUrl");
118
-
119
- // ../../node_modules/rehype-external-links/lib/index.js
120
- var defaultProtocols = ["http", "https"];
121
- var defaultRel = ["nofollow"];
122
- var emptyOptions = {};
123
- function rehypeExternalLinks(options) {
124
- const settings = options || emptyOptions;
125
- const protocols = settings.protocols || defaultProtocols;
126
- const is = convertElement(settings.test);
127
- return function(tree) {
128
- visit(tree, "element", function(node, index, parent) {
129
- if (node.tagName === "a" && typeof node.properties.href === "string" && is(node, index, parent)) {
130
- const url = node.properties.href;
131
- if (isAbsoluteUrl(url) ? protocols.includes(url.slice(0, url.indexOf(":"))) : url.startsWith("//")) {
132
- const contentRaw = createIfNeeded(settings.content, node);
133
- const content = contentRaw && !Array.isArray(contentRaw) ? [contentRaw] : contentRaw;
134
- const relRaw = createIfNeeded(settings.rel, node) || defaultRel;
135
- const rel = typeof relRaw === "string" ? parse(relRaw) : relRaw;
136
- const target = createIfNeeded(settings.target, node);
137
- const properties = createIfNeeded(settings.properties, node);
138
- if (properties) {
139
- Object.assign(node.properties, esm_default(properties));
140
- }
141
- if (rel.length > 0) {
142
- node.properties.rel = [...rel];
143
- }
144
- if (target) {
145
- node.properties.target = target;
146
- }
147
- if (content) {
148
- const properties2 = createIfNeeded(settings.contentProperties, node) || {};
149
- node.children.push({
150
- type: "element",
151
- tagName: "span",
152
- properties: esm_default(properties2),
153
- children: esm_default(content)
154
- });
155
- }
156
- }
157
- }
158
- });
159
- };
160
- }
161
- __name(rehypeExternalLinks, "rehypeExternalLinks");
162
- function createIfNeeded(value, element2) {
163
- return typeof value === "function" ? value(element2) : value;
164
- }
165
- __name(createIfNeeded, "createIfNeeded");
166
- export {
167
- rehypeExternalLinks as default
168
- };