@storyblok/svelte 1.0.1 → 2.0.2

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/README.md CHANGED
@@ -65,13 +65,12 @@ storyblokInit({
65
65
  // apiOptions: { },
66
66
  use: [apiPlugin],
67
67
  components: {
68
- // teaser: () => import("./Teaser.svelte"), // Lazy load it on demand
69
68
  teaser: Teaser,
70
69
  },
71
70
  });
72
71
  ```
73
72
 
74
- > Add all your components to the components object in the storyblokInit function. You can either load all of them at the same time by adding them to the list; or you could lazy load them when they are needed by uncommenting the dynamic import line.
73
+ > Add all your components to the components object in the storyblokInit function. You can load all of them at the same time by adding them to the list.
75
74
 
76
75
  Now, all features are enabled for you: the _Api Client_ for interacting with [Storyblok CDN API](https://www.storyblok.com/docs/api/content-delivery/v2?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-svelte), and _Storyblok Bridge_ for [real-time visual editing experience](https://www.storyblok.com/docs/guide/essentials/visual-editor?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-svelte).
77
76
 
@@ -143,8 +142,6 @@ In order to link the storyblok components, you have to
143
142
 
144
143
  - Load them in components when calling `storyblokInit`
145
144
 
146
- > If you would like to use dynamic component loading, make sure to use the `StorybloKComponent`an use dynamic import when adding the components to your list.
147
-
148
145
  - Use the `storyblokEditable` svelte action on the root element of each component
149
146
 
150
147
  ```html
@@ -1,23 +1,13 @@
1
1
  <script>
2
2
  import { getComponent } from "./index";
3
3
  export let blok;
4
- let resolvedComponent;
4
+ let component;
5
5
 
6
6
  if (blok) {
7
- const component = getComponent(blok.component);
8
- if (component) {
9
- const loadComponent = async () => {
10
- const { default: loadedComponent } = await component();
11
- resolvedComponent = loadedComponent;
12
- };
13
-
14
- const isSvelteComponent = component.name.startsWith("Proxy");
15
- if (isSvelteComponent) resolvedComponent = component;
16
- else loadComponent();
17
- }
7
+ component = getComponent(blok.component);
18
8
  } else {
19
9
  console.error("Please provide a 'blok' property to the StoryblokComponent");
20
10
  }
21
11
  </script>
22
12
 
