@paroicms/internal-link-plugin 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -249,29 +249,29 @@ function bt(t, e, n) {
249
249
  for (; e[l - 1] === n[r - 1]; )
250
250
  l--, r--;
251
251
  if (l === o) {
252
- const a = r < i ? s ? n[s - 1].nextSibling : n[r - s] : u;
253
- for (; s < r; ) t.insertBefore(n[s++], a);
252
+ const f = r < i ? s ? n[s - 1].nextSibling : n[r - s] : u;
253
+ for (; s < r; ) t.insertBefore(n[s++], f);
254
254
  } else if (r === s)
255
255
  for (; o < l; )
256
256
  (!$ || !$.has(e[o])) && e[o].remove(), o++;
257
257
  else if (e[o] === n[r - 1] && n[s] === e[l - 1]) {
258
- const a = e[--l].nextSibling;
259
- t.insertBefore(n[s++], e[o++].nextSibling), t.insertBefore(n[--r], a), e[l] = n[r];
258
+ const f = e[--l].nextSibling;
259
+ t.insertBefore(n[s++], e[o++].nextSibling), t.insertBefore(n[--r], f), e[l] = n[r];
260
260
  } else {
261
261
  if (!$) {
262
262
  $ = /* @__PURE__ */ new Map();
263
263
  let h = s;
264
264
  for (; h < r; ) $.set(n[h], h++);
265
265
  }
266
- const a = $.get(e[o]);
267
- if (a != null)
268
- if (s < a && a < r) {
266
+ const f = $.get(e[o]);
267
+ if (f != null)
268
+ if (s < f && f < r) {
269
269
  let h = o, m = 1, c;
270
- for (; ++h < l && h < r && !((c = $.get(e[h])) == null || c !== a + m); )
270
+ for (; ++h < l && h < r && !((c = $.get(e[h])) == null || c !== f + m); )
271
271
  m++;
272
- if (m > a - s) {
273
- const f = e[o];
274
- for (; s < a; ) t.insertBefore(n[s++], f);
272
+ if (m > f - s) {
273
+ const a = e[o];
274
+ for (; s < f; ) t.insertBefore(n[s++], a);
275
275
  } else t.replaceChild(n[s++], e[o++]);
276
276
  } else o++;
277
277
  else e[o++].remove();
@@ -393,8 +393,8 @@ function H(t, e, n, i) {
393
393
  } else
394
394
  t.push(s), l = !0;
395
395
  else {
396
- const a = String(s);
397
- u && u.nodeType === 3 && u.data === a ? t.push(u) : t.push(document.createTextNode(a));
396
+ const f = String(s);
397
+ u && u.nodeType === 3 && u.data === f ? t.push(u) : t.push(document.createTextNode(f));
398
398
  }
399
399
  }
400
400
  return l;
@@ -483,47 +483,47 @@ function ft(t) {
483
483
  t: u
484
484
  } = K(t.language);
485
485
  F(async () => {
486
- const a = e();
487
- if (!a) return;
488
- const h = await i.getDocument(a);
489
- r(h.title ?? ""), await $();
486
+ const f = e();
487
+ if (!f) return;
488
+ const h = await i.getDocument(f);
489
+ r(h?.title ?? ""), await $();
490
490
  });
491
- const $ = async (a) => {
492
- if (a?.preventDefault(), l().length < 3) return;
491
+ const $ = async (f) => {
492
+ if (f?.preventDefault(), l().length < 3) return;
493
493
  const h = await i.searchDocuments({
494
494
  searchString: l()
495
495
  });
496
496
  s(h);
497
497
  };
498
498
  return (() => {
499
- var a = Tt(), h = a.firstChild, m = h.firstChild;
500
- return h.addEventListener("submit", $), m.$$input = (c) => r(c.currentTarget.value), p(a, T(Z, {
499
+ var f = Tt(), h = f.firstChild, m = h.firstChild;
500
+ return h.addEventListener("submit", $), m.$$input = (c) => r(c.currentTarget.value), p(f, T(Z, {
501
501
  when: o,
502
502
  get children() {
503
503
  var c = Ct();
504
- return p(c, () => o().map((f) => (
504
+ return p(c, () => o().map((a) => (
505
505
  // biome-ignore lint/correctness/useJsxKeyInIterable: no need key here
506
506
  (() => {
507
507
  var d = xt(), g = d.firstChild, L = g.nextSibling;
508
508
  return d.$$click = () => {
509
- n(f.id);
510
- }, p(g, () => f.title), p(L, (() => {
511
- var v = _(() => !!f.ready);
512
- return () => v() ? _(() => z(f.publishDate).getTime() < (/* @__PURE__ */ new Date()).getTime())() ? u("InternalLink.editor.published") : u("InternalLink.editor.sheduled") : u("InternalLink.editor.draft");
509
+ n(a.id);
510
+ }, p(g, () => a.title), p(L, (() => {
511
+ var v = _(() => !!a.ready);
512
+ return () => v() ? _(() => z(a.publishDate).getTime() < (/* @__PURE__ */ new Date()).getTime())() ? u("InternalLink.editor.published") : u("InternalLink.editor.sheduled") : u("InternalLink.editor.draft");
513
513
  })()), P(() => kt(L, `ILResultItem-status
514
- ${f.ready ? z(f.publishDate).getTime() < (/* @__PURE__ */ new Date()).getTime() ? "published" : "sheduled" : "draft"}`)), d;
514
+ ${a.ready ? z(a.publishDate).getTime() < (/* @__PURE__ */ new Date()).getTime() ? "published" : "sheduled" : "draft"}`)), d;
515
515
  })()
516
516
  ))), c;
517
517
  }
518
- }), null), p(a, T(Z, {
518
+ }), null), p(f, T(Z, {
519
519
  get when() {
520
520
  return !o() || o().length === 0;
521
521
  },
522
522
  get children() {
523
- var c = At(), f = c.firstChild;
524
- return p(f, () => u("InternalLink.editor.noResult")), c;
523
+ var c = At(), a = c.firstChild;
524
+ return p(a, () => u("InternalLink.editor.noResult")), c;
525
525
  }
526
- }), null), P(() => m.value = l()), a;
526
+ }), null), P(() => m.value = l()), f;
527
527
  })();
528
528
  }
529
529
  q(["input", "click"]);
@@ -540,17 +540,19 @@ function Ht({
540
540
  F(async () => {
541
541
  const c = n();
542
542
  if (!c) return;
543
+ const a = await t.getDocument(c);
544
+ if (!a) return;
543
545
  const {
544
- title: f,
545
- typeName: d
546
- } = await t.getDocument(c);
546
+ title: d,
547
+ typeName: g
548
+ } = a;
547
549
  o({
548
- title: f,
549
- typeName: d
550
+ title: d,
551
+ typeName: g
550
552
  });
551
553
  });
552
554
  const $ = (() => {
553
- var c = Nt(), f = c.firstChild;
555
+ var c = Nt(), a = c.firstChild;
554
556
  return p(c, (() => {
555
557
  var d = _(() => !!(n() && !s()));
556
558
  return () => d() && (() => {
@@ -559,12 +561,12 @@ function Ht({
559
561
  u(!0);
560
562
  }, g;
561
563
  })();
562
- })(), f), p(f, () => l("InternalLink.dialog.title")), c;
563
- })(), a = (() => {
564
+ })(), a), p(a, () => l("InternalLink.dialog.title")), c;
565
+ })(), f = (() => {
564
566
  var c = Ot();
565
567
  return p(c, (() => {
566
- var f = _(() => !!(s() && n()));
567
- return () => f() ? (() => {
568
+ var a = _(() => !!(s() && n()));
569
+ return () => a() ? (() => {
568
570
  var d = Vt(), g = d.firstChild, L = g.nextSibling;
569
571
  return p(g, () => r()?.title), L.$$click = () => {
570
572
  const v = n(), Q = r()?.typeName;
@@ -582,8 +584,8 @@ function Ht({
582
584
  })(), h = (() => {
583
585
  var c = tt();
584
586
  return p(c, (() => {
585
- var f = _(() => !!s());
586
- return () => f() ? (() => {
587
+ var a = _(() => !!s());
588
+ return () => a() ? (() => {
587
589
  var d = Rt(), g = d.firstChild;
588
590
  return p(d, (() => {
589
591
  var L = _(() => !!n());
@@ -607,15 +609,15 @@ function Ht({
607
609
  })();
608
610
  })()), c;
609
611
  })(), m = t.createModalDialog({
610
- content: a,
612
+ content: f,
611
613
  footer: h,
612
614
  header: $
613
615
  });
614
616
  return (() => {
615
617
  var c = tt();
616
618
  return p(c, (() => {
617
- var f = _(() => !!n());
618
- return () => f() ? (() => {
619
+ var a = _(() => !!n());
620
+ return () => a() ? (() => {
619
621
  var d = Ut(), g = d.firstChild, L = g.nextSibling;
620
622
  return p(g, () => r()?.title), L.$$click = () => m.show(), d;
621
623
  })() : (() => {
@@ -638,13 +640,15 @@ async function Yt({
638
640
  F(async () => {
639
641
  const h = t();
640
642
  if (!h) return;
643
+ const m = await n.getDocument(h);
644
+ if (!m) return;
641
645
  const {
642
- title: m,
643
- typeName: c
644
- } = await n.getDocument(h);
646
+ title: c,
647
+ typeName: a
648
+ } = m;
645
649
  l({
646
- title: m,
647
- typeName: c
650
+ title: c,
651
+ typeName: a
648
652
  });
649
653
  });
650
654
  const u = (() => {
@@ -652,10 +656,10 @@ async function Yt({
652
656
  return p(h, (() => {
653
657
  var c = _(() => !!(t() && !o()));
654
658
  return () => c() && (() => {
655
- var f = Gt();
656
- return f.$$click = () => {
659
+ var a = Gt();
660
+ return a.$$click = () => {
657
661
  s(!0);
658
- }, f;
662
+ }, a;
659
663
  })();
660
664
  })(), m), p(m, () => r("InternalLink.dialog.title")), h;
661
665
  })(), $ = (() => {
@@ -663,45 +667,45 @@ async function Yt({
663
667
  return p(h, (() => {
664
668
  var m = _(() => !!o());
665
669
  return () => m() ? (() => {
666
- var c = Kt(), f = c.firstChild;
670
+ var c = Kt(), a = c.firstChild;
667
671
  return p(c, (() => {
668
672
  var d = _(() => !!t());
669
673
  return () => d() && [(() => {
670
674
  var g = Qt();
671
- return g.$$click = () => a.close("remove"), p(g, () => r("InternalLink.dialog.removeLink")), g;
675
+ return g.$$click = () => f.close("remove"), p(g, () => r("InternalLink.dialog.removeLink")), g;
672
676
  })(), (() => {
673
677
  var g = Zt();
674
678
  return g.$$click = () => s(!1), p(g, () => r("InternalLink.dialog.changeLink")), g;
675
679
  })()];
676
- })(), f), f.$$click = () => a.close(), p(f, () => r("InternalLink.dialog.ok")), c;
680
+ })(), a), a.$$click = () => f.close(), p(a, () => r("InternalLink.dialog.ok")), c;
677
681
  })() : (() => {
678
682
  var c = Wt();
679
- return c.$$click = () => a.close(), p(c, () => r("InternalLink.dialog.ok")), c;
683
+ return c.$$click = () => f.close(), p(c, () => r("InternalLink.dialog.ok")), c;
680
684
  })();
681
685
  })()), h;
682
- })(), a = n.createModalDialog({
686
+ })(), f = n.createModalDialog({
683
687
  content: (() => {
684
688
  var h = Xt();
685
689
  return p(h, (() => {
686
690
  var m = _(() => !!(o() && t()));
687
691
  return () => m() ? (() => {
688
- var c = Jt(), f = c.firstChild, d = f.nextSibling;
689
- return p(f, () => i()?.title), d.$$click = () => {
692
+ var c = Jt(), a = c.firstChild, d = a.nextSibling;
693
+ return p(a, () => i()?.title), d.$$click = () => {
690
694
  const g = t(), L = i()?.typeName;
691
- !g || !L || (a.close(), n.openDocumentEdition(g, L));
695
+ !g || !L || (f.close(), n.openDocumentEdition(g, L));
692
696
  }, c;
693
697
  })() : T(ft, {
694
698
  service: n,
695
699
  language: e,
696
700
  value: t,
697
- setValue: (c) => a.close(c)
701
+ setValue: (c) => f.close(c)
698
702
  });
699
703
  })()), h;
700
704
  })(),
701
705
  header: u,
702
706
  footer: $
703
707
  });
704
- return await a.open();
708
+ return await f.open();
705
709
  }
706
710
  q(["click"]);
707
711
  const ie = {
@@ -716,7 +720,7 @@ function zt(t) {
716
720
  function te(t) {
717
721
  return {
718
722
  async getDocumentTitle(e) {
719
- return (await t.getDocument(e)).title;
723
+ return (await t.getDocument(e))?.title;
720
724
  },
721
725
  async openDialog(e, n) {
722
726
  const i = await Yt({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paroicms/internal-link-plugin",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Internal link plugin for ParoiCMS",
5
5
  "keywords": [
6
6
  "paroicms",
@@ -30,20 +30,20 @@
30
30
  "@paroicms/public-server-lib": "0"
31
31
  },
32
32
  "devDependencies": {
33
- "@paroicms/public-anywhere-lib": "0.21.0",
34
- "@paroicms/public-bo-lib": "0.22.0",
35
- "@paroicms/public-server-lib": "0.31.0",
36
- "@paroicms/quill-editor-plugin": "1.32.0",
33
+ "@paroicms/public-anywhere-lib": "0.22.0",
34
+ "@paroicms/public-bo-lib": "0.23.0",
35
+ "@paroicms/public-server-lib": "0.33.0",
36
+ "@paroicms/quill-editor-plugin": "1.32.2",
37
37
  "@solid-primitives/i18n": "~2.2.0",
38
- "@types/node": "~22.13.10",
38
+ "@types/node": "~22.14.1",
39
39
  "primeicons": "^7.0.0",
40
40
  "rimraf": "~6.0.1",
41
- "sass": "~1.85.1",
41
+ "sass": "~1.86.3",
42
42
  "solid-devtools": "~0.33.0",
43
43
  "solid-js": "1.9.5",
44
44
  "sortablejs": "^1.15.2",
45
- "typescript": "~5.8.2",
46
- "vite": "~6.2.2",
45
+ "typescript": "~5.8.3",
46
+ "vite": "~6.2.6",
47
47
  "vite-plugin-solid": "~2.11.6"
48
48
  },
49
49
  "type": "module",