bi-components-library 1.0.12 → 1.0.13
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 +95 -94
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -53,7 +53,7 @@ function mt() {
|
|
|
53
53
|
return s.$$typeof === U ? null : s.displayName || s.name || null;
|
|
54
54
|
if (typeof s == "string") return s;
|
|
55
55
|
switch (s) {
|
|
56
|
-
case
|
|
56
|
+
case S:
|
|
57
57
|
return "Fragment";
|
|
58
58
|
case w:
|
|
59
59
|
return "Profiler";
|
|
@@ -111,7 +111,7 @@ function mt() {
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
function a(s) {
|
|
114
|
-
if (s ===
|
|
114
|
+
if (s === S) return "<>";
|
|
115
115
|
if (typeof s == "object" && s !== null && s.$$typeof === D)
|
|
116
116
|
return "<...>";
|
|
117
117
|
try {
|
|
@@ -238,7 +238,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
238
238
|
function u(s) {
|
|
239
239
|
typeof s == "object" && s !== null && s.$$typeof === d && s._store && (s._store.validated = 1);
|
|
240
240
|
}
|
|
241
|
-
var q = Ue, d = Symbol.for("react.transitional.element"), o = Symbol.for("react.portal"),
|
|
241
|
+
var q = Ue, d = Symbol.for("react.transitional.element"), o = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), k = Symbol.for("react.consumer"), $ = Symbol.for("react.context"), b = Symbol.for("react.forward_ref"), V = Symbol.for("react.suspense"), _ = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), B = Symbol.for("react.activity"), U = Symbol.for("react.client.reference"), H = q.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, X = Object.prototype.hasOwnProperty, Z = Array.isArray, T = console.createTask ? console.createTask : function() {
|
|
242
242
|
return null;
|
|
243
243
|
};
|
|
244
244
|
q = {
|
|
@@ -250,7 +250,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
250
250
|
q,
|
|
251
251
|
m
|
|
252
252
|
)(), pe = T(a(m)), he = {};
|
|
253
|
-
ke.Fragment =
|
|
253
|
+
ke.Fragment = S, ke.jsx = function(s, L, K, ae, ye) {
|
|
254
254
|
var ce = 1e4 > H.recentlyCreatedOwnerStacks++;
|
|
255
255
|
return x(
|
|
256
256
|
s,
|
|
@@ -836,7 +836,7 @@ const { Option: Nt } = Ve, Ct = ({
|
|
|
836
836
|
externalParams: i = {},
|
|
837
837
|
...e
|
|
838
838
|
}) => {
|
|
839
|
-
const [x, u] = J([]), [q, d] = J(!1), [o,
|
|
839
|
+
const [x, u] = J([]), [q, d] = J(!1), [o, S] = J({
|
|
840
840
|
current: 1,
|
|
841
841
|
pageSize: m,
|
|
842
842
|
total: 0
|
|
@@ -863,7 +863,7 @@ const { Option: Nt } = Ve, Ct = ({
|
|
|
863
863
|
searchParams: { ...c, ..._.current },
|
|
864
864
|
...T
|
|
865
865
|
}, Q = await p(I);
|
|
866
|
-
Q.success && (u(Q.data),
|
|
866
|
+
Q.success && (u(Q.data), S((ee) => ({
|
|
867
867
|
...ee,
|
|
868
868
|
total: Q.total,
|
|
869
869
|
current: I.page || ee.current
|
|
@@ -875,9 +875,9 @@ const { Option: Nt } = Ve, Ct = ({
|
|
|
875
875
|
}
|
|
876
876
|
}
|
|
877
877
|
}, [p, k, c]), U = W((T) => {
|
|
878
|
-
w(T),
|
|
878
|
+
w(T), S((I) => ({ ...I, current: 1 }));
|
|
879
879
|
}, []), H = W(() => {
|
|
880
|
-
b.resetFields(), w({}),
|
|
880
|
+
b.resetFields(), w({}), S((T) => ({ ...T, current: 1 }));
|
|
881
881
|
}, [b]), X = W(() => {
|
|
882
882
|
B();
|
|
883
883
|
}, [B]), Z = W((T, I, Q) => {
|
|
@@ -889,7 +889,7 @@ const { Option: Nt } = Ve, Ct = ({
|
|
|
889
889
|
field: Q?.field,
|
|
890
890
|
order: Q?.order
|
|
891
891
|
};
|
|
892
|
-
|
|
892
|
+
S(ee), $(pe);
|
|
893
893
|
}, [m]);
|
|
894
894
|
return oe(() => {
|
|
895
895
|
const T = Object.keys(i).length > 0;
|
|
@@ -1238,19 +1238,19 @@ function St(t, p, l, a, r, m = {}, A) {
|
|
|
1238
1238
|
}
|
|
1239
1239
|
}
|
|
1240
1240
|
const q = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "", d = e.exclusionGroup ? `<span ${q} class="exclusion-wrapper">` : "", o = e.exclusionGroup ? "</span>" : "";
|
|
1241
|
-
let
|
|
1241
|
+
let S = "";
|
|
1242
1242
|
if (e.type === "tag") {
|
|
1243
1243
|
const w = a || A === "hideTagClose" ? "" : '<span class="tag-close-btn" title="Clear (ESC)"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg></span>', k = a ? ' data-locked="true"' : "", $ = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-tag-key="${e.key || ""}"` : "";
|
|
1244
|
-
|
|
1244
|
+
S = `<span contenteditable="false" class="tag-node group"${k}${$}><span class="tag-label">${e.text}</span>${w}</span>`;
|
|
1245
1245
|
} else if (e.type === "text") {
|
|
1246
1246
|
const c = a ? ' data-locked="true" contenteditable="false"' : ' contenteditable="false"';
|
|
1247
|
-
e.className ?
|
|
1247
|
+
e.className ? S = `<span class="${e.className}"${c}>${e.text ?? ""}</span>` : S = a ? `<span${c}>${e.text ?? ""}</span>` : `<span contenteditable="false">${e.text ?? ""}</span>`;
|
|
1248
1248
|
} else if (e.type === "variable" && e.key) {
|
|
1249
1249
|
const w = r[e.key] || e.text || "", k = !w, $ = k ? "" : w, b = k ? "show-placeholder" : "", V = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", _ = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-variable-key="${e.key || ""}"` : "", P = e.tooltip && k ? "" : "hidden", D = `<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder || ""}"${V}${_} class="variable-chip ${b}">${$}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${P}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, """)}" title="提示"></i>` : ""}</span>`;
|
|
1250
|
-
e.required ?
|
|
1250
|
+
e.required ? S = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${D}</span>` : S = D;
|
|
1251
1251
|
} else if (e.type === "upload" && e.key) {
|
|
1252
1252
|
const c = l[e.key] !== null && l[e.key] !== void 0, w = c ? l[e.key]?.name : e.text, k = c ? "" : "hidden", $ = e.tooltip && !c ? "" : "hidden", b = c ? "has-file" : "", V = c && w ? ` data-file-name="${w.replace(/"/g, """)}"` : "", _ = `<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${b}"><span class="upload-icon">${c ? "<i class='iconfont icon-exlwenjian'></i>" : "<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${V}>${w || e.text}</span>${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${$}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${k}" title="移除文件">×</span></span></span>`;
|
|
1253
|
-
e.required ?
|
|
1253
|
+
e.required ? S = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${_}</span>` : S = _;
|
|
1254
1254
|
} else if (e.type === "multi-variable" && e.key) {
|
|
1255
1255
|
const c = e.maxCount || 9, w = m[e.key] || 1, k = Math.min(w, c);
|
|
1256
1256
|
let $ = "";
|
|
@@ -1258,9 +1258,9 @@ function St(t, p, l, a, r, m = {}, A) {
|
|
|
1258
1258
|
const V = `${e.key}_${b}`, _ = r[V] || "", P = !_, D = P ? "" : _, B = P ? "show-placeholder" : "", U = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-variable-key="${e.key || ""}"` : "", H = e.tooltip && P ? "" : "hidden", X = `<span contenteditable="true" data-type="variable" data-key="${V}" data-multi-key="${e.key}" data-index="${b}" data-placeholder="${e.placeholder || ""}"${U} class="variable-chip ${B}">${D}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${H}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, """)}" title="提示"></i>` : ""}</span>`;
|
|
1259
1259
|
$ += X;
|
|
1260
1260
|
}
|
|
1261
|
-
e.required ?
|
|
1261
|
+
e.required ? S = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${$}</span>` : S = $;
|
|
1262
1262
|
}
|
|
1263
|
-
g += d +
|
|
1263
|
+
g += d + S + o, i++;
|
|
1264
1264
|
}
|
|
1265
1265
|
t.current && (t.current.innerHTML = g, setTimeout(() => {
|
|
1266
1266
|
if (!t.current) return;
|
|
@@ -1289,8 +1289,8 @@ function qt(t, p, l, a, r = {}, m, A, g) {
|
|
|
1289
1289
|
).forEach((d) => {
|
|
1290
1290
|
const o = d.dataset.key;
|
|
1291
1291
|
if (o) {
|
|
1292
|
-
const
|
|
1293
|
-
|
|
1292
|
+
const S = d.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1293
|
+
S && (e[o] = S);
|
|
1294
1294
|
}
|
|
1295
1295
|
}), St(t, p, l, a, e, r, g), m?.current) {
|
|
1296
1296
|
const { key: q, offset: d } = m.current;
|
|
@@ -1301,7 +1301,7 @@ function qt(t, p, l, a, r = {}, m, A, g) {
|
|
|
1301
1301
|
);
|
|
1302
1302
|
if (o) {
|
|
1303
1303
|
try {
|
|
1304
|
-
const
|
|
1304
|
+
const S = document.createRange(), c = document.createTreeWalker(
|
|
1305
1305
|
o,
|
|
1306
1306
|
NodeFilter.SHOW_TEXT,
|
|
1307
1307
|
null
|
|
@@ -1316,19 +1316,19 @@ function qt(t, p, l, a, r = {}, m, A, g) {
|
|
|
1316
1316
|
w += V;
|
|
1317
1317
|
}
|
|
1318
1318
|
if (k) {
|
|
1319
|
-
|
|
1319
|
+
S.setStart(k, Math.min($, k.textContent?.length || 0)), S.collapse(!0);
|
|
1320
1320
|
const b = window.getSelection();
|
|
1321
|
-
b && (b.removeAllRanges(), b.addRange(
|
|
1321
|
+
b && (b.removeAllRanges(), b.addRange(S), o.focus());
|
|
1322
1322
|
} else {
|
|
1323
|
-
|
|
1323
|
+
S.selectNodeContents(o), S.collapse(!1);
|
|
1324
1324
|
const b = window.getSelection();
|
|
1325
|
-
b && (b.removeAllRanges(), b.addRange(
|
|
1325
|
+
b && (b.removeAllRanges(), b.addRange(S), o.focus());
|
|
1326
1326
|
}
|
|
1327
1327
|
} catch {
|
|
1328
|
-
const
|
|
1329
|
-
|
|
1328
|
+
const S = document.createRange();
|
|
1329
|
+
S.selectNodeContents(o), S.collapse(!1);
|
|
1330
1330
|
const c = window.getSelection();
|
|
1331
|
-
c && (c.removeAllRanges(), c.addRange(
|
|
1331
|
+
c && (c.removeAllRanges(), c.addRange(S), o.focus());
|
|
1332
1332
|
}
|
|
1333
1333
|
m.current = null;
|
|
1334
1334
|
}
|
|
@@ -1468,14 +1468,14 @@ function It(t, p) {
|
|
|
1468
1468
|
t.current.contains(o.commonAncestorContainer) || d.removeAllRanges();
|
|
1469
1469
|
return;
|
|
1470
1470
|
}
|
|
1471
|
-
const
|
|
1472
|
-
if (!
|
|
1473
|
-
if (!t.current.contains(
|
|
1471
|
+
const S = d.anchorNode;
|
|
1472
|
+
if (!S) return;
|
|
1473
|
+
if (!t.current.contains(S)) {
|
|
1474
1474
|
d.removeAllRanges();
|
|
1475
1475
|
return;
|
|
1476
1476
|
}
|
|
1477
1477
|
let c = null;
|
|
1478
|
-
if (
|
|
1478
|
+
if (S.nodeType === Node.ELEMENT_NODE ? c = S.closest('[data-type="variable"]') : S.nodeType === Node.TEXT_NODE && S.parentElement && (c = S.parentElement.closest('[data-type="variable"]')), !c) {
|
|
1479
1479
|
if (Date.now() - a > 500)
|
|
1480
1480
|
return;
|
|
1481
1481
|
const w = t.current.querySelectorAll('[data-type="variable"]');
|
|
@@ -1517,7 +1517,7 @@ const Vt = ({
|
|
|
1517
1517
|
background: q = "transparent",
|
|
1518
1518
|
hideButtons: d
|
|
1519
1519
|
}) => {
|
|
1520
|
-
const o = z(null),
|
|
1520
|
+
const o = z(null), S = z(null), [c, w] = J({}), [k, $] = J(null), [b, V] = J(null), _ = z(!1), P = z(null), [D, B] = J(!1), U = z(null), [H, X] = J(!0), [Z, T] = J(() => {
|
|
1521
1521
|
const f = {};
|
|
1522
1522
|
return t.forEach((y) => {
|
|
1523
1523
|
y.type === "multi-variable" && y.key && (f[y.key] = 1);
|
|
@@ -1551,8 +1551,8 @@ const Vt = ({
|
|
|
1551
1551
|
} else if (y) {
|
|
1552
1552
|
s.current = null;
|
|
1553
1553
|
const h = {};
|
|
1554
|
-
t.forEach((
|
|
1555
|
-
|
|
1554
|
+
t.forEach((C) => {
|
|
1555
|
+
C.type === "multi-variable" && C.key && (h[C.key] = 1);
|
|
1556
1556
|
}), T(h), w({});
|
|
1557
1557
|
} else
|
|
1558
1558
|
s.current = null, T({}), w({});
|
|
@@ -1571,9 +1571,9 @@ const Vt = ({
|
|
|
1571
1571
|
X(!0);
|
|
1572
1572
|
return;
|
|
1573
1573
|
}
|
|
1574
|
-
const h = o.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "",
|
|
1574
|
+
const h = o.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "", C = o.current.querySelectorAll('[data-type="variable"]'), v = o.current.querySelectorAll('[data-type="upload"]');
|
|
1575
1575
|
let E = !1;
|
|
1576
|
-
|
|
1576
|
+
C.forEach((R) => {
|
|
1577
1577
|
(R.textContent?.replace(/[\u200B\n]/g, "").trim() || "") && (E = !0);
|
|
1578
1578
|
}), v.forEach((R) => {
|
|
1579
1579
|
R.querySelector(".upload-inner-wrapper.has-file") && (E = !0);
|
|
@@ -1599,10 +1599,10 @@ const Vt = ({
|
|
|
1599
1599
|
f.preventDefault();
|
|
1600
1600
|
const y = f.clipboardData.getData("text/plain"), h = window.getSelection();
|
|
1601
1601
|
if (h && h.rangeCount > 0) {
|
|
1602
|
-
const
|
|
1603
|
-
if (
|
|
1602
|
+
const C = h.anchorNode;
|
|
1603
|
+
if (C) {
|
|
1604
1604
|
let v = null;
|
|
1605
|
-
if (
|
|
1605
|
+
if (C.nodeType === Node.ELEMENT_NODE ? v = C.closest('[data-type="variable"]') : C.nodeType === Node.TEXT_NODE && C.parentElement && (v = C.parentElement.closest('[data-type="variable"]')), v) {
|
|
1606
1606
|
const E = v.dataset.multiKey;
|
|
1607
1607
|
if (E) {
|
|
1608
1608
|
const N = /[、,,\s\n\r\t]+/, R = y.split(N).map((j) => j.trim()).filter((j) => j.length > 0);
|
|
@@ -1647,9 +1647,9 @@ const Vt = ({
|
|
|
1647
1647
|
}
|
|
1648
1648
|
}
|
|
1649
1649
|
document.execCommand("insertText", !1, y), ue(), setTimeout(() => {
|
|
1650
|
-
const
|
|
1651
|
-
if (
|
|
1652
|
-
const v =
|
|
1650
|
+
const C = window.getSelection();
|
|
1651
|
+
if (C && C.rangeCount > 0) {
|
|
1652
|
+
const v = C.anchorNode;
|
|
1653
1653
|
if (v) {
|
|
1654
1654
|
let E = null;
|
|
1655
1655
|
if (v.nodeType === Node.ELEMENT_NODE ? E = v.closest('[data-type="variable"][data-multi-key]') : v.nodeType === Node.TEXT_NODE && v.parentElement && (E = v.parentElement.closest('[data-type="variable"][data-multi-key]')), E) {
|
|
@@ -1662,7 +1662,7 @@ const Vt = ({
|
|
|
1662
1662
|
}, K = (f) => {
|
|
1663
1663
|
if (f.target.files && f.target.files[0] && k) {
|
|
1664
1664
|
const y = f.target.files[0], h = k;
|
|
1665
|
-
w((
|
|
1665
|
+
w((C) => ({ ...C, [h]: y }));
|
|
1666
1666
|
}
|
|
1667
1667
|
f.target && (f.target.value = ""), $(null);
|
|
1668
1668
|
}, ae = (f) => {
|
|
@@ -1690,8 +1690,8 @@ const Vt = ({
|
|
|
1690
1690
|
y.closest('[data-type="variable"]') || (P.current = { x: f.clientX, y: f.clientY }, _.current = !1, y.closest(".file-remove-btn") && (f.preventDefault(), f.stopPropagation()));
|
|
1691
1691
|
}, ce = (f) => {
|
|
1692
1692
|
if (!f.target.closest('[data-type="variable"]') && P.current) {
|
|
1693
|
-
const
|
|
1694
|
-
(
|
|
1693
|
+
const C = Math.abs(f.clientX - P.current.x), v = Math.abs(f.clientY - P.current.y);
|
|
1694
|
+
(C > 3 || v > 3) && (_.current = !0);
|
|
1695
1695
|
}
|
|
1696
1696
|
}, be = (f) => {
|
|
1697
1697
|
if (f.target.closest('[data-type="variable"]')) {
|
|
@@ -1740,14 +1740,14 @@ const Vt = ({
|
|
|
1740
1740
|
const N = y.closest('[data-type="upload"]');
|
|
1741
1741
|
if (N) {
|
|
1742
1742
|
const R = N.dataset.key;
|
|
1743
|
-
R && ($(R),
|
|
1743
|
+
R && ($(R), S.current?.click());
|
|
1744
1744
|
return;
|
|
1745
1745
|
}
|
|
1746
1746
|
}, G = (f) => {
|
|
1747
1747
|
const h = f.target.closest('[data-type="variable"]');
|
|
1748
1748
|
if (h) {
|
|
1749
|
-
const
|
|
1750
|
-
if (
|
|
1749
|
+
const C = window.getSelection();
|
|
1750
|
+
if (C) {
|
|
1751
1751
|
const v = document.createRange(), E = h.textContent || "";
|
|
1752
1752
|
if (E.replace(/\u200B/g, "")) {
|
|
1753
1753
|
let R = 0, j = E.length;
|
|
@@ -1756,7 +1756,7 @@ const Vt = ({
|
|
|
1756
1756
|
M && M.nodeType === Node.TEXT_NODE ? (v.setStart(M, R), v.setEnd(M, j)) : v.selectNodeContents(h);
|
|
1757
1757
|
} else
|
|
1758
1758
|
v.selectNodeContents(h), v.collapse(!0);
|
|
1759
|
-
|
|
1759
|
+
C.removeAllRanges(), C.addRange(v);
|
|
1760
1760
|
}
|
|
1761
1761
|
}
|
|
1762
1762
|
}, ue = () => {
|
|
@@ -1768,14 +1768,14 @@ const Vt = ({
|
|
|
1768
1768
|
return;
|
|
1769
1769
|
}
|
|
1770
1770
|
if ($e(o), o.current && o.current.querySelectorAll('[data-type="variable"]').forEach((h) => {
|
|
1771
|
-
const
|
|
1772
|
-
if (
|
|
1771
|
+
const C = h.querySelector(".variable-info-icon");
|
|
1772
|
+
if (C) {
|
|
1773
1773
|
let v = !1;
|
|
1774
1774
|
const E = document.createTreeWalker(
|
|
1775
1775
|
h,
|
|
1776
1776
|
NodeFilter.SHOW_TEXT,
|
|
1777
1777
|
{
|
|
1778
|
-
acceptNode: (N) =>
|
|
1778
|
+
acceptNode: (N) => C.contains(N) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
|
|
1779
1779
|
}
|
|
1780
1780
|
);
|
|
1781
1781
|
for (; E.nextNode(); )
|
|
@@ -1783,13 +1783,13 @@ const Vt = ({
|
|
|
1783
1783
|
v = !0;
|
|
1784
1784
|
break;
|
|
1785
1785
|
}
|
|
1786
|
-
v ?
|
|
1786
|
+
v ? C.classList.add("hidden") : C.classList.remove("hidden");
|
|
1787
1787
|
}
|
|
1788
1788
|
}), _e(o, t, c), je(o, t, c, B), !o.current) return;
|
|
1789
1789
|
t.filter((y) => y.type === "multi-variable" && y.key).forEach((y) => {
|
|
1790
1790
|
if (!y.key) return;
|
|
1791
|
-
const h = y.maxCount || 9,
|
|
1792
|
-
for (let M = 0; M <
|
|
1791
|
+
const h = y.maxCount || 9, C = Z[y.key] || 1, v = [];
|
|
1792
|
+
for (let M = 0; M < C; M++) {
|
|
1793
1793
|
const ne = `${y.key}_${M}`, re = o.current.querySelector(
|
|
1794
1794
|
`[data-type="variable"][data-key="${ne}"][data-multi-key="${y.key}"]`
|
|
1795
1795
|
);
|
|
@@ -1843,10 +1843,10 @@ const Vt = ({
|
|
|
1843
1843
|
return;
|
|
1844
1844
|
}
|
|
1845
1845
|
if (!N) {
|
|
1846
|
-
const M =
|
|
1846
|
+
const M = C - 1, ne = `${y.key}_${M}`, re = o.current.querySelector(
|
|
1847
1847
|
`[data-type="variable"][data-key="${ne}"][data-multi-key="${y.key}"]`
|
|
1848
1848
|
);
|
|
1849
|
-
if (re && re.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 &&
|
|
1849
|
+
if (re && re.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && C < h) {
|
|
1850
1850
|
const le = window.getSelection();
|
|
1851
1851
|
if (le && le.rangeCount > 0) {
|
|
1852
1852
|
const F = le.getRangeAt(0), te = F.startContainer, de = te.nodeType === Node.ELEMENT_NODE ? te.closest('[data-type="variable"][data-multi-key]') : te.parentElement?.closest('[data-type="variable"][data-multi-key]');
|
|
@@ -1862,7 +1862,7 @@ const Vt = ({
|
|
|
1862
1862
|
}
|
|
1863
1863
|
T((F) => ({
|
|
1864
1864
|
...F,
|
|
1865
|
-
[y.key]:
|
|
1865
|
+
[y.key]: C + 1
|
|
1866
1866
|
}));
|
|
1867
1867
|
}
|
|
1868
1868
|
}
|
|
@@ -1872,21 +1872,22 @@ const Vt = ({
|
|
|
1872
1872
|
const f = o.current;
|
|
1873
1873
|
if (!f) return;
|
|
1874
1874
|
const y = (h) => {
|
|
1875
|
-
const
|
|
1876
|
-
if (!
|
|
1875
|
+
const C = h.target;
|
|
1876
|
+
if (!C || !o.current || !o.current.contains(C))
|
|
1877
|
+
return;
|
|
1877
1878
|
const v = h.relatedTarget, E = !v || !o.current.contains(v);
|
|
1878
1879
|
if (console.log("[Blur Event] 事件触发:", {
|
|
1879
|
-
target:
|
|
1880
|
+
target: C,
|
|
1880
1881
|
relatedTarget: v,
|
|
1881
1882
|
isReallyBlurred: E,
|
|
1882
1883
|
activeElement: document.activeElement,
|
|
1883
|
-
targetTagName:
|
|
1884
|
-
targetClassName:
|
|
1884
|
+
targetTagName: C.tagName,
|
|
1885
|
+
targetClassName: C.className
|
|
1885
1886
|
}), !E) {
|
|
1886
1887
|
console.log("[Blur Event] 焦点仍在编辑器内,跳过处理");
|
|
1887
1888
|
return;
|
|
1888
1889
|
}
|
|
1889
|
-
const N =
|
|
1890
|
+
const N = C.closest('[data-type="variable"][data-multi-key]');
|
|
1890
1891
|
if (N && o.current.contains(N)) {
|
|
1891
1892
|
const R = N.dataset.multiKey, j = N.dataset.key, M = N.dataset.index;
|
|
1892
1893
|
if (R && j && M !== void 0) {
|
|
@@ -1939,8 +1940,8 @@ const Vt = ({
|
|
|
1939
1940
|
}
|
|
1940
1941
|
}
|
|
1941
1942
|
};
|
|
1942
|
-
return f.addEventListener("blur", y, !
|
|
1943
|
-
f.removeEventListener("blur", y, !
|
|
1943
|
+
return f.addEventListener("blur", y, !0), () => {
|
|
1944
|
+
f.removeEventListener("blur", y, !0);
|
|
1944
1945
|
};
|
|
1945
1946
|
}, [t, Z]);
|
|
1946
1947
|
const ve = () => {
|
|
@@ -1960,8 +1961,8 @@ const Vt = ({
|
|
|
1960
1961
|
const y = window.getSelection();
|
|
1961
1962
|
if (y && y.rangeCount > 0) {
|
|
1962
1963
|
const h = y.anchorNode;
|
|
1963
|
-
let
|
|
1964
|
-
if (h && (h.nodeType === Node.ELEMENT_NODE ?
|
|
1964
|
+
let C = null;
|
|
1965
|
+
if (h && (h.nodeType === Node.ELEMENT_NODE ? C = h.closest('[data-type="text"]') : h.nodeType === Node.TEXT_NODE && h.parentElement && (C = h.parentElement.closest('[data-type="text"]'))), C) {
|
|
1965
1966
|
if (f.preventDefault(), f.stopPropagation(), o.current) {
|
|
1966
1967
|
const v = o.current.querySelector(
|
|
1967
1968
|
'[data-type="variable"], [data-type="upload"]'
|
|
@@ -1973,8 +1974,8 @@ const Vt = ({
|
|
|
1973
1974
|
}
|
|
1974
1975
|
if (m && y && y.rangeCount > 0) {
|
|
1975
1976
|
const h = y.anchorNode;
|
|
1976
|
-
let
|
|
1977
|
-
if (h && (h.nodeType === Node.ELEMENT_NODE ?
|
|
1977
|
+
let C = null;
|
|
1978
|
+
if (h && (h.nodeType === Node.ELEMENT_NODE ? C = h.closest(".tag-node") : h.nodeType === Node.TEXT_NODE && h.parentElement && (C = h.parentElement.closest(".tag-node"))), C) {
|
|
1978
1979
|
if (f.preventDefault(), f.stopPropagation(), o.current) {
|
|
1979
1980
|
const v = o.current.querySelector(
|
|
1980
1981
|
'[data-type="variable"], [data-type="upload"]'
|
|
@@ -1994,10 +1995,10 @@ const Vt = ({
|
|
|
1994
1995
|
if (f.key === "Backspace") {
|
|
1995
1996
|
const h = window.getSelection();
|
|
1996
1997
|
if (h && h.rangeCount > 0) {
|
|
1997
|
-
const
|
|
1998
|
+
const C = h.getRangeAt(0), v = h.anchorNode;
|
|
1998
1999
|
if (m) {
|
|
1999
2000
|
let N = null, R = null;
|
|
2000
|
-
if (v && (v.nodeType === Node.ELEMENT_NODE ? (N = v.closest(".tag-node"), R = v.closest('[data-type="text"]')) : v.nodeType === Node.TEXT_NODE && v.parentElement && (N = v.parentElement.closest(".tag-node"), R = v.parentElement.closest('[data-type="text"]'))), (N || R) &&
|
|
2001
|
+
if (v && (v.nodeType === Node.ELEMENT_NODE ? (N = v.closest(".tag-node"), R = v.closest('[data-type="text"]')) : v.nodeType === Node.TEXT_NODE && v.parentElement && (N = v.parentElement.closest(".tag-node"), R = v.parentElement.closest('[data-type="text"]'))), (N || R) && C.collapsed && C.startOffset === 0) {
|
|
2001
2002
|
f.preventDefault();
|
|
2002
2003
|
return;
|
|
2003
2004
|
}
|
|
@@ -2008,18 +2009,18 @@ const Vt = ({
|
|
|
2008
2009
|
) : v.nodeType === Node.TEXT_NODE && v.parentElement && (E = v.parentElement.closest(
|
|
2009
2010
|
'[data-type="variable"]'
|
|
2010
2011
|
))), E) {
|
|
2011
|
-
if (!
|
|
2012
|
+
if (!C.collapsed)
|
|
2012
2013
|
return;
|
|
2013
2014
|
const N = E.innerText;
|
|
2014
2015
|
if (N === "" || N === "") {
|
|
2015
2016
|
f.preventDefault();
|
|
2016
2017
|
return;
|
|
2017
2018
|
}
|
|
2018
|
-
if (
|
|
2019
|
+
if (C.startOffset === 0) {
|
|
2019
2020
|
f.preventDefault();
|
|
2020
2021
|
return;
|
|
2021
2022
|
}
|
|
2022
|
-
if (N.startsWith("") &&
|
|
2023
|
+
if (N.startsWith("") && C.startOffset === 1) {
|
|
2023
2024
|
f.preventDefault();
|
|
2024
2025
|
return;
|
|
2025
2026
|
}
|
|
@@ -2036,7 +2037,7 @@ const Vt = ({
|
|
|
2036
2037
|
}
|
|
2037
2038
|
const f = o.current;
|
|
2038
2039
|
let y = "";
|
|
2039
|
-
const h = {},
|
|
2040
|
+
const h = {}, C = (E) => {
|
|
2040
2041
|
if (!(E.nodeType === Node.ELEMENT_NODE && E.style.display === "none")) {
|
|
2041
2042
|
if (E.nodeType === Node.TEXT_NODE)
|
|
2042
2043
|
y += (E.textContent || "").replace(/\u200B/g, "");
|
|
@@ -2070,12 +2071,12 @@ const Vt = ({
|
|
|
2070
2071
|
h[j] = c[j] ?? null, c[j] && (y += ` [附带文件: ${c[j]?.name}] `);
|
|
2071
2072
|
else {
|
|
2072
2073
|
if (N.classList.contains("tag-close-btn") || N.classList.contains("file-remove-btn")) return;
|
|
2073
|
-
N.getAttribute("contenteditable") === "false" && !R && N.classList.contains("tag-node") ? y += N.innerText : N.childNodes.forEach(
|
|
2074
|
+
N.getAttribute("contenteditable") === "false" && !R && N.classList.contains("tag-node") ? y += N.innerText : N.childNodes.forEach(C);
|
|
2074
2075
|
}
|
|
2075
2076
|
}
|
|
2076
2077
|
}
|
|
2077
2078
|
};
|
|
2078
|
-
if (f.childNodes.forEach(
|
|
2079
|
+
if (f.childNodes.forEach(C), y = y.trim(), !y) return;
|
|
2079
2080
|
const v = new FormData();
|
|
2080
2081
|
v.append("fullPrompt", y), Object.keys(h).forEach((E) => {
|
|
2081
2082
|
const N = h[E];
|
|
@@ -2122,7 +2123,7 @@ const Vt = ({
|
|
|
2122
2123
|
"input",
|
|
2123
2124
|
{
|
|
2124
2125
|
type: "file",
|
|
2125
|
-
ref:
|
|
2126
|
+
ref: S,
|
|
2126
2127
|
className: "rte-file-input",
|
|
2127
2128
|
accept: ".csv,.xlsx,.xls,.txt,.pdf,image/*",
|
|
2128
2129
|
onChange: K
|
|
@@ -2330,7 +2331,7 @@ const De = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2330
2331
|
onStartAutoLoad: x,
|
|
2331
2332
|
onStopLoading: u
|
|
2332
2333
|
}) => {
|
|
2333
|
-
const [q, d] = J(5), o = Math.ceil(a / l),
|
|
2334
|
+
const [q, d] = J(5), o = Math.ceil(a / l), S = Ge(() => r.length >= o, [r, o]), c = () => Array.from(
|
|
2334
2335
|
{ length: o },
|
|
2335
2336
|
($, b) => b + 1
|
|
2336
2337
|
).filter(($) => !r.includes($)).slice(0, q), w = (k, $, b) => {
|
|
@@ -2365,7 +2366,7 @@ const De = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2365
2366
|
a,
|
|
2366
2367
|
"条数据"
|
|
2367
2368
|
] }),
|
|
2368
|
-
!
|
|
2369
|
+
!S && /* @__PURE__ */ n.jsx(
|
|
2369
2370
|
Pt,
|
|
2370
2371
|
{
|
|
2371
2372
|
loadIcon: p || void 0,
|
|
@@ -2413,9 +2414,9 @@ const De = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2413
2414
|
onStartAutoLoad: q,
|
|
2414
2415
|
onStopLoading: d,
|
|
2415
2416
|
...o
|
|
2416
|
-
} = t,
|
|
2417
|
+
} = t, S = z(null), c = W(
|
|
2417
2418
|
(w) => {
|
|
2418
|
-
x(w), e.includes(w) &&
|
|
2419
|
+
x(w), e.includes(w) && S.current?.scrollTo({
|
|
2419
2420
|
key: `${(w - 1) * i + 1}`
|
|
2420
2421
|
});
|
|
2421
2422
|
},
|
|
@@ -2425,7 +2426,7 @@ const De = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2425
2426
|
/* @__PURE__ */ n.jsx(
|
|
2426
2427
|
Ie,
|
|
2427
2428
|
{
|
|
2428
|
-
ref:
|
|
2429
|
+
ref: S,
|
|
2429
2430
|
...o,
|
|
2430
2431
|
columns: r,
|
|
2431
2432
|
dataSource: m,
|
|
@@ -2568,7 +2569,7 @@ const Mt = ({
|
|
|
2568
2569
|
onChange: m,
|
|
2569
2570
|
...A
|
|
2570
2571
|
}) => {
|
|
2571
|
-
const [g, i] = J(""), [e, x] = J(0), [u, q] = J(!1), [d, o] = J(!1), [
|
|
2572
|
+
const [g, i] = J(""), [e, x] = J(0), [u, q] = J(!1), [d, o] = J(!1), [S, c] = J(!1), w = z(void 0), k = z(void 0), $ = z(t), b = z(e), V = z(d), _ = z(g);
|
|
2572
2573
|
oe(() => {
|
|
2573
2574
|
$.current = t, b.current = e, V.current = d, _.current = g;
|
|
2574
2575
|
});
|
|
@@ -2652,7 +2653,7 @@ const Mt = ({
|
|
|
2652
2653
|
},
|
|
2653
2654
|
children: [
|
|
2654
2655
|
/* @__PURE__ */ n.jsx("span", { children: g }),
|
|
2655
|
-
|
|
2656
|
+
S && /* @__PURE__ */ n.jsx(
|
|
2656
2657
|
"span",
|
|
2657
2658
|
{
|
|
2658
2659
|
style: {
|
|
@@ -2751,7 +2752,7 @@ const Dt = ({
|
|
|
2751
2752
|
...d
|
|
2752
2753
|
// 其他原生属性
|
|
2753
2754
|
}) => {
|
|
2754
|
-
const [o,
|
|
2755
|
+
const [o, S] = J(""), [c, w] = J(0), [k, $] = J(!1), [b, V] = J(!1), [_, P] = J(!1), [D, B] = J(r || ""), U = z(void 0), H = z(void 0), X = z(t), Z = z(c), T = z(b), I = z(o), Q = z(null);
|
|
2755
2756
|
oe(() => {
|
|
2756
2757
|
X.current = t, Z.current = c, T.current = b, I.current = o;
|
|
2757
2758
|
});
|
|
@@ -2759,13 +2760,13 @@ const Dt = ({
|
|
|
2759
2760
|
let ue = 0;
|
|
2760
2761
|
P(!0);
|
|
2761
2762
|
const ve = () => {
|
|
2762
|
-
ue < O.length ? (
|
|
2763
|
+
ue < O.length ? (S(O.slice(0, ue + 1)), ue++, H.current = window.setTimeout(ve, l)) : (P(!1), G?.());
|
|
2763
2764
|
};
|
|
2764
2765
|
ve();
|
|
2765
2766
|
}, [l]), pe = W((O) => {
|
|
2766
2767
|
let G = I.current.length;
|
|
2767
2768
|
const ue = () => {
|
|
2768
|
-
G > 0 ? (
|
|
2769
|
+
G > 0 ? (S(I.current.slice(0, G - 1)), G--, H.current = window.setTimeout(ue, l / 2)) : O?.();
|
|
2769
2770
|
};
|
|
2770
2771
|
ue();
|
|
2771
2772
|
}, [l]), he = W(() => {
|
|
@@ -2792,7 +2793,7 @@ const Dt = ({
|
|
|
2792
2793
|
const s = (O) => {
|
|
2793
2794
|
V(!0), U.current && window.clearTimeout(U.current), H.current && window.clearTimeout(H.current), $(!1), P(!1), d.onFocus?.(O);
|
|
2794
2795
|
}, L = (O) => {
|
|
2795
|
-
V(!1), !r && t.length > 0 && (
|
|
2796
|
+
V(!1), !r && t.length > 0 && (S(""), w(0)), d.onBlur?.(O);
|
|
2796
2797
|
}, K = (O) => {
|
|
2797
2798
|
const G = O.target.value;
|
|
2798
2799
|
g && G.length > g || (m ? m(G) : B(G), d.onChange?.(O));
|
|
@@ -3039,7 +3040,7 @@ const ze = ({
|
|
|
3039
3040
|
onVideoEnded: q,
|
|
3040
3041
|
className: d,
|
|
3041
3042
|
style: o,
|
|
3042
|
-
...
|
|
3043
|
+
...S
|
|
3043
3044
|
}) => {
|
|
3044
3045
|
const c = z(null), [w, k] = J(!1), [$, b] = J(!1), [V, _] = J(!1), P = W(() => {
|
|
3045
3046
|
c.current && (c.current.play(), k(!0), x?.());
|
|
@@ -3065,7 +3066,7 @@ const ze = ({
|
|
|
3065
3066
|
return /* @__PURE__ */ n.jsx(
|
|
3066
3067
|
Re,
|
|
3067
3068
|
{
|
|
3068
|
-
...
|
|
3069
|
+
...S,
|
|
3069
3070
|
className: `video-card ${d || ""}`,
|
|
3070
3071
|
style: {
|
|
3071
3072
|
width: l,
|
|
@@ -3260,7 +3261,7 @@ const Gt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
3260
3261
|
}, [t, e, d]);
|
|
3261
3262
|
const o = W(() => {
|
|
3262
3263
|
d();
|
|
3263
|
-
}, [d]),
|
|
3264
|
+
}, [d]), S = W((c) => {
|
|
3264
3265
|
g && g(c), c.onClick?.(c);
|
|
3265
3266
|
}, [g]);
|
|
3266
3267
|
return /* @__PURE__ */ n.jsx(
|
|
@@ -3294,7 +3295,7 @@ const Gt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
3294
3295
|
poster: c.poster,
|
|
3295
3296
|
width: "100%",
|
|
3296
3297
|
height: "100%",
|
|
3297
|
-
onClick: () =>
|
|
3298
|
+
onClick: () => S(c),
|
|
3298
3299
|
onVideoLoaded: o,
|
|
3299
3300
|
autoPlayOnHover: !0,
|
|
3300
3301
|
showPlayButton: !1
|
|
@@ -3303,7 +3304,7 @@ const Gt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
3303
3304
|
"div",
|
|
3304
3305
|
{
|
|
3305
3306
|
className: "waterfall-image-wrapper",
|
|
3306
|
-
onClick: () =>
|
|
3307
|
+
onClick: () => S(c),
|
|
3307
3308
|
style: { cursor: g || c.onClick ? "pointer" : "default" },
|
|
3308
3309
|
children: /* @__PURE__ */ n.jsx(
|
|
3309
3310
|
"img",
|