@apolitical/component-library 5.3.7-SW.0 → 5.3.7-jc.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/index.js +16 -16
- package/index.mjs +295 -295
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -283,7 +283,7 @@ function Bh() {
|
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
var O = v.ReactCurrentDispatcher, q;
|
|
286
|
-
function
|
|
286
|
+
function X(M, ae, fe) {
|
|
287
287
|
{
|
|
288
288
|
if (q === void 0)
|
|
289
289
|
try {
|
|
@@ -296,16 +296,16 @@ function Bh() {
|
|
|
296
296
|
` + q + M;
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
var U = !1,
|
|
299
|
+
var U = !1, Q;
|
|
300
300
|
{
|
|
301
301
|
var ce = typeof WeakMap == "function" ? WeakMap : Map;
|
|
302
|
-
|
|
302
|
+
Q = new ce();
|
|
303
303
|
}
|
|
304
304
|
function G(M, ae) {
|
|
305
305
|
if (!M || U)
|
|
306
306
|
return "";
|
|
307
307
|
{
|
|
308
|
-
var fe =
|
|
308
|
+
var fe = Q.get(M);
|
|
309
309
|
if (fe !== void 0)
|
|
310
310
|
return fe;
|
|
311
311
|
}
|
|
@@ -360,7 +360,7 @@ function Bh() {
|
|
|
360
360
|
if (tt--, at--, at < 0 || Pe[tt] !== pt[at]) {
|
|
361
361
|
var jt = `
|
|
362
362
|
` + Pe[tt].replace(" at new ", " at ");
|
|
363
|
-
return M.displayName && jt.includes("<anonymous>") && (jt = jt.replace("<anonymous>", M.displayName)), typeof M == "function" &&
|
|
363
|
+
return M.displayName && jt.includes("<anonymous>") && (jt = jt.replace("<anonymous>", M.displayName)), typeof M == "function" && Q.set(M, jt), jt;
|
|
364
364
|
}
|
|
365
365
|
while (tt >= 1 && at >= 0);
|
|
366
366
|
break;
|
|
@@ -369,8 +369,8 @@ function Bh() {
|
|
|
369
369
|
} finally {
|
|
370
370
|
U = !1, O.current = Ve, N(), Error.prepareStackTrace = $e;
|
|
371
371
|
}
|
|
372
|
-
var Hn = M ? M.displayName || M.name : "", Vo = Hn ?
|
|
373
|
-
return typeof M == "function" &&
|
|
372
|
+
var Hn = M ? M.displayName || M.name : "", Vo = Hn ? X(Hn) : "";
|
|
373
|
+
return typeof M == "function" && Q.set(M, Vo), Vo;
|
|
374
374
|
}
|
|
375
375
|
function ve(M, ae, fe) {
|
|
376
376
|
return G(M, !1);
|
|
@@ -385,12 +385,12 @@ function Bh() {
|
|
|
385
385
|
if (typeof M == "function")
|
|
386
386
|
return G(M, xe(M));
|
|
387
387
|
if (typeof M == "string")
|
|
388
|
-
return
|
|
388
|
+
return X(M);
|
|
389
389
|
switch (M) {
|
|
390
390
|
case u:
|
|
391
|
-
return
|
|
391
|
+
return X("Suspense");
|
|
392
392
|
case d:
|
|
393
|
-
return
|
|
393
|
+
return X("SuspenseList");
|
|
394
394
|
}
|
|
395
395
|
if (typeof M == "object")
|
|
396
396
|
switch (M.$$typeof) {
|
|
@@ -3242,19 +3242,19 @@ function Mm() {
|
|
|
3242
3242
|
function q(G) {
|
|
3243
3243
|
return B(G) === p;
|
|
3244
3244
|
}
|
|
3245
|
-
function
|
|
3245
|
+
function X(G) {
|
|
3246
3246
|
return B(G) === n;
|
|
3247
3247
|
}
|
|
3248
3248
|
function U(G) {
|
|
3249
3249
|
return B(G) === a;
|
|
3250
3250
|
}
|
|
3251
|
-
function
|
|
3251
|
+
function Q(G) {
|
|
3252
3252
|
return B(G) === i;
|
|
3253
3253
|
}
|
|
3254
3254
|
function ce(G) {
|
|
3255
3255
|
return B(G) === h;
|
|
3256
3256
|
}
|
|
3257
|
-
qe.AsyncMode = x, qe.ConcurrentMode = C, qe.ContextConsumer = S, qe.ContextProvider = I, qe.Element = P, qe.ForwardRef = L, qe.Fragment = $, qe.Lazy = A, qe.Memo = _, qe.Portal = T, qe.Profiler = j, qe.StrictMode = V, qe.Suspense = W, qe.isAsyncMode = ne, qe.isConcurrentMode = D, qe.isContextConsumer = z, qe.isContextProvider = re, qe.isElement = F, qe.isForwardRef = k, qe.isFragment = N, qe.isLazy = O, qe.isMemo = q, qe.isPortal =
|
|
3257
|
+
qe.AsyncMode = x, qe.ConcurrentMode = C, qe.ContextConsumer = S, qe.ContextProvider = I, qe.Element = P, qe.ForwardRef = L, qe.Fragment = $, qe.Lazy = A, qe.Memo = _, qe.Portal = T, qe.Profiler = j, qe.StrictMode = V, qe.Suspense = W, qe.isAsyncMode = ne, qe.isConcurrentMode = D, qe.isContextConsumer = z, qe.isContextProvider = re, qe.isElement = F, qe.isForwardRef = k, qe.isFragment = N, qe.isLazy = O, qe.isMemo = q, qe.isPortal = X, qe.isProfiler = U, qe.isStrictMode = Q, qe.isSuspense = ce, qe.isValidElementType = E, qe.typeOf = B;
|
|
3258
3258
|
}()), qe;
|
|
3259
3259
|
}
|
|
3260
3260
|
var cu;
|
|
@@ -3431,33 +3431,33 @@ function Im() {
|
|
|
3431
3431
|
function b(D) {
|
|
3432
3432
|
if (process.env.NODE_ENV !== "production")
|
|
3433
3433
|
var z = {}, re = 0;
|
|
3434
|
-
function F(N, O, q,
|
|
3435
|
-
if (
|
|
3434
|
+
function F(N, O, q, X, U, Q, ce) {
|
|
3435
|
+
if (X = X || m, Q = Q || q, ce !== n) {
|
|
3436
3436
|
if (l) {
|
|
3437
3437
|
var G = new Error(
|
|
3438
3438
|
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
3439
3439
|
);
|
|
3440
3440
|
throw G.name = "Invariant Violation", G;
|
|
3441
3441
|
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
|
|
3442
|
-
var ve =
|
|
3442
|
+
var ve = X + ":" + q;
|
|
3443
3443
|
!z[ve] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
3444
3444
|
re < 3 && (a(
|
|
3445
|
-
"You are manually calling a React.PropTypes validation function for the `" +
|
|
3445
|
+
"You are manually calling a React.PropTypes validation function for the `" + Q + "` prop on `" + X + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
3446
3446
|
), z[ve] = !0, re++);
|
|
3447
3447
|
}
|
|
3448
3448
|
}
|
|
3449
|
-
return O[q] == null ? N ? O[q] === null ? new f("The " + U + " `" +
|
|
3449
|
+
return O[q] == null ? N ? O[q] === null ? new f("The " + U + " `" + Q + "` is marked as required " + ("in `" + X + "`, but its value is `null`.")) : new f("The " + U + " `" + Q + "` is marked as required in " + ("`" + X + "`, but its value is `undefined`.")) : null : D(O, q, X, U, Q);
|
|
3450
3450
|
}
|
|
3451
3451
|
var k = F.bind(null, !1);
|
|
3452
3452
|
return k.isRequired = F.bind(null, !0), k;
|
|
3453
3453
|
}
|
|
3454
3454
|
function v(D) {
|
|
3455
3455
|
function z(re, F, k, N, O, q) {
|
|
3456
|
-
var
|
|
3456
|
+
var X = re[F], U = V(X);
|
|
3457
3457
|
if (U !== D) {
|
|
3458
|
-
var
|
|
3458
|
+
var Q = W(X);
|
|
3459
3459
|
return new f(
|
|
3460
|
-
"Invalid " + N + " `" + O + "` of type " + ("`" +
|
|
3460
|
+
"Invalid " + N + " `" + O + "` of type " + ("`" + Q + "` supplied to `" + k + "`, expected ") + ("`" + D + "`."),
|
|
3461
3461
|
{ expectedType: D }
|
|
3462
3462
|
);
|
|
3463
3463
|
}
|
|
@@ -3474,13 +3474,13 @@ function Im() {
|
|
|
3474
3474
|
return new f("Property `" + O + "` of component `" + k + "` has invalid PropType notation inside arrayOf.");
|
|
3475
3475
|
var q = re[F];
|
|
3476
3476
|
if (!Array.isArray(q)) {
|
|
3477
|
-
var
|
|
3478
|
-
return new f("Invalid " + N + " `" + O + "` of type " + ("`" +
|
|
3477
|
+
var X = V(q);
|
|
3478
|
+
return new f("Invalid " + N + " `" + O + "` of type " + ("`" + X + "` supplied to `" + k + "`, expected an array."));
|
|
3479
3479
|
}
|
|
3480
3480
|
for (var U = 0; U < q.length; U++) {
|
|
3481
|
-
var
|
|
3482
|
-
if (
|
|
3483
|
-
return
|
|
3481
|
+
var Q = D(q, U, k, N, O + "[" + U + "]", n);
|
|
3482
|
+
if (Q instanceof Error)
|
|
3483
|
+
return Q;
|
|
3484
3484
|
}
|
|
3485
3485
|
return null;
|
|
3486
3486
|
}
|
|
@@ -3511,8 +3511,8 @@ function Im() {
|
|
|
3511
3511
|
function C(D) {
|
|
3512
3512
|
function z(re, F, k, N, O) {
|
|
3513
3513
|
if (!(re[F] instanceof D)) {
|
|
3514
|
-
var q = D.name || m,
|
|
3515
|
-
return new f("Invalid " + N + " `" + O + "` of type " + ("`" +
|
|
3514
|
+
var q = D.name || m, X = ne(re[F]);
|
|
3515
|
+
return new f("Invalid " + N + " `" + O + "` of type " + ("`" + X + "` supplied to `" + k + "`, expected ") + ("instance of `" + q + "`."));
|
|
3516
3516
|
}
|
|
3517
3517
|
return null;
|
|
3518
3518
|
}
|
|
@@ -3524,8 +3524,8 @@ function Im() {
|
|
|
3524
3524
|
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
3525
3525
|
) : a("Invalid argument supplied to oneOf, expected an array.")), s;
|
|
3526
3526
|
function z(re, F, k, N, O) {
|
|
3527
|
-
for (var q = re[F],
|
|
3528
|
-
if (g(q, D[
|
|
3527
|
+
for (var q = re[F], X = 0; X < D.length; X++)
|
|
3528
|
+
if (g(q, D[X]))
|
|
3529
3529
|
return null;
|
|
3530
3530
|
var U = JSON.stringify(D, function(ce, G) {
|
|
3531
3531
|
var ve = W(G);
|
|
@@ -3539,14 +3539,14 @@ function Im() {
|
|
|
3539
3539
|
function z(re, F, k, N, O) {
|
|
3540
3540
|
if (typeof D != "function")
|
|
3541
3541
|
return new f("Property `" + O + "` of component `" + k + "` has invalid PropType notation inside objectOf.");
|
|
3542
|
-
var q = re[F],
|
|
3543
|
-
if (
|
|
3544
|
-
return new f("Invalid " + N + " `" + O + "` of type " + ("`" +
|
|
3542
|
+
var q = re[F], X = V(q);
|
|
3543
|
+
if (X !== "object")
|
|
3544
|
+
return new f("Invalid " + N + " `" + O + "` of type " + ("`" + X + "` supplied to `" + k + "`, expected an object."));
|
|
3545
3545
|
for (var U in q)
|
|
3546
3546
|
if (r(q, U)) {
|
|
3547
|
-
var
|
|
3548
|
-
if (
|
|
3549
|
-
return
|
|
3547
|
+
var Q = D(q, U, k, N, O + "." + U, n);
|
|
3548
|
+
if (Q instanceof Error)
|
|
3549
|
+
return Q;
|
|
3550
3550
|
}
|
|
3551
3551
|
return null;
|
|
3552
3552
|
}
|
|
@@ -3562,15 +3562,15 @@ function Im() {
|
|
|
3562
3562
|
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + ie(re) + " at index " + z + "."
|
|
3563
3563
|
), s;
|
|
3564
3564
|
}
|
|
3565
|
-
function F(k, N, O, q,
|
|
3566
|
-
for (var U = [],
|
|
3567
|
-
var ce = D[
|
|
3565
|
+
function F(k, N, O, q, X) {
|
|
3566
|
+
for (var U = [], Q = 0; Q < D.length; Q++) {
|
|
3567
|
+
var ce = D[Q], G = ce(k, N, O, q, X, n);
|
|
3568
3568
|
if (G == null)
|
|
3569
3569
|
return null;
|
|
3570
3570
|
G.data && r(G.data, "expectedType") && U.push(G.data.expectedType);
|
|
3571
3571
|
}
|
|
3572
3572
|
var ve = U.length > 0 ? ", expected one of type [" + U.join(", ") + "]" : "";
|
|
3573
|
-
return new f("Invalid " + q + " `" +
|
|
3573
|
+
return new f("Invalid " + q + " `" + X + "` supplied to " + ("`" + O + "`" + ve + "."));
|
|
3574
3574
|
}
|
|
3575
3575
|
return b(F);
|
|
3576
3576
|
}
|
|
@@ -3587,14 +3587,14 @@ function Im() {
|
|
|
3587
3587
|
}
|
|
3588
3588
|
function A(D) {
|
|
3589
3589
|
function z(re, F, k, N, O) {
|
|
3590
|
-
var q = re[F],
|
|
3591
|
-
if (
|
|
3592
|
-
return new f("Invalid " + N + " `" + O + "` of type `" +
|
|
3590
|
+
var q = re[F], X = V(q);
|
|
3591
|
+
if (X !== "object")
|
|
3592
|
+
return new f("Invalid " + N + " `" + O + "` of type `" + X + "` " + ("supplied to `" + k + "`, expected `object`."));
|
|
3593
3593
|
for (var U in D) {
|
|
3594
|
-
var
|
|
3595
|
-
if (typeof
|
|
3596
|
-
return $(k, N, O, U, W(
|
|
3597
|
-
var ce =
|
|
3594
|
+
var Q = D[U];
|
|
3595
|
+
if (typeof Q != "function")
|
|
3596
|
+
return $(k, N, O, U, W(Q));
|
|
3597
|
+
var ce = Q(q, U, k, N, O + "." + U, n);
|
|
3598
3598
|
if (ce)
|
|
3599
3599
|
return ce;
|
|
3600
3600
|
}
|
|
@@ -3604,20 +3604,20 @@ function Im() {
|
|
|
3604
3604
|
}
|
|
3605
3605
|
function _(D) {
|
|
3606
3606
|
function z(re, F, k, N, O) {
|
|
3607
|
-
var q = re[F],
|
|
3608
|
-
if (
|
|
3609
|
-
return new f("Invalid " + N + " `" + O + "` of type `" +
|
|
3607
|
+
var q = re[F], X = V(q);
|
|
3608
|
+
if (X !== "object")
|
|
3609
|
+
return new f("Invalid " + N + " `" + O + "` of type `" + X + "` " + ("supplied to `" + k + "`, expected `object`."));
|
|
3610
3610
|
var U = t({}, re[F], D);
|
|
3611
|
-
for (var
|
|
3612
|
-
var ce = D[
|
|
3613
|
-
if (r(D,
|
|
3614
|
-
return $(k, N, O,
|
|
3611
|
+
for (var Q in U) {
|
|
3612
|
+
var ce = D[Q];
|
|
3613
|
+
if (r(D, Q) && typeof ce != "function")
|
|
3614
|
+
return $(k, N, O, Q, W(ce));
|
|
3615
3615
|
if (!ce)
|
|
3616
3616
|
return new f(
|
|
3617
|
-
"Invalid " + N + " `" + O + "` key `" +
|
|
3617
|
+
"Invalid " + N + " `" + O + "` key `" + Q + "` supplied to `" + k + "`.\nBad object: " + JSON.stringify(re[F], null, " ") + `
|
|
3618
3618
|
Valid keys: ` + JSON.stringify(Object.keys(D), null, " ")
|
|
3619
3619
|
);
|
|
3620
|
-
var G = ce(q,
|
|
3620
|
+
var G = ce(q, Q, k, N, O + "." + Q, n);
|
|
3621
3621
|
if (G)
|
|
3622
3622
|
return G;
|
|
3623
3623
|
}
|
|
@@ -6541,8 +6541,8 @@ const Ln = ({
|
|
|
6541
6541
|
return;
|
|
6542
6542
|
let N = 0;
|
|
6543
6543
|
if ((q = ne == null ? void 0 : ne.current) != null && q.id) {
|
|
6544
|
-
const
|
|
6545
|
-
|
|
6544
|
+
const X = document.getElementById(ne.current.id);
|
|
6545
|
+
X && (N = X.getBoundingClientRect().top + window.scrollY);
|
|
6546
6546
|
}
|
|
6547
6547
|
const O = document.getElementById("header");
|
|
6548
6548
|
O && (N = N - O.offsetHeight - b), N < 0 && (N = 0), window.scrollTo({ top: N, behavior: "smooth" }), z();
|
|
@@ -6588,27 +6588,27 @@ const Ln = ({
|
|
|
6588
6588
|
const {
|
|
6589
6589
|
id: O = k.name || N,
|
|
6590
6590
|
component: q,
|
|
6591
|
-
functions:
|
|
6591
|
+
functions: X = { onChange: () => {
|
|
6592
6592
|
} },
|
|
6593
6593
|
submitOnEnter: U = !1
|
|
6594
6594
|
} = k;
|
|
6595
6595
|
if (q)
|
|
6596
6596
|
return /* @__PURE__ */ c.jsx(q, { ...k.props || {} }, `component-${O}-${N}`);
|
|
6597
|
-
const
|
|
6598
|
-
...
|
|
6597
|
+
const Q = (W == null ? void 0 : W[O]) || "", ce = {
|
|
6598
|
+
...X,
|
|
6599
6599
|
onChange: (G) => {
|
|
6600
|
-
_({ type: "updateValue", payload: { key: O, value: G } }),
|
|
6600
|
+
_({ type: "updateValue", payload: { key: O, value: G } }), X.onChange(G && G.toString(), _);
|
|
6601
6601
|
}
|
|
6602
6602
|
};
|
|
6603
6603
|
return U && (ce.onKeyDown = (G) => {
|
|
6604
|
-
G.key === "Enter" && (G.stopPropagation(), G.preventDefault(), z()),
|
|
6604
|
+
G.key === "Enter" && (G.stopPropagation(), G.preventDefault(), z()), X.onKeyDown && X.onKeyDown(G);
|
|
6605
6605
|
}), /* @__PURE__ */ c.jsx(
|
|
6606
6606
|
Jp,
|
|
6607
6607
|
{
|
|
6608
6608
|
intlPath: a,
|
|
6609
6609
|
...k,
|
|
6610
6610
|
showRequiredLabels: B,
|
|
6611
|
-
value:
|
|
6611
|
+
value: Q,
|
|
6612
6612
|
error: T == null ? void 0 : T[O],
|
|
6613
6613
|
functions: ce
|
|
6614
6614
|
},
|
|
@@ -8223,11 +8223,11 @@ var Ug = (e, t, n) => {
|
|
|
8223
8223
|
t[F] = k;
|
|
8224
8224
|
else {
|
|
8225
8225
|
var N = void 0, O = void 0;
|
|
8226
|
-
for (var [q,
|
|
8227
|
-
if (R.compare(
|
|
8228
|
-
N = [q,
|
|
8226
|
+
for (var [q, X] of oe.texts(e))
|
|
8227
|
+
if (R.compare(X, ne) === -1)
|
|
8228
|
+
N = [q, X];
|
|
8229
8229
|
else {
|
|
8230
|
-
O = [q,
|
|
8230
|
+
O = [q, X];
|
|
8231
8231
|
break;
|
|
8232
8232
|
}
|
|
8233
8233
|
var U = !1;
|
|
@@ -8238,13 +8238,13 @@ var Ug = (e, t, n) => {
|
|
|
8238
8238
|
}
|
|
8239
8239
|
case "remove_text": {
|
|
8240
8240
|
var {
|
|
8241
|
-
path:
|
|
8241
|
+
path: Q,
|
|
8242
8242
|
offset: ce,
|
|
8243
8243
|
text: G
|
|
8244
8244
|
} = n;
|
|
8245
8245
|
if (G.length === 0)
|
|
8246
8246
|
break;
|
|
8247
|
-
var ve = oe.leaf(e,
|
|
8247
|
+
var ve = oe.leaf(e, Q), xe = ve.text.slice(0, ce), Fe = ve.text.slice(ce + G.length);
|
|
8248
8248
|
if (ve.text = xe + Fe, t)
|
|
8249
8249
|
for (var [Ne, Se] of Y.points(t))
|
|
8250
8250
|
t[Se] = Be.transform(Ne, n);
|
|
@@ -9392,12 +9392,12 @@ var Cv = /(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u2
|
|
|
9392
9392
|
}))
|
|
9393
9393
|
return;
|
|
9394
9394
|
var s = Y.start(i), o = y.pointRef(e, s), l = y.pointRef(e, a);
|
|
9395
|
-
|
|
9395
|
+
J.delete(e, {
|
|
9396
9396
|
at: i,
|
|
9397
9397
|
voids: r
|
|
9398
9398
|
});
|
|
9399
9399
|
var u = o.unref(), d = l.unref();
|
|
9400
|
-
i = u || d,
|
|
9400
|
+
i = u || d, J.setSelection(e, {
|
|
9401
9401
|
anchor: i,
|
|
9402
9402
|
focus: i
|
|
9403
9403
|
});
|
|
@@ -9442,7 +9442,7 @@ function fi(e) {
|
|
|
9442
9442
|
}
|
|
9443
9443
|
return e;
|
|
9444
9444
|
}
|
|
9445
|
-
var
|
|
9445
|
+
var J = fi(fi(fi(fi({}, Hg), Vg), Kg), kv), Ai = /* @__PURE__ */ new WeakMap(), Fv = (e) => Ai.get(e) || !1, Av = (e, t, n) => {
|
|
9446
9446
|
var r = Ai.get(e) || !1;
|
|
9447
9447
|
Ai.set(e, !0);
|
|
9448
9448
|
try {
|
|
@@ -9481,7 +9481,7 @@ var Bv = (e, t) => {
|
|
|
9481
9481
|
var a = R.operationCanTransformPath(t) ? (s) => R.transform(s, t) : void 0;
|
|
9482
9482
|
Nd(e, e.getDirtyPaths(t), a);
|
|
9483
9483
|
}
|
|
9484
|
-
|
|
9484
|
+
J.transform(e, t), e.operations.push(t), y.normalize(e, {
|
|
9485
9485
|
operation: t
|
|
9486
9486
|
}), t.type === "set_selection" && (e.marks = null), Or.get(e) || (Or.set(e, !0), Promise.resolve().then(() => {
|
|
9487
9487
|
Or.set(e, !1), e.onChange({
|
|
@@ -9560,7 +9560,7 @@ var Bv = (e, t) => {
|
|
|
9560
9560
|
var i = {
|
|
9561
9561
|
text: ""
|
|
9562
9562
|
};
|
|
9563
|
-
|
|
9563
|
+
J.insertNodes(e, i, {
|
|
9564
9564
|
at: r.concat(0),
|
|
9565
9565
|
voids: !0
|
|
9566
9566
|
});
|
|
@@ -9571,7 +9571,7 @@ var Bv = (e, t) => {
|
|
|
9571
9571
|
if (!me.isText(l)) {
|
|
9572
9572
|
var u = l.children[s], d = l.children[s - 1], h = o === n.children.length - 1, m = me.isText(u) || he.isElement(u) && e.isInline(u);
|
|
9573
9573
|
if (m !== a)
|
|
9574
|
-
|
|
9574
|
+
J.removeNodes(e, {
|
|
9575
9575
|
at: r.concat(s),
|
|
9576
9576
|
voids: !0
|
|
9577
9577
|
}), s--;
|
|
@@ -9581,7 +9581,7 @@ var Bv = (e, t) => {
|
|
|
9581
9581
|
var p = {
|
|
9582
9582
|
text: ""
|
|
9583
9583
|
};
|
|
9584
|
-
|
|
9584
|
+
J.insertNodes(e, p, {
|
|
9585
9585
|
at: r.concat(s),
|
|
9586
9586
|
voids: !0
|
|
9587
9587
|
}), s++;
|
|
@@ -9589,7 +9589,7 @@ var Bv = (e, t) => {
|
|
|
9589
9589
|
var g = {
|
|
9590
9590
|
text: ""
|
|
9591
9591
|
};
|
|
9592
|
-
|
|
9592
|
+
J.insertNodes(e, g, {
|
|
9593
9593
|
at: r.concat(s + 1),
|
|
9594
9594
|
voids: !0
|
|
9595
9595
|
}), s++;
|
|
@@ -9598,13 +9598,13 @@ var Bv = (e, t) => {
|
|
|
9598
9598
|
} else
|
|
9599
9599
|
d != null && me.isText(d) && (me.equals(u, d, {
|
|
9600
9600
|
loose: !0
|
|
9601
|
-
}) ? (
|
|
9601
|
+
}) ? (J.mergeNodes(e, {
|
|
9602
9602
|
at: r.concat(s),
|
|
9603
9603
|
voids: !0
|
|
9604
|
-
}), s--) : d.text === "" ? (
|
|
9604
|
+
}), s--) : d.text === "" ? (J.removeNodes(e, {
|
|
9605
9605
|
at: r.concat(s - 1),
|
|
9606
9606
|
voids: !0
|
|
9607
|
-
}), s--) : u.text === "" && (
|
|
9607
|
+
}), s--) : u.text === "" && (J.removeNodes(e, {
|
|
9608
9608
|
at: r.concat(s),
|
|
9609
9609
|
voids: !0
|
|
9610
9610
|
}), s--));
|
|
@@ -9683,7 +9683,7 @@ var Nv = (e, t, n) => {
|
|
|
9683
9683
|
}
|
|
9684
9684
|
}
|
|
9685
9685
|
if (a || s)
|
|
9686
|
-
|
|
9686
|
+
J.setNodes(e, {
|
|
9687
9687
|
[t]: n
|
|
9688
9688
|
}, {
|
|
9689
9689
|
match: i,
|
|
@@ -9780,7 +9780,7 @@ var Rv = function(t, n) {
|
|
|
9780
9780
|
var {
|
|
9781
9781
|
selection: n
|
|
9782
9782
|
} = e;
|
|
9783
|
-
n && Y.isCollapsed(n) &&
|
|
9783
|
+
n && Y.isCollapsed(n) && J.delete(e, {
|
|
9784
9784
|
unit: t,
|
|
9785
9785
|
reverse: !0
|
|
9786
9786
|
});
|
|
@@ -9788,7 +9788,7 @@ var Rv = function(t, n) {
|
|
|
9788
9788
|
var {
|
|
9789
9789
|
selection: n
|
|
9790
9790
|
} = e;
|
|
9791
|
-
n && Y.isCollapsed(n) &&
|
|
9791
|
+
n && Y.isCollapsed(n) && J.delete(e, {
|
|
9792
9792
|
unit: t
|
|
9793
9793
|
});
|
|
9794
9794
|
}, Lv = function(t) {
|
|
@@ -9797,7 +9797,7 @@ var Rv = function(t, n) {
|
|
|
9797
9797
|
} = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, {
|
|
9798
9798
|
selection: r
|
|
9799
9799
|
} = t;
|
|
9800
|
-
r && Y.isExpanded(r) &&
|
|
9800
|
+
r && Y.isExpanded(r) && J.delete(t, {
|
|
9801
9801
|
reverse: n === "backward"
|
|
9802
9802
|
});
|
|
9803
9803
|
}, zv = (e, t) => [y.start(e, t), y.end(e, t)];
|
|
@@ -9865,13 +9865,13 @@ var Vv = function(t) {
|
|
|
9865
9865
|
match: (r) => he.isElement(r) && y.isVoid(t, r)
|
|
9866
9866
|
}));
|
|
9867
9867
|
}, Kv = (e, t) => t.children.some((n) => he.isElement(n) && y.isBlock(e, n)), Zv = (e, t) => t.children.some((n) => me.isText(n) || y.isInline(e, n)), Yv = (e, t) => oe.has(e, t), Gv = (e, t) => t.children.every((n) => me.isText(n)), Qv = (e) => {
|
|
9868
|
-
|
|
9868
|
+
J.splitNodes(e, {
|
|
9869
9869
|
always: !0
|
|
9870
9870
|
});
|
|
9871
9871
|
}, Jv = (e, t, n) => {
|
|
9872
|
-
|
|
9872
|
+
J.insertNodes(e, t, n);
|
|
9873
9873
|
}, Xv = (e) => {
|
|
9874
|
-
|
|
9874
|
+
J.splitNodes(e, {
|
|
9875
9875
|
always: !0
|
|
9876
9876
|
});
|
|
9877
9877
|
};
|
|
@@ -9906,12 +9906,12 @@ var t0 = function(t, n) {
|
|
|
9906
9906
|
var s = e0({
|
|
9907
9907
|
text: n
|
|
9908
9908
|
}, a);
|
|
9909
|
-
|
|
9909
|
+
J.insertNodes(t, s, {
|
|
9910
9910
|
at: r.at,
|
|
9911
9911
|
voids: r.voids
|
|
9912
9912
|
});
|
|
9913
9913
|
} else
|
|
9914
|
-
|
|
9914
|
+
J.insertText(t, n, r);
|
|
9915
9915
|
t.marks = null;
|
|
9916
9916
|
}
|
|
9917
9917
|
}, n0 = (e, t) => !e.isInline(t), r0 = (e, t, n) => y.isStart(e, t, n) || y.isEnd(e, t, n), i0 = (e, t) => {
|
|
@@ -10385,7 +10385,7 @@ var S0 = (e, t) => {
|
|
|
10385
10385
|
}
|
|
10386
10386
|
}
|
|
10387
10387
|
if (i || a)
|
|
10388
|
-
|
|
10388
|
+
J.unsetNodes(e, t, {
|
|
10389
10389
|
match: r,
|
|
10390
10390
|
split: !0,
|
|
10391
10391
|
voids: !0
|
|
@@ -10491,7 +10491,7 @@ var S0 = (e, t) => {
|
|
|
10491
10491
|
}
|
|
10492
10492
|
}
|
|
10493
10493
|
if (R.isPath(u)) {
|
|
10494
|
-
|
|
10494
|
+
J.removeNodes(t, {
|
|
10495
10495
|
at: u,
|
|
10496
10496
|
voids: l
|
|
10497
10497
|
});
|
|
@@ -10558,27 +10558,27 @@ var S0 = (e, t) => {
|
|
|
10558
10558
|
text: N
|
|
10559
10559
|
}), D = N);
|
|
10560
10560
|
}
|
|
10561
|
-
if (W.reverse().map((xe) => xe.unref()).filter((xe) => xe !== null).forEach((xe) =>
|
|
10561
|
+
if (W.reverse().map((xe) => xe.unref()).filter((xe) => xe !== null).forEach((xe) => J.removeNodes(t, {
|
|
10562
10562
|
at: xe,
|
|
10563
10563
|
voids: l
|
|
10564
10564
|
})), !P) {
|
|
10565
10565
|
var O = ne.current, [q] = y.leaf(t, O), {
|
|
10566
|
-
path:
|
|
10567
|
-
} = O, U = S ? w.offset : 0,
|
|
10568
|
-
|
|
10566
|
+
path: X
|
|
10567
|
+
} = O, U = S ? w.offset : 0, Q = q.text.slice(U, E.offset);
|
|
10568
|
+
Q.length > 0 && (t.apply({
|
|
10569
10569
|
type: "remove_text",
|
|
10570
|
-
path:
|
|
10570
|
+
path: X,
|
|
10571
10571
|
offset: U,
|
|
10572
|
-
text:
|
|
10573
|
-
}), D =
|
|
10572
|
+
text: Q
|
|
10573
|
+
}), D = Q);
|
|
10574
10574
|
}
|
|
10575
|
-
!S && C && ne.current && ie.current &&
|
|
10575
|
+
!S && C && ne.current && ie.current && J.mergeNodes(t, {
|
|
10576
10576
|
at: ne.current,
|
|
10577
10577
|
hanging: !0,
|
|
10578
10578
|
voids: l
|
|
10579
|
-
}), h && a && s === "character" && D.length > 1 && D.match(/[\u0E00-\u0E7F]+/) &&
|
|
10579
|
+
}), h && a && s === "character" && D.length > 1 && D.match(/[\u0E00-\u0E7F]+/) && J.insertText(t, D.slice(0, D.length - o));
|
|
10580
10580
|
var ce = ie.unref(), G = ne.unref(), ve = a ? ce || G : G || ce;
|
|
10581
|
-
n.at == null && ve &&
|
|
10581
|
+
n.at == null && ve && J.select(t, ve);
|
|
10582
10582
|
}
|
|
10583
10583
|
}
|
|
10584
10584
|
});
|
|
@@ -10605,7 +10605,7 @@ var S0 = (e, t) => {
|
|
|
10605
10605
|
}))
|
|
10606
10606
|
return;
|
|
10607
10607
|
var u = y.pointRef(t, l);
|
|
10608
|
-
|
|
10608
|
+
J.delete(t, {
|
|
10609
10609
|
at: s
|
|
10610
10610
|
}), s = u.unref();
|
|
10611
10611
|
}
|
|
@@ -10639,8 +10639,8 @@ var S0 = (e, t) => {
|
|
|
10639
10639
|
}, []), [, C] = oe.last({
|
|
10640
10640
|
children: n
|
|
10641
10641
|
}, []), S = [], I = (N) => {
|
|
10642
|
-
var [O, q] = N,
|
|
10643
|
-
return
|
|
10642
|
+
var [O, q] = N, X = q.length === 0;
|
|
10643
|
+
return X ? !1 : w ? !0 : !(E && R.isAncestor(q, x) && he.isElement(O) && !t.isVoid(O) && !t.isInline(O) || B && R.isAncestor(q, C) && he.isElement(O) && !t.isVoid(O) && !t.isInline(O));
|
|
10644
10644
|
};
|
|
10645
10645
|
for (var P of oe.nodes({
|
|
10646
10646
|
children: n
|
|
@@ -10657,7 +10657,7 @@ var S0 = (e, t) => {
|
|
|
10657
10657
|
mode: "highest",
|
|
10658
10658
|
voids: a
|
|
10659
10659
|
}), [, W] = V, ie = y.isStart(t, s, W), ne = y.isEnd(t, s, W), D = y.pathRef(t, v && !A.length ? R.next(f) : f), z = y.pathRef(t, ne ? R.next(W) : W);
|
|
10660
|
-
|
|
10660
|
+
J.splitNodes(t, {
|
|
10661
10661
|
at: s,
|
|
10662
10662
|
match: (N) => T ? he.isElement(N) && y.isBlock(t, N) : me.isText(N) || y.isInline(t, N),
|
|
10663
10663
|
mode: T ? "lowest" : "highest",
|
|
@@ -10665,22 +10665,22 @@ var S0 = (e, t) => {
|
|
|
10665
10665
|
voids: a
|
|
10666
10666
|
});
|
|
10667
10667
|
var re = y.pathRef(t, !ie || ie && ne ? R.next(W) : W);
|
|
10668
|
-
if (
|
|
10668
|
+
if (J.insertNodes(t, L, {
|
|
10669
10669
|
at: re.current,
|
|
10670
10670
|
match: (N) => me.isText(N) || y.isInline(t, N),
|
|
10671
10671
|
mode: "highest",
|
|
10672
10672
|
voids: a,
|
|
10673
10673
|
batchDirty: o
|
|
10674
|
-
}), w && !L.length && $.length && !A.length &&
|
|
10674
|
+
}), w && !L.length && $.length && !A.length && J.delete(t, {
|
|
10675
10675
|
at: f,
|
|
10676
10676
|
voids: a
|
|
10677
|
-
}),
|
|
10677
|
+
}), J.insertNodes(t, $, {
|
|
10678
10678
|
at: D.current,
|
|
10679
10679
|
match: (N) => he.isElement(N) && y.isBlock(t, N),
|
|
10680
10680
|
mode: "lowest",
|
|
10681
10681
|
voids: a,
|
|
10682
10682
|
batchDirty: o
|
|
10683
|
-
}),
|
|
10683
|
+
}), J.insertNodes(t, A, {
|
|
10684
10684
|
at: z.current,
|
|
10685
10685
|
match: (N) => me.isText(N) || y.isInline(t, N),
|
|
10686
10686
|
mode: "highest",
|
|
@@ -10690,7 +10690,7 @@ var S0 = (e, t) => {
|
|
|
10690
10690
|
var F;
|
|
10691
10691
|
if (A.length > 0 && z.current ? F = R.previous(z.current) : $.length > 0 && D.current ? F = R.previous(D.current) : re.current && (F = R.previous(re.current)), F) {
|
|
10692
10692
|
var k = y.end(t, F);
|
|
10693
|
-
|
|
10693
|
+
J.select(t, k);
|
|
10694
10694
|
}
|
|
10695
10695
|
}
|
|
10696
10696
|
re.unref(), D.unref(), z.unref();
|
|
@@ -10705,15 +10705,15 @@ var S0 = (e, t) => {
|
|
|
10705
10705
|
} = t;
|
|
10706
10706
|
if (i) {
|
|
10707
10707
|
if (r === "anchor")
|
|
10708
|
-
|
|
10708
|
+
J.select(t, i.anchor);
|
|
10709
10709
|
else if (r === "focus")
|
|
10710
|
-
|
|
10710
|
+
J.select(t, i.focus);
|
|
10711
10711
|
else if (r === "start") {
|
|
10712
10712
|
var [a] = Y.edges(i);
|
|
10713
|
-
|
|
10713
|
+
J.select(t, a);
|
|
10714
10714
|
} else if (r === "end") {
|
|
10715
10715
|
var [, s] = Y.edges(i);
|
|
10716
|
-
|
|
10716
|
+
J.select(t, s);
|
|
10717
10717
|
}
|
|
10718
10718
|
} else
|
|
10719
10719
|
return;
|
|
@@ -10754,14 +10754,14 @@ var S0 = (e, t) => {
|
|
|
10754
10754
|
var p = s ? y.before(t, u, d) : y.after(t, u, d);
|
|
10755
10755
|
p && (h.focus = p);
|
|
10756
10756
|
}
|
|
10757
|
-
|
|
10757
|
+
J.setSelection(t, h);
|
|
10758
10758
|
}
|
|
10759
10759
|
}, q0 = (e, t) => {
|
|
10760
10760
|
var {
|
|
10761
10761
|
selection: n
|
|
10762
10762
|
} = e;
|
|
10763
10763
|
if (t = y.range(e, t), n) {
|
|
10764
|
-
|
|
10764
|
+
J.setSelection(e, t);
|
|
10765
10765
|
return;
|
|
10766
10766
|
}
|
|
10767
10767
|
if (!Y.isRange(t))
|
|
@@ -10805,7 +10805,7 @@ var W0 = function(t, n) {
|
|
|
10805
10805
|
anchor: s,
|
|
10806
10806
|
focus: o
|
|
10807
10807
|
} = i, l = a === "anchor" ? s : o;
|
|
10808
|
-
|
|
10808
|
+
J.setSelection(t, {
|
|
10809
10809
|
[a === "anchor" ? "anchor" : "focus"]: ll(ll({}, l), n)
|
|
10810
10810
|
});
|
|
10811
10811
|
}
|
|
@@ -10844,7 +10844,7 @@ var W0 = function(t, n) {
|
|
|
10844
10844
|
l = l.anchor;
|
|
10845
10845
|
else {
|
|
10846
10846
|
var [, m] = Y.edges(l), p = y.pointRef(t, m);
|
|
10847
|
-
|
|
10847
|
+
J.delete(t, {
|
|
10848
10848
|
at: l
|
|
10849
10849
|
}), l = p.unref();
|
|
10850
10850
|
}
|
|
@@ -10858,7 +10858,7 @@ var W0 = function(t, n) {
|
|
|
10858
10858
|
});
|
|
10859
10859
|
if (g) {
|
|
10860
10860
|
var [, f] = g, b = y.pathRef(t, f), v = y.isEnd(t, l, f);
|
|
10861
|
-
|
|
10861
|
+
J.splitNodes(t, {
|
|
10862
10862
|
at: l,
|
|
10863
10863
|
match: u,
|
|
10864
10864
|
mode: s,
|
|
@@ -10911,7 +10911,7 @@ var W0 = function(t, n) {
|
|
|
10911
10911
|
}
|
|
10912
10912
|
if (l = R.previous(l), d) {
|
|
10913
10913
|
var P = y.end(t, l);
|
|
10914
|
-
P &&
|
|
10914
|
+
P && J.select(t, P);
|
|
10915
10915
|
}
|
|
10916
10916
|
}
|
|
10917
10917
|
}
|
|
@@ -10945,33 +10945,33 @@ var W0 = function(t, n) {
|
|
|
10945
10945
|
} = m.children;
|
|
10946
10946
|
if (f === 1) {
|
|
10947
10947
|
var b = R.next(p);
|
|
10948
|
-
|
|
10948
|
+
J.moveNodes(t, {
|
|
10949
10949
|
at: d,
|
|
10950
10950
|
to: b,
|
|
10951
10951
|
voids: a
|
|
10952
|
-
}),
|
|
10952
|
+
}), J.removeNodes(t, {
|
|
10953
10953
|
at: p,
|
|
10954
10954
|
voids: a
|
|
10955
10955
|
});
|
|
10956
10956
|
} else if (g === 0)
|
|
10957
|
-
|
|
10957
|
+
J.moveNodes(t, {
|
|
10958
10958
|
at: d,
|
|
10959
10959
|
to: p,
|
|
10960
10960
|
voids: a
|
|
10961
10961
|
});
|
|
10962
10962
|
else if (g === f - 1) {
|
|
10963
10963
|
var v = R.next(p);
|
|
10964
|
-
|
|
10964
|
+
J.moveNodes(t, {
|
|
10965
10965
|
at: d,
|
|
10966
10966
|
to: v,
|
|
10967
10967
|
voids: a
|
|
10968
10968
|
});
|
|
10969
10969
|
} else {
|
|
10970
10970
|
var w = R.next(d), E = R.next(p);
|
|
10971
|
-
|
|
10971
|
+
J.splitNodes(t, {
|
|
10972
10972
|
at: w,
|
|
10973
10973
|
voids: a
|
|
10974
|
-
}),
|
|
10974
|
+
}), J.moveNodes(t, {
|
|
10975
10975
|
at: d,
|
|
10976
10976
|
to: E,
|
|
10977
10977
|
voids: a
|
|
@@ -11011,9 +11011,9 @@ var W0 = function(t, n) {
|
|
|
11011
11011
|
i = i.anchor;
|
|
11012
11012
|
else {
|
|
11013
11013
|
var [, u] = Y.edges(i), d = y.pointRef(t, u);
|
|
11014
|
-
|
|
11014
|
+
J.delete(t, {
|
|
11015
11015
|
at: i
|
|
11016
|
-
}), i = d.unref(), n.at == null &&
|
|
11016
|
+
}), i = d.unref(), n.at == null && J.select(t, i);
|
|
11017
11017
|
}
|
|
11018
11018
|
var [h] = y.nodes(t, {
|
|
11019
11019
|
at: i,
|
|
@@ -11047,14 +11047,14 @@ var W0 = function(t, n) {
|
|
|
11047
11047
|
I = f.children.length, S = P;
|
|
11048
11048
|
} else
|
|
11049
11049
|
throw new Error("Cannot merge the node at path [".concat(g, "] with the previous sibling because it is not the same kind: ").concat(ot.stringify(p), " ").concat(ot.stringify(f)));
|
|
11050
|
-
E ||
|
|
11050
|
+
E || J.moveNodes(t, {
|
|
11051
11051
|
at: g,
|
|
11052
11052
|
to: v,
|
|
11053
11053
|
voids: s
|
|
11054
|
-
}), C &&
|
|
11054
|
+
}), C && J.removeNodes(t, {
|
|
11055
11055
|
at: C.current,
|
|
11056
11056
|
voids: s
|
|
11057
|
-
}), he.isElement(f) && y.isEmpty(t, f) || me.isText(f) && f.text === "" && b[b.length - 1] !== 0 ?
|
|
11057
|
+
}), he.isElement(f) && y.isEmpty(t, f) || me.isText(f) && f.text === "" && b[b.length - 1] !== 0 ? J.removeNodes(t, {
|
|
11058
11058
|
at: b,
|
|
11059
11059
|
voids: s
|
|
11060
11060
|
}) : t.apply({
|
|
@@ -11159,7 +11159,7 @@ var W0 = function(t, n) {
|
|
|
11159
11159
|
var m = y.rangeRef(t, a, {
|
|
11160
11160
|
affinity: "inward"
|
|
11161
11161
|
}), [p, g] = Y.edges(a), f = u === "lowest" ? "lowest" : "highest", b = y.isEnd(t, g, g.path);
|
|
11162
|
-
|
|
11162
|
+
J.splitNodes(t, {
|
|
11163
11163
|
at: g,
|
|
11164
11164
|
match: i,
|
|
11165
11165
|
mode: f,
|
|
@@ -11167,13 +11167,13 @@ var W0 = function(t, n) {
|
|
|
11167
11167
|
always: !b
|
|
11168
11168
|
});
|
|
11169
11169
|
var v = y.isStart(t, p, p.path);
|
|
11170
|
-
|
|
11170
|
+
J.splitNodes(t, {
|
|
11171
11171
|
at: p,
|
|
11172
11172
|
match: i,
|
|
11173
11173
|
mode: f,
|
|
11174
11174
|
voids: h,
|
|
11175
11175
|
always: !v
|
|
11176
|
-
}), a = m.unref(), r.at == null &&
|
|
11176
|
+
}), a = m.unref(), r.at == null && J.select(t, a);
|
|
11177
11177
|
}
|
|
11178
11178
|
s || (s = (I, P) => I !== P);
|
|
11179
11179
|
for (var [w, E] of y.nodes(t, {
|
|
@@ -11201,7 +11201,7 @@ var W0 = function(t, n) {
|
|
|
11201
11201
|
if (Y.isCollapsed(t))
|
|
11202
11202
|
return t.anchor;
|
|
11203
11203
|
var [, n] = Y.edges(t), r = y.pointRef(e, n);
|
|
11204
|
-
return
|
|
11204
|
+
return J.delete(e, {
|
|
11205
11205
|
at: t
|
|
11206
11206
|
}), r.unref();
|
|
11207
11207
|
}, eb = function(t) {
|
|
@@ -11245,7 +11245,7 @@ var W0 = function(t, n) {
|
|
|
11245
11245
|
var B = {
|
|
11246
11246
|
text: ""
|
|
11247
11247
|
}, x = R.next(w);
|
|
11248
|
-
|
|
11248
|
+
J.insertNodes(t, B, {
|
|
11249
11249
|
at: x,
|
|
11250
11250
|
voids: i
|
|
11251
11251
|
}), E = y.point(t, x);
|
|
@@ -11280,7 +11280,7 @@ var W0 = function(t, n) {
|
|
|
11280
11280
|
}
|
|
11281
11281
|
if (n.at == null) {
|
|
11282
11282
|
var W = p.current || y.end(t, []);
|
|
11283
|
-
|
|
11283
|
+
J.select(t, W);
|
|
11284
11284
|
}
|
|
11285
11285
|
} finally {
|
|
11286
11286
|
var ie;
|
|
@@ -11294,7 +11294,7 @@ var W0 = function(t, n) {
|
|
|
11294
11294
|
var i = {};
|
|
11295
11295
|
for (var a of n)
|
|
11296
11296
|
i[a] = null;
|
|
11297
|
-
|
|
11297
|
+
J.setNodes(t, i, r);
|
|
11298
11298
|
}, nb = function(t) {
|
|
11299
11299
|
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
11300
11300
|
y.withoutNormalizing(t, () => {
|
|
@@ -11324,7 +11324,7 @@ var W0 = function(t, n) {
|
|
|
11324
11324
|
// that wrap target node. So we reverse the order.
|
|
11325
11325
|
).reverse(), h = function() {
|
|
11326
11326
|
var g = m.unref(), [f] = y.node(t, g), b = y.range(t, g);
|
|
11327
|
-
i && l && (b = Y.intersection(l.current, b)),
|
|
11327
|
+
i && l && (b = Y.intersection(l.current, b)), J.liftNodes(t, {
|
|
11328
11328
|
at: b,
|
|
11329
11329
|
match: (v) => he.isAncestor(f) && f.children.includes(v),
|
|
11330
11330
|
voids: a
|
|
@@ -11373,15 +11373,15 @@ var rb = function(t, n) {
|
|
|
11373
11373
|
var [u, d] = Y.edges(l), h = y.rangeRef(t, l, {
|
|
11374
11374
|
affinity: "inward"
|
|
11375
11375
|
});
|
|
11376
|
-
|
|
11376
|
+
J.splitNodes(t, {
|
|
11377
11377
|
at: d,
|
|
11378
11378
|
match: o,
|
|
11379
11379
|
voids: s
|
|
11380
|
-
}),
|
|
11380
|
+
}), J.splitNodes(t, {
|
|
11381
11381
|
at: u,
|
|
11382
11382
|
match: o,
|
|
11383
11383
|
voids: s
|
|
11384
|
-
}), l = h.unref(), r.at == null &&
|
|
11384
|
+
}), l = h.unref(), r.at == null && J.select(t, l);
|
|
11385
11385
|
}
|
|
11386
11386
|
var m = Array.from(y.nodes(t, {
|
|
11387
11387
|
at: l,
|
|
@@ -11405,10 +11405,10 @@ var rb = function(t, n) {
|
|
|
11405
11405
|
var S = R.equals(x, C) ? R.parent(x) : R.common(x, C), I = y.range(t, x, C), P = y.node(t, S), [L] = P, $ = S.length + 1, A = R.next(C.slice(0, $)), _ = dl(dl({}, n), {}, {
|
|
11406
11406
|
children: []
|
|
11407
11407
|
});
|
|
11408
|
-
|
|
11408
|
+
J.insertNodes(t, _, {
|
|
11409
11409
|
at: A,
|
|
11410
11410
|
voids: s
|
|
11411
|
-
}),
|
|
11411
|
+
}), J.moveNodes(t, {
|
|
11412
11412
|
at: I,
|
|
11413
11413
|
match: (T) => he.isAncestor(L) && L.children.includes(T),
|
|
11414
11414
|
to: A.concat(0),
|
|
@@ -11887,7 +11887,7 @@ var rb = function(t, n) {
|
|
|
11887
11887
|
} = r;
|
|
11888
11888
|
if (i.length > 0) {
|
|
11889
11889
|
var a = i[i.length - 1];
|
|
11890
|
-
a.selectionBefore &&
|
|
11890
|
+
a.selectionBefore && J.setSelection(t, a.selectionBefore), Xn.withoutSaving(t, () => {
|
|
11891
11891
|
y.withoutNormalizing(t, () => {
|
|
11892
11892
|
for (var s of a.operations)
|
|
11893
11893
|
t.apply(s);
|
|
@@ -11907,7 +11907,7 @@ var rb = function(t, n) {
|
|
|
11907
11907
|
var s = a.operations.map(vn.inverse).reverse();
|
|
11908
11908
|
for (var o of s)
|
|
11909
11909
|
t.apply(o);
|
|
11910
|
-
a.selectionBefore &&
|
|
11910
|
+
a.selectionBefore && J.setSelection(t, a.selectionBefore);
|
|
11911
11911
|
});
|
|
11912
11912
|
}), t.writeHistory("redos", a), r.undos.pop();
|
|
11913
11913
|
}
|
|
@@ -12108,17 +12108,17 @@ const vy = /* @__PURE__ */ Mn(gy), bl = (e) => typeof e == "object" && e != null
|
|
|
12108
12108
|
const W = p[V], { height: ie, width: ne, top: D, right: z, bottom: re, left: F } = W.getBoundingClientRect();
|
|
12109
12109
|
if (s === "if-needed" && x >= 0 && I >= 0 && S <= b && C <= f && x >= D && S <= re && I >= F && C <= z)
|
|
12110
12110
|
return j;
|
|
12111
|
-
const k = getComputedStyle(W), N = parseInt(k.borderLeftWidth, 10), O = parseInt(k.borderTopWidth, 10), q = parseInt(k.borderRightWidth, 10),
|
|
12112
|
-
let U = 0,
|
|
12113
|
-
const ce = "offsetWidth" in W ? W.offsetWidth - W.clientWidth - N - q : 0, G = "offsetHeight" in W ? W.offsetHeight - W.clientHeight - O -
|
|
12111
|
+
const k = getComputedStyle(W), N = parseInt(k.borderLeftWidth, 10), O = parseInt(k.borderTopWidth, 10), q = parseInt(k.borderRightWidth, 10), X = parseInt(k.borderBottomWidth, 10);
|
|
12112
|
+
let U = 0, Q = 0;
|
|
12113
|
+
const ce = "offsetWidth" in W ? W.offsetWidth - W.clientWidth - N - q : 0, G = "offsetHeight" in W ? W.offsetHeight - W.clientHeight - O - X : 0, ve = "offsetWidth" in W ? W.offsetWidth === 0 ? 0 : ne / W.offsetWidth : 0, xe = "offsetHeight" in W ? W.offsetHeight === 0 ? 0 : ie / W.offsetHeight : 0;
|
|
12114
12114
|
if (m === W)
|
|
12115
|
-
U = o === "start" ? _ : o === "end" ? _ - b : o === "nearest" ? hi(w, w + b, b, O,
|
|
12115
|
+
U = o === "start" ? _ : o === "end" ? _ - b : o === "nearest" ? hi(w, w + b, b, O, X, w + _, w + _ + E, E) : _ - b / 2, Q = l === "start" ? T : l === "center" ? T - f / 2 : l === "end" ? T - f : hi(v, v + f, f, N, q, v + T, v + T + B, B), U = Math.max(0, U + w), Q = Math.max(0, Q + v);
|
|
12116
12116
|
else {
|
|
12117
|
-
U = o === "start" ? _ - D - O : o === "end" ? _ - re +
|
|
12117
|
+
U = o === "start" ? _ - D - O : o === "end" ? _ - re + X + G : o === "nearest" ? hi(D, re, ie, O, X + G, _, _ + E, E) : _ - (D + ie / 2) + G / 2, Q = l === "start" ? T - F - N : l === "center" ? T - (F + ne / 2) + ce / 2 : l === "end" ? T - z + q + ce : hi(F, z, ne, N, q + ce, T, T + B, B);
|
|
12118
12118
|
const { scrollLeft: Fe, scrollTop: Ne } = W;
|
|
12119
|
-
U = xe === 0 ? 0 : Math.max(0, Math.min(Ne + U / xe, W.scrollHeight - ie / xe + G)),
|
|
12119
|
+
U = xe === 0 ? 0 : Math.max(0, Math.min(Ne + U / xe, W.scrollHeight - ie / xe + G)), Q = ve === 0 ? 0 : Math.max(0, Math.min(Fe + Q / ve, W.scrollWidth - ne / ve + ce)), _ += Ne - U, T += Fe - Q;
|
|
12120
12120
|
}
|
|
12121
|
-
j.push({ el: W, top: U, left:
|
|
12121
|
+
j.push({ el: W, top: U, left: Q });
|
|
12122
12122
|
}
|
|
12123
12123
|
return j;
|
|
12124
12124
|
}, yy = (e) => e === !1 ? { block: "end", inline: "nearest" } : ((t) => t === Object(t) && Object.keys(t).length !== 0)(e) ? e : { block: "start", inline: "nearest" };
|
|
@@ -12725,7 +12725,7 @@ var ee = {
|
|
|
12725
12725
|
var {
|
|
12726
12726
|
selection: t
|
|
12727
12727
|
} = e, n = ee.findDocumentOrShadowRoot(e), r = n.getSelection();
|
|
12728
|
-
r && r.rangeCount > 0 && r.removeAllRanges(), t &&
|
|
12728
|
+
r && r.rangeCount > 0 && r.removeAllRanges(), t && J.deselect(e);
|
|
12729
12729
|
},
|
|
12730
12730
|
findDocumentOrShadowRoot: (e) => {
|
|
12731
12731
|
var t = ee.toDOMNode(e, e), n = t.getRootNode();
|
|
@@ -12807,7 +12807,7 @@ var ee = {
|
|
|
12807
12807
|
var a = i.getSelection(), s = ee.toDOMRange(t, t.selection);
|
|
12808
12808
|
a == null || a.removeAllRanges(), a == null || a.addRange(s);
|
|
12809
12809
|
}
|
|
12810
|
-
t.selection || (
|
|
12810
|
+
t.selection || (J.select(t, y.start(t, [])), t.onChange()), bn.set(t, !0), r.focus({
|
|
12811
12811
|
preventScroll: !0
|
|
12812
12812
|
});
|
|
12813
12813
|
}
|
|
@@ -13340,7 +13340,7 @@ function w1(e) {
|
|
|
13340
13340
|
var {
|
|
13341
13341
|
selection: _
|
|
13342
13342
|
} = t, T = Sl(t, A);
|
|
13343
|
-
T && (!_ || !Y.equals(T, _)) &&
|
|
13343
|
+
T && (!_ || !Y.equals(T, _)) && J.select(t, T);
|
|
13344
13344
|
}
|
|
13345
13345
|
}, h = () => {
|
|
13346
13346
|
var A = mn.get(t);
|
|
@@ -13350,7 +13350,7 @@ function w1(e) {
|
|
|
13350
13350
|
if (!_)
|
|
13351
13351
|
return;
|
|
13352
13352
|
var T = y.range(t, _);
|
|
13353
|
-
(!t.selection || !Y.equals(t.selection, T)) &&
|
|
13353
|
+
(!t.selection || !Y.equals(t.selection, T)) && J.select(t, _);
|
|
13354
13354
|
}
|
|
13355
13355
|
A.run();
|
|
13356
13356
|
}
|
|
@@ -13368,7 +13368,7 @@ function w1(e) {
|
|
|
13368
13368
|
var j, V, W = It.get(t);
|
|
13369
13369
|
W !== void 0 && (It.delete(t), t.marks = W), W && u === !1 && (u = null);
|
|
13370
13370
|
var ie = g1(T);
|
|
13371
|
-
(!t.selection || !Y.equals(t.selection, ie)) &&
|
|
13371
|
+
(!t.selection || !Y.equals(t.selection, ie)) && J.select(t, ie), T.diff.text ? y.insertText(t, T.diff.text) : y.deleteFragment(t), Ct.set(t, (V = Ct.get(t)) === null || V === void 0 ? void 0 : V.filter((z) => {
|
|
13372
13372
|
var {
|
|
13373
13373
|
id: re
|
|
13374
13374
|
} = z;
|
|
@@ -13376,7 +13376,7 @@ function w1(e) {
|
|
|
13376
13376
|
})), f1(t, T) || (_ = !1, mn.delete(t), nn.delete(t), i = "action", pn.delete(t), n.cancel(), r.cancel(), A == null || A.unref());
|
|
13377
13377
|
}
|
|
13378
13378
|
var ne = A == null ? void 0 : A.unref();
|
|
13379
|
-
if (ne && !pn.get(t) && (!t.selection || !Y.equals(ne, t.selection)) &&
|
|
13379
|
+
if (ne && !pn.get(t) && (!t.selection || !Y.equals(ne, t.selection)) && J.select(t, ne), E()) {
|
|
13380
13380
|
h();
|
|
13381
13381
|
return;
|
|
13382
13382
|
}
|
|
@@ -13459,11 +13459,11 @@ function w1(e) {
|
|
|
13459
13459
|
});
|
|
13460
13460
|
}
|
|
13461
13461
|
}
|
|
13462
|
-
var N = T.endsWith("Backward") ? "backward" : "forward", [O, q] = Y.edges(j), [
|
|
13462
|
+
var N = T.endsWith("Backward") ? "backward" : "forward", [O, q] = Y.edges(j), [X, U] = y.leaf(t, O.path), Q = {
|
|
13463
13463
|
text: "",
|
|
13464
13464
|
start: O.offset,
|
|
13465
13465
|
end: q.offset
|
|
13466
|
-
}, ce = Ct.get(t), G = ce == null ? void 0 : ce.find((be) => R.equals(be.path, U)), ve = G ? [G.diff,
|
|
13466
|
+
}, ce = Ct.get(t), G = ce == null ? void 0 : ce.find((be) => R.equals(be.path, U)), ve = G ? [G.diff, Q] : [Q], xe = lf(X.text, ...ve);
|
|
13467
13467
|
if (xe.length === 0 && (D = !1), Y.isExpanded(j)) {
|
|
13468
13468
|
if (D && R.equals(j.anchor.path, j.focus.path)) {
|
|
13469
13469
|
var Fe = {
|
|
@@ -14263,21 +14263,21 @@ var ax = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, pf(e)), sx =
|
|
|
14263
14263
|
if ((bt || !ee.isComposing(f)) && (!P.isUpdatingSelection || k != null && k.isFlushing()) && !P.isDraggingInternally) {
|
|
14264
14264
|
var N = ee.findDocumentOrShadowRoot(f), {
|
|
14265
14265
|
activeElement: O
|
|
14266
|
-
} = N, q = ee.toDOMNode(f, f),
|
|
14267
|
-
if (O === q ? (P.latestElement = O, bn.set(f, !0)) : bn.delete(f), !
|
|
14268
|
-
return
|
|
14266
|
+
} = N, q = ee.toDOMNode(f, f), X = N.getSelection();
|
|
14267
|
+
if (O === q ? (P.latestElement = O, bn.set(f, !0)) : bn.delete(f), !X)
|
|
14268
|
+
return J.deselect(f);
|
|
14269
14269
|
var {
|
|
14270
14270
|
anchorNode: U,
|
|
14271
|
-
focusNode:
|
|
14272
|
-
} =
|
|
14271
|
+
focusNode: Q
|
|
14272
|
+
} = X, ce = ee.hasEditableTarget(f, U) || ee.isTargetInsideNonReadonlyVoid(f, U), G = ee.hasEditableTarget(f, Q) || ee.isTargetInsideNonReadonlyVoid(f, Q);
|
|
14273
14273
|
if (ce && G) {
|
|
14274
|
-
var ve = ee.toSlateRange(f,
|
|
14274
|
+
var ve = ee.toSlateRange(f, X, {
|
|
14275
14275
|
exactMatch: !1,
|
|
14276
14276
|
suppressThrow: !0
|
|
14277
14277
|
});
|
|
14278
|
-
ve && (!ee.isComposing(f) && !(k != null && k.hasPendingChanges()) && !(k != null && k.isFlushing()) ?
|
|
14278
|
+
ve && (!ee.isComposing(f) && !(k != null && k.hasPendingChanges()) && !(k != null && k.isFlushing()) ? J.select(f, ve) : k == null || k.handleUserSelect(ve));
|
|
14279
14279
|
}
|
|
14280
|
-
s && (!ce || !G) &&
|
|
14280
|
+
s && (!ce || !G) && J.deselect(f);
|
|
14281
14281
|
}
|
|
14282
14282
|
}, 100), [f, s, P]), A = Yt(() => dy($, 0), [$]);
|
|
14283
14283
|
L.current = A1({
|
|
@@ -14289,9 +14289,9 @@ var ax = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, pf(e)), sx =
|
|
|
14289
14289
|
w.current && (O = _o(w.current)) ? (nf.set(f, O), Si.set(f, w.current), Sn.set(f, w.current), Zr.set(w.current, f)) : Sn.delete(f);
|
|
14290
14290
|
var {
|
|
14291
14291
|
selection: q
|
|
14292
|
-
} = f,
|
|
14292
|
+
} = f, X = ee.findDocumentOrShadowRoot(f), U = X.getSelection();
|
|
14293
14293
|
if (!(!U || !ee.isFocused(f) || (k = L.current) !== null && k !== void 0 && k.hasPendingAction())) {
|
|
14294
|
-
var
|
|
14294
|
+
var Q = (xe) => {
|
|
14295
14295
|
var Fe = U.type !== "None";
|
|
14296
14296
|
if (!(!q && !Fe)) {
|
|
14297
14297
|
var Ne = U.focusNode, Se;
|
|
@@ -14326,7 +14326,7 @@ var ax = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, pf(e)), sx =
|
|
|
14326
14326
|
return je ? (ee.isComposing(f) && !bt ? U.collapseToEnd() : Y.isBackward(q) ? U.setBaseAndExtent(je.endContainer, je.endOffset, je.startContainer, je.startOffset) : U.setBaseAndExtent(je.startContainer, je.startOffset, je.endContainer, je.endOffset), d(f, je)) : U.removeAllRanges(), je;
|
|
14327
14327
|
}
|
|
14328
14328
|
};
|
|
14329
|
-
U.rangeCount <= 1 &&
|
|
14329
|
+
U.rangeCount <= 1 && Q();
|
|
14330
14330
|
var ce = ((N = L.current) === null || N === void 0 ? void 0 : N.isFlushing()) === "action";
|
|
14331
14331
|
if (!bt || !ce) {
|
|
14332
14332
|
setTimeout(() => {
|
|
@@ -14339,7 +14339,7 @@ var ax = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, pf(e)), sx =
|
|
|
14339
14339
|
var xe = (Fe) => {
|
|
14340
14340
|
try {
|
|
14341
14341
|
var Ne = ee.toDOMNode(f, f);
|
|
14342
|
-
Ne.focus(),
|
|
14342
|
+
Ne.focus(), Q(Fe);
|
|
14343
14343
|
} catch {
|
|
14344
14344
|
}
|
|
14345
14345
|
};
|
|
@@ -14363,10 +14363,10 @@ var ax = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, pf(e)), sx =
|
|
|
14363
14363
|
selection: O
|
|
14364
14364
|
} = f, {
|
|
14365
14365
|
inputType: q
|
|
14366
|
-
} = k,
|
|
14366
|
+
} = k, X = k.dataTransfer || k.data || void 0, U = q === "insertCompositionText" || q === "deleteCompositionText";
|
|
14367
14367
|
if (U && ee.isComposing(f))
|
|
14368
14368
|
return;
|
|
14369
|
-
var
|
|
14369
|
+
var Q = !1;
|
|
14370
14370
|
if (q === "insertText" && O && Y.isCollapsed(O) && // Only use native character insertion for single characters a-z or space for now.
|
|
14371
14371
|
// Long-press events (hold a + press 4 = ä) to choose a special character otherwise
|
|
14372
14372
|
// causes duplicate inserts.
|
|
@@ -14375,20 +14375,20 @@ var ax = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, pf(e)), sx =
|
|
|
14375
14375
|
// right after it (the start of the next node).
|
|
14376
14376
|
O.anchor.offset !== 0) {
|
|
14377
14377
|
var ce, G;
|
|
14378
|
-
|
|
14378
|
+
Q = !0, f.marks && (Q = !1);
|
|
14379
14379
|
var {
|
|
14380
14380
|
anchor: ve
|
|
14381
14381
|
} = O, [xe, Fe] = ee.toDOMPoint(f, ve), Ne = (ce = xe.parentElement) === null || ce === void 0 ? void 0 : ce.closest("a"), Se = ee.getWindow(f);
|
|
14382
|
-
if (
|
|
14382
|
+
if (Q && Ne && ee.hasDOMNode(f, Ne)) {
|
|
14383
14383
|
var We, Ge = Se == null ? void 0 : Se.document.createTreeWalker(Ne, NodeFilter.SHOW_TEXT).lastChild();
|
|
14384
|
-
Ge === xe && ((We = Ge.textContent) === null || We === void 0 ? void 0 : We.length) === Fe && (
|
|
14384
|
+
Ge === xe && ((We = Ge.textContent) === null || We === void 0 ? void 0 : We.length) === Fe && (Q = !1);
|
|
14385
14385
|
}
|
|
14386
|
-
if (
|
|
14386
|
+
if (Q && xe.parentElement && (Se == null || (G = Se.getComputedStyle(xe.parentElement)) === null || G === void 0 ? void 0 : G.whiteSpace) === "pre") {
|
|
14387
14387
|
var Qe = y.above(f, {
|
|
14388
14388
|
at: ve.path,
|
|
14389
14389
|
match: (se) => he.isElement(se) && y.isBlock(f, se)
|
|
14390
14390
|
});
|
|
14391
|
-
Qe && oe.string(Qe[0]).includes(" ") && (
|
|
14391
|
+
Qe && oe.string(Qe[0]).includes(" ") && (Q = !1);
|
|
14392
14392
|
}
|
|
14393
14393
|
}
|
|
14394
14394
|
if (!q.startsWith("delete") || q.startsWith("deleteBy")) {
|
|
@@ -14399,15 +14399,15 @@ var ax = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, pf(e)), sx =
|
|
|
14399
14399
|
suppressThrow: !1
|
|
14400
14400
|
});
|
|
14401
14401
|
if (!O || !Y.equals(O, ge)) {
|
|
14402
|
-
|
|
14402
|
+
Q = !1;
|
|
14403
14403
|
var Ae = !U && f.selection && y.rangeRef(f, f.selection);
|
|
14404
|
-
|
|
14404
|
+
J.select(f, ge), Ae && Nr.set(f, Ae);
|
|
14405
14405
|
}
|
|
14406
14406
|
}
|
|
14407
14407
|
}
|
|
14408
14408
|
if (U)
|
|
14409
14409
|
return;
|
|
14410
|
-
if (
|
|
14410
|
+
if (Q || k.preventDefault(), O && Y.isExpanded(O) && q.startsWith("delete")) {
|
|
14411
14411
|
var je = q.endsWith("Backward") ? "backward" : "forward";
|
|
14412
14412
|
y.deleteFragment(f, {
|
|
14413
14413
|
direction: je
|
|
@@ -14487,12 +14487,12 @@ var ax = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, pf(e)), sx =
|
|
|
14487
14487
|
case "insertFromYank":
|
|
14488
14488
|
case "insertReplacementText":
|
|
14489
14489
|
case "insertText": {
|
|
14490
|
-
q === "insertFromComposition" && ee.isComposing(f) && (v(!1), Fn.set(f, !1)), (
|
|
14490
|
+
q === "insertFromComposition" && ee.isComposing(f) && (v(!1), Fn.set(f, !1)), (X == null ? void 0 : X.constructor.name) === "DataTransfer" ? ee.insertData(f, X) : typeof X == "string" && (Q ? E.current.push(() => y.insertText(f, X)) : y.insertText(f, X));
|
|
14491
14491
|
break;
|
|
14492
14492
|
}
|
|
14493
14493
|
}
|
|
14494
14494
|
var K = (N = Nr.get(f)) === null || N === void 0 ? void 0 : N.unref();
|
|
14495
|
-
Nr.delete(f), K && (!f.selection || !Y.equals(f.selection, K)) &&
|
|
14495
|
+
Nr.delete(f), K && (!f.selection || !Y.equals(f.selection, K)) && J.select(f, K);
|
|
14496
14496
|
}
|
|
14497
14497
|
}, [f, $, C, i, s, A]), T = Re((k) => {
|
|
14498
14498
|
k == null ? ($.cancel(), A.cancel(), Si.delete(f), Sn.delete(f), w.current && fn && w.current.removeEventListener("beforeinput", _)) : fn && k.addEventListener("beforeinput", _), w.current = k;
|
|
@@ -14623,8 +14623,8 @@ var ax = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, pf(e)), sx =
|
|
|
14623
14623
|
} = k, q = ee.toDOMNode(f, f);
|
|
14624
14624
|
if (O !== q && !(Nt(O) && O.hasAttribute("data-slate-spacer"))) {
|
|
14625
14625
|
if (O != null && xn(O) && ee.hasDOMNode(f, O)) {
|
|
14626
|
-
var
|
|
14627
|
-
if (he.isElement(
|
|
14626
|
+
var X = ee.toSlateNode(f, O);
|
|
14627
|
+
if (he.isElement(X) && !f.isVoid(X))
|
|
14628
14628
|
return;
|
|
14629
14629
|
}
|
|
14630
14630
|
if (Sr) {
|
|
@@ -14644,14 +14644,14 @@ var ax = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, pf(e)), sx =
|
|
|
14644
14644
|
if (k.detail === G1 && O.length >= 1) {
|
|
14645
14645
|
var q = O;
|
|
14646
14646
|
if (!(he.isElement(N) && y.isBlock(f, N))) {
|
|
14647
|
-
var
|
|
14647
|
+
var X, U = y.above(f, {
|
|
14648
14648
|
match: (Ne) => he.isElement(Ne) && y.isBlock(f, Ne),
|
|
14649
14649
|
at: O
|
|
14650
14650
|
});
|
|
14651
|
-
q = (
|
|
14651
|
+
q = (X = U == null ? void 0 : U[1]) !== null && X !== void 0 ? X : O.slice(0, 1);
|
|
14652
14652
|
}
|
|
14653
|
-
var
|
|
14654
|
-
|
|
14653
|
+
var Q = y.range(f, q);
|
|
14654
|
+
J.select(f, Q);
|
|
14655
14655
|
return;
|
|
14656
14656
|
}
|
|
14657
14657
|
if (s)
|
|
@@ -14663,7 +14663,7 @@ var ax = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, pf(e)), sx =
|
|
|
14663
14663
|
});
|
|
14664
14664
|
if (ve && xe && R.equals(ve[1], xe[1])) {
|
|
14665
14665
|
var Fe = y.range(f, ce);
|
|
14666
|
-
|
|
14666
|
+
J.select(f, Fe);
|
|
14667
14667
|
}
|
|
14668
14668
|
}
|
|
14669
14669
|
}, [f, g.onClick, s]),
|
|
@@ -14714,7 +14714,7 @@ var ax = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, pf(e)), sx =
|
|
|
14714
14714
|
y.deleteFragment(f);
|
|
14715
14715
|
else {
|
|
14716
14716
|
var O = oe.parent(f, N.anchor.path);
|
|
14717
|
-
y.isVoid(f, O) &&
|
|
14717
|
+
y.isVoid(f, O) && J.delete(f);
|
|
14718
14718
|
}
|
|
14719
14719
|
}
|
|
14720
14720
|
}, [s, f, g.onCut]),
|
|
@@ -14731,8 +14731,8 @@ var ax = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, pf(e)), sx =
|
|
|
14731
14731
|
voids: !0
|
|
14732
14732
|
});
|
|
14733
14733
|
if (q) {
|
|
14734
|
-
var
|
|
14735
|
-
|
|
14734
|
+
var X = y.range(f, O);
|
|
14735
|
+
J.select(f, X);
|
|
14736
14736
|
}
|
|
14737
14737
|
P.isDraggingInternally = !0, ee.setFragmentData(f, k.dataTransfer, "drag");
|
|
14738
14738
|
}
|
|
@@ -14741,10 +14741,10 @@ var ax = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, pf(e)), sx =
|
|
|
14741
14741
|
if (!s && ee.hasTarget(f, k.target) && !gt(k, g.onDrop)) {
|
|
14742
14742
|
k.preventDefault();
|
|
14743
14743
|
var N = f.selection, O = ee.findEventRange(f, k), q = k.dataTransfer;
|
|
14744
|
-
|
|
14744
|
+
J.select(f, O), P.isDraggingInternally && N && !Y.equals(N, O) && !y.void(f, {
|
|
14745
14745
|
at: O,
|
|
14746
14746
|
voids: !0
|
|
14747
|
-
}) &&
|
|
14747
|
+
}) && J.delete(f, {
|
|
14748
14748
|
at: N
|
|
14749
14749
|
}), ee.insertData(f, q), ee.isFocused(f) || ee.focus(f);
|
|
14750
14750
|
}
|
|
@@ -14774,11 +14774,11 @@ var ax = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, pf(e)), sx =
|
|
|
14774
14774
|
return;
|
|
14775
14775
|
var {
|
|
14776
14776
|
selection: q
|
|
14777
|
-
} = f,
|
|
14777
|
+
} = f, X = f.children[q !== null ? q.focus.path[0] : 0], U = Id(oe.string(X)) === "rtl";
|
|
14778
14778
|
if (Je.isRedo(O)) {
|
|
14779
14779
|
k.preventDefault();
|
|
14780
|
-
var
|
|
14781
|
-
typeof
|
|
14780
|
+
var Q = f;
|
|
14781
|
+
typeof Q.redo == "function" && Q.redo();
|
|
14782
14782
|
return;
|
|
14783
14783
|
}
|
|
14784
14784
|
if (Je.isUndo(O)) {
|
|
@@ -14788,20 +14788,20 @@ var ax = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, pf(e)), sx =
|
|
|
14788
14788
|
return;
|
|
14789
14789
|
}
|
|
14790
14790
|
if (Je.isMoveLineBackward(O)) {
|
|
14791
|
-
k.preventDefault(),
|
|
14791
|
+
k.preventDefault(), J.move(f, {
|
|
14792
14792
|
unit: "line",
|
|
14793
14793
|
reverse: !0
|
|
14794
14794
|
});
|
|
14795
14795
|
return;
|
|
14796
14796
|
}
|
|
14797
14797
|
if (Je.isMoveLineForward(O)) {
|
|
14798
|
-
k.preventDefault(),
|
|
14798
|
+
k.preventDefault(), J.move(f, {
|
|
14799
14799
|
unit: "line"
|
|
14800
14800
|
});
|
|
14801
14801
|
return;
|
|
14802
14802
|
}
|
|
14803
14803
|
if (Je.isExtendLineBackward(O)) {
|
|
14804
|
-
k.preventDefault(),
|
|
14804
|
+
k.preventDefault(), J.move(f, {
|
|
14805
14805
|
unit: "line",
|
|
14806
14806
|
edge: "focus",
|
|
14807
14807
|
reverse: !0
|
|
@@ -14809,41 +14809,41 @@ var ax = (e) => /* @__PURE__ */ te.createElement(te.Fragment, null, pf(e)), sx =
|
|
|
14809
14809
|
return;
|
|
14810
14810
|
}
|
|
14811
14811
|
if (Je.isExtendLineForward(O)) {
|
|
14812
|
-
k.preventDefault(),
|
|
14812
|
+
k.preventDefault(), J.move(f, {
|
|
14813
14813
|
unit: "line",
|
|
14814
14814
|
edge: "focus"
|
|
14815
14815
|
});
|
|
14816
14816
|
return;
|
|
14817
14817
|
}
|
|
14818
14818
|
if (Je.isMoveBackward(O)) {
|
|
14819
|
-
k.preventDefault(), q && Y.isCollapsed(q) ?
|
|
14819
|
+
k.preventDefault(), q && Y.isCollapsed(q) ? J.move(f, {
|
|
14820
14820
|
reverse: !U
|
|
14821
|
-
}) :
|
|
14821
|
+
}) : J.collapse(f, {
|
|
14822
14822
|
edge: U ? "end" : "start"
|
|
14823
14823
|
});
|
|
14824
14824
|
return;
|
|
14825
14825
|
}
|
|
14826
14826
|
if (Je.isMoveForward(O)) {
|
|
14827
|
-
k.preventDefault(), q && Y.isCollapsed(q) ?
|
|
14827
|
+
k.preventDefault(), q && Y.isCollapsed(q) ? J.move(f, {
|
|
14828
14828
|
reverse: U
|
|
14829
|
-
}) :
|
|
14829
|
+
}) : J.collapse(f, {
|
|
14830
14830
|
edge: U ? "start" : "end"
|
|
14831
14831
|
});
|
|
14832
14832
|
return;
|
|
14833
14833
|
}
|
|
14834
14834
|
if (Je.isMoveWordBackward(O)) {
|
|
14835
|
-
k.preventDefault(), q && Y.isExpanded(q) &&
|
|
14835
|
+
k.preventDefault(), q && Y.isExpanded(q) && J.collapse(f, {
|
|
14836
14836
|
edge: "focus"
|
|
14837
|
-
}),
|
|
14837
|
+
}), J.move(f, {
|
|
14838
14838
|
unit: "word",
|
|
14839
14839
|
reverse: !U
|
|
14840
14840
|
});
|
|
14841
14841
|
return;
|
|
14842
14842
|
}
|
|
14843
14843
|
if (Je.isMoveWordForward(O)) {
|
|
14844
|
-
k.preventDefault(), q && Y.isExpanded(q) &&
|
|
14844
|
+
k.preventDefault(), q && Y.isExpanded(q) && J.collapse(f, {
|
|
14845
14845
|
edge: "focus"
|
|
14846
|
-
}),
|
|
14846
|
+
}), J.move(f, {
|
|
14847
14847
|
unit: "word",
|
|
14848
14848
|
reverse: U
|
|
14849
14849
|
});
|
|
@@ -15094,7 +15094,7 @@ var vx = function(t) {
|
|
|
15094
15094
|
});
|
|
15095
15095
|
if (d) {
|
|
15096
15096
|
var [, h] = d, m = y.range(r, h, r.selection.anchor), p = gx(r, m);
|
|
15097
|
-
Y.isCollapsed(p) ||
|
|
15097
|
+
Y.isCollapsed(p) || J.delete(r, {
|
|
15098
15098
|
at: p
|
|
15099
15099
|
});
|
|
15100
15100
|
}
|
|
@@ -15203,7 +15203,7 @@ var vx = function(t) {
|
|
|
15203
15203
|
if (d) {
|
|
15204
15204
|
var h = d.split(/\r\n|\r|\n/), m = !1;
|
|
15205
15205
|
for (var p of h)
|
|
15206
|
-
m &&
|
|
15206
|
+
m && J.splitNodes(r, {
|
|
15207
15207
|
always: !0
|
|
15208
15208
|
}), r.insertText(p), m = !0;
|
|
15209
15209
|
return !0;
|
|
@@ -18671,14 +18671,14 @@ function kw(e, t, n) {
|
|
|
18671
18671
|
) : z(T);
|
|
18672
18672
|
function z(O) {
|
|
18673
18673
|
return q;
|
|
18674
|
-
function q(
|
|
18675
|
-
const U =
|
|
18674
|
+
function q(X) {
|
|
18675
|
+
const U = X !== null && O[X], Q = X !== null && O.null, ce = [
|
|
18676
18676
|
// To do: add more extension tests.
|
|
18677
18677
|
/* c8 ignore next 2 */
|
|
18678
18678
|
...Array.isArray(U) ? U : U ? [U] : [],
|
|
18679
|
-
...Array.isArray(
|
|
18679
|
+
...Array.isArray(Q) ? Q : Q ? [Q] : []
|
|
18680
18680
|
];
|
|
18681
|
-
return re(ce)(
|
|
18681
|
+
return re(ce)(X);
|
|
18682
18682
|
}
|
|
18683
18683
|
}
|
|
18684
18684
|
function re(O) {
|
|
@@ -18686,7 +18686,7 @@ function kw(e, t, n) {
|
|
|
18686
18686
|
}
|
|
18687
18687
|
function F(O) {
|
|
18688
18688
|
return q;
|
|
18689
|
-
function q(
|
|
18689
|
+
function q(X) {
|
|
18690
18690
|
return D = P(), ne = O, O.partial || (u.currentConstruct = O), O.name && u.parser.constructs.disable.null.includes(O.name) ? N() : O.tokenize.call(
|
|
18691
18691
|
// If we do have fields, create an object w/ `context` as its
|
|
18692
18692
|
// prototype.
|
|
@@ -18695,7 +18695,7 @@ function kw(e, t, n) {
|
|
|
18695
18695
|
l,
|
|
18696
18696
|
k,
|
|
18697
18697
|
N
|
|
18698
|
-
)(
|
|
18698
|
+
)(X);
|
|
18699
18699
|
}
|
|
18700
18700
|
}
|
|
18701
18701
|
function k(O) {
|
|
@@ -18945,10 +18945,10 @@ function Vw(e) {
|
|
|
18945
18945
|
blockQuote: a(U),
|
|
18946
18946
|
characterEscape: P,
|
|
18947
18947
|
characterReference: P,
|
|
18948
|
-
codeFenced: a(
|
|
18948
|
+
codeFenced: a(Q),
|
|
18949
18949
|
codeFencedFenceInfo: s,
|
|
18950
18950
|
codeFencedFenceMeta: s,
|
|
18951
|
-
codeIndented: a(
|
|
18951
|
+
codeIndented: a(Q, s),
|
|
18952
18952
|
codeText: a(ce, s),
|
|
18953
18953
|
codeTextData: P,
|
|
18954
18954
|
data: P,
|
|
@@ -18984,7 +18984,7 @@ function Vw(e) {
|
|
|
18984
18984
|
atxHeading: l(),
|
|
18985
18985
|
atxHeadingSequence: x,
|
|
18986
18986
|
autolink: l(),
|
|
18987
|
-
autolinkEmail:
|
|
18987
|
+
autolinkEmail: X,
|
|
18988
18988
|
autolinkProtocol: q,
|
|
18989
18989
|
blockQuote: l(),
|
|
18990
18990
|
characterEscapeValue: L,
|
|
@@ -19353,7 +19353,7 @@ function Vw(e) {
|
|
|
19353
19353
|
const se = this.stack[this.stack.length - 1];
|
|
19354
19354
|
se.url = this.sliceSerialize(K);
|
|
19355
19355
|
}
|
|
19356
|
-
function
|
|
19356
|
+
function X(K) {
|
|
19357
19357
|
L.call(this, K);
|
|
19358
19358
|
const se = this.stack[this.stack.length - 1];
|
|
19359
19359
|
se.url = "mailto:" + this.sliceSerialize(K);
|
|
@@ -19364,7 +19364,7 @@ function Vw(e) {
|
|
|
19364
19364
|
children: []
|
|
19365
19365
|
};
|
|
19366
19366
|
}
|
|
19367
|
-
function
|
|
19367
|
+
function Q() {
|
|
19368
19368
|
return {
|
|
19369
19369
|
type: "code",
|
|
19370
19370
|
lang: null,
|
|
@@ -19751,7 +19751,7 @@ const Yw = function(t) {
|
|
|
19751
19751
|
name: l,
|
|
19752
19752
|
children: [{ text: "" }]
|
|
19753
19753
|
};
|
|
19754
|
-
|
|
19754
|
+
J.select(e, (t == null ? void 0 : t.position) || yf), J.insertNodes(e, [u, { text: " " }]), J.move(e, { distance: 1, unit: "offset" }), So(r);
|
|
19755
19755
|
}, tC = async ({
|
|
19756
19756
|
editor: e,
|
|
19757
19757
|
isShowing: t,
|
|
@@ -20113,7 +20113,7 @@ const iC = ({
|
|
|
20113
20113
|
}, Lf = (e, t, n) => {
|
|
20114
20114
|
try {
|
|
20115
20115
|
const r = aC(e), i = If(e, t), a = Dc.includes(t);
|
|
20116
|
-
|
|
20116
|
+
J.unwrapNodes(e, {
|
|
20117
20117
|
match: (l) => {
|
|
20118
20118
|
const u = l;
|
|
20119
20119
|
return !y.isEditor(u) && he.isElement(u) && Dc.includes(u.type);
|
|
@@ -20123,7 +20123,7 @@ const iC = ({
|
|
|
20123
20123
|
const o = {
|
|
20124
20124
|
type: i ? Z.paragraph : a ? Z.li : t
|
|
20125
20125
|
};
|
|
20126
|
-
if (
|
|
20126
|
+
if (J.setNodes(e, o), a)
|
|
20127
20127
|
if (i) {
|
|
20128
20128
|
const { selection: l } = e;
|
|
20129
20129
|
if (!l)
|
|
@@ -20138,7 +20138,7 @@ const iC = ({
|
|
|
20138
20138
|
}
|
|
20139
20139
|
})
|
|
20140
20140
|
).forEach(([m, p]) => {
|
|
20141
|
-
oe.string(m).trim() === "" &&
|
|
20141
|
+
oe.string(m).trim() === "" && J.removeNodes(e, { at: p });
|
|
20142
20142
|
});
|
|
20143
20143
|
} else {
|
|
20144
20144
|
if (r) {
|
|
@@ -20146,10 +20146,10 @@ const iC = ({
|
|
|
20146
20146
|
type: Z.blockquote,
|
|
20147
20147
|
children: []
|
|
20148
20148
|
};
|
|
20149
|
-
|
|
20149
|
+
J.wrapNodes(e, u);
|
|
20150
20150
|
}
|
|
20151
20151
|
const l = { type: t, children: [] };
|
|
20152
|
-
|
|
20152
|
+
J.wrapNodes(e, l);
|
|
20153
20153
|
}
|
|
20154
20154
|
} catch (r) {
|
|
20155
20155
|
const i = r.message;
|
|
@@ -20189,7 +20189,7 @@ const iC = ({
|
|
|
20189
20189
|
});
|
|
20190
20190
|
if (s) {
|
|
20191
20191
|
const [o, l] = s, u = { link: t };
|
|
20192
|
-
|
|
20192
|
+
J.setNodes(e, u, { at: l }), So(n);
|
|
20193
20193
|
}
|
|
20194
20194
|
} else
|
|
20195
20195
|
Oo(e, t, n, r);
|
|
@@ -20203,13 +20203,13 @@ const iC = ({
|
|
|
20203
20203
|
link: t,
|
|
20204
20204
|
children: a ? [{ text: t }] : []
|
|
20205
20205
|
};
|
|
20206
|
-
a ? (
|
|
20206
|
+
a ? (J.insertNodes(e, s), J.move(e, { distance: 1, unit: "offset" })) : (J.wrapNodes(e, s, { split: !0 }), J.collapse(e, { edge: "end" }), J.insertNodes(e, { text: "" }), J.move(e, { distance: 1, unit: "offset" })), So(n);
|
|
20207
20207
|
} catch (i) {
|
|
20208
20208
|
const a = i.message;
|
|
20209
20209
|
r(`Error in wrapLink: ${a}`);
|
|
20210
20210
|
}
|
|
20211
20211
|
}, zf = (e) => {
|
|
20212
|
-
|
|
20212
|
+
J.unwrapNodes(e, {
|
|
20213
20213
|
match: (t) => {
|
|
20214
20214
|
const n = t;
|
|
20215
20215
|
return !y.isEditor(t) && he.isElement(t) && n.type === Z.link;
|
|
@@ -20294,7 +20294,7 @@ const lC = () => {
|
|
|
20294
20294
|
return;
|
|
20295
20295
|
x.preventDefault(), x.stopPropagation();
|
|
20296
20296
|
const C = y.end(u, []);
|
|
20297
|
-
|
|
20297
|
+
J.select(u, C), ee.focus(u);
|
|
20298
20298
|
}
|
|
20299
20299
|
}
|
|
20300
20300
|
}
|
|
@@ -20486,7 +20486,7 @@ const DC = /* @__PURE__ */ Mn(gC), wC = (e, t, n) => {
|
|
|
20486
20486
|
try {
|
|
20487
20487
|
e.normalizeNode = ([r, i]) => {
|
|
20488
20488
|
if (r.type === Z.link && oe.string(r).trim() === "") {
|
|
20489
|
-
|
|
20489
|
+
J.removeNodes(e, { at: i });
|
|
20490
20490
|
return;
|
|
20491
20491
|
}
|
|
20492
20492
|
n([r, i]);
|
|
@@ -20584,12 +20584,12 @@ const _C = ({
|
|
|
20584
20584
|
if (!z || k !== ie)
|
|
20585
20585
|
return;
|
|
20586
20586
|
const N = y.end(z, []);
|
|
20587
|
-
|
|
20587
|
+
J.select(z, N), ee.focus(z);
|
|
20588
20588
|
};
|
|
20589
20589
|
de(() => {
|
|
20590
20590
|
const k = (N) => {
|
|
20591
|
-
var
|
|
20592
|
-
const O = N, q = ((
|
|
20591
|
+
var X;
|
|
20592
|
+
const O = N, q = ((X = O == null ? void 0 : O.detail) == null ? void 0 : X.id) || null;
|
|
20593
20593
|
q && re(q);
|
|
20594
20594
|
};
|
|
20595
20595
|
return window.addEventListener("focusEditor", k), () => {
|
|
@@ -20635,8 +20635,8 @@ const _C = ({
|
|
|
20635
20635
|
N && W(N);
|
|
20636
20636
|
}
|
|
20637
20637
|
const k = (N) => {
|
|
20638
|
-
var
|
|
20639
|
-
const O = N, q = ((
|
|
20638
|
+
var X;
|
|
20639
|
+
const O = N, q = ((X = O == null ? void 0 : O.detail) == null ? void 0 : X.url) || null;
|
|
20640
20640
|
q && T && T.url === q && x([{ type: "enrichedUrl", value: void 0 }]);
|
|
20641
20641
|
};
|
|
20642
20642
|
return window.addEventListener("linkRemoved", k), () => {
|
|
@@ -20649,12 +20649,12 @@ const _C = ({
|
|
|
20649
20649
|
k && k.length === 1 && k[0].length === t.length && !A && x([{ type: "originalValue", value: t }]);
|
|
20650
20650
|
}
|
|
20651
20651
|
t !== "" || !z || bs(S, t) && !A || (y.withoutNormalizing(z, () => {
|
|
20652
|
-
|
|
20652
|
+
J.delete(z, {
|
|
20653
20653
|
at: {
|
|
20654
20654
|
anchor: y.start(z, []),
|
|
20655
20655
|
focus: y.end(z, [])
|
|
20656
20656
|
}
|
|
20657
|
-
}),
|
|
20657
|
+
}), J.deselect(z), z.children.length !== 0 && J.unwrapNodes(z, { at: [0] }), J.insertNodes(z, w, { at: [0] });
|
|
20658
20658
|
}), x([
|
|
20659
20659
|
{ type: "initialValue", value: w },
|
|
20660
20660
|
{ type: "lastAnchor", value: null },
|
|
@@ -20713,25 +20713,25 @@ const _C = ({
|
|
|
20713
20713
|
j.show && (k.preventDefault(), k.stopPropagation(), Mf(z, j, x, ie));
|
|
20714
20714
|
const { selection: N } = z;
|
|
20715
20715
|
if (N) {
|
|
20716
|
-
const O = Y.isCollapsed(N), [q,
|
|
20717
|
-
let U = q,
|
|
20716
|
+
const O = Y.isCollapsed(N), [q, X] = y.node(z, N, { depth: 1 });
|
|
20717
|
+
let U = q, Q = U.type;
|
|
20718
20718
|
const ce = U.children[0];
|
|
20719
|
-
if (ce && [Z.ol, Z.ul].includes(ce.type) && (U = ce,
|
|
20720
|
-
if (
|
|
20721
|
-
k.stopPropagation(), k.preventDefault(),
|
|
20719
|
+
if (ce && [Z.ol, Z.ul].includes(ce.type) && (U = ce, Q = ce.type), U && he.isElement(U) && Q !== Z.paragraph) {
|
|
20720
|
+
if (Q === Z.blockquote && !k.shiftKey) {
|
|
20721
|
+
k.stopPropagation(), k.preventDefault(), J.insertNodes(z, w);
|
|
20722
20722
|
return;
|
|
20723
20723
|
}
|
|
20724
20724
|
if (O) {
|
|
20725
20725
|
const [G, ve] = y.parent(z, N, {
|
|
20726
20726
|
edge: "end"
|
|
20727
20727
|
}), Fe = G.type;
|
|
20728
|
-
if ([Z.ul, Z.ol].includes(
|
|
20728
|
+
if ([Z.ul, Z.ol].includes(Q))
|
|
20729
20729
|
if (k.stopPropagation(), k.preventDefault(), Fe === Z.li && $ === "Enter") {
|
|
20730
|
-
G.children.length === 1 && "text" in G.children[0] && G.children[0].text === "" &&
|
|
20731
|
-
at: R.next(
|
|
20732
|
-
}),
|
|
20730
|
+
G.children.length === 1 && "text" in G.children[0] && G.children[0].text === "" && J.removeNodes(z, { at: ve }), J.insertNodes(z, w, {
|
|
20731
|
+
at: R.next(X)
|
|
20732
|
+
}), J.select(
|
|
20733
20733
|
z,
|
|
20734
|
-
y.end(z, R.next(
|
|
20734
|
+
y.end(z, R.next(X))
|
|
20735
20735
|
);
|
|
20736
20736
|
return;
|
|
20737
20737
|
} else {
|
|
@@ -20739,9 +20739,9 @@ const _C = ({
|
|
|
20739
20739
|
type: Z.li,
|
|
20740
20740
|
children: [{ text: "" }]
|
|
20741
20741
|
};
|
|
20742
|
-
|
|
20742
|
+
J.insertNodes(z, We, {
|
|
20743
20743
|
at: R.next(Se)
|
|
20744
|
-
}),
|
|
20744
|
+
}), J.select(
|
|
20745
20745
|
z,
|
|
20746
20746
|
y.end(z, R.next(Se))
|
|
20747
20747
|
);
|
|
@@ -20781,7 +20781,7 @@ const _C = ({
|
|
|
20781
20781
|
if (me.isText(k) ? N = k.text.length : k.children && (N = k.children.length), L.offset > N)
|
|
20782
20782
|
return;
|
|
20783
20783
|
try {
|
|
20784
|
-
|
|
20784
|
+
J.select(z, {
|
|
20785
20785
|
anchor: L,
|
|
20786
20786
|
focus: L
|
|
20787
20787
|
});
|
|
@@ -23279,7 +23279,7 @@ const nt = "discussion_form_", ma = ({
|
|
|
23279
23279
|
title: C && C.text || "",
|
|
23280
23280
|
body: x && x.text || S && S.text || "",
|
|
23281
23281
|
categories: x ? x.categories : ""
|
|
23282
|
-
}), [N, O] = ue(l.error || !1), [q,
|
|
23282
|
+
}), [N, O] = ue(l.error || !1), [q, X] = ue(!1);
|
|
23283
23283
|
if (de(() => {
|
|
23284
23284
|
u && !x && S && S !== F.body && k({ ...F, body: S.text || "" });
|
|
23285
23285
|
}, [S]), v)
|
|
@@ -23305,16 +23305,16 @@ const nt = "discussion_form_", ma = ({
|
|
|
23305
23305
|
"action"
|
|
23306
23306
|
), Ae ? O(Ae) : N && O(!1);
|
|
23307
23307
|
};
|
|
23308
|
-
let
|
|
23308
|
+
let Q = `${n.type}-form`;
|
|
23309
23309
|
if (n.type === "response" || n.type === "reply") {
|
|
23310
23310
|
const ge = ((Ge = n.slugs) == null ? void 0 : Ge.reply) || ((Qe = n.slugs) == null ? void 0 : Qe.answer) || ((rt = n.slugs) == null ? void 0 : rt.question) || "";
|
|
23311
|
-
ge && (
|
|
23311
|
+
ge && (Q = `${Q}-${ge.slice(-15)}`);
|
|
23312
23312
|
}
|
|
23313
|
-
e && (
|
|
23313
|
+
e && (Q = `${e}-${Q}`);
|
|
23314
23314
|
const ce = async () => {
|
|
23315
23315
|
if (!g || !g.id || !r || Fe)
|
|
23316
23316
|
return;
|
|
23317
|
-
Di && clearTimeout(Di),
|
|
23317
|
+
Di && clearTimeout(Di), X("submitting");
|
|
23318
23318
|
const ge = window.location.pathname;
|
|
23319
23319
|
try {
|
|
23320
23320
|
let Ae;
|
|
@@ -23349,7 +23349,7 @@ const nt = "discussion_form_", ma = ({
|
|
|
23349
23349
|
break;
|
|
23350
23350
|
}
|
|
23351
23351
|
await Lh(1e3), ie && await ie(Ae), Di = setTimeout(() => {
|
|
23352
|
-
k({ title: "", body: "", categories: "" }),
|
|
23352
|
+
k({ title: "", body: "", categories: "" }), X("submitted"), b(
|
|
23353
23353
|
$t(p.formatMessage, `${nt}success`, n.type, "action")
|
|
23354
23354
|
);
|
|
23355
23355
|
const je = new Event(ut.DISCUSSION_FORM_SUBMITTED);
|
|
@@ -23372,7 +23372,7 @@ const nt = "discussion_form_", ma = ({
|
|
|
23372
23372
|
}
|
|
23373
23373
|
}, G = () => {
|
|
23374
23374
|
Di = setTimeout(() => {
|
|
23375
|
-
O(!1),
|
|
23375
|
+
O(!1), X(!1), b("");
|
|
23376
23376
|
}, 5e3);
|
|
23377
23377
|
}, ve = !F.title || !Qo(F.title), xe = !F.body || !Qo(F.body);
|
|
23378
23378
|
let Fe = xe;
|
|
@@ -23381,7 +23381,7 @@ const nt = "discussion_form_", ma = ({
|
|
|
23381
23381
|
{
|
|
23382
23382
|
component: KC,
|
|
23383
23383
|
props: {
|
|
23384
|
-
formID:
|
|
23384
|
+
formID: Q,
|
|
23385
23385
|
intlPath: nt,
|
|
23386
23386
|
showLabel: C !== !1,
|
|
23387
23387
|
type: n.type
|
|
@@ -23390,7 +23390,7 @@ const nt = "discussion_form_", ma = ({
|
|
|
23390
23390
|
{
|
|
23391
23391
|
component: _C,
|
|
23392
23392
|
props: {
|
|
23393
|
-
id: `${
|
|
23393
|
+
id: `${Q}-input`,
|
|
23394
23394
|
value: q === "submitting" && !N ? "" : F.body,
|
|
23395
23395
|
placeholder: a || $t(
|
|
23396
23396
|
p.formatMessage,
|
|
@@ -23466,7 +23466,7 @@ const nt = "discussion_form_", ma = ({
|
|
|
23466
23466
|
/* @__PURE__ */ c.jsxs(
|
|
23467
23467
|
Ln,
|
|
23468
23468
|
{
|
|
23469
|
-
id:
|
|
23469
|
+
id: Q,
|
|
23470
23470
|
className: H("discussion-card discussion-form", {
|
|
23471
23471
|
"no-styling": w && x
|
|
23472
23472
|
}),
|
|
@@ -23479,7 +23479,7 @@ const nt = "discussion_form_", ma = ({
|
|
|
23479
23479
|
functions: {
|
|
23480
23480
|
onSuccess: async (ge) => {
|
|
23481
23481
|
if (x) {
|
|
23482
|
-
|
|
23482
|
+
X("submitting"), V(F);
|
|
23483
23483
|
return;
|
|
23484
23484
|
}
|
|
23485
23485
|
await ce();
|
|
@@ -24557,7 +24557,7 @@ const rk = ({
|
|
|
24557
24557
|
}
|
|
24558
24558
|
),
|
|
24559
24559
|
b == null ? void 0 : b.map((j, V) => {
|
|
24560
|
-
var q,
|
|
24560
|
+
var q, X, U;
|
|
24561
24561
|
const {
|
|
24562
24562
|
id: W,
|
|
24563
24563
|
own_reactions: ie,
|
|
@@ -24565,11 +24565,11 @@ const rk = ({
|
|
|
24565
24565
|
reaction_counts: D,
|
|
24566
24566
|
mentioned_users: z,
|
|
24567
24567
|
total_replies: re
|
|
24568
|
-
} = j, F = (((q = ne == null ? void 0 : ne.like) == null ? void 0 : q.length) || 0) > 0, k = (((
|
|
24568
|
+
} = j, F = (((q = ne == null ? void 0 : ne.like) == null ? void 0 : q.length) || 0) > 0, k = (((X = ie == null ? void 0 : ie.like) == null ? void 0 : X.length) || 0) > 0, N = k ? ie == null ? void 0 : ie.like[0].id : "", O = F ? (U = ne == null ? void 0 : ne.like) == null ? void 0 : U.map((Q) => {
|
|
24569
24569
|
var ce, G, ve;
|
|
24570
24570
|
return {
|
|
24571
|
-
id: (ce =
|
|
24572
|
-
name: (ve = (G =
|
|
24571
|
+
id: (ce = Q == null ? void 0 : Q.user) == null ? void 0 : ce.id,
|
|
24572
|
+
name: (ve = (G = Q == null ? void 0 : Q.user) == null ? void 0 : G.data) == null ? void 0 : ve.name
|
|
24573
24573
|
};
|
|
24574
24574
|
}) : !1;
|
|
24575
24575
|
return (j == null ? void 0 : j.verb) !== "post" ? /* @__PURE__ */ c.jsx(c.Fragment, { children: " " }) : /* @__PURE__ */ c.jsx(Lr, { children: /* @__PURE__ */ c.jsx(
|
|
@@ -24605,12 +24605,12 @@ const rk = ({
|
|
|
24605
24605
|
createContent: () => null,
|
|
24606
24606
|
deleteContent: () => S({ activityId: W }),
|
|
24607
24607
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24608
|
-
updateContent: (
|
|
24608
|
+
updateContent: (Q, { body: ce }) => C({ activityId: W, content: ce })
|
|
24609
24609
|
},
|
|
24610
24610
|
likes: {
|
|
24611
24611
|
createLike: () => I({ activityId: W }),
|
|
24612
24612
|
deleteLike: () => P({ activityId: W, reactionId: N }),
|
|
24613
|
-
listLikes: (
|
|
24613
|
+
listLikes: (Q) => u.list({ activityId: W, ...Q })
|
|
24614
24614
|
},
|
|
24615
24615
|
comments: {
|
|
24616
24616
|
openComments: () => null
|
|
@@ -25433,10 +25433,10 @@ const BE = ({
|
|
|
25433
25433
|
var q;
|
|
25434
25434
|
return ((q = O == null ? void 0 : O.user) == null ? void 0 : q.id) === (E == null ? void 0 : E.id);
|
|
25435
25435
|
}) : !1, T = _ ? _ == null ? void 0 : _.id : "", j = !!_, W = (((z = P == null ? void 0 : P.like) == null ? void 0 : z.length) || 0) > 0 ? (re = P == null ? void 0 : P.like) == null ? void 0 : re.map((O) => {
|
|
25436
|
-
var q,
|
|
25436
|
+
var q, X, U;
|
|
25437
25437
|
return {
|
|
25438
25438
|
id: (q = O == null ? void 0 : O.user) == null ? void 0 : q.id,
|
|
25439
|
-
name: (U = (
|
|
25439
|
+
name: (U = (X = O == null ? void 0 : O.user) == null ? void 0 : X.data) == null ? void 0 : U.name
|
|
25440
25440
|
};
|
|
25441
25441
|
}) : !1, ie = typeof C.data.content == "string" ? (F = C == null ? void 0 : C.data) == null ? void 0 : F.content : (
|
|
25442
25442
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -25561,25 +25561,25 @@ const TE = ({
|
|
|
25561
25561
|
}
|
|
25562
25562
|
),
|
|
25563
25563
|
m == null ? void 0 : m.map((P, L) => {
|
|
25564
|
-
var F, k, N, O, q,
|
|
25564
|
+
var F, k, N, O, q, X, U;
|
|
25565
25565
|
const {
|
|
25566
25566
|
id: $,
|
|
25567
25567
|
own_children: A,
|
|
25568
25568
|
latest_children: _,
|
|
25569
25569
|
children_counts: T,
|
|
25570
25570
|
data: { mentioned_users: j }
|
|
25571
|
-
} = P, W = (((F = A == null ? void 0 : A.like) == null ? void 0 : F.length) || 0) > 0 ? (k = A == null ? void 0 : A.like) == null ? void 0 : k.find((
|
|
25571
|
+
} = P, W = (((F = A == null ? void 0 : A.like) == null ? void 0 : F.length) || 0) > 0 ? (k = A == null ? void 0 : A.like) == null ? void 0 : k.find((Q) => {
|
|
25572
25572
|
var ce;
|
|
25573
|
-
return ((ce =
|
|
25574
|
-
}) : !1, ie = W ? W == null ? void 0 : W.id : "", ne = !!W, z = (((N = _ == null ? void 0 : _.like) == null ? void 0 : N.length) || 0) > 0 ? (O = _ == null ? void 0 : _.like) == null ? void 0 : O.map((
|
|
25573
|
+
return ((ce = Q == null ? void 0 : Q.user) == null ? void 0 : ce.id) === (x == null ? void 0 : x.id);
|
|
25574
|
+
}) : !1, ie = W ? W == null ? void 0 : W.id : "", ne = !!W, z = (((N = _ == null ? void 0 : _.like) == null ? void 0 : N.length) || 0) > 0 ? (O = _ == null ? void 0 : _.like) == null ? void 0 : O.map((Q) => {
|
|
25575
25575
|
var ce, G, ve;
|
|
25576
25576
|
return {
|
|
25577
|
-
id: (ce =
|
|
25578
|
-
name: (ve = (G =
|
|
25577
|
+
id: (ce = Q == null ? void 0 : Q.user) == null ? void 0 : ce.id,
|
|
25578
|
+
name: (ve = (G = Q == null ? void 0 : Q.user) == null ? void 0 : G.data) == null ? void 0 : ve.name
|
|
25579
25579
|
};
|
|
25580
25580
|
}) : !1, re = typeof P.data.content == "string" ? (q = P == null ? void 0 : P.data) == null ? void 0 : q.content : (
|
|
25581
25581
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25582
|
-
((U = (
|
|
25582
|
+
((U = (X = P == null ? void 0 : P.data) == null ? void 0 : X.content) == null ? void 0 : U.text) || ""
|
|
25583
25583
|
);
|
|
25584
25584
|
return /* @__PURE__ */ c.jsx(HC, { children: /* @__PURE__ */ c.jsx(
|
|
25585
25585
|
pa,
|
|
@@ -25608,12 +25608,12 @@ const TE = ({
|
|
|
25608
25608
|
createContent: () => null,
|
|
25609
25609
|
deleteContent: () => E({ replyId: $ }),
|
|
25610
25610
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25611
|
-
updateContent: (
|
|
25611
|
+
updateContent: (Q, { body: ce }) => v({ replyId: $, content: ce })
|
|
25612
25612
|
},
|
|
25613
25613
|
likes: {
|
|
25614
25614
|
createLike: () => w({ replyId: $ }),
|
|
25615
25615
|
deleteLike: () => B({ replyId: $, reactionId: ie }),
|
|
25616
|
-
listLikes: l.list
|
|
25616
|
+
listLikes: (Q) => l.list({ replyId: $, ...Q })
|
|
25617
25617
|
},
|
|
25618
25618
|
comments: {},
|
|
25619
25619
|
mentions: a
|
|
@@ -25894,7 +25894,7 @@ const pa = ({
|
|
|
25894
25894
|
userLiked: re,
|
|
25895
25895
|
comments: F = 0,
|
|
25896
25896
|
mentions: k
|
|
25897
|
-
} = t, N = C && C.id && typeof W != "string" && W.id && W.id === C.id || !1, O = typeof ie == "boolean" ? ie : !0, q = N && (!t.createdAt || $h(t.createdAt, 10, "seconds")),
|
|
25897
|
+
} = t, N = C && C.id && typeof W != "string" && W.id && W.id === C.id || !1, O = typeof ie == "boolean" ? ie : !0, q = N && (!t.createdAt || $h(t.createdAt, 10, "seconds")), X = ke(null), [U, Q] = ue({
|
|
25898
25898
|
title: t && t.body !== t.title && t.title || "",
|
|
25899
25899
|
body: t && t.body || "",
|
|
25900
25900
|
isEditing: !1,
|
|
@@ -25906,7 +25906,7 @@ const pa = ({
|
|
|
25906
25906
|
/* Default */
|
|
25907
25907
|
), [Fe, Ne] = ue("");
|
|
25908
25908
|
de(() => {
|
|
25909
|
-
const De =
|
|
25909
|
+
const De = X.current;
|
|
25910
25910
|
if (!(!De || ve === "default"))
|
|
25911
25911
|
return document.addEventListener(ut.DISCUSSION_FORM_SUBMITTED, Se), De.addEventListener("transitionend", We), () => {
|
|
25912
25912
|
document.removeEventListener(
|
|
@@ -25915,7 +25915,7 @@ const pa = ({
|
|
|
25915
25915
|
), De.removeEventListener("transitionend", We);
|
|
25916
25916
|
};
|
|
25917
25917
|
}, []), de(() => {
|
|
25918
|
-
|
|
25918
|
+
Q({
|
|
25919
25919
|
...U,
|
|
25920
25920
|
title: t && t.title || "",
|
|
25921
25921
|
body: t && t.body || "",
|
|
@@ -25929,7 +25929,7 @@ const pa = ({
|
|
|
25929
25929
|
k,
|
|
25930
25930
|
j
|
|
25931
25931
|
);
|
|
25932
|
-
|
|
25932
|
+
Q({ ...U, postBody: Oe });
|
|
25933
25933
|
})();
|
|
25934
25934
|
}, [U.body, k]);
|
|
25935
25935
|
const Se = () => {
|
|
@@ -25943,7 +25943,7 @@ const pa = ({
|
|
|
25943
25943
|
De === "background-color" && xe((Oe) => (Oe === "default" && (document.removeEventListener(
|
|
25944
25944
|
ut.DISCUSSION_FORM_SUBMITTED,
|
|
25945
25945
|
Se
|
|
25946
|
-
),
|
|
25946
|
+
), X.current && X.current.removeEventListener("transitionend", We)), Oe === "fading" ? "default" : Oe));
|
|
25947
25947
|
};
|
|
25948
25948
|
if (i || !t || t.type === "answer" && (!t.slugs || !t.slugs.question) || U.postBody === "" && t.title === "")
|
|
25949
25949
|
return /* @__PURE__ */ c.jsx(qt, { className: "discussion-card" });
|
|
@@ -25957,7 +25957,7 @@ const pa = ({
|
|
|
25957
25957
|
const st = t.type === "question" ? { title: Oe } : { title: De, body: Oe };
|
|
25958
25958
|
await L(_c(t.slugs), st);
|
|
25959
25959
|
}
|
|
25960
|
-
|
|
25960
|
+
Q({ ...U, title: De, body: Oe, isEditing: !1, didEdit: !0 });
|
|
25961
25961
|
} catch {
|
|
25962
25962
|
Ne(`${Ht}form_error`);
|
|
25963
25963
|
}
|
|
@@ -26002,7 +26002,7 @@ const pa = ({
|
|
|
26002
26002
|
return n && N && ge.push(
|
|
26003
26003
|
{
|
|
26004
26004
|
text: x.formatMessage({ id: `${Ht}moreMenu_edit` }),
|
|
26005
|
-
onClick: () =>
|
|
26005
|
+
onClick: () => Q({ ...U, isEditing: !0 }),
|
|
26006
26006
|
icon: "pencil-paper",
|
|
26007
26007
|
className: "gtm-trackable",
|
|
26008
26008
|
"data-gtm-event-context": d,
|
|
@@ -26028,13 +26028,13 @@ const pa = ({
|
|
|
26028
26028
|
className: "gtm-trackable",
|
|
26029
26029
|
"data-gtm-event-context": d,
|
|
26030
26030
|
"data-gtm-event-type": `edit-${t.type}-click`
|
|
26031
|
-
}), f && ((Ae =
|
|
26031
|
+
}), f && ((Ae = X == null ? void 0 : X.current) == null || Ae.focus(), (je = X == null ? void 0 : X.current) == null || je.scrollIntoView({ behavior: "smooth" })), te.createElement(e, {
|
|
26032
26032
|
className: H("discussion-post", u, {
|
|
26033
26033
|
[ve]: !u || !u.includes("highlighted-text-box"),
|
|
26034
26034
|
"has-link": l.post && !U.isEditing,
|
|
26035
26035
|
"is-pinned": (t == null ? void 0 : t.pinned) || !1
|
|
26036
26036
|
}),
|
|
26037
|
-
ref:
|
|
26037
|
+
ref: X,
|
|
26038
26038
|
tabIndex: f ? 0 : null,
|
|
26039
26039
|
"data-testid": `discussion-${t.type}-thread`,
|
|
26040
26040
|
"data-gtm-event-context": `${d}-post-click`,
|
|
@@ -26109,7 +26109,7 @@ const pa = ({
|
|
|
26109
26109
|
create: I,
|
|
26110
26110
|
handleSaveEdit: Ge,
|
|
26111
26111
|
handleCancel: () => {
|
|
26112
|
-
Ne(""),
|
|
26112
|
+
Ne(""), Q({ ...U, isEditing: !1 });
|
|
26113
26113
|
},
|
|
26114
26114
|
listMembers: j,
|
|
26115
26115
|
clickMentionFallback: V
|