@storyblok/vue 6.0.3 → 6.0.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.
@@ -1,6 +1,6 @@
1
- var te=Object.defineProperty;var C=Object.getOwnPropertySymbols;var re=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable;var $=(u,h,p)=>h in u?te(u,h,{enumerable:!0,configurable:!0,writable:!0,value:p}):u[h]=p,_=(u,h)=>{for(var p in h||(h={}))re.call(h,p)&&$(u,p,h[p]);if(C)for(var p of C(h))oe.call(h,p)&&$(u,p,h[p]);return u};(function(u,h){typeof exports=="object"&&typeof module!="undefined"?h(exports,require("vue"),require("axios")):typeof define=="function"&&define.amd?define(["exports","vue","axios"],h):(u=typeof globalThis!="undefined"?globalThis:u||self,h(u.storyblokVue={},u.Vue,u.t))})(this,function(u,h,p){"use strict";function M(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var I=M(p),x=Object.defineProperty,N=Object.defineProperties,B=Object.getOwnPropertyDescriptors,w=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable,T=(s,e,t)=>e in s?x(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,f=(s,e)=>{for(var t in e||(e={}))q.call(e,t)&&T(s,t,e[t]);if(w)for(var t of w(e))L.call(e,t)&&T(s,t,e[t]);return s},b=(s,e)=>N(s,B(e));let R=!1;const S=[],V=s=>new Promise((e,t)=>{if(typeof window=="undefined"||(window.storyblokRegisterEvent=o=>{if(window.location===window.parent.location){console.warn("You are not in Draft Mode or in the Visual Editor.");return}R?o():S.push(o)},document.getElementById("storyblok-javascript-bridge")))return;const r=document.createElement("script");r.async=!0,r.src=s,r.id="storyblok-javascript-bridge",r.onerror=o=>t(o),r.onload=o=>{S.forEach(n=>n()),R=!0,e(o)},document.getElementsByTagName("head")[0].appendChild(r)});/*!
1
+ (function(h,d){typeof exports=="object"&&typeof module!="undefined"?d(exports,require("vue"),require("axios")):typeof define=="function"&&define.amd?define(["exports","vue","axios"],d):(h=typeof globalThis!="undefined"?globalThis:h||self,d(h.storyblokVue={},h.Vue,h.e))})(this,function(h,d,p){"use strict";var et=Object.defineProperty;var j=Object.getOwnPropertySymbols;var rt=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable;var C=(h,d,p)=>d in h?et(h,d,{enumerable:!0,configurable:!0,writable:!0,value:p}):h[d]=p,_=(h,d)=>{for(var p in d||(d={}))rt.call(d,p)&&C(h,p,d[p]);if(j)for(var p of j(d))st.call(d,p)&&C(h,p,d[p]);return h};function M(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var I=M(p),N=Object.defineProperty,x=Object.defineProperties,B=Object.getOwnPropertyDescriptors,w=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable,T=(o,t,e)=>t in o?N(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,f=(o,t)=>{for(var e in t||(t={}))q.call(t,e)&&T(o,e,t[e]);if(w)for(var e of w(t))L.call(t,e)&&T(o,e,t[e]);return o},b=(o,t)=>x(o,B(t));let R=!1;const O=[],V=o=>new Promise((t,e)=>{if(typeof window=="undefined"||(window.storyblokRegisterEvent=s=>{if(window.location===window.parent.location){console.warn("You are not in Draft Mode or in the Visual Editor.");return}R?s():O.push(s)},document.getElementById("storyblok-javascript-bridge")))return;const r=document.createElement("script");r.async=!0,r.src=o,r.id="storyblok-javascript-bridge",r.onerror=s=>e(s),r.onload=s=>{O.forEach(n=>n()),R=!0,t(s)},document.getElementsByTagName("head")[0].appendChild(r)});/*!
2
2
  * storyblok-js-client v0.0.0-development
3
3
  * Universal JavaScript SDK for Storyblok's API
4
4
  * (c) 2020-2022 Stobylok Team
5
- */function O(s){return typeof s=="number"&&s==s&&s!==1/0&&s!==-1/0}function P(s,e,t){if(!O(e))throw new TypeError("Expected `limit` to be a finite number");if(!O(t))throw new TypeError("Expected `interval` to be a finite number");var r=[],o=[],n=0,i=function(){n++;var c=setTimeout(function(){n--,r.length>0&&i(),o=o.filter(function(d){return d!==c})},t);o.indexOf(c)<0&&o.push(c);var l=r.shift();l.resolve(s.apply(l.self,l.args))},a=function(){var c=arguments,l=this;return new Promise(function(d,k){r.push({resolve:d,reject:k,args:c,self:l}),n<e&&i()})};return a.abort=function(){o.forEach(clearTimeout),o=[],r.forEach(function(c){c.reject(new throttle.AbortError)}),r.length=0},a}P.AbortError=function(){Error.call(this,"Throttled function aborted"),this.name="AbortError"};const D=function(s,e){if(!s)return null;let t={};for(let r in s){let o=s[r];e.indexOf(r)>-1&&o!==null&&(t[r]=o)}return t};var z={nodes:{horizontal_rule:s=>({singleTag:"hr"}),blockquote:s=>({tag:"blockquote"}),bullet_list:s=>({tag:"ul"}),code_block:s=>({tag:["pre",{tag:"code",attrs:s.attrs}]}),hard_break:s=>({singleTag:"br"}),heading:s=>({tag:"h"+s.attrs.level}),image:s=>({singleTag:[{tag:"img",attrs:D(s.attrs,["src","alt","title"])}]}),list_item:s=>({tag:"li"}),ordered_list:s=>({tag:"ol"}),paragraph:s=>({tag:"p"})},marks:{bold:()=>({tag:"b"}),strike:()=>({tag:"strike"}),underline:()=>({tag:"u"}),strong:()=>({tag:"strong"}),code:()=>({tag:"code"}),italic:()=>({tag:"i"}),link(s){const e=f({},s.attrs),{linktype:t="url"}=s.attrs;return t==="email"&&(e.href="mailto:"+e.href),e.anchor&&(e.href=`${e.href}#${e.anchor}`,delete e.anchor),{tag:[{tag:"a",attrs:e}]}},styled:s=>({tag:[{tag:"span",attrs:s.attrs}]})}};class U{constructor(e){e||(e=z),this.marks=e.marks||[],this.nodes=e.nodes||[]}addNode(e,t){this.nodes[e]=t}addMark(e,t){this.marks[e]=t}render(e={}){if(e.content&&Array.isArray(e.content)){let t="";return e.content.forEach(r=>{t+=this.renderNode(r)}),t}return console.warn("The render method must receive an object with a content field, which is an array"),""}renderNode(e){let t=[];e.marks&&e.marks.forEach(o=>{const n=this.getMatchingMark(o);n&&t.push(this.renderOpeningTag(n.tag))});const r=this.getMatchingNode(e);return r&&r.tag&&t.push(this.renderOpeningTag(r.tag)),e.content?e.content.forEach(o=>{t.push(this.renderNode(o))}):e.text?t.push(function(o){const n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},i=/[&<>"']/g,a=RegExp(i.source);return o&&a.test(o)?o.replace(i,c=>n[c]):o}(e.text)):r&&r.singleTag?t.push(this.renderTag(r.singleTag," /")):r&&r.html&&t.push(r.html),r&&r.tag&&t.push(this.renderClosingTag(r.tag)),e.marks&&e.marks.slice(0).reverse().forEach(o=>{const n=this.getMatchingMark(o);n&&t.push(this.renderClosingTag(n.tag))}),t.join("")}renderTag(e,t){return e.constructor===String?`<${e}${t}>`:e.map(r=>{if(r.constructor===String)return`<${r}${t}>`;{let o="<"+r.tag;if(r.attrs)for(let n in r.attrs){let i=r.attrs[n];i!==null&&(o+=` ${n}="${i}"`)}return`${o}${t}>`}}).join("")}renderOpeningTag(e){return this.renderTag(e,"")}renderClosingTag(e){return e.constructor===String?`</${e}>`:e.slice(0).reverse().map(t=>t.constructor===String?`</${t}>`:`</${t.tag}>`).join("")}getMatchingNode(e){if(typeof this.nodes[e.type]=="function")return this.nodes[e.type](e)}getMatchingMark(e){if(typeof this.marks[e.type]=="function")return this.marks[e.type](e)}}const J=(s=0,e=s)=>{const t=Math.abs(e-s)||0,r=s<e?1:-1;return((o=0,n)=>[...Array(o)].map(n))(t,(o,n)=>n*r+s)},v=(s,e,t)=>{const r=[];for(const o in s){if(!Object.prototype.hasOwnProperty.call(s,o))continue;const n=s[o],i=t?"":encodeURIComponent(o);let a;a=typeof n=="object"?v(n,e?e+encodeURIComponent("["+i+"]"):i,Array.isArray(n)):(e?e+encodeURIComponent("["+i+"]"):i)+"="+encodeURIComponent(n),r.push(a)}return r.join("&")};let m={},g={};class Y{constructor(e,t){if(!t){let n=e.region?"-"+e.region:"",i=e.https===!1?"http":"https";t=e.oauthToken===void 0?`${i}://api${n}.storyblok.com/v2`:`${i}://api${n}.storyblok.com/v1`}let r=Object.assign({},e.headers),o=5;e.oauthToken!==void 0&&(r.Authorization=e.oauthToken,o=3),e.rateLimit!==void 0&&(o=e.rateLimit),this.richTextResolver=new U(e.richTextSchema),typeof e.componentResolver=="function"&&this.setComponentResolver(e.componentResolver),this.maxRetries=e.maxRetries||5,this.throttle=P(this.throttledRequest,o,1e3),this.accessToken=e.accessToken,this.relations={},this.links={},this.cache=e.cache||{clear:"manual"},this.client=I.default.create({baseURL:t,timeout:e.timeout||0,headers:r,proxy:e.proxy||!1}),e.responseInterceptor&&this.client.interceptors.response.use(n=>e.responseInterceptor(n))}setComponentResolver(e){this.richTextResolver.addNode("blok",t=>{let r="";return t.attrs.body.forEach(o=>{r+=e(o.component,o)}),{html:r}})}parseParams(e={}){return e.version||(e.version="published"),e.token||(e.token=this.getToken()),e.cv||(e.cv=g[e.token]),Array.isArray(e.resolve_relations)&&(e.resolve_relations=e.resolve_relations.join(",")),e}factoryParamOptions(e,t={}){return((r="")=>r.indexOf("/cdn/")>-1)(e)?this.parseParams(t):t}makeRequest(e,t,r,o){const n=this.factoryParamOptions(e,((i={},a=25,c=1)=>b(f({},i),{per_page:a,page:c}))(t,r,o));return this.cacheResponse(e,n)}get(e,t){let r="/"+e;const o=this.factoryParamOptions(r,t);return this.cacheResponse(r,o)}async getAll(e,t={},r){const o=t.per_page||25,n="/"+e,i=n.split("/");r=r||i[i.length-1];const a=await this.makeRequest(n,t,o,1),c=Math.ceil(a.total/o);return((l=[],d)=>l.map(d).reduce((k,ee)=>[...k,...ee],[]))([a,...await(async(l=[],d)=>Promise.all(l.map(d)))(J(1,c),async l=>this.makeRequest(n,t,o,l+1))],l=>Object.values(l.data[r]))}post(e,t){let r="/"+e;return this.throttle("post",r,t)}put(e,t){let r="/"+e;return this.throttle("put",r,t)}delete(e,t){let r="/"+e;return this.throttle("delete",r,t)}getStories(e){return this.get("cdn/stories",e)}getStory(e,t){return this.get("cdn/stories/"+e,t)}setToken(e){this.accessToken=e}getToken(){return this.accessToken}_cleanCopy(e){return JSON.parse(JSON.stringify(e))}_insertLinks(e,t){const r=e[t];r&&r.fieldtype=="multilink"&&r.linktype=="story"&&typeof r.id=="string"&&this.links[r.id]?r.story=this._cleanCopy(this.links[r.id]):r&&r.linktype==="story"&&typeof r.uuid=="string"&&this.links[r.uuid]&&(r.story=this._cleanCopy(this.links[r.uuid]))}_insertRelations(e,t,r){if(r.indexOf(e.component+"."+t)>-1){if(typeof e[t]=="string")this.relations[e[t]]&&(e[t]=this._cleanCopy(this.relations[e[t]]));else if(e[t].constructor===Array){let o=[];e[t].forEach(n=>{this.relations[n]&&o.push(this._cleanCopy(this.relations[n]))}),e[t]=o}}}iterateTree(e,t){let r=o=>{if(o!=null){if(o.constructor===Array)for(let n=0;n<o.length;n++)r(o[n]);else if(o.constructor===Object){if(o._stopResolving)return;for(let n in o)(o.component&&o._uid||o.type==="link")&&(this._insertRelations(o,n,t),this._insertLinks(o,n)),r(o[n])}}};r(e.content)}async resolveLinks(e,t){let r=[];if(e.link_uuids){const o=e.link_uuids.length;let n=[];const i=50;for(let a=0;a<o;a+=i){const c=Math.min(o,a+i);n.push(e.link_uuids.slice(a,c))}for(let a=0;a<n.length;a++)(await this.getStories({per_page:i,language:t.language,version:t.version,by_uuids:n[a].join(",")})).data.stories.forEach(c=>{r.push(c)})}else r=e.links;r.forEach(o=>{this.links[o.uuid]=b(f({},o),{_stopResolving:!0})})}async resolveRelations(e,t){let r=[];if(e.rel_uuids){const o=e.rel_uuids.length;let n=[];const i=50;for(let a=0;a<o;a+=i){const c=Math.min(o,a+i);n.push(e.rel_uuids.slice(a,c))}for(let a=0;a<n.length;a++)(await this.getStories({per_page:i,language:t.language,version:t.version,by_uuids:n[a].join(",")})).data.stories.forEach(c=>{r.push(c)})}else r=e.rels;r.forEach(o=>{this.relations[o.uuid]=b(f({},o),{_stopResolving:!0})})}async resolveStories(e,t){let r=[];t.resolve_relations!==void 0&&t.resolve_relations.length>0&&(r=t.resolve_relations.split(","),await this.resolveRelations(e,t)),["1","story","url"].indexOf(t.resolve_links)>-1&&await this.resolveLinks(e,t);for(const o in this.relations)this.iterateTree(this.relations[o],r);e.story?this.iterateTree(e.story,r):e.stories.forEach(o=>{this.iterateTree(o,r)})}cacheResponse(e,t,r){return r===void 0&&(r=0),new Promise(async(o,n)=>{let i=v({url:e,params:t}),a=this.cacheProvider();if(this.cache.clear==="auto"&&t.version==="draft"&&await this.flushCache(),t.version==="published"&&e!="/cdn/spaces/me"){const l=await a.get(i);if(l)return o(l)}try{let l=await this.throttle("get",e,{params:t,paramsSerializer:k=>v(k)}),d={data:l.data,headers:l.headers};if(l.headers["per-page"]&&(d=Object.assign({},d,{perPage:parseInt(l.headers["per-page"]),total:parseInt(l.headers.total)})),l.status!=200)return n(l);(d.data.story||d.data.stories)&&await this.resolveStories(d.data,t),t.version==="published"&&e!="/cdn/spaces/me"&&a.set(i,d),d.data.cv&&(t.version=="draft"&&g[t.token]!=d.data.cv&&this.flushCache(),g[t.token]=d.data.cv),o(d)}catch(l){if(l.response&&l.response.status===429&&(r+=1)<this.maxRetries)return console.log(`Hit rate limit. Retrying in ${r} seconds.`),await(c=1e3*r,new Promise(d=>setTimeout(d,c))),this.cacheResponse(e,t,r).then(o).catch(n);n(l)}var c})}throttledRequest(e,t,r){return this.client[e](t,r)}cacheVersions(){return g}cacheVersion(){return g[this.accessToken]}setCacheVersion(e){this.accessToken&&(g[this.accessToken]=e)}cacheProvider(){switch(this.cache.type){case"memory":return{get:e=>m[e],getAll:()=>m,set(e,t){m[e]=t},flush(){m={}}};default:return{get(){},getAll(){},set(){},flush(){}}}}async flushCache(){return await this.cacheProvider().flush(),this}}var H=(s={})=>{const{apiOptions:e}=s;if(!e.accessToken){console.error("You need to provide an access token to interact with Storyblok API. Read https://www.storyblok.com/docs/api/content-delivery#topics/authentication");return}return{storyblokApi:new Y(e)}},F=s=>{if(typeof s!="object"||typeof s._editable=="undefined")return{};const e=JSON.parse(s._editable.replace(/^<!--#storyblok#/,"").replace(/-->$/,""));return{"data-blok-c":JSON.stringify(e),"data-blok-uid":e.id+"-"+e.uid}};const G="https://app.storyblok.com/f/storyblok-v2-latest.js",E=(s,e,t={})=>{if(typeof window!="undefined"){if(typeof window.storyblokRegisterEvent=="undefined"){console.error("Storyblok Bridge is disabled. Please enable it to use it. Read https://github.com/storyblok/storyblok-js");return}if(!s){console.warn("Story ID is not defined. Please provide a valid ID.");return}window.storyblokRegisterEvent(()=>{new window.StoryblokBridge(t).on(["input","published","change"],o=>{o.action=="input"&&o.story.id===s?e(o.story):window.location.reload()})})}},K=(s={})=>{const{bridge:e,accessToken:t,use:r=[],apiOptions:o={}}=s;o.accessToken=o.accessToken||t;const n={bridge:e,apiOptions:o};let i={};return r.forEach(a=>{i=f(f({},i),a(n))}),e!==!1&&V(G),i},j={props:{blok:Object},setup(s){return(e,t)=>(h.openBlock(),h.createBlock(h.resolveDynamicComponent(s.blok.component),h.normalizeProps(h.guardReactiveProps(_(_({},e.$props),e.$attrs))),null,16))}},Q={beforeMount(s,e){if(e.value){const t=F(e.value);s.setAttribute("data-blok-c",t["data-blok-c"]),s.setAttribute("data-blok-uid",t["data-blok-uid"]),s.classList.add("storyblok__outline")}}},A=s=>{console.error(`You can't use ${s} if you're not loading apiPlugin. Please provide it on StoryblokVue initialization.
6
- `)};let y=null;const W=()=>(y||A("useStoryblokApi"),y),X=async(s,e={},t={})=>{const r=h.ref(null);if(h.onMounted(()=>{r.value&&r.value.id&&E(r.value.id,o=>r.value=o,t)}),y){const{data:o}=await y.get(`cdn/stories/${s}`,e);r.value=o.story}else A("useStoryblok");return r},Z={install(s,e={}){s.directive("editable",Q),s.component("StoryblokComponent",j);const{storyblokApi:t}=K(e);y=t}};u.StoryblokComponent=j,u.StoryblokVue=Z,u.apiPlugin=H,u.useStoryblok=X,u.useStoryblokApi=W,u.useStoryblokBridge=E,Object.defineProperty(u,"__esModule",{value:!0}),u[Symbol.toStringTag]="Module"});
5
+ */function S(o){return typeof o=="number"&&o==o&&o!==1/0&&o!==-1/0}function E(o,t,e){if(!S(t))throw new TypeError("Expected `limit` to be a finite number");if(!S(e))throw new TypeError("Expected `interval` to be a finite number");var r=[],s=[],n=0,i=function(){n++;var c=setTimeout(function(){n--,r.length>0&&i(),s=s.filter(function(u){return u!==c})},e);s.indexOf(c)<0&&s.push(c);var l=r.shift();l.resolve(o.apply(l.self,l.args))},a=function(){var c=arguments,l=this;return new Promise(function(u,m){r.push({resolve:u,reject:m,args:c,self:l}),n<t&&i()})};return a.abort=function(){s.forEach(clearTimeout),s=[],r.forEach(function(c){c.reject(new throttle.AbortError)}),r.length=0},a}E.AbortError=function(){Error.call(this,"Throttled function aborted"),this.name="AbortError"};const D=function(o,t){if(!o)return null;let e={};for(let r in o){let s=o[r];t.indexOf(r)>-1&&s!==null&&(e[r]=s)}return e};var z={nodes:{horizontal_rule:()=>({singleTag:"hr"}),blockquote:()=>({tag:"blockquote"}),bullet_list:()=>({tag:"ul"}),code_block:o=>({tag:["pre",{tag:"code",attrs:o.attrs}]}),hard_break:()=>({singleTag:"br"}),heading:o=>({tag:`h${o.attrs.level}`}),image:o=>({singleTag:[{tag:"img",attrs:D(o.attrs,["src","alt","title"])}]}),list_item:()=>({tag:"li"}),ordered_list:()=>({tag:"ol"}),paragraph:()=>({tag:"p"})},marks:{bold:()=>({tag:"b"}),strike:()=>({tag:"strike"}),underline:()=>({tag:"u"}),strong:()=>({tag:"strong"}),code:()=>({tag:"code"}),italic:()=>({tag:"i"}),link(o){const t=f({},o.attrs),{linktype:e="url"}=o.attrs;return e==="email"&&(t.href=`mailto:${t.href}`),t.anchor&&(t.href=`${t.href}#${t.anchor}`,delete t.anchor),{tag:[{tag:"a",attrs:t}]}},styled:o=>({tag:[{tag:"span",attrs:o.attrs}]})}};class U{constructor(t){t||(t=z),this.marks=t.marks||[],this.nodes=t.nodes||[]}addNode(t,e){this.nodes[t]=e}addMark(t,e){this.marks[t]=e}render(t={}){if(t.content&&Array.isArray(t.content)){let e="";return t.content.forEach(r=>{e+=this.renderNode(r)}),e}return console.warn("The render method must receive an object with a content field, which is an array"),""}renderNode(t){let e=[];t.marks&&t.marks.forEach(s=>{const n=this.getMatchingMark(s);n&&e.push(this.renderOpeningTag(n.tag))});const r=this.getMatchingNode(t);return r&&r.tag&&e.push(this.renderOpeningTag(r.tag)),t.content?t.content.forEach(s=>{e.push(this.renderNode(s))}):t.text?e.push(function(s){const n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},i=/[&<>"']/g,a=RegExp(i.source);return s&&a.test(s)?s.replace(i,c=>n[c]):s}(t.text)):r&&r.singleTag?e.push(this.renderTag(r.singleTag," /")):r&&r.html&&e.push(r.html),r&&r.tag&&e.push(this.renderClosingTag(r.tag)),t.marks&&t.marks.slice(0).reverse().forEach(s=>{const n=this.getMatchingMark(s);n&&e.push(this.renderClosingTag(n.tag))}),e.join("")}renderTag(t,e){return t.constructor===String?`<${t}${e}>`:t.map(r=>{if(r.constructor===String)return`<${r}${e}>`;{let s=`<${r.tag}`;if(r.attrs)for(let n in r.attrs){let i=r.attrs[n];i!==null&&(s+=` ${n}="${i}"`)}return`${s}${e}>`}}).join("")}renderOpeningTag(t){return this.renderTag(t,"")}renderClosingTag(t){return t.constructor===String?`</${t}>`:t.slice(0).reverse().map(e=>e.constructor===String?`</${e}>`:`</${e.tag}>`).join("")}getMatchingNode(t){if(typeof this.nodes[t.type]=="function")return this.nodes[t.type](t)}getMatchingMark(t){if(typeof this.marks[t.type]=="function")return this.marks[t.type](t)}}const J=(o=0,t=o)=>{const e=Math.abs(t-o)||0,r=o<t?1:-1;return((s=0,n)=>[...Array(s)].map(n))(e,(s,n)=>n*r+o)},v=(o,t,e)=>{const r=[];for(const s in o){if(!Object.prototype.hasOwnProperty.call(o,s))continue;const n=o[s],i=e?"":encodeURIComponent(s);let a;a=typeof n=="object"?v(n,t?t+encodeURIComponent("["+i+"]"):i,Array.isArray(n)):(t?t+encodeURIComponent("["+i+"]"):i)+"="+encodeURIComponent(n),r.push(a)}return r.join("&")};let k={},g={};class Y{constructor(t,e){if(!e){let n=t.region?`-${t.region}`:"",i=t.https===!1?"http":"https";e=t.oauthToken===void 0?`${i}://api${n}.storyblok.com/v2`:`${i}://api${n}.storyblok.com/v1`}let r=Object.assign({},t.headers),s=5;t.oauthToken!==void 0&&(r.Authorization=t.oauthToken,s=3),t.rateLimit!==void 0&&(s=t.rateLimit),this.richTextResolver=new U(t.richTextSchema),typeof t.componentResolver=="function"&&this.setComponentResolver(t.componentResolver),this.maxRetries=t.maxRetries||5,this.throttle=E(this.throttledRequest,s,1e3),this.accessToken=t.accessToken,this.relations={},this.links={},this.cache=t.cache||{clear:"manual"},this.client=I.default.create({baseURL:e,timeout:t.timeout||0,headers:r,proxy:t.proxy||!1}),t.responseInterceptor&&this.client.interceptors.response.use(n=>t.responseInterceptor(n)),this.resolveNestedRelations=t.resolveNestedRelations||!0}setComponentResolver(t){this.richTextResolver.addNode("blok",e=>{let r="";return e.attrs.body.forEach(s=>{r+=t(s.component,s)}),{html:r}})}parseParams(t={}){return t.version||(t.version="published"),t.token||(t.token=this.getToken()),t.cv||(t.cv=g[t.token]),Array.isArray(t.resolve_relations)&&(t.resolve_relations=t.resolve_relations.join(",")),t}factoryParamOptions(t,e={}){return((r="")=>r.indexOf("/cdn/")>-1)(t)?this.parseParams(e):e}makeRequest(t,e,r,s){const n=this.factoryParamOptions(t,((i={},a=25,c=1)=>b(f({},i),{per_page:a,page:c}))(e,r,s));return this.cacheResponse(t,n)}get(t,e){let r=`/${t}`;const s=this.factoryParamOptions(r,e);return this.cacheResponse(r,s)}async getAll(t,e={},r){const s=e.per_page||25,n=`/${t}`,i=n.split("/");r=r||i[i.length-1];const a=await this.makeRequest(n,e,s,1),c=Math.ceil(a.total/s);return((l=[],u)=>l.map(u).reduce((m,tt)=>[...m,...tt],[]))([a,...await(async(l=[],u)=>Promise.all(l.map(u)))(J(1,c),async l=>this.makeRequest(n,e,s,l+1))],l=>Object.values(l.data[r]))}post(t,e){let r=`/${t}`;return this.throttle("post",r,e)}put(t,e){let r=`/${t}`;return this.throttle("put",r,e)}delete(t,e){let r=`/${t}`;return this.throttle("delete",r,e)}getStories(t){return this.get("cdn/stories",t)}getStory(t,e){return this.get(`cdn/stories/${t}`,e)}setToken(t){this.accessToken=t}getToken(){return this.accessToken}_cleanCopy(t){return JSON.parse(JSON.stringify(t))}_insertLinks(t,e){const r=t[e];r&&r.fieldtype=="multilink"&&r.linktype=="story"&&typeof r.id=="string"&&this.links[r.id]?r.story=this._cleanCopy(this.links[r.id]):r&&r.linktype==="story"&&typeof r.uuid=="string"&&this.links[r.uuid]&&(r.story=this._cleanCopy(this.links[r.uuid]))}_insertRelations(t,e,r){if(r.indexOf(t.component+"."+e)>-1){if(typeof t[e]=="string")this.relations[t[e]]&&(t[e]=this._cleanCopy(this.relations[t[e]]));else if(t[e].constructor===Array){let s=[];t[e].forEach(n=>{this.relations[n]&&s.push(this._cleanCopy(this.relations[n]))}),t[e]=s}}}_insertAssetsRelations(t,e){e.forEach(r=>{t.id===r.id&&(t.original=r,t.original.filename=t.filename,t.original.filename=t.original.filename.includes("https://s3.amazonaws.com/")?t.original.filename:t.original.filename.replace("https://","https://s3.amazonaws.com/"),delete t.original.s3_filename)})}iterateTree(t,e){let r=s=>{if(s!=null){if(s.constructor===Array)for(let n=0;n<s.length;n++)r(s[n]);else if(s.constructor===Object){if(s._stopResolving)return;for(let n in s)s.component&&s._uid||s.type==="link"?(this._insertRelations(s,n,e),this._insertLinks(s,n)):s.fieldtype==="asset"&&this._insertAssetsRelations(s,e),r(s[n])}}};r(t.content)}async resolveLinks(t,e){let r=[];if(t.link_uuids){const s=t.link_uuids.length;let n=[];const i=50;for(let a=0;a<s;a+=i){const c=Math.min(s,a+i);n.push(t.link_uuids.slice(a,c))}for(let a=0;a<n.length;a++)(await this.getStories({per_page:i,language:e.language,version:e.version,by_uuids:n[a].join(",")})).data.stories.forEach(c=>{r.push(c)})}else r=t.links;r.forEach(s=>{this.links[s.uuid]=b(f({},s),{_stopResolving:!0})})}async resolveRelations(t,e){let r=[];if(t.rel_uuids){const s=t.rel_uuids.length;let n=[];const i=50;for(let a=0;a<s;a+=i){const c=Math.min(s,a+i);n.push(t.rel_uuids.slice(a,c))}for(let a=0;a<n.length;a++)(await this.getStories({per_page:i,language:e.language,version:e.version,by_uuids:n[a].join(",")})).data.stories.forEach(c=>{r.push(c)})}else r=t.rels;r.forEach(s=>{this.relations[s.uuid]=b(f({},s),{_stopResolving:!0})})}async resolveStories(t,e){let r=[];if(e.resolve_relations!==void 0&&e.resolve_relations.length>0&&(r=e.resolve_relations.split(","),await this.resolveRelations(t,e)),["1","story","url"].indexOf(e.resolve_links)>-1&&await this.resolveLinks(t,e),this.resolveNestedRelations)for(const s in this.relations)this.iterateTree(this.relations[s],r);t.story?this.iterateTree(t.story,r):t.stories.forEach(s=>{this.iterateTree(s,r)})}resolveAssetsRelations(t){const{assets:e,stories:r,story:s}=t;if(r)for(const n of r)this.iterateTree(n,e);else this.iterateTree(s,e)}cacheResponse(t,e,r){return r===void 0&&(r=0),new Promise(async(s,n)=>{let i=v({url:t,params:e}),a=this.cacheProvider();if(this.cache.clear==="auto"&&e.version==="draft"&&await this.flushCache(),e.version==="published"&&t!="/cdn/spaces/me"){const l=await a.get(i);if(l)return s(l)}try{let l=await this.throttle("get",t,{params:e,paramsSerializer:m=>v(m)}),u={data:l.data,headers:l.headers};if(u.data.assets&&u.data.assets.length&&this.resolveAssetsRelations(u.data),l.headers["per-page"]&&(u=Object.assign({},u,{perPage:parseInt(l.headers["per-page"]),total:parseInt(l.headers.total)})),l.status!=200)return n(l);(u.data.story||u.data.stories)&&await this.resolveStories(u.data,e),e.version==="published"&&t!="/cdn/spaces/me"&&a.set(i,u),u.data.cv&&(e.version=="draft"&&g[e.token]!=u.data.cv&&this.flushCache(),g[e.token]=u.data.cv),s(u)}catch(l){if(l.response&&l.response.status===429&&(r+=1)<this.maxRetries)return console.log(`Hit rate limit. Retrying in ${r} seconds.`),await(c=1e3*r,new Promise(u=>setTimeout(u,c))),this.cacheResponse(t,e,r).then(s).catch(n);n(l)}var c})}throttledRequest(t,e,r){return this.client[t](e,r)}cacheVersions(){return g}cacheVersion(){return g[this.accessToken]}setCacheVersion(t){this.accessToken&&(g[this.accessToken]=t)}cacheProvider(){return this.cache.type==="memory"?{get:t=>k[t],getAll:()=>k,set(t,e){k[t]=e},flush(){k={}}}:{get(){},getAll(){},set(){},flush(){}}}async flushCache(){return await this.cacheProvider().flush(),this}}var H=(o={})=>{const{apiOptions:t}=o;if(!t.accessToken){console.error("You need to provide an access token to interact with Storyblok API. Read https://www.storyblok.com/docs/api/content-delivery#topics/authentication");return}return{storyblokApi:new Y(t)}},F=o=>{if(typeof o!="object"||typeof o._editable=="undefined")return{};const t=JSON.parse(o._editable.replace(/^<!--#storyblok#/,"").replace(/-->$/,""));return{"data-blok-c":JSON.stringify(t),"data-blok-uid":t.id+"-"+t.uid}};const G="https://app.storyblok.com/f/storyblok-v2-latest.js",P=(o,t,e={})=>{if(typeof window!="undefined"){if(typeof window.storyblokRegisterEvent=="undefined"){console.error("Storyblok Bridge is disabled. Please enable it to use it. Read https://github.com/storyblok/storyblok-js");return}if(!o){console.warn("Story ID is not defined. Please provide a valid ID.");return}window.storyblokRegisterEvent(()=>{new window.StoryblokBridge(e).on(["input","published","change"],s=>{s.action=="input"&&s.story.id===o?t(s.story):window.location.reload()})})}},K=(o={})=>{const{bridge:t,accessToken:e,use:r=[],apiOptions:s={}}=o;s.accessToken=s.accessToken||e;const n={bridge:t,apiOptions:s};let i={};return r.forEach(a=>{i=f(f({},i),a(n))}),t!==!1&&V(G),i},$={props:{blok:Object},setup(o){return(t,e)=>(d.openBlock(),d.createBlock(d.resolveDynamicComponent(o.blok.component),d.normalizeProps(d.guardReactiveProps(_(_({},t.$props),t.$attrs))),null,16))}},Q={beforeMount(o,t){if(t.value){const e=F(t.value);o.setAttribute("data-blok-c",e["data-blok-c"]),o.setAttribute("data-blok-uid",e["data-blok-uid"]),o.classList.add("storyblok__outline")}}},A=o=>{console.error(`You can't use ${o} if you're not loading apiPlugin. Please provide it on StoryblokVue initialization.
6
+ `)};let y=null;const W=()=>(y||A("useStoryblokApi"),y),X=async(o,t={},e={})=>{const r=d.ref(null);if(d.onMounted(()=>{r.value&&r.value.id&&P(r.value.id,s=>r.value=s,e)}),y){const{data:s}=await y.get(`cdn/stories/${o}`,t);r.value=s.story}else A("useStoryblok");return r},Z={install(o,t={}){o.directive("editable",Q),o.component("StoryblokComponent",$);const{storyblokApi:e}=K(t);y=e}};h.StoryblokComponent=$,h.StoryblokVue=Z,h.apiPlugin=H,h.useStoryblok=X,h.useStoryblokApi=W,h.useStoryblokBridge=P,Object.defineProperty(h,"__esModule",{value:!0}),h[Symbol.toStringTag]="Module"});
@@ -15,7 +15,7 @@ var __spreadValues = (a2, b) => {
15
15
  return a2;
16
16
  };
17
17
  import { openBlock, createBlock, resolveDynamicComponent, normalizeProps, guardReactiveProps, ref, onMounted } from "vue";
18
- import t from "axios";
18
+ import e from "axios";
19
19
  var __defProp2 = Object.defineProperty;
20
20
  var __defProps = Object.defineProperties;
21
21
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
@@ -71,309 +71,322 @@ const loadBridge = (src) => {
71
71
  * Universal JavaScript SDK for Storyblok's API
72
72
  * (c) 2020-2022 Stobylok Team
73
73
  */
74
- function e(t2) {
75
- return typeof t2 == "number" && (t2 == t2 && t2 !== 1 / 0 && t2 !== -1 / 0);
74
+ function t(e2) {
75
+ return typeof e2 == "number" && (e2 == e2 && e2 !== 1 / 0 && e2 !== -1 / 0);
76
76
  }
77
- function r(t2, r2, s2) {
78
- if (!e(r2))
77
+ function s(e2, s2, r2) {
78
+ if (!t(s2))
79
79
  throw new TypeError("Expected `limit` to be a finite number");
80
- if (!e(s2))
80
+ if (!t(r2))
81
81
  throw new TypeError("Expected `interval` to be a finite number");
82
- var n2 = [], i2 = [], o2 = 0, a2 = function() {
82
+ var i2 = [], n2 = [], o2 = 0, a2 = function() {
83
83
  o2++;
84
- var e2 = setTimeout(function() {
85
- o2--, n2.length > 0 && a2(), i2 = i2.filter(function(t3) {
86
- return t3 !== e2;
84
+ var t2 = setTimeout(function() {
85
+ o2--, i2.length > 0 && a2(), n2 = n2.filter(function(e3) {
86
+ return e3 !== t2;
87
87
  });
88
- }, s2);
89
- i2.indexOf(e2) < 0 && i2.push(e2);
90
- var r3 = n2.shift();
91
- r3.resolve(t2.apply(r3.self, r3.args));
88
+ }, r2);
89
+ n2.indexOf(t2) < 0 && n2.push(t2);
90
+ var s3 = i2.shift();
91
+ s3.resolve(e2.apply(s3.self, s3.args));
92
92
  }, l2 = function() {
93
- var t3 = arguments, e2 = this;
94
- return new Promise(function(s3, i3) {
95
- n2.push({ resolve: s3, reject: i3, args: t3, self: e2 }), o2 < r2 && a2();
93
+ var e3 = arguments, t2 = this;
94
+ return new Promise(function(r3, n3) {
95
+ i2.push({ resolve: r3, reject: n3, args: e3, self: t2 }), o2 < s2 && a2();
96
96
  });
97
97
  };
98
98
  return l2.abort = function() {
99
- i2.forEach(clearTimeout), i2 = [], n2.forEach(function(t3) {
100
- t3.reject(new throttle.AbortError());
101
- }), n2.length = 0;
99
+ n2.forEach(clearTimeout), n2 = [], i2.forEach(function(e3) {
100
+ e3.reject(new throttle.AbortError());
101
+ }), i2.length = 0;
102
102
  }, l2;
103
103
  }
104
- r.AbortError = function() {
104
+ s.AbortError = function() {
105
105
  Error.call(this, "Throttled function aborted"), this.name = "AbortError";
106
106
  };
107
- const s = function(t2, e2) {
108
- if (!t2)
107
+ const r = function(e2, t2) {
108
+ if (!e2)
109
109
  return null;
110
- let r2 = {};
111
- for (let s2 in t2) {
112
- let n2 = t2[s2];
113
- e2.indexOf(s2) > -1 && n2 !== null && (r2[s2] = n2);
110
+ let s2 = {};
111
+ for (let r2 in e2) {
112
+ let i2 = e2[r2];
113
+ t2.indexOf(r2) > -1 && i2 !== null && (s2[r2] = i2);
114
114
  }
115
- return r2;
115
+ return s2;
116
116
  };
117
- var n = { nodes: { horizontal_rule: (t2) => ({ singleTag: "hr" }), blockquote: (t2) => ({ tag: "blockquote" }), bullet_list: (t2) => ({ tag: "ul" }), code_block: (t2) => ({ tag: ["pre", { tag: "code", attrs: t2.attrs }] }), hard_break: (t2) => ({ singleTag: "br" }), heading: (t2) => ({ tag: "h" + t2.attrs.level }), image: (t2) => ({ singleTag: [{ tag: "img", attrs: s(t2.attrs, ["src", "alt", "title"]) }] }), list_item: (t2) => ({ tag: "li" }), ordered_list: (t2) => ({ tag: "ol" }), paragraph: (t2) => ({ tag: "p" }) }, marks: { bold: () => ({ tag: "b" }), strike: () => ({ tag: "strike" }), underline: () => ({ tag: "u" }), strong: () => ({ tag: "strong" }), code: () => ({ tag: "code" }), italic: () => ({ tag: "i" }), link(t2) {
118
- const e2 = __spreadValues2({}, t2.attrs), { linktype: r2 = "url" } = t2.attrs;
119
- return r2 === "email" && (e2.href = "mailto:" + e2.href), e2.anchor && (e2.href = `${e2.href}#${e2.anchor}`, delete e2.anchor), { tag: [{ tag: "a", attrs: e2 }] };
120
- }, styled: (t2) => ({ tag: [{ tag: "span", attrs: t2.attrs }] }) } };
121
- class i {
122
- constructor(t2) {
123
- t2 || (t2 = n), this.marks = t2.marks || [], this.nodes = t2.nodes || [];
124
- }
125
- addNode(t2, e2) {
126
- this.nodes[t2] = e2;
127
- }
128
- addMark(t2, e2) {
129
- this.marks[t2] = e2;
130
- }
131
- render(t2 = {}) {
132
- if (t2.content && Array.isArray(t2.content)) {
133
- let e2 = "";
134
- return t2.content.forEach((t3) => {
135
- e2 += this.renderNode(t3);
136
- }), e2;
117
+ var i = { nodes: { horizontal_rule: () => ({ singleTag: "hr" }), blockquote: () => ({ tag: "blockquote" }), bullet_list: () => ({ tag: "ul" }), code_block: (e2) => ({ tag: ["pre", { tag: "code", attrs: e2.attrs }] }), hard_break: () => ({ singleTag: "br" }), heading: (e2) => ({ tag: `h${e2.attrs.level}` }), image: (e2) => ({ singleTag: [{ tag: "img", attrs: r(e2.attrs, ["src", "alt", "title"]) }] }), list_item: () => ({ tag: "li" }), ordered_list: () => ({ tag: "ol" }), paragraph: () => ({ tag: "p" }) }, marks: { bold: () => ({ tag: "b" }), strike: () => ({ tag: "strike" }), underline: () => ({ tag: "u" }), strong: () => ({ tag: "strong" }), code: () => ({ tag: "code" }), italic: () => ({ tag: "i" }), link(e2) {
118
+ const t2 = __spreadValues2({}, e2.attrs), { linktype: s2 = "url" } = e2.attrs;
119
+ return s2 === "email" && (t2.href = `mailto:${t2.href}`), t2.anchor && (t2.href = `${t2.href}#${t2.anchor}`, delete t2.anchor), { tag: [{ tag: "a", attrs: t2 }] };
120
+ }, styled: (e2) => ({ tag: [{ tag: "span", attrs: e2.attrs }] }) } };
121
+ class n {
122
+ constructor(e2) {
123
+ e2 || (e2 = i), this.marks = e2.marks || [], this.nodes = e2.nodes || [];
124
+ }
125
+ addNode(e2, t2) {
126
+ this.nodes[e2] = t2;
127
+ }
128
+ addMark(e2, t2) {
129
+ this.marks[e2] = t2;
130
+ }
131
+ render(e2 = {}) {
132
+ if (e2.content && Array.isArray(e2.content)) {
133
+ let t2 = "";
134
+ return e2.content.forEach((e3) => {
135
+ t2 += this.renderNode(e3);
136
+ }), t2;
137
137
  }
138
138
  return console.warn("The render method must receive an object with a content field, which is an array"), "";
139
139
  }
140
- renderNode(t2) {
141
- let e2 = [];
142
- t2.marks && t2.marks.forEach((t3) => {
143
- const r3 = this.getMatchingMark(t3);
144
- r3 && e2.push(this.renderOpeningTag(r3.tag));
140
+ renderNode(e2) {
141
+ let t2 = [];
142
+ e2.marks && e2.marks.forEach((e3) => {
143
+ const s3 = this.getMatchingMark(e3);
144
+ s3 && t2.push(this.renderOpeningTag(s3.tag));
145
145
  });
146
- const r2 = this.getMatchingNode(t2);
147
- return r2 && r2.tag && e2.push(this.renderOpeningTag(r2.tag)), t2.content ? t2.content.forEach((t3) => {
148
- e2.push(this.renderNode(t3));
149
- }) : t2.text ? e2.push(function(t3) {
150
- const e3 = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, r3 = /[&<>"']/g, s2 = RegExp(r3.source);
151
- return t3 && s2.test(t3) ? t3.replace(r3, (t4) => e3[t4]) : t3;
152
- }(t2.text)) : r2 && r2.singleTag ? e2.push(this.renderTag(r2.singleTag, " /")) : r2 && r2.html && e2.push(r2.html), r2 && r2.tag && e2.push(this.renderClosingTag(r2.tag)), t2.marks && t2.marks.slice(0).reverse().forEach((t3) => {
153
- const r3 = this.getMatchingMark(t3);
154
- r3 && e2.push(this.renderClosingTag(r3.tag));
155
- }), e2.join("");
156
- }
157
- renderTag(t2, e2) {
158
- if (t2.constructor === String)
159
- return `<${t2}${e2}>`;
160
- return t2.map((t3) => {
161
- if (t3.constructor === String)
162
- return `<${t3}${e2}>`;
146
+ const s2 = this.getMatchingNode(e2);
147
+ return s2 && s2.tag && t2.push(this.renderOpeningTag(s2.tag)), e2.content ? e2.content.forEach((e3) => {
148
+ t2.push(this.renderNode(e3));
149
+ }) : e2.text ? t2.push(function(e3) {
150
+ const t3 = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, s3 = /[&<>"']/g, r2 = RegExp(s3.source);
151
+ return e3 && r2.test(e3) ? e3.replace(s3, (e4) => t3[e4]) : e3;
152
+ }(e2.text)) : s2 && s2.singleTag ? t2.push(this.renderTag(s2.singleTag, " /")) : s2 && s2.html && t2.push(s2.html), s2 && s2.tag && t2.push(this.renderClosingTag(s2.tag)), e2.marks && e2.marks.slice(0).reverse().forEach((e3) => {
153
+ const s3 = this.getMatchingMark(e3);
154
+ s3 && t2.push(this.renderClosingTag(s3.tag));
155
+ }), t2.join("");
156
+ }
157
+ renderTag(e2, t2) {
158
+ if (e2.constructor === String)
159
+ return `<${e2}${t2}>`;
160
+ return e2.map((e3) => {
161
+ if (e3.constructor === String)
162
+ return `<${e3}${t2}>`;
163
163
  {
164
- let r2 = "<" + t3.tag;
165
- if (t3.attrs)
166
- for (let e3 in t3.attrs) {
167
- let s2 = t3.attrs[e3];
168
- s2 !== null && (r2 += ` ${e3}="${s2}"`);
164
+ let s2 = `<${e3.tag}`;
165
+ if (e3.attrs)
166
+ for (let t3 in e3.attrs) {
167
+ let r2 = e3.attrs[t3];
168
+ r2 !== null && (s2 += ` ${t3}="${r2}"`);
169
169
  }
170
- return `${r2}${e2}>`;
170
+ return `${s2}${t2}>`;
171
171
  }
172
172
  }).join("");
173
173
  }
174
- renderOpeningTag(t2) {
175
- return this.renderTag(t2, "");
174
+ renderOpeningTag(e2) {
175
+ return this.renderTag(e2, "");
176
176
  }
177
- renderClosingTag(t2) {
178
- if (t2.constructor === String)
179
- return `</${t2}>`;
180
- return t2.slice(0).reverse().map((t3) => t3.constructor === String ? `</${t3}>` : `</${t3.tag}>`).join("");
177
+ renderClosingTag(e2) {
178
+ if (e2.constructor === String)
179
+ return `</${e2}>`;
180
+ return e2.slice(0).reverse().map((e3) => e3.constructor === String ? `</${e3}>` : `</${e3.tag}>`).join("");
181
181
  }
182
- getMatchingNode(t2) {
183
- if (typeof this.nodes[t2.type] == "function")
184
- return this.nodes[t2.type](t2);
182
+ getMatchingNode(e2) {
183
+ if (typeof this.nodes[e2.type] == "function")
184
+ return this.nodes[e2.type](e2);
185
185
  }
186
- getMatchingMark(t2) {
187
- if (typeof this.marks[t2.type] == "function")
188
- return this.marks[t2.type](t2);
186
+ getMatchingMark(e2) {
187
+ if (typeof this.marks[e2.type] == "function")
188
+ return this.marks[e2.type](e2);
189
189
  }
190
190
  }
191
- const o = (t2 = 0, e2 = t2) => {
192
- const r2 = Math.abs(e2 - t2) || 0, s2 = t2 < e2 ? 1 : -1;
193
- return ((t3 = 0, e3) => [...Array(t3)].map(e3))(r2, (e3, r3) => r3 * s2 + t2);
194
- }, a = (t2, e2, r2) => {
195
- const s2 = [];
196
- for (const n2 in t2) {
197
- if (!Object.prototype.hasOwnProperty.call(t2, n2))
191
+ const o = (e2 = 0, t2 = e2) => {
192
+ const s2 = Math.abs(t2 - e2) || 0, r2 = e2 < t2 ? 1 : -1;
193
+ return ((e3 = 0, t3) => [...Array(e3)].map(t3))(s2, (t3, s3) => s3 * r2 + e2);
194
+ }, a = (e2, t2, s2) => {
195
+ const r2 = [];
196
+ for (const i2 in e2) {
197
+ if (!Object.prototype.hasOwnProperty.call(e2, i2))
198
198
  continue;
199
- const i2 = t2[n2], o2 = r2 ? "" : encodeURIComponent(n2);
199
+ const n2 = e2[i2], o2 = s2 ? "" : encodeURIComponent(i2);
200
200
  let l2;
201
- l2 = typeof i2 == "object" ? a(i2, e2 ? e2 + encodeURIComponent("[" + o2 + "]") : o2, Array.isArray(i2)) : (e2 ? e2 + encodeURIComponent("[" + o2 + "]") : o2) + "=" + encodeURIComponent(i2), s2.push(l2);
201
+ l2 = typeof n2 == "object" ? a(n2, t2 ? t2 + encodeURIComponent("[" + o2 + "]") : o2, Array.isArray(n2)) : (t2 ? t2 + encodeURIComponent("[" + o2 + "]") : o2) + "=" + encodeURIComponent(n2), r2.push(l2);
202
202
  }
203
- return s2.join("&");
203
+ return r2.join("&");
204
204
  };
205
205
  let l = {}, c = {};
206
- class StoryblokClient {
207
- constructor(e2, s2) {
208
- if (!s2) {
209
- let t2 = e2.region ? "-" + e2.region : "", r2 = e2.https === false ? "http" : "https";
210
- s2 = e2.oauthToken === void 0 ? `${r2}://api${t2}.storyblok.com/v2` : `${r2}://api${t2}.storyblok.com/v1`;
206
+ class h {
207
+ constructor(t2, r2) {
208
+ if (!r2) {
209
+ let e2 = t2.region ? `-${t2.region}` : "", s2 = t2.https === false ? "http" : "https";
210
+ r2 = t2.oauthToken === void 0 ? `${s2}://api${e2}.storyblok.com/v2` : `${s2}://api${e2}.storyblok.com/v1`;
211
211
  }
212
- let n2 = Object.assign({}, e2.headers), o2 = 5;
213
- e2.oauthToken !== void 0 && (n2.Authorization = e2.oauthToken, o2 = 3), e2.rateLimit !== void 0 && (o2 = e2.rateLimit), this.richTextResolver = new i(e2.richTextSchema), typeof e2.componentResolver == "function" && this.setComponentResolver(e2.componentResolver), this.maxRetries = e2.maxRetries || 5, this.throttle = r(this.throttledRequest, o2, 1e3), this.accessToken = e2.accessToken, this.relations = {}, this.links = {}, this.cache = e2.cache || { clear: "manual" }, this.client = t.create({ baseURL: s2, timeout: e2.timeout || 0, headers: n2, proxy: e2.proxy || false }), e2.responseInterceptor && this.client.interceptors.response.use((t2) => e2.responseInterceptor(t2));
214
- }
215
- setComponentResolver(t2) {
216
- this.richTextResolver.addNode("blok", (e2) => {
217
- let r2 = "";
218
- return e2.attrs.body.forEach((e3) => {
219
- r2 += t2(e3.component, e3);
220
- }), { html: r2 };
212
+ let i2 = Object.assign({}, t2.headers), o2 = 5;
213
+ t2.oauthToken !== void 0 && (i2.Authorization = t2.oauthToken, o2 = 3), t2.rateLimit !== void 0 && (o2 = t2.rateLimit), this.richTextResolver = new n(t2.richTextSchema), typeof t2.componentResolver == "function" && this.setComponentResolver(t2.componentResolver), this.maxRetries = t2.maxRetries || 5, this.throttle = s(this.throttledRequest, o2, 1e3), this.accessToken = t2.accessToken, this.relations = {}, this.links = {}, this.cache = t2.cache || { clear: "manual" }, this.client = e.create({ baseURL: r2, timeout: t2.timeout || 0, headers: i2, proxy: t2.proxy || false }), t2.responseInterceptor && this.client.interceptors.response.use((e2) => t2.responseInterceptor(e2)), this.resolveNestedRelations = t2.resolveNestedRelations || true;
214
+ }
215
+ setComponentResolver(e2) {
216
+ this.richTextResolver.addNode("blok", (t2) => {
217
+ let s2 = "";
218
+ return t2.attrs.body.forEach((t3) => {
219
+ s2 += e2(t3.component, t3);
220
+ }), { html: s2 };
221
221
  });
222
222
  }
223
- parseParams(t2 = {}) {
224
- return t2.version || (t2.version = "published"), t2.token || (t2.token = this.getToken()), t2.cv || (t2.cv = c[t2.token]), Array.isArray(t2.resolve_relations) && (t2.resolve_relations = t2.resolve_relations.join(",")), t2;
223
+ parseParams(e2 = {}) {
224
+ return e2.version || (e2.version = "published"), e2.token || (e2.token = this.getToken()), e2.cv || (e2.cv = c[e2.token]), Array.isArray(e2.resolve_relations) && (e2.resolve_relations = e2.resolve_relations.join(",")), e2;
225
225
  }
226
- factoryParamOptions(t2, e2 = {}) {
227
- return ((t3 = "") => t3.indexOf("/cdn/") > -1)(t2) ? this.parseParams(e2) : e2;
226
+ factoryParamOptions(e2, t2 = {}) {
227
+ return ((e3 = "") => e3.indexOf("/cdn/") > -1)(e2) ? this.parseParams(t2) : t2;
228
228
  }
229
- makeRequest(t2, e2, r2, s2) {
230
- const n2 = this.factoryParamOptions(t2, ((t3 = {}, e3 = 25, r3 = 1) => __spreadProps(__spreadValues2({}, t3), { per_page: e3, page: r3 }))(e2, r2, s2));
231
- return this.cacheResponse(t2, n2);
229
+ makeRequest(e2, t2, s2, r2) {
230
+ const i2 = this.factoryParamOptions(e2, ((e3 = {}, t3 = 25, s3 = 1) => __spreadProps(__spreadValues2({}, e3), { per_page: t3, page: s3 }))(t2, s2, r2));
231
+ return this.cacheResponse(e2, i2);
232
232
  }
233
- get(t2, e2) {
234
- let r2 = "/" + t2;
235
- const s2 = this.factoryParamOptions(r2, e2);
236
- return this.cacheResponse(r2, s2);
233
+ get(e2, t2) {
234
+ let s2 = `/${e2}`;
235
+ const r2 = this.factoryParamOptions(s2, t2);
236
+ return this.cacheResponse(s2, r2);
237
237
  }
238
- async getAll(t2, e2 = {}, r2) {
239
- const s2 = e2.per_page || 25, n2 = "/" + t2, i2 = n2.split("/");
240
- r2 = r2 || i2[i2.length - 1];
241
- const a2 = await this.makeRequest(n2, e2, s2, 1), l2 = Math.ceil(a2.total / s2);
242
- return ((t3 = [], e3) => t3.map(e3).reduce((t4, e4) => [...t4, ...e4], []))([a2, ...await (async (t3 = [], e3) => Promise.all(t3.map(e3)))(o(1, l2), async (t3) => this.makeRequest(n2, e2, s2, t3 + 1))], (t3) => Object.values(t3.data[r2]));
238
+ async getAll(e2, t2 = {}, s2) {
239
+ const r2 = t2.per_page || 25, i2 = `/${e2}`, n2 = i2.split("/");
240
+ s2 = s2 || n2[n2.length - 1];
241
+ const a2 = await this.makeRequest(i2, t2, r2, 1), l2 = Math.ceil(a2.total / r2);
242
+ return ((e3 = [], t3) => e3.map(t3).reduce((e4, t4) => [...e4, ...t4], []))([a2, ...await (async (e3 = [], t3) => Promise.all(e3.map(t3)))(o(1, l2), async (e3) => this.makeRequest(i2, t2, r2, e3 + 1))], (e3) => Object.values(e3.data[s2]));
243
243
  }
244
- post(t2, e2) {
245
- let r2 = "/" + t2;
246
- return this.throttle("post", r2, e2);
244
+ post(e2, t2) {
245
+ let s2 = `/${e2}`;
246
+ return this.throttle("post", s2, t2);
247
247
  }
248
- put(t2, e2) {
249
- let r2 = "/" + t2;
250
- return this.throttle("put", r2, e2);
248
+ put(e2, t2) {
249
+ let s2 = `/${e2}`;
250
+ return this.throttle("put", s2, t2);
251
251
  }
252
- delete(t2, e2) {
253
- let r2 = "/" + t2;
254
- return this.throttle("delete", r2, e2);
252
+ delete(e2, t2) {
253
+ let s2 = `/${e2}`;
254
+ return this.throttle("delete", s2, t2);
255
255
  }
256
- getStories(t2) {
257
- return this.get("cdn/stories", t2);
256
+ getStories(e2) {
257
+ return this.get("cdn/stories", e2);
258
258
  }
259
- getStory(t2, e2) {
260
- return this.get("cdn/stories/" + t2, e2);
259
+ getStory(e2, t2) {
260
+ return this.get(`cdn/stories/${e2}`, t2);
261
261
  }
262
- setToken(t2) {
263
- this.accessToken = t2;
262
+ setToken(e2) {
263
+ this.accessToken = e2;
264
264
  }
265
265
  getToken() {
266
266
  return this.accessToken;
267
267
  }
268
- _cleanCopy(t2) {
269
- return JSON.parse(JSON.stringify(t2));
270
- }
271
- _insertLinks(t2, e2) {
272
- const r2 = t2[e2];
273
- r2 && r2.fieldtype == "multilink" && r2.linktype == "story" && typeof r2.id == "string" && this.links[r2.id] ? r2.story = this._cleanCopy(this.links[r2.id]) : r2 && r2.linktype === "story" && typeof r2.uuid == "string" && this.links[r2.uuid] && (r2.story = this._cleanCopy(this.links[r2.uuid]));
274
- }
275
- _insertRelations(t2, e2, r2) {
276
- if (r2.indexOf(t2.component + "." + e2) > -1) {
277
- if (typeof t2[e2] == "string")
278
- this.relations[t2[e2]] && (t2[e2] = this._cleanCopy(this.relations[t2[e2]]));
279
- else if (t2[e2].constructor === Array) {
280
- let r3 = [];
281
- t2[e2].forEach((t3) => {
282
- this.relations[t3] && r3.push(this._cleanCopy(this.relations[t3]));
283
- }), t2[e2] = r3;
268
+ _cleanCopy(e2) {
269
+ return JSON.parse(JSON.stringify(e2));
270
+ }
271
+ _insertLinks(e2, t2) {
272
+ const s2 = e2[t2];
273
+ s2 && s2.fieldtype == "multilink" && s2.linktype == "story" && typeof s2.id == "string" && this.links[s2.id] ? s2.story = this._cleanCopy(this.links[s2.id]) : s2 && s2.linktype === "story" && typeof s2.uuid == "string" && this.links[s2.uuid] && (s2.story = this._cleanCopy(this.links[s2.uuid]));
274
+ }
275
+ _insertRelations(e2, t2, s2) {
276
+ if (s2.indexOf(e2.component + "." + t2) > -1) {
277
+ if (typeof e2[t2] == "string")
278
+ this.relations[e2[t2]] && (e2[t2] = this._cleanCopy(this.relations[e2[t2]]));
279
+ else if (e2[t2].constructor === Array) {
280
+ let s3 = [];
281
+ e2[t2].forEach((e3) => {
282
+ this.relations[e3] && s3.push(this._cleanCopy(this.relations[e3]));
283
+ }), e2[t2] = s3;
284
284
  }
285
285
  }
286
286
  }
287
- iterateTree(t2, e2) {
288
- let r2 = (t3) => {
289
- if (t3 != null) {
290
- if (t3.constructor === Array)
291
- for (let e3 = 0; e3 < t3.length; e3++)
292
- r2(t3[e3]);
293
- else if (t3.constructor === Object) {
294
- if (t3._stopResolving)
287
+ _insertAssetsRelations(e2, t2) {
288
+ t2.forEach((t3) => {
289
+ e2.id === t3.id && (e2.original = t3, e2.original.filename = e2.filename, e2.original.filename = e2.original.filename.includes("https://s3.amazonaws.com/") ? e2.original.filename : e2.original.filename.replace("https://", "https://s3.amazonaws.com/"), delete e2.original.s3_filename);
290
+ });
291
+ }
292
+ iterateTree(e2, t2) {
293
+ let s2 = (e3) => {
294
+ if (e3 != null) {
295
+ if (e3.constructor === Array)
296
+ for (let t3 = 0; t3 < e3.length; t3++)
297
+ s2(e3[t3]);
298
+ else if (e3.constructor === Object) {
299
+ if (e3._stopResolving)
295
300
  return;
296
- for (let s2 in t3)
297
- (t3.component && t3._uid || t3.type === "link") && (this._insertRelations(t3, s2, e2), this._insertLinks(t3, s2)), r2(t3[s2]);
301
+ for (let r2 in e3)
302
+ e3.component && e3._uid || e3.type === "link" ? (this._insertRelations(e3, r2, t2), this._insertLinks(e3, r2)) : e3.fieldtype === "asset" && this._insertAssetsRelations(e3, t2), s2(e3[r2]);
298
303
  }
299
304
  }
300
305
  };
301
- r2(t2.content);
302
- }
303
- async resolveLinks(t2, e2) {
304
- let r2 = [];
305
- if (t2.link_uuids) {
306
- const s2 = t2.link_uuids.length;
307
- let n2 = [];
308
- const i2 = 50;
309
- for (let e3 = 0; e3 < s2; e3 += i2) {
310
- const r3 = Math.min(s2, e3 + i2);
311
- n2.push(t2.link_uuids.slice(e3, r3));
306
+ s2(e2.content);
307
+ }
308
+ async resolveLinks(e2, t2) {
309
+ let s2 = [];
310
+ if (e2.link_uuids) {
311
+ const r2 = e2.link_uuids.length;
312
+ let i2 = [];
313
+ const n2 = 50;
314
+ for (let t3 = 0; t3 < r2; t3 += n2) {
315
+ const s3 = Math.min(r2, t3 + n2);
316
+ i2.push(e2.link_uuids.slice(t3, s3));
312
317
  }
313
- for (let t3 = 0; t3 < n2.length; t3++) {
314
- (await this.getStories({ per_page: i2, language: e2.language, version: e2.version, by_uuids: n2[t3].join(",") })).data.stories.forEach((t4) => {
315
- r2.push(t4);
318
+ for (let e3 = 0; e3 < i2.length; e3++) {
319
+ (await this.getStories({ per_page: n2, language: t2.language, version: t2.version, by_uuids: i2[e3].join(",") })).data.stories.forEach((e4) => {
320
+ s2.push(e4);
316
321
  });
317
322
  }
318
323
  } else
319
- r2 = t2.links;
320
- r2.forEach((t3) => {
321
- this.links[t3.uuid] = __spreadProps(__spreadValues2({}, t3), { _stopResolving: true });
324
+ s2 = e2.links;
325
+ s2.forEach((e3) => {
326
+ this.links[e3.uuid] = __spreadProps(__spreadValues2({}, e3), { _stopResolving: true });
322
327
  });
323
328
  }
324
- async resolveRelations(t2, e2) {
325
- let r2 = [];
326
- if (t2.rel_uuids) {
327
- const s2 = t2.rel_uuids.length;
328
- let n2 = [];
329
- const i2 = 50;
330
- for (let e3 = 0; e3 < s2; e3 += i2) {
331
- const r3 = Math.min(s2, e3 + i2);
332
- n2.push(t2.rel_uuids.slice(e3, r3));
329
+ async resolveRelations(e2, t2) {
330
+ let s2 = [];
331
+ if (e2.rel_uuids) {
332
+ const r2 = e2.rel_uuids.length;
333
+ let i2 = [];
334
+ const n2 = 50;
335
+ for (let t3 = 0; t3 < r2; t3 += n2) {
336
+ const s3 = Math.min(r2, t3 + n2);
337
+ i2.push(e2.rel_uuids.slice(t3, s3));
333
338
  }
334
- for (let t3 = 0; t3 < n2.length; t3++) {
335
- (await this.getStories({ per_page: i2, language: e2.language, version: e2.version, by_uuids: n2[t3].join(",") })).data.stories.forEach((t4) => {
336
- r2.push(t4);
339
+ for (let e3 = 0; e3 < i2.length; e3++) {
340
+ (await this.getStories({ per_page: n2, language: t2.language, version: t2.version, by_uuids: i2[e3].join(",") })).data.stories.forEach((e4) => {
341
+ s2.push(e4);
337
342
  });
338
343
  }
339
344
  } else
340
- r2 = t2.rels;
341
- r2.forEach((t3) => {
342
- this.relations[t3.uuid] = __spreadProps(__spreadValues2({}, t3), { _stopResolving: true });
345
+ s2 = e2.rels;
346
+ s2.forEach((e3) => {
347
+ this.relations[e3.uuid] = __spreadProps(__spreadValues2({}, e3), { _stopResolving: true });
343
348
  });
344
349
  }
345
- async resolveStories(t2, e2) {
346
- let r2 = [];
347
- e2.resolve_relations !== void 0 && e2.resolve_relations.length > 0 && (r2 = e2.resolve_relations.split(","), await this.resolveRelations(t2, e2)), ["1", "story", "url"].indexOf(e2.resolve_links) > -1 && await this.resolveLinks(t2, e2);
348
- for (const t3 in this.relations)
349
- this.iterateTree(this.relations[t3], r2);
350
- t2.story ? this.iterateTree(t2.story, r2) : t2.stories.forEach((t3) => {
351
- this.iterateTree(t3, r2);
350
+ async resolveStories(e2, t2) {
351
+ let s2 = [];
352
+ if (t2.resolve_relations !== void 0 && t2.resolve_relations.length > 0 && (s2 = t2.resolve_relations.split(","), await this.resolveRelations(e2, t2)), ["1", "story", "url"].indexOf(t2.resolve_links) > -1 && await this.resolveLinks(e2, t2), this.resolveNestedRelations)
353
+ for (const e3 in this.relations)
354
+ this.iterateTree(this.relations[e3], s2);
355
+ e2.story ? this.iterateTree(e2.story, s2) : e2.stories.forEach((e3) => {
356
+ this.iterateTree(e3, s2);
352
357
  });
353
358
  }
354
- cacheResponse(t2, e2, r2) {
355
- return r2 === void 0 && (r2 = 0), new Promise(async (s2, n2) => {
356
- let i2 = a({ url: t2, params: e2 }), o2 = this.cacheProvider();
357
- if (this.cache.clear === "auto" && e2.version === "draft" && await this.flushCache(), e2.version === "published" && t2 != "/cdn/spaces/me") {
358
- const t3 = await o2.get(i2);
359
- if (t3)
360
- return s2(t3);
359
+ resolveAssetsRelations(e2) {
360
+ const { assets: t2, stories: s2, story: r2 } = e2;
361
+ if (s2)
362
+ for (const e3 of s2)
363
+ this.iterateTree(e3, t2);
364
+ else
365
+ this.iterateTree(r2, t2);
366
+ }
367
+ cacheResponse(e2, t2, s2) {
368
+ return s2 === void 0 && (s2 = 0), new Promise(async (r2, i2) => {
369
+ let n2 = a({ url: e2, params: t2 }), o2 = this.cacheProvider();
370
+ if (this.cache.clear === "auto" && t2.version === "draft" && await this.flushCache(), t2.version === "published" && e2 != "/cdn/spaces/me") {
371
+ const e3 = await o2.get(n2);
372
+ if (e3)
373
+ return r2(e3);
361
374
  }
362
375
  try {
363
- let r3 = await this.throttle("get", t2, { params: e2, paramsSerializer: (t3) => a(t3) }), l3 = { data: r3.data, headers: r3.headers };
364
- if (r3.headers["per-page"] && (l3 = Object.assign({}, l3, { perPage: parseInt(r3.headers["per-page"]), total: parseInt(r3.headers.total) })), r3.status != 200)
365
- return n2(r3);
366
- (l3.data.story || l3.data.stories) && await this.resolveStories(l3.data, e2), e2.version === "published" && t2 != "/cdn/spaces/me" && o2.set(i2, l3), l3.data.cv && (e2.version == "draft" && c[e2.token] != l3.data.cv && this.flushCache(), c[e2.token] = l3.data.cv), s2(l3);
367
- } catch (i3) {
368
- if (i3.response && i3.response.status === 429 && (r2 += 1) < this.maxRetries)
369
- return console.log(`Hit rate limit. Retrying in ${r2} seconds.`), await (l2 = 1e3 * r2, new Promise((t3) => setTimeout(t3, l2))), this.cacheResponse(t2, e2, r2).then(s2).catch(n2);
370
- n2(i3);
376
+ let s3 = await this.throttle("get", e2, { params: t2, paramsSerializer: (e3) => a(e3) }), l3 = { data: s3.data, headers: s3.headers };
377
+ if (l3.data.assets && l3.data.assets.length && this.resolveAssetsRelations(l3.data), s3.headers["per-page"] && (l3 = Object.assign({}, l3, { perPage: parseInt(s3.headers["per-page"]), total: parseInt(s3.headers.total) })), s3.status != 200)
378
+ return i2(s3);
379
+ (l3.data.story || l3.data.stories) && await this.resolveStories(l3.data, t2), t2.version === "published" && e2 != "/cdn/spaces/me" && o2.set(n2, l3), l3.data.cv && (t2.version == "draft" && c[t2.token] != l3.data.cv && this.flushCache(), c[t2.token] = l3.data.cv), r2(l3);
380
+ } catch (n3) {
381
+ if (n3.response && n3.response.status === 429 && (s2 += 1) < this.maxRetries)
382
+ return console.log(`Hit rate limit. Retrying in ${s2} seconds.`), await (l2 = 1e3 * s2, new Promise((e3) => setTimeout(e3, l2))), this.cacheResponse(e2, t2, s2).then(r2).catch(i2);
383
+ i2(n3);
371
384
  }
372
385
  var l2;
373
386
  });
374
387
  }
375
- throttledRequest(t2, e2, r2) {
376
- return this.client[t2](e2, r2);
388
+ throttledRequest(e2, t2, s2) {
389
+ return this.client[e2](t2, s2);
377
390
  }
378
391
  cacheVersions() {
379
392
  return c;
@@ -381,24 +394,19 @@ class StoryblokClient {
381
394
  cacheVersion() {
382
395
  return c[this.accessToken];
383
396
  }
384
- setCacheVersion(t2) {
385
- this.accessToken && (c[this.accessToken] = t2);
397
+ setCacheVersion(e2) {
398
+ this.accessToken && (c[this.accessToken] = e2);
386
399
  }
387
400
  cacheProvider() {
388
- switch (this.cache.type) {
389
- case "memory":
390
- return { get: (t2) => l[t2], getAll: () => l, set(t2, e2) {
391
- l[t2] = e2;
392
- }, flush() {
393
- l = {};
394
- } };
395
- default:
396
- return { get() {
397
- }, getAll() {
398
- }, set() {
399
- }, flush() {
400
- } };
401
- }
401
+ return this.cache.type === "memory" ? { get: (e2) => l[e2], getAll: () => l, set(e2, t2) {
402
+ l[e2] = t2;
403
+ }, flush() {
404
+ l = {};
405
+ } } : { get() {
406
+ }, getAll() {
407
+ }, set() {
408
+ }, flush() {
409
+ } };
402
410
  }
403
411
  async flushCache() {
404
412
  return await this.cacheProvider().flush(), this;
@@ -410,7 +418,7 @@ var api = (options = {}) => {
410
418
  console.error("You need to provide an access token to interact with Storyblok API. Read https://www.storyblok.com/docs/api/content-delivery#topics/authentication");
411
419
  return;
412
420
  }
413
- const storyblokApi = new StoryblokClient(apiOptions);
421
+ const storyblokApi = new h(apiOptions);
414
422
  return { storyblokApi };
415
423
  };
416
424
  var editable = (blok) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storyblok/vue",
3
- "version": "6.0.3",
3
+ "version": "6.0.4",
4
4
  "description": "Storyblok directive for get editable elements.",
5
5
  "main": "./dist/storyblok-vue.js",
6
6
  "module": "./dist/storyblok-vue.mjs",
@@ -23,22 +23,22 @@
23
23
  "prepublishOnly": "npm run build && cp ../README.md ./"
24
24
  },
25
25
  "dependencies": {
26
- "@storyblok/js": "^1.1.0"
26
+ "@storyblok/js": "^1.2.0"
27
27
  },
28
28
  "devDependencies": {
29
- "@babel/core": "^7.17.9",
29
+ "@babel/core": "^7.18.5",
30
30
  "@cypress/vite-dev-server": "^2.0.7",
31
- "@cypress/vue": "^3.0.3",
32
- "@vitejs/plugin-vue": "^2.3.1",
31
+ "@cypress/vue": "^3.1.2",
32
+ "@vitejs/plugin-vue": "^2.3.3",
33
33
  "@vue/babel-preset-app": "^5.0.4",
34
34
  "@vue/test-utils": "next",
35
- "babel-jest": "^27.5.1",
36
- "cypress": "^9.5.3",
35
+ "babel-jest": "^28.1.0",
36
+ "cypress": "^9.6.0",
37
37
  "eslint-plugin-cypress": "^2.12.1",
38
- "eslint-plugin-jest": "^26.1.3",
39
- "jest": "^27.5.1",
40
- "vite": "^2.7.10",
41
- "vue": "^3.2.31",
38
+ "eslint-plugin-jest": "^26.1.5",
39
+ "jest": "^28.1.0",
40
+ "vite": "^2.9.9",
41
+ "vue": "^3.2.33",
42
42
  "vue-jest": "next"
43
43
  },
44
44
  "babel": {