@storybook/csf 0.1.12--canary.109.1cc9957.0 → 0.1.12--canary.110.bb5bb77.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +12 -12
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -81,6 +81,16 @@ interface ControlBase {
|
|
81
81
|
type?: ControlType;
|
82
82
|
disable?: boolean;
|
83
83
|
}
|
84
|
+
interface Report {
|
85
|
+
id: string;
|
86
|
+
version: number;
|
87
|
+
result: unknown;
|
88
|
+
status: 'failed' | 'passed' | 'warning';
|
89
|
+
}
|
90
|
+
interface ReportingAPI {
|
91
|
+
reports: Report[];
|
92
|
+
addReport: (report: Report) => void;
|
93
|
+
}
|
84
94
|
type Control = ControlType | false | (ControlBase & (ControlBase | {
|
85
95
|
type: 'color';
|
86
96
|
/**
|
@@ -253,7 +263,6 @@ type Awaitable<T> = T | PromiseLike<T>;
|
|
253
263
|
type CleanupCallback = () => Awaitable<unknown>;
|
254
264
|
type BeforeAll = () => Awaitable<CleanupCallback | void>;
|
255
265
|
type BeforeEach<TRenderer extends Renderer = Renderer, TArgs = Args> = (context: StoryContext<TRenderer, TArgs>) => Awaitable<CleanupCallback | void>;
|
256
|
-
type AfterEach<TRenderer extends Renderer = Renderer, TArgs = Args> = (context: StoryContext<TRenderer, TArgs>) => Awaitable<void>;
|
257
266
|
interface Canvas {
|
258
267
|
}
|
259
268
|
interface StoryContext<TRenderer extends Renderer = Renderer, TArgs = Args> extends StoryContextForEnhancers<TRenderer, TArgs>, Required<StoryContextUpdate<TArgs>> {
|
@@ -267,6 +276,7 @@ interface StoryContext<TRenderer extends Renderer = Renderer, TArgs = Args> exte
|
|
267
276
|
context: this;
|
268
277
|
canvas: Canvas;
|
269
278
|
mount: TRenderer['mount'];
|
279
|
+
reporting: ReportingAPI;
|
270
280
|
}
|
271
281
|
/** @deprecated Use {@link StoryContext} instead. */
|
272
282
|
interface StoryContextForLoaders<TRenderer extends Renderer = Renderer, TArgs = Args> extends StoryContext<TRenderer, TArgs> {
|
@@ -323,16 +333,6 @@ interface BaseAnnotations<TRenderer extends Renderer = Renderer, TArgs = Args> {
|
|
323
333
|
* A cleanup function can be returned.
|
324
334
|
*/
|
325
335
|
beforeEach?: BeforeEach<TRenderer, TArgs>[] | BeforeEach<TRenderer, TArgs>;
|
326
|
-
/**
|
327
|
-
* Function to be called after each play function for post-test assertions.
|
328
|
-
* Don't use this function for cleaning up state.
|
329
|
-
* You can use the return callback of `beforeEach` for that, which is run when switching stories.
|
330
|
-
* When the function is async, it will be awaited.
|
331
|
-
*
|
332
|
-
* `afterEach` can be added to preview, the default export and to a specific story.
|
333
|
-
* They are run (and awaited) reverse order: preview, default export, story
|
334
|
-
*/
|
335
|
-
afterEach?: AfterEach<TRenderer, TArgs>[] | AfterEach<TRenderer, TArgs>;
|
336
336
|
/**
|
337
337
|
* Define a custom render function for the story(ies). If not passed, a default render function by the renderer will be used.
|
338
338
|
*/
|
@@ -525,4 +525,4 @@ declare const parseKind: (kind: string, { rootSeparator, groupSeparator }: Separ
|
|
525
525
|
*/
|
526
526
|
declare const combineTags: (...tags: string[]) => string[];
|
527
527
|
|
528
|
-
export {
|
528
|
+
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 };
|
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
|
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 I=(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 E=(r,e,n)=>(n=r!=null?C(h(r)):{},I(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,d){var g,y,p,c=r.call(o),b=r.call(s);if(o===s)return !0;if(o==null||s==null)return !1;if(d.indexOf(o)>-1&&d.indexOf(s)>-1)return !0;if(d.push(o,s),c!=b||(g=n(o),y=n(s),g.length!=y.length||g.some(function(A){return !i(o[A],s[A],d)})))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":g=o.entries(),y=s.entries();do if(!i((p=g.next()).value,y.next().value,d))return !1;while(!p.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(p=0;p<o.length;p++)if((p in o||p in s)&&(p in o!=p in s||!i(o[p],s[p],d)))return !1;return !0;case"Object":return i(e(o),e(s),d);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=E(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
|
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 I=(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 E=(r,e,n)=>(n=r!=null?C(h(r)):{},I(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,d){var g,y,p,c=r.call(o),b=r.call(s);if(o===s)return !0;if(o==null||s==null)return !1;if(d.indexOf(o)>-1&&d.indexOf(s)>-1)return !0;if(d.push(o,s),c!=b||(g=n(o),y=n(s),g.length!=y.length||g.some(function(A){return !i(o[A],s[A],d)})))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":g=o.entries(),y=s.entries();do if(!i((p=g.next()).value,y.next().value,d))return !1;while(!p.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(p=0;p<o.length;p++)if((p in o||p in s)&&(p in o!=p in s||!i(o[p],s[p],d)))return !1;return !0;case"Object":return i(e(o),e(s),d);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=E(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 };
|