@paroicms/internal-link-plugin 0.3.0 → 0.5.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,23 +240,23 @@ 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, a = 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;
249
+ for (; e[i - 1] === n[r - 1]; )
250
+ i--, r--;
251
+ if (i === o) {
252
+ const u = r < l ? s ? n[s - 1].nextSibling : n[r - s] : a;
253
253
  for (; s < r; ) t.insertBefore(n[s++], u);
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 u = e[--i].nextSibling;
259
+ t.insertBefore(n[s++], e[o++].nextSibling), t.insertBefore(n[--r], u), e[i] = n[r];
260
260
  } else {
261
261
  if (!$) {
262
262
  $ = /* @__PURE__ */ new Map();
@@ -267,7 +267,7 @@ function bt(t, e, n) {
267
267
  if (u != null)
268
268
  if (s < u && u < 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 !== u + m); )
271
271
  m++;
272
272
  if (m > u - s) {
273
273
  const f = e[o];
@@ -280,30 +280,30 @@ 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 = (a) => Object.defineProperty(t, "target", {
307
307
  configurable: !0,
308
308
  value: a
309
309
  }), o = () => {
@@ -329,44 +329,44 @@ function _t(t) {
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
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;
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 a ? 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,74 +374,74 @@ 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
380
  let s = e[r], a = 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, a) || 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
391
  Array.isArray(a) ? a : [a]
392
- ) || l;
392
+ ) || i;
393
393
  } else
394
- t.push(s), l = !0;
394
+ t.push(s), i = !0;
395
395
  else {
396
396
  const u = String(s);
397
397
  a && a.nodeType === 3 && a.data === u ? t.push(a) : t.push(document.createTextNode(u));
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) {
412
+ if (i !== s) {
413
413
  const a = s.parentNode === t;
414
- !r && !o ? a ? t.replaceChild(l, s) : t.insertBefore(l, n) : a && s.remove();
414
+ !r && !o ? a ? t.replaceChild(i, s) : t.insertBefore(i, n) : a && s.remove();
415
415
  } else r = !0;
416
416
  }
417
- } else t.insertBefore(l, n);
418
- return [l];
417
+ } else t.insertBefore(i, n);
418
+ return [i];
419
419
  }
420
420
  var at = (t) => t != null && (t = Object.getPrototypeOf(t), t === Array.prototype || t === Object.prototype);
421
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);
422
+ for (const [l, i] of Object.entries(e)) {
423
+ const r = `${n}.${l}`;
424
+ t[r] = i, at(i) && ut(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
+ at(l) && ut(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
  }
@@ -482,8 +482,8 @@ const St = {
482
482
  }, J = { en: Et, fr: Pt };
483
483
  function Q(t) {
484
484
  const e = _(() => {
485
- const i = t(), l = i in J ? i : "en";
486
- return vt(J[l]);
485
+ const l = t(), i = l in J ? l : "en";
486
+ return vt(J[i]);
487
487
  });
488
488
  return { t: It(e) };
489
489
  }
@@ -508,20 +508,20 @@ function ft(t) {
508
508
  const {
509
509
  value: e,
510
510
  setValue: n,
511
- service: i
512
- } = t, [l, r] = S(""), [o, s] = S([]), {
511
+ service: l
512
+ } = t, [i, r] = S(""), [o, s] = S([]), {
513
513
  t: a
514
514
  } = Q(t.language);
515
515
  G(async () => {
516
516
  const u = e();
517
517
  if (!u) return;
518
- const h = await i.getDocument(u);
518
+ const h = await l.getDocument(u);
519
519
  r(h.title ?? ""), await $();
520
520
  });
521
521
  const $ = async (u) => {
522
- if (u?.preventDefault(), l().length < 3) return;
523
- const h = await i.searchDocuments({
524
- searchString: l()
522
+ if (u?.preventDefault(), i().length < 3) return;
523
+ const h = await l.searchDocuments({
524
+ searchString: i()
525
525
  });
526
526
  s(h);
527
527
  };
@@ -556,7 +556,7 @@ function ft(t) {
556
556
  var c = Tt(), f = c.firstChild;
557
557
  return p(f, () => a("InternalLink.editor.noResult")), c;
558
558
  }
559
- }), null), P(() => m.value = l()), u;
559
+ }), null), P(() => m.value = i()), u;
560
560
  })();
