@univerjs/docs-ui 0.9.3 → 0.9.4
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/lib/cjs/index.js +2 -2
- package/lib/es/index.js +99 -107
- package/lib/index.js +99 -107
- package/lib/umd/index.js +2 -2
- package/package.json +9 -9
package/lib/es/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var Mc = Object.defineProperty;
|
|
2
2
|
var _c = (n, e, t) => e in n ? Mc(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
3
|
var O = (n, e, t) => _c(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { IUniverInstanceService as L, Inject as j, Disposable as fe, toDisposable as _n, UniverInstanceType as _, BuildTextUtils as ce, JSONX as W, ObjectRelativeFromV as ht, ObjectRelativeFromH as bo, CommandType as D, sequenceExecuteAsync as Pr, ICommandService as T, DataStreamTreeTokenType as V, TextX as Ee, TextXActionType as G, PresetListType as ye, UpdateDocsAttributeType as on, Tools as
|
|
5
|
-
import { DocSelectionManagerService as Y, RichTextEditingMutation as X, DocSkeletonManagerService as
|
|
4
|
+
import { IUniverInstanceService as L, Inject as j, Disposable as fe, toDisposable as _n, UniverInstanceType as _, BuildTextUtils as ce, JSONX as W, ObjectRelativeFromV as ht, ObjectRelativeFromH as bo, CommandType as D, sequenceExecuteAsync as Pr, ICommandService as T, DataStreamTreeTokenType as V, TextX as Ee, TextXActionType as G, PresetListType as ye, UpdateDocsAttributeType as on, Tools as ue, generateRandomId as ge, TableRowHeightRule as Dc, TableSizeType as Gi, TableTextWrapType as Pc, TableAlignmentType as wc, MemoryCursor as Nt, SHEET_EDITOR_UNITS as In, PositionedObjectLayoutType as Ro, BlockType as Nc, LRUMap as Lc, BaselineOffset as Ve, BooleanNumber as z, ColorKit as Qs, DrawingTypeEnum as wr, skipParseTagNames as Qc, CustomRangeType as Nr, DataStreamTreeNodeType as an, createIdentifier as Yi, ILogService as Lr, SliceBodyType as sr, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Qr, DOC_RANGE_TYPE as He, normalizeBody as Uc, getBodySlice as Ki, FOCUSING_DOC as Dn, EDITOR_ACTIVATED as to, DashStyleType as Fc, RxDisposable as It, ThemeService as Ur, IUndoRedoService as yo, PRESET_LIST_TYPE as Hc, HorizontalAlign as Ue, NamedStyleType as K, RANGE_DIRECTION as De, COLORS as fn, Rectangle as kc, DocumentFlavor as we, LocaleService as Ke, isInternalEditorID as St, IContextService as Fr, Injector as Pn, FOCUSING_EDITOR_STANDALONE as Us, VerticalAlign as Vc, DEFAULT_EMPTY_DOCUMENT_VALUE as qi, PageOrientType as Wc, PAPER_TYPES as jc, PAGE_SIZE as ir, DOCS_ZEN_EDITOR_UNIT_ID_KEY as ot, DEFAULT_STYLES as Xi, NAMED_STYLE_MAP as zc, DisposableCollection as Sn, fromEventSubject as Bt, deepCompare as Gc, FOCUSING_UNIVER_EDITOR as Hr, FOCUSING_COMMON_DRAWINGS as Zi, getPlainText as no, debounce as kr, SpacingRule as Xt, IConfigService as Vr, QuickListTypeMap as Wo, Direction as le, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Yc, checkForSubstrings as Kc, createInterceptorKey as Ji, InterceptorManager as qc, UndoCommandId as Fs, RedoCommandId as Hs, DependentOn as Xc, Plugin as Zc, merge as Jc, touchDependencies as ks, mergeOverrideWithDependencies as $c, createInternalEditorID as el } from "@univerjs/core";
|
|
5
|
+
import { DocSelectionManagerService as Y, RichTextEditingMutation as X, DocSkeletonManagerService as de, SetTextSelectionsOperation as Le, DocStateEmitService as tl, DocInterceptorService as nl } from "@univerjs/docs";
|
|
6
6
|
import { IRenderManagerService as pe, DocumentEditArea as ve, hasListGlyph as ol, isIndentByGlyph as rl, isFirstGlyph as sl, getParagraphByGlyph as il, pixelToPt as al, ptToPixel as Vs, parseDataStreamToTree as cl, Liquid as $i, GlyphType as ea, DocumentSkeletonPageType as Oe, getPageFromPath as ar, getTableIdAndSliceIndex as Ws, NORMAL_TEXT_SELECTION_PLUGIN_STYLE as vn, getColor as pn, RegularPolygon as ta, Rect as qn, getOffsetRectForDom as ll, ScrollTimer as dl, CURSOR_TYPE as Mt, getSystemHighlightColor as Al, Vector2 as Cn, PageLayoutType as bn, Shape as ul, Path as js, pxToNum as na, TRANSFORM_CHANGE_OBSERVABLE_TYPE as oa, getNumberUnitValue as rn, Viewport as hl, ScrollBar as cr, Layer as zs, Documents as gl, DocBackground as fl, getLastLine as pl, lineIterator as ml, getLastColumn as El, UniverRenderEnginePlugin as Il, DeviceInputEventType as ra } from "@univerjs/engine-render";
|
|
7
7
|
import { IClipboardInterfaceService as sa, FILE_PNG_CLIPBOARD_MIME_TYPE as Sl, FILE__WEBP_CLIPBOARD_MIME_TYPE as vl, FILE__JPEG_CLIPBOARD_MIME_TYPE as Cl, FILE__BMP_CLIPBOARD_MIME_TYPE as bl, HTML_CLIPBOARD_MIME_TYPE as ia, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as aa, CopyCommand as Rl, CutCommand as yl, PasteCommand as xl, ILayoutService as xo, KeyCode as q, IConfirmService as ca, useDependency as J, ComponentManager as sn, ISidebarService as la, getMenuHiddenObservable as se, MenuItemType as Z, COLOR_PICKER_COMPONENT as da, FONT_FAMILY_LIST as Ol, FONT_FAMILY_COMPONENT as Tl, FONT_FAMILY_ITEM_COMPONENT as Bl, FONT_SIZE_LIST as Ml, FONT_SIZE_COMPONENT as _l, HEADING_LIST as Gs, COMMON_LABEL_COMPONENT as Dl, HEADING_ITEM_COMPONENT as Pl, ICanvasPopupService as wl, IMenuManagerService as Aa, ToolbarItem as Nl, MenuManagerPosition as Ll, useObservable as tt, RectPopup as Ql, DesktopMenu as Ul, ContextMenuPosition as oo, MetaKeys as te, Slider as Fl, useConfigValue as ua, useEvent as En, ContextMenuGroup as cn, RibbonInsertGroup as Hl, RibbonStartGroup as Ys, IUIPartsService as kl, IShortcutService as Oo, BuiltInUIPart as Ks, connectInjector as qs, imageMimeTypeSet as Vl, IContextMenuService as Wl } from "@univerjs/ui";
|
|
8
8
|
import { ImageSourceType as Wr } from "@univerjs/drawing";
|
|
@@ -111,7 +111,7 @@ function ft(n) {
|
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
113
|
function ld(n, e) {
|
|
114
|
-
const t = n.
|
|
114
|
+
const t = n.getCurrentUnitOfType(_.UNIVER_DOC);
|
|
115
115
|
if (!t)
|
|
116
116
|
return null;
|
|
117
117
|
const o = t.getUnitId(), r = e.getRenderById(o);
|
|
@@ -313,7 +313,7 @@ let at = class extends fe {
|
|
|
313
313
|
return {
|
|
314
314
|
...Vn
|
|
315
315
|
};
|
|
316
|
-
const t = e == null ? void 0 : e.getUnitId(), o = (i = this._renderManagerService.getRenderById(t)) == null ? void 0 : i.with(
|
|
316
|
+
const t = e == null ? void 0 : e.getUnitId(), o = (i = this._renderManagerService.getRenderById(t)) == null ? void 0 : i.with(de), r = o == null ? void 0 : o.getViewModel();
|
|
317
317
|
return r == null ? {
|
|
318
318
|
...Vn
|
|
319
319
|
} : r.getEditArea() === ve.BODY ? {
|
|
@@ -340,9 +340,9 @@ at = gd([
|
|
|
340
340
|
], at);
|
|
341
341
|
function qe(n, e) {
|
|
342
342
|
var o;
|
|
343
|
-
return (o = n.get(pe).getRenderById(e)) == null ? void 0 : o.with(
|
|
343
|
+
return (o = n.get(pe).getRenderById(e)) == null ? void 0 : o.with(de);
|
|
344
344
|
}
|
|
345
|
-
function
|
|
345
|
+
function Ae(n, e = "") {
|
|
346
346
|
if (!e)
|
|
347
347
|
return ["body"];
|
|
348
348
|
const { headers: t, footers: o } = n.getSnapshot();
|
|
@@ -362,7 +362,7 @@ function ma(n, e, t) {
|
|
|
362
362
|
});
|
|
363
363
|
if (e)
|
|
364
364
|
for (const r of o)
|
|
365
|
-
e.bullet && (r.bullet =
|
|
365
|
+
e.bullet && (r.bullet = ue.deepClone(e.bullet)), e.paragraphStyle && (r.paragraphStyle = ue.deepClone(e.paragraphStyle), delete r.paragraphStyle.borderBottom, e.paragraphStyle.headingId && (r.paragraphStyle.headingId = ge(6)));
|
|
366
366
|
if (t)
|
|
367
367
|
for (const r of o)
|
|
368
368
|
r.paragraphStyle || (r.paragraphStyle = {}), r.paragraphStyle.borderBottom = t;
|
|
@@ -471,7 +471,7 @@ const Gr = {
|
|
|
471
471
|
endOffset: u + C,
|
|
472
472
|
collapsed: y
|
|
473
473
|
}];
|
|
474
|
-
const F =
|
|
474
|
+
const F = Ae(l, d);
|
|
475
475
|
return x.params.actions = P.editOp(M.serialize(), F), !!r.syncExecuteCommand(x.id, x.params);
|
|
476
476
|
}
|
|
477
477
|
};
|
|
@@ -522,7 +522,7 @@ function Kr() {
|
|
|
522
522
|
function qr(n) {
|
|
523
523
|
const e = Kr();
|
|
524
524
|
return {
|
|
525
|
-
tableCells: [...new Array(n).fill(null).map(() =>
|
|
525
|
+
tableCells: [...new Array(n).fill(null).map(() => ue.deepClone(e))],
|
|
526
526
|
trHeight: {
|
|
527
527
|
val: { v: 30 },
|
|
528
528
|
hRule: Dc.AUTO
|
|
@@ -540,7 +540,7 @@ function Xr(n) {
|
|
|
540
540
|
};
|
|
541
541
|
}
|
|
542
542
|
function Ea(n, e, t) {
|
|
543
|
-
const o = Xr(t / e), r = qr(e), s = [...new Array(n).fill(null).map(() =>
|
|
543
|
+
const o = Xr(t / e), r = qr(e), s = [...new Array(n).fill(null).map(() => ue.deepClone(r))], i = [...new Array(e).fill(null).map(() => ue.deepClone(o))], a = ge(6);
|
|
544
544
|
return {
|
|
545
545
|
tableRows: s,
|
|
546
546
|
tableColumns: i,
|
|
@@ -972,12 +972,12 @@ const Od = In, va = {
|
|
|
972
972
|
if (b && t || b && xd(c) || c.length && (d != null && d.length))
|
|
973
973
|
return !1;
|
|
974
974
|
for (let w = 0; w < c.length; w++) {
|
|
975
|
-
const N = c[w], { startOffset: ee, endOffset: $, collapsed: U } = N, H = ee - m.cursor, k =
|
|
975
|
+
const N = c[w], { startOffset: ee, endOffset: $, collapsed: U } = N, H = ee - m.cursor, k = ue.deepClone(l);
|
|
976
976
|
if (b)
|
|
977
977
|
for (const ae of k.tables) {
|
|
978
978
|
const { tableId: oe } = ae, he = ge(6);
|
|
979
979
|
ae.tableId = he;
|
|
980
|
-
const Pe =
|
|
980
|
+
const Pe = ue.deepClone(A[oe]);
|
|
981
981
|
Pe.tableId = he;
|
|
982
982
|
const Je = S.insertOp(["tableSource", he], Pe);
|
|
983
983
|
v.push(Je);
|
|
@@ -987,7 +987,7 @@ const Od = In, va = {
|
|
|
987
987
|
for (const oe of k.customBlocks) {
|
|
988
988
|
const { blockId: he } = oe, Pe = ge(6);
|
|
989
989
|
oe.blockId = Pe;
|
|
990
|
-
const Je =
|
|
990
|
+
const Je = ue.deepClone(h[he]);
|
|
991
991
|
Je.drawingId = Pe;
|
|
992
992
|
const At = S.insertOp(["drawings", Pe], Je), $e = S.insertOp(["drawingsOrder", ae], Pe);
|
|
993
993
|
v.push(At), v.push($e);
|
|
@@ -1017,7 +1017,7 @@ const Od = In, va = {
|
|
|
1017
1017
|
}
|
|
1018
1018
|
m.reset(), m.moveCursor($);
|
|
1019
1019
|
}
|
|
1020
|
-
const R =
|
|
1020
|
+
const R = Ae(u, t);
|
|
1021
1021
|
return v.push(S.editOp(I.serialize(), R)), p.params.actions = v.reduce((w, N) => W.compose(w, N), null), !!s.syncExecuteCommand(p.id, p.params);
|
|
1022
1022
|
}
|
|
1023
1023
|
};
|
|
@@ -1043,7 +1043,7 @@ function Bd(n, e, t) {
|
|
|
1043
1043
|
len: b
|
|
1044
1044
|
}) : r.push(...ce.selection.delete([m], o, c.cursor, null, !1)), c.reset(), c.moveCursor(S);
|
|
1045
1045
|
}
|
|
1046
|
-
const d =
|
|
1046
|
+
const d = Ae(e, t);
|
|
1047
1047
|
i.push(s.editOp(r.serialize(), d));
|
|
1048
1048
|
const l = yd(o, n), A = (g = e.getDrawings()) != null ? g : {}, h = (f = e.getDrawingsOrder()) != null ? f : [], u = l.sort((p, m) => h.indexOf(p) > h.indexOf(m) ? -1 : h.indexOf(p) < h.indexOf(m) ? 1 : 0);
|
|
1049
1049
|
if (u.length > 0)
|
|
@@ -1113,7 +1113,7 @@ function Md(n, e, t, o) {
|
|
|
1113
1113
|
}
|
|
1114
1114
|
}
|
|
1115
1115
|
}
|
|
1116
|
-
const d =
|
|
1116
|
+
const d = Ae(e, o);
|
|
1117
1117
|
return r.push(a.editOp(i.serialize(), d)), r.reduce((l, A) => W.compose(l, A), null);
|
|
1118
1118
|
}
|
|
1119
1119
|
function _d(n, e, t, o, r) {
|
|
@@ -1201,7 +1201,7 @@ const Dd = "doc.command.insert-text", Ca = {
|
|
|
1201
1201
|
endOffset: u + f,
|
|
1202
1202
|
collapsed: g
|
|
1203
1203
|
}];
|
|
1204
|
-
const v =
|
|
1204
|
+
const v = Ae(l, r);
|
|
1205
1205
|
return m.params.actions = S.editOp(I.serialize(), v), !!t.syncExecuteCommand(m.id, m.params);
|
|
1206
1206
|
}
|
|
1207
1207
|
}, xn = {
|
|
@@ -1236,7 +1236,7 @@ const Dd = "doc.command.insert-text", Ca = {
|
|
|
1236
1236
|
t: G.DELETE,
|
|
1237
1237
|
len: u - h + 1
|
|
1238
1238
|
});
|
|
1239
|
-
const S =
|
|
1239
|
+
const S = Ae(d, s);
|
|
1240
1240
|
return f.params.actions = m.editOp(p.serialize(), S), !!t.syncExecuteCommand(f.id, f.params);
|
|
1241
1241
|
}
|
|
1242
1242
|
}, ba = {
|
|
@@ -1263,7 +1263,7 @@ const Dd = "doc.command.insert-text", Ca = {
|
|
|
1263
1263
|
len: f - g,
|
|
1264
1264
|
coverType: s
|
|
1265
1265
|
});
|
|
1266
|
-
const p =
|
|
1266
|
+
const p = Ae(l, o);
|
|
1267
1267
|
return A.params.actions = u.editOp(h.serialize(), p), !!c.syncExecuteCommand(A.id, A.params);
|
|
1268
1268
|
}
|
|
1269
1269
|
};
|
|
@@ -1302,7 +1302,7 @@ const Zr = {
|
|
|
1302
1302
|
t: G.DELETE,
|
|
1303
1303
|
len: 1
|
|
1304
1304
|
});
|
|
1305
|
-
const v =
|
|
1305
|
+
const v = Ae(i, h);
|
|
1306
1306
|
S.push(I.editOp(m.serialize(), v));
|
|
1307
1307
|
const b = ((x = i.getDrawings()) != null ? x : {})[l], R = i.getDrawingsOrder().indexOf(l), y = I.removeOp(["drawings", l], b), C = I.removeOp(["drawingsOrder", R], l);
|
|
1308
1308
|
return S.push(y), S.push(C), p.params.actions = S.reduce((M, P) => W.compose(M, P), null), !!r.syncExecuteCommand(p.id, p.params);
|
|
@@ -1366,13 +1366,13 @@ const Zr = {
|
|
|
1366
1366
|
dataStream: "",
|
|
1367
1367
|
paragraphs: [
|
|
1368
1368
|
{
|
|
1369
|
-
...
|
|
1369
|
+
...ue.deepClone(S),
|
|
1370
1370
|
startIndex: 0
|
|
1371
1371
|
}
|
|
1372
1372
|
]
|
|
1373
1373
|
}
|
|
1374
1374
|
});
|
|
1375
|
-
const M =
|
|
1375
|
+
const M = Ae(A, d);
|
|
1376
1376
|
return R.params.actions = C.editOp(y.serialize(), M), !!r.syncExecuteCommand(R.id, R.params);
|
|
1377
1377
|
}
|
|
1378
1378
|
}, Ra = {
|
|
@@ -1418,7 +1418,7 @@ const Zr = {
|
|
|
1418
1418
|
dataStream: "",
|
|
1419
1419
|
paragraphs: [
|
|
1420
1420
|
{
|
|
1421
|
-
...
|
|
1421
|
+
...ue.deepClone({
|
|
1422
1422
|
...g,
|
|
1423
1423
|
paragraphStyle: {
|
|
1424
1424
|
...g.paragraphStyle,
|
|
@@ -1430,7 +1430,7 @@ const Zr = {
|
|
|
1430
1430
|
]
|
|
1431
1431
|
}
|
|
1432
1432
|
});
|
|
1433
|
-
const S =
|
|
1433
|
+
const S = Ae(c, i);
|
|
1434
1434
|
return p.params.actions = I.editOp(m.serialize(), S), !!o.syncExecuteCommand(p.id, p.params);
|
|
1435
1435
|
}
|
|
1436
1436
|
};
|
|
@@ -1729,7 +1729,7 @@ const es = {
|
|
|
1729
1729
|
0,
|
|
1730
1730
|
void 0,
|
|
1731
1731
|
!0
|
|
1732
|
-
), a =
|
|
1732
|
+
), a = Ae(o), c = {
|
|
1733
1733
|
unitId: o.getUnitId(),
|
|
1734
1734
|
actions: W.getInstance().editOp(i, a),
|
|
1735
1735
|
textRanges: [{
|
|
@@ -1974,7 +1974,7 @@ const ti = 660, Co = class Co {
|
|
|
1974
1974
|
const { tableSource: s } = t;
|
|
1975
1975
|
switch (o) {
|
|
1976
1976
|
case "TABLE": {
|
|
1977
|
-
const c = this._tableCache.pop(), { startIndex: d, table: l } = c, A = l.tableRows[0].tableCells.length, h = Xr(ti / A), u = [...new Array(A).fill(null).map(() =>
|
|
1977
|
+
const c = this._tableCache.pop(), { startIndex: d, table: l } = c, A = l.tableRows[0].tableCells.length, h = Xr(ti / A), u = [...new Array(A).fill(null).map(() => ue.deepClone(h))];
|
|
1978
1978
|
l.tableColumns = u, s[l.tableId] = l, r.dataStream += V.TABLE_END, r.tables.push({
|
|
1979
1979
|
startIndex: d,
|
|
1980
1980
|
endIndex: r.dataStream.length,
|
|
@@ -2155,7 +2155,7 @@ function Yo(n, e, t) {
|
|
|
2155
2155
|
const i = [];
|
|
2156
2156
|
for (const a of r) {
|
|
2157
2157
|
const { st: c, ed: d } = a;
|
|
2158
|
-
|
|
2158
|
+
ue.hasIntersectionBetweenTwoRanges(e, t, c, d) && (c > s ? (i.push(o.slice(s, c)), i.push(ni(o, {
|
|
2159
2159
|
...a,
|
|
2160
2160
|
ed: Math.min(d, t)
|
|
2161
2161
|
}))) : i.push(ni(o, {
|
|
@@ -2272,7 +2272,7 @@ class zd {
|
|
|
2272
2272
|
if (e.length === 0)
|
|
2273
2273
|
throw new Error("The bodyList length at least to be 1");
|
|
2274
2274
|
let t = "";
|
|
2275
|
-
for (const o of
|
|
2275
|
+
for (const o of ue.deepClone(e))
|
|
2276
2276
|
t += jd(o);
|
|
2277
2277
|
return t;
|
|
2278
2278
|
}
|
|
@@ -2441,7 +2441,7 @@ let Ar = class extends fe {
|
|
|
2441
2441
|
if (g) {
|
|
2442
2442
|
const f = ge(6);
|
|
2443
2443
|
h.blockId = f, A.drawings[f] = {
|
|
2444
|
-
...
|
|
2444
|
+
...ue.deepClone(g),
|
|
2445
2445
|
drawingId: f
|
|
2446
2446
|
};
|
|
2447
2447
|
}
|
|
@@ -2850,7 +2850,7 @@ const Ba = {
|
|
|
2850
2850
|
},
|
|
2851
2851
|
len: o.length
|
|
2852
2852
|
});
|
|
2853
|
-
const F =
|
|
2853
|
+
const F = Ae(h, f);
|
|
2854
2854
|
E.params.actions = P.editOp(M.serialize(), F), E.params.noHistory = !s, E.params.isCompositionEnd = s;
|
|
2855
2855
|
const w = a.syncExecuteCommand(E.id, E.params);
|
|
2856
2856
|
return A.pushUndoRedoMutationParams(w, E.params), !!w;
|
|
@@ -3103,7 +3103,7 @@ const ri = "doc.command.set-inline-format-bold", Qt = {
|
|
|
3103
3103
|
len: y - R
|
|
3104
3104
|
}), I.reset(), I.moveCursor(y);
|
|
3105
3105
|
}
|
|
3106
|
-
const S =
|
|
3106
|
+
const S = Ae(A, l);
|
|
3107
3107
|
return f.params.actions = m.editOp(p.serialize(), S), !!r.syncExecuteCommand(f.id, f.params);
|
|
3108
3108
|
}
|
|
3109
3109
|
};
|
|
@@ -3137,7 +3137,7 @@ function _a(n, e, t) {
|
|
|
3137
3137
|
}
|
|
3138
3138
|
return C != null && C.ts ? { ...t, ...C.ts } : t;
|
|
3139
3139
|
}
|
|
3140
|
-
const { textRuns: i = [] } = Ki(n, o, r), a =
|
|
3140
|
+
const { textRuns: i = [] } = Ki(n, o, r), a = ue.deepClone(t), c = i.map((y) => {
|
|
3141
3141
|
var C;
|
|
3142
3142
|
return (C = y == null ? void 0 : y.ts) == null ? void 0 : C.fs;
|
|
3143
3143
|
}).filter(Boolean);
|
|
@@ -3191,7 +3191,7 @@ const Da = {
|
|
|
3191
3191
|
const { unitId: t, snapshot: o, textRanges: r, segmentId: s = "", options: i } = e, a = n.get(L), c = n.get(T), d = n.get(Y), l = a.getUnit(t, _.UNIVER_DOC), A = l == null ? void 0 : l.getSelfOrHeaderFooterModel(s).getSnapshot();
|
|
3192
3192
|
if (l == null || A == null)
|
|
3193
3193
|
return !1;
|
|
3194
|
-
const { body: h, tableSource: u, footers: g, headers: f, lists: p, drawings: m, drawingsOrder: I, documentStyle: S } =
|
|
3194
|
+
const { body: h, tableSource: u, footers: g, headers: f, lists: p, drawings: m, drawingsOrder: I, documentStyle: S } = ue.deepClone(o), {
|
|
3195
3195
|
body: v,
|
|
3196
3196
|
tableSource: b,
|
|
3197
3197
|
footers: E,
|
|
@@ -3203,7 +3203,7 @@ const Da = {
|
|
|
3203
3203
|
} = A;
|
|
3204
3204
|
if (h == null || v == null)
|
|
3205
3205
|
return !1;
|
|
3206
|
-
if (
|
|
3206
|
+
if (ue.diffValue(h, v) && r)
|
|
3207
3207
|
return d.replaceDocRanges(r, {
|
|
3208
3208
|
unitId: t,
|
|
3209
3209
|
subUnitId: t
|
|
@@ -3218,35 +3218,35 @@ const Da = {
|
|
|
3218
3218
|
};
|
|
3219
3219
|
i && (M.params.options = i);
|
|
3220
3220
|
const P = [], F = W.getInstance();
|
|
3221
|
-
if (!
|
|
3221
|
+
if (!ue.diffValue(x, S)) {
|
|
3222
3222
|
const N = F.replaceOp(["documentStyle"], x, S);
|
|
3223
3223
|
N != null && P.push(N);
|
|
3224
3224
|
}
|
|
3225
|
-
if (!
|
|
3225
|
+
if (!ue.diffValue(h, v)) {
|
|
3226
3226
|
const N = F.replaceOp(["body"], v, h);
|
|
3227
3227
|
N != null && P.push(N);
|
|
3228
3228
|
}
|
|
3229
|
-
if (!
|
|
3229
|
+
if (!ue.diffValue(u, b)) {
|
|
3230
3230
|
const N = F.replaceOp(["tableSource"], b, u);
|
|
3231
3231
|
N != null && P.push(N);
|
|
3232
3232
|
}
|
|
3233
|
-
if (!
|
|
3233
|
+
if (!ue.diffValue(g, E)) {
|
|
3234
3234
|
const N = F.replaceOp(["footers"], E, g);
|
|
3235
3235
|
N != null && P.push(N);
|
|
3236
3236
|
}
|
|
3237
|
-
if (!
|
|
3237
|
+
if (!ue.diffValue(f, R)) {
|
|
3238
3238
|
const N = F.replaceOp(["headers"], R, f);
|
|
3239
3239
|
N != null && P.push(N);
|
|
3240
3240
|
}
|
|
3241
|
-
if (!
|
|
3241
|
+
if (!ue.diffValue(p, y)) {
|
|
3242
3242
|
const N = F.replaceOp(["lists"], y, p);
|
|
3243
3243
|
N != null && P.push(N);
|
|
3244
3244
|
}
|
|
3245
|
-
if (!
|
|
3245
|
+
if (!ue.diffValue(m, C)) {
|
|
3246
3246
|
const N = F.replaceOp(["drawings"], C, m);
|
|
3247
3247
|
N != null && P.push(N);
|
|
3248
3248
|
}
|
|
3249
|
-
if (!
|
|
3249
|
+
if (!ue.diffValue(I, B)) {
|
|
3250
3250
|
const N = F.replaceOp(["drawingsOrder"], B, I);
|
|
3251
3251
|
N != null && P.push(N);
|
|
3252
3252
|
}
|
|
@@ -3289,7 +3289,7 @@ function Jd(n, e, t, o) {
|
|
|
3289
3289
|
body: o,
|
|
3290
3290
|
len: o.dataStream.length
|
|
3291
3291
|
});
|
|
3292
|
-
const a =
|
|
3292
|
+
const a = Ae(e, n);
|
|
3293
3293
|
return s.editOp(r.serialize(), a);
|
|
3294
3294
|
}
|
|
3295
3295
|
function Pa(n, e, t, o, r) {
|
|
@@ -3354,7 +3354,7 @@ const wa = {
|
|
|
3354
3354
|
textRanges: r,
|
|
3355
3355
|
noHistory: !0
|
|
3356
3356
|
}
|
|
3357
|
-
}, g = W.getInstance(), f =
|
|
3357
|
+
}, g = W.getInstance(), f = Ae(l, s);
|
|
3358
3358
|
return u.params.actions = g.editOp(h.serialize(), f), u.params.textRanges = r, i && (u.params.options = i), !!c.syncExecuteCommand(u.id, u.params);
|
|
3359
3359
|
}
|
|
3360
3360
|
}, eA = {
|
|
@@ -3405,7 +3405,7 @@ const wa = {
|
|
|
3405
3405
|
listType: s,
|
|
3406
3406
|
document: i,
|
|
3407
3407
|
segmentId: c
|
|
3408
|
-
}), m = W.getInstance(), I =
|
|
3408
|
+
}), m = W.getInstance(), I = Ae(i, c);
|
|
3409
3409
|
return g.params.actions = m.editOp(p.serialize(), I), !!r.syncExecuteCommand(g.id, g.params);
|
|
3410
3410
|
}
|
|
3411
3411
|
}, No = {
|
|
@@ -3435,7 +3435,7 @@ const wa = {
|
|
|
3435
3435
|
textRanges: a,
|
|
3436
3436
|
isEditing: !1
|
|
3437
3437
|
}
|
|
3438
|
-
}, m =
|
|
3438
|
+
}, m = Ae(i, c);
|
|
3439
3439
|
return p.params.actions = f.editOp(g.serialize(), m), !!r.syncExecuteCommand(p.id, p.params);
|
|
3440
3440
|
}
|
|
3441
3441
|
};
|
|
@@ -3466,7 +3466,7 @@ const hr = {
|
|
|
3466
3466
|
textRanges: d,
|
|
3467
3467
|
isEditing: !1
|
|
3468
3468
|
}
|
|
3469
|
-
}, I =
|
|
3469
|
+
}, I = Ae(i, c);
|
|
3470
3470
|
return m.params.actions = f.editOp(p.serialize(), I), !!s.syncExecuteCommand(m.id, m.params);
|
|
3471
3471
|
}
|
|
3472
3472
|
}, On = {
|
|
@@ -3521,7 +3521,7 @@ const hr = {
|
|
|
3521
3521
|
});
|
|
3522
3522
|
if (!A)
|
|
3523
3523
|
return !1;
|
|
3524
|
-
const h = W.getInstance(), u =
|
|
3524
|
+
const h = W.getInstance(), u = Ae(a, s);
|
|
3525
3525
|
return l.params.actions = h.editOp(A.serialize(), u), !!o.syncExecuteCommand(l.id, l.params);
|
|
3526
3526
|
}
|
|
3527
3527
|
}, Tn = {
|
|
@@ -3602,7 +3602,7 @@ const hr = {
|
|
|
3602
3602
|
]
|
|
3603
3603
|
}
|
|
3604
3604
|
});
|
|
3605
|
-
const C =
|
|
3605
|
+
const C = Ae(s, a);
|
|
3606
3606
|
return y.params.actions = g.editOp(u.serialize(), C), !!r.syncExecuteCommand(y.id, y.params);
|
|
3607
3607
|
}
|
|
3608
3608
|
};
|
|
@@ -3652,7 +3652,7 @@ function cs(n, e) {
|
|
|
3652
3652
|
}],
|
|
3653
3653
|
isEditing: !1
|
|
3654
3654
|
}
|
|
3655
|
-
}, a = W.getInstance(), c =
|
|
3655
|
+
}, a = W.getInstance(), c = Ae(r);
|
|
3656
3656
|
return i.params.actions = a.editOp(s.serialize(), c), !!t.syncExecuteCommand(i.id, i.params);
|
|
3657
3657
|
}
|
|
3658
3658
|
const ls = {
|
|
@@ -3721,7 +3721,7 @@ const ls = {
|
|
|
3721
3721
|
coverType: on.REPLACE
|
|
3722
3722
|
}), p.moveCursorTo(B + 1);
|
|
3723
3723
|
}
|
|
3724
|
-
const S =
|
|
3724
|
+
const S = Ae(i, c);
|
|
3725
3725
|
return f.params.actions = I.editOp(m.serialize(), S), !!r.syncExecuteCommand(f.id, f.params);
|
|
3726
3726
|
}
|
|
3727
3727
|
}, Lo = {
|
|
@@ -3749,22 +3749,14 @@ const ls = {
|
|
|
3749
3749
|
alignType: Ue.JUSTIFIED
|
|
3750
3750
|
})
|
|
3751
3751
|
}, tA = (n, e) => {
|
|
3752
|
-
const
|
|
3753
|
-
return {
|
|
3754
|
-
...de.deepClone(e),
|
|
3755
|
-
zoomRatio: o
|
|
3756
|
-
};
|
|
3752
|
+
const o = n.get(L).getUnit(e.unitId, _.UNIVER_DOC);
|
|
3753
|
+
return o == null || o.setZoomRatio(e.zoomRatio), { ...e };
|
|
3757
3754
|
}, nt = {
|
|
3758
3755
|
id: "doc.operation.set-zoom-ratio",
|
|
3759
3756
|
type: D.OPERATION,
|
|
3760
3757
|
handler: (n, e) => {
|
|
3761
|
-
const
|
|
3762
|
-
|
|
3763
|
-
return !1;
|
|
3764
|
-
const o = t.getSnapshot();
|
|
3765
|
-
return o.settings == null ? o.settings = {
|
|
3766
|
-
zoomRatio: e.zoomRatio
|
|
3767
|
-
} : o.settings.zoomRatio = e.zoomRatio, !0;
|
|
3758
|
+
const o = n.get(L).getUnit(e.unitId, _.UNIVER_DOC);
|
|
3759
|
+
return o ? (o.setZoomRatio(e.zoomRatio), !0) : !1;
|
|
3768
3760
|
}
|
|
3769
3761
|
}, Zn = {
|
|
3770
3762
|
type: D.COMMAND,
|
|
@@ -3818,7 +3810,7 @@ const ls = {
|
|
|
3818
3810
|
unitId: r,
|
|
3819
3811
|
segmentId: a
|
|
3820
3812
|
}
|
|
3821
|
-
}, l = W.getInstance(), A =
|
|
3813
|
+
}, l = W.getInstance(), A = Ae(o, a);
|
|
3822
3814
|
return d.params.actions = l.editOp(c.serialize(), A), !!n.get(T).syncExecuteCommand(d.id, d.params);
|
|
3823
3815
|
}
|
|
3824
3816
|
}, Qa = {
|
|
@@ -3863,7 +3855,7 @@ const ls = {
|
|
|
3863
3855
|
textX: f,
|
|
3864
3856
|
paragraphTextRun: {}
|
|
3865
3857
|
});
|
|
3866
|
-
const S =
|
|
3858
|
+
const S = Ae(i, c);
|
|
3867
3859
|
return I.params.actions = p.editOp(f.serialize(), S), !!s.syncExecuteCommand(I.id, I.params);
|
|
3868
3860
|
}
|
|
3869
3861
|
}, Ko = {
|
|
@@ -4238,7 +4230,7 @@ function oA(n, e) {
|
|
|
4238
4230
|
}
|
|
4239
4231
|
function Ha(n, e) {
|
|
4240
4232
|
const { path: t } = n, { path: o } = e;
|
|
4241
|
-
return t.indexOf("cells") === -1 || o.indexOf("cells") === -1 || t.length !== o.length ? !1 :
|
|
4233
|
+
return t.indexOf("cells") === -1 || o.indexOf("cells") === -1 || t.length !== o.length ? !1 : ue.diffValue(t, o);
|
|
4242
4234
|
}
|
|
4243
4235
|
function ka(n, e, t) {
|
|
4244
4236
|
var u, g, f, p, m, I, S, v;
|
|
@@ -4856,7 +4848,7 @@ function mr(n, e, t, o, r, s, i, a) {
|
|
|
4856
4848
|
}
|
|
4857
4849
|
if (I === E + 1 && !x && C && C.children.length && (I = E, x = !0), I >= b && I <= E || x) {
|
|
4858
4850
|
const M = r.findNodePositionByCharIndex(m, !0, i, a), P = r.findNodePositionByCharIndex(I, !x, i, a), F = g === De.FORWARD ? M : P, w = g === De.FORWARD ? P : M;
|
|
4859
|
-
if (d.length &&
|
|
4851
|
+
if (d.length && ue.diffValue(F, w))
|
|
4860
4852
|
continue;
|
|
4861
4853
|
c.push(new Zt(t, o, r, F, w, s, i, a));
|
|
4862
4854
|
}
|
|
@@ -5638,7 +5630,7 @@ be = fA([
|
|
|
5638
5630
|
Wn(1, xo),
|
|
5639
5631
|
Wn(2, Lr),
|
|
5640
5632
|
Wn(3, L),
|
|
5641
|
-
Wn(4, j(
|
|
5633
|
+
Wn(4, j(de))
|
|
5642
5634
|
], be);
|
|
5643
5635
|
const Ho = {
|
|
5644
5636
|
id: "doc.command.switch-mode",
|
|
@@ -5649,7 +5641,7 @@ const Ho = {
|
|
|
5649
5641
|
const e = n.get(T), t = n.get(pe), o = n.get(Y), s = n.get(L).getCurrentUniverDocInstance();
|
|
5650
5642
|
if (s == null)
|
|
5651
5643
|
return !1;
|
|
5652
|
-
const i = s.getUnitId(), a = (I = t.getRenderById(i)) == null ? void 0 : I.with(
|
|
5644
|
+
const i = s.getUnitId(), a = (I = t.getRenderById(i)) == null ? void 0 : I.with(de).getSkeleton(), c = (S = t.getRenderById(i)) == null ? void 0 : S.with(be);
|
|
5653
5645
|
if (a == null || c == null)
|
|
5654
5646
|
return !1;
|
|
5655
5647
|
const d = c == null ? void 0 : c.getSegment(), l = c == null ? void 0 : c.getSegmentPage(), A = s.getSnapshot().documentStyle.documentFlavor, h = o.getDocRanges(), u = {
|
|
@@ -5760,7 +5752,7 @@ const Ho = {
|
|
|
5760
5752
|
},
|
|
5761
5753
|
len: P.length
|
|
5762
5754
|
});
|
|
5763
|
-
const k =
|
|
5755
|
+
const k = Ae(A, d);
|
|
5764
5756
|
E.push(b.editOp(v.serialize(), k));
|
|
5765
5757
|
const ne = b.insertOp(["tableSource", H.tableId], H);
|
|
5766
5758
|
return E.push(ne), C.params.actions = E.reduce((At, $e) => W.compose(At, $e), null), !!i.syncExecuteCommand(C.id, C.params);
|
|
@@ -5804,7 +5796,7 @@ const Ho = {
|
|
|
5804
5796
|
t: G.DELETE,
|
|
5805
5797
|
len: I
|
|
5806
5798
|
});
|
|
5807
|
-
const C =
|
|
5799
|
+
const C = Ae(c, a);
|
|
5808
5800
|
E.push(g.editOp(u.serialize(), C));
|
|
5809
5801
|
for (const x of m.reverse()) {
|
|
5810
5802
|
const M = g.removeOp(["tableSource", S, "tableRows", x]);
|
|
@@ -5854,7 +5846,7 @@ const Ho = {
|
|
|
5854
5846
|
len: P
|
|
5855
5847
|
});
|
|
5856
5848
|
}
|
|
5857
|
-
const C =
|
|
5849
|
+
const C = Ae(c, a);
|
|
5858
5850
|
E.push(g.editOp(u.serialize(), C)), m.reverse();
|
|
5859
5851
|
for (let x = 0; x < v; x++)
|
|
5860
5852
|
for (const M of m) {
|
|
@@ -5903,7 +5895,7 @@ const Ho = {
|
|
|
5903
5895
|
t: G.DELETE,
|
|
5904
5896
|
len: m
|
|
5905
5897
|
});
|
|
5906
|
-
const R =
|
|
5898
|
+
const R = Ae(c, a);
|
|
5907
5899
|
v.push(g.editOp(u.serialize(), R));
|
|
5908
5900
|
const y = g.removeOp(["tableSource", I]);
|
|
5909
5901
|
return v.push(y), E.params.actions = v.reduce((B, x) => W.compose(B, x), null), !!o.syncExecuteCommand(E.id, E.params);
|
|
@@ -5963,7 +5955,7 @@ const Ho = {
|
|
|
5963
5955
|
body: B,
|
|
5964
5956
|
len: B.dataStream.length
|
|
5965
5957
|
});
|
|
5966
|
-
const x =
|
|
5958
|
+
const x = Ae(l, d);
|
|
5967
5959
|
E.push(p.editOp(f.serialize(), x));
|
|
5968
5960
|
const M = qr(S), P = p.insertOp(["tableSource", v, "tableRows", b], M);
|
|
5969
5961
|
return E.push(P), C.params.actions = E.reduce((w, N) => W.compose(w, N), null), !!s.syncExecuteCommand(C.id, C.params);
|
|
@@ -6010,7 +6002,7 @@ const Ho = {
|
|
|
6010
6002
|
len: he.dataStream.length
|
|
6011
6003
|
});
|
|
6012
6004
|
}
|
|
6013
|
-
const B =
|
|
6005
|
+
const B = Ae(l, d);
|
|
6014
6006
|
E.push(p.editOp(f.serialize(), B));
|
|
6015
6007
|
for (let oe = 0; oe < b; oe++) {
|
|
6016
6008
|
const he = Kr(), Pe = p.insertOp(["tableSource", v, "tableRows", oe, "tableCells", S], he);
|
|
@@ -6496,7 +6488,7 @@ class WA extends fe {
|
|
|
6496
6488
|
}
|
|
6497
6489
|
getSkeleton() {
|
|
6498
6490
|
var o;
|
|
6499
|
-
return (o = this._injector.get(pe).getRenderById(this._getEditorId())) == null ? void 0 : o.with(
|
|
6491
|
+
return (o = this._injector.get(pe).getRenderById(this._getEditorId())) == null ? void 0 : o.with(de).getSkeleton();
|
|
6500
6492
|
}
|
|
6501
6493
|
isSheetEditor() {
|
|
6502
6494
|
return St(this._getEditorId());
|
|
@@ -6711,7 +6703,7 @@ const KA = (n) => {
|
|
|
6711
6703
|
...y,
|
|
6712
6704
|
[g]: u ? z.TRUE : z.FALSE
|
|
6713
6705
|
}));
|
|
6714
|
-
const f = t.getUniverDocInstance(i), p = f == null ? void 0 : f.getSnapshot().documentStyle, m = (R = o.getRenderById(i)) == null ? void 0 : R.with(
|
|
6706
|
+
const f = t.getUniverDocInstance(i), p = f == null ? void 0 : f.getSnapshot().documentStyle, m = (R = o.getRenderById(i)) == null ? void 0 : R.with(de), I = m == null ? void 0 : m.getViewModel();
|
|
6715
6707
|
if (p == null || I == null)
|
|
6716
6708
|
return;
|
|
6717
6709
|
const S = I.getEditArea();
|
|
@@ -6836,7 +6828,7 @@ const KA = (n) => {
|
|
|
6836
6828
|
] });
|
|
6837
6829
|
}, qA = () => {
|
|
6838
6830
|
var d;
|
|
6839
|
-
const n = J(Ke), e = J(pe), r = J(L).getCurrentUniverDocInstance().getUnitId(), i = ((d = e.getRenderById(r)) == null ? void 0 : d.with(
|
|
6831
|
+
const n = J(Ke), e = J(pe), r = J(L).getCurrentUniverDocInstance().getUnitId(), i = ((d = e.getRenderById(r)) == null ? void 0 : d.with(de)).getViewModel(), [a, c] = me(!0);
|
|
6840
6832
|
return Ce(() => {
|
|
6841
6833
|
const l = i.getEditArea();
|
|
6842
6834
|
c(l !== ve.BODY);
|
|
@@ -7105,7 +7097,7 @@ vr = $A([
|
|
|
7105
7097
|
ut(2, Ye),
|
|
7106
7098
|
ut(3, L),
|
|
7107
7099
|
ut(4, pe),
|
|
7108
|
-
ut(5, j(
|
|
7100
|
+
ut(5, j(de)),
|
|
7109
7101
|
ut(6, j(be)),
|
|
7110
7102
|
ut(7, j(Ke)),
|
|
7111
7103
|
ut(8, j(sn))
|
|
@@ -7213,7 +7205,7 @@ const eo = "doc.command.core-header-footer", uc = {
|
|
|
7213
7205
|
// eslint-disable-next-line max-lines-per-function
|
|
7214
7206
|
handler: async (n, e) => {
|
|
7215
7207
|
var v;
|
|
7216
|
-
const t = n.get(T), o = n.get(L), r = n.get(pe), { unitId: s, segmentId: i, createType: a, headerFooterProps: c } = e, d = (v = r.getRenderById(s)) == null ? void 0 : v.with(
|
|
7208
|
+
const t = n.get(T), o = n.get(L), r = n.get(pe), { unitId: s, segmentId: i, createType: a, headerFooterProps: c } = e, d = (v = r.getRenderById(s)) == null ? void 0 : v.with(de), l = o.getUniverDocInstance(s), A = d == null ? void 0 : d.getViewModel();
|
|
7217
7209
|
if (l == null || A == null)
|
|
7218
7210
|
return !1;
|
|
7219
7211
|
const h = A.getEditArea(), { documentStyle: u } = l.getSnapshot(), g = (c == null ? void 0 : c.marginFooter) != null || (c == null ? void 0 : c.marginHeader) != null, f = [{
|
|
@@ -7257,7 +7249,7 @@ const eo = "doc.command.core-header-footer", uc = {
|
|
|
7257
7249
|
const t = n.get(T), o = n.get(pe), r = n.get(Y), s = n.get(L), { unitId: i } = e, a = o.getRenderById(i);
|
|
7258
7250
|
if (a == null)
|
|
7259
7251
|
return !1;
|
|
7260
|
-
const { scene: c } = a, d = c.getTransformerByCreate(), l = a.with(
|
|
7252
|
+
const { scene: c } = a, d = c.getTransformerByCreate(), l = a.with(de), A = a.with(be), h = l == null ? void 0 : l.getSkeleton(), u = l == null ? void 0 : l.getViewModel();
|
|
7261
7253
|
return u == null || h == null ? !1 : (r.replaceDocRanges([]), d.clearSelectedObjects(), A.setSegment(""), A.setSegmentPage(-1), u.setEditArea(ve.BODY), h.calculate(), (g = a.mainComponent) == null || g.makeDirty(!0), queueMicrotask(() => {
|
|
7262
7254
|
const f = s.getUnit(i), p = f == null ? void 0 : f.getSnapshot();
|
|
7263
7255
|
if (p == null)
|
|
@@ -7579,7 +7571,7 @@ function au(n) {
|
|
|
7579
7571
|
const a = t.getRenderById(s);
|
|
7580
7572
|
if (a == null)
|
|
7581
7573
|
return o.next(!0);
|
|
7582
|
-
a.with(
|
|
7574
|
+
a.with(de).getViewModel().editAreaChange$.subscribe((d) => {
|
|
7583
7575
|
o.next(d === ve.HEADER || d === ve.FOOTER);
|
|
7584
7576
|
});
|
|
7585
7577
|
});
|
|
@@ -8284,7 +8276,7 @@ function bt(n) {
|
|
|
8284
8276
|
}
|
|
8285
8277
|
};
|
|
8286
8278
|
const u = _a(h, i, {});
|
|
8287
|
-
return
|
|
8279
|
+
return ue.deleteNull(u), {
|
|
8288
8280
|
ts: {
|
|
8289
8281
|
...a,
|
|
8290
8282
|
...l,
|
|
@@ -8453,7 +8445,7 @@ function Bi(n, e, t) {
|
|
|
8453
8445
|
};
|
|
8454
8446
|
}
|
|
8455
8447
|
const tr = (n, e) => {
|
|
8456
|
-
const { scene: t, mainComponent: o, engine: r } = e, s = e.with(
|
|
8448
|
+
const { scene: t, mainComponent: o, engine: r } = e, s = e.with(de).getSkeleton(), i = s.findNodePositionByCharIndex(n.startOffset, !0, n.segmentId, n.segmentPage), a = n.collapsed ? n.startOffset : n.endOffset - 1, c = s.findNodePositionByCharIndex(a, !0, n.segmentId, n.segmentPage), d = o;
|
|
8457
8449
|
if (!c || !i)
|
|
8458
8450
|
return;
|
|
8459
8451
|
const l = d.getOffsetConfig(), { docsLeft: A, docsTop: h } = l, u = r.getCanvasElement(), g = u.getBoundingClientRect(), f = na(u.style.width), { top: p, left: m, width: I } = g, S = I / f, { scaleX: v, scaleY: b } = t.getAncestorScale(), E = new pt(l, s), { borderBoxPointGroup: R } = E.getRangePointData(i, c);
|
|
@@ -9033,7 +9025,7 @@ let wt = class extends fe {
|
|
|
9033
9025
|
}
|
|
9034
9026
|
};
|
|
9035
9027
|
wt = Zu([
|
|
9036
|
-
Ju(1, j(
|
|
9028
|
+
Ju(1, j(de))
|
|
9037
9029
|
], wt);
|
|
9038
9030
|
const th = [
|
|
9039
9031
|
ct.id,
|
|
@@ -9243,7 +9235,7 @@ Ao = ch([
|
|
|
9243
9235
|
An(1, j(Y)),
|
|
9244
9236
|
An(2, j(wt)),
|
|
9245
9237
|
An(3, j(Mn)),
|
|
9246
|
-
An(4, j(
|
|
9238
|
+
An(4, j(de)),
|
|
9247
9239
|
An(5, j(lo))
|
|
9248
9240
|
], Ao);
|
|
9249
9241
|
const lh = ({ popup: n }) => {
|
|
@@ -9719,7 +9711,7 @@ const rt = {
|
|
|
9719
9711
|
coverType: on.REPLACE
|
|
9720
9712
|
}), g.moveCursorTo(C + 1);
|
|
9721
9713
|
}
|
|
9722
|
-
const m =
|
|
9714
|
+
const m = Ae(s, a);
|
|
9723
9715
|
return u.params.actions = p.editOp(f.serialize(), m), !!r.syncExecuteCommand(u.id, u.params);
|
|
9724
9716
|
}
|
|
9725
9717
|
}, Fh = () => {
|
|
@@ -9802,7 +9794,7 @@ const rt = {
|
|
|
9802
9794
|
var g;
|
|
9803
9795
|
const u = o.getCurrentUnitForType(_.UNIVER_DOC);
|
|
9804
9796
|
if (u)
|
|
9805
|
-
return (g = t.getRenderById(u == null ? void 0 : u.getUnitId())) == null ? void 0 : g.with(
|
|
9797
|
+
return (g = t.getRenderById(u == null ? void 0 : u.getUnitId())) == null ? void 0 : g.with(de).getSkeleton();
|
|
9806
9798
|
}, []), s = _e(() => new Fe({}), []), [i, a] = me(() => {
|
|
9807
9799
|
var g, f;
|
|
9808
9800
|
const u = n[0];
|
|
@@ -10570,7 +10562,7 @@ let ho = class extends It {
|
|
|
10570
10562
|
ho = Ig([
|
|
10571
10563
|
or(1, j(Y)),
|
|
10572
10564
|
or(2, Ye),
|
|
10573
|
-
or(3, j(
|
|
10565
|
+
or(3, j(de))
|
|
10574
10566
|
], ho);
|
|
10575
10567
|
var Sg = Object.getOwnPropertyDescriptor, vg = (n, e, t, o) => {
|
|
10576
10568
|
for (var r = o > 1 ? void 0 : o ? Sg(e, t) : e, s = n.length - 1, i; s >= 0; s--)
|
|
@@ -10583,7 +10575,7 @@ let br = class extends It {
|
|
|
10583
10575
|
}
|
|
10584
10576
|
reRender(n) {
|
|
10585
10577
|
var s, i;
|
|
10586
|
-
const e = (s = this._renderManagerService.getRenderById(n)) == null ? void 0 : s.with(
|
|
10578
|
+
const e = (s = this._renderManagerService.getRenderById(n)) == null ? void 0 : s.with(de), t = e == null ? void 0 : e.getSkeleton();
|
|
10587
10579
|
if (!t || !!t.getViewModel().getDataModel().getSnapshot().disabled)
|
|
10588
10580
|
return;
|
|
10589
10581
|
t.calculate();
|
|
@@ -10682,7 +10674,7 @@ let br = class extends It {
|
|
|
10682
10674
|
br = vg([
|
|
10683
10675
|
zt(1, T),
|
|
10684
10676
|
zt(2, j(be)),
|
|
10685
|
-
zt(3, j(
|
|
10677
|
+
zt(3, j(de)),
|
|
10686
10678
|
zt(4, Ye),
|
|
10687
10679
|
zt(5, pe),
|
|
10688
10680
|
zt(6, L)
|
|
@@ -10803,7 +10795,7 @@ let fo = class extends fe {
|
|
|
10803
10795
|
this._docAutoFormatService.registerAutoFormat({
|
|
10804
10796
|
id: Jt.id,
|
|
10805
10797
|
match: (n) => {
|
|
10806
|
-
const { selection: e, unit: t } = n, { startNodePosition: o, endNodePosition: r } = e, s = this._renderManagerService.getRenderById(t.getUnitId()), i = s == null ? void 0 : s.with(
|
|
10798
|
+
const { selection: e, unit: t } = n, { startNodePosition: o, endNodePosition: r } = e, s = this._renderManagerService.getRenderById(t.getUnitId()), i = s == null ? void 0 : s.with(de).getSkeleton();
|
|
10807
10799
|
return i == null ? !1 : !!(o && r && ka(i, o, r) || o && !r && o.path.indexOf("cells") > -1);
|
|
10808
10800
|
},
|
|
10809
10801
|
getMutations(n) {
|
|
@@ -11046,7 +11038,7 @@ let po = class extends fe {
|
|
|
11046
11038
|
const t = this._textSelectionManagerService.getActiveTextRange(), o = this._textSelectionManagerService.getTextRanges(), r = this._univerInstanceService.getCurrentUniverDocInstance();
|
|
11047
11039
|
if (r == null)
|
|
11048
11040
|
return;
|
|
11049
|
-
const s = (S = this._renderManagerService.getRenderById(r.getUnitId())) == null ? void 0 : S.with(
|
|
11041
|
+
const s = (S = this._renderManagerService.getRenderById(r.getUnitId())) == null ? void 0 : S.with(de).getSkeleton(), i = this._getDocObject();
|
|
11050
11042
|
if (t == null || s == null || i == null)
|
|
11051
11043
|
return;
|
|
11052
11044
|
const {
|
|
@@ -11119,7 +11111,7 @@ let po = class extends fe {
|
|
|
11119
11111
|
const t = this._textSelectionManagerService.getActiveTextRange(), o = this._textSelectionManagerService.getTextRanges(), r = this._univerInstanceService.getCurrentUniverDocInstance();
|
|
11120
11112
|
if (r == null)
|
|
11121
11113
|
return !1;
|
|
11122
|
-
const s = (I = this._renderManagerService.getRenderById(r.getUnitId())) == null ? void 0 : I.with(
|
|
11114
|
+
const s = (I = this._renderManagerService.getRenderById(r.getUnitId())) == null ? void 0 : I.with(de).getSkeleton(), i = this._getDocObject();
|
|
11123
11115
|
if (t == null || s == null || i == null || o == null)
|
|
11124
11116
|
return;
|
|
11125
11117
|
const { startOffset: a, endOffset: c, style: d, collapsed: l, segmentId: A, startNodePosition: h, endNodePosition: u, segmentPage: g } = t, f = r.getSelfOrHeaderFooterModel(A).getBody();
|
|
@@ -11447,7 +11439,7 @@ let yr = class extends fe {
|
|
|
11447
11439
|
}
|
|
11448
11440
|
};
|
|
11449
11441
|
yr = Vg([
|
|
11450
|
-
Gn(1, j(
|
|
11442
|
+
Gn(1, j(de)),
|
|
11451
11443
|
Gn(2, T),
|
|
11452
11444
|
Gn(3, j(wt)),
|
|
11453
11445
|
Gn(4, j(Y))
|
|
@@ -11621,7 +11613,7 @@ Io = qg([
|
|
|
11621
11613
|
Gt(2, Ye),
|
|
11622
11614
|
Gt(3, T),
|
|
11623
11615
|
Gt(4, j(be)),
|
|
11624
|
-
Gt(5, j(
|
|
11616
|
+
Gt(5, j(de)),
|
|
11625
11617
|
Gt(6, pe)
|
|
11626
11618
|
], Io);
|
|
11627
11619
|
var Xg = Object.getOwnPropertyDescriptor, Zg = (n, e, t, o) => {
|
|
@@ -11652,7 +11644,7 @@ let Or = class extends fe {
|
|
|
11652
11644
|
return;
|
|
11653
11645
|
this._resetIME();
|
|
11654
11646
|
const { activeRange: t } = e;
|
|
11655
|
-
t != null && this._docImeInputManagerService.setActiveRange(
|
|
11647
|
+
t != null && this._docImeInputManagerService.setActiveRange(ue.deepClone(t));
|
|
11656
11648
|
});
|
|
11657
11649
|
}
|
|
11658
11650
|
_initialOnCompositionUpdate() {
|
|
@@ -11687,7 +11679,7 @@ let Or = class extends fe {
|
|
|
11687
11679
|
Or = Zg([
|
|
11688
11680
|
Yn(1, j(be)),
|
|
11689
11681
|
Yn(2, j(wo)),
|
|
11690
|
-
Yn(3, j(
|
|
11682
|
+
Yn(3, j(de)),
|
|
11691
11683
|
Yn(4, T)
|
|
11692
11684
|
], Or);
|
|
11693
11685
|
var Jg = Object.getOwnPropertyDescriptor, $g = (n, e, t, o) => {
|
|
@@ -11747,7 +11739,7 @@ let Tr = class extends fe {
|
|
|
11747
11739
|
};
|
|
11748
11740
|
Tr = $g([
|
|
11749
11741
|
Kn(1, j(be)),
|
|
11750
|
-
Kn(2, j(
|
|
11742
|
+
Kn(2, j(de)),
|
|
11751
11743
|
Kn(3, T),
|
|
11752
11744
|
Kn(4, j(at))
|
|
11753
11745
|
], Tr);
|
|
@@ -11927,7 +11919,7 @@ Mr = of([
|
|
|
11927
11919
|
Yt(2, Ye),
|
|
11928
11920
|
Yt(3, L),
|
|
11929
11921
|
Yt(4, j(be)),
|
|
11930
|
-
Yt(5, j(
|
|
11922
|
+
Yt(5, j(de)),
|
|
11931
11923
|
Yt(6, j(Y))
|
|
11932
11924
|
], Mr);
|
|
11933
11925
|
var rf = Object.getOwnPropertyDescriptor, sf = (n, e, t, o) => {
|
|
@@ -12018,7 +12010,7 @@ let _r = class extends fe {
|
|
|
12018
12010
|
};
|
|
12019
12011
|
_r = sf([
|
|
12020
12012
|
Tt(1, Fr),
|
|
12021
|
-
Tt(2, j(
|
|
12013
|
+
Tt(2, j(de)),
|
|
12022
12014
|
Tt(3, L),
|
|
12023
12015
|
Tt(4, T),
|
|
12024
12016
|
Tt(5, j(Y)),
|
|
@@ -12467,7 +12459,7 @@ let Dr = class extends Zc {
|
|
|
12467
12459
|
}
|
|
12468
12460
|
_initRenderBasics() {
|
|
12469
12461
|
[
|
|
12470
|
-
[
|
|
12462
|
+
[de],
|
|
12471
12463
|
[be],
|
|
12472
12464
|
[nl],
|
|
12473
12465
|
[ws],
|
|
@@ -12540,7 +12532,7 @@ function _f(n, e, t) {
|
|
|
12540
12532
|
const Df = (n, e = !0, t, o) => {
|
|
12541
12533
|
const r = ga(() => {
|
|
12542
12534
|
if (n) {
|
|
12543
|
-
const { scene: i, mainComponent: a } = n.render, c = n.render.with(
|
|
12535
|
+
const { scene: i, mainComponent: a } = n.render, c = n.render.with(de), { width: d, height: l } = n.getBoundingClientRect();
|
|
12544
12536
|
c.getViewModel().getDataModel().updateDocumentDataPageSize(e ? 1 / 0 : d, 1 / 0), i.transformByState({
|
|
12545
12537
|
width: d,
|
|
12546
12538
|
height: l
|
|
@@ -12550,7 +12542,7 @@ const Df = (n, e = !0, t, o) => {
|
|
|
12550
12542
|
var I, S;
|
|
12551
12543
|
if (!t || !n || !t)
|
|
12552
12544
|
return;
|
|
12553
|
-
const a = n.render.with(
|
|
12545
|
+
const a = n.render.with(de).getSkeleton(), { scene: c, mainComponent: d } = n.render, l = c.getViewport(je.VIEW_MAIN), { actualWidth: A, actualHeight: h } = a.getActualSize(), { width: u, height: g } = n.getBoundingClientRect();
|
|
12554
12546
|
let f = l == null ? void 0 : l.getScrollBar();
|
|
12555
12547
|
const p = Math.max(A, u), m = Math.max(h, g);
|
|
12556
12548
|
c.transformByState({
|
|
@@ -12593,7 +12585,7 @@ function Pf(n) {
|
|
|
12593
12585
|
return fa(() => {
|
|
12594
12586
|
var l, A;
|
|
12595
12587
|
if (o.current) {
|
|
12596
|
-
const h = typeof t == "string" ? void 0 :
|
|
12588
|
+
const h = typeof t == "string" ? void 0 : ue.deepClone(t), u = {
|
|
12597
12589
|
body: {
|
|
12598
12590
|
dataStream: typeof t == "string" ? `${t}\r
|
|
12599
12591
|
` : `\r
|
|
@@ -12751,7 +12743,7 @@ const ep = (n) => {
|
|
|
12751
12743
|
}, [C]);
|
|
12752
12744
|
const U = En((k) => {
|
|
12753
12745
|
var ae, oe;
|
|
12754
|
-
const ne = x == null ? void 0 : x.with(
|
|
12746
|
+
const ne = x == null ? void 0 : x.with(de), ie = ne == null ? void 0 : ne.getSkeleton().getActualSize();
|
|
12755
12747
|
ie && (A == null || A(ie.actualHeight), E(Math.max(u, Math.min(ie.actualHeight + 10, g)))), h == null || h(k, no((oe = (ae = k.body) == null ? void 0 : ae.dataStream) != null ? oe : "")), $();
|
|
12756
12748
|
});
|
|
12757
12749
|
return Ce(() => {
|
|
@@ -12934,7 +12926,7 @@ export {
|
|
|
12934
12926
|
qr as getEmptyTableRow,
|
|
12935
12927
|
Es as getLineBounding,
|
|
12936
12928
|
fi as getOneTextSelectionRange,
|
|
12937
|
-
|
|
12929
|
+
Ae as getRichTextEditPath,
|
|
12938
12930
|
Xr as getTableColumn,
|
|
12939
12931
|
Zf as hasParagraphInTable,
|
|
12940
12932
|
Ha as isInSameTableCell,
|