@storybook/csf 0.1.11 → 0.1.12--canary.100.877a297.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.ts CHANGED
@@ -251,7 +251,6 @@ type ViewMode = 'story' | 'docs';
251
251
  type LoaderFunction<TRenderer extends Renderer = Renderer, TArgs = Args> = (context: StoryContextForLoaders<TRenderer, TArgs>) => Promise<Record<string, any> | void> | Record<string, any> | void;
252
252
  type Awaitable<T> = T | PromiseLike<T>;
253
253
  type CleanupCallback = () => Awaitable<unknown>;
254
- type BeforeAll = () => Awaitable<CleanupCallback | void>;
255
254
  type BeforeEach<TRenderer extends Renderer = Renderer, TArgs = Args> = (context: StoryContext<TRenderer, TArgs>) => Awaitable<CleanupCallback | void>;
256
255
  interface Canvas {
257
256
  }
@@ -335,18 +334,6 @@ interface BaseAnnotations<TRenderer extends Renderer = Renderer, TArgs = Args> {
335
334
  interface ProjectAnnotations<TRenderer extends Renderer = Renderer, TArgs = Args> extends BaseAnnotations<TRenderer, TArgs> {
336
335
  argsEnhancers?: ArgsEnhancer<TRenderer, Args>[];
337
336
  argTypesEnhancers?: ArgTypesEnhancer<TRenderer, Args>[];
338
- /**
339
- * Lifecycle hook which runs once, before any loaders, decorators or stories, and may rerun when configuration changes or when reinitializing (e.g. between test runs).
340
- * The function may be synchronous or asynchronous, and may return a cleanup function which may also be synchronous or asynchronous.
341
- * The cleanup function is not guaranteed to run (e.g. when the browser closes), but runs when configuration changes or when reinitializing.
342
- * This hook may only be defined globally (i.e. not on component or story level).
343
- * When multiple hooks are specified, they are to be executed sequentially (and awaited) in the following order:
344
- * - Addon hooks (in order of addons array in e.g. .storybook/main.js)
345
- * - Annotation hooks (in order of previewAnnotations array in e.g. .storybook/main.js)
346
- * - Preview hook (via e.g. .storybook/preview.js)
347
- * Cleanup functions are executed sequentially in reverse order of initialization.
348
- */
349
- beforeAll?: BeforeAll;
350
337
  /**
351
338
  * @deprecated Project `globals` renamed to `initiaGlobals`
352
339
  */
@@ -514,4 +501,4 @@ declare const parseKind: (kind: string, { rootSeparator, groupSeparator }: Separ
514
501
  */
515
502
  declare const combineTags: (...tags: string[]) => string[];
516
503
 
517
- export { AnnotatedStoryFn, AnyFramework, ArgTypes, ArgTypesEnhancer, Args, ArgsEnhancer, ArgsFromMeta, ArgsStoryFn, BaseAnnotations, BeforeAll, BeforeEach, Canvas, CleanupCallback, ComponentAnnotations, ComponentId, ComponentTitle, Conditional, DecoratorApplicator, DecoratorFunction, GlobalTypes, Globals, IncludeExcludeOptions, InputType, LegacyAnnotatedStoryFn, LegacyStoryAnnotationsOrFn, LegacyStoryFn, LoaderFunction, Parameters, PartialStoryFn, PlayFunction, PlayFunctionContext, ProjectAnnotations, Renderer, SBArrayType, SBEnumType, SBIntersectionType, SBObjectType, SBOtherType, SBScalarType, SBType, SBUnionType, SeparatorOptions, StepFunction, StepLabel, StepRunner, StoryAnnotations, StoryAnnotationsOrFn, StoryContext, StoryContextForEnhancers, StoryContextForLoaders, StoryContextUpdate, StoryFn, StoryId, StoryIdentifier, StoryKind, StoryName, StrictArgTypes, StrictArgs, StrictGlobalTypes, StrictInputType, StrictParameters, Tag, ViewMode, combineTags, includeConditionalArg, isExportStory, parseKind, sanitize, storyNameFromExport, toId };
504
+ export { AnnotatedStoryFn, AnyFramework, ArgTypes, ArgTypesEnhancer, Args, ArgsEnhancer, ArgsFromMeta, ArgsStoryFn, BaseAnnotations, BeforeEach, Canvas, CleanupCallback, ComponentAnnotations, ComponentId, ComponentTitle, Conditional, DecoratorApplicator, DecoratorFunction, GlobalTypes, Globals, IncludeExcludeOptions, InputType, LegacyAnnotatedStoryFn, LegacyStoryAnnotationsOrFn, LegacyStoryFn, LoaderFunction, Parameters, PartialStoryFn, PlayFunction, PlayFunctionContext, ProjectAnnotations, Renderer, SBArrayType, SBEnumType, SBIntersectionType, SBObjectType, SBOtherType, SBScalarType, SBType, SBUnionType, SeparatorOptions, StepFunction, StepLabel, StepRunner, StoryAnnotations, StoryAnnotationsOrFn, StoryContext, StoryContextForEnhancers, StoryContextForLoaders, StoryContextUpdate, StoryFn, StoryId, StoryIdentifier, StoryKind, StoryName, StrictArgTypes, StrictArgs, StrictGlobalTypes, StrictInputType, StrictParameters, Tag, ViewMode, combineTags, includeConditionalArg, isExportStory, parseKind, sanitize, storyNameFromExport, toId };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var C=Object.create;var u=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var v=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var E=(r,e,n,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of F(e))!w.call(r,a)&&a!==n&&u(r,a,{get:()=>e[a],enumerable:!(t=B(e,a))||t.enumerable});return r};var I=(r,e,n)=>(n=r!=null?C(h(r)):{},E(e||!r||!r.__esModule?u(n,"default",{value:r,enumerable:!0}):n,r));var x=v(T=>{Object.defineProperty(T,"__esModule",{value:!0}),T.isEqual=function(){var r=Object.prototype.toString,e=Object.getPrototypeOf,n=Object.getOwnPropertySymbols?function(t){return Object.keys(t).concat(Object.getOwnPropertySymbols(t))}:Object.keys;return function(t,a){return function i(o,s,p){var y,g,d,c=r.call(o),b=r.call(s);if(o===s)return !0;if(o==null||s==null)return !1;if(p.indexOf(o)>-1&&p.indexOf(s)>-1)return !0;if(p.push(o,s),c!=b||(y=n(o),g=n(s),y.length!=g.length||y.some(function(A){return !i(o[A],s[A],p)})))return !1;switch(c.slice(8,-1)){case"Symbol":return o.valueOf()==s.valueOf();case"Date":case"Number":return +o==+s||+o!=+o&&+s!=+s;case"RegExp":case"Function":case"String":case"Boolean":return ""+o==""+s;case"Set":case"Map":y=o.entries(),g=s.entries();do if(!i((d=y.next()).value,g.next().value,p))return !1;while(!d.done);return !0;case"ArrayBuffer":o=new Uint8Array(o),s=new Uint8Array(s);case"DataView":o=new Uint8Array(o.buffer),s=new Uint8Array(s.buffer);case"Float32Array":case"Float64Array":case"Int8Array":case"Int16Array":case"Int32Array":case"Uint8Array":case"Uint16Array":case"Uint32Array":case"Uint8ClampedArray":case"Arguments":case"Array":if(o.length!=s.length)return !1;for(d=0;d<o.length;d++)if((d in o||d in s)&&(d in o!=d in s||!i(o[d],s[d],p)))return !1;return !0;case"Object":return i(e(o),e(s),p);default:return !1}}(t,a,[])}}();});function R(r){return r.replace(/_/g," ").replace(/-/g," ").replace(/\./g," ").replace(/([^\n])([A-Z])([a-z])/g,(e,n,t,a)=>`${n} ${t}${a}`).replace(/([a-z])([A-Z])/g,(e,n,t)=>`${n} ${t}`).replace(/([a-z])([0-9])/gi,(e,n,t)=>`${n} ${t}`).replace(/([0-9])([a-z])/gi,(e,n,t)=>`${n} ${t}`).replace(/(\s|^)(\w)/g,(e,n,t)=>`${n}${t.toUpperCase()}`).replace(/ +/g," ").trim()}var l=I(x()),S=r=>r.map(e=>typeof e<"u").filter(Boolean).length,k=(r,e)=>{let{exists:n,eq:t,neq:a,truthy:i}=r;if(S([n,t,a,i])>1)throw new Error(`Invalid conditional test ${JSON.stringify({exists:n,eq:t,neq:a})}`);if(typeof t<"u")return (0, l.isEqual)(e,t);if(typeof a<"u")return !(0, l.isEqual)(e,a);if(typeof n<"u"){let s=typeof e<"u";return n?s:!s}return (typeof i>"u"?!0:i)?!!e:!e},P=(r,e,n)=>{if(!r.if)return !0;let{arg:t,global:a}=r.if;if(S([t,a])!==1)throw new Error(`Invalid conditional value ${JSON.stringify({arg:t,global:a})}`);let i=t?e[t]:n[a];return k(r.if,i)};var O=r=>r.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,"-").replace(/-+/g,"-").replace(/^-+/,"").replace(/-+$/,""),m=(r,e)=>{let n=O(r);if(n==="")throw new Error(`Invalid ${e} '${r}', must include alphanumeric characters`);return n},G=(r,e)=>`${m(r,"kind")}${e?`--${m(e,"name")}`:""}`,N=r=>R(r);function f(r,e){return Array.isArray(e)?e.includes(r):r.match(e)}function M(r,{includeStories:e,excludeStories:n}){return r!=="__esModule"&&(!e||f(r,e))&&(!n||!f(r,n))}var V=(r,{rootSeparator:e,groupSeparator:n})=>{let[t,a]=r.split(e,2),i=(a||r).split(n).filter(o=>!!o);return {root:a?t:null,groups:i}},z=(...r)=>{let e=r.reduce((n,t)=>(t.startsWith("!")?n.delete(t.slice(1)):n.add(t),n),new Set);return Array.from(e)};
3
+ var C=Object.create;var u=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var E=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var v=(r,e,n,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of F(e))!w.call(r,a)&&a!==n&&u(r,a,{get:()=>e[a],enumerable:!(t=B(e,a))||t.enumerable});return r};var I=(r,e,n)=>(n=r!=null?C(h(r)):{},v(e||!r||!r.__esModule?u(n,"default",{value:r,enumerable:!0}):n,r));var x=E(T=>{Object.defineProperty(T,"__esModule",{value:!0}),T.isEqual=function(){var r=Object.prototype.toString,e=Object.getPrototypeOf,n=Object.getOwnPropertySymbols?function(t){return Object.keys(t).concat(Object.getOwnPropertySymbols(t))}:Object.keys;return function(t,a){return function i(o,s,p){var y,g,d,c=r.call(o),b=r.call(s);if(o===s)return !0;if(o==null||s==null)return !1;if(p.indexOf(o)>-1&&p.indexOf(s)>-1)return !0;if(p.push(o,s),c!=b||(y=n(o),g=n(s),y.length!=g.length||y.some(function(A){return !i(o[A],s[A],p)})))return !1;switch(c.slice(8,-1)){case"Symbol":return o.valueOf()==s.valueOf();case"Date":case"Number":return +o==+s||+o!=+o&&+s!=+s;case"RegExp":case"Function":case"String":case"Boolean":return ""+o==""+s;case"Set":case"Map":y=o.entries(),g=s.entries();do if(!i((d=y.next()).value,g.next().value,p))return !1;while(!d.done);return !0;case"ArrayBuffer":o=new Uint8Array(o),s=new Uint8Array(s);case"DataView":o=new Uint8Array(o.buffer),s=new Uint8Array(s.buffer);case"Float32Array":case"Float64Array":case"Int8Array":case"Int16Array":case"Int32Array":case"Uint8Array":case"Uint16Array":case"Uint32Array":case"Uint8ClampedArray":case"Arguments":case"Array":if(o.length!=s.length)return !1;for(d=0;d<o.length;d++)if((d in o||d in s)&&(d in o!=d in s||!i(o[d],s[d],p)))return !1;return !0;case"Object":return i(e(o),e(s),p);default:return !1}}(t,a,[])}}();});function R(r){return r.replace(/_/g," ").replace(/-/g," ").replace(/\./g," ").replace(/([^\n])([A-Z])([a-z])/g,(e,n,t,a)=>`${n} ${t}${a}`).replace(/([a-z])([A-Z])/g,(e,n,t)=>`${n} ${t}`).replace(/([a-z])([0-9])/gi,(e,n,t)=>`${n} ${t}`).replace(/([0-9])([a-z])/gi,(e,n,t)=>`${n} ${t}`).replace(/(\s|^)(\w)/g,(e,n,t)=>`${n}${t.toUpperCase()}`).replace(/ +/g," ").trim()}var l=I(x()),S=r=>r.map(e=>typeof e<"u").filter(Boolean).length,k=(r,e)=>{let{exists:n,eq:t,neq:a,truthy:i}=r;if(S([n,t,a,i])>1)throw new Error(`Invalid conditional test ${JSON.stringify({exists:n,eq:t,neq:a})}`);if(typeof t<"u")return (0, l.isEqual)(e,t);if(typeof a<"u")return !(0, l.isEqual)(e,a);if(typeof n<"u"){let s=typeof e<"u";return n?s:!s}return (typeof i>"u"?!0:i)?!!e:!e},P=(r,e,n)=>{if(!r.if)return !0;let{arg:t,global:a}=r.if;if(S([t,a])!==1)throw new Error(`Invalid conditional value ${JSON.stringify({arg:t,global:a})}`);let i=t?e[t]:n[a];return k(r.if,i)};var O=r=>r.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,"-").replace(/-+/g,"-").replace(/^-+/,"").replace(/-+$/,""),m=(r,e)=>{let n=O(r);if(n==="")throw new Error(`Invalid ${e} '${r}', must include alphanumeric characters`);return n},G=(r,e)=>`${m(r,"kind")}${e?`--${m(e,"name")}`:""}`,N=r=>R(r);function f(r,e){return Array.isArray(e)?e.includes(r):r.match(e)}function M(r,{includeStories:e,excludeStories:n}){return r!=="__esModule"&&(!e||f(r,e))&&(!n||!f(r,n))}var V=(r,{rootSeparator:e,groupSeparator:n})=>{let[t,a]=r.split(e,2),i=(a||r).split(n).filter(o=>!!o);return {root:a?t:null,groups:i}},z=(...r)=>{let e=r.reduce((n,t)=>(t.startsWith("!")?n.delete(t.slice(1)):n.add(t),n),new Set);return Array.from(e)};
4
4
 