561
561
  }
562
562
  K(["input", "click"]);
@@ -565,11 +565,11 @@ function Ht({
565
565
  service: t,
566
566
  setValue: e,
567
567
  value: n,
568
- language: i
568
+ language: l
569
569
  }) {
570
570
  const {
571
- t: l
572
- } = Q(i), [r, o] = S(), [s, a] = S(!!n());
571
+ t: i
572
+ } = Q(l), [r, o] = S(), [s, a] = S(!!n());
573
573
  G(async () => {
574
574
  const c = n();
575
575
  if (!c) return;
@@ -592,7 +592,7 @@ function Ht({
592
592
  a(!0);
593
593
  }, g;
594
594
  })();
595
- })(), f), p(f, () => l("InternalLink.dialog.title")), c;
595
+ })(), f), p(f, () => i("InternalLink.dialog.title")), c;
596
596
  })(), u = (() => {
597
597
  var c = Ot();
598
598
  return p(c, (() => {
@@ -605,7 +605,7 @@ function Ht({
605
605
  }, d;
606
606
  })() : A(ft, {
607
607
  service: t,
608
- language: i,
608
+ language: l,
609
609
  value: n,
610
610
  setValue: (d) => {
611
611
  e(d), a(!0), m.hide();
@@ -624,19 +624,19 @@ function Ht({
624
624
  var v = jt();
625
625
  return v.$$click = () => {
626
626
  e(void 0), m.hide();
627
- }, p(v, () => l("InternalLink.dialog.removeLink")), v;
627
+ }, p(v, () => i("InternalLink.dialog.removeLink")), v;
628
628
  })(), (() => {
629
629
  var v = et();
630
- return v.$$click = () => a(!1), p(v, () => l("InternalLink.dialog.changeLink")), v;
630
+ return v.$$click = () => a(!1), p(v, () => i("InternalLink.dialog.changeLink")), v;
631
631
  })()];
632
632
  })(), g), g.$$click = () => {
633
633
  m.hide();
634
- }, p(g, () => l("InternalLink.dialog.ok")), d;
634
+ }, p(g, () => i("InternalLink.dialog.ok")), d;
635
635
  })() : (() => {
636
636
  var d = Mt();
637
637
  return d.$$click = () => {
638
638
  m.hide();
639
- }, p(d, () => l("InternalLink.dialog.ok")), d;
639
+ }, p(d, () => i("InternalLink.dialog.ok")), d;
640
640
  })();
641
641
  })()), c;
642
642
  })(), m = t.createModalDialog({
@@ -653,7 +653,7 @@ function Ht({
653
653
  return p(g, () => r()?.title), L.$$click = () => m.show(), d;
654
654
  })() : (() => {
655
655
  var d = et();
656
- return d.$$click = () => m.show(), p(d, () => l("InternalLink.insertLink")), d;
656
+ return d.$$click = () => m.show(), p(d, () => i("InternalLink.insertLink")), d;
657
657
  })();
658
658
  })()), c;
659
659
  })();
