ai-word-editor 0.0.89 → 0.0.90
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.js +74 -74
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useUmoEditor as wr } from "@umoteam/editor";
|
|
2
|
-
import { computed as lt, ref as N, watch as ht, nextTick as Ue, openBlock as E, createElementBlock as O, createElementVNode as c, createTextVNode as
|
|
3
|
-
import { E as In, p as On, C as Or, m as Ar, g as dn, u as Dr, e as $r, a as fn, b as zr, c as hn, s as pn, d as
|
|
4
|
-
import { J as
|
|
2
|
+
import { computed as lt, ref as N, watch as ht, nextTick as Ue, openBlock as E, createElementBlock as O, createElementVNode as c, createTextVNode as Re, toDisplayString as M, createCommentVNode as vt, Fragment as Mt, renderList as Vt, normalizeClass as jt, withModifiers as Ct, onMounted as Be, createBlock as Gt, Teleport as Pe, withDirectives as Nn, withKeys as Fe, vModelText as kr, normalizeStyle as br, defineComponent as _r, onUnmounted as un, useAttrs as xr, resolveComponent as Sr, createVNode as Cr, mergeProps as Er, withCtx as mn, renderSlot as Tr, unref as ue, createApp as Mr, h as Nr, vModelCheckbox as Ir } from "vue";
|
|
3
|
+
import { E as In, p as On, C as Or, m as Ar, g as dn, u as Dr, e as $r, a as fn, b as zr, c as hn, s as pn, d as Rr, f as St } from "./wordDocxExport-D007J7d0.js";
|
|
4
|
+
import { J as Br } from "./jszip.min-DBnuU6az.js";
|
|
5
5
|
import { p as Pr, a as Fr, b as Jr } from "./wordDocxImport-CXjVXdOu.js";
|
|
6
6
|
const Qt = (o, t) => {
|
|
7
7
|
const e = o.__vccOpts || o;
|
|
@@ -55,7 +55,7 @@ const Qt = (o, t) => {
|
|
|
55
55
|
}, [
|
|
56
56
|
c("div", Lr, [
|
|
57
57
|
c("h3", Ur, [
|
|
58
|
-
d[0] || (d[0] =
|
|
58
|
+
d[0] || (d[0] = Re(" 批注 ", -1)),
|
|
59
59
|
r.value ? (E(), O("span", Wr, M(r.value), 1)) : vt("", !0)
|
|
60
60
|
])
|
|
61
61
|
]),
|
|
@@ -78,7 +78,7 @@ const Qt = (o, t) => {
|
|
|
78
78
|
}, [
|
|
79
79
|
c("div", Vr, [
|
|
80
80
|
d[2] || (d[2] = c("span", { class: "comment-item__quote-icon" }, "❝", -1)),
|
|
81
|
-
|
|
81
|
+
Re(" " + M(u(v.selectedText, 40)), 1)
|
|
82
82
|
]),
|
|
83
83
|
c("div", jr, M(v.note), 1),
|
|
84
84
|
c("div", Kr, [
|
|
@@ -119,7 +119,7 @@ const Qt = (o, t) => {
|
|
|
119
119
|
emits: ["confirm", "cancel"],
|
|
120
120
|
setup(o, { emit: t }) {
|
|
121
121
|
const e = o, n = t, r = N(e.initialNote), i = N(null);
|
|
122
|
-
|
|
122
|
+
Be(() => {
|
|
123
123
|
i.value?.focus();
|
|
124
124
|
});
|
|
125
125
|
const u = (h, d) => h ? h.length > d ? h.slice(0, d) + "…" : h : "", a = () => {
|
|
@@ -677,15 +677,15 @@ function zn(o, t, e, n) {
|
|
|
677
677
|
let a = zn(u.content, t - i - 1, e, u);
|
|
678
678
|
return a && o.replaceChild(r, u.copy(a));
|
|
679
679
|
}
|
|
680
|
-
const
|
|
680
|
+
const Rn = 65535, Bn = Math.pow(2, 16);
|
|
681
681
|
function So(o, t) {
|
|
682
|
-
return o + t *
|
|
682
|
+
return o + t * Bn;
|
|
683
683
|
}
|
|
684
684
|
function gn(o) {
|
|
685
|
-
return o &
|
|
685
|
+
return o & Rn;
|
|
686
686
|
}
|
|
687
687
|
function Co(o) {
|
|
688
|
-
return (o - (o &
|
|
688
|
+
return (o - (o & Rn)) / Bn;
|
|
689
689
|
}
|
|
690
690
|
const Pn = 1, Fn = 2, fe = 4, Jn = 8;
|
|
691
691
|
class vn {
|
|
@@ -1362,11 +1362,11 @@ class Z {
|
|
|
1362
1362
|
found.
|
|
1363
1363
|
*/
|
|
1364
1364
|
static findFrom(t, e, n = !1) {
|
|
1365
|
-
let r = t.parent.inlineContent ? new yt(t) :
|
|
1365
|
+
let r = t.parent.inlineContent ? new yt(t) : Bt(t.node(0), t.parent, t.pos, t.index(), e, n);
|
|
1366
1366
|
if (r)
|
|
1367
1367
|
return r;
|
|
1368
1368
|
for (let i = t.depth - 1; i >= 0; i--) {
|
|
1369
|
-
let u = e < 0 ?
|
|
1369
|
+
let u = e < 0 ? Bt(t.node(0), t.node(i), t.before(i + 1), t.index(i), e, n) : Bt(t.node(0), t.node(i), t.after(i + 1), t.index(i) + 1, e, n);
|
|
1370
1370
|
if (u)
|
|
1371
1371
|
return u;
|
|
1372
1372
|
}
|
|
@@ -1387,14 +1387,14 @@ class Z {
|
|
|
1387
1387
|
exists.
|
|
1388
1388
|
*/
|
|
1389
1389
|
static atStart(t) {
|
|
1390
|
-
return
|
|
1390
|
+
return Bt(t, t, 0, 0, 1) || new bt(t);
|
|
1391
1391
|
}
|
|
1392
1392
|
/**
|
|
1393
1393
|
Find the cursor or leaf node selection closest to the end of the
|
|
1394
1394
|
given document.
|
|
1395
1395
|
*/
|
|
1396
1396
|
static atEnd(t) {
|
|
1397
|
-
return
|
|
1397
|
+
return Bt(t, t, t.content.size, t.childCount, -1) || new bt(t);
|
|
1398
1398
|
}
|
|
1399
1399
|
/**
|
|
1400
1400
|
Deserialize the JSON representation of a selection. Must be
|
|
@@ -1633,7 +1633,7 @@ const To = {
|
|
|
1633
1633
|
return new bt(o);
|
|
1634
1634
|
}
|
|
1635
1635
|
};
|
|
1636
|
-
function
|
|
1636
|
+
function Bt(o, t, e, n, r, i = !1) {
|
|
1637
1637
|
if (t.inlineContent)
|
|
1638
1638
|
return yt.create(o, e);
|
|
1639
1639
|
for (let u = n - (r > 0 ? 0 : 1); r > 0 ? u < t.childCount : u >= 0; u += r) {
|
|
@@ -1642,7 +1642,7 @@ function Rt(o, t, e, n, r, i = !1) {
|
|
|
1642
1642
|
if (!i && pt.isSelectable(a))
|
|
1643
1643
|
return pt.create(o, e - (r < 0 ? a.nodeSize : 0));
|
|
1644
1644
|
} else {
|
|
1645
|
-
let h =
|
|
1645
|
+
let h = Bt(o, a, e + r, r < 0 ? a.childCount : 0, r, i);
|
|
1646
1646
|
if (h)
|
|
1647
1647
|
return h;
|
|
1648
1648
|
}
|
|
@@ -1798,9 +1798,9 @@ const Io = new No("commentGutter"), Oo = In.create({
|
|
|
1798
1798
|
const At = X.getClientRects()[0] || X.getBoundingClientRect();
|
|
1799
1799
|
if (!At) return;
|
|
1800
1800
|
const z = At.top - et.top + C, gt = At.height || 0;
|
|
1801
|
-
for (const
|
|
1802
|
-
const _t = T.get(
|
|
1803
|
-
(!_t || z < _t.top) && T.set(
|
|
1801
|
+
for (const R of mt) {
|
|
1802
|
+
const _t = T.get(R);
|
|
1803
|
+
(!_t || z < _t.top) && T.set(R, { id: R, top: z, height: gt });
|
|
1804
1804
|
}
|
|
1805
1805
|
});
|
|
1806
1806
|
const S = Array.from(T.values());
|
|
@@ -1866,7 +1866,7 @@ function Sn(o) {
|
|
|
1866
1866
|
Le.delete(o);
|
|
1867
1867
|
}
|
|
1868
1868
|
}
|
|
1869
|
-
function
|
|
1869
|
+
function Ro(o, t, e, n = "default") {
|
|
1870
1870
|
const r = n.startsWith("comment:") ? n.slice(8) : n;
|
|
1871
1871
|
if (!r) return;
|
|
1872
1872
|
Ao(), Sn(n);
|
|
@@ -1887,11 +1887,11 @@ function Bo(o, t, e, n = "default") {
|
|
|
1887
1887
|
];
|
|
1888
1888
|
Le.set(n, h);
|
|
1889
1889
|
}
|
|
1890
|
-
const
|
|
1890
|
+
const Bo = In.create({
|
|
1891
1891
|
name: "umoBlinkDecoration"
|
|
1892
1892
|
}), Zt = "http://schemas.openxmlformats.org/wordprocessingml/2006/main";
|
|
1893
1893
|
async function Po(o) {
|
|
1894
|
-
return await
|
|
1894
|
+
return await Br.loadAsync(o);
|
|
1895
1895
|
}
|
|
1896
1896
|
async function Fo(o) {
|
|
1897
1897
|
const t = o.file("word/document.xml");
|
|
@@ -1915,7 +1915,7 @@ function Jo(o) {
|
|
|
1915
1915
|
function Lo(o) {
|
|
1916
1916
|
const t = Jo(o);
|
|
1917
1917
|
if (!t) return {};
|
|
1918
|
-
const e = t.getElementsByTagNameNS(Zt, "pgSz")[0], n = t.getElementsByTagNameNS(Zt, "pgMar")[0], r = e ?
|
|
1918
|
+
const e = t.getElementsByTagNameNS(Zt, "pgSz")[0], n = t.getElementsByTagNameNS(Zt, "pgMar")[0], r = e ? Rt(zt(e, "w:w", "w")) ?? void 0 : void 0, i = e ? Rt(zt(e, "w:h", "h")) ?? void 0 : void 0, u = n ? Rt(zt(n, "w:left", "left")) ?? void 0 : void 0, a = n ? Rt(zt(n, "w:right", "right")) ?? void 0 : void 0, h = n ? Rt(zt(n, "w:top", "top")) ?? void 0 : void 0, d = n ? Rt(zt(n, "w:bottom", "bottom")) ?? void 0 : void 0, v = r != null && u != null && a != null ? Math.max(r - u - a, 1) : void 0;
|
|
1919
1919
|
return { pgW: r, pgH: i, marLeft: u, marRight: a, marTop: h, marBottom: d, contentW: v };
|
|
1920
1920
|
}
|
|
1921
1921
|
function zt(o, ...t) {
|
|
@@ -1926,7 +1926,7 @@ function zt(o, ...t) {
|
|
|
1926
1926
|
}
|
|
1927
1927
|
return null;
|
|
1928
1928
|
}
|
|
1929
|
-
function
|
|
1929
|
+
function Rt(o) {
|
|
1930
1930
|
if (o == null) return null;
|
|
1931
1931
|
const t = parseInt(o, 10);
|
|
1932
1932
|
return Number.isFinite(t) ? t : null;
|
|
@@ -1935,7 +1935,7 @@ let ze = null, Uo = 0;
|
|
|
1935
1935
|
function Wo() {
|
|
1936
1936
|
return ze || (ze = new Worker(new URL(
|
|
1937
1937
|
/* @vite-ignore */
|
|
1938
|
-
"
|
|
1938
|
+
"" + new URL("assets/wordStyleImport.worker-kAtzPtyN.js", import.meta.url).href,
|
|
1939
1939
|
import.meta.url
|
|
1940
1940
|
), {
|
|
1941
1941
|
type: "module"
|
|
@@ -2066,7 +2066,7 @@ function Xo(o, t) {
|
|
|
2066
2066
|
ge() && console.warn("[UMO][blink] range not found", { commentId: o });
|
|
2067
2067
|
return;
|
|
2068
2068
|
}
|
|
2069
|
-
|
|
2069
|
+
Ro(t.view, e.from, e.to, `comment:${String(o)}`);
|
|
2070
2070
|
}
|
|
2071
2071
|
function Tn(o, t) {
|
|
2072
2072
|
ge() && console.debug("[UMO][blink] blinkAndFocusCommentMark", { commentId: t }), Xo(t, o), setTimeout(() => {
|
|
@@ -2176,7 +2176,7 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2176
2176
|
console.error("Fullscreen failed:", s);
|
|
2177
2177
|
}
|
|
2178
2178
|
}
|
|
2179
|
-
|
|
2179
|
+
Be(() => {
|
|
2180
2180
|
document.addEventListener("fullscreenchange", i), i();
|
|
2181
2181
|
}), un(() => {
|
|
2182
2182
|
document.removeEventListener("fullscreenchange", i);
|
|
@@ -2220,7 +2220,7 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2220
2220
|
const mt = (s) => {
|
|
2221
2221
|
clearTimeout(X), X = setTimeout(() => {
|
|
2222
2222
|
const l = s ?? Y();
|
|
2223
|
-
if (!l ||
|
|
2223
|
+
if (!l || R.value.length === 0 && S.size === 0) return;
|
|
2224
2224
|
const m = /* @__PURE__ */ new Set();
|
|
2225
2225
|
l.state.doc.descendants((f) => {
|
|
2226
2226
|
f.marks.forEach((g) => {
|
|
@@ -2230,16 +2230,16 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2230
2230
|
});
|
|
2231
2231
|
});
|
|
2232
2232
|
for (const [f, { comment: g }] of S)
|
|
2233
|
-
m.has(f) && (S.delete(f), Vn(f),
|
|
2234
|
-
|
|
2233
|
+
m.has(f) && (S.delete(f), Vn(f), R.value.push(g));
|
|
2234
|
+
R.value.filter(
|
|
2235
2235
|
(f) => !m.has(f.id) && !S.has(f.id)
|
|
2236
2236
|
).forEach((f) => {
|
|
2237
|
-
|
|
2237
|
+
R.value = R.value.filter((g) => g.id !== f.id), S.set(f.id, { comment: { ...f } }), Gn(f.id, f.source);
|
|
2238
2238
|
});
|
|
2239
2239
|
}, 500);
|
|
2240
2240
|
}, At = (s) => {
|
|
2241
2241
|
const l = s ?? Y();
|
|
2242
|
-
if (!l ||
|
|
2242
|
+
if (!l || R.value.length === 0) return;
|
|
2243
2243
|
const m = /* @__PURE__ */ new Map();
|
|
2244
2244
|
l.state.doc.descendants((p) => {
|
|
2245
2245
|
p.marks.forEach((f) => {
|
|
@@ -2248,11 +2248,11 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2248
2248
|
if (!g.length) return;
|
|
2249
2249
|
const w = f.attrs.commentColors && typeof f.attrs.commentColors == "object" ? f.attrs.commentColors : {};
|
|
2250
2250
|
for (const y of g) {
|
|
2251
|
-
const b = w[y] != null ? w[y] : f.attrs.colorIndex ?? 0, _ = Number.parseInt(b, 10),
|
|
2252
|
-
m.set(y,
|
|
2251
|
+
const b = w[y] != null ? w[y] : f.attrs.colorIndex ?? 0, _ = Number.parseInt(b, 10), B = Number.isNaN(_) || !Number.isFinite(_) ? 0 : (_ % St + St) % St;
|
|
2252
|
+
m.set(y, B);
|
|
2253
2253
|
}
|
|
2254
2254
|
});
|
|
2255
|
-
}), m.size !== 0 && (
|
|
2255
|
+
}), m.size !== 0 && (R.value = R.value.map(
|
|
2256
2256
|
(p) => m.has(p.id) ? { ...p, colorIndex: m.get(p.id) } : p
|
|
2257
2257
|
));
|
|
2258
2258
|
}, z = N(null);
|
|
@@ -2267,7 +2267,7 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2267
2267
|
{ immediate: !0 }
|
|
2268
2268
|
);
|
|
2269
2269
|
const {
|
|
2270
|
-
comments:
|
|
2270
|
+
comments: R,
|
|
2271
2271
|
activeCommentId: _t,
|
|
2272
2272
|
addComment: qe,
|
|
2273
2273
|
deleteComment: Wn,
|
|
@@ -2278,7 +2278,7 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2278
2278
|
queueDelete: Gn,
|
|
2279
2279
|
cancelPendingDelete: Vn
|
|
2280
2280
|
} = Dr(), ke = lt(
|
|
2281
|
-
() =>
|
|
2281
|
+
() => R.value.filter((s) => s?.source !== it)
|
|
2282
2282
|
);
|
|
2283
2283
|
ht(_t, (s) => {
|
|
2284
2284
|
d("activeCommentChange", s);
|
|
@@ -2328,17 +2328,17 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2328
2328
|
try {
|
|
2329
2329
|
const f = l?.getJSON?.(), g = ee();
|
|
2330
2330
|
if (f)
|
|
2331
|
-
await $r(f,
|
|
2331
|
+
await $r(f, R.value, p, { pageSetup: g });
|
|
2332
2332
|
else {
|
|
2333
2333
|
const w = l?.getHTML() ?? z.value?.getHTML();
|
|
2334
2334
|
if (!w) throw new Error("编辑器内容为空,无法导出");
|
|
2335
|
-
await fn(w,
|
|
2335
|
+
await fn(w, R.value, p, { pageSetup: g });
|
|
2336
2336
|
}
|
|
2337
2337
|
} catch (f) {
|
|
2338
2338
|
try {
|
|
2339
2339
|
const g = l?.getHTML() ?? z.value?.getHTML();
|
|
2340
2340
|
if (!g) throw f;
|
|
2341
|
-
await fn(g,
|
|
2341
|
+
await fn(g, R.value, p, { pageSetup: ee() });
|
|
2342
2342
|
} catch (g) {
|
|
2343
2343
|
console.error("导出 Word 失败:", g), alert("导出 Word 失败,请稍后重试");
|
|
2344
2344
|
}
|
|
@@ -2355,7 +2355,7 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2355
2355
|
let g;
|
|
2356
2356
|
const w = ee();
|
|
2357
2357
|
if (f)
|
|
2358
|
-
g = await zr(f,
|
|
2358
|
+
g = await zr(f, R.value, p, { pageSetup: w });
|
|
2359
2359
|
else {
|
|
2360
2360
|
const y = l?.getHTML() ?? z.value?.getHTML();
|
|
2361
2361
|
if (!y) throw new Error("编辑器内容为空,无法导出");
|
|
@@ -2384,12 +2384,12 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2384
2384
|
comments: [92, 99],
|
|
2385
2385
|
done: [100, 100]
|
|
2386
2386
|
}, p = (f, g = 100, w) => {
|
|
2387
|
-
const [y, b] = m[f], _ = f === "done" ? 100 : Math.round(y + (b - y) * Math.max(0, Math.min(100, g)) / 100),
|
|
2387
|
+
const [y, b] = m[f], _ = f === "done" ? 100 : Math.round(y + (b - y) * Math.max(0, Math.min(100, g)) / 100), B = {
|
|
2388
2388
|
phase: f,
|
|
2389
2389
|
percent: _,
|
|
2390
2390
|
message: w
|
|
2391
2391
|
};
|
|
2392
|
-
l.onProgress?.(
|
|
2392
|
+
l.onProgress?.(B), d("import-progress", B);
|
|
2393
2393
|
};
|
|
2394
2394
|
try {
|
|
2395
2395
|
const f = await s.arrayBuffer();
|
|
@@ -2487,10 +2487,10 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2487
2487
|
const f = /^blob:/, g = /* @__PURE__ */ new WeakSet(), w = async (b) => {
|
|
2488
2488
|
if (!b || typeof b != "object" || g.has(b)) return;
|
|
2489
2489
|
if (g.add(b), b.type === "image" && typeof b.attrs?.src == "string") {
|
|
2490
|
-
const
|
|
2491
|
-
if (f.test(
|
|
2490
|
+
const B = b.attrs.src;
|
|
2491
|
+
if (f.test(B))
|
|
2492
2492
|
try {
|
|
2493
|
-
const F = await (await fetch(
|
|
2493
|
+
const F = await (await fetch(B)).blob(), H = new File([F], `word-import-${b.attrs.id || "image"}.bin`, {
|
|
2494
2494
|
type: F.type || "application/octet-stream"
|
|
2495
2495
|
}), rt = await p(H, { rId: String(b.attrs.id || ""), partPath: "" });
|
|
2496
2496
|
rt?.url && (b.attrs.src = String(rt.url), rt.id != null && (b.attrs.id = rt.id));
|
|
@@ -2499,8 +2499,8 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2499
2499
|
}
|
|
2500
2500
|
}
|
|
2501
2501
|
const _ = Array.isArray(b.content) ? b.content : [];
|
|
2502
|
-
for (const
|
|
2503
|
-
await w(
|
|
2502
|
+
for (const B of _)
|
|
2503
|
+
await w(B);
|
|
2504
2504
|
}, y = structuredClone(s);
|
|
2505
2505
|
return await w(y), y;
|
|
2506
2506
|
}
|
|
@@ -2601,7 +2601,7 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2601
2601
|
}
|
|
2602
2602
|
const { doc: w } = s.state, y = ft(l);
|
|
2603
2603
|
if (!y) return null;
|
|
2604
|
-
const b = !!f.preferDel, _ = Number.isFinite(Number(f.preferFrom)) ? Number(f.preferFrom) : 0,
|
|
2604
|
+
const b = !!f.preferDel, _ = Number.isFinite(Number(f.preferFrom)) ? Number(f.preferFrom) : 0, B = f.source === it ? it : Tt, nt = (D) => !D || !D.isText ? !1 : (D.marks || []).some((x) => {
|
|
2605
2605
|
if (!x || !x.type) return !1;
|
|
2606
2606
|
if (x.type.name === "strike") return !0;
|
|
2607
2607
|
if (x.type.name === "textStyle") {
|
|
@@ -2698,7 +2698,7 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2698
2698
|
q,
|
|
2699
2699
|
m,
|
|
2700
2700
|
p,
|
|
2701
|
-
|
|
2701
|
+
B,
|
|
2702
2702
|
l
|
|
2703
2703
|
);
|
|
2704
2704
|
if (x) return x;
|
|
@@ -2708,7 +2708,7 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2708
2708
|
K,
|
|
2709
2709
|
m,
|
|
2710
2710
|
p,
|
|
2711
|
-
|
|
2711
|
+
B,
|
|
2712
2712
|
l
|
|
2713
2713
|
);
|
|
2714
2714
|
if (Et) return Et;
|
|
@@ -2718,7 +2718,7 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2718
2718
|
q,
|
|
2719
2719
|
m,
|
|
2720
2720
|
p,
|
|
2721
|
-
|
|
2721
|
+
B,
|
|
2722
2722
|
l
|
|
2723
2723
|
);
|
|
2724
2724
|
if (x) return x;
|
|
@@ -2729,7 +2729,7 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2729
2729
|
vr,
|
|
2730
2730
|
m,
|
|
2731
2731
|
p,
|
|
2732
|
-
|
|
2732
|
+
B,
|
|
2733
2733
|
l
|
|
2734
2734
|
);
|
|
2735
2735
|
if (an) return an;
|
|
@@ -2745,7 +2745,7 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2745
2745
|
Q,
|
|
2746
2746
|
m,
|
|
2747
2747
|
p,
|
|
2748
|
-
|
|
2748
|
+
B,
|
|
2749
2749
|
l
|
|
2750
2750
|
);
|
|
2751
2751
|
if (st) return st;
|
|
@@ -2756,7 +2756,7 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2756
2756
|
x,
|
|
2757
2757
|
m,
|
|
2758
2758
|
p,
|
|
2759
|
-
|
|
2759
|
+
B,
|
|
2760
2760
|
l
|
|
2761
2761
|
);
|
|
2762
2762
|
if (J) return J;
|
|
@@ -2787,8 +2787,8 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2787
2787
|
let g = 0, w = 0;
|
|
2788
2788
|
const y = [], b = /* @__PURE__ */ new Set();
|
|
2789
2789
|
for (const _ of l) {
|
|
2790
|
-
const
|
|
2791
|
-
if (typeof
|
|
2790
|
+
const B = _.selectedText, nt = _.id ?? n(), F = String(nt);
|
|
2791
|
+
if (typeof B != "string" || !B.trim()) {
|
|
2792
2792
|
y.push({ id: F, selectedTextPreview: "", reason: "empty_text" });
|
|
2793
2793
|
continue;
|
|
2794
2794
|
}
|
|
@@ -2796,8 +2796,8 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2796
2796
|
continue;
|
|
2797
2797
|
_.id != null && b.add(F);
|
|
2798
2798
|
let H;
|
|
2799
|
-
_.colorIndex != null && !Number.isNaN(Number(_.colorIndex)) ? H = (Number(_.colorIndex) % St + St) % St : H = (
|
|
2800
|
-
const rt = _.source === it || _.source === Tt ? _.source : f, I = Se(s,
|
|
2799
|
+
_.colorIndex != null && !Number.isNaN(Number(_.colorIndex)) ? H = (Number(_.colorIndex) % St + St) % St : H = (R.value.length + g) % St;
|
|
2800
|
+
const rt = _.source === it || _.source === Tt ? _.source : f, I = Se(s, B, nt, H, {
|
|
2801
2801
|
preferDel: !!_.preferDel,
|
|
2802
2802
|
source: rt,
|
|
2803
2803
|
preferFrom: w
|
|
@@ -2805,14 +2805,14 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2805
2805
|
if (I)
|
|
2806
2806
|
w = Math.max(w, Number(I.to) || w), await qe({
|
|
2807
2807
|
id: nt,
|
|
2808
|
-
selectedText:
|
|
2808
|
+
selectedText: B,
|
|
2809
2809
|
note: _.note,
|
|
2810
2810
|
author: _.author ?? p,
|
|
2811
2811
|
colorIndex: H,
|
|
2812
2812
|
source: rt
|
|
2813
2813
|
}), g++;
|
|
2814
2814
|
else {
|
|
2815
|
-
const ct = String(
|
|
2815
|
+
const ct = String(B).slice(0, 50);
|
|
2816
2816
|
y.push({ id: F, selectedTextPreview: ct, reason: "no_match" }), Xe(nt) && console.warn("[批注] 文字无法匹配而跳过:", { preview: ct, note: String(_.note ?? "").slice(0, 30) });
|
|
2817
2817
|
}
|
|
2818
2818
|
}
|
|
@@ -2884,7 +2884,7 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2884
2884
|
};
|
|
2885
2885
|
N(!1), N("http://your-internal-ai-model/api/annotation");
|
|
2886
2886
|
const hr = () => {
|
|
2887
|
-
const s = [
|
|
2887
|
+
const s = [Rr, Bo];
|
|
2888
2888
|
return et.value ? s.push(
|
|
2889
2889
|
Oo.configure({
|
|
2890
2890
|
getStageEl: jn,
|
|
@@ -2921,11 +2921,11 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2921
2921
|
cdnUrl: g,
|
|
2922
2922
|
"cdn-url": w,
|
|
2923
2923
|
...y
|
|
2924
|
-
} = s ?? {}, b = Array.isArray(y.extensions) ? y.extensions : [], _ = hr(),
|
|
2924
|
+
} = s ?? {}, b = Array.isArray(y.extensions) ? y.extensions : [], _ = hr(), B = [...b, ..._], nt = h(a.cdnUrl, s), F = {
|
|
2925
2925
|
...y,
|
|
2926
2926
|
cdnUrl: nt,
|
|
2927
2927
|
disableExtensions: ["import-word"],
|
|
2928
|
-
extensions:
|
|
2928
|
+
extensions: B
|
|
2929
2929
|
}, H = pr.value;
|
|
2930
2930
|
return F.onChanged == null && H?.onChanged && (F.onChanged = H.onChanged), F.onFileUpload == null && H?.onFileUpload && (F.onFileUpload = H.onFileUpload), F.onFileDelete == null && H?.onFileDelete && (F.onFileDelete = H.onFileDelete), F;
|
|
2931
2931
|
});
|
|
@@ -2991,13 +2991,13 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
2991
2991
|
skippedItems: []
|
|
2992
2992
|
};
|
|
2993
2993
|
if (l?.replace) {
|
|
2994
|
-
const y =
|
|
2994
|
+
const y = R.value.filter((b) => b?.source !== it).map((b) => b.id);
|
|
2995
2995
|
for (const b of y)
|
|
2996
2996
|
m.commands.removeComment(b);
|
|
2997
2997
|
qn();
|
|
2998
2998
|
for (const [b, _] of S)
|
|
2999
2999
|
_?.comment?.source !== it && S.delete(b);
|
|
3000
|
-
ye(null),
|
|
3000
|
+
ye(null), R.value = R.value.filter(
|
|
3001
3001
|
(b) => b?.source === it
|
|
3002
3002
|
);
|
|
3003
3003
|
}
|
|
@@ -3023,7 +3023,7 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
3023
3023
|
const p = new Map(
|
|
3024
3024
|
s.map((f) => [String(f?.id ?? "").trim(), String(f?.note ?? "").trim()]).filter(([f, g]) => f && g)
|
|
3025
3025
|
);
|
|
3026
|
-
p.size && (
|
|
3026
|
+
p.size && (R.value = R.value.map((f) => {
|
|
3027
3027
|
const g = String(f?.id ?? "").trim(), w = p.get(g);
|
|
3028
3028
|
return !w || m && String(f.note ?? "").trim() ? f : { ...f, note: w };
|
|
3029
3029
|
}));
|
|
@@ -3033,7 +3033,7 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
3033
3033
|
if (!m) return;
|
|
3034
3034
|
const p = typeof l?.selectedText == "string" ? l.selectedText.trim() : "";
|
|
3035
3035
|
if (p) {
|
|
3036
|
-
const f =
|
|
3036
|
+
const f = R.value.find((y) => String(y?.id) === String(s)), g = f?.colorIndex != null && !Number.isNaN(Number(f.colorIndex)) ? Number(f.colorIndex) : 0, w = f?.source === it ? it : Tt;
|
|
3037
3037
|
Se(m, p, s, g, {
|
|
3038
3038
|
source: w,
|
|
3039
3039
|
preferFrom: 0
|
|
@@ -3053,7 +3053,7 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
3053
3053
|
const gr = async (s) => {
|
|
3054
3054
|
const l = Y();
|
|
3055
3055
|
if (!l) return;
|
|
3056
|
-
const m = n(), p =
|
|
3056
|
+
const m = n(), p = R.value.length % St;
|
|
3057
3057
|
l.commands.addComment(m, p, Tt);
|
|
3058
3058
|
try {
|
|
3059
3059
|
await qe({
|
|
@@ -3093,7 +3093,7 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
3093
3093
|
l instanceof HTMLElement && gt !== l && (gt && gt.removeEventListener("click", Me), gt = l, gt.addEventListener("click", Me));
|
|
3094
3094
|
},
|
|
3095
3095
|
{ immediate: !0 }
|
|
3096
|
-
),
|
|
3096
|
+
), Be(() => {
|
|
3097
3097
|
T.value || (T.value = "未命名文档");
|
|
3098
3098
|
}), un(() => {
|
|
3099
3099
|
clearTimeout(X), gt && (gt.removeEventListener("click", Me), gt = null);
|
|
@@ -3450,7 +3450,7 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
3450
3450
|
}, As = {
|
|
3451
3451
|
class: "complex-comment-panel__tabs",
|
|
3452
3452
|
role: "tablist"
|
|
3453
|
-
}, Ds = ["onClick"], $s = { class: "complex-comment-panel__body" }, zs = { class: "complex-comment-panel__section-head" },
|
|
3453
|
+
}, Ds = ["onClick"], $s = { class: "complex-comment-panel__body" }, zs = { class: "complex-comment-panel__section-head" }, Rs = { class: "complex-comment-panel__section-title" }, Bs = { class: "complex-comment-panel__cards" }, Ps = ["data-comment-id", "onClick"], Fs = { class: "audit-card__head" }, Js = ["title"], Ls = { class: "audit-card__block" }, Us = { class: "audit-card__quote" }, Ws = ["onClick"], Hs = { class: "audit-card__block audit-card__block--desc" }, qs = { class: "audit-card__desc" }, Gs = { class: "audit-card__block audit-card__block--desc" }, Vs = { class: "audit-card__desc audit-card__desc--suggestion" }, qt = "__all__", js = {
|
|
3454
3454
|
__name: "ComplexCommentPanel",
|
|
3455
3455
|
props: {
|
|
3456
3456
|
items: {
|
|
@@ -3584,9 +3584,9 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
3584
3584
|
class: "complex-comment-panel__section"
|
|
3585
3585
|
}, [
|
|
3586
3586
|
c("div", zs, [
|
|
3587
|
-
c("span",
|
|
3587
|
+
c("span", Rs, M(T.category), 1)
|
|
3588
3588
|
]),
|
|
3589
|
-
c("ul",
|
|
3589
|
+
c("ul", Bs, [
|
|
3590
3590
|
(E(!0), O(Mt, null, Vt(T.rows, (S) => (E(), O("li", {
|
|
3591
3591
|
key: S.id,
|
|
3592
3592
|
class: jt(["audit-card", { "audit-card--active": o.activeCommentId === S.id }]),
|
|
@@ -3615,7 +3615,7 @@ const Yo = { class: "app-layout" }, Qo = { class: "editor-wrapper" }, ts = { cla
|
|
|
3615
3615
|
class: "audit-card__locate-icon",
|
|
3616
3616
|
"aria-hidden": "true"
|
|
3617
3617
|
}, "⌖", -1),
|
|
3618
|
-
|
|
3618
|
+
Re(" 原文定位 ", -1)
|
|
3619
3619
|
])], 8, Ws)) : vt("", !0)
|
|
3620
3620
|
]),
|
|
3621
3621
|
k[10] || (k[10] = c("div", { class: "audit-card__divider" }, null, -1)),
|