@paroicms/internal-link-plugin 0.4.0 → 0.6.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.
@@ -2,7 +2,7 @@ const dt = (t, e) => t === e, O = {
2
2
  equals: dt
3
3
  };
4
4
  let nt = st;
5
- const E = 1, R = 2, it = {
5
+ const E = 1, R = 2, lt = {
6
6
  owned: null,
7
7
  cleanups: null,
8
8
  context: null,
@@ -11,17 +11,17 @@ const E = 1, R = 2, it = {
11
11
  var k = null;
12
12
  let H = null, ht = null, w = null, b = null, I = null, U = 0;
13
13
  function pt(t, e) {
14
- const n = w, i = k, l = t.length === 0, r = i, o = l ? it : {
14
+ const n = w, l = k, i = t.length === 0, r = l, o = i ? lt : {
15
15
  owned: null,
16
16
  cleanups: null,
17
17
  context: r ? r.context : null,
18
18
  owner: r
19
- }, s = l ? t : () => t(() => C(() => T(o)));
19
+ }, s = i ? t : () => t(() => C(() => T(o)));
20
20
  k = o, w = null;
21
21
  try {
22
22
  return N(s, !0);
23
23
  } finally {
24
- w = n, k = i;
24
+ w = n, k = l;
25
25
  }
26
26
  }
27
27
  function S(t, e) {
@@ -31,22 +31,22 @@ function S(t, e) {
31
31
  observers: null,
32
32
  observerSlots: null,
33
33
  comparator: e.equals || void 0
34
- }, i = (l) => (typeof l == "function" && (l = l(n.value)), rt(n, l));
35
- return [lt.bind(n), i];
34
+ }, l = (i) => (typeof i == "function" && (i = i(n.value)), rt(n, i));
35
+ return [it.bind(n), l];
36
36
  }
37
37
  function P(t, e, n) {
38
- const i = q(t, e, !1, E);
39
- x(i);
38
+ const l = q(t, e, !1, E);
39
+ x(l);
40
40
  }
41
41
  function G(t, e, n) {
42
42
  nt = mt;
43
- const i = q(t, e, !1, E);
44
- i.user = !0, I ? I.push(i) : x(i);
43
+ const l = q(t, e, !1, E);
44
+ l.user = !0, I ? I.push(l) : x(l);
45
45
  }
46
46
  function _(t, e, n) {
47
47
  n = n ? Object.assign({}, O, n) : O;
48
- const i = q(t, e, !0, 0);
49
- return i.observers = null, i.observerSlots = null, i.comparator = n.equals || void 0, x(i), lt.bind(i);
48
+ const l = q(t, e, !0, 0);
49
+ return l.observers = null, l.observerSlots = null, l.comparator = n.equals || void 0, x(l), it.bind(l);
50
50
  }
51
51
  function C(t) {
52
52
  if (w === null) return t();
@@ -58,7 +58,7 @@ function C(t) {
58
58
  w = e;
59
59
  }
60
60
  }
61
- function lt() {
61
+ function it() {
62
62
  if (this.sources && this.state)
63
63
  if (this.state === E) x(this);
64
64
  else {
@@ -72,10 +72,10 @@ function lt() {
72
72
  return this.value;
73
73
  }
74
74
  function rt(t, e, n) {
75
- let i = t.value;
76
- return (!t.comparator || !t.comparator(i, e)) && (t.value = e, t.observers && t.observers.length && N(() => {
77
- for (let l = 0; l < t.observers.length; l += 1) {
78
- const r = t.observers[l], o = H && H.running;
75
+ let l = t.value;
76
+ return (!t.comparator || !t.comparator(l, e)) && (t.value = e, t.observers && t.observers.length && N(() => {
77
+ for (let i = 0; i < t.observers.length; i += 1) {
78
+ const r = t.observers[i], o = H && H.running;
79
79
  o && H.disposed.has(r), (o ? !r.tState : !r.state) && (r.pure ? b.push(r) : I.push(r), r.observers && ot(r)), o || (r.state = E);
80
80
  }
81
81
  if (b.length > 1e6)
@@ -93,22 +93,22 @@ function x(t) {
93
93
  );
94
94
  }
95
95
  function gt(t, e, n) {
96
- let i;
97
- const l = k, r = w;
96
+ let l;
97
+ const i = k, r = w;
98
98
  w = k = t;
99
99
  try {
100
- i = t.fn(e);
100
+ l = t.fn(e);
101
101
  } catch (o) {
102
102
  return t.pure && (t.state = E, t.owned && t.owned.forEach(T), t.owned = null), t.updatedAt = n + 1, ct(o);
103
103
  } finally {
104
- w = r, k = l;
104
+ w = r, k = i;
105
105
  }
106
- (!t.updatedAt || t.updatedAt <= n) && (t.updatedAt != null && "observers" in t ? rt(t, i) : t.value = i, t.updatedAt = n);
106
+ (!t.updatedAt || t.updatedAt <= n) && (t.updatedAt != null && "observers" in t ? rt(t, l) : t.value = l, t.updatedAt = n);
107
107
  }
108
- function q(t, e, n, i = E, l) {
108
+ function q(t, e, n, l = E, i) {
109
109
  const r = {
110
110
  fn: t,
111
- state: i,
111
+ state: l,
112
112
  updatedAt: null,
113
113
  owned: null,
114
114
  sources: null,
@@ -119,7 +119,7 @@ function q(t, e, n, i = E, l) {
119
119
  context: k ? k.context : null,
120
120
  pure: n
121
121
  };
122
- return k === null || k !== it && (k.owned ? k.owned.push(r) : k.owned = [r]), r;
122
+ return k === null || k !== lt && (k.owned ? k.owned.push(r) : k.owned = [r]), r;
123
123
  }
124
124
  function V(t) {
125
125
  if (t.state === 0) return;
@@ -132,8 +132,8 @@ function V(t) {
132
132
  if (t = e[n], t.state === E)
133
133
  x(t);
134
134
  else if (t.state === R) {
135
- const i = b;
136
- b = null, N(() => j(t, e[0]), !1), b = i;
135
+ const l = b;
136
+ b = null, N(() => j(t, e[0]), !1), b = l;
137
137
  }
138
138
  }
139
139
  function N(t, e) {
@@ -141,10 +141,10 @@ function N(t, e) {
141
141
  let n = !1;
142
142
  e || (b = []), I ? n = !0 : I = [], U++;
143
143
  try {
144
- const i = t();
145
- return $t(n), i;
146
- } catch (i) {
147
- n || (I = null), b = null, ct(i);
144
+ const l = t();
145
+ return $t(n), l;
146
+ } catch (l) {
147
+ n || (I = null), b = null, ct(l);
148
148
  }
149
149
  }
150
150
  function $t(t) {
@@ -158,18 +158,18 @@ function st(t) {
158
158
  function mt(t) {
159
159
  let e, n = 0;
160
160
  for (e = 0; e < t.length; e++) {
161
- const i = t[e];
162
- i.user ? t[n++] = i : V(i);
161
+ const l = t[e];
162
+ l.user ? t[n++] = l : V(l);
163
163
  }
164
164
  for (e = 0; e < n; e++) V(t[e]);
165
165
  }
166
166
  function j(t, e) {
167
167
  t.state = 0;
168
168
  for (let n = 0; n < t.sources.length; n += 1) {
169
- const i = t.sources[n];
170
- if (i.sources) {
171
- const l = i.state;
172
- l === E ? i !== e && (!i.updatedAt || i.updatedAt < U) && V(i) : l === R && j(i, e);
169
+ const l = t.sources[n];
170
+ if (l.sources) {
171
+ const i = l.state;
172
+ i === E ? l !== e && (!l.updatedAt || l.updatedAt < U) && V(l) : i === R && j(l, e);
173
173
  }
174
174
  }
175
175
  }
@@ -183,10 +183,10 @@ function T(t) {
183
183
  let e;
184
184
  if (t.sources)
185
185
  for (; t.sources.length; ) {
186
- const n = t.sources.pop(), i = t.sourceSlots.pop(), l = n.observers;
187
- if (l && l.length) {
188
- const r = l.pop(), o = n.observerSlots.pop();
189
- i < l.length && (r.sourceSlots[o] = i, l[i] = r, n.observerSlots[i] = o);
186
+ const n = t.sources.pop(), l = t.sourceSlots.pop(), i = n.observers;
187
+ if (i && i.length) {
188
+ const r = i.pop(), o = n.observerSlots.pop();
189
+ l < i.length && (r.sourceSlots[o] = l, i[l] = r, n.observerSlots[l] = o);
190
190
  }
191
191
  }
192
192
  if (t.tOwned) {
@@ -217,21 +217,21 @@ function A(t, e) {
217
217
  const wt = (t) => `Stale read from <${t}>.`;
218
218
  function Z(t) {
219
219
  const e = t.keyed, n = _(() => t.when, void 0, {
220
- equals: (i, l) => e ? i === l : !i == !l
220
+ equals: (l, i) => e ? l === i : !l == !i
221
221
  });
222
222
  return _(
223
223
  () => {
224
- const i = n();
225
- if (i) {
226
- const l = t.children;
227
- return typeof l == "function" && l.length > 0 ? C(
228
- () => l(
229
- e ? i : () => {
224
+ const l = n();
225
+ if (l) {
226
+ const i = t.children;
227
+ return typeof i == "function" && i.length > 0 ? C(
228
+ () => i(
229
+ e ? l : () => {
230
230
  if (!C(n)) throw wt("Show");
231
231
  return t.when;
232
232
  }
233
233
  )
234
- ) : l;
234
+ ) : i;
235
235
  }
236
236
  return t.fallback;
237
237
  },
@@ -240,38 +240,38 @@ function Z(t) {
240
240
  );
241
241
  }
242
242
  function bt(t, e, n) {
243
- let i = n.length, l = e.length, r = i, o = 0, s = 0, a = e[l - 1].nextSibling, $ = null;
244
- for (; o < l || s < r; ) {
243
+ let l = n.length, i = e.length, r = l, o = 0, s = 0, u = e[i - 1].nextSibling, $ = null;
244
+ for (; o < i || s < r; ) {
245
245
  if (e[o] === n[s]) {
246
246
  o++, s++;
247
247
  continue;
248
248
  }
249
- for (; e[l - 1] === n[r - 1]; )
250
- l--, r--;
251
- if (l === o) {
252
- const u = r < i ? s ? n[s - 1].nextSibling : n[r - s] : a;
253
- for (; s < r; ) t.insertBefore(n[s++], u);
249
+ for (; e[i - 1] === n[r - 1]; )
250
+ i--, r--;
251
+ if (i === o) {
252
+ const a = r < l ? s ? n[s - 1].nextSibling : n[r - s] : u;
253
+ for (; s < r; ) t.insertBefore(n[s++], a);
254
254
  } else if (r === s)
255
- for (; o < l; )
255
+ for (; o < i; )
256
256
  (!$ || !$.has(e[o])) && e[o].remove(), o++;
257
- else if (e[o] === n[r - 1] && n[s] === e[l - 1]) {
258
- const u = e[--l].nextSibling;
259
- t.insertBefore(n[s++], e[o++].nextSibling), t.insertBefore(n[--r], u), e[l] = n[r];
257
+ else if (e[o] === n[r - 1] && n[s] === e[i - 1]) {
258
+ const a = e[--i].nextSibling;
259
+ t.insertBefore(n[s++], e[o++].nextSibling), t.insertBefore(n[--r], a), e[i] = 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 u = $.get(e[o]);
267
- if (u != null)
268
- if (s < u && u < r) {
266
+ const a = $.get(e[o]);
267
+ if (a != null)
268
+ if (s < a && a < r) {
269
269
  let h = o, m = 1, c;
270
- for (; ++h < l && h < r && !((c = $.get(e[h])) == null || c !== u + m); )
270
+ for (; ++h < i && h < r && !((c = $.get(e[h])) == null || c !== a + m); )
271
271
  m++;
272
- if (m > u - s) {
272
+ if (m > a - s) {
273
273
  const f = e[o];
274
- for (; s < u; ) t.insertBefore(n[s++], f);
274
+ for (; s < a; ) t.insertBefore(n[s++], f);
275
275
  } else t.replaceChild(n[s++], e[o++]);
276
276
  } else o++;
277
277
  else e[o++].remove();
@@ -280,37 +280,37 @@ function bt(t, e, n) {
280
280
  }
281
281
  const W = "_$DX_DELEGATE";
282
282
  function y(t, e, n) {
283
- let i;
284
- const l = () => {
283
+ let l;
284
+ const i = () => {
285
285
  const o = document.createElement("template");
286
286
  return o.innerHTML = t, o.content.firstChild;
287
- }, r = () => (i || (i = l())).cloneNode(!0);
287
+ }, r = () => (l || (l = i())).cloneNode(!0);
288
288
  return r.cloneNode = r, r;
289
289
  }
290
290
  function K(t, e = window.document) {
291
291
  const n = e[W] || (e[W] = /* @__PURE__ */ new Set());
292
- for (let i = 0, l = t.length; i < l; i++) {
293
- const r = t[i];
292
+ for (let l = 0, i = t.length; l < i; l++) {
293
+ const r = t[l];
294
294
  n.has(r) || (n.add(r), e.addEventListener(r, _t));
295
295
  }
296
296
  }
297
297
  function kt(t, e) {
298
298
  e == null ? t.removeAttribute("class") : t.className = e;
299
299
  }
300
- function p(t, e, n, i) {
301
- if (n !== void 0 && !i && (i = []), typeof e != "function") return M(t, e, i, n);
302
- P((l) => M(t, e(), l, n), i);
300
+ function p(t, e, n, l) {
301
+ if (n !== void 0 && !l && (l = []), typeof e != "function") return M(t, e, l, n);
302
+ P((i) => M(t, e(), i, n), l);
303
303
  }
304
304
  function _t(t) {
305
305
  let e = t.target;
306
- const n = `$$${t.type}`, i = t.target, l = t.currentTarget, r = (a) => Object.defineProperty(t, "target", {
306
+ const n = `$$${t.type}`, l = t.target, i = t.currentTarget, r = (u) => Object.defineProperty(t, "target", {
307
307
  configurable: !0,
308
- value: a
308
+ value: u
309
309
  }), o = () => {
310
- const a = e[n];
311
- if (a && !e.disabled) {
310
+ const u = e[n];
311
+ if (u && !e.disabled) {
312
312
  const $ = e[`${n}Data`];
313
- if ($ !== void 0 ? a.call(e, $, t) : a.call(e, t), t.cancelBubble) return;
313
+ if ($ !== void 0 ? u.call(e, $, t) : u.call(e, t), t.cancelBubble) return;
314
314
  }
315
315
  return e.host && typeof e.host != "string" && !e.host._$host && e.contains(t.target) && r(e.host), !0;
316
316
  }, s = () => {
@@ -322,51 +322,51 @@ function _t(t) {
322
322
  return e || document;
323
323
  }
324
324
  }), t.composedPath) {
325
- const a = t.composedPath();
326
- r(a[0]);
327
- for (let $ = 0; $ < a.length - 2 && (e = a[$], !!o()); $++) {
325
+ const u = t.composedPath();
326
+ r(u[0]);
327
+ for (let $ = 0; $ < u.length - 2 && (e = u[$], !!o()); $++) {
328
328
  if (e._$host) {
329
329
  e = e._$host, s();
330
330
  break;
331
331
  }
332
- if (e.parentNode === l)
332
+ if (e.parentNode === i)
333
333
  break;
334
334
  }
335
335
  } else s();
336
- r(i);
336
+ r(l);
337
337
  }
338
- function M(t, e, n, i, l) {
338
+ function M(t, e, n, l, i) {
339
339
  for (; typeof n == "function"; ) n = n();
340
340
  if (e === n) return n;
341
- const r = typeof e, o = i !== void 0;
341
+ const r = typeof e, o = l !== void 0;
342
342
  if (t = o && n[0] && n[0].parentNode || t, r === "string" || r === "number") {
343
343
  if (r === "number" && (e = e.toString(), e === n))
344
344
  return n;
345
345
  if (o) {
346
346
  let s = n[0];
347
- s && s.nodeType === 3 ? s.data !== e && (s.data = e) : s = document.createTextNode(e), n = D(t, n, i, s);
347
+ s && s.nodeType === 3 ? s.data !== e && (s.data = e) : s = document.createTextNode(e), n = D(t, n, l, s);
348
348
  } else
349
349
  n !== "" && typeof n == "string" ? n = t.firstChild.data = e : n = t.textContent = e;
350
350
  } else if (e == null || r === "boolean")
351
- n = D(t, n, i);
351
+ n = D(t, n, l);
352
352
  else {
353
353
  if (r === "function")
354
354
  return P(() => {
355
355
  let s = e();
356
356
  for (; typeof s == "function"; ) s = s();
357
- n = M(t, s, n, i);
357
+ n = M(t, s, n, l);
358
358
  }), () => n;
359
359
  if (Array.isArray(e)) {
360
- const s = [], a = n && Array.isArray(n);
361
- if (F(s, e, n, l))
362
- return P(() => n = M(t, s, n, i, !0)), () => n;
360
+ const s = [], u = n && Array.isArray(n);
361
+ if (F(s, e, n, i))
362
+ return P(() => n = M(t, s, n, l, !0)), () => n;
363
363
  if (s.length === 0) {
364
- if (n = D(t, n, i), o) return n;
365
- } else a ? n.length === 0 ? X(t, s, i) : bt(t, n, s) : (n && D(t), X(t, s));
364
+ if (n = D(t, n, l), o) return n;
365
+ } else u ? n.length === 0 ? X(t, s, l) : bt(t, n, s) : (n && D(t), X(t, s));
366
366
  n = s;
367
367
  } else if (e.nodeType) {
368
368
  if (Array.isArray(n)) {
369
- if (o) return n = D(t, n, i, e);
369
+ if (o) return n = D(t, n, l, e);
370
370
  D(t, n, null, e);
371
371
  } else n == null || n === "" || !t.firstChild ? t.appendChild(e) : t.replaceChild(e, t.firstChild);
372
372
  n = e;
@@ -374,116 +374,86 @@ function M(t, e, n, i, l) {
374
374
  }
375
375
  return n;
376
376
  }
377
- function F(t, e, n, i) {
378
- let l = !1;
377
+ function F(t, e, n, l) {
378
+ let i = !1;
379
379
  for (let r = 0, o = e.length; r < o; r++) {
380
- let s = e[r], a = n && n[t.length], $;
380
+ let s = e[r], u = n && n[t.length], $;
381
381
  if (!(s == null || s === !0 || s === !1)) if (($ = typeof s) == "object" && s.nodeType)
382
382
  t.push(s);
383
383
  else if (Array.isArray(s))
384
- l = F(t, s, a) || l;
384
+ i = F(t, s, u) || i;
385
385
  else if ($ === "function")
386
- if (i) {
386
+ if (l) {
387
387
  for (; typeof s == "function"; ) s = s();
388
- l = F(
388
+ i = F(
389
389
  t,
390
390
  Array.isArray(s) ? s : [s],
391
- Array.isArray(a) ? a : [a]
392
- ) || l;
391
+ Array.isArray(u) ? u : [u]
392
+ ) || i;
393
393
  } else
394
- t.push(s), l = !0;
394
+ t.push(s), i = !0;
395
395
  else {
396
- const u = String(s);
397
- a && a.nodeType === 3 && a.data === u ? t.push(a) : t.push(document.createTextNode(u));
396
+ const a = String(s);
397
+ u && u.nodeType === 3 && u.data === a ? t.push(u) : t.push(document.createTextNode(a));
398
398
  }
399
399
  }
400
- return l;
400
+ return i;
401
401
  }
402
402
  function X(t, e, n = null) {
403
- for (let i = 0, l = e.length; i < l; i++) t.insertBefore(e[i], n);
403
+ for (let l = 0, i = e.length; l < i; l++) t.insertBefore(e[l], n);
404
404
  }
405
- function D(t, e, n, i) {
405
+ function D(t, e, n, l) {
406
406
  if (n === void 0) return t.textContent = "";
407
- const l = i || document.createTextNode("");
407
+ const i = l || document.createTextNode("");
408
408
  if (e.length) {
409
409
  let r = !1;
410
410
  for (let o = e.length - 1; o >= 0; o--) {
411
411
  const s = e[o];
412
- if (l !== s) {
413
- const a = s.parentNode === t;
414
- !r && !o ? a ? t.replaceChild(l, s) : t.insertBefore(l, n) : a && s.remove();
412
+ if (i !== s) {
413
+ const u = s.parentNode === t;
414
+ !r && !o ? u ? t.replaceChild(i, s) : t.insertBefore(i, n) : u && s.remove();
415
415
  } else r = !0;
416
416
  }
417
- } else t.insertBefore(l, n);
418
- return [l];
419
- }
420
- var at = (t) => t != null && (t = Object.getPrototypeOf(t), t === Array.prototype || t === Object.prototype);
421
- function ut(t, e, n) {
422
- for (const [i, l] of Object.entries(e)) {
423
- const r = `${n}.${i}`;
424
- t[r] = l, at(l) && ut(t, l, r);
417
+ } else t.insertBefore(i, n);
418
+ return [i];
419
+ }
420
+ var ut = (t) => t != null && (t = Object.getPrototypeOf(t), t === Array.prototype || t === Object.prototype);
421
+ function at(t, e, n) {
422
+ for (const [l, i] of Object.entries(e)) {
423
+ const r = `${n}.${l}`;
424
+ t[r] = i, ut(i) && at(t, i, r);
425
425
  }
426
426
  }
427
427
  function vt(t) {
428
428
  const e = { ...t };
429
- for (const [n, i] of Object.entries(t))
430
- at(i) && ut(e, i, n);
429
+ for (const [n, l] of Object.entries(t))
430
+ ut(l) && at(e, l, n);
431
431
  return e;
432
432
  }
433
433
  var Lt = (t) => t;
434
434
  function It(t, e = Lt) {
435
- return (n, ...i) => {
435
+ return (n, ...l) => {
436
436
  n[0] === "." && (n = n.slice(1));
437
- const l = t()?.[n];
438
- switch (typeof l) {
437
+ const i = t()?.[n];
438
+ switch (typeof i) {
439
439
  case "function":
440
- return l(...i);
440
+ return i(...l);
441
441
  case "string":
442
- return e(l, i[0]);
442
+ return e(i, l[0]);
443
443
  default:
444
- return l;
444
+ return i;
445
445
  }
446
446
  };
447
447
  }
448
- const St = {
449
- insertLink: "Insert link",
450
- change: "Change",
451
- editor: {
452
- noResult: "No results found",
453
- draft: "Draft",
454
- published: "Published",
455
- sheduled: "Sheduled"
456
- },
457
- dialog: {
458
- title: "Insert an internal link",
459
- removeLink: "Remove link",
460
- changeLink: "Find another link",
461
- ok: "OK"
462
- }
463
- }, Et = {
448
+ const St = { insertLink: "Insert link", change: "Change", editor: { noResult: "No results found", draft: "Draft", published: "Published", sheduled: "Sheduled" }, dialog: { title: "Insert an internal link", removeLink: "Remove link", changeLink: "Find another link", ok: "OK" } }, Et = {
464
449
  InternalLink: St
465
- }, Dt = {
466
- insertLink: "Insérer un lien",
467
- change: "Modifier",
468
- editor: {
469
- noResult: "Aucun résultat trouvé",
470
- draft: "Brouillon",
471
- published: "Publié",
472
- sheduled: "Programmé"
473
- },
474
- dialog: {
475
- title: "Insérer un lien interne",
476
- removeLink: "Supprimer le lien",
477
- changeLink: "Trouver un autre lien",
478
- ok: "OK"
479
- }
480
- }, Pt = {
450
+ }, Dt = { insertLink: "Insérer un lien", change: "Modifier", editor: { noResult: "Aucun résultat trouvé", draft: "Brouillon", published: "Publié", sheduled: "Programmé" }, dialog: { title: "Insérer un lien interne", removeLink: "Supprimer le lien", changeLink: "Trouver un autre lien", ok: "OK" } }, Pt = {
481
451
  InternalLink: Dt
482
452
  }, J = { en: Et, fr: Pt };
483
453
  function Q(t) {
484
454
  const e = _(() => {
485
- const i = t(), l = i in J ? i : "en";
486
- return vt(J[l]);
455
+ const l = t(), i = l in J ? l : "en";
456
+ return vt(J[i]);
487
457
  });
488
458
  return { t: It(e) };
489
459
  }
@@ -508,26 +478,26 @@ function ft(t) {
508
478
  const {
509
479
  value: e,
510
480
  setValue: n,
511
- service: i
512
- } = t, [l, r] = S(""), [o, s] = S([]), {
513
- t: a
481
+ service: l
482
+ } = t, [i, r] = S(""), [o, s] = S([]), {
483
+ t: u
514
484
  } = Q(t.language);
515
485
  G(async () => {
516
- const u = e();
517
- if (!u) return;
518
- const h = await i.getDocument(u);
486
+ const a = e();
487
+ if (!a) return;
488
+ const h = await l.getDocument(a);
519
489
  r(h.title ?? ""), await $();
520
490
  });
521
- const $ = async (u) => {
522
- if (u?.preventDefault(), l().length < 3) return;
523
- const h = await i.searchDocuments({
524
- searchString: l()
491
+ const $ = async (a) => {
492
+ if (a?.preventDefault(), i().length < 3) return;
493
+ const h = await l.searchDocuments({
494
+ searchString: i()
525
495
  });
526
496
  s(h);
527
497
  };
528
498
  return (() => {
529
- var u = At(), h = u.firstChild, m = h.firstChild;
530
- return h.addEventListener("submit", $), m.$$input = (c) => r(c.currentTarget.value), p(u, A(Z, {
499
+ var a = At(), h = a.firstChild, m = h.firstChild;
500
+ return h.addEventListener("submit", $), m.$$input = (c) => r(c.currentTarget.value), p(a, A(Z, {
531
501
  when: o,
532
502
  get children() {
533
503
  var c = Ct();
@@ -541,22 +511,22 @@ function ft(t) {
541
511
  var v = _(() => !!f.ready);
542
512
  return () => v() ? (() => {
543
513
  var B = _(() => z(f.publishDate).getTime() < (/* @__PURE__ */ new Date()).getTime());
544
- return () => B() ? a("InternalLink.editor.published") : a("InternalLink.editor.sheduled");
545
- })() : a("InternalLink.editor.draft");
514
+ return () => B() ? u("InternalLink.editor.published") : u("InternalLink.editor.sheduled");
515
+ })() : u("InternalLink.editor.draft");
546
516
  })()), P(() => kt(L, `ILResultItem-status
547
517
  ${f.ready ? z(f.publishDate).getTime() < (/* @__PURE__ */ new Date()).getTime() ? "published" : "sheduled" : "draft"}`)), d;
548
518
  })()
549
519
  ))), c;
550
520
  }
551
- }), null), p(u, A(Z, {
521
+ }), null), p(a, A(Z, {
552
522
  get when() {
553
523
  return !o() || o().length === 0;
554
524
  },
555
525
  get children() {
556
526
  var c = Tt(), f = c.firstChild;
557
- return p(f, () => a("InternalLink.editor.noResult")), c;
527
+ return p(f, () => u("InternalLink.editor.noResult")), c;
558
528
  }
559
- }), null), P(() => m.value = l()), u;
529
+ }), null), P(() => m.value = i()), a;
560
530
  })();
561
531
  }
562
532
  K(["input", "click"]);
@@ -565,11 +535,11 @@ function Ht({
565
535
  service: t,
566
536
  setValue: e,
567
537
  value: n,
568
- language: i
538
+ language: l
569
539
  }) {
570
540
  const {
571
- t: l
572
- } = Q(i), [r, o] = S(), [s, a] = S(!!n());
541
+ t: i
542
+ } = Q(l), [r, o] = S(), [s, u] = S(!!n());
573
543
  G(async () => {
574
544
  const c = n();
575
545
  if (!c) return;
@@ -589,11 +559,11 @@ function Ht({
589
559
  return () => d() && (() => {
590
560
  var g = Bt();
591
561
  return g.$$click = () => {
592
- a(!0);
562
+ u(!0);
593
563
  }, g;
594
564
  })();
595
- })(), f), p(f, () => l("InternalLink.dialog.title")), c;
596
- })(), u = (() => {
565
+ })(), f), p(f, () => i("InternalLink.dialog.title")), c;
566
+ })(), a = (() => {
597
567
  var c = Ot();
598
568
  return p(c, (() => {
599
569
  var f = _(() => !!(s() && n()));
@@ -605,10 +575,10 @@ function Ht({
605
575
  }, d;
606
576
  })() : A(ft, {
607
577
  service: t,
608
- language: i,
578
+ language: l,
609
579
  value: n,
610
580
  setValue: (d) => {
611
- e(d), a(!0), m.hide();
581
+ e(d), u(!0), m.hide();
612
582
  }
613
583
  });
614
584
  })()), c;
@@ -624,23 +594,23 @@ function Ht({
624
594
  var v = jt();
625
595
  return v.$$click = () => {
626
596
  e(void 0), m.hide();
627
- }, p(v, () => l("InternalLink.dialog.removeLink")), v;
597
+ }, p(v, () => i("InternalLink.dialog.removeLink")), v;
628
598
  })(), (() => {
629
599
  var v = et();
630
- return v.$$click = () => a(!1), p(v, () => l("InternalLink.dialog.changeLink")), v;
600
+ return v.$$click = () => u(!1), p(v, () => i("InternalLink.dialog.changeLink")), v;
631
601
  })()];
632
602
  })(), g), g.$$click = () => {
633
603
  m.hide();
634
- }, p(g, () => l("InternalLink.dialog.ok")), d;
604
+ }, p(g, () => i("InternalLink.dialog.ok")), d;
635
605
  })() : (() => {
636
606
  var d = Mt();
637
607
  return d.$$click = () => {
638
608
  m.hide();
639
- }, p(d, () => l("InternalLink.dialog.ok")), d;
609
+ }, p(d, () => i("InternalLink.dialog.ok")), d;
640
610
  })();
641
611
  })()), c;
642
612
  })(), m = t.createModalDialog({
643
- content: u,
613
+ content: a,
644
614
  footer: h,
645
615
  header: $
646
616
  });
@@ -653,7 +623,7 @@ function Ht({
653
623
  return p(g, () => r()?.title), L.$$click = () => m.show(), d;
654
624
  })() : (() => {
655
625
  var d = et();
656
- return d.$$click = () => m.show(), p(d, () => l("InternalLink.insertLink")), d;
626
+ return d.$$click = () => m.show(), p(d, () => i("InternalLink.insertLink")), d;
657
627
  })();
658
628
  })()), c;
659
629
  })();
@@ -665,7 +635,7 @@ async function Yt({
665
635
  getLanguage: e,
666
636
  service: n
667
637
  }) {
668
- const [i, l] = S(), {
638
+ const [l, i] = S(), {
669
639
  t: r
670
640
  } = Q(e), [o, s] = S(!!t());
671
641
  G(async () => {
@@ -675,12 +645,12 @@ async function Yt({
675
645
  title: m,
676
646
  typeName: c
677
647
  } = await n.getDocument(h);
678
- l({
648
+ i({
679
649
  title: m,
680
650
  typeName: c
681
651
  });
682
652
  });
683
- const a = (() => {
653
+ const u = (() => {
684
654
  var h = Ft(), m = h.firstChild;
685
655
  return p(h, (() => {
686
656
  var c = _(() => !!(t() && !o()));
@@ -701,43 +671,43 @@ async function Yt({
701
671
  var d = _(() => !!t());
702
672
  return () => d() && [(() => {
703
673
  var g = Qt();
704
- return g.$$click = () => u.close("remove"), p(g, () => r("InternalLink.dialog.removeLink")), g;
674
+ return g.$$click = () => a.close("remove"), p(g, () => r("InternalLink.dialog.removeLink")), g;
705
675
  })(), (() => {
706
676
  var g = Zt();
707
677
  return g.$$click = () => s(!1), p(g, () => r("InternalLink.dialog.changeLink")), g;
708
678
  })()];
709
- })(), f), f.$$click = () => u.close(), p(f, () => r("InternalLink.dialog.ok")), c;
679
+ })(), f), f.$$click = () => a.close(), p(f, () => r("InternalLink.dialog.ok")), c;
710
680
  })() : (() => {
711
681
  var c = Wt();
712
- return c.$$click = () => u.close(), p(c, () => r("InternalLink.dialog.ok")), c;
682
+ return c.$$click = () => a.close(), p(c, () => r("InternalLink.dialog.ok")), c;
713
683
  })();
714
684
  })()), h;
715
- })(), u = n.createModalDialog({
685
+ })(), a = n.createModalDialog({
716
686
  content: (() => {
717
687
  var h = Xt();
718
688
  return p(h, (() => {
719
689
  var m = _(() => !!(o() && t()));
720
690
  return () => m() ? (() => {
721
691
  var c = Jt(), f = c.firstChild, d = f.nextSibling;
722
- return p(f, () => i()?.title), d.$$click = () => {
723
- const g = t(), L = i()?.typeName;
724
- !g || !L || (u.close(), n.openDocumentEdition(g, L));
692
+ return p(f, () => l()?.title), d.$$click = () => {
693
+ const g = t(), L = l()?.typeName;
694
+ !g || !L || (a.close(), n.openDocumentEdition(g, L));
725
695
  }, c;
726
696
  })() : A(ft, {
727
697
  service: n,
728
698
  language: e,
729
699
  value: t,
730
- setValue: (c) => u.close(c)
700
+ setValue: (c) => a.close(c)
731
701
  });
732
702
  })()), h;
733
703
  })(),
734
- header: a,
704
+ header: u,
735
705
  footer: $
736
706
  });
737
- return await u.open();
707
+ return await a.open();
738
708
  }
739
709
  K(["click"]);
740
- const ie = {
710
+ const le = {
741
711
  create: ne,
742
712
  init: ee
743
713
  };
@@ -752,19 +722,19 @@ function te(t) {
752
722
  return (await t.getDocument(e)).title;
753
723
  },
754
724
  async openDialog(e, n) {
755
- const i = await Yt({
725
+ const l = await Yt({
756
726
  value: () => e,
757
727
  getLanguage: n.getLanguage,
758
728
  service: t
759
729
  });
760
730
  if (e) {
761
- if (!i) return;
762
- if (i === "remove") return {
731
+ if (!l) return;
732
+ if (l === "remove") return {
763
733
  documentId: void 0
764
734
  };
765
735
  }
766
736
  return {
767
- documentId: i
737
+ documentId: l
768
738
  };
769
739
  }
770
740
  };
@@ -773,25 +743,25 @@ function ee({
773
743
  pluginBaseUrl: t,
774
744
  addAfterInitListener: e
775
745
  }) {
776
- const n = `${t}/style.css`, i = document.createElement("link");
777
- i.rel = "stylesheet", i.href = n, document.head.appendChild(i), e(zt);
746
+ const n = `${t}/style.css`, l = document.createElement("link");
747
+ l.rel = "stylesheet", l.href = n, document.head.appendChild(l), e(zt);
778
748
  }
779
749
  function ne(t) {
780
750
  if (t.fieldType.dataType !== "string")
781
751
  throw new Error(`data type '${t.fieldType.dataType}' is incompatible, should be 'string'`);
782
752
  return pt((e) => {
783
- const [n, i] = S(t.initialValue ?? ""), [l, r] = S(t.language);
753
+ const [n, l] = S(t.initialValue ?? ""), [i, r] = S(t.language);
784
754
  return {
785
755
  element: A(Ht, {
786
- language: l,
756
+ language: i,
787
757
  value: n,
788
758
  setValue: (o) => {
789
- i(o ?? ""), t.setModifiedValue(o);
759
+ l(o ?? ""), t.setModifiedValue(o);
790
760
  },
791
761
  service: t
792
762
  }),
793
763
  setLanguage: r,
794
- setValue: i,
764
+ setValue: l,
795
765
  getValue() {
796
766
  return n();
797
767
  },
@@ -800,5 +770,5 @@ function ne(t) {
800
770
  });
801
771
  }
802
772
  export {
803
- ie as default
773
+ le as default
804
774
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paroicms/internal-link-plugin",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Internal link plugin for ParoiCMS",
5
5
  "keywords": [
6
6
  "paroicms",
@@ -30,21 +30,21 @@
30
30
  "@paroicms/public-server-lib": "0"
31
31
  },
32
32
  "devDependencies": {
33
- "@paroicms/public-anywhere-lib": "0.11.0",
34
- "@paroicms/public-bo-lib": "0.17.0",
35
- "@paroicms/public-server-lib": "0.19.0",
36
- "@paroicms/quill-editor-plugin": "^1.20.0",
33
+ "@paroicms/public-anywhere-lib": "0.14.0",
34
+ "@paroicms/public-bo-lib": "0.19.0",
35
+ "@paroicms/public-server-lib": "0.22.0",
36
+ "@paroicms/quill-editor-plugin": "^1.23.0",
37
37
  "@solid-primitives/i18n": "~2.1.1",
38
- "@types/node": "~20.14.8",
38
+ "@types/node": "~22.10.7",
39
39
  "primeicons": "^7.0.0",
40
40
  "rimraf": "~6.0.1",
41
- "sass": "~1.82.0",
42
- "solid-devtools": "~0.30.1",
43
- "solid-js": "1.9.3",
41
+ "sass": "~1.83.4",
42
+ "solid-devtools": "~0.33.0",
43
+ "solid-js": "1.9.4",
44
44
  "sortablejs": "^1.15.2",
45
- "typescript": "~5.7.2",
46
- "vite": "~5.4.11",
47
- "vite-plugin-solid": "~2.10.2"
45
+ "typescript": "~5.7.3",
46
+ "vite": "~6.0.7",
47
+ "vite-plugin-solid": "~2.11.0"
48
48
  },
49
49
  "main": "backend/dist/plugin.js",
50
50
  "files": [
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "3.1",
2
+ "version": "4.0",
3
3
  "languages": ["en", "fr"],
4
4
  "fieldTypes": [
5
5
  {
6
6
  "name": "featuredDocument",
7
- "storedOn": "leaf",
7
+ "storedOn": "node",
8
8
  "storedAs": "varchar",
9
9
  "dataType": "string",
10
10
  "plugin": "@paroicms/internal-link-plugin"