bi-components-library 1.0.7 → 1.0.9
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 +122 -122
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -17,19 +17,19 @@ function Ke() {
|
|
|
17
17
|
if (Te) return me;
|
|
18
18
|
Te = 1;
|
|
19
19
|
var t = Symbol.for("react.transitional.element"), p = Symbol.for("react.fragment");
|
|
20
|
-
function c(s, l,
|
|
20
|
+
function c(s, l, m) {
|
|
21
21
|
var T = null;
|
|
22
|
-
if (
|
|
23
|
-
|
|
22
|
+
if (m !== void 0 && (T = "" + m), l.key !== void 0 && (T = "" + l.key), "key" in l) {
|
|
23
|
+
m = {};
|
|
24
24
|
for (var y in l)
|
|
25
|
-
y !== "key" && (
|
|
26
|
-
} else
|
|
27
|
-
return l =
|
|
25
|
+
y !== "key" && (m[y] = l[y]);
|
|
26
|
+
} else m = l;
|
|
27
|
+
return l = m.ref, {
|
|
28
28
|
$$typeof: t,
|
|
29
29
|
type: s,
|
|
30
30
|
key: T,
|
|
31
31
|
ref: l !== void 0 ? l : null,
|
|
32
|
-
props:
|
|
32
|
+
props: m
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
return me.Fragment = p, me.jsx = c, me.jsxs = c, me;
|
|
@@ -125,7 +125,7 @@ function Ye() {
|
|
|
125
125
|
var i = D.A;
|
|
126
126
|
return i === null ? null : i.getOwner();
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function m() {
|
|
129
129
|
return Error("react-stack-top-frame");
|
|
130
130
|
}
|
|
131
131
|
function T(i) {
|
|
@@ -200,10 +200,10 @@ function Ye() {
|
|
|
200
200
|
else d(o);
|
|
201
201
|
if (X.call(I, "key")) {
|
|
202
202
|
o = t(i);
|
|
203
|
-
var
|
|
203
|
+
var f = Object.keys(I).filter(function(b) {
|
|
204
204
|
return b !== "key";
|
|
205
205
|
});
|
|
206
|
-
J = 0 <
|
|
206
|
+
J = 0 < f.length ? "{key: someKey, " + f.join(": ..., ") + ": ...}" : "{key: someKey}", ie[o + J] || (f = 0 < f.length ? "{" + f.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
207
207
|
`A props object containing a "key" prop is being spread into JSX:
|
|
208
208
|
let props = %s;
|
|
209
209
|
<%s {...props} />
|
|
@@ -212,7 +212,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
212
212
|
<%s key={someKey} {...props} />`,
|
|
213
213
|
J,
|
|
214
214
|
o,
|
|
215
|
-
|
|
215
|
+
f,
|
|
216
216
|
o
|
|
217
217
|
), ie[o + J] = !0);
|
|
218
218
|
}
|
|
@@ -248,8 +248,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
248
248
|
};
|
|
249
249
|
var _, K = {}, U = C.react_stack_bottom_frame.bind(
|
|
250
250
|
C,
|
|
251
|
-
|
|
252
|
-
)(), le = E(s(
|
|
251
|
+
m
|
|
252
|
+
)(), le = E(s(m)), ie = {};
|
|
253
253
|
ye.Fragment = x, ye.jsx = function(i, I, B, J, se) {
|
|
254
254
|
var ee = 1e4 > D.recentlyCreatedOwnerStacks++;
|
|
255
255
|
return N(
|
|
@@ -288,8 +288,8 @@ const Je = ({
|
|
|
288
288
|
children: c,
|
|
289
289
|
...s
|
|
290
290
|
}) => {
|
|
291
|
-
const l = (
|
|
292
|
-
switch (
|
|
291
|
+
const l = (m) => {
|
|
292
|
+
switch (m) {
|
|
293
293
|
case "primary":
|
|
294
294
|
return "primary";
|
|
295
295
|
case "ghost":
|
|
@@ -365,11 +365,11 @@ const Qe = ({
|
|
|
365
365
|
bordered: c = !0,
|
|
366
366
|
hoverable: s = !1,
|
|
367
367
|
size: l = "default",
|
|
368
|
-
...
|
|
368
|
+
...m
|
|
369
369
|
}) => /* @__PURE__ */ u.jsx(
|
|
370
370
|
Ee,
|
|
371
371
|
{
|
|
372
|
-
...
|
|
372
|
+
...m,
|
|
373
373
|
title: t,
|
|
374
374
|
bordered: c,
|
|
375
375
|
hoverable: s,
|
|
@@ -432,9 +432,9 @@ const Ze = ({
|
|
|
432
432
|
showDefaultFooter: t = !0,
|
|
433
433
|
...p
|
|
434
434
|
}) => {
|
|
435
|
-
const c = p.footer !== void 0 ? p.footer : t ? (s, { OkBtn: l, CancelBtn:
|
|
435
|
+
const c = p.footer !== void 0 ? p.footer : t ? (s, { OkBtn: l, CancelBtn: m }) => /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
436
436
|
/* @__PURE__ */ u.jsx(l, {}),
|
|
437
|
-
/* @__PURE__ */ u.jsx(
|
|
437
|
+
/* @__PURE__ */ u.jsx(m, {})
|
|
438
438
|
] }) : null;
|
|
439
439
|
return /* @__PURE__ */ u.jsx(
|
|
440
440
|
Ie,
|
|
@@ -586,7 +586,7 @@ const tt = De({
|
|
|
586
586
|
style: s,
|
|
587
587
|
...l
|
|
588
588
|
}) => {
|
|
589
|
-
const
|
|
589
|
+
const m = {
|
|
590
590
|
fontSize: p,
|
|
591
591
|
color: c,
|
|
592
592
|
...s
|
|
@@ -596,7 +596,7 @@ const tt = De({
|
|
|
596
596
|
{
|
|
597
597
|
...l,
|
|
598
598
|
type: t,
|
|
599
|
-
style:
|
|
599
|
+
style: m
|
|
600
600
|
}
|
|
601
601
|
);
|
|
602
602
|
};
|
|
@@ -642,7 +642,7 @@ const rt = ({
|
|
|
642
642
|
className: c,
|
|
643
643
|
emptyChildren: s,
|
|
644
644
|
loadingText: l,
|
|
645
|
-
emptyImage:
|
|
645
|
+
emptyImage: m
|
|
646
646
|
}) => t ? /* @__PURE__ */ u.jsxs(
|
|
647
647
|
ke,
|
|
648
648
|
{
|
|
@@ -664,7 +664,7 @@ const rt = ({
|
|
|
664
664
|
children: /* @__PURE__ */ u.jsx(
|
|
665
665
|
Le,
|
|
666
666
|
{
|
|
667
|
-
image:
|
|
667
|
+
image: m,
|
|
668
668
|
description: p,
|
|
669
669
|
imageStyle: { height: 180 },
|
|
670
670
|
children: s
|
|
@@ -830,7 +830,7 @@ const { Option: st } = Se, lt = ({
|
|
|
830
830
|
searchFields: c = [],
|
|
831
831
|
showSearch: s = !0,
|
|
832
832
|
showRefresh: l = !0,
|
|
833
|
-
defaultPageSize:
|
|
833
|
+
defaultPageSize: m = 10,
|
|
834
834
|
pageSizeOptions: T = ["10", "20", "50", "100"],
|
|
835
835
|
autoLoad: y = !0,
|
|
836
836
|
externalParams: e = {},
|
|
@@ -838,7 +838,7 @@ const { Option: st } = Se, lt = ({
|
|
|
838
838
|
}) => {
|
|
839
839
|
const [N, d] = z([]), [C, n] = z(!1), [S, x] = z({
|
|
840
840
|
current: 1,
|
|
841
|
-
pageSize:
|
|
841
|
+
pageSize: m,
|
|
842
842
|
total: 0
|
|
843
843
|
}), [h, v] = z({}), [$, g] = z({}), [k] = he.useForm(), w = Y(S);
|
|
844
844
|
w.current = S;
|
|
@@ -883,14 +883,14 @@ const { Option: st } = Se, lt = ({
|
|
|
883
883
|
}, [P]), Z = F((E, _, K) => {
|
|
884
884
|
const U = {
|
|
885
885
|
current: E.current || 1,
|
|
886
|
-
pageSize: E.pageSize ||
|
|
886
|
+
pageSize: E.pageSize || m,
|
|
887
887
|
total: E.total || 0
|
|
888
888
|
}, le = {
|
|
889
889
|
field: K?.field,
|
|
890
890
|
order: K?.order
|
|
891
891
|
};
|
|
892
892
|
x(U), g(le);
|
|
893
|
-
}, [
|
|
893
|
+
}, [m]);
|
|
894
894
|
return te(() => {
|
|
895
895
|
const E = Object.keys(e).length > 0;
|
|
896
896
|
(y && !O.current || E) && (P(), O.current = !0);
|
|
@@ -1022,13 +1022,13 @@ function ve(t, p, c) {
|
|
|
1022
1022
|
key: d.key,
|
|
1023
1023
|
exclusionGroup: d.exclusionGroup
|
|
1024
1024
|
}));
|
|
1025
|
-
const
|
|
1025
|
+
const m = {};
|
|
1026
1026
|
for (const d of s) {
|
|
1027
|
-
|
|
1027
|
+
m[d] = !1;
|
|
1028
1028
|
for (const C of l[d])
|
|
1029
1029
|
if (C.type === "upload" && C.key) {
|
|
1030
1030
|
if (c[C.key] !== null && c[C.key] !== void 0) {
|
|
1031
|
-
|
|
1031
|
+
m[d] = !0;
|
|
1032
1032
|
break;
|
|
1033
1033
|
}
|
|
1034
1034
|
} else if (C.type === "variable" && C.key) {
|
|
@@ -1036,18 +1036,18 @@ function ve(t, p, c) {
|
|
|
1036
1036
|
`[data-type="variable"][data-key="${C.key}"]`
|
|
1037
1037
|
);
|
|
1038
1038
|
if (n && n.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
|
|
1039
|
-
|
|
1039
|
+
m[d] = !0;
|
|
1040
1040
|
break;
|
|
1041
1041
|
}
|
|
1042
1042
|
}
|
|
1043
1043
|
}
|
|
1044
|
-
const T = p.some((d) => d.exclusionGroup === "separator"), e = Object.keys(
|
|
1045
|
-
(d) =>
|
|
1044
|
+
const T = p.some((d) => d.exclusionGroup === "separator"), e = Object.keys(m).filter(
|
|
1045
|
+
(d) => m[d]
|
|
1046
1046
|
).length > 0;
|
|
1047
1047
|
let a = null;
|
|
1048
1048
|
if (e && T) {
|
|
1049
1049
|
for (const d of p)
|
|
1050
|
-
if (d.exclusionGroup && d.exclusionGroup !== "separator" &&
|
|
1050
|
+
if (d.exclusionGroup && d.exclusionGroup !== "separator" && m[d.exclusionGroup]) {
|
|
1051
1051
|
a = d.exclusionGroup;
|
|
1052
1052
|
break;
|
|
1053
1053
|
}
|
|
@@ -1100,9 +1100,9 @@ function we(t, p, c, s) {
|
|
|
1100
1100
|
}
|
|
1101
1101
|
}
|
|
1102
1102
|
}
|
|
1103
|
-
const
|
|
1103
|
+
const m = p.some((e) => e.exclusionGroup === "separator");
|
|
1104
1104
|
let T = !1;
|
|
1105
|
-
if (
|
|
1105
|
+
if (m && l.length > 1) {
|
|
1106
1106
|
const e = p.findIndex((d) => d.exclusionGroup === "separator"), a = l.filter((d) => p.findIndex(
|
|
1107
1107
|
(n) => (n.type === "variable" || n.type === "upload") && n.key === d.key && n.exclusionGroup === d.exclusionGroup
|
|
1108
1108
|
) < e), N = l.filter((d) => p.findIndex(
|
|
@@ -1213,7 +1213,7 @@ function be(t, p) {
|
|
|
1213
1213
|
l.replace(/\u200B/g, "") ? s.classList.remove("show-placeholder") : (l !== "" && (s.innerText = ""), s.classList.add("show-placeholder"));
|
|
1214
1214
|
});
|
|
1215
1215
|
}
|
|
1216
|
-
function it(t, p, c, s, l,
|
|
1216
|
+
function it(t, p, c, s, l, m = {}) {
|
|
1217
1217
|
if (!t.current) return;
|
|
1218
1218
|
let T = "", y = 0;
|
|
1219
1219
|
for (; y < p.length; ) {
|
|
@@ -1252,7 +1252,7 @@ function it(t, p, c, s, l, f = {}) {
|
|
|
1252
1252
|
const x = c[e.key] !== null && c[e.key] !== void 0, h = x ? c[e.key]?.name : e.text, v = x ? "" : "hidden", $ = e.tooltip && !x ? "" : "hidden", g = x ? "has-file" : "", k = x && h ? ` data-file-name="${h.replace(/"/g, """)}"` : "", w = `<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${g}"><span class="upload-icon">${x ? "<i class='iconfont icon-exlwenjian'></i>" : "<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${k}>${h || 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 ${v}" title="移除文件">×</span></span></span>`;
|
|
1253
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>${w}</span>` : S = w;
|
|
1254
1254
|
} else if (e.type === "multi-variable" && e.key) {
|
|
1255
|
-
const x = e.maxCount || 9, h =
|
|
1255
|
+
const x = e.maxCount || 9, h = m[e.key] || 1, v = Math.min(h, x);
|
|
1256
1256
|
let $ = "";
|
|
1257
1257
|
for (let g = 0; g < v; g++) {
|
|
1258
1258
|
const k = `${e.key}_${g}`, w = l[k] || "", L = !w, O = L ? "" : w, M = L ? "show-placeholder" : "", P = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-variable-key="${e.key || ""}"` : "", W = e.tooltip && L ? "" : "hidden", D = `<span contenteditable="true" data-type="variable" data-key="${k}" data-multi-key="${e.key}" data-index="${g}" data-placeholder="${e.placeholder || ""}"${P} class="variable-chip ${M}">${O}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${W}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, """)}" title="提示"></i>` : ""}</span>`;
|
|
@@ -1270,7 +1270,7 @@ function it(t, p, c, s, l, f = {}) {
|
|
|
1270
1270
|
});
|
|
1271
1271
|
}, 0));
|
|
1272
1272
|
}
|
|
1273
|
-
function ct(t, p, c, s, l = {},
|
|
1273
|
+
function ct(t, p, c, s, l = {}, m, T) {
|
|
1274
1274
|
const y = F(() => {
|
|
1275
1275
|
if (!t.current) return;
|
|
1276
1276
|
if (p.length === 0) {
|
|
@@ -1287,8 +1287,8 @@ function ct(t, p, c, s, l = {}, f, T) {
|
|
|
1287
1287
|
const S = C.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1288
1288
|
S && (e[n] = S);
|
|
1289
1289
|
}
|
|
1290
|
-
}), it(t, p, c, s, e, l),
|
|
1291
|
-
const { key: d, offset: C } =
|
|
1290
|
+
}), it(t, p, c, s, e, l), m?.current) {
|
|
1291
|
+
const { key: d, offset: C } = m.current;
|
|
1292
1292
|
setTimeout(() => {
|
|
1293
1293
|
if (!t.current) return;
|
|
1294
1294
|
const n = t.current.querySelector(
|
|
@@ -1325,11 +1325,11 @@ function ct(t, p, c, s, l = {}, f, T) {
|
|
|
1325
1325
|
const x = window.getSelection();
|
|
1326
1326
|
x && (x.removeAllRanges(), x.addRange(S), n.focus());
|
|
1327
1327
|
}
|
|
1328
|
-
|
|
1328
|
+
m.current = null;
|
|
1329
1329
|
}
|
|
1330
1330
|
}, 0);
|
|
1331
1331
|
}
|
|
1332
|
-
}, [p, c, s, t, l,
|
|
1332
|
+
}, [p, c, s, t, l, m, T]);
|
|
1333
1333
|
te(() => {
|
|
1334
1334
|
y();
|
|
1335
1335
|
}, [y]);
|
|
@@ -1338,7 +1338,7 @@ function ut(t, p, c, s) {
|
|
|
1338
1338
|
te(() => {
|
|
1339
1339
|
const l = t.current;
|
|
1340
1340
|
if (!l) return;
|
|
1341
|
-
const
|
|
1341
|
+
const m = (y) => {
|
|
1342
1342
|
const e = y.target?.closest(".upload-info-icon");
|
|
1343
1343
|
if (e && e.classList.contains("upload-info-icon")) {
|
|
1344
1344
|
const a = e.dataset.uploadKey;
|
|
@@ -1348,8 +1348,8 @@ function ut(t, p, c, s) {
|
|
|
1348
1348
|
const e = y.target?.closest(".upload-info-icon"), a = y.relatedTarget;
|
|
1349
1349
|
e && e.classList.contains("upload-info-icon") && (!a || !l.contains(a) ? s(null) : a.closest(".upload-info-icon") || s(null));
|
|
1350
1350
|
};
|
|
1351
|
-
return l.addEventListener("mouseover",
|
|
1352
|
-
l.removeEventListener("mouseover",
|
|
1351
|
+
return l.addEventListener("mouseover", m, !0), l.addEventListener("mouseout", T, !0), () => {
|
|
1352
|
+
l.removeEventListener("mouseover", m, !0), l.removeEventListener("mouseout", T, !0);
|
|
1353
1353
|
};
|
|
1354
1354
|
}, [p, c, t, s]);
|
|
1355
1355
|
}
|
|
@@ -1362,7 +1362,7 @@ function dt(t, p, c) {
|
|
|
1362
1362
|
}, l = () => {
|
|
1363
1363
|
c(null);
|
|
1364
1364
|
};
|
|
1365
|
-
let
|
|
1365
|
+
let m;
|
|
1366
1366
|
const T = () => {
|
|
1367
1367
|
if (!t.current) return;
|
|
1368
1368
|
t.current.querySelectorAll(
|
|
@@ -1371,10 +1371,10 @@ function dt(t, p, c) {
|
|
|
1371
1371
|
e.addEventListener("mouseenter", s), e.addEventListener("mouseleave", l);
|
|
1372
1372
|
});
|
|
1373
1373
|
};
|
|
1374
|
-
return
|
|
1375
|
-
|
|
1374
|
+
return m = requestAnimationFrame(() => {
|
|
1375
|
+
m = requestAnimationFrame(T);
|
|
1376
1376
|
}), () => {
|
|
1377
|
-
cancelAnimationFrame(
|
|
1377
|
+
cancelAnimationFrame(m), t.current && t.current.querySelectorAll(
|
|
1378
1378
|
".tag-node[data-tooltip]"
|
|
1379
1379
|
).forEach((e) => {
|
|
1380
1380
|
e.removeEventListener("mouseenter", s), e.removeEventListener("mouseleave", l);
|
|
@@ -1392,12 +1392,12 @@ function pt(t, p, c) {
|
|
|
1392
1392
|
const e = y.dataset.variableKey;
|
|
1393
1393
|
e && c({ key: e, anchorEl: y, type: "variable" });
|
|
1394
1394
|
}
|
|
1395
|
-
},
|
|
1395
|
+
}, m = (T) => {
|
|
1396
1396
|
const y = T.target?.closest(".variable-info-icon"), e = T.relatedTarget;
|
|
1397
1397
|
y && y.classList.contains("variable-info-icon") && (!e || !s.contains(e) ? c(null) : e.closest(".variable-info-icon") || c(null));
|
|
1398
1398
|
};
|
|
1399
|
-
return s.addEventListener("mouseover", l, !0), s.addEventListener("mouseout",
|
|
1400
|
-
s.removeEventListener("mouseover", l, !0), s.removeEventListener("mouseout",
|
|
1399
|
+
return s.addEventListener("mouseover", l, !0), s.addEventListener("mouseout", m, !0), () => {
|
|
1400
|
+
s.removeEventListener("mouseover", l, !0), s.removeEventListener("mouseout", m, !0);
|
|
1401
1401
|
};
|
|
1402
1402
|
}, [p, t, c]);
|
|
1403
1403
|
}
|
|
@@ -1407,7 +1407,7 @@ function ft(t, p, c, s) {
|
|
|
1407
1407
|
const l = (e) => {
|
|
1408
1408
|
const a = e.currentTarget;
|
|
1409
1409
|
a.dataset.fileName && s({ key: "", anchorEl: a, type: "upload-label" });
|
|
1410
|
-
},
|
|
1410
|
+
}, m = () => {
|
|
1411
1411
|
s(null);
|
|
1412
1412
|
};
|
|
1413
1413
|
let T;
|
|
@@ -1416,7 +1416,7 @@ function ft(t, p, c, s) {
|
|
|
1416
1416
|
t.current.querySelectorAll(
|
|
1417
1417
|
".upload-label[data-file-name]"
|
|
1418
1418
|
).forEach((a) => {
|
|
1419
|
-
a.addEventListener("mouseenter", l), a.addEventListener("mouseleave",
|
|
1419
|
+
a.addEventListener("mouseenter", l), a.addEventListener("mouseleave", m);
|
|
1420
1420
|
});
|
|
1421
1421
|
};
|
|
1422
1422
|
return T = requestAnimationFrame(() => {
|
|
@@ -1425,7 +1425,7 @@ function ft(t, p, c, s) {
|
|
|
1425
1425
|
cancelAnimationFrame(T), t.current && t.current.querySelectorAll(
|
|
1426
1426
|
".upload-label[data-file-name]"
|
|
1427
1427
|
).forEach((a) => {
|
|
1428
|
-
a.removeEventListener("mouseenter", l), a.removeEventListener("mouseleave",
|
|
1428
|
+
a.removeEventListener("mouseenter", l), a.removeEventListener("mouseleave", m);
|
|
1429
1429
|
});
|
|
1430
1430
|
};
|
|
1431
1431
|
}, [p, c, t, s]);
|
|
@@ -1441,7 +1441,7 @@ function yt(t, p) {
|
|
|
1441
1441
|
let c = !1, s = 0;
|
|
1442
1442
|
const l = () => {
|
|
1443
1443
|
c = !0;
|
|
1444
|
-
},
|
|
1444
|
+
}, m = () => {
|
|
1445
1445
|
c = !1, s = Date.now();
|
|
1446
1446
|
};
|
|
1447
1447
|
let T = !1, y = 0;
|
|
@@ -1488,9 +1488,9 @@ function yt(t, p) {
|
|
|
1488
1488
|
n.removeAllRanges();
|
|
1489
1489
|
}
|
|
1490
1490
|
}, C = t.current;
|
|
1491
|
-
return C && (C.addEventListener("compositionstart", e), C.addEventListener("compositionend", a), C.addEventListener("input", N)), document.addEventListener("mousedown", l), document.addEventListener("mouseup",
|
|
1491
|
+
return C && (C.addEventListener("compositionstart", e), C.addEventListener("compositionend", a), C.addEventListener("input", N)), document.addEventListener("mousedown", l), document.addEventListener("mouseup", m), document.addEventListener("selectionchange", d), () => {
|
|
1492
1492
|
const n = t.current;
|
|
1493
|
-
n && (n.removeEventListener("compositionstart", e), n.removeEventListener("compositionend", a), n.removeEventListener("input", N)), document.removeEventListener("mousedown", l), document.removeEventListener("mouseup",
|
|
1493
|
+
n && (n.removeEventListener("compositionstart", e), n.removeEventListener("compositionend", a), n.removeEventListener("input", N)), document.removeEventListener("mousedown", l), document.removeEventListener("mouseup", m), document.removeEventListener("selectionchange", d);
|
|
1494
1494
|
};
|
|
1495
1495
|
}, [t, p]);
|
|
1496
1496
|
}
|
|
@@ -1500,7 +1500,7 @@ const ht = ({
|
|
|
1500
1500
|
isProcessing: c = !1,
|
|
1501
1501
|
disabled: s = !1,
|
|
1502
1502
|
width: l,
|
|
1503
|
-
lockStructure:
|
|
1503
|
+
lockStructure: m = !1,
|
|
1504
1504
|
agentOptions: T = [],
|
|
1505
1505
|
onAgentSelect: y,
|
|
1506
1506
|
onAgentExit: e,
|
|
@@ -1518,11 +1518,11 @@ const ht = ({
|
|
|
1518
1518
|
te(() => {
|
|
1519
1519
|
Z((r) => {
|
|
1520
1520
|
const o = {};
|
|
1521
|
-
return t.forEach((
|
|
1522
|
-
|
|
1521
|
+
return t.forEach((f) => {
|
|
1522
|
+
f.type === "multi-variable" && f.key && (o[f.key] = r[f.key] || 1);
|
|
1523
1523
|
}), o;
|
|
1524
1524
|
});
|
|
1525
|
-
}, [t]), ct(n, t, x,
|
|
1525
|
+
}, [t]), ct(n, t, x, m, X, P), ut(n, t, x, k), dt(n, t, k), ft(n, t, x, k), pt(n, t, k), mt(n, t, x, M), yt(n, w), te(() => {
|
|
1526
1526
|
if (t.length > 0) {
|
|
1527
1527
|
D(!1);
|
|
1528
1528
|
return;
|
|
@@ -1532,14 +1532,14 @@ const ht = ({
|
|
|
1532
1532
|
D(!0);
|
|
1533
1533
|
return;
|
|
1534
1534
|
}
|
|
1535
|
-
const
|
|
1535
|
+
const f = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "", q = n.current.querySelectorAll('[data-type="variable"]'), b = n.current.querySelectorAll('[data-type="upload"]');
|
|
1536
1536
|
let R = !1;
|
|
1537
1537
|
q.forEach((V) => {
|
|
1538
1538
|
(V.textContent?.replace(/[\u200B\n]/g, "").trim() || "") && (R = !0);
|
|
1539
1539
|
}), b.forEach((V) => {
|
|
1540
1540
|
V.querySelector(".upload-inner-wrapper.has-file") && (R = !0);
|
|
1541
1541
|
});
|
|
1542
|
-
const A = !
|
|
1542
|
+
const A = !f && !R;
|
|
1543
1543
|
D(A), t.length === 0 && M(!A);
|
|
1544
1544
|
};
|
|
1545
1545
|
r();
|
|
@@ -1558,9 +1558,9 @@ const ht = ({
|
|
|
1558
1558
|
return;
|
|
1559
1559
|
}
|
|
1560
1560
|
r.preventDefault();
|
|
1561
|
-
const o = r.clipboardData.getData("text/plain"),
|
|
1562
|
-
if (
|
|
1563
|
-
const q =
|
|
1561
|
+
const o = r.clipboardData.getData("text/plain"), f = window.getSelection();
|
|
1562
|
+
if (f && f.rangeCount > 0) {
|
|
1563
|
+
const q = f.anchorNode;
|
|
1564
1564
|
if (q) {
|
|
1565
1565
|
let b = null;
|
|
1566
1566
|
if (q.nodeType === Node.ELEMENT_NODE ? b = q.closest('[data-type="variable"]') : q.nodeType === Node.TEXT_NODE && q.parentElement && (b = q.parentElement.closest('[data-type="variable"]')), b) {
|
|
@@ -1591,24 +1591,24 @@ const ht = ({
|
|
|
1591
1591
|
document.execCommand("insertText", !1, o), B();
|
|
1592
1592
|
}, _ = (r) => {
|
|
1593
1593
|
if (r.target.files && r.target.files[0] && v) {
|
|
1594
|
-
const o = r.target.files[0],
|
|
1595
|
-
h((q) => ({ ...q, [
|
|
1594
|
+
const o = r.target.files[0], f = v;
|
|
1595
|
+
h((q) => ({ ...q, [f]: o }));
|
|
1596
1596
|
}
|
|
1597
1597
|
r.target && (r.target.value = ""), $(null);
|
|
1598
1598
|
}, K = (r) => {
|
|
1599
1599
|
h((o) => {
|
|
1600
|
-
const
|
|
1601
|
-
return delete
|
|
1600
|
+
const f = { ...o };
|
|
1601
|
+
return delete f[r], f;
|
|
1602
1602
|
});
|
|
1603
1603
|
}, U = (r) => {
|
|
1604
1604
|
const o = r.target;
|
|
1605
1605
|
if (o.closest(".tag-close-btn")) {
|
|
1606
|
-
if (r.preventDefault(), r.stopPropagation(),
|
|
1606
|
+
if (r.preventDefault(), r.stopPropagation(), m)
|
|
1607
1607
|
return;
|
|
1608
1608
|
k(null), e ? e() : n.current && (n.current.innerHTML = "", n.current.focus());
|
|
1609
1609
|
return;
|
|
1610
1610
|
}
|
|
1611
|
-
if (
|
|
1611
|
+
if (m) {
|
|
1612
1612
|
const b = o.closest(".tag-node"), R = o.closest('[data-type="text"]');
|
|
1613
1613
|
if (b || R) {
|
|
1614
1614
|
r.preventDefault(), r.stopPropagation();
|
|
@@ -1645,7 +1645,7 @@ const ht = ({
|
|
|
1645
1645
|
V && V.removeAllRanges();
|
|
1646
1646
|
return;
|
|
1647
1647
|
}
|
|
1648
|
-
if (
|
|
1648
|
+
if (m && o.closest(".tag-node")) {
|
|
1649
1649
|
r.preventDefault(), r.stopPropagation();
|
|
1650
1650
|
const j = window.getSelection();
|
|
1651
1651
|
j && j.removeAllRanges();
|
|
@@ -1674,35 +1674,35 @@ const ht = ({
|
|
|
1674
1674
|
return;
|
|
1675
1675
|
}
|
|
1676
1676
|
}, I = (r) => {
|
|
1677
|
-
const
|
|
1678
|
-
if (
|
|
1677
|
+
const f = r.target.closest('[data-type="variable"]');
|
|
1678
|
+
if (f) {
|
|
1679
1679
|
const q = window.getSelection();
|
|
1680
1680
|
if (q) {
|
|
1681
|
-
const b = document.createRange(), R =
|
|
1681
|
+
const b = document.createRange(), R = f.textContent || "";
|
|
1682
1682
|
if (R.replace(/\u200B/g, "")) {
|
|
1683
1683
|
let V = 0, j = R.length;
|
|
1684
1684
|
R.startsWith("") && (V = 1), R.endsWith("") && R.length > 1 && (j = R.length - 1);
|
|
1685
|
-
const G =
|
|
1686
|
-
G && G.nodeType === Node.TEXT_NODE ? (b.setStart(G, V), b.setEnd(G, j)) : b.selectNodeContents(
|
|
1685
|
+
const G = f.firstChild;
|
|
1686
|
+
G && G.nodeType === Node.TEXT_NODE ? (b.setStart(G, V), b.setEnd(G, j)) : b.selectNodeContents(f);
|
|
1687
1687
|
} else
|
|
1688
|
-
b.selectNodeContents(
|
|
1688
|
+
b.selectNodeContents(f), b.collapse(!0);
|
|
1689
1689
|
q.removeAllRanges(), q.addRange(b);
|
|
1690
1690
|
}
|
|
1691
1691
|
}
|
|
1692
1692
|
}, B = () => {
|
|
1693
1693
|
if (t.length === 0) {
|
|
1694
1694
|
if (n.current) {
|
|
1695
|
-
const
|
|
1696
|
-
D(
|
|
1695
|
+
const f = !(n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "");
|
|
1696
|
+
D(f), M(!f);
|
|
1697
1697
|
}
|
|
1698
1698
|
return;
|
|
1699
1699
|
}
|
|
1700
|
-
if (be(n), n.current && n.current.querySelectorAll('[data-type="variable"]').forEach((
|
|
1701
|
-
const q =
|
|
1700
|
+
if (be(n), n.current && n.current.querySelectorAll('[data-type="variable"]').forEach((f) => {
|
|
1701
|
+
const q = f.querySelector(".variable-info-icon");
|
|
1702
1702
|
if (q) {
|
|
1703
1703
|
let b = !1;
|
|
1704
1704
|
const R = document.createTreeWalker(
|
|
1705
|
-
|
|
1705
|
+
f,
|
|
1706
1706
|
NodeFilter.SHOW_TEXT,
|
|
1707
1707
|
{
|
|
1708
1708
|
acceptNode: (A) => q.contains(A) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
|
|
@@ -1718,7 +1718,7 @@ const ht = ({
|
|
|
1718
1718
|
}), ve(n, t, x), we(n, t, x, M), !n.current) return;
|
|
1719
1719
|
t.filter((o) => o.type === "multi-variable" && o.key).forEach((o) => {
|
|
1720
1720
|
if (!o.key) return;
|
|
1721
|
-
const
|
|
1721
|
+
const f = o.maxCount || 9, q = X[o.key] || 1, b = [];
|
|
1722
1722
|
for (let G = 0; G < q; G++) {
|
|
1723
1723
|
const ne = `${o.key}_${G}`, Q = n.current.querySelector(
|
|
1724
1724
|
`[data-type="variable"][data-key="${ne}"][data-multi-key="${o.key}"]`
|
|
@@ -1776,7 +1776,7 @@ const ht = ({
|
|
|
1776
1776
|
const G = q - 1, ne = `${o.key}_${G}`, Q = n.current.querySelector(
|
|
1777
1777
|
`[data-type="variable"][data-key="${ne}"][data-multi-key="${o.key}"]`
|
|
1778
1778
|
);
|
|
1779
|
-
if (Q && Q.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && q <
|
|
1779
|
+
if (Q && Q.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && q < f) {
|
|
1780
1780
|
const oe = window.getSelection();
|
|
1781
1781
|
if (oe && oe.rangeCount > 0) {
|
|
1782
1782
|
const H = oe.getRangeAt(0), ae = H.startContainer, ce = ae.nodeType === Node.ELEMENT_NODE ? ae.closest('[data-type="variable"][data-multi-key]') : ae.parentElement?.closest('[data-type="variable"][data-multi-key]');
|
|
@@ -1813,9 +1813,9 @@ const ht = ({
|
|
|
1813
1813
|
}
|
|
1814
1814
|
const o = window.getSelection();
|
|
1815
1815
|
if (o && o.rangeCount > 0) {
|
|
1816
|
-
const
|
|
1816
|
+
const f = o.anchorNode;
|
|
1817
1817
|
let q = null;
|
|
1818
|
-
if (
|
|
1818
|
+
if (f && (f.nodeType === Node.ELEMENT_NODE ? q = f.closest('[data-type="text"]') : f.nodeType === Node.TEXT_NODE && f.parentElement && (q = f.parentElement.closest('[data-type="text"]'))), q) {
|
|
1819
1819
|
if (r.preventDefault(), r.stopPropagation(), n.current) {
|
|
1820
1820
|
const b = n.current.querySelector(
|
|
1821
1821
|
'[data-type="variable"], [data-type="upload"]'
|
|
@@ -1825,10 +1825,10 @@ const ht = ({
|
|
|
1825
1825
|
return;
|
|
1826
1826
|
}
|
|
1827
1827
|
}
|
|
1828
|
-
if (
|
|
1829
|
-
const
|
|
1828
|
+
if (m && o && o.rangeCount > 0) {
|
|
1829
|
+
const f = o.anchorNode;
|
|
1830
1830
|
let q = null;
|
|
1831
|
-
if (
|
|
1831
|
+
if (f && (f.nodeType === Node.ELEMENT_NODE ? q = f.closest(".tag-node") : f.nodeType === Node.TEXT_NODE && f.parentElement && (q = f.parentElement.closest(".tag-node"))), q) {
|
|
1832
1832
|
if (r.preventDefault(), r.stopPropagation(), n.current) {
|
|
1833
1833
|
const b = n.current.querySelector(
|
|
1834
1834
|
'[data-type="variable"], [data-type="upload"]'
|
|
@@ -1839,17 +1839,17 @@ const ht = ({
|
|
|
1839
1839
|
}
|
|
1840
1840
|
}
|
|
1841
1841
|
if (r.key === "Enter" && !r.shiftKey && (r.preventDefault(), ee()), r.key === "Escape" && n.current) {
|
|
1842
|
-
if (
|
|
1842
|
+
if (m) {
|
|
1843
1843
|
r.preventDefault();
|
|
1844
1844
|
return;
|
|
1845
1845
|
}
|
|
1846
1846
|
n.current.innerHTML = "", n.current.focus();
|
|
1847
1847
|
}
|
|
1848
1848
|
if (r.key === "Backspace") {
|
|
1849
|
-
const
|
|
1850
|
-
if (
|
|
1851
|
-
const q =
|
|
1852
|
-
if (
|
|
1849
|
+
const f = window.getSelection();
|
|
1850
|
+
if (f && f.rangeCount > 0) {
|
|
1851
|
+
const q = f.getRangeAt(0), b = f.anchorNode;
|
|
1852
|
+
if (m) {
|
|
1853
1853
|
let A = null, V = null;
|
|
1854
1854
|
if (b && (b.nodeType === Node.ELEMENT_NODE ? (A = b.closest(".tag-node"), V = b.closest('[data-type="text"]')) : b.nodeType === Node.TEXT_NODE && b.parentElement && (A = b.parentElement.closest(".tag-node"), V = b.parentElement.closest('[data-type="text"]'))), (A || V) && q.collapsed && q.startOffset === 0) {
|
|
1855
1855
|
r.preventDefault();
|
|
@@ -1890,7 +1890,7 @@ const ht = ({
|
|
|
1890
1890
|
}
|
|
1891
1891
|
const r = n.current;
|
|
1892
1892
|
let o = "";
|
|
1893
|
-
const
|
|
1893
|
+
const f = {}, q = (R) => {
|
|
1894
1894
|
if (!(R.nodeType === Node.ELEMENT_NODE && R.style.display === "none")) {
|
|
1895
1895
|
if (R.nodeType === Node.TEXT_NODE)
|
|
1896
1896
|
o += (R.textContent || "").replace(/\u200B/g, "");
|
|
@@ -1914,14 +1914,14 @@ const ht = ({
|
|
|
1914
1914
|
if (Q) {
|
|
1915
1915
|
const re = A.dataset.multiKey;
|
|
1916
1916
|
if (re) {
|
|
1917
|
-
|
|
1918
|
-
const oe =
|
|
1917
|
+
(!f[re] || !Array.isArray(f[re])) && (f[re] = []);
|
|
1918
|
+
const oe = f[re];
|
|
1919
1919
|
oe.push(Q), oe.length > 1 && (o += " "), o += Q;
|
|
1920
1920
|
} else
|
|
1921
|
-
|
|
1921
|
+
f[j] = Q, o += Q;
|
|
1922
1922
|
}
|
|
1923
1923
|
} else if (V === "upload" && j)
|
|
1924
|
-
|
|
1924
|
+
f[j] = x[j] ?? null, x[j] && (o += ` [附带文件: ${x[j]?.name}] `);
|
|
1925
1925
|
else {
|
|
1926
1926
|
if (A.classList.contains("tag-close-btn") || A.classList.contains("file-remove-btn")) return;
|
|
1927
1927
|
A.getAttribute("contenteditable") === "false" && !V && A.classList.contains("tag-node") ? o += A.innerText : A.childNodes.forEach(q);
|
|
@@ -1931,8 +1931,8 @@ const ht = ({
|
|
|
1931
1931
|
};
|
|
1932
1932
|
if (r.childNodes.forEach(q), o = o.trim(), !o) return;
|
|
1933
1933
|
const b = new FormData();
|
|
1934
|
-
b.append("fullPrompt", o), Object.keys(
|
|
1935
|
-
const A =
|
|
1934
|
+
b.append("fullPrompt", o), Object.keys(f).forEach((R) => {
|
|
1935
|
+
const A = f[R];
|
|
1936
1936
|
A != null && (A instanceof File ? b.append(R, A) : Array.isArray(A) ? t.some(
|
|
1937
1937
|
(j) => j.type === "multi-variable" && j.key === R
|
|
1938
1938
|
) ? A.forEach((j) => {
|
|
@@ -2029,7 +2029,7 @@ const ht = ({
|
|
|
2029
2029
|
return null;
|
|
2030
2030
|
let r = "";
|
|
2031
2031
|
return g.type === "upload" ? r = t.find(
|
|
2032
|
-
(
|
|
2032
|
+
(f) => f.type === "upload" && f.key === g.key
|
|
2033
2033
|
)?.tooltip || "" : g.type === "tag" ? r = g.anchorEl.dataset.tooltip || "" : g.type === "upload-label" ? r = g.anchorEl.dataset.fileName || "" : g.type === "variable" && (r = g.anchorEl.dataset.tooltip || ""), Xe(
|
|
2034
2034
|
/* @__PURE__ */ u.jsx(
|
|
2035
2035
|
Me,
|
|
@@ -2098,7 +2098,7 @@ const gt = ({
|
|
|
2098
2098
|
animationSpeed: c = 100,
|
|
2099
2099
|
autoPlay: s = !0,
|
|
2100
2100
|
value: l,
|
|
2101
|
-
onChange:
|
|
2101
|
+
onChange: m,
|
|
2102
2102
|
...T
|
|
2103
2103
|
}) => {
|
|
2104
2104
|
const [y, e] = z(""), [a, N] = z(0), [d, C] = z(!1), [n, S] = z(!1), [x, h] = z(!1), v = Y(void 0), $ = Y(void 0), g = Y(t), k = Y(a), w = Y(n), L = Y(y);
|
|
@@ -2144,7 +2144,7 @@ const gt = ({
|
|
|
2144
2144
|
}, D = (E) => {
|
|
2145
2145
|
S(!1), !l && t.length > 0 && (e(""), N(0)), T.onBlur?.(E);
|
|
2146
2146
|
}, X = (E) => {
|
|
2147
|
-
|
|
2147
|
+
m?.(E.target.value), T.onChange?.(E);
|
|
2148
2148
|
}, Z = () => n || l ? p : y || p;
|
|
2149
2149
|
return /* @__PURE__ */ u.jsxs("div", { style: { position: "relative" }, children: [
|
|
2150
2150
|
/* @__PURE__ */ u.jsx(
|
|
@@ -2265,7 +2265,7 @@ const xt = ({
|
|
|
2265
2265
|
// 是否自动播放动画
|
|
2266
2266
|
value: l = "",
|
|
2267
2267
|
// 受控模式的值
|
|
2268
|
-
onChange:
|
|
2268
|
+
onChange: m,
|
|
2269
2269
|
// 受控模式的变化回调
|
|
2270
2270
|
onSubmit: T,
|
|
2271
2271
|
// 提交回调
|
|
@@ -2289,18 +2289,18 @@ const xt = ({
|
|
|
2289
2289
|
X.current = t, Z.current = h, E.current = k, _.current = S;
|
|
2290
2290
|
});
|
|
2291
2291
|
const U = F((r, o) => {
|
|
2292
|
-
let
|
|
2292
|
+
let f = 0;
|
|
2293
2293
|
O(!0);
|
|
2294
2294
|
const q = () => {
|
|
2295
|
-
|
|
2295
|
+
f < r.length ? (x(r.slice(0, f + 1)), f++, D.current = window.setTimeout(q, c)) : (O(!1), o?.());
|
|
2296
2296
|
};
|
|
2297
2297
|
q();
|
|
2298
2298
|
}, [c]), le = F((r) => {
|
|
2299
2299
|
let o = _.current.length;
|
|
2300
|
-
const
|
|
2301
|
-
o > 0 ? (x(_.current.slice(0, o - 1)), o--, D.current = window.setTimeout(
|
|
2300
|
+
const f = () => {
|
|
2301
|
+
o > 0 ? (x(_.current.slice(0, o - 1)), o--, D.current = window.setTimeout(f, c / 2)) : r?.();
|
|
2302
2302
|
};
|
|
2303
|
-
|
|
2303
|
+
f();
|
|
2304
2304
|
}, [c]), ie = F(() => {
|
|
2305
2305
|
if (X.current.length === 0 || E.current) return;
|
|
2306
2306
|
g(!0);
|
|
@@ -2328,20 +2328,20 @@ const xt = ({
|
|
|
2328
2328
|
w(!1), !l && t.length > 0 && (x(""), v(0)), n.onBlur?.(r);
|
|
2329
2329
|
}, B = (r) => {
|
|
2330
2330
|
const o = r.target.value;
|
|
2331
|
-
y && o.length > y || (
|
|
2331
|
+
y && o.length > y || (m ? m(o) : P(o), n.onChange?.(r));
|
|
2332
2332
|
}, J = () => {
|
|
2333
|
-
const r =
|
|
2334
|
-
r.trim() && !N && (T?.(r),
|
|
2333
|
+
const r = m ? l : M;
|
|
2334
|
+
r.trim() && !N && (T?.(r), m || P(""));
|
|
2335
2335
|
}, se = (r) => {
|
|
2336
2336
|
(r.ctrlKey || r.metaKey) && r.key === "Enter" && (r.preventDefault(), J()), n.onKeyDown?.(r);
|
|
2337
|
-
}, ee =
|
|
2337
|
+
}, ee = m ? l : M, de = N || !ee.trim() || (y ? ee.length > y : !1);
|
|
2338
2338
|
return /* @__PURE__ */ u.jsxs("div", { style: { position: "relative", ...C }, children: [
|
|
2339
2339
|
/* @__PURE__ */ u.jsxs("div", { style: { position: "relative" }, children: [
|
|
2340
2340
|
/* @__PURE__ */ u.jsx(
|
|
2341
2341
|
"textarea",
|
|
2342
2342
|
{
|
|
2343
2343
|
ref: K,
|
|
2344
|
-
value:
|
|
2344
|
+
value: m ? l : M,
|
|
2345
2345
|
onChange: B,
|
|
2346
2346
|
onFocus: (r) => {
|
|
2347
2347
|
r.target.style.borderColor = "#1890ff", r.target.style.boxShadow = "0 0 0 2px rgba(24, 144, 255, 0.2)", i(r);
|
|
@@ -2561,7 +2561,7 @@ const Re = ({
|
|
|
2561
2561
|
height: s,
|
|
2562
2562
|
videoWidth: l,
|
|
2563
2563
|
// 参数保留但不使用,由CSS控制
|
|
2564
|
-
videoHeight:
|
|
2564
|
+
videoHeight: m,
|
|
2565
2565
|
// 参数保留但不使用,由CSS控制
|
|
2566
2566
|
showPlayButton: T = !0,
|
|
2567
2567
|
autoPlayOnHover: y = !0,
|
|
@@ -2757,7 +2757,7 @@ const bt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
2757
2757
|
xl: 5,
|
|
2758
2758
|
xxl: 6
|
|
2759
2759
|
},
|
|
2760
|
-
className:
|
|
2760
|
+
className: m,
|
|
2761
2761
|
style: T,
|
|
2762
2762
|
onClick: y
|
|
2763
2763
|
}) => {
|
|
@@ -2800,7 +2800,7 @@ const bt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
2800
2800
|
"div",
|
|
2801
2801
|
{
|
|
2802
2802
|
ref: e,
|
|
2803
|
-
className: `waterfall-container ${
|
|
2803
|
+
className: `waterfall-container ${m || ""}`,
|
|
2804
2804
|
style: {
|
|
2805
2805
|
position: "relative",
|
|
2806
2806
|
width: "100%",
|