@storybook/addon-docs 7.0.0-alpha.6 → 7.0.0-alpha.61

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 (134) hide show
  1. package/README.md +14 -77
  2. package/angular/index.js +1 -1
  3. package/dist/DocsRenderer-FLOC7YSC.mjs +1 -0
  4. package/dist/chunk-HXSBEJGO.mjs +1 -0
  5. package/dist/chunk-MA2MUXQN.mjs +1 -0
  6. package/dist/index.d.ts +10 -0
  7. package/dist/index.js +1 -0
  8. package/dist/index.mjs +1 -0
  9. package/dist/preset.d.ts +5 -0
  10. package/dist/preset.js +7 -0
  11. package/dist/preset.mjs +7 -0
  12. package/dist/preview.d.ts +3 -0
  13. package/dist/preview.js +1 -0
  14. package/dist/preview.mjs +1 -0
  15. package/dist/shims/mdx-react-shim.d.ts +1 -0
  16. package/dist/shims/mdx-react-shim.js +1 -0
  17. package/dist/shims/mdx-react-shim.mjs +1 -0
  18. package/jest-transform-mdx.js +4 -3
  19. package/jest.config.js +7 -0
  20. package/package.json +80 -46
  21. package/preset.js +1 -1
  22. package/preview.js +2 -1
  23. package/web-components/README.md +1 -0
  24. package/LICENSE +0 -21
  25. package/blocks.d.ts +0 -2
  26. package/blocks.js +0 -14
  27. package/dist/cjs/blocks/Anchor.js +0 -23
  28. package/dist/cjs/blocks/ArgsTable.js +0 -329
  29. package/dist/cjs/blocks/Canvas.js +0 -119
  30. package/dist/cjs/blocks/Description.js +0 -126
  31. package/dist/cjs/blocks/DocsContainer.js +0 -134
  32. package/dist/cjs/blocks/DocsContext.js +0 -25
  33. package/dist/cjs/blocks/DocsPage.js +0 -30
  34. package/dist/cjs/blocks/DocsRenderer.js +0 -50
  35. package/dist/cjs/blocks/DocsStory.js +0 -68
  36. package/dist/cjs/blocks/ExternalDocsContainer.js +0 -64
  37. package/dist/cjs/blocks/ExternalPreview.js +0 -99
  38. package/dist/cjs/blocks/Heading.js +0 -31
  39. package/dist/cjs/blocks/Meta.js +0 -64
  40. package/dist/cjs/blocks/Preview.js +0 -23
  41. package/dist/cjs/blocks/Primary.js +0 -39
  42. package/dist/cjs/blocks/Props.js +0 -29
  43. package/dist/cjs/blocks/Source.js +0 -185
  44. package/dist/cjs/blocks/SourceContainer.js +0 -67
  45. package/dist/cjs/blocks/Stories.js +0 -51
  46. package/dist/cjs/blocks/Story.js +0 -152
  47. package/dist/cjs/blocks/Subheading.js +0 -31
  48. package/dist/cjs/blocks/Subtitle.js +0 -39
  49. package/dist/cjs/blocks/Title.js +0 -44
  50. package/dist/cjs/blocks/Wrapper.js +0 -20
  51. package/dist/cjs/blocks/enhanceSource.js +0 -92
  52. package/dist/cjs/blocks/index.js +0 -394
  53. package/dist/cjs/blocks/mdx.js +0 -234
  54. package/dist/cjs/blocks/types.js +0 -10
  55. package/dist/cjs/blocks/useStory.js +0 -44
  56. package/dist/cjs/blocks/utils.js +0 -40
  57. package/dist/cjs/index.js +0 -18
  58. package/dist/cjs/manager.js +0 -20
  59. package/dist/cjs/preset.js +0 -162
  60. package/dist/cjs/preview.js +0 -22
  61. package/dist/cjs/shared.js +0 -22
  62. package/dist/esm/blocks/Anchor.js +0 -8
  63. package/dist/esm/blocks/ArgsTable.js +0 -292
  64. package/dist/esm/blocks/Canvas.js +0 -93
  65. package/dist/esm/blocks/Description.js +0 -107
  66. package/dist/esm/blocks/DocsContainer.js +0 -105
  67. package/dist/esm/blocks/DocsContext.js +0 -16
  68. package/dist/esm/blocks/DocsPage.js +0 -11
  69. package/dist/esm/blocks/DocsRenderer.js +0 -32
  70. package/dist/esm/blocks/DocsStory.js +0 -46
  71. package/dist/esm/blocks/ExternalDocsContainer.js +0 -48
  72. package/dist/esm/blocks/ExternalPreview.js +0 -89
  73. package/dist/esm/blocks/Heading.js +0 -17
  74. package/dist/esm/blocks/Meta.js +0 -45
  75. package/dist/esm/blocks/Preview.js +0 -9
  76. package/dist/esm/blocks/Primary.js +0 -23
  77. package/dist/esm/blocks/Props.js +0 -14
  78. package/dist/esm/blocks/Source.js +0 -150
  79. package/dist/esm/blocks/SourceContainer.js +0 -44
  80. package/dist/esm/blocks/Stories.js +0 -30
  81. package/dist/esm/blocks/Story.js +0 -123
  82. package/dist/esm/blocks/Subheading.js +0 -17
  83. package/dist/esm/blocks/Subtitle.js +0 -23
  84. package/dist/esm/blocks/Title.js +0 -24
  85. package/dist/esm/blocks/Wrapper.js +0 -8
  86. package/dist/esm/blocks/enhanceSource.js +0 -87
  87. package/dist/esm/blocks/index.js +0 -27
  88. package/dist/esm/blocks/mdx.js +0 -203
  89. package/dist/esm/blocks/types.js +0 -2
  90. package/dist/esm/blocks/useStory.js +0 -34
  91. package/dist/esm/blocks/utils.js +0 -29
  92. package/dist/esm/index.js +0 -1
  93. package/dist/esm/manager.js +0 -16
  94. package/dist/esm/preset.js +0 -132
  95. package/dist/esm/preview.js +0 -10
  96. package/dist/esm/shared.js +0 -11
  97. package/dist/types/blocks/Anchor.d.ts +0 -6
  98. package/dist/types/blocks/ArgsTable.d.ts +0 -33
  99. package/dist/types/blocks/Canvas.d.ts +0 -9
  100. package/dist/types/blocks/Description.d.ts +0 -20
  101. package/dist/types/blocks/DocsContainer.d.ts +0 -7
  102. package/dist/types/blocks/DocsContext.d.ts +0 -5
  103. package/dist/types/blocks/DocsPage.d.ts +0 -2
  104. package/dist/types/blocks/DocsRenderer.d.ts +0 -7
  105. package/dist/types/blocks/DocsStory.d.ts +0 -3
  106. package/dist/types/blocks/ExternalDocsContainer.d.ts +0 -4
  107. package/dist/types/blocks/ExternalPreview.d.ts +0 -19
  108. package/dist/types/blocks/Heading.d.ts +0 -6
  109. package/dist/types/blocks/Meta.d.ts +0 -12
  110. package/dist/types/blocks/Preview.d.ts +0 -3
  111. package/dist/types/blocks/Primary.d.ts +0 -6
  112. package/dist/types/blocks/Props.d.ts +0 -3
  113. package/dist/types/blocks/Source.d.ts +0 -38
  114. package/dist/types/blocks/SourceContainer.d.ts +0 -14
  115. package/dist/types/blocks/Stories.d.ts +0 -7
  116. package/dist/types/blocks/Story.d.ts +0 -30
  117. package/dist/types/blocks/Subheading.d.ts +0 -3
  118. package/dist/types/blocks/Subtitle.d.ts +0 -6
  119. package/dist/types/blocks/Title.d.ts +0 -8
  120. package/dist/types/blocks/Wrapper.d.ts +0 -2
  121. package/dist/types/blocks/enhanceSource.d.ts +0 -3
  122. package/dist/types/blocks/index.d.ts +0 -26
  123. package/dist/types/blocks/mdx.d.ts +0 -20
  124. package/dist/types/blocks/types.d.ts +0 -13
  125. package/dist/types/blocks/useStory.d.ts +0 -5
  126. package/dist/types/blocks/utils.d.ts +0 -3
  127. package/dist/types/index.d.ts +0 -1
  128. package/dist/types/manager.d.ts +0 -1
  129. package/dist/types/preset.d.ts +0 -12
  130. package/dist/types/preview.d.ts +0 -5
  131. package/dist/types/shared.d.ts +0 -24
  132. package/manager.js +0 -1
  133. package/mdx-compiler-plugin.js +0 -1
  134. package/register.js +0 -6
