@paroicms/internal-link-plugin 0.14.0 → 0.15.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.
- package/{bo-front/dist/bo-plugin.mjs → admin-ui-plugin/dist/admin-ui-plugin.mjs} +210 -225
- package/backend/dist/plugin.js +1 -1
- package/package.json +16 -17
- package/site-schema-lib/field-lib.site-schema.json +1 -1
- /package/{bo-front/dist/bo-plugin.css → admin-ui-plugin/dist/admin-ui-plugin.css} +0 -0
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
const
|
|
2
|
-
equals:
|
|
1
|
+
const ht = (t, e) => t === e, O = {
|
|
2
|
+
equals: ht
|
|
3
3
|
};
|
|
4
|
-
let
|
|
5
|
-
const E = 1,
|
|
4
|
+
let it = ot;
|
|
5
|
+
const E = 1, V = 2, lt = {
|
|
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
|
|
13
|
-
function
|
|
14
|
-
const n = w, i = k, l = t.length === 0, r = i, o = l ?
|
|
12
|
+
let H = null, pt = null, w = null, b = null, I = null, U = 0;
|
|
13
|
+
function gt(t, e) {
|
|
14
|
+
const n = w, i = k, l = t.length === 0, r = i, o = l ? 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(() =>
|
|
19
|
+
}, s = l ? t : () => t(() => A(() => T(o)));
|
|
20
20
|
k = o, w = null;
|
|
21
21
|
try {
|
|
22
|
-
return
|
|
22
|
+
return B(s, !0);
|
|
23
23
|
} finally {
|
|
24
24
|
w = n, k = i;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
function S(t, e) {
|
|
28
|
-
e = e ? Object.assign({},
|
|
28
|
+
e = e ? Object.assign({}, O, e) : O;
|
|
29
29
|
const n = {
|
|
30
30
|
value: t,
|
|
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)),
|
|
35
|
-
return [
|
|
34
|
+
}, i = (l) => (typeof l == "function" && (l = l(n.value)), st(n, l));
|
|
35
|
+
return [rt.bind(n), i];
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
const i =
|
|
39
|
-
|
|
37
|
+
function C(t, e, n) {
|
|
38
|
+
const i = q(t, e, !1, E);
|
|
39
|
+
N(i);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
|
|
43
|
-
const i =
|
|
44
|
-
i.user = !0, I ? I.push(i) :
|
|
41
|
+
function G(t, e, n) {
|
|
42
|
+
it = yt;
|
|
43
|
+
const i = q(t, e, !1, E);
|
|
44
|
+
i.user = !0, I ? I.push(i) : N(i);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
n = n ? Object.assign({},
|
|
48
|
-
const i =
|
|
49
|
-
return i.observers = null, i.observerSlots = null, i.comparator = n.equals || void 0,
|
|
46
|
+
function P(t, e, n) {
|
|
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, N(i), rt.bind(i);
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function A(t) {
|
|
52
52
|
if (w === null) return t();
|
|
53
53
|
const e = w;
|
|
54
54
|
w = null;
|
|
@@ -58,12 +58,12 @@ function C(t) {
|
|
|
58
58
|
w = e;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function rt() {
|
|
62
62
|
if (this.sources && this.state)
|
|
63
|
-
if (this.state === E)
|
|
63
|
+
if (this.state === E) N(this);
|
|
64
64
|
else {
|
|
65
65
|
const t = b;
|
|
66
|
-
b = null,
|
|
66
|
+
b = null, B(() => M(this), !1), b = t;
|
|
67
67
|
}
|
|
68
68
|
if (w) {
|
|
69
69
|
const t = this.observers ? this.observers.length : 0;
|
|
@@ -71,41 +71,37 @@ function lt() {
|
|
|
71
71
|
}
|
|
72
72
|
return this.value;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function st(t, e, n) {
|
|
75
75
|
let i = t.value;
|
|
76
|
-
return (!t.comparator || !t.comparator(i, e)) && (t.value = e, t.observers && t.observers.length &&
|
|
76
|
+
return (!t.comparator || !t.comparator(i, e)) && (t.value = e, t.observers && t.observers.length && B(() => {
|
|
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 = H && H.running;
|
|
79
|
+
o && H.disposed.has(r), (o ? !r.tState : !r.state) && (r.pure ? b.push(r) : I.push(r), r.observers && ct(r)), o || (r.state = E);
|
|
80
80
|
}
|
|
81
81
|
if (b.length > 1e6)
|
|
82
82
|
throw b = [], new Error();
|
|
83
83
|
}, !1)), e;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function N(t) {
|
|
86
86
|
if (!t.fn) return;
|
|
87
|
-
|
|
88
|
-
const e =
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
e
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
function gt(t, e, n) {
|
|
87
|
+
T(t);
|
|
88
|
+
const e = U;
|
|
89
|
+
$t(t, t.value, e);
|
|
90
|
+
}
|
|
91
|
+
function $t(t, e, n) {
|
|
96
92
|
let i;
|
|
97
93
|
const l = k, r = w;
|
|
98
94
|
w = k = t;
|
|
99
95
|
try {
|
|
100
96
|
i = t.fn(e);
|
|
101
97
|
} catch (o) {
|
|
102
|
-
return t.pure && (t.state = E, t.owned && t.owned.forEach(
|
|
98
|
+
return t.pure && (t.state = E, t.owned && t.owned.forEach(T), t.owned = null), t.updatedAt = n + 1, ut(o);
|
|
103
99
|
} finally {
|
|
104
100
|
w = r, k = l;
|
|
105
101
|
}
|
|
106
|
-
(!t.updatedAt || t.updatedAt <= n) && (t.updatedAt != null && "observers" in t ?
|
|
102
|
+
(!t.updatedAt || t.updatedAt <= n) && (t.updatedAt != null && "observers" in t ? st(t, i) : t.value = i, t.updatedAt = n);
|
|
107
103
|
}
|
|
108
|
-
function
|
|
104
|
+
function q(t, e, n, i = E, l) {
|
|
109
105
|
const r = {
|
|
110
106
|
fn: t,
|
|
111
107
|
state: i,
|
|
@@ -119,67 +115,67 @@ function G(t, e, n, i = E, l) {
|
|
|
119
115
|
context: k ? k.context : null,
|
|
120
116
|
pure: n
|
|
121
117
|
};
|
|
122
|
-
return k === null || k !==
|
|
118
|
+
return k === null || k !== lt && (k.owned ? k.owned.push(r) : k.owned = [r]), r;
|
|
123
119
|
}
|
|
124
|
-
function
|
|
120
|
+
function R(t) {
|
|
125
121
|
if (t.state === 0) return;
|
|
126
|
-
if (t.state ===
|
|
127
|
-
if (t.suspense &&
|
|
122
|
+
if (t.state === V) return M(t);
|
|
123
|
+
if (t.suspense && A(t.suspense.inFallback)) return t.suspense.effects.push(t);
|
|
128
124
|
const e = [t];
|
|
129
|
-
for (; (t = t.owner) && (!t.updatedAt || t.updatedAt <
|
|
125
|
+
for (; (t = t.owner) && (!t.updatedAt || t.updatedAt < U); )
|
|
130
126
|
t.state && e.push(t);
|
|
131
127
|
for (let n = e.length - 1; n >= 0; n--)
|
|
132
128
|
if (t = e[n], t.state === E)
|
|
133
|
-
|
|
134
|
-
else if (t.state ===
|
|
129
|
+
N(t);
|
|
130
|
+
else if (t.state === V) {
|
|
135
131
|
const i = b;
|
|
136
|
-
b = null,
|
|
132
|
+
b = null, B(() => M(t, e[0]), !1), b = i;
|
|
137
133
|
}
|
|
138
134
|
}
|
|
139
|
-
function
|
|
135
|
+
function B(t, e) {
|
|
140
136
|
if (b) return t();
|
|
141
137
|
let n = !1;
|
|
142
|
-
e || (b = []), I ? n = !0 : I = [],
|
|
138
|
+
e || (b = []), I ? n = !0 : I = [], U++;
|
|
143
139
|
try {
|
|
144
140
|
const i = t();
|
|
145
|
-
return
|
|
141
|
+
return mt(n), i;
|
|
146
142
|
} catch (i) {
|
|
147
|
-
n || (I = null), b = null,
|
|
143
|
+
n || (I = null), b = null, ut(i);
|
|
148
144
|
}
|
|
149
145
|
}
|
|
150
|
-
function
|
|
151
|
-
if (b && (
|
|
146
|
+
function mt(t) {
|
|
147
|
+
if (b && (ot(b), b = null), t) return;
|
|
152
148
|
const e = I;
|
|
153
|
-
I = null, e.length &&
|
|
149
|
+
I = null, e.length && B(() => it(e), !1);
|
|
154
150
|
}
|
|
155
|
-
function
|
|
156
|
-
for (let e = 0; e < t.length; e++)
|
|
151
|
+
function ot(t) {
|
|
152
|
+
for (let e = 0; e < t.length; e++) R(t[e]);
|
|
157
153
|
}
|
|
158
|
-
function
|
|
154
|
+
function yt(t) {
|
|
159
155
|
let e, n = 0;
|
|
160
156
|
for (e = 0; e < t.length; e++) {
|
|
161
157
|
const i = t[e];
|
|
162
|
-
i.user ? t[n++] = i :
|
|
158
|
+
i.user ? t[n++] = i : R(i);
|
|
163
159
|
}
|
|
164
|
-
for (e = 0; e < n; e++)
|
|
160
|
+
for (e = 0; e < n; e++) R(t[e]);
|
|
165
161
|
}
|
|
166
|
-
function
|
|
162
|
+
function M(t, e) {
|
|
167
163
|
t.state = 0;
|
|
168
164
|
for (let n = 0; n < t.sources.length; n += 1) {
|
|
169
165
|
const i = t.sources[n];
|
|
170
166
|
if (i.sources) {
|
|
171
167
|
const l = i.state;
|
|
172
|
-
l === E ? i !== e && (!i.updatedAt || i.updatedAt <
|
|
168
|
+
l === E ? i !== e && (!i.updatedAt || i.updatedAt < U) && R(i) : l === V && M(i, e);
|
|
173
169
|
}
|
|
174
170
|
}
|
|
175
171
|
}
|
|
176
|
-
function
|
|
172
|
+
function ct(t) {
|
|
177
173
|
for (let e = 0; e < t.observers.length; e += 1) {
|
|
178
174
|
const n = t.observers[e];
|
|
179
|
-
n.state || (n.state =
|
|
175
|
+
n.state || (n.state = V, n.pure ? b.push(n) : I.push(n), n.observers && ct(n));
|
|
180
176
|
}
|
|
181
177
|
}
|
|
182
|
-
function
|
|
178
|
+
function T(t) {
|
|
183
179
|
let e;
|
|
184
180
|
if (t.sources)
|
|
185
181
|
for (; t.sources.length; ) {
|
|
@@ -190,11 +186,11 @@ function A(t) {
|
|
|
190
186
|
}
|
|
191
187
|
}
|
|
192
188
|
if (t.tOwned) {
|
|
193
|
-
for (e = t.tOwned.length - 1; e >= 0; e--)
|
|
189
|
+
for (e = t.tOwned.length - 1; e >= 0; e--) T(t.tOwned[e]);
|
|
194
190
|
delete t.tOwned;
|
|
195
191
|
}
|
|
196
192
|
if (t.owned) {
|
|
197
|
-
for (e = t.owned.length - 1; e >= 0; e--)
|
|
193
|
+
for (e = t.owned.length - 1; e >= 0; e--) T(t.owned[e]);
|
|
198
194
|
t.owned = null;
|
|
199
195
|
}
|
|
200
196
|
if (t.cleanups) {
|
|
@@ -203,43 +199,36 @@ function A(t) {
|
|
|
203
199
|
}
|
|
204
200
|
t.state = 0;
|
|
205
201
|
}
|
|
206
|
-
function
|
|
202
|
+
function wt(t) {
|
|
207
203
|
return t instanceof Error ? t : new Error(typeof t == "string" ? t : "Unknown error", {
|
|
208
204
|
cause: t
|
|
209
205
|
});
|
|
210
206
|
}
|
|
211
|
-
function
|
|
212
|
-
throw
|
|
207
|
+
function ut(t, e = k) {
|
|
208
|
+
throw wt(t);
|
|
213
209
|
}
|
|
214
|
-
function
|
|
215
|
-
return
|
|
210
|
+
function x(t, e) {
|
|
211
|
+
return A(() => t(e || {}));
|
|
216
212
|
}
|
|
217
|
-
const
|
|
218
|
-
function
|
|
219
|
-
const e = t.keyed, n =
|
|
213
|
+
const bt = (t) => `Stale read from <${t}>.`;
|
|
214
|
+
function W(t) {
|
|
215
|
+
const e = t.keyed, n = P(() => t.when, void 0, void 0), i = e ? n : P(n, void 0, {
|
|
220
216
|
equals: (l, r) => !l == !r
|
|
221
217
|
});
|
|
222
|
-
return
|
|
223
|
-
()
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
)
|
|
234
|
-
) : r;
|
|
235
|
-
}
|
|
236
|
-
return t.fallback;
|
|
237
|
-
},
|
|
238
|
-
void 0,
|
|
239
|
-
void 0
|
|
240
|
-
);
|
|
218
|
+
return P(() => {
|
|
219
|
+
const l = i();
|
|
220
|
+
if (l) {
|
|
221
|
+
const r = t.children;
|
|
222
|
+
return typeof r == "function" && r.length > 0 ? A(() => r(e ? l : () => {
|
|
223
|
+
if (!A(i)) throw bt("Show");
|
|
224
|
+
return n();
|
|
225
|
+
})) : r;
|
|
226
|
+
}
|
|
227
|
+
return t.fallback;
|
|
228
|
+
}, void 0, void 0);
|
|
241
229
|
}
|
|
242
|
-
|
|
230
|
+
const L = (t) => P(() => t());
|
|
231
|
+
function kt(t, e, n) {
|
|
243
232
|
let i = n.length, l = e.length, r = i, o = 0, s = 0, u = e[l - 1].nextSibling, $ = null;
|
|
244
233
|
for (; o < l || s < r; ) {
|
|
245
234
|
if (e[o] === n[s]) {
|
|
@@ -278,7 +267,7 @@ function bt(t, e, n) {
|
|
|
278
267
|
}
|
|
279
268
|
}
|
|
280
269
|
}
|
|
281
|
-
const
|
|
270
|
+
const X = "_$DX_DELEGATE";
|
|
282
271
|
function y(t, e, n, i) {
|
|
283
272
|
let l;
|
|
284
273
|
const r = () => {
|
|
@@ -287,21 +276,21 @@ function y(t, e, n, i) {
|
|
|
287
276
|
}, o = () => (l || (l = r())).cloneNode(!0);
|
|
288
277
|
return o.cloneNode = o, o;
|
|
289
278
|
}
|
|
290
|
-
function
|
|
291
|
-
const n = e[
|
|
279
|
+
function K(t, e = window.document) {
|
|
280
|
+
const n = e[X] || (e[X] = /* @__PURE__ */ new Set());
|
|
292
281
|
for (let i = 0, l = t.length; i < l; i++) {
|
|
293
282
|
const r = t[i];
|
|
294
|
-
n.has(r) || (n.add(r), e.addEventListener(r,
|
|
283
|
+
n.has(r) || (n.add(r), e.addEventListener(r, vt));
|
|
295
284
|
}
|
|
296
285
|
}
|
|
297
|
-
function
|
|
286
|
+
function _t(t, e) {
|
|
298
287
|
e == null ? t.removeAttribute("class") : t.className = e;
|
|
299
288
|
}
|
|
300
289
|
function p(t, e, n, i) {
|
|
301
|
-
if (n !== void 0 && !i && (i = []), typeof e != "function") return
|
|
302
|
-
|
|
290
|
+
if (n !== void 0 && !i && (i = []), typeof e != "function") return j(t, e, i, n);
|
|
291
|
+
C((l) => j(t, e(), l, n), i);
|
|
303
292
|
}
|
|
304
|
-
function
|
|
293
|
+
function vt(t) {
|
|
305
294
|
let e = t.target;
|
|
306
295
|
const n = `$$${t.type}`, i = t.target, l = t.currentTarget, r = (u) => Object.defineProperty(t, "target", {
|
|
307
296
|
configurable: !0,
|
|
@@ -335,7 +324,7 @@ function _t(t) {
|
|
|
335
324
|
} else s();
|
|
336
325
|
r(i);
|
|
337
326
|
}
|
|
338
|
-
function
|
|
327
|
+
function j(t, e, n, i, l) {
|
|
339
328
|
for (; typeof n == "function"; ) n = n();
|
|
340
329
|
if (e === n) return n;
|
|
341
330
|
const r = typeof e, o = i !== void 0;
|
|
@@ -351,18 +340,18 @@ function M(t, e, n, i, l) {
|
|
|
351
340
|
n = D(t, n, i);
|
|
352
341
|
else {
|
|
353
342
|
if (r === "function")
|
|
354
|
-
return
|
|
343
|
+
return C(() => {
|
|
355
344
|
let s = e();
|
|
356
345
|
for (; typeof s == "function"; ) s = s();
|
|
357
|
-
n =
|
|
346
|
+
n = j(t, s, n, i);
|
|
358
347
|
}), () => n;
|
|
359
348
|
if (Array.isArray(e)) {
|
|
360
349
|
const s = [], u = n && Array.isArray(n);
|
|
361
|
-
if (
|
|
362
|
-
return
|
|
350
|
+
if (F(s, e, n, l))
|
|
351
|
+
return C(() => n = j(t, s, n, i, !0)), () => n;
|
|
363
352
|
if (s.length === 0) {
|
|
364
353
|
if (n = D(t, n, i), o) return n;
|
|
365
|
-
} else u ? n.length === 0 ?
|
|
354
|
+
} else u ? n.length === 0 ? J(t, s, i) : kt(t, n, s) : (n && D(t), J(t, s));
|
|
366
355
|
n = s;
|
|
367
356
|
} else if (e.nodeType) {
|
|
368
357
|
if (Array.isArray(n)) {
|
|
@@ -374,22 +363,18 @@ function M(t, e, n, i, l) {
|
|
|
374
363
|
}
|
|
375
364
|
return n;
|
|
376
365
|
}
|
|
377
|
-
function
|
|
366
|
+
function F(t, e, n, i) {
|
|
378
367
|
let l = !1;
|
|
379
368
|
for (let r = 0, o = e.length; r < o; r++) {
|
|
380
369
|
let s = e[r], u = n && n[t.length], $;
|
|
381
370
|
if (!(s == null || s === !0 || s === !1)) if (($ = typeof s) == "object" && s.nodeType)
|
|
382
371
|
t.push(s);
|
|
383
372
|
else if (Array.isArray(s))
|
|
384
|
-
l =
|
|
373
|
+
l = F(t, s, u) || l;
|
|
385
374
|
else if ($ === "function")
|
|
386
375
|
if (i) {
|
|
387
376
|
for (; typeof s == "function"; ) s = s();
|
|
388
|
-
l =
|
|
389
|
-
t,
|
|
390
|
-
Array.isArray(s) ? s : [s],
|
|
391
|
-
Array.isArray(u) ? u : [u]
|
|
392
|
-
) || l;
|
|
377
|
+
l = F(t, Array.isArray(s) ? s : [s], Array.isArray(u) ? u : [u]) || l;
|
|
393
378
|
} else
|
|
394
379
|
t.push(s), l = !0;
|
|
395
380
|
else {
|
|
@@ -399,7 +384,7 @@ function H(t, e, n, i) {
|
|
|
399
384
|
}
|
|
400
385
|
return l;
|
|
401
386
|
}
|
|
402
|
-
function
|
|
387
|
+
function J(t, e, n = null) {
|
|
403
388
|
for (let i = 0, l = e.length; i < l; i++) t.insertBefore(e[i], n);
|
|
404
389
|
}
|
|
405
390
|
function D(t, e, n, i) {
|
|
@@ -417,21 +402,21 @@ function D(t, e, n, i) {
|
|
|
417
402
|
} else t.insertBefore(l, n);
|
|
418
403
|
return [l];
|
|
419
404
|
}
|
|
420
|
-
const
|
|
421
|
-
function
|
|
405
|
+
const at = (t) => t != null && (t = Object.getPrototypeOf(t), t === Array.prototype || t === Object.prototype);
|
|
406
|
+
function ft(t, e, n) {
|
|
422
407
|
for (const [i, l] of Object.entries(e)) {
|
|
423
408
|
const r = `${n}.${i}`;
|
|
424
|
-
t[r] = l,
|
|
409
|
+
t[r] = l, at(l) && ft(t, l, r);
|
|
425
410
|
}
|
|
426
411
|
}
|
|
427
|
-
function
|
|
412
|
+
function Lt(t) {
|
|
428
413
|
const e = { ...t };
|
|
429
414
|
for (const [n, i] of Object.entries(t))
|
|
430
|
-
|
|
415
|
+
at(i) && ft(e, i, n);
|
|
431
416
|
return e;
|
|
432
417
|
}
|
|
433
|
-
const
|
|
434
|
-
function
|
|
418
|
+
const It = (t) => t;
|
|
419
|
+
function St(t, e = It) {
|
|
435
420
|
return (n, ...i) => {
|
|
436
421
|
n[0] === "." && (n = n.slice(1));
|
|
437
422
|
const l = t()?.[n];
|
|
@@ -445,44 +430,44 @@ function It(t, e = Lt) {
|
|
|
445
430
|
}
|
|
446
431
|
};
|
|
447
432
|
}
|
|
448
|
-
const
|
|
449
|
-
InternalLink:
|
|
450
|
-
},
|
|
451
|
-
InternalLink:
|
|
452
|
-
},
|
|
453
|
-
function
|
|
454
|
-
const e =
|
|
455
|
-
const i = t(), l = i in
|
|
456
|
-
return
|
|
433
|
+
const Et = { 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" } }, Dt = {
|
|
434
|
+
InternalLink: Et
|
|
435
|
+
}, Pt = { 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" } }, Ct = {
|
|
436
|
+
InternalLink: Pt
|
|
437
|
+
}, Y = { en: Dt, fr: Ct };
|
|
438
|
+
function Q(t) {
|
|
439
|
+
const e = P(() => {
|
|
440
|
+
const i = t(), l = i in Y ? i : "en";
|
|
441
|
+
return Lt(Y[l]);
|
|
457
442
|
});
|
|
458
|
-
return { t:
|
|
443
|
+
return { t: St(e) };
|
|
459
444
|
}
|
|
460
|
-
function
|
|
445
|
+
function z(t) {
|
|
461
446
|
return t.varName ? ` for '${t.varName}'` : "";
|
|
462
447
|
}
|
|
463
|
-
function
|
|
448
|
+
function tt(t, e = {}) {
|
|
464
449
|
if (t instanceof Date)
|
|
465
450
|
return t;
|
|
466
451
|
if (t == null || t === "")
|
|
467
|
-
throw new Error(`Missing number value${
|
|
452
|
+
throw new Error(`Missing number value${z(e)}`);
|
|
468
453
|
if (typeof t == "string") {
|
|
469
454
|
const n = t.includes("Z") || t.includes("+");
|
|
470
455
|
return new Date(n ? t : `${t}Z`);
|
|
471
456
|
}
|
|
472
457
|
if (typeof t == "number")
|
|
473
458
|
return new Date(t);
|
|
474
|
-
throw new Error(`Cannot convert to date the value of type '${typeof t}'${
|
|
459
|
+
throw new Error(`Cannot convert to date the value of type '${typeof t}'${z(e)}`);
|
|
475
460
|
}
|
|
476
|
-
var
|
|
477
|
-
function
|
|
461
|
+
var At = /* @__PURE__ */ y("<div class=ILResult>"), Tt = /* @__PURE__ */ y('<div class=ILNoResult><span class=ILNoResult-message></span><span class="pi pi-exclamation-circle">'), xt = /* @__PURE__ */ y("<div class=InternalLinkEditor><form class=ILForm><input class=InternalLinkEditor-input type=text placeholder=Search>"), Nt = /* @__PURE__ */ y("<div class=ILResultItem><div class=ILResultItem-title></div><span>");
|
|
462
|
+
function dt(t) {
|
|
478
463
|
const {
|
|
479
464
|
value: e,
|
|
480
465
|
setValue: n,
|
|
481
466
|
service: i
|
|
482
467
|
} = t, [l, r] = S(""), [o, s] = S([]), {
|
|
483
468
|
t: u
|
|
484
|
-
} =
|
|
485
|
-
|
|
469
|
+
} = Q(t.language);
|
|
470
|
+
G(async () => {
|
|
486
471
|
const f = e();
|
|
487
472
|
if (!f) return;
|
|
488
473
|
const h = await i.getDocument(f);
|
|
@@ -496,39 +481,39 @@ function ft(t) {
|
|
|
496
481
|
s(h);
|
|
497
482
|
};
|
|
498
483
|
return (() => {
|
|
499
|
-
var f =
|
|
500
|
-
return h.addEventListener("submit", $), m.$$input = (c) => r(c.currentTarget.value), p(f,
|
|
484
|
+
var f = xt(), h = f.firstChild, m = h.firstChild;
|
|
485
|
+
return h.addEventListener("submit", $), m.$$input = (c) => r(c.currentTarget.value), p(f, x(W, {
|
|
501
486
|
when: o,
|
|
502
487
|
get children() {
|
|
503
|
-
var c =
|
|
488
|
+
var c = At();
|
|
504
489
|
return p(c, () => o().map((a) => (
|
|
505
490
|
// biome-ignore lint/correctness/useJsxKeyInIterable: no need key here
|
|
506
491
|
(() => {
|
|
507
|
-
var d =
|
|
492
|
+
var d = Nt(), g = d.firstChild, v = g.nextSibling;
|
|
508
493
|
return d.$$click = () => {
|
|
509
494
|
n(a.id);
|
|
510
|
-
}, p(g, () => a.title), p(
|
|
511
|
-
var
|
|
512
|
-
return () =>
|
|
513
|
-
})()),
|
|
514
|
-
${a.ready ?
|
|
495
|
+
}, p(g, () => a.title), p(v, (() => {
|
|
496
|
+
var _ = L(() => !!a.ready);
|
|
497
|
+
return () => _() ? L(() => tt(a.publishDate).getTime() < (/* @__PURE__ */ new Date()).getTime())() ? u("InternalLink.editor.published") : u("InternalLink.editor.sheduled") : u("InternalLink.editor.draft");
|
|
498
|
+
})()), C(() => _t(v, `ILResultItem-status
|
|
499
|
+
${a.ready ? tt(a.publishDate).getTime() < (/* @__PURE__ */ new Date()).getTime() ? "published" : "sheduled" : "draft"}`)), d;
|
|
515
500
|
})()
|
|
516
501
|
))), c;
|
|
517
502
|
}
|
|
518
|
-
}), null), p(f,
|
|
503
|
+
}), null), p(f, x(W, {
|
|
519
504
|
get when() {
|
|
520
505
|
return !o() || o().length === 0;
|
|
521
506
|
},
|
|
522
507
|
get children() {
|
|
523
|
-
var c =
|
|
508
|
+
var c = Tt(), a = c.firstChild;
|
|
524
509
|
return p(a, () => u("InternalLink.editor.noResult")), c;
|
|
525
510
|
}
|
|
526
|
-
}), null),
|
|
511
|
+
}), null), C(() => m.value = l()), f;
|
|
527
512
|
})();
|
|
528
513
|
}
|
|
529
|
-
|
|
530
|
-
var
|
|
531
|
-
function
|
|
514
|
+
K(["input", "click"]);
|
|
515
|
+
var Bt = /* @__PURE__ */ y("<div class=InternalLinkDialog-header><span class=InternalLinkDialog-title>"), Ot = /* @__PURE__ */ y('<button class="PlgBtn pi pi-arrow-left"type=button>'), Vt = /* @__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>'), et = /* @__PURE__ */ y("<div>"), Mt = /* @__PURE__ */ y('<div><button class="PlgBtn primary"type=button>'), jt = /* @__PURE__ */ y('<button type=button class="PlgBtn danger outlined">'), nt = /* @__PURE__ */ y("<button class=PlgBtn type=button>"), Ut = /* @__PURE__ */ y('<button class="PlgBtn primary"type=button>'), Ht = /* @__PURE__ */ y('<div class=InternalLinkDialog-linkPreview><div></div><button class="PlgBtn iconBtn pi pi-pencil"type=button>');
|
|
516
|
+
function Ft({
|
|
532
517
|
service: t,
|
|
533
518
|
setValue: e,
|
|
534
519
|
value: n,
|
|
@@ -536,8 +521,8 @@ function Ht({
|
|
|
536
521
|
}) {
|
|
537
522
|
const {
|
|
538
523
|
t: l
|
|
539
|
-
} =
|
|
540
|
-
|
|
524
|
+
} = Q(i), [r, o] = S(), [s, u] = S(!!n());
|
|
525
|
+
G(async () => {
|
|
541
526
|
const c = n();
|
|
542
527
|
if (!c) return;
|
|
543
528
|
const a = await t.getDocument(c);
|
|
@@ -552,27 +537,27 @@ function Ht({
|
|
|
552
537
|
});
|
|
553
538
|
});
|
|
554
539
|
const $ = (() => {
|
|
555
|
-
var c =
|
|
540
|
+
var c = Bt(), a = c.firstChild;
|
|
556
541
|
return p(c, (() => {
|
|
557
|
-
var d =
|
|
542
|
+
var d = L(() => !!(n() && !s()));
|
|
558
543
|
return () => d() && (() => {
|
|
559
|
-
var g =
|
|
544
|
+
var g = Ot();
|
|
560
545
|
return g.$$click = () => {
|
|
561
546
|
u(!0);
|
|
562
547
|
}, g;
|
|
563
548
|
})();
|
|
564
549
|
})(), a), p(a, () => l("InternalLink.dialog.title")), c;
|
|
565
550
|
})(), f = (() => {
|
|
566
|
-
var c =
|
|
551
|
+
var c = Vt();
|
|
567
552
|
return p(c, (() => {
|
|
568
|
-
var a =
|
|
553
|
+
var a = L(() => !!(s() && n()));
|
|
569
554
|
return () => a() ? (() => {
|
|
570
|
-
var d =
|
|
571
|
-
return p(g, () => r()?.title),
|
|
572
|
-
const
|
|
573
|
-
!
|
|
555
|
+
var d = Rt(), g = d.firstChild, v = g.nextSibling;
|
|
556
|
+
return p(g, () => r()?.title), v.$$click = () => {
|
|
557
|
+
const _ = n(), Z = r()?.typeName;
|
|
558
|
+
!_ || !Z || (m.close(), t.openDocumentEdition(_, Z));
|
|
574
559
|
}, d;
|
|
575
|
-
})() :
|
|
560
|
+
})() : x(dt, {
|
|
576
561
|
service: t,
|
|
577
562
|
language: i,
|
|
578
563
|
value: n,
|
|
@@ -582,27 +567,27 @@ function Ht({
|
|
|
582
567
|
});
|
|
583
568
|
})()), c;
|
|
584
569
|
})(), h = (() => {
|
|
585
|
-
var c =
|
|
570
|
+
var c = et();
|
|
586
571
|
return p(c, (() => {
|
|
587
|
-
var a =
|
|
572
|
+
var a = L(() => !!s());
|
|
588
573
|
return () => a() ? (() => {
|
|
589
|
-
var d =
|
|
574
|
+
var d = Mt(), g = d.firstChild;
|
|
590
575
|
return p(d, (() => {
|
|
591
|
-
var
|
|
592
|
-
return () =>
|
|
593
|
-
var
|
|
594
|
-
return
|
|
576
|
+
var v = L(() => !!n());
|
|
577
|
+
return () => v() && [(() => {
|
|
578
|
+
var _ = jt();
|
|
579
|
+
return _.$$click = () => {
|
|
595
580
|
e(void 0), m.hide();
|
|
596
|
-
}, p(
|
|
581
|
+
}, p(_, () => l("InternalLink.dialog.removeLink")), _;
|
|
597
582
|
})(), (() => {
|
|
598
|
-
var
|
|
599
|
-
return
|
|
583
|
+
var _ = nt();
|
|
584
|
+
return _.$$click = () => u(!1), p(_, () => l("InternalLink.dialog.changeLink")), _;
|
|
600
585
|
})()];
|
|
601
586
|
})(), g), g.$$click = () => {
|
|
602
587
|
m.hide();
|
|
603
588
|
}, p(g, () => l("InternalLink.dialog.ok")), d;
|
|
604
589
|
})() : (() => {
|
|
605
|
-
var d =
|
|
590
|
+
var d = Ut();
|
|
606
591
|
return d.$$click = () => {
|
|
607
592
|
m.hide();
|
|
608
593
|
}, p(d, () => l("InternalLink.dialog.ok")), d;
|
|
@@ -614,30 +599,30 @@ function Ht({
|
|
|
614
599
|
header: $
|
|
615
600
|
});
|
|
616
601
|
return (() => {
|
|
617
|
-
var c =
|
|
602
|
+
var c = et();
|
|
618
603
|
return p(c, (() => {
|
|
619
|
-
var a =
|
|
604
|
+
var a = L(() => !!n());
|
|
620
605
|
return () => a() ? (() => {
|
|
621
|
-
var d =
|
|
622
|
-
return p(g, () => r()?.title),
|
|
606
|
+
var d = Ht(), g = d.firstChild, v = g.nextSibling;
|
|
607
|
+
return p(g, () => r()?.title), v.$$click = () => m.show(), d;
|
|
623
608
|
})() : (() => {
|
|
624
|
-
var d =
|
|
609
|
+
var d = nt();
|
|
625
610
|
return d.$$click = () => m.show(), p(d, () => l("InternalLink.insertLink")), d;
|
|
626
611
|
})();
|
|
627
612
|
})()), c;
|
|
628
613
|
})();
|
|
629
614
|
}
|
|
630
|
-
|
|
631
|
-
var
|
|
632
|
-
async function
|
|
615
|
+
K(["click"]);
|
|
616
|
+
var Gt = /* @__PURE__ */ y("<div class=InternalLinkDialog-header><span class=InternalLinkDialog-title>"), qt = /* @__PURE__ */ y('<button class="PlgBtn pi pi-arrow-left"type=button>'), Kt = /* @__PURE__ */ y("<div>"), Qt = /* @__PURE__ */ y('<div><button class="PlgBtn primary"type=button>'), Zt = /* @__PURE__ */ y('<button type=button class="PlgBtn danger outlined">'), Wt = /* @__PURE__ */ y("<button class=PlgBtn type=button>"), Xt = /* @__PURE__ */ y('<button class="PlgBtn primary"type=button>'), Jt = /* @__PURE__ */ y("<div class=InternalLinkDialog-content>"), Yt = /* @__PURE__ */ y('<div class=ILPreview><div class=ILPreview-title></div><button class="PlgBtn outlined iconBtn pi pi-pencil"type=button>');
|
|
617
|
+
async function zt({
|
|
633
618
|
value: t,
|
|
634
619
|
getLanguage: e,
|
|
635
620
|
service: n
|
|
636
621
|
}) {
|
|
637
622
|
const [i, l] = S(), {
|
|
638
623
|
t: r
|
|
639
|
-
} =
|
|
640
|
-
|
|
624
|
+
} = Q(e), [o, s] = S(!!t());
|
|
625
|
+
G(async () => {
|
|
641
626
|
const h = t();
|
|
642
627
|
if (!h) return;
|
|
643
628
|
const m = await n.getDocument(h);
|
|
@@ -652,49 +637,49 @@ async function Yt({
|
|
|
652
637
|
});
|
|
653
638
|
});
|
|
654
639
|
const u = (() => {
|
|
655
|
-
var h =
|
|
640
|
+
var h = Gt(), m = h.firstChild;
|
|
656
641
|
return p(h, (() => {
|
|
657
|
-
var c =
|
|
642
|
+
var c = L(() => !!(t() && !o()));
|
|
658
643
|
return () => c() && (() => {
|
|
659
|
-
var a =
|
|
644
|
+
var a = qt();
|
|
660
645
|
return a.$$click = () => {
|
|
661
646
|
s(!0);
|
|
662
647
|
}, a;
|
|
663
648
|
})();
|
|
664
649
|
})(), m), p(m, () => r("InternalLink.dialog.title")), h;
|
|
665
650
|
})(), $ = (() => {
|
|
666
|
-
var h =
|
|
651
|
+
var h = Kt();
|
|
667
652
|
return p(h, (() => {
|
|
668
|
-
var m =
|
|
653
|
+
var m = L(() => !!o());
|
|
669
654
|
return () => m() ? (() => {
|
|
670
|
-
var c =
|
|
655
|
+
var c = Qt(), a = c.firstChild;
|
|
671
656
|
return p(c, (() => {
|
|
672
|
-
var d =
|
|
657
|
+
var d = L(() => !!t());
|
|
673
658
|
return () => d() && [(() => {
|
|
674
|
-
var g =
|
|
659
|
+
var g = Zt();
|
|
675
660
|
return g.$$click = () => f.close("remove"), p(g, () => r("InternalLink.dialog.removeLink")), g;
|
|
676
661
|
})(), (() => {
|
|
677
|
-
var g =
|
|
662
|
+
var g = Wt();
|
|
678
663
|
return g.$$click = () => s(!1), p(g, () => r("InternalLink.dialog.changeLink")), g;
|
|
679
664
|
})()];
|
|
680
665
|
})(), a), a.$$click = () => f.close(), p(a, () => r("InternalLink.dialog.ok")), c;
|
|
681
666
|
})() : (() => {
|
|
682
|
-
var c =
|
|
667
|
+
var c = Xt();
|
|
683
668
|
return c.$$click = () => f.close(), p(c, () => r("InternalLink.dialog.ok")), c;
|
|
684
669
|
})();
|
|
685
670
|
})()), h;
|
|
686
671
|
})(), f = n.createModalDialog({
|
|
687
672
|
content: (() => {
|
|
688
|
-
var h =
|
|
673
|
+
var h = Jt();
|
|
689
674
|
return p(h, (() => {
|
|
690
|
-
var m =
|
|
675
|
+
var m = L(() => !!(o() && t()));
|
|
691
676
|
return () => m() ? (() => {
|
|
692
|
-
var c =
|
|
677
|
+
var c = Yt(), a = c.firstChild, d = a.nextSibling;
|
|
693
678
|
return p(a, () => i()?.title), d.$$click = () => {
|
|
694
|
-
const g = t(),
|
|
695
|
-
!g || !
|
|
679
|
+
const g = t(), v = i()?.typeName;
|
|
680
|
+
!g || !v || (f.close(), n.openDocumentEdition(g, v));
|
|
696
681
|
}, c;
|
|
697
|
-
})() :
|
|
682
|
+
})() : x(dt, {
|
|
698
683
|
service: n,
|
|
699
684
|
language: e,
|
|
700
685
|
value: t,
|
|
@@ -707,23 +692,23 @@ async function Yt({
|
|
|
707
692
|
});
|
|
708
693
|
return await f.open();
|
|
709
694
|
}
|
|
710
|
-
|
|
711
|
-
const
|
|
712
|
-
create:
|
|
713
|
-
init:
|
|
695
|
+
K(["click"]);
|
|
696
|
+
const le = {
|
|
697
|
+
create: ie,
|
|
698
|
+
init: ne
|
|
714
699
|
};
|
|
715
|
-
function
|
|
700
|
+
function te(t) {
|
|
716
701
|
t.executeHook("htmlEditorServiceProvider").forEach((n) => {
|
|
717
|
-
n.registerInternalLinkPlugin(
|
|
702
|
+
n.registerInternalLinkPlugin(ee(t));
|
|
718
703
|
});
|
|
719
704
|
}
|
|
720
|
-
function
|
|
705
|
+
function ee(t) {
|
|
721
706
|
return {
|
|
722
707
|
async getDocumentTitle(e) {
|
|
723
708
|
return (await t.getDocument(e))?.title;
|
|
724
709
|
},
|
|
725
710
|
async openDialog(e, n) {
|
|
726
|
-
const i = await
|
|
711
|
+
const i = await zt({
|
|
727
712
|
value: () => e,
|
|
728
713
|
getLanguage: n.getLanguage,
|
|
729
714
|
service: t
|
|
@@ -740,14 +725,14 @@ function te(t) {
|
|
|
740
725
|
}
|
|
741
726
|
};
|
|
742
727
|
}
|
|
743
|
-
function
|
|
728
|
+
function ne({
|
|
744
729
|
pluginBaseUrl: t,
|
|
745
730
|
addAfterInitListener: e
|
|
746
731
|
}) {
|
|
747
|
-
const n = `${t}/
|
|
748
|
-
i.rel = "stylesheet", i.href = n, document.head.appendChild(i), e(
|
|
732
|
+
const n = `${t}/internal-link.css`, i = document.createElement("link");
|
|
733
|
+
i.rel = "stylesheet", i.href = n, document.head.appendChild(i), e(te);
|
|
749
734
|
}
|
|
750
|
-
function
|
|
735
|
+
function ie(t) {
|
|
751
736
|
const {
|
|
752
737
|
fieldType: e,
|
|
753
738
|
initialValue: n
|
|
@@ -756,10 +741,10 @@ function ne(t) {
|
|
|
756
741
|
throw new Error(`field type '${e.name}' is incompatible with internal-link plugin, needs data type 'string'`);
|
|
757
742
|
if (n !== void 0 && typeof n != "string")
|
|
758
743
|
throw new Error(`field type '${e.name}' is incompatible, should be a string, got '${typeof n}'`);
|
|
759
|
-
return
|
|
744
|
+
return gt((i) => {
|
|
760
745
|
const [l, r] = S(n ?? ""), [o, s] = S(t.language);
|
|
761
746
|
return {
|
|
762
|
-
element:
|
|
747
|
+
element: x(Ft, {
|
|
763
748
|
language: o,
|
|
764
749
|
value: l,
|
|
765
750
|
setValue: (u) => {
|
|
@@ -777,5 +762,5 @@ function ne(t) {
|
|
|
777
762
|
});
|
|
778
763
|
}
|
|
779
764
|
export {
|
|
780
|
-
|
|
765
|
+
le as default
|
|
781
766
|
};
|
package/backend/dist/plugin.js
CHANGED
|
@@ -9,7 +9,7 @@ const plugin = {
|
|
|
9
9
|
version,
|
|
10
10
|
siteInit(service) {
|
|
11
11
|
service.registerSiteSchemaLibrary(join(packageDir, "site-schema-lib"));
|
|
12
|
-
service.
|
|
12
|
+
service.setAdminUiAssetsDirectory(join(packageDir, "admin-ui-plugin", "dist"));
|
|
13
13
|
},
|
|
14
14
|
};
|
|
15
15
|
export default plugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paroicms/internal-link-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Internal link plugin for ParoiCMS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"paroicms",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"author": "Paroi Team",
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"scripts": {
|
|
19
|
-
"dev:
|
|
20
|
-
"build:
|
|
21
|
-
"build": "npm run build:backend && npm run build:
|
|
19
|
+
"dev:admin-ui": "(cd admin-ui-plugin && vite)",
|
|
20
|
+
"build:admin-ui:watch": "(cd admin-ui-plugin && vite build --watch)",
|
|
21
|
+
"build": "npm run build:backend && npm run build:admin-ui",
|
|
22
22
|
"build:backend": "(cd backend && tsc)",
|
|
23
|
-
"build:
|
|
23
|
+
"build:admin-ui": "(cd admin-ui-plugin && tsc && vite build)"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@paroi/data-formatters-lib": "~0.4.0"
|
|
@@ -30,27 +30,26 @@
|
|
|
30
30
|
"@paroicms/public-server-lib": "0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@paroicms/public-anywhere-lib": "0.
|
|
34
|
-
"@paroicms/public-
|
|
35
|
-
"@paroicms/public-server-lib": "0.
|
|
36
|
-
"@paroicms/quill-editor-plugin": "1.
|
|
37
|
-
"@solid-primitives/i18n": "~2.2.
|
|
38
|
-
"@types/node": "~
|
|
33
|
+
"@paroicms/public-anywhere-lib": "0.24.0",
|
|
34
|
+
"@paroicms/public-admin-ui-lib": "0.25.0",
|
|
35
|
+
"@paroicms/public-server-lib": "0.36.0",
|
|
36
|
+
"@paroicms/quill-editor-plugin": "1.35.0",
|
|
37
|
+
"@solid-primitives/i18n": "~2.2.1",
|
|
38
|
+
"@types/node": "~24.0.1",
|
|
39
39
|
"primeicons": "^7.0.0",
|
|
40
40
|
"rimraf": "~6.0.1",
|
|
41
|
-
"sass": "~1.
|
|
42
|
-
"solid-devtools": "~0.
|
|
43
|
-
"solid-js": "1.9.
|
|
44
|
-
"sortablejs": "^1.15.2",
|
|
41
|
+
"sass": "~1.89.2",
|
|
42
|
+
"solid-devtools": "~0.34.0",
|
|
43
|
+
"solid-js": "1.9.7",
|
|
45
44
|
"typescript": "~5.8.3",
|
|
46
|
-
"vite": "~6.
|
|
45
|
+
"vite": "~6.3.5",
|
|
47
46
|
"vite-plugin-solid": "~2.11.6"
|
|
48
47
|
},
|
|
49
48
|
"type": "module",
|
|
50
49
|
"main": "backend/dist/plugin.js",
|
|
51
50
|
"files": [
|
|
52
51
|
"backend/dist",
|
|
53
|
-
"
|
|
52
|
+
"admin-ui-plugin/dist",
|
|
54
53
|
"site-schema-lib"
|
|
55
54
|
]
|
|
56
55
|
}
|
|
File without changes
|