@storybook/addon-docs 9.2.0-alpha.3 → 10.0.0-beta.1

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 (63) hide show
  1. package/README.md +5 -3
  2. package/dist/_browser-chunks/Color-LWAWP22K.js +1566 -0
  3. package/dist/_browser-chunks/DocsRenderer-HT7GNKAR.js +9 -0
  4. package/dist/_browser-chunks/chunk-67KILNXL.js +6831 -0
  5. package/dist/_browser-chunks/chunk-74ZUTOZN.js +65 -0
  6. package/dist/_browser-chunks/chunk-MM7DTO55.js +44 -0
  7. package/dist/_browser-chunks/chunk-RX6225WF.js +46 -0
  8. package/dist/_browser-chunks/chunk-TQ5Q4DDG.js +846 -0
  9. package/dist/_browser-chunks/chunk-UZFOWTVP.js +974 -0
  10. package/dist/_node-chunks/chunk-6DADMWJS.js +248 -0
  11. package/dist/_node-chunks/chunk-LNIOBV3K.js +231 -0
  12. package/dist/_node-chunks/chunk-QLR5HOHE.js +48 -0
  13. package/dist/_node-chunks/chunk-YXBYQIGE.js +35424 -0
  14. package/dist/_node-chunks/mdx-plugin-NOHB7LLV.js +1653 -0
  15. package/dist/_node-chunks/rehype-external-links-D74PKVP3.js +168 -0
  16. package/dist/_node-chunks/rehype-slug-KQZG2QNC.js +127 -0
  17. package/dist/angular/index.d.ts +3 -0
  18. package/dist/angular/index.js +11 -0
  19. package/dist/blocks.d.ts +86 -42
  20. package/dist/blocks.js +8123 -201
  21. package/dist/ember/index.d.ts +3 -0
  22. package/dist/ember/index.js +11 -0
  23. package/dist/index.d.ts +42 -5
  24. package/dist/index.js +17 -15
  25. package/dist/manager.js +85 -154
  26. package/dist/mdx-loader.js +38 -71
  27. package/dist/mdx-react-shim.js +2 -0
  28. package/dist/preset.js +310 -72
  29. package/dist/preview.js +8 -13
  30. package/dist/web-components/index.d.ts +2 -0
  31. package/dist/web-components/index.js +0 -0
  32. package/manager.js +1 -1
  33. package/package.json +45 -89
  34. package/preset.js +1 -1
  35. package/preview.js +1 -1
  36. package/angular/README.md +0 -256
  37. package/angular/index.d.ts +0 -1
  38. package/angular/index.js +0 -4
  39. package/common/README.md +0 -98
  40. package/dist/Color-AVL7NMMY.mjs +0 -10
  41. package/dist/DocsContainer-fccc2203.d.ts +0 -51
  42. package/dist/DocsRenderer-3PZUHFFL.mjs +0 -2
  43. package/dist/DocsRenderer-ULRJ3H2C.mjs +0 -8
  44. package/dist/blocks.mjs +0 -213
  45. package/dist/chunk-2UFMRE4V.mjs +0 -5
  46. package/dist/chunk-CEH6MNVV.mjs +0 -3
  47. package/dist/chunk-GWJYCGSQ.mjs +0 -7
  48. package/dist/chunk-QUZPS4B6.mjs +0 -3
  49. package/dist/chunk-SPFYY5GD.mjs +0 -3
  50. package/dist/index.mjs +0 -8
  51. package/dist/preview.mjs +0 -5
  52. package/dist/shims/mdx-react-shim.js +0 -12
  53. package/dist/shims/mdx-react-shim.mjs +0 -1
  54. package/ember/README.md +0 -153
  55. package/ember/index.d.ts +0 -1
  56. package/ember/index.js +0 -3
  57. package/react/README.md +0 -149
  58. package/svelte/HOC.svelte +0 -7
  59. package/vue/README.md +0 -152
  60. package/vue3/README.md +0 -152
  61. package/web-components/README.md +0 -131
  62. package/web-components/index.js +0 -1
  63. /package/dist/{shims/mdx-react-shim.d.ts → mdx-react-shim.d.ts} +0 -0