5
5
  exports.combineTags = z;
6
6
  exports.includeConditionalArg = P;
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- var C=Object.create;var u=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var v=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var E=(r,e,n,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of F(e))!w.call(r,a)&&a!==n&&u(r,a,{get:()=>e[a],enumerable:!(t=B(e,a))||t.enumerable});return r};var I=(r,e,n)=>(n=r!=null?C(h(r)):{},E(e||!r||!r.__esModule?u(n,"default",{value:r,enumerable:!0}):n,r));var x=v(T=>{Object.defineProperty(T,"__esModule",{value:!0}),T.isEqual=function(){var r=Object.prototype.toString,e=Object.getPrototypeOf,n=Object.getOwnPropertySymbols?function(t){return Object.keys(t).concat(Object.getOwnPropertySymbols(t))}:Object.keys;return function(t,a){return function i(o,s,p){var y,g,d,c=r.call(o),b=r.call(s);if(o===s)return !0;if(o==null||s==null)return !1;if(p.indexOf(o)>-1&&p.indexOf(s)>-1)return !0;if(p.push(o,s),c!=b||(y=n(o),g=n(s),y.length!=g.length||y.some(function(A){return !i(o[A],s[A],p)})))return !1;switch(c.slice(8,-1)){case"Symbol":return o.valueOf()==s.valueOf();case"Date":case"Number":return +o==+s||+o!=+o&&+s!=+s;case"RegExp":case"Function":case"String":case"Boolean":return ""+o==""+s;case"Set":case"Map":y=o.entries(),g=s.entries();do if(!i((d=y.next()).value,g.next().value,p))return !1;while(!d.done);return !0;case"ArrayBuffer":o=new Uint8Array(o),s=new Uint8Array(s);case"DataView":o=new Uint8Array(o.buffer),s=new Uint8Array(s.buffer);case"Float32Array":case"Float64Array":case"Int8Array":case"Int16Array":case"Int32Array":case"Uint8Array":case"Uint16Array":case"Uint32Array":case"Uint8ClampedArray":case"Arguments":case"Array":if(o.length!=s.length)return !1;for(d=0;d<o.length;d++)if((d in o||d in s)&&(d in o!=d in s||!i(o[d],s[d],p)))return !1;return !0;case"Object":return i(e(o),e(s),p);default:return !1}}(t,a,[])}}();});function R(r){return r.replace(/_/g," ").replace(/-/g," ").replace(/\./g," ").replace(/([^\n])([A-Z])([a-z])/g,(e,n,t,a)=>`${n} ${t}${a}`).replace(/([a-z])([A-Z])/g,(e,n,t)=>`${n} ${t}`).replace(/([a-z])([0-9])/gi,(e,n,t)=>`${n} ${t}`).replace(/([0-9])([a-z])/gi,(e,n,t)=>`${n} ${t}`).replace(/(\s|^)(\w)/g,(e,n,t)=>`${n}${t.toUpperCase()}`).replace(/ +/g," ").trim()}var l=I(x()),S=r=>r.map(e=>typeof e<"u").filter(Boolean).length,k=(r,e)=>{let{exists:n,eq:t,neq:a,truthy:i}=r;if(S([n,t,a,i])>1)throw new Error(`Invalid conditional test ${JSON.stringify({exists:n,eq:t,neq:a})}`);if(typeof t<"u")return (0, l.isEqual)(e,t);if(typeof a<"u")return !(0, l.isEqual)(e,a);if(typeof n<"u"){let s=typeof e<"u";return n?s:!s}return (typeof i>"u"?!0:i)?!!e:!e},P=(r,e,n)=>{if(!r.if)return !0;let{arg:t,global:a}=r.if;if(S([t,a])!==1)throw new Error(`Invalid conditional value ${JSON.stringify({arg:t,global:a})}`);let i=t?e[t]:n[a];return k(r.if,i)};var O=r=>r.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,"-").replace(/-+/g,"-").replace(/^-+/,"").replace(/-+$/,""),m=(r,e)=>{let n=O(r);if(n==="")throw new Error(`Invalid ${e} '${r}', must include alphanumeric characters`);return n},G=(r,e)=>`${m(r,"kind")}${e?`--${m(e,"name")}`:""}`,N=r=>R(r);function f(r,e){return Array.isArray(e)?e.includes(r):r.match(e)}function M(r,{includeStories:e,excludeStories:n}){return r!=="__esModule"&&(!e||f(r,e))&&(!n||!f(r,n))}var V=(r,{rootSeparator:e,groupSeparator:n})=>{let[t,a]=r.split(e,2),i=(a||r).split(n).filter(o=>!!o);return {root:a?t:null,groups:i}},z=(...r)=>{let e=r.reduce((n,t)=>(t.startsWith("!")?n.delete(t.slice(1)):n.add(t),n),new Set);return Array.from(e)};
1
+ var C=Object.create;var u=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var E=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var v=(r,e,n,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of F(e))!w.call(r,a)&&a!==n&&u(r,a,{get:()=>e[a],enumerable:!(t=B(e,a))||t.enumerable});return r};var I=(r,e,n)=>(n=r!=null?C(h(r)):{},v(e||!r||!r.__esModule?u(n,"default",{value:r,enumerable:!0}):n,r));var x=E(T=>{Object.defineProperty(T,"__esModule",{value:!0}),T.isEqual=function(){var r=Object.prototype.toString,e=Object.getPrototypeOf,n=Object.getOwnPropertySymbols?function(t){return Object.keys(t).concat(Object.getOwnPropertySymbols(t))}:Object.keys;return function(t,a){return function i(o,s,p){var y,g,d,c=r.call(o),b=r.call(s);if(o===s)return !0;if(o==null||s==null)return !1;if(p.indexOf(o)>-1&&p.indexOf(s)>-1)return !0;if(p.push(o,s),c!=b||(y=n(o),g=n(s),y.length!=g.length||y.some(function(A){return !i(o[A],s[A],p)})))return !1;switch(c.slice(8,-1)){case"Symbol":return o.valueOf()==s.valueOf();case"Date":case"Number":return +o==+s||+o!=+o&&+s!=+s;case"RegExp":case"Function":case"String":case"Boolean":return ""+o==""+s;case"Set":case"Map":y=o.entries(),g=s.entries();do if(!i((d=y.next()).value,g.next().value,p))return !1;while(!d.done);return !0;case"ArrayBuffer":o=new Uint8Array(o),s=new Uint8Array(s);case"DataView":o=new Uint8Array(o.buffer),s=new Uint8Array(s.buffer);case"Float32Array":case"Float64Array":case"Int8Array":case"Int16Array":case"Int32Array":case"Uint8Array":case"Uint16Array":case"Uint32Array":case"Uint8ClampedArray":case"Arguments":case"Array":if(o.length!=s.length)return !1;for(d=0;d<o.length;d++)if((d in o||d in s)&&(d in o!=d in s||!i(o[d],s[d],p)))return !1;return !0;case"Object":return i(e(o),e(s),p);default:return !1}}(t,a,[])}}();});function R(r){return r.replace(/_/g," ").replace(/-/g," ").replace(/\./g," ").replace(/([^\n])([A-Z])([a-z])/g,(e,n,t,a)=>`${n} ${t}${a}`).replace(/([a-z])([A-Z])/g,(e,n,t)=>`${n} ${t}`).replace(/([a-z])([0-9])/gi,(e,n,t)=>`${n} ${t}`).replace(/([0-9])([a-z])/gi,(e,n,t)=>`${n} ${t}`).replace(/(\s|^)(\w)/g,(e,n,t)=>`${n}${t.toUpperCase()}`).replace(/ +/g," ").trim()}var l=I(x()),S=r=>r.map(e=>typeof e<"u").filter(Boolean).length,k=(r,e)=>{let{exists:n,eq:t,neq:a,truthy:i}=r;if(S([n,t,a,i])>1)throw new Error(`Invalid conditional test ${JSON.stringify({exists:n,eq:t,neq:a})}`);if(typeof t<"u")return (0, l.isEqual)(e,t);if(typeof a<"u")return !(0, l.isEqual)(e,a);if(typeof n<"u"){let s=typeof e<"u";return n?s:!s}return (typeof i>"u"?!0:i)?!!e:!e},P=(r,e,n)=>{if(!r.if)return !0;let{arg:t,global:a}=r.if;if(S([t,a])!==1)throw new Error(`Invalid conditional value ${JSON.stringify({arg:t,global:a})}`);let i=t?e[t]:n[a];return k(r.if,i)};var O=r=>r.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,"-").replace(/-+/g,"-").replace(/^-+/,"").replace(/-+$/,""),m=(r,e)=>{let n=O(r);if(n==="")throw new Error(`Invalid ${e} '${r}', must include alphanumeric characters`);return n},G=(r,e)=>`${m(r,"kind")}${e?`--${m(e,"name")}`:""}`,N=r=>R(r);function f(r,e){return Array.isArray(e)?e.includes(r):r.match(e)}function M(r,{includeStories:e,excludeStories:n}){return r!=="__esModule"&&(!e||f(r,e))&&(!n||!f(r,n))}var V=(r,{rootSeparator:e,groupSeparator:n})=>{let[t,a]=r.split(e,2),i=(a||r).split(n).filter(o=>!!o);return {root:a?t:null,groups:i}},z=(...r)=>{let e=r.reduce((n,t)=>(t.startsWith("!")?n.delete(t.slice(1)):n.add(t),n),new Set);return Array.from(e)};
2
2
 
