@paroicms/internal-link-plugin 0.7.0 → 0.9.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.
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const dt = (t, e) => t === e,
|
|
1
|
+
const dt = (t, e) => t === e, B = {
|
|
2
2
|
equals: dt
|
|
3
3
|
};
|
|
4
4
|
let nt = st;
|
|
5
|
-
const E = 1,
|
|
5
|
+
const E = 1, O = 2, it = {
|
|
6
6
|
owned: null,
|
|
7
7
|
cleanups: null,
|
|
8
8
|
context: null,
|
|
9
9
|
owner: null
|
|
10
10
|
};
|
|
11
11
|
var k = null;
|
|
12
|
-
let
|
|
12
|
+
let U = null, ht = null, w = null, b = null, I = null, M = 0;
|
|
13
13
|
function pt(t, e) {
|
|
14
14
|
const n = w, i = k, l = t.length === 0, r = i, o = l ? it : {
|
|
15
15
|
owned: null,
|
|
@@ -25,7 +25,7 @@ function pt(t, e) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
function S(t, e) {
|
|
28
|
-
e = e ? Object.assign({},
|
|
28
|
+
e = e ? Object.assign({}, B, e) : B;
|
|
29
29
|
const n = {
|
|
30
30
|
value: t,
|
|
31
31
|
observers: null,
|
|
@@ -35,17 +35,17 @@ function S(t, e) {
|
|
|
35
35
|
return [lt.bind(n), i];
|
|
36
36
|
}
|
|
37
37
|
function P(t, e, n) {
|
|
38
|
-
const i =
|
|
38
|
+
const i = G(t, e, !1, E);
|
|
39
39
|
x(i);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function F(t, e, n) {
|
|
42
42
|
nt = mt;
|
|
43
|
-
const i =
|
|
43
|
+
const i = G(t, e, !1, E);
|
|
44
44
|
i.user = !0, I ? I.push(i) : x(i);
|
|
45
45
|
}
|
|
46
46
|
function _(t, e, n) {
|
|
47
|
-
n = n ? Object.assign({},
|
|
48
|
-
const i =
|
|
47
|
+
n = n ? Object.assign({}, B, n) : B;
|
|
48
|
+
const i = G(t, e, !0, 0);
|
|
49
49
|
return i.observers = null, i.observerSlots = null, i.comparator = n.equals || void 0, x(i), lt.bind(i);
|
|
50
50
|
}
|
|
51
51
|
function C(t) {
|
|
@@ -63,7 +63,7 @@ function lt() {
|
|
|
63
63
|
if (this.state === E) x(this);
|
|
64
64
|
else {
|
|
65
65
|
const t = b;
|
|
66
|
-
b = null, N(() =>
|
|
66
|
+
b = null, N(() => V(this), !1), b = t;
|
|
67
67
|
}
|
|
68
68
|
if (w) {
|
|
69
69
|
const t = this.observers ? this.observers.length : 0;
|
|
@@ -75,8 +75,8 @@ function rt(t, e, n) {
|
|
|
75
75
|
let i = t.value;
|
|
76
76
|
return (!t.comparator || !t.comparator(i, e)) && (t.value = e, t.observers && t.observers.length && N(() => {
|
|
77
77
|
for (let l = 0; l < t.observers.length; l += 1) {
|
|
78
|
-
const r = t.observers[l], o =
|
|
79
|
-
o &&
|
|
78
|
+
const r = t.observers[l], o = U && U.running;
|
|
79
|
+
o && U.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)
|
|
82
82
|
throw b = [], new Error();
|
|
@@ -85,7 +85,7 @@ function rt(t, e, n) {
|
|
|
85
85
|
function x(t) {
|
|
86
86
|
if (!t.fn) return;
|
|
87
87
|
T(t);
|
|
88
|
-
const e =
|
|
88
|
+
const e = M;
|
|
89
89
|
gt(
|
|
90
90
|
t,
|
|
91
91
|
t.value,
|
|
@@ -105,7 +105,7 @@ function gt(t, e, n) {
|
|
|
105
105
|
}
|
|
106
106
|
(!t.updatedAt || t.updatedAt <= n) && (t.updatedAt != null && "observers" in t ? rt(t, i) : t.value = i, t.updatedAt = n);
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function G(t, e, n, i = E, l) {
|
|
109
109
|
const r = {
|
|
110
110
|
fn: t,
|
|
111
111
|
state: i,
|
|
@@ -121,25 +121,25 @@ function q(t, e, n, i = E, l) {
|
|
|
121
121
|
};
|
|
122
122
|
return k === null || k !== it && (k.owned ? k.owned.push(r) : k.owned = [r]), r;
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function R(t) {
|
|
125
125
|
if (t.state === 0) return;
|
|
126
|
-
if (t.state ===
|
|
126
|
+
if (t.state === O) return V(t);
|
|
127
127
|
if (t.suspense && C(t.suspense.inFallback)) return t.suspense.effects.push(t);
|
|
128
128
|
const e = [t];
|
|
129
|
-
for (; (t = t.owner) && (!t.updatedAt || t.updatedAt <
|
|
129
|
+
for (; (t = t.owner) && (!t.updatedAt || t.updatedAt < M); )
|
|
130
130
|
t.state && e.push(t);
|
|
131
131
|
for (let n = e.length - 1; n >= 0; n--)
|
|
132
132
|
if (t = e[n], t.state === E)
|
|
133
133
|
x(t);
|
|
134
|
-
else if (t.state ===
|
|
134
|
+
else if (t.state === O) {
|
|
135
135
|
const i = b;
|
|
136
|
-
b = null, N(() =>
|
|
136
|
+
b = null, N(() => V(t, e[0]), !1), b = i;
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
function N(t, e) {
|
|
140
140
|
if (b) return t();
|
|
141
141
|
let n = !1;
|
|
142
|
-
e || (b = []), I ? n = !0 : I = [],
|
|
142
|
+
e || (b = []), I ? n = !0 : I = [], M++;
|
|
143
143
|
try {
|
|
144
144
|
const i = t();
|
|
145
145
|
return $t(n), i;
|
|
@@ -153,30 +153,30 @@ function $t(t) {
|
|
|
153
153
|
I = null, e.length && N(() => nt(e), !1);
|
|
154
154
|
}
|
|
155
155
|
function st(t) {
|
|
156
|
-
for (let e = 0; e < t.length; e++)
|
|
156
|
+
for (let e = 0; e < t.length; e++) R(t[e]);
|
|
157
157
|
}
|
|
158
158
|
function mt(t) {
|
|
159
159
|
let e, n = 0;
|
|
160
160
|
for (e = 0; e < t.length; e++) {
|
|
161
161
|
const i = t[e];
|
|
162
|
-
i.user ? t[n++] = i :
|
|
162
|
+
i.user ? t[n++] = i : R(i);
|
|
163
163
|
}
|
|
164
|
-
for (e = 0; e < n; e++)
|
|
164
|
+
for (e = 0; e < n; e++) R(t[e]);
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function V(t, e) {
|
|
167
167
|
t.state = 0;
|
|
168
168
|
for (let n = 0; n < t.sources.length; n += 1) {
|
|
169
169
|
const i = t.sources[n];
|
|
170
170
|
if (i.sources) {
|
|
171
171
|
const l = i.state;
|
|
172
|
-
l === E ? i !== e && (!i.updatedAt || i.updatedAt <
|
|
172
|
+
l === E ? i !== e && (!i.updatedAt || i.updatedAt < M) && R(i) : l === O && V(i, e);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
function ot(t) {
|
|
177
177
|
for (let e = 0; e < t.observers.length; e += 1) {
|
|
178
178
|
const n = t.observers[e];
|
|
179
|
-
n.state || (n.state =
|
|
179
|
+
n.state || (n.state = O, n.pure ? b.push(n) : I.push(n), n.observers && ot(n));
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
function T(t) {
|
|
@@ -287,7 +287,7 @@ function y(t, e, n) {
|
|
|
287
287
|
}, r = () => (i || (i = l())).cloneNode(!0);
|
|
288
288
|
return r.cloneNode = r, r;
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function q(t, e = window.document) {
|
|
291
291
|
const n = e[W] || (e[W] = /* @__PURE__ */ new Set());
|
|
292
292
|
for (let i = 0, l = t.length; i < l; i++) {
|
|
293
293
|
const r = t[i];
|
|
@@ -298,8 +298,8 @@ function kt(t, e) {
|
|
|
298
298
|
e == null ? t.removeAttribute("class") : t.className = e;
|
|
299
299
|
}
|
|
300
300
|
function p(t, e, n, i) {
|
|
301
|
-
if (n !== void 0 && !i && (i = []), typeof e != "function") return
|
|
302
|
-
P((l) =>
|
|
301
|
+
if (n !== void 0 && !i && (i = []), typeof e != "function") return j(t, e, i, n);
|
|
302
|
+
P((l) => j(t, e(), l, n), i);
|
|
303
303
|
}
|
|
304
304
|
function _t(t) {
|
|
305
305
|
let e = t.target;
|
|
@@ -335,7 +335,7 @@ function _t(t) {
|
|
|
335
335
|
} else s();
|
|
336
336
|
r(i);
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function j(t, e, n, i, l) {
|
|
339
339
|
for (; typeof n == "function"; ) n = n();
|
|
340
340
|
if (e === n) return n;
|
|
341
341
|
const r = typeof e, o = i !== void 0;
|
|
@@ -354,12 +354,12 @@ function M(t, e, n, i, l) {
|
|
|
354
354
|
return P(() => {
|
|
355
355
|
let s = e();
|
|
356
356
|
for (; typeof s == "function"; ) s = s();
|
|
357
|
-
n =
|
|
357
|
+
n = j(t, s, n, i);
|
|
358
358
|
}), () => n;
|
|
359
359
|
if (Array.isArray(e)) {
|
|
360
360
|
const s = [], u = n && Array.isArray(n);
|
|
361
|
-
if (
|
|
362
|
-
return P(() => n =
|
|
361
|
+
if (H(s, e, n, l))
|
|
362
|
+
return P(() => n = j(t, s, n, i, !0)), () => n;
|
|
363
363
|
if (s.length === 0) {
|
|
364
364
|
if (n = D(t, n, i), o) return n;
|
|
365
365
|
} else u ? n.length === 0 ? X(t, s, i) : bt(t, n, s) : (n && D(t), X(t, s));
|
|
@@ -374,18 +374,18 @@ function M(t, e, n, i, l) {
|
|
|
374
374
|
}
|
|
375
375
|
return n;
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function H(t, e, n, i) {
|
|
378
378
|
let l = !1;
|
|
379
379
|
for (let r = 0, o = e.length; r < o; r++) {
|
|
380
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 =
|
|
384
|
+
l = H(t, s, u) || l;
|
|
385
385
|
else if ($ === "function")
|
|
386
386
|
if (i) {
|
|
387
387
|
for (; typeof s == "function"; ) s = s();
|
|
388
|
-
l =
|
|
388
|
+
l = H(
|
|
389
389
|
t,
|
|
390
390
|
Array.isArray(s) ? s : [s],
|
|
391
391
|
Array.isArray(u) ? u : [u]
|
|
@@ -450,7 +450,7 @@ const St = { insertLink: "Insert link", change: "Change", editor: { noResult: "N
|
|
|
450
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 = {
|
|
451
451
|
InternalLink: Dt
|
|
452
452
|
}, J = { en: Et, fr: Pt };
|
|
453
|
-
function
|
|
453
|
+
function K(t) {
|
|
454
454
|
const e = _(() => {
|
|
455
455
|
const i = t(), l = i in J ? i : "en";
|
|
456
456
|
return vt(J[l]);
|
|
@@ -481,8 +481,8 @@ function ft(t) {
|
|
|
481
481
|
service: i
|
|
482
482
|
} = t, [l, r] = S(""), [o, s] = S([]), {
|
|
483
483
|
t: u
|
|
484
|
-
} =
|
|
485
|
-
|
|
484
|
+
} = K(t.language);
|
|
485
|
+
F(async () => {
|
|
486
486
|
const a = e();
|
|
487
487
|
if (!a) return;
|
|
488
488
|
const h = await i.getDocument(a);
|
|
@@ -509,10 +509,7 @@ function ft(t) {
|
|
|
509
509
|
n(f.id);
|
|
510
510
|
}, p(g, () => f.title), p(L, (() => {
|
|
511
511
|
var v = _(() => !!f.ready);
|
|
512
|
-
return () => v() ? (() =>
|
|
513
|
-
var B = _(() => z(f.publishDate).getTime() < (/* @__PURE__ */ new Date()).getTime());
|
|
514
|
-
return () => B() ? u("InternalLink.editor.published") : u("InternalLink.editor.sheduled");
|
|
515
|
-
})() : u("InternalLink.editor.draft");
|
|
512
|
+
return () => v() ? _(() => z(f.publishDate).getTime() < (/* @__PURE__ */ new Date()).getTime())() ? u("InternalLink.editor.published") : u("InternalLink.editor.sheduled") : u("InternalLink.editor.draft");
|
|
516
513
|
})()), P(() => kt(L, `ILResultItem-status
|
|
517
514
|
${f.ready ? z(f.publishDate).getTime() < (/* @__PURE__ */ new Date()).getTime() ? "published" : "sheduled" : "draft"}`)), d;
|
|
518
515
|
})()
|
|
@@ -529,7 +526,7 @@ function ft(t) {
|
|
|
529
526
|
}), null), P(() => m.value = l()), a;
|
|
530
527
|
})();
|
|
531
528
|
}
|
|
532
|
-
|
|
529
|
+
q(["input", "click"]);
|
|
533
530
|
var Nt = /* @__PURE__ */ y("<div class=InternalLinkDialog-header><span class=InternalLinkDialog-title>"), Bt = /* @__PURE__ */ y('<button class="PlgBtn pi pi-arrow-left"type=button>'), Ot = /* @__PURE__ */ y("<div class=InternalLinkDialog-content>"), Rt = /* @__PURE__ */ y('<div class=ILPreview><div class=ILPreview-title></div><button class="PlgBtn outlined iconBtn pi pi-pencil"type=button>'), tt = /* @__PURE__ */ y("<div>"), Vt = /* @__PURE__ */ y('<div><button class="PlgBtn primary"type=button>'), jt = /* @__PURE__ */ y('<button type=button class="PlgBtn danger outlined">'), et = /* @__PURE__ */ y("<button class=PlgBtn type=button>"), Mt = /* @__PURE__ */ y('<button class="PlgBtn primary"type=button>'), Ut = /* @__PURE__ */ y('<div class=InternalLinkDialog-linkPreview><div></div><button class="PlgBtn iconBtn pi pi-pencil"type=button>');
|
|
534
531
|
function Ht({
|
|
535
532
|
service: t,
|
|
@@ -539,8 +536,8 @@ function Ht({
|
|
|
539
536
|
}) {
|
|
540
537
|
const {
|
|
541
538
|
t: l
|
|
542
|
-
} =
|
|
543
|
-
|
|
539
|
+
} = K(i), [r, o] = S(), [s, u] = S(!!n());
|
|
540
|
+
F(async () => {
|
|
544
541
|
const c = n();
|
|
545
542
|
if (!c) return;
|
|
546
543
|
const {
|
|
@@ -570,8 +567,8 @@ function Ht({
|
|
|
570
567
|
return () => f() ? (() => {
|
|
571
568
|
var d = Rt(), g = d.firstChild, L = g.nextSibling;
|
|
572
569
|
return p(g, () => r()?.title), L.$$click = () => {
|
|
573
|
-
const v = n(),
|
|
574
|
-
!v || !
|
|
570
|
+
const v = n(), Q = r()?.typeName;
|
|
571
|
+
!v || !Q || (m.close(), t.openDocumentEdition(v, Q));
|
|
575
572
|
}, d;
|
|
576
573
|
})() : A(ft, {
|
|
577
574
|
service: t,
|
|
@@ -628,7 +625,7 @@ function Ht({
|
|
|
628
625
|
})()), c;
|
|
629
626
|
})();
|
|
630
627
|
}
|
|
631
|
-
|
|
628
|
+
q(["click"]);
|
|
632
629
|
var Ft = /* @__PURE__ */ y("<div class=InternalLinkDialog-header><span class=InternalLinkDialog-title>"), Gt = /* @__PURE__ */ y('<button class="PlgBtn pi pi-arrow-left"type=button>'), qt = /* @__PURE__ */ y("<div>"), Kt = /* @__PURE__ */ y('<div><button class="PlgBtn primary"type=button>'), Qt = /* @__PURE__ */ y('<button type=button class="PlgBtn danger outlined">'), Zt = /* @__PURE__ */ y("<button class=PlgBtn type=button>"), Wt = /* @__PURE__ */ y('<button class="PlgBtn primary"type=button>'), Xt = /* @__PURE__ */ y("<div class=InternalLinkDialog-content>"), Jt = /* @__PURE__ */ y('<div class=ILPreview><div class=ILPreview-title></div><button class="PlgBtn outlined iconBtn pi pi-pencil"type=button>');
|
|
633
630
|
async function Yt({
|
|
634
631
|
value: t,
|
|
@@ -637,8 +634,8 @@ async function Yt({
|
|
|
637
634
|
}) {
|
|
638
635
|
const [i, l] = S(), {
|
|
639
636
|
t: r
|
|
640
|
-
} =
|
|
641
|
-
|
|
637
|
+
} = K(e), [o, s] = S(!!t());
|
|
638
|
+
F(async () => {
|
|
642
639
|
const h = t();
|
|
643
640
|
if (!h) return;
|
|
644
641
|
const {
|
|
@@ -706,7 +703,7 @@ async function Yt({
|
|
|
706
703
|
});
|
|
707
704
|
return await a.open();
|
|
708
705
|
}
|
|
709
|
-
|
|
706
|
+
q(["click"]);
|
|
710
707
|
const ie = {
|
|
711
708
|
create: ne,
|
|
712
709
|
init: ee
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paroicms/internal-link-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.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.
|
|
34
|
-
"@paroicms/public-bo-lib": "0.19.
|
|
35
|
-
"@paroicms/public-server-lib": "0.
|
|
36
|
-
"@paroicms/quill-editor-plugin": "^1.
|
|
33
|
+
"@paroicms/public-anywhere-lib": "0.18.0",
|
|
34
|
+
"@paroicms/public-bo-lib": "0.19.5",
|
|
35
|
+
"@paroicms/public-server-lib": "0.25.0",
|
|
36
|
+
"@paroicms/quill-editor-plugin": "^1.27.0",
|
|
37
37
|
"@solid-primitives/i18n": "~2.1.1",
|
|
38
38
|
"@types/node": "~22.10.7",
|
|
39
39
|
"primeicons": "^7.0.0",
|