@storyblok/vue 8.1.10 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{FallbackComponent-U_HRL08c.js → FallbackComponent-Dky11gEu.js} +2 -2
- package/dist/__tests__/test.d.ts +0 -0
- package/dist/components/FallbackComponent.vue.d.ts +1 -1
- package/dist/components/StoryblokComponent.vue.d.ts +3 -1
- package/dist/storyblok-vue.js +3 -3
- package/dist/storyblok-vue.mjs +384 -356
- package/package.json +35 -17
package/dist/storyblok-vue.mjs
CHANGED
|
@@ -4,76 +4,76 @@
|
|
|
4
4
|
* description: SDK to integrate Storyblok into your project using Vue.
|
|
5
5
|
* author: Storyblok
|
|
6
6
|
*/
|
|
7
|
-
import { defineComponent as
|
|
8
|
-
let
|
|
9
|
-
const z = [],
|
|
7
|
+
import { defineComponent as J, ref as O, resolveDynamicComponent as H, inject as he, createBlock as K, openBlock as Y, mergeProps as ue, h as W, createTextVNode as de, watch as pe, onMounted as ge, defineAsyncComponent as me } from "vue";
|
|
8
|
+
let B = !1;
|
|
9
|
+
const z = [], fe = (s) => new Promise((e, t) => {
|
|
10
10
|
if (typeof window > "u" || (window.storyblokRegisterEvent = (o) => {
|
|
11
11
|
if (window.location === window.parent.location) {
|
|
12
12
|
console.warn("You are not in Draft Mode or in the Visual Editor.");
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
B ? o() : z.push(o);
|
|
16
16
|
}, document.getElementById("storyblok-javascript-bridge")))
|
|
17
17
|
return;
|
|
18
18
|
const r = document.createElement("script");
|
|
19
19
|
r.async = !0, r.src = s, r.id = "storyblok-javascript-bridge", r.onerror = (o) => t(o), r.onload = (o) => {
|
|
20
|
-
z.forEach((n) => n()),
|
|
20
|
+
z.forEach((n) => n()), B = !0, e(o);
|
|
21
21
|
}, document.getElementsByTagName("head")[0].appendChild(r);
|
|
22
22
|
});
|
|
23
|
-
var
|
|
24
|
-
class
|
|
23
|
+
var ye = Object.defineProperty, be = (s, e, t) => e in s ? ye(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, g = (s, e, t) => be(s, typeof e != "symbol" ? e + "" : e, t);
|
|
24
|
+
class ke extends Error {
|
|
25
25
|
constructor(e) {
|
|
26
26
|
super(e), this.name = "AbortError";
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function ve(s, e, t) {
|
|
30
30
|
if (!Number.isFinite(e))
|
|
31
31
|
throw new TypeError("Expected `limit` to be a finite number");
|
|
32
32
|
if (!Number.isFinite(t))
|
|
33
33
|
throw new TypeError("Expected `interval` to be a finite number");
|
|
34
34
|
const r = [];
|
|
35
|
-
let o = [], n = 0,
|
|
35
|
+
let o = [], n = 0, a = !1;
|
|
36
36
|
const l = async () => {
|
|
37
37
|
n++;
|
|
38
38
|
const h = r.shift();
|
|
39
39
|
if (h)
|
|
40
40
|
try {
|
|
41
|
-
const
|
|
42
|
-
h.resolve(
|
|
43
|
-
} catch (
|
|
44
|
-
h.reject(
|
|
41
|
+
const p = await s(...h.args);
|
|
42
|
+
h.resolve(p);
|
|
43
|
+
} catch (p) {
|
|
44
|
+
h.reject(p);
|
|
45
45
|
}
|
|
46
|
-
const
|
|
47
|
-
n--, r.length > 0 && l(), o = o.filter((
|
|
46
|
+
const d = setTimeout(() => {
|
|
47
|
+
n--, r.length > 0 && l(), o = o.filter((p) => p !== d);
|
|
48
48
|
}, t);
|
|
49
|
-
o.includes(
|
|
50
|
-
},
|
|
49
|
+
o.includes(d) || o.push(d);
|
|
50
|
+
}, i = (...h) => a ? Promise.reject(
|
|
51
51
|
new Error(
|
|
52
52
|
"Throttled function is already aborted and not accepting new promises"
|
|
53
53
|
)
|
|
54
|
-
) : new Promise((
|
|
54
|
+
) : new Promise((d, p) => {
|
|
55
55
|
r.push({
|
|
56
|
-
resolve:
|
|
57
|
-
reject:
|
|
56
|
+
resolve: d,
|
|
57
|
+
reject: p,
|
|
58
58
|
args: h
|
|
59
59
|
}), n < e && l();
|
|
60
60
|
});
|
|
61
|
-
return
|
|
62
|
-
|
|
63
|
-
(h) => h.reject(() => new
|
|
61
|
+
return i.abort = () => {
|
|
62
|
+
a = !0, o.forEach(clearTimeout), o = [], r.forEach(
|
|
63
|
+
(h) => h.reject(() => new ke("Throttle function aborted"))
|
|
64
64
|
), r.length = 0;
|
|
65
|
-
},
|
|
65
|
+
}, i;
|
|
66
66
|
}
|
|
67
|
-
class
|
|
67
|
+
class P {
|
|
68
68
|
constructor() {
|
|
69
|
-
|
|
69
|
+
g(this, "isCDNUrl", (e = "") => e.includes("/cdn/")), g(this, "getOptionsPage", (e, t = 25, r = 1) => ({
|
|
70
70
|
...e,
|
|
71
71
|
per_page: t,
|
|
72
72
|
page: r
|
|
73
|
-
})),
|
|
73
|
+
})), g(this, "delay", (e) => new Promise((t) => setTimeout(t, e))), g(this, "arrayFrom", (e = 0, t) => Array.from({ length: e }, t)), g(this, "range", (e = 0, t = e) => {
|
|
74
74
|
const r = Math.abs(t - e) || 0, o = e < t ? 1 : -1;
|
|
75
|
-
return this.arrayFrom(r, (n,
|
|
76
|
-
}),
|
|
75
|
+
return this.arrayFrom(r, (n, a) => a * o + e);
|
|
76
|
+
}), g(this, "asyncMap", async (e, t) => Promise.all(e.map(t))), g(this, "flatMap", (e = [], t) => e.map(t).reduce((r, o) => [...r, ...o], [])), g(this, "escapeHTML", function(e) {
|
|
77
77
|
const t = {
|
|
78
78
|
"&": "&",
|
|
79
79
|
"<": "<",
|
|
@@ -96,13 +96,13 @@ class L {
|
|
|
96
96
|
for (const n in e) {
|
|
97
97
|
if (!Object.prototype.hasOwnProperty.call(e, n))
|
|
98
98
|
continue;
|
|
99
|
-
const
|
|
100
|
-
let
|
|
101
|
-
typeof
|
|
102
|
-
|
|
99
|
+
const a = e[n], l = r ? "" : encodeURIComponent(n);
|
|
100
|
+
let i;
|
|
101
|
+
typeof a == "object" ? i = this.stringify(
|
|
102
|
+
a,
|
|
103
103
|
t ? t + encodeURIComponent(`[${l}]`) : l,
|
|
104
|
-
Array.isArray(
|
|
105
|
-
) :
|
|
104
|
+
Array.isArray(a)
|
|
105
|
+
) : i = `${t ? t + encodeURIComponent(`[${l}]`) : l}=${encodeURIComponent(a)}`, o.push(i);
|
|
106
106
|
}
|
|
107
107
|
return o.join("&");
|
|
108
108
|
}
|
|
@@ -112,7 +112,7 @@ class L {
|
|
|
112
112
|
* @return {string} The base URL of the region
|
|
113
113
|
*/
|
|
114
114
|
getRegionURL(e) {
|
|
115
|
-
const t = "api.storyblok.com", r = "api-us.storyblok.com", o = "app.storyblokchina.cn", n = "api-ap.storyblok.com",
|
|
115
|
+
const t = "api.storyblok.com", r = "api-us.storyblok.com", o = "app.storyblokchina.cn", n = "api-ap.storyblok.com", a = "api-ca.storyblok.com";
|
|
116
116
|
switch (e) {
|
|
117
117
|
case "us":
|
|
118
118
|
return r;
|
|
@@ -121,26 +121,26 @@ class L {
|
|
|
121
121
|
case "ap":
|
|
122
122
|
return n;
|
|
123
123
|
case "ca":
|
|
124
|
-
return
|
|
124
|
+
return a;
|
|
125
125
|
default:
|
|
126
126
|
return t;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
const
|
|
130
|
+
const $e = function(s, e) {
|
|
131
131
|
const t = {};
|
|
132
132
|
for (const r in s) {
|
|
133
133
|
const o = s[r];
|
|
134
134
|
e.includes(r) && o !== null && (t[r] = o);
|
|
135
135
|
}
|
|
136
136
|
return t;
|
|
137
|
-
},
|
|
137
|
+
}, we = (s) => s === "email", Te = () => ({
|
|
138
138
|
singleTag: "hr"
|
|
139
|
-
}),
|
|
139
|
+
}), Re = () => ({
|
|
140
140
|
tag: "blockquote"
|
|
141
|
-
}),
|
|
141
|
+
}), _e = () => ({
|
|
142
142
|
tag: "ul"
|
|
143
|
-
}),
|
|
143
|
+
}), Ee = (s) => ({
|
|
144
144
|
tag: [
|
|
145
145
|
"pre",
|
|
146
146
|
{
|
|
@@ -148,24 +148,24 @@ const ye = function(s, e) {
|
|
|
148
148
|
attrs: s.attrs
|
|
149
149
|
}
|
|
150
150
|
]
|
|
151
|
-
}),
|
|
151
|
+
}), Se = () => ({
|
|
152
152
|
singleTag: "br"
|
|
153
|
-
}),
|
|
153
|
+
}), je = (s) => ({
|
|
154
154
|
tag: `h${s.attrs.level}`
|
|
155
|
-
}),
|
|
155
|
+
}), Ae = (s) => ({
|
|
156
156
|
singleTag: [
|
|
157
157
|
{
|
|
158
158
|
tag: "img",
|
|
159
|
-
attrs:
|
|
159
|
+
attrs: $e(s.attrs, ["src", "alt", "title"])
|
|
160
160
|
}
|
|
161
161
|
]
|
|
162
|
-
}),
|
|
162
|
+
}), xe = () => ({
|
|
163
163
|
tag: "li"
|
|
164
|
-
}),
|
|
164
|
+
}), Ie = () => ({
|
|
165
165
|
tag: "ol"
|
|
166
|
-
}),
|
|
166
|
+
}), Ce = () => ({
|
|
167
167
|
tag: "p"
|
|
168
|
-
}),
|
|
168
|
+
}), Le = (s) => ({
|
|
169
169
|
tag: [
|
|
170
170
|
{
|
|
171
171
|
tag: "span",
|
|
@@ -176,25 +176,25 @@ const ye = function(s, e) {
|
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
]
|
|
179
|
-
}),
|
|
179
|
+
}), Oe = () => ({
|
|
180
180
|
tag: "b"
|
|
181
|
-
}),
|
|
181
|
+
}), Pe = () => ({
|
|
182
182
|
tag: "s"
|
|
183
|
-
}),
|
|
183
|
+
}), Ne = () => ({
|
|
184
184
|
tag: "u"
|
|
185
|
-
}),
|
|
185
|
+
}), Me = () => ({
|
|
186
186
|
tag: "strong"
|
|
187
|
-
}),
|
|
187
|
+
}), He = () => ({
|
|
188
188
|
tag: "code"
|
|
189
|
-
}),
|
|
189
|
+
}), De = () => ({
|
|
190
190
|
tag: "i"
|
|
191
|
-
}),
|
|
191
|
+
}), Ue = (s) => {
|
|
192
192
|
if (!s.attrs)
|
|
193
193
|
return {
|
|
194
194
|
tag: ""
|
|
195
195
|
};
|
|
196
|
-
const e = new
|
|
197
|
-
if (delete t.linktype, t.href && (t.href = e(s.attrs.href || "")),
|
|
196
|
+
const e = new P().escapeHTML, t = { ...s.attrs }, { linktype: r = "url" } = s.attrs;
|
|
197
|
+
if (delete t.linktype, t.href && (t.href = e(s.attrs.href || "")), we(r) && (t.href = `mailto:${t.href}`), t.anchor && (t.href = `${t.href}#${t.anchor}`, delete t.anchor), t.custom) {
|
|
198
198
|
for (const o in t.custom)
|
|
199
199
|
t[o] = t.custom[o];
|
|
200
200
|
delete t.custom;
|
|
@@ -207,25 +207,25 @@ const ye = function(s, e) {
|
|
|
207
207
|
}
|
|
208
208
|
]
|
|
209
209
|
};
|
|
210
|
-
},
|
|
210
|
+
}, Be = (s) => ({
|
|
211
211
|
tag: [
|
|
212
212
|
{
|
|
213
213
|
tag: "span",
|
|
214
214
|
attrs: s.attrs
|
|
215
215
|
}
|
|
216
216
|
]
|
|
217
|
-
}),
|
|
217
|
+
}), ze = () => ({
|
|
218
218
|
tag: "sub"
|
|
219
|
-
}),
|
|
219
|
+
}), Fe = () => ({
|
|
220
220
|
tag: "sup"
|
|
221
|
-
}),
|
|
221
|
+
}), qe = (s) => ({
|
|
222
222
|
tag: [
|
|
223
223
|
{
|
|
224
224
|
tag: "span",
|
|
225
225
|
attrs: s.attrs
|
|
226
226
|
}
|
|
227
227
|
]
|
|
228
|
-
}),
|
|
228
|
+
}), Ve = (s) => {
|
|
229
229
|
var e;
|
|
230
230
|
return (e = s.attrs) != null && e.color ? {
|
|
231
231
|
tag: [
|
|
@@ -239,7 +239,7 @@ const ye = function(s, e) {
|
|
|
239
239
|
} : {
|
|
240
240
|
tag: ""
|
|
241
241
|
};
|
|
242
|
-
},
|
|
242
|
+
}, Ge = (s) => {
|
|
243
243
|
var e;
|
|
244
244
|
return (e = s.attrs) != null && e.color ? {
|
|
245
245
|
tag: [
|
|
@@ -253,36 +253,36 @@ const ye = function(s, e) {
|
|
|
253
253
|
} : {
|
|
254
254
|
tag: ""
|
|
255
255
|
};
|
|
256
|
-
},
|
|
256
|
+
}, Je = {
|
|
257
257
|
nodes: {
|
|
258
|
-
horizontal_rule:
|
|
259
|
-
blockquote:
|
|
260
|
-
bullet_list:
|
|
261
|
-
code_block:
|
|
262
|
-
hard_break:
|
|
263
|
-
heading:
|
|
264
|
-
image:
|
|
265
|
-
list_item:
|
|
266
|
-
ordered_list:
|
|
267
|
-
paragraph:
|
|
268
|
-
emoji:
|
|
258
|
+
horizontal_rule: Te,
|
|
259
|
+
blockquote: Re,
|
|
260
|
+
bullet_list: _e,
|
|
261
|
+
code_block: Ee,
|
|
262
|
+
hard_break: Se,
|
|
263
|
+
heading: je,
|
|
264
|
+
image: Ae,
|
|
265
|
+
list_item: xe,
|
|
266
|
+
ordered_list: Ie,
|
|
267
|
+
paragraph: Ce,
|
|
268
|
+
emoji: Le
|
|
269
269
|
},
|
|
270
270
|
marks: {
|
|
271
|
-
bold:
|
|
272
|
-
strike:
|
|
273
|
-
underline:
|
|
274
|
-
strong:
|
|
275
|
-
code:
|
|
276
|
-
italic:
|
|
277
|
-
link:
|
|
278
|
-
styled:
|
|
279
|
-
subscript:
|
|
280
|
-
superscript:
|
|
281
|
-
anchor:
|
|
282
|
-
highlight:
|
|
283
|
-
textStyle:
|
|
284
|
-
}
|
|
285
|
-
},
|
|
271
|
+
bold: Oe,
|
|
272
|
+
strike: Pe,
|
|
273
|
+
underline: Ne,
|
|
274
|
+
strong: Me,
|
|
275
|
+
code: He,
|
|
276
|
+
italic: De,
|
|
277
|
+
link: Ue,
|
|
278
|
+
styled: Be,
|
|
279
|
+
subscript: ze,
|
|
280
|
+
superscript: Fe,
|
|
281
|
+
anchor: qe,
|
|
282
|
+
highlight: Ve,
|
|
283
|
+
textStyle: Ge
|
|
284
|
+
}
|
|
285
|
+
}, Ke = function(s) {
|
|
286
286
|
const e = {
|
|
287
287
|
"&": "&",
|
|
288
288
|
"<": "<",
|
|
@@ -293,9 +293,9 @@ const ye = function(s, e) {
|
|
|
293
293
|
return s && r.test(s) ? s.replace(t, (o) => e[o]) : s;
|
|
294
294
|
};
|
|
295
295
|
let F = !1;
|
|
296
|
-
class
|
|
296
|
+
class N {
|
|
297
297
|
constructor(e) {
|
|
298
|
-
|
|
298
|
+
g(this, "marks"), g(this, "nodes"), e || (e = Je), this.marks = e.marks || [], this.nodes = e.nodes || [];
|
|
299
299
|
}
|
|
300
300
|
addNode(e, t) {
|
|
301
301
|
this.nodes[e] = t;
|
|
@@ -340,34 +340,34 @@ class Ve {
|
|
|
340
340
|
), "";
|
|
341
341
|
}
|
|
342
342
|
optimizeImages(e, t) {
|
|
343
|
-
let r = 0, o = 0, n = "",
|
|
344
|
-
typeof t != "boolean" && (typeof t.width == "number" && t.width > 0 && (n += `width="${t.width}" `, r = t.width), typeof t.height == "number" && t.height > 0 && (n += `height="${t.height}" `, o = t.height), (t.loading === "lazy" || t.loading === "eager") && (n += `loading="${t.loading}" `), typeof t.class == "string" && t.class.length > 0 && (n += `class="${t.class}" `), t.filters && (typeof t.filters.blur == "number" && t.filters.blur >= 0 && t.filters.blur <= 100 && (
|
|
345
|
-
const l = r > 0 || o > 0 ||
|
|
343
|
+
let r = 0, o = 0, n = "", a = "";
|
|
344
|
+
typeof t != "boolean" && (typeof t.width == "number" && t.width > 0 && (n += `width="${t.width}" `, r = t.width), typeof t.height == "number" && t.height > 0 && (n += `height="${t.height}" `, o = t.height), (t.loading === "lazy" || t.loading === "eager") && (n += `loading="${t.loading}" `), typeof t.class == "string" && t.class.length > 0 && (n += `class="${t.class}" `), t.filters && (typeof t.filters.blur == "number" && t.filters.blur >= 0 && t.filters.blur <= 100 && (a += `:blur(${t.filters.blur})`), typeof t.filters.brightness == "number" && t.filters.brightness >= -100 && t.filters.brightness <= 100 && (a += `:brightness(${t.filters.brightness})`), t.filters.fill && (t.filters.fill.match(/[0-9A-F]{6}/gi) || t.filters.fill === "transparent") && (a += `:fill(${t.filters.fill})`), t.filters.format && ["webp", "png", "jpeg"].includes(t.filters.format) && (a += `:format(${t.filters.format})`), typeof t.filters.grayscale == "boolean" && t.filters.grayscale && (a += ":grayscale()"), typeof t.filters.quality == "number" && t.filters.quality >= 0 && t.filters.quality <= 100 && (a += `:quality(${t.filters.quality})`), t.filters.rotate && [90, 180, 270].includes(t.filters.rotate) && (a += `:rotate(${t.filters.rotate})`), a.length > 0 && (a = `/filters${a}`))), n.length > 0 && (e = e.replace(/<img/g, `<img ${n.trim()}`));
|
|
345
|
+
const l = r > 0 || o > 0 || a.length > 0 ? `${r}x${o}${a}` : "";
|
|
346
346
|
return e = e.replace(
|
|
347
347
|
/a.storyblok.com\/f\/(\d+)\/([^.]+)\.(gif|jpg|jpeg|png|tif|bmp)/g,
|
|
348
348
|
`a.storyblok.com/f/$1/$2.$3/m/${l}`
|
|
349
|
-
), typeof t != "boolean" && (t.sizes || t.srcset) && (e = e.replace(/<img.*?src=["|'](.*?)["|']/g, (
|
|
350
|
-
var h,
|
|
351
|
-
const
|
|
349
|
+
), typeof t != "boolean" && (t.sizes || t.srcset) && (e = e.replace(/<img.*?src=["|'](.*?)["|']/g, (i) => {
|
|
350
|
+
var h, d;
|
|
351
|
+
const p = i.match(
|
|
352
352
|
/a.storyblok.com\/f\/(\d+)\/([^.]+)\.(gif|jpg|jpeg|png|tif|bmp)/g
|
|
353
353
|
);
|
|
354
|
-
if (
|
|
355
|
-
const
|
|
356
|
-
srcset: (h = t.srcset) == null ? void 0 : h.map((
|
|
357
|
-
if (typeof
|
|
358
|
-
return `//${
|
|
359
|
-
if (typeof
|
|
360
|
-
let
|
|
361
|
-
return typeof
|
|
354
|
+
if (p && p.length > 0) {
|
|
355
|
+
const b = {
|
|
356
|
+
srcset: (h = t.srcset) == null ? void 0 : h.map((w) => {
|
|
357
|
+
if (typeof w == "number")
|
|
358
|
+
return `//${p}/m/${w}x0${a} ${w}w`;
|
|
359
|
+
if (typeof w == "object" && w.length === 2) {
|
|
360
|
+
let E = 0, j = 0;
|
|
361
|
+
return typeof w[0] == "number" && (E = w[0]), typeof w[1] == "number" && (j = w[1]), `//${p}/m/${E}x${j}${a} ${E}w`;
|
|
362
362
|
}
|
|
363
363
|
return "";
|
|
364
364
|
}).join(", "),
|
|
365
|
-
sizes: (
|
|
365
|
+
sizes: (d = t.sizes) == null ? void 0 : d.map((w) => w).join(", ")
|
|
366
366
|
};
|
|
367
|
-
let
|
|
368
|
-
return
|
|
367
|
+
let v = "";
|
|
368
|
+
return b.srcset && (v += `srcset="${b.srcset}" `), b.sizes && (v += `sizes="${b.sizes}" `), i.replace(/<img/g, `<img ${v.trim()}`);
|
|
369
369
|
}
|
|
370
|
-
return
|
|
370
|
+
return i;
|
|
371
371
|
})), e;
|
|
372
372
|
}
|
|
373
373
|
renderNode(e) {
|
|
@@ -379,7 +379,7 @@ class Ve {
|
|
|
379
379
|
const r = this.getMatchingNode(e);
|
|
380
380
|
return r && r.tag && t.push(this.renderOpeningTag(r.tag)), e.content ? e.content.forEach((o) => {
|
|
381
381
|
t.push(this.renderNode(o));
|
|
382
|
-
}) : e.text ? t.push(
|
|
382
|
+
}) : e.text ? t.push(Ke(e.text)) : r && r.singleTag ? t.push(this.renderTag(r.singleTag, " /")) : r && r.html ? t.push(r.html) : e.type === "emoji" && t.push(this.renderEmoji(e)), r && r.tag && t.push(this.renderClosingTag(r.tag)), e.marks && e.marks.slice(0).reverse().forEach((o) => {
|
|
383
383
|
const n = this.getMatchingMark(o);
|
|
384
384
|
n && n.tag !== "" && t.push(this.renderClosingTag(n.tag));
|
|
385
385
|
}), t.join("");
|
|
@@ -393,8 +393,8 @@ class Ve {
|
|
|
393
393
|
if (r.attrs) {
|
|
394
394
|
for (const n in r.attrs)
|
|
395
395
|
if (Object.prototype.hasOwnProperty.call(r.attrs, n)) {
|
|
396
|
-
const
|
|
397
|
-
|
|
396
|
+
const a = r.attrs[n];
|
|
397
|
+
a !== null && (o += ` ${n}="${a}"`);
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
return `${o}${t}>`;
|
|
@@ -434,10 +434,9 @@ class Ve {
|
|
|
434
434
|
return this.renderTag(t, " /");
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
|
-
|
|
438
|
-
class Ge {
|
|
437
|
+
class Ye {
|
|
439
438
|
constructor(e) {
|
|
440
|
-
|
|
439
|
+
g(this, "baseURL"), g(this, "timeout"), g(this, "headers"), g(this, "responseInterceptor"), g(this, "fetch"), g(this, "ejectInterceptor"), g(this, "url"), g(this, "parameters"), g(this, "fetchOptions"), this.baseURL = e.baseURL, this.headers = e.headers || new Headers(), this.timeout = e != null && e.timeout ? e.timeout * 1e3 : 0, this.responseInterceptor = e.responseInterceptor, this.fetch = (...t) => e.fetch ? e.fetch(...t) : fetch(...t), this.ejectInterceptor = !1, this.url = "", this.parameters = {}, this.fetchOptions = {};
|
|
441
440
|
}
|
|
442
441
|
/**
|
|
443
442
|
*
|
|
@@ -474,31 +473,31 @@ class Ge {
|
|
|
474
473
|
async _methodHandler(e) {
|
|
475
474
|
let t = `${this.baseURL}${this.url}`, r = null;
|
|
476
475
|
if (e === "get") {
|
|
477
|
-
const
|
|
478
|
-
t = `${this.baseURL}${this.url}?${
|
|
476
|
+
const i = new P();
|
|
477
|
+
t = `${this.baseURL}${this.url}?${i.stringify(
|
|
479
478
|
this.parameters
|
|
480
479
|
)}`;
|
|
481
480
|
} else
|
|
482
481
|
r = JSON.stringify(this.parameters);
|
|
483
|
-
const o = new URL(t), n = new AbortController(), { signal:
|
|
482
|
+
const o = new URL(t), n = new AbortController(), { signal: a } = n;
|
|
484
483
|
let l;
|
|
485
484
|
this.timeout && (l = setTimeout(() => n.abort(), this.timeout));
|
|
486
485
|
try {
|
|
487
|
-
const
|
|
486
|
+
const i = await this.fetch(`${o}`, {
|
|
488
487
|
method: e,
|
|
489
488
|
headers: this.headers,
|
|
490
489
|
body: r,
|
|
491
|
-
signal:
|
|
490
|
+
signal: a,
|
|
492
491
|
...this.fetchOptions
|
|
493
492
|
});
|
|
494
493
|
this.timeout && clearTimeout(l);
|
|
495
494
|
const h = await this._responseHandler(
|
|
496
|
-
|
|
495
|
+
i
|
|
497
496
|
);
|
|
498
497
|
return this.responseInterceptor && !this.ejectInterceptor ? this._statusHandler(this.responseInterceptor(h)) : this._statusHandler(h);
|
|
499
|
-
} catch (
|
|
498
|
+
} catch (i) {
|
|
500
499
|
return {
|
|
501
|
-
message:
|
|
500
|
+
message: i
|
|
502
501
|
};
|
|
503
502
|
}
|
|
504
503
|
}
|
|
@@ -522,39 +521,39 @@ class Ge {
|
|
|
522
521
|
});
|
|
523
522
|
}
|
|
524
523
|
}
|
|
525
|
-
const
|
|
524
|
+
const q = "SB-Agent", D = {
|
|
526
525
|
defaultAgentName: "SB-JS-CLIENT",
|
|
527
526
|
defaultAgentVersion: "SB-Agent-Version",
|
|
528
527
|
packageVersion: "6.0.0"
|
|
529
528
|
};
|
|
530
529
|
let C = {};
|
|
531
|
-
const
|
|
532
|
-
class
|
|
530
|
+
const S = {};
|
|
531
|
+
class We {
|
|
533
532
|
/**
|
|
534
533
|
*
|
|
535
534
|
* @param config ISbConfig interface
|
|
536
535
|
* @param pEndpoint string, optional
|
|
537
536
|
*/
|
|
538
537
|
constructor(e, t) {
|
|
539
|
-
|
|
538
|
+
g(this, "client"), g(this, "maxRetries"), g(this, "retriesDelay"), g(this, "throttle"), g(this, "accessToken"), g(this, "cache"), g(this, "helpers"), g(this, "resolveCounter"), g(this, "relations"), g(this, "links"), g(this, "richTextResolver"), g(this, "resolveNestedRelations"), g(this, "stringifiedStoriesCache");
|
|
540
539
|
let r = e.endpoint || t;
|
|
541
540
|
if (!r) {
|
|
542
|
-
const
|
|
543
|
-
e.oauthToken ? r = `${l}://${
|
|
541
|
+
const a = new P().getRegionURL, l = e.https === !1 ? "http" : "https";
|
|
542
|
+
e.oauthToken ? r = `${l}://${a(e.region)}/v1` : r = `${l}://${a(e.region)}/v2`;
|
|
544
543
|
}
|
|
545
544
|
const o = new Headers();
|
|
546
|
-
o.set("Content-Type", "application/json"), o.set("Accept", "application/json"), e.headers && (e.headers.constructor.name === "Headers" ? e.headers.entries().toArray() : Object.entries(e.headers)).forEach(([
|
|
547
|
-
o.set(
|
|
548
|
-
}), o.has(
|
|
549
|
-
|
|
550
|
-
|
|
545
|
+
o.set("Content-Type", "application/json"), o.set("Accept", "application/json"), e.headers && (e.headers.constructor.name === "Headers" ? e.headers.entries().toArray() : Object.entries(e.headers)).forEach(([a, l]) => {
|
|
546
|
+
o.set(a, l);
|
|
547
|
+
}), o.has(q) || (o.set(q, D.defaultAgentName), o.set(
|
|
548
|
+
D.defaultAgentVersion,
|
|
549
|
+
D.packageVersion
|
|
551
550
|
));
|
|
552
551
|
let n = 5;
|
|
553
|
-
e.oauthToken && (o.set("Authorization", e.oauthToken), n = 3), e.rateLimit && (n = e.rateLimit), e.richTextSchema ? this.richTextResolver = new
|
|
552
|
+
e.oauthToken && (o.set("Authorization", e.oauthToken), n = 3), e.rateLimit && (n = e.rateLimit), e.richTextSchema ? this.richTextResolver = new N(e.richTextSchema) : this.richTextResolver = new N(), e.componentResolver && this.setComponentResolver(e.componentResolver), this.maxRetries = e.maxRetries || 10, this.retriesDelay = 300, this.throttle = ve(
|
|
554
553
|
this.throttledRequest.bind(this),
|
|
555
554
|
n,
|
|
556
555
|
1e3
|
|
557
|
-
), this.accessToken = e.accessToken || "", this.relations = {}, this.links = {}, this.cache = e.cache || { clear: "manual" }, this.helpers = new
|
|
556
|
+
), this.accessToken = e.accessToken || "", this.relations = {}, this.links = {}, this.cache = e.cache || { clear: "manual" }, this.helpers = new P(), this.resolveCounter = 0, this.resolveNestedRelations = e.resolveNestedRelations || !0, this.stringifiedStoriesCache = {}, this.client = new Ye({
|
|
558
557
|
baseURL: r,
|
|
559
558
|
timeout: e.timeout || 0,
|
|
560
559
|
headers: o,
|
|
@@ -573,17 +572,17 @@ class Je {
|
|
|
573
572
|
});
|
|
574
573
|
}
|
|
575
574
|
parseParams(e) {
|
|
576
|
-
return e.token || (e.token = this.getToken()), e.cv || (e.cv =
|
|
575
|
+
return e.token || (e.token = this.getToken()), e.cv || (e.cv = S[e.token]), Array.isArray(e.resolve_relations) && (e.resolve_relations = e.resolve_relations.join(",")), typeof e.resolve_relations < "u" && (e.resolve_level = 2), e;
|
|
577
576
|
}
|
|
578
577
|
factoryParamOptions(e, t) {
|
|
579
578
|
return this.helpers.isCDNUrl(e) ? this.parseParams(t) : t;
|
|
580
579
|
}
|
|
581
580
|
makeRequest(e, t, r, o, n) {
|
|
582
|
-
const
|
|
581
|
+
const a = this.factoryParamOptions(
|
|
583
582
|
e,
|
|
584
583
|
this.helpers.getOptionsPage(t, r, o)
|
|
585
584
|
);
|
|
586
|
-
return this.cacheResponse(e,
|
|
585
|
+
return this.cacheResponse(e, a, void 0, n);
|
|
587
586
|
}
|
|
588
587
|
get(e, t, r) {
|
|
589
588
|
t || (t = {});
|
|
@@ -591,17 +590,17 @@ class Je {
|
|
|
591
590
|
return this.cacheResponse(o, n, void 0, r);
|
|
592
591
|
}
|
|
593
592
|
async getAll(e, t, r, o) {
|
|
594
|
-
const n = (t == null ? void 0 : t.per_page) || 25,
|
|
595
|
-
|
|
593
|
+
const n = (t == null ? void 0 : t.per_page) || 25, a = `/${e}`.replace(/\/$/, ""), l = r ?? a.substring(a.lastIndexOf("/") + 1), i = 1, h = await this.makeRequest(
|
|
594
|
+
a,
|
|
596
595
|
t,
|
|
597
596
|
n,
|
|
598
|
-
|
|
597
|
+
i,
|
|
599
598
|
o
|
|
600
|
-
),
|
|
601
|
-
this.helpers.range(
|
|
602
|
-
(
|
|
599
|
+
), d = h.total ? Math.ceil(h.total / n) : 1, p = await this.helpers.asyncMap(
|
|
600
|
+
this.helpers.range(i, d),
|
|
601
|
+
(b) => this.makeRequest(a, t, n, b + 1, o)
|
|
603
602
|
);
|
|
604
|
-
return this.helpers.flatMap([h, ...
|
|
603
|
+
return this.helpers.flatMap([h, ...p], (b) => Object.values(b.data[l]));
|
|
605
604
|
}
|
|
606
605
|
post(e, t, r) {
|
|
607
606
|
const o = `/${e}`;
|
|
@@ -687,7 +686,7 @@ class Je {
|
|
|
687
686
|
* allowing flexible specification of relation patterns.
|
|
688
687
|
*/
|
|
689
688
|
_insertRelations(e, t, r, o) {
|
|
690
|
-
if (Array.isArray(r) ? r.find((
|
|
689
|
+
if (Array.isArray(r) ? r.find((a) => a.endsWith(`.${t}`)) : r.endsWith(`.${t}`)) {
|
|
691
690
|
this._resolveField(e, t, o);
|
|
692
691
|
return;
|
|
693
692
|
}
|
|
@@ -701,14 +700,14 @@ class Je {
|
|
|
701
700
|
* @param resolveId - The unique identifier for the current resolution context
|
|
702
701
|
*/
|
|
703
702
|
iterateTree(e, t, r) {
|
|
704
|
-
const o = (n,
|
|
703
|
+
const o = (n, a = "") => {
|
|
705
704
|
if (!(!n || n._stopResolving)) {
|
|
706
705
|
if (Array.isArray(n))
|
|
707
|
-
n.forEach((l,
|
|
706
|
+
n.forEach((l, i) => o(l, `${a}[${i}]`));
|
|
708
707
|
else if (typeof n == "object")
|
|
709
708
|
for (const l in n) {
|
|
710
|
-
const
|
|
711
|
-
(n.component && n._uid || n.type === "link") && (this._insertRelations(n, l, t, r), this._insertLinks(n, l, r)), o(n[l],
|
|
709
|
+
const i = a ? `${a}.${l}` : l;
|
|
710
|
+
(n.component && n._uid || n.type === "link") && (this._insertRelations(n, l, t, r), this._insertLinks(n, l, r)), o(n[l], i);
|
|
712
711
|
}
|
|
713
712
|
}
|
|
714
713
|
};
|
|
@@ -717,17 +716,18 @@ class Je {
|
|
|
717
716
|
async resolveLinks(e, t, r) {
|
|
718
717
|
let o = [];
|
|
719
718
|
if (e.link_uuids) {
|
|
720
|
-
const n = e.link_uuids.length,
|
|
721
|
-
for (let
|
|
722
|
-
const h = Math.min(n,
|
|
723
|
-
|
|
719
|
+
const n = e.link_uuids.length, a = [], l = 50;
|
|
720
|
+
for (let i = 0; i < n; i += l) {
|
|
721
|
+
const h = Math.min(n, i + l);
|
|
722
|
+
a.push(e.link_uuids.slice(i, h));
|
|
724
723
|
}
|
|
725
|
-
for (let
|
|
724
|
+
for (let i = 0; i < a.length; i++)
|
|
726
725
|
(await this.getStories({
|
|
727
726
|
per_page: l,
|
|
728
727
|
language: t.language,
|
|
729
728
|
version: t.version,
|
|
730
|
-
|
|
729
|
+
starts_with: t.starts_with,
|
|
730
|
+
by_uuids: a[i].join(",")
|
|
731
731
|
})).data.stories.forEach(
|
|
732
732
|
(h) => {
|
|
733
733
|
o.push(h);
|
|
@@ -745,17 +745,18 @@ class Je {
|
|
|
745
745
|
async resolveRelations(e, t, r) {
|
|
746
746
|
let o = [];
|
|
747
747
|
if (e.rel_uuids) {
|
|
748
|
-
const n = e.rel_uuids.length,
|
|
749
|
-
for (let
|
|
750
|
-
const h = Math.min(n,
|
|
751
|
-
|
|
748
|
+
const n = e.rel_uuids.length, a = [], l = 50;
|
|
749
|
+
for (let i = 0; i < n; i += l) {
|
|
750
|
+
const h = Math.min(n, i + l);
|
|
751
|
+
a.push(e.rel_uuids.slice(i, h));
|
|
752
752
|
}
|
|
753
|
-
for (let
|
|
753
|
+
for (let i = 0; i < a.length; i++)
|
|
754
754
|
(await this.getStories({
|
|
755
755
|
per_page: l,
|
|
756
756
|
language: t.language,
|
|
757
757
|
version: t.version,
|
|
758
|
-
|
|
758
|
+
starts_with: t.starts_with,
|
|
759
|
+
by_uuids: a[i].join(","),
|
|
759
760
|
excluding_fields: t.excluding_fields
|
|
760
761
|
})).data.stories.forEach((h) => {
|
|
761
762
|
o.push(h);
|
|
@@ -780,51 +781,53 @@ class Je {
|
|
|
780
781
|
*/
|
|
781
782
|
async resolveStories(e, t, r) {
|
|
782
783
|
var o, n;
|
|
783
|
-
let
|
|
784
|
-
if (this.links[r] = {}, this.relations[r] = {}, typeof t.resolve_relations < "u" && t.resolve_relations.length > 0 && (typeof t.resolve_relations == "string" && (
|
|
784
|
+
let a = [];
|
|
785
|
+
if (this.links[r] = {}, this.relations[r] = {}, typeof t.resolve_relations < "u" && t.resolve_relations.length > 0 && (typeof t.resolve_relations == "string" && (a = t.resolve_relations.split(",")), await this.resolveRelations(e, t, r)), t.resolve_links && ["1", "story", "url", "link"].includes(t.resolve_links) && ((o = e.links) != null && o.length || (n = e.link_uuids) != null && n.length) && await this.resolveLinks(e, t, r), this.resolveNestedRelations)
|
|
785
786
|
for (const l in this.relations[r])
|
|
786
787
|
this.iterateTree(
|
|
787
788
|
this.relations[r][l],
|
|
788
|
-
|
|
789
|
+
a,
|
|
789
790
|
r
|
|
790
791
|
);
|
|
791
|
-
e.story ? this.iterateTree(e.story,
|
|
792
|
-
this.iterateTree(l,
|
|
792
|
+
e.story ? this.iterateTree(e.story, a, r) : e.stories.forEach((l) => {
|
|
793
|
+
this.iterateTree(l, a, r);
|
|
793
794
|
}), this.stringifiedStoriesCache = {}, delete this.links[r], delete this.relations[r];
|
|
794
795
|
}
|
|
795
796
|
async cacheResponse(e, t, r, o) {
|
|
796
|
-
const n = this.helpers.stringify({ url: e, params: t }),
|
|
797
|
-
if (
|
|
798
|
-
const l = await
|
|
797
|
+
const n = this.helpers.stringify({ url: e, params: t }), a = this.cacheProvider();
|
|
798
|
+
if (t.version === "published" && e !== "/cdn/spaces/me") {
|
|
799
|
+
const l = await a.get(n);
|
|
799
800
|
if (l)
|
|
800
801
|
return Promise.resolve(l);
|
|
801
802
|
}
|
|
802
|
-
return new Promise(async (l,
|
|
803
|
+
return new Promise(async (l, i) => {
|
|
803
804
|
var h;
|
|
804
805
|
try {
|
|
805
|
-
const
|
|
806
|
+
const d = await this.throttle(
|
|
806
807
|
"get",
|
|
807
808
|
e,
|
|
808
809
|
t,
|
|
809
810
|
o
|
|
810
811
|
);
|
|
811
|
-
if (
|
|
812
|
-
return
|
|
813
|
-
let
|
|
814
|
-
if ((h =
|
|
815
|
-
perPage:
|
|
816
|
-
total:
|
|
817
|
-
})),
|
|
818
|
-
const
|
|
819
|
-
await this.resolveStories(
|
|
812
|
+
if (d.status !== 200)
|
|
813
|
+
return i(d);
|
|
814
|
+
let p = { data: d.data, headers: d.headers };
|
|
815
|
+
if ((h = d.headers) != null && h["per-page"] && (p = Object.assign({}, p, {
|
|
816
|
+
perPage: d.headers["per-page"] ? Number.parseInt(d.headers["per-page"]) : 0,
|
|
817
|
+
total: d.headers["per-page"] ? Number.parseInt(d.headers.total) : 0
|
|
818
|
+
})), p.data.story || p.data.stories) {
|
|
819
|
+
const v = this.resolveCounter = ++this.resolveCounter % 1e3;
|
|
820
|
+
await this.resolveStories(p.data, t, `${v}`);
|
|
820
821
|
}
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
822
|
+
t.version === "published" && e !== "/cdn/spaces/me" && await a.set(n, p);
|
|
823
|
+
const b = this.cache.clear === "onpreview" && t.version === "draft" || this.cache.clear === "auto";
|
|
824
|
+
return t.token && p.data.cv && (b && S[t.token] && S[t.token] !== p.data.cv && await this.flushCache(), S[t.token] = p.data.cv), l(p);
|
|
825
|
+
} catch (d) {
|
|
826
|
+
if (d.response && d.status === 429 && (r = typeof r > "u" ? 0 : r + 1, r < this.maxRetries))
|
|
824
827
|
return console.log(
|
|
825
828
|
`Hit rate limit. Retrying in ${this.retriesDelay / 1e3} seconds.`
|
|
826
|
-
), await this.helpers.delay(this.retriesDelay), this.cacheResponse(e, t, r).then(l).catch(
|
|
827
|
-
|
|
829
|
+
), await this.helpers.delay(this.retriesDelay), this.cacheResponse(e, t, r).then(l).catch(i);
|
|
830
|
+
i(d);
|
|
828
831
|
}
|
|
829
832
|
});
|
|
830
833
|
}
|
|
@@ -832,16 +835,16 @@ class Je {
|
|
|
832
835
|
return this.client.setFetchOptions(o), this.client[e](t, r);
|
|
833
836
|
}
|
|
834
837
|
cacheVersions() {
|
|
835
|
-
return
|
|
838
|
+
return S;
|
|
836
839
|
}
|
|
837
840
|
cacheVersion() {
|
|
838
|
-
return
|
|
841
|
+
return S[this.accessToken];
|
|
839
842
|
}
|
|
840
843
|
setCacheVersion(e) {
|
|
841
|
-
this.accessToken && (
|
|
844
|
+
this.accessToken && (S[this.accessToken] = e);
|
|
842
845
|
}
|
|
843
846
|
clearCacheVersion() {
|
|
844
|
-
this.accessToken && (
|
|
847
|
+
this.accessToken && (S[this.accessToken] = 0);
|
|
845
848
|
}
|
|
846
849
|
cacheProvider() {
|
|
847
850
|
switch (this.cache.type) {
|
|
@@ -863,6 +866,7 @@ class Je {
|
|
|
863
866
|
case "custom":
|
|
864
867
|
if (this.cache.custom)
|
|
865
868
|
return this.cache.custom;
|
|
869
|
+
// eslint-disable-next-line no-fallthrough
|
|
866
870
|
default:
|
|
867
871
|
return {
|
|
868
872
|
get() {
|
|
@@ -884,7 +888,7 @@ class Je {
|
|
|
884
888
|
return await this.cacheProvider().flush(), this.clearCacheVersion(), this;
|
|
885
889
|
}
|
|
886
890
|
}
|
|
887
|
-
const
|
|
891
|
+
const dt = (s = {}) => {
|
|
888
892
|
const { apiOptions: e } = s;
|
|
889
893
|
if (!e || !e.accessToken) {
|
|
890
894
|
console.error(
|
|
@@ -892,8 +896,8 @@ const ht = (s = {}) => {
|
|
|
892
896
|
);
|
|
893
897
|
return;
|
|
894
898
|
}
|
|
895
|
-
return { storyblokApi: new
|
|
896
|
-
},
|
|
899
|
+
return { storyblokApi: new We(e) };
|
|
900
|
+
}, Xe = (s) => {
|
|
897
901
|
if (typeof s != "object" || typeof s._editable > "u")
|
|
898
902
|
return {};
|
|
899
903
|
try {
|
|
@@ -908,25 +912,25 @@ const ht = (s = {}) => {
|
|
|
908
912
|
return {};
|
|
909
913
|
}
|
|
910
914
|
};
|
|
911
|
-
function
|
|
915
|
+
function Qe(s, e) {
|
|
912
916
|
if (!e)
|
|
913
917
|
return { src: s, attrs: {} };
|
|
914
918
|
let t = 0, r = 0;
|
|
915
919
|
const o = {}, n = [];
|
|
916
|
-
function i
|
|
917
|
-
typeof
|
|
920
|
+
function a(i, h, d, p, b) {
|
|
921
|
+
typeof i != "number" || i <= h || i >= d ? console.warn(`[StoryblokRichText] - ${p.charAt(0).toUpperCase() + p.slice(1)} value must be a number between ${h} and ${d} (inclusive)`) : b.push(`${p}(${i})`);
|
|
918
922
|
}
|
|
919
923
|
if (typeof e == "object") {
|
|
920
924
|
if (typeof e.width == "number" && e.width > 0 ? (o.width = e.width, t = e.width) : console.warn("[StoryblokRichText] - Width value must be a number greater than 0"), e.height && typeof e.height == "number" && e.height > 0 ? (o.height = e.height, r = e.height) : console.warn("[StoryblokRichText] - Height value must be a number greater than 0"), e.loading && ["lazy", "eager"].includes(e.loading) && (o.loading = e.loading), e.class && (o.class = e.class), e.filters) {
|
|
921
|
-
const { filters:
|
|
922
|
-
h &&
|
|
925
|
+
const { filters: i } = e || {}, { blur: h, brightness: d, fill: p, format: b, grayscale: v, quality: w, rotate: E } = i || {};
|
|
926
|
+
h && a(h, 0, 100, "blur", n), w && a(w, 0, 100, "quality", n), d && a(d, 0, 100, "brightness", n), p && n.push(`fill(${p})`), v && n.push("grayscale()"), E && [0, 90, 180, 270].includes(e.filters.rotate || 0) && n.push(`rotate(${E})`), b && ["webp", "png", "jpeg"].includes(b) && n.push(`format(${b})`);
|
|
923
927
|
}
|
|
924
|
-
e.srcset && (o.srcset = e.srcset.map((
|
|
925
|
-
if (typeof
|
|
926
|
-
return `${s}/m/${
|
|
927
|
-
if (Array.isArray(
|
|
928
|
-
const [h,
|
|
929
|
-
return `${s}/m/${h}x${
|
|
928
|
+
e.srcset && (o.srcset = e.srcset.map((i) => {
|
|
929
|
+
if (typeof i == "number")
|
|
930
|
+
return `${s}/m/${i}x0/${n.length > 0 ? `filters:${n.join(":")}` : ""} ${i}w`;
|
|
931
|
+
if (Array.isArray(i) && i.length === 2) {
|
|
932
|
+
const [h, d] = i;
|
|
933
|
+
return `${s}/m/${h}x${d}/${n.length > 0 ? `filters:${n.join(":")}` : ""} ${h}w`;
|
|
930
934
|
} else {
|
|
931
935
|
console.warn("[StoryblokRichText] - srcset entry must be a number or a tuple of two numbers");
|
|
932
936
|
return;
|
|
@@ -939,8 +943,8 @@ function We(s, e) {
|
|
|
939
943
|
attrs: o
|
|
940
944
|
};
|
|
941
945
|
}
|
|
942
|
-
var
|
|
943
|
-
const
|
|
946
|
+
var k = /* @__PURE__ */ ((s) => (s.DOCUMENT = "doc", s.HEADING = "heading", s.PARAGRAPH = "paragraph", s.QUOTE = "blockquote", s.OL_LIST = "ordered_list", s.UL_LIST = "bullet_list", s.LIST_ITEM = "list_item", s.CODE_BLOCK = "code_block", s.HR = "horizontal_rule", s.BR = "hard_break", s.IMAGE = "image", s.EMOJI = "emoji", s.COMPONENT = "blok", s.TABLE = "table", s.TABLE_ROW = "tableRow", s.TABLE_CELL = "tableCell", s.TABLE_HEADER = "tableHeader", s))(k || {}), _ = /* @__PURE__ */ ((s) => (s.BOLD = "bold", s.STRONG = "strong", s.STRIKE = "strike", s.UNDERLINE = "underline", s.ITALIC = "italic", s.CODE = "code", s.LINK = "link", s.ANCHOR = "anchor", s.STYLED = "styled", s.SUPERSCRIPT = "superscript", s.SUBSCRIPT = "subscript", s.TEXT_STYLE = "textStyle", s.HIGHLIGHT = "highlight", s))(_ || {}), X = /* @__PURE__ */ ((s) => (s.TEXT = "text", s))(X || {}), A = /* @__PURE__ */ ((s) => (s.URL = "url", s.STORY = "story", s.ASSET = "asset", s.EMAIL = "email", s))(A || {});
|
|
947
|
+
const Ze = [
|
|
944
948
|
"area",
|
|
945
949
|
"base",
|
|
946
950
|
"br",
|
|
@@ -955,180 +959,204 @@ const Xe = [
|
|
|
955
959
|
"source",
|
|
956
960
|
"track",
|
|
957
961
|
"wbr"
|
|
958
|
-
],
|
|
959
|
-
function
|
|
962
|
+
], et = (s = {}) => Object.keys(s).map((e) => `${e}="${s[e]}"`).join(" "), tt = (s = {}) => Object.keys(s).map((e) => `${e}: ${s[e]}`).join("; ");
|
|
963
|
+
function rt(s) {
|
|
960
964
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
961
965
|
}
|
|
962
|
-
const
|
|
966
|
+
const L = (s) => Object.fromEntries(Object.entries(s).filter(([e, t]) => t !== void 0));
|
|
963
967
|
function V(s, e = {}, t) {
|
|
964
|
-
const r =
|
|
968
|
+
const r = et(e), o = r ? `${s} ${r}` : s, n = Array.isArray(t) ? t.join("") : t || "";
|
|
965
969
|
if (s) {
|
|
966
|
-
if (
|
|
970
|
+
if (Ze.includes(s))
|
|
967
971
|
return `<${o}>`;
|
|
968
972
|
} else return n;
|
|
969
973
|
return `<${o}>${n}</${s}>`;
|
|
970
974
|
}
|
|
971
|
-
function
|
|
975
|
+
function st(s = {}) {
|
|
972
976
|
let e = 0;
|
|
973
977
|
const {
|
|
974
978
|
renderFn: t = V,
|
|
975
|
-
textFn: r =
|
|
979
|
+
textFn: r = rt,
|
|
976
980
|
resolvers: o = {},
|
|
977
981
|
optimizeImages: n = !1,
|
|
978
|
-
keyedResolvers:
|
|
979
|
-
} = s, l = t !== V,
|
|
980
|
-
const m =
|
|
981
|
-
return
|
|
982
|
+
keyedResolvers: a = !1
|
|
983
|
+
} = s, l = t !== V, i = (c) => (u) => {
|
|
984
|
+
const m = u.attrs || {};
|
|
985
|
+
return a && (m.key = `${c}-${e}`), t(c, m, u.children || null);
|
|
982
986
|
}, h = (c) => {
|
|
983
|
-
const { src:
|
|
984
|
-
let
|
|
987
|
+
const { src: u, alt: m, title: y, srcset: R, sizes: $ } = c.attrs || {};
|
|
988
|
+
let f = u, T = {};
|
|
985
989
|
if (n) {
|
|
986
|
-
const { src:
|
|
987
|
-
|
|
990
|
+
const { src: le, attrs: ce } = Qe(u, n);
|
|
991
|
+
f = le, T = ce;
|
|
988
992
|
}
|
|
989
|
-
|
|
990
|
-
...
|
|
993
|
+
a && (T = {
|
|
994
|
+
...T,
|
|
991
995
|
key: `img-${e}`
|
|
992
996
|
});
|
|
993
|
-
const
|
|
994
|
-
src:
|
|
997
|
+
const ie = {
|
|
998
|
+
src: f,
|
|
995
999
|
alt: m,
|
|
996
|
-
title:
|
|
1000
|
+
title: y,
|
|
997
1001
|
srcset: R,
|
|
998
1002
|
sizes: $,
|
|
999
|
-
...
|
|
1003
|
+
...T
|
|
1000
1004
|
};
|
|
1001
|
-
return t("img",
|
|
1002
|
-
},
|
|
1003
|
-
const { level:
|
|
1005
|
+
return t("img", L(ie));
|
|
1006
|
+
}, d = (c) => {
|
|
1007
|
+
const { level: u, ...m } = c.attrs || {}, y = {
|
|
1004
1008
|
...m
|
|
1005
1009
|
};
|
|
1006
|
-
return
|
|
1007
|
-
},
|
|
1008
|
-
var
|
|
1010
|
+
return a && (y.key = `h${u}-${e}`), t(`h${u}`, y, c.children);
|
|
1011
|
+
}, p = (c) => {
|
|
1012
|
+
var u, m, y, R;
|
|
1009
1013
|
const $ = t("img", {
|
|
1010
|
-
src: (
|
|
1014
|
+
src: (u = c.attrs) == null ? void 0 : u.fallbackImage,
|
|
1011
1015
|
alt: (m = c.attrs) == null ? void 0 : m.alt,
|
|
1012
1016
|
style: "width: 1.25em; height: 1.25em; vertical-align: text-top",
|
|
1013
1017
|
draggable: "false",
|
|
1014
1018
|
loading: "lazy"
|
|
1015
|
-
}),
|
|
1019
|
+
}), f = {
|
|
1016
1020
|
"data-type": "emoji",
|
|
1017
|
-
"data-name": (
|
|
1021
|
+
"data-name": (y = c.attrs) == null ? void 0 : y.name,
|
|
1018
1022
|
"data-emoji": (R = c.attrs) == null ? void 0 : R.emoji
|
|
1019
1023
|
};
|
|
1020
|
-
return
|
|
1021
|
-
},
|
|
1024
|
+
return a && (f.key = `emoji-${e}`), t("span", f, $);
|
|
1025
|
+
}, b = (c) => t("pre", {
|
|
1022
1026
|
...c.attrs,
|
|
1023
1027
|
key: `code-${e}`
|
|
1024
|
-
}, t("code", { key: `code-${e}` }, c.children || "")),
|
|
1025
|
-
const { class: R, id: $, ...
|
|
1028
|
+
}, t("code", { key: `code-${e}` }, c.children || "")), v = (c, u = !1) => ({ text: m, attrs: y }) => {
|
|
1029
|
+
const { class: R, id: $, ...f } = y || {}, T = u ? {
|
|
1026
1030
|
class: R,
|
|
1027
1031
|
id: $,
|
|
1028
|
-
style:
|
|
1029
|
-
} :
|
|
1030
|
-
return
|
|
1031
|
-
},
|
|
1032
|
-
const { marks:
|
|
1033
|
-
return "text" in c ?
|
|
1034
|
-
(
|
|
1032
|
+
style: tt(f) || void 0
|
|
1033
|
+
} : y || {};
|
|
1034
|
+
return a && (T.key = `${c}-${e}`), t(c, L(T), m);
|
|
1035
|
+
}, w = (c) => M(c), E = (c) => {
|
|
1036
|
+
const { marks: u, ...m } = c;
|
|
1037
|
+
return "text" in c ? u ? u.reduce(
|
|
1038
|
+
(y, R) => w({ ...R, text: y }),
|
|
1035
1039
|
// Fix: Ensure render function returns a string
|
|
1036
|
-
|
|
1040
|
+
w({ ...m, children: m.children })
|
|
1037
1041
|
// Fix: Cast children to string
|
|
1038
1042
|
) : r(m.text) : "";
|
|
1039
1043
|
}, j = (c) => {
|
|
1040
|
-
const { linktype:
|
|
1044
|
+
const { linktype: u, href: m, anchor: y, ...R } = c.attrs || {};
|
|
1041
1045
|
let $ = "";
|
|
1042
|
-
switch (
|
|
1043
|
-
case
|
|
1044
|
-
case
|
|
1046
|
+
switch (u) {
|
|
1047
|
+
case A.ASSET:
|
|
1048
|
+
case A.URL:
|
|
1045
1049
|
$ = m;
|
|
1046
1050
|
break;
|
|
1047
|
-
case
|
|
1051
|
+
case A.EMAIL:
|
|
1048
1052
|
$ = `mailto:${m}`;
|
|
1049
1053
|
break;
|
|
1050
|
-
case
|
|
1051
|
-
$ = m,
|
|
1054
|
+
case A.STORY:
|
|
1055
|
+
$ = m, y && ($ = `${$}#${y}`);
|
|
1052
1056
|
break;
|
|
1053
1057
|
default:
|
|
1054
1058
|
$ = m;
|
|
1055
1059
|
break;
|
|
1056
1060
|
}
|
|
1057
|
-
const
|
|
1058
|
-
return $ && (
|
|
1061
|
+
const f = { ...R };
|
|
1062
|
+
return $ && (f.href = $), a && (f.key = `a-${e}`), t("a", f, c.text);
|
|
1059
1063
|
}, te = (c) => {
|
|
1060
|
-
var
|
|
1064
|
+
var u, m;
|
|
1061
1065
|
return console.warn("[StoryblokRichtText] - BLOK resolver is not available for vanilla usage"), t("span", {
|
|
1062
|
-
blok: (
|
|
1066
|
+
blok: (u = c == null ? void 0 : c.attrs) == null ? void 0 : u.body[0],
|
|
1063
1067
|
id: (m = c.attrs) == null ? void 0 : m.id,
|
|
1064
1068
|
key: `component-${e}`,
|
|
1065
1069
|
style: "display: none"
|
|
1066
1070
|
});
|
|
1067
|
-
}, re =
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
[
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
[
|
|
1089
|
-
[
|
|
1090
|
-
[
|
|
1091
|
-
[
|
|
1092
|
-
[
|
|
1093
|
-
[
|
|
1094
|
-
|
|
1071
|
+
}, re = (c) => {
|
|
1072
|
+
const u = {};
|
|
1073
|
+
return a && (u.key = `table-${e}`), t("table", u, c.children);
|
|
1074
|
+
}, se = (c) => {
|
|
1075
|
+
const u = {};
|
|
1076
|
+
return a && (u.key = `tr-${e}`), t("tr", u, c.children);
|
|
1077
|
+
}, oe = (c) => {
|
|
1078
|
+
const { colspan: u, rowspan: m, colwidth: y, backgroundColor: R, ...$ } = c.attrs || {}, f = {
|
|
1079
|
+
...$
|
|
1080
|
+
};
|
|
1081
|
+
u > 1 && (f.colspan = u), m > 1 && (f.rowspan = m);
|
|
1082
|
+
const T = [];
|
|
1083
|
+
return y && T.push(`width: ${y}px;`), R && T.push(`background-color: ${R};`), T.length > 0 && (f.style = T.join(" ")), a && (f.key = `td-${e}`), t("td", L(f), c.children);
|
|
1084
|
+
}, ne = (c) => {
|
|
1085
|
+
const { colspan: u, rowspan: m, colwidth: y, backgroundColor: R, ...$ } = c.attrs || {}, f = {
|
|
1086
|
+
...$
|
|
1087
|
+
};
|
|
1088
|
+
u > 1 && (f.colspan = u), m > 1 && (f.rowspan = m);
|
|
1089
|
+
const T = [];
|
|
1090
|
+
return y && T.push(`width: ${y}px;`), R && T.push(`background-color: ${R};`), T.length > 0 && (f.style = T.join(" ")), a && (f.key = `th-${e}`), t("th", L(f), c.children);
|
|
1091
|
+
}, ae = new Map([
|
|
1092
|
+
[k.DOCUMENT, i("")],
|
|
1093
|
+
[k.HEADING, d],
|
|
1094
|
+
[k.PARAGRAPH, i("p")],
|
|
1095
|
+
[k.UL_LIST, i("ul")],
|
|
1096
|
+
[k.OL_LIST, i("ol")],
|
|
1097
|
+
[k.LIST_ITEM, i("li")],
|
|
1098
|
+
[k.IMAGE, h],
|
|
1099
|
+
[k.EMOJI, p],
|
|
1100
|
+
[k.CODE_BLOCK, b],
|
|
1101
|
+
[k.HR, i("hr")],
|
|
1102
|
+
[k.BR, i("br")],
|
|
1103
|
+
[k.QUOTE, i("blockquote")],
|
|
1104
|
+
[k.COMPONENT, te],
|
|
1105
|
+
[X.TEXT, E],
|
|
1106
|
+
[_.LINK, j],
|
|
1107
|
+
[_.ANCHOR, j],
|
|
1108
|
+
[_.STYLED, v("span", !0)],
|
|
1109
|
+
[_.BOLD, v("strong")],
|
|
1110
|
+
[_.TEXT_STYLE, v("span", !0)],
|
|
1111
|
+
[_.ITALIC, v("em")],
|
|
1112
|
+
[_.UNDERLINE, v("u")],
|
|
1113
|
+
[_.STRIKE, v("s")],
|
|
1114
|
+
[_.CODE, v("code")],
|
|
1115
|
+
[_.SUPERSCRIPT, v("sup")],
|
|
1116
|
+
[_.SUBSCRIPT, v("sub")],
|
|
1117
|
+
[_.HIGHLIGHT, v("mark")],
|
|
1118
|
+
[k.TABLE, re],
|
|
1119
|
+
[k.TABLE_ROW, se],
|
|
1120
|
+
[k.TABLE_CELL, oe],
|
|
1121
|
+
[k.TABLE_HEADER, ne],
|
|
1122
|
+
...Object.entries(o).map(([c, u]) => [c, u])
|
|
1095
1123
|
]);
|
|
1096
|
-
function
|
|
1124
|
+
function I(c) {
|
|
1097
1125
|
e += 1;
|
|
1098
|
-
const
|
|
1099
|
-
if (!
|
|
1126
|
+
const u = ae.get(c.type);
|
|
1127
|
+
if (!u)
|
|
1100
1128
|
return console.error("<Storyblok>", `No resolver found for node type ${c.type}`), "";
|
|
1101
1129
|
if (c.type === "text")
|
|
1102
|
-
return
|
|
1103
|
-
const m = c.content ? c.content.map(
|
|
1104
|
-
return
|
|
1130
|
+
return u(c);
|
|
1131
|
+
const m = c.content ? c.content.map(M) : void 0;
|
|
1132
|
+
return u({
|
|
1105
1133
|
...c,
|
|
1106
1134
|
children: m
|
|
1107
1135
|
// Fix: Update the type of 'children' to Node[]
|
|
1108
1136
|
});
|
|
1109
1137
|
}
|
|
1110
|
-
function
|
|
1111
|
-
return c.type === "doc" ? l ? c.content.map(
|
|
1138
|
+
function M(c) {
|
|
1139
|
+
return c.type === "doc" ? l ? c.content.map(I) : c.content.map(I).join("") : Array.isArray(c) ? c.map(I) : I(c);
|
|
1112
1140
|
}
|
|
1113
1141
|
return {
|
|
1114
|
-
render:
|
|
1142
|
+
render: M
|
|
1115
1143
|
};
|
|
1116
1144
|
}
|
|
1117
1145
|
let U, G = "https://app.storyblok.com/f/storyblok-v2-latest.js";
|
|
1118
|
-
const
|
|
1146
|
+
const ot = (s, e, t = {}) => {
|
|
1119
1147
|
var r;
|
|
1120
1148
|
const o = !(typeof window > "u") && typeof window.storyblokRegisterEvent < "u", n = new URL((r = window.location) == null ? void 0 : r.href).searchParams.get(
|
|
1121
1149
|
"_storyblok"
|
|
1122
|
-
),
|
|
1123
|
-
if (!(!o || !
|
|
1150
|
+
), a = n !== null && +n === s;
|
|
1151
|
+
if (!(!o || !a)) {
|
|
1124
1152
|
if (!s) {
|
|
1125
1153
|
console.warn("Story ID is not defined. Please provide a valid ID.");
|
|
1126
1154
|
return;
|
|
1127
1155
|
}
|
|
1128
1156
|
window.storyblokRegisterEvent(() => {
|
|
1129
1157
|
new window.StoryblokBridge(t).on(["input", "published", "change"], (l) => {
|
|
1130
|
-
var
|
|
1131
|
-
l && (l.action === "input" && ((
|
|
1158
|
+
var i;
|
|
1159
|
+
l && (l.action === "input" && ((i = l.story) == null ? void 0 : i.id) === s ? e(l.story) : (l.action === "change" || l.action === "published") && l.storyId === s && window.location.reload());
|
|
1132
1160
|
});
|
|
1133
1161
|
});
|
|
1134
1162
|
}
|
|
@@ -1141,28 +1169,28 @@ const rt = (s, e, t = {}) => {
|
|
|
1141
1169
|
html: r
|
|
1142
1170
|
};
|
|
1143
1171
|
});
|
|
1144
|
-
},
|
|
1172
|
+
}, nt = (s = {}) => {
|
|
1145
1173
|
var e, t;
|
|
1146
1174
|
const {
|
|
1147
1175
|
bridge: r,
|
|
1148
1176
|
accessToken: o,
|
|
1149
1177
|
use: n = [],
|
|
1150
|
-
apiOptions:
|
|
1178
|
+
apiOptions: a = {},
|
|
1151
1179
|
richText: l = {},
|
|
1152
|
-
bridgeUrl:
|
|
1180
|
+
bridgeUrl: i
|
|
1153
1181
|
} = s;
|
|
1154
|
-
|
|
1155
|
-
const h = { bridge: r, apiOptions:
|
|
1156
|
-
let
|
|
1157
|
-
n.forEach((
|
|
1158
|
-
|
|
1159
|
-
}),
|
|
1160
|
-
const
|
|
1161
|
-
return r !== !1 &&
|
|
1162
|
-
},
|
|
1182
|
+
a.accessToken = a.accessToken || o;
|
|
1183
|
+
const h = { bridge: r, apiOptions: a };
|
|
1184
|
+
let d = {};
|
|
1185
|
+
n.forEach((b) => {
|
|
1186
|
+
d = { ...d, ...b(h) };
|
|
1187
|
+
}), i && (G = i);
|
|
1188
|
+
const p = !(typeof window > "u") && ((t = (e = window.location) == null ? void 0 : e.search) == null ? void 0 : t.includes("_storyblok_tk"));
|
|
1189
|
+
return r !== !1 && p && fe(G), U = new N(l.schema), l.resolver && Q(U, l.resolver), d;
|
|
1190
|
+
}, at = (s) => {
|
|
1163
1191
|
var e;
|
|
1164
1192
|
return !s || !((e = s == null ? void 0 : s.content) != null && e.some((t) => t.content || t.type === "blok" || t.type === "horizontal_rule"));
|
|
1165
|
-
},
|
|
1193
|
+
}, pt = (s, e, t) => {
|
|
1166
1194
|
let r = t || U;
|
|
1167
1195
|
if (!r) {
|
|
1168
1196
|
console.error(
|
|
@@ -1170,8 +1198,8 @@ const rt = (s, e, t = {}) => {
|
|
|
1170
1198
|
);
|
|
1171
1199
|
return;
|
|
1172
1200
|
}
|
|
1173
|
-
return
|
|
1174
|
-
}, Z = /* @__PURE__ */
|
|
1201
|
+
return at(s) ? "" : (e && (r = new N(e.schema), e.resolver && Q(r, e.resolver)), r.render(s, {}, !1));
|
|
1202
|
+
}, Z = /* @__PURE__ */ J({
|
|
1175
1203
|
__name: "StoryblokComponent",
|
|
1176
1204
|
props: {
|
|
1177
1205
|
blok: {}
|
|
@@ -1181,17 +1209,17 @@ const rt = (s, e, t = {}) => {
|
|
|
1181
1209
|
e({
|
|
1182
1210
|
value: r
|
|
1183
1211
|
});
|
|
1184
|
-
const o = typeof
|
|
1185
|
-
return !o && n && (n.enableFallbackComponent ? (
|
|
1186
|
-
`Is the Fallback component "${
|
|
1212
|
+
const o = typeof H(t.blok.component) != "string", n = he("VueSDKOptions"), a = O(t.blok.component);
|
|
1213
|
+
return !o && n && (n.enableFallbackComponent ? (a.value = n.customFallbackComponent ?? "FallbackComponent", typeof H(a.value) == "string" && console.error(
|
|
1214
|
+
`Is the Fallback component "${a.value}" registered properly?`
|
|
1187
1215
|
)) : console.error(
|
|
1188
1216
|
`Component could not be found for blok "${t.blok.component}"! Is it defined in main.ts as "app.component("${t.blok.component}", ${t.blok.component});"?`
|
|
1189
|
-
)), (l,
|
|
1217
|
+
)), (l, i) => (Y(), K(H(a.value), ue({
|
|
1190
1218
|
ref_key: "blokRef",
|
|
1191
1219
|
ref: r
|
|
1192
1220
|
}, { ...l.$props, ...l.$attrs }), null, 16));
|
|
1193
1221
|
}
|
|
1194
|
-
}),
|
|
1222
|
+
}), it = (s) => {
|
|
1195
1223
|
var e, t;
|
|
1196
1224
|
return W(
|
|
1197
1225
|
Z,
|
|
@@ -1202,19 +1230,19 @@ const rt = (s, e, t = {}) => {
|
|
|
1202
1230
|
s.children
|
|
1203
1231
|
);
|
|
1204
1232
|
};
|
|
1205
|
-
function
|
|
1233
|
+
function lt(s) {
|
|
1206
1234
|
const e = {
|
|
1207
1235
|
renderFn: W,
|
|
1208
|
-
textFn:
|
|
1236
|
+
textFn: de,
|
|
1209
1237
|
keyedResolvers: !0,
|
|
1210
1238
|
resolvers: {
|
|
1211
|
-
[
|
|
1239
|
+
[k.COMPONENT]: it,
|
|
1212
1240
|
...s.resolvers
|
|
1213
1241
|
}
|
|
1214
1242
|
};
|
|
1215
|
-
return
|
|
1243
|
+
return st(e);
|
|
1216
1244
|
}
|
|
1217
|
-
const
|
|
1245
|
+
const ct = /* @__PURE__ */ J({
|
|
1218
1246
|
__name: "StoryblokRichText",
|
|
1219
1247
|
props: {
|
|
1220
1248
|
doc: {},
|
|
@@ -1222,20 +1250,20 @@ const at = /* @__PURE__ */ K({
|
|
|
1222
1250
|
},
|
|
1223
1251
|
setup(s) {
|
|
1224
1252
|
const e = s, t = O(), r = () => t.value;
|
|
1225
|
-
return
|
|
1226
|
-
const { render:
|
|
1253
|
+
return pe([() => e.doc, () => e.resolvers], ([o, n]) => {
|
|
1254
|
+
const { render: a } = lt({
|
|
1227
1255
|
resolvers: n ?? {}
|
|
1228
1256
|
});
|
|
1229
|
-
t.value =
|
|
1257
|
+
t.value = a(o);
|
|
1230
1258
|
}, {
|
|
1231
1259
|
immediate: !0,
|
|
1232
1260
|
deep: !0
|
|
1233
|
-
}), (o, n) => (
|
|
1261
|
+
}), (o, n) => (Y(), K(r));
|
|
1234
1262
|
}
|
|
1235
|
-
}),
|
|
1263
|
+
}), ht = {
|
|
1236
1264
|
beforeMount(s, e) {
|
|
1237
1265
|
if (e.value) {
|
|
1238
|
-
const t =
|
|
1266
|
+
const t = Xe(e.value);
|
|
1239
1267
|
Object.keys(t).length > 0 && (s.setAttribute("data-blok-c", t["data-blok-c"]), s.setAttribute("data-blok-uid", t["data-blok-uid"]), s.classList.add("storyblok__outline"));
|
|
1240
1268
|
}
|
|
1241
1269
|
}
|
|
@@ -1244,10 +1272,10 @@ const at = /* @__PURE__ */ K({
|
|
|
1244
1272
|
`);
|
|
1245
1273
|
};
|
|
1246
1274
|
let x = null;
|
|
1247
|
-
const
|
|
1275
|
+
const gt = () => (x || ee("useStoryblokApi"), x), mt = async (s, e = {}, t = {}) => {
|
|
1248
1276
|
const r = O(null);
|
|
1249
|
-
if (t.resolveRelations = t.resolveRelations ?? e.resolve_relations, t.resolveLinks = t.resolveLinks ?? e.resolve_links,
|
|
1250
|
-
r.value && r.value.id &&
|
|
1277
|
+
if (t.resolveRelations = t.resolveRelations ?? e.resolve_relations, t.resolveLinks = t.resolveLinks ?? e.resolve_links, ge(() => {
|
|
1278
|
+
r.value && r.value.id && ot(
|
|
1251
1279
|
r.value.id,
|
|
1252
1280
|
(o) => r.value = o,
|
|
1253
1281
|
t
|
|
@@ -1261,30 +1289,30 @@ const dt = () => (x || ee("useStoryblokApi"), x), pt = async (s, e = {}, t = {})
|
|
|
1261
1289
|
} else
|
|
1262
1290
|
ee("useStoryblok");
|
|
1263
1291
|
return r;
|
|
1264
|
-
},
|
|
1292
|
+
}, ft = {
|
|
1265
1293
|
install(s, e = {}) {
|
|
1266
|
-
s.directive("editable",
|
|
1294
|
+
s.directive("editable", ht), s.component("StoryblokComponent", Z), s.component("StoryblokRichText", ct), e.enableFallbackComponent && !e.customFallbackComponent && s.component(
|
|
1267
1295
|
"FallbackComponent",
|
|
1268
|
-
|
|
1296
|
+
me(() => import("./FallbackComponent-Dky11gEu.js"))
|
|
1269
1297
|
);
|
|
1270
|
-
const { storyblokApi: t } =
|
|
1298
|
+
const { storyblokApi: t } = nt(e);
|
|
1271
1299
|
x = t || null, s.provide("VueSDKOptions", e);
|
|
1272
1300
|
}
|
|
1273
1301
|
};
|
|
1274
1302
|
export {
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1303
|
+
k as BlockTypes,
|
|
1304
|
+
_ as MarkTypes,
|
|
1305
|
+
N as RichTextResolver,
|
|
1306
|
+
Je as RichTextSchema,
|
|
1279
1307
|
Z as StoryblokComponent,
|
|
1280
|
-
|
|
1281
|
-
|
|
1308
|
+
ct as StoryblokRichText,
|
|
1309
|
+
ft as StoryblokVue,
|
|
1282
1310
|
X as TextTypes,
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1311
|
+
dt as apiPlugin,
|
|
1312
|
+
pt as renderRichText,
|
|
1313
|
+
st as richTextResolver,
|
|
1314
|
+
mt as useStoryblok,
|
|
1315
|
+
gt as useStoryblokApi,
|
|
1316
|
+
ot as useStoryblokBridge,
|
|
1317
|
+
lt as useStoryblokRichText
|
|
1290
1318
|
};
|