@storyblok/astro 1.2.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,271 +1,234 @@
1
- import "axios";
2
- function k(r, e, t) {
3
- const o = "virtual:storyblok-init", n = "\0" + o;
1
+ function k(t, e, r) {
2
+ const o = "virtual:storyblok-init", s = "\0" + o;
4
3
  return {
5
4
  name: "vite-plugin-storyblok-init",
6
- async resolveId(s) {
7
- if (s === o)
8
- return n;
5
+ async resolveId(n) {
6
+ if (n === o)
7
+ return s;
9
8
  },
10
- async load(s) {
11
- if (s === n)
9
+ async load(n) {
10
+ if (n === s)
12
11
  return `
13
12
  import { storyblokInit, apiPlugin } from "@storyblok/js";
14
13
  const { storyblokApi } = storyblokInit({
15
- accessToken: "${r}",
14
+ accessToken: "${t}",
16
15
  use: ${e ? "[]" : "[apiPlugin]"},
17
- apiOptions: ${JSON.stringify(t)},
16
+ apiOptions: ${JSON.stringify(r)},
18
17
  });
19
- export const storyblokApiInstance = storyblokApi;
18
+ export const storyblokApiInstance = storyblokApi;
20
19
  `;
21
20
  }
22
21
  };
23
22
  }
24
- const m = /[\p{Lu}]/u, v = /[\p{Ll}]/u, c = /^[\p{Lu}](?![\p{Lu}])/gu, b = /([\p{Alpha}\p{N}_]|$)/u, i = /[_.\- ]+/, T = new RegExp("^" + i.source), u = new RegExp(i.source + b.source, "gu"), d = new RegExp("\\d+" + b.source, "gu"), I = (r, e, t) => {
25
- let o = !1, n = !1, s = !1;
26
- for (let l = 0; l < r.length; l++) {
27
- const a = r[l];
28
- o && m.test(a) ? (r = r.slice(0, l) + "-" + r.slice(l), o = !1, s = n, n = !0, l++) : n && s && v.test(a) ? (r = r.slice(0, l - 1) + "-" + r.slice(l - 1), s = n, n = !1, o = !0) : (o = e(a) === a && t(a) !== a, s = n, n = t(a) === a && e(a) !== a);
23
+ const v = /[\p{Lu}]/u, I = /[\p{Ll}]/u, c = /^[\p{Lu}](?![\p{Lu}])/gu, m = /([\p{Alpha}\p{N}_]|$)/u, i = /[_.\- ]+/, T = new RegExp("^" + i.source), u = new RegExp(i.source + m.source, "gu"), d = new RegExp("\\d+" + m.source, "gu"), E = (t, e, r) => {
24
+ let o = !1, s = !1, n = !1;
25
+ for (let a = 0; a < t.length; a++) {
26
+ const l = t[a];
27
+ o && v.test(l) ? (t = t.slice(0, a) + "-" + t.slice(a), o = !1, n = s, s = !0, a++) : s && n && I.test(l) ? (t = t.slice(0, a - 1) + "-" + t.slice(a - 1), n = s, s = !1, o = !0) : (o = e(l) === l && r(l) !== l, n = s, s = r(l) === l && e(l) !== l);
29
28
  }
30
- return r;
31
- }, E = (r, e) => (c.lastIndex = 0, r.replace(c, (t) => e(t))), A = (r, e) => (u.lastIndex = 0, d.lastIndex = 0, r.replace(u, (t, o) => e(o)).replace(d, (t) => e(t)));
32
- function f(r, e) {
33
- if (!(typeof r == "string" || Array.isArray(r)))
29
+ return t;
30
+ }, A = (t, e) => (c.lastIndex = 0, t.replace(c, (r) => e(r))), w = (t, e) => (u.lastIndex = 0, d.lastIndex = 0, t.replace(u, (r, o) => e(o)).replace(d, (r) => e(r)));
31
+ function g(t, e) {
32
+ if (!(typeof t == "string" || Array.isArray(t)))
34
33
  throw new TypeError("Expected the input to be `string | string[]`");
35
34
  if (e = {
36
35
  pascalCase: !1,
37
36
  preserveConsecutiveUppercase: !1,
38
37
  ...e
39
- }, Array.isArray(r) ? r = r.map((s) => s.trim()).filter((s) => s.length).join("-") : r = r.trim(), r.length === 0)
38
+ }, Array.isArray(t) ? t = t.map((n) => n.trim()).filter((n) => n.length).join("-") : t = t.trim(), t.length === 0)
40
39
  return "";
41
- const t = e.locale === !1 ? (s) => s.toLowerCase() : (s) => s.toLocaleLowerCase(e.locale), o = e.locale === !1 ? (s) => s.toUpperCase() : (s) => s.toLocaleUpperCase(e.locale);
42
- return r.length === 1 ? i.test(r) ? "" : e.pascalCase ? o(r) : t(r) : (r !== t(r) && (r = I(r, t, o)), r = r.replace(T, ""), r = e.preserveConsecutiveUppercase ? E(r, t) : t(r), e.pascalCase && (r = o(r.charAt(0)) + r.slice(1)), A(r, o));
40
+ const r = e.locale === !1 ? (n) => n.toLowerCase() : (n) => n.toLocaleLowerCase(e.locale), o = e.locale === !1 ? (n) => n.toUpperCase() : (n) => n.toLocaleUpperCase(e.locale);
41
+ return t.length === 1 ? i.test(t) ? "" : e.pascalCase ? o(t) : r(t) : (t !== r(t) && (t = E(t, r, o)), t = t.replace(T, ""), t = e.preserveConsecutiveUppercase ? A(t, r) : r(t), e.pascalCase && (t = o(t.charAt(0)) + t.slice(1)), w(t, o));
43
42
  }
44
- function w(r) {
45
- const e = "virtual:storyblok-components", t = "\0" + e;
43
+ function S(t) {
44
+ const e = "virtual:storyblok-components", r = "\0" + e;
46
45
  return {
47
46
  name: "vite-plugin-storyblok-components",
48
47
  async resolveId(o) {
49
48
  if (o === e)
50
- return t;
49
+ return r;
51
50
  },
52
51
  async load(o) {
53
- if (o === t) {
54
- const n = [];
55
- for await (const [s, l] of Object.entries(r)) {
56
- const { id: a } = await this.resolve("/src/" + l + ".astro");
57
- n.push(`import ${f(s)} from "${a}"`);
52
+ if (o === r) {
53
+ const s = [];
54
+ for await (const [n, a] of Object.entries(t)) {
55
+ const { id: l } = await this.resolve("/src/" + a + ".astro");
56
+ s.push(`import ${g(n)} from "${l}"`);
58
57
  }
59
- return `${n.join(";")};export default {${Object.keys(r).map((s) => f(s)).join(",")}}`;
58
+ return `${s.join(";")};export default {${Object.keys(t).map((n) => g(n)).join(",")}}`;
60
59
  }
61
60
  }
62
61
  };
63
62
  }
64
- var S = Object.defineProperty, h = Object.getOwnPropertySymbols, R = Object.prototype.hasOwnProperty, _ = Object.prototype.propertyIsEnumerable, p = (r, e, t) => e in r ? S(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, C = (r, e) => {
65
- for (var t in e || (e = {}))
66
- R.call(e, t) && p(r, t, e[t]);
63
+ var C = Object.defineProperty, h = Object.getOwnPropertySymbols, R = Object.prototype.hasOwnProperty, _ = Object.prototype.propertyIsEnumerable, f = (t, e, r) => e in t ? C(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, x = (t, e) => {
64
+ for (var r in e || (e = {}))
65
+ R.call(e, r) && f(t, r, e[r]);
67
66
  if (h)
68
- for (var t of h(e))
69
- _.call(e, t) && p(r, t, e[t]);
70
- return r;
67
+ for (var r of h(e))
68
+ _.call(e, r) && f(t, r, e[r]);
69
+ return t;
71
70
  };
72
- let g = !1;
73
- const y = [], x = (r) => new Promise((e, t) => {
74
- if (typeof window > "u" || (window.storyblokRegisterEvent = (n) => {
71
+ let p = !1;
72
+ const b = [], $ = (t) => new Promise((e, r) => {
73
+ if (typeof window > "u" || (window.storyblokRegisterEvent = (s) => {
75
74
  if (window.location === window.parent.location) {
76
75
  console.warn("You are not in Draft Mode or in the Visual Editor.");
77
76
  return;
78
77
  }
79
- g ? n() : y.push(n);
78
+ p ? s() : b.push(s);
80
79
  }, document.getElementById("storyblok-javascript-bridge")))
81
80
  return;
82
81
  const o = document.createElement("script");
83
- o.async = !0, o.src = r, o.id = "storyblok-javascript-bridge", o.onerror = (n) => t(n), o.onload = (n) => {
84
- y.forEach((s) => s()), g = !0, e(n);
82
+ o.async = !0, o.src = t, o.id = "storyblok-javascript-bridge", o.onerror = (s) => r(s), o.onload = (s) => {
83
+ b.forEach((n) => n()), p = !0, e(s);
85
84
  }, document.getElementsByTagName("head")[0].appendChild(o);
86
- }), $ = function(r, e) {
87
- if (!r)
88
- return null;
89
- let t = {};
90
- for (let o in r) {
91
- let n = r[o];
92
- e.indexOf(o) > -1 && n !== null && (t[o] = n);
85
+ });
86
+ var O = Object.defineProperty, P = (t, e, r) => e in t ? O(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, y = (t, e, r) => (P(t, typeof e != "symbol" ? e + "" : e, r), r);
87
+ const N = function(t, e) {
88
+ const r = {};
89
+ for (const o in t) {
90
+ const s = t[o];
91
+ e.indexOf(o) > -1 && s !== null && (r[o] = s);
93
92
  }
94
- return t;
95
- }, O = (r) => r === "email";
96
- var N = {
97
- nodes: {
98
- horizontal_rule() {
99
- return {
100
- singleTag: "hr"
101
- };
102
- },
103
- blockquote() {
104
- return {
105
- tag: "blockquote"
106
- };
107
- },
108
- bullet_list() {
109
- return {
110
- tag: "ul"
111
- };
112
- },
113
- code_block(r) {
114
- return {
115
- tag: [
116
- "pre",
117
- {
118
- tag: "code",
119
- attrs: r.attrs
120
- }
121
- ]
122
- };
123
- },
124
- hard_break() {
125
- return {
126
- singleTag: "br"
127
- };
128
- },
129
- heading(r) {
130
- return {
131
- tag: `h${r.attrs.level}`
132
- };
133
- },
134
- image(r) {
135
- return {
136
- singleTag: [
137
- {
138
- tag: "img",
139
- attrs: $(r.attrs, ["src", "alt", "title"])
140
- }
141
- ]
142
- };
143
- },
144
- list_item() {
145
- return {
146
- tag: "li"
147
- };
148
- },
149
- ordered_list() {
150
- return {
151
- tag: "ol"
152
- };
153
- },
154
- paragraph() {
155
- return {
156
- tag: "p"
157
- };
93
+ return r;
94
+ }, j = (t) => t === "email", L = () => ({
95
+ singleTag: "hr"
96
+ }), M = () => ({
97
+ tag: "blockquote"
98
+ }), U = () => ({
99
+ tag: "ul"
100
+ }), D = (t) => ({
101
+ tag: [
102
+ "pre",
103
+ {
104
+ tag: "code",
105
+ attrs: t.attrs
158
106
  }
107
+ ]
108
+ }), B = () => ({
109
+ singleTag: "br"
110
+ }), z = (t) => ({
111
+ tag: `h${t.attrs.level}`
112
+ }), F = (t) => ({
113
+ singleTag: [
114
+ {
115
+ tag: "img",
116
+ attrs: N(t.attrs, ["src", "alt", "title"])
117
+ }
118
+ ]
119
+ }), V = () => ({
120
+ tag: "li"
121
+ }), q = () => ({
122
+ tag: "ol"
123
+ }), J = () => ({
124
+ tag: "p"
125
+ }), G = () => ({
126
+ tag: "b"
127
+ }), K = () => ({
128
+ tag: "strike"
129
+ }), H = () => ({
130
+ tag: "u"
131
+ }), W = () => ({
132
+ tag: "strong"
133
+ }), Y = () => ({
134
+ tag: "code"
135
+ }), Q = () => ({
136
+ tag: "i"
137
+ }), X = (t) => {
138
+ const e = x({}, t.attrs), { linktype: r = "url" } = t.attrs;
139
+ return j(r) && (e.href = `mailto:${e.href}`), e.anchor && (e.href = `${e.href}#${e.anchor}`, delete e.anchor), {
140
+ tag: [
141
+ {
142
+ tag: "a",
143
+ attrs: e
144
+ }
145
+ ]
146
+ };
147
+ }, Z = (t) => ({
148
+ tag: [
149
+ {
150
+ tag: "span",
151
+ attrs: t.attrs
152
+ }
153
+ ]
154
+ }), ee = {
155
+ nodes: {
156
+ horizontal_rule: L,
157
+ blockquote: M,
158
+ bullet_list: U,
159
+ code_block: D,
160
+ hard_break: B,
161
+ heading: z,
162
+ image: F,
163
+ list_item: V,
164
+ ordered_list: q,
165
+ paragraph: J
159
166
  },
160
167
  marks: {
161
- bold() {
162
- return {
163
- tag: "b"
164
- };
165
- },
166
- strike() {
167
- return {
168
- tag: "strike"
169
- };
170
- },
171
- underline() {
172
- return {
173
- tag: "u"
174
- };
175
- },
176
- strong() {
177
- return {
178
- tag: "strong"
179
- };
180
- },
181
- code() {
182
- return {
183
- tag: "code"
184
- };
185
- },
186
- italic() {
187
- return {
188
- tag: "i"
189
- };
190
- },
191
- link(r) {
192
- const e = C({}, r.attrs), { linktype: t = "url" } = r.attrs;
193
- return O(t) && (e.href = `mailto:${e.href}`), e.anchor && (e.href = `${e.href}#${e.anchor}`, delete e.anchor), {
194
- tag: [
195
- {
196
- tag: "a",
197
- attrs: e
198
- }
199
- ]
200
- };
201
- },
202
- styled(r) {
203
- return {
204
- tag: [
205
- {
206
- tag: "span",
207
- attrs: r.attrs
208
- }
209
- ]
210
- };
211
- }
168
+ bold: G,
169
+ strike: K,
170
+ underline: H,
171
+ strong: W,
172
+ code: Y,
173
+ italic: Q,
174
+ link: X,
175
+ styled: Z
212
176
  }
213
- };
214
- const P = function(r) {
177
+ }, te = function(t) {
215
178
  const e = {
216
179
  "&": "&amp;",
217
180
  "<": "&lt;",
218
181
  ">": "&gt;",
219
182
  '"': "&quot;",
220
183
  "'": "&#39;"
221
- }, t = /[&<>"']/g, o = RegExp(t.source);
222
- return r && o.test(r) ? r.replace(t, (n) => e[n]) : r;
184
+ }, r = /[&<>"']/g, o = RegExp(r.source);
185
+ return t && o.test(t) ? t.replace(r, (s) => e[s]) : t;
223
186
  };
224
- class L {
187
+ class re {
225
188
  constructor(e) {
226
- e || (e = N), this.marks = e.marks || [], this.nodes = e.nodes || [];
189
+ y(this, "marks"), y(this, "nodes"), e || (e = ee), this.marks = e.marks || [], this.nodes = e.nodes || [];
227
190
  }
228
- addNode(e, t) {
229
- this.nodes[e] = t;
191
+ addNode(e, r) {
192
+ this.nodes[e] = r;
230
193
  }
231
- addMark(e, t) {
232
- this.marks[e] = t;
194
+ addMark(e, r) {
195
+ this.marks[e] = r;
233
196
  }
234
- render(e = {}) {
235
- if (e.content && Array.isArray(e.content)) {
236
- let t = "";
197
+ render(e) {
198
+ if (e && e.content && Array.isArray(e.content)) {
199
+ let r = "";
237
200
  return e.content.forEach((o) => {
238
- t += this.renderNode(o);
239
- }), t;
201
+ r += this.renderNode(o);
202
+ }), r;
240
203
  }
241
204
  return console.warn("The render method must receive an object with a content field, which is an array"), "";
242
205
  }
243
206
  renderNode(e) {
244
- let t = [];
245
- e.marks && e.marks.forEach((n) => {
246
- const s = this.getMatchingMark(n);
247
- s && t.push(this.renderOpeningTag(s.tag));
207
+ const r = [];
208
+ e.marks && e.marks.forEach((s) => {
209
+ const n = this.getMatchingMark(s);
210
+ n && r.push(this.renderOpeningTag(n.tag));
248
211
  });
249
212
  const o = this.getMatchingNode(e);
250
- return o && o.tag && t.push(this.renderOpeningTag(o.tag)), e.content ? e.content.forEach((n) => {
251
- t.push(this.renderNode(n));
252
- }) : e.text ? t.push(P(e.text)) : o && o.singleTag ? t.push(this.renderTag(o.singleTag, " /")) : o && o.html && t.push(o.html), o && o.tag && t.push(this.renderClosingTag(o.tag)), e.marks && e.marks.slice(0).reverse().forEach((n) => {
253
- const s = this.getMatchingMark(n);
254
- s && t.push(this.renderClosingTag(s.tag));
255
- }), t.join("");
213
+ return o && o.tag && r.push(this.renderOpeningTag(o.tag)), e.content ? e.content.forEach((s) => {
214
+ r.push(this.renderNode(s));
215
+ }) : e.text ? r.push(te(e.text)) : o && o.singleTag ? r.push(this.renderTag(o.singleTag, " /")) : o && o.html && r.push(o.html), o && o.tag && r.push(this.renderClosingTag(o.tag)), e.marks && e.marks.slice(0).reverse().forEach((s) => {
216
+ const n = this.getMatchingMark(s);
217
+ n && r.push(this.renderClosingTag(n.tag));
218
+ }), r.join("");
256
219
  }
257
- renderTag(e, t) {
258
- return e.constructor === String ? `<${e}${t}>` : e.map((n) => {
259
- if (n.constructor === String)
260
- return `<${n}${t}>`;
220
+ renderTag(e, r) {
221
+ return e.constructor === String ? `<${e}${r}>` : e.map((o) => {
222
+ if (o.constructor === String)
223
+ return `<${o}${r}>`;
261
224
  {
262
- let s = `<${n.tag}`;
263
- if (n.attrs)
264
- for (let l in n.attrs) {
265
- let a = n.attrs[l];
266
- a !== null && (s += ` ${l}="${a}"`);
225
+ let s = `<${o.tag}`;
226
+ if (o.attrs)
227
+ for (const n in o.attrs) {
228
+ const a = o.attrs[n];
229
+ a !== null && (s += ` ${n}="${a}"`);
267
230
  }
268
- return `${s}${t}>`;
231
+ return `${s}${r}>`;
269
232
  }
270
233
  }).join("");
271
234
  }
@@ -273,74 +236,81 @@ class L {
273
236
  return this.renderTag(e, "");
274
237
  }
275
238
  renderClosingTag(e) {
276
- return e.constructor === String ? `</${e}>` : e.slice(0).reverse().map((o) => o.constructor === String ? `</${o}>` : `</${o.tag}>`).join("");
239
+ return e.constructor === String ? `</${e}>` : e.slice(0).reverse().map((r) => r.constructor === String ? `</${r}>` : `</${r.tag}>`).join("");
277
240
  }
278
241
  getMatchingNode(e) {
279
- if (typeof this.nodes[e.type] == "function")
280
- return this.nodes[e.type](e);
242
+ const r = this.nodes[e.type];
243
+ if (typeof r == "function")
244
+ return r(e);
281
245
  }
282
246
  getMatchingMark(e) {
283
- if (typeof this.marks[e.type] == "function")
284
- return this.marks[e.type](e);
247
+ const r = this.marks[e.type];
248
+ if (typeof r == "function")
249
+ return r(e);
285
250
  }
286
251
  }
287
- var z = (r) => {
288
- if (typeof r != "object" || typeof r._editable > "u")
252
+ var le = (t) => {
253
+ if (typeof t != "object" || typeof t._editable > "u")
289
254
  return {};
290
- const e = JSON.parse(r._editable.replace(/^<!--#storyblok#/, "").replace(/-->$/, ""));
255
+ const e = JSON.parse(t._editable.replace(/^<!--#storyblok#/, "").replace(/-->$/, ""));
291
256
  return {
292
257
  "data-blok-c": JSON.stringify(e),
293
258
  "data-blok-uid": e.id + "-" + e.uid
294
259
  };
295
260
  };
296
- let j;
297
- const M = "https://app.storyblok.com/f/storyblok-v2-latest.js", U = (r, e) => {
298
- r.addNode("blok", (t) => {
261
+ let oe;
262
+ const se = "https://app.storyblok.com/f/storyblok-v2-latest.js", ne = (t, e) => {
263
+ t.addNode("blok", (r) => {
299
264
  let o = "";
300
- return t.attrs.body.forEach((n) => {
301
- o += e(n.component, n);
265
+ return r.attrs.body.forEach((s) => {
266
+ o += e(s.component, s);
302
267
  }), {
303
268
  html: o
304
269
  };
305
270
  });
306
- }, B = (r, e, t) => {
307
- let o = t || j;
271
+ }, ae = (t, e, r) => {
272
+ let o = r || oe;
308
273
  if (!o) {
309
274
  console.error("Please initialize the Storyblok SDK before calling the renderRichText function");
310
275
  return;
311
276
  }
312
- return r === "" ? "" : r ? (e && (o = new L(e.schema), e.resolver && U(o, e.resolver)), o.render(r)) : (console.warn(`${r} is not a valid Richtext object. This might be because the value of the richtext field is empty.
277
+ return t === "" ? "" : t ? (e && (o = new re(e.schema), e.resolver && ne(o, e.resolver)), o.render(t)) : (console.warn(`${t} is not a valid Richtext object. This might be because the value of the richtext field is empty.
313
278
 
314
279
  For more info about the richtext object check https://github.com/storyblok/storyblok-js#rendering-rich-text`), "");
315
- }, H = () => x(M);
316
- function F() {
317
- return globalThis.storyblokApiInstance || console.error("storyblokApiInstance has not been initialized correctly"), storyblokApiInstance;
280
+ }, ie = () => $(se);
281
+ function ce() {
282
+ return globalThis.storyblokApiInstance || console.error("storyblokApiInstance has not been initialized correctly"), globalThis.storyblokApiInstance;
318
283
  }
319
- function V(r, e) {
320
- const t = globalThis.storyblokApiInstance.richTextResolver;
321
- if (!t) {
284
+ function ue(t, e) {
285
+ const r = globalThis.storyblokApiInstance.richTextResolver;
286
+ if (!r) {
322
287
  console.error(
323
288
  "Please initialize the Storyblok SDK before calling the renderRichText function"
324
289
  );
325
290
  return;
326
291
  }
327
- return B(r, e, t);
292
+ return ae(t, e, r);
328
293
  }
329
- function q(r) {
294
+ function de(t = {
295
+ accessToken: "",
296
+ useCustomApi: !1,
297
+ apiOptions: {},
298
+ bridge: !0,
299
+ components: {}
300
+ }) {
330
301
  return {
331
302
  name: "@storyblok/astro",
332
303
  hooks: {
333
- "astro:config:setup": ({ injectScript: e, updateConfig: t }) => {
334
- var n;
335
- t({
304
+ "astro:config:setup": ({ injectScript: e, updateConfig: r }) => {
305
+ r({
336
306
  vite: {
337
307
  plugins: [
338
308
  k(
339
- r.accessToken,
340
- r.useCustomApi,
341
- r.apiOptions
309
+ t.accessToken,
310
+ t.useCustomApi,
311
+ t.apiOptions
342
312
  ),
343
- w(r.components)
313
+ S(t.components)
344
314
  ]
345
315
  }
346
316
  }), e(
@@ -349,7 +319,7 @@ function q(r) {
349
319
  import { storyblokApiInstance } from "virtual:storyblok-init";
350
320
  globalThis.storyblokApiInstance = storyblokApiInstance;
351
321
  `
352
- ), ((n = r.bridge) != null ? n : !0) && e(
322
+ ), t.bridge && e(
353
323
  "page",
354
324
  `
355
325
  import { loadStoryblokBridge } from "@storyblok/astro";
@@ -370,10 +340,11 @@ function q(r) {
370
340
  };
371
341
  }
372
342
  export {
373
- N as RichTextSchema,
374
- q as default,
375
- H as loadStoryblokBridge,
376
- V as renderRichText,
377
- z as storyblokEditable,
378
- F as useStoryblokApi
343
+ re as RichTextResolver,
344
+ ee as RichTextSchema,
345
+ de as default,
346
+ ie as loadStoryblokBridge,
347
+ ue as renderRichText,
348
+ le as storyblokEditable,
349
+ ce as useStoryblokApi
379
350
  };
@@ -0,0 +1,12 @@
1
+ export type { SbPluginFactory, SbBlokKeyDataTypes, SbBlokData, SbRichTextOptions, SbSDKOptions, StoryblokClient, StoryblokBridgeV2, StoryblokBridgeConfigV2, ISbConfig, // previously StoryblokConfig
2
+ ISbCache, // previously StoryblokCache
3
+ ISbResult, // previously StoryblokResult
4
+ ISbResponse, ISbError, ISbNode, ISbSchema, ThrottleFn, AsyncFn, ArrayFn, ISbContentMangmntAPI, ISbManagmentApiResult, // previously StoryblokManagmentApiResult
5
+ ISbStories, // previously Stories
6
+ ISbStory, // previously Story
7
+ ISbDimensions, StoryblokComponentType, ISbStoryData, // previously StoryData
8
+ ISbAlternateObject, // previously AlternateObject
9
+ ISbStoriesParams, // previously StoriesParams
10
+ ISbStoryParams, // previously StoryParams
11
+ ISbRichtext, // previously Richtext
12
+ ISbEventPayload, } from "@storyblok/js";
@@ -0,0 +1,5 @@
1
+ export declare function vitePluginStoryblokComponents(components?: object): {
2
+ name: string;
3
+ resolveId(id: string): Promise<string>;
4
+ load(id: string): Promise<string>;
5
+ };
@@ -0,0 +1,5 @@
1
+ export declare function vitePluginStoryblokInit(accessToken: any, useCustomApi: any, apiOptions: any): {
2
+ name: string;
3
+ resolveId(id: string): Promise<string>;
4
+ load(id: string): Promise<string>;
5
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storyblok/astro",
3
- "version": "1.2.0",
3
+ "version": "2.0.1",
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",
@@ -15,6 +15,7 @@
15
15
  },
16
16
  "./StoryblokComponent.astro": "./StoryblokComponent.astro"
17
17
  },
18
+ "types": "./dist/index.d.ts",
18
19
  "scripts": {
19
20
  "dev": "vite build --watch",
20
21
  "build": "vite build",
@@ -27,17 +28,20 @@
27
28
  "prepublishOnly": "npm run build && cp ../README.md ./"
28
29
  },
29
30
  "dependencies": {
30
- "@storyblok/js": "^1.8.6",
31
+ "@storyblok/js": "^2.0.5",
31
32
  "camelcase": "^7.0.0"
32
33
  },
33
34
  "devDependencies": {
34
- "@cypress/vite-dev-server": "^2.0.7",
35
- "@rollup/plugin-dynamic-import-vars": "^1.4.4",
36
- "axios": "^0.27.2",
37
- "cypress": "^10.9.0",
35
+ "@cypress/vite-dev-server": "^5.0.2",
36
+ "@rollup/plugin-dynamic-import-vars": "^2.0.1",
37
+ "@types/node": "18.11.10",
38
+ "astro": "1.6.15",
39
+ "cypress": "^12.1.0",
38
40
  "eslint-plugin-cypress": "^2.12.1",
39
- "start-server-and-test": "^1.14.0",
40
- "vite": "^3.2.4"
41
+ "start-server-and-test": "^1.15.2",
42
+ "typescript": "4.9.4",
43
+ "vite": "^4.0.1",
44
+ "vite-plugin-dts": "^1.7.1"
41
45
  },
42
46
  "repository": {
43
47
  "type": "git",