@storybook/react 7.0.0-alpha.38 → 7.0.0-alpha.39
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/config.d.ts +5 -6
- package/dist/index.d.ts +3 -11
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{types-cd314162.d.ts → types-7e2d88a6.d.ts} +1 -9
- package/package.json +7 -7
package/dist/config.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as lib_addons_dist from 'lib/addons/dist';
|
|
1
|
+
import * as lib_docs_tools_dist from 'lib/docs-tools/dist';
|
|
3
2
|
import * as _storybook_csf from '@storybook/csf';
|
|
4
3
|
import { ArgsStoryFn } from '@storybook/csf';
|
|
5
|
-
import { R as ReactFramework, S as StoryFnReactReturnType } from './types-
|
|
4
|
+
import { R as ReactFramework, S as StoryFnReactReturnType } from './types-7e2d88a6.js';
|
|
6
5
|
import { RenderContext } from '@storybook/store';
|
|
7
6
|
import 'react';
|
|
8
7
|
|
|
9
8
|
declare const decorators: ((storyFn: _storybook_csf.PartialStoryFn<ReactFramework, _storybook_csf.Args>, context: _storybook_csf.StoryContext<ReactFramework, _storybook_csf.Args>) => StoryFnReactReturnType)[];
|
|
10
|
-
declare const argTypesEnhancers: (<TFramework extends _storybook_csf.AnyFramework>(context: _storybook_csf.StoryContextForEnhancers<TFramework, _storybook_csf.Args>) => _storybook_csf.StrictArgTypes<_storybook_csf.Args>
|
|
9
|
+
declare const argTypesEnhancers: (<TFramework extends _storybook_csf.AnyFramework>(context: _storybook_csf.StoryContextForEnhancers<TFramework, _storybook_csf.Args>) => _storybook_csf.StrictArgTypes<_storybook_csf.Args>)[];
|
|
11
10
|
|
|
12
11
|
declare const render: ArgsStoryFn<ReactFramework>;
|
|
13
12
|
declare function renderToDOM({ storyContext, unboundStoryFn, showMain, showException, forceRemount, }: RenderContext<ReactFramework>, domElement: Element): Promise<() => void>;
|
|
@@ -15,8 +14,8 @@ declare function renderToDOM({ storyContext, unboundStoryFn, showMain, showExcep
|
|
|
15
14
|
declare const parameters: {
|
|
16
15
|
docs: {
|
|
17
16
|
inlineStories: boolean;
|
|
18
|
-
extractArgTypes:
|
|
19
|
-
extractComponentDescription: typeof
|
|
17
|
+
extractArgTypes: lib_docs_tools_dist.ArgTypesExtractor;
|
|
18
|
+
extractComponentDescription: typeof lib_docs_tools_dist.extractComponentDescription;
|
|
20
19
|
};
|
|
21
20
|
framework: string;
|
|
22
21
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,30 +1,22 @@
|
|
|
1
1
|
import { ClientStoryApi, Loadable } from '@storybook/addons';
|
|
2
2
|
import * as _storybook_csf from '@storybook/csf';
|
|
3
3
|
import { Args, DecoratorFunction, ComponentAnnotations, AnnotatedStoryFn, ArgsStoryFn, StoryAnnotations, LoaderFunction, ProjectAnnotations } from '@storybook/csf';
|
|
4
|
-
import { R as ReactFramework,
|
|
4
|
+
import { R as ReactFramework, S as StoryFnReactReturnType } from './types-7e2d88a6.js';
|
|
5
5
|
import { Simplify, SetOptional, UnionToIntersection } from 'type-fest';
|
|
6
6
|
import { ComponentType, ComponentProps, JSXElementConstructor } from 'react';
|
|
7
7
|
import * as _storybook_store from '@storybook/store';
|
|
8
8
|
import { ComposedStory, CSFExports, StoriesWithPartialProps } from '@storybook/store';
|
|
9
9
|
|
|
10
10
|
interface ClientApi extends ClientStoryApi<ReactFramework['storyResult']> {
|
|
11
|
-
setAddon(addon: any): void;
|
|
12
11
|
configure(loader: Loadable, module: NodeModule): void;
|
|
13
|
-
getStorybook(): IStorybookSection[];
|
|
14
|
-
clearDecorators(): void;
|
|
15
12
|
forceReRender(): void;
|
|
16
13
|
raw: () => any;
|
|
17
14
|
}
|
|
18
15
|
declare const storiesOf: ClientApi['storiesOf'];
|
|
19
16
|
declare const configure: ClientApi['configure'];
|
|
20
|
-
declare const addDecorator: ClientApi['addDecorator'];
|
|
21
|
-
declare type DecoratorFn<TArgs = Args> = DecoratorFunction<ReactFramework, TArgs>;
|
|
22
|
-
declare const addParameters: ClientApi['addParameters'];
|
|
23
|
-
declare const clearDecorators: ClientApi['clearDecorators'];
|
|
24
|
-
declare const setAddon: ClientApi['setAddon'];
|
|
25
17
|
declare const forceReRender: ClientApi['forceReRender'];
|
|
26
|
-
declare const getStorybook: ClientApi['getStorybook'];
|
|
27
18
|
declare const raw: ClientApi['raw'];
|
|
19
|
+
declare type DecoratorFn<TArgs = Args> = DecoratorFunction<ReactFramework, TArgs>;
|
|
28
20
|
|
|
29
21
|
declare type JSXElement = keyof JSX.IntrinsicElements | JSXElementConstructor<any>;
|
|
30
22
|
/**
|
|
@@ -190,4 +182,4 @@ declare function composeStory<TArgs = Args>(story: ComposedStory<ReactFramework,
|
|
|
190
182
|
*/
|
|
191
183
|
declare function composeStories<TModule extends CSFExports<ReactFramework>>(csfExports: TModule, projectAnnotations?: ProjectAnnotations<ReactFramework>): Omit<StoriesWithPartialProps<ReactFramework, TModule>, keyof CSFExports<_storybook_csf.AnyFramework>>;
|
|
192
184
|
|
|
193
|
-
export { ComponentMeta, ComponentStory, ComponentStoryFn, ComponentStoryObj, DecoratorFn, Meta, Story, StoryFn, StoryObj,
|
|
185
|
+
export { ComponentMeta, ComponentStory, ComponentStoryFn, ComponentStoryObj, DecoratorFn, Meta, Story, StoryFn, StoryObj, composeStories, composeStory, configure, forceReRender, raw, setGlobalConfig, setProjectAnnotations, storiesOf };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var T=Object.create;var
|
|
1
|
+
"use strict";var T=Object.create;var p=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var U=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty;var N=(o,t)=>{for(var e in t)p(o,e,{get:t[e],enumerable:!0})},y=(o,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of W(t))!L.call(o,s)&&s!==e&&p(o,s,{get:()=>t[s],enumerable:!(r=v(t,s))||r.enumerable});return o};var m=(o,t,e)=>(e=o!=null?T(U(o)):{},y(t||!o||!o.__esModule?p(e,"default",{value:o,enumerable:!0}):e,o)),O=o=>y(p({},"__esModule",{value:!0}),o);var K={};N(K,{composeStories:()=>Z,composeStory:()=>b,configure:()=>z,forceReRender:()=>H,raw:()=>J,setGlobalConfig:()=>Q,setProjectAnnotations:()=>M,storiesOf:()=>q});module.exports=O(K);var g=m(require("global")),{window:A}=g.default;A&&(A.STORYBOOK_ENV="react");var S=require("@storybook/core-client");var h=m(require("global")),n=m(require("react")),a=m(require("react-dom")),{FRAMEWORK_OPTIONS:i}=h.default,l=new Map,d=(o,t)=>{let{id:e,component:r}=t;if(!r)throw new Error(`Unable to render story ${e} as the component annotation is missing from the default export`);return n.default.createElement(r,{...o})},G=({callback:o,children:t})=>{let e=(0,n.useRef)();return(0,n.useLayoutEffect)(()=>{e.current!==o&&(e.current=o,o())},[o]),t},V=async(o,t)=>{let e=await $(t);return new Promise(r=>{e?e.render(n.default.createElement(G,{callback:()=>r(null)},o)):a.default.render(o,t,()=>r(null))})},B=a.version&&(a.version.startsWith("18")||a.version.startsWith("0.0.0")),Y=(i==null?void 0:i.legacyRootApi)!==!0,x=Y&&B,C=o=>{let t=l.get(o);t&&x?(t.unmount(),l.delete(o)):a.default.unmountComponentAtNode(o)},$=async o=>{if(!x)return null;let t=l.get(o);return t||(t=(await import("react-dom/client")).default.createRoot(o),l.set(o,t)),t},R=class extends n.Component{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidMount(){let{hasError:e}=this.state,{showMain:r}=this.props;e||r()}componentDidCatch(e){let{showException:r}=this.props;r(e)}render(){let{hasError:e}=this.state,{children:r}=this.props;return e?null:r}},F=i!=null&&i.strictMode?n.StrictMode:n.Fragment;async function k({storyContext:o,unboundStoryFn:t,showMain:e,showException:r,forceRemount:s},u){let w=n.default.createElement(R,{showMain:e,showException:r},n.default.createElement(t,{...o})),D=F?n.default.createElement(F,null,w):w;return s&&C(u),await V(D,u),()=>C(u)}var E="react",f=(0,S.start)(k,{render:d}),q=(o,t)=>f.clientApi.storiesOf(o,t).addParameters({framework:E}),z=(...o)=>f.configure(E,...o),H=f.forceReRender,J=f.clientApi.raw;var c=require("@storybook/store"),P=require("@storybook/client-logger");function M(o){(0,c.setProjectAnnotations)(o)}function Q(o){(0,P.deprecate)("setGlobalConfig is deprecated. Use setProjectAnnotations instead."),M(o)}var X={render:d};function b(o,t,e,r){return(0,c.composeStory)(o,t,e,X,r)}function Z(o,t){return(0,c.composeStories)(o,t,b)}var j;(j=module==null?void 0:module.hot)==null||j.decline();0&&(module.exports={composeStories,composeStory,configure,forceReRender,raw,setGlobalConfig,setProjectAnnotations,storiesOf});
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as e,b as a}from"./chunk-WO7CMEGS.mjs";import c from"global";var{window:i}=c;i&&(i.STORYBOOK_ENV="react");import{start as A}from"@storybook/core-client";var p="react",n=A(a,{render:e}),x=(o,r)=>n.clientApi.storiesOf(o,r).addParameters({framework:p}),w=(...o)=>n.configure(p,...o),T=n.forceReRender,u=n.clientApi.raw;import{composeStory as g,composeStories as y,setProjectAnnotations as d}from"@storybook/store";import{deprecate as f}from"@storybook/client-logger";function l(o){d(o)}function D(o){f("setGlobalConfig is deprecated. Use setProjectAnnotations instead."),l(o)}var S={render:e};function F(o,r,s,m){return g(o,r,s,S,m)}function E(o,r){return y(o,r,F)}module?.hot?.decline();export{E as composeStories,F as composeStory,w as configure,T as forceReRender,u as raw,D as setGlobalConfig,l as setProjectAnnotations,x as storiesOf};
|
|
@@ -6,13 +6,5 @@ interface ReactFramework extends AnyFramework {
|
|
|
6
6
|
storyResult: StoryFnReactReturnType;
|
|
7
7
|
}
|
|
8
8
|
declare type StoryFnReactReturnType = ReactElement<unknown>;
|
|
9
|
-
interface IStorybookStory {
|
|
10
|
-
name: string;
|
|
11
|
-
render: (context: any) => any;
|
|
12
|
-
}
|
|
13
|
-
interface IStorybookSection {
|
|
14
|
-
kind: string;
|
|
15
|
-
stories: IStorybookStory[];
|
|
16
|
-
}
|
|
17
9
|
|
|
18
|
-
export {
|
|
10
|
+
export { ReactFramework as R, StoryFnReactReturnType as S };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.39",
|
|
4
4
|
"description": "Storybook React renderer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
"prep": "../../../scripts/prepare/bundle.ts"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@storybook/addons": "7.0.0-alpha.
|
|
55
|
-
"@storybook/client-logger": "7.0.0-alpha.
|
|
56
|
-
"@storybook/core-client": "7.0.0-alpha.
|
|
54
|
+
"@storybook/addons": "7.0.0-alpha.39",
|
|
55
|
+
"@storybook/client-logger": "7.0.0-alpha.39",
|
|
56
|
+
"@storybook/core-client": "7.0.0-alpha.39",
|
|
57
57
|
"@storybook/csf": "0.0.2--canary.49.258942b.0",
|
|
58
|
-
"@storybook/docs-tools": "7.0.0-alpha.
|
|
59
|
-
"@storybook/store": "7.0.0-alpha.
|
|
58
|
+
"@storybook/docs-tools": "7.0.0-alpha.39",
|
|
59
|
+
"@storybook/store": "7.0.0-alpha.39",
|
|
60
60
|
"@types/estree": "^0.0.51",
|
|
61
61
|
"@types/node": "^16.0.0",
|
|
62
62
|
"acorn": "^7.4.1",
|
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
],
|
|
104
104
|
"platform": "browser"
|
|
105
105
|
},
|
|
106
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "47386bd49d141ea70daac41ab3e4d52749fc5da9"
|
|
107
107
|
}
|