@storybook/server 7.0.0-alpha.7 → 7.0.0-beta.0
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/dist/chunk-4Z76BHM4.mjs +4 -0
- package/dist/config.d.ts +5 -6
- package/dist/config.js +2 -2
- package/dist/config.mjs +1 -1
- package/dist/index.d.ts +10 -24
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/dist/public-types-3062cfcf.d.ts +42 -0
- package/jest.config.js +7 -0
- package/package.json +16 -16
- package/template/cli/button.stories.json +32 -0
- package/template/cli/header.stories.json +15 -0
- package/template/cli/page.stories.json +15 -0
- package/LICENSE +0 -21
- package/dist/chunk-43Y6KZXY.mjs +0 -4
- package/dist/public-types-07d4abb5.d.ts +0 -42
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import global from"global";import{dedent}from"ts-dedent";import{simulatePageLoad,simulateDOMContentLoaded}from"@storybook/preview-api";var{fetch,Node}=global,defaultFetchStoryHtml=async(url,path,params,storyContext)=>{let fetchUrl=new URL(`${url}/${path}`);return fetchUrl.search=new URLSearchParams({...storyContext.globals,...params}).toString(),(await fetch(fetchUrl)).text()},buildStoryArgs=(args,argTypes)=>{let storyArgs={...args};return Object.keys(argTypes).forEach(key=>{let argType=argTypes[key],{control}=argType,controlType=control&&control.type.toLowerCase(),argValue=storyArgs[key];switch(controlType){case"date":storyArgs[key]=new Date(argValue).toISOString();break;case"object":storyArgs[key]=JSON.stringify(argValue);break;default:}}),storyArgs},render=args=>{};async function renderToCanvas({id,title,name,showMain,showError,forceRemount,storyFn,storyContext,storyContext:{parameters,args,argTypes}},canvasElement){storyFn();let storyArgs=buildStoryArgs(args,argTypes),{server:{url,id:storyId,fetchStoryHtml=defaultFetchStoryHtml,params}}=parameters,fetchId=storyId||id,storyParams={...params,...storyArgs},element=await fetchStoryHtml(url,fetchId,storyParams,storyContext);if(showMain(),typeof element=="string")canvasElement.innerHTML=element,simulatePageLoad(canvasElement);else if(element instanceof Node){if(canvasElement.firstChild===element&&forceRemount===!1)return;canvasElement.innerHTML="",canvasElement.appendChild(element),simulateDOMContentLoaded()}else showError({title:`Expecting an HTML snippet or DOM node from the story: "${name}" of "${title}".`,description:dedent`
|
|
2
|
+
Did you forget to return the HTML snippet from the story?
|
|
3
|
+
Use "() => <your snippet or node>" or when defining the story.
|
|
4
|
+
`})}export{render,renderToCanvas};
|
package/dist/config.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { RenderContext } from '@storybook/
|
|
2
|
-
import { a as StoryFn, S as
|
|
3
|
-
import '@storybook/csf';
|
|
1
|
+
import { RenderContext } from '@storybook/types';
|
|
2
|
+
import { a as StoryFn, S as ServerRenderer } from './public-types-3062cfcf.js';
|
|
4
3
|
|
|
5
|
-
declare const render: StoryFn<
|
|
6
|
-
declare function
|
|
4
|
+
declare const render: StoryFn<ServerRenderer>;
|
|
5
|
+
declare function renderToCanvas({ id, title, name, showMain, showError, forceRemount, storyFn, storyContext, storyContext: { parameters, args, argTypes }, }: RenderContext<ServerRenderer>, canvasElement: ServerRenderer['canvasElement']): Promise<void>;
|
|
7
6
|
|
|
8
7
|
declare const parameters: {
|
|
9
8
|
framework: "server";
|
|
10
9
|
};
|
|
11
10
|
|
|
12
|
-
export { parameters, render,
|
|
11
|
+
export { parameters, render, renderToCanvas };
|
package/dist/config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var R=Object.create;var p=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var D=(e,r)=>{for(var t in r)p(e,t,{get:r[t],enumerable:!0})},f=(e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of v(r))!O.call(e,o)&&o!==t&&p(e,o,{get:()=>r[o],enumerable:!(s=M(r,o))||s.enumerable});return e};var U=(e,r,t)=>(t=e!=null?R(F(e)):{},f(r||!e||!e.__esModule?p(t,"default",{value:e,enumerable:!0}):t,e)),$=e=>f(p({},"__esModule",{value:!0}),e);var J={};D(J,{parameters:()=>N,render:()=>g,renderToCanvas:()=>h});module.exports=$(J);var m=U(require("global")),l=require("ts-dedent"),y=require("@storybook/preview-api"),{fetch:I,Node:P}=m.default,j=async(e,r,t,s)=>{let o=new URL(`${e}/${r}`);return o.search=new URLSearchParams({...s.globals,...t}).toString(),(await I(o)).text()},k=(e,r)=>{let t={...e};return Object.keys(r).forEach(s=>{let o=r[s],{control:n}=o,d=n&&n.type.toLowerCase(),c=t[s];switch(d){case"date":t[s]=new Date(c).toISOString();break;case"object":t[s]=JSON.stringify(c);break;default:}}),t},g=e=>{};async function h({id:e,title:r,name:t,showMain:s,showError:o,forceRemount:n,storyFn:d,storyContext:c,storyContext:{parameters:S,args:u,argTypes:T}},a){d();let b=k(u,T),{server:{url:w,id:x,fetchStoryHtml:C=j,params:L}}=S,A=x||e,H={...L,...b},i=await C(w,A,H,c);if(s(),typeof i=="string")a.innerHTML=i,(0,y.simulatePageLoad)(a);else if(i instanceof P){if(a.firstChild===i&&n===!1)return;a.innerHTML="",a.appendChild(i),(0,y.simulateDOMContentLoaded)()}else o({title:`Expecting an HTML snippet or DOM node from the story: "${t}" of "${r}".`,description:l.dedent`
|
|
2
2
|
Did you forget to return the HTML snippet from the story?
|
|
3
3
|
Use "() => <your snippet or node>" or when defining the story.
|
|
4
|
-
`})}
|
|
4
|
+
`})}var N={framework:"server"};0&&(module.exports={parameters,render,renderToCanvas});
|
package/dist/config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{render,renderToCanvas}from"./chunk-4Z76BHM4.mjs";var parameters={framework:"server"};export{parameters,render,renderToCanvas};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,31 +1,17 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { ClientStoryApi, Loadable } from '@storybook/addons';
|
|
7
|
-
import { S as ServerFramework, I as IStorybookSection } from './public-types-07d4abb5.js';
|
|
8
|
-
export { M as Meta, c as Story, a as StoryFn, b as StoryObj } from './public-types-07d4abb5.js';
|
|
1
|
+
import * as _storybook_types from '@storybook/types';
|
|
2
|
+
import { Addon_ClientStoryApi, Addon_Loadable } from '@storybook/types';
|
|
3
|
+
export { ArgTypes, Args, Parameters, StrictArgs } from '@storybook/types';
|
|
4
|
+
import { S as ServerRenderer } from './public-types-3062cfcf.js';
|
|
5
|
+
export { D as Decorator, L as Loader, M as Meta, S as ServerRenderer, c as Story, d as StoryContext, a as StoryFn, b as StoryObj } from './public-types-3062cfcf.js';
|
|
9
6
|
|
|
10
|
-
interface ClientApi extends
|
|
11
|
-
|
|
12
|
-
configure(loader: Loadable, module: NodeModule): void;
|
|
13
|
-
getStorybook(): IStorybookSection[];
|
|
14
|
-
clearDecorators(): void;
|
|
7
|
+
interface ClientApi extends Addon_ClientStoryApi<ServerRenderer['storyResult']> {
|
|
8
|
+
configure(loader: Addon_Loadable, module: NodeModule): void;
|
|
15
9
|
forceReRender(): void;
|
|
16
10
|
raw: () => any;
|
|
17
11
|
}
|
|
18
12
|
declare const storiesOf: ClientApi['storiesOf'];
|
|
19
13
|
declare const configure: ClientApi['configure'];
|
|
20
|
-
declare const
|
|
21
|
-
declare const
|
|
22
|
-
globals?: _storybook_csf.Globals;
|
|
23
|
-
globalTypes?: _storybook_csf.GlobalTypes;
|
|
24
|
-
}) => void);
|
|
25
|
-
declare const clearDecorators: (() => never) | (() => void);
|
|
26
|
-
declare const setAddon: (() => never) | ((addon: any) => void);
|
|
27
|
-
declare const getStorybook: (() => never) | (() => lib_client_api_dist_types_ClientApi.GetStorybookKind<ServerFramework>[]);
|
|
28
|
-
declare const raw: (() => never) | (() => lib_store_dist_types.BoundStory<ServerFramework>[]);
|
|
29
|
-
declare const forceReRender: (() => never) | (() => void);
|
|
14
|
+
declare const raw: ((...args: any[]) => never) | (() => _storybook_types.BoundStory<ServerRenderer>[]);
|
|
15
|
+
declare const forceReRender: () => void;
|
|
30
16
|
|
|
31
|
-
export {
|
|
17
|
+
export { configure, forceReRender, raw, storiesOf };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var D=Object.create;var a=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var U=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var k=(e,r)=>{for(var t in r)a(e,t,{get:r[t],enumerable:!0})},y=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of P(r))!$.call(e,o)&&o!==t&&a(e,o,{get:()=>r[o],enumerable:!(n=N(r,o))||n.enumerable});return e};var m=(e,r,t)=>(t=e!=null?D(U(e)):{},y(r||!e||!e.__esModule?a(t,"default",{value:e,enumerable:!0}):t,e)),E=e=>y(a({},"__esModule",{value:!0}),e);var z={};k(z,{configure:()=>J,forceReRender:()=>q,raw:()=>Y,storiesOf:()=>B});module.exports=E(z);var g=m(require("global")),{window:I}=g.default;I.STORYBOOK_ENV="SERVER";var h=require("@storybook/preview-api");var u=m(require("global")),S=require("ts-dedent"),c=require("@storybook/preview-api"),{fetch:V,Node:j}=u.default,K=async(e,r,t,n)=>{let o=new URL(`${e}/${r}`);return o.search=new URLSearchParams({...n.globals,...t}).toString(),(await V(o)).text()},W=(e,r)=>{let t={...e};return Object.keys(r).forEach(n=>{let o=r[n],{control:s}=o,l=s&&s.type.toLowerCase(),d=t[n];switch(l){case"date":t[n]=new Date(d).toISOString();break;case"object":t[n]=JSON.stringify(d);break;default:}}),t},R=e=>{};async function A({id:e,title:r,name:t,showMain:n,showError:o,forceRemount:s,storyFn:l,storyContext:d,storyContext:{parameters:w,args:x,argTypes:O}},i){l();let T=W(x,O),{server:{url:L,id:v,fetchStoryHtml:H=K,params:M}}=w,F=v||e,_={...M,...T},p=await H(L,F,_,d);if(n(),typeof p=="string")i.innerHTML=p,(0,c.simulatePageLoad)(i);else if(p instanceof j){if(i.firstChild===p&&s===!1)return;i.innerHTML="",i.appendChild(p),(0,c.simulateDOMContentLoaded)()}else o({title:`Expecting an HTML snippet or DOM node from the story: "${t}" of "${r}".`,description:S.dedent`
|
|
2
2
|
Did you forget to return the HTML snippet from the story?
|
|
3
3
|
Use "() => <your snippet or node>" or when defining the story.
|
|
4
|
-
`})}
|
|
4
|
+
`})}var C="server",f=(0,h.start)(A,{render:R}),B=(e,r)=>f.clientApi.storiesOf(e,r).addParameters({framework:C}),J=(...e)=>f.configure(C,...e),{raw:Y}=f.clientApi,{forceReRender:q}=f;var b;(b=module==null?void 0:module.hot)==null||b.decline();0&&(module.exports={configure,forceReRender,raw,storiesOf});
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{render,renderToCanvas}from"./chunk-4Z76BHM4.mjs";import global from"global";var{window:globalWindow}=global;globalWindow.STORYBOOK_ENV="SERVER";import{start}from"@storybook/preview-api";var FRAMEWORK="server",api=start(renderToCanvas,{render}),storiesOf=(kind,m)=>api.clientApi.storiesOf(kind,m).addParameters({framework:FRAMEWORK}),configure=(...args)=>api.configure(FRAMEWORK,...args),{raw}=api.clientApi,{forceReRender}=api;module?.hot?.decline();export{configure,forceReRender,raw,storiesOf};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { WebRenderer, Args, ComponentAnnotations, AnnotatedStoryFn, StoryAnnotations, StrictArgs, DecoratorFunction, LoaderFunction, StoryContext as StoryContext$1 } from '@storybook/types';
|
|
2
|
+
|
|
3
|
+
type StoryFnServerReturnType = any;
|
|
4
|
+
interface ServerRenderer extends WebRenderer {
|
|
5
|
+
component: string;
|
|
6
|
+
storyResult: StoryFnServerReturnType;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Metadata to configure the stories for a component.
|
|
11
|
+
*
|
|
12
|
+
* @see [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)
|
|
13
|
+
*/
|
|
14
|
+
type Meta<TArgs = Args> = ComponentAnnotations<ServerRenderer, TArgs>;
|
|
15
|
+
/**
|
|
16
|
+
* Story function that represents a CSFv2 component example.
|
|
17
|
+
*
|
|
18
|
+
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
19
|
+
*/
|
|
20
|
+
type StoryFn<TArgs = Args> = AnnotatedStoryFn<ServerRenderer, TArgs>;
|
|
21
|
+
/**
|
|
22
|
+
* Story function that represents a CSFv3 component example.
|
|
23
|
+
*
|
|
24
|
+
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
25
|
+
*/
|
|
26
|
+
type StoryObj<TArgs = Args> = StoryAnnotations<ServerRenderer, TArgs>;
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated Use `StoryFn` instead.
|
|
29
|
+
* Use `StoryObj` if you want to migrate to CSF3, which uses objects instead of functions to represent stories.
|
|
30
|
+
* You can read more about the CSF3 format here: https://storybook.js.org/blog/component-story-format-3-0/
|
|
31
|
+
*
|
|
32
|
+
* Story function that represents a CSFv2 component example.
|
|
33
|
+
*
|
|
34
|
+
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
35
|
+
*/
|
|
36
|
+
type Story<TArgs = Args> = StoryFn<TArgs>;
|
|
37
|
+
|
|
38
|
+
type Decorator<TArgs = StrictArgs> = DecoratorFunction<ServerRenderer, TArgs>;
|
|
39
|
+
type Loader<TArgs = StrictArgs> = LoaderFunction<ServerRenderer, TArgs>;
|
|
40
|
+
type StoryContext<TArgs = StrictArgs> = StoryContext$1<ServerRenderer, TArgs>;
|
|
41
|
+
|
|
42
|
+
export { Decorator as D, Loader as L, Meta as M, ServerRenderer as S, StoryFn as a, StoryObj as b, Story as c, StoryContext as d };
|
package/jest.config.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/server",
|
|
3
|
-
"version": "7.0.0-
|
|
3
|
+
"version": "7.0.0-beta.0",
|
|
4
4
|
"description": "Storybook Server renderer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -41,27 +41,24 @@
|
|
|
41
41
|
"types": "dist/index.d.ts",
|
|
42
42
|
"files": [
|
|
43
43
|
"dist/**/*",
|
|
44
|
+
"template/**/*",
|
|
44
45
|
"README.md",
|
|
45
46
|
"*.js",
|
|
46
47
|
"*.d.ts"
|
|
47
48
|
],
|
|
48
49
|
"scripts": {
|
|
49
|
-
"
|
|
50
|
+
"check": "../../../scripts/node_modules/.bin/tsc --noEmit",
|
|
51
|
+
"prep": "../../../scripts/prepare/bundle.ts"
|
|
50
52
|
},
|
|
51
53
|
"dependencies": {
|
|
52
|
-
"@storybook/
|
|
53
|
-
"@storybook/
|
|
54
|
-
"@storybook/
|
|
55
|
-
"@storybook/preview-web": "7.0.0-alpha.7",
|
|
56
|
-
"@storybook/store": "7.0.0-alpha.7",
|
|
57
|
-
"core-js": "^3.8.2",
|
|
54
|
+
"@storybook/core-client": "7.0.0-beta.0",
|
|
55
|
+
"@storybook/preview-api": "7.0.0-beta.0",
|
|
56
|
+
"@storybook/types": "7.0.0-beta.0",
|
|
58
57
|
"global": "^4.4.0",
|
|
59
|
-
"react": "16.14.0",
|
|
60
|
-
"react-dom": "16.14.0",
|
|
61
58
|
"ts-dedent": "^2.0.0"
|
|
62
59
|
},
|
|
63
60
|
"devDependencies": {
|
|
64
|
-
"
|
|
61
|
+
"typescript": "~4.9.3"
|
|
65
62
|
},
|
|
66
63
|
"engines": {
|
|
67
64
|
"node": ">=10.13.0"
|
|
@@ -69,9 +66,12 @@
|
|
|
69
66
|
"publishConfig": {
|
|
70
67
|
"access": "public"
|
|
71
68
|
},
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
"bundler": {
|
|
70
|
+
"entries": [
|
|
71
|
+
"./src/index.ts",
|
|
72
|
+
"./src/config.ts"
|
|
73
|
+
],
|
|
74
|
+
"platform": "browser"
|
|
75
|
+
},
|
|
76
|
+
"gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70"
|
|
77
77
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Example/Button",
|
|
3
|
+
"parameters": {
|
|
4
|
+
"server": { "id": "button" }
|
|
5
|
+
},
|
|
6
|
+
"args": { "label": "Button" },
|
|
7
|
+
"argTypes": {
|
|
8
|
+
"label": { "control": "text" },
|
|
9
|
+
"primary": { "control": "boolean" },
|
|
10
|
+
"backgroundColor": { "control": "color" },
|
|
11
|
+
"size": {
|
|
12
|
+
"control": { "type": "select", "options": ["small", "medium", "large"] }
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"stories": [
|
|
16
|
+
{
|
|
17
|
+
"name": "Primary",
|
|
18
|
+
"args": { "primary": true }
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "Secondary"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "Large",
|
|
25
|
+
"args": { "size": "large" }
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "Small",
|
|
29
|
+
"args": { "size": "small" }
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2017 Kadira Inc. <hello@kadira.io>
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|
package/dist/chunk-43Y6KZXY.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var h=Object.defineProperty;var l=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var y=(r,t,e)=>t in r?h(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,n=(r,t)=>{for(var e in t||(t={}))T.call(t,e)&&y(r,e,t[e]);if(l)for(var e of l(t))x.call(t,e)&&y(r,e,t[e]);return r};var f=(r,t)=>h(r,"name",{value:t,configurable:!0});import C from"global";import D from"ts-dedent";import{simulatePageLoad as U,simulateDOMContentLoaded as $}from"@storybook/preview-web";var{fetch:A,Node:I}=C,P=f(async(r,t,e,o)=>{let s=new URL(`${r}/${t}`);return s.search=new URLSearchParams(n(n({},o.globals),e)).toString(),(await A(s)).text()},"defaultFetchStoryHtml"),j=f((r,t)=>{let e=n({},r);return Object.keys(t).forEach(o=>{let s=t[o],{control:a}=s,d=a&&a.type.toLowerCase(),p=e[o];switch(d){case"date":e[o]=new Date(p).toISOString();break;case"object":e[o]=JSON.stringify(p);break;default:}}),e},"buildStoryArgs"),k=f(r=>{},"render");async function q({id:r,title:t,name:e,showMain:o,showError:s,forceRemount:a,storyFn:d,storyContext:p,storyContext:{parameters:g,args:u,argTypes:L}},c){d();let m=j(u,L),{server:{url:w,id:S,fetchStoryHtml:b=P,params:M}}=g,H=S||r,O=n(n({},M),m),i=await b(w,H,O,p);if(o(),typeof i=="string")c.innerHTML=i,U(c);else if(i instanceof I){if(c.firstChild===i&&a===!1)return;c.innerHTML="",c.appendChild(i),$()}else s({title:`Expecting an HTML snippet or DOM node from the story: "${e}" of "${t}".`,description:D`
|
|
2
|
-
Did you forget to return the HTML snippet from the story?
|
|
3
|
-
Use "() => <your snippet or node>" or when defining the story.
|
|
4
|
-
`})}f(q,"renderToDOM");export{f as a,k as b,q as c};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Args, ComponentAnnotations, AnnotatedStoryFn, StoryAnnotations } from '@storybook/csf';
|
|
2
|
-
|
|
3
|
-
declare type StoryFnServerReturnType = any;
|
|
4
|
-
declare type ServerFramework = {
|
|
5
|
-
component: string;
|
|
6
|
-
storyResult: StoryFnServerReturnType;
|
|
7
|
-
};
|
|
8
|
-
interface IStorybookStory {
|
|
9
|
-
name: string;
|
|
10
|
-
render: (context: any) => any;
|
|
11
|
-
}
|
|
12
|
-
interface IStorybookSection {
|
|
13
|
-
kind: string;
|
|
14
|
-
stories: IStorybookStory[];
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Metadata to configure the stories for a component.
|
|
19
|
-
*
|
|
20
|
-
* @see [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)
|
|
21
|
-
*/
|
|
22
|
-
declare type Meta<TArgs = Args> = ComponentAnnotations<ServerFramework, TArgs>;
|
|
23
|
-
/**
|
|
24
|
-
* Story function that represents a CSFv2 component example.
|
|
25
|
-
*
|
|
26
|
-
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
27
|
-
*/
|
|
28
|
-
declare type StoryFn<TArgs = Args> = AnnotatedStoryFn<ServerFramework, TArgs>;
|
|
29
|
-
/**
|
|
30
|
-
* Story function that represents a CSFv3 component example.
|
|
31
|
-
*
|
|
32
|
-
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
33
|
-
*/
|
|
34
|
-
declare type StoryObj<TArgs = Args> = StoryAnnotations<ServerFramework, TArgs>;
|
|
35
|
-
/**
|
|
36
|
-
* Story function that represents a CSFv3 component example.
|
|
37
|
-
*
|
|
38
|
-
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
39
|
-
*/
|
|
40
|
-
declare type Story<TArgs = Args> = StoryObj<TArgs>;
|
|
41
|
-
|
|
42
|
-
export { IStorybookSection as I, Meta as M, ServerFramework as S, StoryFn as a, StoryObj as b, Story as c };
|