@univerjs/docs-ui 0.15.0-insiders.20260108-7b9120d → 0.15.0-insiders.20260110-48b77c8
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 +1 -1
- package/lib/es/index.js +241 -235
- package/lib/index.js +241 -235
- package/lib/types/controllers/render-controllers/zoom.render-controller.d.ts +3 -0
- package/lib/umd/index.js +13 -13
- package/package.json +8 -8
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";
|
|
@@ -7433,7 +7433,7 @@ let Cr = class extends me {
|
|
|
7433
7433
|
this._commandService.onCommandExecuted((e) => {
|
|
7434
7434
|
if (X.id === e.id) {
|
|
7435
7435
|
const t = this._context.unit, r = this._docSkeletonManagerService.getViewModel().getEditArea(), s = t.getSnapshot().documentStyle.documentFlavor;
|
|
7436
|
-
r !== ve.BODY && s ===
|
|
7436
|
+
r !== ve.BODY && s === Pe.MODERN && this._commandService.executeCommand(Ms.id, {
|
|
7437
7437
|
unitId: this._context.unitId
|
|
7438
7438
|
});
|
|
7439
7439
|
}
|
|
@@ -7566,7 +7566,7 @@ let Cr = class extends me {
|
|
|
7566
7566
|
return t ? t.isReadOnly() : !1;
|
|
7567
7567
|
}
|
|
7568
7568
|
_isTraditionalMode() {
|
|
7569
|
-
return this._context.unit.getSnapshot().documentStyle.documentFlavor ===
|
|
7569
|
+
return this._context.unit.getSnapshot().documentStyle.documentFlavor === Pe.TRADITIONAL;
|
|
7570
7570
|
}
|
|
7571
7571
|
};
|
|
7572
7572
|
Cr = XA([
|
|
@@ -8069,18 +8069,18 @@ function su(n) {
|
|
|
8069
8069
|
return;
|
|
8070
8070
|
}
|
|
8071
8071
|
const { documentStyle: A } = l.getSnapshot();
|
|
8072
|
-
o.next((A == null ? void 0 : A.documentFlavor) !==
|
|
8072
|
+
o.next((A == null ? void 0 : A.documentFlavor) !== Pe.TRADITIONAL);
|
|
8073
8073
|
}
|
|
8074
8074
|
}), s = e.focused$.subscribe((c) => {
|
|
8075
8075
|
if (c == null)
|
|
8076
8076
|
return o.next(!0);
|
|
8077
8077
|
const d = e.getUniverDocInstance(c), l = d == null ? void 0 : d.getSnapshot().documentStyle.documentFlavor;
|
|
8078
|
-
o.next(l !==
|
|
8078
|
+
o.next(l !== Pe.TRADITIONAL);
|
|
8079
8079
|
}), i = e.getCurrentUniverDocInstance();
|
|
8080
8080
|
if (i == null)
|
|
8081
8081
|
return o.next(!0);
|
|
8082
8082
|
const a = i == null ? void 0 : i.getSnapshot().documentStyle.documentFlavor;
|
|
8083
|
-
return o.next(a !==
|
|
8083
|
+
return o.next(a !== Pe.TRADITIONAL), () => {
|
|
8084
8084
|
r.dispose(), s.unsubscribe();
|
|
8085
8085
|
};
|
|
8086
8086
|
});
|
|
@@ -8480,7 +8480,7 @@ function mu(n) {
|
|
|
8480
8480
|
type: Z.BUTTON,
|
|
8481
8481
|
icon: "HeaderFooterIcon",
|
|
8482
8482
|
tooltip: "toolbar.headerFooter",
|
|
8483
|
-
hidden$:
|
|
8483
|
+
hidden$: Pn(se(n, _.UNIVER_DOC, void 0, nt), su(n), (e, t) => e || t)
|
|
8484
8484
|
};
|
|
8485
8485
|
}
|
|
8486
8486
|
const Eu = "GridIcon", mc = "doc.menu.table";
|
|
@@ -8492,7 +8492,7 @@ function Iu(n) {
|
|
|
8492
8492
|
tooltip: "toolbar.table.main",
|
|
8493
8493
|
disabled$: iu(n),
|
|
8494
8494
|
// Do not show header footer menu and insert table at zen mode.
|
|
8495
|
-
hidden$:
|
|
8495
|
+
hidden$: Pn(se(n, _.UNIVER_DOC, void 0, nt), ru(n), (e, t) => e || t)
|
|
8496
8496
|
};
|
|
8497
8497
|
}
|
|
8498
8498
|
function Su(n) {
|
|
@@ -8660,7 +8660,7 @@ function xi(n) {
|
|
|
8660
8660
|
tooltip: "toolbar.order",
|
|
8661
8661
|
hidden$: se(n, _.UNIVER_DOC),
|
|
8662
8662
|
disabled$: ye(n),
|
|
8663
|
-
activated$: Tn(n).pipe(
|
|
8663
|
+
activated$: Tn(n).pipe(wn((e) => !!(e && e.indexOf("ORDER_LIST") === 0)))
|
|
8664
8664
|
};
|
|
8665
8665
|
}
|
|
8666
8666
|
function yi(n) {
|
|
@@ -8682,7 +8682,7 @@ function yi(n) {
|
|
|
8682
8682
|
tooltip: "toolbar.unorder",
|
|
8683
8683
|
disabled$: ye(n),
|
|
8684
8684
|
hidden$: se(n, _.UNIVER_DOC),
|
|
8685
|
-
activated$: Tn(n).pipe(
|
|
8685
|
+
activated$: Tn(n).pipe(wn((e) => !!(e && e.indexOf("BULLET_LIST") === 0)))
|
|
8686
8686
|
};
|
|
8687
8687
|
}
|
|
8688
8688
|
function Oi(n) {
|
|
@@ -8693,7 +8693,7 @@ function Oi(n) {
|
|
|
8693
8693
|
tooltip: "toolbar.checklist",
|
|
8694
8694
|
disabled$: ye(n),
|
|
8695
8695
|
hidden$: se(n, _.UNIVER_DOC),
|
|
8696
|
-
activated$: Tn(n).pipe(
|
|
8696
|
+
activated$: Tn(n).pipe(wn((e) => !!(e && e.indexOf("CHECK_LIST") === 0)))
|
|
8697
8697
|
};
|
|
8698
8698
|
}
|
|
8699
8699
|
function yu(n) {
|
|
@@ -8710,10 +8710,10 @@ function yu(n) {
|
|
|
8710
8710
|
var c;
|
|
8711
8711
|
if (a.id === X.id) {
|
|
8712
8712
|
const d = t.getCurrentUnitForType(_.UNIVER_DOC);
|
|
8713
|
-
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);
|
|
8714
8714
|
}
|
|
8715
8715
|
}), s = t.getCurrentUnitForType(_.UNIVER_DOC);
|
|
8716
|
-
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();
|
|
8717
8717
|
})
|
|
8718
8718
|
};
|
|
8719
8719
|
}
|
|
@@ -8871,7 +8871,7 @@ const Mu = {
|
|
|
8871
8871
|
return a(), c.dispose;
|
|
8872
8872
|
})
|
|
8873
8873
|
};
|
|
8874
|
-
}, _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);
|
|
8875
8875
|
yt(K.TITLE);
|
|
8876
8876
|
yt(K.SUBTITLE);
|
|
8877
8877
|
const Qu = (n) => ({
|
|
@@ -9090,7 +9090,7 @@ let Bn = class extends me {
|
|
|
9090
9090
|
const { direction: r = "top", multipleDirection: s } = e, i = this._renderManagerService.getRenderById(t);
|
|
9091
9091
|
if (!i)
|
|
9092
9092
|
throw new Error(`Current render not found, unitId: ${t}`);
|
|
9093
|
-
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({
|
|
9094
9094
|
...e,
|
|
9095
9095
|
unitId: t,
|
|
9096
9096
|
subUnitId: "default",
|
|
@@ -9111,7 +9111,7 @@ let Bn = class extends me {
|
|
|
9111
9111
|
// #endregion
|
|
9112
9112
|
};
|
|
9113
9113
|
Bn = Gu([
|
|
9114
|
-
Wn(0, z(
|
|
9114
|
+
Wn(0, z(wl)),
|
|
9115
9115
|
Wn(1, pe),
|
|
9116
9116
|
Wn(2, L),
|
|
9117
9117
|
Wn(3, T)
|
|
@@ -9191,7 +9191,7 @@ function Tt(n, e, t) {
|
|
|
9191
9191
|
const { left: o, right: r, top: s, bottom: i } = t;
|
|
9192
9192
|
return n >= o && n <= r && e >= s && e <= i;
|
|
9193
9193
|
}
|
|
9194
|
-
let
|
|
9194
|
+
let Pt = class extends me {
|
|
9195
9195
|
constructor(e, t) {
|
|
9196
9196
|
super();
|
|
9197
9197
|
O(this, "_hoverCustomRanges$", new Fe([]));
|
|
@@ -9292,7 +9292,7 @@ let wt = class extends me {
|
|
|
9292
9292
|
}));
|
|
9293
9293
|
const e = Mt(this._context.mainComponent.onPointerDown$), t = Mt(this._context.scene.onPointerUp$);
|
|
9294
9294
|
this.disposeWithMe(e.pipe(
|
|
9295
|
-
Wl((o) => t.pipe(zl(1),
|
|
9295
|
+
Wl((o) => t.pipe(zl(1), wn((r) => ({ down: o, up: r })))),
|
|
9296
9296
|
ro(({ down: o, up: r }) => o.target === r.target && r.timeStamp - o.timeStamp < 300)
|
|
9297
9297
|
).subscribe(({ down: o }) => {
|
|
9298
9298
|
if (o.button === 2)
|
|
@@ -9439,18 +9439,18 @@ let wt = class extends me {
|
|
|
9439
9439
|
}), p.rows.forEach((E, b) => {
|
|
9440
9440
|
E.cells.forEach((x, C) => {
|
|
9441
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);
|
|
9442
|
-
let
|
|
9443
|
-
|
|
9444
|
-
...M.map((
|
|
9445
|
-
rect:
|
|
9446
|
-
paragraphStart:
|
|
9447
|
-
paragraphEnd:
|
|
9448
|
-
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,
|
|
9449
9449
|
pageIndex: h,
|
|
9450
9450
|
segmentId: e,
|
|
9451
9451
|
rowIndex: b,
|
|
9452
9452
|
colIndex: C,
|
|
9453
|
-
firstLine:
|
|
9453
|
+
firstLine: P.fisrtLine,
|
|
9454
9454
|
tableId: R
|
|
9455
9455
|
}))
|
|
9456
9456
|
);
|
|
@@ -9538,9 +9538,9 @@ let wt = class extends me {
|
|
|
9538
9538
|
return t || Array.from(this._tableParagraphBounds.values()).flat().find((r) => r.startIndex === e);
|
|
9539
9539
|
}
|
|
9540
9540
|
};
|
|
9541
|
-
|
|
9541
|
+
Pt = Ku([
|
|
9542
9542
|
qu(1, z(de))
|
|
9543
|
-
],
|
|
9543
|
+
], Pt);
|
|
9544
9544
|
const Ju = [
|
|
9545
9545
|
ct.id,
|
|
9546
9546
|
Qt.id,
|
|
@@ -9572,7 +9572,7 @@ function $u(n) {
|
|
|
9572
9572
|
"div",
|
|
9573
9573
|
{
|
|
9574
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),
|
|
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(
|
|
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))
|
|
9576
9576
|
}
|
|
9577
9577
|
);
|
|
9578
9578
|
}
|
|
@@ -9701,7 +9701,7 @@ let Ao = class extends me {
|
|
|
9701
9701
|
this.hideParagraphMenu(!0);
|
|
9702
9702
|
};
|
|
9703
9703
|
this.disposeWithMe(
|
|
9704
|
-
|
|
9704
|
+
Pn([this._docEventManagerService.hoverParagraphRealTime$, this._docEventManagerService.hoverParagraphLeft$]).pipe(Rn(16)).subscribe(([o, r]) => {
|
|
9705
9705
|
const s = o != null ? o : r;
|
|
9706
9706
|
e(s);
|
|
9707
9707
|
})
|
|
@@ -9747,14 +9747,14 @@ let Ao = class extends me {
|
|
|
9747
9747
|
};
|
|
9748
9748
|
Ao = sh([
|
|
9749
9749
|
dn(1, z(Y)),
|
|
9750
|
-
dn(2, z(
|
|
9750
|
+
dn(2, z(Pt)),
|
|
9751
9751
|
dn(3, z(Bn)),
|
|
9752
9752
|
dn(4, z(de)),
|
|
9753
9753
|
dn(5, z(lo))
|
|
9754
9754
|
], Ao);
|
|
9755
9755
|
const ih = ({ popup: n }) => {
|
|
9756
9756
|
var E, b;
|
|
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(
|
|
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(() => {
|
|
9758
9758
|
var x, C;
|
|
9759
9759
|
return (C = (x = A == null ? void 0 : A.getBody()) == null ? void 0 : x.paragraphs) == null ? void 0 : C.find((B) => B.startIndex === p);
|
|
9760
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({
|
|
@@ -9776,14 +9776,14 @@ const ih = ({ popup: n }) => {
|
|
|
9776
9776
|
"univer-bg-white dark:!univer-bg-gray-700": !e
|
|
9777
9777
|
}),
|
|
9778
9778
|
onMouseEnter: (x) => {
|
|
9779
|
-
var B, y, M,
|
|
9779
|
+
var B, y, M, w, F, P;
|
|
9780
9780
|
(B = n.onPointerEnter) == null || B.call(n, x), a.current = !0;
|
|
9781
9781
|
const C = (y = i.current) == null ? void 0 : y.getBoundingClientRect();
|
|
9782
9782
|
v.next({
|
|
9783
9783
|
left: ((M = C == null ? void 0 : C.left) != null ? M : 0) - 4,
|
|
9784
|
-
right: (
|
|
9784
|
+
right: (w = C == null ? void 0 : C.right) != null ? w : 0,
|
|
9785
9785
|
top: (F = C == null ? void 0 : C.top) != null ? F : 0,
|
|
9786
|
-
bottom: (
|
|
9786
|
+
bottom: (P = C == null ? void 0 : C.bottom) != null ? P : 0
|
|
9787
9787
|
});
|
|
9788
9788
|
},
|
|
9789
9789
|
onMouseLeave: () => {
|
|
@@ -9910,7 +9910,7 @@ const ch = {
|
|
|
9910
9910
|
id: yn.id,
|
|
9911
9911
|
binding: q.Digit8 | te.CTRL_COMMAND | te.SHIFT,
|
|
9912
9912
|
preconditions: Se
|
|
9913
|
-
}, Wo = "docs-ui.config",
|
|
9913
|
+
}, Wo = "docs-ui.config", wi = {
|
|
9914
9914
|
layout: {
|
|
9915
9915
|
docContainerConfig: rd,
|
|
9916
9916
|
toolbarConfig: od
|
|
@@ -10066,7 +10066,7 @@ const Oh = "univer-font-[500] univer-truncate univer-h-[24px] univer-mb-2 univer
|
|
|
10066
10066
|
return 1;
|
|
10067
10067
|
}
|
|
10068
10068
|
};
|
|
10069
|
-
function
|
|
10069
|
+
function wh(n, e, t, o) {
|
|
10070
10070
|
var a, c;
|
|
10071
10071
|
if (!n)
|
|
10072
10072
|
return;
|
|
@@ -10084,15 +10084,15 @@ function Ph(n, e, t, o) {
|
|
|
10084
10084
|
return A.paragraphStyle.headingId;
|
|
10085
10085
|
}
|
|
10086
10086
|
}
|
|
10087
|
-
const
|
|
10088
|
-
function
|
|
10087
|
+
const Pi = "__title";
|
|
10088
|
+
function Ph() {
|
|
10089
10089
|
var e, t, o;
|
|
10090
10090
|
const n = ua(Wo);
|
|
10091
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;
|
|
10092
10092
|
}
|
|
10093
10093
|
function Nh() {
|
|
10094
|
-
var B, y, M,
|
|
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(
|
|
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(() => {
|
|
10096
10096
|
const U = /* @__PURE__ */ new Map();
|
|
10097
10097
|
return m.forEach((H) => {
|
|
10098
10098
|
U.set(H.startIndex, H);
|
|
@@ -10116,11 +10116,11 @@ function Nh() {
|
|
|
10116
10116
|
isTitle: ((ae = U.paragraphStyle) == null ? void 0 : ae.namedStyleType) === K.TITLE
|
|
10117
10117
|
};
|
|
10118
10118
|
}).filter((U) => U == null ? void 0 : U.text), R = mn((U) => {
|
|
10119
|
-
const H = U.viewportScrollY, k = H + f / p, ne =
|
|
10119
|
+
const H = U.viewportScrollY, k = H + f / p, ne = wh(u, I, H, k);
|
|
10120
10120
|
ne && c(ne);
|
|
10121
10121
|
}), E = v != null && v.find((U) => U.isTitle) ? v : [
|
|
10122
10122
|
...A ? [{
|
|
10123
|
-
id:
|
|
10123
|
+
id: Pi,
|
|
10124
10124
|
text: A,
|
|
10125
10125
|
level: 1,
|
|
10126
10126
|
isTitle: !0
|
|
@@ -10147,7 +10147,7 @@ function Nh() {
|
|
|
10147
10147
|
const H = l == null ? void 0 : l.scene.getViewport(We.VIEW_MAIN);
|
|
10148
10148
|
if (!H)
|
|
10149
10149
|
return;
|
|
10150
|
-
if (U.id ===
|
|
10150
|
+
if (U.id === Pi) {
|
|
10151
10151
|
H.scrollToViewportPos({ viewportScrollY: 0 });
|
|
10152
10152
|
return;
|
|
10153
10153
|
}
|
|
@@ -10528,7 +10528,7 @@ const Ds = {
|
|
|
10528
10528
|
id: "sidebar.operation.doc-paragraph-setting-panel",
|
|
10529
10529
|
type: D.OPERATION,
|
|
10530
10530
|
handler: (n) => (n.get(tn).openPanel(), !0)
|
|
10531
|
-
},
|
|
10531
|
+
}, ws = (n) => {
|
|
10532
10532
|
const e = n.get(Y);
|
|
10533
10533
|
return new fe((t) => {
|
|
10534
10534
|
const o = e.textSelection$.subscribe(() => {
|
|
@@ -10576,7 +10576,7 @@ const dt = (n) => {
|
|
|
10576
10576
|
type: Z.BUTTON,
|
|
10577
10577
|
icon: "CopyDoubleIcon",
|
|
10578
10578
|
title: "rightClick.copy",
|
|
10579
|
-
disabled$:
|
|
10579
|
+
disabled$: ws(n),
|
|
10580
10580
|
hidden$: se(n, _.UNIVER_DOC)
|
|
10581
10581
|
}), $h = (n) => ({
|
|
10582
10582
|
id: Ds.id,
|
|
@@ -10589,7 +10589,7 @@ const dt = (n) => {
|
|
|
10589
10589
|
type: Z.BUTTON,
|
|
10590
10590
|
icon: "CopyDoubleIcon",
|
|
10591
10591
|
title: "rightClick.cut",
|
|
10592
|
-
disabled$:
|
|
10592
|
+
disabled$: ws(n),
|
|
10593
10593
|
hidden$: se(n, _.UNIVER_DOC)
|
|
10594
10594
|
}), tg = (n) => ({
|
|
10595
10595
|
id: is.id,
|
|
@@ -10598,11 +10598,11 @@ const dt = (n) => {
|
|
|
10598
10598
|
title: "rightClick.paste",
|
|
10599
10599
|
hidden$: se(n, _.UNIVER_DOC)
|
|
10600
10600
|
}), ng = (n) => ({
|
|
10601
|
-
id:
|
|
10601
|
+
id: wo.id,
|
|
10602
10602
|
type: Z.BUTTON,
|
|
10603
10603
|
icon: "PasteSpecialDoubleIcon",
|
|
10604
10604
|
title: "rightClick.delete",
|
|
10605
|
-
disabled$:
|
|
10605
|
+
disabled$: ws(n),
|
|
10606
10606
|
hidden$: se(n, _.UNIVER_DOC)
|
|
10607
10607
|
}), vc = "doc.menu.table-insert";
|
|
10608
10608
|
function og(n) {
|
|
@@ -10611,7 +10611,7 @@ function og(n) {
|
|
|
10611
10611
|
type: Z.SUBITEMS,
|
|
10612
10612
|
title: "table.insert",
|
|
10613
10613
|
icon: "InsertDoubleIcon",
|
|
10614
|
-
hidden$:
|
|
10614
|
+
hidden$: Pn(se(n, _.UNIVER_DOC), dt(n), (e, t) => e || t)
|
|
10615
10615
|
};
|
|
10616
10616
|
}
|
|
10617
10617
|
function rg(n) {
|
|
@@ -10661,7 +10661,7 @@ function cg(n) {
|
|
|
10661
10661
|
type: Z.SUBITEMS,
|
|
10662
10662
|
title: "table.delete",
|
|
10663
10663
|
icon: "ReduceDoubleIcon",
|
|
10664
|
-
hidden$:
|
|
10664
|
+
hidden$: Pn(se(n, _.UNIVER_DOC), dt(n), (e, t) => e || t)
|
|
10665
10665
|
};
|
|
10666
10666
|
}
|
|
10667
10667
|
function lg(n) {
|
|
@@ -10815,7 +10815,7 @@ const ug = {
|
|
|
10815
10815
|
order: 2,
|
|
10816
10816
|
menuItemFactory: tg
|
|
10817
10817
|
},
|
|
10818
|
-
[
|
|
10818
|
+
[wo.id]: {
|
|
10819
10819
|
order: 3,
|
|
10820
10820
|
menuItemFactory: ng
|
|
10821
10821
|
}
|
|
@@ -10875,11 +10875,11 @@ const ug = {
|
|
|
10875
10875
|
},
|
|
10876
10876
|
[gs.id]: {
|
|
10877
10877
|
order: 2,
|
|
10878
|
-
menuItemFactory:
|
|
10878
|
+
menuItemFactory: wu
|
|
10879
10879
|
},
|
|
10880
10880
|
[fs.id]: {
|
|
10881
10881
|
order: 3,
|
|
10882
|
-
menuItemFactory:
|
|
10882
|
+
menuItemFactory: Pu
|
|
10883
10883
|
},
|
|
10884
10884
|
[ps.id]: {
|
|
10885
10885
|
order: 4,
|
|
@@ -10965,7 +10965,7 @@ let uo = class extends me {
|
|
|
10965
10965
|
});
|
|
10966
10966
|
}
|
|
10967
10967
|
_initUiParts() {
|
|
10968
|
-
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)));
|
|
10969
10969
|
}
|
|
10970
10970
|
_initMenus() {
|
|
10971
10971
|
this._menuManagerService.mergeMenu(ug);
|
|
@@ -11173,7 +11173,7 @@ let br = class extends Ct {
|
|
|
11173
11173
|
for (let g = 0, f = a.length; g < f; g++) {
|
|
11174
11174
|
const p = a[g];
|
|
11175
11175
|
let { pageWidth: m, pageHeight: I } = p;
|
|
11176
|
-
if (A ===
|
|
11176
|
+
if (A === Pe.MODERN) {
|
|
11177
11177
|
const S = Ig(p);
|
|
11178
11178
|
m = S.pageWidth, I = S.pageHeight;
|
|
11179
11179
|
}
|
|
@@ -11404,7 +11404,7 @@ let fo = class extends me {
|
|
|
11404
11404
|
}
|
|
11405
11405
|
};
|
|
11406
11406
|
fo = yg([
|
|
11407
|
-
Ui(0, z(
|
|
11407
|
+
Ui(0, z(wt)),
|
|
11408
11408
|
Ui(1, pe)
|
|
11409
11409
|
], fo);
|
|
11410
11410
|
function Og(n) {
|
|
@@ -11512,8 +11512,8 @@ function Dg(n) {
|
|
|
11512
11512
|
const e = El(n);
|
|
11513
11513
|
return e.lines[e.lines.length - 1];
|
|
11514
11514
|
}
|
|
11515
|
-
var
|
|
11516
|
-
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--)
|
|
11517
11517
|
(i = n[s]) && (r = i(r) || r);
|
|
11518
11518
|
return r;
|
|
11519
11519
|
}, zn = (n, e) => (t, o) => e(t, o, n);
|
|
@@ -11780,8 +11780,8 @@ let po = class extends me {
|
|
|
11780
11780
|
if (t === !0)
|
|
11781
11781
|
l = (S = (I = c.sections[h - 1]) == null ? void 0 : I.columns[0]) == null ? void 0 : S.lines[0];
|
|
11782
11782
|
else {
|
|
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],
|
|
11784
|
-
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];
|
|
11785
11785
|
}
|
|
11786
11786
|
if (l != null)
|
|
11787
11787
|
return l;
|
|
@@ -11798,7 +11798,7 @@ let po = class extends me {
|
|
|
11798
11798
|
const y = (C = u.pages[g - 1]) == null ? void 0 : C.sections;
|
|
11799
11799
|
if (y == null)
|
|
11800
11800
|
return;
|
|
11801
|
-
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;
|
|
11802
11802
|
l = F[F.length - 1];
|
|
11803
11803
|
}
|
|
11804
11804
|
if (l != null)
|
|
@@ -11818,7 +11818,7 @@ let po = class extends me {
|
|
|
11818
11818
|
return cd(this._univerInstanceService, this._renderManagerService);
|
|
11819
11819
|
}
|
|
11820
11820
|
};
|
|
11821
|
-
po =
|
|
11821
|
+
po = Pg([
|
|
11822
11822
|
zn(0, L),
|
|
11823
11823
|
zn(1, pe),
|
|
11824
11824
|
zn(2, z(Y)),
|
|
@@ -11954,7 +11954,7 @@ let yr = class extends me {
|
|
|
11954
11954
|
yr = Fg([
|
|
11955
11955
|
jn(1, z(de)),
|
|
11956
11956
|
jn(2, T),
|
|
11957
|
-
jn(3, z(
|
|
11957
|
+
jn(3, z(Pt)),
|
|
11958
11958
|
jn(4, z(Y))
|
|
11959
11959
|
], yr);
|
|
11960
11960
|
var Hg = Object.getOwnPropertyDescriptor, kg = (n, e, t, o) => {
|
|
@@ -11973,7 +11973,7 @@ let Eo = class extends Ct {
|
|
|
11973
11973
|
var n;
|
|
11974
11974
|
(n = this._docSelectionRenderService) == null || n.onPaste$.pipe(ft(this.dispose$)).subscribe((e) => {
|
|
11975
11975
|
var a, c, d;
|
|
11976
|
-
if (!
|
|
11976
|
+
if (!Po(this._contextService))
|
|
11977
11977
|
return;
|
|
11978
11978
|
e.event.preventDefault();
|
|
11979
11979
|
const t = e.event;
|
|
@@ -12256,12 +12256,13 @@ Br = Xg([
|
|
|
12256
12256
|
Yn(3, T),
|
|
12257
12257
|
Yn(4, z(at))
|
|
12258
12258
|
], Br);
|
|
12259
|
-
class
|
|
12259
|
+
class Ps extends me {
|
|
12260
12260
|
constructor(e) {
|
|
12261
12261
|
super(), this._context = e;
|
|
12262
12262
|
}
|
|
12263
12263
|
calculatePagePosition() {
|
|
12264
12264
|
var v, R;
|
|
12265
|
+
if (this._disposed) return;
|
|
12265
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;
|
|
12266
12267
|
if (a == null || c === Number.POSITIVE_INFINITY || d === Number.POSITIVE_INFINITY)
|
|
12267
12268
|
return;
|
|
@@ -12298,7 +12299,7 @@ let Mr = class extends me {
|
|
|
12298
12299
|
}
|
|
12299
12300
|
};
|
|
12300
12301
|
Mr = Jg([
|
|
12301
|
-
Wi(1, z(
|
|
12302
|
+
Wi(1, z(Ps)),
|
|
12302
12303
|
Wi(2, z(Y))
|
|
12303
12304
|
], Mr);
|
|
12304
12305
|
var $g = Object.getOwnPropertyDescriptor, ef = (n, e, t, o) => {
|
|
@@ -12444,9 +12445,14 @@ let Dr = class extends me {
|
|
|
12444
12445
|
constructor(e, t, o, r, s, i, a, c, d) {
|
|
12445
12446
|
super();
|
|
12446
12447
|
O(this, "_isSheetEditor", !1);
|
|
12448
|
+
O(this, "_initTimer");
|
|
12449
|
+
O(this, "_updateTimer");
|
|
12447
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;
|
|
12448
12451
|
const l = this._univerInstanceService.getCurrentUnitOfType(_.UNIVER_SHEET), A = l && this._renderManagerService.getRenderById(l.getUnitId());
|
|
12449
|
-
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);
|
|
12450
12456
|
}
|
|
12451
12457
|
_initRenderRefresher() {
|
|
12452
12458
|
this._docSkeletonManagerService.currentSkeleton$.subscribe((e) => {
|
|
@@ -12460,7 +12466,7 @@ let Dr = class extends me {
|
|
|
12460
12466
|
if (!s)
|
|
12461
12467
|
return;
|
|
12462
12468
|
const { documentFlavor: i } = s.getSnapshot().documentStyle;
|
|
12463
|
-
if (i ===
|
|
12469
|
+
if (i === Pe.MODERN)
|
|
12464
12470
|
return;
|
|
12465
12471
|
const a = Math.abs(r.deltaX);
|
|
12466
12472
|
let c = a < 40 ? 0.2 : a < 80 ? 0.4 : 0.2;
|
|
@@ -12479,10 +12485,10 @@ let Dr = class extends me {
|
|
|
12479
12485
|
if (e == null)
|
|
12480
12486
|
return;
|
|
12481
12487
|
const t = this._univerInstanceService.getCurrentUniverDocInstance();
|
|
12482
|
-
t && setTimeout(() => {
|
|
12488
|
+
t && (this._updateTimer = window.setTimeout(() => {
|
|
12483
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;
|
|
12484
12490
|
this.updateViewZoom(s, !1);
|
|
12485
|
-
});
|
|
12491
|
+
}));
|
|
12486
12492
|
}));
|
|
12487
12493
|
}
|
|
12488
12494
|
_initCommandExecutedListener() {
|
|
@@ -12533,7 +12539,7 @@ Dr = nf([
|
|
|
12533
12539
|
ht(4, T),
|
|
12534
12540
|
ht(5, z(Y)),
|
|
12535
12541
|
ht(6, Ge),
|
|
12536
|
-
ht(7, z(
|
|
12542
|
+
ht(7, z(Ps)),
|
|
12537
12543
|
ht(8, pe)
|
|
12538
12544
|
], Dr);
|
|
12539
12545
|
const of = $i("PRINTING_COMPONENT_COLLECT"), rf = $i("PRINTING_DOM_COLLECT");
|
|
@@ -12729,7 +12735,7 @@ const Af = {
|
|
|
12729
12735
|
preconditions: ah,
|
|
12730
12736
|
binding: q.ENTER
|
|
12731
12737
|
}, uf = {
|
|
12732
|
-
id:
|
|
12738
|
+
id: wo.id,
|
|
12733
12739
|
preconditions: Se,
|
|
12734
12740
|
binding: q.BACKSPACE
|
|
12735
12741
|
}, hf = {
|
|
@@ -12802,13 +12808,13 @@ var Rf = Object.defineProperty, bf = Object.getOwnPropertyDescriptor, xf = (n, e
|
|
|
12802
12808
|
(i = n[s]) && (r = i(r) || r);
|
|
12803
12809
|
return r;
|
|
12804
12810
|
}, hn = (n, e) => (t, o) => e(t, o, n), Of = (n, e, t) => xf(n, e + "", t);
|
|
12805
|
-
let
|
|
12811
|
+
let wr = class extends Zc {
|
|
12806
12812
|
// static override type = UniverInstanceType.UNIVER_DOC;
|
|
12807
|
-
constructor(n =
|
|
12813
|
+
constructor(n = wi, e, t, o, r, s) {
|
|
12808
12814
|
super(), this._config = n, this._injector = e, this._renderManagerSrv = t, this._commandService = o, this._logService = r, this._configService = s;
|
|
12809
12815
|
const { menu: i, ...a } = Jc(
|
|
12810
12816
|
{},
|
|
12811
|
-
|
|
12817
|
+
wi,
|
|
12812
12818
|
this._config
|
|
12813
12819
|
);
|
|
12814
12820
|
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(Wo, a), this._initDependencies(e), this._initializeShortcut(), this._initCommand();
|
|
@@ -12833,7 +12839,7 @@ let Pr = class extends Zc {
|
|
|
12833
12839
|
// eslint-disable-next-line max-lines-per-function
|
|
12834
12840
|
_initCommand() {
|
|
12835
12841
|
[
|
|
12836
|
-
|
|
12842
|
+
wo,
|
|
12837
12843
|
xa,
|
|
12838
12844
|
Qt,
|
|
12839
12845
|
Ut,
|
|
@@ -12898,7 +12904,7 @@ let Pr = class extends Zc {
|
|
|
12898
12904
|
St,
|
|
12899
12905
|
vt,
|
|
12900
12906
|
Jd,
|
|
12901
|
-
|
|
12907
|
+
Pa,
|
|
12902
12908
|
$d,
|
|
12903
12909
|
Xe,
|
|
12904
12910
|
Qa,
|
|
@@ -12958,7 +12964,7 @@ let Pr = class extends Zc {
|
|
|
12958
12964
|
[Bn],
|
|
12959
12965
|
[vo],
|
|
12960
12966
|
[So],
|
|
12961
|
-
[
|
|
12967
|
+
[wt],
|
|
12962
12968
|
[at]
|
|
12963
12969
|
], this._config.override).forEach((t) => n.add(t));
|
|
12964
12970
|
}
|
|
@@ -12981,7 +12987,7 @@ let Pr = class extends Zc {
|
|
|
12981
12987
|
[de],
|
|
12982
12988
|
[Re],
|
|
12983
12989
|
[nl],
|
|
12984
|
-
[
|
|
12990
|
+
[Ps],
|
|
12985
12991
|
[Lo],
|
|
12986
12992
|
[br],
|
|
12987
12993
|
[Dr]
|
|
@@ -12991,7 +12997,7 @@ let Pr = class extends Zc {
|
|
|
12991
12997
|
}
|
|
12992
12998
|
_initRenderModules() {
|
|
12993
12999
|
[
|
|
12994
|
-
[
|
|
13000
|
+
[Pt],
|
|
12995
13001
|
[lo],
|
|
12996
13002
|
[Ao],
|
|
12997
13003
|
[ho],
|
|
@@ -13009,15 +13015,15 @@ let Pr = class extends Zc {
|
|
|
13009
13015
|
});
|
|
13010
13016
|
}
|
|
13011
13017
|
};
|
|
13012
|
-
Of(
|
|
13013
|
-
|
|
13018
|
+
Of(wr, "pluginName", sd);
|
|
13019
|
+
wr = yf([
|
|
13014
13020
|
Xc(Il),
|
|
13015
13021
|
hn(1, z(Dn)),
|
|
13016
13022
|
hn(2, pe),
|
|
13017
13023
|
hn(3, T),
|
|
13018
13024
|
hn(4, Qr),
|
|
13019
13025
|
hn(5, Vr)
|
|
13020
|
-
],
|
|
13026
|
+
], wr);
|
|
13021
13027
|
function Tf(n, e, t) {
|
|
13022
13028
|
const o = J(T), r = J(Bo), s = Te(() => ge(4), []);
|
|
13023
13029
|
Ce(() => {
|
|
@@ -13247,7 +13253,7 @@ const Zf = (n) => {
|
|
|
13247
13253
|
container: b,
|
|
13248
13254
|
autoFocus: t,
|
|
13249
13255
|
isSingle: d
|
|
13250
|
-
}), 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(() => {
|
|
13251
13257
|
var k, ne;
|
|
13252
13258
|
return !ce.transform.getPlainText((ne = (k = C == null ? void 0 : C.getDocumentData().body) == null ? void 0 : k.dataStream) != null ? ne : "");
|
|
13253
13259
|
}), { checkScrollBar: $ } = Bf(C, d, !0, !0);
|
|
@@ -13280,7 +13286,7 @@ const Zf = (n) => {
|
|
|
13280
13286
|
}, [F, S]), Ce(() => {
|
|
13281
13287
|
const k = (ie) => {
|
|
13282
13288
|
var oe, he;
|
|
13283
|
-
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());
|
|
13284
13290
|
}, ne = setTimeout(() => {
|
|
13285
13291
|
document.addEventListener("click", k);
|
|
13286
13292
|
}, 100);
|
|
@@ -13294,7 +13300,7 @@ const Zf = (n) => {
|
|
|
13294
13300
|
"univer-border-primary-500": F
|
|
13295
13301
|
}),
|
|
13296
13302
|
style: { height: R },
|
|
13297
|
-
ref:
|
|
13303
|
+
ref: P,
|
|
13298
13304
|
children: [
|
|
13299
13305
|
/* @__PURE__ */ Q(
|
|
13300
13306
|
"div",
|
|
@@ -13343,15 +13349,15 @@ export {
|
|
|
13343
13349
|
od as DefaultToolbarConfig,
|
|
13344
13350
|
xn as DeleteCommand,
|
|
13345
13351
|
Zr as DeleteCustomBlockCommand,
|
|
13346
|
-
|
|
13352
|
+
wo as DeleteLeftCommand,
|
|
13347
13353
|
xa as DeleteRightCommand,
|
|
13348
|
-
|
|
13354
|
+
wt as DocAutoFormatService,
|
|
13349
13355
|
ho as DocBackScrollRenderController,
|
|
13350
13356
|
Bn as DocCanvasPopManagerService,
|
|
13351
13357
|
so as DocCopyCommand,
|
|
13352
13358
|
Os as DocCreateTableOperation,
|
|
13353
13359
|
rs as DocCutCommand,
|
|
13354
|
-
|
|
13360
|
+
Pt as DocEventManagerService,
|
|
13355
13361
|
Lo as DocIMEInputManagerService,
|
|
13356
13362
|
is as DocPasteCommand,
|
|
13357
13363
|
sf as DocPrintInterceptorService,
|
|
@@ -13397,7 +13403,7 @@ export {
|
|
|
13397
13403
|
La as QuickListCommand,
|
|
13398
13404
|
Wa as RectRange,
|
|
13399
13405
|
qd as ReplaceContentCommand,
|
|
13400
|
-
|
|
13406
|
+
Pa as ReplaceSelectionCommand,
|
|
13401
13407
|
Da as ReplaceSnapshotCommand,
|
|
13402
13408
|
Jd as ReplaceTextRunsCommand,
|
|
13403
13409
|
Un as ResetInlineFormatTextBackgroundColorCommand,
|
|
@@ -13421,7 +13427,7 @@ export {
|
|
|
13421
13427
|
Jt as TabCommand,
|
|
13422
13428
|
Zt as TextRange,
|
|
13423
13429
|
Na as ToggleCheckListCommand,
|
|
13424
|
-
|
|
13430
|
+
wr as UniverDocsUIPlugin,
|
|
13425
13431
|
Ra as UpdateCommand,
|
|
13426
13432
|
We as VIEWPORT_KEY,
|
|
13427
13433
|
Gf as addCustomDecorationBySelectionFactory,
|