@x-wave/blog 1.0.19 → 1.0.20

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.
Files changed (2) hide show
  1. package/index.js +101 -101
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { jsxs as d, jsx as e, Fragment as G } from "react/jsx-runtime";
2
2
  import { useTranslation as O } from "react-i18next";
3
- import { useLocation as Q, useNavigate as K, useParams as ce, Link as he, Navigate as be, Routes as ye, Route as ge } from "react-router-dom";
3
+ import { useLocation as Q, useNavigate as K, useParams as ce, Link as he, Navigate as be, Routes as ye, Route as me } from "react-router-dom";
4
4
  import { useState as T, useEffect as S, createContext as Te, useContext as Pe, useRef as F } from "react";
5
5
  import Le from "react-markdown";
6
6
  import Se from "remark-gfm";
7
7
  import ne from "i18next";
8
- import { User as De, CalendarBlank as Be, X as re, Tag as Me, MagnifyingGlass as me, List as Ee, Sun as _e, Moon as pe, Monitor as fe, CaretDown as oe, Globe as Oe, CaretRight as Re } from "@phosphor-icons/react";
8
+ import { User as De, CalendarBlank as Be, X as re, Tag as Me, MagnifyingGlass as ge, List as Ee, Sun as _e, Moon as pe, Monitor as fe, CaretDown as oe, Globe as Oe, CaretRight as Re } from "@phosphor-icons/react";
9
9
  import { createPortal as we } from "react-dom";