@@ -0,0 +1,65 @@
1
+ import {
2
+ __name
3
+ } from "./chunk-MM7DTO55.js";
4
+
5
+ // src/DocsRenderer.tsx
6
+ import React, { Component } from "react";
7
+ import { renderElement, unmountElement } from "@storybook/react-dom-shim";
8
+ import { AnchorMdx, CodeOrSourceMdx, Docs, HeadersMdx } from "@storybook/addon-docs/blocks";
9
+ var defaultComponents = {
10
+ code: CodeOrSourceMdx,
11
+ a: AnchorMdx,
12
+ ...HeadersMdx
13
+ };
14
+ var _ErrorBoundary = class _ErrorBoundary extends Component {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.state = { hasError: false };
18
+ }
19
+ static getDerivedStateFromError() {
20
+ return { hasError: true };
21
+ }
22
+ componentDidCatch(err) {
23
+ const { showException } = this.props;
24
+ showException(err);
25
+ }
26
+ render() {
27
+ const { hasError } = this.state;
28
+ const { children } = this.props;
29
+ return hasError ? null : React.createElement(React.Fragment, null, children);
30
+ }
31
+ };
32
+ __name(_ErrorBoundary, "ErrorBoundary");
33
+ var ErrorBoundary = _ErrorBoundary;
34
+ var _DocsRenderer = class _DocsRenderer {
35
+ constructor() {
36
+ this.render = async (context, docsParameter, element) => {
37
+ const components = {
38
+ ...defaultComponents,
39
+ ...docsParameter?.components
40
+ };
41
+ const TDocs = Docs;
42
+ return new Promise((resolve, reject) => {
43
+ import("@mdx-js/react").then(
44
+ ({ MDXProvider }) => (
45
+ // We use a `key={}` here to reset the `hasError` state each time we render ErrorBoundary
46
+ renderElement(
47
+ React.createElement(ErrorBoundary, { showException: reject, key: Math.random() }, React.createElement(MDXProvider, { components }, React.createElement(TDocs, { context, docsParameter }))),
48
+ element
49
+ )
50
+ )
51
+ ).then(() => resolve());
52
+ });
53
+ };
54
+ this.unmount = (element) => {
55
+ unmountElement(element);
56
+ };
57
+ }
58
+ };
59
+ __name(_DocsRenderer, "DocsRenderer");
60
+ var DocsRenderer = _DocsRenderer;
61
+
62
+ export {
63
+ defaultComponents,
64
+ DocsRenderer
65
+ };
@@ -0,0 +1,44 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
9
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
10
+ }) : x)(function(x) {
11
+ if (typeof require !== "undefined") return require.apply(this, arguments);
12
+ throw Error('Dynamic require of "' + x + '" is not supported');
13
+ });
14
+ var __commonJS = (cb, mod) => function __require2() {
15
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
16
+ };
17
+ var __export = (target, all) => {
18
+ for (var name in all)
19
+ __defProp(target, name, { get: all[name], enumerable: true });
20
+ };
21
+ var __copyProps = (to, from, except, desc) => {
22
+ if (from && typeof from === "object" || typeof from === "function") {
23
+ for (let key of __getOwnPropNames(from))
24
+ if (!__hasOwnProp.call(to, key) && key !== except)
25
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
26
+ }
27
+ return to;
28
+ };
29
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
30
+ // If the importer is in node compatibility mode or this is not an ESM
31
+ // file that has been converted to a CommonJS file using a Babel-
32
+ // compatible transform (i.e. "__esModule" has not been set), then set
33
+ // "default" to the CommonJS "module.exports" for node compatibility.
34
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
35
+ mod
36
+ ));
37
+
38
+ export {
39
+ __name,
40
+ __require,
41
+ __commonJS,
42
+ __export,
43
+ __toESM
44
+ };
@@ -0,0 +1,46 @@
1
+ import {
2
+ tocbot_default,
3
+ tocbot_exports
4
+ } from "./chunk-TQ5Q4DDG.js";
5
+ import {
6
+ __export,
7
+ __name
8
+ } from "./chunk-MM7DTO55.js";
9
+
10
+ // src/preview.ts
11
+ var preview_exports = {};
12
+ __export(preview_exports, {
13
+ parameters: () => parameters
14
+ });
15
+ if (!globalThis.__STORYBOOK_UNSAFE_TOCBOT__) {
16
+ globalThis.__STORYBOOK_UNSAFE_TOCBOT__ = tocbot_default ?? tocbot_exports;
17
+ }
18
+ var excludeTags = Object.entries(globalThis.TAGS_OPTIONS ?? {}).reduce(
19
+ (acc, entry) => {
20
+ const [tag, option] = entry;
21
+ if (option.excludeFromDocsStories) {
22
+ acc[tag] = true;
23
+ }
24
+ return acc;
25
+ },
26
+ {}
27
+ );
28
+ var parameters = {
29
+ docs: {
30
+ renderer: /* @__PURE__ */ __name(async () => {
31
+ const { DocsRenderer } = await import("./DocsRenderer-HT7GNKAR.js");
32
+ return new DocsRenderer();
33
+ }, "renderer"),
34
+ stories: {
35
+ filter: /* @__PURE__ */ __name((story) => {
36
+ const tags = story.tags || [];
37
+ return tags.filter((tag) => excludeTags[tag]).length === 0 && !story.parameters.docs?.disable;
38
+ }, "filter")
39
+ }
40
+ }
41
+ };
42
+
43
+ export {
44
+ parameters,
45
+ preview_exports
46
+ };