bi-components-library 1.3.7-next.5 → 1.3.7-next.6
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 +463 -468
- 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 ye, { 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 = ye.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 = ye.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(xe) {
|
|
4682
4682
|
return he;
|
|
4683
4683
|
function he(we) {
|
|
4684
|
-
const
|
|
4684
|
+
const De = we !== null && xe[we], _e = we !== null && xe.null, lt = [
|
|
4685
4685
|
// To do: add more extension tests.
|
|
4686
4686
|
/* c8 ignore next 2 */
|
|
4687
|
-
...Array.isArray(
|
|
4687
|
+
...Array.isArray(De) ? De : De ? [De] : [],
|
|
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(xe) {
|
|
4694
|
+
return U = xe, q = 0, xe.length === 0 ? B : R(xe[q]);
|
|
4695
4695
|
}
|
|
4696
|
-
function R(
|
|
4696
|
+
function R(xe) {
|
|
4697
4697
|
return he;
|
|
4698
4698
|
function he(we) {
|
|
4699
|
-
return T = S(), Z =
|
|
4699
|
+
return T = S(), Z = xe, xe.partial || (u.currentConstruct = xe), xe.name && u.parser.constructs.disable.null.includes(xe.name) ? ve() : xe.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(xe) {
|
|
4711
4711
|
return _(Z, T), E;
|
|
4712
4712
|
}
|
|
4713
|
-
function ve(
|
|
4713
|
+
function ve(xe) {
|
|
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(Se),
|
|
4895
|
+
hardBreakTrailing: a(Se),
|
|
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: De,
|
|
4921
4921
|
autolinkProtocol: we,
|
|
4922
4922
|
blockQuote: o(),
|
|
4923
4923
|
characterEscapeValue: O,
|
|
4924
4924
|
characterReferenceMarkerHexadecimal: ve,
|
|
4925
4925
|
characterReferenceMarkerNumeric: ve,
|
|
4926
|
-
characterReferenceValue:
|
|
4926
|
+
characterReferenceValue: xe,
|
|
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
|
+
}, Te = [];
|
|
4986
|
+
let Le = -1;
|
|
4987
|
+
for (; ++Le < j.length; )
|
|
4988
|
+
if (j[Le][1].type === "listOrdered" || j[Le][1].type === "listUnordered")
|
|
4989
|
+
if (j[Le][0] === "enter")
|
|
4990
|
+
Te.push(Le);
|
|
4991
4991
|
else {
|
|
4992
|
-
const It =
|
|
4993
|
-
|
|
4992
|
+
const It = Te.pop();
|
|
4993
|
+
Le = l(j, It, Le);
|
|
4994
4994
|
}
|
|
4995
|
-
for (
|
|
4996
|
-
const It = t[j[
|
|
4997
|
-
Wh.call(It, j[
|
|
4998
|
-
sliceSerialize: j[
|
|
4999
|
-
}, pe), j[
|
|
4995
|
+
for (Le = -1; ++Le < j.length; ) {
|
|
4996
|
+
const It = t[j[Le][0]];
|
|
4997
|
+
Wh.call(It, j[Le][1].type) && It[j[Le][1].type].call(Object.assign({
|
|
4998
|
+
sliceSerialize: j[Le][2].sliceSerialize
|
|
4999
|
+
}, pe), j[Le][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
|
+
}, Le = -1; ++Le < t.transforms.length; )
|
|
5017
|
+
le = t.transforms[Le](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 Te = le - 1, Le = -1, It = !1, Lt, ct, yn, En;
|
|
5022
|
+
for (; ++Te <= pe; ) {
|
|
5023
|
+
const Xe = j[Te];
|
|
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" ? Le++ : Le--, En = void 0;
|
|
5029
5029
|
break;
|
|
5030
5030
|
}
|
|
5031
5031
|
case "lineEndingBlank": {
|
|
5032
|
-
Xe[0] === "enter" && (Lt && !En && !
|
|
5032
|
+
Xe[0] === "enter" && (Lt && !En && !Le && !yn && (yn = Te), 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 (!Le && Xe[0] === "enter" && Xe[1].type === "listItemPrefix" || Le === -1 && Xe[0] === "exit" && (Xe[1].type === "listUnordered" || Xe[1].type === "listOrdered")) {
|
|
5045
5045
|
if (Lt) {
|
|
5046
|
-
let sn =
|
|
5046
|
+
let sn = Te;
|
|
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 || Te, 0, ["exit", Lt, Xe[2]]), Te++, 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(Te, 0, ["enter", sn, Xe[2]]), Te++, 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(Te) {
|
|
5073
|
+
s.call(this, j(Te), Te), le && le.call(this, Te);
|
|
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(), Te = this.tokenStack.pop();
|
|
5097
|
+
if (Te)
|
|
5098
|
+
Te[0].type !== j.type && (le ? le.call(this, j, Te[0]) : (Te[1] || Fc).call(this, j, Te[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 Te = pe[pe.length - 1];
|
|
5168
|
+
(!Te || Te.type !== "text") && (Te = jt(), Te.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(Te)), this.stack.push(Te);
|
|
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 Te = j.children;
|
|
5228
|
+
pe.children = Te;
|
|
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 xe(j) {
|
|
5254
5254
|
const le = this.sliceSerialize(j), pe = this.data.characterReferenceType;
|
|
5255
|
-
let
|
|
5256
|
-
pe ? (
|
|
5257
|
-
const
|
|
5258
|
-
|
|
5255
|
+
let Te;
|
|
5256
|
+
pe ? (Te = Lh(le, pe === "characterReferenceMarkerNumeric" ? 10 : 16), this.data.characterReferenceType = void 0) : Te = Pl(le);
|
|
5257
|
+
const Le = this.stack[this.stack.length - 1];
|
|
5258
|
+
Le.value += Te;
|
|
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 De(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 Se() {
|
|
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 = ye.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 = ye.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 = ye.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 = ye.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 = Ee.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"), xe = 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 De = Math.min(240, Math.max(80, R + fe + xe + we + 4));
|
|
15790
|
+
f((_e) => _e === De ? _e : De);
|
|
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(De, _e) {
|
|
16056
|
+
var lt = _.w(q.$u ? Date.UTC(q.$y, _e, De) : new Date(q.$y, _e, De), 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(De, _e) {
|
|
16059
|
+
return _.w(q.toDate()[De].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, xe = "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(xe + "Hours", 0);
|
|
16072
16072
|
case o:
|
|
16073
|
-
return ie(
|
|
16073
|
+
return ie(xe + "Minutes", 1);
|
|
16074
16074
|
case s:
|
|
16075
|
-
return ie(
|
|
16075
|
+
return ie(xe + "Seconds", 2);
|
|
16076
16076
|
case i:
|
|
16077
|
-
return ie(
|
|
16077
|
+
return ie(xe + "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, xe = 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
|
+
}, De = xe || 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 De(X, ie, !0);
|
|
16157
16157
|
case "A":
|
|
16158
|
-
return
|
|
16158
|
+
return De(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 = ye.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 = ye.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 = ye.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 = ye.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 = ye.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 = ye.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 = ye.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 = ye.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)}`, xe = await n4(ve);
|
|
23480
|
+
xe && y.current === R && l?.(e.key, xe);
|
|
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 = ye.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 = ye.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 (Se) => {
|
|
24008
|
+
const Ve = Se.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
|
+
(Se) => {
|
|
24027
24027
|
if (!e.key) return;
|
|
24028
|
-
const Ve =
|
|
24029
|
-
Ve.trim() && (
|
|
24028
|
+
const Ve = Se.clipboardData.getData("text/plain");
|
|
24029
|
+
Ve.trim() && (Se.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
|
+
(Se) => {
|
|
24038
|
+
e.key && (n(e.key, Se.url), N(!1), /^https?:\/\//i.test(Se.url) && _(Se.url));
|
|
24039
24039
|
},
|
|
24040
24040
|
[e.key, n, _]
|
|
24041
24041
|
), B = $(
|
|
24042
|
-
(
|
|
24043
|
-
|
|
24042
|
+
(Se) => {
|
|
24043
|
+
Se.preventDefault(), Se.stopPropagation(), e.key && n(e.key, ""), s?.();
|
|
24044
24044
|
},
|
|
24045
24045
|
[e.key, n, s]
|
|
24046
24046
|
);
|
|
24047
24047
|
be(() => {
|
|
24048
|
-
const
|
|
24048
|
+
const Se = (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", Se), () => document.removeEventListener("rte-report-dropdown-opening", Se);
|
|
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 Se = Z.current;
|
|
24061
|
+
if (!Se) return;
|
|
24062
|
+
const Ve = Se.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 Se = (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", Se), () => document.removeEventListener("mousedown", Se);
|
|
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: (Se) => {
|
|
24099
|
+
Se.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, xe = e.placeholder ?? "粘贴报告链接", he = m || xe, we = te(null), [De, _e] = G(0);
|
|
24125
24125
|
Ue(() => {
|
|
24126
24126
|
we.current && _e(we.current.offsetWidth);
|
|
24127
24127
|
});
|
|
24128
|
-
const lt =
|
|
24128
|
+
const lt = De > 0 ? Math.max(60, De + 2) : f4(he) + 6, Vt = Be(() => {
|
|
24129
24129
|
if (g) return "";
|
|
24130
|
-
const
|
|
24131
|
-
return /^https?:\/\//i.test(
|
|
24130
|
+
const Se = m.trim();
|
|
24131
|
+
return /^https?:\/\//i.test(Se) ? c0(Se) : "";
|
|
24132
24132
|
}, [m, g]), ln = $(
|
|
24133
|
-
(
|
|
24133
|
+
(Se) => {
|
|
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 = Se.target;
|
|
24136
|
+
Ve.closest(".rte-report-chip-clear-host") || Ve.closest(".rte-report-dropdown-host") || (Se.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: (Se) => n(e.key, Se.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: xe,
|
|
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 = ye.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 = ye.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 Ee(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 Ee.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 Ee extends Ne {
|
|
28918
28918
|
/**
|
|
28919
28919
|
Construct a text selection between the given points.
|
|
28920
28920
|
*/
|
|
@@ -28933,7 +28933,7 @@ class Te 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 Ee(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 Te extends Ne {
|
|
|
28942
28942
|
}
|
|
28943
28943
|
}
|
|
28944
28944
|
eq(t) {
|
|
28945
|
-
return t instanceof
|
|
28945
|
+
return t instanceof Ee && 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 Te 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 Ee(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 Te 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 Ee(t, n);
|
|
28986
28986
|
}
|
|
28987
28987
|
}
|
|
28988
|
-
Ne.jsonID("text",
|
|
28988
|
+
Ne.jsonID("text", Ee);
|
|
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 Ee.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 Ee.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 Ee) || 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 Ee) && (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)) || Ee.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 Ee)
|
|
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 Ee(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 Ee(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 Ee(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 Ee && !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 Ee))
|
|
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 Ee) || !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, Ee.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, Ee.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 Ee && (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 Ee && !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 Ee && (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 e5 = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), t5 = typeof navigator < "u" && /Win/.test(navigator.platform);
|
|
33431
|
+
function n5(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 nk(e) {
|
|
|
33443
33443
|
else if (/^s(hift)?$/i.test(o))
|
|
33444
33444
|
a = !0;
|
|
33445
33445
|
else if (/^mod$/i.test(o))
|
|
33446
|
-
|
|
33446
|
+
e5 ? 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 r5(e) {
|
|
33453
33453
|
let t = /* @__PURE__ */ Object.create(null);
|
|
33454
33454
|
for (let n in e)
|
|
33455
|
-
t[
|
|
33455
|
+
t[n5(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 l5(e) {
|
|
33462
33462
|
return new Tt({ props: { handleKeyDown: wm(e) } });
|
|
33463
33463
|
}
|
|
33464
33464
|
function wm(e) {
|
|
33465
|
-
let t =
|
|
33465
|
+
let t = r5(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
|
+
!(t5 && 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
|
+
}, a5 = (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
|
+
}, i5 = (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(Ee.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 s5 = (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 sk = (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
|
+
}, o5 = (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 sk = (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
|
+
}, u5 = (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 c5 = (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 ck = (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(Ee.create(s.doc, i + 1)), t(s.scrollIntoView());
|
|
33697
33697
|
}
|
|
33698
33698
|
return !0;
|
|
33699
33699
|
}, Fm = (e, t) => {
|
|
@@ -33708,7 +33708,7 @@ const ck = (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 d5(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 dk(e) {
|
|
|
33726
33726
|
a.unshift(null);
|
|
33727
33727
|
}
|
|
33728
33728
|
let c = t.tr;
|
|
33729
|
-
(t.selection instanceof
|
|
33729
|
+
(t.selection instanceof Ee || 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 dk(e) {
|
|
|
33737
33737
|
return n && n(c.scrollIntoView()), !0;
|
|
33738
33738
|
};
|
|
33739
33739
|
}
|
|
33740
|
-
const
|
|
33740
|
+
const f5 = d5(), h5 = (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 p5(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 && p5(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(Ee.create(t.doc, e < 0 ? l.start(a) : l.end(a)))), !0) : !1;
|
|
33796
33796
|
};
|
|
33797
33797
|
}
|
|
33798
|
-
const
|
|
33799
|
-
function
|
|
33798
|
+
const m5 = Um(-1), b5 = Um(1);
|
|
33799
|
+
function g5(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, f5);
|
|
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 v5(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 y5(s, i, e, t) ? (r && r(s.scrollIntoView()), !0) : !1;
|
|
33854
33854
|
};
|
|
33855
33855
|
}
|
|
33856
|
-
function
|
|
33856
|
+
function y5(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 yk(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 && E5(e, t, s, l, n), !0) : !1;
|
|
33866
33866
|
}
|
|
33867
|
-
function
|
|
33867
|
+
function E5(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 Ek(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 T5(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 ? C5(t, n, e, a) : x5(t, n, a) : !0 : !1;
|
|
33884
33884
|
};
|
|
33885
33885
|
}
|
|
33886
|
-
function
|
|
33886
|
+
function C5(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 Ck(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 x5(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 xk(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 S5(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 k5 {
|
|
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 A5(e = {}) {
|
|
34150
34150
|
return Object.keys(e).length === 0 && e.constructor === Object;
|
|
34151
34151
|
}
|
|
34152
|
-
function
|
|
34152
|
+
function N5(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) : N5(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" && A5(n) ? !1 : n != null)
|
|
34177
34177
|
);
|
|
34178
34178
|
}
|
|
34179
|
-
function
|
|
34179
|
+
function w5(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 I5 = (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 _5 = (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 = I5(u) + a;
|
|
34311
34311
|
return i.forEach((h) => {
|
|
34312
34312
|
if (c)
|
|
34313
34313
|
return;
|
|
34314
|
-
const f =
|
|
34314
|
+
const f = _5(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 O5(e) {
|
|
34343
34343
|
const { editor: t, rules: n } = e, r = new Tt({
|
|
34344
34344
|
state: {
|
|
34345
34345
|
init() {
|
|
@@ -34411,11 +34411,11 @@ function Ok(e) {
|
|
|
34411
34411
|
});
|
|
34412
34412
|
return r;
|
|
34413
34413
|
}
|
|
34414
|
-
function
|
|
34414
|
+
function M5(e) {
|
|
34415
34415
|
return Object.prototype.toString.call(e).slice(8, -1);
|
|
34416
34416
|
}
|
|
34417
34417
|
function Na(e) {
|
|
34418
|
-
return
|
|
34418
|
+
return M5(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 R5(e) {
|
|
34473
34473
|
return typeof e == "number";
|
|
34474
34474
|
}
|
|
34475
|
-
class
|
|
34475
|
+
class D5 {
|
|
34476
34476
|
constructor(t) {
|
|
34477
34477
|
this.find = t.find, this.handler = t.handler;
|
|
34478
34478
|
}
|
|
34479
34479
|
}
|
|
34480
|
-
const
|
|
34480
|
+
const L5 = (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 Lk = (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 P5(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 Pk(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
|
+
L5(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 Pk(e) {
|
|
|
34516
34516
|
}), d.every((f) => f !== null);
|
|
34517
34517
|
}
|
|
34518
34518
|
let wa = null;
|
|
34519
|
-
const
|
|
34519
|
+
const B5 = (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 F5(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 Fk(e) {
|
|
|
34536
34536
|
state: c,
|
|
34537
34537
|
transaction: g
|
|
34538
34538
|
});
|
|
34539
|
-
if (!(!
|
|
34539
|
+
if (!(!P5({
|
|
34540
34540
|
editor: t,
|
|
34541
34541
|
state: b,
|
|
34542
34542
|
from: Math.max(d - 1, 0),
|
|
@@ -34594,7 +34594,7 @@ function Fk(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 = B5(M);
|
|
34598
34598
|
return o({
|
|
34599
34599
|
rule: c,
|
|
34600
34600
|
state: f,
|
|
@@ -34604,7 +34604,7 @@ function Fk(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 (!(!R5(k) || !D || k === D.b))
|
|
34608
34608
|
return o({
|
|
34609
34609
|
rule: c,
|
|
34610
34610
|
state: f,
|
|
@@ -34615,13 +34615,13 @@ function Fk(e) {
|
|
|
34615
34615
|
}
|
|
34616
34616
|
}));
|
|
34617
34617
|
}
|
|
34618
|
-
function
|
|
34618
|
+
function H5(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 = w5(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 = H5(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 = l5(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
|
+
O5({
|
|
34714
34714
|
editor: t,
|
|
34715
34715
|
rules: r
|
|
34716
34716
|
}),
|
|
34717
|
-
...
|
|
34717
|
+
...F5({
|
|
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 U5 = pt.create({
|
|
34845
34845
|
name: "clipboardTextSerializer",
|
|
34846
34846
|
addOptions() {
|
|
34847
34847
|
return {
|
|
@@ -34864,10 +34864,10 @@ const Uk = pt.create({
|
|
|
34864
34864
|
})
|
|
34865
34865
|
];
|
|
34866
34866
|
}
|
|
34867
|
-
}),
|
|
34867
|
+
}), z5 = () => ({ 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), V5 = (e = !1) => ({ commands: t }) => t.setContent("", e), $5 = () => ({ 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 Uk = pt.create({
|
|
|
34884
34884
|
(m || m === 0) && t.lift(f, m);
|
|
34885
34885
|
});
|
|
34886
34886
|
}), !0;
|
|
34887
|
-
},
|
|
34887
|
+
}, q5 = (e) => (t) => e(t), W5 = () => ({ state: e, dispatch: t }) => Bm(e, t), Y5 = (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 Ee(r.doc.resolve(Math.max(i - 1, 0)))), !0;
|
|
34892
|
+
}, j5 = () => ({ 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 Uk = pt.create({
|
|
|
34903
34903
|
return !0;
|
|
34904
34904
|
}
|
|
34905
34905
|
return !1;
|
|
34906
|
-
},
|
|
34906
|
+
}, G5 = (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 Uk = pt.create({
|
|
|
34914
34914
|
return !0;
|
|
34915
34915
|
}
|
|
34916
34916
|
return !1;
|
|
34917
|
-
},
|
|
34917
|
+
}, K5 = (e) => ({ tr: t, dispatch: n }) => {
|
|
34918
34918
|
const { from: r, to: l } = e;
|
|
34919
34919
|
return n && t.delete(r, l), !0;
|
|
34920
|
-
},
|
|
34920
|
+
}, Q5 = () => ({ state: e, dispatch: t }) => Au(e, t), X5 = () => ({ commands: e }) => e.keyboardShortcut("Enter"), J5 = () => ({ state: e, dispatch: t }) => c5(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 Z5 = (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 = Ee.create(i, d.from, d.to);
|
|
34966
34966
|
n.setSelection(h);
|
|
34967
34967
|
}
|
|
34968
34968
|
}
|
|
34969
34969
|
return !0;
|
|
34970
|
-
},
|
|
34970
|
+
}, ek = (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 Zk = (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 Ee;
|
|
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" ? Ee.create(e, or(0, l, a), or(e.content.size, l, a)) : Ee.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 tk() {
|
|
35008
35008
|
return typeof navigator < "u" ? /^((?!chrome|android).)*safari/i.test(navigator.userAgent) : !1;
|
|
35009
35009
|
}
|
|
35010
|
-
const
|
|
35010
|
+
const nk = (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(), tk() && !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 n5 = (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
|
+
}, rk = (e, t) => (n) => e.every((r, l) => t(r, { ...n, index: l })), lk = (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 ak(e, t, n) {
|
|
35088
35088
|
const r = e.steps.length - 1;
|
|
35089
35089
|
if (r < t)
|
|
35090
35090
|
return;
|
|
@@ -35097,7 +35097,7 @@ function a5(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 ik = (e) => !("type" in e), sk = (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 i5 = (e) => !("type" in e), s5 = (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 ((ik(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 i5 = (e) => !("type" in e), s5 = (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 && ak(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
|
+
}, ok = () => ({ state: e, dispatch: t }) => s5(e, t), uk = () => ({ state: e, dispatch: t }) => o5(e, t), ck = () => ({ state: e, dispatch: t }) => _m(e, t), dk = () => ({ state: e, dispatch: t }) => Dm(e, t), fk = () => ({ 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
|
+
}, hk = () => ({ 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
|
+
}, pk = () => ({ state: e, dispatch: t }) => a5(e, t), mk = () => ({ state: e, dispatch: t }) => i5(e, t);
|
|
35178
35178
|
function Km() {
|
|
35179
35179
|
return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
|
|
35180
35180
|
}
|
|
35181
|
-
function
|
|
35181
|
+
function bk(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 b5(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 gk = (e) => ({ editor: t, view: n, tr: r, dispatch: l }) => {
|
|
35204
|
+
const a = bk(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 vk = (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) ? u5(n, r) : !1;
|
|
35238
|
+
}, yk = () => ({ state: e, dispatch: t }) => Fm(e, t), Ek = (e) => ({ state: t, dispatch: n }) => {
|
|
35239
35239
|
const r = rt(e, t.schema);
|
|
35240
|
-
return
|
|
35241
|
-
},
|
|
35240
|
+
return T5(r)(t, n);
|
|
35241
|
+
}, Tk = () => ({ 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 Ck = (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 C5 = (e, t) => ({ tr: n, state: r, dispatch: l }) => {
|
|
|
35256
35256
|
});
|
|
35257
35257
|
});
|
|
35258
35258
|
}), !0) : !1;
|
|
35259
|
-
},
|
|
35259
|
+
}, xk = () => ({ tr: e, dispatch: t }) => (t && e.scrollIntoView(), !0), Sk = () => ({ 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
|
+
}, kk = () => ({ state: e, dispatch: t }) => Mm(e, t), Ak = () => ({ state: e, dispatch: t }) => Lm(e, t), Nk = () => ({ state: e, dispatch: t }) => h5(e, t), wk = () => ({ state: e, dispatch: t }) => b5(e, t), Ik = () => ({ state: e, dispatch: t }) => m5(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 _k = (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 Ok(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 O5(e) {
|
|
|
35300
35300
|
}
|
|
35301
35301
|
return null;
|
|
35302
35302
|
}
|
|
35303
|
-
function
|
|
35303
|
+
function Mk(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 M5(e, t) {
|
|
|
35313
35313
|
}
|
|
35314
35314
|
}
|
|
35315
35315
|
function Du(e) {
|
|
35316
|
-
return (t) =>
|
|
35316
|
+
return (t) => Mk(t.$from, e);
|
|
35317
35317
|
}
|
|
35318
|
-
function
|
|
35318
|
+
function Rk(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 Dk(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 D5(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 Lk(e, t) {
|
|
35334
35334
|
const n = Li(typeof t == "string" ? t : t.name, e.schema);
|
|
35335
|
-
return n === "node" ?
|
|
35335
|
+
return n === "node" ? Dk(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 Pk(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 Bk(e) {
|
|
35422
35422
|
return e instanceof ge;
|
|
35423
35423
|
}
|
|
35424
|
-
function
|
|
35424
|
+
function Fk(e, t, n) {
|
|
35425
35425
|
var r;
|
|
35426
35426
|
const { selection: l } = t;
|
|
35427
35427
|
let a = null;
|
|
@@ -35443,7 +35443,7 @@ function F5(e, t, n) {
|
|
|
35443
35443
|
}), u;
|
|
35444
35444
|
});
|
|
35445
35445
|
}
|
|
35446
|
-
const
|
|
35446
|
+
const Hk = (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 H5 = (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 Fk(r, n, o);
|
|
35469
|
+
}, Uk = (e, t) => ({ tr: n }) => (n.setMeta(e, t), !0), zk = (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
|
+
}, Vk = (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
|
+
}, $k = (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 = Ee.atStart(r).from, s = Ee.atEnd(r).to, o = or(l, i, s), u = or(a, i, s), c = Ee.create(r, o, u);
|
|
35482
35482
|
t.setSelection(c);
|
|
35483
35483
|
}
|
|
35484
35484
|
return !0;
|
|
35485
|
-
},
|
|
35485
|
+
}, qk = (e) => ({ state: t, dispatch: n }) => {
|
|
35486
35486
|
const r = rt(e, t.schema);
|
|
35487
|
-
return
|
|
35487
|
+
return S5(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 Wk = ({ 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 : Ok(s.node(-1).contentMatchAt(s.indexAfter(-1)));
|
|
35503
35503
|
let f = d && h ? [
|
|
35504
35504
|
{
|
|
35505
35505
|
type: h,
|
|
@@ -35512,14 +35512,14 @@ const W5 = ({ 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 Ee && 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
|
+
}, Yk = (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 W5 = ({ 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(Ee.near(n.doc.resolve(w))), n.scrollIntoView();
|
|
35552
35552
|
}
|
|
35553
35553
|
return !0;
|
|
35554
35554
|
}
|
|
@@ -35592,7 +35592,7 @@ const W5 = ({ 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
|
+
}, jk = (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 W5 = ({ 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
|
+
}, Gk = (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
|
+
}, Kk = (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
|
+
}, Qk = (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
|
+
}, Xk = () => ({ 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 W5 = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, edit
|
|
|
35637
35637
|
}
|
|
35638
35638
|
}
|
|
35639
35639
|
return !1;
|
|
35640
|
-
},
|
|
35640
|
+
}, Jk = () => ({ 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
|
+
}, Zk = (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 W5 = ({ 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 g5(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 v5(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: z5,
|
|
35700
|
+
clearContent: V5,
|
|
35701
|
+
clearNodes: $5,
|
|
35702
|
+
command: q5,
|
|
35703
|
+
createParagraphNear: W5,
|
|
35704
|
+
cut: Y5,
|
|
35705
|
+
deleteCurrentNode: j5,
|
|
35706
|
+
deleteNode: G5,
|
|
35707
|
+
deleteRange: K5,
|
|
35708
|
+
deleteSelection: Q5,
|
|
35709
|
+
enter: X5,
|
|
35710
|
+
exitCode: J5,
|
|
35711
|
+
extendMarkRange: Z5,
|
|
35712
|
+
first: ek,
|
|
35713
|
+
focus: nk,
|
|
35714
|
+
forEach: rk,
|
|
35715
|
+
insertContent: lk,
|
|
35716
|
+
insertContentAt: sk,
|
|
35717
|
+
joinBackward: ck,
|
|
35718
|
+
joinDown: uk,
|
|
35719
|
+
joinForward: dk,
|
|
35720
|
+
joinItemBackward: fk,
|
|
35721
|
+
joinItemForward: hk,
|
|
35722
|
+
joinTextblockBackward: pk,
|
|
35723
|
+
joinTextblockForward: mk,
|
|
35724
|
+
joinUp: ok,
|
|
35725
|
+
keyboardShortcut: gk,
|
|
35726
|
+
lift: vk,
|
|
35727
|
+
liftEmptyBlock: yk,
|
|
35728
|
+
liftListItem: Ek,
|
|
35729
|
+
newlineInCode: Tk,
|
|
35730
|
+
resetAttributes: Ck,
|
|
35731
|
+
scrollIntoView: xk,
|
|
35732
|
+
selectAll: Sk,
|
|
35733
|
+
selectNodeBackward: kk,
|
|
35734
|
+
selectNodeForward: Ak,
|
|
35735
|
+
selectParentNode: Nk,
|
|
35736
|
+
selectTextblockEnd: wk,
|
|
35737
|
+
selectTextblockStart: Ik,
|
|
35738
|
+
setContent: _k,
|
|
35739
|
+
setMark: Hk,
|
|
35740
|
+
setMeta: Uk,
|
|
35741
|
+
setNode: zk,
|
|
35742
|
+
setNodeSelection: Vk,
|
|
35743
|
+
setTextSelection: $k,
|
|
35744
|
+
sinkListItem: qk,
|
|
35745
|
+
splitBlock: Wk,
|
|
35746
|
+
splitListItem: Yk,
|
|
35747
|
+
toggleList: jk,
|
|
35748
|
+
toggleMark: Gk,
|
|
35749
|
+
toggleNode: Kk,
|
|
35750
|
+
toggleWrap: Qk,
|
|
35751
|
+
undoInputRule: Xk,
|
|
35752
|
+
unsetAllMarks: Jk,
|
|
35753
|
+
unsetMark: Zk,
|
|
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 k5 {
|
|
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 kk {
|
|
|
36267
36267
|
var t, n;
|
|
36268
36268
|
const l = [...this.options.enableCoreExtensions ? [
|
|
36269
36269
|
i8,
|
|
36270
|
-
|
|
36270
|
+
U5.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 kk {
|
|
|
36401
36401
|
* Get attributes of the currently selected node or mark.
|
|
36402
36402
|
*/
|
|
36403
36403
|
getAttributes(t) {
|
|
36404
|
-
return
|
|
36404
|
+
return Lk(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 Pk(this.state, r, l);
|
|
36409
36409
|
}
|
|
36410
36410
|
/**
|
|
36411
36411
|
* Get the document as JSON.
|
|
@@ -36426,7 +36426,7 @@ class p8 extends kk {
|
|
|
36426
36426
|
const { blockSeparator: n = `
|
|
36427
36427
|
|
|
36428
36428
|
`, textSerializers: r = {} } = t || {};
|
|
36429
|
-
return
|
|
36429
|
+
return Rk(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 D5({
|
|
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 = ye;
|
|
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 = ye, 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 ye.createElement(ye.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 ye.Component {
|
|
36802
36802
|
constructor(t) {
|
|
36803
36803
|
var n;
|
|
36804
|
-
super(t), this.editorContentRef =
|
|
36804
|
+
super(t), this.editorContentRef = ye.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 Ee.Component {
|
|
|
36839
36839
|
}
|
|
36840
36840
|
render() {
|
|
36841
36841
|
const { editor: t, innerRef: n, ...r } = this.props;
|
|
36842
|
-
return
|
|
36843
|
-
|
|
36842
|
+
return ye.createElement(
|
|
36843
|
+
ye.Fragment,
|
|
36844
36844
|
null,
|
|
36845
|
-
|
|
36846
|
-
t?.contentComponent &&
|
|
36845
|
+
ye.createElement("div", { ref: E8(n, this.editorContentRef), ...r }),
|
|
36846
|
+
t?.contentComponent && ye.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 = ye.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [e.editor]);
|
|
36852
|
+
return ye.createElement(x8, {
|
|
36853
36853
|
key: n,
|
|
36854
36854
|
innerRef: t,
|
|
36855
36855
|
...e
|
|
36856
36856
|
});
|
|
36857
|
-
}), k8 =
|
|
36857
|
+
}), k8 = ye.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 = ye, 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 = ye, 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
|
+
ye.forwardRef((e, t) => {
|
|
37211
37211
|
const { onDragStart: n } = F8(), r = e.as || "div";
|
|
37212
37212
|
return (
|
|
37213
37213
|
// @ts-ignore
|
|
37214
|
-
|
|
37214
|
+
ye.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(Ee.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 Ee) {
|
|
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(Ee.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
|
+
}) : Bk(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(Ee.create(i.doc, u.pos + 1)) : u.nodeAfter.isBlock ? i.setSelection(ge.create(i.doc, u.pos)) : i.setSelection(Ee.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(Ee.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 = ye.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 = ye.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 = ye.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 = ye.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 = ye.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 = ye.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 = ye.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 = ye.memo(({ onClick: e, loading: t, disabled: n }) => /* @__PURE__ */ v(
|
|
40233
40233
|
"button",
|
|
40234
40234
|
{
|
|
40235
40235
|
type: "button",
|
|
@@ -40241,7 +40241,7 @@ const pb = Ee.memo(({ onClick: e, loading: t, disabled: n }) => /* @__PURE__ */
|
|
|
40241
40241
|
}
|
|
40242
40242
|
));
|
|
40243
40243
|
pb.displayName = "SendButton";
|
|
40244
|
-
const mb =
|
|
40244
|
+
const mb = ye.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 = ye.memo(
|
|
40431
40431
|
({
|
|
40432
40432
|
isProcessing: e,
|
|
40433
40433
|
loading: t,
|
|
@@ -40464,9 +40464,9 @@ const $N = { points: ["tl", "tr"], offset: [4, 0] }, gb = Ee.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 xe of X) {
|
|
40468
|
+
if (ve + xe.size > 52428800) break;
|
|
40469
|
+
fe.push(xe), ve += xe.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 = ye.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 = ye.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: xe,
|
|
40758
40758
|
aiImageSelected: he,
|
|
40759
40759
|
onAIImageExit: we,
|
|
40760
|
-
loading:
|
|
40760
|
+
loading: De,
|
|
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: Se = 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, Te] = G(u ?? []), [Le, 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()) + Se, Wu(!0)), be(() => {
|
|
40801
40801
|
if (!ua) return;
|
|
40802
|
-
const H = setTimeout(() => Wu(!1),
|
|
40802
|
+
const H = setTimeout(() => Wu(!1), Se);
|
|
40803
40803
|
return () => clearTimeout(H);
|
|
40804
|
-
}, [ua, qe,
|
|
40804
|
+
}, [ua, qe, Se]);
|
|
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
|
+
Te(ae);
|
|
40820
40820
|
} else
|
|
40821
|
-
$i.current = !0,
|
|
40821
|
+
$i.current = !0, Te(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, Te((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"), xe?.();
|
|
40864
|
+
}, [Zn, P, xe, 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((ke) => ke.startsWith(`${ae}__module_`)).every((ke) => rc(me[ke])) && (ct((ke) => {
|
|
40885
|
+
if (!ke.markdownModules[ae]) return ke;
|
|
40886
|
+
const Pe = { ...ke.markdownModules };
|
|
40887
|
+
return delete Pe[ae], { ...ke, markdownModules: Pe };
|
|
40888
|
+
}), Object.keys(me).filter((ke) => ke.startsWith(`${ae}__module_`)).forEach((ke) => delete me[ke]), 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 Ce = { ...ne };
|
|
40922
|
+
return delete Ce[H], Ce;
|
|
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 [Ce, ke] of Object.entries(ne)) {
|
|
40926
|
+
if (Ce === H) continue;
|
|
40927
|
+
const Pe = Ce.match(/^(.+)_(\d+)$/);
|
|
40928
|
+
if (Pe && Pe[1] === ae) {
|
|
40929
|
+
const dt = parseInt(Pe[2], 10);
|
|
40930
|
+
dt > re ? me[`${ae}_${dt - 1}`] = ke : me[Ce] = ke;
|
|
40931
40931
|
} else
|
|
40932
|
-
me[
|
|
40932
|
+
me[Ce] = ke;
|
|
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 Ce = me.slice(ae.length);
|
|
40942
|
+
/^\d+$/.test(Ce) && se.push([Number(Ce), 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, Ce] of se) {
|
|
40948
40948
|
if (me === ne) continue;
|
|
40949
|
-
const
|
|
40950
|
-
re[`${H}_${
|
|
40949
|
+
const ke = me > ne ? me - 1 : me;
|
|
40950
|
+
re[`${H}_${ke}`] = Ce;
|
|
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((Ce, ke) => {
|
|
40986
|
+
me[`${H}__module_${ke}`] = Ce.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 Ce = { ...re };
|
|
40991
|
+
for (const ke of Object.keys(Ce))
|
|
40992
|
+
ke.startsWith(`${H}__module_`) && (delete Ce[ke], me = !0);
|
|
40993
|
+
return me ? Ce : 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 Ce = typeof re == "string" ? re.trim() : "";
|
|
41028
|
+
if (!Ce) return;
|
|
41029
|
+
const ke = `${ae}_${me}`;
|
|
41030
|
+
sl.current.get(ke) !== Ce && (sl.current.set(ke, Ce), setTimeout(() => {
|
|
41031
|
+
Gi(ke, Ce, "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((Ce) => setTimeout(Ce, 500 - me)), re && (ct((Ce) => ({
|
|
41047
|
+
...Ce,
|
|
41048
|
+
markdownModules: { ...Ce.markdownModules, [H]: re.modules }
|
|
41049
|
+
})), vn((Ce) => {
|
|
41050
|
+
const ke = { ...Ce };
|
|
41051
|
+
return re.modules.forEach((Pe, dt) => {
|
|
41052
|
+
ke[`${H}__module_${dt}`] = Pe.content;
|
|
41053
|
+
}), ke;
|
|
41054
41054
|
}));
|
|
41055
41055
|
} finally {
|
|
41056
41056
|
En((re) => {
|
|
@@ -41086,18 +41086,13 @@ const Ew = (e) => {
|
|
|
41086
41086
|
if (t.length === 0) {
|
|
41087
41087
|
const re = Jn.trim();
|
|
41088
41088
|
if (!re && !pe.length) return;
|
|
41089
|
-
|
|
41090
|
-
if (at) {
|
|
41091
|
-
const ye = at.title;
|
|
41092
|
-
me = ye.startsWith("【") ? ye : `【${ye}】`;
|
|
41093
|
-
}
|
|
41094
|
-
const xe = me ? `${me}${re}` : re;
|
|
41089
|
+
const me = at ? `${at.title} ${re}` : re;
|
|
41095
41090
|
if (pe.length) {
|
|
41096
|
-
const
|
|
41097
|
-
|
|
41091
|
+
const Ce = new FormData();
|
|
41092
|
+
me && Ce.append("prompt", me), pe.forEach((ke) => Ce.append("files", ke)), n(Ce, me, ne);
|
|
41098
41093
|
} else
|
|
41099
|
-
n(re,
|
|
41100
|
-
Yu(""),
|
|
41094
|
+
n(re, me, ne);
|
|
41095
|
+
Yu(""), Te([]);
|
|
41101
41096
|
return;
|
|
41102
41097
|
}
|
|
41103
41098
|
if (!Zu(jt, j, Ar)) return;
|
|
@@ -41110,7 +41105,7 @@ const Ew = (e) => {
|
|
|
41110
41105
|
excludedKeys: Ar,
|
|
41111
41106
|
hiddenSeparatorIndexes: Yi
|
|
41112
41107
|
});
|
|
41113
|
-
se && (n(oe, ae, ne),
|
|
41108
|
+
se && (n(oe, ae, ne), Te([]));
|
|
41114
41109
|
}, [
|
|
41115
41110
|
t.length,
|
|
41116
41111
|
Jn,
|
|
@@ -41234,7 +41229,7 @@ const Ew = (e) => {
|
|
|
41234
41229
|
overflow: qe || ua ? "hidden" : "auto",
|
|
41235
41230
|
// min-height 必须与 max-height 同步过渡:展开动画用 min-height 把空框顶到目标高(见 minHeight 注释),
|
|
41236
41231
|
// 不纳入 transition 则 min-height 0→122 会瞬间生效、首帧 snap,失去动画。
|
|
41237
|
-
transition: Ui ? "none" : `max-height ${
|
|
41232
|
+
transition: Ui ? "none" : `max-height ${Se}ms cubic-bezier(0.4, 0, 0.2, 1), min-height ${Se}ms cubic-bezier(0.4, 0, 0.2, 1)`,
|
|
41238
41233
|
willChange: "max-height, min-height"
|
|
41239
41234
|
}, uc = $(() => {
|
|
41240
41235
|
qe && bn && mn?.(!1), al.current?.focus();
|
|
@@ -41250,26 +41245,26 @@ const Ew = (e) => {
|
|
|
41250
41245
|
const ae = H.offsetHeight, se = H.scrollHeight, re = H.parentElement;
|
|
41251
41246
|
let me = 1 / 0;
|
|
41252
41247
|
if (re) {
|
|
41253
|
-
let
|
|
41248
|
+
let Pe = 0;
|
|
41254
41249
|
for (const pa of Array.from(re.children))
|
|
41255
|
-
pa !== H && (
|
|
41250
|
+
pa !== H && (Pe += pa.offsetHeight);
|
|
41256
41251
|
const dt = getComputedStyle(re), Ji = parseFloat(dt.paddingTop) + parseFloat(dt.paddingBottom);
|
|
41257
|
-
me = Math.max(0, re.clientHeight -
|
|
41252
|
+
me = Math.max(0, re.clientHeight - Pe - Ji);
|
|
41258
41253
|
}
|
|
41259
41254
|
H.style.maxHeight = oe;
|
|
41260
|
-
const
|
|
41261
|
-
|
|
41255
|
+
const Ce = Math.max(Math.ceil(se || 0), Math.ceil(ae || 0)), ke = Math.min(Ce, Math.ceil(me));
|
|
41256
|
+
ke > 0 && zu((Pe) => Pe === ke ? Pe : ke);
|
|
41262
41257
|
}
|
|
41263
41258
|
try {
|
|
41264
41259
|
const oe = H.getBoundingClientRect(), ae = H.querySelector(".rte-config-fade") ?? H, se = document.createRange();
|
|
41265
41260
|
se.selectNodeContents(ae);
|
|
41266
41261
|
const re = Array.from(se.getClientRects()).filter((me) => me.height > 0);
|
|
41267
41262
|
if (re.length > 0) {
|
|
41268
|
-
const me = Math.min(...re.map((tr) => tr.top)),
|
|
41263
|
+
const me = Math.min(...re.map((tr) => tr.top)), Ce = parseFloat(getComputedStyle(H).lineHeight) || 34, ke = Math.max(Ce, 1), Pe = me + ke * 0.5;
|
|
41269
41264
|
let dt = 0;
|
|
41270
41265
|
for (const tr of re)
|
|
41271
|
-
tr.top <
|
|
41272
|
-
const Ji = dt > 0 ? Math.ceil(dt - oe.top) : 0, pa = getComputedStyle(H), Qb = parseFloat(pa.paddingTop) || 0, Xb = Math.ceil(Qb +
|
|
41266
|
+
tr.top < Pe && (dt = Math.max(dt, tr.bottom));
|
|
41267
|
+
const Ji = dt > 0 ? Math.ceil(dt - oe.top) : 0, pa = getComputedStyle(H), Qb = parseFloat(pa.paddingTop) || 0, Xb = Math.ceil(Qb + ke), Zi = Math.max(Ji, Xb);
|
|
41273
41268
|
Zi > 0 && Nb((tr) => tr === Zi ? tr : Zi);
|
|
41274
41269
|
}
|
|
41275
41270
|
} catch {
|
|
@@ -41281,9 +41276,9 @@ const Ew = (e) => {
|
|
|
41281
41276
|
), dc = te(Nr);
|
|
41282
41277
|
dc.current !== Nr && (dc.current = Nr, qe || (zu(uh), Vu(!0))), be(() => {
|
|
41283
41278
|
if (!Ui) return;
|
|
41284
|
-
const H = setTimeout(() => Vu(!1),
|
|
41279
|
+
const H = setTimeout(() => Vu(!1), Se);
|
|
41285
41280
|
return () => clearTimeout(H);
|
|
41286
|
-
}, [Ui, Nr,
|
|
41281
|
+
}, [Ui, Nr, Se]), Ue(() => {
|
|
41287
41282
|
const H = Qn.current;
|
|
41288
41283
|
if (!H || (ha(), typeof ResizeObserver > "u")) return;
|
|
41289
41284
|
const ne = () => {
|
|
@@ -41369,24 +41364,24 @@ const Ew = (e) => {
|
|
|
41369
41364
|
), Kb = $(
|
|
41370
41365
|
(H) => {
|
|
41371
41366
|
const ne = H.clipboardData?.files;
|
|
41372
|
-
if (!ne || ne.length === 0 || (H.preventDefault(), t.some((
|
|
41367
|
+
if (!ne || ne.length === 0 || (H.preventDefault(), t.some((Pe) => Pe.type === "tag"))) return;
|
|
41373
41368
|
const ae = [];
|
|
41374
41369
|
let se = !1;
|
|
41375
|
-
for (const
|
|
41376
|
-
const dt = (
|
|
41377
|
-
hc.has(dt) ? ae.push(
|
|
41370
|
+
for (const Pe of Array.from(ne)) {
|
|
41371
|
+
const dt = (Pe.name || "").split(".").pop()?.toLowerCase() || "";
|
|
41372
|
+
hc.has(dt) ? ae.push(Pe) : se = !0;
|
|
41378
41373
|
}
|
|
41379
41374
|
if (se && Hi.current?.error("粘贴文件中含不支持的类型,已自动过滤"), ae.length === 0) return;
|
|
41380
|
-
const re = 50 * 1024 * 1024, me = pe.reduce((
|
|
41381
|
-
let
|
|
41382
|
-
for (const
|
|
41383
|
-
if (
|
|
41375
|
+
const re = 50 * 1024 * 1024, me = pe.reduce((Pe, dt) => Pe + dt.size, 0), Ce = [];
|
|
41376
|
+
let ke = me;
|
|
41377
|
+
for (const Pe of ae) {
|
|
41378
|
+
if (ke + Pe.size > re) {
|
|
41384
41379
|
Hi.current?.error("文件总大小不能超过 50MB");
|
|
41385
41380
|
break;
|
|
41386
41381
|
}
|
|
41387
|
-
|
|
41382
|
+
Ce.push(Pe), ke += Pe.size;
|
|
41388
41383
|
}
|
|
41389
|
-
|
|
41384
|
+
Ce.length > 0 && Te((Pe) => [...Ce, ...Pe]);
|
|
41390
41385
|
},
|
|
41391
41386
|
[hc, t, pe]
|
|
41392
41387
|
);
|
|
@@ -41402,7 +41397,7 @@ const Ew = (e) => {
|
|
|
41402
41397
|
style: jb,
|
|
41403
41398
|
onPaste: Kb,
|
|
41404
41399
|
children: [
|
|
41405
|
-
/* @__PURE__ */ v(vb, { files: pe, onChange:
|
|
41400
|
+
/* @__PURE__ */ v(vb, { files: pe, onChange: Te }),
|
|
41406
41401
|
t.length === 0 ? /* @__PURE__ */ W(
|
|
41407
41402
|
"div",
|
|
41408
41403
|
{
|
|
@@ -41452,7 +41447,7 @@ const Ew = (e) => {
|
|
|
41452
41447
|
files: j,
|
|
41453
41448
|
onChange: ji,
|
|
41454
41449
|
onFileChange: Lb,
|
|
41455
|
-
thumbnails:
|
|
41450
|
+
thumbnails: Le,
|
|
41456
41451
|
onThumbnailChange: Pb,
|
|
41457
41452
|
videoUrlParse: A,
|
|
41458
41453
|
videoUpload: k,
|
|
@@ -41486,12 +41481,12 @@ const Ew = (e) => {
|
|
|
41486
41481
|
gb,
|
|
41487
41482
|
{
|
|
41488
41483
|
isProcessing: r,
|
|
41489
|
-
loading:
|
|
41484
|
+
loading: De,
|
|
41490
41485
|
disabled: l,
|
|
41491
41486
|
sendDisabled: !qb,
|
|
41492
41487
|
showFooterUpload: Vt,
|
|
41493
41488
|
footerFiles: pe,
|
|
41494
|
-
onFooterFilesChange:
|
|
41489
|
+
onFooterFilesChange: Te,
|
|
41495
41490
|
agentOptions: F,
|
|
41496
41491
|
onAgentSelect: Ib,
|
|
41497
41492
|
hideAgentButton: _e === "hideAgent",
|
|
@@ -42037,18 +42032,18 @@ const ew = ({
|
|
|
42037
42032
|
F.current = e, V.current = b, P.current = D, E.current = m;
|
|
42038
42033
|
});
|
|
42039
42034
|
const U = $((he, we) => {
|
|
42040
|
-
let
|
|
42035
|
+
let De = 0;
|
|
42041
42036
|
w(!0);
|
|
42042
42037
|
const _e = () => {
|
|
42043
|
-
|
|
42038
|
+
De < he.length ? (g(he.slice(0, De + 1)), De++, _.current = window.setTimeout(_e, n)) : (w(!1), we?.());
|
|
42044
42039
|
};
|
|
42045
42040
|
_e();
|
|
42046
42041
|
}, [n]), q = $((he) => {
|
|
42047
42042
|
let we = E.current.length;
|
|
42048
|
-
const
|
|
42049
|
-
we > 0 ? (g(E.current.slice(0, we - 1)), we--, _.current = window.setTimeout(
|
|
42043
|
+
const De = () => {
|
|
42044
|
+
we > 0 ? (g(E.current.slice(0, we - 1)), we--, _.current = window.setTimeout(De, n / 2)) : he?.();
|
|
42050
42045
|
};
|
|
42051
|
-
|
|
42046
|
+
De();
|
|
42052
42047
|
}, [n]), Z = $(() => {
|
|
42053
42048
|
if (F.current.length === 0 || P.current) return;
|
|
42054
42049
|
k(!0);
|
|
@@ -42082,7 +42077,7 @@ const ew = ({
|
|
|
42082
42077
|
he.trim() && !c && (i?.(he), a || S(""));
|
|
42083
42078
|
}, fe = (he) => {
|
|
42084
42079
|
(he.ctrlKey || he.metaKey) && he.key === "Enter" && (he.preventDefault(), R()), f.onKeyDown?.(he);
|
|
42085
|
-
}, ve = a ? l : N,
|
|
42080
|
+
}, ve = a ? l : N, xe = c || !ve.trim() || (s ? ve.length > s : !1);
|
|
42086
42081
|
return /* @__PURE__ */ W("div", { style: { position: "relative", ...h }, children: [
|
|
42087
42082
|
/* @__PURE__ */ W("div", { style: { position: "relative" }, children: [
|
|
42088
42083
|
/* @__PURE__ */ v(
|
|
@@ -42177,7 +42172,7 @@ const ew = ({
|
|
|
42177
42172
|
size: "small",
|
|
42178
42173
|
icon: /* @__PURE__ */ v(m1, {}),
|
|
42179
42174
|
onClick: R,
|
|
42180
|
-
disabled:
|
|
42175
|
+
disabled: xe,
|
|
42181
42176
|
style: {
|
|
42182
42177
|
borderRadius: 6,
|
|
42183
42178
|
minWidth: 32,
|