@storybook/nextjs 7.0.0-alpha.57 → 7.0.0-alpha.59
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.
- package/dist/preset.d.ts +0 -4
- package/dist/preview.js +1 -1
- package/dist/preview.mjs +1 -1
- package/package.json +9 -9
package/dist/preset.d.ts
CHANGED
|
@@ -971,10 +971,6 @@ interface StorybookConfig {
|
|
|
971
971
|
staticDirs?: (DirectoryMapping | string)[];
|
|
972
972
|
logLevel?: string;
|
|
973
973
|
features?: {
|
|
974
|
-
/**
|
|
975
|
-
* Allows to disable deprecated implicit PostCSS loader. (will be removed in 7.0)
|
|
976
|
-
*/
|
|
977
|
-
postcss?: boolean;
|
|
978
974
|
/**
|
|
979
975
|
* Build stories.json automatically on start/build
|
|
980
976
|
*/
|
package/dist/preview.js
CHANGED
|
@@ -7,4 +7,4 @@ See https://stackoverflow.com/q/20007992 for more info`),-1}}else{var s=this._ta
|
|
|
7
7
|
`+n+`
|
|
8
8
|
|
|
9
9
|
See https://stackoverflow.com/q/20007992 for more info`),o.insertRule(this._deletedRulePlaceholder,e)}}else{var s=this._tags[e];l(s,"old rule at index `"+e+"` not found"),s.textContent=n}return e},r.deleteRule=function(e){if(typeof window>"u"){this._serverSheet.deleteRule(e);return}if(this._optimizeForSpeed)this.replaceRule(e,"");else{var n=this._tags[e];l(n,"rule at index `"+e+"` not found"),n.parentNode.removeChild(n),this._tags[e]=null}},r.flush=function(){this._injected=!1,this._rulesCount=0,typeof window<"u"?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},r.cssRules=function(){var e=this;return typeof window>"u"?this._serverSheet.cssRules:this._tags.reduce(function(n,o){return o?n=n.concat(Array.prototype.map.call(e.getSheetForTag(o).cssRules,function(s){return s.cssText===e._deletedRulePlaceholder?null:s})):n.push(null),n},[])},r.makeStyleTag=function(e,n,o){n&&l(N(n),"makeStyleTag accepts only strings as second parameter");var s=document.createElement("style");this._nonce&&s.setAttribute("nonce",this._nonce),s.type="text/css",s.setAttribute("data-"+e,""),n&&s.appendChild(document.createTextNode(n));var u=document.head||document.getElementsByTagName("head")[0];return o?u.insertBefore(s,o):u.appendChild(s),s},re(t,[{key:"length",get:function(){return this._rulesCount}}]),t}();function l(t,r){if(!t)throw new Error("StyleSheet: "+r+".")}function ie(t){for(var r=5381,i=t.length;i;)r=r*33^t.charCodeAt(--i);return r>>>0}var oe=ie,se=function(t){return t.replace(/\/style/gi,"\\/style")},d={};function b(t,r){if(!r)return"jsx-"+t;var i=String(r),e=t+i;return d[e]||(d[e]="jsx-"+oe(t+"-"+i)),d[e]}function q(t,r){var i=/__jsx-style-dynamic-selector/g;typeof window>"u"&&(r=se(r));var e=t+r;return d[e]||(d[e]=r.replace(i,t)),d[e]}function ue(t,r){return r===void 0&&(r={}),t.map(function(i){var e=i[0],n=i[1];return v.default.createElement("style",{id:"__"+e,key:"__"+e,nonce:r.nonce?r.nonce:void 0,dangerouslySetInnerHTML:{__html:n}})})}var ae=function(){function t(i){var e=i===void 0?{}:i,n=e.styleSheet,o=n===void 0?null:n,s=e.optimizeForSpeed,u=s===void 0?!1:s;this._sheet=o||new ne({name:"styled-jsx",optimizeForSpeed:u}),this._sheet.inject(),o&&typeof u=="boolean"&&(this._sheet.setOptimizeForSpeed(u),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var r=t.prototype;return r.add=function(e){var n=this;this._optimizeForSpeed===void 0&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),typeof window<"u"&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(f,H){return f[H]=0,f},{}));var o=this.getIdAndRules(e),s=o.styleId,u=o.rules;if(s in this._instancesCounts){this._instancesCounts[s]+=1;return}var c=u.map(function(f){return n._sheet.insertRule(f)}).filter(function(f){return f!==-1});this._indices[s]=c,this._instancesCounts[s]=1},r.remove=function(e){var n=this,o=this.getIdAndRules(e).styleId;if(le(o in this._instancesCounts,"styleId: `"+o+"` not found"),this._instancesCounts[o]-=1,this._instancesCounts[o]<1){var s=this._fromServer&&this._fromServer[o];s?(s.parentNode.removeChild(s),delete this._fromServer[o]):(this._indices[o].forEach(function(u){return n._sheet.deleteRule(u)}),delete this._indices[o]),delete this._instancesCounts[o]}},r.update=function(e,n){this.add(n),this.remove(e)},r.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},r.cssRules=function(){var e=this,n=this._fromServer?Object.keys(this._fromServer).map(function(s){return[s,e._fromServer[s]]}):[],o=this._sheet.cssRules();return n.concat(Object.keys(this._indices).map(function(s){return[s,e._indices[s].map(function(u){return o[u].cssText}).join(e._optimizeForSpeed?"":`
|
|
10
|
-
`)]}).filter(function(s){return Boolean(s[1])}))},r.styles=function(e){return ue(this.cssRules(),e)},r.getIdAndRules=function(e){var n=e.children,o=e.dynamic,s=e.id;if(o){var u=b(s,o);return{styleId:u,rules:Array.isArray(n)?n.map(function(c){return q(u,c)}):[q(u,n)]}}return{styleId:b(s),rules:Array.isArray(n)?n:[n]}},r.selectFromServer=function(){var e=Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]'));return e.reduce(function(n,o){var s=o.id.slice(2);return n[s]=o,n},{})},t}();function le(t,r){if(!t)throw new Error("StyleSheetRegistry: "+r+".")}var g=m.createContext(null);g.displayName="StyleSheetContext";function z(){return new ae}function ce(t){var r=t.registry,i=t.children,e=m.useContext(g),n=m.useState(function(){return e||r||z()}),o=n[0];return v.default.createElement(g.Provider,{value:o},i)}function $(){return m.useContext(g)}var fe=v.default.useInsertionEffect||v.default.useLayoutEffect,L=typeof window<"u"?z():void 0;function D(t){var r=L||$();return r?typeof window>"u"?(r.add(t),null):(fe(function(){return r.add(t),function(){r.remove(t)}},[t.id,String(t.dynamic)]),null):null}D.dynamic=function(t){return t.map(function(r){var i=r[0],e=r[1];return b(i,e)}).join(" ")};p.StyleRegistry=ce;p.createStyleRegistry=z;p.style=D;p.useStyleRegistry=$});var X=w((ge,V)=>{V.exports=J()});var me={};Y(me,{decorators:()=>he});module.exports=Z(me);var O=require("next/config");(0,O.setConfig)(process.env.__NEXT_RUNTIME_CONFIG);var F=h(require("react")),P=require("next/dist/shared/lib/router-context"),x=h(require("next/router")),a;try{a=require("@storybook/addon-actions").action}catch{a=()=>()=>{}}var ee={route:"/",pathname:"/",query:{},asPath:"/",push(...t){return a("nextRouter.push")(...t),Promise.resolve(!0)},replace(...t){return a("nextRouter.replace")(...t),Promise.resolve(!0)},reload(...t){a("nextRouter.reload")(...t)},back(...t){a("nextRouter.back")(...t)},prefetch(...t){return a("nextRouter.prefetch")(...t),Promise.resolve()},beforePopState(...t){a("nextRouter.beforePopState")(...t)},events:{on(...t){a("nextRouter.events.on")(...t)},off(...t){a("nextRouter.events.off")(...t)},emit(...t){a("nextRouter.events.emit")(...t)}},isFallback:!1},A=(t,{globals:r,parameters:i})=>{let e=i.nextRouter??{};return x.default.router={...ee,locale:r==null?void 0:r.locale,...e},F.createElement(P.RouterContext.Provider,{value:x.default.router},F.createElement(t,null))};var y=h(require("react")),C;try{C=X().StyleRegistry}catch{C=y.Fragment}var B=t=>y.createElement(C,null,y.createElement(t,null));var R=h(require("react")),I=h(require("semver")),k=({src:t,width:r,quality:i})=>{let e=[];if(t||e.push("src"),r||e.push("width"),e.length>0)throw new Error(`Next Image Optimization requires ${e.join(", ")} to be provided. Make sure you pass them as props to the \`next/image\` component. Received: ${JSON.stringify({src:t,width:r,quality:i})}`);return`${t}?w=${r}&q=${i??75}`},M=require("next/image"),de=M.default;Object.defineProperty(M,"default",{configurable:!0,value:t=>R.createElement(de,{...t,loader:t.loader??k})});if(I.default.satisfies(process.env.__NEXT_VERSION,"^13.0.0")){let r=require("next/legacy/image").default;Object.defineProperty(r,"default",{configurable:!0,value:i=>R.createElement(r,{...i,loader:i.loader??k})})}if(I.default.satisfies(process.env.__NEXT_VERSION,"^12.
|
|
10
|
+
`)]}).filter(function(s){return Boolean(s[1])}))},r.styles=function(e){return ue(this.cssRules(),e)},r.getIdAndRules=function(e){var n=e.children,o=e.dynamic,s=e.id;if(o){var u=b(s,o);return{styleId:u,rules:Array.isArray(n)?n.map(function(c){return q(u,c)}):[q(u,n)]}}return{styleId:b(s),rules:Array.isArray(n)?n:[n]}},r.selectFromServer=function(){var e=Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]'));return e.reduce(function(n,o){var s=o.id.slice(2);return n[s]=o,n},{})},t}();function le(t,r){if(!t)throw new Error("StyleSheetRegistry: "+r+".")}var g=m.createContext(null);g.displayName="StyleSheetContext";function z(){return new ae}function ce(t){var r=t.registry,i=t.children,e=m.useContext(g),n=m.useState(function(){return e||r||z()}),o=n[0];return v.default.createElement(g.Provider,{value:o},i)}function $(){return m.useContext(g)}var fe=v.default.useInsertionEffect||v.default.useLayoutEffect,L=typeof window<"u"?z():void 0;function D(t){var r=L||$();return r?typeof window>"u"?(r.add(t),null):(fe(function(){return r.add(t),function(){r.remove(t)}},[t.id,String(t.dynamic)]),null):null}D.dynamic=function(t){return t.map(function(r){var i=r[0],e=r[1];return b(i,e)}).join(" ")};p.StyleRegistry=ce;p.createStyleRegistry=z;p.style=D;p.useStyleRegistry=$});var X=w((ge,V)=>{V.exports=J()});var me={};Y(me,{decorators:()=>he});module.exports=Z(me);var O=require("next/config");(0,O.setConfig)(process.env.__NEXT_RUNTIME_CONFIG);var F=h(require("react")),P=require("next/dist/shared/lib/router-context"),x=h(require("next/router")),a;try{a=require("@storybook/addon-actions").action}catch{a=()=>()=>{}}var ee={route:"/",pathname:"/",query:{},asPath:"/",push(...t){return a("nextRouter.push")(...t),Promise.resolve(!0)},replace(...t){return a("nextRouter.replace")(...t),Promise.resolve(!0)},reload(...t){a("nextRouter.reload")(...t)},back(...t){a("nextRouter.back")(...t)},prefetch(...t){return a("nextRouter.prefetch")(...t),Promise.resolve()},beforePopState(...t){a("nextRouter.beforePopState")(...t)},events:{on(...t){a("nextRouter.events.on")(...t)},off(...t){a("nextRouter.events.off")(...t)},emit(...t){a("nextRouter.events.emit")(...t)}},isFallback:!1},A=(t,{globals:r,parameters:i})=>{let e=i.nextRouter??{};return x.default.router={...ee,locale:r==null?void 0:r.locale,...e},F.createElement(P.RouterContext.Provider,{value:x.default.router},F.createElement(t,null))};var y=h(require("react")),C;try{C=X().StyleRegistry}catch{C=y.Fragment}var B=t=>y.createElement(C,null,y.createElement(t,null));var R=h(require("react")),I=h(require("semver")),k=({src:t,width:r,quality:i})=>{let e=[];if(t||e.push("src"),r||e.push("width"),e.length>0)throw new Error(`Next Image Optimization requires ${e.join(", ")} to be provided. Make sure you pass them as props to the \`next/image\` component. Received: ${JSON.stringify({src:t,width:r,quality:i})}`);return`${t}?w=${r}&q=${i??75}`},M=require("next/image"),de=M.default;Object.defineProperty(M,"default",{configurable:!0,value:t=>R.createElement(de,{...t,loader:t.loader??k})});if(I.default.satisfies(process.env.__NEXT_VERSION,"^13.0.0")){let r=require("next/legacy/image").default;Object.defineProperty(r,"default",{configurable:!0,value:i=>R.createElement(r,{...i,loader:i.loader??k})})}if(I.default.satisfies(process.env.__NEXT_VERSION,"^12.2.0")){let r=require("next/future/image").default;Object.defineProperty(r,"default",{configurable:!0,value:i=>R.createElement(r,{...i,loader:i.loader??k})})}var he=[B,A];0&&(module.exports={decorators});
|
package/dist/preview.mjs
CHANGED
|
@@ -7,4 +7,4 @@ See https://stackoverflow.com/q/20007992 for more info`),-1}}else{var insertionP
|
|
|
7
7
|
`+rule+`
|
|
8
8
|
|
|
9
9
|
See https://stackoverflow.com/q/20007992 for more info`),sheet.insertRule(this._deletedRulePlaceholder,index)}}else{var tag=this._tags[index];invariant$1(tag,"old rule at index `"+index+"` not found"),tag.textContent=rule}return index},_proto.deleteRule=function(index){if(typeof window>"u"){this._serverSheet.deleteRule(index);return}if(this._optimizeForSpeed)this.replaceRule(index,"");else{var tag=this._tags[index];invariant$1(tag,"rule at index `"+index+"` not found"),tag.parentNode.removeChild(tag),this._tags[index]=null}},_proto.flush=function(){this._injected=!1,this._rulesCount=0,typeof window<"u"?(this._tags.forEach(function(tag){return tag&&tag.parentNode.removeChild(tag)}),this._tags=[]):this._serverSheet.cssRules=[]},_proto.cssRules=function(){var _this=this;return typeof window>"u"?this._serverSheet.cssRules:this._tags.reduce(function(rules,tag){return tag?rules=rules.concat(Array.prototype.map.call(_this.getSheetForTag(tag).cssRules,function(rule){return rule.cssText===_this._deletedRulePlaceholder?null:rule})):rules.push(null),rules},[])},_proto.makeStyleTag=function(name,cssString,relativeToTag){cssString&&invariant$1(isString(cssString),"makeStyleTag accepts only strings as second parameter");var tag=document.createElement("style");this._nonce&&tag.setAttribute("nonce",this._nonce),tag.type="text/css",tag.setAttribute("data-"+name,""),cssString&&tag.appendChild(document.createTextNode(cssString));var head=document.head||document.getElementsByTagName("head")[0];return relativeToTag?head.insertBefore(tag,relativeToTag):head.appendChild(tag),tag},_createClass(StyleSheet2,[{key:"length",get:function(){return this._rulesCount}}]),StyleSheet2}();function invariant$1(condition,message){if(!condition)throw new Error("StyleSheet: "+message+".")}function hash(str){for(var _$hash=5381,i=str.length;i;)_$hash=_$hash*33^str.charCodeAt(--i);return _$hash>>>0}var stringHash=hash,sanitize=function(rule){return rule.replace(/\/style/gi,"\\/style")},cache={};function computeId(baseId,props){if(!props)return"jsx-"+baseId;var propsToString=String(props),key=baseId+propsToString;return cache[key]||(cache[key]="jsx-"+stringHash(baseId+"-"+propsToString)),cache[key]}function computeSelector(id,css){var selectoPlaceholderRegexp=/__jsx-style-dynamic-selector/g;typeof window>"u"&&(css=sanitize(css));var idcss=id+css;return cache[idcss]||(cache[idcss]=css.replace(selectoPlaceholderRegexp,id)),cache[idcss]}function mapRulesToStyle(cssRules,options){return options===void 0&&(options={}),cssRules.map(function(args){var id=args[0],css=args[1];return React__default.default.createElement("style",{id:"__"+id,key:"__"+id,nonce:options.nonce?options.nonce:void 0,dangerouslySetInnerHTML:{__html:css}})})}var StyleSheetRegistry=function(){function StyleSheetRegistry2(param){var ref=param===void 0?{}:param,_styleSheet=ref.styleSheet,styleSheet=_styleSheet===void 0?null:_styleSheet,_optimizeForSpeed=ref.optimizeForSpeed,optimizeForSpeed=_optimizeForSpeed===void 0?!1:_optimizeForSpeed;this._sheet=styleSheet||new StyleSheet({name:"styled-jsx",optimizeForSpeed}),this._sheet.inject(),styleSheet&&typeof optimizeForSpeed=="boolean"&&(this._sheet.setOptimizeForSpeed(optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var _proto=StyleSheetRegistry2.prototype;return _proto.add=function(props){var _this=this;this._optimizeForSpeed===void 0&&(this._optimizeForSpeed=Array.isArray(props.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),typeof window<"u"&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(acc,tagName){return acc[tagName]=0,acc},{}));var ref=this.getIdAndRules(props),styleId=ref.styleId,rules=ref.rules;if(styleId in this._instancesCounts){this._instancesCounts[styleId]+=1;return}var indices=rules.map(function(rule){return _this._sheet.insertRule(rule)}).filter(function(index){return index!==-1});this._indices[styleId]=indices,this._instancesCounts[styleId]=1},_proto.remove=function(props){var _this=this,styleId=this.getIdAndRules(props).styleId;if(invariant(styleId in this._instancesCounts,"styleId: `"+styleId+"` not found"),this._instancesCounts[styleId]-=1,this._instancesCounts[styleId]<1){var tagFromServer=this._fromServer&&this._fromServer[styleId];tagFromServer?(tagFromServer.parentNode.removeChild(tagFromServer),delete this._fromServer[styleId]):(this._indices[styleId].forEach(function(index){return _this._sheet.deleteRule(index)}),delete this._indices[styleId]),delete this._instancesCounts[styleId]}},_proto.update=function(props,nextProps){this.add(nextProps),this.remove(props)},_proto.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},_proto.cssRules=function(){var _this=this,fromServer=this._fromServer?Object.keys(this._fromServer).map(function(styleId){return[styleId,_this._fromServer[styleId]]}):[],cssRules2=this._sheet.cssRules();return fromServer.concat(Object.keys(this._indices).map(function(styleId){return[styleId,_this._indices[styleId].map(function(index){return cssRules2[index].cssText}).join(_this._optimizeForSpeed?"":`
|
|
10
|
-
`)]}).filter(function(rule){return Boolean(rule[1])}))},_proto.styles=function(options){return mapRulesToStyle(this.cssRules(),options)},_proto.getIdAndRules=function(props){var css=props.children,dynamic=props.dynamic,id=props.id;if(dynamic){var styleId=computeId(id,dynamic);return{styleId,rules:Array.isArray(css)?css.map(function(rule){return computeSelector(styleId,rule)}):[computeSelector(styleId,css)]}}return{styleId:computeId(id),rules:Array.isArray(css)?css:[css]}},_proto.selectFromServer=function(){var elements=Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]'));return elements.reduce(function(acc,element){var id=element.id.slice(2);return acc[id]=element,acc},{})},StyleSheetRegistry2}();function invariant(condition,message){if(!condition)throw new Error("StyleSheetRegistry: "+message+".")}var StyleSheetContext=React4.createContext(null);StyleSheetContext.displayName="StyleSheetContext";function createStyleRegistry(){return new StyleSheetRegistry}function StyleRegistry2(param){var configuredRegistry=param.registry,children=param.children,rootRegistry=React4.useContext(StyleSheetContext),ref=React4.useState(function(){return rootRegistry||configuredRegistry||createStyleRegistry()}),registry=ref[0];return React__default.default.createElement(StyleSheetContext.Provider,{value:registry},children)}function useStyleRegistry(){return React4.useContext(StyleSheetContext)}var useInsertionEffect=React__default.default.useInsertionEffect||React__default.default.useLayoutEffect,defaultRegistry=typeof window<"u"?createStyleRegistry():void 0;function JSXStyle(props){var registry=defaultRegistry||useStyleRegistry();return registry?typeof window>"u"?(registry.add(props),null):(useInsertionEffect(function(){return registry.add(props),function(){registry.remove(props)}},[props.id,String(props.dynamic)]),null):null}JSXStyle.dynamic=function(info){return info.map(function(tagInfo){var baseId=tagInfo[0],props=tagInfo[1];return computeId(baseId,props)}).join(" ")};exports.StyleRegistry=StyleRegistry2;exports.createStyleRegistry=createStyleRegistry;exports.style=JSXStyle;exports.useStyleRegistry=useStyleRegistry}});var require_styled_jsx=__commonJS({"../../node_modules/styled-jsx/index.js"(exports,module){module.exports=require_index()}});import{setConfig}from"next/config";setConfig(process.env.__NEXT_RUNTIME_CONFIG);import*as React from"react";import{RouterContext}from"next/dist/shared/lib/router-context";import Router from"next/router";var action;try{action=__require("@storybook/addon-actions").action}catch{action=()=>()=>{}}var defaultRouter={route:"/",pathname:"/",query:{},asPath:"/",push(...args){return action("nextRouter.push")(...args),Promise.resolve(!0)},replace(...args){return action("nextRouter.replace")(...args),Promise.resolve(!0)},reload(...args){action("nextRouter.reload")(...args)},back(...args){action("nextRouter.back")(...args)},prefetch(...args){return action("nextRouter.prefetch")(...args),Promise.resolve()},beforePopState(...args){action("nextRouter.beforePopState")(...args)},events:{on(...args){action("nextRouter.events.on")(...args)},off(...args){action("nextRouter.events.off")(...args)},emit(...args){action("nextRouter.events.emit")(...args)}},isFallback:!1},RouterDecorator=(Story,{globals,parameters})=>{let nextRouterParams=parameters.nextRouter??{};return Router.router={...defaultRouter,locale:globals?.locale,...nextRouterParams},React.createElement(RouterContext.Provider,{value:Router.router},React.createElement(Story,null))};import*as React2 from"react";var StyleRegistry;try{StyleRegistry=require_styled_jsx().StyleRegistry}catch{StyleRegistry=React2.Fragment}var StyledJsxDecorator=Story=>React2.createElement(StyleRegistry,null,React2.createElement(Story,null));import*as React3 from"react";import semver from"semver";var defaultLoader=({src,width,quality})=>{let missingValues=[];if(src||missingValues.push("src"),width||missingValues.push("width"),missingValues.length>0)throw new Error(`Next Image Optimization requires ${missingValues.join(", ")} to be provided. Make sure you pass them as props to the \`next/image\` component. Received: ${JSON.stringify({src,width,quality})}`);return`${src}?w=${width}&q=${quality??75}`},NextImage=__require("next/image"),OriginalNextImage=NextImage.default;Object.defineProperty(NextImage,"default",{configurable:!0,value:props=>React3.createElement(OriginalNextImage,{...props,loader:props.loader??defaultLoader})});if(semver.satisfies(process.env.__NEXT_VERSION,"^13.0.0")){let OriginalNextLegacyImage=__require("next/legacy/image").default;Object.defineProperty(OriginalNextLegacyImage,"default",{configurable:!0,value:props=>React3.createElement(OriginalNextLegacyImage,{...props,loader:props.loader??defaultLoader})})}if(semver.satisfies(process.env.__NEXT_VERSION,"^12.
|
|
10
|
+
`)]}).filter(function(rule){return Boolean(rule[1])}))},_proto.styles=function(options){return mapRulesToStyle(this.cssRules(),options)},_proto.getIdAndRules=function(props){var css=props.children,dynamic=props.dynamic,id=props.id;if(dynamic){var styleId=computeId(id,dynamic);return{styleId,rules:Array.isArray(css)?css.map(function(rule){return computeSelector(styleId,rule)}):[computeSelector(styleId,css)]}}return{styleId:computeId(id),rules:Array.isArray(css)?css:[css]}},_proto.selectFromServer=function(){var elements=Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]'));return elements.reduce(function(acc,element){var id=element.id.slice(2);return acc[id]=element,acc},{})},StyleSheetRegistry2}();function invariant(condition,message){if(!condition)throw new Error("StyleSheetRegistry: "+message+".")}var StyleSheetContext=React4.createContext(null);StyleSheetContext.displayName="StyleSheetContext";function createStyleRegistry(){return new StyleSheetRegistry}function StyleRegistry2(param){var configuredRegistry=param.registry,children=param.children,rootRegistry=React4.useContext(StyleSheetContext),ref=React4.useState(function(){return rootRegistry||configuredRegistry||createStyleRegistry()}),registry=ref[0];return React__default.default.createElement(StyleSheetContext.Provider,{value:registry},children)}function useStyleRegistry(){return React4.useContext(StyleSheetContext)}var useInsertionEffect=React__default.default.useInsertionEffect||React__default.default.useLayoutEffect,defaultRegistry=typeof window<"u"?createStyleRegistry():void 0;function JSXStyle(props){var registry=defaultRegistry||useStyleRegistry();return registry?typeof window>"u"?(registry.add(props),null):(useInsertionEffect(function(){return registry.add(props),function(){registry.remove(props)}},[props.id,String(props.dynamic)]),null):null}JSXStyle.dynamic=function(info){return info.map(function(tagInfo){var baseId=tagInfo[0],props=tagInfo[1];return computeId(baseId,props)}).join(" ")};exports.StyleRegistry=StyleRegistry2;exports.createStyleRegistry=createStyleRegistry;exports.style=JSXStyle;exports.useStyleRegistry=useStyleRegistry}});var require_styled_jsx=__commonJS({"../../node_modules/styled-jsx/index.js"(exports,module){module.exports=require_index()}});import{setConfig}from"next/config";setConfig(process.env.__NEXT_RUNTIME_CONFIG);import*as React from"react";import{RouterContext}from"next/dist/shared/lib/router-context";import Router from"next/router";var action;try{action=__require("@storybook/addon-actions").action}catch{action=()=>()=>{}}var defaultRouter={route:"/",pathname:"/",query:{},asPath:"/",push(...args){return action("nextRouter.push")(...args),Promise.resolve(!0)},replace(...args){return action("nextRouter.replace")(...args),Promise.resolve(!0)},reload(...args){action("nextRouter.reload")(...args)},back(...args){action("nextRouter.back")(...args)},prefetch(...args){return action("nextRouter.prefetch")(...args),Promise.resolve()},beforePopState(...args){action("nextRouter.beforePopState")(...args)},events:{on(...args){action("nextRouter.events.on")(...args)},off(...args){action("nextRouter.events.off")(...args)},emit(...args){action("nextRouter.events.emit")(...args)}},isFallback:!1},RouterDecorator=(Story,{globals,parameters})=>{let nextRouterParams=parameters.nextRouter??{};return Router.router={...defaultRouter,locale:globals?.locale,...nextRouterParams},React.createElement(RouterContext.Provider,{value:Router.router},React.createElement(Story,null))};import*as React2 from"react";var StyleRegistry;try{StyleRegistry=require_styled_jsx().StyleRegistry}catch{StyleRegistry=React2.Fragment}var StyledJsxDecorator=Story=>React2.createElement(StyleRegistry,null,React2.createElement(Story,null));import*as React3 from"react";import semver from"semver";var defaultLoader=({src,width,quality})=>{let missingValues=[];if(src||missingValues.push("src"),width||missingValues.push("width"),missingValues.length>0)throw new Error(`Next Image Optimization requires ${missingValues.join(", ")} to be provided. Make sure you pass them as props to the \`next/image\` component. Received: ${JSON.stringify({src,width,quality})}`);return`${src}?w=${width}&q=${quality??75}`},NextImage=__require("next/image"),OriginalNextImage=NextImage.default;Object.defineProperty(NextImage,"default",{configurable:!0,value:props=>React3.createElement(OriginalNextImage,{...props,loader:props.loader??defaultLoader})});if(semver.satisfies(process.env.__NEXT_VERSION,"^13.0.0")){let OriginalNextLegacyImage=__require("next/legacy/image").default;Object.defineProperty(OriginalNextLegacyImage,"default",{configurable:!0,value:props=>React3.createElement(OriginalNextLegacyImage,{...props,loader:props.loader??defaultLoader})})}if(semver.satisfies(process.env.__NEXT_VERSION,"^12.2.0")){let OriginalNextFutureImage=__require("next/future/image").default;Object.defineProperty(OriginalNextFutureImage,"default",{configurable:!0,value:props=>React3.createElement(OriginalNextFutureImage,{...props,loader:props.loader??defaultLoader})})}var decorators=[StyledJsxDecorator,RouterDecorator];export{decorators};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/nextjs",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.59",
|
|
4
4
|
"description": "Storybook for Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -59,12 +59,12 @@
|
|
|
59
59
|
"prep": "../../../scripts/prepare/bundle.ts"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@storybook/builder-webpack5": "7.0.0-alpha.
|
|
63
|
-
"@storybook/core-common": "7.0.0-alpha.
|
|
64
|
-
"@storybook/node-logger": "7.0.0-alpha.
|
|
65
|
-
"@storybook/preset-react-webpack": "7.0.0-alpha.
|
|
66
|
-
"@storybook/preview-api": "7.0.0-alpha.
|
|
67
|
-
"@storybook/react": "7.0.0-alpha.
|
|
62
|
+
"@storybook/builder-webpack5": "7.0.0-alpha.59",
|
|
63
|
+
"@storybook/core-common": "7.0.0-alpha.59",
|
|
64
|
+
"@storybook/node-logger": "7.0.0-alpha.59",
|
|
65
|
+
"@storybook/preset-react-webpack": "7.0.0-alpha.59",
|
|
66
|
+
"@storybook/preview-api": "7.0.0-alpha.59",
|
|
67
|
+
"@storybook/react": "7.0.0-alpha.59",
|
|
68
68
|
"@types/node": "^16.0.0",
|
|
69
69
|
"find-up": "^5.0.0",
|
|
70
70
|
"fs-extra": "^9.0.1",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"tsconfig-paths-webpack-plugin": "^3.5.2"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@storybook/addon-actions": "7.0.0-alpha.
|
|
83
|
+
"@storybook/addon-actions": "7.0.0-alpha.59",
|
|
84
84
|
"next": "^13.0.5",
|
|
85
85
|
"typescript": "^4.9.3",
|
|
86
86
|
"webpack": "^5.65.0"
|
|
@@ -119,5 +119,5 @@
|
|
|
119
119
|
],
|
|
120
120
|
"platform": "node"
|
|
121
121
|
},
|
|
122
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "8d3068344b96cb740635b6fbb7a9052108a984bc"
|
|
123
123
|
}
|