bi-components-library 1.3.7-next.4 → 1.3.7-next.5
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/dist/index.es.js +468 -463
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +12 -12
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as v, jsxs as W, Fragment as nt } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import Ee, { useState as G, useRef as te, useMemo as Be, useCallback as $, useEffect as be, createContext as Bo, useContext as dh, useLayoutEffect as Ue, useDebugValue as fh, forwardRef as Jb } from "react";
|
|
3
3
|
import { Button as ur, Card as Fo, Modal as Zb, Table as Ho, Flex as pc, Spin as fi, Empty as e1, Select as Xl, Form as ma, Input as Uo, Space as t1, unstableSetRender as n1, Tooltip as zo, DatePicker as r1, Cascader as l1, Popover as qa, Image as hh, App as Vn, Dropdown as ph, Popconfirm as a1, ConfigProvider as i1, Progress as s1, Pagination as o1, theme as u1 } from "antd";
|
|
4
4
|
import { createFromIconfontCN as c1, LeftOutlined as d1, SearchOutlined as f1, ReloadOutlined as h1, CloseCircleFilled as mh, InfoCircleOutlined as p1, SendOutlined as m1, PauseCircleOutlined as b1, PlayCircleOutlined as g1 } from "@ant-design/icons";
|
|
5
5
|
import { createRoot as v1 } from "react-dom/client";
|
|
@@ -755,7 +755,7 @@ const O1 = ({ node: e, value: t, onChange: n, index: r }) => {
|
|
|
755
755
|
}, M1 = /[;;,,。.!!??::、]/, R1 = (e) => {
|
|
756
756
|
const t = (e ?? "").trim();
|
|
757
757
|
return t.length === 1 && M1.test(t);
|
|
758
|
-
}, gh =
|
|
758
|
+
}, gh = Ee.memo(({ node: e }) => {
|
|
759
759
|
if (R1(e.text) && !e.className && !e.exclusionGroup)
|
|
760
760
|
return /* @__PURE__ */ v("span", { "data-type": "text", className: "rte-inline-punct", contentEditable: !1, children: (e.text ?? "").trim() });
|
|
761
761
|
const t = (e.text ?? "").replace(/\n/g, "<br/>"), n = /* @__PURE__ */ v(
|
|
@@ -794,7 +794,7 @@ const D1 = {
|
|
|
794
794
|
overlayInnerStyle: D1,
|
|
795
795
|
children: e
|
|
796
796
|
}
|
|
797
|
-
), L1 = (e) => e ? typeof e == "string" ? e : JSON.stringify(e) : "", vh =
|
|
797
|
+
), L1 = (e) => e ? typeof e == "string" ? e : JSON.stringify(e) : "", vh = Ee.memo(({ node: e, hideClose: t, onClose: n, tooltipZIndex: r }) => {
|
|
798
798
|
const l = L1(e.tooltip), a = /* @__PURE__ */ v(
|
|
799
799
|
"span",
|
|
800
800
|
{
|
|
@@ -4678,25 +4678,25 @@ function f2(e, t, n) {
|
|
|
4678
4678
|
P
|
|
4679
4679
|
])
|
|
4680
4680
|
) : X(P);
|
|
4681
|
-
function X(
|
|
4681
|
+
function X(Se) {
|
|
4682
4682
|
return he;
|
|
4683
4683
|
function he(we) {
|
|
4684
|
-
const
|
|
4684
|
+
const Le = we !== null && Se[we], _e = we !== null && Se.null, lt = [
|
|
4685
4685
|
// To do: add more extension tests.
|
|
4686
4686
|
/* c8 ignore next 2 */
|
|
4687
|
-
...Array.isArray(
|
|
4687
|
+
...Array.isArray(Le) ? Le : Le ? [Le] : [],
|
|
4688
4688
|
...Array.isArray(_e) ? _e : _e ? [_e] : []
|
|
4689
4689
|
];
|
|
4690
4690
|
return ie(lt)(we);
|
|
4691
4691
|
}
|
|
4692
4692
|
}
|
|
4693
|
-
function ie(
|
|
4694
|
-
return U =
|
|
4693
|
+
function ie(Se) {
|
|
4694
|
+
return U = Se, q = 0, Se.length === 0 ? B : R(Se[q]);
|
|
4695
4695
|
}
|
|
4696
|
-
function R(
|
|
4696
|
+
function R(Se) {
|
|
4697
4697
|
return he;
|
|
4698
4698
|
function he(we) {
|
|
4699
|
-
return T = S(), Z =
|
|
4699
|
+
return T = S(), Z = Se, Se.partial || (u.currentConstruct = Se), Se.name && u.parser.constructs.disable.null.includes(Se.name) ? ve() : Se.tokenize.call(
|
|
4700
4700
|
// If we do have fields, create an object w/ `context` as its
|
|
4701
4701
|
// prototype.
|
|
4702
4702
|
// This allows a “live binding”, which is needed for `interrupt`.
|
|
@@ -4707,10 +4707,10 @@ function f2(e, t, n) {
|
|
|
4707
4707
|
)(we);
|
|
4708
4708
|
}
|
|
4709
4709
|
}
|
|
4710
|
-
function fe(
|
|
4710
|
+
function fe(Se) {
|
|
4711
4711
|
return _(Z, T), E;
|
|
4712
4712
|
}
|
|
4713
|
-
function ve(
|
|
4713
|
+
function ve(Se) {
|
|
4714
4714
|
return T.restore(), ++q < U.length ? R(U[q]) : B;
|
|
4715
4715
|
}
|
|
4716
4716
|
}
|
|
@@ -4891,8 +4891,8 @@ function C2(e) {
|
|
|
4891
4891
|
definitionLabelString: i,
|
|
4892
4892
|
definitionTitleString: i,
|
|
4893
4893
|
emphasis: a(qe),
|
|
4894
|
-
hardBreakEscape: a(
|
|
4895
|
-
hardBreakTrailing: a(
|
|
4894
|
+
hardBreakEscape: a(ke),
|
|
4895
|
+
hardBreakTrailing: a(ke),
|
|
4896
4896
|
htmlFlow: a(Ve, i),
|
|
4897
4897
|
htmlFlowData: S,
|
|
4898
4898
|
htmlText: a(Ve, i),
|
|
@@ -4917,13 +4917,13 @@ function C2(e) {
|
|
|
4917
4917
|
atxHeading: o(),
|
|
4918
4918
|
atxHeadingSequence: M,
|
|
4919
4919
|
autolink: o(),
|
|
4920
|
-
autolinkEmail:
|
|
4920
|
+
autolinkEmail: Le,
|
|
4921
4921
|
autolinkProtocol: we,
|
|
4922
4922
|
blockQuote: o(),
|
|
4923
4923
|
characterEscapeValue: O,
|
|
4924
4924
|
characterReferenceMarkerHexadecimal: ve,
|
|
4925
4925
|
characterReferenceMarkerNumeric: ve,
|
|
4926
|
-
characterReferenceValue:
|
|
4926
|
+
characterReferenceValue: Se,
|
|
4927
4927
|
characterReference: he,
|
|
4928
4928
|
codeFenced: o(b),
|
|
4929
4929
|
codeFencedFence: g,
|
|
@@ -4982,21 +4982,21 @@ function C2(e) {
|
|
|
4982
4982
|
buffer: i,
|
|
4983
4983
|
resume: c,
|
|
4984
4984
|
data: n
|
|
4985
|
-
},
|
|
4986
|
-
let
|
|
4987
|
-
for (; ++
|
|
4988
|
-
if (j[
|
|
4989
|
-
if (j[
|
|
4990
|
-
|
|
4985
|
+
}, Ce = [];
|
|
4986
|
+
let Pe = -1;
|
|
4987
|
+
for (; ++Pe < j.length; )
|
|
4988
|
+
if (j[Pe][1].type === "listOrdered" || j[Pe][1].type === "listUnordered")
|
|
4989
|
+
if (j[Pe][0] === "enter")
|
|
4990
|
+
Ce.push(Pe);
|
|
4991
4991
|
else {
|
|
4992
|
-
const It =
|
|
4993
|
-
|
|
4992
|
+
const It = Ce.pop();
|
|
4993
|
+
Pe = l(j, It, Pe);
|
|
4994
4994
|
}
|
|
4995
|
-
for (
|
|
4996
|
-
const It = t[j[
|
|
4997
|
-
Wh.call(It, j[
|
|
4998
|
-
sliceSerialize: j[
|
|
4999
|
-
}, pe), j[
|
|
4995
|
+
for (Pe = -1; ++Pe < j.length; ) {
|
|
4996
|
+
const It = t[j[Pe][0]];
|
|
4997
|
+
Wh.call(It, j[Pe][1].type) && It[j[Pe][1].type].call(Object.assign({
|
|
4998
|
+
sliceSerialize: j[Pe][2].sliceSerialize
|
|
4999
|
+
}, pe), j[Pe][1]);
|
|
5000
5000
|
}
|
|
5001
5001
|
if (pe.tokenStack.length > 0) {
|
|
5002
5002
|
const It = pe.tokenStack[pe.tokenStack.length - 1];
|
|
@@ -5013,23 +5013,23 @@ function C2(e) {
|
|
|
5013
5013
|
column: 1,
|
|
5014
5014
|
offset: 0
|
|
5015
5015
|
})
|
|
5016
|
-
},
|
|
5017
|
-
le = t.transforms[
|
|
5016
|
+
}, Pe = -1; ++Pe < t.transforms.length; )
|
|
5017
|
+
le = t.transforms[Pe](le) || le;
|
|
5018
5018
|
return le;
|
|
5019
5019
|
}
|
|
5020
5020
|
function l(j, le, pe) {
|
|
5021
|
-
let
|
|
5022
|
-
for (; ++
|
|
5023
|
-
const Xe = j[
|
|
5021
|
+
let Ce = le - 1, Pe = -1, It = !1, Lt, ct, yn, En;
|
|
5022
|
+
for (; ++Ce <= pe; ) {
|
|
5023
|
+
const Xe = j[Ce];
|
|
5024
5024
|
switch (Xe[1].type) {
|
|
5025
5025
|
case "listUnordered":
|
|
5026
5026
|
case "listOrdered":
|
|
5027
5027
|
case "blockQuote": {
|
|
5028
|
-
Xe[0] === "enter" ?
|
|
5028
|
+
Xe[0] === "enter" ? Pe++ : Pe--, En = void 0;
|
|
5029
5029
|
break;
|
|
5030
5030
|
}
|
|
5031
5031
|
case "lineEndingBlank": {
|
|
5032
|
-
Xe[0] === "enter" && (Lt && !En && !
|
|
5032
|
+
Xe[0] === "enter" && (Lt && !En && !Pe && !yn && (yn = Ce), En = void 0);
|
|
5033
5033
|
break;
|
|
5034
5034
|
}
|
|
5035
5035
|
case "linePrefix":
|
|
@@ -5041,9 +5041,9 @@ function C2(e) {
|
|
|
5041
5041
|
default:
|
|
5042
5042
|
En = void 0;
|
|
5043
5043
|
}
|
|
5044
|
-
if (!
|
|
5044
|
+
if (!Pe && Xe[0] === "enter" && Xe[1].type === "listItemPrefix" || Pe === -1 && Xe[0] === "exit" && (Xe[1].type === "listUnordered" || Xe[1].type === "listOrdered")) {
|
|
5045
5045
|
if (Lt) {
|
|
5046
|
-
let sn =
|
|
5046
|
+
let sn = Ce;
|
|
5047
5047
|
for (ct = void 0; sn--; ) {
|
|
5048
5048
|
const Ct = j[sn];
|
|
5049
5049
|
if (Ct[1].type === "lineEnding" || Ct[1].type === "lineEndingBlank") {
|
|
@@ -5051,7 +5051,7 @@ function C2(e) {
|
|
|
5051
5051
|
ct && (j[ct][1].type = "lineEndingBlank", It = !0), Ct[1].type = "lineEnding", ct = sn;
|
|
5052
5052
|
} else if (!(Ct[1].type === "linePrefix" || Ct[1].type === "blockQuotePrefix" || Ct[1].type === "blockQuotePrefixWhitespace" || Ct[1].type === "blockQuoteMarker" || Ct[1].type === "listItemIndent")) break;
|
|
5053
5053
|
}
|
|
5054
|
-
yn && (!ct || yn < ct) && (Lt._spread = !0), Lt.end = Object.assign({}, ct ? j[ct][1].start : Xe[1].end), j.splice(ct ||
|
|
5054
|
+
yn && (!ct || yn < ct) && (Lt._spread = !0), Lt.end = Object.assign({}, ct ? j[ct][1].start : Xe[1].end), j.splice(ct || Ce, 0, ["exit", Lt, Xe[2]]), Ce++, pe++;
|
|
5055
5055
|
}
|
|
5056
5056
|
if (Xe[1].type === "listItemPrefix") {
|
|
5057
5057
|
const sn = {
|
|
@@ -5061,7 +5061,7 @@ function C2(e) {
|
|
|
5061
5061
|
// @ts-expect-error: we’ll add `end` in a second.
|
|
5062
5062
|
end: void 0
|
|
5063
5063
|
};
|
|
5064
|
-
Lt = sn, j.splice(
|
|
5064
|
+
Lt = sn, j.splice(Ce, 0, ["enter", sn, Xe[2]]), Ce++, pe++, yn = void 0, En = !0;
|
|
5065
5065
|
}
|
|
5066
5066
|
}
|
|
5067
5067
|
}
|
|
@@ -5069,8 +5069,8 @@ function C2(e) {
|
|
|
5069
5069
|
}
|
|
5070
5070
|
function a(j, le) {
|
|
5071
5071
|
return pe;
|
|
5072
|
-
function pe(
|
|
5073
|
-
s.call(this, j(
|
|
5072
|
+
function pe(Ce) {
|
|
5073
|
+
s.call(this, j(Ce), Ce), le && le.call(this, Ce);
|
|
5074
5074
|
}
|
|
5075
5075
|
}
|
|
5076
5076
|
function i() {
|
|
@@ -5093,9 +5093,9 @@ function C2(e) {
|
|
|
5093
5093
|
}
|
|
5094
5094
|
}
|
|
5095
5095
|
function u(j, le) {
|
|
5096
|
-
const pe = this.stack.pop(),
|
|
5097
|
-
if (
|
|
5098
|
-
|
|
5096
|
+
const pe = this.stack.pop(), Ce = this.tokenStack.pop();
|
|
5097
|
+
if (Ce)
|
|
5098
|
+
Ce[0].type !== j.type && (le ? le.call(this, j, Ce[0]) : (Ce[1] || Fc).call(this, j, Ce[0]));
|
|
5099
5099
|
else throw new Error("Cannot close `" + j.type + "` (" + Tl({
|
|
5100
5100
|
start: j.start,
|
|
5101
5101
|
end: j.end
|
|
@@ -5164,12 +5164,12 @@ function C2(e) {
|
|
|
5164
5164
|
}
|
|
5165
5165
|
function S(j) {
|
|
5166
5166
|
const pe = this.stack[this.stack.length - 1].children;
|
|
5167
|
-
let
|
|
5168
|
-
(!
|
|
5167
|
+
let Ce = pe[pe.length - 1];
|
|
5168
|
+
(!Ce || Ce.type !== "text") && (Ce = jt(), Ce.position = {
|
|
5169
5169
|
start: Tn(j.start),
|
|
5170
5170
|
// @ts-expect-error: we’ll add `end` later.
|
|
5171
5171
|
end: void 0
|
|
5172
|
-
}, pe.push(
|
|
5172
|
+
}, pe.push(Ce)), this.stack.push(Ce);
|
|
5173
5173
|
}
|
|
5174
5174
|
function O(j) {
|
|
5175
5175
|
const le = this.stack.pop();
|
|
@@ -5224,8 +5224,8 @@ function C2(e) {
|
|
|
5224
5224
|
function Z() {
|
|
5225
5225
|
const j = this.stack[this.stack.length - 1], le = this.resume(), pe = this.stack[this.stack.length - 1];
|
|
5226
5226
|
if (this.data.inReference = !0, pe.type === "link") {
|
|
5227
|
-
const
|
|
5228
|
-
pe.children =
|
|
5227
|
+
const Ce = j.children;
|
|
5228
|
+
pe.children = Ce;
|
|
5229
5229
|
} else
|
|
5230
5230
|
pe.alt = le;
|
|
5231
5231
|
}
|
|
@@ -5250,12 +5250,12 @@ function C2(e) {
|
|
|
5250
5250
|
function ve(j) {
|
|
5251
5251
|
this.data.characterReferenceType = j.type;
|
|
5252
5252
|
}
|
|
5253
|
-
function
|
|
5253
|
+
function Se(j) {
|
|
5254
5254
|
const le = this.sliceSerialize(j), pe = this.data.characterReferenceType;
|
|
5255
|
-
let
|
|
5256
|
-
pe ? (
|
|
5257
|
-
const
|
|
5258
|
-
|
|
5255
|
+
let Ce;
|
|
5256
|
+
pe ? (Ce = Lh(le, pe === "characterReferenceMarkerNumeric" ? 10 : 16), this.data.characterReferenceType = void 0) : Ce = Pl(le);
|
|
5257
|
+
const Pe = this.stack[this.stack.length - 1];
|
|
5258
|
+
Pe.value += Ce;
|
|
5259
5259
|
}
|
|
5260
5260
|
function he(j) {
|
|
5261
5261
|
const le = this.stack.pop();
|
|
@@ -5266,7 +5266,7 @@ function C2(e) {
|
|
|
5266
5266
|
const le = this.stack[this.stack.length - 1];
|
|
5267
5267
|
le.url = this.sliceSerialize(j);
|
|
5268
5268
|
}
|
|
5269
|
-
function
|
|
5269
|
+
function Le(j) {
|
|
5270
5270
|
O.call(this, j);
|
|
5271
5271
|
const le = this.stack[this.stack.length - 1];
|
|
5272
5272
|
le.url = "mailto:" + this.sliceSerialize(j);
|
|
@@ -5314,7 +5314,7 @@ function C2(e) {
|
|
|
5314
5314
|
children: []
|
|
5315
5315
|
};
|
|
5316
5316
|
}
|
|
5317
|
-
function
|
|
5317
|
+
function ke() {
|
|
5318
5318
|
return {
|
|
5319
5319
|
type: "break"
|
|
5320
5320
|
};
|
|
@@ -15403,7 +15403,7 @@ const d6 = {
|
|
|
15403
15403
|
}
|
|
15404
15404
|
) })
|
|
15405
15405
|
] });
|
|
15406
|
-
}, T6 = (e) => e ? typeof e == "string" ? e : JSON.stringify(e) : "", qp =
|
|
15406
|
+
}, T6 = (e) => e ? typeof e == "string" ? e : JSON.stringify(e) : "", qp = Ee.memo(
|
|
15407
15407
|
({ node: e, value: t, onChange: n, disabled: r, error: l }) => {
|
|
15408
15408
|
const a = T6(e.tooltip), i = t ?? "", s = e.placeholder || "", o = i.length > 0, u = la(e.tooltip), c = !!u, d = !!a && !c && !o, h = !!a && !c, f = te(null), m = te(null), g = te(i), [b, y] = G(
|
|
15409
15409
|
() => i.includes(`
|
|
@@ -15497,7 +15497,7 @@ const d6 = {
|
|
|
15497
15497
|
}
|
|
15498
15498
|
);
|
|
15499
15499
|
qp.displayName = "VariableNode";
|
|
15500
|
-
const Wp =
|
|
15500
|
+
const Wp = Ee.memo(
|
|
15501
15501
|
({ node: e, value: t, onChange: n, disabled: r, error: l }) => {
|
|
15502
15502
|
const a = t === void 0 && typeof e.defaultNumber == "number" ? String(e.defaultNumber) : t ?? "", i = a !== "", s = $(
|
|
15503
15503
|
(g) => {
|
|
@@ -15647,7 +15647,7 @@ const Ta = {
|
|
|
15647
15647
|
htmlRegion: "visible",
|
|
15648
15648
|
dynamicInset: !0
|
|
15649
15649
|
}
|
|
15650
|
-
}, Yp =
|
|
15650
|
+
}, Yp = Ee.memo(
|
|
15651
15651
|
({ node: e, value: t, onChange: n, disabled: r, error: l }) => {
|
|
15652
15652
|
const a = $(
|
|
15653
15653
|
(h) => n(e.key, h),
|
|
@@ -15728,7 +15728,7 @@ const Ta = {
|
|
|
15728
15728
|
}
|
|
15729
15729
|
);
|
|
15730
15730
|
Yp.displayName = "SelectNode";
|
|
15731
|
-
const jp =
|
|
15731
|
+
const jp = Ee.memo(
|
|
15732
15732
|
({ node: e, value: t, onChange: n, disabled: r, error: l }) => {
|
|
15733
15733
|
const a = e.placeholder || "搜索或输入", i = Be(
|
|
15734
15734
|
() => e.options ?? [],
|
|
@@ -15780,14 +15780,14 @@ const jp = ye.memo(
|
|
|
15780
15780
|
const _e = window.getComputedStyle(V);
|
|
15781
15781
|
fe = (Number.parseFloat(_e.paddingLeft) || 0) + (Number.parseFloat(_e.paddingRight) || 0);
|
|
15782
15782
|
}
|
|
15783
|
-
const ve = N.querySelector(".ant-select-arrow"),
|
|
15783
|
+
const ve = N.querySelector(".ant-select-arrow"), Se = ve ? Math.ceil(ve.getBoundingClientRect().width) : 12, he = N.querySelector(".ant-select-clear");
|
|
15784
15784
|
let we = 0;
|
|
15785
15785
|
if (he) {
|
|
15786
15786
|
const _e = window.getComputedStyle(he);
|
|
15787
15787
|
_e.display !== "none" && _e.visibility !== "hidden" && (we = Math.ceil(he.getBoundingClientRect().width));
|
|
15788
15788
|
}
|
|
15789
|
-
const
|
|
15790
|
-
f((_e) => _e ===
|
|
15789
|
+
const Le = Math.min(240, Math.max(80, R + fe + Se + we + 4));
|
|
15790
|
+
f((_e) => _e === Le ? _e : Le);
|
|
15791
15791
|
}, [D]);
|
|
15792
15792
|
Ue(() => {
|
|
15793
15793
|
const N = window.requestAnimationFrame(() => M()), S = window.setTimeout(() => M(), 60);
|
|
@@ -16052,12 +16052,12 @@ function Kp() {
|
|
|
16052
16052
|
}, E.valueOf = function() {
|
|
16053
16053
|
return this.$d.getTime();
|
|
16054
16054
|
}, E.startOf = function(B, U) {
|
|
16055
|
-
var q = this, Z = !!_.u(U) || U, T = _.p(B), X = function(
|
|
16056
|
-
var lt = _.w(q.$u ? Date.UTC(q.$y, _e,
|
|
16055
|
+
var q = this, Z = !!_.u(U) || U, T = _.p(B), X = function(Le, _e) {
|
|
16056
|
+
var lt = _.w(q.$u ? Date.UTC(q.$y, _e, Le) : new Date(q.$y, _e, Le), q);
|
|
16057
16057
|
return Z ? lt : lt.endOf(u);
|
|
16058
|
-
}, ie = function(
|
|
16059
|
-
return _.w(q.toDate()[
|
|
16060
|
-
}, R = this.$W, fe = this.$M, ve = this.$D,
|
|
16058
|
+
}, ie = function(Le, _e) {
|
|
16059
|
+
return _.w(q.toDate()[Le].apply(q.toDate("s"), (Z ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(_e)), q);
|
|
16060
|
+
}, R = this.$W, fe = this.$M, ve = this.$D, Se = "set" + (this.$u ? "UTC" : "");
|
|
16061
16061
|
switch (T) {
|
|
16062
16062
|
case f:
|
|
16063
16063
|
return Z ? X(1, 0) : X(31, 11);
|
|
@@ -16068,13 +16068,13 @@ function Kp() {
|
|
|
16068
16068
|
return X(Z ? ve - we : ve + (6 - we), fe);
|
|
16069
16069
|
case u:
|
|
16070
16070
|
case m:
|
|
16071
|
-
return ie(
|
|
16071
|
+
return ie(Se + "Hours", 0);
|
|
16072
16072
|
case o:
|
|
16073
|
-
return ie(
|
|
16073
|
+
return ie(Se + "Minutes", 1);
|
|
16074
16074
|
case s:
|
|
16075
|
-
return ie(
|
|
16075
|
+
return ie(Se + "Seconds", 2);
|
|
16076
16076
|
case i:
|
|
16077
|
-
return ie(
|
|
16077
|
+
return ie(Se + "Milliseconds", 3);
|
|
16078
16078
|
default:
|
|
16079
16079
|
return this.clone();
|
|
16080
16080
|
}
|
|
@@ -16109,11 +16109,11 @@ function Kp() {
|
|
|
16109
16109
|
}, E.format = function(B) {
|
|
16110
16110
|
var U = this, q = this.$locale();
|
|
16111
16111
|
if (!this.isValid()) return q.invalidDate || g;
|
|
16112
|
-
var Z = B || "YYYY-MM-DDTHH:mm:ssZ", T = _.z(this), X = this.$H, ie = this.$m, R = this.$M, fe = q.weekdays, ve = q.months,
|
|
16112
|
+
var Z = B || "YYYY-MM-DDTHH:mm:ssZ", T = _.z(this), X = this.$H, ie = this.$m, R = this.$M, fe = q.weekdays, ve = q.months, Se = q.meridiem, he = function(_e, lt, Vt, ln) {
|
|
16113
16113
|
return _e && (_e[lt] || _e(U, Z)) || Vt[lt].slice(0, ln);
|
|
16114
16114
|
}, we = function(_e) {
|
|
16115
16115
|
return _.s(X % 12 || 12, _e, "0");
|
|
16116
|
-
},
|
|
16116
|
+
}, Le = Se || function(_e, lt, Vt) {
|
|
16117
16117
|
var ln = _e < 12 ? "AM" : "PM";
|
|
16118
16118
|
return Vt ? ln.toLowerCase() : ln;
|
|
16119
16119
|
};
|
|
@@ -16153,9 +16153,9 @@ function Kp() {
|
|
|
16153
16153
|
case "hh":
|
|
16154
16154
|
return we(2);
|
|
16155
16155
|
case "a":
|
|
16156
|
-
return
|
|
16156
|
+
return Le(X, ie, !0);
|
|
16157
16157
|
case "A":
|
|
16158
|
-
return
|
|
16158
|
+
return Le(X, ie, !1);
|
|
16159
16159
|
case "m":
|
|
16160
16160
|
return String(ie);
|
|
16161
16161
|
case "mm":
|
|
@@ -16268,7 +16268,7 @@ const { RangePicker: M6 } = r1, R6 = (e) => {
|
|
|
16268
16268
|
if (t.length !== 2 || !t[0] || !t[1]) return null;
|
|
16269
16269
|
const n = Ka(t[0]), r = Ka(t[1]);
|
|
16270
16270
|
return n.isValid() && r.isValid() ? [n, r] : null;
|
|
16271
|
-
}, Qp =
|
|
16271
|
+
}, Qp = Ee.memo(
|
|
16272
16272
|
({ node: e, value: t, onChange: n, disabled: r, error: l }) => {
|
|
16273
16273
|
const a = R6(t), [i, s] = G(null), o = $(
|
|
16274
16274
|
(h) => {
|
|
@@ -22189,7 +22189,7 @@ const D6 = [
|
|
|
22189
22189
|
n.push(a.label), r = a.children;
|
|
22190
22190
|
}
|
|
22191
22191
|
return n;
|
|
22192
|
-
}, Xp =
|
|
22192
|
+
}, Xp = Ee.memo(
|
|
22193
22193
|
({ node: e, value: t, onChange: n, disabled: r, error: l }) => {
|
|
22194
22194
|
const a = e.cascaderOptions && e.cascaderOptions.length > 0 ? e.cascaderOptions : D6, i = e.placeholder || "请选择省市区", s = t ?? e.defaultValue, [o, u] = G(() => Ss(s)), [c, d] = G(0), [h, f] = G(100), m = te(null);
|
|
22195
22195
|
be(() => {
|
|
@@ -22298,7 +22298,7 @@ const D6 = [
|
|
|
22298
22298
|
}
|
|
22299
22299
|
);
|
|
22300
22300
|
Xp.displayName = "CascaderNode";
|
|
22301
|
-
const Jp =
|
|
22301
|
+
const Jp = Ee.memo(
|
|
22302
22302
|
({ node: e, value: t, onChange: n, disabled: r, error: l, nodeDefaults: a }) => {
|
|
22303
22303
|
const i = typeof e.maxHeight == "number" ? e.maxHeight : a?.textarea?.maxHeight ?? 252, s = $(
|
|
22304
22304
|
(o) => n(e.key, o.target.value),
|
|
@@ -22576,7 +22576,7 @@ const fu = (e) => {
|
|
|
22576
22576
|
color: "inherit",
|
|
22577
22577
|
boxSizing: "border-box",
|
|
22578
22578
|
verticalAlign: "middle"
|
|
22579
|
-
}, U6 = (e) => e ? typeof e == "string" ? e : JSON.stringify(e) : "", Zp =
|
|
22579
|
+
}, U6 = (e) => e ? typeof e == "string" ? e : JSON.stringify(e) : "", Zp = Ee.memo(
|
|
22580
22580
|
({
|
|
22581
22581
|
node: e,
|
|
22582
22582
|
value: t,
|
|
@@ -22839,7 +22839,7 @@ const e0 = ({
|
|
|
22839
22839
|
]
|
|
22840
22840
|
}
|
|
22841
22841
|
);
|
|
22842
|
-
}, z6 = (e) => e ? typeof e == "string" ? e : JSON.stringify(e) : "", t0 =
|
|
22842
|
+
}, z6 = (e) => e ? typeof e == "string" ? e : JSON.stringify(e) : "", t0 = Ee.memo(
|
|
22843
22843
|
({
|
|
22844
22844
|
node: e,
|
|
22845
22845
|
value: t,
|
|
@@ -22935,7 +22935,7 @@ function n0(e) {
|
|
|
22935
22935
|
};
|
|
22936
22936
|
}, [e, t]), t;
|
|
22937
22937
|
}
|
|
22938
|
-
const V6 = /\.(png|jpe?g|gif|webp|bmp|svg)(\?.*)?$/i, $6 = (e) => V6.test(e), q6 = (e) => /^image\//i.test(e.type), Ha =
|
|
22938
|
+
const V6 = /\.(png|jpe?g|gif|webp|bmp|svg)(\?.*)?$/i, $6 = (e) => V6.test(e), q6 = (e) => /^image\//i.test(e.type), Ha = Ee.memo(
|
|
22939
22939
|
({
|
|
22940
22940
|
slotKey: e,
|
|
22941
22941
|
file: t,
|
|
@@ -23124,7 +23124,7 @@ const K6 = (e = Date.now()) => e - Dd < G6 ? !1 : (Dd = e, !0), Q6 = 32, X6 = (e
|
|
|
23124
23124
|
}, Z6 = (e) => {
|
|
23125
23125
|
if (e)
|
|
23126
23126
|
return typeof e == "string" ? e : JSON.stringify(e);
|
|
23127
|
-
}, e4 = 12, r0 =
|
|
23127
|
+
}, e4 = 12, r0 = Ee.memo(
|
|
23128
23128
|
({ node: e, files: t, onFileChange: n, disabled: r, error: l, onValidationError: a }) => {
|
|
23129
23129
|
const { message: i } = Vn.useApp(), s = typeof e.maxCount == "number" && typeof e.minCount == "number" && e.maxCount > 1, o = J6(e), u = te(null), c = X6(u), d = la(e.tooltip), h = !!d, f = h ? void 0 : Z6(e.tooltip), m = $(
|
|
23130
23130
|
(_) => {
|
|
@@ -23432,7 +23432,7 @@ const Ld = 2 * Math.PI * 6.5, l0 = "data:image/svg+xml,%3Csvg xmlns='http://www.
|
|
|
23432
23432
|
minWidth: 40,
|
|
23433
23433
|
boxSizing: "border-box",
|
|
23434
23434
|
verticalAlign: "middle"
|
|
23435
|
-
}, a4 = (e) => e ? typeof e == "string" ? e : JSON.stringify(e) : "", o0 =
|
|
23435
|
+
}, a4 = (e) => e ? typeof e == "string" ? e : JSON.stringify(e) : "", o0 = Ee.memo(
|
|
23436
23436
|
({
|
|
23437
23437
|
node: e,
|
|
23438
23438
|
value: t,
|
|
@@ -23476,8 +23476,8 @@ const Ld = 2 * Math.PI * 6.5, l0 = "data:image/svg+xml,%3Csvg xmlns='http://www.
|
|
|
23476
23476
|
try {
|
|
23477
23477
|
const fe = await a({ url: ie });
|
|
23478
23478
|
if (F(), r(e.key, fe.videoUrl), l?.(e.key, fe.thumbnail || ""), c("success"), !fe.thumbnail && fe.videoUrl) {
|
|
23479
|
-
const ve = `/api/download-report-pdf?url=${encodeURIComponent(fe.videoUrl)}`,
|
|
23480
|
-
|
|
23479
|
+
const ve = `/api/download-report-pdf?url=${encodeURIComponent(fe.videoUrl)}`, Se = await n4(ve);
|
|
23480
|
+
Se && y.current === R && l?.(e.key, Se);
|
|
23481
23481
|
}
|
|
23482
23482
|
} catch (fe) {
|
|
23483
23483
|
F(), y.current += 1, r(e.key, ""), l?.(e.key, ""), g(""), c("idle"), d.error(fe instanceof Error ? fe.message : "视频解析失败,请检查链接是否正确");
|
|
@@ -23647,7 +23647,7 @@ const Ld = 2 * Math.PI * 6.5, l0 = "data:image/svg+xml,%3Csvg xmlns='http://www.
|
|
|
23647
23647
|
}
|
|
23648
23648
|
);
|
|
23649
23649
|
o0.displayName = "VideoUrlNode";
|
|
23650
|
-
const i4 = (e) => e ? typeof e == "string" ? e : JSON.stringify(e) : "", s4 = 1024 * 1024 * 1024, o4 = "视频文件不能超过1GB", u0 =
|
|
23650
|
+
const i4 = (e) => e ? typeof e == "string" ? e : JSON.stringify(e) : "", s4 = 1024 * 1024 * 1024, o4 = "视频文件不能超过1GB", u0 = Ee.memo(
|
|
23651
23651
|
({
|
|
23652
23652
|
node: e,
|
|
23653
23653
|
value: t,
|
|
@@ -23988,7 +23988,7 @@ const u4 = "https://sealseek-public-read.oss-cn-hangzhou.aliyuncs.com/file/websi
|
|
|
23988
23988
|
`${M.url}-${C}`
|
|
23989
23989
|
)) })
|
|
23990
23990
|
] }) : null });
|
|
23991
|
-
}, d0 =
|
|
23991
|
+
}, d0 = Ee.memo(
|
|
23992
23992
|
({
|
|
23993
23993
|
node: e,
|
|
23994
23994
|
value: t,
|
|
@@ -24004,8 +24004,8 @@ const u4 = "https://sealseek-public-read.oss-cn-hangzhou.aliyuncs.com/file/websi
|
|
|
24004
24004
|
error: d
|
|
24005
24005
|
}) => {
|
|
24006
24006
|
const h = el(), f = c4(e.tooltip), m = t ?? "", g = !!i, b = !m && !g, y = !!l, A = y && !c && (b || g), k = !y && !!f && b, D = A || k, [M, C] = G(!1), [w, N] = G(!1), S = te({}).current, O = te(""), _ = $(
|
|
24007
|
-
async (
|
|
24008
|
-
const Ve =
|
|
24007
|
+
async (ke) => {
|
|
24008
|
+
const Ve = ke.trim();
|
|
24009
24009
|
if (!(!Ve || !r) && O.current !== Ve) {
|
|
24010
24010
|
O.current = Ve, C(!0);
|
|
24011
24011
|
try {
|
|
@@ -24023,10 +24023,10 @@ const u4 = "https://sealseek-public-read.oss-cn-hangzhou.aliyuncs.com/file/websi
|
|
|
24023
24023
|
const F = $(() => {
|
|
24024
24024
|
_(m);
|
|
24025
24025
|
}, [_, m]), V = $(
|
|
24026
|
-
(
|
|
24026
|
+
(ke) => {
|
|
24027
24027
|
if (!e.key) return;
|
|
24028
|
-
const Ve =
|
|
24029
|
-
Ve.trim() && (
|
|
24028
|
+
const Ve = ke.clipboardData.getData("text/plain");
|
|
24029
|
+
Ve.trim() && (ke.preventDefault(), n(e.key, Ve), N(!1), _(Ve));
|
|
24030
24030
|
},
|
|
24031
24031
|
[e.key, n, _]
|
|
24032
24032
|
), P = $(() => {
|
|
@@ -24034,21 +24034,21 @@ const u4 = "https://sealseek-public-read.oss-cn-hangzhou.aliyuncs.com/file/websi
|
|
|
24034
24034
|
new CustomEvent("rte-report-dropdown-opening", { detail: S })
|
|
24035
24035
|
), N(!0);
|
|
24036
24036
|
}, [S]), E = $(
|
|
24037
|
-
(
|
|
24038
|
-
e.key && (n(e.key,
|
|
24037
|
+
(ke) => {
|
|
24038
|
+
e.key && (n(e.key, ke.url), N(!1), /^https?:\/\//i.test(ke.url) && _(ke.url));
|
|
24039
24039
|
},
|
|
24040
24040
|
[e.key, n, _]
|
|
24041
24041
|
), B = $(
|
|
24042
|
-
(
|
|
24043
|
-
|
|
24042
|
+
(ke) => {
|
|
24043
|
+
ke.preventDefault(), ke.stopPropagation(), e.key && n(e.key, ""), s?.();
|
|
24044
24044
|
},
|
|
24045
24045
|
[e.key, n, s]
|
|
24046
24046
|
);
|
|
24047
24047
|
be(() => {
|
|
24048
|
-
const
|
|
24048
|
+
const ke = (Ve) => {
|
|
24049
24049
|
Ve.detail !== S && N(!1);
|
|
24050
24050
|
};
|
|
24051
|
-
return document.addEventListener("rte-report-dropdown-opening",
|
|
24051
|
+
return document.addEventListener("rte-report-dropdown-opening", ke), () => document.removeEventListener("rte-report-dropdown-opening", ke);
|
|
24052
24052
|
}, [S]);
|
|
24053
24053
|
const U = [
|
|
24054
24054
|
"variable-chip",
|
|
@@ -24057,9 +24057,9 @@ const u4 = "https://sealseek-public-read.oss-cn-hangzhou.aliyuncs.com/file/websi
|
|
|
24057
24057
|
d ? "rte-report-url-error" : "",
|
|
24058
24058
|
D ? "rte-variable-with-icon" : ""
|
|
24059
24059
|
].filter(Boolean).join(" "), q = te(null), Z = te(null), [T, X] = G("bottomLeft"), ie = $(() => {
|
|
24060
|
-
const
|
|
24061
|
-
if (!
|
|
24062
|
-
const Ve =
|
|
24060
|
+
const ke = Z.current;
|
|
24061
|
+
if (!ke) return;
|
|
24062
|
+
const Ve = ke.getBoundingClientRect(), an = 236, Yt = window.innerHeight - Ve.bottom;
|
|
24063
24063
|
X(Yt < an ? "topLeft" : "bottomLeft");
|
|
24064
24064
|
}, []);
|
|
24065
24065
|
Ue(() => {
|
|
@@ -24074,7 +24074,7 @@ const u4 = "https://sealseek-public-read.oss-cn-hangzhou.aliyuncs.com/file/websi
|
|
|
24074
24074
|
);
|
|
24075
24075
|
be(() => {
|
|
24076
24076
|
if (!w) return;
|
|
24077
|
-
const
|
|
24077
|
+
const ke = (Ve) => {
|
|
24078
24078
|
const an = Z.current, Yt = Ve.target;
|
|
24079
24079
|
if (an?.contains(Yt)) return;
|
|
24080
24080
|
const bn = document.querySelectorAll(".rte-report-dropdown-overlay");
|
|
@@ -24082,7 +24082,7 @@ const u4 = "https://sealseek-public-read.oss-cn-hangzhou.aliyuncs.com/file/websi
|
|
|
24082
24082
|
if (bn[gn].contains(Yt)) return;
|
|
24083
24083
|
N(!1);
|
|
24084
24084
|
};
|
|
24085
|
-
return document.addEventListener("mousedown",
|
|
24085
|
+
return document.addEventListener("mousedown", ke), () => document.removeEventListener("mousedown", ke);
|
|
24086
24086
|
}, [w]);
|
|
24087
24087
|
const fe = A ? /* @__PURE__ */ v(
|
|
24088
24088
|
"span",
|
|
@@ -24095,8 +24095,8 @@ const u4 = "https://sealseek-public-read.oss-cn-hangzhou.aliyuncs.com/file/websi
|
|
|
24095
24095
|
"data-key": e.key,
|
|
24096
24096
|
"data-node-type": "report-url",
|
|
24097
24097
|
contentEditable: !1,
|
|
24098
|
-
onClick: (
|
|
24099
|
-
|
|
24098
|
+
onClick: (ke) => {
|
|
24099
|
+
ke.stopPropagation(), w ? N(!1) : P();
|
|
24100
24100
|
},
|
|
24101
24101
|
children: /* @__PURE__ */ v(
|
|
24102
24102
|
"i",
|
|
@@ -24121,19 +24121,19 @@ const u4 = "https://sealseek-public-read.oss-cn-hangzhou.aliyuncs.com/file/websi
|
|
|
24121
24121
|
onMouseDown: B,
|
|
24122
24122
|
children: /* @__PURE__ */ v("span", { className: "rte-report-chip-clear-icon", title: "清除", children: /* @__PURE__ */ v(mh, {}) })
|
|
24123
24123
|
}
|
|
24124
|
-
) : null,
|
|
24124
|
+
) : null, Se = e.placeholder ?? "粘贴报告链接", he = m || Se, we = te(null), [Le, _e] = G(0);
|
|
24125
24125
|
Ue(() => {
|
|
24126
24126
|
we.current && _e(we.current.offsetWidth);
|
|
24127
24127
|
});
|
|
24128
|
-
const lt =
|
|
24128
|
+
const lt = Le > 0 ? Math.max(60, Le + 2) : f4(he) + 6, Vt = Be(() => {
|
|
24129
24129
|
if (g) return "";
|
|
24130
|
-
const
|
|
24131
|
-
return /^https?:\/\//i.test(
|
|
24130
|
+
const ke = m.trim();
|
|
24131
|
+
return /^https?:\/\//i.test(ke) ? c0(ke) : "";
|
|
24132
24132
|
}, [m, g]), ln = $(
|
|
24133
|
-
(
|
|
24133
|
+
(ke) => {
|
|
24134
24134
|
if (!g || c || !A) return;
|
|
24135
|
-
const Ve =
|
|
24136
|
-
Ve.closest(".rte-report-chip-clear-host") || Ve.closest(".rte-report-dropdown-host") || (
|
|
24135
|
+
const Ve = ke.target;
|
|
24136
|
+
Ve.closest(".rte-report-chip-clear-host") || Ve.closest(".rte-report-dropdown-host") || (ke.stopPropagation(), w ? N(!1) : P());
|
|
24137
24137
|
},
|
|
24138
24138
|
[g, c, A, w, P]
|
|
24139
24139
|
), qe = /* @__PURE__ */ W(
|
|
@@ -24173,7 +24173,7 @@ const u4 = "https://sealseek-public-read.oss-cn-hangzhou.aliyuncs.com/file/websi
|
|
|
24173
24173
|
"data-type": "report-url",
|
|
24174
24174
|
"data-key": e.key,
|
|
24175
24175
|
value: m,
|
|
24176
|
-
onChange: (
|
|
24176
|
+
onChange: (ke) => n(e.key, ke.target.value),
|
|
24177
24177
|
onBlur: F,
|
|
24178
24178
|
onPaste: V,
|
|
24179
24179
|
onClick: () => {
|
|
@@ -24181,7 +24181,7 @@ const u4 = "https://sealseek-public-read.oss-cn-hangzhou.aliyuncs.com/file/websi
|
|
|
24181
24181
|
Z.current?.querySelector(".rte-report-dropdown-host")?.click();
|
|
24182
24182
|
},
|
|
24183
24183
|
disabled: c || M,
|
|
24184
|
-
placeholder:
|
|
24184
|
+
placeholder: Se,
|
|
24185
24185
|
style: { ...d4, width: lt }
|
|
24186
24186
|
}
|
|
24187
24187
|
),
|
|
@@ -24245,7 +24245,7 @@ const u4 = "https://sealseek-public-read.oss-cn-hangzhou.aliyuncs.com/file/websi
|
|
|
24245
24245
|
);
|
|
24246
24246
|
d0.displayName = "ReportUrlNode";
|
|
24247
24247
|
function p4(e, t) {
|
|
24248
|
-
const n =
|
|
24248
|
+
const n = Ee.memo(({ node: r, value: l, onChange: a, disabled: i, error: s }) => {
|
|
24249
24249
|
const o = r.moduleIndex ?? 0, u = `${r.key}__module_${o}`, c = te(null), d = l ?? r.text ?? "";
|
|
24250
24250
|
Ue(() => {
|
|
24251
24251
|
const b = c.current;
|
|
@@ -24286,7 +24286,7 @@ const f0 = { createModuleNode: p4 }, m4 = f0.createModuleNode(
|
|
|
24286
24286
|
"ReportModuleNode"
|
|
24287
24287
|
);
|
|
24288
24288
|
function h0(e, t) {
|
|
24289
|
-
const n =
|
|
24289
|
+
const n = Ee.memo(
|
|
24290
24290
|
({ node: r, value: l, onChange: a, onParse: i, disabled: s, error: o }) => {
|
|
24291
24291
|
const u = te(null), [c, d] = G(!1), h = te(!0);
|
|
24292
24292
|
Ue(() => (h.current = !0, () => {
|
|
@@ -28831,7 +28831,7 @@ class Ne {
|
|
|
28831
28831
|
found.
|
|
28832
28832
|
*/
|
|
28833
28833
|
static findFrom(t, n, r = !1) {
|
|
28834
|
-
let l = t.parent.inlineContent ? new
|
|
28834
|
+
let l = t.parent.inlineContent ? new Te(t) : Mr(t.node(0), t.parent, t.pos, t.index(), n, r);
|
|
28835
28835
|
if (l)
|
|
28836
28836
|
return l;
|
|
28837
28837
|
for (let a = t.depth - 1; a >= 0; a--) {
|
|
@@ -28898,7 +28898,7 @@ class Ne {
|
|
|
28898
28898
|
returns the bookmark for that.
|
|
28899
28899
|
*/
|
|
28900
28900
|
getBookmark() {
|
|
28901
|
-
return
|
|
28901
|
+
return Te.between(this.$anchor, this.$head).getBookmark();
|
|
28902
28902
|
}
|
|
28903
28903
|
}
|
|
28904
28904
|
Ne.prototype.visible = !0;
|
|
@@ -28914,7 +28914,7 @@ let Qd = !1;
|
|
|
28914
28914
|
function Xd(e) {
|
|
28915
28915
|
!Qd && !e.parent.inlineContent && (Qd = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + e.parent.type.name + ")"));
|
|
28916
28916
|
}
|
|
28917
|
-
class
|
|
28917
|
+
class Te extends Ne {
|
|
28918
28918
|
/**
|
|
28919
28919
|
Construct a text selection between the given points.
|
|
28920
28920
|
*/
|
|
@@ -28933,7 +28933,7 @@ class Ee extends Ne {
|
|
|
28933
28933
|
if (!r.parent.inlineContent)
|
|
28934
28934
|
return Ne.near(r);
|
|
28935
28935
|
let l = t.resolve(n.map(this.anchor));
|
|
28936
|
-
return new
|
|
28936
|
+
return new Te(l.parent.inlineContent ? l : r, r);
|
|
28937
28937
|
}
|
|
28938
28938
|
replace(t, n = ue.empty) {
|
|
28939
28939
|
if (super.replace(t, n), n == ue.empty) {
|
|
@@ -28942,7 +28942,7 @@ class Ee extends Ne {
|
|
|
28942
28942
|
}
|
|
28943
28943
|
}
|
|
28944
28944
|
eq(t) {
|
|
28945
|
-
return t instanceof
|
|
28945
|
+
return t instanceof Te && t.anchor == this.anchor && t.head == this.head;
|
|
28946
28946
|
}
|
|
28947
28947
|
getBookmark() {
|
|
28948
28948
|
return new Ai(this.anchor, this.head);
|
|
@@ -28956,7 +28956,7 @@ class Ee extends Ne {
|
|
|
28956
28956
|
static fromJSON(t, n) {
|
|
28957
28957
|
if (typeof n.anchor != "number" || typeof n.head != "number")
|
|
28958
28958
|
throw new RangeError("Invalid input for TextSelection.fromJSON");
|
|
28959
|
-
return new
|
|
28959
|
+
return new Te(t.resolve(n.anchor), t.resolve(n.head));
|
|
28960
28960
|
}
|
|
28961
28961
|
/**
|
|
28962
28962
|
Create a text selection from non-resolved positions.
|
|
@@ -28982,10 +28982,10 @@ class Ee extends Ne {
|
|
|
28982
28982
|
else
|
|
28983
28983
|
return Ne.near(n, r);
|
|
28984
28984
|
}
|
|
28985
|
-
return t.parent.inlineContent || (l == 0 ? t = n : (t = (Ne.findFrom(t, -r, !0) || Ne.findFrom(t, r, !0)).$anchor, t.pos < n.pos != l < 0 && (t = n))), new
|
|
28985
|
+
return t.parent.inlineContent || (l == 0 ? t = n : (t = (Ne.findFrom(t, -r, !0) || Ne.findFrom(t, r, !0)).$anchor, t.pos < n.pos != l < 0 && (t = n))), new Te(t, n);
|
|
28986
28986
|
}
|
|
28987
28987
|
}
|
|
28988
|
-
Ne.jsonID("text",
|
|
28988
|
+
Ne.jsonID("text", Te);
|
|
28989
28989
|
class Ai {
|
|
28990
28990
|
constructor(t, n) {
|
|
28991
28991
|
this.anchor = t, this.head = n;
|
|
@@ -28994,7 +28994,7 @@ class Ai {
|
|
|
28994
28994
|
return new Ai(t.map(this.anchor), t.map(this.head));
|
|
28995
28995
|
}
|
|
28996
28996
|
resolve(t) {
|
|
28997
|
-
return
|
|
28997
|
+
return Te.between(t.resolve(this.anchor), t.resolve(this.head));
|
|
28998
28998
|
}
|
|
28999
28999
|
}
|
|
29000
29000
|
class ge extends Ne {
|
|
@@ -29104,7 +29104,7 @@ const fx = {
|
|
|
29104
29104
|
};
|
|
29105
29105
|
function Mr(e, t, n, r, l, a = !1) {
|
|
29106
29106
|
if (t.inlineContent)
|
|
29107
|
-
return
|
|
29107
|
+
return Te.create(e, n);
|
|
29108
29108
|
for (let i = r - (l > 0 ? 0 : 1); l > 0 ? i < t.childCount : i >= 0; i += l) {
|
|
29109
29109
|
let s = t.child(i);
|
|
29110
29110
|
if (s.isAtom) {
|
|
@@ -30512,7 +30512,7 @@ class Fn extends sa {
|
|
|
30512
30512
|
}
|
|
30513
30513
|
localCompositionInfo(t, n) {
|
|
30514
30514
|
let { from: r, to: l } = t.state.selection;
|
|
30515
|
-
if (!(t.state.selection instanceof
|
|
30515
|
+
if (!(t.state.selection instanceof Te) || r < n || l > n + this.node.content.size)
|
|
30516
30516
|
return null;
|
|
30517
30517
|
let a = t.input.compositionNode;
|
|
30518
30518
|
if (!a || !this.dom.contains(a.parentNode))
|
|
@@ -31072,7 +31072,7 @@ function pn(e, t = !1) {
|
|
|
31072
31072
|
Gx(e);
|
|
31073
31073
|
else {
|
|
31074
31074
|
let { anchor: r, head: l } = n, a, i;
|
|
31075
|
-
hf && !(n instanceof
|
|
31075
|
+
hf && !(n instanceof Te) && (n.$from.parent.inlineContent || (a = pf(e, n.from)), !n.empty && !n.$from.parent.inlineContent && (i = pf(e, n.to))), e.docView.setSelection(r, l, e, t), hf && (a && mf(a), i && mf(i)), n.visible ? e.dom.classList.remove("ProseMirror-hideselection") : (e.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && jx(e));
|
|
31076
31076
|
}
|
|
31077
31077
|
e.domObserver.setCurSelection(), e.domObserver.connectSelection();
|
|
31078
31078
|
}
|
|
@@ -31123,7 +31123,7 @@ function bf(e) {
|
|
|
31123
31123
|
e.lastSelectedViewDesc && (e.lastSelectedViewDesc.parent && e.lastSelectedViewDesc.deselectNode(), e.lastSelectedViewDesc = void 0);
|
|
31124
31124
|
}
|
|
31125
31125
|
function yu(e, t, n, r) {
|
|
31126
|
-
return e.someProp("createSelectionBetween", (l) => l(e, t, n)) ||
|
|
31126
|
+
return e.someProp("createSelectionBetween", (l) => l(e, t, n)) || Te.between(t, n, r);
|
|
31127
31127
|
}
|
|
31128
31128
|
function gf(e) {
|
|
31129
31129
|
return e.editable && !e.hasFocus() ? !1 : um(e);
|
|
@@ -31151,13 +31151,13 @@ function In(e, t) {
|
|
|
31151
31151
|
}
|
|
31152
31152
|
function vf(e, t, n) {
|
|
31153
31153
|
let r = e.state.selection;
|
|
31154
|
-
if (r instanceof
|
|
31154
|
+
if (r instanceof Te)
|
|
31155
31155
|
if (n.indexOf("s") > -1) {
|
|
31156
31156
|
let { $head: l } = r, a = l.textOffset ? null : t < 0 ? l.nodeBefore : l.nodeAfter;
|
|
31157
31157
|
if (!a || a.isText || !a.isLeaf)
|
|
31158
31158
|
return !1;
|
|
31159
31159
|
let i = e.state.doc.resolve(l.pos + a.nodeSize * (t < 0 ? -1 : 1));
|
|
31160
|
-
return In(e, new
|
|
31160
|
+
return In(e, new Te(r.$anchor, i));
|
|
31161
31161
|
} else if (r.empty) {
|
|
31162
31162
|
if (e.endOfTextblock(t > 0 ? "forward" : "backward")) {
|
|
31163
31163
|
let l = So(e.state, t);
|
|
@@ -31167,12 +31167,12 @@ function vf(e, t, n) {
|
|
|
31167
31167
|
if (!a || a.isText)
|
|
31168
31168
|
return !1;
|
|
31169
31169
|
let s = t < 0 ? l.pos - a.nodeSize : l.pos;
|
|
31170
|
-
return a.isAtom || (i = e.docView.descAt(s)) && !i.contentDOM ? ge.isSelectable(a) ? In(e, new ge(t < 0 ? e.state.doc.resolve(l.pos - a.nodeSize) : l)) : ia ? In(e, new
|
|
31170
|
+
return a.isAtom || (i = e.docView.descAt(s)) && !i.contentDOM ? ge.isSelectable(a) ? In(e, new ge(t < 0 ? e.state.doc.resolve(l.pos - a.nodeSize) : l)) : ia ? In(e, new Te(e.state.doc.resolve(t < 0 ? s : s + a.nodeSize))) : !1 : !1;
|
|
31171
31171
|
}
|
|
31172
31172
|
} else return !1;
|
|
31173
31173
|
else {
|
|
31174
31174
|
if (r instanceof ge && r.node.isInline)
|
|
31175
|
-
return In(e, new
|
|
31175
|
+
return In(e, new Te(t > 0 ? r.$to : r.$from));
|
|
31176
31176
|
{
|
|
31177
31177
|
let l = So(e.state, t);
|
|
31178
31178
|
return l ? In(e, l) : !1;
|
|
@@ -31322,7 +31322,7 @@ function yf(e, t) {
|
|
|
31322
31322
|
}
|
|
31323
31323
|
function Ef(e, t, n) {
|
|
31324
31324
|
let r = e.state.selection;
|
|
31325
|
-
if (r instanceof
|
|
31325
|
+
if (r instanceof Te && !r.empty || n.indexOf("s") > -1 || Pt && n.indexOf("m") > -1)
|
|
31326
31326
|
return !1;
|
|
31327
31327
|
let { $from: l, $to: a } = r;
|
|
31328
31328
|
if (!l.parent.inlineContent || e.endOfTextblock(t < 0 ? "up" : "down")) {
|
|
@@ -31337,7 +31337,7 @@ function Ef(e, t, n) {
|
|
|
31337
31337
|
return !1;
|
|
31338
31338
|
}
|
|
31339
31339
|
function Tf(e, t) {
|
|
31340
|
-
if (!(e.state.selection instanceof
|
|
31340
|
+
if (!(e.state.selection instanceof Te))
|
|
31341
31341
|
return !0;
|
|
31342
31342
|
let { $head: n, $anchor: r, empty: l } = e.state.selection;
|
|
31343
31343
|
if (!n.sameParent(r))
|
|
@@ -31655,7 +31655,7 @@ yt.keypress = (e, t) => {
|
|
|
31655
31655
|
return;
|
|
31656
31656
|
}
|
|
31657
31657
|
let r = e.state.selection;
|
|
31658
|
-
if (!(r instanceof
|
|
31658
|
+
if (!(r instanceof Te) || !r.$from.sameParent(r.$to)) {
|
|
31659
31659
|
let l = String.fromCharCode(n.charCode), a = () => e.state.tr.insertText(l).scrollIntoView();
|
|
31660
31660
|
!/[\r\n]/.test(l) && !e.someProp("handleTextInput", (i) => i(e, r.$from.pos, r.$to.pos, l, a)) && e.dispatch(a()), n.preventDefault();
|
|
31661
31661
|
}
|
|
@@ -31717,12 +31717,12 @@ function TS(e, t, n) {
|
|
|
31717
31717
|
return !1;
|
|
31718
31718
|
let r = e.state.doc;
|
|
31719
31719
|
if (t == -1)
|
|
31720
|
-
return r.inlineContent ? (zr(e,
|
|
31720
|
+
return r.inlineContent ? (zr(e, Te.create(r, 0, r.content.size)), !0) : !1;
|
|
31721
31721
|
let l = r.resolve(t);
|
|
31722
31722
|
for (let a = l.depth + 1; a > 0; a--) {
|
|
31723
31723
|
let i = a > l.depth ? l.nodeAfter : l.node(a), s = l.before(a);
|
|
31724
31724
|
if (i.inlineContent)
|
|
31725
|
-
zr(e,
|
|
31725
|
+
zr(e, Te.create(r, s + 1, s + 1 + i.content.size));
|
|
31726
31726
|
else if (ge.isSelectable(i))
|
|
31727
31727
|
zr(e, ge.create(r, s));
|
|
31728
31728
|
else
|
|
@@ -31803,7 +31803,7 @@ yt.compositionstart = yt.compositionupdate = (e) => {
|
|
|
31803
31803
|
if (!e.composing) {
|
|
31804
31804
|
e.domObserver.flush();
|
|
31805
31805
|
let { state: t } = e, n = t.selection.$to;
|
|
31806
|
-
if (t.selection instanceof
|
|
31806
|
+
if (t.selection instanceof Te && (t.storedMarks || !n.textOffset && n.parentOffset && n.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1) || ut && K0 && SS(e)))
|
|
31807
31807
|
e.markCursor = e.state.storedMarks || n.marks(), ri(e, !0), e.markCursor = null;
|
|
31808
31808
|
else if (ri(e, !t.selection.empty), Ut && t.selection.empty && n.parentOffset && !n.textOffset && n.nodeBefore.marks.length) {
|
|
31809
31809
|
let r = e.domSelectionRange();
|
|
@@ -32831,7 +32831,7 @@ function WS(e, t, n, r, l) {
|
|
|
32831
32831
|
return;
|
|
32832
32832
|
}
|
|
32833
32833
|
if (!m)
|
|
32834
|
-
if (r && o instanceof
|
|
32834
|
+
if (r && o instanceof Te && !o.empty && o.$head.sameParent(o.$anchor) && !e.composing && !(u.sel && u.sel.anchor != u.sel.head))
|
|
32835
32835
|
m = { start: o.from, endA: o.to, endB: o.to };
|
|
32836
32836
|
else {
|
|
32837
32837
|
if (u.sel) {
|
|
@@ -32843,7 +32843,7 @@ function WS(e, t, n, r, l) {
|
|
|
32843
32843
|
}
|
|
32844
32844
|
return;
|
|
32845
32845
|
}
|
|
32846
|
-
e.state.selection.from < e.state.selection.to && m.start == m.endB && e.state.selection instanceof
|
|
32846
|
+
e.state.selection.from < e.state.selection.to && m.start == m.endB && e.state.selection instanceof Te && (m.start > e.state.selection.from && m.start <= e.state.selection.from + 2 && e.state.selection.from >= u.from ? m.start = e.state.selection.from : m.endA < e.state.selection.to && m.endA >= e.state.selection.to - 2 && e.state.selection.to <= u.to && (m.endB += e.state.selection.to - m.endA, m.endA = e.state.selection.to)), At && Bn <= 11 && m.endB == m.start + 1 && m.endA == m.start && m.start > u.from && u.doc.textBetween(m.start - u.from - 1, m.start - u.from + 1) == " " && (m.start--, m.endA--, m.endB--);
|
|
32847
32847
|
let g = u.doc.resolveNoCache(m.start - u.from), b = u.doc.resolveNoCache(m.endB - u.from), y = c.resolve(m.start), A = g.sameParent(b) && g.parent.inlineContent && y.end() >= m.endA;
|
|
32848
32848
|
if ((Wr && e.input.lastIOSEnter > Date.now() - 225 && (!A || l.some((w) => w.nodeName == "DIV" || w.nodeName == "P")) || !A && g.pos < u.doc.content.size && (!g.sameParent(b) || !g.parent.inlineContent) && g.pos < b.pos && !/\S/.test(u.doc.textBetween(g.pos, b.pos, "", ""))) && e.someProp("handleKeyDown", (w) => w(e, rr(13, "Enter")))) {
|
|
32849
32849
|
e.input.lastIOSEnter = 0;
|
|
@@ -33427,8 +33427,8 @@ function ZS(e) {
|
|
|
33427
33427
|
var t = XS && e.metaKey && e.shiftKey && !e.ctrlKey && !e.altKey || JS && e.shiftKey && e.key && e.key.length == 1 || e.key == "Unidentified", n = !t && e.key || (e.shiftKey ? ii : Un)[e.keyCode] || e.key || "Unidentified";
|
|
33428
33428
|
return n == "Esc" && (n = "Escape"), n == "Del" && (n = "Delete"), n == "Left" && (n = "ArrowLeft"), n == "Up" && (n = "ArrowUp"), n == "Right" && (n = "ArrowRight"), n == "Down" && (n = "ArrowDown"), n;
|
|
33429
33429
|
}
|
|
33430
|
-
const
|
|
33431
|
-
function
|
|
33430
|
+
const ek = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), tk = typeof navigator < "u" && /Win/.test(navigator.platform);
|
|
33431
|
+
function nk(e) {
|
|
33432
33432
|
let t = e.split(/-(?!$)/), n = t[t.length - 1];
|
|
33433
33433
|
n == "Space" && (n = " ");
|
|
33434
33434
|
let r, l, a, i;
|
|
@@ -33443,26 +33443,26 @@ function n5(e) {
|
|
|
33443
33443
|
else if (/^s(hift)?$/i.test(o))
|
|
33444
33444
|
a = !0;
|
|
33445
33445
|
else if (/^mod$/i.test(o))
|
|
33446
|
-
|
|
33446
|
+
ek ? i = !0 : l = !0;
|
|
33447
33447
|
else
|
|
33448
33448
|
throw new Error("Unrecognized modifier name: " + o);
|
|
33449
33449
|
}
|
|
33450
33450
|
return r && (n = "Alt-" + n), l && (n = "Ctrl-" + n), i && (n = "Meta-" + n), a && (n = "Shift-" + n), n;
|
|
33451
33451
|
}
|
|
33452
|
-
function
|
|
33452
|
+
function rk(e) {
|
|
33453
33453
|
let t = /* @__PURE__ */ Object.create(null);
|
|
33454
33454
|
for (let n in e)
|
|
33455
|
-
t[
|
|
33455
|
+
t[nk(n)] = e[n];
|
|
33456
33456
|
return t;
|
|
33457
33457
|
}
|
|
33458
33458
|
function Fs(e, t, n = !0) {
|
|
33459
33459
|
return t.altKey && (e = "Alt-" + e), t.ctrlKey && (e = "Ctrl-" + e), t.metaKey && (e = "Meta-" + e), n && t.shiftKey && (e = "Shift-" + e), e;
|
|
33460
33460
|
}
|
|
33461
|
-
function
|
|
33461
|
+
function lk(e) {
|
|
33462
33462
|
return new Tt({ props: { handleKeyDown: wm(e) } });
|
|
33463
33463
|
}
|
|
33464
33464
|
function wm(e) {
|
|
33465
|
-
let t =
|
|
33465
|
+
let t = rk(e);
|
|
33466
33466
|
return function(n, r) {
|
|
33467
33467
|
let l = ZS(r), a, i = t[Fs(l, r)];
|
|
33468
33468
|
if (i && i(n.state, n.dispatch, n))
|
|
@@ -33474,7 +33474,7 @@ function wm(e) {
|
|
|
33474
33474
|
return !0;
|
|
33475
33475
|
}
|
|
33476
33476
|
if ((r.altKey || r.metaKey || r.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
|
|
33477
|
-
!(
|
|
33477
|
+
!(tk && r.ctrlKey && r.altKey) && (a = Un[r.keyCode]) && a != l) {
|
|
33478
33478
|
let s = t[Fs(a, r)];
|
|
33479
33479
|
if (s && s(n.state, n.dispatch, n))
|
|
33480
33480
|
return !0;
|
|
@@ -33514,13 +33514,13 @@ const _m = (e, t, n) => {
|
|
|
33514
33514
|
break;
|
|
33515
33515
|
}
|
|
33516
33516
|
return a.isAtom && l.depth == r.depth - 1 ? (t && t(e.tr.delete(l.pos - a.nodeSize, l.pos).scrollIntoView()), !0) : !1;
|
|
33517
|
-
},
|
|
33517
|
+
}, ak = (e, t, n) => {
|
|
33518
33518
|
let r = Im(e, n);
|
|
33519
33519
|
if (!r)
|
|
33520
33520
|
return !1;
|
|
33521
33521
|
let l = Nu(r);
|
|
33522
33522
|
return l ? Om(e, l, t) : !1;
|
|
33523
|
-
},
|
|
33523
|
+
}, ik = (e, t, n) => {
|
|
33524
33524
|
let r = Rm(e, n);
|
|
33525
33525
|
if (!r)
|
|
33526
33526
|
return !1;
|
|
@@ -33551,7 +33551,7 @@ function Om(e, t, n) {
|
|
|
33551
33551
|
return !1;
|
|
33552
33552
|
if (n) {
|
|
33553
33553
|
let c = e.tr.step(u);
|
|
33554
|
-
c.setSelection(
|
|
33554
|
+
c.setSelection(Te.create(c.doc, a)), n(c.scrollIntoView());
|
|
33555
33555
|
}
|
|
33556
33556
|
return !0;
|
|
33557
33557
|
}
|
|
@@ -33634,7 +33634,7 @@ function wu(e) {
|
|
|
33634
33634
|
}
|
|
33635
33635
|
return null;
|
|
33636
33636
|
}
|
|
33637
|
-
const
|
|
33637
|
+
const sk = (e, t) => {
|
|
33638
33638
|
let n = e.selection, r = n instanceof ge, l;
|
|
33639
33639
|
if (r) {
|
|
33640
33640
|
if (n.node.isTextblock || !Yn(e.doc, n.from))
|
|
@@ -33647,7 +33647,7 @@ const s5 = (e, t) => {
|
|
|
33647
33647
|
r && a.setSelection(ge.create(a.doc, l - e.doc.resolve(l).nodeBefore.nodeSize)), t(a.scrollIntoView());
|
|
33648
33648
|
}
|
|
33649
33649
|
return !0;
|
|
33650
|
-
},
|
|
33650
|
+
}, ok = (e, t) => {
|
|
33651
33651
|
let n = e.selection, r;
|
|
33652
33652
|
if (n instanceof ge) {
|
|
33653
33653
|
if (n.node.isTextblock || !Yn(e.doc, n.to))
|
|
@@ -33656,7 +33656,7 @@ const s5 = (e, t) => {
|
|
|
33656
33656
|
} else if (r = Si(e.doc, n.to, 1), r == null)
|
|
33657
33657
|
return !1;
|
|
33658
33658
|
return t && t(e.tr.join(r).scrollIntoView()), !0;
|
|
33659
|
-
},
|
|
33659
|
+
}, uk = (e, t) => {
|
|
33660
33660
|
let { $from: n, $to: r } = e.selection, l = n.blockRange(r), a = l && rl(l);
|
|
33661
33661
|
return a == null ? !1 : (t && t(e.tr.lift(l, a).scrollIntoView()), !0);
|
|
33662
33662
|
}, Pm = (e, t) => {
|
|
@@ -33672,7 +33672,7 @@ function Iu(e) {
|
|
|
33672
33672
|
}
|
|
33673
33673
|
return null;
|
|
33674
33674
|
}
|
|
33675
|
-
const
|
|
33675
|
+
const ck = (e, t) => {
|
|
33676
33676
|
let { $head: n, $anchor: r } = e.selection;
|
|
33677
33677
|
if (!n.parent.type.spec.code || !n.sameParent(r))
|
|
33678
33678
|
return !1;
|
|
@@ -33693,7 +33693,7 @@ const c5 = (e, t) => {
|
|
|
33693
33693
|
return !1;
|
|
33694
33694
|
if (t) {
|
|
33695
33695
|
let i = (!r.parentOffset && l.index() < l.parent.childCount ? r : l).pos, s = e.tr.insert(i, a.createAndFill());
|
|
33696
|
-
s.setSelection(
|
|
33696
|
+
s.setSelection(Te.create(s.doc, i + 1)), t(s.scrollIntoView());
|
|
33697
33697
|
}
|
|
33698
33698
|
return !0;
|
|
33699
33699
|
}, Fm = (e, t) => {
|
|
@@ -33708,7 +33708,7 @@ const c5 = (e, t) => {
|
|
|
33708
33708
|
let r = n.blockRange(), l = r && rl(r);
|
|
33709
33709
|
return l == null ? !1 : (t && t(e.tr.lift(r, l).scrollIntoView()), !0);
|
|
33710
33710
|
};
|
|
33711
|
-
function
|
|
33711
|
+
function dk(e) {
|
|
33712
33712
|
return (t, n) => {
|
|
33713
33713
|
let { $from: r, $to: l } = t.selection;
|
|
33714
33714
|
if (t.selection instanceof ge && t.selection.node.isBlock)
|
|
@@ -33726,7 +33726,7 @@ function d5(e) {
|
|
|
33726
33726
|
a.unshift(null);
|
|
33727
33727
|
}
|
|
33728
33728
|
let c = t.tr;
|
|
33729
|
-
(t.selection instanceof
|
|
33729
|
+
(t.selection instanceof Te || t.selection instanceof Dt) && c.deleteSelection();
|
|
33730
33730
|
let d = c.mapping.map(r.pos), h = hn(c.doc, d, a.length, a);
|
|
33731
33731
|
if (h || (a[0] = s ? { type: s } : null, h = hn(c.doc, d, a.length, a)), !h)
|
|
33732
33732
|
return !1;
|
|
@@ -33737,17 +33737,17 @@ function d5(e) {
|
|
|
33737
33737
|
return n && n(c.scrollIntoView()), !0;
|
|
33738
33738
|
};
|
|
33739
33739
|
}
|
|
33740
|
-
const
|
|
33740
|
+
const fk = dk(), hk = (e, t) => {
|
|
33741
33741
|
let { $from: n, to: r } = e.selection, l, a = n.sharedDepth(r);
|
|
33742
33742
|
return a == 0 ? !1 : (l = n.before(a), t && t(e.tr.setSelection(ge.create(e.doc, l))), !0);
|
|
33743
33743
|
};
|
|
33744
|
-
function
|
|
33744
|
+
function pk(e, t, n) {
|
|
33745
33745
|
let r = t.nodeBefore, l = t.nodeAfter, a = t.index();
|
|
33746
33746
|
return !r || !l || !r.type.compatibleContent(l.type) ? !1 : !r.content.size && t.parent.canReplace(a - 1, a) ? (n && n(e.tr.delete(t.pos - r.nodeSize, t.pos).scrollIntoView()), !0) : !t.parent.canReplace(a, a + 1) || !(l.isTextblock || Yn(e.doc, t.pos)) ? !1 : (n && n(e.tr.join(t.pos).scrollIntoView()), !0);
|
|
33747
33747
|
}
|
|
33748
33748
|
function Hm(e, t, n, r) {
|
|
33749
33749
|
let l = t.nodeBefore, a = t.nodeAfter, i, s, o = l.type.spec.isolating || a.type.spec.isolating;
|
|
33750
|
-
if (!o &&
|
|
33750
|
+
if (!o && pk(e, t, n))
|
|
33751
33751
|
return !0;
|
|
33752
33752
|
let u = !o && t.parent.canReplace(t.index(), t.index() + 1);
|
|
33753
33753
|
if (u && (i = (s = l.contentMatchAt(l.childCount)).findWrapping(a.type)) && s.matchType(i[0] || a.type).validEnd) {
|
|
@@ -33792,11 +33792,11 @@ function Um(e) {
|
|
|
33792
33792
|
return !1;
|
|
33793
33793
|
a--;
|
|
33794
33794
|
}
|
|
33795
|
-
return l.node(a).isTextblock ? (n && n(t.tr.setSelection(
|
|
33795
|
+
return l.node(a).isTextblock ? (n && n(t.tr.setSelection(Te.create(t.doc, e < 0 ? l.start(a) : l.end(a)))), !0) : !1;
|
|
33796
33796
|
};
|
|
33797
33797
|
}
|
|
33798
|
-
const
|
|
33799
|
-
function
|
|
33798
|
+
const mk = Um(-1), bk = Um(1);
|
|
33799
|
+
function gk(e, t = null) {
|
|
33800
33800
|
return function(n, r) {
|
|
33801
33801
|
let { $from: l, $to: a } = n.selection, i = l.blockRange(a), s = i && mu(i, e, t);
|
|
33802
33802
|
return s ? (r && r(n.tr.wrap(i, s).scrollIntoView()), !0) : !1;
|
|
@@ -33842,18 +33842,18 @@ function _u(...e) {
|
|
|
33842
33842
|
}
|
|
33843
33843
|
_u(Au, _m, Mm);
|
|
33844
33844
|
_u(Au, Dm, Lm);
|
|
33845
|
-
_u(Pm, Bm, Fm,
|
|
33845
|
+
_u(Pm, Bm, Fm, fk);
|
|
33846
33846
|
typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform && os.platform() == "darwin";
|
|
33847
|
-
function
|
|
33847
|
+
function vk(e, t = null) {
|
|
33848
33848
|
return function(n, r) {
|
|
33849
33849
|
let { $from: l, $to: a } = n.selection, i = l.blockRange(a);
|
|
33850
33850
|
if (!i)
|
|
33851
33851
|
return !1;
|
|
33852
33852
|
let s = r ? n.tr : null;
|
|
33853
|
-
return
|
|
33853
|
+
return yk(s, i, e, t) ? (r && r(s.scrollIntoView()), !0) : !1;
|
|
33854
33854
|
};
|
|
33855
33855
|
}
|
|
33856
|
-
function
|
|
33856
|
+
function yk(e, t, n, r = null) {
|
|
33857
33857
|
let l = !1, a = t, i = t.$from.doc;
|
|
33858
33858
|
if (t.depth >= 2 && t.$from.node(t.depth - 1).type.compatibleContent(n) && t.startIndex == 0) {
|
|
33859
33859
|
if (t.$from.index(t.depth - 1) == 0)
|
|
@@ -33862,9 +33862,9 @@ function y5(e, t, n, r = null) {
|
|
|
33862
33862
|
a = new Za(o, o, t.depth), t.endIndex < t.parent.childCount && (t = new Za(t.$from, i.resolve(t.$to.end(t.depth)), t.depth)), l = !0;
|
|
33863
33863
|
}
|
|
33864
33864
|
let s = mu(a, n, r, t);
|
|
33865
|
-
return s ? (e &&
|
|
33865
|
+
return s ? (e && Ek(e, t, s, l, n), !0) : !1;
|
|
33866
33866
|
}
|
|
33867
|
-
function
|
|
33867
|
+
function Ek(e, t, n, r, l) {
|
|
33868
33868
|
let a = Q.empty;
|
|
33869
33869
|
for (let c = n.length - 1; c >= 0; c--)
|
|
33870
33870
|
a = Q.from(n[c].type.create(n[c].attrs, a));
|
|
@@ -33877,13 +33877,13 @@ function E5(e, t, n, r, l) {
|
|
|
33877
33877
|
!h && hn(e.doc, o, s) && (e.split(o, s), o += 2 * s), o += u.child(c).nodeSize;
|
|
33878
33878
|
return e;
|
|
33879
33879
|
}
|
|
33880
|
-
function
|
|
33880
|
+
function Tk(e) {
|
|
33881
33881
|
return function(t, n) {
|
|
33882
33882
|
let { $from: r, $to: l } = t.selection, a = r.blockRange(l, (i) => i.childCount > 0 && i.firstChild.type == e);
|
|
33883
|
-
return a ? n ? r.node(a.depth - 1).type == e ?
|
|
33883
|
+
return a ? n ? r.node(a.depth - 1).type == e ? Ck(t, n, e, a) : xk(t, n, a) : !0 : !1;
|
|
33884
33884
|
};
|
|
33885
33885
|
}
|
|
33886
|
-
function
|
|
33886
|
+
function Ck(e, t, n, r) {
|
|
33887
33887
|
let l = e.tr, a = r.end, i = r.$to.end(r.depth);
|
|
33888
33888
|
a < i && (l.step(new et(a - 1, i, a, i, new ue(Q.from(n.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new Za(l.doc.resolve(r.$from.pos), l.doc.resolve(i), r.depth));
|
|
33889
33889
|
const s = rl(r);
|
|
@@ -33893,7 +33893,7 @@ function C5(e, t, n, r) {
|
|
|
33893
33893
|
let o = l.doc.resolve(l.mapping.map(a, -1) - 1);
|
|
33894
33894
|
return Yn(l.doc, o.pos) && o.nodeBefore.type == o.nodeAfter.type && l.join(o.pos), t(l.scrollIntoView()), !0;
|
|
33895
33895
|
}
|
|
33896
|
-
function
|
|
33896
|
+
function xk(e, t, n) {
|
|
33897
33897
|
let r = e.tr, l = n.parent;
|
|
33898
33898
|
for (let f = n.end, m = n.endIndex - 1, g = n.startIndex; m > g; m--)
|
|
33899
33899
|
f -= l.child(m).nodeSize, r.delete(f - 1, f + 1);
|
|
@@ -33906,7 +33906,7 @@ function x5(e, t, n) {
|
|
|
33906
33906
|
let d = a.pos, h = d + i.nodeSize;
|
|
33907
33907
|
return r.step(new et(d - (s ? 1 : 0), h + (o ? 1 : 0), d + 1, h - 1, new ue((s ? Q.empty : Q.from(l.copy(Q.empty))).append(o ? Q.empty : Q.from(l.copy(Q.empty))), s ? 0 : 1, o ? 0 : 1), s ? 0 : 1)), t(r.scrollIntoView()), !0;
|
|
33908
33908
|
}
|
|
33909
|
-
function
|
|
33909
|
+
function Sk(e) {
|
|
33910
33910
|
return function(t, n) {
|
|
33911
33911
|
let { $from: r, $to: l } = t.selection, a = r.blockRange(l, (u) => u.childCount > 0 && u.firstChild.type == e);
|
|
33912
33912
|
if (!a)
|
|
@@ -34009,7 +34009,7 @@ class Oi {
|
|
|
34009
34009
|
return s;
|
|
34010
34010
|
}
|
|
34011
34011
|
}
|
|
34012
|
-
class
|
|
34012
|
+
class kk {
|
|
34013
34013
|
constructor() {
|
|
34014
34014
|
this.callbacks = {};
|
|
34015
34015
|
}
|
|
@@ -34146,10 +34146,10 @@ function Vm(e) {
|
|
|
34146
34146
|
function Ie(e, t = void 0, ...n) {
|
|
34147
34147
|
return Vm(e) ? t ? e.bind(t)(...n) : e(...n) : e;
|
|
34148
34148
|
}
|
|
34149
|
-
function
|
|
34149
|
+
function Ak(e = {}) {
|
|
34150
34150
|
return Object.keys(e).length === 0 && e.constructor === Object;
|
|
34151
34151
|
}
|
|
34152
|
-
function
|
|
34152
|
+
function Nk(e) {
|
|
34153
34153
|
return typeof e != "string" ? e : e.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(e) : e === "true" ? !0 : e === "false" ? !1 : e;
|
|
34154
34154
|
}
|
|
34155
34155
|
function Bf(e, t) {
|
|
@@ -34160,7 +34160,7 @@ function Bf(e, t) {
|
|
|
34160
34160
|
if (r === !1)
|
|
34161
34161
|
return !1;
|
|
34162
34162
|
const l = t.reduce((a, i) => {
|
|
34163
|
-
const s = i.attribute.parseHTML ? i.attribute.parseHTML(n) :
|
|
34163
|
+
const s = i.attribute.parseHTML ? i.attribute.parseHTML(n) : Nk(n.getAttribute(i.name));
|
|
34164
34164
|
return s == null ? a : {
|
|
34165
34165
|
...a,
|
|
34166
34166
|
[i.name]: s
|
|
@@ -34173,10 +34173,10 @@ function Bf(e, t) {
|
|
|
34173
34173
|
function Ff(e) {
|
|
34174
34174
|
return Object.fromEntries(
|
|
34175
34175
|
// @ts-ignore
|
|
34176
|
-
Object.entries(e).filter(([t, n]) => t === "attrs" &&
|
|
34176
|
+
Object.entries(e).filter(([t, n]) => t === "attrs" && Ak(n) ? !1 : n != null)
|
|
34177
34177
|
);
|
|
34178
34178
|
}
|
|
34179
|
-
function
|
|
34179
|
+
function wk(e, t) {
|
|
34180
34180
|
var n;
|
|
34181
34181
|
const r = zm(e), { nodeExtensions: l, markExtensions: a } = Mi(e), i = (n = l.find((u) => ce(u, "topNode"))) === null || n === void 0 ? void 0 : n.name, s = Object.fromEntries(l.map((u) => {
|
|
34182
34182
|
const c = r.filter((y) => y.type === u.name), d = {
|
|
@@ -34264,7 +34264,7 @@ function Ou(e, t) {
|
|
|
34264
34264
|
const n = kr.fromSchema(t).serializeFragment(e), l = document.implementation.createHTMLDocument().createElement("div");
|
|
34265
34265
|
return l.appendChild(n), l.innerHTML;
|
|
34266
34266
|
}
|
|
34267
|
-
const
|
|
34267
|
+
const Ik = (e, t = 500) => {
|
|
34268
34268
|
let n = "";
|
|
34269
34269
|
const r = e.parentOffset;
|
|
34270
34270
|
return e.parent.nodesBetween(Math.max(0, r - t), r, (l, a, i, s) => {
|
|
@@ -34286,7 +34286,7 @@ class Ri {
|
|
|
34286
34286
|
this.find = t.find, this.handler = t.handler;
|
|
34287
34287
|
}
|
|
34288
34288
|
}
|
|
34289
|
-
const
|
|
34289
|
+
const _k = (e, t) => {
|
|
34290
34290
|
if (Mu(t))
|
|
34291
34291
|
return t.exec(e);
|
|
34292
34292
|
const n = t(e);
|
|
@@ -34307,11 +34307,11 @@ function Aa(e) {
|
|
|
34307
34307
|
)
|
|
34308
34308
|
return !1;
|
|
34309
34309
|
let c = !1;
|
|
34310
|
-
const d =
|
|
34310
|
+
const d = Ik(u) + a;
|
|
34311
34311
|
return i.forEach((h) => {
|
|
34312
34312
|
if (c)
|
|
34313
34313
|
return;
|
|
34314
|
-
const f =
|
|
34314
|
+
const f = _k(d, h.find);
|
|
34315
34315
|
if (!f)
|
|
34316
34316
|
return;
|
|
34317
34317
|
const m = o.state.tr, g = _i({
|
|
@@ -34339,7 +34339,7 @@ function Aa(e) {
|
|
|
34339
34339
|
}), o.dispatch(m), c = !0);
|
|
34340
34340
|
}), c;
|
|
34341
34341
|
}
|
|
34342
|
-
function
|
|
34342
|
+
function Ok(e) {
|
|
34343
34343
|
const { editor: t, rules: n } = e, r = new Tt({
|
|
34344
34344
|
state: {
|
|
34345
34345
|
init() {
|
|
@@ -34411,11 +34411,11 @@ function O5(e) {
|
|
|
34411
34411
|
});
|
|
34412
34412
|
return r;
|
|
34413
34413
|
}
|
|
34414
|
-
function
|
|
34414
|
+
function Mk(e) {
|
|
34415
34415
|
return Object.prototype.toString.call(e).slice(8, -1);
|
|
34416
34416
|
}
|
|
34417
34417
|
function Na(e) {
|
|
34418
|
-
return
|
|
34418
|
+
return Mk(e) !== "Object" ? !1 : e.constructor === Object && Object.getPrototypeOf(e) === Object.prototype;
|
|
34419
34419
|
}
|
|
34420
34420
|
function Di(e, t) {
|
|
34421
34421
|
const n = { ...e };
|
|
@@ -34469,15 +34469,15 @@ class zn {
|
|
|
34469
34469
|
return !1;
|
|
34470
34470
|
}
|
|
34471
34471
|
}
|
|
34472
|
-
function
|
|
34472
|
+
function Rk(e) {
|
|
34473
34473
|
return typeof e == "number";
|
|
34474
34474
|
}
|
|
34475
|
-
class
|
|
34475
|
+
class Dk {
|
|
34476
34476
|
constructor(t) {
|
|
34477
34477
|
this.find = t.find, this.handler = t.handler;
|
|
34478
34478
|
}
|
|
34479
34479
|
}
|
|
34480
|
-
const
|
|
34480
|
+
const Lk = (e, t, n) => {
|
|
34481
34481
|
if (Mu(t))
|
|
34482
34482
|
return [...e.matchAll(t)];
|
|
34483
34483
|
const r = t(e, n);
|
|
@@ -34486,7 +34486,7 @@ const L5 = (e, t, n) => {
|
|
|
34486
34486
|
return a.index = l.index, a.input = e, a.data = l.data, l.replaceWith && (l.text.includes(l.replaceWith) || console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'), a.push(l.replaceWith)), a;
|
|
34487
34487
|
}) : [];
|
|
34488
34488
|
};
|
|
34489
|
-
function
|
|
34489
|
+
function Pk(e) {
|
|
34490
34490
|
const { editor: t, state: n, from: r, to: l, rule: a, pasteEvent: i, dropEvent: s } = e, { commands: o, chain: u, can: c } = new Oi({
|
|
34491
34491
|
editor: t,
|
|
34492
34492
|
state: n
|
|
@@ -34495,7 +34495,7 @@ function P5(e) {
|
|
|
34495
34495
|
if (!f.isTextblock || f.type.spec.code)
|
|
34496
34496
|
return;
|
|
34497
34497
|
const g = Math.max(r, m), b = Math.min(l, m + f.content.size), y = f.textBetween(g - m, b - m, void 0, "");
|
|
34498
|
-
|
|
34498
|
+
Lk(y, a.find, i).forEach((k) => {
|
|
34499
34499
|
if (k.index === void 0)
|
|
34500
34500
|
return;
|
|
34501
34501
|
const D = g + k.index + 1, M = D + k[0].length, C = {
|
|
@@ -34516,14 +34516,14 @@ function P5(e) {
|
|
|
34516
34516
|
}), d.every((f) => f !== null);
|
|
34517
34517
|
}
|
|
34518
34518
|
let wa = null;
|
|
34519
|
-
const
|
|
34519
|
+
const Bk = (e) => {
|
|
34520
34520
|
var t;
|
|
34521
34521
|
const n = new ClipboardEvent("paste", {
|
|
34522
34522
|
clipboardData: new DataTransfer()
|
|
34523
34523
|
});
|
|
34524
34524
|
return (t = n.clipboardData) === null || t === void 0 || t.setData("text/html", e), n;
|
|
34525
34525
|
};
|
|
34526
|
-
function
|
|
34526
|
+
function Fk(e) {
|
|
34527
34527
|
const { editor: t, rules: n } = e;
|
|
34528
34528
|
let r = null, l = !1, a = !1, i = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, s;
|
|
34529
34529
|
try {
|
|
@@ -34536,7 +34536,7 @@ function F5(e) {
|
|
|
34536
34536
|
state: c,
|
|
34537
34537
|
transaction: g
|
|
34538
34538
|
});
|
|
34539
|
-
if (!(!
|
|
34539
|
+
if (!(!Pk({
|
|
34540
34540
|
editor: t,
|
|
34541
34541
|
state: b,
|
|
34542
34542
|
from: Math.max(d - 1, 0),
|
|
@@ -34594,7 +34594,7 @@ function F5(e) {
|
|
|
34594
34594
|
if (A) {
|
|
34595
34595
|
let { text: M } = y;
|
|
34596
34596
|
typeof M == "string" ? M = M : M = Ou(Q.from(M), f.schema);
|
|
34597
|
-
const { from: C } = y, w = C + M.length, N =
|
|
34597
|
+
const { from: C } = y, w = C + M.length, N = Bk(M);
|
|
34598
34598
|
return o({
|
|
34599
34599
|
rule: c,
|
|
34600
34600
|
state: f,
|
|
@@ -34604,7 +34604,7 @@ function F5(e) {
|
|
|
34604
34604
|
});
|
|
34605
34605
|
}
|
|
34606
34606
|
const k = h.doc.content.findDiffStart(f.doc.content), D = h.doc.content.findDiffEnd(f.doc.content);
|
|
34607
|
-
if (!(!
|
|
34607
|
+
if (!(!Rk(k) || !D || k === D.b))
|
|
34608
34608
|
return o({
|
|
34609
34609
|
rule: c,
|
|
34610
34610
|
state: f,
|
|
@@ -34615,13 +34615,13 @@ function F5(e) {
|
|
|
34615
34615
|
}
|
|
34616
34616
|
}));
|
|
34617
34617
|
}
|
|
34618
|
-
function
|
|
34618
|
+
function Hk(e) {
|
|
34619
34619
|
const t = e.filter((n, r) => e.indexOf(n) !== r);
|
|
34620
34620
|
return Array.from(new Set(t));
|
|
34621
34621
|
}
|
|
34622
34622
|
class Br {
|
|
34623
34623
|
constructor(t, n) {
|
|
34624
|
-
this.splittableMarks = [], this.editor = n, this.extensions = Br.resolve(t), this.schema =
|
|
34624
|
+
this.splittableMarks = [], this.editor = n, this.extensions = Br.resolve(t), this.schema = wk(this.extensions, n), this.setupExtensions();
|
|
34625
34625
|
}
|
|
34626
34626
|
/**
|
|
34627
34627
|
* Returns a flattened and sorted extension list while
|
|
@@ -34630,7 +34630,7 @@ class Br {
|
|
|
34630
34630
|
* @returns An flattened and sorted array of Tiptap extensions
|
|
34631
34631
|
*/
|
|
34632
34632
|
static resolve(t) {
|
|
34633
|
-
const n = Br.sort(Br.flatten(t)), r =
|
|
34633
|
+
const n = Br.sort(Br.flatten(t)), r = Hk(n.map((l) => l.name));
|
|
34634
34634
|
return r.length && console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map((l) => `'${l}'`).join(", ")}]. This can lead to issues.`), n;
|
|
34635
34635
|
}
|
|
34636
34636
|
/**
|
|
@@ -34696,7 +34696,7 @@ class Br {
|
|
|
34696
34696
|
const g = Object.fromEntries(Object.entries(u()).map(([b, y]) => [b, () => y({ editor: t })]));
|
|
34697
34697
|
c = { ...c, ...g };
|
|
34698
34698
|
}
|
|
34699
|
-
const d =
|
|
34699
|
+
const d = lk(c);
|
|
34700
34700
|
o.push(d);
|
|
34701
34701
|
const h = ce(i, "addInputRules", s);
|
|
34702
34702
|
Hf(i, t.options.enableInputRules) && h && r.push(...h());
|
|
@@ -34710,11 +34710,11 @@ class Br {
|
|
|
34710
34710
|
return o;
|
|
34711
34711
|
}).flat();
|
|
34712
34712
|
return [
|
|
34713
|
-
|
|
34713
|
+
Ok({
|
|
34714
34714
|
editor: t,
|
|
34715
34715
|
rules: r
|
|
34716
34716
|
}),
|
|
34717
|
-
...
|
|
34717
|
+
...Fk({
|
|
34718
34718
|
editor: t,
|
|
34719
34719
|
rules: l
|
|
34720
34720
|
}),
|
|
@@ -34841,7 +34841,7 @@ function $m(e, t, n) {
|
|
|
34841
34841
|
function qm(e) {
|
|
34842
34842
|
return Object.fromEntries(Object.entries(e.nodes).filter(([, t]) => t.spec.toText).map(([t, n]) => [t, n.spec.toText]));
|
|
34843
34843
|
}
|
|
34844
|
-
const
|
|
34844
|
+
const Uk = pt.create({
|
|
34845
34845
|
name: "clipboardTextSerializer",
|
|
34846
34846
|
addOptions() {
|
|
34847
34847
|
return {
|
|
@@ -34864,10 +34864,10 @@ const U5 = pt.create({
|
|
|
34864
34864
|
})
|
|
34865
34865
|
];
|
|
34866
34866
|
}
|
|
34867
|
-
}),
|
|
34867
|
+
}), zk = () => ({ editor: e, view: t }) => (requestAnimationFrame(() => {
|
|
34868
34868
|
var n;
|
|
34869
34869
|
e.isDestroyed || (t.dom.blur(), (n = window?.getSelection()) === null || n === void 0 || n.removeAllRanges());
|
|
34870
|
-
}), !0),
|
|
34870
|
+
}), !0), Vk = (e = !1) => ({ commands: t }) => t.setContent("", e), $k = () => ({ state: e, tr: t, dispatch: n }) => {
|
|
34871
34871
|
const { selection: r } = t, { ranges: l } = r;
|
|
34872
34872
|
return n && l.forEach(({ $from: a, $to: i }) => {
|
|
34873
34873
|
e.doc.nodesBetween(a.pos, i.pos, (s, o) => {
|
|
@@ -34884,12 +34884,12 @@ const U5 = pt.create({
|
|
|
34884
34884
|
(m || m === 0) && t.lift(f, m);
|
|
34885
34885
|
});
|
|
34886
34886
|
}), !0;
|
|
34887
|
-
},
|
|
34887
|
+
}, qk = (e) => (t) => e(t), Wk = () => ({ state: e, dispatch: t }) => Bm(e, t), Yk = (e, t) => ({ editor: n, tr: r }) => {
|
|
34888
34888
|
const { state: l } = n, a = l.doc.slice(e.from, e.to);
|
|
34889
34889
|
r.deleteRange(e.from, e.to);
|
|
34890
34890
|
const i = r.mapping.map(t);
|
|
34891
|
-
return r.insert(i, a.content), r.setSelection(new
|
|
34892
|
-
},
|
|
34891
|
+
return r.insert(i, a.content), r.setSelection(new Te(r.doc.resolve(Math.max(i - 1, 0)))), !0;
|
|
34892
|
+
}, jk = () => ({ tr: e, dispatch: t }) => {
|
|
34893
34893
|
const { selection: n } = e, r = n.$anchor.node();
|
|
34894
34894
|
if (r.content.size > 0)
|
|
34895
34895
|
return !1;
|
|
@@ -34903,7 +34903,7 @@ const U5 = pt.create({
|
|
|
34903
34903
|
return !0;
|
|
34904
34904
|
}
|
|
34905
34905
|
return !1;
|
|
34906
|
-
},
|
|
34906
|
+
}, Gk = (e) => ({ tr: t, state: n, dispatch: r }) => {
|
|
34907
34907
|
const l = rt(e, n.schema), a = t.selection.$anchor;
|
|
34908
34908
|
for (let i = a.depth; i > 0; i -= 1)
|
|
34909
34909
|
if (a.node(i).type === l) {
|
|
@@ -34914,10 +34914,10 @@ const U5 = pt.create({
|
|
|
34914
34914
|
return !0;
|
|
34915
34915
|
}
|
|
34916
34916
|
return !1;
|
|
34917
|
-
},
|
|
34917
|
+
}, Kk = (e) => ({ tr: t, dispatch: n }) => {
|
|
34918
34918
|
const { from: r, to: l } = e;
|
|
34919
34919
|
return n && t.delete(r, l), !0;
|
|
34920
|
-
},
|
|
34920
|
+
}, Qk = () => ({ state: e, dispatch: t }) => Au(e, t), Xk = () => ({ commands: e }) => e.keyboardShortcut("Enter"), Jk = () => ({ state: e, dispatch: t }) => ck(e, t);
|
|
34921
34921
|
function si(e, t, n = { strict: !0 }) {
|
|
34922
34922
|
const r = Object.keys(t);
|
|
34923
34923
|
return r.length ? r.every((l) => n.strict ? t[l] === e[l] : Mu(t[l]) ? t[l].test(e[l]) : t[l] === e[l]) : !0;
|
|
@@ -34957,17 +34957,17 @@ function Gn(e, t) {
|
|
|
34957
34957
|
}
|
|
34958
34958
|
return e;
|
|
34959
34959
|
}
|
|
34960
|
-
const
|
|
34960
|
+
const Zk = (e, t = {}) => ({ tr: n, state: r, dispatch: l }) => {
|
|
34961
34961
|
const a = Gn(e, r.schema), { doc: i, selection: s } = n, { $from: o, from: u, to: c } = s;
|
|
34962
34962
|
if (l) {
|
|
34963
34963
|
const d = Ru(o, a, t);
|
|
34964
34964
|
if (d && d.from <= u && d.to >= c) {
|
|
34965
|
-
const h =
|
|
34965
|
+
const h = Te.create(i, d.from, d.to);
|
|
34966
34966
|
n.setSelection(h);
|
|
34967
34967
|
}
|
|
34968
34968
|
}
|
|
34969
34969
|
return !0;
|
|
34970
|
-
},
|
|
34970
|
+
}, e5 = (e) => (t) => {
|
|
34971
34971
|
const n = typeof e == "function" ? e(t) : e;
|
|
34972
34972
|
for (let r = 0; r < n.length; r += 1)
|
|
34973
34973
|
if (n[r](t))
|
|
@@ -34975,7 +34975,7 @@ const Z5 = (e, t = {}) => ({ tr: n, state: r, dispatch: l }) => {
|
|
|
34975
34975
|
return !1;
|
|
34976
34976
|
};
|
|
34977
34977
|
function Ym(e) {
|
|
34978
|
-
return e instanceof
|
|
34978
|
+
return e instanceof Te;
|
|
34979
34979
|
}
|
|
34980
34980
|
function or(e = 0, t = 0, n = 0) {
|
|
34981
34981
|
return Math.min(Math.max(e, t), n);
|
|
@@ -34989,7 +34989,7 @@ function jm(e, t = null) {
|
|
|
34989
34989
|
if (t === "end")
|
|
34990
34990
|
return r;
|
|
34991
34991
|
const l = n.from, a = r.to;
|
|
34992
|
-
return t === "all" ?
|
|
34992
|
+
return t === "all" ? Te.create(e, or(0, l, a), or(e.content.size, l, a)) : Te.create(e, or(t, l, a), or(t, l, a));
|
|
34993
34993
|
}
|
|
34994
34994
|
function zf() {
|
|
34995
34995
|
return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
|
|
@@ -35004,17 +35004,17 @@ function oi() {
|
|
|
35004
35004
|
"iPod"
|
|
35005
35005
|
].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
|
|
35006
35006
|
}
|
|
35007
|
-
function
|
|
35007
|
+
function t5() {
|
|
35008
35008
|
return typeof navigator < "u" ? /^((?!chrome|android).)*safari/i.test(navigator.userAgent) : !1;
|
|
35009
35009
|
}
|
|
35010
|
-
const
|
|
35010
|
+
const n5 = (e = null, t = {}) => ({ editor: n, view: r, tr: l, dispatch: a }) => {
|
|
35011
35011
|
t = {
|
|
35012
35012
|
scrollIntoView: !0,
|
|
35013
35013
|
...t
|
|
35014
35014
|
};
|
|
35015
35015
|
const i = () => {
|
|
35016
35016
|
(oi() || zf()) && r.dom.focus(), requestAnimationFrame(() => {
|
|
35017
|
-
n.isDestroyed || (r.focus(),
|
|
35017
|
+
n.isDestroyed || (r.focus(), t5() && !oi() && !zf() && r.dom.focus({ preventScroll: !0 }));
|
|
35018
35018
|
});
|
|
35019
35019
|
};
|
|
35020
35020
|
if (r.hasFocus() && e === null || e === !1)
|
|
@@ -35023,7 +35023,7 @@ const nk = (e = null, t = {}) => ({ editor: n, view: r, tr: l, dispatch: a }) =>
|
|
|
35023
35023
|
return i(), !0;
|
|
35024
35024
|
const s = jm(l.doc, e) || n.state.selection, o = n.state.selection.eq(s);
|
|
35025
35025
|
return a && (o || l.setSelection(s), o && l.storedMarks && l.setStoredMarks(l.storedMarks), i()), !0;
|
|
35026
|
-
},
|
|
35026
|
+
}, r5 = (e, t) => (n) => e.every((r, l) => t(r, { ...n, index: l })), l5 = (e, t) => ({ tr: n, commands: r }) => r.insertContentAt({ from: n.selection.from, to: n.selection.to }, e, t), Gm = (e) => {
|
|
35027
35027
|
const t = e.childNodes;
|
|
35028
35028
|
for (let n = t.length - 1; n >= 0; n -= 1) {
|
|
35029
35029
|
const r = t[n];
|
|
@@ -35084,7 +35084,7 @@ function Gl(e, t, n) {
|
|
|
35084
35084
|
}
|
|
35085
35085
|
return Gl("", t, n);
|
|
35086
35086
|
}
|
|
35087
|
-
function
|
|
35087
|
+
function a5(e, t, n) {
|
|
35088
35088
|
const r = e.steps.length - 1;
|
|
35089
35089
|
if (r < t)
|
|
35090
35090
|
return;
|
|
@@ -35097,7 +35097,7 @@ function ak(e, t, n) {
|
|
|
35097
35097
|
i === 0 && (i = c);
|
|
35098
35098
|
}), e.setSelection(Ne.near(e.doc.resolve(i), n));
|
|
35099
35099
|
}
|
|
35100
|
-
const
|
|
35100
|
+
const i5 = (e) => !("type" in e), s5 = (e, t, n) => ({ tr: r, dispatch: l, editor: a }) => {
|
|
35101
35101
|
var i;
|
|
35102
35102
|
if (l) {
|
|
35103
35103
|
n = {
|
|
@@ -35138,7 +35138,7 @@ const ik = (e) => !("type" in e), sk = (e, t, n) => ({ tr: r, dispatch: l, edito
|
|
|
35138
35138
|
return o(b), !1;
|
|
35139
35139
|
}
|
|
35140
35140
|
let { from: c, to: d } = typeof e == "number" ? { from: e, to: e } : { from: e.from, to: e.to }, h = !0, f = !0;
|
|
35141
|
-
if ((
|
|
35141
|
+
if ((i5(s) ? s : [s]).forEach((b) => {
|
|
35142
35142
|
b.check(), h = h ? b.isText && b.marks.length === 0 : !1, f = f ? b.isBlock : !1;
|
|
35143
35143
|
}), c === d && f) {
|
|
35144
35144
|
const { parent: b } = r.doc.resolve(c);
|
|
@@ -35157,28 +35157,28 @@ const ik = (e) => !("type" in e), sk = (e, t, n) => ({ tr: r, dispatch: l, edito
|
|
|
35157
35157
|
r.insertText(g, c, d);
|
|
35158
35158
|
} else
|
|
35159
35159
|
g = s, r.replaceWith(c, d, g);
|
|
35160
|
-
n.updateSelection &&
|
|
35160
|
+
n.updateSelection && a5(r, r.steps.length - 1, -1), n.applyInputRules && r.setMeta("applyInputRules", { from: c, text: g }), n.applyPasteRules && r.setMeta("applyPasteRules", { from: c, text: g });
|
|
35161
35161
|
}
|
|
35162
35162
|
return !0;
|
|
35163
|
-
},
|
|
35163
|
+
}, o5 = () => ({ state: e, dispatch: t }) => sk(e, t), u5 = () => ({ state: e, dispatch: t }) => ok(e, t), c5 = () => ({ state: e, dispatch: t }) => _m(e, t), d5 = () => ({ state: e, dispatch: t }) => Dm(e, t), f5 = () => ({ state: e, dispatch: t, tr: n }) => {
|
|
35164
35164
|
try {
|
|
35165
35165
|
const r = Si(e.doc, e.selection.$from.pos, -1);
|
|
35166
35166
|
return r == null ? !1 : (n.join(r, 2), t && t(n), !0);
|
|
35167
35167
|
} catch {
|
|
35168
35168
|
return !1;
|
|
35169
35169
|
}
|
|
35170
|
-
},
|
|
35170
|
+
}, h5 = () => ({ state: e, dispatch: t, tr: n }) => {
|
|
35171
35171
|
try {
|
|
35172
35172
|
const r = Si(e.doc, e.selection.$from.pos, 1);
|
|
35173
35173
|
return r == null ? !1 : (n.join(r, 2), t && t(n), !0);
|
|
35174
35174
|
} catch {
|
|
35175
35175
|
return !1;
|
|
35176
35176
|
}
|
|
35177
|
-
},
|
|
35177
|
+
}, p5 = () => ({ state: e, dispatch: t }) => ak(e, t), m5 = () => ({ state: e, dispatch: t }) => ik(e, t);
|
|
35178
35178
|
function Km() {
|
|
35179
35179
|
return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
|
|
35180
35180
|
}
|
|
35181
|
-
function
|
|
35181
|
+
function b5(e) {
|
|
35182
35182
|
const t = e.split(/-(?!$)/);
|
|
35183
35183
|
let n = t[t.length - 1];
|
|
35184
35184
|
n === "Space" && (n = " ");
|
|
@@ -35200,8 +35200,8 @@ function bk(e) {
|
|
|
35200
35200
|
}
|
|
35201
35201
|
return r && (n = `Alt-${n}`), l && (n = `Ctrl-${n}`), i && (n = `Meta-${n}`), a && (n = `Shift-${n}`), n;
|
|
35202
35202
|
}
|
|
35203
|
-
const
|
|
35204
|
-
const a =
|
|
35203
|
+
const g5 = (e) => ({ editor: t, view: n, tr: r, dispatch: l }) => {
|
|
35204
|
+
const a = b5(e).split(/-(?!$)/), i = a.find((u) => !["Alt", "Ctrl", "Meta", "Shift"].includes(u)), s = new KeyboardEvent("keydown", {
|
|
35205
35205
|
key: i === "Space" ? " " : i,
|
|
35206
35206
|
altKey: a.includes("Alt"),
|
|
35207
35207
|
ctrlKey: a.includes("Ctrl"),
|
|
@@ -35232,13 +35232,13 @@ function Kl(e, t, n = {}) {
|
|
|
35232
35232
|
const o = l - r, u = s.filter((d) => i ? i.name === d.node.type.name : !0).filter((d) => si(d.node.attrs, n, { strict: !1 }));
|
|
35233
35233
|
return a ? !!u.length : u.reduce((d, h) => d + h.to - h.from, 0) >= o;
|
|
35234
35234
|
}
|
|
35235
|
-
const
|
|
35235
|
+
const v5 = (e, t = {}) => ({ state: n, dispatch: r }) => {
|
|
35236
35236
|
const l = rt(e, n.schema);
|
|
35237
|
-
return Kl(n, l, t) ?
|
|
35238
|
-
},
|
|
35237
|
+
return Kl(n, l, t) ? uk(n, r) : !1;
|
|
35238
|
+
}, y5 = () => ({ state: e, dispatch: t }) => Fm(e, t), E5 = (e) => ({ state: t, dispatch: n }) => {
|
|
35239
35239
|
const r = rt(e, t.schema);
|
|
35240
|
-
return
|
|
35241
|
-
},
|
|
35240
|
+
return Tk(r)(t, n);
|
|
35241
|
+
}, T5 = () => ({ state: e, dispatch: t }) => Pm(e, t);
|
|
35242
35242
|
function Li(e, t) {
|
|
35243
35243
|
return t.nodes[e] ? "node" : t.marks[e] ? "mark" : null;
|
|
35244
35244
|
}
|
|
@@ -35246,7 +35246,7 @@ function Vf(e, t) {
|
|
|
35246
35246
|
const n = typeof t == "string" ? [t] : t;
|
|
35247
35247
|
return Object.keys(e).reduce((r, l) => (n.includes(l) || (r[l] = e[l]), r), {});
|
|
35248
35248
|
}
|
|
35249
|
-
const
|
|
35249
|
+
const C5 = (e, t) => ({ tr: n, state: r, dispatch: l }) => {
|
|
35250
35250
|
let a = null, i = null;
|
|
35251
35251
|
const s = Li(typeof e == "string" ? e : e.name, r.schema);
|
|
35252
35252
|
return s ? (s === "node" && (a = rt(e, r.schema)), s === "mark" && (i = Gn(e, r.schema)), l && n.selection.ranges.forEach((o) => {
|
|
@@ -35256,13 +35256,13 @@ const Ck = (e, t) => ({ tr: n, state: r, dispatch: l }) => {
|
|
|
35256
35256
|
});
|
|
35257
35257
|
});
|
|
35258
35258
|
}), !0) : !1;
|
|
35259
|
-
},
|
|
35259
|
+
}, x5 = () => ({ tr: e, dispatch: t }) => (t && e.scrollIntoView(), !0), S5 = () => ({ tr: e, dispatch: t }) => {
|
|
35260
35260
|
if (t) {
|
|
35261
35261
|
const n = new Dt(e.doc);
|
|
35262
35262
|
e.setSelection(n);
|
|
35263
35263
|
}
|
|
35264
35264
|
return !0;
|
|
35265
|
-
},
|
|
35265
|
+
}, k5 = () => ({ state: e, dispatch: t }) => Mm(e, t), A5 = () => ({ state: e, dispatch: t }) => Lm(e, t), N5 = () => ({ state: e, dispatch: t }) => hk(e, t), w5 = () => ({ state: e, dispatch: t }) => bk(e, t), I5 = () => ({ state: e, dispatch: t }) => mk(e, t);
|
|
35266
35266
|
function Io(e, t, n = {}, r = {}) {
|
|
35267
35267
|
return Gl(e, t, {
|
|
35268
35268
|
slice: !1,
|
|
@@ -35270,7 +35270,7 @@ function Io(e, t, n = {}, r = {}) {
|
|
|
35270
35270
|
errorOnInvalidContent: r.errorOnInvalidContent
|
|
35271
35271
|
});
|
|
35272
35272
|
}
|
|
35273
|
-
const
|
|
35273
|
+
const _5 = (e, t = !1, n = {}, r = {}) => ({ editor: l, tr: a, dispatch: i, commands: s }) => {
|
|
35274
35274
|
var o, u;
|
|
35275
35275
|
const { doc: c } = a;
|
|
35276
35276
|
if (n.preserveWhitespace !== "full") {
|
|
@@ -35292,7 +35292,7 @@ function Qm(e, t) {
|
|
|
35292
35292
|
const s = i.find((o) => o.type.name === n.name);
|
|
35293
35293
|
return s ? { ...s.attrs } : {};
|
|
35294
35294
|
}
|
|
35295
|
-
function
|
|
35295
|
+
function O5(e) {
|
|
35296
35296
|
for (let t = 0; t < e.edgeCount; t += 1) {
|
|
35297
35297
|
const { type: n } = e.edge(t);
|
|
35298
35298
|
if (n.isTextblock && !n.hasRequiredAttrs())
|
|
@@ -35300,7 +35300,7 @@ function Ok(e) {
|
|
|
35300
35300
|
}
|
|
35301
35301
|
return null;
|
|
35302
35302
|
}
|
|
35303
|
-
function
|
|
35303
|
+
function M5(e, t) {
|
|
35304
35304
|
for (let n = e.depth; n > 0; n -= 1) {
|
|
35305
35305
|
const r = e.node(n);
|
|
35306
35306
|
if (t(r))
|
|
@@ -35313,16 +35313,16 @@ function Mk(e, t) {
|
|
|
35313
35313
|
}
|
|
35314
35314
|
}
|
|
35315
35315
|
function Du(e) {
|
|
35316
|
-
return (t) =>
|
|
35316
|
+
return (t) => M5(t.$from, e);
|
|
35317
35317
|
}
|
|
35318
|
-
function
|
|
35318
|
+
function R5(e, t) {
|
|
35319
35319
|
const n = {
|
|
35320
35320
|
from: 0,
|
|
35321
35321
|
to: e.content.size
|
|
35322
35322
|
};
|
|
35323
35323
|
return $m(e, n, t);
|
|
35324
35324
|
}
|
|
35325
|
-
function
|
|
35325
|
+
function D5(e, t) {
|
|
35326
35326
|
const n = rt(t, e.schema), { from: r, to: l } = e.selection, a = [];
|
|
35327
35327
|
e.doc.nodesBetween(r, l, (s) => {
|
|
35328
35328
|
a.push(s);
|
|
@@ -35330,9 +35330,9 @@ function Dk(e, t) {
|
|
|
35330
35330
|
const i = a.reverse().find((s) => s.type.name === n.name);
|
|
35331
35331
|
return i ? { ...i.attrs } : {};
|
|
35332
35332
|
}
|
|
35333
|
-
function
|
|
35333
|
+
function L5(e, t) {
|
|
35334
35334
|
const n = Li(typeof t == "string" ? t : t.name, e.schema);
|
|
35335
|
-
return n === "node" ?
|
|
35335
|
+
return n === "node" ? D5(e, t) : n === "mark" ? Qm(e, t) : {};
|
|
35336
35336
|
}
|
|
35337
35337
|
function Xm(e, t, n) {
|
|
35338
35338
|
const r = [];
|
|
@@ -35379,7 +35379,7 @@ function _o(e, t, n = {}) {
|
|
|
35379
35379
|
const o = s.filter((d) => a ? a.name === d.mark.type.name : !0).filter((d) => si(d.mark.attrs, n, { strict: !1 })).reduce((d, h) => d + h.to - h.from, 0), u = s.filter((d) => a ? d.mark.type !== a && d.mark.type.excludes(a) : !0).reduce((d, h) => d + h.to - h.from, 0);
|
|
35380
35380
|
return (o > 0 ? o + u : o) >= i;
|
|
35381
35381
|
}
|
|
35382
|
-
function
|
|
35382
|
+
function P5(e, t, n = {}) {
|
|
35383
35383
|
if (!t)
|
|
35384
35384
|
return Kl(e, null, n) || _o(e, null, n);
|
|
35385
35385
|
const r = Li(t, e.schema);
|
|
@@ -35418,10 +35418,10 @@ function Pi(e, { checkChildren: t = !0, ignoreWhitespace: n = !1 } = {}) {
|
|
|
35418
35418
|
}
|
|
35419
35419
|
return !1;
|
|
35420
35420
|
}
|
|
35421
|
-
function
|
|
35421
|
+
function B5(e) {
|
|
35422
35422
|
return e instanceof ge;
|
|
35423
35423
|
}
|
|
35424
|
-
function
|
|
35424
|
+
function F5(e, t, n) {
|
|
35425
35425
|
var r;
|
|
35426
35426
|
const { selection: l } = t;
|
|
35427
35427
|
let a = null;
|
|
@@ -35443,7 +35443,7 @@ function Fk(e, t, n) {
|
|
|
35443
35443
|
}), u;
|
|
35444
35444
|
});
|
|
35445
35445
|
}
|
|
35446
|
-
const
|
|
35446
|
+
const H5 = (e, t = {}) => ({ tr: n, state: r, dispatch: l }) => {
|
|
35447
35447
|
const { selection: a } = n, { empty: i, ranges: s } = a, o = Gn(e, r.schema);
|
|
35448
35448
|
if (l)
|
|
35449
35449
|
if (i) {
|
|
@@ -35465,26 +35465,26 @@ const Hk = (e, t = {}) => ({ tr: n, state: r, dispatch: l }) => {
|
|
|
35465
35465
|
}) : n.addMark(m, g, o.create(t));
|
|
35466
35466
|
});
|
|
35467
35467
|
});
|
|
35468
|
-
return
|
|
35469
|
-
},
|
|
35468
|
+
return F5(r, n, o);
|
|
35469
|
+
}, U5 = (e, t) => ({ tr: n }) => (n.setMeta(e, t), !0), z5 = (e, t = {}) => ({ state: n, dispatch: r, chain: l }) => {
|
|
35470
35470
|
const a = rt(e, n.schema);
|
|
35471
35471
|
let i;
|
|
35472
35472
|
return n.selection.$anchor.sameParent(n.selection.$head) && (i = n.selection.$anchor.parent.attrs), a.isTextblock ? l().command(({ commands: s }) => Pf(a, { ...i, ...t })(n) ? !0 : s.clearNodes()).command(({ state: s }) => Pf(a, { ...i, ...t })(s, r)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
|
|
35473
|
-
},
|
|
35473
|
+
}, V5 = (e) => ({ tr: t, dispatch: n }) => {
|
|
35474
35474
|
if (n) {
|
|
35475
35475
|
const { doc: r } = t, l = or(e, 0, r.content.size), a = ge.create(r, l);
|
|
35476
35476
|
t.setSelection(a);
|
|
35477
35477
|
}
|
|
35478
35478
|
return !0;
|
|
35479
|
-
}, $
|
|
35479
|
+
}, $5 = (e) => ({ tr: t, dispatch: n }) => {
|
|
35480
35480
|
if (n) {
|
|
35481
|
-
const { doc: r } = t, { from: l, to: a } = typeof e == "number" ? { from: e, to: e } : e, i =
|
|
35481
|
+
const { doc: r } = t, { from: l, to: a } = typeof e == "number" ? { from: e, to: e } : e, i = Te.atStart(r).from, s = Te.atEnd(r).to, o = or(l, i, s), u = or(a, i, s), c = Te.create(r, o, u);
|
|
35482
35482
|
t.setSelection(c);
|
|
35483
35483
|
}
|
|
35484
35484
|
return !0;
|
|
35485
|
-
},
|
|
35485
|
+
}, q5 = (e) => ({ state: t, dispatch: n }) => {
|
|
35486
35486
|
const r = rt(e, t.schema);
|
|
35487
|
-
return
|
|
35487
|
+
return Sk(r)(t, n);
|
|
35488
35488
|
};
|
|
35489
35489
|
function qf(e, t) {
|
|
35490
35490
|
const n = e.storedMarks || e.selection.$to.parentOffset && e.selection.$from.marks();
|
|
@@ -35493,13 +35493,13 @@ function qf(e, t) {
|
|
|
35493
35493
|
e.tr.ensureMarks(r);
|
|
35494
35494
|
}
|
|
35495
35495
|
}
|
|
35496
|
-
const
|
|
35496
|
+
const W5 = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor: l }) => {
|
|
35497
35497
|
const { selection: a, doc: i } = t, { $from: s, $to: o } = a, u = l.extensionManager.attributes, c = Va(u, s.node().type.name, s.node().attrs);
|
|
35498
35498
|
if (a instanceof ge && a.node.isBlock)
|
|
35499
35499
|
return !s.parentOffset || !hn(i, s.pos) ? !1 : (r && (e && qf(n, l.extensionManager.splittableMarks), t.split(s.pos).scrollIntoView()), !0);
|
|
35500
35500
|
if (!s.parent.isBlock)
|
|
35501
35501
|
return !1;
|
|
35502
|
-
const d = o.parentOffset === o.parent.content.size, h = s.depth === 0 ? void 0 :
|
|
35502
|
+
const d = o.parentOffset === o.parent.content.size, h = s.depth === 0 ? void 0 : O5(s.node(-1).contentMatchAt(s.indexAfter(-1)));
|
|
35503
35503
|
let f = d && h ? [
|
|
35504
35504
|
{
|
|
35505
35505
|
type: h,
|
|
@@ -35512,14 +35512,14 @@ const Wk = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, edit
|
|
|
35512
35512
|
attrs: c
|
|
35513
35513
|
}
|
|
35514
35514
|
] : void 0), r) {
|
|
35515
|
-
if (m && (a instanceof
|
|
35515
|
+
if (m && (a instanceof Te && t.deleteSelection(), t.split(t.mapping.map(s.pos), 1, f), h && !d && !s.parentOffset && s.parent.type !== h)) {
|
|
35516
35516
|
const g = t.mapping.map(s.before()), b = t.doc.resolve(g);
|
|
35517
35517
|
s.node(-1).canReplaceWith(b.index(), b.index() + 1, h) && t.setNodeMarkup(t.mapping.map(s.before()), h);
|
|
35518
35518
|
}
|
|
35519
35519
|
e && qf(n, l.extensionManager.splittableMarks), t.scrollIntoView();
|
|
35520
35520
|
}
|
|
35521
35521
|
return m;
|
|
35522
|
-
},
|
|
35522
|
+
}, Y5 = (e, t = {}) => ({ tr: n, state: r, dispatch: l, editor: a }) => {
|
|
35523
35523
|
var i;
|
|
35524
35524
|
const s = rt(e, r.schema), { $from: o, $to: u } = r.selection, c = r.selection.node;
|
|
35525
35525
|
if (c && c.isBlock || o.depth < 2 || !o.sameParent(u))
|
|
@@ -35548,7 +35548,7 @@ const Wk = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, edit
|
|
|
35548
35548
|
if (w > -1)
|
|
35549
35549
|
return !1;
|
|
35550
35550
|
N.isTextblock && N.content.size === 0 && (w = S + 1);
|
|
35551
|
-
}), w > -1 && n.setSelection(
|
|
35551
|
+
}), w > -1 && n.setSelection(Te.near(n.doc.resolve(w))), n.scrollIntoView();
|
|
35552
35552
|
}
|
|
35553
35553
|
return !0;
|
|
35554
35554
|
}
|
|
@@ -35592,7 +35592,7 @@ const Wk = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, edit
|
|
|
35592
35592
|
return !0;
|
|
35593
35593
|
const l = e.doc.nodeAt(r);
|
|
35594
35594
|
return n.node.type === l?.type && Yn(e.doc, r) && e.join(r), !0;
|
|
35595
|
-
},
|
|
35595
|
+
}, j5 = (e, t, n, r = {}) => ({ editor: l, tr: a, state: i, dispatch: s, chain: o, commands: u, can: c }) => {
|
|
35596
35596
|
const { extensions: d, splittableMarks: h } = l.extensionManager, f = rt(e, i.schema), m = rt(t, i.schema), { selection: g, storedMarks: b } = i, { $from: y, $to: A } = g, k = y.blockRange(A), D = b || g.$to.parentOffset && g.$from.marks();
|
|
35597
35597
|
if (!k)
|
|
35598
35598
|
return !1;
|
|
@@ -35607,17 +35607,17 @@ const Wk = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, edit
|
|
|
35607
35607
|
const C = c().wrapInList(f, r), w = D.filter((N) => h.includes(N.type.name));
|
|
35608
35608
|
return a.ensureMarks(w), C ? !0 : u.clearNodes();
|
|
35609
35609
|
}).wrapInList(f, r).command(() => Us(a, f)).command(() => zs(a, f)).run();
|
|
35610
|
-
},
|
|
35610
|
+
}, G5 = (e, t = {}, n = {}) => ({ state: r, commands: l }) => {
|
|
35611
35611
|
const { extendEmptyMarkRange: a = !1 } = n, i = Gn(e, r.schema);
|
|
35612
35612
|
return _o(r, i, t) ? l.unsetMark(i, { extendEmptyMarkRange: a }) : l.setMark(i, t);
|
|
35613
|
-
},
|
|
35613
|
+
}, K5 = (e, t, n = {}) => ({ state: r, commands: l }) => {
|
|
35614
35614
|
const a = rt(e, r.schema), i = rt(t, r.schema), s = Kl(r, a, n);
|
|
35615
35615
|
let o;
|
|
35616
35616
|
return r.selection.$anchor.sameParent(r.selection.$head) && (o = r.selection.$anchor.parent.attrs), s ? l.setNode(i, o) : l.setNode(a, { ...o, ...n });
|
|
35617
|
-
},
|
|
35617
|
+
}, Q5 = (e, t = {}) => ({ state: n, commands: r }) => {
|
|
35618
35618
|
const l = rt(e, n.schema);
|
|
35619
35619
|
return Kl(n, l, t) ? r.lift(l) : r.wrapIn(l, t);
|
|
35620
|
-
},
|
|
35620
|
+
}, X5 = () => ({ state: e, dispatch: t }) => {
|
|
35621
35621
|
const n = e.plugins;
|
|
35622
35622
|
for (let r = 0; r < n.length; r += 1) {
|
|
35623
35623
|
const l = n[r];
|
|
@@ -35637,12 +35637,12 @@ const Wk = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, edit
|
|
|
35637
35637
|
}
|
|
35638
35638
|
}
|
|
35639
35639
|
return !1;
|
|
35640
|
-
},
|
|
35640
|
+
}, J5 = () => ({ tr: e, dispatch: t }) => {
|
|
35641
35641
|
const { selection: n } = e, { empty: r, ranges: l } = n;
|
|
35642
35642
|
return r || t && l.forEach((a) => {
|
|
35643
35643
|
e.removeMark(a.$from.pos, a.$to.pos);
|
|
35644
35644
|
}), !0;
|
|
35645
|
-
},
|
|
35645
|
+
}, Z5 = (e, t = {}) => ({ tr: n, state: r, dispatch: l }) => {
|
|
35646
35646
|
var a;
|
|
35647
35647
|
const { extendEmptyMarkRange: i = !1 } = t, { selection: s } = n, o = Gn(e, r.schema), { $from: u, empty: c, ranges: d } = s;
|
|
35648
35648
|
if (!l)
|
|
@@ -35689,68 +35689,68 @@ const Wk = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, edit
|
|
|
35689
35689
|
}), !0) : !1;
|
|
35690
35690
|
}, t8 = (e, t = {}) => ({ state: n, dispatch: r }) => {
|
|
35691
35691
|
const l = rt(e, n.schema);
|
|
35692
|
-
return
|
|
35692
|
+
return gk(l, t)(n, r);
|
|
35693
35693
|
}, n8 = (e, t = {}) => ({ state: n, dispatch: r }) => {
|
|
35694
35694
|
const l = rt(e, n.schema);
|
|
35695
|
-
return
|
|
35695
|
+
return vk(l, t)(n, r);
|
|
35696
35696
|
};
|
|
35697
35697
|
var r8 = /* @__PURE__ */ Object.freeze({
|
|
35698
35698
|
__proto__: null,
|
|
35699
|
-
blur:
|
|
35700
|
-
clearContent:
|
|
35701
|
-
clearNodes: $
|
|
35702
|
-
command:
|
|
35703
|
-
createParagraphNear:
|
|
35704
|
-
cut:
|
|
35705
|
-
deleteCurrentNode:
|
|
35706
|
-
deleteNode:
|
|
35707
|
-
deleteRange:
|
|
35708
|
-
deleteSelection:
|
|
35709
|
-
enter:
|
|
35710
|
-
exitCode:
|
|
35711
|
-
extendMarkRange:
|
|
35712
|
-
first:
|
|
35713
|
-
focus:
|
|
35714
|
-
forEach:
|
|
35715
|
-
insertContent:
|
|
35716
|
-
insertContentAt:
|
|
35717
|
-
joinBackward:
|
|
35718
|
-
joinDown:
|
|
35719
|
-
joinForward:
|
|
35720
|
-
joinItemBackward:
|
|
35721
|
-
joinItemForward:
|
|
35722
|
-
joinTextblockBackward:
|
|
35723
|
-
joinTextblockForward:
|
|
35724
|
-
joinUp:
|
|
35725
|
-
keyboardShortcut:
|
|
35726
|
-
lift:
|
|
35727
|
-
liftEmptyBlock:
|
|
35728
|
-
liftListItem:
|
|
35729
|
-
newlineInCode:
|
|
35730
|
-
resetAttributes:
|
|
35731
|
-
scrollIntoView:
|
|
35732
|
-
selectAll:
|
|
35733
|
-
selectNodeBackward:
|
|
35734
|
-
selectNodeForward:
|
|
35735
|
-
selectParentNode:
|
|
35736
|
-
selectTextblockEnd:
|
|
35737
|
-
selectTextblockStart:
|
|
35738
|
-
setContent:
|
|
35739
|
-
setMark:
|
|
35740
|
-
setMeta:
|
|
35741
|
-
setNode:
|
|
35742
|
-
setNodeSelection:
|
|
35743
|
-
setTextSelection: $
|
|
35744
|
-
sinkListItem:
|
|
35745
|
-
splitBlock:
|
|
35746
|
-
splitListItem:
|
|
35747
|
-
toggleList:
|
|
35748
|
-
toggleMark:
|
|
35749
|
-
toggleNode:
|
|
35750
|
-
toggleWrap:
|
|
35751
|
-
undoInputRule:
|
|
35752
|
-
unsetAllMarks:
|
|
35753
|
-
unsetMark:
|
|
35699
|
+
blur: zk,
|
|
35700
|
+
clearContent: Vk,
|
|
35701
|
+
clearNodes: $k,
|
|
35702
|
+
command: qk,
|
|
35703
|
+
createParagraphNear: Wk,
|
|
35704
|
+
cut: Yk,
|
|
35705
|
+
deleteCurrentNode: jk,
|
|
35706
|
+
deleteNode: Gk,
|
|
35707
|
+
deleteRange: Kk,
|
|
35708
|
+
deleteSelection: Qk,
|
|
35709
|
+
enter: Xk,
|
|
35710
|
+
exitCode: Jk,
|
|
35711
|
+
extendMarkRange: Zk,
|
|
35712
|
+
first: e5,
|
|
35713
|
+
focus: n5,
|
|
35714
|
+
forEach: r5,
|
|
35715
|
+
insertContent: l5,
|
|
35716
|
+
insertContentAt: s5,
|
|
35717
|
+
joinBackward: c5,
|
|
35718
|
+
joinDown: u5,
|
|
35719
|
+
joinForward: d5,
|
|
35720
|
+
joinItemBackward: f5,
|
|
35721
|
+
joinItemForward: h5,
|
|
35722
|
+
joinTextblockBackward: p5,
|
|
35723
|
+
joinTextblockForward: m5,
|
|
35724
|
+
joinUp: o5,
|
|
35725
|
+
keyboardShortcut: g5,
|
|
35726
|
+
lift: v5,
|
|
35727
|
+
liftEmptyBlock: y5,
|
|
35728
|
+
liftListItem: E5,
|
|
35729
|
+
newlineInCode: T5,
|
|
35730
|
+
resetAttributes: C5,
|
|
35731
|
+
scrollIntoView: x5,
|
|
35732
|
+
selectAll: S5,
|
|
35733
|
+
selectNodeBackward: k5,
|
|
35734
|
+
selectNodeForward: A5,
|
|
35735
|
+
selectParentNode: N5,
|
|
35736
|
+
selectTextblockEnd: w5,
|
|
35737
|
+
selectTextblockStart: I5,
|
|
35738
|
+
setContent: _5,
|
|
35739
|
+
setMark: H5,
|
|
35740
|
+
setMeta: U5,
|
|
35741
|
+
setNode: z5,
|
|
35742
|
+
setNodeSelection: V5,
|
|
35743
|
+
setTextSelection: $5,
|
|
35744
|
+
sinkListItem: q5,
|
|
35745
|
+
splitBlock: W5,
|
|
35746
|
+
splitListItem: Y5,
|
|
35747
|
+
toggleList: j5,
|
|
35748
|
+
toggleMark: G5,
|
|
35749
|
+
toggleNode: K5,
|
|
35750
|
+
toggleWrap: Q5,
|
|
35751
|
+
undoInputRule: X5,
|
|
35752
|
+
unsetAllMarks: J5,
|
|
35753
|
+
unsetMark: Z5,
|
|
35754
35754
|
updateAttributes: e8,
|
|
35755
35755
|
wrapIn: t8,
|
|
35756
35756
|
wrapInList: n8
|
|
@@ -36134,7 +36134,7 @@ function h8(e, t, n) {
|
|
|
36134
36134
|
const l = document.createElement("style");
|
|
36135
36135
|
return t && l.setAttribute("nonce", t), l.setAttribute("data-tiptap-style", ""), l.innerHTML = e, document.getElementsByTagName("head")[0].appendChild(l), l;
|
|
36136
36136
|
}
|
|
36137
|
-
class p8 extends
|
|
36137
|
+
class p8 extends kk {
|
|
36138
36138
|
constructor(t = {}) {
|
|
36139
36139
|
super(), this.isFocused = !1, this.isInitialized = !1, this.extensionStorage = {}, this.options = {
|
|
36140
36140
|
element: document.createElement("div"),
|
|
@@ -36267,7 +36267,7 @@ class p8 extends k5 {
|
|
|
36267
36267
|
var t, n;
|
|
36268
36268
|
const l = [...this.options.enableCoreExtensions ? [
|
|
36269
36269
|
i8,
|
|
36270
|
-
|
|
36270
|
+
Uk.configure({
|
|
36271
36271
|
blockSeparator: (n = (t = this.options.coreExtensionOptions) === null || t === void 0 ? void 0 : t.clipboardTextSerializer) === null || n === void 0 ? void 0 : n.blockSeparator
|
|
36272
36272
|
}),
|
|
36273
36273
|
l8,
|
|
@@ -36401,11 +36401,11 @@ class p8 extends k5 {
|
|
|
36401
36401
|
* Get attributes of the currently selected node or mark.
|
|
36402
36402
|
*/
|
|
36403
36403
|
getAttributes(t) {
|
|
36404
|
-
return
|
|
36404
|
+
return L5(this.state, t);
|
|
36405
36405
|
}
|
|
36406
36406
|
isActive(t, n) {
|
|
36407
36407
|
const r = typeof t == "string" ? t : null, l = typeof t == "string" ? n : t;
|
|
36408
|
-
return
|
|
36408
|
+
return P5(this.state, r, l);
|
|
36409
36409
|
}
|
|
36410
36410
|
/**
|
|
36411
36411
|
* Get the document as JSON.
|
|
@@ -36426,7 +36426,7 @@ class p8 extends k5 {
|
|
|
36426
36426
|
const { blockSeparator: n = `
|
|
36427
36427
|
|
|
36428
36428
|
`, textSerializers: r = {} } = t || {};
|
|
36429
|
-
return
|
|
36429
|
+
return R5(this.state.doc, {
|
|
36430
36430
|
blockSeparator: n,
|
|
36431
36431
|
textSerializers: {
|
|
36432
36432
|
...qm(this.schema),
|
|
@@ -36591,7 +36591,7 @@ class Nt {
|
|
|
36591
36591
|
}
|
|
36592
36592
|
}
|
|
36593
36593
|
function Gr(e) {
|
|
36594
|
-
return new
|
|
36594
|
+
return new Dk({
|
|
36595
36595
|
find: e.find,
|
|
36596
36596
|
handler: ({ state: t, range: n, match: r, pasteEvent: l }) => {
|
|
36597
36597
|
const a = Ie(e.getAttributes, void 0, r, l);
|
|
@@ -36640,7 +36640,7 @@ var Wf;
|
|
|
36640
36640
|
function v8() {
|
|
36641
36641
|
if (Wf) return Vs;
|
|
36642
36642
|
Wf = 1;
|
|
36643
|
-
var e =
|
|
36643
|
+
var e = Ee;
|
|
36644
36644
|
function t(d, h) {
|
|
36645
36645
|
return d === h && (d !== 0 || 1 / d === 1 / h) || d !== d && h !== h;
|
|
36646
36646
|
}
|
|
@@ -36685,7 +36685,7 @@ var Yf;
|
|
|
36685
36685
|
function y8() {
|
|
36686
36686
|
return Yf || (Yf = 1, process.env.NODE_ENV !== "production" && function() {
|
|
36687
36687
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
36688
|
-
var e =
|
|
36688
|
+
var e = Ee, t = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
36689
36689
|
function n(k) {
|
|
36690
36690
|
{
|
|
36691
36691
|
for (var D = arguments.length, M = new Array(D > 1 ? D - 1 : 0), C = 1; C < D; C++)
|
|
@@ -36760,7 +36760,7 @@ const E8 = (...e) => (t) => {
|
|
|
36760
36760
|
});
|
|
36761
36761
|
}, T8 = ({ contentComponent: e }) => {
|
|
36762
36762
|
const t = Bi.useSyncExternalStore(e.subscribe, e.getSnapshot, e.getServerSnapshot);
|
|
36763
|
-
return
|
|
36763
|
+
return Ee.createElement(Ee.Fragment, null, Object.values(t));
|
|
36764
36764
|
};
|
|
36765
36765
|
function C8() {
|
|
36766
36766
|
const e = /* @__PURE__ */ new Set();
|
|
@@ -36798,10 +36798,10 @@ function C8() {
|
|
|
36798
36798
|
}
|
|
36799
36799
|
};
|
|
36800
36800
|
}
|
|
36801
|
-
class x8 extends
|
|
36801
|
+
class x8 extends Ee.Component {
|
|
36802
36802
|
constructor(t) {
|
|
36803
36803
|
var n;
|
|
36804
|
-
super(t), this.editorContentRef =
|
|
36804
|
+
super(t), this.editorContentRef = Ee.createRef(), this.initialized = !1, this.state = {
|
|
36805
36805
|
hasContentComponentInitialized: !!(!((n = t.editor) === null || n === void 0) && n.contentComponent)
|
|
36806
36806
|
};
|
|
36807
36807
|
}
|
|
@@ -36839,22 +36839,22 @@ class x8 extends ye.Component {
|
|
|
36839
36839
|
}
|
|
36840
36840
|
render() {
|
|
36841
36841
|
const { editor: t, innerRef: n, ...r } = this.props;
|
|
36842
|
-
return
|
|
36843
|
-
|
|
36842
|
+
return Ee.createElement(
|
|
36843
|
+
Ee.Fragment,
|
|
36844
36844
|
null,
|
|
36845
|
-
|
|
36846
|
-
t?.contentComponent &&
|
|
36845
|
+
Ee.createElement("div", { ref: E8(n, this.editorContentRef), ...r }),
|
|
36846
|
+
t?.contentComponent && Ee.createElement(T8, { contentComponent: t.contentComponent })
|
|
36847
36847
|
);
|
|
36848
36848
|
}
|
|
36849
36849
|
}
|
|
36850
36850
|
const S8 = Jb((e, t) => {
|
|
36851
|
-
const n =
|
|
36852
|
-
return
|
|
36851
|
+
const n = Ee.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [e.editor]);
|
|
36852
|
+
return Ee.createElement(x8, {
|
|
36853
36853
|
key: n,
|
|
36854
36854
|
innerRef: t,
|
|
36855
36855
|
...e
|
|
36856
36856
|
});
|
|
36857
|
-
}), k8 =
|
|
36857
|
+
}), k8 = Ee.memo(S8);
|
|
36858
36858
|
var A8 = function e(t, n) {
|
|
36859
36859
|
if (t === n) return !0;
|
|
36860
36860
|
if (t && n && typeof t == "object" && typeof n == "object") {
|
|
@@ -36914,7 +36914,7 @@ var jf;
|
|
|
36914
36914
|
function w8() {
|
|
36915
36915
|
if (jf) return qs;
|
|
36916
36916
|
jf = 1;
|
|
36917
|
-
var e =
|
|
36917
|
+
var e = Ee, t = Bi;
|
|
36918
36918
|
function n(u, c) {
|
|
36919
36919
|
return u === c && (u !== 0 || 1 / u === 1 / c) || u !== u && c !== c;
|
|
36920
36920
|
}
|
|
@@ -36965,7 +36965,7 @@ var Gf;
|
|
|
36965
36965
|
function I8() {
|
|
36966
36966
|
return Gf || (Gf = 1, process.env.NODE_ENV !== "production" && function() {
|
|
36967
36967
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
36968
|
-
var e =
|
|
36968
|
+
var e = Ee, t = Bi;
|
|
36969
36969
|
function n(c, d) {
|
|
36970
36970
|
return c === d && (c !== 0 || 1 / c === 1 / d) || c !== c && d !== d;
|
|
36971
36971
|
}
|
|
@@ -37207,11 +37207,11 @@ P8.Consumer;
|
|
|
37207
37207
|
const B8 = Bo({
|
|
37208
37208
|
onDragStart: void 0
|
|
37209
37209
|
}), F8 = () => dh(B8);
|
|
37210
|
-
|
|
37210
|
+
Ee.forwardRef((e, t) => {
|
|
37211
37211
|
const { onDragStart: n } = F8(), r = e.as || "div";
|
|
37212
37212
|
return (
|
|
37213
37213
|
// @ts-ignore
|
|
37214
|
-
|
|
37214
|
+
Ee.createElement(r, { ...e, ref: t, "data-node-view-wrapper": "", onDragStart: n, style: {
|
|
37215
37215
|
whiteSpace: "normal",
|
|
37216
37216
|
...e.style
|
|
37217
37217
|
} })
|
|
@@ -37536,7 +37536,7 @@ const H8 = /^\s*>\s$/, U8 = Nt.create({
|
|
|
37536
37536
|
return !1;
|
|
37537
37537
|
const { tr: i, schema: s } = e.state, o = s.text(n.replace(/\r\n?/g, `
|
|
37538
37538
|
`));
|
|
37539
|
-
return i.replaceSelectionWith(this.type.create({ language: a }, o)), i.selection.$from.parent.type !== this.type && i.setSelection(
|
|
37539
|
+
return i.replaceSelectionWith(this.type.create({ language: a }, o)), i.selection.$from.parent.type !== this.type && i.setSelection(Te.near(i.doc.resolve(Math.max(0, i.selection.from - 2)))), i.setMeta("paste", !0), e.dispatch(i), !0;
|
|
37540
37540
|
}
|
|
37541
37541
|
}
|
|
37542
37542
|
})
|
|
@@ -37803,7 +37803,7 @@ function _a(e, t) {
|
|
|
37803
37803
|
const n = e == "vert" ? t > 0 ? "down" : "up" : t > 0 ? "right" : "left";
|
|
37804
37804
|
return function(r, l, a) {
|
|
37805
37805
|
let i = r.selection, s = t > 0 ? i.$to : i.$from, o = i.empty;
|
|
37806
|
-
if (i instanceof
|
|
37806
|
+
if (i instanceof Te) {
|
|
37807
37807
|
if (!a.endOfTextblock(n) || s.depth == 0)
|
|
37808
37808
|
return !1;
|
|
37809
37809
|
o = !1, s = r.doc.resolve(t > 0 ? s.after() : s.before());
|
|
@@ -37831,7 +37831,7 @@ function uA(e, t) {
|
|
|
37831
37831
|
for (let i = r.length - 1; i >= 0; i--)
|
|
37832
37832
|
l = Q.from(r[i].createAndFill(null, l));
|
|
37833
37833
|
let a = e.state.tr.replace(n.pos, n.pos, new ue(l, 0, 0));
|
|
37834
|
-
return a.setSelection(
|
|
37834
|
+
return a.setSelection(Te.near(a.doc.resolve(n.pos + 1))), e.dispatch(a), !1;
|
|
37835
37835
|
}
|
|
37836
37836
|
function cA(e) {
|
|
37837
37837
|
if (!(e.selection instanceof $e))
|
|
@@ -38347,17 +38347,17 @@ const tb = eb(!1, !0), nb = eb(!0, !0), xA = pt.create({
|
|
|
38347
38347
|
to: l.pos
|
|
38348
38348
|
}, {
|
|
38349
38349
|
type: this.name
|
|
38350
|
-
}) :
|
|
38350
|
+
}) : B5(n) ? a.insertContentAt(l.pos, {
|
|
38351
38351
|
type: this.name
|
|
38352
38352
|
}) : a.insertContent({ type: this.name }), a.command(({ tr: i, dispatch: s }) => {
|
|
38353
38353
|
var o;
|
|
38354
38354
|
if (s) {
|
|
38355
38355
|
const { $to: u } = i.selection, c = u.end();
|
|
38356
38356
|
if (u.nodeAfter)
|
|
38357
|
-
u.nodeAfter.isTextblock ? i.setSelection(
|
|
38357
|
+
u.nodeAfter.isTextblock ? i.setSelection(Te.create(i.doc, u.pos + 1)) : u.nodeAfter.isBlock ? i.setSelection(ge.create(i.doc, u.pos)) : i.setSelection(Te.create(i.doc, u.pos));
|
|
38358
38358
|
else {
|
|
38359
38359
|
const d = (o = u.parent.type.contentMatch.defaultType) === null || o === void 0 ? void 0 : o.create();
|
|
38360
|
-
d && (i.insert(c, d), i.setSelection(
|
|
38360
|
+
d && (i.insert(c, d), i.setSelection(Te.create(i.doc, c + 1)));
|
|
38361
38361
|
}
|
|
38362
38362
|
i.scrollIntoView();
|
|
38363
38363
|
}
|
|
@@ -38697,7 +38697,7 @@ const zA = ({ expanded: e, onToggle: t }) => /* @__PURE__ */ W(
|
|
|
38697
38697
|
/* @__PURE__ */ v("span", { className: "rte-richtext-toggle-label", children: e ? "收起" : "展开" })
|
|
38698
38698
|
]
|
|
38699
38699
|
}
|
|
38700
|
-
), rb =
|
|
38700
|
+
), rb = Ee.memo(
|
|
38701
38701
|
({ node: e, value: t, onChange: n, disabled: r, error: l, nodeDefaults: a, onExpandChange: i }) => {
|
|
38702
38702
|
const s = typeof e.minHeight == "number" ? e.minHeight : a?.richtext?.minHeight ?? 40, o = typeof e.maxHeight == "number" ? e.maxHeight : a?.richtext?.maxHeight ?? 160, u = Math.max(o, s), c = e.expandable !== !1, [d, h] = G(!1), f = te(n), m = te(e.key);
|
|
38703
38703
|
be(() => {
|
|
@@ -39022,7 +39022,7 @@ const VA = (e) => {
|
|
|
39022
39022
|
}
|
|
39023
39023
|
);
|
|
39024
39024
|
}
|
|
39025
|
-
}, lb =
|
|
39025
|
+
}, lb = Ee.memo(VA);
|
|
39026
39026
|
lb.displayName = "NodeRenderer";
|
|
39027
39027
|
const nh = (e) => typeof e == "string" || Array.isArray(e) && e.every((t) => typeof t == "string"), rh = (e, t) => e === t ? !0 : Array.isArray(e) && Array.isArray(t) ? e.length === t.length && e.every((n, r) => n === t[r]) : !1, $A = (e) => {
|
|
39028
39028
|
const t = /* @__PURE__ */ new Map();
|
|
@@ -39527,7 +39527,7 @@ const cN = {
|
|
|
39527
39527
|
adjustY: 1,
|
|
39528
39528
|
shiftX: !1,
|
|
39529
39529
|
shiftY: !1
|
|
39530
|
-
}, ob =
|
|
39530
|
+
}, ob = Ee.memo(({ options: e, onSelect: t, disabled: n, currentAgent: r, onOpenChange: l, align: a, onExit: i }) => {
|
|
39531
39531
|
const [s, o] = G(!1), u = (f) => {
|
|
39532
39532
|
o(f), l?.(f);
|
|
39533
39533
|
}, c = e.filter((f) => f.isShowNew !== 1).map((f) => ({
|
|
@@ -39602,7 +39602,7 @@ const fN = ["全部技能", "我的技能", "订阅技能", "系统技能"], hN
|
|
|
39602
39602
|
},
|
|
39603
39603
|
{
|
|
39604
39604
|
id: "c2",
|
|
39605
|
-
title: "
|
|
39605
|
+
title: "【商品评价明细导出助手 问候提示生成助手",
|
|
39606
39606
|
desc: Cn,
|
|
39607
39607
|
tags: xn,
|
|
39608
39608
|
badge: "system",
|
|
@@ -39866,7 +39866,7 @@ const fN = ["全部技能", "我的技能", "订阅技能", "系统技能"], hN
|
|
|
39866
39866
|
]
|
|
39867
39867
|
}
|
|
39868
39868
|
);
|
|
39869
|
-
}, ub =
|
|
39869
|
+
}, ub = Ee.memo(({ selectedId: e, onSelect: t, onCardClick: n, onAction: r, skillListFetch: l, onHeaderAction: a, showCreateSkill: i = !0, createDisabled: s }) => {
|
|
39870
39870
|
const { message: o } = Vn.useApp(), [u, c] = G(0), [d, h] = G(l ? [] : bN), [f, m] = G(!1), [g, b] = G(!!l), y = te(0), A = $(() => {
|
|
39871
39871
|
b(!0), y.current = window.setTimeout(() => {
|
|
39872
39872
|
b(!1), m(!0);
|
|
@@ -40022,7 +40022,7 @@ const Ma = 4, cb = () => /* @__PURE__ */ v(
|
|
|
40022
40022
|
}
|
|
40023
40023
|
)
|
|
40024
40024
|
}
|
|
40025
|
-
), db =
|
|
40025
|
+
), db = Ee.memo(({ disabled: e, selectedSkill: t, onSkillSelect: n, onSkillCardClick: r, onSkillAction: l, skillListFetch: a, onSkillHeaderAction: i, showCreateSkill: s, skillPanelOpen: o, onSkillPanelOpenChange: u, createDisabled: c, skillPanelOpenDelay: d }) => {
|
|
40026
40026
|
const [h, f] = G(!1), m = o !== void 0, [g, b] = G(o ?? !1), y = te(0);
|
|
40027
40027
|
be(() => {
|
|
40028
40028
|
if (m)
|
|
@@ -40147,7 +40147,7 @@ const RN = 10 * 1024 * 1024, DN = 50 * 1024 * 1024, LN = "图片大小不能超
|
|
|
40147
40147
|
a.push(o), i += o.size;
|
|
40148
40148
|
}
|
|
40149
40149
|
return { accepted: a, imageOversize: n, totalExceeded: s };
|
|
40150
|
-
}, fb =
|
|
40150
|
+
}, fb = Ee.memo(({ files: e, onChange: t, disabled: n }) => {
|
|
40151
40151
|
const { message: r } = Vn.useApp(), l = te(null), a = $(
|
|
40152
40152
|
(s) => {
|
|
40153
40153
|
const o = Array.from(s.target.files ?? []);
|
|
@@ -40195,7 +40195,7 @@ const HN = () => /* @__PURE__ */ v(
|
|
|
40195
40195
|
}
|
|
40196
40196
|
)
|
|
40197
40197
|
}
|
|
40198
|
-
), hb =
|
|
40198
|
+
), hb = Ee.memo(({ selected: e, onClick: t, onExit: n, disabled: r }) => {
|
|
40199
40199
|
const l = $(() => {
|
|
40200
40200
|
r || t?.();
|
|
40201
40201
|
}, [r, t]);
|
|
@@ -40229,7 +40229,7 @@ const HN = () => /* @__PURE__ */ v(
|
|
|
40229
40229
|
);
|
|
40230
40230
|
});
|
|
40231
40231
|
hb.displayName = "AIImageButton";
|
|
40232
|
-
const pb =
|
|
40232
|
+
const pb = Ee.memo(({ onClick: e, loading: t, disabled: n }) => /* @__PURE__ */ v(
|
|
40233
40233
|
"button",
|
|
40234
40234
|
{
|
|
40235
40235
|
type: "button",
|
|
@@ -40241,7 +40241,7 @@ const pb = ye.memo(({ onClick: e, loading: t, disabled: n }) => /* @__PURE__ */
|
|
|
40241
40241
|
}
|
|
40242
40242
|
));
|
|
40243
40243
|
pb.displayName = "SendButton";
|
|
40244
|
-
const mb =
|
|
40244
|
+
const mb = Ee.memo(
|
|
40245
40245
|
({ currentAgent: e }) => {
|
|
40246
40246
|
const t = e?.points;
|
|
40247
40247
|
return t == null ? null : /* @__PURE__ */ W("div", { className: "rte-points-badge", style: { position: "relative" }, children: [
|
|
@@ -40427,7 +40427,7 @@ const bb = ({ items: e, measureKey: t, disabled: n }) => {
|
|
|
40427
40427
|
] });
|
|
40428
40428
|
};
|
|
40429
40429
|
bb.displayName = "ToolbarOverflow";
|
|
40430
|
-
const $N = { points: ["tl", "tr"], offset: [4, 0] }, gb =
|
|
40430
|
+
const $N = { points: ["tl", "tr"], offset: [4, 0] }, gb = Ee.memo(
|
|
40431
40431
|
({
|
|
40432
40432
|
isProcessing: e,
|
|
40433
40433
|
loading: t,
|
|
@@ -40464,9 +40464,9 @@ const $N = { points: ["tl", "tr"], offset: [4, 0] }, gb = ye.memo(
|
|
|
40464
40464
|
if (X.reduce((fe, ve) => fe + ve.size, 0) > 52428800) {
|
|
40465
40465
|
const fe = [];
|
|
40466
40466
|
let ve = 0;
|
|
40467
|
-
for (const
|
|
40468
|
-
if (ve +
|
|
40469
|
-
fe.push(
|
|
40467
|
+
for (const Se of X) {
|
|
40468
|
+
if (ve + Se.size > 52428800) break;
|
|
40469
|
+
fe.push(Se), ve += Se.size;
|
|
40470
40470
|
}
|
|
40471
40471
|
i(fe);
|
|
40472
40472
|
} else
|
|
@@ -40644,7 +40644,7 @@ const qN = (e) => e < 1024 ? `${e}B` : e < 1024 * 1024 ? `${Math.round(e / 1024)
|
|
|
40644
40644
|
}
|
|
40645
40645
|
)
|
|
40646
40646
|
] });
|
|
40647
|
-
}, vb =
|
|
40647
|
+
}, vb = Ee.memo(({ files: e, onChange: t }) => {
|
|
40648
40648
|
const n = te(null), [r, l] = G({
|
|
40649
40649
|
showLeft: !1,
|
|
40650
40650
|
showRight: !1
|
|
@@ -40692,7 +40692,7 @@ vb.displayName = "FooterFilesList";
|
|
|
40692
40692
|
const uh = 9999, GN = ({ messageRef: e }) => {
|
|
40693
40693
|
const { message: t } = Vn.useApp();
|
|
40694
40694
|
return e.current = t, null;
|
|
40695
|
-
}, Po =
|
|
40695
|
+
}, Po = Ee.memo(({ title: e, onClose: t, exitTip: n = "点击退出技能" }) => (
|
|
40696
40696
|
// zIndex 10000 盖过技能面板(SkillButton 弹层 9999),否则面板打开时 hover tag 的退出气泡
|
|
40697
40697
|
// 被面板遮住(SeTooltip 默认 zIndex ~1070 < 9999)。与 SkillPanel 内各 tooltip 同款抬层。
|
|
40698
40698
|
/* @__PURE__ */ v(gr, { title: n, placement: "top", zIndex: 1e4, children: /* @__PURE__ */ v("span", { className: "tag-node group", contentEditable: !1, children: /* @__PURE__ */ v(
|
|
@@ -40754,10 +40754,10 @@ const Ew = (e) => {
|
|
|
40754
40754
|
skillPanelOpenDelay: R,
|
|
40755
40755
|
selectedSkill: fe,
|
|
40756
40756
|
onSkillSelect: ve,
|
|
40757
|
-
onAIImageClick:
|
|
40757
|
+
onAIImageClick: Se,
|
|
40758
40758
|
aiImageSelected: he,
|
|
40759
40759
|
onAIImageExit: we,
|
|
40760
|
-
loading:
|
|
40760
|
+
loading: Le,
|
|
40761
40761
|
hideButtons: _e,
|
|
40762
40762
|
footerPadding: lt,
|
|
40763
40763
|
showFooterUpload: Vt,
|
|
@@ -40767,7 +40767,7 @@ const Ew = (e) => {
|
|
|
40767
40767
|
lockStructure: ln = !0,
|
|
40768
40768
|
collapsed: qe = !1,
|
|
40769
40769
|
onCollapsedChange: mn,
|
|
40770
|
-
collapseTransitionMs:
|
|
40770
|
+
collapseTransitionMs: ke = 260,
|
|
40771
40771
|
nodeDefaults: Ve,
|
|
40772
40772
|
// 展开态真实高度变化回调:消费端据此算对话列表底部留白,避免最后一条消息被输入框遮挡。
|
|
40773
40773
|
onExpandedHeightChange: an,
|
|
@@ -40784,7 +40784,7 @@ const Ew = (e) => {
|
|
|
40784
40784
|
scrollContainerRef: Bu,
|
|
40785
40785
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
40786
40786
|
autoCollapseOnScroll: Fu
|
|
40787
|
-
} = e, [jt, vn] = G({}), [j, le] = G({}), [pe,
|
|
40787
|
+
} = e, [jt, vn] = G({}), [j, le] = G({}), [pe, Ce] = G(u ?? []), [Pe, It] = G({}), [Lt, ct] = G(cN), [yn, En] = G(() => /* @__PURE__ */ new Set()), [Xe, sn] = G(() => /* @__PURE__ */ new Set()), [Ct, Eb] = G(() => /* @__PURE__ */ new Set()), [Hu, ll] = G({}), [Kn, Tb] = G(null), [Cb, Uu] = G(null), Fi = te(null);
|
|
40788
40788
|
Ue(() => {
|
|
40789
40789
|
const H = Fi.current?.ownerDocument ?? document, ne = H.createElement("div");
|
|
40790
40790
|
return ne.className = "rte-message-host", ne.style.cssText = "position:fixed;inset:0;z-index:2000000000;pointer-events:none;", H.body.appendChild(ne), Uu(ne), () => {
|
|
@@ -40797,11 +40797,11 @@ const Ew = (e) => {
|
|
|
40797
40797
|
), Hi = te(null), [oa, Sb] = G(null), kb = $((H, ne) => {
|
|
40798
40798
|
Sb(ne ? H : null);
|
|
40799
40799
|
}, []), Qn = te(null), [Ab, Nb] = G(58), [Xn, zu] = G(58), [Ui, Vu] = G(!1), $u = te(0), qu = te(qe), [ua, Wu] = G(!1);
|
|
40800
|
-
qu.current !== qe && (qu.current = qe, $u.current = (typeof performance < "u" ? performance.now() : Date.now()) +
|
|
40800
|
+
qu.current !== qe && (qu.current = qe, $u.current = (typeof performance < "u" ? performance.now() : Date.now()) + ke, Wu(!0)), be(() => {
|
|
40801
40801
|
if (!ua) return;
|
|
40802
|
-
const H = setTimeout(() => Wu(!1),
|
|
40802
|
+
const H = setTimeout(() => Wu(!1), ke);
|
|
40803
40803
|
return () => clearTimeout(H);
|
|
40804
|
-
}, [ua, qe,
|
|
40804
|
+
}, [ua, qe, ke]);
|
|
40805
40805
|
const [Jn, Yu] = G(""), al = te(null), zi = te(null), [il, ju] = G(0), [Vi, Gu] = G(0), $i = te(!1);
|
|
40806
40806
|
be(() => {
|
|
40807
40807
|
if (!u || u.length === pe.length && u.every((ae, se) => {
|
|
@@ -40816,9 +40816,9 @@ const Ew = (e) => {
|
|
|
40816
40816
|
if (se + re.size > ne) break;
|
|
40817
40817
|
ae.push(re), se += re.size;
|
|
40818
40818
|
}
|
|
40819
|
-
|
|
40819
|
+
Ce(ae);
|
|
40820
40820
|
} else
|
|
40821
|
-
$i.current = !0,
|
|
40821
|
+
$i.current = !0, Ce(u);
|
|
40822
40822
|
}, [u]);
|
|
40823
40823
|
const xt = Be(
|
|
40824
40824
|
() => uN(t, Lt, yn),
|
|
@@ -40830,7 +40830,7 @@ const Ew = (e) => {
|
|
|
40830
40830
|
Ku.current = !0, qi.current = H;
|
|
40831
40831
|
return;
|
|
40832
40832
|
}
|
|
40833
|
-
qi.current !== H && (qi.current = H,
|
|
40833
|
+
qi.current !== H && (qi.current = H, Ce((ne) => ne.length === 0 ? ne : []));
|
|
40834
40834
|
}, [t]);
|
|
40835
40835
|
const Zn = Be(() => {
|
|
40836
40836
|
const H = t.find((ne) => ne.type === "tag")?.text;
|
|
@@ -40860,8 +40860,8 @@ const Ew = (e) => {
|
|
|
40860
40860
|
},
|
|
40861
40861
|
[V, ve]
|
|
40862
40862
|
), _b = $(() => {
|
|
40863
|
-
er(!0), ol(null), ve?.(null), Zn && P?.("ai-image-switch"),
|
|
40864
|
-
}, [Zn, P,
|
|
40863
|
+
er(!0), ol(null), ve?.(null), Zn && P?.("ai-image-switch"), Se?.();
|
|
40864
|
+
}, [Zn, P, Se, ve]), Ob = $(() => P?.("tag-close"), [P]), Mb = $(() => {
|
|
40865
40865
|
er(!1), we?.();
|
|
40866
40866
|
}, [we]);
|
|
40867
40867
|
be(() => {
|
|
@@ -40881,11 +40881,11 @@ const Ew = (e) => {
|
|
|
40881
40881
|
(re) => re.key === ae && re.type === "markdown-module"
|
|
40882
40882
|
) && vn((re) => {
|
|
40883
40883
|
const me = { ...re, [H]: ne };
|
|
40884
|
-
return Object.keys(me).filter((
|
|
40885
|
-
if (!
|
|
40886
|
-
const
|
|
40887
|
-
return delete
|
|
40888
|
-
}), Object.keys(me).filter((
|
|
40884
|
+
return Object.keys(me).filter((ye) => ye.startsWith(`${ae}__module_`)).every((ye) => rc(me[ye])) && (ct((ye) => {
|
|
40885
|
+
if (!ye.markdownModules[ae]) return ye;
|
|
40886
|
+
const De = { ...ye.markdownModules };
|
|
40887
|
+
return delete De[ae], { ...ye, markdownModules: De };
|
|
40888
|
+
}), Object.keys(me).filter((ye) => ye.startsWith(`${ae}__module_`)).forEach((ye) => delete me[ye]), me[ae] = ""), me;
|
|
40889
40889
|
});
|
|
40890
40890
|
return;
|
|
40891
40891
|
}
|
|
@@ -40918,18 +40918,18 @@ const Ew = (e) => {
|
|
|
40918
40918
|
if (!(H in ne)) return ne;
|
|
40919
40919
|
const oe = H.match(/^(.+)_(\d+)$/);
|
|
40920
40920
|
if (!oe) {
|
|
40921
|
-
const
|
|
40922
|
-
return delete
|
|
40921
|
+
const xe = { ...ne };
|
|
40922
|
+
return delete xe[H], xe;
|
|
40923
40923
|
}
|
|
40924
40924
|
const [, ae, se] = oe, re = parseInt(se, 10), me = {};
|
|
40925
|
-
for (const [
|
|
40926
|
-
if (
|
|
40927
|
-
const
|
|
40928
|
-
if (
|
|
40929
|
-
const dt = parseInt(
|
|
40930
|
-
dt > re ? me[`${ae}_${dt - 1}`] =
|
|
40925
|
+
for (const [xe, ye] of Object.entries(ne)) {
|
|
40926
|
+
if (xe === H) continue;
|
|
40927
|
+
const De = xe.match(/^(.+)_(\d+)$/);
|
|
40928
|
+
if (De && De[1] === ae) {
|
|
40929
|
+
const dt = parseInt(De[2], 10);
|
|
40930
|
+
dt > re ? me[`${ae}_${dt - 1}`] = ye : me[xe] = ye;
|
|
40931
40931
|
} else
|
|
40932
|
-
me[
|
|
40932
|
+
me[xe] = ye;
|
|
40933
40933
|
}
|
|
40934
40934
|
return me;
|
|
40935
40935
|
});
|
|
@@ -40938,16 +40938,16 @@ const Ew = (e) => {
|
|
|
40938
40938
|
const ae = `${H}_`, se = [];
|
|
40939
40939
|
for (const me of Object.keys(oe)) {
|
|
40940
40940
|
if (!me.startsWith(ae)) continue;
|
|
40941
|
-
const
|
|
40942
|
-
/^\d+$/.test(
|
|
40941
|
+
const xe = me.slice(ae.length);
|
|
40942
|
+
/^\d+$/.test(xe) && se.push([Number(xe), oe[me]]);
|
|
40943
40943
|
}
|
|
40944
40944
|
if (se.length === 0) return oe;
|
|
40945
40945
|
const re = { ...oe };
|
|
40946
40946
|
for (const [me] of se) delete re[`${H}_${me}`];
|
|
40947
|
-
for (const [me,
|
|
40947
|
+
for (const [me, xe] of se) {
|
|
40948
40948
|
if (me === ne) continue;
|
|
40949
|
-
const
|
|
40950
|
-
re[`${H}_${
|
|
40949
|
+
const ye = me > ne ? me - 1 : me;
|
|
40950
|
+
re[`${H}_${ye}`] = xe;
|
|
40951
40951
|
}
|
|
40952
40952
|
return re;
|
|
40953
40953
|
});
|
|
@@ -40982,15 +40982,15 @@ const Ew = (e) => {
|
|
|
40982
40982
|
reportModules: { ...re.reportModules, [H]: se.modules }
|
|
40983
40983
|
})), vn((re) => {
|
|
40984
40984
|
const me = { ...re };
|
|
40985
|
-
return se.modules.forEach((
|
|
40986
|
-
me[`${H}__module_${
|
|
40985
|
+
return se.modules.forEach((xe, ye) => {
|
|
40986
|
+
me[`${H}__module_${ye}`] = xe.content;
|
|
40987
40987
|
}), me;
|
|
40988
40988
|
})) : se.status === "failed" && (ji(H, ""), vn((re) => {
|
|
40989
40989
|
let me = !1;
|
|
40990
|
-
const
|
|
40991
|
-
for (const
|
|
40992
|
-
|
|
40993
|
-
return me ?
|
|
40990
|
+
const xe = { ...re };
|
|
40991
|
+
for (const ye of Object.keys(xe))
|
|
40992
|
+
ye.startsWith(`${H}__module_`) && (delete xe[ye], me = !0);
|
|
40993
|
+
return me ? xe : re;
|
|
40994
40994
|
}));
|
|
40995
40995
|
});
|
|
40996
40996
|
await Promise.all([oe, ae]);
|
|
@@ -41024,11 +41024,11 @@ const Ew = (e) => {
|
|
|
41024
41024
|
for (const oe of ne) {
|
|
41025
41025
|
const ae = oe.key, se = i[ae];
|
|
41026
41026
|
!Array.isArray(se) || se.length === 0 || se.forEach((re, me) => {
|
|
41027
|
-
const
|
|
41028
|
-
if (!
|
|
41029
|
-
const
|
|
41030
|
-
sl.current.get(
|
|
41031
|
-
Gi(
|
|
41027
|
+
const xe = typeof re == "string" ? re.trim() : "";
|
|
41028
|
+
if (!xe) return;
|
|
41029
|
+
const ye = `${ae}_${me}`;
|
|
41030
|
+
sl.current.get(ye) !== xe && (sl.current.set(ye, xe), setTimeout(() => {
|
|
41031
|
+
Gi(ye, xe, "multi-variable-select");
|
|
41032
41032
|
}, 100));
|
|
41033
41033
|
});
|
|
41034
41034
|
}
|
|
@@ -41043,14 +41043,14 @@ const Ew = (e) => {
|
|
|
41043
41043
|
});
|
|
41044
41044
|
try {
|
|
41045
41045
|
const re = await oe(H, ne), me = Date.now() - se;
|
|
41046
|
-
me < 500 && await new Promise((
|
|
41047
|
-
...
|
|
41048
|
-
markdownModules: { ...
|
|
41049
|
-
})), vn((
|
|
41050
|
-
const
|
|
41051
|
-
return re.modules.forEach((
|
|
41052
|
-
|
|
41053
|
-
}),
|
|
41046
|
+
me < 500 && await new Promise((xe) => setTimeout(xe, 500 - me)), re && (ct((xe) => ({
|
|
41047
|
+
...xe,
|
|
41048
|
+
markdownModules: { ...xe.markdownModules, [H]: re.modules }
|
|
41049
|
+
})), vn((xe) => {
|
|
41050
|
+
const ye = { ...xe };
|
|
41051
|
+
return re.modules.forEach((De, dt) => {
|
|
41052
|
+
ye[`${H}__module_${dt}`] = De.content;
|
|
41053
|
+
}), ye;
|
|
41054
41054
|
}));
|
|
41055
41055
|
} finally {
|
|
41056
41056
|
En((re) => {
|
|
@@ -41086,13 +41086,18 @@ const Ew = (e) => {
|
|
|
41086
41086
|
if (t.length === 0) {
|
|
41087
41087
|
const re = Jn.trim();
|
|
41088
41088
|
if (!re && !pe.length) return;
|
|
41089
|
-
|
|
41089
|
+
let me = "";
|
|
41090
|
+
if (at) {
|
|
41091
|
+
const ye = at.title;
|
|
41092
|
+
me = ye.startsWith("【") ? ye : `【${ye}】`;
|
|
41093
|
+
}
|
|
41094
|
+
const xe = me ? `${me}${re}` : re;
|
|
41090
41095
|
if (pe.length) {
|
|
41091
|
-
const
|
|
41092
|
-
|
|
41096
|
+
const ye = new FormData();
|
|
41097
|
+
xe && ye.append("prompt", xe), pe.forEach((De) => ye.append("files", De)), n(ye, xe, ne);
|
|
41093
41098
|
} else
|
|
41094
|
-
n(re,
|
|
41095
|
-
Yu(""),
|
|
41099
|
+
n(re, xe, ne);
|
|
41100
|
+
Yu(""), Ce([]);
|
|
41096
41101
|
return;
|
|
41097
41102
|
}
|
|
41098
41103
|
if (!Zu(jt, j, Ar)) return;
|
|
@@ -41105,7 +41110,7 @@ const Ew = (e) => {
|
|
|
41105
41110
|
excludedKeys: Ar,
|
|
41106
41111
|
hiddenSeparatorIndexes: Yi
|
|
41107
41112
|
});
|
|
41108
|
-
se && (n(oe, ae, ne),
|
|
41113
|
+
se && (n(oe, ae, ne), Ce([]));
|
|
41109
41114
|
}, [
|
|
41110
41115
|
t.length,
|
|
41111
41116
|
Jn,
|
|
@@ -41229,7 +41234,7 @@ const Ew = (e) => {
|
|
|
41229
41234
|
overflow: qe || ua ? "hidden" : "auto",
|
|
41230
41235
|
// min-height 必须与 max-height 同步过渡:展开动画用 min-height 把空框顶到目标高(见 minHeight 注释),
|
|
41231
41236
|
// 不纳入 transition 则 min-height 0→122 会瞬间生效、首帧 snap,失去动画。
|
|
41232
|
-
transition: Ui ? "none" : `max-height ${
|
|
41237
|
+
transition: Ui ? "none" : `max-height ${ke}ms cubic-bezier(0.4, 0, 0.2, 1), min-height ${ke}ms cubic-bezier(0.4, 0, 0.2, 1)`,
|
|
41233
41238
|
willChange: "max-height, min-height"
|
|
41234
41239
|
}, uc = $(() => {
|
|
41235
41240
|
qe && bn && mn?.(!1), al.current?.focus();
|
|
@@ -41245,26 +41250,26 @@ const Ew = (e) => {
|
|
|
41245
41250
|
const ae = H.offsetHeight, se = H.scrollHeight, re = H.parentElement;
|
|
41246
41251
|
let me = 1 / 0;
|
|
41247
41252
|
if (re) {
|
|
41248
|
-
let
|
|
41253
|
+
let De = 0;
|
|
41249
41254
|
for (const pa of Array.from(re.children))
|
|
41250
|
-
pa !== H && (
|
|
41255
|
+
pa !== H && (De += pa.offsetHeight);
|
|
41251
41256
|
const dt = getComputedStyle(re), Ji = parseFloat(dt.paddingTop) + parseFloat(dt.paddingBottom);
|
|
41252
|
-
me = Math.max(0, re.clientHeight -
|
|
41257
|
+
me = Math.max(0, re.clientHeight - De - Ji);
|
|
41253
41258
|
}
|
|
41254
41259
|
H.style.maxHeight = oe;
|
|
41255
|
-
const
|
|
41256
|
-
|
|
41260
|
+
const xe = Math.max(Math.ceil(se || 0), Math.ceil(ae || 0)), ye = Math.min(xe, Math.ceil(me));
|
|
41261
|
+
ye > 0 && zu((De) => De === ye ? De : ye);
|
|
41257
41262
|
}
|
|
41258
41263
|
try {
|
|
41259
41264
|
const oe = H.getBoundingClientRect(), ae = H.querySelector(".rte-config-fade") ?? H, se = document.createRange();
|
|
41260
41265
|
se.selectNodeContents(ae);
|
|
41261
41266
|
const re = Array.from(se.getClientRects()).filter((me) => me.height > 0);
|
|
41262
41267
|
if (re.length > 0) {
|
|
41263
|
-
const me = Math.min(...re.map((tr) => tr.top)),
|
|
41268
|
+
const me = Math.min(...re.map((tr) => tr.top)), xe = parseFloat(getComputedStyle(H).lineHeight) || 34, ye = Math.max(xe, 1), De = me + ye * 0.5;
|
|
41264
41269
|
let dt = 0;
|
|
41265
41270
|
for (const tr of re)
|
|
41266
|
-
tr.top <
|
|
41267
|
-
const Ji = dt > 0 ? Math.ceil(dt - oe.top) : 0, pa = getComputedStyle(H), Qb = parseFloat(pa.paddingTop) || 0, Xb = Math.ceil(Qb +
|
|
41271
|
+
tr.top < De && (dt = Math.max(dt, tr.bottom));
|
|
41272
|
+
const Ji = dt > 0 ? Math.ceil(dt - oe.top) : 0, pa = getComputedStyle(H), Qb = parseFloat(pa.paddingTop) || 0, Xb = Math.ceil(Qb + ye), Zi = Math.max(Ji, Xb);
|
|
41268
41273
|
Zi > 0 && Nb((tr) => tr === Zi ? tr : Zi);
|
|
41269
41274
|
}
|
|
41270
41275
|
} catch {
|
|
@@ -41276,9 +41281,9 @@ const Ew = (e) => {
|
|
|
41276
41281
|
), dc = te(Nr);
|
|
41277
41282
|
dc.current !== Nr && (dc.current = Nr, qe || (zu(uh), Vu(!0))), be(() => {
|
|
41278
41283
|
if (!Ui) return;
|
|
41279
|
-
const H = setTimeout(() => Vu(!1),
|
|
41284
|
+
const H = setTimeout(() => Vu(!1), ke);
|
|
41280
41285
|
return () => clearTimeout(H);
|
|
41281
|
-
}, [Ui, Nr,
|
|
41286
|
+
}, [Ui, Nr, ke]), Ue(() => {
|
|
41282
41287
|
const H = Qn.current;
|
|
41283
41288
|
if (!H || (ha(), typeof ResizeObserver > "u")) return;
|
|
41284
41289
|
const ne = () => {
|
|
@@ -41364,24 +41369,24 @@ const Ew = (e) => {
|
|
|
41364
41369
|
), Kb = $(
|
|
41365
41370
|
(H) => {
|
|
41366
41371
|
const ne = H.clipboardData?.files;
|
|
41367
|
-
if (!ne || ne.length === 0 || (H.preventDefault(), t.some((
|
|
41372
|
+
if (!ne || ne.length === 0 || (H.preventDefault(), t.some((De) => De.type === "tag"))) return;
|
|
41368
41373
|
const ae = [];
|
|
41369
41374
|
let se = !1;
|
|
41370
|
-
for (const
|
|
41371
|
-
const dt = (
|
|
41372
|
-
hc.has(dt) ? ae.push(
|
|
41375
|
+
for (const De of Array.from(ne)) {
|
|
41376
|
+
const dt = (De.name || "").split(".").pop()?.toLowerCase() || "";
|
|
41377
|
+
hc.has(dt) ? ae.push(De) : se = !0;
|
|
41373
41378
|
}
|
|
41374
41379
|
if (se && Hi.current?.error("粘贴文件中含不支持的类型,已自动过滤"), ae.length === 0) return;
|
|
41375
|
-
const re = 50 * 1024 * 1024, me = pe.reduce((
|
|
41376
|
-
let
|
|
41377
|
-
for (const
|
|
41378
|
-
if (
|
|
41380
|
+
const re = 50 * 1024 * 1024, me = pe.reduce((De, dt) => De + dt.size, 0), xe = [];
|
|
41381
|
+
let ye = me;
|
|
41382
|
+
for (const De of ae) {
|
|
41383
|
+
if (ye + De.size > re) {
|
|
41379
41384
|
Hi.current?.error("文件总大小不能超过 50MB");
|
|
41380
41385
|
break;
|
|
41381
41386
|
}
|
|
41382
|
-
|
|
41387
|
+
xe.push(De), ye += De.size;
|
|
41383
41388
|
}
|
|
41384
|
-
|
|
41389
|
+
xe.length > 0 && Ce((De) => [...xe, ...De]);
|
|
41385
41390
|
},
|
|
41386
41391
|
[hc, t, pe]
|
|
41387
41392
|
);
|
|
@@ -41397,7 +41402,7 @@ const Ew = (e) => {
|
|
|
41397
41402
|
style: jb,
|
|
41398
41403
|
onPaste: Kb,
|
|
41399
41404
|
children: [
|
|
41400
|
-
/* @__PURE__ */ v(vb, { files: pe, onChange:
|
|
41405
|
+
/* @__PURE__ */ v(vb, { files: pe, onChange: Ce }),
|
|
41401
41406
|
t.length === 0 ? /* @__PURE__ */ W(
|
|
41402
41407
|
"div",
|
|
41403
41408
|
{
|
|
@@ -41447,7 +41452,7 @@ const Ew = (e) => {
|
|
|
41447
41452
|
files: j,
|
|
41448
41453
|
onChange: ji,
|
|
41449
41454
|
onFileChange: Lb,
|
|
41450
|
-
thumbnails:
|
|
41455
|
+
thumbnails: Pe,
|
|
41451
41456
|
onThumbnailChange: Pb,
|
|
41452
41457
|
videoUrlParse: A,
|
|
41453
41458
|
videoUpload: k,
|
|
@@ -41481,12 +41486,12 @@ const Ew = (e) => {
|
|
|
41481
41486
|
gb,
|
|
41482
41487
|
{
|
|
41483
41488
|
isProcessing: r,
|
|
41484
|
-
loading:
|
|
41489
|
+
loading: Le,
|
|
41485
41490
|
disabled: l,
|
|
41486
41491
|
sendDisabled: !qb,
|
|
41487
41492
|
showFooterUpload: Vt,
|
|
41488
41493
|
footerFiles: pe,
|
|
41489
|
-
onFooterFilesChange:
|
|
41494
|
+
onFooterFilesChange: Ce,
|
|
41490
41495
|
agentOptions: F,
|
|
41491
41496
|
onAgentSelect: Ib,
|
|
41492
41497
|
hideAgentButton: _e === "hideAgent",
|
|
@@ -42032,18 +42037,18 @@ const ew = ({
|
|
|
42032
42037
|
F.current = e, V.current = b, P.current = D, E.current = m;
|
|
42033
42038
|
});
|
|
42034
42039
|
const U = $((he, we) => {
|
|
42035
|
-
let
|
|
42040
|
+
let Le = 0;
|
|
42036
42041
|
w(!0);
|
|
42037
42042
|
const _e = () => {
|
|
42038
|
-
|
|
42043
|
+
Le < he.length ? (g(he.slice(0, Le + 1)), Le++, _.current = window.setTimeout(_e, n)) : (w(!1), we?.());
|
|
42039
42044
|
};
|
|
42040
42045
|
_e();
|
|
42041
42046
|
}, [n]), q = $((he) => {
|
|
42042
42047
|
let we = E.current.length;
|
|
42043
|
-
const
|
|
42044
|
-
we > 0 ? (g(E.current.slice(0, we - 1)), we--, _.current = window.setTimeout(
|
|
42048
|
+
const Le = () => {
|
|
42049
|
+
we > 0 ? (g(E.current.slice(0, we - 1)), we--, _.current = window.setTimeout(Le, n / 2)) : he?.();
|
|
42045
42050
|
};
|
|
42046
|
-
|
|
42051
|
+
Le();
|
|
42047
42052
|
}, [n]), Z = $(() => {
|
|
42048
42053
|
if (F.current.length === 0 || P.current) return;
|
|
42049
42054
|
k(!0);
|
|
@@ -42077,7 +42082,7 @@ const ew = ({
|
|
|
42077
42082
|
he.trim() && !c && (i?.(he), a || S(""));
|
|
42078
42083
|
}, fe = (he) => {
|
|
42079
42084
|
(he.ctrlKey || he.metaKey) && he.key === "Enter" && (he.preventDefault(), R()), f.onKeyDown?.(he);
|
|
42080
|
-
}, ve = a ? l : N,
|
|
42085
|
+
}, ve = a ? l : N, Se = c || !ve.trim() || (s ? ve.length > s : !1);
|
|
42081
42086
|
return /* @__PURE__ */ W("div", { style: { position: "relative", ...h }, children: [
|
|
42082
42087
|
/* @__PURE__ */ W("div", { style: { position: "relative" }, children: [
|
|
42083
42088
|
/* @__PURE__ */ v(
|
|
@@ -42172,7 +42177,7 @@ const ew = ({
|
|
|
42172
42177
|
size: "small",
|
|
42173
42178
|
icon: /* @__PURE__ */ v(m1, {}),
|
|
42174
42179
|
onClick: R,
|
|
42175
|
-
disabled:
|
|
42180
|
+
disabled: Se,
|
|
42176
42181
|
style: {
|
|
42177
42182
|
borderRadius: 6,
|
|
42178
42183
|
minWidth: 32,
|