3
3
  export { z as combineTags, P as includeConditionalArg, M as isExportStory, V as parseKind, O as sanitize, N as storyNameFromExport, G as toId };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/csf",
3
- "version": "0.1.11",
3
+ "version": "0.1.12--canary.100.877a297.0",
4
4
  "description": "Component Story Format (CSF) utilities",
5
5
  "keywords": [
6
6
  "storybook",
package/CHANGELOG.md DELETED
@@ -1,218 +0,0 @@
1
- # v0.1.11 (Tue Jul 02 2024)
2
-
3
- #### 🐛 Bug Fix
4
-
5
- - Add mount to CSF [#100](https://github.com/ComponentDriven/csf/pull/100) ([@kasperpeulen](https://github.com/kasperpeulen))
6
-
7
- #### Authors: 1
8
-
9
- - Kasper Peulen ([@kasperpeulen](https://github.com/kasperpeulen))
10
-
11
- ---
12
-
13
- # v0.1.10 (Tue Jul 02 2024)
14
-
15
- #### 🐛 Bug Fix
16
-
17
- - Consolidate loader, play and render context and add a self referencing context property [#98](https://github.com/ComponentDriven/csf/pull/98) ([@kasperpeulen](https://github.com/kasperpeulen))
18
- - Add canvas prop to the context [#99](https://github.com/ComponentDriven/csf/pull/99) ([@kasperpeulen](https://github.com/kasperpeulen))
19
-
20
- #### Authors: 1
21
-
22
- - Kasper Peulen ([@kasperpeulen](https://github.com/kasperpeulen))
23
-
24
- ---
25
-
26
- # v0.1.9 (Mon Jun 24 2024)
27
-
28
- #### 🐛 Bug Fix
29
-
30
- - Add `beforeAll` hook to CSF types [#96](https://github.com/ComponentDriven/csf/pull/96) ([@ghengeveld](https://github.com/ghengeveld))
31
-
32
- #### Authors: 2
33
-
34
- - Gert Hengeveld ([@ghengeveld](https://github.com/ghengeveld))
35
- - Michael Shilman ([@shilman](https://github.com/shilman))
36
-
37
- ---
38
-
39
- # v0.1.8 (Mon Jun 03 2024)
40
-
41
- #### 🐛 Bug Fix
42
-
43
- - Add project initialGlobals & component/story globals, deprecate project globals [#92](https://github.com/ComponentDriven/csf/pull/92) ([@shilman](https://github.com/shilman))
44
-
45
- #### Authors: 1
46
-
47
- - Michael Shilman ([@shilman](https://github.com/shilman))
48
-
49
- ---
50
-
51
- # v0.1.7 (Mon May 06 2024)
52
-
53
- #### 🐛 Bug Fix
54
-
55
- - Fix the package name in the readme [#81](https://github.com/ComponentDriven/csf/pull/81) ([@stof](https://github.com/stof))
56
- - Add utility for tag combination & negation [#80](https://github.com/ComponentDriven/csf/pull/80) ([@shilman](https://github.com/shilman))
57
-
58
- #### Authors: 2
59
-
60
- - Christophe Coevoet ([@stof](https://github.com/stof))
61
- - Michael Shilman ([@shilman](https://github.com/shilman))
62
-
63
- ---
64
-
65
- # v0.1.6 (Tue Apr 30 2024)
66
-
67
- #### 🐛 Bug Fix
68
-
69
- - Add the beforeEach hook [#82](https://github.com/ComponentDriven/csf/pull/82) ([@kasperpeulen](https://github.com/kasperpeulen))
70
-
71
- #### Authors: 1
72
-
73
- - Kasper Peulen ([@kasperpeulen](https://github.com/kasperpeulen))
74
-
75
- ---
76
-
77
- # v0.1.5 (Thu Apr 25 2024)
78
-
79
- #### 🐛 Bug Fix
80
-
81
- - chore: resolve eslint issues [#87](https://github.com/ComponentDriven/csf/pull/87) ([@Cherry](https://github.com/Cherry))
82
- - fix: better handle readonly InputType options [#85](https://github.com/ComponentDriven/csf/pull/85) ([@Cherry](https://github.com/Cherry))
83
-
84
- #### Authors: 2
85
-
86
- - James Ross ([@Cherry](https://github.com/Cherry))
87
- - Kasper Peulen ([@kasperpeulen](https://github.com/kasperpeulen))
88
-
89
- ---
90
-
91
- # v0.1.4 (Fri Apr 12 2024)
92
-
93
- #### 🐛 Bug Fix
94
-
95
- - Loosen control type and some fixes [#83](https://github.com/ComponentDriven/csf/pull/83) ([@kasperpeulen](https://github.com/kasperpeulen))
96
-
97
- #### Authors: 1
98
-
99
- - Kasper Peulen ([@kasperpeulen](https://github.com/kasperpeulen))
100
-
101
- ---
102
-
103
- # v0.1.3 (Mon Mar 18 2024)
104
-
105
- #### 🐛 Bug Fix
106
-
107
- - Fix bad publish [#78](https://github.com/ComponentDriven/csf/pull/78) ([@shilman](https://github.com/shilman))
108
- - Improve InputType for controls [#75](https://github.com/ComponentDriven/csf/pull/75) ([@Shinigami92](https://github.com/Shinigami92) [@shilman](https://github.com/shilman))
109
- - Update README [#74](https://github.com/ComponentDriven/csf/pull/74) ([@nkabrown](https://github.com/nkabrown))
110
-
111
- #### Authors: 4
112
-
113
- - Kasper Peulen ([@kasperpeulen](https://github.com/kasperpeulen))
114
- - Michael Shilman ([@shilman](https://github.com/shilman))
115
- - Nathan Brown ([@nkabrown](https://github.com/nkabrown))
116
- - Shinigami ([@Shinigami92](https://github.com/Shinigami92))
117
-
118
- ---
119
-
120
- # v0.1.2 (Wed Nov 22 2023)
121
-
122
- #### 🐛 Bug Fix
123
-
124
- - Allow loaders to be synchronous or void [#71](https://github.com/ComponentDriven/csf/pull/71) ([@kasperpeulen](https://github.com/kasperpeulen))
125
- - Move `types` condition to the front [#69](https://github.com/ComponentDriven/csf/pull/69) ([@Andarist](https://github.com/Andarist))
126
-
127
- #### Authors: 2
128
-
129
- - Kasper Peulen ([@kasperpeulen](https://github.com/kasperpeulen))
130
- - Mateusz Burzyński ([@Andarist](https://github.com/Andarist))
131
-
132
- ---
133
-
134
- # v0.1.1 (Fri Jun 02 2023)
135
-
136
- #### 🐛 Bug Fix
137
-
138
- - Move `types` condition to the front [#70](https://github.com/ComponentDriven/csf/pull/70) ([@Andarist](https://github.com/Andarist))
139
-
140
- #### Authors: 1
141
-
142
- - Mateusz Burzyński ([@Andarist](https://github.com/Andarist))
143
-
144
- ---
145
-
146
- # v0.1.0 (Mon Apr 03 2023)
147
-
148
- #### 🚀 Enhancement
149
-
150
-
151
- #### 🐛 Bug Fix
152
-
153
- - Turn Args interfaces into types when passed to decorators [#65](https://github.com/ComponentDriven/csf/pull/65) ([@kasperpeulen](https://github.com/kasperpeulen))
154
- - Improve the startcase implementation to mimick lodash's version more closely [#64](https://github.com/ComponentDriven/csf/pull/64) ([@ndelangen](https://github.com/ndelangen))
155
- - replace lodash [#62](https://github.com/ComponentDriven/csf/pull/62) ([@ndelangen](https://github.com/ndelangen))
156
- - Fix bug with meta not working well as generic parameter for StoryObj [#60](https://github.com/ComponentDriven/csf/pull/60) ([@kasperpeulen](https://github.com/kasperpeulen))
157
- - Make sure that index signatures (used in decorators) don't cause unexpected types [#58](https://github.com/ComponentDriven/csf/pull/58) ([@kasperpeulen](https://github.com/kasperpeulen))
158
- - Add strict variants for Args and Paramters to CSF [#57](https://github.com/ComponentDriven/csf/pull/57) ([@kasperpeulen](https://github.com/kasperpeulen))
159
- - Revert stricter parameters [#56](https://github.com/ComponentDriven/csf/pull/56) ([@kasperpeulen](https://github.com/kasperpeulen))
160
- - Use builtin installation of actions/setup-node [#55](https://github.com/ComponentDriven/csf/pull/55) ([@kasperpeulen](https://github.com/kasperpeulen))
161
- - Rename Framework to Renderer [#54](https://github.com/ComponentDriven/csf/pull/54) ([@kasperpeulen](https://github.com/kasperpeulen))
162
- - Rework Framework type to contain `canvasElement` [#53](https://github.com/ComponentDriven/csf/pull/53) ([@tmeasday](https://github.com/tmeasday))
163
- - Add tags annotation at all levels [#52](https://github.com/ComponentDriven/csf/pull/52) ([@tmeasday](https://github.com/tmeasday))
164
- - First attempt at bringing new types over [#29](https://github.com/ComponentDriven/csf/pull/29) ([@tmeasday](https://github.com/tmeasday) [@shilman](https://github.com/shilman) [@ghengeveld](https://github.com/ghengeveld) [@wKich](https://github.com/wKich) [@kasperpeulen](https://github.com/kasperpeulen))
165
- - Revert "Play function can only be set at the story level" [#40](https://github.com/ComponentDriven/csf/pull/40) ([@wKich](https://github.com/wKich) [@shilman](https://github.com/shilman))
166
- - Add conditional arg types and metadata [#36](https://github.com/ComponentDriven/csf/pull/36) ([@shilman](https://github.com/shilman) [@tmeasday](https://github.com/tmeasday) [@kasperpeulen](https://github.com/kasperpeulen))
167
- - Re-apply `TArgs` to CSF `render` type [#43](https://github.com/ComponentDriven/csf/pull/43) ([@tmeasday](https://github.com/tmeasday) [@shilman](https://github.com/shilman) [@kasperpeulen](https://github.com/kasperpeulen))
168
- - Add step to play context and `runStep` to project annotations [#48](https://github.com/ComponentDriven/csf/pull/48) ([@tmeasday](https://github.com/tmeasday) [@shilman](https://github.com/shilman) [@kasperpeulen](https://github.com/kasperpeulen))
169
- - Sound arg types for CSF3 [#49](https://github.com/ComponentDriven/csf/pull/49) ([@kasperpeulen](https://github.com/kasperpeulen) [@shilman](https://github.com/shilman))
170
- - ArgsFromMeta utility and generic ArgsStoryFn RT [#51](https://github.com/ComponentDriven/csf/pull/51) ([@kasperpeulen](https://github.com/kasperpeulen))
171
- - Configure Auto [#50](https://github.com/ComponentDriven/csf/pull/50) ([@shilman](https://github.com/shilman))
172
- - Only make `TArgs` parameterize `args` and `argTypes` in our default annotations [#33](https://github.com/ComponentDriven/csf/pull/33) ([@tmeasday](https://github.com/tmeasday))
173
- - Adding Components.studio as a tool using CSF [#13](https://github.com/ComponentDriven/csf/pull/13) ([@georges-gomes](https://github.com/georges-gomes) [@ghengeveld](https://github.com/ghengeveld))
174
- - Makes name argument for 'toId' optional [#17](https://github.com/ComponentDriven/csf/pull/17) ([@unematiii](https://github.com/unematiii) [@ghengeveld](https://github.com/ghengeveld))
175
- - use permanent url for the header image [#12](https://github.com/ComponentDriven/csf/pull/12) ([@winkerVSbecks](https://github.com/winkerVSbecks))
176
- - fix link to image [#10](https://github.com/ComponentDriven/csf/pull/10) ([@winkerVSbecks](https://github.com/winkerVSbecks))
177
- - Publish under @componentdriven and update README [#8](https://github.com/ComponentDriven/csf/pull/8) ([@winkerVSbecks](https://github.com/winkerVSbecks))
178
- - Add meta types for CSF [#5](https://github.com/ComponentDriven/csf/pull/5) ([@wKich](https://github.com/wKich))
179
- - types of csf properties [#3](https://github.com/ComponentDriven/csf/pull/3) ([@atanasster](https://github.com/atanasster) [@ndelangen](https://github.com/ndelangen))
180
- - Extract @storybook/csf from monorepo [#1](https://github.com/ComponentDriven/csf/pull/1) ([@shilman](https://github.com/shilman))
181
-
182
- #### ⚠️ Pushed to `master`
183
-
184
- - First commit ([@shilman](https://github.com/shilman))
185
-
186
- #### 📝 Documentation
187
-
188
- - added storyNameFromExport(key) in README.md [#2](https://github.com/ComponentDriven/csf/pull/2) ([@georges-gomes](https://github.com/georges-gomes) [@shilman](https://github.com/shilman))
189
-
190
- #### 🔩 Dependency Updates
191
-
192
- - Bump handlebars from 4.5.3 to 4.7.7 [#20](https://github.com/ComponentDriven/csf/pull/20) ([@dependabot[bot]](https://github.com/dependabot[bot]))
193
- - Bump y18n from 4.0.0 to 4.0.3 [#32](https://github.com/ComponentDriven/csf/pull/32) ([@dependabot[bot]](https://github.com/dependabot[bot]))
194
- - Bump ini from 1.3.5 to 1.3.8 [#18](https://github.com/ComponentDriven/csf/pull/18) ([@dependabot[bot]](https://github.com/dependabot[bot]))
195
- - Bump yargs-parser from 13.1.1 to 13.1.2 [#15](https://github.com/ComponentDriven/csf/pull/15) ([@dependabot[bot]](https://github.com/dependabot[bot]))
196
- - Bump lodash from 4.17.15 to 4.17.21 [#21](https://github.com/ComponentDriven/csf/pull/21) ([@dependabot[bot]](https://github.com/dependabot[bot]))
197
- - Bump hosted-git-info from 2.8.5 to 2.8.9 [#22](https://github.com/ComponentDriven/csf/pull/22) ([@dependabot[bot]](https://github.com/dependabot[bot]))
198
- - Bump path-parse from 1.0.6 to 1.0.7 [#25](https://github.com/ComponentDriven/csf/pull/25) ([@dependabot[bot]](https://github.com/dependabot[bot]))
199
- - Bump browserslist from 4.11.1 to 4.16.6 [#23](https://github.com/ComponentDriven/csf/pull/23) ([@dependabot[bot]](https://github.com/dependabot[bot]))
200
- - Bump acorn from 5.7.3 to 5.7.4 [#27](https://github.com/ComponentDriven/csf/pull/27) ([@dependabot[bot]](https://github.com/dependabot[bot]))
201
- - Bump ws from 5.2.2 to 5.2.3 [#28](https://github.com/ComponentDriven/csf/pull/28) ([@dependabot[bot]](https://github.com/dependabot[bot]))
202
- - Bump tar from 4.4.13 to 4.4.19 [#30](https://github.com/ComponentDriven/csf/pull/30) ([@dependabot[bot]](https://github.com/dependabot[bot]))
203
- - Bump tmpl from 1.0.4 to 1.0.5 [#31](https://github.com/ComponentDriven/csf/pull/31) ([@dependabot[bot]](https://github.com/dependabot[bot]))
204
-
205
- #### Authors: 12
206
-
207
- - [@dependabot[bot]](https://github.com/dependabot[bot])
208
- - Atanas Stoyanov ([@atanasster](https://github.com/atanasster))
209
- - Dmitriy Lazarev ([@wKich](https://github.com/wKich))
210
- - Dominic Nguyen ([@domyen](https://github.com/domyen))
211
- - Georges Gomes ([@georges-gomes](https://github.com/georges-gomes))
212
- - Gert Hengeveld ([@ghengeveld](https://github.com/ghengeveld))
213
- - Kasper Peulen ([@kasperpeulen](https://github.com/kasperpeulen))
214
- - Mati Kärner ([@unematiii](https://github.com/unematiii))
215
- - Michael Shilman ([@shilman](https://github.com/shilman))
216
- - Norbert de Langen ([@ndelangen](https://github.com/ndelangen))
217
- - Tom Coleman ([@tmeasday](https://github.com/tmeasday))
218
- - Varun Vachhar ([@winkerVSbecks](https://github.com/winkerVSbecks))