10
10
  const je = "_tabContainer_zk6h4_1", Ae = "_tab_zk6h4_1", We = "_active_zk6h4_45", Y = {
11
11
  tabContainer: je,
@@ -22,7 +22,7 @@ function He({ hasAdvanced: t }) {
22
22
  const v = h.toString(), _ = v ? `?${v}` : "";
23
23
  a(`${s.pathname}${_}${s.hash}`);
24
24
  }
25
- }, m = () => {
25
+ }, g = () => {
26
26
  if (!o) {
27
27
  const h = new URLSearchParams(s.search);
28
28
  h.set("advanced", ""), a(`${s.pathname}?${h.toString()}${s.hash}`);
@@ -43,7 +43,7 @@ function He({ hasAdvanced: t }) {
43
43
  {
44
44
  type: "button",
45
45
  className: `${Y.tab} ${o ? Y.active : ""}`,
46
- onClick: m,
46
+ onClick: g,
47
47
  children: n("ui.advanced")
48
48
  }
49
49
  )
@@ -57,28 +57,28 @@ function $e(t) {
57
57
  const a = s.match(/^---\s*\n([\s\S]*?)\n---\s*\n/);
58
58
  if (!a) return { frontmatter: {}, content: s };
59
59
  const r = {}, o = a[1];
60
- let u = "", m = !1;
60
+ let u = "", g = !1;
61
61
  const h = [];
62
62
  for (const _ of o.split(`
63
63
  `)) {
64
64
  const b = _.trim();
65
65
  if (b.startsWith("-")) {
66
- if (m) {
66
+ if (g) {
67
67
  const p = b.substring(1).trim();
68
68
  h.push(p);
69
69
  }
70
70
  continue;
71
71
  }
72
- if (m && !b.startsWith("-") && (r[u] = h.slice(), h.length = 0, m = !1), b != null && b.includes(":")) {
72
+ if (g && !b.startsWith("-") && (r[u] = h.slice(), h.length = 0, g = !1), b != null && b.includes(":")) {
73
73
  const [p, ...i] = b.split(":"), l = i.join(":").trim();
74
74
  if (u = p.trim(), !l) {
75
- m = !0;
75
+ g = !0;
76
76
  continue;
77
77
  }
78
78
  l === "true" ? r[u] = !0 : l === "false" ? r[u] = !1 : r[u] = l;
79
79
  }
80
80
  }
81
- m && h.length > 0 && (r[u] = h);
81
+ g && h.length > 0 && (r[u] = h);
82
82
  const v = s.replace(
83
83
  /^---\s*\n[\s\S]*?\n---\s*\n/,
84
84
  ""
@@ -91,9 +91,9 @@ function $e(t) {
91
91
  * Automatically loads the advanced variant if `advanced` is true.
92
92
  */
93
93
  async loadMDXContent(s, a, r = !1) {
94
- const o = r ? `${a}-advanced.mdx` : `${a}.mdx`, u = `./docs/${s}/${o}`, m = t[u];
95
- if (!m) throw new Error(`File not found: ${u}`);
96
- const h = await m(), { frontmatter: v, content: _ } = n(h);
94
+ const o = r ? `${a}-advanced.mdx` : `${a}.mdx`, u = `./docs/${s}/${o}`, g = t[u];
95
+ if (!g) throw new Error(`File not found: ${u}`);
96
+ const h = await g(), { frontmatter: v, content: _ } = n(h);
97
97
  return { content: _, frontmatter: v };
98
98
  },
99
99
  /**
@@ -103,7 +103,7 @@ function $e(t) {
103
103
  async loadEnglishContent(s, a = !1) {
104
104
  const o = `./docs/en/${a ? `${s}-advanced.mdx` : `${s}.mdx`}`, u = t[o];
105
105
  if (!u) throw new Error(`File not found: ${o}`);
106
- const m = await u(), { content: h } = n(m);
106
+ const g = await u(), { content: h } = n(g);
107
107
  return h;
108
108
  },
109
109
  /**
@@ -119,14 +119,14 @@ function $e(t) {
119
119
  );
120
120
  for (const u of o)
121
121
  try {
122
- const m = t[u], h = await m(), { frontmatter: v, content: _ } = n(h), b = u.split("/").pop() || "", p = b.replace(".mdx", "").replace("-advanced", ""), i = _.match(/^#\s+(.+)$/m), l = i ? i[1].trim() : p;
122
+ const g = t[u], h = await g(), { frontmatter: v, content: _ } = n(h), b = u.split("/").pop() || "", p = b.replace(".mdx", "").replace("-advanced", ""), i = _.match(/^#\s+(.+)$/m), l = i ? i[1].trim() : p;
123
123
  if (b.includes("-advanced")) continue;
124
124
  const c = v.tags;
125
125
  if (c && Array.isArray(c))
126
126
  for (const w of c)
127
127
  a[w] || (a[w] = []), a[w].some((I) => I.slug === p) || a[w].push({ slug: p, title: l });
128
- } catch (m) {
129
- console.warn(`Failed to process ${u}:`, m);
128
+ } catch (g) {
129
+ console.warn(`Failed to process ${u}:`, g);
130
130
  }
131
131
  return a;
132
132
  }
@@ -146,8 +146,8 @@ const Ne = "app-theme", xe = () => typeof window > "u" ? "light" : window.matchM
146
146
  const a = ve(t), r = document.querySelector(".xw-blog-root");
147
147
  if (r && (r.classList.remove("light", "dark"), r.classList.add(a)), t === "system") {
148
148
  const o = window.matchMedia("(prefers-color-scheme: dark)"), u = () => {
149
- const m = xe(), h = document.querySelector(".xw-blog-root");
150
- h && (h.classList.remove("light", "dark"), h.classList.add(m));
149
+ const g = xe(), h = document.querySelector(".xw-blog-root");
150
+ h && (h.classList.remove("light", "dark"), h.classList.add(g));
151
151
  };
152
152
  return o.addEventListener("change", u), () => o.removeEventListener("change", u);
153
153
  }
@@ -185,9 +185,9 @@ function Qa({
185
185
  Ie();
186
186
  const [r, o] = T({});
187
187
  S(() => {
188
- const { buildTagIndex: m } = $e(s.mdxFiles), h = n.supportedLanguages.map(async (v) => {
188
+ const { buildTagIndex: g } = $e(s.mdxFiles), h = n.supportedLanguages.map(async (v) => {
189
189
  try {
190
- const _ = await m(v);
190
+ const _ = await g(v);
191
191
  return { language: v, index: _ };
192
192
  } catch (_) {
193
193
  return console.error(`Failed to build tag index for ${v}:`, _), { language: v, index: {} };
@@ -260,7 +260,7 @@ function rt({
260
260
  content: t,
261
261
  englishContent: n
262
262
  }) {
263
- const { t: s } = O(), a = Q(), r = K(), [o, u] = T([]), [m, h] = T(""), v = F(null);
263
+ const { t: s } = O(), a = Q(), r = K(), [o, u] = T([]), [g, h] = T(""), v = F(null);
264
264
  S(() => {
265
265
  h(""), (() => {
266
266
  const p = /^(#{1,6})\s+(.+)$/gm, i = [];
@@ -341,7 +341,7 @@ function rt({
341
341
  /* @__PURE__ */ e("nav", { className: W.nav, children: /* @__PURE__ */ e("ul", { className: W.list, children: o.map((b) => /* @__PURE__ */ e("li", { className: W.item, children: /* @__PURE__ */ e(
342
342
  "button",
343
343
  {
344
- className: `${W.link} ${W[`level${b.level}`]} ${m === b.id ? W.active : ""}`,
344
+ className: `${W.link} ${W[`level${b.level}`]} ${g === b.id ? W.active : ""}`,
345
345
  onClick: () => _(b.id),
346
346
  type: "button",
347
347
  children: b.text
@@ -349,14 +349,14 @@ function rt({
349
349
  ) }, b.id)) }) })
350
350
  ] });
351
351
  }
352
- const lt = "_overlay_1e1d4_1", it = "_modal_1e1d4_26", dt = "_header_1e1d4_50", ut = "_title_1e1d4_58", ht = "_closeButton_1e1d4_65", gt = "_results_1e1d4_86", mt = "_resultsList_1e1d4_94", _t = "_resultItem_1e1d4_100", pt = "_resultTitle_1e1d4_119", ft = "_resultSlug_1e1d4_124", vt = "_noResults_1e1d4_130", j = {
352
+ const lt = "_overlay_1e1d4_1", it = "_modal_1e1d4_26", dt = "_header_1e1d4_50", ut = "_title_1e1d4_58", ht = "_closeButton_1e1d4_65", mt = "_results_1e1d4_86", gt = "_resultsList_1e1d4_94", _t = "_resultItem_1e1d4_100", pt = "_resultTitle_1e1d4_119", ft = "_resultSlug_1e1d4_124", vt = "_noResults_1e1d4_130", j = {
353
353
  overlay: lt,
354
354
  modal: it,
355
355
  header: dt,
356
356
  title: ut,
357
357
  closeButton: ht,
358
- results: gt,
359
- resultsList: mt,
358
+ results: mt,
359
+ resultsList: gt,
360
360
  resultItem: _t,
361
361
  resultTitle: pt,
362
362
  resultSlug: ft,
@@ -368,7 +368,7 @@ function bt({
368
368
  language: s,
369
369
  onClose: a
370
370
  }) {
371
- const { t: r } = O(), { config: o } = R(), u = K(), m = (h) => {
371
+ const { t: r } = O(), { config: o } = R(), u = K(), g = (h) => {
372
372
  const v = o.basePath || "";
373
373
  u(`${v}/${s}/${h}`), a();
374
374
  };
@@ -396,7 +396,7 @@ function bt({
396
396
  {
397
397
  type: "button",
398
398
  className: j.resultItem,
399
- onClick: () => m(h.slug),
399
+ onClick: () => g(h.slug),
400
400
  children: [
401
401
  /* @__PURE__ */ e("div", { className: j.resultTitle, children: h.title }),
402
402
  /* @__PURE__ */ d("div", { className: j.resultSlug, children: [
@@ -466,13 +466,13 @@ const yt = "_contentPage_1nxj5_1", Tt = "_loadingContainer_1nxj5_48", Pt = "_err
466
466
  };
467
467
  function jt({ language: t }) {
468
468
  var ue;
469
- const { slug: n } = ce(), s = Q(), { config: a, loadContent: r, loadEnglishContent: o } = R(), [u, m] = T(""), [h, v] = T(""), [_, b] = T({}), [p, i] = T(!0), [l, c] = T(null), [w, I] = T(!0), [y, f] = T(null), $ = F(0), D = F([]), ee = ((g) => {
469
+ const { slug: n } = ce(), s = Q(), { config: a, loadContent: r, loadEnglishContent: o } = R(), [u, g] = T(""), [h, v] = T(""), [_, b] = T({}), [p, i] = T(!0), [l, c] = T(null), [w, I] = T(!0), [y, f] = T(null), $ = F(0), D = F([]), ee = ((m) => {
470
470
  const C = {
471
471
  advanced: !1,
472
472
  anchor: ""
473
473
  };
474
- if (!g) return C;
475
- const N = (g.startsWith("?") ? g.substring(1) : g).split("&");
474
+ if (!m) return C;
475
+ const N = (m.startsWith("?") ? m.substring(1) : m).split("&");
476
476
  for (const k of N)
477
477
  k === "advanced" ? C.advanced = !0 : k.startsWith("a=") && (C.anchor = k.substring(2));
478
478
  return C;
@@ -517,7 +517,7 @@ function jt({ language: t }) {
517
517
  const ke = U[2].trim();
518
518
  X.push(ke), U = E.exec(k);
519
519
  }
520
- D.current = X, v(k), m(N.content), b(N.frontmatter);
520
+ D.current = X, v(k), g(N.content), b(N.frontmatter);
521
521
  } catch (N) {
522
522
  c(N instanceof Error ? N.message : "Failed to load content");
523
523
  } finally {
@@ -533,7 +533,7 @@ function jt({ language: t }) {
533
533
  o
534
534
  ]), S(() => {
535
535
  if (!p && ee.anchor) {
536
- const g = setTimeout(() => {
536
+ const m = setTimeout(() => {
537
537
  const C = document.getElementById(ee.anchor);
538
538
  if (C) {
539
539
  const k = C.getBoundingClientRect().top + window.pageYOffset - 80;
@@ -543,7 +543,7 @@ function jt({ language: t }) {
543
543
  });
544
544
  }
545
545
  }, 150);
546
- return () => clearTimeout(g);
546
+ return () => clearTimeout(m);
547
547
  }
548
548
  }, [p, ee.anchor]), p)
549
549
  return /* @__PURE__ */ e("div", { className: B.contentPage, children: /* @__PURE__ */ d("div", { className: B.loadingContainer, children: [
@@ -567,7 +567,7 @@ function jt({ language: t }) {
567
567
  {
568
568
  remarkPlugins: [Se],
569
569
  components: {
570
- h1: ({ children: g }) => {
570
+ h1: ({ children: m }) => {
571
571
  const C = $.current++, L = D.current[C] || "", N = Z(L), k = A ? `?advanced&a=${N}` : `?a=${N}`, E = `#/${t}/${n}${k}`, X = !de;
572
572
  de = !0;
573
573
  const U = _.date || _.author;
@@ -582,7 +582,7 @@ function jt({ language: t }) {
582
582
  {
583
583
  href: E,
584
584
  style: { color: "inherit", textDecoration: "none" },
585
- children: g
585
+ children: m
586
586
  }
587
587
  )
588
588
  }
@@ -596,81 +596,81 @@ function jt({ language: t }) {
596
596
  )
597
597
  ] });
598
598
  },
599
- h2: ({ children: g }) => {
599
+ h2: ({ children: m }) => {
600
600
  const C = $.current++, L = D.current[C] || "", N = Z(L), k = A ? `?advanced&a=${N}` : `?a=${N}`, E = `#/${t}/${n}${k}`;
601
601
  return /* @__PURE__ */ e("h2", { id: N, children: /* @__PURE__ */ e(
602
602
  "a",
603
603
  {
604
604
  href: E,
605
605
  style: { color: "inherit", textDecoration: "none" },
606
- children: g
606
+ children: m
607
607
  }
608
608
  ) });
609
609
  },
610
- h3: ({ children: g }) => {
610
+ h3: ({ children: m }) => {
611
611
  const C = $.current++, L = D.current[C] || "", N = Z(L), k = A ? `?advanced&a=${N}` : `?a=${N}`, E = `#/${t}/${n}${k}`;
612
612
  return /* @__PURE__ */ e("h3", { id: N, children: /* @__PURE__ */ e(
613
613
  "a",
614
614
  {
615
615
  href: E,
616
616
  style: { color: "inherit", textDecoration: "none" },
617
- children: g
617
+ children: m
618
618
  }
619
619
  ) });
620
620
  },
621
- h4: ({ children: g }) => {
621
+ h4: ({ children: m }) => {
622
622
  const C = $.current++, L = D.current[C] || "", N = Z(L), k = A ? `?advanced&a=${N}` : `?a=${N}`, E = `#/${t}/${n}${k}`;
623
623
  return /* @__PURE__ */ e("h4", { id: N, children: /* @__PURE__ */ e(
624
624
  "a",
625
625
  {
626
626
  href: E,
627
627
  style: { color: "inherit", textDecoration: "none" },
628
- children: g
628
+ children: m
629
629
  }
630
630
  ) });
631
631
  },
632
- h5: ({ children: g }) => {
632
+ h5: ({ children: m }) => {
633
633
  const C = `h5-${$.current++}`;
634
- return /* @__PURE__ */ e("h5", { id: C, children: g });
634
+ return /* @__PURE__ */ e("h5", { id: C, children: m });
635
635
  },
636
- h6: ({ children: g }) => {
636
+ h6: ({ children: m }) => {
637
637
  const C = `h6-${$.current++}`;
638
- return /* @__PURE__ */ e("h6", { id: C, children: g });
638
+ return /* @__PURE__ */ e("h6", { id: C, children: m });
639
639
  },
640
- p: ({ children: g }) => /* @__PURE__ */ e("p", { children: g }),
641
- ul: ({ children: g }) => /* @__PURE__ */ e("ul", { children: g }),
642
- ol: ({ children: g }) => /* @__PURE__ */ e("ol", { children: g }),
643
- li: ({ children: g }) => /* @__PURE__ */ e("li", { children: g }),
644
- code: ({ className: g, children: C, ...L }) => {
645
- if (!g)
640
+ p: ({ children: m }) => /* @__PURE__ */ e("p", { children: m }),
641
+ ul: ({ children: m }) => /* @__PURE__ */ e("ul", { children: m }),
642
+ ol: ({ children: m }) => /* @__PURE__ */ e("ol", { children: m }),
643
+ li: ({ children: m }) => /* @__PURE__ */ e("li", { children: m }),
644
+ code: ({ className: m, children: C, ...L }) => {
645
+ if (!m)
646
646
  return /* @__PURE__ */ e("code", { ...L, children: C });
647
- const k = (g == null ? void 0 : g.replace("language-", "")) || "";
647
+ const k = (m == null ? void 0 : m.replace("language-", "")) || "";
648
648
  return /* @__PURE__ */ d("div", { className: B.codeBlock, children: [
649
649
  k && /* @__PURE__ */ e("div", { className: B.codeLanguage, children: k }),
650
- /* @__PURE__ */ e("pre", { children: /* @__PURE__ */ e("code", { className: g, ...L, children: C }) })
650
+ /* @__PURE__ */ e("pre", { children: /* @__PURE__ */ e("code", { className: m, ...L, children: C }) })
651
651
  ] });
652
652
  },
653
- pre: ({ children: g }) => /* @__PURE__ */ e(G, { children: g }),
653
+ pre: ({ children: m }) => /* @__PURE__ */ e(G, { children: m }),
654
654
  // Let code component handle pre styling
655
- blockquote: ({ children: g }) => /* @__PURE__ */ e("blockquote", { children: g }),
656
- a: ({ href: g, children: C, ...L }) => {
657
- if (g != null && g.startsWith("./")) {
658
- const N = g.slice(2), k = `#/${t}/${N}`;
655
+ blockquote: ({ children: m }) => /* @__PURE__ */ e("blockquote", { children: m }),
656
+ a: ({ href: m, children: C, ...L }) => {
657
+ if (m != null && m.startsWith("./")) {
658
+ const N = m.slice(2), k = `#/${t}/${N}`;
659
659
  return /* @__PURE__ */ e("a", { href: k, ...L, children: C });
660
660
  }
661
- return g != null && g.startsWith("http://") || g != null && g.startsWith("https://") ? /* @__PURE__ */ e(
661
+ return m != null && m.startsWith("http://") || m != null && m.startsWith("https://") ? /* @__PURE__ */ e(
662
662
  "a",
663
663
  {
664
- href: g,
664
+ href: m,
665
665
  target: "_blank",
666
666
  rel: "noopener noreferrer",
667
667
  ...L,
668
668
  children: C
669
669
  }
670
- ) : /* @__PURE__ */ e("a", { href: g, ...L, children: C });
670
+ ) : /* @__PURE__ */ e("a", { href: m, ...L, children: C });
671
671
  },
672
- strong: ({ children: g }) => /* @__PURE__ */ e("strong", { children: g }),
673
- em: ({ children: g }) => /* @__PURE__ */ e("em", { children: g })
672
+ strong: ({ children: m }) => /* @__PURE__ */ e("strong", { children: m }),
673
+ em: ({ children: m }) => /* @__PURE__ */ e("em", { children: m })
674
674
  },
675
675
  children: u
676
676
  }
@@ -680,7 +680,7 @@ function jt({ language: t }) {
680
680
  {
681
681
  tags: _.tags,
682
682
  variant: "compact",
683
- onTagClick: (g) => f(g)
683
+ onTagClick: (m) => f(m)
684
684
  }
685
685
  )
686
686
  ] }),
@@ -717,7 +717,7 @@ const At = "_searchButton_1k9sl_1", Wt = "_searchIcon_1k9sl_17", Ht = "_searchHi
717
717
  hint: nn
718
718
  };
719
719
  function an({ language: t }) {
720
- const { t: n } = O(), s = K(), { config: a } = R(), [r, o] = T(!1), [u, m] = T(""), [h, v] = T([]), [_, b] = T(0), p = F(null), i = F(null), c = typeof navigator < "u" && /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform) ? "⌘K" : "Ctrl+K", w = (a.navigationData ? te(a.navigationData, t) : []).flatMap((f) => "items" in f ? f.items.map(($) => ({
720
+ const { t: n } = O(), s = K(), { config: a } = R(), [r, o] = T(!1), [u, g] = T(""), [h, v] = T([]), [_, b] = T(0), p = F(null), i = F(null), c = typeof navigator < "u" && /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform) ? "⌘K" : "Ctrl+K", w = (a.navigationData ? te(a.navigationData, t) : []).flatMap((f) => "items" in f ? f.items.map(($) => ({
721
721
  title: $.title,
722
722
  slug: $.slug
723
723
  })) : [{ title: f.title, slug: f.slug }]);
@@ -735,7 +735,7 @@ function an({ language: t }) {
735
735
  ($.metaKey || $.ctrlKey) && $.key === "k" && ($.preventDefault(), o(!0), setTimeout(() => {
736
736
  var D;
737
737
  return (D = p.current) == null ? void 0 : D.focus();
738
- }, 100)), $.key === "Escape" && r && (o(!1), m(""));
738
+ }, 100)), $.key === "Escape" && r && (o(!1), g(""));
739
739
  };
740
740
  return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
741
741
  }, [r]), S(() => {
@@ -745,7 +745,7 @@ function an({ language: t }) {
745
745
  return (D = p.current) == null ? void 0 : D.focus();
746
746
  }, 100);
747
747
  }, $ = () => {
748
- o(!1), m("");
748
+ o(!1), g("");
749
749
  };
750
750
  return window.addEventListener("blog:open-search", f), window.addEventListener("blog:close-search", $), () => {
751
751
  window.removeEventListener("blog:open-search", f), window.removeEventListener("blog:close-search", $);
@@ -756,13 +756,13 @@ function an({ language: t }) {
756
756
  };
757
757
  S(() => {
758
758
  const f = ($) => {
759
- i.current && !i.current.contains($.target) && (o(!1), m(""));
759
+ i.current && !i.current.contains($.target) && (o(!1), g(""));
760
760
  };
761
761
  return r && document.addEventListener("mousedown", f), () => document.removeEventListener("mousedown", f);
762
762
  }, [r]);
763
763
  const y = (f) => {
764
764
  const $ = a.basePath || "";
765
- s(`${$}/${t}/${f}`), o(!1), m("");
765
+ s(`${$}/${t}/${f}`), o(!1), g("");
766
766
  };
767
767
  return /* @__PURE__ */ d(G, { children: [
768
768
  /* @__PURE__ */ d(
@@ -778,7 +778,7 @@ function an({ language: t }) {
778
778
  },
779
779
  "aria-label": n("ui.search"),
780
780
  children: [
781
- /* @__PURE__ */ e(me, { className: P.searchIcon }),
781
+ /* @__PURE__ */ e(ge, { className: P.searchIcon }),
782
782
  /* @__PURE__ */ e("span", { className: P.searchHint, children: n("ui.search") }),
783
783
  /* @__PURE__ */ e("kbd", { className: P.kbd, children: c })
784
784
  ]
@@ -790,7 +790,7 @@ function an({ language: t }) {
790
790
  {
791
791
  className: P.searchOverlay,
792
792
  onClick: () => {
793
- o(!1), m("");
793
+ o(!1), g("");
794
794
  },
795
795
  children: /* @__PURE__ */ d(
796
796
  "div",
@@ -800,7 +800,7 @@ function an({ language: t }) {
800
800
  onClick: (f) => f.stopPropagation(),
801
801
  children: [
802
802
  /* @__PURE__ */ d("div", { className: P.searchHeader, children: [
803
- /* @__PURE__ */ e(me, { className: P.searchIcon }),
803
+ /* @__PURE__ */ e(ge, { className: P.searchIcon }),
804
804
  /* @__PURE__ */ e(
805
805
  "input",
806
806
  {
@@ -809,7 +809,7 @@ function an({ language: t }) {
809
809
  className: P.searchInput,
810
810
  placeholder: n("ui.searchPlaceholder"),
811
811
  value: u,
812
- onChange: (f) => m(f.target.value),
812
+ onChange: (f) => g(f.target.value),
813
813
  onKeyDown: I
814
814
  }
815
815
  ),
@@ -819,7 +819,7 @@ function an({ language: t }) {
819
819
  type: "button",
820
820
  className: P.closeButton,
821
821
  onClick: () => {
822
- o(!1), m("");
822
+ o(!1), g("");
823
823
  },
824
824
  "aria-label": "Close search",
825
825
  children: /* @__PURE__ */ e(re, {})
@@ -866,7 +866,7 @@ function an({ language: t }) {
866
866
  )
867
867
  ] });
868
868
  }
869
- const on = "_header_jrobc_1", sn = "_container_jrobc_24", cn = "_content_jrobc_36", rn = "_leftSection_jrobc_43", ln = "_mobileMenuButton_jrobc_49", dn = "_burgerIcon_jrobc_87", un = "_logo_jrobc_92", hn = "_nav_jrobc_98", gn = "_navLink_jrobc_109", mn = "_externalIcon_jrobc_135", _n = "_supportDropdown_jrobc_141", pn = "_themeDropdown_jrobc_145", fn = "_themeButton_jrobc_149", vn = "_themeIcon_jrobc_171", bn = "_supportButton_jrobc_177", wn = "_caretIcon_jrobc_198", $n = "_dropdownMenu_jrobc_208", Nn = "_dropdownItem_jrobc_221", xn = "_dropdownIcon_jrobc_244", x = {
869
+ const on = "_header_jrobc_1", sn = "_container_jrobc_24", cn = "_content_jrobc_36", rn = "_leftSection_jrobc_43", ln = "_mobileMenuButton_jrobc_49", dn = "_burgerIcon_jrobc_87", un = "_logo_jrobc_92", hn = "_nav_jrobc_98", mn = "_navLink_jrobc_109", gn = "_externalIcon_jrobc_135", _n = "_supportDropdown_jrobc_141", pn = "_themeDropdown_jrobc_145", fn = "_themeButton_jrobc_149", vn = "_themeIcon_jrobc_171", bn = "_supportButton_jrobc_177", wn = "_caretIcon_jrobc_198", $n = "_dropdownMenu_jrobc_208", Nn = "_dropdownItem_jrobc_221", xn = "_dropdownIcon_jrobc_244", x = {
870
870
  header: on,
871
871
  container: sn,
872
872
  content: cn,
@@ -875,8 +875,8 @@ const on = "_header_jrobc_1", sn = "_container_jrobc_24", cn = "_content_jrobc_3
875
875
  burgerIcon: dn,
876
876
  logo: un,
877
877
  nav: hn,
878
- navLink: gn,
879
- externalIcon: mn,
878
+ navLink: mn,
879
+ externalIcon: gn,
880
880
  supportDropdown: _n,
881
881
  themeDropdown: pn,
882
882
  themeButton: fn,
@@ -888,7 +888,7 @@ const on = "_header_jrobc_1", sn = "_container_jrobc_24", cn = "_content_jrobc_3
888
888
  dropdownIcon: xn
889
889
  };
890
890
  function In({ onMobileMenuToggle: t }) {
891
- const { t: n, i18n: s } = O(), { config: a } = R(), r = a.header ?? {}, o = r.navLinks ?? [], u = r.dropdownItems ?? [], [m, h] = T(!1), [v, _] = T(!1), { theme: b, setTheme: p } = Ie(), i = F(null), l = F(null);
891
+ const { t: n, i18n: s } = O(), { config: a } = R(), r = a.header ?? {}, o = r.navLinks ?? [], u = r.dropdownItems ?? [], [g, h] = T(!1), [v, _] = T(!1), { theme: b, setTheme: p } = Ie(), i = F(null), l = F(null);
892
892
  return S(() => {
893
893
  const c = (w) => {
894
894
  i.current && !i.current.contains(w.target) && h(!1), l.current && !l.current.contains(w.target) && _(!1);
@@ -979,8 +979,8 @@ function In({ onMobileMenuToggle: t }) {
979
979
  {
980
980
  type: "button",
981
981
  className: x.supportButton,
982
- onClick: () => h(!m),
983
- "aria-expanded": m,
982
+ onClick: () => h(!g),
983
+ "aria-expanded": g,
984
984
  "aria-haspopup": "true",
985
985
  children: [
986
986
  n("ui.support"),
@@ -988,7 +988,7 @@ function In({ onMobileMenuToggle: t }) {
988
988
  ]
989
989
  }
990
990
  ),
991
- m && /* @__PURE__ */ e("div", { className: x.dropdownMenu, children: u.map((c, w) => {
991
+ g && /* @__PURE__ */ e("div", { className: x.dropdownMenu, children: u.map((c, w) => {
992
992
  const I = c.target ?? (c.url.startsWith("http") ? "_blank" : "_self"), y = c.rel ?? (I === "_blank" ? "noopener noreferrer" : void 0), f = c.icon;
993
993
  return /* @__PURE__ */ d(
994
994
  "a",
@@ -1031,7 +1031,7 @@ function le({
1031
1031
  styles: t,
1032
1032
  onLanguageChange: n
1033
1033
  }) {
1034
- const { i18n: s } = O(), a = Q(), r = K(), { config: o } = R(), [u, m] = T(!1), h = F(null), v = s.language, _ = (p) => {
1034
+ const { i18n: s } = O(), a = Q(), r = K(), { config: o } = R(), [u, g] = T(!1), h = F(null), v = s.language, _ = (p) => {
1035
1035
  const i = o.basePath || "";
1036
1036
  let l = a.pathname;
1037
1037
  i && l.startsWith(i) && (l = l.slice(i.length));
@@ -1039,11 +1039,11 @@ function le({
1039
1039
  let I = "";
1040
1040
  o.supportedLanguages.includes(w) ? (c[0] = p, I = `${i}/${c.join("/")}`) : I = `${i}/${p}${l}`;
1041
1041
  const y = I + a.search + a.hash;
1042
- s.changeLanguage(p), r(y), m(!1), n == null || n();
1042
+ s.changeLanguage(p), r(y), g(!1), n == null || n();
1043
1043
  };
1044
1044
  S(() => {
1045
1045
  const p = (i) => {
1046
- h.current && !h.current.contains(i.target) && m(!1);
1046
+ h.current && !h.current.contains(i.target) && g(!1);
1047
1047
  };
1048
1048
  return document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
1049
1049
  }, []);
@@ -1054,7 +1054,7 @@ function le({
1054
1054
  {
1055
1055
  type: "button",
1056
1056
  className: t.languageButton,
1057
- onClick: () => m(!u),
1057
+ onClick: () => g(!u),
1058
1058
  "aria-expanded": u,
1059
1059
  "aria-haspopup": "listbox",
1060
1060
  children: [
@@ -1092,12 +1092,12 @@ function ie({ styles: t, onLinkClick: n }) {
1092
1092
  },
1093
1093
  {}
1094
1094
  );
1095
- }), m = s.language, h = r.navigationData ? te(r.navigationData, m) : [];
1095
+ }), g = s.language, h = r.navigationData ? te(r.navigationData, g) : [];
1096
1096
  S(() => {
1097
1097
  if (!r.navigationData) return;
1098
1098
  const l = te(
1099
1099
  r.navigationData,
1100
- m
1100
+ g
1101
1101
  ).reduce(
1102
1102
  (c, w, I) => {
1103
1103
  if (V(w)) {
@@ -1109,7 +1109,7 @@ function ie({ styles: t, onLinkClick: n }) {
1109
1109
  {}
1110
1110
  );
1111
1111
  u(l);
1112
- }, [m, r.navigationData]);
1112
+ }, [g, r.navigationData]);
1113
1113
  const v = (i) => {
1114
1114
  u((l) => ({
1115
1115
  ...l,
@@ -1126,7 +1126,7 @@ function ie({ styles: t, onLinkClick: n }) {
1126
1126
  let c = a.pathname;
1127
1127
  l && c.startsWith(l) && (c = c.slice(l.length));
1128
1128
  const w = c.split("/").filter(Boolean);
1129
- return w[0] && r.supportedLanguages.includes(w[0]) ? `${l}/${w[0]}/${i}` : `${l}/${m}/${i}`;
1129
+ return w[0] && r.supportedLanguages.includes(w[0]) ? `${l}/${w[0]}/${i}` : `${l}/${g}/${i}`;
1130
1130
  }, p = () => {
1131
1131
  n == null || n();
1132
1132
  };
@@ -1242,7 +1242,7 @@ function Jn({ isOpen: t, onClose: n }) {
1242
1242
  ] })
1243
1243
  ] });
1244
1244
  }
1245
- const Zn = "_sidebar_1tdxt_1", ea = "_header_1tdxt_17", ta = "_brand_1tdxt_29", na = "_cloudIcon_1tdxt_35", aa = "_title_1tdxt_44", oa = "_languageSelect_1tdxt_55", sa = "_languageButton_1tdxt_61", ca = "_icon_1tdxt_99", ra = "_chevron_1tdxt_104", la = "_languageDropdown_1tdxt_114", ia = "_languageOption_1tdxt_128", da = "_selected_1tdxt_147", ua = "_scrollArea_1tdxt_152", ha = "_navigation_1tdxt_158", ga = "_section_1tdxt_164", ma = "_sectionButton_1tdxt_170", _a = "_expanded_1tdxt_213", pa = "_sectionItems_1tdxt_217", fa = "_navItem_1tdxt_225", va = "_active_1tdxt_238", ba = "_navItemContent_1tdxt_243", q = {
1245
+ const Zn = "_sidebar_1tdxt_1", ea = "_header_1tdxt_17", ta = "_brand_1tdxt_29", na = "_cloudIcon_1tdxt_35", aa = "_title_1tdxt_44", oa = "_languageSelect_1tdxt_55", sa = "_languageButton_1tdxt_61", ca = "_icon_1tdxt_99", ra = "_chevron_1tdxt_104", la = "_languageDropdown_1tdxt_114", ia = "_languageOption_1tdxt_128", da = "_selected_1tdxt_147", ua = "_scrollArea_1tdxt_152", ha = "_navigation_1tdxt_158", ma = "_section_1tdxt_164", ga = "_sectionButton_1tdxt_170", _a = "_expanded_1tdxt_213", pa = "_sectionItems_1tdxt_217", fa = "_navItem_1tdxt_225", va = "_active_1tdxt_238", ba = "_navItemContent_1tdxt_243", q = {
1246
1246
  sidebar: Zn,
1247
1247
  header: ea,
1248
1248
  brand: ta,
@@ -1257,8 +1257,8 @@ const Zn = "_sidebar_1tdxt_1", ea = "_header_1tdxt_17", ta = "_brand_1tdxt_29",
1257
1257
  selected: da,
1258
1258
  scrollArea: ua,
1259
1259
  navigation: ha,
1260
- section: ga,
1261
- sectionButton: ma,
1260
+ section: ma,
1261
+ sectionButton: ga,
1262
1262
  expanded: _a,
1263
1263
  sectionItems: pa,
1264
1264
  navItem: fa,
@@ -1292,15 +1292,15 @@ function ka({ children: t }) {
1292
1292
  }, [n, s, a.supportedLanguages]);
1293
1293
  const u = () => {
1294
1294
  o(!r);
1295
- }, m = () => {
1295
+ }, g = () => {
1296
1296
  o(!1);
1297
1297
  };
1298
1298
  if (!n || !a.supportedLanguages.includes(n))
1299
1299
  return /* @__PURE__ */ e(be, { to: "/en/welcome", replace: !0 });
1300
- const h = !!a.header, v = !!a.navigationData && a.navigationData.length > 0, _ = a.contentMaxWidth ? { width: "100%", maxWidth: a.contentMaxWidth } : void 0;
1300
+ const h = !!a.header, v = a.showSideMenu !== !1, _ = a.contentMaxWidth ? { width: "100%", maxWidth: a.contentMaxWidth } : void 0;
1301
1301
  return /* @__PURE__ */ d("div", { className: J.app, children: [
1302
1302
  h && /* @__PURE__ */ e(In, { onMobileMenuToggle: u }),
1303
- /* @__PURE__ */ e(Jn, { isOpen: r, onClose: m }),
1303
+ /* @__PURE__ */ e(Jn, { isOpen: r, onClose: g }),
1304
1304
  /* @__PURE__ */ d("div", { className: J.layout, children: [
1305
1305
  v && /* @__PURE__ */ e(wa, {}),
1306
1306
  /* @__PURE__ */ e(
@@ -1325,7 +1325,7 @@ const ya = "_homePage_1lc5u_1", Ta = "_header_1lc5u_20", Pa = "_title_1lc5u_24",
1325
1325
  empty: Ea
1326
1326
  };
1327
1327
  function Oa() {
1328
- const { i18n: t, t: n } = O(), { config: s, loadContent: a } = R(), r = K(), [o, u] = T([]), [m, h] = T(!0);
1328
+ const { i18n: t, t: n } = O(), { config: s, loadContent: a } = R(), r = K(), [o, u] = T([]), [g, h] = T(!0);
1329
1329
  S(() => {
1330
1330
  (async () => {
1331
1331
  try {
@@ -1370,7 +1370,7 @@ function Oa() {
1370
1370
  const b = s.basePath || "";
1371
1371
  r(`${b}/${t.language}/${_}`);
1372
1372
  };
1373
- return m ? /* @__PURE__ */ e("div", { className: H.loading, children: n("ui.loadingArticles") }) : o.length === 0 ? /* @__PURE__ */ e("div", { className: H.empty, children: n("ui.noArticlesFound") }) : /* @__PURE__ */ d("div", { className: H.homePage, children: [
1373
+ return g ? /* @__PURE__ */ e("div", { className: H.loading, children: n("ui.loadingArticles") }) : o.length === 0 ? /* @__PURE__ */ e("div", { className: H.empty, children: n("ui.noArticlesFound") }) : /* @__PURE__ */ d("div", { className: H.homePage, children: [
1374
1374
  /* @__PURE__ */ d("div", { className: H.header, children: [
1375
1375
  /* @__PURE__ */ e("h1", { className: H.title, children: n("ui.latestPosts") }),
1376
1376
  o.length > 0 && /* @__PURE__ */ e(se, { date: o[0].date, author: o[0].author })
@@ -1394,9 +1394,9 @@ function Oa() {
1394
1394
  function Ya() {
1395
1395
  const { language: t } = ce(), { config: n } = R();
1396
1396
  return /* @__PURE__ */ e(ka, { children: /* @__PURE__ */ d(ye, { children: [
1397
- /* @__PURE__ */ e(ge, { path: "/:slug", element: /* @__PURE__ */ e(jt, { language: t }) }),
1397
+ /* @__PURE__ */ e(me, { path: "/:slug", element: /* @__PURE__ */ e(jt, { language: t }) }),
1398
1398
  /* @__PURE__ */ e(
1399
- ge,
1399
+ me,
1400
1400
  {
1401
1401
  index: !0,
1402
1402
  element: (n.defaultRoute || "latest") === "latest" ? /* @__PURE__ */ e(Oa, {}) : /* @__PURE__ */ e(be, { to: `./${n.defaultRoute}`, replace: !0 })
@@ -1420,9 +1420,9 @@ function Ja() {
1420
1420
  const o = a.basePath || "";
1421
1421
  let u = n.pathname;
1422
1422
  o && u.startsWith(o) && (u = u.slice(o.length));
1423
- const m = u.split("/").filter(Boolean), h = m[0];
1423
+ const g = u.split("/").filter(Boolean), h = g[0];
1424
1424
  let v = "";
1425
- a.supportedLanguages.includes(h) ? (m[0] = r, v = `${o}/${m.join("/")}`) : v = `${o}/${r}${u}`;
1425
+ a.supportedLanguages.includes(h) ? (g[0] = r, v = `${o}/${g.join("/")}`) : v = `${o}/${r}${u}`;
1426
1426
  const _ = v + n.search + n.hash;
1427
1427
  t.changeLanguage(r), s(_);
1428
1428
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x-wave/blog",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {