@ibiz-template-plugin/ai-chat 0.0.109 → 0.0.110
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 +171 -153
- package/dist/index.legacy.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/interface/i-chat-options/i-chat-options.d.ts +7 -0
- package/dist/types/interface/i-speech-recognition/i-speech-recognition.d.ts +14 -0
- package/dist/types/interface/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -581,7 +581,7 @@ function Qa(n) {
|
|
|
581
581
|
};
|
|
582
582
|
}
|
|
583
583
|
function _o(n, e, t, i, r, s, o, a, l, c) {
|
|
584
|
-
var d, u, f, p, m, v, y, g, b, S, w, C, x, T, N, E,
|
|
584
|
+
var d, u, f, p, m, v, y, g, b, S, w, C, x, T, N, E, O, z = e.type;
|
|
585
585
|
if (e.constructor != null)
|
|
586
586
|
return null;
|
|
587
587
|
128 & t.__u && (l = !!(32 & t.__u), s = [a = e.__e = t.__e]), (d = B.__b) && d(e);
|
|
@@ -619,8 +619,8 @@ function _o(n, e, t, i, r, s, o, a, l, c) {
|
|
|
619
619
|
a = a.nextSibling;
|
|
620
620
|
s[s.indexOf(a)] = null, e.__e = a;
|
|
621
621
|
} else {
|
|
622
|
-
for (
|
|
623
|
-
Mo(s[
|
|
622
|
+
for (O = s.length; O--; )
|
|
623
|
+
Mo(s[O]);
|
|
624
624
|
Bs(e);
|
|
625
625
|
}
|
|
626
626
|
else
|
|
@@ -1387,7 +1387,7 @@ class xn {
|
|
|
1387
1387
|
* @memberof TextUtil
|
|
1388
1388
|
*/
|
|
1389
1389
|
M(xn, "element", null);
|
|
1390
|
-
const
|
|
1390
|
+
const $ = class $ {
|
|
1391
1391
|
/**
|
|
1392
1392
|
* 检查数据库是否存在
|
|
1393
1393
|
*
|
|
@@ -1410,7 +1410,7 @@ const O = class O {
|
|
|
1410
1410
|
*/
|
|
1411
1411
|
static async deleteDatabase(e) {
|
|
1412
1412
|
var t, i;
|
|
1413
|
-
return
|
|
1413
|
+
return $.lastLink && ((i = (t = $.lastLink).close) == null || i.call(t)), new Promise((r, s) => {
|
|
1414
1414
|
const o = indexedDB.deleteDatabase(e);
|
|
1415
1415
|
o.onsuccess = () => {
|
|
1416
1416
|
r(!0);
|
|
@@ -1432,13 +1432,13 @@ const O = class O {
|
|
|
1432
1432
|
* @memberof IndexedDBUtil
|
|
1433
1433
|
*/
|
|
1434
1434
|
static async checkTableExists(e, t) {
|
|
1435
|
-
return await
|
|
1435
|
+
return await $.checkDataBaseExists(e) ? new Promise((r, s) => {
|
|
1436
1436
|
const o = indexedDB.open(e);
|
|
1437
1437
|
o.onupgradeneeded = (a) => {
|
|
1438
|
-
|
|
1438
|
+
$.db = a.target.result, $.version = $.db.version;
|
|
1439
1439
|
}, o.onsuccess = (a) => {
|
|
1440
|
-
|
|
1441
|
-
const l =
|
|
1440
|
+
$.db = a.target.result, $.lastLink = o.result;
|
|
1441
|
+
const l = $.db.objectStoreNames.contains(t);
|
|
1442
1442
|
o.result.close(), r(l);
|
|
1443
1443
|
}, o.onerror = (a) => {
|
|
1444
1444
|
s(a.target.error);
|
|
@@ -1457,15 +1457,15 @@ const O = class O {
|
|
|
1457
1457
|
static async createTable(e, t, i, r = !1) {
|
|
1458
1458
|
return new Promise((s) => {
|
|
1459
1459
|
var a, l;
|
|
1460
|
-
|
|
1461
|
-
const o = indexedDB.open(e,
|
|
1460
|
+
$.version += 1, $.lastLink && ((l = (a = $.lastLink).close) == null || l.call(a));
|
|
1461
|
+
const o = indexedDB.open(e, $.version);
|
|
1462
1462
|
o.onupgradeneeded = (c) => {
|
|
1463
|
-
if (
|
|
1463
|
+
if ($.db = c.target.result, !$.db.objectStoreNames.contains(t)) {
|
|
1464
1464
|
const d = {};
|
|
1465
|
-
i ? d.keyPath = i : r && (d.autoIncrement = !0),
|
|
1465
|
+
i ? d.keyPath = i : r && (d.autoIncrement = !0), $.db.createObjectStore(t, d);
|
|
1466
1466
|
}
|
|
1467
1467
|
}, o.onsuccess = () => {
|
|
1468
|
-
|
|
1468
|
+
$.lastLink = o.result, o.result.close(), s(!0);
|
|
1469
1469
|
}, o.onerror = () => {
|
|
1470
1470
|
s(!1);
|
|
1471
1471
|
};
|
|
@@ -1481,12 +1481,12 @@ const O = class O {
|
|
|
1481
1481
|
static async deleteTable(e, t) {
|
|
1482
1482
|
return new Promise((i) => {
|
|
1483
1483
|
var s, o;
|
|
1484
|
-
|
|
1485
|
-
const r = indexedDB.open(e,
|
|
1484
|
+
$.version += 1, $.lastLink && ((o = (s = $.lastLink).close) == null || o.call(s));
|
|
1485
|
+
const r = indexedDB.open(e, $.version);
|
|
1486
1486
|
r.onupgradeneeded = (a) => {
|
|
1487
|
-
|
|
1487
|
+
$.db = a.target.result, $.lastLink = r.result, $.db.objectStoreNames.contains(t) && $.db.deleteObjectStore(t);
|
|
1488
1488
|
}, r.onsuccess = (a) => {
|
|
1489
|
-
|
|
1489
|
+
$.db = a.target.result, $.lastLink = r.result, r.result.close(), i(!0);
|
|
1490
1490
|
}, r.onerror = () => {
|
|
1491
1491
|
r.result.close(), i(!1);
|
|
1492
1492
|
};
|
|
@@ -1504,8 +1504,8 @@ const O = class O {
|
|
|
1504
1504
|
return new Promise((r, s) => {
|
|
1505
1505
|
const o = indexedDB.open(e);
|
|
1506
1506
|
o.onsuccess = (a) => {
|
|
1507
|
-
if (
|
|
1508
|
-
const d =
|
|
1507
|
+
if ($.db = a.target.result, $.lastLink = o.result, $.db.objectStoreNames.contains(t)) {
|
|
1508
|
+
const d = $.db.transaction(
|
|
1509
1509
|
[t],
|
|
1510
1510
|
"readwrite"
|
|
1511
1511
|
).objectStore(t).add(i);
|
|
@@ -1533,8 +1533,8 @@ const O = class O {
|
|
|
1533
1533
|
return new Promise((r, s) => {
|
|
1534
1534
|
const o = indexedDB.open(e);
|
|
1535
1535
|
o.onsuccess = (a) => {
|
|
1536
|
-
if (
|
|
1537
|
-
const d =
|
|
1536
|
+
if ($.db = a.target.result, $.lastLink = o.result, $.db.objectStoreNames.contains(t)) {
|
|
1537
|
+
const d = $.db.transaction(
|
|
1538
1538
|
[t],
|
|
1539
1539
|
"readwrite"
|
|
1540
1540
|
).objectStore(t).delete(i);
|
|
@@ -1562,8 +1562,8 @@ const O = class O {
|
|
|
1562
1562
|
return new Promise((r, s) => {
|
|
1563
1563
|
const o = indexedDB.open(e);
|
|
1564
1564
|
o.onsuccess = (a) => {
|
|
1565
|
-
if (
|
|
1566
|
-
const d =
|
|
1565
|
+
if ($.db = a.target.result, $.lastLink = o.result, $.db.objectStoreNames.contains(t)) {
|
|
1566
|
+
const d = $.db.transaction(
|
|
1567
1567
|
[t],
|
|
1568
1568
|
"readwrite"
|
|
1569
1569
|
).objectStore(t).put(i);
|
|
@@ -1591,8 +1591,8 @@ const O = class O {
|
|
|
1591
1591
|
return new Promise((r, s) => {
|
|
1592
1592
|
const o = indexedDB.open(e);
|
|
1593
1593
|
o.onsuccess = (a) => {
|
|
1594
|
-
if (
|
|
1595
|
-
const d =
|
|
1594
|
+
if ($.db = a.target.result, $.lastLink = o.result, $.db.objectStoreNames.contains(t)) {
|
|
1595
|
+
const d = $.db.transaction(
|
|
1596
1596
|
[t],
|
|
1597
1597
|
"readonly"
|
|
1598
1598
|
).objectStore(t).get(i);
|
|
@@ -1619,8 +1619,8 @@ const O = class O {
|
|
|
1619
1619
|
return new Promise((i, r) => {
|
|
1620
1620
|
const s = indexedDB.open(e);
|
|
1621
1621
|
s.onsuccess = (o) => {
|
|
1622
|
-
if (
|
|
1623
|
-
const c =
|
|
1622
|
+
if ($.db = o.target.result, $.lastLink = s.result, $.db.objectStoreNames.contains(t)) {
|
|
1623
|
+
const c = $.db.transaction(
|
|
1624
1624
|
[t],
|
|
1625
1625
|
"readonly"
|
|
1626
1626
|
).objectStore(t).getAll();
|
|
@@ -1638,10 +1638,10 @@ const O = class O {
|
|
|
1638
1638
|
}
|
|
1639
1639
|
};
|
|
1640
1640
|
// 数据库版本
|
|
1641
|
-
M(
|
|
1642
|
-
M(
|
|
1643
|
-
M(
|
|
1644
|
-
let dt =
|
|
1641
|
+
M($, "version", 1), // 数据库连接句柄
|
|
1642
|
+
M($, "db", null), // 上一个连接
|
|
1643
|
+
M($, "lastLink");
|
|
1644
|
+
let dt = $;
|
|
1645
1645
|
class vg {
|
|
1646
1646
|
/**
|
|
1647
1647
|
* Creates an instance of FileUploader.
|
|
@@ -4655,7 +4655,7 @@ const Ce = new F("chat-single-select"), Uo = (n) => {
|
|
|
4655
4655
|
}, []);
|
|
4656
4656
|
const E = (j) => {
|
|
4657
4657
|
g(j.value), d == null || d(j.value), C(!1);
|
|
4658
|
-
},
|
|
4658
|
+
}, O = (j) => {
|
|
4659
4659
|
v.value = j;
|
|
4660
4660
|
}, z = async (j) => {
|
|
4661
4661
|
try {
|
|
@@ -4715,7 +4715,7 @@ const Ce = new F("chat-single-select"), Uo = (n) => {
|
|
|
4715
4715
|
autoFocus: !0,
|
|
4716
4716
|
value: v.value,
|
|
4717
4717
|
onEnter: z,
|
|
4718
|
-
onChange:
|
|
4718
|
+
onChange: O
|
|
4719
4719
|
}
|
|
4720
4720
|
) }) : null,
|
|
4721
4721
|
/* @__PURE__ */ h("ul", { className: Ce.em("dropdown", "list"), children: K() })
|
|
@@ -4738,9 +4738,9 @@ const Me = new F("chat-multiple-select"), Su = (n) => {
|
|
|
4738
4738
|
}, [e]), L(() => {
|
|
4739
4739
|
S(t);
|
|
4740
4740
|
}, [t]), L(() => {
|
|
4741
|
-
const E = (
|
|
4741
|
+
const E = (O) => {
|
|
4742
4742
|
var z, K;
|
|
4743
|
-
|
|
4743
|
+
O.stopPropagation(), !(O.target && ((z = d.current) != null && z.contains(O.target))) && ((K = c.current) != null && K.contains(O.target) ? p((U) => !U) : p(!1));
|
|
4744
4744
|
};
|
|
4745
4745
|
return document.addEventListener("mousedown", E), () => {
|
|
4746
4746
|
document.removeEventListener("mousedown", E);
|
|
@@ -4752,19 +4752,19 @@ const Me = new F("chat-multiple-select"), Su = (n) => {
|
|
|
4752
4752
|
}, C = (E) => {
|
|
4753
4753
|
u.value = E;
|
|
4754
4754
|
}, x = (E) => {
|
|
4755
|
-
const
|
|
4755
|
+
const O = new Set(e || []), z = [], K = [];
|
|
4756
4756
|
for (const U of E)
|
|
4757
|
-
|
|
4757
|
+
O.has(U.value) ? z.push(U) : K.push(U);
|
|
4758
4758
|
return [...z, ...K];
|
|
4759
4759
|
}, T = async (E) => {
|
|
4760
4760
|
try {
|
|
4761
4761
|
v(!0);
|
|
4762
|
-
let
|
|
4763
|
-
l ? (
|
|
4762
|
+
let O = [];
|
|
4763
|
+
l ? (O = await l(E), O = x(O)) : O = t.filter(
|
|
4764
4764
|
(z) => z.label.toLowerCase().includes(E.toLowerCase())
|
|
4765
|
-
), S(
|
|
4766
|
-
} catch (
|
|
4767
|
-
S([]), console.error(k.t.value("searchFailed"),
|
|
4765
|
+
), S(O);
|
|
4766
|
+
} catch (O) {
|
|
4767
|
+
S([]), console.error(k.t.value("searchFailed"), O);
|
|
4768
4768
|
} finally {
|
|
4769
4769
|
v(!1);
|
|
4770
4770
|
}
|
|
@@ -10451,7 +10451,7 @@ class kr {
|
|
|
10451
10451
|
return V.between(e.resolve(this.anchor), e.resolve(this.head));
|
|
10452
10452
|
}
|
|
10453
10453
|
}
|
|
10454
|
-
class
|
|
10454
|
+
class R extends W {
|
|
10455
10455
|
/**
|
|
10456
10456
|
Create a node selection. Does not verify the validity of its
|
|
10457
10457
|
argument.
|
|
@@ -10462,13 +10462,13 @@ class $ extends W {
|
|
|
10462
10462
|
}
|
|
10463
10463
|
map(e, t) {
|
|
10464
10464
|
let { deleted: i, pos: r } = t.mapResult(this.anchor), s = e.resolve(r);
|
|
10465
|
-
return i ? W.near(s) : new
|
|
10465
|
+
return i ? W.near(s) : new R(s);
|
|
10466
10466
|
}
|
|
10467
10467
|
content() {
|
|
10468
10468
|
return new I(_.from(this.node), 0, 0);
|
|
10469
10469
|
}
|
|
10470
10470
|
eq(e) {
|
|
10471
|
-
return e instanceof
|
|
10471
|
+
return e instanceof R && e.anchor == this.anchor;
|
|
10472
10472
|
}
|
|
10473
10473
|
toJSON() {
|
|
10474
10474
|
return { type: "node", anchor: this.anchor };
|
|
@@ -10482,13 +10482,13 @@ class $ extends W {
|
|
|
10482
10482
|
static fromJSON(e, t) {
|
|
10483
10483
|
if (typeof t.anchor != "number")
|
|
10484
10484
|
throw new RangeError("Invalid input for NodeSelection.fromJSON");
|
|
10485
|
-
return new
|
|
10485
|
+
return new R(e.resolve(t.anchor));
|
|
10486
10486
|
}
|
|
10487
10487
|
/**
|
|
10488
10488
|
Create a node selection from non-resolved positions.
|
|
10489
10489
|
*/
|
|
10490
10490
|
static create(e, t) {
|
|
10491
|
-
return new
|
|
10491
|
+
return new R(e.resolve(t));
|
|
10492
10492
|
}
|
|
10493
10493
|
/**
|
|
10494
10494
|
Determines whether the given node may be selected as a node
|
|
@@ -10498,8 +10498,8 @@ class $ extends W {
|
|
|
10498
10498
|
return !e.isText && e.type.spec.selectable !== !1;
|
|
10499
10499
|
}
|
|
10500
10500
|
}
|
|
10501
|
-
|
|
10502
|
-
W.jsonID("node",
|
|
10501
|
+
R.prototype.visible = !1;
|
|
10502
|
+
W.jsonID("node", R);
|
|
10503
10503
|
class Go {
|
|
10504
10504
|
constructor(e) {
|
|
10505
10505
|
this.anchor = e;
|
|
@@ -10510,7 +10510,7 @@ class Go {
|
|
|
10510
10510
|
}
|
|
10511
10511
|
resolve(e) {
|
|
10512
10512
|
let t = e.resolve(this.anchor), i = t.nodeAfter;
|
|
10513
|
-
return i &&
|
|
10513
|
+
return i && R.isSelectable(i) ? new R(t) : W.near(t);
|
|
10514
10514
|
}
|
|
10515
10515
|
}
|
|
10516
10516
|
class Ve extends W {
|
|
@@ -10562,8 +10562,8 @@ function on(n, e, t, i, r, s = !1) {
|
|
|
10562
10562
|
for (let o = i - (r > 0 ? 0 : 1); r > 0 ? o < e.childCount : o >= 0; o += r) {
|
|
10563
10563
|
let a = e.child(o);
|
|
10564
10564
|
if (a.isAtom) {
|
|
10565
|
-
if (!s &&
|
|
10566
|
-
return
|
|
10565
|
+
if (!s && R.isSelectable(a))
|
|
10566
|
+
return R.create(n, t - (r < 0 ? a.nodeSize : 0));
|
|
10567
10567
|
} else {
|
|
10568
10568
|
let l = on(n, a, t + r, r < 0 ? a.childCount : 0, r, s);
|
|
10569
10569
|
if (l)
|
|
@@ -11016,13 +11016,13 @@ const A6 = (n, e, t) => {
|
|
|
11016
11016
|
let s = r.nodeBefore;
|
|
11017
11017
|
if (fh(n, r, e, -1))
|
|
11018
11018
|
return !0;
|
|
11019
|
-
if (i.parent.content.size == 0 && (bn(s, "end") ||
|
|
11019
|
+
if (i.parent.content.size == 0 && (bn(s, "end") || R.isSelectable(s)))
|
|
11020
11020
|
for (let o = i.depth; ; o--) {
|
|
11021
11021
|
let a = Sr(n.doc, i.before(o), i.after(o), I.empty);
|
|
11022
11022
|
if (a && a.slice.size < a.to - a.from) {
|
|
11023
11023
|
if (e) {
|
|
11024
11024
|
let l = n.tr.step(a);
|
|
11025
|
-
l.setSelection(bn(s, "end") ? W.findFrom(l.doc.resolve(l.mapping.map(r.pos, -1)), -1) :
|
|
11025
|
+
l.setSelection(bn(s, "end") ? W.findFrom(l.doc.resolve(l.mapping.map(r.pos, -1)), -1) : R.create(l.doc, r.pos - s.nodeSize)), e(l.scrollIntoView());
|
|
11026
11026
|
}
|
|
11027
11027
|
return !0;
|
|
11028
11028
|
}
|
|
@@ -11090,7 +11090,7 @@ const $6 = (n, e, t) => {
|
|
|
11090
11090
|
s = Xo(i);
|
|
11091
11091
|
}
|
|
11092
11092
|
let o = s && s.nodeBefore;
|
|
11093
|
-
return !o ||
|
|
11093
|
+
return !o || !R.isSelectable(o) ? !1 : (e && e(n.tr.setSelection(R.create(n.doc, s.pos - o.nodeSize)).scrollIntoView()), !0);
|
|
11094
11094
|
};
|
|
11095
11095
|
function Xo(n) {
|
|
11096
11096
|
if (!n.parent.type.spec.isolating)
|
|
@@ -11116,12 +11116,12 @@ const R6 = (n, e, t) => {
|
|
|
11116
11116
|
let s = r.nodeAfter;
|
|
11117
11117
|
if (fh(n, r, e, 1))
|
|
11118
11118
|
return !0;
|
|
11119
|
-
if (i.parent.content.size == 0 && (bn(s, "start") ||
|
|
11119
|
+
if (i.parent.content.size == 0 && (bn(s, "start") || R.isSelectable(s))) {
|
|
11120
11120
|
let o = Sr(n.doc, i.before(), i.after(), I.empty);
|
|
11121
11121
|
if (o && o.slice.size < o.to - o.from) {
|
|
11122
11122
|
if (e) {
|
|
11123
11123
|
let a = n.tr.step(o);
|
|
11124
|
-
a.setSelection(bn(s, "start") ? W.findFrom(a.doc.resolve(a.mapping.map(r.pos)), 1) :
|
|
11124
|
+
a.setSelection(bn(s, "start") ? W.findFrom(a.doc.resolve(a.mapping.map(r.pos)), 1) : R.create(a.doc, a.mapping.map(r.pos))), e(a.scrollIntoView());
|
|
11125
11125
|
}
|
|
11126
11126
|
return !0;
|
|
11127
11127
|
}
|
|
@@ -11137,7 +11137,7 @@ const R6 = (n, e, t) => {
|
|
|
11137
11137
|
s = Yo(i);
|
|
11138
11138
|
}
|
|
11139
11139
|
let o = s && s.nodeAfter;
|
|
11140
|
-
return !o ||
|
|
11140
|
+
return !o || !R.isSelectable(o) ? !1 : (e && e(n.tr.setSelection(R.create(n.doc, s.pos)).scrollIntoView()), !0);
|
|
11141
11141
|
};
|
|
11142
11142
|
function Yo(n) {
|
|
11143
11143
|
if (!n.parent.type.spec.isolating)
|
|
@@ -11151,7 +11151,7 @@ function Yo(n) {
|
|
|
11151
11151
|
return null;
|
|
11152
11152
|
}
|
|
11153
11153
|
const L6 = (n, e) => {
|
|
11154
|
-
let t = n.selection, i = t instanceof
|
|
11154
|
+
let t = n.selection, i = t instanceof R, r;
|
|
11155
11155
|
if (i) {
|
|
11156
11156
|
if (t.node.isTextblock || !Qt(n.doc, t.from))
|
|
11157
11157
|
return !1;
|
|
@@ -11160,12 +11160,12 @@ const L6 = (n, e) => {
|
|
|
11160
11160
|
return !1;
|
|
11161
11161
|
if (e) {
|
|
11162
11162
|
let s = n.tr.join(r);
|
|
11163
|
-
i && s.setSelection(
|
|
11163
|
+
i && s.setSelection(R.create(s.doc, r - n.doc.resolve(r).nodeBefore.nodeSize)), e(s.scrollIntoView());
|
|
11164
11164
|
}
|
|
11165
11165
|
return !0;
|
|
11166
11166
|
}, z6 = (n, e) => {
|
|
11167
11167
|
let t = n.selection, i;
|
|
11168
|
-
if (t instanceof
|
|
11168
|
+
if (t instanceof R) {
|
|
11169
11169
|
if (t.node.isTextblock || !Qt(n.doc, t.to))
|
|
11170
11170
|
return !1;
|
|
11171
11171
|
i = t.to;
|
|
@@ -11224,7 +11224,7 @@ const H6 = (n, e) => {
|
|
|
11224
11224
|
return r == null ? !1 : (e && e(n.tr.lift(i, r).scrollIntoView()), !0);
|
|
11225
11225
|
}, j6 = (n, e) => {
|
|
11226
11226
|
let { $from: t, to: i } = n.selection, r, s = t.sharedDepth(i);
|
|
11227
|
-
return s == 0 ? !1 : (r = t.before(s), e && e(n.tr.setSelection(
|
|
11227
|
+
return s == 0 ? !1 : (r = t.before(s), e && e(n.tr.setSelection(R.create(n.doc, r))), !0);
|
|
11228
11228
|
};
|
|
11229
11229
|
function U6(n, e, t) {
|
|
11230
11230
|
let i = e.nodeBefore, r = e.nodeAfter, s = e.index();
|
|
@@ -12884,9 +12884,9 @@ function Zo(n, e = null) {
|
|
|
12884
12884
|
for (l = o; r && !r.node; )
|
|
12885
12885
|
r = r.parent;
|
|
12886
12886
|
let u = r.node;
|
|
12887
|
-
if (r && u.isAtom &&
|
|
12887
|
+
if (r && u.isAtom && R.isSelectable(u) && r.parent && !(u.isInline && o3(t.focusNode, t.focusOffset, r.dom))) {
|
|
12888
12888
|
let f = r.posBefore;
|
|
12889
|
-
c = new
|
|
12889
|
+
c = new R(o == f ? a : i.resolve(f));
|
|
12890
12890
|
}
|
|
12891
12891
|
} else {
|
|
12892
12892
|
if (t instanceof n.dom.ownerDocument.defaultView.Selection && t.rangeCount > 1) {
|
|
@@ -12968,7 +12968,7 @@ function R3(n) {
|
|
|
12968
12968
|
i ? e.collapse(t.parentNode, ge(t) + 1) : e.collapse(t, 0), !i && !n.state.selection.visible && De && xt <= 11 && (t.disabled = !0, t.disabled = !1);
|
|
12969
12969
|
}
|
|
12970
12970
|
function Ih(n, e) {
|
|
12971
|
-
if (e instanceof
|
|
12971
|
+
if (e instanceof R) {
|
|
12972
12972
|
let t = n.docView.descAt(e.from);
|
|
12973
12973
|
t != n.lastSelectedViewDesc && (ac(n), t && t.selectNode(), n.lastSelectedViewDesc = t);
|
|
12974
12974
|
} else
|
|
@@ -13016,18 +13016,18 @@ function cc(n, e, t) {
|
|
|
13016
13016
|
} else if (i.empty) {
|
|
13017
13017
|
if (n.endOfTextblock(e > 0 ? "forward" : "backward")) {
|
|
13018
13018
|
let r = so(n.state, e);
|
|
13019
|
-
return r && r instanceof
|
|
13019
|
+
return r && r instanceof R ? vt(n, r) : !1;
|
|
13020
13020
|
} else if (!(Be && t.indexOf("m") > -1)) {
|
|
13021
13021
|
let r = i.$head, s = r.textOffset ? null : e < 0 ? r.nodeBefore : r.nodeAfter, o;
|
|
13022
13022
|
if (!s || s.isText)
|
|
13023
13023
|
return !1;
|
|
13024
13024
|
let a = e < 0 ? r.pos - s.nodeSize : r.pos;
|
|
13025
|
-
return s.isAtom || (o = n.docView.descAt(a)) && !o.contentDOM ?
|
|
13025
|
+
return s.isAtom || (o = n.docView.descAt(a)) && !o.contentDOM ? R.isSelectable(s) ? vt(n, new R(e < 0 ? n.state.doc.resolve(r.pos - s.nodeSize) : r)) : di ? vt(n, new V(n.state.doc.resolve(e < 0 ? a : a + s.nodeSize))) : !1 : !1;
|
|
13026
13026
|
}
|
|
13027
13027
|
} else
|
|
13028
13028
|
return !1;
|
|
13029
13029
|
else {
|
|
13030
|
-
if (i instanceof
|
|
13030
|
+
if (i instanceof R && i.node.isInline)
|
|
13031
13031
|
return vt(n, new V(e > 0 ? i.$to : i.$from));
|
|
13032
13032
|
{
|
|
13033
13033
|
let r = so(n.state, e);
|
|
@@ -13184,7 +13184,7 @@ function uc(n, e, t) {
|
|
|
13184
13184
|
let { $from: r, $to: s } = i;
|
|
13185
13185
|
if (!r.parent.inlineContent || n.endOfTextblock(e < 0 ? "up" : "down")) {
|
|
13186
13186
|
let o = so(n.state, e);
|
|
13187
|
-
if (o && o instanceof
|
|
13187
|
+
if (o && o instanceof R)
|
|
13188
13188
|
return vt(n, o);
|
|
13189
13189
|
}
|
|
13190
13190
|
if (!r.parent.inlineContent) {
|
|
@@ -13541,22 +13541,22 @@ function i4(n, e) {
|
|
|
13541
13541
|
if (e == -1)
|
|
13542
13542
|
return !1;
|
|
13543
13543
|
let t = n.state.doc.resolve(e), i = t.nodeAfter;
|
|
13544
|
-
return i && i.isAtom &&
|
|
13544
|
+
return i && i.isAtom && R.isSelectable(i) ? (mn(n, new R(t), "pointer"), !0) : !1;
|
|
13545
13545
|
}
|
|
13546
13546
|
function r4(n, e) {
|
|
13547
13547
|
if (e == -1)
|
|
13548
13548
|
return !1;
|
|
13549
13549
|
let t = n.state.selection, i, r;
|
|
13550
|
-
t instanceof
|
|
13550
|
+
t instanceof R && (i = t.node);
|
|
13551
13551
|
let s = n.state.doc.resolve(e);
|
|
13552
13552
|
for (let o = s.depth + 1; o > 0; o--) {
|
|
13553
13553
|
let a = o > s.depth ? s.nodeAfter : s.node(o);
|
|
13554
|
-
if (
|
|
13554
|
+
if (R.isSelectable(a)) {
|
|
13555
13555
|
i && t.$from.depth > 0 && o >= t.$from.depth && s.before(t.$from.depth + 1) == t.$from.pos ? r = s.before(t.$from.depth) : r = s.before(o);
|
|
13556
13556
|
break;
|
|
13557
13557
|
}
|
|
13558
13558
|
}
|
|
13559
|
-
return r != null ? (mn(n,
|
|
13559
|
+
return r != null ? (mn(n, R.create(n.state.doc, r), "pointer"), !0) : !1;
|
|
13560
13560
|
}
|
|
13561
13561
|
function s4(n, e, t, i, r) {
|
|
13562
13562
|
return ia(n, "handleClickOn", e, t, i) || n.someProp("handleClick", (s) => s(n, e, i)) || (r ? r4(n, t) : i4(n, t));
|
|
@@ -13578,8 +13578,8 @@ function l4(n, e, t) {
|
|
|
13578
13578
|
let o = s > r.depth ? r.nodeAfter : r.node(s), a = r.before(s);
|
|
13579
13579
|
if (o.inlineContent)
|
|
13580
13580
|
mn(n, V.create(i, a + 1, a + 1 + o.content.size), "pointer");
|
|
13581
|
-
else if (
|
|
13582
|
-
mn(n,
|
|
13581
|
+
else if (R.isSelectable(o))
|
|
13582
|
+
mn(n, R.create(i, a), "pointer");
|
|
13583
13583
|
else
|
|
13584
13584
|
continue;
|
|
13585
13585
|
return !0;
|
|
@@ -13610,7 +13610,7 @@ class c4 {
|
|
|
13610
13610
|
const a = r ? null : i.target, l = a ? e.docView.nearestDesc(a, !0) : null;
|
|
13611
13611
|
this.target = l && l.nodeDOM.nodeType == 1 ? l.nodeDOM : null;
|
|
13612
13612
|
let { selection: c } = e.state;
|
|
13613
|
-
(i.button == 0 && s.type.spec.draggable && s.type.spec.selectable !== !1 || c instanceof
|
|
13613
|
+
(i.button == 0 && s.type.spec.draggable && s.type.spec.selectable !== !1 || c instanceof R && c.from <= o && c.to > o) && (this.mightDrag = {
|
|
13614
13614
|
node: s,
|
|
13615
13615
|
pos: o,
|
|
13616
13616
|
addAttr: !!(this.target && !this.target.draggable),
|
|
@@ -13796,12 +13796,12 @@ Ee.dragstart = (n, e) => {
|
|
|
13796
13796
|
if (i && i.done(), !t.dataTransfer)
|
|
13797
13797
|
return;
|
|
13798
13798
|
let r = n.state.selection, s = r.empty ? null : n.posAtCoords(Mr(t)), o;
|
|
13799
|
-
if (!(s && s.pos >= r.from && s.pos <= (r instanceof
|
|
13799
|
+
if (!(s && s.pos >= r.from && s.pos <= (r instanceof R ? r.to - 1 : r.to))) {
|
|
13800
13800
|
if (i && i.mightDrag)
|
|
13801
|
-
o =
|
|
13801
|
+
o = R.create(n.state.doc, i.mightDrag.pos);
|
|
13802
13802
|
else if (t.target && t.target.nodeType == 1) {
|
|
13803
13803
|
let u = n.docView.nearestDesc(t.target, !0);
|
|
13804
|
-
u && u.node.type.spec.draggable && u != n.docView && (o =
|
|
13804
|
+
u && u.node.type.spec.draggable && u != n.docView && (o = R.create(n.state.doc, u.posBefore));
|
|
13805
13805
|
}
|
|
13806
13806
|
}
|
|
13807
13807
|
let a = (o || n.state.selection).content(), { dom: l, text: c, slice: d } = ta(n, a);
|
|
@@ -13850,8 +13850,8 @@ function y4(n, e, t) {
|
|
|
13850
13850
|
if (d ? l.replaceRangeWith(c, c, s.content.firstChild) : l.replaceRange(c, c, s), l.doc.eq(u))
|
|
13851
13851
|
return;
|
|
13852
13852
|
let f = l.doc.resolve(c);
|
|
13853
|
-
if (d &&
|
|
13854
|
-
l.setSelection(new
|
|
13853
|
+
if (d && R.isSelectable(s.content.firstChild) && f.nodeAfter && f.nodeAfter.sameMarkup(s.content.firstChild))
|
|
13854
|
+
l.setSelection(new R(f));
|
|
13855
13855
|
else {
|
|
13856
13856
|
let p = l.mapping.map(a);
|
|
13857
13857
|
l.mapping.maps[l.mapping.maps.length - 1].forEach((m, v, y, g) => p = g), l.setSelection(ea(n, f, l.doc.resolve(p)));
|
|
@@ -14641,7 +14641,7 @@ function A4(n, e, t, i, r) {
|
|
|
14641
14641
|
if (n.input.compositionPendingChanges = 0, e < 0) {
|
|
14642
14642
|
let T = n.input.lastSelectionTime > Date.now() - 50 ? n.input.lastSelectionOrigin : null, N = Zo(n, T);
|
|
14643
14643
|
if (N && !n.state.selection.eq(N)) {
|
|
14644
|
-
if (ue && ct && n.input.lastKeyCode === 13 && Date.now() - 100 < n.input.lastKeyCodeTime && n.someProp("handleKeyDown", (
|
|
14644
|
+
if (ue && ct && n.input.lastKeyCode === 13 && Date.now() - 100 < n.input.lastKeyCodeTime && n.someProp("handleKeyDown", (O) => O(n, Rt(13, "Enter"))))
|
|
14645
14645
|
return;
|
|
14646
14646
|
let E = n.state.tr.setSelection(N);
|
|
14647
14647
|
T == "pointer" ? E.setMeta("pointer", !0) : T == "key" && E.scrollIntoView(), s && E.setMeta("composition", s), n.dispatch(E);
|
|
@@ -14878,7 +14878,7 @@ class Gh {
|
|
|
14878
14878
|
let e = this.domSelectionRange().focusNode;
|
|
14879
14879
|
if (!(!e || !this.dom.contains(e.nodeType == 1 ? e : e.parentNode))) {
|
|
14880
14880
|
if (!this.someProp("handleScrollToSelection", (t) => t(this)))
|
|
14881
|
-
if (this.state.selection instanceof
|
|
14881
|
+
if (this.state.selection instanceof R) {
|
|
14882
14882
|
let t = this.docView.domAfterPos(this.state.selection.from);
|
|
14883
14883
|
t.nodeType == 1 && Xl(this, t.getBoundingClientRect(), e);
|
|
14884
14884
|
} else
|
|
@@ -14915,7 +14915,7 @@ class Gh {
|
|
|
14915
14915
|
let s = i.from + (this.state.doc.content.size - t.doc.content.size);
|
|
14916
14916
|
(s > 0 && this.state.doc.nodeAt(s)) == i.node && (r = s);
|
|
14917
14917
|
}
|
|
14918
|
-
this.dragging = new jh(e.slice, e.move, r < 0 ? void 0 :
|
|
14918
|
+
this.dragging = new jh(e.slice, e.move, r < 0 ? void 0 : R.create(this.state.doc, r));
|
|
14919
14919
|
}
|
|
14920
14920
|
someProp(e, t) {
|
|
14921
14921
|
let i = this._props && this._props[e], r;
|
|
@@ -16390,7 +16390,7 @@ function Ar(n, {
|
|
|
16390
16390
|
return !1;
|
|
16391
16391
|
}
|
|
16392
16392
|
function Yv(n) {
|
|
16393
|
-
return n instanceof
|
|
16393
|
+
return n instanceof R;
|
|
16394
16394
|
}
|
|
16395
16395
|
var uf = class hf {
|
|
16396
16396
|
constructor(e) {
|
|
@@ -16478,7 +16478,7 @@ var t8 = (n, e = {}) => ({ tr: t, state: i, dispatch: r }) => {
|
|
|
16478
16478
|
return t.selection.$anchor.sameParent(t.selection.$head) && (o = t.selection.$anchor.parent.attrs), s.isTextblock ? r().command(({ commands: a }) => ql(s, { ...o, ...e })(t) ? !0 : a.clearNodes()).command(({ state: a }) => ql(s, { ...o, ...e })(a, i)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
|
|
16479
16479
|
}, r8 = (n) => ({ tr: e, dispatch: t }) => {
|
|
16480
16480
|
if (t) {
|
|
16481
|
-
const { doc: i } = e, r = zt(n, 0, i.content.size), s =
|
|
16481
|
+
const { doc: i } = e, r = zt(n, 0, i.content.size), s = R.create(i, r);
|
|
16482
16482
|
e.setSelection(s);
|
|
16483
16483
|
}
|
|
16484
16484
|
return !0;
|
|
@@ -16510,7 +16510,7 @@ function $c(n, e) {
|
|
|
16510
16510
|
}
|
|
16511
16511
|
var l8 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor: r }) => {
|
|
16512
16512
|
const { selection: s, doc: o } = e, { $from: a, $to: l } = s, c = r.extensionManager.attributes, d = Hi(c, a.node().type.name, a.node().attrs);
|
|
16513
|
-
if (s instanceof
|
|
16513
|
+
if (s instanceof R && s.node.isBlock)
|
|
16514
16514
|
return !a.parentOffset || !fn(o, a.pos) ? !1 : (i && (n && $c(t, r.extensionManager.splittableMarks), e.split(a.pos).scrollIntoView()), !0);
|
|
16515
16515
|
if (!a.parent.isBlock)
|
|
16516
16516
|
return !1;
|
|
@@ -16998,8 +16998,8 @@ function E8(n) {
|
|
|
16998
16998
|
N8(T, s.find, o).forEach((E) => {
|
|
16999
16999
|
if (E.index === void 0)
|
|
17000
17000
|
return;
|
|
17001
|
-
const
|
|
17002
|
-
from: t.tr.mapping.map(
|
|
17001
|
+
const O = C + E.index + 1, z = O + E[0].length, K = {
|
|
17002
|
+
from: t.tr.mapping.map(O),
|
|
17003
17003
|
to: t.tr.mapping.map(z)
|
|
17004
17004
|
}, U = s.handler({
|
|
17005
17005
|
state: t,
|
|
@@ -18607,14 +18607,14 @@ function V8(n) {
|
|
|
18607
18607
|
const E = T.exec(N);
|
|
18608
18608
|
if (E === null)
|
|
18609
18609
|
break;
|
|
18610
|
-
const
|
|
18610
|
+
const O = E.index, z = E[1];
|
|
18611
18611
|
if (!((m = E[2]) != null && m.endsWith(":::"))) {
|
|
18612
18612
|
if (z)
|
|
18613
18613
|
w += 1;
|
|
18614
18614
|
else if (w -= 1, w === 0) {
|
|
18615
|
-
const K = N.slice(0,
|
|
18615
|
+
const K = N.slice(0, O);
|
|
18616
18616
|
x = K.trim();
|
|
18617
|
-
const U = u.slice(0, C +
|
|
18617
|
+
const U = u.slice(0, C + O + E[0].length);
|
|
18618
18618
|
let j = [];
|
|
18619
18619
|
if (x)
|
|
18620
18620
|
if (a === "block")
|
|
@@ -18745,7 +18745,7 @@ function K8(n, e, t) {
|
|
|
18745
18745
|
for (d += 1; d < a.length; ) {
|
|
18746
18746
|
const C = a[d];
|
|
18747
18747
|
if (C.trim() === "") {
|
|
18748
|
-
const T = a.slice(d + 1).findIndex((
|
|
18748
|
+
const T = a.slice(d + 1).findIndex((O) => O.trim() !== "");
|
|
18749
18749
|
if (T === -1)
|
|
18750
18750
|
break;
|
|
18751
18751
|
if ((((r = (i = a[d + 1 + T].match(/^(\s*)/)) == null ? void 0 : i[1]) == null ? void 0 : r.length) || 0) > v) {
|
|
@@ -18986,7 +18986,7 @@ class ie extends W {
|
|
|
18986
18986
|
for (; ; ) {
|
|
18987
18987
|
let o = t > 0 ? s.firstChild : s.lastChild;
|
|
18988
18988
|
if (!o) {
|
|
18989
|
-
if (s.isAtom && !s.isText &&
|
|
18989
|
+
if (s.isAtom && !s.isText && !R.isSelectable(s)) {
|
|
18990
18990
|
e = e.doc.resolve(r + s.nodeSize * t), i = !1;
|
|
18991
18991
|
continue e;
|
|
18992
18992
|
}
|
|
@@ -19092,7 +19092,7 @@ function iy(n, e, t) {
|
|
|
19092
19092
|
if (!ie.valid(i))
|
|
19093
19093
|
return !1;
|
|
19094
19094
|
let r = n.posAtCoords({ left: t.clientX, top: t.clientY });
|
|
19095
|
-
return r && r.inside > -1 &&
|
|
19095
|
+
return r && r.inside > -1 && R.isSelectable(n.state.doc.nodeAt(r.inside)) ? !1 : (n.dispatch(n.state.tr.setSelection(new ie(i))), !0);
|
|
19096
19096
|
}
|
|
19097
19097
|
function ry(n, e) {
|
|
19098
19098
|
if (e.inputType != "insertCompositionText" || !(n.state.selection instanceof ie))
|
|
@@ -20004,9 +20004,14 @@ const sn = new F("chat-editor"), ya = Ko(
|
|
|
20004
20004
|
t.inputExpand.value = m, m || f();
|
|
20005
20005
|
};
|
|
20006
20006
|
return L(() => {
|
|
20007
|
-
|
|
20008
|
-
|
|
20009
|
-
|
|
20007
|
+
const m = (v) => {
|
|
20008
|
+
var y;
|
|
20009
|
+
(y = c.current) == null || y.commands.setContent(v);
|
|
20010
|
+
};
|
|
20011
|
+
return t.evt.on("onSetInput", m), () => {
|
|
20012
|
+
t.evt.off("onSetInput", m);
|
|
20013
|
+
};
|
|
20014
|
+
}, []), L(() => {
|
|
20010
20015
|
if (!d.current)
|
|
20011
20016
|
return;
|
|
20012
20017
|
const m = async (g) => {
|
|
@@ -21046,8 +21051,8 @@ const Ly = (n) => {
|
|
|
21046
21051
|
const N = d.current.get(C);
|
|
21047
21052
|
if (N && (N.disconnect(), d.current.delete(C)), T && typeof ResizeObserver < "u") {
|
|
21048
21053
|
const E = new ResizeObserver(() => {
|
|
21049
|
-
const
|
|
21050
|
-
|
|
21054
|
+
const O = Math.round(T.offsetHeight);
|
|
21055
|
+
O > 0 && c.current.get(C) !== O && (c.current.set(C, O), l.value += 1);
|
|
21051
21056
|
});
|
|
21052
21057
|
E.observe(T), d.current.set(C, E);
|
|
21053
21058
|
}
|
|
@@ -21060,10 +21065,10 @@ const Ly = (n) => {
|
|
|
21060
21065
|
C[U + 1] = C[U] + (j != null ? j : i(U));
|
|
21061
21066
|
}
|
|
21062
21067
|
const x = C[e] || 0, T = f + p;
|
|
21063
|
-
let N = 0, E = 0,
|
|
21064
|
-
for (; E <=
|
|
21065
|
-
const U = Math.floor((E +
|
|
21066
|
-
C[U] <= f ? (N = U, E = U + 1) :
|
|
21068
|
+
let N = 0, E = 0, O = e - 1;
|
|
21069
|
+
for (; E <= O; ) {
|
|
21070
|
+
const U = Math.floor((E + O) / 2);
|
|
21071
|
+
C[U] <= f ? (N = U, E = U + 1) : O = U - 1;
|
|
21067
21072
|
}
|
|
21068
21073
|
N = Math.max(0, N - r);
|
|
21069
21074
|
let z = N;
|
|
@@ -21098,9 +21103,9 @@ const Ly = (n) => {
|
|
|
21098
21103
|
}
|
|
21099
21104
|
if (E <= 0)
|
|
21100
21105
|
return;
|
|
21101
|
-
const
|
|
21102
|
-
if (
|
|
21103
|
-
const K = C.scrollTop +
|
|
21106
|
+
const O = (z = y.offsets[E]) != null ? z : 0;
|
|
21107
|
+
if (O > 0) {
|
|
21108
|
+
const K = C.scrollTop + O;
|
|
21104
21109
|
o.value = K, C.scrollTop = K;
|
|
21105
21110
|
}
|
|
21106
21111
|
}, [e, S]);
|
|
@@ -21161,7 +21166,7 @@ const In = new F("chat-messages"), ho = (n) => {
|
|
|
21161
21166
|
}
|
|
21162
21167
|
};
|
|
21163
21168
|
Eo(() => {
|
|
21164
|
-
var E,
|
|
21169
|
+
var E, O;
|
|
21165
21170
|
const b = d.current;
|
|
21166
21171
|
if (!b)
|
|
21167
21172
|
return;
|
|
@@ -21178,7 +21183,7 @@ const In = new F("chat-messages"), ho = (n) => {
|
|
|
21178
21183
|
const { messageid: z, offsetWithin: K } = o.current, U = e.value.findIndex(
|
|
21179
21184
|
(j) => j.messageid === z
|
|
21180
21185
|
);
|
|
21181
|
-
U >= 0 && (b.scrollTop = ((
|
|
21186
|
+
U >= 0 && (b.scrollTop = ((O = p[U]) != null ? O : 0) + K);
|
|
21182
21187
|
}
|
|
21183
21188
|
}, [e.value, f, i]);
|
|
21184
21189
|
const y = () => {
|
|
@@ -21946,7 +21951,7 @@ class Hc {
|
|
|
21946
21951
|
* @param {string} input
|
|
21947
21952
|
*/
|
|
21948
21953
|
setInput(e) {
|
|
21949
|
-
this.
|
|
21954
|
+
this.evt.emit("onSetInput", e || "");
|
|
21950
21955
|
}
|
|
21951
21956
|
/**
|
|
21952
21957
|
* @description 当前消息附加agentID(ai助手消息且无metadata属性且存在激活智能体)
|
|
@@ -24467,15 +24472,25 @@ const H = new F("chat-input"), Vc = window.SpeechRecognition || window.webkitSpe
|
|
|
24467
24472
|
const [e, t] = J(!1);
|
|
24468
24473
|
Ao(Dr);
|
|
24469
24474
|
const i = n.controller.input, r = D(!1), s = P(), o = P(null), a = P(null);
|
|
24470
|
-
|
|
24471
|
-
|
|
24472
|
-
|
|
24473
|
-
|
|
24474
|
-
|
|
24475
|
-
|
|
24476
|
-
|
|
24477
|
-
|
|
24478
|
-
|
|
24475
|
+
L(() => {
|
|
24476
|
+
let w = n.controller.opts.speechRecognition;
|
|
24477
|
+
if (!w && Vc && (w = new Vc()), !!w)
|
|
24478
|
+
return w.onstart = () => {
|
|
24479
|
+
r.value = !0;
|
|
24480
|
+
}, w.onend = () => {
|
|
24481
|
+
r.value = !1;
|
|
24482
|
+
}, w.onresult = (C) => {
|
|
24483
|
+
var T, N, E, O;
|
|
24484
|
+
const x = (E = (N = (T = C.results) == null ? void 0 : T[0]) == null ? void 0 : N[0]) == null ? void 0 : E.transcript;
|
|
24485
|
+
x && ((O = o.current) == null || O.commands.insertContent(x));
|
|
24486
|
+
}, s.current = w, () => {
|
|
24487
|
+
try {
|
|
24488
|
+
w.stop(), w.abort();
|
|
24489
|
+
} catch (C) {
|
|
24490
|
+
}
|
|
24491
|
+
w.onstart = null, w.onend = null, w.onresult = null, s.current = void 0, r.value = !1;
|
|
24492
|
+
};
|
|
24493
|
+
}, []);
|
|
24479
24494
|
const l = () => {
|
|
24480
24495
|
s.current && (r.value ? s.current.stop() : s.current.start());
|
|
24481
24496
|
}, c = ye(() => Kn(i.value).length > 0), d = ll(async () => {
|
|
@@ -24736,10 +24751,12 @@ const H = new F("chat-input"), Vc = window.SpeechRecognition || window.webkitSpe
|
|
|
24736
24751
|
const Oe = new F("chat-topic-item"), Qy = Ko(
|
|
24737
24752
|
(n, e) => {
|
|
24738
24753
|
const { hasMoreThanOne: t, controller: i, topic: r, onClick: s, onAction: o } = n, a = P(null), l = ye(() => {
|
|
24739
|
-
var
|
|
24740
|
-
return ((
|
|
24741
|
-
}), [c, d] = J(!1), u = D(
|
|
24742
|
-
|
|
24754
|
+
var x;
|
|
24755
|
+
return ((x = i.activedTopic.value) == null ? void 0 : x.id) === r.id;
|
|
24756
|
+
}), [c, d] = J(!1), u = D(!1), f = D(!1);
|
|
24757
|
+
let p = "";
|
|
24758
|
+
const m = D([]);
|
|
24759
|
+
t ? m.value = [
|
|
24743
24760
|
{
|
|
24744
24761
|
id: "PINNED",
|
|
24745
24762
|
caption: r.isTop ? k.t.value("unpin") : k.t.value("pinTop"),
|
|
@@ -24751,7 +24768,7 @@ const Oe = new F("chat-topic-item"), Qy = Ko(
|
|
|
24751
24768
|
caption: k.t.value("deleteTopic"),
|
|
24752
24769
|
icon: /* @__PURE__ */ h(Lo, {})
|
|
24753
24770
|
}
|
|
24754
|
-
] :
|
|
24771
|
+
] : m.value = [
|
|
24755
24772
|
{
|
|
24756
24773
|
id: "PINNED",
|
|
24757
24774
|
caption: r.isTop ? k.t.value("unpin") : k.t.value("pinTop"),
|
|
@@ -24759,26 +24776,26 @@ const Oe = new F("chat-topic-item"), Qy = Ko(
|
|
|
24759
24776
|
},
|
|
24760
24777
|
{ id: "RENAME", caption: k.t.value("rename"), icon: /* @__PURE__ */ h(dl, {}) }
|
|
24761
24778
|
];
|
|
24762
|
-
const
|
|
24779
|
+
const v = () => {
|
|
24763
24780
|
f.value || (f.value = !0, setTimeout(() => {
|
|
24764
|
-
var
|
|
24765
|
-
(
|
|
24781
|
+
var C;
|
|
24782
|
+
(C = a.current) == null || C.focus();
|
|
24766
24783
|
}, 100));
|
|
24767
24784
|
};
|
|
24768
24785
|
Io(e, () => ({
|
|
24769
|
-
enterEditMode:
|
|
24786
|
+
enterEditMode: v
|
|
24770
24787
|
}));
|
|
24771
|
-
const
|
|
24772
|
-
|
|
24773
|
-
},
|
|
24774
|
-
|
|
24775
|
-
},
|
|
24776
|
-
var
|
|
24777
|
-
|
|
24778
|
-
},
|
|
24779
|
-
|
|
24780
|
-
},
|
|
24781
|
-
|
|
24788
|
+
const y = (C) => {
|
|
24789
|
+
C.stopPropagation(), o("LINK", C);
|
|
24790
|
+
}, g = (C, x) => {
|
|
24791
|
+
C === "RENAME" ? v() : o(C, x), d(!1);
|
|
24792
|
+
}, b = (C) => {
|
|
24793
|
+
var x;
|
|
24794
|
+
C.stopPropagation(), p = (x = C.target) == null ? void 0 : x.value;
|
|
24795
|
+
}, S = (C) => {
|
|
24796
|
+
C.stopPropagation(), f.value = !1, u.value || (r.data.caption = p, o("RENAME", C)), u.value = !1;
|
|
24797
|
+
}, w = (C) => {
|
|
24798
|
+
C.stopPropagation(), C.key === "Enter" && (f.value = !1), C.key === "Escape" && (u.value = !0, f.value = !1);
|
|
24782
24799
|
};
|
|
24783
24800
|
return /* @__PURE__ */ h(
|
|
24784
24801
|
"div",
|
|
@@ -24794,10 +24811,10 @@ const Oe = new F("chat-topic-item"), Qy = Ko(
|
|
|
24794
24811
|
{
|
|
24795
24812
|
ref: a,
|
|
24796
24813
|
value: r.caption,
|
|
24797
|
-
onBlur:
|
|
24798
|
-
onKeyDown:
|
|
24799
|
-
onClick: (
|
|
24800
|
-
onChange: (
|
|
24814
|
+
onBlur: S,
|
|
24815
|
+
onKeyDown: w,
|
|
24816
|
+
onClick: (C) => C.stopPropagation(),
|
|
24817
|
+
onChange: (C) => b(C),
|
|
24801
24818
|
className: Oe.em("caption", "editor")
|
|
24802
24819
|
}
|
|
24803
24820
|
) : /* @__PURE__ */ h("div", { className: Oe.em("caption", "readonly"), children: [
|
|
@@ -24810,7 +24827,7 @@ const Oe = new F("chat-topic-item"), Qy = Ko(
|
|
|
24810
24827
|
{
|
|
24811
24828
|
title: k.t.value("jumpMainView"),
|
|
24812
24829
|
className: Oe.em("icon", "item"),
|
|
24813
|
-
onClick:
|
|
24830
|
+
onClick: y.bind(void 0),
|
|
24814
24831
|
children: /* @__PURE__ */ h(Dg, { className: Oe.b("link-icon") })
|
|
24815
24832
|
}
|
|
24816
24833
|
),
|
|
@@ -24818,11 +24835,11 @@ const Oe = new F("chat-topic-item"), Qy = Ko(
|
|
|
24818
24835
|
Jn,
|
|
24819
24836
|
{
|
|
24820
24837
|
triggerMode: "click",
|
|
24821
|
-
actions:
|
|
24838
|
+
actions: m.value,
|
|
24822
24839
|
position: "bottom",
|
|
24823
24840
|
isOpen: c,
|
|
24824
24841
|
onToggleOpen: d,
|
|
24825
|
-
onAction:
|
|
24842
|
+
onAction: g.bind(void 0),
|
|
24826
24843
|
children: /* @__PURE__ */ h(
|
|
24827
24844
|
"span",
|
|
24828
24845
|
{
|
|
@@ -25059,11 +25076,11 @@ const Je = new F("chat-minimize"), Zy = (n) => {
|
|
|
25059
25076
|
Object.assign(f, { x: j, y: se }), requestAnimationFrame(() => {
|
|
25060
25077
|
g();
|
|
25061
25078
|
});
|
|
25062
|
-
},
|
|
25079
|
+
}, O = () => {
|
|
25063
25080
|
const z = Date.now();
|
|
25064
|
-
u.current = z - N > 300, document.body.style.userSelect = "", document.removeEventListener("mousemove", E), document.removeEventListener("mouseup",
|
|
25081
|
+
u.current = z - N > 300, document.body.style.userSelect = "", document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", O);
|
|
25065
25082
|
};
|
|
25066
|
-
document.addEventListener("mousemove", E), document.addEventListener("mouseup",
|
|
25083
|
+
document.addEventListener("mousemove", E), document.addEventListener("mouseup", O);
|
|
25067
25084
|
});
|
|
25068
25085
|
}, S = () => {
|
|
25069
25086
|
u.current || n.onClick();
|
|
@@ -25074,10 +25091,10 @@ const Je = new F("chat-minimize"), Zy = (n) => {
|
|
|
25074
25091
|
const w = () => {
|
|
25075
25092
|
if (!i.current)
|
|
25076
25093
|
return;
|
|
25077
|
-
const N = r.getBoundingClientRect(), E = N.left + (N.right - N.left) / 2 + ((t == null ? void 0 : t.x) || 0),
|
|
25094
|
+
const N = r.getBoundingClientRect(), E = N.left + (N.right - N.left) / 2 + ((t == null ? void 0 : t.x) || 0), O = N.top - 38;
|
|
25078
25095
|
Object.assign(i.current.style, {
|
|
25079
25096
|
left: "".concat(E, "px"),
|
|
25080
|
-
top: "".concat(
|
|
25097
|
+
top: "".concat(O, "px")
|
|
25081
25098
|
}), y();
|
|
25082
25099
|
};
|
|
25083
25100
|
w();
|
|
@@ -25840,7 +25857,8 @@ class xs extends Le {
|
|
|
25840
25857
|
controller: this.props.aiChat,
|
|
25841
25858
|
isMinimize: this.state.isMinimize,
|
|
25842
25859
|
onClick: this.exitMinimize.bind(this)
|
|
25843
|
-
}
|
|
25860
|
+
},
|
|
25861
|
+
this.props.aiChat.topicId
|
|
25844
25862
|
)
|
|
25845
25863
|
] }) });
|
|
25846
25864
|
}
|