23
- <svelte:component this={resolvedComponent} {blok} {...$$restProps} />
13
+ <svelte:component this={component} {blok} {...$$restProps} />
@@ -1,12 +1,12 @@
1
- (function(f,m){typeof exports=="object"&&typeof module!="undefined"?m(exports,require("axios")):typeof define=="function"&&define.amd?define(["exports","axios"],m):(f=typeof globalThis!="undefined"?globalThis:f||self,m(f.storyblokSvelte={},f.t))})(this,function(f,m){"use strict";function ne(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var re=ne(m),oe=Object.defineProperty,se=Object.defineProperties,ie=Object.getOwnPropertyDescriptors,N=Object.getOwnPropertySymbols,ae=Object.prototype.hasOwnProperty,ce=Object.prototype.propertyIsEnumerable,B=(t,e,n)=>e in t?oe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,p=(t,e)=>{for(var n in e||(e={}))ae.call(e,n)&&B(t,n,e[n]);if(N)for(var n of N(e))ce.call(e,n)&&B(t,n,e[n]);return t},E=(t,e)=>se(t,ie(e));let q=!1;const L=[],le=t=>new Promise((e,n)=>{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}q?o():L.push(o)},document.getElementById("storyblok-javascript-bridge")))return;const r=document.createElement("script");r.async=!0,r.src=t,r.id="storyblok-javascript-bridge",r.onerror=o=>n(o),r.onload=o=>{L.forEach(s=>s()),q=!0,e(o)},document.getElementsByTagName("head")[0].appendChild(r)});/*!
1
+ (function(f,y){typeof exports=="object"&&typeof module!="undefined"?y(exports,require("axios")):typeof define=="function"&&define.amd?define(["exports","axios"],y):(f=typeof globalThis!="undefined"?globalThis:f||self,y(f.storyblokSvelte={},f.t))})(this,function(f,y){"use strict";function ne(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var re=ne(y),oe=Object.defineProperty,se=Object.defineProperties,ie=Object.getOwnPropertyDescriptors,N=Object.getOwnPropertySymbols,ae=Object.prototype.hasOwnProperty,ce=Object.prototype.propertyIsEnumerable,B=(t,e,n)=>e in t?oe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,p=(t,e)=>{for(var n in e||(e={}))ae.call(e,n)&&B(t,n,e[n]);if(N)for(var n of N(e))ce.call(e,n)&&B(t,n,e[n]);return t},E=(t,e)=>se(t,ie(e));let q=!1;const L=[],le=t=>new Promise((e,n)=>{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}q?o():L.push(o)},document.getElementById("storyblok-javascript-bridge")))return;const r=document.createElement("script");r.async=!0,r.src=t,r.id="storyblok-javascript-bridge",r.onerror=o=>n(o),r.onload=o=>{L.forEach(s=>s()),q=!0,e(o)},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 D(t){return typeof t=="number"&&t==t&&t!==1/0&&t!==-1/0}function U(t,e,n){if(!D(e))throw new TypeError("Expected `limit` to be a finite number");if(!D(n))throw new TypeError("Expected `interval` to be a finite number");var r=[],o=[],s=0,a=function(){s++;var c=setTimeout(function(){s--,r.length>0&&a(),o=o.filter(function(u){return u!==c})},n);o.indexOf(c)<0&&o.push(c);var l=r.shift();l.resolve(t.apply(l.self,l.args))},i=function(){var c=arguments,l=this;return new Promise(function(u,d){r.push({resolve:u,reject:d,args:c,self:l}),s<e&&a()})};return i.abort=function(){o.forEach(clearTimeout),o=[],r.forEach(function(c){c.reject(new throttle.AbortError)}),r.length=0},i}U.AbortError=function(){Error.call(this,"Throttled function aborted"),this.name="AbortError"};const ue=function(t,e){if(!t)return null;let n={};for(let r in t){let o=t[r];e.indexOf(r)>-1&&o!==null&&(n[r]=o)}return n};var fe={nodes:{horizontal_rule:t=>({singleTag:"hr"}),blockquote:t=>({tag:"blockquote"}),bullet_list:t=>({tag:"ul"}),code_block:t=>({tag:["pre",{tag:"code",attrs:t.attrs}]}),hard_break:t=>({singleTag:"br"}),heading:t=>({tag:"h"+t.attrs.level}),image:t=>({singleTag:[{tag:"img",attrs:ue(t.attrs,["src","alt","title"])}]}),list_item:t=>({tag:"li"}),ordered_list:t=>({tag:"ol"}),paragraph:t=>({tag:"p"})},marks:{bold:()=>({tag:"b"}),strike:()=>({tag:"strike"}),underline:()=>({tag:"u"}),strong:()=>({tag:"strong"}),code:()=>({tag:"code"}),italic:()=>({tag:"i"}),link(t){const e=p({},t.attrs),{linktype:n="url"}=t.attrs;return n==="email"&&(e.href="mailto:"+e.href),e.anchor&&(e.href=`${e.href}#${e.anchor}`,delete e.anchor),{tag:[{tag:"a",attrs:e}]}},styled:t=>({tag:[{tag:"span",attrs:t.attrs}]})}};class de{constructor(e){e||(e=fe),this.marks=e.marks||[],this.nodes=e.nodes||[]}addNode(e,n){this.nodes[e]=n}addMark(e,n){this.marks[e]=n}render(e={}){if(e.content&&Array.isArray(e.content)){let n="";return e.content.forEach(r=>{n+=this.renderNode(r)}),n}return console.warn("The render method must receive an object with a content field, which is an array"),""}renderNode(e){let n=[];e.marks&&e.marks.forEach(o=>{const s=this.getMatchingMark(o);s&&n.push(this.renderOpeningTag(s.tag))});const r=this.getMatchingNode(e);return r&&r.tag&&n.push(this.renderOpeningTag(r.tag)),e.content?e.content.forEach(o=>{n.push(this.renderNode(o))}):e.text?n.push(function(o){const s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},a=/[&<>"']/g,i=RegExp(a.source);return o&&i.test(o)?o.replace(a,c=>s[c]):o}(e.text)):r&&r.singleTag?n.push(this.renderTag(r.singleTag," /")):r&&r.html&&n.push(r.html),r&&r.tag&&n.push(this.renderClosingTag(r.tag)),e.marks&&e.marks.slice(0).reverse().forEach(o=>{const s=this.getMatchingMark(o);s&&n.push(this.renderClosingTag(s.tag))}),n.join("")}renderTag(e,n){return e.constructor===String?`<${e}${n}>`:e.map(r=>{if(r.constructor===String)return`<${r}${n}>`;{let o="<"+r.tag;if(r.attrs)for(let s in r.attrs){let a=r.attrs[s];a!==null&&(o+=` ${s}="${a}"`)}return`${o}${n}>`}}).join("")}renderOpeningTag(e){return this.renderTag(e,"")}renderClosingTag(e){return e.constructor===String?`</${e}>`:e.slice(0).reverse().map(n=>n.constructor===String?`</${n}>`:`</${n.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 he=(t=0,e=t)=>{const n=Math.abs(e-t)||0,r=t<e?1:-1;return((o=0,s)=>[...Array(o)].map(s))(n,(o,s)=>s*r+t)},O=(t,e,n)=>{const r=[];for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o))continue;const s=t[o],a=n?"":encodeURIComponent(o);let i;i=typeof s=="object"?O(s,e?e+encodeURIComponent("["+a+"]"):a,Array.isArray(s)):(e?e+encodeURIComponent("["+a+"]"):a)+"="+encodeURIComponent(s),r.push(i)}return r.join("&")};let b={},g={};class pe{constructor(e,n){if(!n){let s=e.region?"-"+e.region:"",a=e.https===!1?"http":"https";n=e.oauthToken===void 0?`${a}://api${s}.storyblok.com/v2`:`${a}://api${s}.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 de(e.richTextSchema),typeof e.componentResolver=="function"&&this.setComponentResolver(e.componentResolver),this.maxRetries=e.maxRetries||5,this.throttle=U(this.throttledRequest,o,1e3),this.accessToken=e.accessToken,this.relations={},this.links={},this.cache=e.cache||{clear:"manual"},this.client=re.default.create({baseURL:n,timeout:e.timeout||0,headers:r,proxy:e.proxy||!1}),e.responseInterceptor&&this.client.interceptors.response.use(s=>e.responseInterceptor(s))}setComponentResolver(e){this.richTextResolver.addNode("blok",n=>{let r="";return n.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,n={}){return((r="")=>r.indexOf("/cdn/")>-1)(e)?this.parseParams(n):n}makeRequest(e,n,r,o){const s=this.factoryParamOptions(e,((a={},i=25,c=1)=>E(p({},a),{per_page:i,page:c}))(n,r,o));return this.cacheResponse(e,s)}get(e,n){let r="/"+e;const o=this.factoryParamOptions(r,n);return this.cacheResponse(r,o)}async getAll(e,n={},r){const o=n.per_page||25,s="/"+e,a=s.split("/");r=r||a[a.length-1];const i=await this.makeRequest(s,n,o,1),c=Math.ceil(i.total/o);return((l=[],u)=>l.map(u).reduce((d,$)=>[...d,...$],[]))([i,...await(async(l=[],u)=>Promise.all(l.map(u)))(he(1,c),async l=>this.makeRequest(s,n,o,l+1))],l=>Object.values(l.data[r]))}post(e,n){let r="/"+e;return this.throttle("post",r,n)}put(e,n){let r="/"+e;return this.throttle("put",r,n)}delete(e,n){let r="/"+e;return this.throttle("delete",r,n)}getStories(e){return this.get("cdn/stories",e)}getStory(e,n){return this.get("cdn/stories/"+e,n)}setToken(e){this.accessToken=e}getToken(){return this.accessToken}_cleanCopy(e){return JSON.parse(JSON.stringify(e))}_insertLinks(e,n){const r=e[n];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,n,r){if(r.indexOf(e.component+"."+n)>-1){if(typeof e[n]=="string")this.relations[e[n]]&&(e[n]=this._cleanCopy(this.relations[e[n]]));else if(e[n].constructor===Array){let o=[];e[n].forEach(s=>{this.relations[s]&&o.push(this._cleanCopy(this.relations[s]))}),e[n]=o}}}iterateTree(e,n){let r=o=>{if(o!=null){if(o.constructor===Array)for(let s=0;s<o.length;s++)r(o[s]);else if(o.constructor===Object){if(o._stopResolving)return;for(let s in o)(o.component&&o._uid||o.type==="link")&&(this._insertRelations(o,s,n),this._insertLinks(o,s)),r(o[s])}}};r(e.content)}async resolveLinks(e,n){let r=[];if(e.link_uuids){const o=e.link_uuids.length;let s=[];const a=50;for(let i=0;i<o;i+=a){const c=Math.min(o,i+a);s.push(e.link_uuids.slice(i,c))}for(let i=0;i<s.length;i++)(await this.getStories({per_page:a,language:n.language,version:n.version,by_uuids:s[i].join(",")})).data.stories.forEach(c=>{r.push(c)})}else r=e.links;r.forEach(o=>{this.links[o.uuid]=E(p({},o),{_stopResolving:!0})})}async resolveRelations(e,n){let r=[];if(e.rel_uuids){const o=e.rel_uuids.length;let s=[];const a=50;for(let i=0;i<o;i+=a){const c=Math.min(o,i+a);s.push(e.rel_uuids.slice(i,c))}for(let i=0;i<s.length;i++)(await this.getStories({per_page:a,language:n.language,version:n.version,by_uuids:s[i].join(",")})).data.stories.forEach(c=>{r.push(c)})}else r=e.rels;r.forEach(o=>{this.relations[o.uuid]=E(p({},o),{_stopResolving:!0})})}async resolveStories(e,n){let r=[];n.resolve_relations!==void 0&&n.resolve_relations.length>0&&(r=n.resolve_relations.split(","),await this.resolveRelations(e,n)),["1","story","url"].indexOf(n.resolve_links)>-1&&await this.resolveLinks(e,n);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,n,r){return r===void 0&&(r=0),new Promise(async(o,s)=>{let a=O({url:e,params:n}),i=this.cacheProvider();if(this.cache.clear==="auto"&&n.version==="draft"&&await this.flushCache(),n.version==="published"&&e!="/cdn/spaces/me"){const l=await i.get(a);if(l)return o(l)}try{let l=await this.throttle("get",e,{params:n,paramsSerializer:d=>O(d)}),u={data:l.data,headers:l.headers};if(l.headers["per-page"]&&(u=Object.assign({},u,{perPage:parseInt(l.headers["per-page"]),total:parseInt(l.headers.total)})),l.status!=200)return s(l);(u.data.story||u.data.stories)&&await this.resolveStories(u.data,n),n.version==="published"&&e!="/cdn/spaces/me"&&i.set(a,u),u.data.cv&&(n.version=="draft"&&g[n.token]!=u.data.cv&&this.flushCache(),g[n.token]=u.data.cv),o(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(e,n,r).then(o).catch(s);s(l)}var c})}throttledRequest(e,n,r){return this.client[e](n,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=>b[e],getAll:()=>b,set(e,n){b[e]=n},flush(){b={}}};default:return{get(){},getAll(){},set(){},flush(){}}}}async flushCache(){return await this.cacheProvider().flush(),this}}var ge=(t={})=>{const{apiOptions:e}=t;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 pe(e)}},me=t=>{if(typeof t!="object"||typeof t._editable=="undefined")return{};const e=JSON.parse(t._editable.replace(/^<!--#storyblok#/,"").replace(/-->$/,""));return{"data-blok-c":JSON.stringify(e),"data-blok-uid":e.id+"-"+e.uid}};const ye=(t,e,n={})=>{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}window.storyblokRegisterEvent(()=>{new window.StoryblokBridge(n).on(["input","published","change"],o=>{o.action=="input"&&o.story.id===t?e(o.story):window.location.reload()})})}},_e=(t={})=>{const{bridge:e,accessToken:n,use:r=[],apiOptions:o={}}=t;o.accessToken=o.accessToken||n;const s={bridge:e,apiOptions:o};let a={};return r.forEach(i=>{a=p(p({},a),i(s))}),e!==!1&&le("https://app.storyblok.com/f/storyblok-v2-latest.js"),a};function V(){}function S(t,e){for(const n in e)t[n]=e[n];return t}function J(t){return t()}function Y(){return Object.create(null)}function y(t){t.forEach(J)}function ke(t){return typeof t=="function"}function be(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function ve(t){return Object.keys(t).length===0}function we(t){const e={};for(const n in t)n[0]!=="$"&&(e[n]=t[n]);return e}function z(t,e){const n={};e=new Set(e);for(const r in t)!e.has(r)&&r[0]!=="$"&&(n[r]=t[r]);return n}function Te(t,e,n){t.insertBefore(e,n||null)}function F(t){t.parentNode.removeChild(t)}function $e(t){return document.createTextNode(t)}function Ee(){return $e("")}function Oe(t){return Array.from(t.childNodes)}let P;function _(t){P=t}const k=[],H=[],v=[],W=[],Se=Promise.resolve();let R=!1;function Pe(){R||(R=!0,Se.then(G))}function j(t){v.push(t)}const x=new Set;let w=0;function G(){const t=P;do{for(;w<k.length;){const e=k[w];w++,_(e),Re(e.$$)}for(_(null),k.length=0,w=0;H.length;)H.pop()();for(let e=0;e<v.length;e+=1){const n=v[e];x.has(n)||(x.add(n),n())}v.length=0}while(k.length);for(;W.length;)W.pop()();R=!1,x.clear(),_(t)}function Re(t){if(t.fragment!==null){t.update(),y(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(j)}}const T=new Set;let h;function je(){h={r:0,c:[],p:h}}function xe(){h.r||y(h.c),h=h.p}function C(t,e){t&&t.i&&(T.delete(t),t.i(e))}function K(t,e,n,r){if(t&&t.o){if(T.has(t))return;T.add(t),h.c.push(()=>{T.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}}function Ce(t,e){const n={},r={},o={$$scope:1};let s=t.length;for(;s--;){const a=t[s],i=e[s];if(i){for(const c in a)c in i||(r[c]=1);for(const c in i)o[c]||(n[c]=i[c],o[c]=1);t[s]=i}else for(const c in a)o[c]=1}for(const a in r)a in n||(n[a]=void 0);return n}function Ae(t){return typeof t=="object"&&t!==null?t:{}}function Q(t){t&&t.c()}function A(t,e,n,r){const{fragment:o,on_mount:s,on_destroy:a,after_update:i}=t.$$;o&&o.m(e,n),r||j(()=>{const c=s.map(J).filter(ke);a?a.push(...c):y(c),t.$$.on_mount=[]}),i.forEach(j)}function I(t,e){const n=t.$$;n.fragment!==null&&(y(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Ie(t,e){t.$$.dirty[0]===-1&&(k.push(t),Pe(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function Me(t,e,n,r,o,s,a,i=[-1]){const c=P;_(t);const l=t.$$={fragment:null,ctx:null,props:s,update:V,not_equal:o,bound:Y(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Y(),dirty:i,skip_bound:!1,root:e.target||c.$$.root};a&&a(l.root);let u=!1;if(l.ctx=n?n(t,e.props||{},(d,$,...ee)=>{const te=ee.length?ee[0]:$;return l.ctx&&o(l.ctx[d],l.ctx[d]=te)&&(!l.skip_bound&&l.bound[d]&&l.bound[d](te),u&&Ie(t,d)),$}):[],l.update(),u=!0,y(l.before_update),l.fragment=r?r(l.ctx):!1,e.target){if(e.hydrate){const d=Oe(e.target);l.fragment&&l.fragment.l(d),d.forEach(F)}else l.fragment&&l.fragment.c();e.intro&&C(t.$$.fragment),A(t,e.target,e.anchor,e.customElement),G()}_(c)}class Ne{$destroy(){I(this,1),this.$destroy=V}$on(e,n){const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{const o=r.indexOf(n);o!==-1&&r.splice(o,1)}}$set(e){this.$$set&&!ve(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function Be(t){let e,n,r;const o=[{blok:t[0]},t[2]];var s=t[1];function a(i){let c={};for(let l=0;l<o.length;l+=1)c=S(c,o[l]);return{props:c}}return s&&(e=new s(a())),{c(){e&&Q(e.$$.fragment),n=Ee()},m(i,c){e&&A(e,i,c),Te(i,n,c),r=!0},p(i,[c]){const l=c&5?Ce(o,[c&1&&{blok:i[0]},c&4&&Ae(i[2])]):{};if(s!==(s=i[1])){if(e){je();const u=e;K(u.$$.fragment,1,0,()=>{I(u,1)}),xe()}s?(e=new s(a()),Q(e.$$.fragment),C(e.$$.fragment,1),A(e,n.parentNode,n)):e=null}else s&&e.$set(l)},i(i){r||(e&&C(e.$$.fragment,i),r=!0)},o(i){e&&K(e.$$.fragment,i),r=!1},d(i){i&&F(n),e&&I(e,i)}}}function qe(t,e,n){const r=["blok"];let o=z(e,r),{blok:s}=e,a;if(s){const i=Z(s.component);if(i){const c=async()=>{const{default:u}=await i();n(1,a=u)};i.name.startsWith("Proxy")?a=i:c()}}else console.error("Please provide a 'blok' property to the StoryblokComponent");return t.$$set=i=>{e=S(S({},e),we(i)),n(2,o=z(e,r)),"blok"in i&&n(0,s=i.blok)},[s,a,o]}class Le extends Ne{constructor(e){super();Me(this,e,qe,Be,be,{blok:0})}}const De=(t,e)=>{const n=r=>{const o=me(r);o["data-blok-c"]&&(t.setAttribute("data-blok-c",o["data-blok-c"]),t.setAttribute("data-blok-uid",o["data-blok-uid"]),t.classList.add("storyblok__outline"))};return n(e),{update(r){n(r)}}};let M=null;const Ue=()=>(M||console.log("You can't use useStoryblokApi if you're not loading apiPlugin."),M);let X=null;const Ve=t=>{const{storyblokApi:e}=_e(t);M=e,X=t.components||{}},Z=t=>{const e=X[t];return e||console.error(`You didn't load the ${t} component. Please load it in storyblokInit. For example:
5
+ */function D(t){return typeof t=="number"&&t==t&&t!==1/0&&t!==-1/0}function U(t,e,n){if(!D(e))throw new TypeError("Expected `limit` to be a finite number");if(!D(n))throw new TypeError("Expected `interval` to be a finite number");var r=[],o=[],s=0,a=function(){s++;var c=setTimeout(function(){s--,r.length>0&&a(),o=o.filter(function(u){return u!==c})},n);o.indexOf(c)<0&&o.push(c);var l=r.shift();l.resolve(t.apply(l.self,l.args))},i=function(){var c=arguments,l=this;return new Promise(function(u,d){r.push({resolve:u,reject:d,args:c,self:l}),s<e&&a()})};return i.abort=function(){o.forEach(clearTimeout),o=[],r.forEach(function(c){c.reject(new throttle.AbortError)}),r.length=0},i}U.AbortError=function(){Error.call(this,"Throttled function aborted"),this.name="AbortError"};const ue=function(t,e){if(!t)return null;let n={};for(let r in t){let o=t[r];e.indexOf(r)>-1&&o!==null&&(n[r]=o)}return n};var fe={nodes:{horizontal_rule:t=>({singleTag:"hr"}),blockquote:t=>({tag:"blockquote"}),bullet_list:t=>({tag:"ul"}),code_block:t=>({tag:["pre",{tag:"code",attrs:t.attrs}]}),hard_break:t=>({singleTag:"br"}),heading:t=>({tag:"h"+t.attrs.level}),image:t=>({singleTag:[{tag:"img",attrs:ue(t.attrs,["src","alt","title"])}]}),list_item:t=>({tag:"li"}),ordered_list:t=>({tag:"ol"}),paragraph:t=>({tag:"p"})},marks:{bold:()=>({tag:"b"}),strike:()=>({tag:"strike"}),underline:()=>({tag:"u"}),strong:()=>({tag:"strong"}),code:()=>({tag:"code"}),italic:()=>({tag:"i"}),link(t){const e=p({},t.attrs),{linktype:n="url"}=t.attrs;return n==="email"&&(e.href="mailto:"+e.href),e.anchor&&(e.href=`${e.href}#${e.anchor}`,delete e.anchor),{tag:[{tag:"a",attrs:e}]}},styled:t=>({tag:[{tag:"span",attrs:t.attrs}]})}};class de{constructor(e){e||(e=fe),this.marks=e.marks||[],this.nodes=e.nodes||[]}addNode(e,n){this.nodes[e]=n}addMark(e,n){this.marks[e]=n}render(e={}){if(e.content&&Array.isArray(e.content)){let n="";return e.content.forEach(r=>{n+=this.renderNode(r)}),n}return console.warn("The render method must receive an object with a content field, which is an array"),""}renderNode(e){let n=[];e.marks&&e.marks.forEach(o=>{const s=this.getMatchingMark(o);s&&n.push(this.renderOpeningTag(s.tag))});const r=this.getMatchingNode(e);return r&&r.tag&&n.push(this.renderOpeningTag(r.tag)),e.content?e.content.forEach(o=>{n.push(this.renderNode(o))}):e.text?n.push(function(o){const s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},a=/[&<>"']/g,i=RegExp(a.source);return o&&i.test(o)?o.replace(a,c=>s[c]):o}(e.text)):r&&r.singleTag?n.push(this.renderTag(r.singleTag," /")):r&&r.html&&n.push(r.html),r&&r.tag&&n.push(this.renderClosingTag(r.tag)),e.marks&&e.marks.slice(0).reverse().forEach(o=>{const s=this.getMatchingMark(o);s&&n.push(this.renderClosingTag(s.tag))}),n.join("")}renderTag(e,n){return e.constructor===String?`<${e}${n}>`:e.map(r=>{if(r.constructor===String)return`<${r}${n}>`;{let o="<"+r.tag;if(r.attrs)for(let s in r.attrs){let a=r.attrs[s];a!==null&&(o+=` ${s}="${a}"`)}return`${o}${n}>`}}).join("")}renderOpeningTag(e){return this.renderTag(e,"")}renderClosingTag(e){return e.constructor===String?`</${e}>`:e.slice(0).reverse().map(n=>n.constructor===String?`</${n}>`:`</${n.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 he=(t=0,e=t)=>{const n=Math.abs(e-t)||0,r=t<e?1:-1;return((o=0,s)=>[...Array(o)].map(s))(n,(o,s)=>s*r+t)},O=(t,e,n)=>{const r=[];for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o))continue;const s=t[o],a=n?"":encodeURIComponent(o);let i;i=typeof s=="object"?O(s,e?e+encodeURIComponent("["+a+"]"):a,Array.isArray(s)):(e?e+encodeURIComponent("["+a+"]"):a)+"="+encodeURIComponent(s),r.push(i)}return r.join("&")};let b={},g={};class pe{constructor(e,n){if(!n){let s=e.region?"-"+e.region:"",a=e.https===!1?"http":"https";n=e.oauthToken===void 0?`${a}://api${s}.storyblok.com/v2`:`${a}://api${s}.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 de(e.richTextSchema),typeof e.componentResolver=="function"&&this.setComponentResolver(e.componentResolver),this.maxRetries=e.maxRetries||5,this.throttle=U(this.throttledRequest,o,1e3),this.accessToken=e.accessToken,this.relations={},this.links={},this.cache=e.cache||{clear:"manual"},this.client=re.default.create({baseURL:n,timeout:e.timeout||0,headers:r,proxy:e.proxy||!1}),e.responseInterceptor&&this.client.interceptors.response.use(s=>e.responseInterceptor(s))}setComponentResolver(e){this.richTextResolver.addNode("blok",n=>{let r="";return n.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,n={}){return((r="")=>r.indexOf("/cdn/")>-1)(e)?this.parseParams(n):n}makeRequest(e,n,r,o){const s=this.factoryParamOptions(e,((a={},i=25,c=1)=>E(p({},a),{per_page:i,page:c}))(n,r,o));return this.cacheResponse(e,s)}get(e,n){let r="/"+e;const o=this.factoryParamOptions(r,n);return this.cacheResponse(r,o)}async getAll(e,n={},r){const o=n.per_page||25,s="/"+e,a=s.split("/");r=r||a[a.length-1];const i=await this.makeRequest(s,n,o,1),c=Math.ceil(i.total/o);return((l=[],u)=>l.map(u).reduce((d,$)=>[...d,...$],[]))([i,...await(async(l=[],u)=>Promise.all(l.map(u)))(he(1,c),async l=>this.makeRequest(s,n,o,l+1))],l=>Object.values(l.data[r]))}post(e,n){let r="/"+e;return this.throttle("post",r,n)}put(e,n){let r="/"+e;return this.throttle("put",r,n)}delete(e,n){let r="/"+e;return this.throttle("delete",r,n)}getStories(e){return this.get("cdn/stories",e)}getStory(e,n){return this.get("cdn/stories/"+e,n)}setToken(e){this.accessToken=e}getToken(){return this.accessToken}_cleanCopy(e){return JSON.parse(JSON.stringify(e))}_insertLinks(e,n){const r=e[n];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,n,r){if(r.indexOf(e.component+"."+n)>-1){if(typeof e[n]=="string")this.relations[e[n]]&&(e[n]=this._cleanCopy(this.relations[e[n]]));else if(e[n].constructor===Array){let o=[];e[n].forEach(s=>{this.relations[s]&&o.push(this._cleanCopy(this.relations[s]))}),e[n]=o}}}iterateTree(e,n){let r=o=>{if(o!=null){if(o.constructor===Array)for(let s=0;s<o.length;s++)r(o[s]);else if(o.constructor===Object){if(o._stopResolving)return;for(let s in o)(o.component&&o._uid||o.type==="link")&&(this._insertRelations(o,s,n),this._insertLinks(o,s)),r(o[s])}}};r(e.content)}async resolveLinks(e,n){let r=[];if(e.link_uuids){const o=e.link_uuids.length;let s=[];const a=50;for(let i=0;i<o;i+=a){const c=Math.min(o,i+a);s.push(e.link_uuids.slice(i,c))}for(let i=0;i<s.length;i++)(await this.getStories({per_page:a,language:n.language,version:n.version,by_uuids:s[i].join(",")})).data.stories.forEach(c=>{r.push(c)})}else r=e.links;r.forEach(o=>{this.links[o.uuid]=E(p({},o),{_stopResolving:!0})})}async resolveRelations(e,n){let r=[];if(e.rel_uuids){const o=e.rel_uuids.length;let s=[];const a=50;for(let i=0;i<o;i+=a){const c=Math.min(o,i+a);s.push(e.rel_uuids.slice(i,c))}for(let i=0;i<s.length;i++)(await this.getStories({per_page:a,language:n.language,version:n.version,by_uuids:s[i].join(",")})).data.stories.forEach(c=>{r.push(c)})}else r=e.rels;r.forEach(o=>{this.relations[o.uuid]=E(p({},o),{_stopResolving:!0})})}async resolveStories(e,n){let r=[];n.resolve_relations!==void 0&&n.resolve_relations.length>0&&(r=n.resolve_relations.split(","),await this.resolveRelations(e,n)),["1","story","url"].indexOf(n.resolve_links)>-1&&await this.resolveLinks(e,n);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,n,r){return r===void 0&&(r=0),new Promise(async(o,s)=>{let a=O({url:e,params:n}),i=this.cacheProvider();if(this.cache.clear==="auto"&&n.version==="draft"&&await this.flushCache(),n.version==="published"&&e!="/cdn/spaces/me"){const l=await i.get(a);if(l)return o(l)}try{let l=await this.throttle("get",e,{params:n,paramsSerializer:d=>O(d)}),u={data:l.data,headers:l.headers};if(l.headers["per-page"]&&(u=Object.assign({},u,{perPage:parseInt(l.headers["per-page"]),total:parseInt(l.headers.total)})),l.status!=200)return s(l);(u.data.story||u.data.stories)&&await this.resolveStories(u.data,n),n.version==="published"&&e!="/cdn/spaces/me"&&i.set(a,u),u.data.cv&&(n.version=="draft"&&g[n.token]!=u.data.cv&&this.flushCache(),g[n.token]=u.data.cv),o(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(e,n,r).then(o).catch(s);s(l)}var c})}throttledRequest(e,n,r){return this.client[e](n,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=>b[e],getAll:()=>b,set(e,n){b[e]=n},flush(){b={}}};default:return{get(){},getAll(){},set(){},flush(){}}}}async flushCache(){return await this.cacheProvider().flush(),this}}var ge=(t={})=>{const{apiOptions:e}=t;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 pe(e)}},ye=t=>{if(typeof t!="object"||typeof t._editable=="undefined")return{};const e=JSON.parse(t._editable.replace(/^<!--#storyblok#/,"").replace(/-->$/,""));return{"data-blok-c":JSON.stringify(e),"data-blok-uid":e.id+"-"+e.uid}};const me=(t,e,n={})=>{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}window.storyblokRegisterEvent(()=>{new window.StoryblokBridge(n).on(["input","published","change"],o=>{o.action=="input"&&o.story.id===t?e(o.story):window.location.reload()})})}},_e=(t={})=>{const{bridge:e,accessToken:n,use:r=[],apiOptions:o={}}=t;o.accessToken=o.accessToken||n;const s={bridge:e,apiOptions:o};let a={};return r.forEach(i=>{a=p(p({},a),i(s))}),e!==!1&&le("https://app.storyblok.com/f/storyblok-v2-latest.js"),a};function V(){}function R(t,e){for(const n in e)t[n]=e[n];return t}function J(t){return t()}function Y(){return Object.create(null)}function m(t){t.forEach(J)}function ke(t){return typeof t=="function"}function be(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function ve(t){return Object.keys(t).length===0}function we(t){const e={};for(const n in t)n[0]!=="$"&&(e[n]=t[n]);return e}function z(t,e){const n={};e=new Set(e);for(const r in t)!e.has(r)&&r[0]!=="$"&&(n[r]=t[r]);return n}function Te(t,e,n){t.insertBefore(e,n||null)}function F(t){t.parentNode.removeChild(t)}function $e(t){return document.createTextNode(t)}function Ee(){return $e("")}function Oe(t){return Array.from(t.childNodes)}let S;function _(t){S=t}const k=[],H=[],v=[],G=[],Re=Promise.resolve();let P=!1;function Se(){P||(P=!0,Re.then(K))}function j(t){v.push(t)}const x=new Set;let w=0;function K(){const t=S;do{for(;w<k.length;){const e=k[w];w++,_(e),Pe(e.$$)}for(_(null),k.length=0,w=0;H.length;)H.pop()();for(let e=0;e<v.length;e+=1){const n=v[e];x.has(n)||(x.add(n),n())}v.length=0}while(k.length);for(;G.length;)G.pop()();P=!1,x.clear(),_(t)}function Pe(t){if(t.fragment!==null){t.update(),m(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(j)}}const T=new Set;let h;function je(){h={r:0,c:[],p:h}}function xe(){h.r||m(h.c),h=h.p}function A(t,e){t&&t.i&&(T.delete(t),t.i(e))}function Q(t,e,n,r){if(t&&t.o){if(T.has(t))return;T.add(t),h.c.push(()=>{T.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}}function Ae(t,e){const n={},r={},o={$$scope:1};let s=t.length;for(;s--;){const a=t[s],i=e[s];if(i){for(const c in a)c in i||(r[c]=1);for(const c in i)o[c]||(n[c]=i[c],o[c]=1);t[s]=i}else for(const c in a)o[c]=1}for(const a in r)a in n||(n[a]=void 0);return n}function Ce(t){return typeof t=="object"&&t!==null?t:{}}function W(t){t&&t.c()}function C(t,e,n,r){const{fragment:o,on_mount:s,on_destroy:a,after_update:i}=t.$$;o&&o.m(e,n),r||j(()=>{const c=s.map(J).filter(ke);a?a.push(...c):m(c),t.$$.on_mount=[]}),i.forEach(j)}function I(t,e){const n=t.$$;n.fragment!==null&&(m(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Ie(t,e){t.$$.dirty[0]===-1&&(k.push(t),Se(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function Me(t,e,n,r,o,s,a,i=[-1]){const c=S;_(t);const l=t.$$={fragment:null,ctx:null,props:s,update:V,not_equal:o,bound:Y(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Y(),dirty:i,skip_bound:!1,root:e.target||c.$$.root};a&&a(l.root);let u=!1;if(l.ctx=n?n(t,e.props||{},(d,$,...ee)=>{const te=ee.length?ee[0]:$;return l.ctx&&o(l.ctx[d],l.ctx[d]=te)&&(!l.skip_bound&&l.bound[d]&&l.bound[d](te),u&&Ie(t,d)),$}):[],l.update(),u=!0,m(l.before_update),l.fragment=r?r(l.ctx):!1,e.target){if(e.hydrate){const d=Oe(e.target);l.fragment&&l.fragment.l(d),d.forEach(F)}else l.fragment&&l.fragment.c();e.intro&&A(t.$$.fragment),C(t,e.target,e.anchor,e.customElement),K()}_(c)}class Ne{$destroy(){I(this,1),this.$destroy=V}$on(e,n){const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{const o=r.indexOf(n);o!==-1&&r.splice(o,1)}}$set(e){this.$$set&&!ve(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function Be(t){let e,n,r;const o=[{blok:t[0]},t[2]];var s=t[1];function a(i){let c={};for(let l=0;l<o.length;l+=1)c=R(c,o[l]);return{props:c}}return s&&(e=new s(a())),{c(){e&&W(e.$$.fragment),n=Ee()},m(i,c){e&&C(e,i,c),Te(i,n,c),r=!0},p(i,[c]){const l=c&5?Ae(o,[c&1&&{blok:i[0]},c&4&&Ce(i[2])]):{};if(s!==(s=i[1])){if(e){je();const u=e;Q(u.$$.fragment,1,0,()=>{I(u,1)}),xe()}s?(e=new s(a()),W(e.$$.fragment),A(e.$$.fragment,1),C(e,n.parentNode,n)):e=null}else s&&e.$set(l)},i(i){r||(e&&A(e.$$.fragment,i),r=!0)},o(i){e&&Q(e.$$.fragment,i),r=!1},d(i){i&&F(n),e&&I(e,i)}}}function qe(t,e,n){const r=["blok"];let o=z(e,r),{blok:s}=e,a;return s?a=Z(s.component):console.error("Please provide a 'blok' property to the StoryblokComponent"),t.$$set=i=>{e=R(R({},e),we(i)),n(2,o=z(e,r)),"blok"in i&&n(0,s=i.blok)},[s,a,o]}class Le extends Ne{constructor(e){super();Me(this,e,qe,Be,be,{blok:0})}}const De=(t,e)=>{const n=r=>{const o=ye(r);o["data-blok-c"]&&(t.setAttribute("data-blok-c",o["data-blok-c"]),t.setAttribute("data-blok-uid",o["data-blok-uid"]),t.classList.add("storyblok__outline"))};return n(e),{update(r){n(r)}}};let M=null;const Ue=()=>(M||console.log("You can't use useStoryblokApi if you're not loading apiPlugin."),M);let X=null;const Ve=t=>{const{storyblokApi:e}=_e(t);M=e,X=t.components||{}},Z=t=>{const e=X[t];return e||console.error(`You didn't load the ${t} component. Please load it in storyblokInit. For example:
6
6
  storyblokInit({
7
7
  accessToken: "<your-token>",
8
8
  components: {
9
9
  "teaser": Teaser
10
10
  }
11
11
  })
12
- `),e};f.StoryblokComponent=Le,f.apiPlugin=ge,f.getComponent=Z,f.storyblokEditable=De,f.storyblokInit=Ve,f.useStoryblokApi=Ue,f.useStoryblokBridge=ye,Object.defineProperty(f,"__esModule",{value:!0}),f[Symbol.toStringTag]="Module"});
12
+ `),e};f.StoryblokComponent=Le,f.apiPlugin=ge,f.getComponent=Z,f.storyblokEditable=De,f.storyblokInit=Ve,f.useStoryblokApi=Ue,f.useStoryblokBridge=me,Object.defineProperty(f,"__esModule",{value:!0}),f[Symbol.toStringTag]="Module"});
@@ -815,20 +815,9 @@ function instance($$self, $$props, $$invalidate) {
815
815
  const omit_props_names = ["blok"];
816
816
  let $$restProps = compute_rest_props($$props, omit_props_names);
817
817
  let { blok } = $$props;
818
- let resolvedComponent;
818
+ let component;
819
819
  if (blok) {
820
- const component = getComponent(blok.component);
821
- if (component) {
822
- const loadComponent = async () => {
823
- const { default: loadedComponent } = await component();
824
- $$invalidate(1, resolvedComponent = loadedComponent);
825
- };
826
- const isSvelteComponent = component.name.startsWith("Proxy");
827
- if (isSvelteComponent)
828
- resolvedComponent = component;
829
- else
830
- loadComponent();
831
- }
820
+ component = getComponent(blok.component);
832
821
  } else {
833
822
  console.error("Please provide a 'blok' property to the StoryblokComponent");
834
823
  }
@@ -838,7 +827,7 @@ function instance($$self, $$props, $$invalidate) {
838
827
  if ("blok" in $$new_props)
839
828
  $$invalidate(0, blok = $$new_props.blok);
840
829
  };
841
- return [blok, resolvedComponent, $$restProps];
830
+ return [blok, component, $$restProps];
842
831
  }
843
832
  class StoryblokComponent extends SvelteComponent {
844
833
  constructor(options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storyblok/svelte",
3
- "version": "1.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Storyblok SDK to connect Storyblok with Svelte",
5
5
  "main": "./dist/storyblok-svelte.js",
6
6
  "module": "./dist/storyblok-svelte.mjs",
@@ -29,10 +29,10 @@
29
29
  "@storyblok/js": "^1.0.3"
30
30
  },
31
31
  "devDependencies": {
32
- "@babel/core": "^7.15.0",
32
+ "@babel/core": "^7.17.8",
33
33
  "@cypress/vite-dev-server": "^2.2.2",
34
34
  "babel-jest": "^27.5.1",
35
- "cypress": "^9.4.1",
35
+ "cypress": "^9.5.3",
36
36
  "cypress-svelte-unit-test": "^3.3.4",
37
37
  "eslint-plugin-cypress": "^2.12.1",
38
38
  "eslint-plugin-jest": "^26.1.1",