@storyblok/astro 2.0.14 → 2.0.16
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 +23 -1
- package/dist/storyblok-astro.js +7 -7
- package/dist/storyblok-astro.mjs +267 -170
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -63,7 +63,7 @@ export default defineConfig({
|
|
|
63
63
|
|
|
64
64
|
### Options
|
|
65
65
|
|
|
66
|
-
When you initialize the integration, you can pass all [_@storyblok/js_ options](https://github.com/storyblok/storyblok-js#features-and-api).
|
|
66
|
+
When you initialize the integration, you can pass all [_@storyblok/js_ options](https://github.com/storyblok/storyblok-js#features-and-api).
|
|
67
67
|
|
|
68
68
|
```js
|
|
69
69
|
// Defaults
|
|
@@ -71,12 +71,31 @@ storyblok({
|
|
|
71
71
|
accessToken: "<your-access-token>",
|
|
72
72
|
bridge: true,
|
|
73
73
|
apiOptions: {}, // storyblok-js-client options
|
|
74
|
+
components: {},
|
|
74
75
|
useCustomApi: false,
|
|
75
76
|
});
|
|
76
77
|
```
|
|
77
78
|
|
|
78
79
|
> Note: By default, the apiPlugin from `@storyblok/js` is loaded. If you want to use your own method to fetch data from Storyblok, you can disable this behavior by setting `useCustomApi` to `true`, resulting in an optimized final bundle.
|
|
79
80
|
|
|
81
|
+
#### Region parameter
|
|
82
|
+
Possible values:
|
|
83
|
+
- `eu` (default): For spaces created in the EU
|
|
84
|
+
- `us`: For spaces created in the US
|
|
85
|
+
- `cn`: For spaces created in China
|
|
86
|
+
|
|
87
|
+
Full example for a space created in the US:
|
|
88
|
+
```js
|
|
89
|
+
storyblok({
|
|
90
|
+
accessToken: "<your-access-token>",
|
|
91
|
+
apiOptions: {
|
|
92
|
+
region: 'us'
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
> Note: For spaces created in the United States or China, the `region` parameter **must** be specified.
|
|
98
|
+
|
|
80
99
|
## Getting started
|
|
81
100
|
|
|
82
101
|
### 1. Creating and linking your components to the Storyblok Visual Editor
|
|
@@ -262,6 +281,9 @@ const renderedRichText = renderRichText(blok.text, {
|
|
|
262
281
|
|
|
263
282
|
Returns the instance of the `storyblok-js-client`.
|
|
264
283
|
|
|
284
|
+
## The Storyblok JavaScript SDK Ecosystem
|
|
285
|
+

|
|
286
|
+
|
|
265
287
|
## Acknowledgements
|
|
266
288
|
|
|
267
289
|
A huge thank you goes to the Astro Team. In particular to [Tony Sullivan](https://github.com/tony-sull), who has provided extraordinary support and made _automagically_ rendering Storyblok components a reality.
|
package/dist/storyblok-astro.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(c,f){typeof exports=="object"&&typeof module<"u"?f(exports):typeof define=="function"&&define.amd?define(["exports"],f):(c=typeof globalThis<"u"?globalThis:c||self,f(c.storyblokAstro={}))})(this,function(c){"use strict";function f(r,e,t){const s="virtual:storyblok-init",a="\0"+s;return{name:"vite-plugin-storyblok-init",async resolveId(o){if(o===s)return a},async load(o){if(o===a)return`
|
|
2
2
|
import { storyblokInit, apiPlugin } from "@storyblok/js";
|
|
3
3
|
const { storyblokApi } = storyblokInit({
|
|
4
|
-
accessToken: "${
|
|
4
|
+
accessToken: "${r}",
|
|
5
5
|
use: ${e?"[]":"[apiPlugin]"},
|
|
6
|
-
apiOptions: ${JSON.stringify(
|
|
6
|
+
apiOptions: ${JSON.stringify(t)},
|
|
7
7
|
});
|
|
8
8
|
export const storyblokApiInstance = storyblokApi;
|
|
9
|
-
`}}}const
|
|
9
|
+
`}}}const x=/[\p{Lu}]/u,R=/[\p{Ll}]/u,y=/^[\p{Lu}](?![\p{Lu}])/gu,k=/([\p{Alpha}\p{N}_]|$)/u,p=/[_.\- ]+/,N=new RegExp("^"+p.source),$=new RegExp(p.source+k.source,"gu"),v=new RegExp("\\d+"+k.source,"gu"),L=(r,e,t,s)=>{let a=!1,o=!1,i=!1,u=!1;for(let n=0;n<r.length;n++){const l=r[n];u=n>2?r[n-3]==="-":!0,a&&x.test(l)?(r=r.slice(0,n)+"-"+r.slice(n),a=!1,i=o,o=!0,n++):o&&i&&R.test(l)&&(!u||s)?(r=r.slice(0,n-1)+"-"+r.slice(n-1),i=o,o=!1,a=!0):(a=e(l)===l&&t(l)!==l,i=o,o=t(l)===l&&e(l)!==l)}return r},O=(r,e)=>(y.lastIndex=0,r.replace(y,t=>e(t))),_=(r,e)=>($.lastIndex=0,v.lastIndex=0,r.replace($,(t,s)=>e(s)).replace(v,t=>e(t)));function I(r,e){if(!(typeof r=="string"||Array.isArray(r)))throw new TypeError("Expected the input to be `string | string[]`");if(e={pascalCase:!1,preserveConsecutiveUppercase:!1,...e},Array.isArray(r)?r=r.map(o=>o.trim()).filter(o=>o.length).join("-"):r=r.trim(),r.length===0)return"";const t=e.locale===!1?o=>o.toLowerCase():o=>o.toLocaleLowerCase(e.locale),s=e.locale===!1?o=>o.toUpperCase():o=>o.toLocaleUpperCase(e.locale);return r.length===1?p.test(r)?"":e.pascalCase?s(r):t(r):(r!==t(r)&&(r=L(r,t,s,e.preserveConsecutiveUppercase)),r=r.replace(N,""),r=e.preserveConsecutiveUppercase?O(r,t):t(r),e.pascalCase&&(r=s(r.charAt(0))+r.slice(1)),_(r,s))}function z(r){const e="virtual:storyblok-components",t="\0"+e;return{name:"vite-plugin-storyblok-components",async resolveId(s){if(s===e)return t},async load(s){if(s===t){const a=[];for await(const[o,i]of Object.entries(r)){const u=await this.resolve("/src/"+i+".astro");if(!u)throw new Error(`Component could not be found for blok "${o}"! Does "/src/${i}.astro" exist?`);a.push(`import ${I(o)} from "${u.id}"`)}return`${a.join(";")};export default {${Object.keys(r).map(o=>I(o)).join(",")}}`}}}}let T=!1;const w=[],M=r=>new Promise((e,t)=>{if(typeof window>"u"||(window.storyblokRegisterEvent=a=>{if(window.location===window.parent.location){console.warn("You are not in Draft Mode or in the Visual Editor.");return}T?a():w.push(a)},document.getElementById("storyblok-javascript-bridge")))return;const s=document.createElement("script");s.async=!0,s.src=r,s.id="storyblok-javascript-bridge",s.onerror=a=>t(a),s.onload=a=>{w.forEach(o=>o()),T=!0,e(a)},document.getElementsByTagName("head")[0].appendChild(s)});var P=Object.defineProperty,D=(r,e,t)=>e in r?P(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,A=(r,e,t)=>(D(r,typeof e!="symbol"?e+"":e,t),t);const U=function(r,e){const t={};for(const s in r){const a=r[s];e.indexOf(s)>-1&&a!==null&&(t[s]=a)}return t},q=r=>r==="email",B=()=>({singleTag:"hr"}),F=()=>({tag:"blockquote"}),J=()=>({tag:"ul"}),V=r=>({tag:["pre",{tag:"code",attrs:r.attrs}]}),G=()=>({singleTag:"br"}),K=r=>({tag:`h${r.attrs.level}`}),W=r=>({singleTag:[{tag:"img",attrs:U(r.attrs,["src","alt","title"])}]}),Y=()=>({tag:"li"}),H=()=>({tag:"ol"}),Q=()=>({tag:"p"}),X=r=>({tag:[{tag:"span",attrs:{["data-type"]:"emoji",["data-name"]:r.attrs.name,emoji:r.attrs.emoji}}]}),Z=()=>({tag:"b"}),ee=()=>({tag:"strike"}),te=()=>({tag:"u"}),re=()=>({tag:"strong"}),se=()=>({tag:"code"}),oe=()=>({tag:"i"}),ae=r=>{const e={...r.attrs},{linktype:t="url"}=r.attrs;if(q(t)&&(e.href=`mailto:${e.href}`),e.anchor&&(e.href=`${e.href}#${e.anchor}`,delete e.anchor),e.custom){for(const s in e.custom)e[s]=e.custom[s];delete e.custom}return{tag:[{tag:"a",attrs:e}]}},ie=r=>({tag:[{tag:"span",attrs:r.attrs}]}),ne=()=>({tag:"sub"}),le=()=>({tag:"sup"}),ce=r=>({tag:[{tag:"span",attrs:r.attrs}]}),ge=r=>({tag:[{tag:"span",attrs:{style:`background-color:${r.attrs.color};`}}]}),ue=r=>({tag:[{tag:"span",attrs:{style:`background-color:${r.attrs.color}`}}]}),E={nodes:{horizontal_rule:B,blockquote:F,bullet_list:J,code_block:V,hard_break:G,heading:K,image:W,list_item:Y,ordered_list:H,paragraph:Q,emoji:X},marks:{bold:Z,strike:ee,underline:te,strong:re,code:se,italic:oe,link:ae,styled:ie,subscript:ne,superscript:le,anchor:ce,highlight:ge,textStyle:ue}},fe=function(r){const e={"&":"&","<":"<",">":">",'"':""","'":"'"},t=/[&<>"']/g,s=RegExp(t.source);return r&&s.test(r)?r.replace(t,a=>e[a]):r};class j{constructor(e){A(this,"marks"),A(this,"nodes"),e||(e=E),this.marks=e.marks||[],this.nodes=e.nodes||[]}addNode(e,t){this.nodes[e]=t}addMark(e,t){this.marks[e]=t}render(e,t={optimizeImages:!1}){if(e&&e.content&&Array.isArray(e.content)){let s="";return e.content.forEach(a=>{s+=this.renderNode(a)}),t.optimizeImages?this.optimizeImages(s,t.optimizeImages):s}return console.warn("The render method must receive an object with a content field, which is an array"),""}optimizeImages(e,t){let s=0,a=0,o="",i="";typeof t!="boolean"&&(typeof t.width=="number"&&t.width>0&&(o+=`width="${t.width}" `,s=t.width),typeof t.height=="number"&&t.height>0&&(o+=`height="${t.height}" `,a=t.height),(t.loading==="lazy"||t.loading==="eager")&&(o+=`loading="${t.loading}" `),typeof t.class=="string"&&t.class.length>0&&(o+=`class="${t.class}" `),t.filters&&(typeof t.filters.blur=="number"&&t.filters.blur>=0&&t.filters.blur<=100&&(i+=`:blur(${t.filters.blur})`),typeof t.filters.brightness=="number"&&t.filters.brightness>=-100&&t.filters.brightness<=100&&(i+=`:brightness(${t.filters.brightness})`),t.filters.fill&&(t.filters.fill.match(/[0-9A-Fa-f]{6}/g)||t.filters.fill==="transparent")&&(i+=`:fill(${t.filters.fill})`),t.filters.format&&["webp","png","jpeg"].includes(t.filters.format)&&(i+=`:format(${t.filters.format})`),typeof t.filters.grayscale=="boolean"&&t.filters.grayscale&&(i+=":grayscale()"),typeof t.filters.quality=="number"&&t.filters.quality>=0&&t.filters.quality<=100&&(i+=`:quality(${t.filters.quality})`),t.filters.rotate&&[90,180,270].includes(t.filters.rotate)&&(i+=`:rotate(${t.filters.rotate})`),i.length>0&&(i="/filters"+i))),o.length>0&&(e=e.replace(/<img/g,`<img ${o.trim()}`));const u=s>0||a>0||i.length>0?`${s}x${a}${i}`:"";return e=e.replace(/a.storyblok.com\/f\/(\d+)\/([^.]+)\.(gif|jpg|jpeg|png|tif|tiff|bmp)/g,`a.storyblok.com/f/$1/$2.$3/m/${u}`),typeof t!="boolean"&&(t.sizes||t.srcset)&&(e=e.replace(/<img.*?src=["|'](.*?)["|']/g,n=>{var l,C;const d=n.match(/a.storyblok.com\/f\/(\d+)\/([^.]+)\.(gif|jpg|jpeg|png|tif|tiff|bmp)/g);if(d&&d.length>0){const h={srcset:(l=t.srcset)==null?void 0:l.map(g=>{if(typeof g=="number")return`//${d}/m/${g}x0${i} ${g}w`;if(typeof g=="object"&&g.length===2){let m=0,S=0;return typeof g[0]=="number"&&(m=g[0]),typeof g[1]=="number"&&(S=g[1]),`//${d}/m/${m}x${S}${i} ${m}w`}}).join(", "),sizes:(C=t.sizes)==null?void 0:C.map(g=>g).join(", ")};let b="";return h.srcset&&(b+=`srcset="${h.srcset}" `),h.sizes&&(b+=`sizes="${h.sizes}" `),n.replace(/<img/g,`<img ${b.trim()}`)}return n})),e}renderNode(e){const t=[];e.marks&&e.marks.forEach(a=>{const o=this.getMatchingMark(a);o&&t.push(this.renderOpeningTag(o.tag))});const s=this.getMatchingNode(e);return s&&s.tag&&t.push(this.renderOpeningTag(s.tag)),e.content?e.content.forEach(a=>{t.push(this.renderNode(a))}):e.text?t.push(fe(e.text)):s&&s.singleTag?t.push(this.renderTag(s.singleTag," /")):s&&s.html?t.push(s.html):e.type==="emoji"&&t.push(this.renderEmoji(e)),s&&s.tag&&t.push(this.renderClosingTag(s.tag)),e.marks&&e.marks.slice(0).reverse().forEach(a=>{const o=this.getMatchingMark(a);o&&t.push(this.renderClosingTag(o.tag))}),t.join("")}renderTag(e,t){return e.constructor===String?`<${e}${t}>`:e.map(s=>{if(s.constructor===String)return`<${s}${t}>`;{let a=`<${s.tag}`;if(s.attrs)for(const o in s.attrs){const i=s.attrs[o];i!==null&&(a+=` ${o}="${i}"`)}return`${a}${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){const t=this.nodes[e.type];if(typeof t=="function")return t(e)}getMatchingMark(e){const t=this.marks[e.type];if(typeof t=="function")return t(e)}renderEmoji(e){if(e.attrs.emoji)return e.attrs.emoji;const t=[{tag:"img",attrs:{src:e.attrs.fallbackImage,draggable:"false",loading:"lazy",align:"absmiddle"}}];return this.renderTag(t," /")}}const de=r=>{if(typeof r!="object"||typeof r._editable>"u")return{};const e=JSON.parse(r._editable.replace(/^<!--#storyblok#/,"").replace(/-->$/,""));return{"data-blok-c":JSON.stringify(e),"data-blok-uid":e.id+"-"+e.uid}};let he;const pe="https://app.storyblok.com/f/storyblok-v2-latest.js",be=(r,e)=>{r.addNode("blok",t=>{let s="";return t.attrs.body.forEach(a=>{s+=e(a.component,a)}),{html:s}})},me=(r,e,t)=>{let s=t||he;if(!s){console.error("Please initialize the Storyblok SDK before calling the renderRichText function");return}return r===""?"":r?(e&&(s=new j(e.schema),e.resolver&&be(s,e.resolver)),s.render(r)):(console.warn(`${r} is not a valid Richtext object. This might be because the value of the richtext field is empty.
|
|
10
10
|
|
|
11
|
-
For more info about the richtext object check https://github.com/storyblok/storyblok-js#rendering-rich-text`),"")},
|
|
11
|
+
For more info about the richtext object check https://github.com/storyblok/storyblok-js#rendering-rich-text`),"")},ye=()=>M(pe);function ke(){return globalThis.storyblokApiInstance||console.error("storyblokApiInstance has not been initialized correctly"),globalThis.storyblokApiInstance}function $e(r,e){const t=globalThis.storyblokApiInstance.richTextResolver;if(!t){console.error("Please initialize the Storyblok SDK before calling the renderRichText function");return}return me(r,e,t)}function ve(r){const e={useCustomApi:!1,bridge:!0,...r};return{name:"@storyblok/astro",hooks:{"astro:config:setup":({injectScript:t,updateConfig:s})=>{s({vite:{plugins:[f(e.accessToken,e.useCustomApi,e.apiOptions),z(e.components)]}}),t("page-ssr",`
|
|
12
12
|
import { storyblokApiInstance } from "virtual:storyblok-init";
|
|
13
13
|
globalThis.storyblokApiInstance = storyblokApiInstance;
|
|
14
|
-
`),e.bridge&&
|
|
14
|
+
`),e.bridge&&t("page",`
|
|
15
15
|
import { loadStoryblokBridge } from "@storyblok/astro";
|
|
16
16
|
loadStoryblokBridge().then(() => {
|
|
17
17
|
const { StoryblokBridge, location } = window;
|
|
@@ -23,4 +23,4 @@
|
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
});
|
|
26
|
-
`)}}}}
|
|
26
|
+
`)}}}}c.RichTextResolver=j,c.RichTextSchema=E,c.default=ve,c.loadStoryblokBridge=ye,c.renderRichText=$e,c.storyblokEditable=de,c.useStoryblokApi=ke,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/storyblok-astro.mjs
CHANGED
|
@@ -1,138 +1,154 @@
|
|
|
1
|
-
function
|
|
2
|
-
const
|
|
1
|
+
function A(r, e, t) {
|
|
2
|
+
const s = "virtual:storyblok-init", a = "\0" + s;
|
|
3
3
|
return {
|
|
4
4
|
name: "vite-plugin-storyblok-init",
|
|
5
|
-
async resolveId(
|
|
6
|
-
if (
|
|
7
|
-
return
|
|
5
|
+
async resolveId(o) {
|
|
6
|
+
if (o === s)
|
|
7
|
+
return a;
|
|
8
8
|
},
|
|
9
|
-
async load(
|
|
10
|
-
if (
|
|
9
|
+
async load(o) {
|
|
10
|
+
if (o === a)
|
|
11
11
|
return `
|
|
12
12
|
import { storyblokInit, apiPlugin } from "@storyblok/js";
|
|
13
13
|
const { storyblokApi } = storyblokInit({
|
|
14
|
-
accessToken: "${
|
|
14
|
+
accessToken: "${r}",
|
|
15
15
|
use: ${e ? "[]" : "[apiPlugin]"},
|
|
16
|
-
apiOptions: ${JSON.stringify(
|
|
16
|
+
apiOptions: ${JSON.stringify(t)},
|
|
17
17
|
});
|
|
18
18
|
export const storyblokApiInstance = storyblokApi;
|
|
19
19
|
`;
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
let
|
|
25
|
-
for (let
|
|
26
|
-
const
|
|
27
|
-
|
|
23
|
+
const j = /[\p{Lu}]/u, C = /[\p{Ll}]/u, y = /^[\p{Lu}](?![\p{Lu}])/gu, E = /([\p{Alpha}\p{N}_]|$)/u, p = /[_.\- ]+/, x = new RegExp("^" + p.source), k = new RegExp(p.source + E.source, "gu"), $ = new RegExp("\\d+" + E.source, "gu"), S = (r, e, t, s) => {
|
|
24
|
+
let a = !1, o = !1, i = !1, g = !1;
|
|
25
|
+
for (let n = 0; n < r.length; n++) {
|
|
26
|
+
const l = r[n];
|
|
27
|
+
g = n > 2 ? r[n - 3] === "-" : !0, a && j.test(l) ? (r = r.slice(0, n) + "-" + r.slice(n), a = !1, i = o, o = !0, n++) : o && i && C.test(l) && (!g || s) ? (r = r.slice(0, n - 1) + "-" + r.slice(n - 1), i = o, o = !1, a = !0) : (a = e(l) === l && t(l) !== l, i = o, o = t(l) === l && e(l) !== l);
|
|
28
28
|
}
|
|
29
|
-
return
|
|
30
|
-
},
|
|
31
|
-
function
|
|
32
|
-
if (!(typeof
|
|
29
|
+
return r;
|
|
30
|
+
}, R = (r, e) => (y.lastIndex = 0, r.replace(y, (t) => e(t))), N = (r, e) => (k.lastIndex = 0, $.lastIndex = 0, r.replace(k, (t, s) => e(s)).replace($, (t) => e(t)));
|
|
31
|
+
function v(r, e) {
|
|
32
|
+
if (!(typeof r == "string" || Array.isArray(r)))
|
|
33
33
|
throw new TypeError("Expected the input to be `string | string[]`");
|
|
34
34
|
if (e = {
|
|
35
35
|
pascalCase: !1,
|
|
36
36
|
preserveConsecutiveUppercase: !1,
|
|
37
37
|
...e
|
|
38
|
-
}, Array.isArray(
|
|
38
|
+
}, Array.isArray(r) ? r = r.map((o) => o.trim()).filter((o) => o.length).join("-") : r = r.trim(), r.length === 0)
|
|
39
39
|
return "";
|
|
40
|
-
const
|
|
41
|
-
return
|
|
40
|
+
const t = e.locale === !1 ? (o) => o.toLowerCase() : (o) => o.toLocaleLowerCase(e.locale), s = e.locale === !1 ? (o) => o.toUpperCase() : (o) => o.toLocaleUpperCase(e.locale);
|
|
41
|
+
return r.length === 1 ? p.test(r) ? "" : e.pascalCase ? s(r) : t(r) : (r !== t(r) && (r = S(r, t, s, e.preserveConsecutiveUppercase)), r = r.replace(x, ""), r = e.preserveConsecutiveUppercase ? R(r, t) : t(r), e.pascalCase && (r = s(r.charAt(0)) + r.slice(1)), N(r, s));
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
const e = "virtual:storyblok-components",
|
|
43
|
+
function L(r) {
|
|
44
|
+
const e = "virtual:storyblok-components", t = "\0" + e;
|
|
45
45
|
return {
|
|
46
46
|
name: "vite-plugin-storyblok-components",
|
|
47
|
-
async resolveId(
|
|
48
|
-
if (
|
|
49
|
-
return
|
|
47
|
+
async resolveId(s) {
|
|
48
|
+
if (s === e)
|
|
49
|
+
return t;
|
|
50
50
|
},
|
|
51
|
-
async load(
|
|
52
|
-
if (
|
|
53
|
-
const
|
|
54
|
-
for await (const [
|
|
55
|
-
const
|
|
56
|
-
if (!
|
|
51
|
+
async load(s) {
|
|
52
|
+
if (s === t) {
|
|
53
|
+
const a = [];
|
|
54
|
+
for await (const [o, i] of Object.entries(r)) {
|
|
55
|
+
const g = await this.resolve("/src/" + i + ".astro");
|
|
56
|
+
if (!g)
|
|
57
57
|
throw new Error(
|
|
58
|
-
`Component could not be found for blok "${
|
|
58
|
+
`Component could not be found for blok "${o}"! Does "/src/${i}.astro" exist?`
|
|
59
59
|
);
|
|
60
|
-
|
|
60
|
+
a.push(`import ${v(o)} from "${g.id}"`);
|
|
61
61
|
}
|
|
62
|
-
return `${
|
|
62
|
+
return `${a.join(";")};export default {${Object.keys(r).map((o) => v(o)).join(",")}}`;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
let
|
|
68
|
-
const
|
|
69
|
-
if (typeof window > "u" || (window.storyblokRegisterEvent = (
|
|
67
|
+
let I = !1;
|
|
68
|
+
const w = [], z = (r) => new Promise((e, t) => {
|
|
69
|
+
if (typeof window > "u" || (window.storyblokRegisterEvent = (a) => {
|
|
70
70
|
if (window.location === window.parent.location) {
|
|
71
71
|
console.warn("You are not in Draft Mode or in the Visual Editor.");
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
I ? a() : w.push(a);
|
|
75
75
|
}, document.getElementById("storyblok-javascript-bridge")))
|
|
76
76
|
return;
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}, document.getElementsByTagName("head")[0].appendChild(
|
|
77
|
+
const s = document.createElement("script");
|
|
78
|
+
s.async = !0, s.src = r, s.id = "storyblok-javascript-bridge", s.onerror = (a) => t(a), s.onload = (a) => {
|
|
79
|
+
w.forEach((o) => o()), I = !0, e(a);
|
|
80
|
+
}, document.getElementsByTagName("head")[0].appendChild(s);
|
|
81
81
|
});
|
|
82
|
-
var
|
|
83
|
-
const
|
|
84
|
-
const
|
|
85
|
-
for (const
|
|
86
|
-
const
|
|
87
|
-
e.indexOf(
|
|
82
|
+
var O = Object.defineProperty, P = (r, e, t) => e in r ? O(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, T = (r, e, t) => (P(r, typeof e != "symbol" ? e + "" : e, t), t);
|
|
83
|
+
const _ = function(r, e) {
|
|
84
|
+
const t = {};
|
|
85
|
+
for (const s in r) {
|
|
86
|
+
const a = r[s];
|
|
87
|
+
e.indexOf(s) > -1 && a !== null && (t[s] = a);
|
|
88
88
|
}
|
|
89
|
-
return
|
|
90
|
-
},
|
|
89
|
+
return t;
|
|
90
|
+
}, M = (r) => r === "email", D = () => ({
|
|
91
91
|
singleTag: "hr"
|
|
92
|
-
}),
|
|
92
|
+
}), U = () => ({
|
|
93
93
|
tag: "blockquote"
|
|
94
|
-
}),
|
|
94
|
+
}), q = () => ({
|
|
95
95
|
tag: "ul"
|
|
96
|
-
}),
|
|
96
|
+
}), B = (r) => ({
|
|
97
97
|
tag: [
|
|
98
98
|
"pre",
|
|
99
99
|
{
|
|
100
100
|
tag: "code",
|
|
101
|
-
attrs:
|
|
101
|
+
attrs: r.attrs
|
|
102
102
|
}
|
|
103
103
|
]
|
|
104
|
-
}),
|
|
104
|
+
}), F = () => ({
|
|
105
105
|
singleTag: "br"
|
|
106
|
-
}),
|
|
107
|
-
tag: `h${
|
|
108
|
-
}),
|
|
106
|
+
}), J = (r) => ({
|
|
107
|
+
tag: `h${r.attrs.level}`
|
|
108
|
+
}), V = (r) => ({
|
|
109
109
|
singleTag: [
|
|
110
110
|
{
|
|
111
111
|
tag: "img",
|
|
112
|
-
attrs:
|
|
112
|
+
attrs: _(r.attrs, ["src", "alt", "title"])
|
|
113
113
|
}
|
|
114
114
|
]
|
|
115
|
-
}),
|
|
115
|
+
}), G = () => ({
|
|
116
116
|
tag: "li"
|
|
117
|
-
}),
|
|
117
|
+
}), K = () => ({
|
|
118
118
|
tag: "ol"
|
|
119
|
-
}),
|
|
119
|
+
}), W = () => ({
|
|
120
120
|
tag: "p"
|
|
121
|
-
}),
|
|
121
|
+
}), Y = (r) => ({
|
|
122
|
+
tag: [
|
|
123
|
+
{
|
|
124
|
+
tag: "span",
|
|
125
|
+
attrs: {
|
|
126
|
+
["data-type"]: "emoji",
|
|
127
|
+
["data-name"]: r.attrs.name,
|
|
128
|
+
emoji: r.attrs.emoji
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
}), H = () => ({
|
|
122
133
|
tag: "b"
|
|
123
|
-
}),
|
|
134
|
+
}), Q = () => ({
|
|
124
135
|
tag: "strike"
|
|
125
|
-
}),
|
|
136
|
+
}), X = () => ({
|
|
126
137
|
tag: "u"
|
|
127
|
-
}),
|
|
138
|
+
}), Z = () => ({
|
|
128
139
|
tag: "strong"
|
|
129
|
-
}),
|
|
140
|
+
}), ee = () => ({
|
|
130
141
|
tag: "code"
|
|
131
|
-
}),
|
|
142
|
+
}), te = () => ({
|
|
132
143
|
tag: "i"
|
|
133
|
-
}),
|
|
134
|
-
const e = { ...
|
|
135
|
-
|
|
144
|
+
}), re = (r) => {
|
|
145
|
+
const e = { ...r.attrs }, { linktype: t = "url" } = r.attrs;
|
|
146
|
+
if (M(t) && (e.href = `mailto:${e.href}`), e.anchor && (e.href = `${e.href}#${e.anchor}`, delete e.anchor), e.custom) {
|
|
147
|
+
for (const s in e.custom)
|
|
148
|
+
e[s] = e.custom[s];
|
|
149
|
+
delete e.custom;
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
136
152
|
tag: [
|
|
137
153
|
{
|
|
138
154
|
tag: "a",
|
|
@@ -140,93 +156,158 @@ const R = function(t, e) {
|
|
|
140
156
|
}
|
|
141
157
|
]
|
|
142
158
|
};
|
|
143
|
-
},
|
|
159
|
+
}, se = (r) => ({
|
|
160
|
+
tag: [
|
|
161
|
+
{
|
|
162
|
+
tag: "span",
|
|
163
|
+
attrs: r.attrs
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
}), oe = () => ({
|
|
167
|
+
tag: "sub"
|
|
168
|
+
}), ae = () => ({
|
|
169
|
+
tag: "sup"
|
|
170
|
+
}), ie = (r) => ({
|
|
171
|
+
tag: [
|
|
172
|
+
{
|
|
173
|
+
tag: "span",
|
|
174
|
+
attrs: r.attrs
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
}), ne = (r) => ({
|
|
144
178
|
tag: [
|
|
145
179
|
{
|
|
146
180
|
tag: "span",
|
|
147
|
-
attrs:
|
|
181
|
+
attrs: {
|
|
182
|
+
style: `background-color:${r.attrs.color};`
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
}), le = (r) => ({
|
|
187
|
+
tag: [
|
|
188
|
+
{
|
|
189
|
+
tag: "span",
|
|
190
|
+
attrs: {
|
|
191
|
+
style: `background-color:${r.attrs.color}`
|
|
192
|
+
}
|
|
148
193
|
}
|
|
149
194
|
]
|
|
150
|
-
}),
|
|
195
|
+
}), ce = {
|
|
151
196
|
nodes: {
|
|
152
|
-
horizontal_rule:
|
|
153
|
-
blockquote:
|
|
154
|
-
bullet_list:
|
|
155
|
-
code_block:
|
|
156
|
-
hard_break:
|
|
157
|
-
heading:
|
|
158
|
-
image:
|
|
159
|
-
list_item:
|
|
160
|
-
ordered_list:
|
|
161
|
-
paragraph:
|
|
197
|
+
horizontal_rule: D,
|
|
198
|
+
blockquote: U,
|
|
199
|
+
bullet_list: q,
|
|
200
|
+
code_block: B,
|
|
201
|
+
hard_break: F,
|
|
202
|
+
heading: J,
|
|
203
|
+
image: V,
|
|
204
|
+
list_item: G,
|
|
205
|
+
ordered_list: K,
|
|
206
|
+
paragraph: W,
|
|
207
|
+
emoji: Y
|
|
162
208
|
},
|
|
163
209
|
marks: {
|
|
164
|
-
bold:
|
|
165
|
-
strike:
|
|
166
|
-
underline:
|
|
167
|
-
strong:
|
|
168
|
-
code:
|
|
169
|
-
italic:
|
|
170
|
-
link:
|
|
171
|
-
styled:
|
|
210
|
+
bold: H,
|
|
211
|
+
strike: Q,
|
|
212
|
+
underline: X,
|
|
213
|
+
strong: Z,
|
|
214
|
+
code: ee,
|
|
215
|
+
italic: te,
|
|
216
|
+
link: re,
|
|
217
|
+
styled: se,
|
|
218
|
+
subscript: oe,
|
|
219
|
+
superscript: ae,
|
|
220
|
+
anchor: ie,
|
|
221
|
+
highlight: ne,
|
|
222
|
+
textStyle: le
|
|
172
223
|
}
|
|
173
|
-
},
|
|
224
|
+
}, ge = function(r) {
|
|
174
225
|
const e = {
|
|
175
226
|
"&": "&",
|
|
176
227
|
"<": "<",
|
|
177
228
|
">": ">",
|
|
178
229
|
'"': """,
|
|
179
230
|
"'": "'"
|
|
180
|
-
},
|
|
181
|
-
return
|
|
231
|
+
}, t = /[&<>"']/g, s = RegExp(t.source);
|
|
232
|
+
return r && s.test(r) ? r.replace(t, (a) => e[a]) : r;
|
|
182
233
|
};
|
|
183
|
-
class
|
|
234
|
+
class ue {
|
|
184
235
|
constructor(e) {
|
|
185
|
-
|
|
236
|
+
T(this, "marks"), T(this, "nodes"), e || (e = ce), this.marks = e.marks || [], this.nodes = e.nodes || [];
|
|
186
237
|
}
|
|
187
|
-
addNode(e,
|
|
188
|
-
this.nodes[e] =
|
|
238
|
+
addNode(e, t) {
|
|
239
|
+
this.nodes[e] = t;
|
|
189
240
|
}
|
|
190
|
-
addMark(e,
|
|
191
|
-
this.marks[e] =
|
|
241
|
+
addMark(e, t) {
|
|
242
|
+
this.marks[e] = t;
|
|
192
243
|
}
|
|
193
|
-
render(e) {
|
|
244
|
+
render(e, t = { optimizeImages: !1 }) {
|
|
194
245
|
if (e && e.content && Array.isArray(e.content)) {
|
|
195
|
-
let
|
|
196
|
-
return e.content.forEach((
|
|
197
|
-
|
|
198
|
-
}),
|
|
246
|
+
let s = "";
|
|
247
|
+
return e.content.forEach((a) => {
|
|
248
|
+
s += this.renderNode(a);
|
|
249
|
+
}), t.optimizeImages ? this.optimizeImages(s, t.optimizeImages) : s;
|
|
199
250
|
}
|
|
200
251
|
return console.warn(
|
|
201
252
|
"The render method must receive an object with a content field, which is an array"
|
|
202
253
|
), "";
|
|
203
254
|
}
|
|
255
|
+
optimizeImages(e, t) {
|
|
256
|
+
let s = 0, a = 0, o = "", i = "";
|
|
257
|
+
typeof t != "boolean" && (typeof t.width == "number" && t.width > 0 && (o += `width="${t.width}" `, s = t.width), typeof t.height == "number" && t.height > 0 && (o += `height="${t.height}" `, a = t.height), (t.loading === "lazy" || t.loading === "eager") && (o += `loading="${t.loading}" `), typeof t.class == "string" && t.class.length > 0 && (o += `class="${t.class}" `), t.filters && (typeof t.filters.blur == "number" && t.filters.blur >= 0 && t.filters.blur <= 100 && (i += `:blur(${t.filters.blur})`), typeof t.filters.brightness == "number" && t.filters.brightness >= -100 && t.filters.brightness <= 100 && (i += `:brightness(${t.filters.brightness})`), t.filters.fill && (t.filters.fill.match(/[0-9A-Fa-f]{6}/g) || t.filters.fill === "transparent") && (i += `:fill(${t.filters.fill})`), t.filters.format && ["webp", "png", "jpeg"].includes(t.filters.format) && (i += `:format(${t.filters.format})`), typeof t.filters.grayscale == "boolean" && t.filters.grayscale && (i += ":grayscale()"), typeof t.filters.quality == "number" && t.filters.quality >= 0 && t.filters.quality <= 100 && (i += `:quality(${t.filters.quality})`), t.filters.rotate && [90, 180, 270].includes(t.filters.rotate) && (i += `:rotate(${t.filters.rotate})`), i.length > 0 && (i = "/filters" + i))), o.length > 0 && (e = e.replace(/<img/g, `<img ${o.trim()}`));
|
|
258
|
+
const g = s > 0 || a > 0 || i.length > 0 ? `${s}x${a}${i}` : "";
|
|
259
|
+
return e = e.replace(
|
|
260
|
+
/a.storyblok.com\/f\/(\d+)\/([^.]+)\.(gif|jpg|jpeg|png|tif|tiff|bmp)/g,
|
|
261
|
+
`a.storyblok.com/f/$1/$2.$3/m/${g}`
|
|
262
|
+
), typeof t != "boolean" && (t.sizes || t.srcset) && (e = e.replace(/<img.*?src=["|'](.*?)["|']/g, (n) => {
|
|
263
|
+
var l, m;
|
|
264
|
+
const u = n.match(
|
|
265
|
+
/a.storyblok.com\/f\/(\d+)\/([^.]+)\.(gif|jpg|jpeg|png|tif|tiff|bmp)/g
|
|
266
|
+
);
|
|
267
|
+
if (u && u.length > 0) {
|
|
268
|
+
const f = {
|
|
269
|
+
srcset: (l = t.srcset) == null ? void 0 : l.map((c) => {
|
|
270
|
+
if (typeof c == "number")
|
|
271
|
+
return `//${u}/m/${c}x0${i} ${c}w`;
|
|
272
|
+
if (typeof c == "object" && c.length === 2) {
|
|
273
|
+
let h = 0, b = 0;
|
|
274
|
+
return typeof c[0] == "number" && (h = c[0]), typeof c[1] == "number" && (b = c[1]), `//${u}/m/${h}x${b}${i} ${h}w`;
|
|
275
|
+
}
|
|
276
|
+
}).join(", "),
|
|
277
|
+
sizes: (m = t.sizes) == null ? void 0 : m.map((c) => c).join(", ")
|
|
278
|
+
};
|
|
279
|
+
let d = "";
|
|
280
|
+
return f.srcset && (d += `srcset="${f.srcset}" `), f.sizes && (d += `sizes="${f.sizes}" `), n.replace(/<img/g, `<img ${d.trim()}`);
|
|
281
|
+
}
|
|
282
|
+
return n;
|
|
283
|
+
})), e;
|
|
284
|
+
}
|
|
204
285
|
renderNode(e) {
|
|
205
|
-
const
|
|
206
|
-
e.marks && e.marks.forEach((
|
|
207
|
-
const
|
|
208
|
-
|
|
286
|
+
const t = [];
|
|
287
|
+
e.marks && e.marks.forEach((a) => {
|
|
288
|
+
const o = this.getMatchingMark(a);
|
|
289
|
+
o && t.push(this.renderOpeningTag(o.tag));
|
|
209
290
|
});
|
|
210
|
-
const
|
|
211
|
-
return
|
|
212
|
-
|
|
213
|
-
}) : e.text ?
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
}),
|
|
291
|
+
const s = this.getMatchingNode(e);
|
|
292
|
+
return s && s.tag && t.push(this.renderOpeningTag(s.tag)), e.content ? e.content.forEach((a) => {
|
|
293
|
+
t.push(this.renderNode(a));
|
|
294
|
+
}) : e.text ? t.push(ge(e.text)) : s && s.singleTag ? t.push(this.renderTag(s.singleTag, " /")) : s && s.html ? t.push(s.html) : e.type === "emoji" && t.push(this.renderEmoji(e)), s && s.tag && t.push(this.renderClosingTag(s.tag)), e.marks && e.marks.slice(0).reverse().forEach((a) => {
|
|
295
|
+
const o = this.getMatchingMark(a);
|
|
296
|
+
o && t.push(this.renderClosingTag(o.tag));
|
|
297
|
+
}), t.join("");
|
|
217
298
|
}
|
|
218
|
-
renderTag(e,
|
|
219
|
-
return e.constructor === String ? `<${e}${
|
|
220
|
-
if (
|
|
221
|
-
return `<${
|
|
299
|
+
renderTag(e, t) {
|
|
300
|
+
return e.constructor === String ? `<${e}${t}>` : e.map((s) => {
|
|
301
|
+
if (s.constructor === String)
|
|
302
|
+
return `<${s}${t}>`;
|
|
222
303
|
{
|
|
223
|
-
let
|
|
224
|
-
if (
|
|
225
|
-
for (const
|
|
226
|
-
const
|
|
227
|
-
|
|
304
|
+
let a = `<${s.tag}`;
|
|
305
|
+
if (s.attrs)
|
|
306
|
+
for (const o in s.attrs) {
|
|
307
|
+
const i = s.attrs[o];
|
|
308
|
+
i !== null && (a += ` ${o}="${i}"`);
|
|
228
309
|
}
|
|
229
|
-
return `${
|
|
310
|
+
return `${a}${t}>`;
|
|
230
311
|
}
|
|
231
312
|
}).join("");
|
|
232
313
|
}
|
|
@@ -234,93 +315,109 @@ class Z {
|
|
|
234
315
|
return this.renderTag(e, "");
|
|
235
316
|
}
|
|
236
317
|
renderClosingTag(e) {
|
|
237
|
-
return e.constructor === String ? `</${e}>` : e.slice(0).reverse().map((
|
|
318
|
+
return e.constructor === String ? `</${e}>` : e.slice(0).reverse().map((t) => t.constructor === String ? `</${t}>` : `</${t.tag}>`).join("");
|
|
238
319
|
}
|
|
239
320
|
getMatchingNode(e) {
|
|
240
|
-
const
|
|
241
|
-
if (typeof
|
|
242
|
-
return
|
|
321
|
+
const t = this.nodes[e.type];
|
|
322
|
+
if (typeof t == "function")
|
|
323
|
+
return t(e);
|
|
243
324
|
}
|
|
244
325
|
getMatchingMark(e) {
|
|
245
|
-
const
|
|
246
|
-
if (typeof
|
|
247
|
-
return
|
|
326
|
+
const t = this.marks[e.type];
|
|
327
|
+
if (typeof t == "function")
|
|
328
|
+
return t(e);
|
|
329
|
+
}
|
|
330
|
+
renderEmoji(e) {
|
|
331
|
+
if (e.attrs.emoji)
|
|
332
|
+
return e.attrs.emoji;
|
|
333
|
+
const t = [
|
|
334
|
+
{
|
|
335
|
+
tag: "img",
|
|
336
|
+
attrs: {
|
|
337
|
+
src: e.attrs.fallbackImage,
|
|
338
|
+
draggable: "false",
|
|
339
|
+
loading: "lazy",
|
|
340
|
+
align: "absmiddle"
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
];
|
|
344
|
+
return this.renderTag(t, " /");
|
|
248
345
|
}
|
|
249
346
|
}
|
|
250
|
-
const
|
|
251
|
-
if (typeof
|
|
347
|
+
const me = (r) => {
|
|
348
|
+
if (typeof r != "object" || typeof r._editable > "u")
|
|
252
349
|
return {};
|
|
253
350
|
const e = JSON.parse(
|
|
254
|
-
|
|
351
|
+
r._editable.replace(/^<!--#storyblok#/, "").replace(/-->$/, "")
|
|
255
352
|
);
|
|
256
353
|
return {
|
|
257
354
|
"data-blok-c": JSON.stringify(e),
|
|
258
355
|
"data-blok-uid": e.id + "-" + e.uid
|
|
259
356
|
};
|
|
260
357
|
};
|
|
261
|
-
let
|
|
262
|
-
const
|
|
263
|
-
|
|
264
|
-
let
|
|
265
|
-
return
|
|
266
|
-
|
|
358
|
+
let fe;
|
|
359
|
+
const de = "https://app.storyblok.com/f/storyblok-v2-latest.js", he = (r, e) => {
|
|
360
|
+
r.addNode("blok", (t) => {
|
|
361
|
+
let s = "";
|
|
362
|
+
return t.attrs.body.forEach((a) => {
|
|
363
|
+
s += e(a.component, a);
|
|
267
364
|
}), {
|
|
268
|
-
html:
|
|
365
|
+
html: s
|
|
269
366
|
};
|
|
270
367
|
});
|
|
271
|
-
},
|
|
272
|
-
let
|
|
273
|
-
if (!
|
|
368
|
+
}, pe = (r, e, t) => {
|
|
369
|
+
let s = t || fe;
|
|
370
|
+
if (!s) {
|
|
274
371
|
console.error(
|
|
275
372
|
"Please initialize the Storyblok SDK before calling the renderRichText function"
|
|
276
373
|
);
|
|
277
374
|
return;
|
|
278
375
|
}
|
|
279
|
-
return
|
|
376
|
+
return r === "" ? "" : r ? (e && (s = new ue(e.schema), e.resolver && he(s, e.resolver)), s.render(r)) : (console.warn(`${r} is not a valid Richtext object. This might be because the value of the richtext field is empty.
|
|
280
377
|
|
|
281
378
|
For more info about the richtext object check https://github.com/storyblok/storyblok-js#rendering-rich-text`), "");
|
|
282
|
-
},
|
|
283
|
-
function
|
|
379
|
+
}, be = () => z(de);
|
|
380
|
+
function ye() {
|
|
284
381
|
return globalThis.storyblokApiInstance || console.error("storyblokApiInstance has not been initialized correctly"), globalThis.storyblokApiInstance;
|
|
285
382
|
}
|
|
286
|
-
function
|
|
287
|
-
const
|
|
288
|
-
if (!
|
|
383
|
+
function ke(r, e) {
|
|
384
|
+
const t = globalThis.storyblokApiInstance.richTextResolver;
|
|
385
|
+
if (!t) {
|
|
289
386
|
console.error(
|
|
290
387
|
"Please initialize the Storyblok SDK before calling the renderRichText function"
|
|
291
388
|
);
|
|
292
389
|
return;
|
|
293
390
|
}
|
|
294
|
-
return
|
|
391
|
+
return pe(r, e, t);
|
|
295
392
|
}
|
|
296
|
-
function
|
|
393
|
+
function $e(r) {
|
|
297
394
|
const e = {
|
|
298
395
|
useCustomApi: !1,
|
|
299
396
|
bridge: !0,
|
|
300
|
-
...
|
|
397
|
+
...r
|
|
301
398
|
};
|
|
302
399
|
return {
|
|
303
400
|
name: "@storyblok/astro",
|
|
304
401
|
hooks: {
|
|
305
|
-
"astro:config:setup": ({ injectScript:
|
|
306
|
-
|
|
402
|
+
"astro:config:setup": ({ injectScript: t, updateConfig: s }) => {
|
|
403
|
+
s({
|
|
307
404
|
vite: {
|
|
308
405
|
plugins: [
|
|
309
|
-
|
|
406
|
+
A(
|
|
310
407
|
e.accessToken,
|
|
311
408
|
e.useCustomApi,
|
|
312
409
|
e.apiOptions
|
|
313
410
|
),
|
|
314
|
-
|
|
411
|
+
L(e.components)
|
|
315
412
|
]
|
|
316
413
|
}
|
|
317
|
-
}),
|
|
414
|
+
}), t(
|
|
318
415
|
"page-ssr",
|
|
319
416
|
`
|
|
320
417
|
import { storyblokApiInstance } from "virtual:storyblok-init";
|
|
321
418
|
globalThis.storyblokApiInstance = storyblokApiInstance;
|
|
322
419
|
`
|
|
323
|
-
), e.bridge &&
|
|
420
|
+
), e.bridge && t(
|
|
324
421
|
"page",
|
|
325
422
|
`
|
|
326
423
|
import { loadStoryblokBridge } from "@storyblok/astro";
|
|
@@ -341,11 +438,11 @@ function le(t) {
|
|
|
341
438
|
};
|
|
342
439
|
}
|
|
343
440
|
export {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
441
|
+
ue as RichTextResolver,
|
|
442
|
+
ce as RichTextSchema,
|
|
443
|
+
$e as default,
|
|
444
|
+
be as loadStoryblokBridge,
|
|
445
|
+
ke as renderRichText,
|
|
446
|
+
me as storyblokEditable,
|
|
447
|
+
ye as useStoryblokApi
|
|
351
448
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storyblok/astro",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.16",
|
|
4
4
|
"description": "Official Astro integration for the Storyblok Headless CMS",
|
|
5
5
|
"main": "./dist/storyblok-astro.js",
|
|
6
6
|
"module": "./dist/storyblok-astro.mjs",
|
|
@@ -28,19 +28,19 @@
|
|
|
28
28
|
"prepublishOnly": "npm run build && cp ../README.md ./"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@storyblok/js": "^2.1.
|
|
31
|
+
"@storyblok/js": "^2.1.3",
|
|
32
32
|
"camelcase": "^7.0.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@cypress/vite-dev-server": "^5.0.4",
|
|
36
36
|
"@rollup/plugin-dynamic-import-vars": "^2.0.3",
|
|
37
|
-
"@types/node": "18.15.
|
|
38
|
-
"astro": "2.1.
|
|
39
|
-
"cypress": "^12.
|
|
37
|
+
"@types/node": "18.15.11",
|
|
38
|
+
"astro": "2.1.8",
|
|
39
|
+
"cypress": "^12.9.0",
|
|
40
40
|
"eslint-plugin-cypress": "^2.12.1",
|
|
41
41
|
"start-server-and-test": "^2.0.0",
|
|
42
42
|
"typescript": "4.9.5",
|
|
43
|
-
"vite": "^4.1
|
|
43
|
+
"vite": "^4.2.1",
|
|
44
44
|
"vite-plugin-dts": "^2.1.0"
|
|
45
45
|
},
|
|
46
46
|
"repository": {
|