1 |
- "use strict";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 __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__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};var __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 entry_preview_exports={};__export(entry_preview_exports,{parameters:()=>parameters,render:()=>render,renderToCanvas:()=>renderToCanvas});module.exports=__toCommonJS(entry_preview_exports);var import_global=require("@storybook/global"),import_react=__toESM(require("react")),import_react_dom_shim=require("@storybook/react-dom-shim"),{FRAMEWORK_OPTIONS}=import_global.global,render=(args,context)=>{let{id,component:Component}=context;if(!Component)throw new Error(`Unable to render story ${id} as the component annotation is missing from the default export`);return import_react.default.createElement(Component,{...args})},ErrorBoundary=class extends import_react.Component{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidMount(){let{hasError}=this.state,{showMain}=this.props;hasError||showMain()}componentDidCatch(err){let{showException}=this.props;showException(err)}render(){let{hasError}=this.state,{children}=this.props;return hasError?null:children}},Wrapper=FRAMEWORK_OPTIONS!=null&&FRAMEWORK_OPTIONS.strictMode?import_react.StrictMode:import_react.Fragment;async function renderToCanvas({storyContext,unboundStoryFn,showMain,showException,forceRemount},canvasElement){let content=import_react.default.createElement(ErrorBoundary,{showMain,showException},import_react.default.createElement(unboundStoryFn,{...storyContext})),element=Wrapper?import_react.default.createElement(Wrapper,null,content):content;return forceRemount&&(0,import_react_dom_shim.unmountElement)(canvasElement),await(0,import_react_dom_shim.renderElement)(element,canvasElement),()=>(0,import_react_dom_shim.unmountElement)(canvasElement)}var parameters={renderer:"react"};0&&(module.exports={parameters,render,renderToCanvas});
|