@xosen/site-sdk 0.0.4 → 0.0.5

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/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import { onMounted as C, computed as f, defineComponent as y, openBlock as n, createElementBlock as a, Fragment as h, renderList as v, normalizeClass as k, toDisplayString as _, ref as w, onUnmounted as A, resolveComponent as E, createElementVNode as u, createVNode as P, withCtx as B, createBlock as T, createTextVNode as L, createCommentVNode as d, renderSlot as H, normalizeStyle as U, resolveDynamicComponent as R, watch as I, mergeProps as z } from "vue";
1
+ import { onMounted as C, computed as f, defineComponent as y, openBlock as n, createElementBlock as a, Fragment as h, renderList as v, normalizeClass as k, toDisplayString as _, ref as w, onUnmounted as E, resolveComponent as A, createElementVNode as d, createVNode as P, withCtx as B, createBlock as T, createTextVNode as L, createCommentVNode as u, renderSlot as z, normalizeStyle as U, resolveDynamicComponent as R, watch as I, mergeProps as G } from "vue";
2
2
  import { useI18n as M } from "vue-i18n";
3
- function G(r) {
3
+ function J(r) {
4
4
  function o(e) {
5
5
  const t = document.documentElement;
6
6
  if (e.colors)
7
7
  for (const [c, i] of Object.entries(e.colors))
8
- i && t.style.setProperty(`--x-color-${J(c)}`, i);
8
+ i && t.style.setProperty(`--x-color-${V(c)}`, i);
9
9
  e.typography?.fontFamily && t.style.setProperty("--x-font-family", e.typography.fontFamily), e.typography?.headingFont && t.style.setProperty("--x-font-heading", e.typography.headingFont), e.typography?.baseFontSize && t.style.setProperty("--x-font-size", e.typography.baseFontSize), e.shape?.borderRadius && t.style.setProperty("--x-border-radius", e.shape.borderRadius), e.shape?.maxWidth && t.style.setProperty("--x-max-width", e.shape.maxWidth);
10
10
  }
11
11
  C(() => {
@@ -21,7 +21,7 @@ function G(r) {
21
21
  });
22
22
  });
23
23
  }