@@ -665,7 +665,7 @@ async function Yt({
665
665
  getLanguage: e,
666
666
  service: n
667
667
  }) {
668
- const [i, l] = S(), {
668
+ const [l, i] = S(), {
669
669
  t: r
670
670
  } = Q(e), [o, s] = S(!!t());
671
671
  G(async () => {
@@ -675,7 +675,7 @@ async function Yt({
675
675
  title: m,
676
676
  typeName: c
677
677
  } = await n.getDocument(h);
678
- l({
678
+ i({
679
679
  title: m,
680
680
  typeName: c
681
681
  });
@@ -719,8 +719,8 @@ async function Yt({
719
719
  var m = _(() => !!(o() && t()));
720
720
  return () => m() ? (() => {
721
721
  var c = Jt(), f = c.firstChild, d = f.nextSibling;
722
- return p(f, () => i()?.title), d.$$click = () => {
723
- const g = t(), L = i()?.typeName;
722
+ return p(f, () => l()?.title), d.$$click = () => {
723
+ const g = t(), L = l()?.typeName;
724
724
  !g || !L || (u.close(), n.openDocumentEdition(g, L));
725
725
  }, c;
726
726
  })() : A(ft, {
@@ -737,7 +737,7 @@ async function Yt({
737
737
  return await u.open();
738
738
  }
739
739
  K(["click"]);
740
- const ie = {
740
+ const le = {
741
741
  create: ne,
742
742
  init: ee
743
743
  };
@@ -752,19 +752,19 @@ function te(t) {
752
752
  return (await t.getDocument(e)).title;
753
753
  },
754
754
  async openDialog(e, n) {
755
- const i = await Yt({
755
+ const l = await Yt({
756
756
  value: () => e,
757
757
  getLanguage: n.getLanguage,
758
758
  service: t
759
759
  });
760
760
  if (e) {
761
- if (!i) return;
762
- if (i === "remove") return {
761
+ if (!l) return;
762
+ if (l === "remove") return {
763
763
  documentId: void 0
764
764
  };
765
765
  }
766
766
  return {
767
- documentId: i
767
+ documentId: l
768
768
  };
769
769
  }
770
770
  };
@@ -773,25 +773,25 @@ function ee({
773
773
  pluginBaseUrl: t,
774
774
  addAfterInitListener: e
775
775
  }) {
776
- const n = `${t}/style.css`, i = document.createElement("link");
777
- i.rel = "stylesheet", i.href = n, document.head.appendChild(i), e(zt);
776
+ const n = `${t}/style.css`, l = document.createElement("link");
777
+ l.rel = "stylesheet", l.href = n, document.head.appendChild(l), e(zt);
778
778
  }
779
779
  function ne(t) {
780
780
  if (t.fieldType.dataType !== "string")
781
781
  throw new Error(`data type '${t.fieldType.dataType}' is incompatible, should be 'string'`);
782
782
  return pt((e) => {
783
- const [n, i] = S(t.initialValue ?? ""), [l, r] = S(t.language);
783
+ const [n, l] = S(t.initialValue ?? ""), [i, r] = S(t.language);
784
784
  return {
785
785
  element: A(Ht, {
786
- language: l,
786
+ language: i,
787
787
  value: n,
788
788
  setValue: (o) => {
789
- i(o ?? ""), t.setModifiedValue(o);
789
+ l(o ?? ""), t.setModifiedValue(o);
790
790
  },
791
791
  service: t
792
792
  }),
793
793
  setLanguage: r,
794
- setValue: i,
794
+ setValue: l,
795
795
  getValue() {
796
796
  return n();
797
797
  },
@@ -800,5 +800,5 @@ function ne(t) {
800
800
  });
801
801
  }
802
802
  export {
803
- ie as default
803
+ le as default
804
804
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paroicms/internal-link-plugin",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Internal link plugin for ParoiCMS",
5
5
  "keywords": [
6
6
  "paroicms",
@@ -30,10 +30,10 @@
30
30
  "@paroicms/public-server-lib": "0"
31
31
  },
32
32
  "devDependencies": {
33
- "@paroicms/public-anywhere-lib": "0.10.0",
34
- "@paroicms/public-bo-lib": "0.16.0",
35
- "@paroicms/public-server-lib": "0.17.0",
36
- "@paroicms/quill-editor-plugin": "^1.18.0",
33
+ "@paroicms/public-anywhere-lib": "0.12.0",
34
+ "@paroicms/public-bo-lib": "0.18.0",
35
+ "@paroicms/public-server-lib": "0.20.0",
36
+ "@paroicms/quill-editor-plugin": "^1.21.0",
37
37
  "@solid-primitives/i18n": "~2.1.1",
38
38
  "@types/node": "~20.14.8",
39
39
  "primeicons": "^7.0.0",
@@ -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"