@storybook/addon-docs 7.0.0-beta.13 → 7.0.0-beta.14

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/angular/README.md CHANGED
@@ -15,6 +15,7 @@ To learn more about Storybook Docs, read the [general documentation](../README.m
15
15
  - [Props tables](#props-tables)
16
16
  - [MDX](#mdx)
17
17
  - [IFrame height](#iframe-height)
18
+ - [Inline Stories](#inline-stories)
18
19
  - [More resources](#more-resources)
19
20
 
20
21
  ## Installation
@@ -186,9 +187,7 @@ Storybook Docs renders all Angular stories inside IFrames, with a default height
186
187
  To update the global default, modify `.storybook/preview.ts`:
187
188
 
188
189
  ```ts
189
- import { addParameters } from '@storybook/angular';
190
-
191
- addParameters({ docs: { iframeHeight: 400 } });
190
+ export const parameters = { docs: { iframeHeight: 400 } };
192
191
  ```
193
192
 
194
193
  For `DocsPage`, you need to update the parameter locally in a story:
@@ -208,18 +207,14 @@ And for `MDX` you can modify it as an attribute on the `Story` element:
208
207
 
209
208
  ## Inline Stories
210
209
 
211
- Storybook Docs renders all Angular stories inside IFrames by default. But it is possible to use an inline rendering:
210
+ Storybook Docs renders all Angular stories inline by default.
212
211
 
213
- Then update `.storybook/preview.js`:
212
+ However, you can render stories in an iframe, with a default height of `60px` (configurable using the `docs.iframeHeight` story parameter), by using the `docs.inlineStories` parameter.
214
213
 
215
- ```js
216
- import { addParameters } from '@storybook/angular';
214
+ To do so for all stories, update `.storybook/preview.js`:
217
215
 
218
- addParameters({
219
- docs: {
220
- inlineStories: true,
221
- },
222
- });
216
+ ```js
217
+ export const parameters = { docs: { inlineStories: false } };
223
218
  ```
224
219
 
225
220
  ## More resources
package/dist/preset.js CHANGED
@@ -10,4 +10,4 @@ var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropD
10
10
  To update your configuration, please see migration instructions here:
11
11
 
12
12
  https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#dropped-addon-docs-manual-babel-configuration
13
- `);let mdxLoader=require.resolve("@storybook/mdx2-csf/loader"),rules=module2.rules||[];return transcludeMarkdown&&(rules=[...rules.filter(rule=>{var _a;return((_a=rule.test)==null?void 0:_a.toString())!=="/\\.md$/"}),{test:/\.md$/,use:[{loader:mdxLoader,options:mdxLoaderOptions}]}]),{...webpackConfig,plugins:[...webpackConfig.plugins||[],...csfPluginOptions?[require("@storybook/csf-plugin").webpack(csfPluginOptions)]:[]],module:{...module2,rules:[...rules,{test:/(stories|story)\.mdx$/,use:[{loader:mdxLoader,options:{...mdxLoaderOptions,skipCsf:!1}}]},{test:/\.mdx$/,exclude:/(stories|story)\.mdx$/,use:[{loader:mdxLoader,options:mdxLoaderOptions}]}]}}}var storyIndexers=indexers=>[{test:/(stories|story)\.mdx$/,indexer:async(fileName,opts)=>{let code=(await import_fs_extra.default.readFile(fileName,"utf-8")).toString(),{compile}=await import("@storybook/mdx2-csf");return code=await compile(code,{}),(0,import_csf_tools.loadCsf)(code,{...opts,fileName}).parse()}},...indexers||[]],docs=docsOptions=>({...docsOptions,enabled:!0,defaultName:"Docs",docsPage:!0}),webpackX=webpack,storyIndexersX=storyIndexers,docsX=docs;0&&(module.exports={docs,storyIndexers,webpack});
13
+ `);let mdxLoader=require.resolve("@storybook/mdx2-csf/loader"),rules=module2.rules||[];return transcludeMarkdown&&(rules=[...rules.filter(rule=>{var _a;return((_a=rule.test)==null?void 0:_a.toString())!=="/\\.md$/"}),{test:/\.md$/,use:[{loader:mdxLoader,options:mdxLoaderOptions}]}]),{...webpackConfig,plugins:[...webpackConfig.plugins||[],...csfPluginOptions?[require("@storybook/csf-plugin").webpack(csfPluginOptions)]:[]],module:{...module2,rules:[...rules,{test:/(stories|story)\.mdx$/,use:[{loader:mdxLoader,options:{...mdxLoaderOptions,skipCsf:!1}}]},{test:/\.mdx$/,exclude:/(stories|story)\.mdx$/,use:[{loader:mdxLoader,options:mdxLoaderOptions}]}]}}}var storyIndexers=indexers=>[{test:/(stories|story)\.mdx$/,indexer:async(fileName,opts)=>{let code=(await import_fs_extra.default.readFile(fileName,"utf-8")).toString(),{compile}=await import("@storybook/mdx2-csf");return code=await compile(code,{}),(0,import_csf_tools.loadCsf)(code,{...opts,fileName}).parse()}},...indexers||[]],docs=docsOptions=>({...docsOptions,disable:!1,defaultName:"Docs",autodocs:"tag"}),webpackX=webpack,storyIndexersX=storyIndexers,docsX=docs;0&&(module.exports={docs,storyIndexers,webpack});
package/dist/preset.mjs CHANGED
@@ -10,4 +10,4 @@ import{__require}from"./chunk-R4NKYYJA.mjs";import fs from"fs-extra";import rema
10
10
  To update your configuration, please see migration instructions here:
11
11
 
12
12
  https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#dropped-addon-docs-manual-babel-configuration
13
- `);let mdxLoader=__require.resolve("@storybook/mdx2-csf/loader"),rules=module.rules||[];return transcludeMarkdown&&(rules=[...rules.filter(rule=>rule.test?.toString()!=="/\\.md$/"),{test:/\.md$/,use:[{loader:mdxLoader,options:mdxLoaderOptions}]}]),{...webpackConfig,plugins:[...webpackConfig.plugins||[],...csfPluginOptions?[__require("@storybook/csf-plugin").webpack(csfPluginOptions)]:[]],module:{...module,rules:[...rules,{test:/(stories|story)\.mdx$/,use:[{loader:mdxLoader,options:{...mdxLoaderOptions,skipCsf:!1}}]},{test:/\.mdx$/,exclude:/(stories|story)\.mdx$/,use:[{loader:mdxLoader,options:mdxLoaderOptions}]}]}}}var storyIndexers=indexers=>[{test:/(stories|story)\.mdx$/,indexer:async(fileName,opts)=>{let code=(await fs.readFile(fileName,"utf-8")).toString(),{compile}=await import("@storybook/mdx2-csf");return code=await compile(code,{}),loadCsf(code,{...opts,fileName}).parse()}},...indexers||[]],docs=docsOptions=>({...docsOptions,enabled:!0,defaultName:"Docs",docsPage:!0}),webpackX=webpack,storyIndexersX=storyIndexers,docsX=docs;export{docsX as docs,storyIndexersX as storyIndexers,webpackX as webpack};
13
+ `);let mdxLoader=__require.resolve("@storybook/mdx2-csf/loader"),rules=module.rules||[];return transcludeMarkdown&&(rules=[...rules.filter(rule=>rule.test?.toString()!=="/\\.md$/"),{test:/\.md$/,use:[{loader:mdxLoader,options:mdxLoaderOptions}]}]),{...webpackConfig,plugins:[...webpackConfig.plugins||[],...csfPluginOptions?[__require("@storybook/csf-plugin").webpack(csfPluginOptions)]:[]],module:{...module,rules:[...rules,{test:/(stories|story)\.mdx$/,use:[{loader:mdxLoader,options:{...mdxLoaderOptions,skipCsf:!1}}]},{test:/\.mdx$/,exclude:/(stories|story)\.mdx$/,use:[{loader:mdxLoader,options:mdxLoaderOptions}]}]}}}var storyIndexers=indexers=>[{test:/(stories|story)\.mdx$/,indexer:async(fileName,opts)=>{let code=(await fs.readFile(fileName,"utf-8")).toString(),{compile}=await import("@storybook/mdx2-csf");return code=await compile(code,{}),loadCsf(code,{...opts,fileName}).parse()}},...indexers||[]],docs=docsOptions=>({...docsOptions,disable:!1,defaultName:"Docs",autodocs:"tag"}),webpackX=webpack,storyIndexersX=storyIndexers,docsX=docs;export{docsX as docs,storyIndexersX as storyIndexers,webpackX as webpack};
package/ember/README.md CHANGED
@@ -125,9 +125,7 @@ Storybook Docs renders all Ember stories inside `iframe`s, with a default height
125
125
  To update the global default, modify `.storybook/preview.js`:
126
126
 
127
127
  ```ts
128
- import { addParameters } from '@storybook/ember';
129
-
130
- addParameters({ docs: { iframeHeight: 400 } });
128
+ export const parameters = { docs: { iframeHeight: 400 } };
131
129
  ```
132
130
 
133
131
  For `DocsPage`, you need to update the parameter locally in a story:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/addon-docs",
3
- "version": "7.0.0-beta.13",
3
+ "version": "7.0.0-beta.14",
4
4
  "description": "Document component usage and properties in Markdown",
5
5
  "keywords": [
6
6
  "addon",
@@ -104,17 +104,17 @@
104
104
  "@babel/plugin-transform-react-jsx": "^7.19.0",
105
105
  "@jest/transform": "^29.3.1",
106
106
  "@mdx-js/react": "^2.1.5",
107
- "@storybook/blocks": "7.0.0-beta.13",
108
- "@storybook/components": "7.0.0-beta.13",
109
- "@storybook/csf-plugin": "7.0.0-beta.13",
110
- "@storybook/csf-tools": "7.0.0-beta.13",
107
+ "@storybook/blocks": "7.0.0-beta.14",
108
+ "@storybook/components": "7.0.0-beta.14",
109
+ "@storybook/csf-plugin": "7.0.0-beta.14",
110
+ "@storybook/csf-tools": "7.0.0-beta.14",
111
111
  "@storybook/global": "^5.0.0",
112
112
  "@storybook/mdx2-csf": "next",
113
- "@storybook/node-logger": "7.0.0-beta.13",
114
- "@storybook/postinstall": "7.0.0-beta.13",
115
- "@storybook/preview-api": "7.0.0-beta.13",
116
- "@storybook/theming": "7.0.0-beta.13",
117
- "@storybook/types": "7.0.0-beta.13",
113
+ "@storybook/node-logger": "7.0.0-beta.14",
114
+ "@storybook/postinstall": "7.0.0-beta.14",
115
+ "@storybook/preview-api": "7.0.0-beta.14",
116
+ "@storybook/theming": "7.0.0-beta.14",
117
+ "@storybook/types": "7.0.0-beta.14",
118
118
  "fs-extra": "^9.0.1",
119
119
  "remark-external-links": "^8.0.0",
120
120
  "remark-slug": "^6.0.0",
@@ -141,7 +141,7 @@
141
141
  "./src/shims/mdx-react-shim.ts"
142
142
  ]
143
143
  },
144
- "gitHead": "ddf86bd126ede0c019d7c9494f99f24a5cad9908",
144
+ "gitHead": "c3b2e8fe2517ba2d7630e260de0fd1ad86cafeb6",
145
145
  "storybook": {
146
146
  "displayName": "Docs",
147
147
  "icon": "https://user-images.githubusercontent.com/263385/101991672-48355c80-3c7c-11eb-82d9-95fa12438f64.png",
package/react/README.md CHANGED
@@ -98,14 +98,15 @@ Some **markdown** description, or whatever you want.
98
98
 
99
99
  ## Inline stories
100
100
 
101
- Storybook Docs renders all React stories inline on the page by default. If you want to render stories in an `iframe` so that they are better isolated. To do this, update `.storybook/preview.js`:
101
+
102
+ Storybook Docs renders all React stories inline by default.
103
+
104
+ However, you can render stories in an iframe, with a default height of `60px` (configurable using the `docs.iframeHeight` story parameter), by using the `docs.inlineStories` parameter.
105
+
106
+ To do so for all stories, update `.storybook/preview.js`:
102
107
 
103
108
  ```js
104
- export const parameters = {
105
- docs: {
106
- inlineStories: false,
107
- },
108
- };
109
+ export const parameters = { docs: { inlineStories: false } };
109
110
  ```
110
111
 
111
112
  ## TypeScript props with `react-docgen`
package/vue/README.md CHANGED
@@ -133,18 +133,14 @@ Yes, it's redundant to declare `component` twice. [Coming soon](https://github.c
133
133
 
134
134
  ## Inline Stories
135
135
 
136
- Storybook Docs renders all Vue stories inside IFrames, with a default height of `60px` (configurable using the `docs.iframeHeight` story parameter).
136
+ Storybook Docs renders all Vue stories inline by default.
137
137
 
138
- Starting in 5.3, you can also render stories inline, and in 6.0 this has become the default behavior. To render inline, update `.storybook/preview.js`:
138
+ However, you can render stories in an iframe, with a default height of `60px` (configurable using the `docs.iframeHeight` story parameter), by using the `docs.inlineStories` parameter.
139
139
 
140
- ```js
141
- import { addParameters } from '@storybook/vue';
140
+ To do so for all stories, update `.storybook/preview.js`:
142
141
 
143
- addParameters({
144
- docs: {
145
- inlineStories: true,
146
- },
147
- });
142
+ ```js
143
+ export const parameters = { docs: { inlineStories: false, }, };
148
144
  ```
149
145
 
150
146
  ## More resources
@@ -112,24 +112,15 @@ For a full example see the [web-components-kitchen-sink/custom-elements.json](..
112
112
 
113
113
  ## Stories not inline
114
114
 
115
- By default stories are rendered inline.
116
- For web components that is usually fine as they are style encapsulated via shadow dom.
117
- However when you have a style tag in you template it might be best to show them in an iframe.
118
115
 
119
- To always use iframes you can set
116
+ Storybook Docs renders all web components stories inline by default.
120
117
 
121
- ```js
122
- addParameters({
123
- docs: {
124
- inlineStories: false,
125
- },
126
- });
127
- ```
118
+ However, you can render stories in an iframe, with a default height of `60px` (configurable using the `docs.iframeHeight` story parameter), by using the `docs.inlineStories` parameter.
128
119
 
129
- or add it to individual stories.
120
+ To do so for all stories, update `.storybook/preview.js`:
130
121
 
131
122
  ```js
132
- <Story inline={false} />
123
+ export const parameters = { docs: { inlineStories: false } };
133
124
  ```
134
125
 
135
126
  ## More resources