24
- function J(r) {
24
+ function V(r) {
25
25
  return r.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
26
26
  }
27
27
  function F() {
@@ -41,7 +41,7 @@ function F() {
41
41
  hasFeature: p
42
42
  };
43
43
  }
44
- const V = /* @__PURE__ */ y({
44
+ const W = /* @__PURE__ */ y({
45
45
  __name: "XLocaleSwitcher",
46
46
  props: {
47
47
  locales: { type: Array, required: !0 }
@@ -60,9 +60,9 @@ const V = /* @__PURE__ */ y({
60
60
  for (const [t, c] of o)
61
61
  e[t] = c;
62
62
  return e;
63
- }, W = { class: "x-locale-switcher" }, K = ["onClick"];
64
- function Y(r, o, e, t, c, i) {
65
- return n(), a("div", W, [
63
+ }, K = { class: "x-locale-switcher" }, Y = ["onClick"];
64
+ function Z(r, o, e, t, c, i) {
65
+ return n(), a("div", K, [
66
66
  (n(!0), a(
67
67
  h,
68
68
  null,
@@ -70,13 +70,13 @@ function Y(r, o, e, t, c, i) {
70
70
  key: s,
71
71
  class: k(["x-locale-switcher__btn", { "x-locale-switcher__btn--active": t.locale === s }]),
72
72
  onClick: (l) => t.switchLocale(s)
73
- }, _(s.toUpperCase()), 11, K))),
73
+ }, _(s.toUpperCase()), 11, Y))),
74
74
  128
75
75
  /* KEYED_FRAGMENT */
76
76
  ))
77
77
  ]);
78
78
  }
79
- const Z = /* @__PURE__ */ x(V, [["render", Y], ["__scopeId", "data-v-675f0bbd"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/common/XLocaleSwitcher.vue"]]), Q = /* @__PURE__ */ y({
79
+ const Q = /* @__PURE__ */ x(W, [["render", Z], ["__scopeId", "data-v-675f0bbd"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/common/XLocaleSwitcher.vue"]]), ee = /* @__PURE__ */ y({
80
80
  __name: "XSiteNav",
81
81
  setup(r, { expose: o }) {
82
82
  o();
@@ -84,23 +84,23 @@ const Z = /* @__PURE__ */ x(V, [["render", Y], ["__scopeId", "data-v-675f0bbd"],
84
84
  function l() {
85
85
  i.value = window.scrollY > 20;
86
86
  }
87
- C(() => window.addEventListener("scroll", l)), A(() => window.removeEventListener("scroll", l));
88
- const p = { navigation: e, branding: t, locales: c, scrolled: i, menuOpen: s, onScroll: l, XLocaleSwitcher: Z };
87
+ C(() => window.addEventListener("scroll", l)), E(() => window.removeEventListener("scroll", l));
88
+ const p = { navigation: e, branding: t, locales: c, scrolled: i, menuOpen: s, onScroll: l, XLocaleSwitcher: Q };
89
89
  return Object.defineProperty(p, "__isScriptSetup", { enumerable: !1, value: !0 }), p;
90
90
  }
91
- }), ee = { class: "x-nav__container" }, te = ["src", "alt"], se = {
91
+ }), te = { class: "x-nav__container" }, se = ["src", "alt"], oe = {
92
92
  key: 1,
93
93
  class: "x-nav__logo-text"
94
- }, oe = ["href"];
95
- function ne(r, o, e, t, c, i) {
96
- const s = E("router-link");
94
+ }, ne = ["href"];
95
+ function ae(r, o, e, t, c, i) {
96
+ const s = A("router-link");
97
97
  return n(), a(
98
98
  "nav",
99
99
  {
100
100
  class: k(["x-nav", { "x-nav--scrolled": t.scrolled }])
101
101
  },
102
102
  [
103
- u("div", ee, [
103
+ d("div", te, [
104
104
  P(s, {
105
105
  to: "/",
106
106
  class: "x-nav__logo"
@@ -111,9 +111,9 @@ function ne(r, o, e, t, c, i) {
111
111
  src: t.branding.logo,
112
112
  alt: t.branding.siteName || "",
113
113
  class: "x-nav__logo-img"
114
- }, null, 8, te)) : (n(), a(
114
+ }, null, 8, se)) : (n(), a(
115
115
  "span",
116
- se,
116
+ oe,
117
117
  _(t.branding.siteName || ""),
118
118
  1
119
119
  /* TEXT */
@@ -122,7 +122,7 @@ function ne(r, o, e, t, c, i) {
122
122
  _: 1
123
123
  /* STABLE */
124
124
  }),
125
- u(
125
+ d(
126
126
  "div",
127
127
  {
128
128
  class: k(["x-nav__links", { "x-nav__links--open": t.menuOpen }])
@@ -143,7 +143,7 @@ function ne(r, o, e, t, c, i) {
143
143
  class: "x-nav__link",
144
144
  target: "_blank",
145
145
  onClick: o[0] || (o[0] = (p) => t.menuOpen = !1)
146
- }, _(l.text), 9, oe)) : (n(), T(s, {
146
+ }, _(l.text), 9, ne)) : (n(), T(s, {
147
147
  key: 1,
148
148
  to: l.url,
149
149
  class: "x-nav__link",
@@ -169,30 +169,30 @@ function ne(r, o, e, t, c, i) {
169
169
  t.locales.length > 1 ? (n(), T(t.XLocaleSwitcher, {
170
170
  key: 0,
171
171
  locales: t.locales
172
- }, null, 8, ["locales"])) : d("v-if", !0)
172
+ }, null, 8, ["locales"])) : u("v-if", !0)
173
173
  ],
174
174
  2
175
175
  /* CLASS */
176
176
  ),
177
- u("button", {
177
+ d("button", {
178
178
  class: "x-nav__hamburger",
179
179
  onClick: o[2] || (o[2] = (l) => t.menuOpen = !t.menuOpen)
180
180
  }, [...o[3] || (o[3] = [
181
- u(
181
+ d(
182
182
  "span",
183
183
  null,
184
184
  null,
185
185
  -1
186
186
  /* CACHED */
187
187
  ),
188
- u(
188
+ d(
189
189
  "span",
190
190
  null,
191
191
  null,
192
192
  -1
193
193
  /* CACHED */
194
194
  ),
195
- u(
195
+ d(
196
196
  "span",
197
197
  null,
198
198
  null,
@@ -206,25 +206,25 @@ function ne(r, o, e, t, c, i) {
206
206
  /* CLASS */
207
207
  );
208
208
  }
209
- const ae = /* @__PURE__ */ x(Q, [["render", ne], ["__scopeId", "data-v-07c4b748"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/layout/XSiteNav.vue"]]), re = /* @__PURE__ */ y({
209
+ const re = /* @__PURE__ */ x(ee, [["render", ae], ["__scopeId", "data-v-07c4b748"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/layout/XSiteNav.vue"]]), ce = /* @__PURE__ */ y({
210
210
  __name: "XSiteFooter",
211
211
  setup(r, { expose: o }) {
212
212
  o();
213
213
  const { footer: e, branding: t } = F(), c = f(() => e.value.copyright ? e.value.copyright : `© ${(/* @__PURE__ */ new Date()).getFullYear()} ${t.value.siteName || ""}`), i = { footerConfig: e, branding: t, copyright: c };
214
214
  return Object.defineProperty(i, "__isScriptSetup", { enumerable: !1, value: !0 }), i;
215
215
  }
216
- }), ce = { class: "x-footer" }, ie = { class: "x-footer__container" }, le = {
216
+ }), ie = { class: "x-footer" }, le = { class: "x-footer__container" }, _e = {
217
217
  key: 0,
218
218
  class: "x-footer__links"
219
- }, _e = {
219
+ }, ue = {
220
220
  key: 1,
221
221
  class: "x-footer__copyright"
222
222
  };
223
223
  function de(r, o, e, t, c, i) {
224
- const s = E("router-link");
225
- return n(), a("footer", ce, [
226
- u("div", ie, [
227
- t.footerConfig.links?.length ? (n(), a("div", le, [
224
+ const s = A("router-link");
225
+ return n(), a("footer", ie, [
226
+ d("div", le, [
227
+ t.footerConfig.links?.length ? (n(), a("div", _e, [
228
228
  (n(!0), a(
229
229
  h,
230
230
  null,
@@ -246,35 +246,35 @@ function de(r, o, e, t, c, i) {
246
246
  128
247
247
  /* KEYED_FRAGMENT */
248
248
  ))
249
- ])) : d("v-if", !0),
249
+ ])) : u("v-if", !0),
250
250
  t.copyright ? (n(), a(
251
251
  "p",
252
- _e,
252
+ ue,
253
253
  _(t.copyright),
254
254
  1
255
255
  /* TEXT */
256
- )) : d("v-if", !0)
256
+ )) : u("v-if", !0)
257
257
  ])
258
258
  ]);
259
259
  }
260
- const ue = /* @__PURE__ */ x(re, [["render", de], ["__scopeId", "data-v-f9b38381"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/layout/XSiteFooter.vue"]]), pe = /* @__PURE__ */ y({
260
+ const pe = /* @__PURE__ */ x(ce, [["render", de], ["__scopeId", "data-v-f9b38381"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/layout/XSiteFooter.vue"]]), fe = /* @__PURE__ */ y({
261
261
  __name: "XSiteLayout",
262
262
  setup(r, { expose: o }) {
263
- o(), G();
264
- const e = { XSiteNav: ae, XSiteFooter: ue };
263
+ o(), J();
264
+ const e = { XSiteNav: re, XSiteFooter: pe };
265
265
  return Object.defineProperty(e, "__isScriptSetup", { enumerable: !1, value: !0 }), e;
266
266
  }
267
- }), fe = { class: "x-site-layout" }, me = { class: "x-site-layout__main" };
268
- function he(r, o, e, t, c, i) {
269
- return n(), a("div", fe, [
267
+ }), me = { class: "x-site-layout" }, he = { class: "x-site-layout__main" };
268
+ function ve(r, o, e, t, c, i) {
269
+ return n(), a("div", me, [
270
270
  P(t.XSiteNav),
271
- u("main", me, [
272
- H(r.$slots, "default", {}, void 0, !0)
271
+ d("main", he, [
272
+ z(r.$slots, "default", {}, void 0, !0)
273
273
  ]),
274
274
  P(t.XSiteFooter)
275
275
  ]);
276
276
  }
277
- const ts = /* @__PURE__ */ x(pe, [["render", he], ["__scopeId", "data-v-41b0f2a9"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/layout/XSiteLayout.vue"]]), ve = /* @__PURE__ */ y({
277
+ const ss = /* @__PURE__ */ x(fe, [["render", ve], ["__scopeId", "data-v-41b0f2a9"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/layout/XSiteLayout.vue"]]), ye = /* @__PURE__ */ y({
278
278
  __name: "XHeroBlock",
279
279
  props: {
280
280
  data: { type: Object, required: !0 },
@@ -285,23 +285,23 @@ const ts = /* @__PURE__ */ x(pe, [["render", he], ["__scopeId", "data-v-41b0f2a9
285
285
  const e = r, t = f(() => e.data.image ? { backgroundImage: `url(${e.data.image})` } : {}), c = { props: e, bgStyle: t };
286
286
  return Object.defineProperty(c, "__isScriptSetup", { enumerable: !1, value: !0 }), c;
287
287
  }
288
- }), ye = {
288
+ }), xe = {
289
289
  key: 0,
290
290
  class: "x-hero__overlay"
291
- }, xe = { class: "x-hero__content" }, ge = {
291
+ }, ge = { class: "x-hero__content" }, ke = {
292
292
  key: 0,
293
293
  class: "x-hero__title"
294
- }, ke = {
294
+ }, be = {
295
295
  key: 1,
296
296
  class: "x-hero__subtitle"
297
- }, be = {
297
+ }, $e = {
298
298
  key: 2,
299
299
  class: "x-hero__buttons"
300
- }, $e = ["href"], Se = {
300
+ }, Se = ["href"], we = {
301
301
  key: 3,
302
302
  class: "x-hero__stats"
303
- }, we = { class: "x-hero__stat-value" }, je = { class: "x-hero__stat-label" };
304
- function Te(r, o, e, t, c, i) {
303
+ }, je = { class: "x-hero__stat-value" }, Te = { class: "x-hero__stat-label" };
304
+ function Ce(r, o, e, t, c, i) {
305
305
  return n(), a(
306
306
  "section",
307
307
  {
@@ -309,23 +309,23 @@ function Te(r, o, e, t, c, i) {
309
309
  style: U(t.bgStyle)
310
310
  },
311
311
  [
312
- e.data.image && e.data.overlay !== !1 ? (n(), a("div", ye)) : d("v-if", !0),
313
- u("div", xe, [
312
+ e.data.image && e.data.overlay !== !1 ? (n(), a("div", xe)) : u("v-if", !0),
313
+ d("div", ge, [
314
314
  e.data.title ? (n(), a(
315
315
  "h1",
316
- ge,
316
+ ke,
317
317
  _(e.data.title),
318
318
  1
319
319
  /* TEXT */
320
- )) : d("v-if", !0),
320
+ )) : u("v-if", !0),
321
321
  e.data.subtitle ? (n(), a(
322
322
  "p",
323
- ke,
323
+ be,
324
324
  _(e.data.subtitle),
325
325
  1
326
326
  /* TEXT */
327
- )) : d("v-if", !0),
328
- e.data.buttons?.length ? (n(), a("div", be, [
327
+ )) : u("v-if", !0),
328
+ e.data.buttons?.length ? (n(), a("div", $e, [
329
329
  (n(!0), a(
330
330
  h,
331
331
  null,
@@ -333,12 +333,12 @@ function Te(r, o, e, t, c, i) {
333
333
  key: l,
334
334
  href: s.url,
335
335
  class: k(["x-btn", `x-btn--${s.variant || "primary"}`])
336
- }, _(s.text), 11, $e))),
336
+ }, _(s.text), 11, Se))),
337
337
  128
338
338
  /* KEYED_FRAGMENT */
339
339
  ))
340
- ])) : d("v-if", !0),
341
- e.data.stats?.length ? (n(), a("div", Se, [
340
+ ])) : u("v-if", !0),
341
+ e.data.stats?.length ? (n(), a("div", we, [
342
342
  (n(!0), a(
343
343
  h,
344
344
  null,
@@ -346,16 +346,16 @@ function Te(r, o, e, t, c, i) {
346
346
  key: l,
347
347
  class: "x-hero__stat"
348
348
  }, [
349
- u(
349
+ d(
350
350
  "span",
351
- we,
351
+ je,
352
352
  _(s.value),
353
353
  1
354
354
  /* TEXT */
355
355
  ),
356
- u(
356
+ d(
357
357
  "span",
358
- je,
358
+ Te,
359
359
  _(s.label),
360
360
  1
361
361
  /* TEXT */
@@ -364,14 +364,14 @@ function Te(r, o, e, t, c, i) {
364
364
  128
365
365
  /* KEYED_FRAGMENT */
366
366
  ))
367
- ])) : d("v-if", !0)
367
+ ])) : u("v-if", !0)
368
368
  ])
369
369
  ],
370
370
  6
371
371
  /* CLASS, STYLE */
372
372
  );
373
373
  }
374
- const Ce = /* @__PURE__ */ x(ve, [["render", Te], ["__scopeId", "data-v-d8cfe56f"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XHeroBlock.vue"]]), Xe = /* @__PURE__ */ y({
374
+ const Xe = /* @__PURE__ */ x(ye, [["render", Ce], ["__scopeId", "data-v-d8cfe56f"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XHeroBlock.vue"]]), Be = /* @__PURE__ */ y({
375
375
  __name: "XHtmlBlock",
376
376
  props: {
377
377
  data: { type: Object, required: !0 }
@@ -381,16 +381,16 @@ const Ce = /* @__PURE__ */ x(ve, [["render", Te], ["__scopeId", "data-v-d8cfe56f
381
381
  const e = {};
382
382
  return Object.defineProperty(e, "__isScriptSetup", { enumerable: !1, value: !0 }), e;
383
383
  }
384
- }), Be = { class: "x-html-block" }, Oe = ["innerHTML"];
385
- function Pe(r, o, e, t, c, i) {
386
- return n(), a("section", Be, [
387
- u("div", {
384
+ }), Oe = { class: "x-html-block" }, Pe = ["innerHTML"];
385
+ function Ie(r, o, e, t, c, i) {
386
+ return n(), a("section", Oe, [
387
+ d("div", {
388
388
  class: "x-html-block__content",
389
389
  innerHTML: e.data.content
390
- }, null, 8, Oe)
390
+ }, null, 8, Pe)
391
391
  ]);
392
392
  }
393
- const Ie = /* @__PURE__ */ x(Xe, [["render", Pe], ["__scopeId", "data-v-abfd69e8"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XHtmlBlock.vue"]]), Le = /* @__PURE__ */ y({
393
+ const Le = /* @__PURE__ */ x(Be, [["render", Ie], ["__scopeId", "data-v-abfd69e8"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XHtmlBlock.vue"]]), Ne = /* @__PURE__ */ y({
394
394
  __name: "XCardsBlock",
395
395
  props: {
396
396
  data: { type: Object, required: !0 },
@@ -423,36 +423,36 @@ const Ie = /* @__PURE__ */ x(Xe, [["render", Pe], ["__scopeId", "data-v-abfd69e8
423
423
  const l = { props: e, gridStyle: t, iconStyle: c, iconMap: i, iconDisplay: s };
424
424
  return Object.defineProperty(l, "__isScriptSetup", { enumerable: !1, value: !0 }), l;
425
425
  }
426
- }), Ne = { class: "x-cards-block__container" }, Ae = {
426
+ }), Ee = { class: "x-cards-block__container" }, Ae = {
427
427
  key: 0,
428
428
  class: "x-cards-block__title"
429
- }, Ee = {
429
+ }, Ue = {
430
430
  key: 1,
431
431
  class: "x-cards-block__subtitle"
432
- }, Ue = ["src", "alt"], Re = { class: "x-card__title" }, Me = { class: "x-card__desc" };
433
- function Fe(r, o, e, t, c, i) {
432
+ }, Re = ["src", "alt"], Me = { class: "x-card__title" }, Fe = { class: "x-card__desc" };
433
+ function qe(r, o, e, t, c, i) {
434
434
  return n(), a(
435
435
  "section",
436
436
  {
437
437
  class: k(["x-cards-block", `x-cards-block--${e.variant}`])
438
438
  },
439
439
  [
440
- u("div", Ne, [
440
+ d("div", Ee, [
441
441
  e.data.title ? (n(), a(
442
442
  "h2",
443
443
  Ae,
444
444
  _(e.data.title),
445
445
  1
446
446
  /* TEXT */
447
- )) : d("v-if", !0),
447
+ )) : u("v-if", !0),
448
448
  e.data.subtitle ? (n(), a(
449
449
  "p",
450
- Ee,
450
+ Ue,
451
451
  _(e.data.subtitle),
452
452
  1
453
453
  /* TEXT */
454
- )) : d("v-if", !0),
455
- u(
454
+ )) : u("v-if", !0),
455
+ d(
456
456
  "div",
457
457
  {
458
458
  class: "x-cards-block__grid",
@@ -473,7 +473,7 @@ function Fe(r, o, e, t, c, i) {
473
473
  src: s.image,
474
474
  alt: s.title,
475
475
  class: "x-card__image"
476
- }, null, 8, Ue)) : d("v-if", !0),
476
+ }, null, 8, Re)) : u("v-if", !0),
477
477
  s.icon && e.variant !== "image-cards" ? (n(), a(
478
478
  "div",
479
479
  {
@@ -484,17 +484,17 @@ function Fe(r, o, e, t, c, i) {
484
484
  _(t.iconDisplay(s.icon)),
485
485
  1
486
486
  /* TEXT */
487
- )) : d("v-if", !0),
488
- u(
487
+ )) : u("v-if", !0),
488
+ d(
489
489
  "h3",
490
- Re,
490
+ Me,
491
491
  _(s.title),
492
492
  1
493
493
  /* TEXT */
494
494
  ),
495
- u(
495
+ d(
496
496
  "p",
497
- Me,
497
+ Fe,
498
498
  _(s.desc),
499
499
  1
500
500
  /* TEXT */
@@ -516,7 +516,7 @@ function Fe(r, o, e, t, c, i) {
516
516
  /* CLASS */
517
517
  );
518
518
  }
519
- const qe = /* @__PURE__ */ x(Le, [["render", Fe], ["__scopeId", "data-v-a1505674"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XCardsBlock.vue"]]), De = /* @__PURE__ */ y({
519
+ const De = /* @__PURE__ */ x(Ne, [["render", qe], ["__scopeId", "data-v-a1505674"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XCardsBlock.vue"]]), He = /* @__PURE__ */ y({
520
520
  __name: "XImageTextBlock",
521
521
  props: {
522
522
  data: { type: Object, required: !0 },
@@ -527,45 +527,45 @@ const qe = /* @__PURE__ */ x(Le, [["render", Fe], ["__scopeId", "data-v-a1505674
527
527
  const e = {};
528
528
  return Object.defineProperty(e, "__isScriptSetup", { enumerable: !1, value: !0 }), e;
529
529
  }
530
- }), He = { class: "x-image-text__container" }, ze = { class: "x-image-text__text" }, Ge = {
530
+ }), ze = { class: "x-image-text__container" }, Ge = { class: "x-image-text__text" }, Je = {
531
531
  key: 0,
532
532
  class: "x-image-text__title"
533
- }, Je = ["innerHTML"], Ve = {
533
+ }, Ve = ["innerHTML"], We = {
534
534
  key: 2,
535
535
  class: "x-image-text__checklist"
536
- }, We = { class: "x-image-text__check-icon" }, Ke = {
536
+ }, Ke = { class: "x-image-text__check-icon" }, Ye = {
537
537
  key: 0,
538
538
  class: "x-image-text__image-wrap"
539
- }, Ye = ["src", "alt"];
540
- function Ze(r, o, e, t, c, i) {
539
+ }, Ze = ["src", "alt"];
540
+ function Qe(r, o, e, t, c, i) {
541
541
  return n(), a(
542
542
  "section",
543
543
  {
544
544
  class: k(["x-image-text", { "x-image-text--reverse": e.reverse }])
545
545
  },
546
546
  [
547
- u("div", He, [
548
- u("div", ze, [
547
+ d("div", ze, [
548
+ d("div", Ge, [
549
549
  e.data.title ? (n(), a(
550
550
  "h2",
551
- Ge,
551
+ Je,
552
552
  _(e.data.title),
553
553
  1
554
554
  /* TEXT */
555
- )) : d("v-if", !0),
555
+ )) : u("v-if", !0),
556
556
  e.data.content ? (n(), a("div", {
557
557
  key: 1,
558
558
  class: "x-image-text__content",
559
559
  innerHTML: e.data.content
560
- }, null, 8, Je)) : d("v-if", !0),
561
- e.data.items?.length ? (n(), a("ul", Ve, [
560
+ }, null, 8, Ve)) : u("v-if", !0),
561
+ e.data.items?.length ? (n(), a("ul", We, [
562
562
  (n(!0), a(
563
563
  h,
564
564
  null,
565
565
  v(e.data.items, (s, l) => (n(), a("li", { key: l }, [
566
- u(
566
+ d(
567
567
  "span",
568
- We,
568
+ Ke,
569
569
  _(s.icon || "✓"),
570
570
  1
571
571
  /* TEXT */
@@ -579,22 +579,22 @@ function Ze(r, o, e, t, c, i) {
579
579
  128
580
580
  /* KEYED_FRAGMENT */
581
581
  ))
582
- ])) : d("v-if", !0)
582
+ ])) : u("v-if", !0)
583
583
  ]),
584
- e.data.image ? (n(), a("div", Ke, [
585
- u("img", {
584
+ e.data.image ? (n(), a("div", Ye, [
585
+ d("img", {
586
586
  src: e.data.image,
587
587
  alt: e.data.title || "",
588
588
  class: "x-image-text__image"
589
- }, null, 8, Ye)
590
- ])) : d("v-if", !0)
589
+ }, null, 8, Ze)
590
+ ])) : u("v-if", !0)
591
591
  ])
592
592
  ],
593
593
  2
594
594
  /* CLASS */
595
595
  );
596
596
  }
597
- const Qe = /* @__PURE__ */ x(De, [["render", Ze], ["__scopeId", "data-v-5ca1e218"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XImageTextBlock.vue"]]);
597
+ const et = /* @__PURE__ */ x(He, [["render", Qe], ["__scopeId", "data-v-5ca1e218"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XImageTextBlock.vue"]]);
598
598
  function q(r, o) {
599
599
  const e = w(null), { locale: t } = M(), c = window.__SITE_DATA__, i = c?.locale;
600
600
  function s() {
@@ -613,7 +613,7 @@ function q(r, o) {
613
613
  l();
614
614
  }), e;
615
615
  }
616
- function et() {
616
+ function tt() {
617
617
  const o = window.__SITE_DATA__?.apiBase || "";
618
618
  async function e(i) {
619
619
  const s = await fetch(`${o}${i}`);
@@ -633,7 +633,7 @@ function et() {
633
633
  getProducts: c
634
634
  };
635
635
  }
636
- const tt = /* @__PURE__ */ y({
636
+ const st = /* @__PURE__ */ y({
637
637
  __name: "XPricingBlock",
638
638
  props: {
639
639
  data: { type: Object, required: !1 },
@@ -642,7 +642,7 @@ const tt = /* @__PURE__ */ y({
642
642
  },
643
643
  setup(r, { expose: o }) {
644
644
  o();
645
- const e = r, t = f(() => e.data?.title), c = f(() => e.data?.subtitle), i = w([]), s = w(""), l = q("tariffs", "tariffs"), p = et();
645
+ const e = r, t = f(() => e.data?.title), c = f(() => e.data?.subtitle), i = w([]), s = w(""), l = q("tariffs", "tariffs"), p = tt();
646
646
  C(async () => {
647
647
  if (e.source === "api")
648
648
  try {
@@ -670,44 +670,44 @@ const tt = /* @__PURE__ */ y({
670
670
  const b = f(() => !s.value || g.value.length <= 1 ? i.value : i.value.filter((m) => m.tariffGroupName === s.value)), X = { props: e, title: t, subtitle: c, plans: i, activeGroup: s, kvTariffs: l, api: p, groups: g, activePlans: b };
671
671
  return Object.defineProperty(X, "__isScriptSetup", { enumerable: !1, value: !0 }), X;
672
672
  }
673
- }), st = { class: "x-pricing" }, ot = { class: "x-pricing__container" }, nt = {
673
+ }), ot = { class: "x-pricing" }, nt = { class: "x-pricing__container" }, at = {
674
674
  key: 0,
675
675
  class: "x-pricing__title"
676
- }, at = {
676
+ }, rt = {
677
677
  key: 1,
678
678
  class: "x-pricing__subtitle"
679
- }, rt = {
679
+ }, ct = {
680
680
  key: 2,
681
681
  class: "x-pricing__tabs"
682
- }, ct = ["onClick"], it = { class: "x-pricing__grid" }, lt = { class: "x-pricing-card__name" }, _t = {
682
+ }, it = ["onClick"], lt = { class: "x-pricing__grid" }, _t = { class: "x-pricing-card__name" }, ut = {
683
683
  key: 0,
684
684
  class: "x-pricing-card__desc"
685
- }, dt = { class: "x-pricing-card__price" }, ut = { class: "x-pricing-card__amount" }, pt = {
685
+ }, dt = { class: "x-pricing-card__price" }, pt = { class: "x-pricing-card__amount" }, ft = {
686
686
  key: 0,
687
687
  class: "x-pricing-card__period"
688
- }, ft = {
688
+ }, mt = {
689
689
  key: 1,
690
690
  class: "x-pricing-card__features"
691
- }, mt = ["href"];
692
- function ht(r, o, e, t, c, i) {
693
- return n(), a("section", st, [
694
- u("div", ot, [
691
+ }, ht = ["href"];
692
+ function vt(r, o, e, t, c, i) {
693
+ return n(), a("section", ot, [
694
+ d("div", nt, [
695
695
  t.title ? (n(), a(
696
696
  "h2",
697
- nt,
697
+ at,
698
698
  _(t.title),
699
699
  1
700
700
  /* TEXT */
701
- )) : d("v-if", !0),
701
+ )) : u("v-if", !0),
702
702
  t.subtitle ? (n(), a(
703
703
  "p",
704
- at,
704
+ rt,
705
705
  _(t.subtitle),
706
706
  1
707
707
  /* TEXT */
708
- )) : d("v-if", !0),
709
- d(" Tabs for tariff groups "),
710
- t.groups.length > 1 ? (n(), a("div", rt, [
708
+ )) : u("v-if", !0),
709
+ u(" Tabs for tariff groups "),
710
+ t.groups.length > 1 ? (n(), a("div", ct, [
711
711
  (n(!0), a(
712
712
  h,
713
713
  null,
@@ -715,12 +715,12 @@ function ht(r, o, e, t, c, i) {
715
715
  key: s,
716
716
  class: k(["x-pricing__tab", { "x-pricing__tab--active": t.activeGroup === s }]),
717
717
  onClick: (l) => t.activeGroup = s
718
- }, _(s), 11, ct))),
718
+ }, _(s), 11, it))),
719
719
  128
720
720
  /* KEYED_FRAGMENT */
721
721
  ))
722
- ])) : d("v-if", !0),
723
- u("div", it, [
722
+ ])) : u("v-if", !0),
723
+ d("div", lt, [
724
724
  (n(!0), a(
725
725
  h,
726
726
  null,
@@ -731,37 +731,37 @@ function ht(r, o, e, t, c, i) {
731
731
  class: k(["x-pricing-card", { "x-pricing-card--featured": l === e.featuredIndex }])
732
732
  },
733
733
  [
734
- u(
734
+ d(
735
735
  "h3",
736
- lt,
736
+ _t,
737
737
  _(s.name),
738
738
  1
739
739
  /* TEXT */
740
740
  ),
741
741
  s.description ? (n(), a(
742
742
  "p",
743
- _t,
743
+ ut,
744
744
  _(s.description),
745
745
  1
746
746
  /* TEXT */
747
- )) : d("v-if", !0),
748
- u("div", dt, [
749
- u(
747
+ )) : u("v-if", !0),
748
+ d("div", dt, [
749
+ d(
750
750
  "span",
751
- ut,
751
+ pt,
752
752
  _(s.price),
753
753
  1
754
754
  /* TEXT */
755
755
  ),
756
756
  s.period ? (n(), a(
757
757
  "span",
758
- pt,
758
+ ft,
759
759
  "/" + _(s.period),
760
760
  1
761
761
  /* TEXT */
762
- )) : d("v-if", !0)
762
+ )) : u("v-if", !0)
763
763
  ]),
764
- s.features?.length ? (n(), a("ul", ft, [
764
+ s.features?.length ? (n(), a("ul", mt, [
765
765
  (n(!0), a(
766
766
  h,
767
767
  null,
@@ -775,12 +775,12 @@ function ht(r, o, e, t, c, i) {
775
775
  128
776
776
  /* KEYED_FRAGMENT */
777
777
  ))
778
- ])) : d("v-if", !0),
778
+ ])) : u("v-if", !0),
779
779
  s.actionUrl ? (n(), a("a", {
780
780
  key: 2,
781
781
  href: s.actionUrl,
782
782
  class: "x-btn x-btn--primary x-pricing-card__action"
783
- }, _(s.actionText || "Choose"), 9, mt)) : d("v-if", !0)
783
+ }, _(s.actionText || "Choose"), 9, ht)) : u("v-if", !0)
784
784
  ],
785
785
  2
786
786
  /* CLASS */
@@ -792,7 +792,7 @@ function ht(r, o, e, t, c, i) {
792
792
  ])
793
793
  ]);
794
794
  }
795
- const vt = /* @__PURE__ */ x(tt, [["render", ht], ["__scopeId", "data-v-bd1e5d79"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XPricingBlock.vue"]]), yt = /* @__PURE__ */ y({
795
+ const yt = /* @__PURE__ */ x(st, [["render", vt], ["__scopeId", "data-v-bd1e5d79"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XPricingBlock.vue"]]), xt = /* @__PURE__ */ y({
796
796
  __name: "XContactsBlock",
797
797
  props: {
798
798
  data: { type: Object, required: !1 }
@@ -802,36 +802,36 @@ const vt = /* @__PURE__ */ x(tt, [["render", ht], ["__scopeId", "data-v-bd1e5d79
802
802
  const e = q("contacts:offices", "contacts:offices"), t = f(() => e.value || []), c = { kvOffices: e, offices: t };
803
803
  return Object.defineProperty(c, "__isScriptSetup", { enumerable: !1, value: !0 }), c;
804
804
  }
805
- }), xt = { class: "x-contacts" }, gt = { class: "x-contacts__container" }, kt = {
805
+ }), gt = { class: "x-contacts" }, kt = { class: "x-contacts__container" }, bt = {
806
806
  key: 0,
807
807
  class: "x-contacts__title"
808
- }, bt = {
808
+ }, $t = {
809
809
  key: 1,
810
810
  class: "x-contacts__grid"
811
- }, $t = { class: "x-contacts__name" }, St = {
811
+ }, St = { class: "x-contacts__name" }, wt = {
812
812
  key: 0,
813
813
  class: "x-contacts__info"
814
- }, wt = {
814
+ }, jt = {
815
815
  key: 1,
816
816
  class: "x-contacts__info"
817
- }, jt = ["href"], Tt = {
817
+ }, Tt = ["href"], Ct = {
818
818
  key: 2,
819
819
  class: "x-contacts__info"
820
- }, Ct = ["href"], Xt = {
820
+ }, Xt = ["href"], Bt = {
821
821
  key: 3,
822
822
  class: "x-contacts__hours"
823
823
  };
824
- function Bt(r, o, e, t, c, i) {
825
- return n(), a("section", xt, [
826
- u("div", gt, [
824
+ function Ot(r, o, e, t, c, i) {
825
+ return n(), a("section", gt, [
826
+ d("div", kt, [
827
827
  e.data?.title ? (n(), a(
828
828
  "h2",
829
- kt,
829
+ bt,
830
830
  _(e.data.title),
831
831
  1
832
832
  /* TEXT */
833
- )) : d("v-if", !0),
834
- t.offices ? (n(), a("div", bt, [
833
+ )) : u("v-if", !0),
834
+ t.offices ? (n(), a("div", $t, [
835
835
  (n(!0), a(
836
836
  h,
837
837
  null,
@@ -842,37 +842,37 @@ function Bt(r, o, e, t, c, i) {
842
842
  class: k(["x-contacts__card", { "x-contacts__card--main": s.isMain }])
843
843
  },
844
844
  [
845
- u(
845
+ d(
846
846
  "h3",
847
- $t,
847
+ St,
848
848
  _(s.name),
849
849
  1
850
850
  /* TEXT */
851
851
  ),
852
852
  s.address ? (n(), a(
853
853
  "p",
854
- St,
854
+ wt,
855
855
  _(s.address),
856
856
  1
857
857
  /* TEXT */
858
- )) : d("v-if", !0),
859
- s.phone ? (n(), a("p", wt, [
860
- u("a", {
858
+ )) : u("v-if", !0),
859
+ s.phone ? (n(), a("p", jt, [
860
+ d("a", {
861
861
  href: `tel:${s.phone}`
862
- }, _(s.phone), 9, jt)
863
- ])) : d("v-if", !0),
864
- s.email ? (n(), a("p", Tt, [
865
- u("a", {
862
+ }, _(s.phone), 9, Tt)
863
+ ])) : u("v-if", !0),
864
+ s.email ? (n(), a("p", Ct, [
865
+ d("a", {
866
866
  href: `mailto:${s.email}`
867
- }, _(s.email), 9, Ct)
868
- ])) : d("v-if", !0),
867
+ }, _(s.email), 9, Xt)
868
+ ])) : u("v-if", !0),
869
869
  s.hours ? (n(), a(
870
870
  "p",
871
- Xt,
871
+ Bt,
872
872
  _(s.hours),
873
873
  1
874
874
  /* TEXT */
875
- )) : d("v-if", !0)
875
+ )) : u("v-if", !0)
876
876
  ],
877
877
  2
878
878
  /* CLASS */
@@ -880,11 +880,11 @@ function Bt(r, o, e, t, c, i) {
880
880
  128
881
881
  /* KEYED_FRAGMENT */
882
882
  ))
883
- ])) : d("v-if", !0)
883
+ ])) : u("v-if", !0)
884
884
  ])
885
885
  ]);
886
886
  }
887
- const Ot = /* @__PURE__ */ x(yt, [["render", Bt], ["__scopeId", "data-v-e873ba26"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XContactsBlock.vue"]]), Pt = /* @__PURE__ */ y({
887
+ const Pt = /* @__PURE__ */ x(xt, [["render", Ot], ["__scopeId", "data-v-e873ba26"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XContactsBlock.vue"]]), It = /* @__PURE__ */ y({
888
888
  __name: "XGalleryBlock",
889
889
  props: {
890
890
  data: { type: Object, required: !0 }
@@ -894,20 +894,20 @@ const Ot = /* @__PURE__ */ x(yt, [["render", Bt], ["__scopeId", "data-v-e873ba26
894
894
  const e = {};
895
895
  return Object.defineProperty(e, "__isScriptSetup", { enumerable: !1, value: !0 }), e;
896
896
  }
897
- }), It = { class: "x-gallery-block" }, Lt = {
897
+ }), Lt = { class: "x-gallery-block" }, Nt = {
898
898
  key: 0,
899
899
  class: "x-gallery-block__title"
900
- }, Nt = { class: "x-gallery-block__grid" }, At = ["src", "alt"], Et = { key: 0 };
901
- function Ut(r, o, e, t, c, i) {
902
- return n(), a("section", It, [
900
+ }, Et = { class: "x-gallery-block__grid" }, At = ["src", "alt"], Ut = { key: 0 };
901
+ function Rt(r, o, e, t, c, i) {
902
+ return n(), a("section", Lt, [
903
903
  e.data.title ? (n(), a(
904
904
  "h2",
905
- Lt,
905
+ Nt,
906
906
  _(e.data.title),
907
907
  1
908
908
  /* TEXT */
909
- )) : d("v-if", !0),
910
- u("div", Nt, [
909
+ )) : u("v-if", !0),
910
+ d("div", Et, [
911
911
  (n(!0), a(
912
912
  h,
913
913
  null,
@@ -915,18 +915,18 @@ function Ut(r, o, e, t, c, i) {
915
915
  key: l,
916
916
  class: "x-gallery-block__item"
917
917
  }, [
918
- u("img", {
918
+ d("img", {
919
919
  src: s.src,
920
920
  alt: s.alt || "",
921
921
  loading: "lazy"
922
922
  }, null, 8, At),
923
923
  s.caption ? (n(), a(
924
924
  "figcaption",
925
- Et,
925
+ Ut,
926
926
  _(s.caption),
927
927
  1
928
928
  /* TEXT */
929
- )) : d("v-if", !0)
929
+ )) : u("v-if", !0)
930
930
  ]))),
931
931
  128
932
932
  /* KEYED_FRAGMENT */
@@ -934,7 +934,7 @@ function Ut(r, o, e, t, c, i) {
934
934
  ])
935
935
  ]);
936
936
  }
937
- const Rt = /* @__PURE__ */ x(Pt, [["render", Ut], ["__scopeId", "data-v-b99bb987"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XGalleryBlock.vue"]]), Mt = /* @__PURE__ */ y({
937
+ const Mt = /* @__PURE__ */ x(It, [["render", Rt], ["__scopeId", "data-v-b99bb987"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XGalleryBlock.vue"]]), Ft = /* @__PURE__ */ y({
938
938
  __name: "XMapBlock",
939
939
  props: {
940
940
  data: { type: Object, required: !0 }
@@ -947,21 +947,21 @@ const Rt = /* @__PURE__ */ x(Pt, [["render", Ut], ["__scopeId", "data-v-b99bb987
947
947
  }), c = { props: e, mapUrl: t };
948
948
  return Object.defineProperty(c, "__isScriptSetup", { enumerable: !1, value: !0 }), c;
949
949
  }
950
- }), Ft = { class: "x-map-block" }, qt = {
950
+ }), qt = { class: "x-map-block" }, Dt = {
951
951
  key: 0,
952
952
  class: "x-map-block__title"
953
- }, Dt = { class: "x-map-block__container" }, Ht = ["src"];
954
- function zt(r, o, e, t, c, i) {
955
- return n(), a("section", Ft, [
953
+ }, Ht = { class: "x-map-block__container" }, zt = ["src"];
954
+ function Gt(r, o, e, t, c, i) {
955
+ return n(), a("section", qt, [
956
956
  e.data.title ? (n(), a(
957
957
  "h2",
958
- qt,
958
+ Dt,
959
959
  _(e.data.title),
960
960
  1
961
961
  /* TEXT */
962
- )) : d("v-if", !0),
963
- u("div", Dt, [
964
- u("iframe", {
962
+ )) : u("v-if", !0),
963
+ d("div", Ht, [
964
+ d("iframe", {
965
965
  src: t.mapUrl,
966
966
  width: "100%",
967
967
  height: "400",
@@ -969,11 +969,11 @@ function zt(r, o, e, t, c, i) {
969
969
  allowfullscreen: "",
970
970
  loading: "lazy",
971
971
  referrerpolicy: "no-referrer-when-downgrade"
972
- }, null, 8, Ht)
972
+ }, null, 8, zt)
973
973
  ])
974
974
  ]);
975
975
  }
976
- const Gt = /* @__PURE__ */ x(Mt, [["render", zt], ["__scopeId", "data-v-583f4762"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XMapBlock.vue"]]), Jt = /* @__PURE__ */ y({
976
+ const Jt = /* @__PURE__ */ x(Ft, [["render", Gt], ["__scopeId", "data-v-583f4762"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XMapBlock.vue"]]), Vt = /* @__PURE__ */ y({
977
977
  __name: "XBlockRenderer",
978
978
  props: {
979
979
  blocks: { type: Array, required: !0 }
@@ -981,14 +981,14 @@ const Gt = /* @__PURE__ */ x(Mt, [["render", zt], ["__scopeId", "data-v-583f4762
981
981
  setup(r, { expose: o }) {
982
982
  o();
983
983
  const e = r, t = {
984
- hero: Ce,
985
- html: Ie,
986
- cards: qe,
987
- "image-text": Qe,
988
- pricing: vt,
989
- contacts: Ot,
990
- gallery: Rt,
991
- map: Gt
984
+ hero: Xe,
985
+ html: Le,
986
+ cards: De,
987
+ "image-text": et,
988
+ pricing: yt,
989
+ contacts: Pt,
990
+ gallery: Mt,
991
+ map: Jt
992
992
  };
993
993
  function c(l) {
994
994
  return t[l];
@@ -996,9 +996,9 @@ const Gt = /* @__PURE__ */ x(Mt, [["render", zt], ["__scopeId", "data-v-583f4762
996
996
  const i = f(() => e.blocks.filter((l) => l.settings?.visible !== !1)), s = { props: e, blockRegistry: t, getBlockComponent: c, visibleBlocks: i };
997
997
  return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
998
998
  }
999
- }), Vt = { class: "x-block-renderer" };
1000
- function Wt(r, o, e, t, c, i) {
1001
- return n(), a("div", Vt, [
999
+ }), Wt = { class: "x-block-renderer" };
1000
+ function Kt(r, o, e, t, c, i) {
1001
+ return n(), a("div", Wt, [
1002
1002
  (n(!0), a(
1003
1003
  h,
1004
1004
  null,
@@ -1006,12 +1006,12 @@ function Wt(r, o, e, t, c, i) {
1006
1006
  h,
1007
1007
  { key: l },
1008
1008
  [
1009
- t.getBlockComponent(s.type) ? (n(), T(R(t.getBlockComponent(s.type)), z({
1009
+ t.getBlockComponent(s.type) ? (n(), T(R(t.getBlockComponent(s.type)), G({
1010
1010
  key: 0,
1011
1011
  data: s.data || s.props
1012
1012
  }, { ref_for: !0 }, s.settings, {
1013
1013
  class: s.settings?.className
1014
- }), null, 16, ["data", "class"])) : d("v-if", !0)
1014
+ }), null, 16, ["data", "class"])) : u("v-if", !0)
1015
1015
  ],
1016
1016
  64
1017
1017
  /* STABLE_FRAGMENT */
@@ -1021,24 +1021,34 @@ function Wt(r, o, e, t, c, i) {
1021
1021
  ))
1022
1022
  ]);
1023
1023
  }
1024
- const ss = /* @__PURE__ */ x(Jt, [["render", Wt], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XBlockRenderer.vue"]]);
1025
- function os() {
1026
- const r = w(null), o = w(!1);
1024
+ const os = /* @__PURE__ */ x(Vt, [["render", Kt], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XBlockRenderer.vue"]]);
1025
+ function D() {
1026
+ try {
1027
+ return window.self !== window.top;
1028
+ } catch {
1029
+ return !0;
1030
+ }
1031
+ }
1032
+ function ns(r) {
1033
+ D() && r.beforeEach((o, e) => !e.name);
1034
+ }
1035
+ function as() {
1036
+ const r = w(null), o = w(D());
1027
1037
  function e(t) {
1028
1038
  const c = t.data;
1029
1039
  c?.type === "xosen-preview-update" && c.page && (r.value = c.page, o.value = !0);
1030
1040
  }
1031
1041
  return C(() => {
1032
- window.addEventListener("message", e), window.parent !== window && window.parent.postMessage({ type: "xosen-preview-ready" }, "*");
1033
- }), A(() => {
1042
+ window.addEventListener("message", e), o.value && window.parent.postMessage({ type: "xosen-preview-ready" }, "*");
1043
+ }), E(() => {
1034
1044
  window.removeEventListener("message", e);
1035
1045
  }), {
1036
1046
  previewPage: r,
1037
1047
  isPreviewMode: o
1038
1048
  };
1039
1049
  }
1040
- const Kt = /\.(js|css|png|jpg|jpeg|gif|svg|ico|woff2?|ttf|eot|webp|avif|map|json|txt|xml|webmanifest)$/;
1041
- function Yt(r, o) {
1050
+ const Yt = /\.(js|css|png|jpg|jpeg|gif|svg|ico|woff2?|ttf|eot|webp|avif|map|json|txt|xml|webmanifest)$/;
1051
+ function Zt(r, o) {
1042
1052
  const t = new URL(r.url).searchParams.get("lang");
1043
1053
  if (t && o.supportedLocales?.includes(t)) return t;
1044
1054
  if (o.supportedLocales?.length) {
@@ -1048,7 +1058,7 @@ function Yt(r, o) {
1048
1058
  }
1049
1059
  return o.defaultLocale;
1050
1060
  }
1051
- function Zt(r, o) {
1061
+ function Qt(r, o) {
1052
1062
  if (!r.pathname.startsWith("/api/content/")) return null;
1053
1063
  const e = decodeURIComponent(r.pathname.replace("/api/content/", ""));
1054
1064
  return e ? (async () => {
@@ -1070,14 +1080,14 @@ function N(r, o, e) {
1070
1080
  }
1071
1081
  return o.meta?.description && (t = t.replace(/(<meta\s+name="description"\s+content=")[^"]*(")/, `$1${o.meta.description}$2`)), o.meta?.ogTitle && (t = t.replace(/(<meta\s+property="og:title"\s+content=")[^"]*(")/, `$1${o.meta.ogTitle}$2`)), o.html && (t = t.replace('<div id="app"></div>', `<div id="app">${o.html}</div>`)), t;
1072
1082
  }
1073
- function ns(r) {
1083
+ function rs(r) {
1074
1084
  return {
1075
1085
  async fetch(o, e) {
1076
- const t = new URL(o.url), c = Zt(t, e);
1086
+ const t = new URL(o.url), c = Qt(t, e);
1077
1087
  if (c) return c;
1078
- if (Kt.test(t.pathname))
1088
+ if (Yt.test(t.pathname))
1079
1089
  return e.ASSETS.fetch(o);
1080
- const i = Yt(o, r), s = new URL("/index.html", o.url);
1090
+ const i = Zt(o, r), s = new URL("/index.html", o.url);
1081
1091
  let p = await (await e.ASSETS.fetch(new Request(s))).text();
1082
1092
  const [g, b] = await Promise.all([
1083
1093
  e.SITE_CONTENT.get("config"),
@@ -1101,8 +1111,8 @@ function ns(r) {
1101
1111
  S && (p = N(p, S, r.siteName));
1102
1112
  }
1103
1113
  t.pathname === "/" && m.home && (p = N(p, m.home, r.siteName));
1104
- const D = `<script>window.__SITE_DATA__ = ${JSON.stringify(O)};<\/script>`;
1105
- return p = p.replace("</head>", `${D}
1114
+ const H = `<script>window.__SITE_DATA__ = ${JSON.stringify(O)};<\/script>`;
1115
+ return p = p.replace("</head>", `${H}
1106
1116
  </head>`), new Response(p, {
1107
1117
  headers: {
1108
1118
  "Content-Type": "text/html;charset=utf-8",
@@ -1113,23 +1123,25 @@ function ns(r) {
1113
1123
  };
1114
1124
  }
1115
1125
  export {
1116
- ss as XBlockRenderer,
1117
- qe as XCardsBlock,
1118
- Ot as XContactsBlock,
1119
- Rt as XGalleryBlock,
1120
- Ce as XHeroBlock,
1121
- Ie as XHtmlBlock,
1122
- Qe as XImageTextBlock,
1123
- Z as XLocaleSwitcher,
1124
- Gt as XMapBlock,
1125
- vt as XPricingBlock,
1126
- ue as XSiteFooter,
1127
- ts as XSiteLayout,
1128
- ae as XSiteNav,
1129
- ns as createSiteWorker,
1130
- os as useLivePreview,
1131
- et as useSiteApi,
1126
+ os as XBlockRenderer,
1127
+ De as XCardsBlock,
1128
+ Pt as XContactsBlock,
1129
+ Mt as XGalleryBlock,
1130
+ Xe as XHeroBlock,
1131
+ Le as XHtmlBlock,
1132
+ et as XImageTextBlock,
1133
+ Q as XLocaleSwitcher,
1134
+ Jt as XMapBlock,
1135
+ yt as XPricingBlock,
1136
+ pe as XSiteFooter,
1137
+ ss as XSiteLayout,
1138
+ re as XSiteNav,
1139
+ rs as createSiteWorker,
1140
+ D as isInPreview,
1141
+ ns as setupPreviewRouter,
1142
+ as as useLivePreview,
1143
+ tt as useSiteApi,
1132
1144
  F as useSiteConfig,
1133
1145
  q as useSiteData,
1134
- G as useSkin
1146
+ J as useSkin
1135
1147
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xosen/site-sdk",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "Shared Vue components and composables for Xosen site templates",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,4 +1,5 @@
1
1
  import { ref, onMounted, onUnmounted } from 'vue';
2
+ import type { Router } from 'vue-router';
2
3
 
3
4
  export interface PreviewMessage {
4
5
  type: 'xosen-preview-update';
@@ -11,20 +12,37 @@ export interface PreviewMessage {
11
12
  };
12
13
  }
13
14
 
15
+ /** Check if running inside an iframe (preview mode) */
16
+ export function isInPreview(): boolean {
17
+ try {
18
+ return window.self !== window.top;
19
+ } catch {
20
+ return true;
21
+ }
22
+ }
23
+
24
+ /**
25
+ * Install a router guard that blocks all navigation in preview mode.
26
+ * Call this once during app setup (e.g. in App.vue or router config).
27
+ */
28
+ export function setupPreviewRouter(router: Router) {
29
+ if (!isInPreview()) return;
30
+
31
+ router.beforeEach((_to, from) => {
32
+ // Allow initial navigation, block subsequent ones
33
+ if (!from.name) return true;
34
+ return false;
35
+ });
36
+ }
37
+
14
38
  /**
15
39
  * Listen for live preview messages from the admin UI.
16
40
  * When the admin sends page data via postMessage, this composable
17
41
  * provides reactive access to the preview data.
18
- *
19
- * Usage in template ContentPage:
20
- * ```ts
21
- * const { previewPage } = useLivePreview();
22
- * // If previewPage matches current slug+locale, use it instead of KV/API data
23
- * ```
24
42
  */
25
43
  export function useLivePreview() {
26
44
  const previewPage = ref<PreviewMessage['page'] | null>(null);
27
- const isPreviewMode = ref(false);
45
+ const isPreviewMode = ref(isInPreview());
28
46
 
29
47
  function handleMessage(event: MessageEvent) {
30
48
  const data = event.data;
@@ -37,7 +55,7 @@ export function useLivePreview() {
37
55
  onMounted(() => {
38
56
  window.addEventListener('message', handleMessage);
39
57
  // Notify parent that preview is ready
40
- if (window.parent !== window) {
58
+ if (isPreviewMode.value) {
41
59
  window.parent.postMessage({ type: 'xosen-preview-ready' }, '*');
42
60
  }
43
61
  });
package/src/index.ts CHANGED
@@ -22,7 +22,7 @@ export { useSiteData } from './composables/useSiteData.js';
22
22
  export { useSiteConfig } from './composables/useSiteConfig.js';
23
23
  export { useSkin } from './composables/useSkin.js';
24
24
  export { useSiteApi } from './composables/useSiteApi.js';
25
- export { useLivePreview } from './composables/useLivePreview.js';
25
+ export { useLivePreview, setupPreviewRouter, isInPreview } from './composables/useLivePreview.js';
26
26
  export type { PreviewMessage } from './composables/useLivePreview.js';
27
27
 
28
28
  // Worker