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

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/blocks.js CHANGED
@@ -1 +1 @@
1
- var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__reExport=(target,mod,secondTarget)=>(__copyProps(target,mod,"default"),secondTarget&&__copyProps(secondTarget,mod,"default"));var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var blocks_exports={};module.exports=__toCommonJS(blocks_exports);var import_global=require("@storybook/global"),{LOGLEVEL}=import_global.global,levels={trace:1,debug:2,info:3,warn:4,error:5,silent:10},currentLogLevelString=LOGLEVEL,currentLogLevelNumber=levels[currentLogLevelString]||levels.info,logger={trace:(message,...rest)=>{currentLogLevelNumber<=levels.trace&&console.trace(message,...rest)},debug:(message,...rest)=>{currentLogLevelNumber<=levels.debug&&console.debug(message,...rest)},info:(message,...rest)=>{currentLogLevelNumber<=levels.info&&console.info(message,...rest)},warn:(message,...rest)=>{currentLogLevelNumber<=levels.warn&&console.warn(message,...rest)},error:(message,...rest)=>{currentLogLevelNumber<=levels.error&&console.error(message,...rest)},log:(message,...rest)=>{currentLogLevelNumber<levels.silent&&console.log(message,...rest)}},logged=new Set,once=type=>(message,...rest)=>{if(!logged.has(message))return logged.add(message),logger[type](message,...rest)};once.clear=()=>logged.clear();once.trace=once("trace");once.debug=once("debug");once.info=once("info");once.warn=once("warn");once.error=once("error");once.log=once("log");var deprecate=once("warn"),pretty=type=>(...args)=>{let argArray=[];if(args.length){let startTagRe=/<span\s+style=(['"])([^'"]*)\1\s*>/gi,endTagRe=/<\/span>/gi,reResultArray;for(argArray.push(args[0].replace(startTagRe,"%c").replace(endTagRe,"%c"));reResultArray=startTagRe.exec(args[0]);)argArray.push(reResultArray[2]),argArray.push("");for(let j=1;j<args.length;j++)argArray.push(args[j])}logger[type].apply(logger,argArray)};pretty.trace=pretty("trace");pretty.debug=pretty("debug");pretty.info=pretty("info");pretty.warn=pretty("warn");pretty.error=pretty("error");__reExport(blocks_exports,require("@storybook/blocks"),module.exports);deprecate("Import from '@storybook/addon-docs/blocks' is deprecated. Please import from '@storybook/blocks' instead.");
1
+ var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __commonJS=(cb,mod)=>function(){return mod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__reExport=(target,mod,secondTarget)=>(__copyProps(target,mod,"default"),secondTarget&&__copyProps(secondTarget,mod,"default")),__toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var require_dist=__commonJS({"../../lib/client-logger/dist/index.js"(exports,module2){"use strict";var __defProp2=Object.defineProperty,__getOwnPropDesc2=Object.getOwnPropertyDescriptor,__getOwnPropNames2=Object.getOwnPropertyNames,__hasOwnProp2=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp2(target,name,{get:all[name],enumerable:!0})},__copyProps2=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames2(from))!__hasOwnProp2.call(to,key)&&key!==except&&__defProp2(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc2(from,key))||desc.enumerable});return to},__toCommonJS2=mod=>__copyProps2(__defProp2({},"__esModule",{value:!0}),mod),src_exports={};__export(src_exports,{deprecate:()=>deprecate2,logger:()=>logger,once:()=>once,pretty:()=>pretty});module2.exports=__toCommonJS2(src_exports);var import_global=require("@storybook/global"),{LOGLEVEL}=import_global.global,levels={trace:1,debug:2,info:3,warn:4,error:5,silent:10},currentLogLevelString=LOGLEVEL,currentLogLevelNumber=levels[currentLogLevelString]||levels.info,logger={trace:(message,...rest)=>{currentLogLevelNumber<=levels.trace&&console.trace(message,...rest)},debug:(message,...rest)=>{currentLogLevelNumber<=levels.debug&&console.debug(message,...rest)},info:(message,...rest)=>{currentLogLevelNumber<=levels.info&&console.info(message,...rest)},warn:(message,...rest)=>{currentLogLevelNumber<=levels.warn&&console.warn(message,...rest)},error:(message,...rest)=>{currentLogLevelNumber<=levels.error&&console.error(message,...rest)},log:(message,...rest)=>{currentLogLevelNumber<levels.silent&&console.log(message,...rest)}},logged=new Set,once=type=>(message,...rest)=>{if(!logged.has(message))return logged.add(message),logger[type](message,...rest)};once.clear=()=>logged.clear();once.trace=once("trace");once.debug=once("debug");once.info=once("info");once.warn=once("warn");once.error=once("error");once.log=once("log");var deprecate2=once("warn"),pretty=type=>(...args)=>{let argArray=[];if(args.length){let startTagRe=/<span\s+style=(['"])([^'"]*)\1\s*>/gi,endTagRe=/<\/span>/gi,reResultArray;for(argArray.push(args[0].replace(startTagRe,"%c").replace(endTagRe,"%c"));reResultArray=startTagRe.exec(args[0]);)argArray.push(reResultArray[2]),argArray.push("");for(let j=1;j<args.length;j++)argArray.push(args[j])}logger[type].apply(logger,argArray)};pretty.trace=pretty("trace");pretty.debug=pretty("debug");pretty.info=pretty("info");pretty.warn=pretty("warn");pretty.error=pretty("error")}});var blocks_exports={};module.exports=__toCommonJS(blocks_exports);var import_client_logger=__toESM(require_dist());__reExport(blocks_exports,require("@storybook/blocks"),module.exports);(0,import_client_logger.deprecate)("Import from '@storybook/addon-docs/blocks' is deprecated. Please import from '@storybook/blocks' instead.");
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.15",
4
4
  "description": "Document component usage and properties in Markdown",
5
5
  "keywords": [
6
6
  "addon",
@@ -92,8 +92,7 @@
92
92
  "lit/**/*",
93
93
  "README.md",
94
94
  "*.js",
95
- "*.d.ts",
96
- "!__testfixtures__"
95
+ "*.d.ts"
97
96
  ],
98
97
  "scripts": {
99
98
  "check": "../../../scripts/node_modules/.bin/tsc --noEmit",
@@ -104,17 +103,17 @@
104
103
  "@babel/plugin-transform-react-jsx": "^7.19.0",
105
104
  "@jest/transform": "^29.3.1",
106
105
  "@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",
106
+ "@storybook/blocks": "7.0.0-beta.15",
107
+ "@storybook/components": "7.0.0-beta.15",
108
+ "@storybook/csf-plugin": "7.0.0-beta.15",
109
+ "@storybook/csf-tools": "7.0.0-beta.15",
111
110
  "@storybook/global": "^5.0.0",
112
111
  "@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",
112
+ "@storybook/node-logger": "7.0.0-beta.15",
113
+ "@storybook/postinstall": "7.0.0-beta.15",
114
+ "@storybook/preview-api": "7.0.0-beta.15",
115
+ "@storybook/theming": "7.0.0-beta.15",
116
+ "@storybook/types": "7.0.0-beta.15",
118
117
  "fs-extra": "^9.0.1",
119
118
  "remark-external-links": "^8.0.0",
120
119
  "remark-slug": "^6.0.0",
@@ -141,7 +140,7 @@
141
140
  "./src/shims/mdx-react-shim.ts"
142
141
  ]
143
142
  },
144
- "gitHead": "ddf86bd126ede0c019d7c9494f99f24a5cad9908",
143
+ "gitHead": "ed794f9d13e2bfe696ed2b230a3da04c203519eb",
145
144
  "storybook": {
146
145
  "displayName": "Docs",
147
146
  "icon": "https://user-images.githubusercontent.com/263385/101991672-48355c80-3c7c-11eb-82d9-95fa12438f64.png",
package/react/README.md CHANGED
@@ -98,14 +98,14 @@ 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
+ Storybook Docs renders all React stories inline by default.
102
+
103
+ 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.
104
+
105
+ To do so for all stories, update `.storybook/preview.js`:
102
106
 
103
107
  ```js
104
- export const parameters = {
105
- docs: {
106
- inlineStories: false,
107
- },
108
- };
108
+ export const parameters = { docs: { inlineStories: false } };
109
109
  ```
110
110
 
111
111
  ## 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,14 @@ 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.
115
+ Storybook Docs renders all web components stories inline by default.
118
116
 
119
- To always use iframes you can set
117
+ 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.
120
118
 
121
- ```js
122
- addParameters({
123
- docs: {
124
- inlineStories: false,
125
- },
126
- });
127
- ```
128
-
129
- or add it to individual stories.
119
+ To do so for all stories, update `.storybook/preview.js`:
130
120
 
131
121
  ```js
132
- <Story inline={false} />
122
+ export const parameters = { docs: { inlineStories: false } };
133
123
  ```
134
124
 
135
125
  ## More resources