@storybook/addon-docs 10.1.0-alpha.10 → 10.1.0-alpha.12

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-AAP3IT42.js → chunk-C335KFTP.js} +13 -19
  9. package/dist/_node-chunks/chunk-KYCOJTNB.js +168 -0
  10. package/dist/_node-chunks/chunk-O7PYD3IJ.js +22630 -0
  11. package/dist/_node-chunks/chunk-W3QUNYQ5.js +196 -0
  12. package/dist/_node-chunks/mdx-plugin-DEILFM7O.js +1032 -0
  13. package/dist/_node-chunks/rehype-external-links-5BFMYXOM.js +121 -0
  14. package/dist/_node-chunks/{rehype-slug-NPV5OLTF.js → rehype-slug-WW2KPWVT.js} +24 -58
  15. package/dist/angular/index.js +3 -5
  16. package/dist/blocks.d.ts +4 -2
  17. package/dist/blocks.js +1833 -3846
  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 +155 -454
  23. package/dist/preview.js +2 -2
  24. package/package.json +6 -6
  25. package/dist/_browser-chunks/Color-553OW3OY.js +0 -1694
  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-BHIBLL2L.js +0 -36332
  30. package/dist/_node-chunks/chunk-RAVRMRBT.js +0 -248
  31. package/dist/_node-chunks/chunk-TSMODHW2.js +0 -231
  32. package/dist/_node-chunks/mdx-plugin-OGZHIA54.js +0 -1654
  33. package/dist/_node-chunks/rehype-external-links-32F3YIMH.js +0 -168
@@ -1,7 +1,3 @@
1
- import {
2
- __name
3
- } from "./chunk-MM7DTO55.js";
4
-
5
1
  // src/DocsRenderer.tsx
6
2
  import React, { Component } from "react";
7
3
  import { renderElement, unmountElement } from "@storybook/react-dom-shim";
