@storybook/preview 8.1.2 → 8.1.4

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.
Files changed (2) hide show
  1. package/dist/runtime.js +1 -1
  2. package/package.json +5 -5
package/dist/runtime.js CHANGED
@@ -97,7 +97,7 @@ This is deprecated and won't work in Storybook 8 anymore.
97
97
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var it,normalCompletion=!0,didErr=!1,err;return{s:function(){it=o[Symbol.iterator]()},n:function(){var step=it.next();return normalCompletion=step.done,step},e:function(_e2){didErr=!0,err=_e2},f:function(){try{!normalCompletion&&it.return!=null&&it.return()}finally{if(didErr)throw err}}}}function _unsupportedIterableToArray(o,minLen){if(o){if(typeof o=="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor&&(n=o.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}}function _arrayLikeToArray(arr,len){(len==null||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}var entities=require_lib2(),defaults={fg:"#FFF",bg:"#000",newline:!1,escapeXML:!1,stream:!1,colors:getDefaultColors()};function getDefaultColors(){var colors={0:"#000",1:"#A00",2:"#0A0",3:"#A50",4:"#00A",5:"#A0A",6:"#0AA",7:"#AAA",8:"#555",9:"#F55",10:"#5F5",11:"#FF5",12:"#55F",13:"#F5F",14:"#5FF",15:"#FFF"};return range(0,5).forEach(function(red){range(0,5).forEach(function(green){range(0,5).forEach(function(blue){return setStyleColor(red,green,blue,colors)})})}),range(0,23).forEach(function(gray){var c2=gray+232,l=toHexString(gray*10+8);colors[c2]="#"+l+l+l}),colors}function setStyleColor(red,green,blue,colors){var c2=16+red*36+green*6+blue,r=red>0?red*40+55:0,g=green>0?green*40+55:0,b=blue>0?blue*40+55:0;colors[c2]=toColorHexString([r,g,b])}function toHexString(num){for(var str=num.toString(16);str.length<2;)str="0"+str;return str}function toColorHexString(ref){var results=[],_iterator=_createForOfIteratorHelper(ref),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var r=_step.value;results.push(toHexString(r))}}catch(err){_iterator.e(err)}finally{_iterator.f()}return"#"+results.join("")}function generateOutput(stack,token,data,options2){var result2;return token==="text"?result2=pushText(data,options2):token==="display"?result2=handleDisplay(stack,data,options2):token==="xterm256"?result2=pushForegroundColor(stack,options2.colors[data]):token==="rgb"&&(result2=handleRgb(stack,data)),result2}function handleRgb(stack,data){data=data.substring(2).slice(0,-1);var operation=+data.substr(0,2),color=data.substring(5).split(";"),rgb=color.map(function(value2){return("0"+Number(value2).toString(16)).substr(-2)}).join("");return pushStyle(stack,(operation===38?"color:#":"background-color:#")+rgb)}function handleDisplay(stack,code,options2){code=parseInt(code,10);var codeMap={"-1":function(){return"<br/>"},0:function(){return stack.length&&resetStyles(stack)},1:function(){return pushTag(stack,"b")},3:function(){return pushTag(stack,"i")},4:function(){return pushTag(stack,"u")},8:function(){return pushStyle(stack,"display:none")},9:function(){return pushTag(stack,"strike")},22:function(){return pushStyle(stack,"font-weight:normal;text-decoration:none;font-style:normal")},23:function(){return closeTag(stack,"i")},24:function(){return closeTag(stack,"u")},39:function(){return pushForegroundColor(stack,options2.fg)},49:function(){return pushBackgroundColor(stack,options2.bg)},53:function(){return pushStyle(stack,"text-decoration:overline")}},result2;return codeMap[code]?result2=codeMap[code]():4<code&&code<7?result2=pushTag(stack,"blink"):29<code&&code<38?result2=pushForegroundColor(stack,options2.colors[code-30]):39<code&&code<48?result2=pushBackgroundColor(stack,options2.colors[code-40]):89<code&&code<98?result2=pushForegroundColor(stack,options2.colors[8+(code-90)]):99<code&&code<108&&(result2=pushBackgroundColor(stack,options2.colors[8+(code-100)])),result2}function resetStyles(stack){var stackClone=stack.slice(0);return stack.length=0,stackClone.reverse().map(function(tag){return"</"+tag+">"}).join("")}function range(low,high){for(var results=[],j=low;j<=high;j++)results.push(j);return results}function notCategory(category){return function(e){return(category===null||e.category!==category)&&category!=="all"}}function categoryForCode(code){code=parseInt(code,10);var result2=null;return code===0?result2="all":code===1?result2="bold":2<code&&code<5?result2="underline":4<code&&code<7?result2="blink":code===8?result2="hide":code===9?result2="strike":29<code&&code<38||code===39||89<code&&code<98?result2="foreground-color":(39<code&&code<48||code===49||99<code&&code<108)&&(result2="background-color"),result2}function pushText(text,options2){return options2.escapeXML?entities.encodeXML(text):text}function pushTag(stack,tag,style){return style||(style=""),stack.push(tag),"<".concat(tag).concat(style?' style="'.concat(style,'"'):"",">")}function pushStyle(stack,style){return pushTag(stack,"span",style)}function pushForegroundColor(stack,color){return pushTag(stack,"span","color:"+color)}function pushBackgroundColor(stack,color){return pushTag(stack,"span","background-color:"+color)}function closeTag(stack,style){var last;if(stack.slice(-1)[0]===style&&(last=stack.pop()),last)return"</"+style+">"}function tokenize(text,options2,callback){var ansiMatch=!1,ansiHandler=3;function remove(){return""}function removeXterm256(m2,g1){return callback("xterm256",g1),""}function newline(m2){return options2.newline?callback("display",-1):callback("text",m2),""}function ansiMess(m2,g1){ansiMatch=!0,g1.trim().length===0&&(g1="0"),g1=g1.trimRight(";").split(";");var _iterator2=_createForOfIteratorHelper(g1),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var g=_step2.value;callback("display",g)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return""}function realText(m2){return callback("text",m2),""}function rgb(m2){return callback("rgb",m2),""}var tokens=[{pattern:/^\x08+/,sub:remove},{pattern:/^\x1b\[[012]?K/,sub:remove},{pattern:/^\x1b\[\(B/,sub:remove},{pattern:/^\x1b\[[34]8;2;\d+;\d+;\d+m/,sub:rgb},{pattern:/^\x1b\[38;5;(\d+)m/,sub:removeXterm256},{pattern:/^\n/,sub:newline},{pattern:/^\r+\n/,sub:newline},{pattern:/^\x1b\[((?:\d{1,3};?)+|)m/,sub:ansiMess},{pattern:/^\x1b\[\d?J/,sub:remove},{pattern:/^\x1b\[\d{0,3};\d{0,3}f/,sub:remove},{pattern:/^\x1b\[?[\d;]{0,3}/,sub:remove},{pattern:/^(([^\x1b\x08\r\n])+)/,sub:realText}];function process2(handler2,i2){i2>ansiHandler&&ansiMatch||(ansiMatch=!1,text=text.replace(handler2.pattern,handler2.sub))}var results1=[],_text=text,length=_text.length;outer:for(;length>0;){for(var i=0,o=0,len=tokens.length;o<len;i=++o){var handler=tokens[i];if(process2(handler,i),text.length!==length){length=text.length;continue outer}}if(text.length===length)break;results1.push(0),length=text.length}return results1}function updateStickyStack(stickyStack,token,data){return token!=="text"&&(stickyStack=stickyStack.filter(notCategory(categoryForCode(data))),stickyStack.push({token,data,category:categoryForCode(data)})),stickyStack}var Filter=function(){function Filter2(options2){_classCallCheck(this,Filter2),options2=options2||{},options2.colors&&(options2.colors=Object.assign({},defaults.colors,options2.colors)),this.options=Object.assign({},defaults,options2),this.stack=[],this.stickyStack=[]}return _createClass(Filter2,[{key:"toHtml",value:function(input){var _this=this;input=typeof input=="string"?[input]:input;var stack=this.stack,options2=this.options,buf=[];return this.stickyStack.forEach(function(element){var output=generateOutput(stack,element.token,element.data,options2);output&&buf.push(output)}),tokenize(input.join(""),options2,function(token,data){var output=generateOutput(stack,token,data,options2);output&&buf.push(output),options2.stream&&(_this.stickyStack=updateStickyStack(_this.stickyStack,token,data))}),stack.length&&buf.push(resetStyles(stack)),buf.join("")}}]),Filter2}();module.exports=Filter}});function mockChannel(){let transport={setHandler:()=>{},send:()=>{}};return new Channel({transport})}var AddonStore=class{constructor(){this.getChannel=()=>{if(!this.channel){let channel=mockChannel();return this.setChannel(channel),channel}return this.channel},this.ready=()=>this.promise,this.hasChannel=()=>!!this.channel,this.setChannel=channel=>{this.channel=channel,this.resolve()},this.promise=new Promise(res=>{this.resolve=()=>res(this.getChannel())})}},KEY2="__STORYBOOK_ADDONS_PREVIEW";function getAddonsStore(){return scope[KEY2]||(scope[KEY2]=new AddonStore),scope[KEY2]}var addons=getAddonsStore(),HooksContext=class{constructor(){this.hookListsMap=void 0,this.mountedDecorators=void 0,this.prevMountedDecorators=void 0,this.currentHooks=void 0,this.nextHookIndex=void 0,this.currentPhase=void 0,this.currentEffects=void 0,this.prevEffects=void 0,this.currentDecoratorName=void 0,this.hasUpdates=void 0,this.currentContext=void 0,this.renderListener=storyId=>{storyId===this.currentContext?.id&&(this.triggerEffects(),this.currentContext=null,this.removeRenderListeners())},this.init()}init(){this.hookListsMap=new WeakMap,this.mountedDecorators=new Set,this.prevMountedDecorators=new Set,this.currentHooks=[],this.nextHookIndex=0,this.currentPhase="NONE",this.currentEffects=[],this.prevEffects=[],this.currentDecoratorName=null,this.hasUpdates=!1,this.currentContext=null}clean(){this.prevEffects.forEach(effect=>{effect.destroy&&effect.destroy()}),this.init(),this.removeRenderListeners()}getNextHook(){let hook=this.currentHooks[this.nextHookIndex];return this.nextHookIndex+=1,hook}triggerEffects(){this.prevEffects.forEach(effect=>{!this.currentEffects.includes(effect)&&effect.destroy&&effect.destroy()}),this.currentEffects.forEach(effect=>{this.prevEffects.includes(effect)||(effect.destroy=effect.create())}),this.prevEffects=this.currentEffects,this.currentEffects=[]}addRenderListeners(){this.removeRenderListeners(),addons.getChannel().on(STORY_RENDERED,this.renderListener)}removeRenderListeners(){addons.getChannel().removeListener(STORY_RENDERED,this.renderListener)}};function hookify(fn){let hookified=(...args2)=>{let{hooks}=typeof args2[0]=="function"?args2[1]:args2[0],prevPhase=hooks.currentPhase,prevHooks=hooks.currentHooks,prevNextHookIndex=hooks.nextHookIndex,prevDecoratorName=hooks.currentDecoratorName;hooks.currentDecoratorName=fn.name,hooks.prevMountedDecorators.has(fn)?(hooks.currentPhase="UPDATE",hooks.currentHooks=hooks.hookListsMap.get(fn)||[]):(hooks.currentPhase="MOUNT",hooks.currentHooks=[],hooks.hookListsMap.set(fn,hooks.currentHooks),hooks.prevMountedDecorators.add(fn)),hooks.nextHookIndex=0;let prevContext=scope.STORYBOOK_HOOKS_CONTEXT;scope.STORYBOOK_HOOKS_CONTEXT=hooks;let result2=fn(...args2);if(scope.STORYBOOK_HOOKS_CONTEXT=prevContext,hooks.currentPhase==="UPDATE"&&hooks.getNextHook()!=null)throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");return hooks.currentPhase=prevPhase,hooks.currentHooks=prevHooks,hooks.nextHookIndex=prevNextHookIndex,hooks.currentDecoratorName=prevDecoratorName,result2};return hookified.originalFn=fn,hookified}var numberOfRenders=0,RENDER_LIMIT=25,applyHooks=applyDecorators=>(storyFn,decorators)=>{let decorated=applyDecorators(hookify(storyFn),decorators.map(decorator=>hookify(decorator)));return context=>{let{hooks}=context;hooks.prevMountedDecorators??=new Set,hooks.mountedDecorators=new Set([storyFn,...decorators]),hooks.currentContext=context,hooks.hasUpdates=!1;let result2=decorated(context);for(numberOfRenders=1;hooks.hasUpdates;)if(hooks.hasUpdates=!1,hooks.currentEffects=[],result2=decorated(context),numberOfRenders+=1,numberOfRenders>RENDER_LIMIT)throw new Error("Too many re-renders. Storybook limits the number of renders to prevent an infinite loop.");return hooks.addRenderListeners(),result2}},areDepsEqual=(deps,nextDeps)=>deps.length===nextDeps.length&&deps.every((dep,i)=>dep===nextDeps[i]),invalidHooksError=()=>new Error("Storybook preview hooks can only be called inside decorators and story functions.");function getHooksContextOrNull(){return scope.STORYBOOK_HOOKS_CONTEXT||null}function getHooksContextOrThrow(){let hooks=getHooksContextOrNull();if(hooks==null)throw invalidHooksError();return hooks}function useHook(name2,callback,deps){let hooks=getHooksContextOrThrow();if(hooks.currentPhase==="MOUNT"){deps!=null&&!Array.isArray(deps)&&logger.warn(`${name2} received a final argument that is not an array (instead, received ${deps}). When specified, the final argument must be an array.`);let hook={name:name2,deps};return hooks.currentHooks.push(hook),callback(hook),hook}if(hooks.currentPhase==="UPDATE"){let hook=hooks.getNextHook();if(hook==null)throw new Error("Rendered more hooks than during the previous render.");return hook.name!==name2&&logger.warn(`Storybook has detected a change in the order of Hooks${hooks.currentDecoratorName?` called by ${hooks.currentDecoratorName}`:""}. This will lead to bugs and errors if not fixed.`),deps!=null&&hook.deps==null&&logger.warn(`${name2} received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.`),deps!=null&&hook.deps!=null&&deps.length!==hook.deps.length&&logger.warn(`The final argument passed to ${name2} changed size between renders. The order and size of this array must remain constant.
98
98
  Previous: ${hook.deps}
99
99
  Incoming: ${deps}`),(deps==null||hook.deps==null||!areDepsEqual(deps,hook.deps))&&(callback(hook),hook.deps=deps),hook}throw invalidHooksError()}function useMemoLike(name2,nextCreate,deps){let{memoizedState}=useHook(name2,hook=>{hook.memoizedState=nextCreate()},deps);return memoizedState}function useMemo(nextCreate,deps){return useMemoLike("useMemo",nextCreate,deps)}function useCallback(callback,deps){return useMemoLike("useCallback",()=>callback,deps)}function useRefLike(name2,initialValue){return useMemoLike(name2,()=>({current:initialValue}),[])}function useRef(initialValue){return useRefLike("useRef",initialValue)}function triggerUpdate(){let hooks=getHooksContextOrNull();if(hooks!=null&&hooks.currentPhase!=="NONE")hooks.hasUpdates=!0;else try{addons.getChannel().emit(FORCE_RE_RENDER)}catch{logger.warn("State updates of Storybook preview hooks work only in browser")}}function useStateLike(name2,initialState){let stateRef=useRefLike(name2,typeof initialState=="function"?initialState():initialState),setState=update=>{stateRef.current=typeof update=="function"?update(stateRef.current):update,triggerUpdate()};return[stateRef.current,setState]}function useState(initialState){return useStateLike("useState",initialState)}function useReducer(reducer,initialArg,init){let initialState=init!=null?()=>init(initialArg):initialArg,[state,setState]=useStateLike("useReducer",initialState);return[state,action=>setState(prevState=>reducer(prevState,action))]}function useEffect(create,deps){let hooks=getHooksContextOrThrow(),effect=useMemoLike("useEffect",()=>({create}),deps);hooks.currentEffects.includes(effect)||hooks.currentEffects.push(effect)}function useChannel(eventMap,deps=[]){let channel=addons.getChannel();return useEffect(()=>(Object.entries(eventMap).forEach(([type,listener])=>channel.on(type,listener)),()=>{Object.entries(eventMap).forEach(([type,listener])=>channel.removeListener(type,listener))}),[...Object.keys(eventMap),...deps]),useCallback(channel.emit.bind(channel),[channel])}function useStoryContext(){let{currentContext}=getHooksContextOrThrow();if(currentContext==null)throw invalidHooksError();return currentContext}function useParameter(parameterKey,defaultValue){let{parameters}=useStoryContext();if(parameterKey)return parameters[parameterKey]??defaultValue}function useArgs(){let channel=addons.getChannel(),{id:storyId,args:args2}=useStoryContext(),updateArgs=useCallback(updatedArgs=>channel.emit(UPDATE_STORY_ARGS,{storyId,updatedArgs}),[channel,storyId]),resetArgs=useCallback(argNames=>channel.emit(RESET_STORY_ARGS,{storyId,argNames}),[channel,storyId]);return[args2,updateArgs,resetArgs]}function useGlobals(){let channel=addons.getChannel(),{globals}=useStoryContext(),updateGlobals=useCallback(newGlobals=>channel.emit(UPDATE_GLOBALS,{globals:newGlobals}),[channel]);return[globals,updateGlobals]}var makeDecorator=({name:name2,parameterName,wrapper,skipIfNoParametersOrOptions=!1})=>{let decorator=options2=>(storyFn,context)=>{let parameters=context.parameters&&context.parameters[parameterName];return parameters&&parameters.disable||skipIfNoParametersOrOptions&&!options2&&!parameters?storyFn(context):wrapper(storyFn,context,{options:options2,parameters})};return(...args2)=>typeof args2[0]=="function"?decorator()(...args2):(...innerArgs)=>{if(innerArgs.length>1)return args2.length>1?decorator(args2)(...innerArgs):decorator(...args2)(...innerArgs);throw new Error(`Passing stories directly into ${name2}() is not allowed,
100
- instead use addDecorator(${name2}) and pass options with the '${parameterName}' parameter`)}},getImportPathMap=(0,import_memoizerific2.default)(1)(entries=>Object.values(entries).reduce((acc,entry)=>(acc[entry.importPath]=acc[entry.importPath]||entry,acc),{})),StoryIndexStore=class{constructor({entries}={v:4,entries:{}}){this.entries=entries}entryFromSpecifier(specifier){let entries=Object.values(this.entries);if(specifier==="*")return entries[0];if(typeof specifier=="string")return this.entries[specifier]?this.entries[specifier]:entries.find(entry=>entry.id.startsWith(specifier));let{name:name2,title}=specifier;return entries.find(entry=>entry.name===name2&&entry.title===title)}storyIdToEntry(storyId){let storyEntry=this.entries[storyId];if(!storyEntry)throw new MissingStoryAfterHmrError({storyId});return storyEntry}importPathToEntry(importPath){return getImportPathMap(this.entries)[importPath]}},INCOMPATIBLE=Symbol("incompatible"),map=(arg,argType)=>{let type=argType.type;if(arg==null||!type||argType.mapping)return arg;switch(type.name){case"string":return String(arg);case"enum":return arg;case"number":return Number(arg);case"boolean":return String(arg)==="true";case"array":return!type.value||!Array.isArray(arg)?INCOMPATIBLE:arg.reduce((acc,item,index)=>{let mapped=map(item,{type:type.value});return mapped!==INCOMPATIBLE&&(acc[index]=mapped),acc},new Array(arg.length));case"object":return typeof arg=="string"||typeof arg=="number"?arg:!type.value||typeof arg!="object"?INCOMPATIBLE:Object.entries(arg).reduce((acc,[key2,val])=>{let mapped=map(val,{type:type.value[key2]});return mapped===INCOMPATIBLE?acc:Object.assign(acc,{[key2]:mapped})},{});default:return INCOMPATIBLE}},mapArgsToTypes=(args2,argTypes)=>Object.entries(args2).reduce((acc,[key2,value2])=>{if(!argTypes[key2])return acc;let mapped=map(value2,argTypes[key2]);return mapped===INCOMPATIBLE?acc:Object.assign(acc,{[key2]:mapped})},{}),combineArgs=(value2,update)=>Array.isArray(value2)&&Array.isArray(update)?update.reduce((acc,upd,index)=>(acc[index]=combineArgs(value2[index],update[index]),acc),[...value2]).filter(v2=>v2!==void 0):!(0,import_isPlainObject.default)(value2)||!(0,import_isPlainObject.default)(update)?update:Object.keys({...value2,...update}).reduce((acc,key2)=>{if(key2 in update){let combined=combineArgs(value2[key2],update[key2]);combined!==void 0&&(acc[key2]=combined)}else acc[key2]=value2[key2];return acc},{}),validateOptions=(args2,argTypes)=>Object.entries(argTypes).reduce((acc,[key2,{options:options2}])=>{function allowArg(){return key2 in args2&&(acc[key2]=args2[key2]),acc}if(!options2)return allowArg();if(!Array.isArray(options2))return once.error(dedent`
100
+ instead use addDecorator(${name2}) and pass options with the '${parameterName}' parameter`)}},getImportPathMap=(0,import_memoizerific2.default)(1)(entries=>Object.values(entries).reduce((acc,entry)=>(acc[entry.importPath]=acc[entry.importPath]||entry,acc),{})),StoryIndexStore=class{constructor({entries}={v:5,entries:{}}){this.entries=entries}entryFromSpecifier(specifier){let entries=Object.values(this.entries);if(specifier==="*")return entries[0];if(typeof specifier=="string")return this.entries[specifier]?this.entries[specifier]:entries.find(entry=>entry.id.startsWith(specifier));let{name:name2,title}=specifier;return entries.find(entry=>entry.name===name2&&entry.title===title)}storyIdToEntry(storyId){let storyEntry=this.entries[storyId];if(!storyEntry)throw new MissingStoryAfterHmrError({storyId});return storyEntry}importPathToEntry(importPath){return getImportPathMap(this.entries)[importPath]}},INCOMPATIBLE=Symbol("incompatible"),map=(arg,argType)=>{let type=argType.type;if(arg==null||!type||argType.mapping)return arg;switch(type.name){case"string":return String(arg);case"enum":return arg;case"number":return Number(arg);case"boolean":return String(arg)==="true";case"array":return!type.value||!Array.isArray(arg)?INCOMPATIBLE:arg.reduce((acc,item,index)=>{let mapped=map(item,{type:type.value});return mapped!==INCOMPATIBLE&&(acc[index]=mapped),acc},new Array(arg.length));case"object":return typeof arg=="string"||typeof arg=="number"?arg:!type.value||typeof arg!="object"?INCOMPATIBLE:Object.entries(arg).reduce((acc,[key2,val])=>{let mapped=map(val,{type:type.value[key2]});return mapped===INCOMPATIBLE?acc:Object.assign(acc,{[key2]:mapped})},{});default:return INCOMPATIBLE}},mapArgsToTypes=(args2,argTypes)=>Object.entries(args2).reduce((acc,[key2,value2])=>{if(!argTypes[key2])return acc;let mapped=map(value2,argTypes[key2]);return mapped===INCOMPATIBLE?acc:Object.assign(acc,{[key2]:mapped})},{}),combineArgs=(value2,update)=>Array.isArray(value2)&&Array.isArray(update)?update.reduce((acc,upd,index)=>(acc[index]=combineArgs(value2[index],update[index]),acc),[...value2]).filter(v2=>v2!==void 0):!(0,import_isPlainObject.default)(value2)||!(0,import_isPlainObject.default)(update)?update:Object.keys({...value2,...update}).reduce((acc,key2)=>{if(key2 in update){let combined=combineArgs(value2[key2],update[key2]);combined!==void 0&&(acc[key2]=combined)}else acc[key2]=value2[key2];return acc},{}),validateOptions=(args2,argTypes)=>Object.entries(argTypes).reduce((acc,[key2,{options:options2}])=>{function allowArg(){return key2 in args2&&(acc[key2]=args2[key2]),acc}if(!options2)return allowArg();if(!Array.isArray(options2))return once.error(dedent`
101
101
  Invalid argType: '${key2}.options' should be an array.
102
102
 
103
103
  More info: https://storybook.js.org/docs/react/api/argtypes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/preview",
3
- "version": "8.1.2",
3
+ "version": "8.1.4",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "storybook"
@@ -57,11 +57,11 @@
57
57
  "prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/esm-bundle.ts"
58
58
  },
59
59
  "devDependencies": {
60
- "@storybook/channels": "8.1.2",
61
- "@storybook/client-logger": "8.1.2",
62
- "@storybook/core-events": "8.1.2",
60
+ "@storybook/channels": "8.1.4",
61
+ "@storybook/client-logger": "8.1.4",
62
+ "@storybook/core-events": "8.1.4",
63
63
  "@storybook/global": "^5.0.0",
64
- "@storybook/preview-api": "8.1.2",
64
+ "@storybook/preview-api": "8.1.4",
65
65
  "browser-dtector": "^3.4.0",
66
66
  "typescript": "^5.3.2"
67
67
  },