1 line
No EOL
9.3 KiB
Text
1 line
No EOL
9.3 KiB
Text
{"version":3,"file":"entry-preview-docs-BInlz0sG.js","sources":["../../node_modules/@storybook/svelte/dist/entry-preview-docs.mjs"],"sourcesContent":["import './chunk-CEH6MNVV.mjs';\nimport { enhanceArgTypes, SNIPPET_RENDERED, SourceType } from 'storybook/internal/docs-tools';\nimport { logger, deprecate } from 'storybook/internal/client-logger';\nimport { addons, useEffect } from 'storybook/internal/preview-api';\n\nfunction hasKeyword(keyword,keywords){return keywords?keywords.find(k=>k.name===keyword)!=null:!1}var extractArgTypes=component=>{try{let docgen=component.__docgen;if(docgen)return createArgTypes(docgen)}catch(err){logger.log(`Error extracting argTypes: ${err}`);}return {}},createArgTypes=docgen=>{let results={};return docgen.data&&docgen.data.forEach(item=>{results[item.name]={control:parseTypeToControl(item.type),name:item.name,description:item.description||void 0,type:{required:hasKeyword(\"required\",item.keywords||[]),name:item.type?.text},table:{type:{summary:item.type?.text},defaultValue:{summary:item.defaultValue},category:\"properties\"}};}),docgen.events&&docgen.events.forEach(item=>{results[`event_${item.name}`]={name:item.name,action:item.name,control:!1,...item.description?{description:item.description}:{},table:{category:\"events\"}};}),docgen.slots&&docgen.slots.forEach(item=>{results[`slot_${item.name}`]={name:item.name,control:!1,description:[item.description,item.params?.map(p=>`\\`${p.name}\\``).join(\" \")].filter(p=>p).join(`\n\n`),table:{category:\"slots\"}};}),results},parseTypeToControl=type=>{if(!type)return null;if(type.kind===\"type\")switch(type.type){case\"string\":return {type:\"text\"};case\"enum\":return {type:\"radio\"};case\"any\":return {type:\"object\"};default:return {type:type.type}}else if(type.kind===\"union\"&&Array.isArray(type.type)&&!type.type.find(t=>t.type!==\"string\"))return {type:\"radio\",options:type.type.filter(t=>t.kind===\"const\").map(t=>t.value)};return null};function extractComponentDescription(component){if(!component)return \"\";let{__docgen={}}=component;return __docgen.description}var skipSourceRender=context=>{let sourceParams=context?.parameters.docs?.source,isArgsStory=context?.parameters.__isArgsStory;return sourceParams?.type===SourceType.DYNAMIC?!1:!isArgsStory||sourceParams?.code||sourceParams?.type===SourceType.CODE};function toSvelteProperty(key,value,argTypes){if(value==null)return null;let argType=argTypes[key];return argType&&argType.defaultValue===value||argType&&argType.action?null:value===!0?key:typeof value==\"string\"?`${key}=${JSON.stringify(value)}`:typeof value==\"function\"?`${key}={<handler>}`:`${key}={${JSON.stringify(value)}}`}function getComponentName(component){if(component==null)return null;let{__docgen={}}=component,{name}=__docgen;return name?(name.endsWith(\".svelte\")&&(name=name.substring(0,name.length-7)),name):component.name}function generateSvelteSource(component,args,argTypes,slotProperty){let name=getComponentName(component);if(!name)return null;let propsArray=Object.entries(args).filter(([k])=>k!==slotProperty).map(([k,v])=>toSvelteProperty(k,v,argTypes)).filter(p=>p),props=propsArray.join(\" \"),multiline=props.length>50,slotValue=slotProperty?args[slotProperty]:null,srcStart=multiline?`<${name}\n ${propsArray.join(`\n `)}`:`<${name} ${props}`;return slotValue?`${srcStart}>\n ${slotValue}\n</${name}>`:`${srcStart}/>`}function getWrapperProperties(component){let{__docgen}=component||{};return __docgen?__docgen.keywords?.find(kw=>kw.name===\"wrapper\")?{wrapper:!0,slotProperty:__docgen.data?.find(prop=>prop.keywords.find(kw=>kw.name===\"slot\"))?.name}:{wrapper:!1}:{wrapper:!1}}var sourceDecorator=(storyFn,context)=>{let channel=addons.getChannel(),skip=skipSourceRender(context),story=storyFn(),source;if(useEffect(()=>{if(!skip&&source){let{id,unmappedArgs}=context;channel.emit(SNIPPET_RENDERED,{id,args:unmappedArgs,source});}}),skip)return story;let{parameters:parameters2={},args={},component:ctxComponent}=context||{},{Component:component}=context.originalStoryFn(args,context),{wrapper,slotProperty}=getWrapperProperties(component);wrapper&&(parameters2.component&&deprecate(\"parameters.component is deprecated. Using context.component instead.\"),component=ctxComponent);let generated=generateSvelteSource(component,args,context?.argTypes,slotProperty);return generated&&(source=generated),story};var parameters={docs:{story:{inline:!0},extractArgTypes,extractComponentDescription}},decorators=[sourceDecorator],argTypesEnhancers=[enhanceArgTypes];\n\nexport { argTypesEnhancers, decorators, parameters };\n"],"names":["logger","deprecate","addons","useEffect","hasKeyword","keyword","keywords","k","extractArgTypes","component","docgen","createArgTypes","err","results","item","parseTypeToControl","_a","_b","p","type","t","extractComponentDescription","__docgen","skipSourceRender","context","sourceParams","isArgsStory","SourceType","toSvelteProperty","key","value","argTypes","argType","getComponentName","name","generateSvelteSource","args","slotProperty","propsArray","v","props","multiline","slotValue","srcStart","getWrapperProperties","kw","_c","prop","sourceDecorator","storyFn","channel","skip","story","source","id","unmappedArgs","SNIPPET_RENDERED","parameters2","ctxComponent","wrapper","generated","parameters","decorators","argTypesEnhancers","enhanceArgTypes"],"mappings":"sDAEA,KAAA,CAAA,OAAAA,EAAA,UAAAC,CAAA,EAAA,mCACA,CAAA,OAAAC,EAAA,UAAAC,CAAA,EAAA,iCAEA,SAASC,EAAWC,EAAQC,EAAS,CAAC,OAAOA,EAASA,EAAS,KAAKC,GAAGA,EAAE,OAAOF,CAAO,GAAG,KAAK,EAAE,CAAC,IAAIG,EAAgBC,GAAW,CAAC,GAAG,CAAC,IAAIC,EAAOD,EAAU,SAAS,GAAGC,EAAO,OAAOC,EAAeD,CAAM,CAAC,OAAOE,EAAI,CAACZ,EAAO,IAAI,8BAA8BY,CAAG,EAAE,CAAE,CAAC,MAAO,CAAE,CAAA,EAAED,EAAeD,GAAQ,CAAC,IAAIG,EAAQ,CAAE,EAAC,OAAOH,EAAO,MAAMA,EAAO,KAAK,QAAQI,GAAM,SAACD,EAAQC,EAAK,IAAI,EAAE,CAAC,QAAQC,EAAmBD,EAAK,IAAI,EAAE,KAAKA,EAAK,KAAK,YAAYA,EAAK,aAAa,OAAO,KAAK,CAAC,SAASV,EAAW,WAAWU,EAAK,UAAU,CAAA,CAAE,EAAE,MAAKE,EAAAF,EAAK,OAAL,YAAAE,EAAW,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,SAAQC,EAAAH,EAAK,OAAL,YAAAG,EAAW,IAAI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