@univerjs/docs-ui 0.15.0 → 0.15.1
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 +244 -237
- package/lib/index.js +244 -237
- package/lib/types/controllers/render-controllers/zoom.render-controller.d.ts +3 -0
- package/lib/types/services/editor/editor.d.ts +1 -1
- package/lib/umd/index.js +16 -16
- package/package.json +11 -11
package/lib/es/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var Bc = Object.defineProperty;
|
|
2
2
|
var Mc = (n, e, t) => e in n ? Bc(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
3
|
var O = (n, e, t) => Mc(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { IUniverInstanceService as L, Inject as z, Disposable as me, toDisposable as Mn, UniverInstanceType as _, BuildTextUtils as ce, JSONX as W, ObjectRelativeFromV as gt, ObjectRelativeFromH as Ro, CommandType as D, sequenceExecuteAsync as
|
|
4
|
+
import { IUniverInstanceService as L, Inject as z, Disposable as me, toDisposable as Mn, UniverInstanceType as _, BuildTextUtils as ce, JSONX as W, ObjectRelativeFromV as gt, ObjectRelativeFromH as Ro, CommandType as D, sequenceExecuteAsync as Pr, ICommandService as T, DataStreamTreeTokenType as V, TextX as Ie, TextXActionType as G, PresetListType as xe, UpdateDocsAttributeType as nn, Tools as ue, generateRandomId as ge, TableRowHeightRule as _c, TableSizeType as Yi, TableTextWrapType as Dc, TableAlignmentType as wc, MemoryCursor as Nt, SHEET_EDITOR_UNITS as En, PositionedObjectLayoutType as bo, BlockType as Pc, LRUMap as Nc, BaselineOffset as Ve, BooleanNumber as j, ColorKit as Qs, DrawingTypeEnum as Nr, skipParseTagNames as Lc, CustomRangeType as Lr, DataStreamTreeNodeType as sn, createIdentifier as Ki, ILogService as Qr, SliceBodyType as ar, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as xo, DOC_RANGE_TYPE as He, normalizeBody as Qc, getBodySlice as qi, FOCUSING_DOC as _n, EDITOR_ACTIVATED as eo, DashStyleType as Uc, RxDisposable as Ct, ThemeService as Ur, IUndoRedoService as yo, PRESET_LIST_TYPE as Fc, HorizontalAlign as Ue, NamedStyleType as K, RANGE_DIRECTION as De, COLORS as gn, Rectangle as Hc, DocumentFlavor as Pe, LocaleService as Ye, IConfirmService as Xi, isInternalEditorID as Rt, IContextService as Fr, Injector as Dn, FOCUSING_EDITOR_STANDALONE as Us, FOCUSING_COMMENT_EDITOR as Fs, isCommentEditorID as kc, VerticalAlign as Vc, DEFAULT_EMPTY_DOCUMENT_VALUE as Zi, PageOrientType as Wc, PAPER_TYPES as zc, PAGE_SIZE as to, DOCS_ZEN_EDITOR_UNIT_ID_KEY as nt, DEFAULT_STYLES as Oo, NAMED_STYLE_MAP as jc, DisposableCollection as In, fromEventSubject as Mt, deepCompare as Gc, FOCUSING_UNIVER_EDITOR as Hr, FOCUSING_COMMON_DRAWINGS as Ji, getPlainText as no, debounce as kr, SpacingRule as Xt, IConfigService as Vr, QuickListTypeMap as jo, Direction as le, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Yc, checkForSubstrings as Kc, createInterceptorKey as $i, InterceptorManager as qc, UndoCommandId as Hs, RedoCommandId as ks, DependentOn as Xc, Plugin as Zc, merge as Jc, touchDependencies as Vs, mergeOverrideWithDependencies as $c, createInternalEditorID as el } from "@univerjs/core";
|
|
5
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 Ws, parseDataStreamToTree as cl, Liquid as ea, GlyphType as ta, DocumentSkeletonPageType as Oe, getPageFromPath as cr, getTableIdAndSliceIndex as zs, NORMAL_TEXT_SELECTION_PLUGIN_STYLE as Sn, getColor as fn, RegularPolygon as na, Rect as Kn, getOffsetRectForDom as ll, ScrollTimer as dl, CURSOR_TYPE as Dt, getSystemHighlightColor as Al, Vector2 as vn, PageLayoutType as Cn, Shape as ul, Path as js, pxToNum as oa, TRANSFORM_CHANGE_OBSERVABLE_TYPE as ra, getNumberUnitValue as on, Viewport as hl, ScrollBar as lr, Layer as Gs, Documents as gl, DocBackground as fl, getLastLine as pl, lineIterator as ml, getLastColumn as El, UniverRenderEnginePlugin as Il, DeviceInputEventType as sa } from "@univerjs/engine-render";
|
|
7
|
-
import { IClipboardInterfaceService as ia, 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 Rl, HTML_CLIPBOARD_MIME_TYPE as aa, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as ca, CopyCommand as bl, CutCommand as xl, PasteCommand as yl, ILayoutService as To, KeyCode as q, useDependency as J, ComponentManager as rn, ISidebarService as la, getMenuHiddenObservable as se, MenuItemType as Z, COLOR_PICKER_COMPONENT as da, FONT_FAMILY_ITEM_COMPONENT as Ol, FONT_FAMILY_COMPONENT as Tl, FONT_SIZE_LIST as Bl, FONT_SIZE_COMPONENT as Ml, HEADING_LIST as Ys, COMMON_LABEL_COMPONENT as _l, HEADING_ITEM_COMPONENT as Dl, ICanvasPopupService as
|
|
7
|
+
import { IClipboardInterfaceService as ia, 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 Rl, HTML_CLIPBOARD_MIME_TYPE as aa, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as ca, CopyCommand as bl, CutCommand as xl, PasteCommand as yl, ILayoutService as To, KeyCode as q, useDependency as J, ComponentManager as rn, ISidebarService as la, getMenuHiddenObservable as se, MenuItemType as Z, COLOR_PICKER_COMPONENT as da, FONT_FAMILY_ITEM_COMPONENT as Ol, FONT_FAMILY_COMPONENT as Tl, FONT_SIZE_LIST as Bl, FONT_SIZE_COMPONENT as Ml, HEADING_LIST as Ys, COMMON_LABEL_COMPONENT as _l, HEADING_ITEM_COMPONENT as Dl, ICanvasPopupService as wl, IMenuManagerService as Aa, ToolbarItem as Pl, MenuManagerPosition as Nl, useObservable as et, RectPopup as Ll, DesktopMenu as Ql, ContextMenuPosition as oo, MetaKeys as te, Slider as Ul, useConfigValue as ua, useEvent as mn, ContextMenuGroup as an, RibbonInsertGroup as Fl, RibbonStartGroup as Ks, IUIPartsService as Hl, IShortcutService as Bo, BuiltInUIPart as qs, connectInjector as Xs, imageMimeTypeSet as kl, IContextMenuService as Vl } from "@univerjs/ui";
|
|
8
8
|
import { ImageSourceType as Wr } from "@univerjs/drawing";
|
|
9
|
-
import { Subject as be, BehaviorSubject as Fe, merge as ha, filter as ro, takeUntil as ft, fromEvent as ze, Observable as fe, map as
|
|
9
|
+
import { Subject as be, BehaviorSubject as Fe, merge as ha, filter as ro, takeUntil as ft, fromEvent as ze, Observable as fe, map as wn, combineLatest as Pn, distinctUntilChanged as Wt, throttleTime as Rn, switchMap as Wl, take as zl, first as jl, of as Gl, animationFrameScheduler as Yl } from "rxjs";
|
|
10
10
|
import { useRef as ke, createElement as Be, forwardRef as Me, useState as Ee, useEffect as Ce, useMemo as Te, useCallback as ga, useImperativeHandle as Kl, useLayoutEffect as fa } from "react";
|
|
11
11
|
import { filter as dr, bufferTime as ql, map as Xl } from "rxjs/operators";
|
|
12
12
|
import { jsxs as re, jsx as Q, Fragment as Zl } from "react/jsx-runtime";
|
|
@@ -16,7 +16,7 @@ var td = Object.getOwnPropertyDescriptor, nd = (n, e, t, o) => {
|
|
|
16
16
|
(i = n[s]) && (r = i(r) || r);
|
|
17
17
|
return r;
|
|
18
18
|
}, Js = (n, e) => (t, o) => e(t, o, n);
|
|
19
|
-
let
|
|
19
|
+
let wt = class extends me {
|
|
20
20
|
constructor(e, t) {
|
|
21
21
|
super();
|
|
22
22
|
O(this, "_matches", /* @__PURE__ */ new Map());
|
|
@@ -53,10 +53,10 @@ let Pt = class extends me {
|
|
|
53
53
|
return [];
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
|
|
56
|
+
wt = nd([
|
|
57
57
|
Js(0, L),
|
|
58
58
|
Js(1, z(Y))
|
|
59
|
-
],
|
|
59
|
+
], wt);
|
|
60
60
|
const od = {
|
|
61
61
|
undo: !0,
|
|
62
62
|
redo: !0,
|
|
@@ -254,22 +254,22 @@ const dd = "doc.command.tab", Jt = {
|
|
|
254
254
|
id: dd,
|
|
255
255
|
type: D.COMMAND,
|
|
256
256
|
async handler(n, e) {
|
|
257
|
-
const o = n.get(
|
|
258
|
-
return (await
|
|
257
|
+
const o = n.get(wt).onAutoFormat(Jt.id, e);
|
|
258
|
+
return (await Pr(o, n.get(T))).result;
|
|
259
259
|
}
|
|
260
260
|
}, Ad = "doc.command.after-space", _o = {
|
|
261
261
|
id: Ad,
|
|
262
262
|
type: D.COMMAND,
|
|
263
263
|
async handler(n) {
|
|
264
|
-
const t = n.get(
|
|
265
|
-
return (await
|
|
264
|
+
const t = n.get(wt).onAutoFormat(_o.id);
|
|
265
|
+
return (await Pr(t, n.get(T))).result;
|
|
266
266
|
}
|
|
267
267
|
}, bn = {
|
|
268
268
|
id: "doc.command.enter",
|
|
269
269
|
type: D.COMMAND,
|
|
270
270
|
async handler(n) {
|
|
271
|
-
const t = n.get(
|
|
272
|
-
return (await
|
|
271
|
+
const t = n.get(wt).onAutoFormat(bn.id);
|
|
272
|
+
return (await Pr(t, n.get(T))).result;
|
|
273
273
|
}
|
|
274
274
|
};
|
|
275
275
|
var ud = Object.getOwnPropertyDescriptor, hd = (n, e, t, o) => {
|
|
@@ -425,7 +425,7 @@ const Gr = {
|
|
|
425
425
|
textRanges: B,
|
|
426
426
|
debounce: !0
|
|
427
427
|
}
|
|
428
|
-
}, M = new Ie(),
|
|
428
|
+
}, M = new Ie(), w = W.getInstance();
|
|
429
429
|
if (x)
|
|
430
430
|
u > 0 && M.push({
|
|
431
431
|
t: G.RETAIN,
|
|
@@ -472,7 +472,7 @@ const Gr = {
|
|
|
472
472
|
collapsed: x
|
|
473
473
|
}];
|
|
474
474
|
const F = Ae(l, d);
|
|
475
|
-
return y.params.actions =
|
|
475
|
+
return y.params.actions = w.editOp(M.serialize(), F), !!r.syncExecuteCommand(y.id, y.params);
|
|
476
476
|
}
|
|
477
477
|
};
|
|
478
478
|
var Do = /* @__PURE__ */ ((n) => (n[n.ABOVE = 0] = "ABOVE", n[n.BELLOW = 1] = "BELLOW", n))(Do || {}), Yr = /* @__PURE__ */ ((n) => (n[n.LEFT = 0] = "LEFT", n[n.RIGHT = 1] = "RIGHT", n))(Yr || {});
|
|
@@ -545,7 +545,7 @@ function Ea(n, e, t) {
|
|
|
545
545
|
tableRows: s,
|
|
546
546
|
tableColumns: i,
|
|
547
547
|
tableId: a,
|
|
548
|
-
align:
|
|
548
|
+
align: wc.START,
|
|
549
549
|
indent: {
|
|
550
550
|
v: 0
|
|
551
551
|
},
|
|
@@ -951,7 +951,7 @@ const yd = En, va = {
|
|
|
951
951
|
type: D.COMMAND,
|
|
952
952
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
953
953
|
handler: async (n, e) => {
|
|
954
|
-
var C, B, y, M,
|
|
954
|
+
var C, B, y, M, w, F;
|
|
955
955
|
const { segmentId: t, textRanges: o, doc: r } = e, s = n.get(T), i = n.get(Y), a = n.get(L), c = i.getTextRanges(), d = i.getRectRanges(), { body: l, tableSource: A, drawings: h } = r;
|
|
956
956
|
if (!Array.isArray(c) || c.length === 0 || l == null)
|
|
957
957
|
return !1;
|
|
@@ -971,29 +971,29 @@ const yd = En, va = {
|
|
|
971
971
|
const I = new Ie(), S = W.getInstance(), v = [], R = !!((C = l.tables) != null && C.length), E = !!((B = l.customBlocks) != null && B.length);
|
|
972
972
|
if (R && t || R && xd(c) || c.length && (d != null && d.length))
|
|
973
973
|
return !1;
|
|
974
|
-
for (let
|
|
975
|
-
const N = c[
|
|
974
|
+
for (let P = 0; P < c.length; P++) {
|
|
975
|
+
const N = c[P], { startOffset: ee, endOffset: $, collapsed: U } = N, H = ee - m.cursor, k = ue.deepClone(l);
|
|
976
976
|
if (R)
|
|
977
977
|
for (const ae of k.tables) {
|
|
978
978
|
const { tableId: oe } = ae, he = ge(6);
|
|
979
979
|
ae.tableId = he;
|
|
980
|
-
const
|
|
981
|
-
|
|
982
|
-
const Ze = S.insertOp(["tableSource", he],
|
|
980
|
+
const we = ue.deepClone(A[oe]);
|
|
981
|
+
we.tableId = he;
|
|
982
|
+
const Ze = S.insertOp(["tableSource", he], we);
|
|
983
983
|
v.push(Ze);
|
|
984
984
|
}
|
|
985
985
|
if (E && h) {
|
|
986
986
|
const ae = (M = (y = u.getSnapshot().drawingsOrder) == null ? void 0 : y.length) != null ? M : 0;
|
|
987
987
|
for (const oe of k.customBlocks) {
|
|
988
|
-
const { blockId: he } = oe,
|
|
989
|
-
oe.blockId =
|
|
988
|
+
const { blockId: he } = oe, we = ge(6);
|
|
989
|
+
oe.blockId = we;
|
|
990
990
|
const Ze = ue.deepClone(h[he]);
|
|
991
|
-
Ze.drawingId =
|
|
992
|
-
const At = S.insertOp(["drawings",
|
|
991
|
+
Ze.drawingId = we;
|
|
992
|
+
const At = S.insertOp(["drawings", we], Ze), Je = S.insertOp(["drawingsOrder", ae], we);
|
|
993
993
|
v.push(At), v.push(Je);
|
|
994
994
|
}
|
|
995
995
|
}
|
|
996
|
-
const ne = zr((
|
|
996
|
+
const ne = zr((w = g.customRanges) != null ? w : [], $, yd.includes(f)), ie = jr((F = g.customDecorations) != null ? F : [], $);
|
|
997
997
|
if (ne && (k.customRanges = [{
|
|
998
998
|
...ne,
|
|
999
999
|
startIndex: 0,
|
|
@@ -1018,7 +1018,7 @@ const yd = En, va = {
|
|
|
1018
1018
|
m.reset(), m.moveCursor($);
|
|
1019
1019
|
}
|
|
1020
1020
|
const b = Ae(u, t);
|
|
1021
|
-
return v.push(S.editOp(I.serialize(), b)), p.params.actions = v.reduce((
|
|
1021
|
+
return v.push(S.editOp(I.serialize(), b)), p.params.actions = v.reduce((P, N) => W.compose(P, N), null), !!s.syncExecuteCommand(p.id, p.params);
|
|
1022
1022
|
}
|
|
1023
1023
|
};
|
|
1024
1024
|
function Od(n, e) {
|
|
@@ -1305,7 +1305,7 @@ const Zr = {
|
|
|
1305
1305
|
const v = Ae(i, h);
|
|
1306
1306
|
S.push(I.editOp(m.serialize(), v));
|
|
1307
1307
|
const R = ((y = i.getDrawings()) != null ? y : {})[l], b = i.getDrawingsOrder().indexOf(l), x = I.removeOp(["drawings", l], R), C = I.removeOp(["drawingsOrder", b], l);
|
|
1308
|
-
return S.push(x), S.push(C), p.params.actions = S.reduce((M,
|
|
1308
|
+
return S.push(x), S.push(C), p.params.actions = S.reduce((M, w) => W.compose(M, w), null), !!r.syncExecuteCommand(p.id, p.params);
|
|
1309
1309
|
}
|
|
1310
1310
|
}, Jr = {
|
|
1311
1311
|
id: "doc.command.merge-two-paragraph",
|
|
@@ -1454,12 +1454,12 @@ function $r(n, e) {
|
|
|
1454
1454
|
}
|
|
1455
1455
|
return t;
|
|
1456
1456
|
}
|
|
1457
|
-
const
|
|
1457
|
+
const wo = {
|
|
1458
1458
|
id: "doc.command.delete-left",
|
|
1459
1459
|
type: D.COMMAND,
|
|
1460
1460
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
1461
1461
|
handler: async (n) => {
|
|
1462
|
-
var C, B, y, M,
|
|
1462
|
+
var C, B, y, M, w, F;
|
|
1463
1463
|
const e = n.get(Y), t = n.get(L), o = n.get(T);
|
|
1464
1464
|
let r = !0;
|
|
1465
1465
|
const s = t.getCurrentUniverDocInstance();
|
|
@@ -1469,10 +1469,10 @@ const Po = {
|
|
|
1469
1469
|
if (A == null)
|
|
1470
1470
|
return !1;
|
|
1471
1471
|
if (d != null && d.length) {
|
|
1472
|
-
const
|
|
1472
|
+
const P = $r(l, d), N = d[0].segmentId, ee = [
|
|
1473
1473
|
{
|
|
1474
|
-
startOffset:
|
|
1475
|
-
endOffset:
|
|
1474
|
+
startOffset: P,
|
|
1475
|
+
endOffset: P
|
|
1476
1476
|
}
|
|
1477
1477
|
];
|
|
1478
1478
|
return o.executeCommand($t.id, {
|
|
@@ -1489,19 +1489,19 @@ const Po = {
|
|
|
1489
1489
|
let E = m;
|
|
1490
1490
|
const b = A.findNodeByCharIndex(m - 1, h, g);
|
|
1491
1491
|
if (sl(S) && b !== S && (v === !0 || R === !0) && I) {
|
|
1492
|
-
const
|
|
1493
|
-
if (
|
|
1492
|
+
const P = il(S, f);
|
|
1493
|
+
if (P == null)
|
|
1494
1494
|
return !1;
|
|
1495
|
-
const N =
|
|
1495
|
+
const N = P == null ? void 0 : P.startIndex, ee = { startIndex: 0 }, $ = P.paragraphStyle;
|
|
1496
1496
|
if (v === !0) {
|
|
1497
|
-
const H =
|
|
1497
|
+
const H = P.paragraphStyle;
|
|
1498
1498
|
if (H) {
|
|
1499
1499
|
ee.paragraphStyle = H;
|
|
1500
1500
|
const { hanging: k } = H;
|
|
1501
1501
|
k && (ee.paragraphStyle.indentStart = k, ee.paragraphStyle.hanging = void 0);
|
|
1502
1502
|
}
|
|
1503
1503
|
} else if (R === !0) {
|
|
1504
|
-
const H =
|
|
1504
|
+
const H = P.bullet;
|
|
1505
1505
|
H && (ee.bullet = H), $ != null && (ee.paragraphStyle = { ...$ }, delete ee.paragraphStyle.hanging, delete ee.paragraphStyle.indentStart);
|
|
1506
1506
|
}
|
|
1507
1507
|
const U = [
|
|
@@ -1529,17 +1529,17 @@ const Po = {
|
|
|
1529
1529
|
if (b == null)
|
|
1530
1530
|
return !0;
|
|
1531
1531
|
if (b.content === "\r") {
|
|
1532
|
-
const
|
|
1533
|
-
(B =
|
|
1532
|
+
const P = (C = f.paragraphs) == null ? void 0 : C.find((N) => N.startIndex === m - 1);
|
|
1533
|
+
(B = P == null ? void 0 : P.paragraphStyle) != null && B.borderBottom ? r = await o.executeCommand(ba.id) : r = await o.executeCommand(Jr.id, {
|
|
1534
1534
|
direction: Ne.LEFT,
|
|
1535
1535
|
range: p
|
|
1536
1536
|
});
|
|
1537
1537
|
} else if (b.streamType === "\b") {
|
|
1538
|
-
const
|
|
1539
|
-
if (
|
|
1538
|
+
const P = (M = s.getSnapshot().drawings) == null ? void 0 : M[(y = b.drawingId) != null ? y : ""];
|
|
1539
|
+
if (P == null)
|
|
1540
1540
|
return !0;
|
|
1541
|
-
const N = (F = (
|
|
1542
|
-
if (
|
|
1541
|
+
const N = (F = (w = s.getBody()) == null ? void 0 : w.customBlocks) == null ? void 0 : F.find(($) => $.blockId === b.drawingId);
|
|
1542
|
+
if (P.layoutType === bo.INLINE || (N == null ? void 0 : N.blockType) === Pc.CUSTOM) {
|
|
1543
1543
|
const $ = s.getUnitId();
|
|
1544
1544
|
r = await o.executeCommand(Zr.id, {
|
|
1545
1545
|
direction: Ne.LEFT,
|
|
@@ -1581,10 +1581,10 @@ const Po = {
|
|
|
1581
1581
|
len: b.count
|
|
1582
1582
|
});
|
|
1583
1583
|
} else {
|
|
1584
|
-
const
|
|
1584
|
+
const P = ya(p, [p]);
|
|
1585
1585
|
r = await o.executeCommand($t.id, {
|
|
1586
1586
|
segmentId: h,
|
|
1587
|
-
textRanges:
|
|
1587
|
+
textRanges: P,
|
|
1588
1588
|
selections: [p]
|
|
1589
1589
|
});
|
|
1590
1590
|
}
|
|
@@ -1740,9 +1740,9 @@ const es = {
|
|
|
1740
1740
|
};
|
|
1741
1741
|
return t.syncExecuteCommand(X.id, c);
|
|
1742
1742
|
}
|
|
1743
|
-
}, Dd = 10,
|
|
1744
|
-
function
|
|
1745
|
-
return ge(
|
|
1743
|
+
}, Dd = 10, wd = 6;
|
|
1744
|
+
function Pd() {
|
|
1745
|
+
return ge(wd);
|
|
1746
1746
|
}
|
|
1747
1747
|
function Nd(n) {
|
|
1748
1748
|
const e = n.match(/data-copy-id="([^\s]+)"/);
|
|
@@ -2407,7 +2407,7 @@ let ur = class extends me {
|
|
|
2407
2407
|
}
|
|
2408
2408
|
async _setClipboardData(e, t = !0) {
|
|
2409
2409
|
var i, a, c, d;
|
|
2410
|
-
const o =
|
|
2410
|
+
const o = Pd(), r = (e.length > 1 ? e.map((l) => {
|
|
2411
2411
|
var A;
|
|
2412
2412
|
return ((A = l.body) == null ? void 0 : A.dataStream) || "";
|
|
2413
2413
|
}).join(`
|
|
@@ -2585,7 +2585,7 @@ ur = Gd([
|
|
|
2585
2585
|
cn(3, ia),
|
|
2586
2586
|
cn(4, z(Y))
|
|
2587
2587
|
], ur);
|
|
2588
|
-
function
|
|
2588
|
+
function Po(n) {
|
|
2589
2589
|
return n.getContextValue(_n) || n.getContextValue(eo);
|
|
2590
2590
|
}
|
|
2591
2591
|
const ns = 999, so = {
|
|
@@ -2594,7 +2594,7 @@ const ns = 999, so = {
|
|
|
2594
2594
|
type: D.COMMAND,
|
|
2595
2595
|
multi: !0,
|
|
2596
2596
|
priority: ns,
|
|
2597
|
-
preconditions:
|
|
2597
|
+
preconditions: Po,
|
|
2598
2598
|
handler: async (n) => n.get(Lt).copy()
|
|
2599
2599
|
}, os = {
|
|
2600
2600
|
id: "doc.command.copy-current-paragraph",
|
|
@@ -2616,7 +2616,7 @@ const ns = 999, so = {
|
|
|
2616
2616
|
type: D.COMMAND,
|
|
2617
2617
|
multi: !0,
|
|
2618
2618
|
priority: ns,
|
|
2619
|
-
preconditions:
|
|
2619
|
+
preconditions: Po,
|
|
2620
2620
|
handler: async (n) => n.get(Lt).cut()
|
|
2621
2621
|
}, ss = {
|
|
2622
2622
|
id: "doc.command.cut-current-paragraph",
|
|
@@ -2638,7 +2638,7 @@ const ns = 999, so = {
|
|
|
2638
2638
|
type: D.COMMAND,
|
|
2639
2639
|
multi: !0,
|
|
2640
2640
|
priority: ns,
|
|
2641
|
-
preconditions:
|
|
2641
|
+
preconditions: Po,
|
|
2642
2642
|
handler: async (n) => {
|
|
2643
2643
|
const e = n.get(Lt), o = await n.get(ia).read();
|
|
2644
2644
|
return o.length === 0 ? !1 : e.paste(o);
|
|
@@ -2795,7 +2795,7 @@ const Ba = {
|
|
|
2795
2795
|
b,
|
|
2796
2796
|
x,
|
|
2797
2797
|
En.includes(t)
|
|
2798
|
-
), y = jr(($ = p.customDecorations) != null ? $ : [], I + r), M = new Ie(),
|
|
2798
|
+
), y = jr(($ = p.customDecorations) != null ? $ : [], I + r), M = new Ie(), w = W.getInstance();
|
|
2799
2799
|
if (!u.collapsed && i) {
|
|
2800
2800
|
const U = ce.selection.delete([u], p, 0, null, !1);
|
|
2801
2801
|
M.push(...U), E.params.textRanges = [{
|
|
@@ -2834,9 +2834,9 @@ const Ba = {
|
|
|
2834
2834
|
len: o.length
|
|
2835
2835
|
});
|
|
2836
2836
|
const F = Ae(h, f);
|
|
2837
|
-
E.params.actions =
|
|
2838
|
-
const
|
|
2839
|
-
return A.pushUndoRedoMutationParams(
|
|
2837
|
+
E.params.actions = w.editOp(M.serialize(), F), E.params.noHistory = !s, E.params.isCompositionEnd = s;
|
|
2838
|
+
const P = a.syncExecuteCommand(E.id, E.params);
|
|
2839
|
+
return A.pushUndoRedoMutationParams(P, E.params), !!P;
|
|
2840
2840
|
}
|
|
2841
2841
|
};
|
|
2842
2842
|
function qe(n, e, t) {
|
|
@@ -3053,12 +3053,12 @@ const si = "doc.command.set-inline-format-bold", Qt = {
|
|
|
3053
3053
|
if (b == null || x == null)
|
|
3054
3054
|
continue;
|
|
3055
3055
|
if (C === He.RECT && (b = b - 1), b === x) {
|
|
3056
|
-
const M = a.getStyleCache(),
|
|
3056
|
+
const M = a.getStyleCache(), w = hr[o];
|
|
3057
3057
|
a.setStyleCache(
|
|
3058
3058
|
{
|
|
3059
|
-
[
|
|
3059
|
+
[w]: (M == null ? void 0 : M[w]) !== void 0 ? Ma(
|
|
3060
3060
|
M,
|
|
3061
|
-
|
|
3061
|
+
w,
|
|
3062
3062
|
o
|
|
3063
3063
|
) : g
|
|
3064
3064
|
}
|
|
@@ -3200,40 +3200,40 @@ const Da = {
|
|
|
3200
3200
|
}
|
|
3201
3201
|
};
|
|
3202
3202
|
i && (M.params.options = i);
|
|
3203
|
-
const
|
|
3203
|
+
const w = [], F = W.getInstance();
|
|
3204
3204
|
if (!ue.diffValue(y, S)) {
|
|
3205
3205
|
const N = F.replaceOp(["documentStyle"], y, S);
|
|
3206
|
-
N != null &&
|
|
3206
|
+
N != null && w.push(N);
|
|
3207
3207
|
}
|
|
3208
3208
|
if (!ue.diffValue(h, v)) {
|
|
3209
3209
|
const N = F.replaceOp(["body"], v, h);
|
|
3210
|
-
N != null &&
|
|
3210
|
+
N != null && w.push(N);
|
|
3211
3211
|
}
|
|
3212
3212
|
if (!ue.diffValue(u, R)) {
|
|
3213
3213
|
const N = F.replaceOp(["tableSource"], R, u);
|
|
3214
|
-
N != null &&
|
|
3214
|
+
N != null && w.push(N);
|
|
3215
3215
|
}
|
|
3216
3216
|
if (!ue.diffValue(g, E)) {
|
|
3217
3217
|
const N = F.replaceOp(["footers"], E, g);
|
|
3218
|
-
N != null &&
|
|
3218
|
+
N != null && w.push(N);
|
|
3219
3219
|
}
|
|
3220
3220
|
if (!ue.diffValue(f, b)) {
|
|
3221
3221
|
const N = F.replaceOp(["headers"], b, f);
|
|
3222
|
-
N != null &&
|
|
3222
|
+
N != null && w.push(N);
|
|
3223
3223
|
}
|
|
3224
3224
|
if (!ue.diffValue(p, x)) {
|
|
3225
3225
|
const N = F.replaceOp(["lists"], x, p);
|
|
3226
|
-
N != null &&
|
|
3226
|
+
N != null && w.push(N);
|
|
3227
3227
|
}
|
|
3228
3228
|
if (!ue.diffValue(m, C)) {
|
|
3229
3229
|
const N = F.replaceOp(["drawings"], C, m);
|
|
3230
|
-
N != null &&
|
|
3230
|
+
N != null && w.push(N);
|
|
3231
3231
|
}
|
|
3232
3232
|
if (!ue.diffValue(I, B)) {
|
|
3233
3233
|
const N = F.replaceOp(["drawingsOrder"], B, I);
|
|
3234
|
-
N != null &&
|
|
3234
|
+
N != null && w.push(N);
|
|
3235
3235
|
}
|
|
3236
|
-
return M.params.actions =
|
|
3236
|
+
return M.params.actions = w.reduce((N, ee) => W.compose(N, ee), null), !!c.syncExecuteCommand(M.id, M.params);
|
|
3237
3237
|
}
|
|
3238
3238
|
}, qd = {
|
|
3239
3239
|
id: "doc.command-replace-content",
|
|
@@ -3242,7 +3242,7 @@ const Da = {
|
|
|
3242
3242
|
const { unitId: t, body: 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().body;
|
|
3243
3243
|
if (l == null || A == null)
|
|
3244
3244
|
return !1;
|
|
3245
|
-
const h =
|
|
3245
|
+
const h = wa(t, s, l, A, o);
|
|
3246
3246
|
return h.params.textRanges = r, i && (h.params.options = i), h.params.actions == null && r ? (d.replaceDocRanges(r, {
|
|
3247
3247
|
unitId: t,
|
|
3248
3248
|
subUnitId: t
|
|
@@ -3255,7 +3255,7 @@ const Da = {
|
|
|
3255
3255
|
const { unitId: t, body: o, segmentId: r = "", textRanges: s } = e, i = n.get(L), a = n.get(T), c = n.get(yo), d = i.getUniverDocInstance(t), l = d == null ? void 0 : d.getSnapshot().body;
|
|
3256
3256
|
if (d == null || l == null)
|
|
3257
3257
|
return !1;
|
|
3258
|
-
const A =
|
|
3258
|
+
const A = wa(t, r, d, l, o);
|
|
3259
3259
|
return A.params.noNeedSetTextRange = !0, A.params.noHistory = !0, A.params.textRanges = s, a.syncExecuteCommand(
|
|
3260
3260
|
A.id,
|
|
3261
3261
|
A.params
|
|
@@ -3275,7 +3275,7 @@ function Zd(n, e, t, o) {
|
|
|
3275
3275
|
const a = Ae(e, n);
|
|
3276
3276
|
return s.editOp(r.serialize(), a);
|
|
3277
3277
|
}
|
|
3278
|
-
function
|
|
3278
|
+
function wa(n, e, t, o, r) {
|
|
3279
3279
|
const s = {
|
|
3280
3280
|
id: X.id,
|
|
3281
3281
|
params: {
|
|
@@ -3286,7 +3286,7 @@ function Pa(n, e, t, o, r) {
|
|
|
3286
3286
|
}, i = Zd(e, t, o, r);
|
|
3287
3287
|
return s.params.actions = i, s;
|
|
3288
3288
|
}
|
|
3289
|
-
const
|
|
3289
|
+
const Pa = {
|
|
3290
3290
|
id: "doc.command.replace-selection",
|
|
3291
3291
|
type: D.COMMAND,
|
|
3292
3292
|
handler(n, e) {
|
|
@@ -3360,7 +3360,7 @@ const wa = {
|
|
|
3360
3360
|
}]
|
|
3361
3361
|
}
|
|
3362
3362
|
};
|
|
3363
|
-
return t.syncExecuteCommand(
|
|
3363
|
+
return t.syncExecuteCommand(Pa.id, d);
|
|
3364
3364
|
}
|
|
3365
3365
|
}, Fn = {
|
|
3366
3366
|
id: "doc.command.list-operation",
|
|
@@ -3523,7 +3523,7 @@ const gr = {
|
|
|
3523
3523
|
type: D.COMMAND,
|
|
3524
3524
|
// eslint-disable-next-line max-lines-per-function
|
|
3525
3525
|
handler(n, e) {
|
|
3526
|
-
var y, M,
|
|
3526
|
+
var y, M, w;
|
|
3527
3527
|
if (!e)
|
|
3528
3528
|
return !1;
|
|
3529
3529
|
const t = n.get(Y), o = n.get(L), r = n.get(T), s = o.getCurrentUnitForType(_.UNIVER_DOC), i = t.getActiveTextRange();
|
|
@@ -3572,7 +3572,7 @@ const gr = {
|
|
|
3572
3572
|
indentFirstLine: void 0
|
|
3573
3573
|
},
|
|
3574
3574
|
bullet: {
|
|
3575
|
-
...(
|
|
3575
|
+
...(w = l.bullet) != null ? w : {
|
|
3576
3576
|
nestingLevel: 0,
|
|
3577
3577
|
textStyle: {
|
|
3578
3578
|
fs: 20
|
|
@@ -4003,30 +4003,30 @@ class It {
|
|
|
4003
4003
|
return;
|
|
4004
4004
|
const { x: E, y: b } = this._liquid;
|
|
4005
4005
|
let x, C;
|
|
4006
|
-
const B = v[d], y = v[l], M = v[d - 1],
|
|
4006
|
+
const B = v[d], y = v[l], M = v[d - 1], w = (B == null ? void 0 : B.left) || 0, F = (B == null ? void 0 : B.width) || 0, P = (y == null ? void 0 : y.left) || 0, N = (y == null ? void 0 : y.width) || 0, ee = (B == null ? void 0 : B.glyphType) === ta.LIST, { startOffset: $, endOffset: U } = tA(v, d, l, R), H = a.glyph === d && A ? a.isBack : !0, k = c.glyph === l && h ? c.isBack : !1, ne = a === c, ie = H && M != null ? M : B;
|
|
4007
4007
|
if (d === 0 && l === v.length - 1)
|
|
4008
4008
|
x = {
|
|
4009
|
-
startX: E +
|
|
4009
|
+
startX: E + w + (ee ? F : 0),
|
|
4010
4010
|
startY: b,
|
|
4011
|
-
endX: E +
|
|
4011
|
+
endX: E + P + (k ? 0 : N),
|
|
4012
4012
|
endY: b + f - I - S
|
|
4013
4013
|
}, C = {
|
|
4014
|
-
startX: E +
|
|
4014
|
+
startX: E + w + (ee ? F : 0),
|
|
4015
4015
|
startY: b + m + p - ie.bBox.ba,
|
|
4016
|
-
endX: E +
|
|
4016
|
+
endX: E + P + (k ? 0 : N),
|
|
4017
4017
|
endY: b + m + p + ie.bBox.bd
|
|
4018
4018
|
};
|
|
4019
4019
|
else {
|
|
4020
4020
|
const ae = H && !ee;
|
|
4021
4021
|
x = {
|
|
4022
|
-
startX: E +
|
|
4022
|
+
startX: E + w + (ae ? 0 : F),
|
|
4023
4023
|
startY: b,
|
|
4024
|
-
endX: E +
|
|
4024
|
+
endX: E + P + (k ? 0 : N),
|
|
4025
4025
|
endY: b + f - I - S
|
|
4026
4026
|
}, C = {
|
|
4027
|
-
startX: E +
|
|
4027
|
+
startX: E + w + (ae ? 0 : F),
|
|
4028
4028
|
startY: b + m + p - ie.bBox.ba,
|
|
4029
|
-
endX: E +
|
|
4029
|
+
endX: E + P + (k ? 0 : N),
|
|
4030
4030
|
endY: b + m + p + ie.bBox.bd
|
|
4031
4031
|
};
|
|
4032
4032
|
}
|
|
@@ -4123,7 +4123,7 @@ class It {
|
|
|
4123
4123
|
this._liquid.translatePage(b, f, p, m);
|
|
4124
4124
|
continue;
|
|
4125
4125
|
}
|
|
4126
|
-
const M = y.sections, { start_next:
|
|
4126
|
+
const M = y.sections, { start_next: w, end_next: F } = this._getSelectionRuler(
|
|
4127
4127
|
qt.page,
|
|
4128
4128
|
e,
|
|
4129
4129
|
t,
|
|
@@ -4139,13 +4139,13 @@ class It {
|
|
|
4139
4139
|
});
|
|
4140
4140
|
break;
|
|
4141
4141
|
case Oe.FOOTER: {
|
|
4142
|
-
const
|
|
4143
|
-
this._liquid.translate(b.marginLeft,
|
|
4142
|
+
const P = b.pageHeight - y.height - y.marginBottom;
|
|
4143
|
+
this._liquid.translate(b.marginLeft, P);
|
|
4144
4144
|
break;
|
|
4145
4145
|
}
|
|
4146
4146
|
case Oe.CELL: {
|
|
4147
4147
|
this._liquid.translatePagePadding(b);
|
|
4148
|
-
const
|
|
4148
|
+
const P = y.parent, N = P.parent, { left: ee } = y, { top: $, left: U } = N, { top: H } = P;
|
|
4149
4149
|
this._liquid.translate(U + ee, $ + H), this._liquid.translatePagePadding(y);
|
|
4150
4150
|
break;
|
|
4151
4151
|
}
|
|
@@ -4153,13 +4153,13 @@ class It {
|
|
|
4153
4153
|
this._liquid.translatePagePadding(b);
|
|
4154
4154
|
break;
|
|
4155
4155
|
}
|
|
4156
|
-
for (let
|
|
4157
|
-
const N = M[
|
|
4156
|
+
for (let P = w; P <= F; P++) {
|
|
4157
|
+
const N = M[P], ee = N.columns, { start_next: $, end_next: U } = this._getSelectionRuler(
|
|
4158
4158
|
qt.section,
|
|
4159
4159
|
e,
|
|
4160
4160
|
t,
|
|
4161
4161
|
ee.length - 1,
|
|
4162
|
-
|
|
4162
|
+
P
|
|
4163
4163
|
);
|
|
4164
4164
|
this._liquid.translateSection(N);
|
|
4165
4165
|
for (let H = $; H <= U; H++) {
|
|
@@ -4172,16 +4172,16 @@ class It {
|
|
|
4172
4172
|
);
|
|
4173
4173
|
this._liquid.translateColumn(k);
|
|
4174
4174
|
for (let oe = ie; oe <= ae; oe++) {
|
|
4175
|
-
const he = ne[oe], { divides:
|
|
4175
|
+
const he = ne[oe], { divides: we } = he, { start_next: Ze, end_next: At } = this._getSelectionRuler(
|
|
4176
4176
|
qt.line,
|
|
4177
4177
|
e,
|
|
4178
4178
|
t,
|
|
4179
|
-
|
|
4179
|
+
we.length - 1,
|
|
4180
4180
|
oe
|
|
4181
4181
|
);
|
|
4182
4182
|
this._liquid.translateSave(), this._liquid.translateLine(he, !0, !1);
|
|
4183
4183
|
for (let Je = Ze; Je <= At; Je++) {
|
|
4184
|
-
const zo =
|
|
4184
|
+
const zo = we[Je];
|
|
4185
4185
|
this._liquid.translateSave(), this._liquid.translateDivide(zo);
|
|
4186
4186
|
const { glyphGroup: yc } = zo, { start_next: Oc, end_next: Tc } = this._getSelectionRuler(
|
|
4187
4187
|
qt.divide,
|
|
@@ -4191,7 +4191,7 @@ class It {
|
|
|
4191
4191
|
Je
|
|
4192
4192
|
);
|
|
4193
4193
|
let Ns = !1, Ls = !1;
|
|
4194
|
-
E === I &&
|
|
4194
|
+
E === I && P === w && H === $ && oe === ie && Je === Ze && (Ns = !0), E === S && P === F && H === U && oe === ae && Je === At && (Ls = !0), o && o(Oc, Tc, Ns, Ls, zo, he, k, N, y), this._liquid.translateRestore();
|
|
4195
4195
|
}
|
|
4196
4196
|
this._liquid.translateRestore();
|
|
4197
4197
|
}
|
|
@@ -4291,13 +4291,13 @@ class Va {
|
|
|
4291
4291
|
const M = oA(y.cells, u, f);
|
|
4292
4292
|
if (M == null)
|
|
4293
4293
|
continue;
|
|
4294
|
-
const [
|
|
4295
|
-
startX: x +
|
|
4294
|
+
const [w, F] = M, P = {
|
|
4295
|
+
startX: x + w.left + B,
|
|
4296
4296
|
startY: C + y.top,
|
|
4297
4297
|
endX: x + F.left + F.pageWidth + B,
|
|
4298
4298
|
endY: C + y.top + y.height
|
|
4299
4299
|
};
|
|
4300
|
-
o.push(pr(
|
|
4300
|
+
o.push(pr(P));
|
|
4301
4301
|
}
|
|
4302
4302
|
this._liquid.translateRestore(), this._liquid.restorePagePadding(R), this._liquid.translatePage(R, p, m, I);
|
|
4303
4303
|
}
|
|
@@ -4801,22 +4801,22 @@ function Er(n, e, t, o, r, s, i, a) {
|
|
|
4801
4801
|
const { startIndex: R, endIndex: E, children: b } = v, x = S.children.indexOf(v), C = S.children[x + 1], B = b[0];
|
|
4802
4802
|
let y = !1;
|
|
4803
4803
|
if (B) {
|
|
4804
|
-
const { startIndex: M, endIndex:
|
|
4805
|
-
let
|
|
4804
|
+
const { startIndex: M, endIndex: w, children: F } = B;
|
|
4805
|
+
let P = null, N = null;
|
|
4806
4806
|
const ee = F.find((U) => U.startIndex <= f && U.endIndex >= f), $ = F.find((U) => U.startIndex <= p && U.endIndex >= p);
|
|
4807
|
-
if (f > M && f <
|
|
4808
|
-
|
|
4809
|
-
else if (p > M && p <
|
|
4810
|
-
|
|
4811
|
-
else if (M > f &&
|
|
4812
|
-
if (
|
|
4807
|
+
if (f > M && f < w)
|
|
4808
|
+
P = r.findNodePositionByCharIndex(ee.startIndex + 2, !0, i, a), N = r.findNodePositionByCharIndex(w - 4, !0, i, a), m = w + 1;
|
|
4809
|
+
else if (p > M && p < w)
|
|
4810
|
+
P = r.findNodePositionByCharIndex(M + 3, !0, i, a), N = r.findNodePositionByCharIndex($.endIndex - 3, !0, i, a), I = M - 1, y = !0;
|
|
4811
|
+
else if (M > f && w < p) {
|
|
4812
|
+
if (P = r.findNodePositionByCharIndex(M + 3, !0, i, a), N = r.findNodePositionByCharIndex(w - 4, !0, i, a), m <= M - 1) {
|
|
4813
4813
|
const U = r.findNodePositionByCharIndex(m, !0, i, a), H = r.findNodePositionByCharIndex(M - 1, !1, i, a), k = g === De.FORWARD ? U : H, ne = g === De.FORWARD ? H : U;
|
|
4814
4814
|
c.push(new Zt(t, o, r, k, ne, s, i, a));
|
|
4815
4815
|
}
|
|
4816
|
-
m =
|
|
4816
|
+
m = w + 1;
|
|
4817
4817
|
}
|
|
4818
|
-
if (
|
|
4819
|
-
const U = g === De.FORWARD ?
|
|
4818
|
+
if (P && N) {
|
|
4819
|
+
const U = g === De.FORWARD ? P : N, H = g === De.FORWARD ? N : P;
|
|
4820
4820
|
d.push(...$o(
|
|
4821
4821
|
t,
|
|
4822
4822
|
o,
|
|
@@ -4830,10 +4830,10 @@ function Er(n, e, t, o, r, s, i, a) {
|
|
|
4830
4830
|
}
|
|
4831
4831
|
}
|
|
4832
4832
|
if (I === E + 1 && !y && C && C.children.length && (I = E, y = !0), I >= R && I <= E || y) {
|
|
4833
|
-
const M = r.findNodePositionByCharIndex(m, !0, i, a),
|
|
4834
|
-
if (d.length && ue.diffValue(F,
|
|
4833
|
+
const M = r.findNodePositionByCharIndex(m, !0, i, a), w = r.findNodePositionByCharIndex(I, !y, i, a), F = g === De.FORWARD ? M : w, P = g === De.FORWARD ? w : M;
|
|
4834
|
+
if (d.length && ue.diffValue(F, P))
|
|
4835
4835
|
continue;
|
|
4836
|
-
c.push(new Zt(t, o, r, F,
|
|
4836
|
+
c.push(new Zt(t, o, r, F, P, s, i, a));
|
|
4837
4837
|
}
|
|
4838
4838
|
}
|
|
4839
4839
|
return {
|
|
@@ -5632,28 +5632,28 @@ const Vo = {
|
|
|
5632
5632
|
params: {
|
|
5633
5633
|
unitId: i,
|
|
5634
5634
|
actions: [],
|
|
5635
|
-
textRanges: A ===
|
|
5635
|
+
textRanges: A === Pe.TRADITIONAL && d ? [] : h
|
|
5636
5636
|
}
|
|
5637
5637
|
}, g = W.getInstance(), f = [];
|
|
5638
5638
|
let p;
|
|
5639
|
-
if (A === void 0 ? p = g.insertOp(["documentStyle", "documentFlavor"],
|
|
5639
|
+
if (A === void 0 ? p = g.insertOp(["documentStyle", "documentFlavor"], Pe.MODERN) : A === Pe.MODERN ? p = g.replaceOp(["documentStyle", "documentFlavor"], A, Pe.TRADITIONAL) : p = g.replaceOp(["documentStyle", "documentFlavor"], A, Pe.MODERN), p)
|
|
5640
5640
|
f.push(p);
|
|
5641
5641
|
else
|
|
5642
5642
|
return !1;
|
|
5643
|
-
if (A !==
|
|
5643
|
+
if (A !== Pe.MODERN) {
|
|
5644
5644
|
const b = s.getSnapshot(), { drawings: x = {}, body: C } = b, B = (v = C == null ? void 0 : C.customBlocks) != null ? v : [];
|
|
5645
5645
|
for (const y in x) {
|
|
5646
|
-
const M = x[y],
|
|
5647
|
-
if (
|
|
5646
|
+
const M = x[y], w = B.find((he) => he.blockId === y);
|
|
5647
|
+
if (w == null)
|
|
5648
5648
|
continue;
|
|
5649
|
-
const F = M.docTransform.positionV, { relativeFrom:
|
|
5650
|
-
if (
|
|
5649
|
+
const F = M.docTransform.positionV, { relativeFrom: P, posOffset: N } = F;
|
|
5650
|
+
if (P === gt.PARAGRAPH)
|
|
5651
5651
|
continue;
|
|
5652
|
-
const { startIndex: ee } =
|
|
5652
|
+
const { startIndex: ee } = w, $ = a.findNodeByCharIndex(ee, d, l), U = (R = $ == null ? void 0 : $.parent) == null ? void 0 : R.parent, H = U == null ? void 0 : U.parent, k = H == null ? void 0 : H.lines.find((he) => he.paragraphIndex === (U == null ? void 0 : U.paragraphIndex) && he.paragraphStart), ne = (E = H == null ? void 0 : H.parent) == null ? void 0 : E.parent;
|
|
5653
5653
|
if ($ == null || U == null || k == null || H == null || ne == null)
|
|
5654
5654
|
continue;
|
|
5655
5655
|
let ie = 0;
|
|
5656
|
-
|
|
5656
|
+
P === gt.LINE ? ie -= U.top : P === gt.PAGE && (ie += ne.marginTop), ie += k.top;
|
|
5657
5657
|
const ae = {
|
|
5658
5658
|
...F,
|
|
5659
5659
|
relativeFrom: gt.PARAGRAPH,
|
|
@@ -5669,7 +5669,7 @@ const Vo = {
|
|
|
5669
5669
|
type: D.COMMAND,
|
|
5670
5670
|
// eslint-disable-next-line max-lines-per-function
|
|
5671
5671
|
handler: async (n, e) => {
|
|
5672
|
-
var ae, oe, he,
|
|
5672
|
+
var ae, oe, he, we, Ze;
|
|
5673
5673
|
const { rowCount: t, colCount: o } = e, r = n.get(Y), s = n.get(L), i = n.get(T), a = n.get(at), c = r.getActiveTextRange();
|
|
5674
5674
|
if (c == null)
|
|
5675
5675
|
return !1;
|
|
@@ -5710,30 +5710,30 @@ const Vo = {
|
|
|
5710
5710
|
p,
|
|
5711
5711
|
B,
|
|
5712
5712
|
y
|
|
5713
|
-
), { dataStream:
|
|
5713
|
+
), { dataStream: w, paragraphs: F, sectionBreaks: P } = pd(t, o), N = (Ze = (we = (he = (oe = S.parent) == null ? void 0 : oe.parent) == null ? void 0 : he.parent) == null ? void 0 : we.parent) == null ? void 0 : Ze.parent;
|
|
5714
5714
|
if (N == null)
|
|
5715
5715
|
return !1;
|
|
5716
5716
|
const { pageWidth: ee, marginLeft: $, marginRight: U } = N, H = Ea(t, o, ee - $ - U);
|
|
5717
5717
|
v.push({
|
|
5718
5718
|
t: G.INSERT,
|
|
5719
5719
|
body: {
|
|
5720
|
-
dataStream:
|
|
5720
|
+
dataStream: w,
|
|
5721
5721
|
paragraphs: F,
|
|
5722
|
-
sectionBreaks:
|
|
5722
|
+
sectionBreaks: P,
|
|
5723
5723
|
textRuns: [{
|
|
5724
5724
|
...M,
|
|
5725
5725
|
st: 0,
|
|
5726
|
-
ed:
|
|
5726
|
+
ed: w.length
|
|
5727
5727
|
}],
|
|
5728
5728
|
tables: [
|
|
5729
5729
|
{
|
|
5730
5730
|
startIndex: 0,
|
|
5731
|
-
endIndex:
|
|
5731
|
+
endIndex: w.length,
|
|
5732
5732
|
tableId: H.tableId
|
|
5733
5733
|
}
|
|
5734
5734
|
]
|
|
5735
5735
|
},
|
|
5736
|
-
len:
|
|
5736
|
+
len: w.length
|
|
5737
5737
|
});
|
|
5738
5738
|
const k = Ae(A, d);
|
|
5739
5739
|
E.push(R.editOp(v.serialize(), k));
|
|
@@ -5820,21 +5820,21 @@ const Vo = {
|
|
|
5820
5820
|
}
|
|
5821
5821
|
};
|
|
5822
5822
|
for (const y of p) {
|
|
5823
|
-
const { retain: M, delete:
|
|
5823
|
+
const { retain: M, delete: w } = y;
|
|
5824
5824
|
M > 0 && u.push({
|
|
5825
5825
|
t: G.RETAIN,
|
|
5826
5826
|
len: M
|
|
5827
5827
|
}), u.push({
|
|
5828
5828
|
t: G.DELETE,
|
|
5829
|
-
len:
|
|
5829
|
+
len: w
|
|
5830
5830
|
});
|
|
5831
5831
|
}
|
|
5832
5832
|
const C = Ae(c, a);
|
|
5833
5833
|
E.push(g.editOp(u.serialize(), C)), m.reverse();
|
|
5834
5834
|
for (let y = 0; y < v; y++)
|
|
5835
5835
|
for (const M of m) {
|
|
5836
|
-
const
|
|
5837
|
-
E.push(
|
|
5836
|
+
const w = g.removeOp(["tableSource", I, "tableRows", y, "tableCells", M]);
|
|
5837
|
+
E.push(w);
|
|
5838
5838
|
}
|
|
5839
5839
|
for (const y of m) {
|
|
5840
5840
|
const M = g.removeOp(["tableSource", I, "tableColumns", y]);
|
|
@@ -5940,8 +5940,8 @@ const Vo = {
|
|
|
5940
5940
|
});
|
|
5941
5941
|
const y = Ae(l, d);
|
|
5942
5942
|
E.push(p.editOp(f.serialize(), y));
|
|
5943
|
-
const M = qr(S),
|
|
5944
|
-
return E.push(
|
|
5943
|
+
const M = qr(S), w = p.insertOp(["tableSource", v, "tableRows", R], M);
|
|
5944
|
+
return E.push(w), C.params.actions = E.reduce((P, N) => W.compose(P, N), null), !!s.syncExecuteCommand(C.id, C.params);
|
|
5945
5945
|
}
|
|
5946
5946
|
}, SA = {
|
|
5947
5947
|
id: Cs,
|
|
@@ -5988,10 +5988,10 @@ const Vo = {
|
|
|
5988
5988
|
const B = Ae(l, d);
|
|
5989
5989
|
E.push(p.editOp(f.serialize(), B));
|
|
5990
5990
|
for (let oe = 0; oe < R; oe++) {
|
|
5991
|
-
const he = Kr(),
|
|
5992
|
-
E.push(
|
|
5991
|
+
const he = Kr(), we = p.insertOp(["tableSource", v, "tableRows", oe, "tableCells", S], he);
|
|
5992
|
+
E.push(we);
|
|
5993
5993
|
}
|
|
5994
|
-
const y = l.getSnapshot(), M = y.documentStyle, { marginLeft:
|
|
5994
|
+
const y = l.getSnapshot(), M = y.documentStyle, { marginLeft: w = 0, marginRight: F = 0 } = M, P = ((ie = (ne = M.pageSize) == null ? void 0 : ne.width) != null ? ie : 800) - w - F, N = (ae = y == null ? void 0 : y.tableSource) == null ? void 0 : ae[v].tableColumns, { newColWidth: ee, widths: $ } = vd(P, N, S);
|
|
5995
5995
|
for (let oe = 0; oe < $.length; oe++) {
|
|
5996
5996
|
const he = p.replaceOp(["tableSource", v, "tableColumns", oe, "size", "width", "v"], N[oe].size.width.v, $[oe]);
|
|
5997
5997
|
E.push(he);
|
|
@@ -6446,7 +6446,7 @@ const DA = {
|
|
|
6446
6446
|
}));
|
|
6447
6447
|
});
|
|
6448
6448
|
oc.displayName = "H4Icon";
|
|
6449
|
-
const
|
|
6449
|
+
const wA = {
|
|
6450
6450
|
tag: "svg",
|
|
6451
6451
|
attrs: {
|
|
6452
6452
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6472,11 +6472,11 @@ const PA = {
|
|
|
6472
6472
|
return Be(_e, Object.assign({}, e, {
|
|
6473
6473
|
id: "h5-icon",
|
|
6474
6474
|
ref: t,
|
|
6475
|
-
icon:
|
|
6475
|
+
icon: wA
|
|
6476
6476
|
}));
|
|
6477
6477
|
});
|
|
6478
6478
|
rc.displayName = "H5Icon";
|
|
6479
|
-
const
|
|
6479
|
+
const PA = {
|
|
6480
6480
|
tag: "svg",
|
|
6481
6481
|
attrs: {
|
|
6482
6482
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6519,7 +6519,7 @@ const wA = {
|
|
|
6519
6519
|
return Be(_e, Object.assign({}, e, {
|
|
6520
6520
|
id: "horizontally-icon",
|
|
6521
6521
|
ref: t,
|
|
6522
|
-
icon:
|
|
6522
|
+
icon: PA
|
|
6523
6523
|
}));
|
|
6524
6524
|
});
|
|
6525
6525
|
sc.displayName = "HorizontallyIcon";
|
|
@@ -6925,7 +6925,8 @@ class HA extends me {
|
|
|
6925
6925
|
return this._undoRedoService.clearUndoRedo(t);
|
|
6926
6926
|
}
|
|
6927
6927
|
dispose() {
|
|
6928
|
-
this._getDocDataModel()
|
|
6928
|
+
const t = this._getDocDataModel();
|
|
6929
|
+
t == null || t.dispose();
|
|
6929
6930
|
}
|
|
6930
6931
|
/**
|
|
6931
6932
|
* @deprecated use getEditorId.
|
|
@@ -7432,7 +7433,7 @@ let Cr = class extends me {
|
|
|
7432
7433
|
this._commandService.onCommandExecuted((e) => {
|
|
7433
7434
|
if (X.id === e.id) {
|
|
7434
7435
|
const t = this._context.unit, r = this._docSkeletonManagerService.getViewModel().getEditArea(), s = t.getSnapshot().documentStyle.documentFlavor;
|
|
7435
|
-
r !== ve.BODY && s ===
|
|
7436
|
+
r !== ve.BODY && s === Pe.MODERN && this._commandService.executeCommand(Ms.id, {
|
|
7436
7437
|
unitId: this._context.unitId
|
|
7437
7438
|
});
|
|
7438
7439
|
}
|
|
@@ -7565,7 +7566,7 @@ let Cr = class extends me {
|
|
|
7565
7566
|
return t ? t.isReadOnly() : !1;
|
|
7566
7567
|
}
|
|
7567
7568
|
_isTraditionalMode() {
|
|
7568
|
-
return this._context.unit.getSnapshot().documentStyle.documentFlavor ===
|
|
7569
|
+
return this._context.unit.getSnapshot().documentStyle.documentFlavor === Pe.TRADITIONAL;
|
|
7569
7570
|
}
|
|
7570
7571
|
};
|
|
7571
7572
|
Cr = XA([
|
|
@@ -8068,18 +8069,18 @@ function su(n) {
|
|
|
8068
8069
|
return;
|
|
8069
8070
|
}
|
|
8070
8071
|
const { documentStyle: A } = l.getSnapshot();
|
|
8071
|
-
o.next((A == null ? void 0 : A.documentFlavor) !==
|
|
8072
|
+
o.next((A == null ? void 0 : A.documentFlavor) !== Pe.TRADITIONAL);
|
|
8072
8073
|
}
|
|
8073
8074
|
}), s = e.focused$.subscribe((c) => {
|
|
8074
8075
|
if (c == null)
|
|
8075
8076
|
return o.next(!0);
|
|
8076
8077
|
const d = e.getUniverDocInstance(c), l = d == null ? void 0 : d.getSnapshot().documentStyle.documentFlavor;
|
|
8077
|
-
o.next(l !==
|
|
8078
|
+
o.next(l !== Pe.TRADITIONAL);
|
|
8078
8079
|
}), i = e.getCurrentUniverDocInstance();
|
|
8079
8080
|
if (i == null)
|
|
8080
8081
|
return o.next(!0);
|
|
8081
8082
|
const a = i == null ? void 0 : i.getSnapshot().documentStyle.documentFlavor;
|
|
8082
|
-
return o.next(a !==
|
|
8083
|
+
return o.next(a !== Pe.TRADITIONAL), () => {
|
|
8083
8084
|
r.dispose(), s.unsubscribe();
|
|
8084
8085
|
};
|
|
8085
8086
|
});
|
|
@@ -8479,7 +8480,7 @@ function mu(n) {
|
|
|
8479
8480
|
type: Z.BUTTON,
|
|
8480
8481
|
icon: "HeaderFooterIcon",
|
|
8481
8482
|
tooltip: "toolbar.headerFooter",
|
|
8482
|
-
hidden$:
|
|
8483
|
+
hidden$: Pn(se(n, _.UNIVER_DOC, void 0, nt), su(n), (e, t) => e || t)
|
|
8483
8484
|
};
|
|
8484
8485
|
}
|
|
8485
8486
|
const Eu = "GridIcon", mc = "doc.menu.table";
|
|
@@ -8491,7 +8492,7 @@ function Iu(n) {
|
|
|
8491
8492
|
tooltip: "toolbar.table.main",
|
|
8492
8493
|
disabled$: iu(n),
|
|
8493
8494
|
// Do not show header footer menu and insert table at zen mode.
|
|
8494
|
-
hidden$:
|
|
8495
|
+
hidden$: Pn(se(n, _.UNIVER_DOC, void 0, nt), ru(n), (e, t) => e || t)
|
|
8495
8496
|
};
|
|
8496
8497
|
}
|
|
8497
8498
|
function Su(n) {
|
|
@@ -8659,7 +8660,7 @@ function xi(n) {
|
|
|
8659
8660
|
tooltip: "toolbar.order",
|
|
8660
8661
|
hidden$: se(n, _.UNIVER_DOC),
|
|
8661
8662
|
disabled$: ye(n),
|
|
8662
|
-
activated$: Tn(n).pipe(
|
|
8663
|
+
activated$: Tn(n).pipe(wn((e) => !!(e && e.indexOf("ORDER_LIST") === 0)))
|
|
8663
8664
|
};
|
|
8664
8665
|
}
|
|
8665
8666
|
function yi(n) {
|
|
@@ -8681,7 +8682,7 @@ function yi(n) {
|
|
|
8681
8682
|
tooltip: "toolbar.unorder",
|
|
8682
8683
|
disabled$: ye(n),
|
|
8683
8684
|
hidden$: se(n, _.UNIVER_DOC),
|
|
8684
|
-
activated$: Tn(n).pipe(
|
|
8685
|
+
activated$: Tn(n).pipe(wn((e) => !!(e && e.indexOf("BULLET_LIST") === 0)))
|
|
8685
8686
|
};
|
|
8686
8687
|
}
|
|
8687
8688
|
function Oi(n) {
|
|
@@ -8692,7 +8693,7 @@ function Oi(n) {
|
|
|
8692
8693
|
tooltip: "toolbar.checklist",
|
|
8693
8694
|
disabled$: ye(n),
|
|
8694
8695
|
hidden$: se(n, _.UNIVER_DOC),
|
|
8695
|
-
activated$: Tn(n).pipe(
|
|
8696
|
+
activated$: Tn(n).pipe(wn((e) => !!(e && e.indexOf("CHECK_LIST") === 0)))
|
|
8696
8697
|
};
|
|
8697
8698
|
}
|
|
8698
8699
|
function yu(n) {
|
|
@@ -8709,10 +8710,10 @@ function yu(n) {
|
|
|
8709
8710
|
var c;
|
|
8710
8711
|
if (a.id === X.id) {
|
|
8711
8712
|
const d = t.getCurrentUnitForType(_.UNIVER_DOC);
|
|
8712
|
-
o.next(((c = d == null ? void 0 : d.getSnapshot()) == null ? void 0 : c.documentStyle.documentFlavor) ===
|
|
8713
|
+
o.next(((c = d == null ? void 0 : d.getSnapshot()) == null ? void 0 : c.documentStyle.documentFlavor) === Pe.MODERN);
|
|
8713
8714
|
}
|
|
8714
8715
|
}), s = t.getCurrentUnitForType(_.UNIVER_DOC);
|
|
8715
|
-
return o.next(((i = s == null ? void 0 : s.getSnapshot()) == null ? void 0 : i.documentStyle.documentFlavor) ===
|
|
8716
|
+
return o.next(((i = s == null ? void 0 : s.getSnapshot()) == null ? void 0 : i.documentStyle.documentFlavor) === Pe.MODERN), () => r.dispose();
|
|
8716
8717
|
})
|
|
8717
8718
|
};
|
|
8718
8719
|
}
|
|
@@ -8870,7 +8871,7 @@ const Mu = {
|
|
|
8870
8871
|
return a(), c.dispose;
|
|
8871
8872
|
})
|
|
8872
8873
|
};
|
|
8873
|
-
}, _u = yt(K.HEADING_1), Du = yt(K.HEADING_2),
|
|
8874
|
+
}, _u = yt(K.HEADING_1), Du = yt(K.HEADING_2), wu = yt(K.HEADING_3), Pu = yt(K.HEADING_4), Nu = yt(K.HEADING_5), Lu = yt(K.NORMAL_TEXT);
|
|
8874
8875
|
yt(K.TITLE);
|
|
8875
8876
|
yt(K.SUBTITLE);
|
|
8876
8877
|
const Qu = (n) => ({
|
|
@@ -9089,7 +9090,7 @@ let Bn = class extends me {
|
|
|
9089
9090
|
const { direction: r = "top", multipleDirection: s } = e, i = this._renderManagerService.getRenderById(t);
|
|
9090
9091
|
if (!i)
|
|
9091
9092
|
throw new Error(`Current render not found, unitId: ${t}`);
|
|
9092
|
-
const { positions: a, positions$: c, disposable: d } = this._createRangePositionObserver(n, i), l = c.pipe(
|
|
9093
|
+
const { positions: a, positions$: c, disposable: d } = this._createRangePositionObserver(n, i), l = c.pipe(wn((h) => r.includes("top") ? h[0] : h[h.length - 1])), A = this._globalPopupManagerService.addPopup({
|
|
9093
9094
|
...e,
|
|
9094
9095
|
unitId: t,
|
|
9095
9096
|
subUnitId: "default",
|
|
@@ -9110,7 +9111,7 @@ let Bn = class extends me {
|
|
|
9110
9111
|
// #endregion
|
|
9111
9112
|
};
|
|
9112
9113
|
Bn = Gu([
|
|
9113
|
-
Wn(0, z(
|
|
9114
|
+
Wn(0, z(wl)),
|
|
9114
9115
|
Wn(1, pe),
|
|
9115
9116
|
Wn(2, L),
|
|
9116
9117
|
Wn(3, T)
|
|
@@ -9190,7 +9191,7 @@ function Tt(n, e, t) {
|
|
|
9190
9191
|
const { left: o, right: r, top: s, bottom: i } = t;
|
|
9191
9192
|
return n >= o && n <= r && e >= s && e <= i;
|
|
9192
9193
|
}
|
|
9193
|
-
let
|
|
9194
|
+
let Pt = class extends me {
|
|
9194
9195
|
constructor(e, t) {
|
|
9195
9196
|
super();
|
|
9196
9197
|
O(this, "_hoverCustomRanges$", new Fe([]));
|
|
@@ -9291,7 +9292,7 @@ let wt = class extends me {
|
|
|
9291
9292
|
}));
|
|
9292
9293
|
const e = Mt(this._context.mainComponent.onPointerDown$), t = Mt(this._context.scene.onPointerUp$);
|
|
9293
9294
|
this.disposeWithMe(e.pipe(
|
|
9294
|
-
Wl((o) => t.pipe(zl(1),
|
|
9295
|
+
Wl((o) => t.pipe(zl(1), wn((r) => ({ down: o, up: r })))),
|
|
9295
9296
|
ro(({ down: o, up: r }) => o.target === r.target && r.timeStamp - o.timeStamp < 300)
|
|
9296
9297
|
).subscribe(({ down: o }) => {
|
|
9297
9298
|
if (o.button === 2)
|
|
@@ -9438,18 +9439,18 @@ let wt = class extends me {
|
|
|
9438
9439
|
}), p.rows.forEach((E, b) => {
|
|
9439
9440
|
E.cells.forEach((x, C) => {
|
|
9440
9441
|
const B = ((u.pageHeight === 1 / 0 ? 0 : u.pageHeight) + r.pageMarginTop) * h + p.top + r.docsTop + u.marginTop + E.top + x.marginTop, y = p.left + r.docsLeft + u.marginLeft + x.left + x.marginLeft, M = _i(x.sections, B, y, x.pageWidth - x.marginLeft - x.marginRight);
|
|
9441
|
-
let
|
|
9442
|
-
|
|
9443
|
-
...M.map((
|
|
9444
|
-
rect:
|
|
9445
|
-
paragraphStart:
|
|
9446
|
-
paragraphEnd:
|
|
9447
|
-
startIndex:
|
|
9442
|
+
let w = this._tableParagraphBounds.get(R);
|
|
9443
|
+
w || (w = [], this._tableParagraphBounds.set(R, w)), w.push(
|
|
9444
|
+
...M.map((P) => ({
|
|
9445
|
+
rect: P.rect,
|
|
9446
|
+
paragraphStart: P.paragraphStart,
|
|
9447
|
+
paragraphEnd: P.paragraphEnd,
|
|
9448
|
+
startIndex: P.startIndex,
|
|
9448
9449
|
pageIndex: h,
|
|
9449
9450
|
segmentId: e,
|
|
9450
9451
|
rowIndex: b,
|
|
9451
9452
|
colIndex: C,
|
|
9452
|
-
firstLine:
|
|
9453
|
+
firstLine: P.fisrtLine,
|
|
9453
9454
|
tableId: R
|
|
9454
9455
|
}))
|
|
9455
9456
|
);
|
|
@@ -9537,9 +9538,9 @@ let wt = class extends me {
|
|
|
9537
9538
|
return t || Array.from(this._tableParagraphBounds.values()).flat().find((r) => r.startIndex === e);
|
|
9538
9539
|
}
|
|
9539
9540
|
};
|
|
9540
|
-
|
|
9541
|
+
Pt = Ku([
|
|
9541
9542
|
qu(1, z(de))
|
|
9542
|
-
],
|
|
9543
|
+
], Pt);
|
|
9543
9544
|
const Ju = [
|
|
9544
9545
|
ct.id,
|
|
9545
9546
|
Qt.id,
|
|
@@ -9571,7 +9572,7 @@ function $u(n) {
|
|
|
9571
9572
|
"div",
|
|
9572
9573
|
{
|
|
9573
9574
|
className: je("univer-box-border univer-flex univer-rounded univer-bg-white univer-py-1.5 univer-shadow-sm dark:!univer-border-gray-700 dark:!univer-bg-gray-900", Nn),
|
|
9574
|
-
children: o.map((s) => s.item && /* @__PURE__ */ Q("div", { className: "univer-flex univer-flex-nowrap univer-gap-2 univer-px-2", children: /* @__PURE__ */ Q(
|
|
9575
|
+
children: o.map((s) => s.item && /* @__PURE__ */ Q("div", { className: "univer-flex univer-flex-nowrap univer-gap-2 univer-px-2", children: /* @__PURE__ */ Q(Pl, { ...s.item }, s.key) }, s.key))
|
|
9575
9576
|
}
|
|
9576
9577
|
);
|
|
9577
9578
|
}
|
|
@@ -9700,7 +9701,7 @@ let Ao = class extends me {
|
|
|
9700
9701
|
this.hideParagraphMenu(!0);
|
|
9701
9702
|
};
|
|
9702
9703
|
this.disposeWithMe(
|
|
9703
|
-
|
|
9704
|
+
Pn([this._docEventManagerService.hoverParagraphRealTime$, this._docEventManagerService.hoverParagraphLeft$]).pipe(Rn(16)).subscribe(([o, r]) => {
|
|
9704
9705
|
const s = o != null ? o : r;
|
|
9705
9706
|
e(s);
|
|
9706
9707
|
})
|
|
@@ -9746,14 +9747,14 @@ let Ao = class extends me {
|
|
|
9746
9747
|
};
|
|
9747
9748
|
Ao = sh([
|
|
9748
9749
|
dn(1, z(Y)),
|
|
9749
|
-
dn(2, z(
|
|
9750
|
+
dn(2, z(Pt)),
|
|
9750
9751
|
dn(3, z(Bn)),
|
|
9751
9752
|
dn(4, z(de)),
|
|
9752
9753
|
dn(5, z(lo))
|
|
9753
9754
|
], Ao);
|
|
9754
9755
|
const ih = ({ popup: n }) => {
|
|
9755
9756
|
var E, b;
|
|
9756
|
-
const [e, t] = Ee(!1), o = ke(null), r = J(T), s = J(To), i = ke(null), a = ke(!1), c = J(pe), d = J(L), l = c.getRenderById(n.unitId), A = d.getUnit(n.unitId, _.UNIVER_DOC), h = l == null ? void 0 : l.with(Ao), u = l == null ? void 0 : l.with(
|
|
9757
|
+
const [e, t] = Ee(!1), o = ke(null), r = J(T), s = J(To), i = ke(null), a = ke(!1), c = J(pe), d = J(L), l = c.getRenderById(n.unitId), A = d.getUnit(n.unitId, _.UNIVER_DOC), h = l == null ? void 0 : l.with(Ao), u = l == null ? void 0 : l.with(Pt), g = et(u == null ? void 0 : u.hoverParagraph$), f = et(u == null ? void 0 : u.hoverParagraphLeft$), p = (E = g != null ? g : f) == null ? void 0 : E.startIndex, m = Te(() => {
|
|
9757
9758
|
var x, C;
|
|
9758
9759
|
return (C = (x = A == null ? void 0 : A.getBody()) == null ? void 0 : x.paragraphs) == null ? void 0 : C.find((B) => B.startIndex === p);
|
|
9759
9760
|
}, [A, g]), I = (b = m == null ? void 0 : m.paragraphStyle) == null ? void 0 : b.namedStyleType, S = Ec[I != null ? I : K.NORMAL_TEXT], v = Te(() => new Fe({
|
|
@@ -9775,14 +9776,14 @@ const ih = ({ popup: n }) => {
|
|
|
9775
9776
|
"univer-bg-white dark:!univer-bg-gray-700": !e
|
|
9776
9777
|
}),
|
|
9777
9778
|
onMouseEnter: (x) => {
|
|
9778
|
-
var B, y, M,
|
|
9779
|
+
var B, y, M, w, F, P;
|
|
9779
9780
|
(B = n.onPointerEnter) == null || B.call(n, x), a.current = !0;
|
|
9780
9781
|
const C = (y = i.current) == null ? void 0 : y.getBoundingClientRect();
|
|
9781
9782
|
v.next({
|
|
9782
9783
|
left: ((M = C == null ? void 0 : C.left) != null ? M : 0) - 4,
|
|
9783
|
-
right: (
|
|
9784
|
+
right: (w = C == null ? void 0 : C.right) != null ? w : 0,
|
|
9784
9785
|
top: (F = C == null ? void 0 : C.top) != null ? F : 0,
|
|
9785
|
-
bottom: (
|
|
9786
|
+
bottom: (P = C == null ? void 0 : C.bottom) != null ? P : 0
|
|
9786
9787
|
});
|
|
9787
9788
|
},
|
|
9788
9789
|
onMouseLeave: () => {
|
|
@@ -9909,7 +9910,7 @@ const ch = {
|
|
|
9909
9910
|
id: yn.id,
|
|
9910
9911
|
binding: q.Digit8 | te.CTRL_COMMAND | te.SHIFT,
|
|
9911
9912
|
preconditions: Se
|
|
9912
|
-
}, Wo = "docs-ui.config",
|
|
9913
|
+
}, Wo = "docs-ui.config", wi = {
|
|
9913
9914
|
layout: {
|
|
9914
9915
|
docContainerConfig: rd,
|
|
9915
9916
|
toolbarConfig: od
|
|
@@ -10065,7 +10066,7 @@ const Oh = "univer-font-[500] univer-truncate univer-h-[24px] univer-mb-2 univer
|
|
|
10065
10066
|
return 1;
|
|
10066
10067
|
}
|
|
10067
10068
|
};
|
|
10068
|
-
function
|
|
10069
|
+
function wh(n, e, t, o) {
|
|
10069
10070
|
var a, c;
|
|
10070
10071
|
if (!n)
|
|
10071
10072
|
return;
|
|
@@ -10083,15 +10084,15 @@ function Ph(n, e, t, o) {
|
|
|
10083
10084
|
return A.paragraphStyle.headingId;
|
|
10084
10085
|
}
|
|
10085
10086
|
}
|
|
10086
|
-
const
|
|
10087
|
-
function
|
|
10087
|
+
const Pi = "__title";
|
|
10088
|
+
function Ph() {
|
|
10088
10089
|
var e, t, o;
|
|
10089
10090
|
const n = ua(Wo);
|
|
10090
10091
|
return (o = (t = (e = n == null ? void 0 : n.layout) == null ? void 0 : e.docContainerConfig) == null ? void 0 : t.sideMenu) == null || o ? /* @__PURE__ */ Q(Nh, {}) : null;
|
|
10091
10092
|
}
|
|
10092
10093
|
function Nh() {
|
|
10093
|
-
var B, y, M,
|
|
10094
|
-
const n = J(T), e = J(L), t = et(Te(() => e.getCurrentTypeOfUnit$(_.UNIVER_DOC), [])), o = J(pe), r = (y = (B = t == null ? void 0 : t.getBody()) == null ? void 0 : B.dataStream) != null ? y : "", [s, i] = Ee(0), [a, c] = Ee(void 0), d = (M = t == null ? void 0 : t.getUnitId()) != null ? M : "", l = o.getRenderById(d), A = t == null ? void 0 : t.getTitle(), h = l == null ? void 0 : l.with(
|
|
10094
|
+
var B, y, M, w, F, P, N, ee, $;
|
|
10095
|
+
const n = J(T), e = J(L), t = et(Te(() => e.getCurrentTypeOfUnit$(_.UNIVER_DOC), [])), o = J(pe), r = (y = (B = t == null ? void 0 : t.getBody()) == null ? void 0 : B.dataStream) != null ? y : "", [s, i] = Ee(0), [a, c] = Ee(void 0), d = (M = t == null ? void 0 : t.getUnitId()) != null ? M : "", l = o.getRenderById(d), A = t == null ? void 0 : t.getTitle(), h = l == null ? void 0 : l.with(Pt), u = h == null ? void 0 : h.paragraphBounds, g = (F = (w = l == null ? void 0 : l.mainComponent) == null ? void 0 : w.left) != null ? F : 0, f = (P = l == null ? void 0 : l.engine.height) != null ? P : 0, p = (N = l == null ? void 0 : l.scene.scaleY) != null ? N : 1, m = ($ = (ee = t == null ? void 0 : t.getBody()) == null ? void 0 : ee.paragraphs) != null ? $ : [], I = Te(() => {
|
|
10095
10096
|
const U = /* @__PURE__ */ new Map();
|
|
10096
10097
|
return m.forEach((H) => {
|
|
10097
10098
|
U.set(H.startIndex, H);
|
|
@@ -10115,11 +10116,11 @@ function Nh() {
|
|
|
10115
10116
|
isTitle: ((ae = U.paragraphStyle) == null ? void 0 : ae.namedStyleType) === K.TITLE
|
|
10116
10117
|
};
|
|
10117
10118
|
}).filter((U) => U == null ? void 0 : U.text), R = mn((U) => {
|
|
10118
|
-
const H = U.viewportScrollY, k = H + f / p, ne =
|
|
10119
|
+
const H = U.viewportScrollY, k = H + f / p, ne = wh(u, I, H, k);
|
|
10119
10120
|
ne && c(ne);
|
|
10120
10121
|
}), E = v != null && v.find((U) => U.isTitle) ? v : [
|
|
10121
10122
|
...A ? [{
|
|
10122
|
-
id:
|
|
10123
|
+
id: Pi,
|
|
10123
10124
|
text: A,
|
|
10124
10125
|
level: 1,
|
|
10125
10126
|
isTitle: !0
|
|
@@ -10146,7 +10147,7 @@ function Nh() {
|
|
|
10146
10147
|
const H = l == null ? void 0 : l.scene.getViewport(We.VIEW_MAIN);
|
|
10147
10148
|
if (!H)
|
|
10148
10149
|
return;
|
|
10149
|
-
if (U.id ===
|
|
10150
|
+
if (U.id === Pi) {
|
|
10150
10151
|
H.scrollToViewportPos({ viewportScrollY: 0 });
|
|
10151
10152
|
return;
|
|
10152
10153
|
}
|
|
@@ -10527,7 +10528,7 @@ const Ds = {
|
|
|
10527
10528
|
id: "sidebar.operation.doc-paragraph-setting-panel",
|
|
10528
10529
|
type: D.OPERATION,
|
|
10529
10530
|
handler: (n) => (n.get(tn).openPanel(), !0)
|
|
10530
|
-
},
|
|
10531
|
+
}, ws = (n) => {
|
|
10531
10532
|
const e = n.get(Y);
|
|
10532
10533
|
return new fe((t) => {
|
|
10533
10534
|
const o = e.textSelection$.subscribe(() => {
|
|
@@ -10575,7 +10576,7 @@ const dt = (n) => {
|
|
|
10575
10576
|
type: Z.BUTTON,
|
|
10576
10577
|
icon: "CopyDoubleIcon",
|
|
10577
10578
|
title: "rightClick.copy",
|
|
10578
|
-
disabled$:
|
|
10579
|
+
disabled$: ws(n),
|
|
10579
10580
|
hidden$: se(n, _.UNIVER_DOC)
|
|
10580
10581
|
}), $h = (n) => ({
|
|
10581
10582
|
id: Ds.id,
|
|
@@ -10588,7 +10589,7 @@ const dt = (n) => {
|
|
|
10588
10589
|
type: Z.BUTTON,
|
|
10589
10590
|
icon: "CopyDoubleIcon",
|
|
10590
10591
|
title: "rightClick.cut",
|
|
10591
|
-
disabled$:
|
|
10592
|
+
disabled$: ws(n),
|
|
10592
10593
|
hidden$: se(n, _.UNIVER_DOC)
|
|
10593
10594
|
}), tg = (n) => ({
|
|
10594
10595
|
id: is.id,
|
|
@@ -10597,11 +10598,11 @@ const dt = (n) => {
|
|
|
10597
10598
|
title: "rightClick.paste",
|
|
10598
10599
|
hidden$: se(n, _.UNIVER_DOC)
|
|
10599
10600
|
}), ng = (n) => ({
|
|
10600
|
-
id:
|
|
10601
|
+
id: wo.id,
|
|
10601
10602
|
type: Z.BUTTON,
|
|
10602
10603
|
icon: "PasteSpecialDoubleIcon",
|
|
10603
10604
|
title: "rightClick.delete",
|
|
10604
|
-
disabled$:
|
|
10605
|
+
disabled$: ws(n),
|
|
10605
10606
|
hidden$: se(n, _.UNIVER_DOC)
|
|
10606
10607
|
}), vc = "doc.menu.table-insert";
|
|
10607
10608
|
function og(n) {
|
|
@@ -10610,7 +10611,7 @@ function og(n) {
|
|
|
10610
10611
|
type: Z.SUBITEMS,
|
|
10611
10612
|
title: "table.insert",
|
|
10612
10613
|
icon: "InsertDoubleIcon",
|
|
10613
|
-
hidden$:
|
|
10614
|
+
hidden$: Pn(se(n, _.UNIVER_DOC), dt(n), (e, t) => e || t)
|
|
10614
10615
|
};
|
|
10615
10616
|
}
|
|
10616
10617
|
function rg(n) {
|
|
@@ -10660,7 +10661,7 @@ function cg(n) {
|
|
|
10660
10661
|
type: Z.SUBITEMS,
|
|
10661
10662
|
title: "table.delete",
|
|
10662
10663
|
icon: "ReduceDoubleIcon",
|
|
10663
|
-
hidden$:
|
|
10664
|
+
hidden$: Pn(se(n, _.UNIVER_DOC), dt(n), (e, t) => e || t)
|
|
10664
10665
|
};
|
|
10665
10666
|
}
|
|
10666
10667
|
function lg(n) {
|
|
@@ -10814,7 +10815,7 @@ const ug = {
|
|
|
10814
10815
|
order: 2,
|
|
10815
10816
|
menuItemFactory: tg
|
|
10816
10817
|
},
|
|
10817
|
-
[
|
|
10818
|
+
[wo.id]: {
|
|
10818
10819
|
order: 3,
|
|
10819
10820
|
menuItemFactory: ng
|
|
10820
10821
|
}
|
|
@@ -10874,11 +10875,11 @@ const ug = {
|
|
|
10874
10875
|
},
|
|
10875
10876
|
[gs.id]: {
|
|
10876
10877
|
order: 2,
|
|
10877
|
-
menuItemFactory:
|
|
10878
|
+
menuItemFactory: wu
|
|
10878
10879
|
},
|
|
10879
10880
|
[fs.id]: {
|
|
10880
10881
|
order: 3,
|
|
10881
|
-
menuItemFactory:
|
|
10882
|
+
menuItemFactory: Pu
|
|
10882
10883
|
},
|
|
10883
10884
|
[ps.id]: {
|
|
10884
10885
|
order: 4,
|
|
@@ -10964,7 +10965,7 @@ let uo = class extends me {
|
|
|
10964
10965
|
});
|
|
10965
10966
|
}
|
|
10966
10967
|
_initUiParts() {
|
|
10967
|
-
this.disposeWithMe(this._uiPartsService.registerComponent(qs.FOOTER, () => Xs(yh, this._injector))), this.disposeWithMe(this._uiPartsService.registerComponent(qs.CONTENT, () => Xs(
|
|
10968
|
+
this.disposeWithMe(this._uiPartsService.registerComponent(qs.FOOTER, () => Xs(yh, this._injector))), this.disposeWithMe(this._uiPartsService.registerComponent(qs.CONTENT, () => Xs(Ph, this._injector)));
|
|
10968
10969
|
}
|
|
10969
10970
|
_initMenus() {
|
|
10970
10971
|
this._menuManagerService.mergeMenu(ug);
|
|
@@ -11172,7 +11173,7 @@ let br = class extends Ct {
|
|
|
11172
11173
|
for (let g = 0, f = a.length; g < f; g++) {
|
|
11173
11174
|
const p = a[g];
|
|
11174
11175
|
let { pageWidth: m, pageHeight: I } = p;
|
|
11175
|
-
if (A ===
|
|
11176
|
+
if (A === Pe.MODERN) {
|
|
11176
11177
|
const S = Ig(p);
|
|
11177
11178
|
m = S.pageWidth, I = S.pageHeight;
|
|
11178
11179
|
}
|
|
@@ -11403,7 +11404,7 @@ let fo = class extends me {
|
|
|
11403
11404
|
}
|
|
11404
11405
|
};
|
|
11405
11406
|
fo = yg([
|
|
11406
|
-
Ui(0, z(
|
|
11407
|
+
Ui(0, z(wt)),
|
|
11407
11408
|
Ui(1, pe)
|
|
11408
11409
|
], fo);
|
|
11409
11410
|
function Og(n) {
|
|
@@ -11511,8 +11512,8 @@ function Dg(n) {
|
|
|
11511
11512
|
const e = El(n);
|
|
11512
11513
|
return e.lines[e.lines.length - 1];
|
|
11513
11514
|
}
|
|
11514
|
-
var
|
|
11515
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
11515
|
+
var wg = Object.getOwnPropertyDescriptor, Pg = (n, e, t, o) => {
|
|
11516
|
+
for (var r = o > 1 ? void 0 : o ? wg(e, t) : e, s = n.length - 1, i; s >= 0; s--)
|
|
11516
11517
|
(i = n[s]) && (r = i(r) || r);
|
|
11517
11518
|
return r;
|
|
11518
11519
|
}, zn = (n, e) => (t, o) => e(t, o, n);
|
|
@@ -11779,8 +11780,8 @@ let po = class extends me {
|
|
|
11779
11780
|
if (t === !0)
|
|
11780
11781
|
l = (S = (I = c.sections[h - 1]) == null ? void 0 : I.columns[0]) == null ? void 0 : S.lines[0];
|
|
11781
11782
|
else {
|
|
11782
|
-
const y = (R = (v = c.sections) == null ? void 0 : v[h - 1]) == null ? void 0 : R.columns, M = y == null ? void 0 : y[y.length - 1],
|
|
11783
|
-
l =
|
|
11783
|
+
const y = (R = (v = c.sections) == null ? void 0 : v[h - 1]) == null ? void 0 : R.columns, M = y == null ? void 0 : y[y.length - 1], w = M == null ? void 0 : M.lines;
|
|
11784
|
+
l = w == null ? void 0 : w[w.length - 1];
|
|
11784
11785
|
}
|
|
11785
11786
|
if (l != null)
|
|
11786
11787
|
return l;
|
|
@@ -11797,7 +11798,7 @@ let po = class extends me {
|
|
|
11797
11798
|
const y = (C = u.pages[g - 1]) == null ? void 0 : C.sections;
|
|
11798
11799
|
if (y == null)
|
|
11799
11800
|
return;
|
|
11800
|
-
const M = (B = y[y.length - 1]) == null ? void 0 : B.columns,
|
|
11801
|
+
const M = (B = y[y.length - 1]) == null ? void 0 : B.columns, w = M[M.length - 1], F = w == null ? void 0 : w.lines;
|
|
11801
11802
|
l = F[F.length - 1];
|
|
11802
11803
|
}
|
|
11803
11804
|
if (l != null)
|
|
@@ -11817,7 +11818,7 @@ let po = class extends me {
|
|
|
11817
11818
|
return cd(this._univerInstanceService, this._renderManagerService);
|
|
11818
11819
|
}
|
|
11819
11820
|
};
|
|
11820
|
-
po =
|
|
11821
|
+
po = Pg([
|
|
11821
11822
|
zn(0, L),
|
|
11822
11823
|
zn(1, pe),
|
|
11823
11824
|
zn(2, z(Y)),
|
|
@@ -11953,7 +11954,7 @@ let yr = class extends me {
|
|
|
11953
11954
|
yr = Fg([
|
|
11954
11955
|
jn(1, z(de)),
|
|
11955
11956
|
jn(2, T),
|
|
11956
|
-
jn(3, z(
|
|
11957
|
+
jn(3, z(Pt)),
|
|
11957
11958
|
jn(4, z(Y))
|
|
11958
11959
|
], yr);
|
|
11959
11960
|
var Hg = Object.getOwnPropertyDescriptor, kg = (n, e, t, o) => {
|
|
@@ -11972,7 +11973,7 @@ let Eo = class extends Ct {
|
|
|
11972
11973
|
var n;
|
|
11973
11974
|
(n = this._docSelectionRenderService) == null || n.onPaste$.pipe(ft(this.dispose$)).subscribe((e) => {
|
|
11974
11975
|
var a, c, d;
|
|
11975
|
-
if (!
|
|
11976
|
+
if (!Po(this._contextService))
|
|
11976
11977
|
return;
|
|
11977
11978
|
e.event.preventDefault();
|
|
11978
11979
|
const t = e.event;
|
|
@@ -12255,12 +12256,13 @@ Br = Xg([
|
|
|
12255
12256
|
Yn(3, T),
|
|
12256
12257
|
Yn(4, z(at))
|
|
12257
12258
|
], Br);
|
|
12258
|
-
class
|
|
12259
|
+
class Ps extends me {
|
|
12259
12260
|
constructor(e) {
|
|
12260
12261
|
super(), this._context = e;
|
|
12261
12262
|
}
|
|
12262
12263
|
calculatePagePosition() {
|
|
12263
12264
|
var v, R;
|
|
12265
|
+
if (this._disposed) return;
|
|
12264
12266
|
const e = pt(this._context), o = (R = (v = this._context.unit.getSettings()) == null ? void 0 : v.zoomRatio) != null ? R : 1, { document: r, scene: s, docBackground: i } = e, a = s == null ? void 0 : s.getParent(), { width: c, height: d, pageMarginLeft: l, pageMarginTop: A } = r;
|
|
12265
12267
|
if (a == null || c === Number.POSITIVE_INFINITY || d === Number.POSITIVE_INFINITY)
|
|
12266
12268
|
return;
|
|
@@ -12291,13 +12293,13 @@ let Mr = class extends me {
|
|
|
12291
12293
|
ro((n) => n.type === ra.resize),
|
|
12292
12294
|
Rn(0, Yl)
|
|
12293
12295
|
).subscribe(() => {
|
|
12294
|
-
this._docPageLayoutService.calculatePagePosition(), this._textSelectionManagerService.refreshSelection();
|
|
12296
|
+
this._disposed || (this._docPageLayoutService.calculatePagePosition(), this._textSelectionManagerService.refreshSelection());
|
|
12295
12297
|
})
|
|
12296
12298
|
);
|
|
12297
12299
|
}
|
|
12298
12300
|
};
|
|
12299
12301
|
Mr = Jg([
|
|
12300
|
-
Wi(1, z(
|
|
12302
|
+
Wi(1, z(Ps)),
|
|
12301
12303
|
Wi(2, z(Y))
|
|
12302
12304
|
], Mr);
|
|
12303
12305
|
var $g = Object.getOwnPropertyDescriptor, ef = (n, e, t, o) => {
|
|
@@ -12443,9 +12445,14 @@ let Dr = class extends me {
|
|
|
12443
12445
|
constructor(e, t, o, r, s, i, a, c, d) {
|
|
12444
12446
|
super();
|
|
12445
12447
|
O(this, "_isSheetEditor", !1);
|
|
12448
|
+
O(this, "_initTimer");
|
|
12449
|
+
O(this, "_updateTimer");
|
|
12446
12450
|
this._context = e, this._contextService = t, this._docSkeletonManagerService = o, this._univerInstanceService = r, this._commandService = s, this._textSelectionManagerService = i, this._editorService = a, this._docPageLayoutService = c, this._renderManagerService = d, this._initSkeletonListener(), this._initCommandExecutedListener(), this._initRenderRefresher(), this._isSheetEditor = this._context.unitId === xo;
|
|
12447
12451
|
const l = this._univerInstanceService.getCurrentUnitOfType(_.UNIVER_SHEET), A = l && this._renderManagerService.getRenderById(l.getUnitId());
|
|
12448
|
-
setTimeout(() => this.updateViewZoom(A && this._isSheetEditor ? A.scene.scaleX : 1, !0), 20), Rt(this._context.unitId) || this._initZoomEventListener();
|
|
12452
|
+
this._initTimer = window.setTimeout(() => this.updateViewZoom(A && this._isSheetEditor ? A.scene.scaleX : 1, !0), 20), Rt(this._context.unitId) || this._initZoomEventListener();
|
|
12453
|
+
}
|
|
12454
|
+
dispose() {
|
|
12455
|
+
window.clearTimeout(this._initTimer), window.clearTimeout(this._updateTimer);
|
|
12449
12456
|
}
|
|
12450
12457
|
_initRenderRefresher() {
|
|
12451
12458
|
this._docSkeletonManagerService.currentSkeleton$.subscribe((e) => {
|
|
@@ -12459,7 +12466,7 @@ let Dr = class extends me {
|
|
|
12459
12466
|
if (!s)
|
|
12460
12467
|
return;
|
|
12461
12468
|
const { documentFlavor: i } = s.getSnapshot().documentStyle;
|
|
12462
|
-
if (i ===
|
|
12469
|
+
if (i === Pe.MODERN)
|
|
12463
12470
|
return;
|
|
12464
12471
|
const a = Math.abs(r.deltaX);
|
|
12465
12472
|
let c = a < 40 ? 0.2 : a < 80 ? 0.4 : 0.2;
|
|
@@ -12478,10 +12485,10 @@ let Dr = class extends me {
|
|
|
12478
12485
|
if (e == null)
|
|
12479
12486
|
return;
|
|
12480
12487
|
const t = this._univerInstanceService.getCurrentUniverDocInstance();
|
|
12481
|
-
t && setTimeout(() => {
|
|
12488
|
+
t && (this._updateTimer = window.setTimeout(() => {
|
|
12482
12489
|
const o = this._univerInstanceService.getCurrentUnitOfType(_.UNIVER_SHEET), r = o && this._renderManagerService.getRenderById(o.getUnitId()), s = this._isSheetEditor ? (r == null ? void 0 : r.scene.scaleX) || 1 : t.zoomRatio;
|
|
12483
12490
|
this.updateViewZoom(s, !1);
|
|
12484
|
-
});
|
|
12491
|
+
}));
|
|
12485
12492
|
}));
|
|
12486
12493
|
}
|
|
12487
12494
|
_initCommandExecutedListener() {
|
|
@@ -12532,7 +12539,7 @@ Dr = nf([
|
|
|
12532
12539
|
ht(4, T),
|
|
12533
12540
|
ht(5, z(Y)),
|
|
12534
12541
|
ht(6, Ge),
|
|
12535
|
-
ht(7, z(
|
|
12542
|
+
ht(7, z(Ps)),
|
|
12536
12543
|
ht(8, pe)
|
|
12537
12544
|
], Dr);
|
|
12538
12545
|
const of = $i("PRINTING_COMPONENT_COLLECT"), rf = $i("PRINTING_DOM_COLLECT");
|
|
@@ -12728,7 +12735,7 @@ const Af = {
|
|
|
12728
12735
|
preconditions: ah,
|
|
12729
12736
|
binding: q.ENTER
|
|
12730
12737
|
}, uf = {
|
|
12731
|
-
id:
|
|
12738
|
+
id: wo.id,
|
|
12732
12739
|
preconditions: Se,
|
|
12733
12740
|
binding: q.BACKSPACE
|
|
12734
12741
|
}, hf = {
|
|
@@ -12801,13 +12808,13 @@ var Rf = Object.defineProperty, bf = Object.getOwnPropertyDescriptor, xf = (n, e
|
|
|
12801
12808
|
(i = n[s]) && (r = i(r) || r);
|
|
12802
12809
|
return r;
|
|
12803
12810
|
}, hn = (n, e) => (t, o) => e(t, o, n), Of = (n, e, t) => xf(n, e + "", t);
|
|
12804
|
-
let
|
|
12811
|
+
let wr = class extends Zc {
|
|
12805
12812
|
// static override type = UniverInstanceType.UNIVER_DOC;
|
|
12806
|
-
constructor(n =
|
|
12813
|
+
constructor(n = wi, e, t, o, r, s) {
|
|
12807
12814
|
super(), this._config = n, this._injector = e, this._renderManagerSrv = t, this._commandService = o, this._logService = r, this._configService = s;
|
|
12808
12815
|
const { menu: i, ...a } = Jc(
|
|
12809
12816
|
{},
|
|
12810
|
-
|
|
12817
|
+
wi,
|
|
12811
12818
|
this._config
|
|
12812
12819
|
);
|
|
12813
12820
|
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(Wo, a), this._initDependencies(e), this._initializeShortcut(), this._initCommand();
|
|
@@ -12832,7 +12839,7 @@ let Pr = class extends Zc {
|
|
|
12832
12839
|
// eslint-disable-next-line max-lines-per-function
|
|
12833
12840
|
_initCommand() {
|
|
12834
12841
|
[
|
|
12835
|
-
|
|
12842
|
+
wo,
|
|
12836
12843
|
xa,
|
|
12837
12844
|
Qt,
|
|
12838
12845
|
Ut,
|
|
@@ -12897,7 +12904,7 @@ let Pr = class extends Zc {
|
|
|
12897
12904
|
St,
|
|
12898
12905
|
vt,
|
|
12899
12906
|
Jd,
|
|
12900
|
-
|
|
12907
|
+
Pa,
|
|
12901
12908
|
$d,
|
|
12902
12909
|
Xe,
|
|
12903
12910
|
Qa,
|
|
@@ -12957,7 +12964,7 @@ let Pr = class extends Zc {
|
|
|
12957
12964
|
[Bn],
|
|
12958
12965
|
[vo],
|
|
12959
12966
|
[So],
|
|
12960
|
-
[
|
|
12967
|
+
[wt],
|
|
12961
12968
|
[at]
|
|
12962
12969
|
], this._config.override).forEach((t) => n.add(t));
|
|
12963
12970
|
}
|
|
@@ -12980,7 +12987,7 @@ let Pr = class extends Zc {
|
|
|
12980
12987
|
[de],
|
|
12981
12988
|
[Re],
|
|
12982
12989
|
[nl],
|
|
12983
|
-
[
|
|
12990
|
+
[Ps],
|
|
12984
12991
|
[Lo],
|
|
12985
12992
|
[br],
|
|
12986
12993
|
[Dr]
|
|
@@ -12990,7 +12997,7 @@ let Pr = class extends Zc {
|
|
|
12990
12997
|
}
|
|
12991
12998
|
_initRenderModules() {
|
|
12992
12999
|
[
|
|
12993
|
-
[
|
|
13000
|
+
[Pt],
|
|
12994
13001
|
[lo],
|
|
12995
13002
|
[Ao],
|
|
12996
13003
|
[ho],
|
|
@@ -13008,15 +13015,15 @@ let Pr = class extends Zc {
|
|
|
13008
13015
|
});
|
|
13009
13016
|
}
|
|
13010
13017
|
};
|
|
13011
|
-
Of(
|
|
13012
|
-
|
|
13018
|
+
Of(wr, "pluginName", sd);
|
|
13019
|
+
wr = yf([
|
|
13013
13020
|
Xc(Il),
|
|
13014
13021
|
hn(1, z(Dn)),
|
|
13015
13022
|
hn(2, pe),
|
|
13016
13023
|
hn(3, T),
|
|
13017
13024
|
hn(4, Qr),
|
|
13018
13025
|
hn(5, Vr)
|
|
13019
|
-
],
|
|
13026
|
+
], wr);
|
|
13020
13027
|
function Tf(n, e, t) {
|
|
13021
13028
|
const o = J(T), r = J(Bo), s = Te(() => ge(4), []);
|
|
13022
13029
|
Ce(() => {
|
|
@@ -13246,7 +13253,7 @@ const Zf = (n) => {
|
|
|
13246
13253
|
container: b,
|
|
13247
13254
|
autoFocus: t,
|
|
13248
13255
|
isSingle: d
|
|
13249
|
-
}), y = J(pe).getRenderById(x), M = y == null ? void 0 : y.with(Re),
|
|
13256
|
+
}), y = J(pe).getRenderById(x), M = y == null ? void 0 : y.with(Re), w = et(M == null ? void 0 : M.textSelectionInner$), F = !!((H = M == null ? void 0 : M.isFocusing) != null && H && (w != null && w.textRanges.some((k) => k.collapsed))), P = ke(null), [N, ee] = Ee(() => {
|
|
13250
13257
|
var k, ne;
|
|
13251
13258
|
return !ce.transform.getPlainText((ne = (k = C == null ? void 0 : C.getDocumentData().body) == null ? void 0 : k.dataStream) != null ? ne : "");
|
|
13252
13259
|
}), { checkScrollBar: $ } = Bf(C, d, !0, !0);
|
|
@@ -13279,7 +13286,7 @@ const Zf = (n) => {
|
|
|
13279
13286
|
}, [F, S]), Ce(() => {
|
|
13280
13287
|
const k = (ie) => {
|
|
13281
13288
|
var oe, he;
|
|
13282
|
-
I.getFocusId() !== x || ((he = (oe = ie.target) == null ? void 0 : oe.dataset) == null ? void 0 : he.editorid) === x ||
|
|
13289
|
+
I.getFocusId() !== x || ((he = (oe = ie.target) == null ? void 0 : oe.dataset) == null ? void 0 : he.editorid) === x || P.current && !P.current.contains(ie.target) && (v == null || v());
|
|
13283
13290
|
}, ne = setTimeout(() => {
|
|
13284
13291
|
document.addEventListener("click", k);
|
|
13285
13292
|
}, 100);
|
|
@@ -13293,7 +13300,7 @@ const Zf = (n) => {
|
|
|
13293
13300
|
"univer-border-primary-500": F
|
|
13294
13301
|
}),
|
|
13295
13302
|
style: { height: R },
|
|
13296
|
-
ref:
|
|
13303
|
+
ref: P,
|
|
13297
13304
|
children: [
|
|
13298
13305
|
/* @__PURE__ */ Q(
|
|
13299
13306
|
"div",
|
|
@@ -13342,15 +13349,15 @@ export {
|
|
|
13342
13349
|
od as DefaultToolbarConfig,
|
|
13343
13350
|
xn as DeleteCommand,
|
|
13344
13351
|
Zr as DeleteCustomBlockCommand,
|
|
13345
|
-
|
|
13352
|
+
wo as DeleteLeftCommand,
|
|
13346
13353
|
xa as DeleteRightCommand,
|
|
13347
|
-
|
|
13354
|
+
wt as DocAutoFormatService,
|
|
13348
13355
|
ho as DocBackScrollRenderController,
|
|
13349
13356
|
Bn as DocCanvasPopManagerService,
|
|
13350
13357
|
so as DocCopyCommand,
|
|
13351
13358
|
Os as DocCreateTableOperation,
|
|
13352
13359
|
rs as DocCutCommand,
|
|
13353
|
-
|
|
13360
|
+
Pt as DocEventManagerService,
|
|
13354
13361
|
Lo as DocIMEInputManagerService,
|
|
13355
13362
|
is as DocPasteCommand,
|
|
13356
13363
|
sf as DocPrintInterceptorService,
|
|
@@ -13396,7 +13403,7 @@ export {
|
|
|
13396
13403
|
La as QuickListCommand,
|
|
13397
13404
|
Wa as RectRange,
|
|
13398
13405
|
qd as ReplaceContentCommand,
|
|
13399
|
-
|
|
13406
|
+
Pa as ReplaceSelectionCommand,
|
|
13400
13407
|
Da as ReplaceSnapshotCommand,
|
|
13401
13408
|
Jd as ReplaceTextRunsCommand,
|
|
13402
13409
|
Un as ResetInlineFormatTextBackgroundColorCommand,
|
|
@@ -13420,7 +13427,7 @@ export {
|
|
|
13420
13427
|
Jt as TabCommand,
|
|
13421
13428
|
Zt as TextRange,
|
|
13422
13429
|
Na as ToggleCheckListCommand,
|
|
13423
|
-
|
|
13430
|
+
wr as UniverDocsUIPlugin,
|
|
13424
13431
|
Ra as UpdateCommand,
|
|
13425
13432
|
We as VIEWPORT_KEY,
|
|
13426
13433
|
Gf as addCustomDecorationBySelectionFactory,
|