@@ -1,14 +0,0 @@
1
- import { FC, Context } from 'react';
2
- import type { SyntaxHighlighterFormatTypes } from '@storybook/components';
3
- import type { StoryId } from '@storybook/api';
4
- export interface SourceItem {
5
- code: string;
6
- format: SyntaxHighlighterFormatTypes;
7
- }
8
- export declare type StorySources = Record<StoryId, SourceItem>;
9
- export interface SourceContextProps {
10
- sources: StorySources;
11
- setSource?: (id: StoryId, item: SourceItem) => void;
12
- }
13
- export declare const SourceContext: Context<SourceContextProps>;
14
- export declare const SourceContainer: FC<{}>;
@@ -1,7 +0,0 @@
1
- import { FunctionComponent } from 'react';
2
- interface StoriesProps {
3
- title?: JSX.Element | string;
4
- includePrimary?: boolean;
5
- }
6
- export declare const Stories: FunctionComponent<StoriesProps>;
7
- export {};
@@ -1,30 +0,0 @@
1
- import { FunctionComponent, ReactNode, ElementType, ComponentProps } from 'react';
2
- import { Story as PureStory } from '@storybook/components';
3
- import { StoryId, StoryAnnotations, AnyFramework } from '@storybook/csf';
4
- import type { ModuleExport, ModuleExports, Story as StoryType } from '@storybook/store';
5
- import { DocsContextProps } from './DocsContext';
6
- export declare const storyBlockIdFromId: (storyId: string) => string;
7
- declare type PureStoryProps = ComponentProps<typeof PureStory>;
8
- declare type CommonProps = StoryAnnotations & {
9
- height?: string;
10
- inline?: boolean;
11
- };
12
- declare type StoryDefProps = {
13
- name: string;
14
- children: ReactNode;
15
- };
16
- declare type StoryRefProps = {
17
- id?: string;
18
- of?: ModuleExport;
19
- meta?: ModuleExports;
20
- };
21
- declare type StoryImportProps = {
22
- name: string;
23
- story: ElementType;
24
- };
25
- export declare type StoryProps = (StoryDefProps | StoryRefProps | StoryImportProps) & CommonProps;
26
- export declare const lookupStoryId: (storyName: string, { mdxStoryNameToKey, mdxComponentAnnotations }: DocsContextProps) => string;
27
- export declare const getStoryId: (props: StoryProps, context: DocsContextProps) => StoryId;
28
- export declare const getStoryProps: <TFramework extends AnyFramework>({ height, inline }: StoryProps, story: StoryType<TFramework>) => PureStoryProps;
29
- declare const Story: FunctionComponent<StoryProps>;
30
- export { Story };
@@ -1,3 +0,0 @@
1
- import { FunctionComponent } from 'react';
2
- import { HeadingProps } from './Heading';
3
- export declare const Subheading: FunctionComponent<HeadingProps>;
@@ -1,6 +0,0 @@
1
- import { FunctionComponent } from 'react';
2
- interface SubtitleProps {
3
- children?: JSX.Element | string;
4
- }
5
- export declare const Subtitle: FunctionComponent<SubtitleProps>;
6
- export {};
@@ -1,8 +0,0 @@
1
- import { FunctionComponent } from 'react';
2
- import { DocsContextProps } from './DocsContext';
3
- interface TitleProps {
4
- children?: JSX.Element | string;
5
- }
6
- export declare const extractTitle: ({ title }: DocsContextProps) => string;
7
- export declare const Title: FunctionComponent<TitleProps>;
8
- export {};
@@ -1,2 +0,0 @@
1
- import { FunctionComponent } from 'react';
2
- export declare const Wrapper: FunctionComponent;
@@ -1,3 +0,0 @@
1
- import type { Parameters } from '@storybook/addons';
2
- import type { Story } from '@storybook/store';
3
- export declare const enhanceSource: (story: Story<any>) => Parameters;
@@ -1,26 +0,0 @@
1
- export { ColorPalette, ColorItem, IconGallery, IconItem, Typeset } from '@storybook/components';
2
- export * from './Anchor';
3
- export * from './ArgsTable';
4
- export * from './Canvas';
5
- export * from './Description';
6
- export * from './DocsContext';
7
- export * from './DocsPage';
8
- export * from './DocsContainer';
9
- export * from './DocsRenderer';
10
- export * from './ExternalDocsContainer';
11
- export * from './DocsStory';
12
- export * from './Heading';
13
- export * from './Meta';
14
- export * from './Preview';
15
- export * from './Primary';
16
- export * from './Props';
17
- export * from './Source';
18
- export * from './SourceContainer';
19
- export * from './Stories';
20
- export * from './Story';
21
- export * from './Subheading';
22
- export * from './Subtitle';
23
- export * from './Title';
24
- export * from './Wrapper';
25
- export * from './types';
26
- export * from './mdx';
@@ -1,20 +0,0 @@
1
- import { FC } from 'react';
2
- import { DocsContextProps } from './DocsContext';
3
- export declare const assertIsFn: (val: any) => any;
4
- export declare const AddContext: FC<DocsContextProps>;
5
- interface CodeOrSourceMdxProps {
6
- className?: string;
7
- }
8
- export declare const CodeOrSourceMdx: FC<CodeOrSourceMdxProps>;
9
- interface AnchorMdxProps {
10
- href: string;
11
- target: string;
12
- }
13
- export declare const AnchorMdx: FC<AnchorMdxProps>;
14
- interface HeaderMdxProps {
15
- as: string;
16
- id: string;
17
- }
18
- export declare const HeaderMdx: FC<HeaderMdxProps>;
19
- export declare const HeadersMdx: {};
20
- export {};
@@ -1,13 +0,0 @@
1
- export declare const CURRENT_SELECTION = ".";
2
- export declare const PRIMARY_STORY = "^";
3
- export declare type Component = any;
4
- export interface StoryData {
5
- id?: string;
6
- kind?: string;
7
- name?: string;
8
- parameters?: any;
9
- }
10
- export declare type DocsStoryProps = StoryData & {
11
- expanded?: boolean;
12
- withToolbar?: boolean;
13
- };
@@ -1,5 +0,0 @@
1
- import type { StoryId, AnyFramework } from '@storybook/csf';
2
- import type { Story } from '@storybook/store';
3
- import { DocsContextProps } from './DocsContext';
4
- export declare function useStory<TFramework extends AnyFramework = AnyFramework>(storyId: StoryId, context: DocsContextProps<TFramework>): Story<TFramework> | void;
5
- export declare function useStories<TFramework extends AnyFramework = AnyFramework>(storyIds: StoryId[], context: DocsContextProps<TFramework>): (Story<TFramework> | void)[];
@@ -1,3 +0,0 @@
1
- import { Component } from './types';
2
- export declare const getComponentName: (component: Component) => string;
3
- export declare function scrollToElement(element: any, block?: string): void;
@@ -1 +0,0 @@
1
- export * from './blocks';
@@ -1 +0,0 @@
1
- export {};
@@ -1,12 +0,0 @@
1
- import type { Options, StoryIndexer } from '@storybook/core-common';
2
- declare type BabelParams = {
3
- babelOptions?: any;
4
- mdxBabelOptions?: any;
5
- configureJSX?: boolean;
6
- };
7
- export declare function webpack(webpackConfig: any, options: Options & BabelParams & {
8
- sourceLoaderOptions: any;
9
- transcludeMarkdown: boolean;
10
- }): Promise<any>;
11
- export declare const storyIndexers: (indexers?: StoryIndexer[]) => Promise<StoryIndexer[]>;
12
- export {};
@@ -1,5 +0,0 @@
1
- export declare const parameters: {
2
- docs: {
3
- renderer: () => Promise<import("./blocks/DocsRenderer").DocsRenderer<import("@storybook/csf").AnyFramework>>;
4
- };
5
- };
@@ -1,24 +0,0 @@
1
- export declare const ADDON_ID = "storybook/docs";
2
- export declare const PANEL_ID: string;
3
- export declare const PARAM_KEY = "docs";
4
- export declare const SNIPPET_RENDERED: string;
5
- export declare enum SourceType {
6
- /**
7
- * AUTO is the default
8
- *
9
- * Use the CODE logic if:
10
- * - the user has set a custom source snippet in `docs.source.code` story parameter
11
- * - the story is not an args-based story
12
- *
13
- * Use the DYNAMIC rendered snippet if the story is an args story
14
- */
15
- AUTO = "auto",
16
- /**
17
- * Render the code extracted by source-loader
18
- */
19
- CODE = "code",
20
- /**
21
- * Render dynamically-rendered source snippet from the story's virtual DOM (currently React only)
22
- */
23
- DYNAMIC = "dynamic"
24
- }
package/manager.js DELETED
@@ -1 +0,0 @@
1
- import './dist/esm/manager';
@@ -1 +0,0 @@
1
- module.exports = require('@storybook/mdx1-csf').createCompiler;
package/register.js DELETED
@@ -1,6 +0,0 @@
1
- import { once } from '@storybook/client-logger';
2
- import './manager';
3
-
4
- once.warn(
5
- 'register.js is deprecated see https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-registerjs'
6
- );