@@ -10,35 +6,29 @@ var defaultComponents = {
10
6
  code: CodeOrSourceMdx,
11
7
  a: AnchorMdx,
12
8
  ...HeadersMdx
13
- };
14
- var _ErrorBoundary = class _ErrorBoundary extends Component {
9
+ }, ErrorBoundary = class extends Component {
15
10
  constructor() {
16
11
  super(...arguments);
17
- this.state = { hasError: false };
12
+ this.state = { hasError: !1 };
18
13
  }
19
14
  static getDerivedStateFromError() {
20
- return { hasError: true };
15
+ return { hasError: !0 };
21
16
  }
22
17
  componentDidCatch(err) {
23
- const { showException } = this.props;
18
+ let { showException } = this.props;
24
19
  showException(err);
25
20
  }
26
21
  render() {
27
- const { hasError } = this.state;
28
- const { children } = this.props;
22
+ let { hasError } = this.state, { children } = this.props;
29
23
  return hasError ? null : React.createElement(React.Fragment, null, children);
30
24
  }
31
- };
32
- __name(_ErrorBoundary, "ErrorBoundary");
33
- var ErrorBoundary = _ErrorBoundary;
34
- var _DocsRenderer = class _DocsRenderer {
25
+ }, DocsRenderer = class {
35
26
  constructor() {
36
27
  this.render = async (context, docsParameter, element) => {
37
- const components = {
28
+ let components = {
38
29
  ...defaultComponents,
39
30
  ...docsParameter?.components
40
- };
41
- const TDocs = Docs;
31
+ }, TDocs = Docs;
42
32
  return new Promise((resolve, reject) => {
43
33
  import("@mdx-js/react").then(
44
34
  ({ MDXProvider }) => (
@@ -50,14 +40,11 @@ var _DocsRenderer = class _DocsRenderer {
50
40
  )
51
41
  ).then(() => resolve());
52
42
  });
53
- };
54
- this.unmount = (element) => {
43
+ }, this.unmount = (element) => {
55
44
  unmountElement(element);
56
45
  };
57
46
  }
58
47
  };
59
- __name(_DocsRenderer, "DocsRenderer");
60
- var DocsRenderer = _DocsRenderer;
61
48
 
62
49
  export {
63
50
  defaultComponents,
@@ -0,0 +1,31 @@
1
+ import {
2
+ __export
3
+ } from "./chunk-A242L54C.js";
4
+
5
+ // src/preview.ts
6
+ var preview_exports = {};
7
+ __export(preview_exports, {
8
+ parameters: () => parameters
9
+ });
10
+ var excludeTags = Object.entries(globalThis.TAGS_OPTIONS ?? {}).reduce(
11
+ (acc, entry) => {
12
+ let [tag, option] = entry;
13
+ return option.excludeFromDocsStories && (acc[tag] = !0), acc;
14
+ },
15
+ {}
16
+ ), parameters = {
17
+ docs: {
18
+ renderer: async () => {
19
+ let { DocsRenderer } = await import("./DocsRenderer-GHJI37HO.js");
20
+ return new DocsRenderer();
21
+ },
22
+ stories: {
23
+ filter: (story) => (story.tags || []).filter((tag) => excludeTags[tag]).length === 0 && !story.parameters.docs?.disable
24
+ }
25
+ }
26
+ };
27
+
28
+ export {
29
+ parameters,
30
+ preview_exports
31
+ };
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_l24grcih83q from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_l24grcih83q from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_l24grcih83q from "node:module";
1
+ import CJS_COMPAT_NODE_URL_nnw3aq5pfe from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_nnw3aq5pfe from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_nnw3aq5pfe from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_l24grcih83q.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_l24grcih83q.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_l24grcih83q.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_nnw3aq5pfe.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_nnw3aq5pfe.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_nnw3aq5pfe.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -13,22 +13,17 @@ var __create = Object.create;
13
13
  var __defProp = Object.defineProperty;
14
14
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
15
15
  var __getOwnPropNames = Object.getOwnPropertyNames;
16
- var __getProtoOf = Object.getPrototypeOf;
17
- var __hasOwnProp = Object.prototype.hasOwnProperty;
18
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
19
- var __commonJS = (cb, mod) => function __require() {
16
+ var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
17
+ var __commonJS = (cb, mod) => function() {
20
18
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
21
19
  };
22
20
  var __export = (target, all) => {
23
21
  for (var name in all)
24
- __defProp(target, name, { get: all[name], enumerable: true });
25
- };
26
- var __copyProps = (to, from, except, desc) => {
27
- if (from && typeof from === "object" || typeof from === "function") {
22
+ __defProp(target, name, { get: all[name], enumerable: !0 });
23
+ }, __copyProps = (to, from, except, desc) => {
24
+ if (from && typeof from == "object" || typeof from == "function")
28
25
  for (let key of __getOwnPropNames(from))
29
- if (!__hasOwnProp.call(to, key) && key !== except)
30
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
31
- }
26
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
32
27
  return to;
33
28
  };
34
29
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
@@ -36,12 +31,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
36
31
  // file that has been converted to a CommonJS file using a Babel-
37
32
  // compatible transform (i.e. "__esModule" has not been set), then set
38
33
  // "default" to the CommonJS "module.exports" for node compatibility.
39
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
40
35
  mod
41
36
  ));
42
37
 
43
38
  export {
44
- __name,
45
39
  __commonJS,
46
40
  __export,
47
41
  __toESM
@@ -0,0 +1,168 @@
1
+ import CJS_COMPAT_NODE_URL_nnw3aq5pfe from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_nnw3aq5pfe from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_nnw3aq5pfe from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_nnw3aq5pfe.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_nnw3aq5pfe.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_nnw3aq5pfe.createRequire(import.meta.url);
8
+
9
+ // ------------------------------------------------------------
10
+ // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
+ // ------------------------------------------------------------
12
+
13
+ // ../../node_modules/unist-util-is/lib/index.js
14
+ var convert = (
15
+ // Note: overloads in JSDoc can’t yet use different `@template`s.
16
+ /**
17
+ * @type {(
18
+ * (<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &
19
+ * (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &
20
+ * (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &
21
+ * ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &
22
+ * ((test?: Test) => Check)
23
+ * )}
24
+ */
25
+ /**
26
+ * @param {Test} [test]
27
+ * @returns {Check}
28
+ */
29
+ (function(test) {
30
+ if (test == null)
31
+ return ok;
32
+ if (typeof test == "function")
33
+ return castFactory(test);
34
+ if (typeof test == "object")
35
+ return Array.isArray(test) ? anyFactory(test) : (
36
+ // Cast because `ReadonlyArray` goes into the above but `isArray`
37
+ // narrows to `Array`.
38
+ propertiesFactory(
39
+ /** @type {Props} */
40
+ test
41
+ )
42
+ );
43
+ if (typeof test == "string")
44
+ return typeFactory(test);
45
+ throw new Error("Expected function, string, or object as test");
46
+ })
47
+ );
48
+ function anyFactory(tests) {
49
+ let checks = [], index = -1;
50
+ for (; ++index < tests.length; )
51
+ checks[index] = convert(tests[index]);
52
+ return castFactory(any);
53
+ function any(...parameters) {
54
+ let index2 = -1;
55
+ for (; ++index2 < checks.length; )
56
+ if (checks[index2].apply(this, parameters)) return !0;
57
+ return !1;
58
+ }
59
+ }
60
+ function propertiesFactory(check) {
61
+ let checkAsRecord = (
62
+ /** @type {Record<string, unknown>} */
63
+ check
64
+ );
65
+ return castFactory(all);
66
+ function all(node) {
67
+ let nodeAsRecord = (
68
+ /** @type {Record<string, unknown>} */
69
+ /** @type {unknown} */
70
+ node
71
+ ), key;
72
+ for (key in check)
73
+ if (nodeAsRecord[key] !== checkAsRecord[key]) return !1;
74
+ return !0;
75
+ }
76
+ }
77
+ function typeFactory(check) {
78
+ return castFactory(type);
79
+ function type(node) {
80
+ return node && node.type === check;
81
+ }
82
+ }
83
+ function castFactory(testFunction) {
84
+ return check;
85
+ function check(value, index, parent) {
86
+ return !!(looksLikeANode(value) && testFunction.call(
87
+ this,
88
+ value,
89
+ typeof index == "number" ? index : void 0,
90
+ parent || void 0
91
+ ));
92
+ }
93
+ }
94
+ function ok() {
95
+ return !0;
96
+ }
97
+ function looksLikeANode(value) {
98
+ return value !== null && typeof value == "object" && "type" in value;
99
+ }
100
+
101
+ // ../../node_modules/unist-util-visit-parents/lib/color.node.js
102
+ function color(d) {
103
+ return "\x1B[33m" + d + "\x1B[39m";
104
+ }
105
+
106
+ // ../../node_modules/unist-util-visit-parents/lib/index.js
107
+ var empty = [], CONTINUE = !0, EXIT = !1, SKIP = "skip";
108
+ function visitParents(tree, test, visitor, reverse) {
109
+ let check;
110
+ typeof test == "function" && typeof visitor != "function" ? (reverse = visitor, visitor = test) : check = test;
111
+ let is2 = convert(check), step = reverse ? -1 : 1;
112
+ factory(tree, void 0, [])();
113
+ function factory(node, index, parents) {
114
+ let value = (
115
+ /** @type {Record<string, unknown>} */
116
+ node && typeof node == "object" ? node : {}
117
+ );
118
+ if (typeof value.type == "string") {
119
+ let name = (
120
+ // `hast`
121
+ typeof value.tagName == "string" ? value.tagName : (
122
+ // `xast`
123
+ typeof value.name == "string" ? value.name : void 0
124
+ )
125
+ );
126
+ Object.defineProperty(visit2, "name", {
127
+ value: "node (" + color(node.type + (name ? "<" + name + ">" : "")) + ")"
128
+ });
129
+ }
130
+ return visit2;
131
+ function visit2() {
132
+ let result = empty, subresult, offset, grandparents;
133
+ if ((!test || is2(node, index, parents[parents.length - 1] || void 0)) && (result = toResult(visitor(node, parents)), result[0] === EXIT))
134
+ return result;
135
+ if ("children" in node && node.children) {
136
+ let nodeAsParent = (
137
+ /** @type {UnistParent} */
138
+ node
139
+ );
140
+ if (nodeAsParent.children && result[0] !== SKIP)
141
+ for (offset = (reverse ? nodeAsParent.children.length : -1) + step, grandparents = parents.concat(nodeAsParent); offset > -1 && offset < nodeAsParent.children.length; ) {
142
+ let child = nodeAsParent.children[offset];
143
+ if (subresult = factory(child, offset, grandparents)(), subresult[0] === EXIT)
144
+ return subresult;
145
+ offset = typeof subresult[1] == "number" ? subresult[1] : offset + step;
146
+ }
147
+ }
148
+ return result;
149
+ }
150
+ }
151
+ }
152
+ function toResult(value) {
153
+ return Array.isArray(value) ? value : typeof value == "number" ? [CONTINUE, value] : value == null ? empty : [value];
154
+ }
155
+
156
+ // ../../node_modules/unist-util-visit/lib/index.js
157
+ function visit(tree, testOrVisitor, visitorOrReverse, maybeReverse) {
158
+ let reverse, test, visitor;
159
+ typeof testOrVisitor == "function" && typeof visitorOrReverse != "function" ? (test = void 0, visitor = testOrVisitor, reverse = visitorOrReverse) : (test = testOrVisitor, visitor = visitorOrReverse, reverse = maybeReverse), visitParents(tree, test, overload, reverse);
160
+ function overload(node, parents) {
161
+ let parent = parents[parents.length - 1], index = parent ? parent.children.indexOf(node) : void 0;
162
+ return visitor(node, index, parent);
163
+ }
164
+ }
165
+
166
+ export {
167
+ visit
168
+ };