@univerjs/docs-ui 0.10.1 → 0.10.2-nightly.202508080617
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 +7 -7
- package/lib/es/index.js +833 -827
- package/lib/index.js +833 -827
- package/lib/types/controllers/render-controllers/zoom.render-controller.d.ts +4 -2
- package/lib/umd/index.js +16 -16
- package/package.json +10 -10
- package/LICENSE +0 -176
package/lib/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var Mc = Object.defineProperty;
|
|
2
2
|
var _c = (n, e, t) => e in n ? Mc(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
3
|
var O = (n, e, t) => _c(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { IUniverInstanceService as L, Inject as j, Disposable as
|
|
4
|
+
import { IUniverInstanceService as L, Inject as j, Disposable as pe, toDisposable as _n, UniverInstanceType as _, BuildTextUtils as ce, JSONX as W, ObjectRelativeFromV as gt, ObjectRelativeFromH as Ro, CommandType as D, sequenceExecuteAsync as wr, ICommandService as T, DataStreamTreeTokenType as V, TextX as Ee, TextXActionType as G, PresetListType as ye, UpdateDocsAttributeType as on, Tools as ue, generateRandomId as ge, TableRowHeightRule as Dc, TableSizeType as Gi, TableTextWrapType as Pc, TableAlignmentType as wc, MemoryCursor as Nt, SHEET_EDITOR_UNITS as In, PositionedObjectLayoutType as bo, BlockType as Nc, LRUMap as Lc, BaselineOffset as Ve, BooleanNumber as z, ColorKit as Qs, DrawingTypeEnum as Nr, skipParseTagNames as Qc, CustomRangeType as Lr, DataStreamTreeNodeType as an, createIdentifier as Yi, ILogService as Qr, SliceBodyType as ir, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as yo, DOC_RANGE_TYPE as He, normalizeBody as Uc, getBodySlice as Ki, FOCUSING_DOC as Dn, EDITOR_ACTIVATED as to, DashStyleType as Fc, RxDisposable as St, ThemeService as Ur, IUndoRedoService as xo, PRESET_LIST_TYPE as Hc, HorizontalAlign as Ue, NamedStyleType as K, RANGE_DIRECTION as De, COLORS as fn, Rectangle as kc, DocumentFlavor as we, LocaleService as Ke, isInternalEditorID as vt, IContextService as Fr, Injector as Pn, FOCUSING_EDITOR_STANDALONE as Us, VerticalAlign as Vc, DEFAULT_EMPTY_DOCUMENT_VALUE as qi, PageOrientType as Wc, PAPER_TYPES as jc, PAGE_SIZE as ar, DOCS_ZEN_EDITOR_UNIT_ID_KEY as ot, DEFAULT_STYLES as Xi, NAMED_STYLE_MAP as zc, DisposableCollection as Sn, fromEventSubject as Bt, deepCompare as Gc, FOCUSING_UNIVER_EDITOR as Hr, FOCUSING_COMMON_DRAWINGS as Zi, getPlainText as no, debounce as kr, SpacingRule as Xt, IConfigService as Vr, QuickListTypeMap as jo, Direction as le, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Yc, checkForSubstrings as Kc, createInterceptorKey as Ji, InterceptorManager as qc, UndoCommandId as Fs, RedoCommandId as Hs, DependentOn as Xc, Plugin as Zc, merge as Jc, touchDependencies as ks, mergeOverrideWithDependencies as $c, createInternalEditorID as el } from "@univerjs/core";
|
|
5
5
|
import { DocSelectionManagerService as Y, RichTextEditingMutation as X, DocSkeletonManagerService as de, SetTextSelectionsOperation as Le, DocStateEmitService as tl, DocInterceptorService as nl } from "@univerjs/docs";
|
|
6
|
-
import { IRenderManagerService as
|
|
7
|
-
import { IClipboardInterfaceService as sa, FILE_PNG_CLIPBOARD_MIME_TYPE as Sl, FILE__WEBP_CLIPBOARD_MIME_TYPE as vl, FILE__JPEG_CLIPBOARD_MIME_TYPE as Cl, FILE__BMP_CLIPBOARD_MIME_TYPE as
|
|
6
|
+
import { IRenderManagerService as fe, DocumentEditArea as ve, hasListGlyph as ol, isIndentByGlyph as rl, isFirstGlyph as sl, getParagraphByGlyph as il, pixelToPt as al, ptToPixel as Vs, parseDataStreamToTree as cl, Liquid as $i, GlyphType as ea, DocumentSkeletonPageType as Oe, getPageFromPath as cr, getTableIdAndSliceIndex as Ws, NORMAL_TEXT_SELECTION_PLUGIN_STYLE as vn, getColor as pn, RegularPolygon as ta, Rect as qn, getOffsetRectForDom as ll, ScrollTimer as dl, CURSOR_TYPE as Mt, getSystemHighlightColor as Al, Vector2 as Cn, PageLayoutType as Rn, Shape as ul, Path as js, pxToNum as na, TRANSFORM_CHANGE_OBSERVABLE_TYPE as oa, getNumberUnitValue as rn, Viewport as hl, ScrollBar as lr, Layer as zs, Documents as gl, DocBackground as fl, getLastLine as pl, lineIterator as ml, getLastColumn as El, UniverRenderEnginePlugin as Il, DeviceInputEventType as ra } from "@univerjs/engine-render";
|
|
7
|
+
import { IClipboardInterfaceService as sa, FILE_PNG_CLIPBOARD_MIME_TYPE as Sl, FILE__WEBP_CLIPBOARD_MIME_TYPE as vl, FILE__JPEG_CLIPBOARD_MIME_TYPE as Cl, FILE__BMP_CLIPBOARD_MIME_TYPE as Rl, HTML_CLIPBOARD_MIME_TYPE as ia, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as aa, CopyCommand as bl, CutCommand as yl, PasteCommand as xl, ILayoutService as Oo, KeyCode as q, IConfirmService as ca, useDependency as J, ComponentManager as sn, ISidebarService as la, getMenuHiddenObservable as se, MenuItemType as Z, COLOR_PICKER_COMPONENT as da, FONT_FAMILY_LIST as Ol, FONT_FAMILY_COMPONENT as Tl, FONT_FAMILY_ITEM_COMPONENT as Bl, FONT_SIZE_LIST as Ml, FONT_SIZE_COMPONENT as _l, HEADING_LIST as Gs, COMMON_LABEL_COMPONENT as Dl, HEADING_ITEM_COMPONENT as Pl, ICanvasPopupService as wl, IMenuManagerService as Aa, ToolbarItem as Nl, MenuManagerPosition as Ll, useObservable as tt, RectPopup as Ql, DesktopMenu as Ul, ContextMenuPosition as oo, MetaKeys as te, Slider as Fl, useConfigValue as ua, useEvent as En, ContextMenuGroup as cn, RibbonInsertGroup as Hl, RibbonStartGroup as Ys, IUIPartsService as kl, IShortcutService as To, BuiltInUIPart as Ks, connectInjector as qs, imageMimeTypeSet as Vl, IContextMenuService as Wl } from "@univerjs/ui";
|
|
8
8
|
import { ImageSourceType as Wr } from "@univerjs/drawing";
|
|
9
|
-
import { Subject as
|
|
10
|
-
import { filter as
|
|
9
|
+
import { Subject as be, BehaviorSubject as Fe, merge as ha, filter as ro, takeUntil as ft, fromEvent as ze, Observable as Ie, map as wn, combineLatest as Nn, distinctUntilChanged as Wt, throttleTime as bn, switchMap as jl, take as zl, first as Gl, of as Yl, animationFrameScheduler as Kl } from "rxjs";
|
|
10
|
+
import { filter as dr, bufferTime as ql, map as Xl } from "rxjs/operators";
|
|
11
11
|
import { jsxs as re, jsx as Q, Fragment as Zl } from "react/jsx-runtime";
|
|
12
12
|
import { forwardRef as Te, useRef as ke, createElement as Be, useState as me, useEffect as Ce, useMemo as _e, useCallback as ga, useImperativeHandle as Jl, useLayoutEffect as fa } from "react";
|
|
13
13
|
import { Checkbox as Xs, InputNumber as it, Button as $l, clsx as Ge, borderClassName as Ln, Select as pa, scrollbarClassName as ed, Tooltip as td } from "@univerjs/design";
|
|
@@ -16,7 +16,7 @@ var nd = Object.getOwnPropertyDescriptor, od = (n, e, t, o) => {
|
|
|
16
16
|
(i = n[s]) && (r = i(r) || r);
|
|
17
17
|
return r;
|
|
18
18
|
}, Zs = (n, e) => (t, o) => e(t, o, n);
|
|
19
|
-
let _t = class extends
|
|
19
|
+
let _t = class extends pe {
|
|
20
20
|
constructor(e, t) {
|
|
21
21
|
super();
|
|
22
22
|
O(this, "_matches", /* @__PURE__ */ new Map());
|
|
@@ -100,8 +100,8 @@ const rd = {
|
|
|
100
100
|
toolbar: !0
|
|
101
101
|
}, id = "DOC_UI_PLUGIN";
|
|
102
102
|
var et = /* @__PURE__ */ ((n) => (n.MAIN = "__Document_Render_Main__", n.BACKGROUND = "__Document_Render_Background__", n))(et || {}), je = /* @__PURE__ */ ((n) => (n.VIEW_MAIN = "viewMain", n.VIEW_TOP = "viewTop", n.VIEW_LEFT = "viewLeft", n.VIEW_LEFT_TOP = "viewLeftTop", n))(je || {});
|
|
103
|
-
const ad = 0,
|
|
104
|
-
function
|
|
103
|
+
const ad = 0, zo = 2, cd = 4, Js = 10, Yf = "normalTextSelectionPluginName";
|
|
104
|
+
function pt(n) {
|
|
105
105
|
const { mainComponent: e, scene: t, engine: o, components: r } = n, s = e, i = r.get(et.BACKGROUND);
|
|
106
106
|
return {
|
|
107
107
|
document: s,
|
|
@@ -187,7 +187,7 @@ function Xf(n, e) {
|
|
|
187
187
|
function Zf(n, e) {
|
|
188
188
|
return e.some((t) => n.startIndex > t.startIndex && n.startIndex < t.endIndex);
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function Bo(n, e, t, o, r) {
|
|
191
191
|
const { textRuns: s = [], dataStream: i } = n, a = r && i.startsWith("="), c = {
|
|
192
192
|
st: 0,
|
|
193
193
|
ed: 0,
|
|
@@ -240,11 +240,11 @@ function $f(n, e = 0, t = 0) {
|
|
|
240
240
|
height: n.height
|
|
241
241
|
},
|
|
242
242
|
positionH: {
|
|
243
|
-
relativeFrom:
|
|
243
|
+
relativeFrom: Ro.MARGIN,
|
|
244
244
|
posOffset: (n.left || 0) - e
|
|
245
245
|
},
|
|
246
246
|
positionV: {
|
|
247
|
-
relativeFrom:
|
|
247
|
+
relativeFrom: gt.PAGE,
|
|
248
248
|
posOffset: (n.top || 0) - t
|
|
249
249
|
},
|
|
250
250
|
angle: n.angle || 0
|
|
@@ -255,28 +255,28 @@ const Ad = "doc.command.tab", Jt = {
|
|
|
255
255
|
type: D.COMMAND,
|
|
256
256
|
async handler(n, e) {
|
|
257
257
|
const o = n.get(_t).onAutoFormat(Jt.id, e);
|
|
258
|
-
return (await
|
|
258
|
+
return (await wr(o, n.get(T))).result;
|
|
259
259
|
}
|
|
260
|
-
}, ud = "doc.command.after-space",
|
|
260
|
+
}, ud = "doc.command.after-space", Mo = {
|
|
261
261
|
id: ud,
|
|
262
262
|
type: D.COMMAND,
|
|
263
263
|
async handler(n) {
|
|
264
|
-
const t = n.get(_t).onAutoFormat(
|
|
265
|
-
return (await
|
|
264
|
+
const t = n.get(_t).onAutoFormat(Mo.id);
|
|
265
|
+
return (await wr(t, n.get(T))).result;
|
|
266
266
|
}
|
|
267
267
|
}, yn = {
|
|
268
268
|
id: "doc.command.enter",
|
|
269
269
|
type: D.COMMAND,
|
|
270
270
|
async handler(n) {
|
|
271
271
|
const t = n.get(_t).onAutoFormat(yn.id);
|
|
272
|
-
return (await
|
|
272
|
+
return (await wr(t, n.get(T))).result;
|
|
273
273
|
}
|
|
274
274
|
};
|
|
275
275
|
var hd = Object.getOwnPropertyDescriptor, gd = (n, e, t, o) => {
|
|
276
276
|
for (var r = o > 1 ? void 0 : o ? hd(e, t) : e, s = n.length - 1, i; s >= 0; s--)
|
|
277
277
|
(i = n[s]) && (r = i(r) || r);
|
|
278
278
|
return r;
|
|
279
|
-
},
|
|
279
|
+
}, Go = (n, e) => (t, o) => e(t, o, n);
|
|
280
280
|
const fd = 11, pd = 9, Vn = {
|
|
281
281
|
/**
|
|
282
282
|
* fontFamily
|
|
@@ -287,7 +287,7 @@ const fd = 11, pd = 9, Vn = {
|
|
|
287
287
|
*/
|
|
288
288
|
fs: fd
|
|
289
289
|
};
|
|
290
|
-
let at = class extends
|
|
290
|
+
let at = class extends pe {
|
|
291
291
|
constructor(e, t, o) {
|
|
292
292
|
super();
|
|
293
293
|
O(this, "_cacheStyle", null);
|
|
@@ -334,13 +334,13 @@ let at = class extends fe {
|
|
|
334
334
|
}
|
|
335
335
|
};
|
|
336
336
|
at = gd([
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
337
|
+
Go(0, j(Y)),
|
|
338
|
+
Go(1, L),
|
|
339
|
+
Go(2, fe)
|
|
340
340
|
], at);
|
|
341
341
|
function qe(n, e) {
|
|
342
342
|
var o;
|
|
343
|
-
return (o = n.get(
|
|
343
|
+
return (o = n.get(fe).getRenderById(e)) == null ? void 0 : o.with(de);
|
|
344
344
|
}
|
|
345
345
|
function Ae(n, e = "") {
|
|
346
346
|
if (!e)
|
|
@@ -390,7 +390,7 @@ const Gr = {
|
|
|
390
390
|
const h = l.getUnitId(), { startOffset: u, endOffset: g } = i, p = ((ee = A.paragraphs) != null ? ee : []).find((k) => k.startIndex >= u);
|
|
391
391
|
if (!p)
|
|
392
392
|
return !1;
|
|
393
|
-
const m = u === p.startIndex, I = p.startIndex, S = s.getDefaultStyle(), v = s.getStyleCache(),
|
|
393
|
+
const m = u === p.startIndex, I = p.startIndex, S = s.getDefaultStyle(), v = s.getStyleCache(), R = Bo(A, g, S, v), E = {
|
|
394
394
|
dataStream: V.PARAGRAPH,
|
|
395
395
|
paragraphs: ma(
|
|
396
396
|
V.PARAGRAPH,
|
|
@@ -401,20 +401,20 @@ const Gr = {
|
|
|
401
401
|
st: 0,
|
|
402
402
|
ed: 1,
|
|
403
403
|
ts: {
|
|
404
|
-
...
|
|
404
|
+
...R.ts
|
|
405
405
|
}
|
|
406
406
|
}]
|
|
407
407
|
};
|
|
408
408
|
if (l == null)
|
|
409
409
|
return !1;
|
|
410
|
-
const
|
|
410
|
+
const b = t.getActiveTextRange();
|
|
411
411
|
if (A == null)
|
|
412
412
|
return !1;
|
|
413
413
|
const { collapsed: y } = i, C = E.dataStream.length, B = [
|
|
414
414
|
{
|
|
415
415
|
startOffset: u + C,
|
|
416
416
|
endOffset: u + C,
|
|
417
|
-
style:
|
|
417
|
+
style: b == null ? void 0 : b.style,
|
|
418
418
|
collapsed: y
|
|
419
419
|
}
|
|
420
420
|
], x = {
|
|
@@ -475,7 +475,7 @@ const Gr = {
|
|
|
475
475
|
return x.params.actions = P.editOp(M.serialize(), F), !!r.syncExecuteCommand(x.id, x.params);
|
|
476
476
|
}
|
|
477
477
|
};
|
|
478
|
-
var
|
|
478
|
+
var _o = /* @__PURE__ */ ((n) => (n[n.ABOVE = 0] = "ABOVE", n[n.BELLOW = 1] = "BELLOW", n))(_o || {}), Yr = /* @__PURE__ */ ((n) => (n[n.LEFT = 0] = "LEFT", n[n.RIGHT = 1] = "RIGHT", n))(Yr || {});
|
|
479
479
|
function md(n, e) {
|
|
480
480
|
let t = V.TABLE_START;
|
|
481
481
|
const o = [], r = [];
|
|
@@ -552,11 +552,11 @@ function Ea(n, e, t) {
|
|
|
552
552
|
textWrap: Pc.NONE,
|
|
553
553
|
position: {
|
|
554
554
|
positionH: {
|
|
555
|
-
relativeFrom:
|
|
555
|
+
relativeFrom: Ro.PAGE,
|
|
556
556
|
posOffset: 0
|
|
557
557
|
},
|
|
558
558
|
positionV: {
|
|
559
|
-
relativeFrom:
|
|
559
|
+
relativeFrom: gt.PAGE,
|
|
560
560
|
posOffset: 0
|
|
561
561
|
}
|
|
562
562
|
},
|
|
@@ -693,9 +693,9 @@ function vd(n, e, t) {
|
|
|
693
693
|
continue;
|
|
694
694
|
l = S;
|
|
695
695
|
for (const v of S.children) {
|
|
696
|
-
for (const
|
|
697
|
-
const E = v.children.indexOf(
|
|
698
|
-
if (a >=
|
|
696
|
+
for (const R of v.children) {
|
|
697
|
+
const E = v.children.indexOf(R);
|
|
698
|
+
if (a >= R.startIndex && a <= R.endIndex) {
|
|
699
699
|
A = E;
|
|
700
700
|
break;
|
|
701
701
|
}
|
|
@@ -749,8 +749,8 @@ function Ia(n, e) {
|
|
|
749
749
|
continue;
|
|
750
750
|
l = I.startIndex + 3;
|
|
751
751
|
for (const S of I.children) {
|
|
752
|
-
const v = I.children.indexOf(S), { startIndex:
|
|
753
|
-
t >=
|
|
752
|
+
const v = I.children.indexOf(S), { startIndex: R, endIndex: E } = S;
|
|
753
|
+
t >= R && t <= E ? (c = R, a.push(v), d += E - R + 1) : (R > t && E < o || o >= R && o <= E) && (a.push(v), d += E - R + 1), a.length === I.children.length && (A = !0);
|
|
754
754
|
}
|
|
755
755
|
}
|
|
756
756
|
if (a.length)
|
|
@@ -768,7 +768,7 @@ function Ia(n, e) {
|
|
|
768
768
|
selectWholeTable: A
|
|
769
769
|
};
|
|
770
770
|
}
|
|
771
|
-
function
|
|
771
|
+
function Rd(n, e) {
|
|
772
772
|
var g, f, p;
|
|
773
773
|
const { startOffset: t, endOffset: o, segmentId: r } = n, s = e.getSelfOrHeaderFooterViewModel(r), i = (p = (f = (g = e.getBody()) == null ? void 0 : g.tables) == null ? void 0 : f.find((m) => t >= m.startIndex && o <= m.endIndex)) == null ? void 0 : p.tableId, a = [];
|
|
774
774
|
let c = null;
|
|
@@ -781,10 +781,10 @@ function bd(n, e) {
|
|
|
781
781
|
if (t < v.startIndex || o > v.endIndex)
|
|
782
782
|
continue;
|
|
783
783
|
c = v;
|
|
784
|
-
for (const
|
|
785
|
-
for (const E of
|
|
786
|
-
const
|
|
787
|
-
t >= E.startIndex && t <= E.endIndex && (A =
|
|
784
|
+
for (const R of v.children)
|
|
785
|
+
for (const E of R.children) {
|
|
786
|
+
const b = R.children.indexOf(E);
|
|
787
|
+
t >= E.startIndex && t <= E.endIndex && (A = b), o >= E.startIndex && o <= E.endIndex && (h = b);
|
|
788
788
|
}
|
|
789
789
|
}
|
|
790
790
|
if (c)
|
|
@@ -839,7 +839,7 @@ function Sa(n, e) {
|
|
|
839
839
|
cursor: d
|
|
840
840
|
};
|
|
841
841
|
}
|
|
842
|
-
function
|
|
842
|
+
function bd(n, e) {
|
|
843
843
|
var g, f, p;
|
|
844
844
|
const { startOffset: t, endOffset: o, segmentId: r } = n, s = e.getSelfOrHeaderFooterViewModel(r), i = (p = (f = (g = e.getBody()) == null ? void 0 : g.tables) == null ? void 0 : f.find((m) => t >= m.startIndex && o <= m.endIndex)) == null ? void 0 : p.tableId, a = [];
|
|
845
845
|
let c = null, d = -1, l = -1, A = -1, h = -1;
|
|
@@ -850,11 +850,11 @@ function Rd(n, e) {
|
|
|
850
850
|
if (t < v.startIndex || o > v.endIndex)
|
|
851
851
|
continue;
|
|
852
852
|
c = v;
|
|
853
|
-
for (const
|
|
854
|
-
const E = v.children.indexOf(
|
|
855
|
-
for (const
|
|
856
|
-
const y =
|
|
857
|
-
t >=
|
|
853
|
+
for (const R of v.children) {
|
|
854
|
+
const E = v.children.indexOf(R);
|
|
855
|
+
for (const b of R.children) {
|
|
856
|
+
const y = R.children.indexOf(b);
|
|
857
|
+
t >= b.startIndex && t <= b.endIndex && (l = E, A = y), o >= b.startIndex && o <= b.endIndex && (h = y);
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
860
|
}
|
|
@@ -881,7 +881,7 @@ function Rd(n, e) {
|
|
|
881
881
|
rowCount: c.children.length
|
|
882
882
|
};
|
|
883
883
|
}
|
|
884
|
-
var
|
|
884
|
+
var Ar = /* @__PURE__ */ ((n) => (n[n.NEXT = 0] = "NEXT", n[n.PREV = 1] = "PREV", n))(Ar || {});
|
|
885
885
|
function $s(n, e, t) {
|
|
886
886
|
const { startOffset: o } = e;
|
|
887
887
|
let r = null;
|
|
@@ -968,12 +968,12 @@ const Od = In, va = {
|
|
|
968
968
|
}
|
|
969
969
|
}, m = new Nt();
|
|
970
970
|
m.reset();
|
|
971
|
-
const I = new Ee(), S = W.getInstance(), v = [],
|
|
972
|
-
if (
|
|
971
|
+
const I = new Ee(), S = W.getInstance(), v = [], R = !!((C = l.tables) != null && C.length), E = !!((B = l.customBlocks) != null && B.length);
|
|
972
|
+
if (R && t || R && xd(c) || c.length && (d != null && d.length))
|
|
973
973
|
return !1;
|
|
974
974
|
for (let w = 0; w < c.length; w++) {
|
|
975
975
|
const N = c[w], { startOffset: ee, endOffset: $, collapsed: U } = N, H = ee - m.cursor, k = ue.deepClone(l);
|
|
976
|
-
if (
|
|
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;
|
|
@@ -1017,8 +1017,8 @@ const Od = In, va = {
|
|
|
1017
1017
|
}
|
|
1018
1018
|
m.reset(), m.moveCursor($);
|
|
1019
1019
|
}
|
|
1020
|
-
const
|
|
1021
|
-
return v.push(S.editOp(I.serialize(),
|
|
1020
|
+
const b = Ae(u, t);
|
|
1021
|
+
return v.push(S.editOp(I.serialize(), b)), p.params.actions = v.reduce((w, N) => W.compose(w, N), null), !!s.syncExecuteCommand(p.id, p.params);
|
|
1022
1022
|
}
|
|
1023
1023
|
};
|
|
1024
1024
|
function Td(n, e) {
|
|
@@ -1037,10 +1037,10 @@ function Bd(n, e, t) {
|
|
|
1037
1037
|
const { tables: a = [] } = o, c = new Nt();
|
|
1038
1038
|
c.reset();
|
|
1039
1039
|
for (let p = 0; p < n.length; p++) {
|
|
1040
|
-
const m = Td(n[p], a), { startOffset: I, endOffset: S, collapsed: v } = m,
|
|
1040
|
+
const m = Td(n[p], a), { startOffset: I, endOffset: S, collapsed: v } = m, R = I - c.cursor;
|
|
1041
1041
|
v ? r.push({
|
|
1042
1042
|
t: G.RETAIN,
|
|
1043
|
-
len:
|
|
1043
|
+
len: R
|
|
1044
1044
|
}) : r.push(...ce.selection.delete([m], o, c.cursor, null, !1)), c.reset(), c.moveCursor(S);
|
|
1045
1045
|
}
|
|
1046
1046
|
const d = Ae(e, t);
|
|
@@ -1092,12 +1092,12 @@ function Md(n, e, t, o) {
|
|
|
1092
1092
|
len: I
|
|
1093
1093
|
});
|
|
1094
1094
|
for (const v of m.reverse()) {
|
|
1095
|
-
const
|
|
1096
|
-
r.push(
|
|
1095
|
+
const R = a.removeOp(["tableSource", S, "tableRows", v]);
|
|
1096
|
+
r.push(R);
|
|
1097
1097
|
}
|
|
1098
1098
|
c.moveCursorTo(p + I);
|
|
1099
1099
|
} else {
|
|
1100
|
-
const f =
|
|
1100
|
+
const f = bd({ startOffset: A, endOffset: h, segmentId: o }, t);
|
|
1101
1101
|
if (f == null)
|
|
1102
1102
|
continue;
|
|
1103
1103
|
const { offsets: p } = f;
|
|
@@ -1193,8 +1193,8 @@ const Dd = "doc.command.insert-text", Ca = {
|
|
|
1193
1193
|
len: s.dataStream.length
|
|
1194
1194
|
});
|
|
1195
1195
|
else {
|
|
1196
|
-
const
|
|
1197
|
-
I.push(...
|
|
1196
|
+
const b = ce.selection.delete([o], h, 0, s);
|
|
1197
|
+
I.push(...b);
|
|
1198
1198
|
}
|
|
1199
1199
|
m.params.textRanges = [{
|
|
1200
1200
|
startOffset: u + f,
|
|
@@ -1208,13 +1208,13 @@ const Dd = "doc.command.insert-text", Ca = {
|
|
|
1208
1208
|
id: "doc.command.delete-text",
|
|
1209
1209
|
type: D.COMMAND,
|
|
1210
1210
|
handler: async (n, e) => {
|
|
1211
|
-
var
|
|
1211
|
+
var R;
|
|
1212
1212
|
const t = n.get(T), o = n.get(L), { range: r, segmentId: s, unitId: i, direction: a, len: c = 1 } = e, d = o.getUnit(i, _.UNIVER_DOC), l = d == null ? void 0 : d.getSelfOrHeaderFooterModel(s).getBody();
|
|
1213
1213
|
if (d == null || l == null)
|
|
1214
1214
|
return !1;
|
|
1215
1215
|
const { startOffset: A } = r;
|
|
1216
1216
|
let h = a === Ne.LEFT ? A - c : A, u = a === Ne.LEFT ? A - 1 : A + c - 1;
|
|
1217
|
-
const g = (
|
|
1217
|
+
const g = (R = l.customRanges) == null ? void 0 : R.find((E) => E.startIndex <= h && E.endIndex >= u);
|
|
1218
1218
|
g != null && g.wholeEntity && (h = g.startIndex, u = Math.max(u, g.endIndex));
|
|
1219
1219
|
const f = {
|
|
1220
1220
|
id: X.id,
|
|
@@ -1239,7 +1239,7 @@ const Dd = "doc.command.insert-text", Ca = {
|
|
|
1239
1239
|
const S = Ae(d, s);
|
|
1240
1240
|
return f.params.actions = m.editOp(p.serialize(), S), !!t.syncExecuteCommand(f.id, f.params);
|
|
1241
1241
|
}
|
|
1242
|
-
},
|
|
1242
|
+
}, Ra = {
|
|
1243
1243
|
id: "doc.command.update-text",
|
|
1244
1244
|
type: D.COMMAND,
|
|
1245
1245
|
handler: async (n, e) => {
|
|
@@ -1304,7 +1304,7 @@ const Zr = {
|
|
|
1304
1304
|
});
|
|
1305
1305
|
const v = Ae(i, h);
|
|
1306
1306
|
S.push(I.editOp(m.serialize(), v));
|
|
1307
|
-
const
|
|
1307
|
+
const R = ((x = i.getDrawings()) != null ? x : {})[l], b = i.getDrawingsOrder().indexOf(l), y = I.removeOp(["drawings", l], R), C = I.removeOp(["drawingsOrder", b], l);
|
|
1308
1308
|
return S.push(y), S.push(C), p.params.actions = S.reduce((M, P) => W.compose(M, P), null), !!r.syncExecuteCommand(p.id, p.params);
|
|
1309
1309
|
}
|
|
1310
1310
|
}, Jr = {
|
|
@@ -1332,13 +1332,13 @@ const Zr = {
|
|
|
1332
1332
|
}
|
|
1333
1333
|
if (S == null || v == null)
|
|
1334
1334
|
return !1;
|
|
1335
|
-
const
|
|
1335
|
+
const R = s === Ne.LEFT ? p - 1 : p, E = [
|
|
1336
1336
|
{
|
|
1337
|
-
startOffset:
|
|
1338
|
-
endOffset:
|
|
1337
|
+
startOffset: R,
|
|
1338
|
+
endOffset: R,
|
|
1339
1339
|
style: l
|
|
1340
1340
|
}
|
|
1341
|
-
],
|
|
1341
|
+
], b = {
|
|
1342
1342
|
id: X.id,
|
|
1343
1343
|
params: {
|
|
1344
1344
|
unitId: f,
|
|
@@ -1373,14 +1373,14 @@ const Zr = {
|
|
|
1373
1373
|
}
|
|
1374
1374
|
});
|
|
1375
1375
|
const M = Ae(A, d);
|
|
1376
|
-
return
|
|
1376
|
+
return b.params.actions = C.editOp(y.serialize(), M), !!r.syncExecuteCommand(b.id, b.params);
|
|
1377
1377
|
}
|
|
1378
|
-
},
|
|
1378
|
+
}, ba = {
|
|
1379
1379
|
id: "doc.command.remove-horizontal-line",
|
|
1380
1380
|
type: D.COMMAND,
|
|
1381
1381
|
// eslint-disable-next-line max-lines-per-function
|
|
1382
1382
|
handler: async (n) => {
|
|
1383
|
-
var
|
|
1383
|
+
var R;
|
|
1384
1384
|
const e = n.get(Y), t = n.get(L), o = n.get(T), r = e.getActiveTextRange(), s = e.getTextRanges();
|
|
1385
1385
|
if (r == null || s == null)
|
|
1386
1386
|
return !1;
|
|
@@ -1390,7 +1390,7 @@ const Zr = {
|
|
|
1390
1390
|
const l = r, A = c.getUnitId(), { startOffset: h, collapsed: u } = l;
|
|
1391
1391
|
if (!u)
|
|
1392
1392
|
return !1;
|
|
1393
|
-
const g = (
|
|
1393
|
+
const g = (R = d.paragraphs) == null ? void 0 : R.find((E) => E.startIndex === h - 1);
|
|
1394
1394
|
if (g == null)
|
|
1395
1395
|
return !1;
|
|
1396
1396
|
const f = [
|
|
@@ -1454,7 +1454,7 @@ function $r(n, e) {
|
|
|
1454
1454
|
}
|
|
1455
1455
|
return t;
|
|
1456
1456
|
}
|
|
1457
|
-
const
|
|
1457
|
+
const Do = {
|
|
1458
1458
|
id: "doc.command.delete-left",
|
|
1459
1459
|
type: D.COMMAND,
|
|
1460
1460
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
@@ -1485,10 +1485,10 @@ const _o = {
|
|
|
1485
1485
|
const { segmentId: h, style: u, segmentPage: g } = c, f = s.getSelfOrHeaderFooterModel(h).getBody();
|
|
1486
1486
|
if (f == null)
|
|
1487
1487
|
return !1;
|
|
1488
|
-
const p = c, { startOffset: m, collapsed: I } = p, S = A.findNodeByCharIndex(m, h, g), v = ol(S),
|
|
1488
|
+
const p = c, { startOffset: m, collapsed: I } = p, S = A.findNodeByCharIndex(m, h, g), v = ol(S), R = rl(S, f);
|
|
1489
1489
|
let E = m;
|
|
1490
|
-
const
|
|
1491
|
-
if (sl(S) &&
|
|
1490
|
+
const b = A.findNodeByCharIndex(m - 1, h, g);
|
|
1491
|
+
if (sl(S) && b !== S && (v === !0 || R === !0) && I) {
|
|
1492
1492
|
const w = il(S, f);
|
|
1493
1493
|
if (w == null)
|
|
1494
1494
|
return !1;
|
|
@@ -1500,7 +1500,7 @@ const _o = {
|
|
|
1500
1500
|
const { hanging: k } = H;
|
|
1501
1501
|
k && (ee.paragraphStyle.indentStart = k, ee.paragraphStyle.hanging = void 0);
|
|
1502
1502
|
}
|
|
1503
|
-
} else if (
|
|
1503
|
+
} else if (R === !0) {
|
|
1504
1504
|
const H = w.bullet;
|
|
1505
1505
|
H && (ee.bullet = H), $ != null && (ee.paragraphStyle = { ...$ }, delete ee.paragraphStyle.hanging, delete ee.paragraphStyle.indentStart);
|
|
1506
1506
|
}
|
|
@@ -1511,7 +1511,7 @@ const _o = {
|
|
|
1511
1511
|
style: u
|
|
1512
1512
|
}
|
|
1513
1513
|
];
|
|
1514
|
-
r = await o.executeCommand(
|
|
1514
|
+
r = await o.executeCommand(Ra.id, {
|
|
1515
1515
|
unitId: s.getUnitId(),
|
|
1516
1516
|
updateBody: {
|
|
1517
1517
|
dataStream: "",
|
|
@@ -1526,32 +1526,32 @@ const _o = {
|
|
|
1526
1526
|
segmentId: h
|
|
1527
1527
|
});
|
|
1528
1528
|
} else if (I === !0) {
|
|
1529
|
-
if (
|
|
1529
|
+
if (b == null)
|
|
1530
1530
|
return !0;
|
|
1531
|
-
if (
|
|
1531
|
+
if (b.content === "\r") {
|
|
1532
1532
|
const w = (C = f.paragraphs) == null ? void 0 : C.find((N) => N.startIndex === m - 1);
|
|
1533
|
-
(B = w == null ? void 0 : w.paragraphStyle) != null && B.borderBottom ? r = await o.executeCommand(
|
|
1533
|
+
(B = w == null ? void 0 : w.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
|
-
} else if (
|
|
1538
|
-
const w = (M = s.getSnapshot().drawings) == null ? void 0 : M[(x =
|
|
1537
|
+
} else if (b.streamType === "\b") {
|
|
1538
|
+
const w = (M = s.getSnapshot().drawings) == null ? void 0 : M[(x = b.drawingId) != null ? x : ""];
|
|
1539
1539
|
if (w == null)
|
|
1540
1540
|
return !0;
|
|
1541
|
-
const N = (F = (P = s.getBody()) == null ? void 0 : P.customBlocks) == null ? void 0 : F.find(($) => $.blockId ===
|
|
1542
|
-
if (w.layoutType ===
|
|
1541
|
+
const N = (F = (P = s.getBody()) == null ? void 0 : P.customBlocks) == null ? void 0 : F.find(($) => $.blockId === b.drawingId);
|
|
1542
|
+
if (w.layoutType === bo.INLINE || (N == null ? void 0 : N.blockType) === Nc.CUSTOM) {
|
|
1543
1543
|
const $ = s.getUnitId();
|
|
1544
1544
|
r = await o.executeCommand(Zr.id, {
|
|
1545
1545
|
direction: Ne.LEFT,
|
|
1546
1546
|
range: c,
|
|
1547
1547
|
unitId: $,
|
|
1548
|
-
drawingId:
|
|
1548
|
+
drawingId: b.drawingId
|
|
1549
1549
|
});
|
|
1550
1550
|
} else {
|
|
1551
1551
|
const $ = A.findNodeByCharIndex(m - 2);
|
|
1552
1552
|
if ($ == null)
|
|
1553
1553
|
return !0;
|
|
1554
|
-
E -=
|
|
1554
|
+
E -= b.count, E -= $.count;
|
|
1555
1555
|
const U = [
|
|
1556
1556
|
{
|
|
1557
1557
|
startOffset: E,
|
|
@@ -1573,12 +1573,12 @@ const _o = {
|
|
|
1573
1573
|
});
|
|
1574
1574
|
}
|
|
1575
1575
|
} else
|
|
1576
|
-
E -=
|
|
1576
|
+
E -= b.count, r = await o.executeCommand(xn.id, {
|
|
1577
1577
|
unitId: s.getUnitId(),
|
|
1578
1578
|
range: p,
|
|
1579
1579
|
segmentId: h,
|
|
1580
1580
|
direction: Ne.LEFT,
|
|
1581
|
-
len:
|
|
1581
|
+
len: b.count
|
|
1582
1582
|
});
|
|
1583
1583
|
} else {
|
|
1584
1584
|
const w = xa(p, [p]);
|
|
@@ -1601,15 +1601,15 @@ const _o = {
|
|
|
1601
1601
|
return !1;
|
|
1602
1602
|
const r = qe(n, o.getUnitId()), s = n.get(T), i = e.getActiveTextRange(), a = e.getRectRanges(), c = e.getTextRanges(), d = r == null ? void 0 : r.getSkeleton();
|
|
1603
1603
|
if (a != null && a.length) {
|
|
1604
|
-
const
|
|
1604
|
+
const R = $r(c, a), E = a[0].segmentId, b = [
|
|
1605
1605
|
{
|
|
1606
|
-
startOffset:
|
|
1607
|
-
endOffset:
|
|
1606
|
+
startOffset: R,
|
|
1607
|
+
endOffset: R
|
|
1608
1608
|
}
|
|
1609
1609
|
];
|
|
1610
1610
|
return s.executeCommand($t.id, {
|
|
1611
1611
|
segmentId: E,
|
|
1612
|
-
textRanges:
|
|
1612
|
+
textRanges: b
|
|
1613
1613
|
});
|
|
1614
1614
|
}
|
|
1615
1615
|
if (i == null || d == null || c == null)
|
|
@@ -1622,25 +1622,25 @@ const _o = {
|
|
|
1622
1622
|
return !0;
|
|
1623
1623
|
let I = !1;
|
|
1624
1624
|
if (m === !0) {
|
|
1625
|
-
const
|
|
1626
|
-
if (
|
|
1625
|
+
const R = d.findNodeByCharIndex(f, l, h), E = d.findNodeByCharIndex(f + 1);
|
|
1626
|
+
if (R.streamType === V.PARAGRAPH && (E == null ? void 0 : E.streamType) === V.SECTION_BREAK)
|
|
1627
1627
|
return !1;
|
|
1628
|
-
if (
|
|
1628
|
+
if (R.content === "\r")
|
|
1629
1629
|
I = await s.executeCommand(Jr.id, {
|
|
1630
1630
|
direction: Ne.RIGHT,
|
|
1631
1631
|
range: i
|
|
1632
1632
|
});
|
|
1633
|
-
else if (
|
|
1634
|
-
const
|
|
1635
|
-
if (
|
|
1633
|
+
else if (R.streamType === "\b") {
|
|
1634
|
+
const b = (v = o.getSnapshot().drawings) == null ? void 0 : v[(S = R.drawingId) != null ? S : ""];
|
|
1635
|
+
if (b == null)
|
|
1636
1636
|
return !0;
|
|
1637
|
-
if (
|
|
1637
|
+
if (b.layoutType === bo.INLINE) {
|
|
1638
1638
|
const C = o.getUnitId();
|
|
1639
1639
|
I = await s.executeCommand(Zr.id, {
|
|
1640
1640
|
direction: Ne.RIGHT,
|
|
1641
1641
|
range: i,
|
|
1642
1642
|
unitId: C,
|
|
1643
|
-
drawingId:
|
|
1643
|
+
drawingId: R.drawingId
|
|
1644
1644
|
});
|
|
1645
1645
|
} else {
|
|
1646
1646
|
if (E == null)
|
|
@@ -1666,7 +1666,7 @@ const _o = {
|
|
|
1666
1666
|
});
|
|
1667
1667
|
}
|
|
1668
1668
|
} else {
|
|
1669
|
-
const
|
|
1669
|
+
const b = [
|
|
1670
1670
|
{
|
|
1671
1671
|
startOffset: f,
|
|
1672
1672
|
endOffset: f,
|
|
@@ -1678,15 +1678,15 @@ const _o = {
|
|
|
1678
1678
|
range: g,
|
|
1679
1679
|
segmentId: l,
|
|
1680
1680
|
direction: Ne.RIGHT,
|
|
1681
|
-
textRanges:
|
|
1682
|
-
len:
|
|
1681
|
+
textRanges: b,
|
|
1682
|
+
len: R.count
|
|
1683
1683
|
});
|
|
1684
1684
|
}
|
|
1685
1685
|
} else {
|
|
1686
|
-
const
|
|
1686
|
+
const R = xa(g, [g]);
|
|
1687
1687
|
I = await s.executeCommand($t.id, {
|
|
1688
1688
|
segmentId: l,
|
|
1689
|
-
textRanges:
|
|
1689
|
+
textRanges: R,
|
|
1690
1690
|
selections: [g]
|
|
1691
1691
|
});
|
|
1692
1692
|
}
|
|
@@ -1762,7 +1762,7 @@ class Qd {
|
|
|
1762
1762
|
this._cache.clear();
|
|
1763
1763
|
}
|
|
1764
1764
|
}
|
|
1765
|
-
const
|
|
1765
|
+
const Yo = new Qd();
|
|
1766
1766
|
function ts(n) {
|
|
1767
1767
|
const e = n.style, t = {}, o = n.tagName.toLowerCase();
|
|
1768
1768
|
switch (o) {
|
|
@@ -1911,16 +1911,16 @@ const ti = 660, Co = class Co {
|
|
|
1911
1911
|
size: { width: f, height: p },
|
|
1912
1912
|
angle: 0,
|
|
1913
1913
|
positionH: {
|
|
1914
|
-
relativeFrom:
|
|
1914
|
+
relativeFrom: Ro.PAGE,
|
|
1915
1915
|
posOffset: 0
|
|
1916
1916
|
},
|
|
1917
1917
|
positionV: {
|
|
1918
|
-
relativeFrom:
|
|
1918
|
+
relativeFrom: gt.PARAGRAPH,
|
|
1919
1919
|
posOffset: 0
|
|
1920
1920
|
}
|
|
1921
1921
|
},
|
|
1922
|
-
layoutType:
|
|
1923
|
-
drawingType:
|
|
1922
|
+
layoutType: bo.INLINE,
|
|
1923
|
+
drawingType: Nr.DRAWING_IMAGE,
|
|
1924
1924
|
unitId: o.id || "",
|
|
1925
1925
|
subUnitId: o.id || ""
|
|
1926
1926
|
};
|
|
@@ -2007,7 +2007,7 @@ ${V.TABLE_CELL_END}`;
|
|
|
2007
2007
|
startIndex: o,
|
|
2008
2008
|
endIndex: r.dataStream.length - 1,
|
|
2009
2009
|
rangeId: (a = s.dataset.rangeid) != null ? a : ge(),
|
|
2010
|
-
rangeType:
|
|
2010
|
+
rangeType: Lr.HYPERLINK,
|
|
2011
2011
|
properties: { url: s.href }
|
|
2012
2012
|
}));
|
|
2013
2013
|
}
|
|
@@ -2147,7 +2147,7 @@ function ni(n, e) {
|
|
|
2147
2147
|
const p = [];
|
|
2148
2148
|
return a === z.TRUE && (f = `<i>${f}</i>`), g === Ve.SUPERSCRIPT ? f = `<sup>${f}</sup>` : g === Ve.SUBSCRIPT && (f = `<sub>${f}</sub>`), (d == null ? void 0 : d.s) === z.TRUE && (f = `<u>${f}</u>`), (l == null ? void 0 : l.s) === z.TRUE && (f = `<s>${f}</s>`), c === z.TRUE && (f = `<strong>${f}</strong>`), s && p.push(`font-family: ${s}`), u && p.push(`color: ${u.rgb}`), i && p.push(`font-size: ${i}pt`), A && p.push("text-decoration: overline"), h && p.push(`background: ${h.rgb}`), p.length ? `<span style="${p.join("; ")};">${f}</span>` : f;
|
|
2149
2149
|
}
|
|
2150
|
-
function
|
|
2150
|
+
function Ko(n, e, t) {
|
|
2151
2151
|
const { dataStream: o, textRuns: r = [] } = n;
|
|
2152
2152
|
if (e === t)
|
|
2153
2153
|
return "";
|
|
@@ -2172,30 +2172,30 @@ function Wd(n, e, t) {
|
|
|
2172
2172
|
const A = (u, g) => {
|
|
2173
2173
|
let f = "", p = 0, m = u, I = a.findIndex((S) => u <= S.startIndex && g >= S.startIndex);
|
|
2174
2174
|
if (I === -1)
|
|
2175
|
-
return f =
|
|
2175
|
+
return f = Ko(o, u, g), { sliceHtml: f, customBlockLength: p };
|
|
2176
2176
|
for (; I !== -1; ) {
|
|
2177
2177
|
const S = a[I];
|
|
2178
|
-
a.splice(I, 1), f +=
|
|
2178
|
+
a.splice(I, 1), f += Ko(o, m, S.startIndex);
|
|
2179
2179
|
const v = r[S.blockId];
|
|
2180
2180
|
if (v)
|
|
2181
2181
|
switch (v.drawingType) {
|
|
2182
|
-
case
|
|
2182
|
+
case Nr.DRAWING_IMAGE: {
|
|
2183
2183
|
f += Vd(v), p++;
|
|
2184
2184
|
break;
|
|
2185
2185
|
}
|
|
2186
2186
|
}
|
|
2187
|
-
m = S.startIndex + 1, I = a.findIndex((
|
|
2187
|
+
m = S.startIndex + 1, I = a.findIndex((R) => m <= R.startIndex && g >= R.startIndex);
|
|
2188
2188
|
}
|
|
2189
|
-
return f = f +
|
|
2189
|
+
return f = f + Ko(o, m, g + 1), { sliceHtml: f, customBlockLength: p };
|
|
2190
2190
|
};
|
|
2191
2191
|
c.forEach((u) => {
|
|
2192
|
-
var v,
|
|
2192
|
+
var v, R;
|
|
2193
2193
|
const { startIndex: g, endIndex: f, rangeType: p, rangeId: m } = u, I = A(d, g);
|
|
2194
2194
|
l += I.sliceHtml;
|
|
2195
2195
|
const S = A(g, f + 1);
|
|
2196
2196
|
switch (p) {
|
|
2197
|
-
case
|
|
2198
|
-
l += `<a data-rangeid="${m}" href="${(
|
|
2197
|
+
case Lr.HYPERLINK: {
|
|
2198
|
+
l += `<a data-rangeid="${m}" href="${(R = (v = u.properties) == null ? void 0 : v.url) != null ? R : ""}">${S.sliceHtml}</a>`;
|
|
2199
2199
|
break;
|
|
2200
2200
|
}
|
|
2201
2201
|
default: {
|
|
@@ -2300,7 +2300,7 @@ function oi(n, e, t) {
|
|
|
2300
2300
|
}), o;
|
|
2301
2301
|
}
|
|
2302
2302
|
const Lt = Yi("doc.clipboard-service");
|
|
2303
|
-
let
|
|
2303
|
+
let ur = class extends pe {
|
|
2304
2304
|
constructor(e, t, o, r, s) {
|
|
2305
2305
|
super();
|
|
2306
2306
|
O(this, "_clipboardHooks", []);
|
|
@@ -2308,7 +2308,7 @@ let Ar = class extends fe {
|
|
|
2308
2308
|
O(this, "_umdToHtml", new zd());
|
|
2309
2309
|
this._univerInstanceService = e, this._logService = t, this._commandService = o, this._clipboardInterfaceService = r, this._docSelectionManagerService = s;
|
|
2310
2310
|
}
|
|
2311
|
-
async copy(e =
|
|
2311
|
+
async copy(e = ir.copy, t) {
|
|
2312
2312
|
var a, c;
|
|
2313
2313
|
const { newSnapshotList: o = [], needCache: r = !1, snapshot: s, ranges: i } = (a = this._getDocumentBodyInRanges(e, t)) != null ? a : {};
|
|
2314
2314
|
if (o.length === 0 || s == null)
|
|
@@ -2334,7 +2334,7 @@ let Ar = class extends fe {
|
|
|
2334
2334
|
if (!t && !o && r.length && (t = await this._createImagePasteHtml(r)), !t && !o)
|
|
2335
2335
|
return this._logService.warn("[DocClipboardController] html and text cannot be both empty!"), !1;
|
|
2336
2336
|
const a = this._genDocDataFromHtmlAndText(t, o, i);
|
|
2337
|
-
if (i ===
|
|
2337
|
+
if (i === yo)
|
|
2338
2338
|
if (o) {
|
|
2339
2339
|
const c = ce.transform.fromPlainText(o);
|
|
2340
2340
|
return this._paste({ body: c });
|
|
@@ -2351,7 +2351,7 @@ let Ar = class extends fe {
|
|
|
2351
2351
|
} = (A = t[0]) != null ? A : {};
|
|
2352
2352
|
if (r == null && this._logService.error("[DocClipboardController] segmentId is not existed"), t.length === 0 && o.length === 0)
|
|
2353
2353
|
return !1;
|
|
2354
|
-
this.copy(
|
|
2354
|
+
this.copy(ir.cut, e);
|
|
2355
2355
|
try {
|
|
2356
2356
|
let h = 0;
|
|
2357
2357
|
if (o.length > 0)
|
|
@@ -2447,7 +2447,7 @@ let Ar = class extends fe {
|
|
|
2447
2447
|
}
|
|
2448
2448
|
}
|
|
2449
2449
|
}
|
|
2450
|
-
|
|
2450
|
+
Yo.set(o, A);
|
|
2451
2451
|
}
|
|
2452
2452
|
return this._clipboardInterfaceService.write(r, s);
|
|
2453
2453
|
}
|
|
@@ -2502,7 +2502,7 @@ let Ar = class extends fe {
|
|
|
2502
2502
|
t = await s.getType(i).then((a) => a && a.text());
|
|
2503
2503
|
break;
|
|
2504
2504
|
}
|
|
2505
|
-
case
|
|
2505
|
+
case Rl:
|
|
2506
2506
|
case Cl:
|
|
2507
2507
|
case vl:
|
|
2508
2508
|
case Sl: {
|
|
@@ -2524,7 +2524,7 @@ let Ar = class extends fe {
|
|
|
2524
2524
|
}
|
|
2525
2525
|
const r = Ld(e);
|
|
2526
2526
|
if (r) {
|
|
2527
|
-
const i =
|
|
2527
|
+
const i = Yo.get(r);
|
|
2528
2528
|
if (i)
|
|
2529
2529
|
return i;
|
|
2530
2530
|
}
|
|
@@ -2533,7 +2533,7 @@ let Ar = class extends fe {
|
|
|
2533
2533
|
o = (i == null ? void 0 : i.getUnitId()) || "";
|
|
2534
2534
|
}
|
|
2535
2535
|
const s = this._htmlToUDM.convert(e, { unitId: o });
|
|
2536
|
-
return r &&
|
|
2536
|
+
return r && Yo.set(r, s), s;
|
|
2537
2537
|
}
|
|
2538
2538
|
async _createImagePasteHtml(e) {
|
|
2539
2539
|
var a, c;
|
|
@@ -2578,8 +2578,8 @@ let Ar = class extends fe {
|
|
|
2578
2578
|
title: "",
|
|
2579
2579
|
source: A.source,
|
|
2580
2580
|
description: "",
|
|
2581
|
-
layoutType:
|
|
2582
|
-
drawingType:
|
|
2581
|
+
layoutType: bo.INLINE,
|
|
2582
|
+
drawingType: Nr.DRAWING_IMAGE,
|
|
2583
2583
|
transform: {
|
|
2584
2584
|
width: h,
|
|
2585
2585
|
height: u,
|
|
@@ -2588,30 +2588,30 @@ let Ar = class extends fe {
|
|
|
2588
2588
|
docTransform: {
|
|
2589
2589
|
angle: 0,
|
|
2590
2590
|
size: { width: h, height: u },
|
|
2591
|
-
positionH: { relativeFrom:
|
|
2592
|
-
positionV: { relativeFrom:
|
|
2591
|
+
positionH: { relativeFrom: Ro.CHARACTER, posOffset: 0 },
|
|
2592
|
+
positionV: { relativeFrom: gt.LINE, posOffset: 0 }
|
|
2593
2593
|
}
|
|
2594
2594
|
};
|
|
2595
2595
|
})), this._umdToHtml.convert([t]);
|
|
2596
2596
|
}
|
|
2597
2597
|
};
|
|
2598
|
-
|
|
2598
|
+
ur = Yd([
|
|
2599
2599
|
ln(0, L),
|
|
2600
|
-
ln(1,
|
|
2600
|
+
ln(1, Qr),
|
|
2601
2601
|
ln(2, T),
|
|
2602
2602
|
ln(3, sa),
|
|
2603
2603
|
ln(4, j(Y))
|
|
2604
|
-
],
|
|
2605
|
-
function
|
|
2604
|
+
], ur);
|
|
2605
|
+
function Po(n) {
|
|
2606
2606
|
return n.getContextValue(Dn) || n.getContextValue(to);
|
|
2607
2607
|
}
|
|
2608
2608
|
const ns = 999, so = {
|
|
2609
|
-
id:
|
|
2609
|
+
id: bl.id,
|
|
2610
2610
|
name: "doc.command.copy",
|
|
2611
2611
|
type: D.COMMAND,
|
|
2612
2612
|
multi: !0,
|
|
2613
2613
|
priority: ns,
|
|
2614
|
-
preconditions:
|
|
2614
|
+
preconditions: Po,
|
|
2615
2615
|
handler: async (n) => n.get(Lt).copy()
|
|
2616
2616
|
}, os = {
|
|
2617
2617
|
id: "doc.command.copy-current-paragraph",
|
|
@@ -2619,7 +2619,7 @@ const ns = 999, so = {
|
|
|
2619
2619
|
handler: async (n) => {
|
|
2620
2620
|
const e = n.get(Lt), t = Un(n);
|
|
2621
2621
|
return t ? e.copy(
|
|
2622
|
-
|
|
2622
|
+
ir.copy,
|
|
2623
2623
|
[{
|
|
2624
2624
|
startOffset: t.paragraphStart,
|
|
2625
2625
|
endOffset: t.paragraphEnd + 1,
|
|
@@ -2633,7 +2633,7 @@ const ns = 999, so = {
|
|
|
2633
2633
|
type: D.COMMAND,
|
|
2634
2634
|
multi: !0,
|
|
2635
2635
|
priority: ns,
|
|
2636
|
-
preconditions:
|
|
2636
|
+
preconditions: Po,
|
|
2637
2637
|
handler: async (n) => n.get(Lt).cut()
|
|
2638
2638
|
}, ss = {
|
|
2639
2639
|
id: "doc.command.cut-current-paragraph",
|
|
@@ -2655,12 +2655,12 @@ const ns = 999, so = {
|
|
|
2655
2655
|
type: D.COMMAND,
|
|
2656
2656
|
multi: !0,
|
|
2657
2657
|
priority: ns,
|
|
2658
|
-
preconditions:
|
|
2658
|
+
preconditions: Po,
|
|
2659
2659
|
handler: async (n) => {
|
|
2660
2660
|
const e = n.get(Lt), o = await n.get(sa).read();
|
|
2661
2661
|
return o.length === 0 ? !1 : e.paste(o);
|
|
2662
2662
|
}
|
|
2663
|
-
},
|
|
2663
|
+
}, wo = {
|
|
2664
2664
|
id: "doc.command.horizontal-line",
|
|
2665
2665
|
type: D.COMMAND,
|
|
2666
2666
|
handler: (n, e) => n.get(T).syncExecuteCommand(Gr.id, {
|
|
@@ -2679,7 +2679,7 @@ const ns = 999, so = {
|
|
|
2679
2679
|
type: D.COMMAND,
|
|
2680
2680
|
handler: (n) => {
|
|
2681
2681
|
const e = n.get(T), t = Un(n);
|
|
2682
|
-
return t ? e.syncExecuteCommand(
|
|
2682
|
+
return t ? e.syncExecuteCommand(wo.id, {
|
|
2683
2683
|
insertRange: {
|
|
2684
2684
|
startOffset: t.startIndex + 1,
|
|
2685
2685
|
endOffset: t.startIndex + 1
|
|
@@ -2727,7 +2727,7 @@ const ns = 999, so = {
|
|
|
2727
2727
|
}, !1), !0;
|
|
2728
2728
|
}
|
|
2729
2729
|
};
|
|
2730
|
-
class
|
|
2730
|
+
class No extends St {
|
|
2731
2731
|
constructor(t) {
|
|
2732
2732
|
super();
|
|
2733
2733
|
O(this, "_previousActiveRange", null);
|
|
@@ -2782,7 +2782,7 @@ const Ba = {
|
|
|
2782
2782
|
// eslint-disable-next-line max-lines-per-function
|
|
2783
2783
|
handler: async (n, e) => {
|
|
2784
2784
|
var N, ee, $;
|
|
2785
|
-
const { unitId: t, newText: o, oldTextLen: r, isCompositionEnd: s, isCompositionStart: i } = e, a = n.get(T), c = n.get(
|
|
2785
|
+
const { unitId: t, newText: o, oldTextLen: r, isCompositionEnd: s, isCompositionStart: i } = e, a = n.get(T), c = n.get(fe), d = n.get(L), l = n.get(at), A = (N = c.getRenderById(t)) == null ? void 0 : N.with(No), h = d.getUnit(t, _.UNIVER_DOC);
|
|
2786
2786
|
if (h == null || A == null)
|
|
2787
2787
|
return !1;
|
|
2788
2788
|
const u = A.getActiveRange();
|
|
@@ -2792,7 +2792,7 @@ const Ba = {
|
|
|
2792
2792
|
if (p == null)
|
|
2793
2793
|
return !1;
|
|
2794
2794
|
Object.assign(u, u);
|
|
2795
|
-
const { startOffset: I, endOffset: S } = u, v = o.length,
|
|
2795
|
+
const { startOffset: I, endOffset: S } = u, v = o.length, R = [
|
|
2796
2796
|
{
|
|
2797
2797
|
startOffset: I + v,
|
|
2798
2798
|
endOffset: I + v,
|
|
@@ -2804,12 +2804,12 @@ const Ba = {
|
|
|
2804
2804
|
params: {
|
|
2805
2805
|
unitId: t,
|
|
2806
2806
|
actions: [],
|
|
2807
|
-
textRanges:
|
|
2807
|
+
textRanges: R
|
|
2808
2808
|
}
|
|
2809
|
-
},
|
|
2809
|
+
}, b = l.getDefaultStyle(), y = l.getStyleCache(), C = jr((ee = p.customRanges) != null ? ee : [], I + r, In.includes(t)), B = Bo(
|
|
2810
2810
|
p,
|
|
2811
2811
|
i ? S : I + r,
|
|
2812
|
-
|
|
2812
|
+
b,
|
|
2813
2813
|
y,
|
|
2814
2814
|
In.includes(t)
|
|
2815
2815
|
), x = zr(($ = p.customDecorations) != null ? $ : [], I + r), M = new Ee(), P = W.getInstance();
|
|
@@ -2857,7 +2857,7 @@ const Ba = {
|
|
|
2857
2857
|
}
|
|
2858
2858
|
};
|
|
2859
2859
|
function Xe(n, e, t) {
|
|
2860
|
-
return t.executeCommand(
|
|
2860
|
+
return t.executeCommand(Rt.id, {
|
|
2861
2861
|
preCommandId: n,
|
|
2862
2862
|
...e != null ? e : {}
|
|
2863
2863
|
});
|
|
@@ -2906,7 +2906,7 @@ const ri = "doc.command.set-inline-format-bold", Qt = {
|
|
|
2906
2906
|
t
|
|
2907
2907
|
);
|
|
2908
2908
|
}
|
|
2909
|
-
}, ci = "doc.command.set-inline-format-subscript",
|
|
2909
|
+
}, ci = "doc.command.set-inline-format-subscript", Ct = {
|
|
2910
2910
|
id: ci,
|
|
2911
2911
|
type: D.COMMAND,
|
|
2912
2912
|
handler: async (n, e) => {
|
|
@@ -2983,7 +2983,7 @@ const ri = "doc.command.set-inline-format-bold", Qt = {
|
|
|
2983
2983
|
t
|
|
2984
2984
|
);
|
|
2985
2985
|
}
|
|
2986
|
-
},
|
|
2986
|
+
}, hr = {
|
|
2987
2987
|
[Qt.id]: "bl",
|
|
2988
2988
|
[Ut.id]: "it",
|
|
2989
2989
|
[Ft.id]: "ul",
|
|
@@ -2993,15 +2993,15 @@ const ri = "doc.command.set-inline-format-bold", Qt = {
|
|
|
2993
2993
|
[Dt.id]: "cl",
|
|
2994
2994
|
[Pt.id]: "bg",
|
|
2995
2995
|
[Fn.id]: "bg",
|
|
2996
|
-
[
|
|
2996
|
+
[Ct.id]: "va",
|
|
2997
2997
|
[kt.id]: "va"
|
|
2998
|
-
},
|
|
2998
|
+
}, Rt = {
|
|
2999
2999
|
id: "doc.command.set-inline-format",
|
|
3000
3000
|
type: D.COMMAND,
|
|
3001
3001
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
3002
3002
|
handler: async (n, e) => {
|
|
3003
|
-
var
|
|
3004
|
-
const { value: t, preCommandId: o } = e, r = n.get(T), s = n.get(Y), i = n.get(L), a = n.get(at), c = s.getDocRanges(), d = (
|
|
3003
|
+
var R;
|
|
3004
|
+
const { value: t, preCommandId: o } = e, r = n.get(T), s = n.get(Y), i = n.get(L), a = n.get(at), c = s.getDocRanges(), d = (R = c.find((E) => E.isActive)) != null ? R : c[0];
|
|
3005
3005
|
if (c.length === 0)
|
|
3006
3006
|
return !1;
|
|
3007
3007
|
const { segmentId: l } = c[0], A = i.getCurrentUnitForType(_.UNIVER_DOC);
|
|
@@ -3021,16 +3021,16 @@ const ri = "doc.command.set-inline-format-bold", Qt = {
|
|
|
3021
3021
|
// fallthrough
|
|
3022
3022
|
case Ht.id:
|
|
3023
3023
|
// fallthrough
|
|
3024
|
-
case
|
|
3024
|
+
case Ct.id:
|
|
3025
3025
|
// fallthrough
|
|
3026
3026
|
case kt.id: {
|
|
3027
|
-
const E = a.getDefaultStyle(),
|
|
3027
|
+
const E = a.getDefaultStyle(), b = _a(
|
|
3028
3028
|
h,
|
|
3029
3029
|
d,
|
|
3030
3030
|
E
|
|
3031
3031
|
);
|
|
3032
3032
|
g = qd(
|
|
3033
|
-
|
|
3033
|
+
b,
|
|
3034
3034
|
o
|
|
3035
3035
|
);
|
|
3036
3036
|
break;
|
|
@@ -3066,11 +3066,11 @@ const ri = "doc.command.set-inline-format-bold", Qt = {
|
|
|
3066
3066
|
}, p = new Ee(), m = W.getInstance(), I = new Nt();
|
|
3067
3067
|
I.reset();
|
|
3068
3068
|
for (const E of c) {
|
|
3069
|
-
let { startOffset:
|
|
3070
|
-
if (
|
|
3069
|
+
let { startOffset: b, endOffset: y, rangeType: C } = E;
|
|
3070
|
+
if (b == null || y == null)
|
|
3071
3071
|
continue;
|
|
3072
|
-
if (C === He.RECT && (
|
|
3073
|
-
const M = a.getStyleCache(), P =
|
|
3072
|
+
if (C === He.RECT && (b = b - 1), b === y) {
|
|
3073
|
+
const M = a.getStyleCache(), P = hr[o];
|
|
3074
3074
|
a.setStyleCache(
|
|
3075
3075
|
{
|
|
3076
3076
|
[P]: (M == null ? void 0 : M[P]) !== void 0 ? Ma(
|
|
@@ -3087,20 +3087,20 @@ const ri = "doc.command.set-inline-format-bold", Qt = {
|
|
|
3087
3087
|
textRuns: [
|
|
3088
3088
|
{
|
|
3089
3089
|
st: 0,
|
|
3090
|
-
ed: y -
|
|
3090
|
+
ed: y - b,
|
|
3091
3091
|
ts: {
|
|
3092
|
-
[
|
|
3092
|
+
[hr[o]]: g
|
|
3093
3093
|
}
|
|
3094
3094
|
}
|
|
3095
3095
|
]
|
|
3096
|
-
}, x =
|
|
3096
|
+
}, x = b - I.cursor;
|
|
3097
3097
|
x !== 0 && p.push({
|
|
3098
3098
|
t: G.RETAIN,
|
|
3099
3099
|
len: x
|
|
3100
3100
|
}), p.push({
|
|
3101
3101
|
t: G.RETAIN,
|
|
3102
3102
|
body: B,
|
|
3103
|
-
len: y -
|
|
3103
|
+
len: y - b
|
|
3104
3104
|
}), I.reset(), I.moveCursor(y);
|
|
3105
3105
|
}
|
|
3106
3106
|
const S = Ae(A, l);
|
|
@@ -3120,10 +3120,10 @@ function Ma(n, e, t) {
|
|
|
3120
3120
|
s: z.TRUE
|
|
3121
3121
|
};
|
|
3122
3122
|
if (/va/.test(e))
|
|
3123
|
-
return t ===
|
|
3123
|
+
return t === Ct.id ? (n == null ? void 0 : n[e]) === Ve.SUBSCRIPT ? Ve.NORMAL : Ve.SUBSCRIPT : (n == null ? void 0 : n[e]) === Ve.SUPERSCRIPT ? Ve.NORMAL : Ve.SUPERSCRIPT;
|
|
3124
3124
|
}
|
|
3125
3125
|
function _a(n, e, t) {
|
|
3126
|
-
var l, A, h, u, g, f, p, m, I, S, v,
|
|
3126
|
+
var l, A, h, u, g, f, p, m, I, S, v, R, E, b;
|
|
3127
3127
|
const { startOffset: o, endOffset: r, collapsed: s } = e;
|
|
3128
3128
|
if (s) {
|
|
3129
3129
|
const y = (l = n.textRuns) != null ? l : [];
|
|
@@ -3159,10 +3159,10 @@ function _a(n, e, t) {
|
|
|
3159
3159
|
}) ? (f = i[0].ts) == null ? void 0 : f.st : a.st, a.bg = (I = (m = (p = i.find((y) => {
|
|
3160
3160
|
var C;
|
|
3161
3161
|
return ((C = y.ts) == null ? void 0 : C.bg) != null;
|
|
3162
|
-
})) == null ? void 0 : p.ts) == null ? void 0 : m.bg) != null ? I : a.bg, a.cl = (
|
|
3162
|
+
})) == null ? void 0 : p.ts) == null ? void 0 : m.bg) != null ? I : a.bg, a.cl = (R = (v = (S = i.find((y) => {
|
|
3163
3163
|
var C;
|
|
3164
3164
|
return ((C = y.ts) == null ? void 0 : C.cl) != null;
|
|
3165
|
-
})) == null ? void 0 : S.ts) == null ? void 0 : v.cl) != null ?
|
|
3165
|
+
})) == null ? void 0 : S.ts) == null ? void 0 : v.cl) != null ? R : a.cl;
|
|
3166
3166
|
const d = i.filter((y) => {
|
|
3167
3167
|
var C;
|
|
3168
3168
|
return ((C = y == null ? void 0 : y.ts) == null ? void 0 : C.va) != null;
|
|
@@ -3171,7 +3171,7 @@ function _a(n, e, t) {
|
|
|
3171
3171
|
const y = (E = d[0].ts) == null ? void 0 : E.va;
|
|
3172
3172
|
let C = !0;
|
|
3173
3173
|
for (let B = 1; B < d.length; B++)
|
|
3174
|
-
if (((
|
|
3174
|
+
if (((b = d[B].ts) == null ? void 0 : b.va) !== y) {
|
|
3175
3175
|
C = !1;
|
|
3176
3176
|
break;
|
|
3177
3177
|
}
|
|
@@ -3180,7 +3180,7 @@ function _a(n, e, t) {
|
|
|
3180
3180
|
return a;
|
|
3181
3181
|
}
|
|
3182
3182
|
function qd(n, e) {
|
|
3183
|
-
const t =
|
|
3183
|
+
const t = hr[e];
|
|
3184
3184
|
return Ma(n, t, e);
|
|
3185
3185
|
}
|
|
3186
3186
|
const Da = {
|
|
@@ -3193,9 +3193,9 @@ const Da = {
|
|
|
3193
3193
|
return !1;
|
|
3194
3194
|
const { body: h, tableSource: u, footers: g, headers: f, lists: p, drawings: m, drawingsOrder: I, documentStyle: S } = ue.deepClone(o), {
|
|
3195
3195
|
body: v,
|
|
3196
|
-
tableSource:
|
|
3196
|
+
tableSource: R,
|
|
3197
3197
|
footers: E,
|
|
3198
|
-
headers:
|
|
3198
|
+
headers: b,
|
|
3199
3199
|
lists: y,
|
|
3200
3200
|
drawings: C,
|
|
3201
3201
|
drawingsOrder: B,
|
|
@@ -3226,16 +3226,16 @@ const Da = {
|
|
|
3226
3226
|
const N = F.replaceOp(["body"], v, h);
|
|
3227
3227
|
N != null && P.push(N);
|
|
3228
3228
|
}
|
|
3229
|
-
if (!ue.diffValue(u,
|
|
3230
|
-
const N = F.replaceOp(["tableSource"],
|
|
3229
|
+
if (!ue.diffValue(u, R)) {
|
|
3230
|
+
const N = F.replaceOp(["tableSource"], R, u);
|
|
3231
3231
|
N != null && P.push(N);
|
|
3232
3232
|
}
|
|
3233
3233
|
if (!ue.diffValue(g, E)) {
|
|
3234
3234
|
const N = F.replaceOp(["footers"], E, g);
|
|
3235
3235
|
N != null && P.push(N);
|
|
3236
3236
|
}
|
|
3237
|
-
if (!ue.diffValue(f,
|
|
3238
|
-
const N = F.replaceOp(["headers"],
|
|
3237
|
+
if (!ue.diffValue(f, b)) {
|
|
3238
|
+
const N = F.replaceOp(["headers"], b, f);
|
|
3239
3239
|
N != null && P.push(N);
|
|
3240
3240
|
}
|
|
3241
3241
|
if (!ue.diffValue(p, y)) {
|
|
@@ -3269,7 +3269,7 @@ const Da = {
|
|
|
3269
3269
|
id: "doc.command-cover-content",
|
|
3270
3270
|
type: D.COMMAND,
|
|
3271
3271
|
handler: (n, e) => {
|
|
3272
|
-
const { unitId: t, body: o, segmentId: r = "", textRanges: s } = e, i = n.get(L), a = n.get(T), c = n.get(
|
|
3272
|
+
const { unitId: t, body: o, segmentId: r = "", textRanges: s } = e, i = n.get(L), a = n.get(T), c = n.get(xo), d = i.getUniverDocInstance(t), l = d == null ? void 0 : d.getSnapshot().body;
|
|
3273
3273
|
if (d == null || l == null)
|
|
3274
3274
|
return !1;
|
|
3275
3275
|
const A = Pa(t, r, d, l, o);
|
|
@@ -3371,7 +3371,7 @@ const wa = {
|
|
|
3371
3371
|
startIndex: 0,
|
|
3372
3372
|
endIndex: a.length - 1,
|
|
3373
3373
|
rangeId: r,
|
|
3374
|
-
rangeType:
|
|
3374
|
+
rangeType: Lr.CUSTOM,
|
|
3375
3375
|
properties: i,
|
|
3376
3376
|
wholeEntity: c
|
|
3377
3377
|
}]
|
|
@@ -3383,11 +3383,11 @@ const wa = {
|
|
|
3383
3383
|
id: "doc.command.list-operation",
|
|
3384
3384
|
type: D.COMMAND,
|
|
3385
3385
|
handler: (n, e) => {
|
|
3386
|
-
var v,
|
|
3387
|
-
const t = n.get(Y), o = n.get(L), r = n.get(T), s = e.listType, i = o.getCurrentUnitForType(_.UNIVER_DOC), a = (
|
|
3386
|
+
var v, R, E, b, y, C;
|
|
3387
|
+
const t = n.get(Y), o = n.get(L), r = n.get(T), s = e.listType, i = o.getCurrentUnitForType(_.UNIVER_DOC), a = (R = (v = e.docRange) != null ? v : t.getDocRanges()) != null ? R : [];
|
|
3388
3388
|
if (i == null || a.length === 0)
|
|
3389
3389
|
return !1;
|
|
3390
|
-
const c = a[0].segmentId, d = i.getSelfOrHeaderFooterModel(c), l = (
|
|
3390
|
+
const c = a[0].segmentId, d = i.getSelfOrHeaderFooterModel(c), l = (b = (E = d.getBody()) == null ? void 0 : E.paragraphs) != null ? b : [], A = (C = (y = d.getBody()) == null ? void 0 : y.dataStream) != null ? C : "";
|
|
3391
3391
|
if (!l.length)
|
|
3392
3392
|
return !1;
|
|
3393
3393
|
const h = ce.range.getParagraphsInRanges(a, l, A), u = i.getUnitId(), g = {
|
|
@@ -3408,15 +3408,15 @@ const wa = {
|
|
|
3408
3408
|
}), m = W.getInstance(), I = Ae(i, c);
|
|
3409
3409
|
return g.params.actions = m.editOp(p.serialize(), I), !!r.syncExecuteCommand(g.id, g.params);
|
|
3410
3410
|
}
|
|
3411
|
-
},
|
|
3411
|
+
}, Lo = {
|
|
3412
3412
|
id: "doc.command.change-list-type",
|
|
3413
3413
|
type: D.COMMAND,
|
|
3414
3414
|
handler: (n, e) => {
|
|
3415
|
-
var S, v,
|
|
3415
|
+
var S, v, R, E, b;
|
|
3416
3416
|
const t = n.get(Y), o = n.get(L), r = n.get(T), { listType: s } = e, i = o.getCurrentUnitForType(_.UNIVER_DOC), a = (S = e.docRange) != null ? S : t.getDocRanges();
|
|
3417
3417
|
if (i == null || a == null || !a.length)
|
|
3418
3418
|
return !1;
|
|
3419
|
-
const { segmentId: c } = a[0], d = i.getSelfOrHeaderFooterModel(c), l = (
|
|
3419
|
+
const { segmentId: c } = a[0], d = i.getSelfOrHeaderFooterModel(c), l = (R = (v = d.getBody()) == null ? void 0 : v.paragraphs) != null ? R : [], A = (b = (E = d.getBody()) == null ? void 0 : E.dataStream) != null ? b : "";
|
|
3420
3420
|
if (!l.length)
|
|
3421
3421
|
return !1;
|
|
3422
3422
|
const h = ce.range.getParagraphsInRanges(a, l, A), u = i.getUnitId(), g = ce.paragraph.bullet.set({
|
|
@@ -3440,17 +3440,17 @@ const wa = {
|
|
|
3440
3440
|
}
|
|
3441
3441
|
};
|
|
3442
3442
|
var Xn = /* @__PURE__ */ ((n) => (n[n.increase = 1] = "increase", n[n.decrease = -1] = "decrease", n))(Xn || {});
|
|
3443
|
-
const
|
|
3443
|
+
const gr = {
|
|
3444
3444
|
id: "doc.command.change-list-nesting-level",
|
|
3445
3445
|
type: D.COMMAND,
|
|
3446
3446
|
handler: (n, e) => {
|
|
3447
|
-
var v,
|
|
3447
|
+
var v, R, E, b, y;
|
|
3448
3448
|
if (!e)
|
|
3449
3449
|
return !1;
|
|
3450
3450
|
const { type: t } = e, o = n.get(Y), r = n.get(L), s = n.get(T), i = r.getCurrentUnitForType(_.UNIVER_DOC), a = o.getActiveTextRange();
|
|
3451
3451
|
if (i == null || a == null)
|
|
3452
3452
|
return !1;
|
|
3453
|
-
const { segmentId: c } = a, d = (v = o.getDocRanges()) != null ? v : [], l = i.getSelfOrHeaderFooterModel(c), A = (E = (
|
|
3453
|
+
const { segmentId: c } = a, d = (v = o.getDocRanges()) != null ? v : [], l = i.getSelfOrHeaderFooterModel(c), A = (E = (R = l.getBody()) == null ? void 0 : R.paragraphs) != null ? E : [], h = (y = (b = l.getBody()) == null ? void 0 : b.dataStream) != null ? y : "";
|
|
3454
3454
|
if (!A.length)
|
|
3455
3455
|
return !1;
|
|
3456
3456
|
const u = ce.range.getParagraphsInRange(a, A, h), g = i.getUnitId(), f = W.getInstance(), p = ce.paragraph.bullet.changeNestLevel({
|
|
@@ -3474,7 +3474,7 @@ const hr = {
|
|
|
3474
3474
|
type: D.COMMAND,
|
|
3475
3475
|
handler: (n, e) => {
|
|
3476
3476
|
const t = n.get(T);
|
|
3477
|
-
return e != null && e.value ? t.syncExecuteCommand(
|
|
3477
|
+
return e != null && e.value ? t.syncExecuteCommand(Lo.id, {
|
|
3478
3478
|
listType: e.value,
|
|
3479
3479
|
docRange: e.docRange
|
|
3480
3480
|
}) : t.syncExecuteCommand(Hn.id, {
|
|
@@ -3487,7 +3487,7 @@ const hr = {
|
|
|
3487
3487
|
type: D.COMMAND,
|
|
3488
3488
|
handler: (n, e) => {
|
|
3489
3489
|
const t = n.get(T);
|
|
3490
|
-
return e != null && e.value ? t.syncExecuteCommand(
|
|
3490
|
+
return e != null && e.value ? t.syncExecuteCommand(Lo.id, {
|
|
3491
3491
|
listType: e.value,
|
|
3492
3492
|
docRange: e.docRange
|
|
3493
3493
|
}) : t.syncExecuteCommand(Hn.id, {
|
|
@@ -3529,7 +3529,7 @@ const hr = {
|
|
|
3529
3529
|
type: D.COMMAND,
|
|
3530
3530
|
handler: (n, e) => {
|
|
3531
3531
|
const t = n.get(T);
|
|
3532
|
-
return e != null && e.value ? t.syncExecuteCommand(
|
|
3532
|
+
return e != null && e.value ? t.syncExecuteCommand(Lo.id, {
|
|
3533
3533
|
listType: e.value
|
|
3534
3534
|
}) : t.syncExecuteCommand(Hn.id, {
|
|
3535
3535
|
listType: ye.ORDER_LIST
|
|
@@ -3548,8 +3548,8 @@ const hr = {
|
|
|
3548
3548
|
return !1;
|
|
3549
3549
|
const { segmentId: a, startOffset: c } = i, { listType: d, paragraph: l } = e, { paragraphStart: A, paragraphEnd: h } = l, u = new Ee(), g = W.getInstance(), { paragraphStyle: f = {} } = l, m = (Hc[d].nestingLevel[0].paragraphProperties || {}).textStyle;
|
|
3550
3550
|
let S = ge(6);
|
|
3551
|
-
const v = (M = (x = s.getBody()) == null ? void 0 : x.paragraphs) != null ? M : [],
|
|
3552
|
-
E && E.bullet && E.bullet.listType.indexOf(d) === 0 ? S = E.bullet.listId :
|
|
3551
|
+
const v = (M = (x = s.getBody()) == null ? void 0 : x.paragraphs) != null ? M : [], R = v.findIndex((F) => F.startIndex === l.startIndex), E = v[R - 1], b = v[R + 1];
|
|
3552
|
+
E && E.bullet && E.bullet.listType.indexOf(d) === 0 ? S = E.bullet.listId : b && b.bullet && b.bullet.listType.indexOf(d) === 0 && (S = b.bullet.listId);
|
|
3553
3553
|
const y = {
|
|
3554
3554
|
id: X.id,
|
|
3555
3555
|
params: {
|
|
@@ -3672,14 +3672,14 @@ const ls = {
|
|
|
3672
3672
|
type: D.COMMAND,
|
|
3673
3673
|
// eslint-disable-next-line max-lines-per-function
|
|
3674
3674
|
handler: (n, e) => {
|
|
3675
|
-
var
|
|
3675
|
+
var R, E, b, y;
|
|
3676
3676
|
const t = n.get(Y), o = n.get(L), r = n.get(T), { alignType: s } = e, i = o.getCurrentUniverDocInstance();
|
|
3677
3677
|
if (i == null)
|
|
3678
3678
|
return !1;
|
|
3679
3679
|
const a = t.getDocRanges();
|
|
3680
3680
|
if (a.length === 0)
|
|
3681
3681
|
return !1;
|
|
3682
|
-
const c = a[0].segmentId, d = i.getSelfOrHeaderFooterModel(c), l = (E = (
|
|
3682
|
+
const c = a[0].segmentId, d = i.getSelfOrHeaderFooterModel(c), l = (E = (R = d.getBody()) == null ? void 0 : R.paragraphs) != null ? E : [], A = (y = (b = d.getBody()) == null ? void 0 : b.dataStream) != null ? y : "";
|
|
3683
3683
|
if (l == null)
|
|
3684
3684
|
return !1;
|
|
3685
3685
|
const h = ce.range.getParagraphsInRanges(a, l, A), u = i.getUnitId(), g = h.every((C) => {
|
|
@@ -3724,25 +3724,25 @@ const ls = {
|
|
|
3724
3724
|
const S = Ae(i, c);
|
|
3725
3725
|
return f.params.actions = I.editOp(m.serialize(), S), !!r.syncExecuteCommand(f.id, f.params);
|
|
3726
3726
|
}
|
|
3727
|
-
},
|
|
3727
|
+
}, Qo = {
|
|
3728
3728
|
id: "doc.command.align-left",
|
|
3729
3729
|
type: D.COMMAND,
|
|
3730
3730
|
handler: (n) => n.get(T).syncExecuteCommand(lt.id, {
|
|
3731
3731
|
alignType: Ue.LEFT
|
|
3732
3732
|
})
|
|
3733
|
-
},
|
|
3733
|
+
}, Uo = {
|
|
3734
3734
|
id: "doc.command.align-center",
|
|
3735
3735
|
type: D.COMMAND,
|
|
3736
3736
|
handler: (n) => n.get(T).syncExecuteCommand(lt.id, {
|
|
3737
3737
|
alignType: Ue.CENTER
|
|
3738
3738
|
})
|
|
3739
|
-
},
|
|
3739
|
+
}, Fo = {
|
|
3740
3740
|
id: "doc.command.align-right",
|
|
3741
3741
|
type: D.COMMAND,
|
|
3742
3742
|
handler: (n) => n.get(T).syncExecuteCommand(lt.id, {
|
|
3743
3743
|
alignType: Ue.RIGHT
|
|
3744
3744
|
})
|
|
3745
|
-
},
|
|
3745
|
+
}, Ho = {
|
|
3746
3746
|
id: "doc.command.align-justify",
|
|
3747
3747
|
type: D.COMMAND,
|
|
3748
3748
|
handler: (n) => n.get(T).syncExecuteCommand(lt.id, {
|
|
@@ -3763,7 +3763,7 @@ const ls = {
|
|
|
3763
3763
|
id: "doc.command.set-zoom-ratio",
|
|
3764
3764
|
handler: async (n, e) => {
|
|
3765
3765
|
var A, h, u;
|
|
3766
|
-
const t = n.get(T), o = n.get(
|
|
3766
|
+
const t = n.get(T), o = n.get(xo), r = n.get(L);
|
|
3767
3767
|
let s = (A = r.getCurrentUniverDocInstance()) == null ? void 0 : A.getUnitId();
|
|
3768
3768
|
if (!s) return !1;
|
|
3769
3769
|
let i = 1;
|
|
@@ -3817,13 +3817,13 @@ const ls = {
|
|
|
3817
3817
|
id: "doc.command.quick-heading",
|
|
3818
3818
|
type: D.COMMAND,
|
|
3819
3819
|
handler(n, e) {
|
|
3820
|
-
var
|
|
3820
|
+
var R, E, b, y;
|
|
3821
3821
|
if (!e)
|
|
3822
3822
|
return !1;
|
|
3823
3823
|
const { value: t } = e, o = n.get(Y), r = n.get(L), s = n.get(T), i = r.getCurrentUnitForType(_.UNIVER_DOC), a = o.getActiveTextRange();
|
|
3824
3824
|
if (i == null || a == null || !a.collapsed)
|
|
3825
3825
|
return !1;
|
|
3826
|
-
const { segmentId: c, startOffset: d } = a, l = i.getSelfOrHeaderFooterModel(c), A = (E = (
|
|
3826
|
+
const { segmentId: c, startOffset: d } = a, l = i.getSelfOrHeaderFooterModel(c), A = (E = (R = l.getBody()) == null ? void 0 : R.paragraphs) != null ? E : [], h = (y = (b = l.getBody()) == null ? void 0 : b.dataStream) != null ? y : "", u = ce.paragraph.util.getParagraphsInRange(a, A, h)[0];
|
|
3827
3827
|
if (!u)
|
|
3828
3828
|
return !1;
|
|
3829
3829
|
const { paragraphStart: g } = u, f = new Ee(), p = W.getInstance(), { paragraphStyle: m = {} } = u, I = {
|
|
@@ -3858,7 +3858,7 @@ const ls = {
|
|
|
3858
3858
|
const S = Ae(i, c);
|
|
3859
3859
|
return I.params.actions = p.editOp(f.serialize(), S), !!s.syncExecuteCommand(I.id, I.params);
|
|
3860
3860
|
}
|
|
3861
|
-
},
|
|
3861
|
+
}, qo = {
|
|
3862
3862
|
"#": K.HEADING_1,
|
|
3863
3863
|
"##": K.HEADING_2,
|
|
3864
3864
|
"###": K.HEADING_3,
|
|
@@ -3925,7 +3925,7 @@ const qt = {
|
|
|
3925
3925
|
function ms(n, e) {
|
|
3926
3926
|
return n.page > e.page ? !1 : n.page < e.page ? !0 : n.section > e.section ? !1 : n.section < e.section ? !0 : n.column > e.column ? !1 : n.column < e.column ? !0 : n.line > e.line ? !1 : n.line < e.line ? !0 : n.divide > e.divide ? !1 : n.divide < e.divide ? !0 : n.glyph > e.glyph ? !1 : (n.glyph < e.glyph, !0);
|
|
3927
3927
|
}
|
|
3928
|
-
function
|
|
3928
|
+
function fr(n, e) {
|
|
3929
3929
|
return ms(n, e) ? {
|
|
3930
3930
|
start: n,
|
|
3931
3931
|
end: e
|
|
@@ -3956,7 +3956,7 @@ function nA(n, e, t, o) {
|
|
|
3956
3956
|
endOffset: s
|
|
3957
3957
|
};
|
|
3958
3958
|
}
|
|
3959
|
-
function
|
|
3959
|
+
function pr(n) {
|
|
3960
3960
|
const { startX: e, startY: t, endX: o, endY: r } = n, s = [];
|
|
3961
3961
|
return s.push({
|
|
3962
3962
|
x: e,
|
|
@@ -3975,7 +3975,7 @@ function fr(n) {
|
|
|
3975
3975
|
y: t
|
|
3976
3976
|
}), s;
|
|
3977
3977
|
}
|
|
3978
|
-
class
|
|
3978
|
+
class mt {
|
|
3979
3979
|
constructor(e, t) {
|
|
3980
3980
|
O(this, "_liquid", new $i());
|
|
3981
3981
|
O(this, "_currentStartState", {
|
|
@@ -4013,41 +4013,41 @@ class pt {
|
|
|
4013
4013
|
Invalid positions in NodePositionConvertToCursor,
|
|
4014
4014
|
they are not in the same segment page when in header or footer.`
|
|
4015
4015
|
);
|
|
4016
|
-
const { start: a, end: c } =
|
|
4016
|
+
const { start: a, end: c } = fr(e, t);
|
|
4017
4017
|
return this._selectionIterator(a, c, (d, l, A, h, u, g) => {
|
|
4018
|
-
const { lineHeight: f, asc: p, paddingTop: m, marginTop: I, marginBottom: S } = g, { glyphGroup: v, st:
|
|
4018
|
+
const { lineHeight: f, asc: p, paddingTop: m, marginTop: I, marginBottom: S } = g, { glyphGroup: v, st: R } = u;
|
|
4019
4019
|
if (v.length === 0)
|
|
4020
4020
|
return;
|
|
4021
|
-
const { x: E, y:
|
|
4021
|
+
const { x: E, y: b } = this._liquid;
|
|
4022
4022
|
let y, C;
|
|
4023
|
-
const B = v[d], x = v[l], M = v[d - 1], P = (B == null ? void 0 : B.left) || 0, F = (B == null ? void 0 : B.width) || 0, w = (x == null ? void 0 : x.left) || 0, N = (x == null ? void 0 : x.width) || 0, ee = (B == null ? void 0 : B.glyphType) === ea.LIST, { startOffset: $, endOffset: U } = nA(v, d, l,
|
|
4023
|
+
const B = v[d], x = v[l], M = v[d - 1], P = (B == null ? void 0 : B.left) || 0, F = (B == null ? void 0 : B.width) || 0, w = (x == null ? void 0 : x.left) || 0, N = (x == null ? void 0 : x.width) || 0, ee = (B == null ? void 0 : B.glyphType) === ea.LIST, { startOffset: $, endOffset: U } = nA(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;
|
|
4024
4024
|
if (d === 0 && l === v.length - 1)
|
|
4025
4025
|
y = {
|
|
4026
4026
|
startX: E + P + (ee ? F : 0),
|
|
4027
|
-
startY:
|
|
4027
|
+
startY: b,
|
|
4028
4028
|
endX: E + w + (k ? 0 : N),
|
|
4029
|
-
endY:
|
|
4029
|
+
endY: b + f - I - S
|
|
4030
4030
|
}, C = {
|
|
4031
4031
|
startX: E + P + (ee ? F : 0),
|
|
4032
|
-
startY:
|
|
4032
|
+
startY: b + m + p - ie.bBox.ba,
|
|
4033
4033
|
endX: E + w + (k ? 0 : N),
|
|
4034
|
-
endY:
|
|
4034
|
+
endY: b + m + p + ie.bBox.bd
|
|
4035
4035
|
};
|
|
4036
4036
|
else {
|
|
4037
4037
|
const ae = H && !ee;
|
|
4038
4038
|
y = {
|
|
4039
4039
|
startX: E + P + (ae ? 0 : F),
|
|
4040
|
-
startY:
|
|
4040
|
+
startY: b,
|
|
4041
4041
|
endX: E + w + (k ? 0 : N),
|
|
4042
|
-
endY:
|
|
4042
|
+
endY: b + f - I - S
|
|
4043
4043
|
}, C = {
|
|
4044
4044
|
startX: E + P + (ae ? 0 : F),
|
|
4045
|
-
startY:
|
|
4045
|
+
startY: b + m + p - ie.bBox.ba,
|
|
4046
4046
|
endX: E + w + (k ? 0 : N),
|
|
4047
|
-
endY:
|
|
4047
|
+
endY: b + m + p + ie.bBox.bd
|
|
4048
4048
|
};
|
|
4049
4049
|
}
|
|
4050
|
-
o.push(
|
|
4050
|
+
o.push(pr(y)), r.push(pr(C)), s.push({
|
|
4051
4051
|
startOffset: H ? $ : $ + B.count,
|
|
4052
4052
|
endOffset: k ? U : U + x.count,
|
|
4053
4053
|
collapsed: ne
|
|
@@ -4115,7 +4115,7 @@ class pt {
|
|
|
4115
4115
|
}
|
|
4116
4116
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
4117
4117
|
_selectionIterator(e, t, o) {
|
|
4118
|
-
var v,
|
|
4118
|
+
var v, R;
|
|
4119
4119
|
const r = this._docSkeleton;
|
|
4120
4120
|
if (!r)
|
|
4121
4121
|
return [];
|
|
@@ -4129,15 +4129,15 @@ class pt {
|
|
|
4129
4129
|
return [];
|
|
4130
4130
|
const { pageLayoutType: f, pageMarginLeft: p, pageMarginTop: m } = this._documentOffsetConfig, I = s === Oe.BODY || s === Oe.CELL ? A : h;
|
|
4131
4131
|
for (let E = 0; E < I; E++) {
|
|
4132
|
-
const
|
|
4133
|
-
this._liquid.translatePage(
|
|
4132
|
+
const b = c[E];
|
|
4133
|
+
this._liquid.translatePage(b, f, p, m);
|
|
4134
4134
|
}
|
|
4135
4135
|
const S = s === Oe.BODY || s === Oe.CELL ? u : g;
|
|
4136
4136
|
for (let E = I; E <= S; E++) {
|
|
4137
|
-
const
|
|
4138
|
-
let x =
|
|
4139
|
-
if (s === Oe.HEADER ? x = (v = d.get(y)) == null ? void 0 : v.get(B) : s === Oe.FOOTER ? x = (
|
|
4140
|
-
this._liquid.translatePage(
|
|
4137
|
+
const b = c[E], { headerId: y, footerId: C, pageWidth: B } = b;
|
|
4138
|
+
let x = b;
|
|
4139
|
+
if (s === Oe.HEADER ? x = (v = d.get(y)) == null ? void 0 : v.get(B) : s === Oe.FOOTER ? x = (R = l.get(C)) == null ? void 0 : R.get(B) : s === Oe.CELL && (x = cr(a, i)), x == null) {
|
|
4140
|
+
this._liquid.translatePage(b, f, p, m);
|
|
4141
4141
|
continue;
|
|
4142
4142
|
}
|
|
4143
4143
|
const M = x.sections, { start_next: P, end_next: F } = this._getSelectionRuler(
|
|
@@ -4151,23 +4151,23 @@ class pt {
|
|
|
4151
4151
|
case Oe.HEADER:
|
|
4152
4152
|
this._liquid.translatePagePadding({
|
|
4153
4153
|
...x,
|
|
4154
|
-
marginLeft:
|
|
4154
|
+
marginLeft: b.marginLeft
|
|
4155
4155
|
// Because header or footer margin Left is 0.
|
|
4156
4156
|
});
|
|
4157
4157
|
break;
|
|
4158
4158
|
case Oe.FOOTER: {
|
|
4159
|
-
const w =
|
|
4160
|
-
this._liquid.translate(
|
|
4159
|
+
const w = b.pageHeight - x.height - x.marginBottom;
|
|
4160
|
+
this._liquid.translate(b.marginLeft, w);
|
|
4161
4161
|
break;
|
|
4162
4162
|
}
|
|
4163
4163
|
case Oe.CELL: {
|
|
4164
|
-
this._liquid.translatePagePadding(
|
|
4164
|
+
this._liquid.translatePagePadding(b);
|
|
4165
4165
|
const w = x.parent, N = w.parent, { left: ee } = x, { top: $, left: U } = N, { top: H } = w;
|
|
4166
4166
|
this._liquid.translate(U + ee, $ + H), this._liquid.translatePagePadding(x);
|
|
4167
4167
|
break;
|
|
4168
4168
|
}
|
|
4169
4169
|
default:
|
|
4170
|
-
this._liquid.translatePagePadding(
|
|
4170
|
+
this._liquid.translatePagePadding(b);
|
|
4171
4171
|
break;
|
|
4172
4172
|
}
|
|
4173
4173
|
for (let w = P; w <= F; w++) {
|
|
@@ -4198,9 +4198,9 @@ class pt {
|
|
|
4198
4198
|
);
|
|
4199
4199
|
this._liquid.translateSave(), this._liquid.translateLine(he, !0, !1);
|
|
4200
4200
|
for (let $e = Je; $e <= At; $e++) {
|
|
4201
|
-
const
|
|
4202
|
-
this._liquid.translateSave(), this._liquid.translateDivide(
|
|
4203
|
-
const { glyphGroup: Oc } =
|
|
4201
|
+
const Wo = Pe[$e];
|
|
4202
|
+
this._liquid.translateSave(), this._liquid.translateDivide(Wo);
|
|
4203
|
+
const { glyphGroup: Oc } = Wo, { start_next: Tc, end_next: Bc } = this._getSelectionRuler(
|
|
4204
4204
|
qt.divide,
|
|
4205
4205
|
e,
|
|
4206
4206
|
t,
|
|
@@ -4208,13 +4208,13 @@ class pt {
|
|
|
4208
4208
|
$e
|
|
4209
4209
|
);
|
|
4210
4210
|
let Ns = !1, Ls = !1;
|
|
4211
|
-
E === I && w === P && H === $ && oe === ie && $e === Je && (Ns = !0), E === S && w === F && H === U && oe === ae && $e === At && (Ls = !0), o && o(Tc, Bc, Ns, Ls,
|
|
4211
|
+
E === I && w === P && H === $ && oe === ie && $e === Je && (Ns = !0), E === S && w === F && H === U && oe === ae && $e === At && (Ls = !0), o && o(Tc, Bc, Ns, Ls, Wo, he, k, N, x), this._liquid.translateRestore();
|
|
4212
4212
|
}
|
|
4213
4213
|
this._liquid.translateRestore();
|
|
4214
4214
|
}
|
|
4215
4215
|
}
|
|
4216
4216
|
}
|
|
4217
|
-
this._liquid.translateRestore(), this._liquid.translatePage(
|
|
4217
|
+
this._liquid.translateRestore(), this._liquid.translatePage(b, f, p, m);
|
|
4218
4218
|
}
|
|
4219
4219
|
}
|
|
4220
4220
|
}
|
|
@@ -4243,7 +4243,7 @@ function ka(n, e, t) {
|
|
|
4243
4243
|
const d = a.parent, l = c.parent, A = d.cells.indexOf(a), h = l.cells.indexOf(c);
|
|
4244
4244
|
return A === h && d.index === l.index;
|
|
4245
4245
|
}
|
|
4246
|
-
function
|
|
4246
|
+
function Xo(n, e) {
|
|
4247
4247
|
if (Ha(n, e))
|
|
4248
4248
|
return ms(n, e);
|
|
4249
4249
|
const { path: t } = n, { path: o } = e, r = t[t.length - 5], s = o[o.length - 5];
|
|
@@ -4287,23 +4287,23 @@ class Va {
|
|
|
4287
4287
|
this._liquid.reset();
|
|
4288
4288
|
const { pageLayoutType: p, pageMarginLeft: m, pageMarginTop: I } = this._documentOffsetConfig, S = d === Oe.BODY || d === Oe.CELL ? c : a;
|
|
4289
4289
|
for (let v = 0; v < S; v++) {
|
|
4290
|
-
const
|
|
4291
|
-
this._liquid.translatePage(
|
|
4290
|
+
const R = i[v];
|
|
4291
|
+
this._liquid.translatePage(R, p, m, I);
|
|
4292
4292
|
}
|
|
4293
4293
|
for (let v = S; v < i.length; v++) {
|
|
4294
|
-
const
|
|
4295
|
-
this._liquid.translatePagePadding(
|
|
4296
|
-
const { skeTables: E } =
|
|
4297
|
-
let
|
|
4294
|
+
const R = i[v];
|
|
4295
|
+
this._liquid.translatePagePadding(R);
|
|
4296
|
+
const { skeTables: E } = R;
|
|
4297
|
+
let b = null;
|
|
4298
4298
|
for (const [x, M] of E.entries())
|
|
4299
|
-
x.startsWith(A) && (
|
|
4300
|
-
if (
|
|
4301
|
-
this._liquid.restorePagePadding(
|
|
4299
|
+
x.startsWith(A) && (b = M);
|
|
4300
|
+
if (b == null) {
|
|
4301
|
+
this._liquid.restorePagePadding(R), this._liquid.translatePage(R, p, m, I);
|
|
4302
4302
|
continue;
|
|
4303
4303
|
}
|
|
4304
|
-
this._liquid.translateSave(), this._liquid.translate(0,
|
|
4305
|
-
const { x: y, y: C } = this._liquid, { left: B } =
|
|
4306
|
-
for (const x of
|
|
4304
|
+
this._liquid.translateSave(), this._liquid.translate(0, b.top);
|
|
4305
|
+
const { x: y, y: C } = this._liquid, { left: B } = b;
|
|
4306
|
+
for (const x of b.rows)
|
|
4307
4307
|
if (x.index >= h && x.index <= g) {
|
|
4308
4308
|
const M = rA(x.cells, u, f);
|
|
4309
4309
|
if (M == null)
|
|
@@ -4314,9 +4314,9 @@ class Va {
|
|
|
4314
4314
|
endX: y + F.left + F.pageWidth + B,
|
|
4315
4315
|
endY: C + x.top + x.height
|
|
4316
4316
|
};
|
|
4317
|
-
o.push(
|
|
4317
|
+
o.push(pr(w));
|
|
4318
4318
|
}
|
|
4319
|
-
this._liquid.translateRestore(), this._liquid.restorePagePadding(
|
|
4319
|
+
this._liquid.translateRestore(), this._liquid.restorePagePadding(R), this._liquid.translatePage(R, p, m, I);
|
|
4320
4320
|
}
|
|
4321
4321
|
return {
|
|
4322
4322
|
pointGroup: o,
|
|
@@ -4348,12 +4348,12 @@ class Va {
|
|
|
4348
4348
|
});
|
|
4349
4349
|
} else
|
|
4350
4350
|
for (let p = d; p <= A; p++) {
|
|
4351
|
-
const m = u.children[p], I = m.children[l], S = m.children[h], v = this._docSkeleton.findNodePositionByCharIndex(I.startIndex + 1),
|
|
4352
|
-
if (v == null ||
|
|
4351
|
+
const m = u.children[p], I = m.children[l], S = m.children[h], v = this._docSkeleton.findNodePositionByCharIndex(I.startIndex + 1), R = this._docSkeleton.findNodePositionByCharIndex(S.endIndex - 2);
|
|
4352
|
+
if (v == null || R == null)
|
|
4353
4353
|
return;
|
|
4354
4354
|
o.push({
|
|
4355
|
-
anchor: i ? v :
|
|
4356
|
-
focus: i ?
|
|
4355
|
+
anchor: i ? v : R,
|
|
4356
|
+
focus: i ? R : v
|
|
4357
4357
|
});
|
|
4358
4358
|
}
|
|
4359
4359
|
return o;
|
|
@@ -4362,7 +4362,7 @@ class Va {
|
|
|
4362
4362
|
const r = this._docSkeleton.getSkeletonData();
|
|
4363
4363
|
if (r == null)
|
|
4364
4364
|
return;
|
|
4365
|
-
const { pages: s } = r, { path: i } = e, { path: a } = t, c =
|
|
4365
|
+
const { pages: s } = r, { path: i } = e, { path: a } = t, c = cr(r, i), d = cr(r, a);
|
|
4366
4366
|
if (c == null || d == null)
|
|
4367
4367
|
return;
|
|
4368
4368
|
const l = c.segmentId, A = c.parent.index, h = c.parent.cells.indexOf(c), u = (d == null ? void 0 : d.parent).index, g = (d == null ? void 0 : d.parent).cells.indexOf(d), f = Math.min(A, u), p = Math.max(A, u), m = Math.min(h, g), I = Math.max(h, g);
|
|
@@ -4376,7 +4376,7 @@ class Va {
|
|
|
4376
4376
|
};
|
|
4377
4377
|
}
|
|
4378
4378
|
}
|
|
4379
|
-
const sA = "__TestSelectionRange__", iA = "__TestSelectionAnchor__", pi = 6,
|
|
4379
|
+
const sA = "__TestSelectionRange__", iA = "__TestSelectionAnchor__", pi = 6, Zo = 500, aA = 500, mr = 3;
|
|
4380
4380
|
function $n(n) {
|
|
4381
4381
|
const e = n[0], t = e[0], o = e[2], { x: r, y: s } = t, { x: i, y: a } = o;
|
|
4382
4382
|
return {
|
|
@@ -4415,11 +4415,11 @@ class Zt {
|
|
|
4415
4415
|
_anchorBlink() {
|
|
4416
4416
|
setTimeout(() => {
|
|
4417
4417
|
this._anchorShape && this._anchorShape.visible && this.deactivateStatic();
|
|
4418
|
-
},
|
|
4418
|
+
}, Zo), this._anchorBlinkTimer = setInterval(() => {
|
|
4419
4419
|
this._anchorShape && this._anchorShape.visible && (this.activeStatic(), setTimeout(() => {
|
|
4420
4420
|
this.deactivateStatic();
|
|
4421
|
-
},
|
|
4422
|
-
}, aA +
|
|
4421
|
+
}, Zo));
|
|
4422
|
+
}, aA + Zo);
|
|
4423
4423
|
}
|
|
4424
4424
|
// The start position of the range
|
|
4425
4425
|
get startOffset() {
|
|
@@ -4448,7 +4448,7 @@ class Zt {
|
|
|
4448
4448
|
return null;
|
|
4449
4449
|
if (this.focusNodePosition == null)
|
|
4450
4450
|
return this.anchorNodePosition;
|
|
4451
|
-
const { start: e } =
|
|
4451
|
+
const { start: e } = fr(this.anchorNodePosition, this.focusNodePosition);
|
|
4452
4452
|
return e;
|
|
4453
4453
|
}
|
|
4454
4454
|
get endNodePosition() {
|
|
@@ -4456,7 +4456,7 @@ class Zt {
|
|
|
4456
4456
|
return this.focusNodePosition;
|
|
4457
4457
|
if (this.focusNodePosition == null)
|
|
4458
4458
|
return null;
|
|
4459
|
-
const { end: e } =
|
|
4459
|
+
const { end: e } = fr(this.anchorNodePosition, this.focusNodePosition);
|
|
4460
4460
|
return e;
|
|
4461
4461
|
}
|
|
4462
4462
|
get direction() {
|
|
@@ -4473,7 +4473,7 @@ class Zt {
|
|
|
4473
4473
|
const e = this.anchorNodePosition, t = this.focusNodePosition;
|
|
4474
4474
|
if (this._isEmpty())
|
|
4475
4475
|
return;
|
|
4476
|
-
const o = this._document.getOffsetConfig(), { docsLeft: r, docsTop: s } = o, i = new
|
|
4476
|
+
const o = this._document.getOffsetConfig(), { docsLeft: r, docsTop: s } = o, i = new mt(o, this._docSkeleton);
|
|
4477
4477
|
if (this._isCollapsed()) {
|
|
4478
4478
|
const { contentBoxPointGroup: l, cursorList: A } = i.getRangePointData(e, e);
|
|
4479
4479
|
if (this._setCursorList(A), l.length === 0)
|
|
@@ -4533,7 +4533,7 @@ class Zt {
|
|
|
4533
4533
|
const { _document: e, _docSkeleton: t } = this, o = this.anchorNodePosition, r = this.focusNodePosition;
|
|
4534
4534
|
if ((A = this._anchorShape) == null || A.hide(), (h = this._rangeShape) == null || h.hide(), this._isEmpty())
|
|
4535
4535
|
return;
|
|
4536
|
-
const s = e.getOffsetConfig(), { docsLeft: i, docsTop: a } = s, c = new
|
|
4536
|
+
const s = e.getOffsetConfig(), { docsLeft: i, docsTop: a } = s, c = new mt(s, t);
|
|
4537
4537
|
if (this._isCollapsed()) {
|
|
4538
4538
|
const { contentBoxPointGroup: u, cursorList: g } = c.getRangePointData(o, o);
|
|
4539
4539
|
if (this._setCursorList(g), u.length > 0) {
|
|
@@ -4576,7 +4576,7 @@ class Zt {
|
|
|
4576
4576
|
evented: !1,
|
|
4577
4577
|
debounceParentDirty: !1
|
|
4578
4578
|
});
|
|
4579
|
-
this._rangeShape = s, this._scene.addObject(s,
|
|
4579
|
+
this._rangeShape = s, this._scene.addObject(s, mr);
|
|
4580
4580
|
}
|
|
4581
4581
|
_createOrUpdateAnchor(e, t, o, r) {
|
|
4582
4582
|
var f, p, m;
|
|
@@ -4599,14 +4599,14 @@ class Zt {
|
|
|
4599
4599
|
stroke: ((m = this.style) == null ? void 0 : m.strokeActive) || pn(fn.black, 1),
|
|
4600
4600
|
evented: !1
|
|
4601
4601
|
});
|
|
4602
|
-
u && g.skew(-l, 0), this._anchorShape = g, this._scene.addObject(g,
|
|
4602
|
+
u && g.skew(-l, 0), this._anchorShape = g, this._scene.addObject(g, mr), this.activeStatic();
|
|
4603
4603
|
}
|
|
4604
4604
|
_setCursorList(e) {
|
|
4605
4605
|
e.length !== 0 && (this._cursorList = e);
|
|
4606
4606
|
}
|
|
4607
4607
|
}
|
|
4608
4608
|
const cA = "__DocTableRectRange__", lA = 6;
|
|
4609
|
-
function
|
|
4609
|
+
function Jo(n, e, t, o, r, s = vn, i = "", a = -1) {
|
|
4610
4610
|
const c = e.getOffsetConfig(), l = new Va(c, t).getNodePositionGroup(o, r);
|
|
4611
4611
|
return (l != null ? l : []).map((A) => new Wa(
|
|
4612
4612
|
n,
|
|
@@ -4691,15 +4691,15 @@ class Wa {
|
|
|
4691
4691
|
}
|
|
4692
4692
|
get startNodePosition() {
|
|
4693
4693
|
const { anchorNodePosition: e, focusNodePosition: t } = this;
|
|
4694
|
-
return
|
|
4694
|
+
return Xo(e, t) ? e : t;
|
|
4695
4695
|
}
|
|
4696
4696
|
get endNodePosition() {
|
|
4697
4697
|
const { anchorNodePosition: e, focusNodePosition: t } = this;
|
|
4698
|
-
return
|
|
4698
|
+
return Xo(e, t) ? t : e;
|
|
4699
4699
|
}
|
|
4700
4700
|
get direction() {
|
|
4701
4701
|
const { anchorNodePosition: e, focusNodePosition: t } = this;
|
|
4702
|
-
return
|
|
4702
|
+
return Xo(e, t) ? De.FORWARD : De.BACKWARD;
|
|
4703
4703
|
}
|
|
4704
4704
|
isActive() {
|
|
4705
4705
|
return this._current === !0;
|
|
@@ -4754,7 +4754,7 @@ class Wa {
|
|
|
4754
4754
|
evented: !1,
|
|
4755
4755
|
debounceParentDirty: !1
|
|
4756
4756
|
});
|
|
4757
|
-
this._rangeShape = s, this._scene.addObject(s,
|
|
4757
|
+
this._rangeShape = s, this._scene.addObject(s, mr);
|
|
4758
4758
|
}
|
|
4759
4759
|
}
|
|
4760
4760
|
function mi(n, e, t, o, r, s, i, a, c = !0, d = !0) {
|
|
@@ -4770,7 +4770,7 @@ function dA(n, e, t, o, r, s, i, a) {
|
|
|
4770
4770
|
function AA(n, e, t, o, r, s, i, a) {
|
|
4771
4771
|
const c = r.findNodePositionByCharIndex(n, !0, i, a), d = r.findNodePositionByCharIndex(e, !0, i, a);
|
|
4772
4772
|
if (!(c == null || d == null))
|
|
4773
|
-
return
|
|
4773
|
+
return Er(
|
|
4774
4774
|
c,
|
|
4775
4775
|
d,
|
|
4776
4776
|
t,
|
|
@@ -4781,7 +4781,7 @@ function AA(n, e, t, o, r, s, i, a) {
|
|
|
4781
4781
|
a
|
|
4782
4782
|
);
|
|
4783
4783
|
}
|
|
4784
|
-
function
|
|
4784
|
+
function Er(n, e, t, o, r, s, i, a) {
|
|
4785
4785
|
const c = [], d = [], l = [t, o, r, n, e, s, i, a];
|
|
4786
4786
|
if (ka(r, n, e)) {
|
|
4787
4787
|
if (Ha(n, e))
|
|
@@ -4790,7 +4790,7 @@ function mr(n, e, t, o, r, s, i, a) {
|
|
|
4790
4790
|
rectRanges: d
|
|
4791
4791
|
};
|
|
4792
4792
|
{
|
|
4793
|
-
const S =
|
|
4793
|
+
const S = Jo(
|
|
4794
4794
|
...l
|
|
4795
4795
|
);
|
|
4796
4796
|
return d.push(...S), {
|
|
@@ -4800,7 +4800,7 @@ function mr(n, e, t, o, r, s, i, a) {
|
|
|
4800
4800
|
}
|
|
4801
4801
|
}
|
|
4802
4802
|
if (oA(n, e)) {
|
|
4803
|
-
const S =
|
|
4803
|
+
const S = Jo(
|
|
4804
4804
|
...l
|
|
4805
4805
|
);
|
|
4806
4806
|
return d.push(...S), {
|
|
@@ -4815,7 +4815,7 @@ function mr(n, e, t, o, r, s, i, a) {
|
|
|
4815
4815
|
let m = f, I = p;
|
|
4816
4816
|
for (const S of A.getChildren())
|
|
4817
4817
|
for (const v of S.children) {
|
|
4818
|
-
const { startIndex:
|
|
4818
|
+
const { startIndex: R, endIndex: E, children: b } = v, y = S.children.indexOf(v), C = S.children[y + 1], B = b[0];
|
|
4819
4819
|
let x = !1;
|
|
4820
4820
|
if (B) {
|
|
4821
4821
|
const { startIndex: M, endIndex: P, children: F } = B;
|
|
@@ -4834,7 +4834,7 @@ function mr(n, e, t, o, r, s, i, a) {
|
|
|
4834
4834
|
}
|
|
4835
4835
|
if (w && N) {
|
|
4836
4836
|
const U = g === De.FORWARD ? w : N, H = g === De.FORWARD ? N : w;
|
|
4837
|
-
d.push(...
|
|
4837
|
+
d.push(...Jo(
|
|
4838
4838
|
t,
|
|
4839
4839
|
o,
|
|
4840
4840
|
r,
|
|
@@ -4846,7 +4846,7 @@ function mr(n, e, t, o, r, s, i, a) {
|
|
|
4846
4846
|
));
|
|
4847
4847
|
}
|
|
4848
4848
|
}
|
|
4849
|
-
if (I === E + 1 && !x && C && C.children.length && (I = E, x = !0), I >=
|
|
4849
|
+
if (I === E + 1 && !x && C && C.children.length && (I = E, x = !0), I >= R && I <= E || x) {
|
|
4850
4850
|
const M = r.findNodePositionByCharIndex(m, !0, i, a), P = r.findNodePositionByCharIndex(I, !x, i, a), F = g === De.FORWARD ? M : P, w = g === De.FORWARD ? P : M;
|
|
4851
4851
|
if (d.length && ue.diffValue(F, w))
|
|
4852
4852
|
continue;
|
|
@@ -4889,7 +4889,7 @@ function Ei(n) {
|
|
|
4889
4889
|
nodeIndex: s
|
|
4890
4890
|
};
|
|
4891
4891
|
}
|
|
4892
|
-
function
|
|
4892
|
+
function Ir(n) {
|
|
4893
4893
|
const { startOffset: e, endOffset: t, collapsed: o, rangeType: r, startNodePosition: s, endNodePosition: i, direction: a, segmentId: c, segmentPage: d } = n;
|
|
4894
4894
|
return {
|
|
4895
4895
|
startOffset: e,
|
|
@@ -4905,7 +4905,7 @@ function Er(n) {
|
|
|
4905
4905
|
};
|
|
4906
4906
|
}
|
|
4907
4907
|
function hA(n) {
|
|
4908
|
-
const e =
|
|
4908
|
+
const e = Ir(n), {
|
|
4909
4909
|
startRow: t,
|
|
4910
4910
|
startColumn: o,
|
|
4911
4911
|
endRow: r,
|
|
@@ -4932,14 +4932,14 @@ var gA = Object.getOwnPropertyDescriptor, fA = (n, e, t, o) => {
|
|
|
4932
4932
|
(i = n[s]) && (r = i(r) || r);
|
|
4933
4933
|
return r;
|
|
4934
4934
|
}, Wn = (n, e) => (t, o) => e(t, o, n);
|
|
4935
|
-
let
|
|
4935
|
+
let Re = class extends St {
|
|
4936
4936
|
constructor(e, t, o, r, s) {
|
|
4937
4937
|
super();
|
|
4938
|
-
O(this, "_onInputBefore$", new
|
|
4938
|
+
O(this, "_onInputBefore$", new be());
|
|
4939
4939
|
O(this, "onInputBefore$", this._onInputBefore$.asObservable());
|
|
4940
|
-
O(this, "_onKeydown$", new
|
|
4940
|
+
O(this, "_onKeydown$", new be());
|
|
4941
4941
|
O(this, "onKeydown$", this._onKeydown$.asObservable());
|
|
4942
|
-
O(this, "_onInput$", new
|
|
4942
|
+
O(this, "_onInput$", new be());
|
|
4943
4943
|
O(this, "onInput$", this._onInput$.asObservable());
|
|
4944
4944
|
O(this, "_onCompositionstart$", new Fe(null));
|
|
4945
4945
|
O(this, "onCompositionstart$", this._onCompositionstart$.asObservable());
|
|
@@ -4954,15 +4954,15 @@ let be = class extends It {
|
|
|
4954
4954
|
this._onKeydown$.pipe(ro((e) => e.event.keyCode === q.BACKSPACE)),
|
|
4955
4955
|
this._onCompositionend$
|
|
4956
4956
|
));
|
|
4957
|
-
O(this, "_onPaste$", new
|
|
4957
|
+
O(this, "_onPaste$", new be());
|
|
4958
4958
|
O(this, "onPaste$", this._onPaste$.asObservable());
|
|
4959
4959
|
O(this, "_textSelectionInner$", new Fe(null));
|
|
4960
4960
|
O(this, "textSelectionInner$", this._textSelectionInner$.asObservable());
|
|
4961
|
-
O(this, "_onFocus$", new
|
|
4961
|
+
O(this, "_onFocus$", new be());
|
|
4962
4962
|
O(this, "onFocus$", this._onFocus$.asObservable());
|
|
4963
|
-
O(this, "_onBlur$", new
|
|
4963
|
+
O(this, "_onBlur$", new be());
|
|
4964
4964
|
O(this, "onBlur$", this._onBlur$.asObservable());
|
|
4965
|
-
O(this, "_onPointerDown$", new
|
|
4965
|
+
O(this, "_onPointerDown$", new be());
|
|
4966
4966
|
O(this, "onPointerDown$", this._onPointerDown$.asObservable());
|
|
4967
4967
|
O(this, "_container");
|
|
4968
4968
|
O(this, "_inputParent");
|
|
@@ -4999,7 +4999,7 @@ let be = class extends It {
|
|
|
4999
4999
|
return this.isFocusing || document.activeElement === document.body || document.activeElement === null;
|
|
5000
5000
|
}
|
|
5001
5001
|
_listenCurrentUnitChange() {
|
|
5002
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(_.UNIVER_DOC).pipe(
|
|
5002
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(_.UNIVER_DOC).pipe(ft(this.dispose$)).subscribe((e) => {
|
|
5003
5003
|
if (e == null)
|
|
5004
5004
|
return;
|
|
5005
5005
|
e.getUnitId() !== this._context.unitId && !this._reserveRanges && this.removeAllRanges();
|
|
@@ -5280,7 +5280,7 @@ let be = class extends It {
|
|
|
5280
5280
|
this._setRangeStyle(s);
|
|
5281
5281
|
}
|
|
5282
5282
|
_getAllTextRanges() {
|
|
5283
|
-
return this._rangeList.map(
|
|
5283
|
+
return this._rangeList.map(Ir);
|
|
5284
5284
|
}
|
|
5285
5285
|
_getAllRectRanges() {
|
|
5286
5286
|
return this._rectRangeList.map(hA);
|
|
@@ -5296,7 +5296,7 @@ let be = class extends It {
|
|
|
5296
5296
|
if (e == null)
|
|
5297
5297
|
return null;
|
|
5298
5298
|
const { startOffset: t, endOffset: o } = e;
|
|
5299
|
-
return t == null || o == null ? null :
|
|
5299
|
+
return t == null || o == null ? null : Ir(e);
|
|
5300
5300
|
}
|
|
5301
5301
|
_getActiveRangeInstance() {
|
|
5302
5302
|
return this._rangeList.find((e) => e.isActive());
|
|
@@ -5432,7 +5432,7 @@ let be = class extends It {
|
|
|
5432
5432
|
const { scene: o, mainComponent: r } = this._context, s = this._docSkeletonManagerService.getSkeleton(), { _anchorNodePosition: i, _focusNodePosition: a, _selectionStyle: c, _currentSegmentId: d, _currentSegmentPage: l } = this;
|
|
5433
5433
|
if (i == null || a == null || r == null)
|
|
5434
5434
|
return;
|
|
5435
|
-
const A =
|
|
5435
|
+
const A = Er(
|
|
5436
5436
|
i,
|
|
5437
5437
|
a,
|
|
5438
5438
|
o,
|
|
@@ -5479,7 +5479,7 @@ let be = class extends It {
|
|
|
5479
5479
|
const { _anchorNodePosition: d, _selectionStyle: l } = this, { scene: A, mainComponent: h } = this._context, u = this._docSkeletonManagerService.getSkeleton();
|
|
5480
5480
|
if (d == null || h == null)
|
|
5481
5481
|
return;
|
|
5482
|
-
const g =
|
|
5482
|
+
const g = Er(
|
|
5483
5483
|
d,
|
|
5484
5484
|
i,
|
|
5485
5485
|
A,
|
|
@@ -5610,7 +5610,7 @@ let be = class extends It {
|
|
|
5610
5610
|
if (r == null)
|
|
5611
5611
|
return;
|
|
5612
5612
|
const s = this._context.mainComponent, i = this._docSkeletonManagerService.getSkeleton(), {
|
|
5613
|
-
pageLayoutType: a =
|
|
5613
|
+
pageLayoutType: a = Rn.VERTICAL,
|
|
5614
5614
|
pageMarginLeft: c,
|
|
5615
5615
|
pageMarginTop: d
|
|
5616
5616
|
} = s.getOffsetConfig();
|
|
@@ -5626,22 +5626,22 @@ let be = class extends It {
|
|
|
5626
5626
|
this._onInputBefore$.complete(), this._onKeydown$.complete(), this._onInput$.complete(), this._onCompositionstart$.complete(), this._onCompositionupdate$.complete(), this._onCompositionend$.complete(), this._onSelectionStart$.complete(), this._textSelectionInner$.complete(), this._onPaste$.complete(), this._onFocus$.complete(), this._onBlur$.complete(), this._onPointerDown$.complete();
|
|
5627
5627
|
}
|
|
5628
5628
|
};
|
|
5629
|
-
|
|
5630
|
-
Wn(1,
|
|
5631
|
-
Wn(2,
|
|
5629
|
+
Re = fA([
|
|
5630
|
+
Wn(1, Oo),
|
|
5631
|
+
Wn(2, Qr),
|
|
5632
5632
|
Wn(3, L),
|
|
5633
5633
|
Wn(4, j(de))
|
|
5634
|
-
],
|
|
5635
|
-
const
|
|
5634
|
+
], Re);
|
|
5635
|
+
const ko = {
|
|
5636
5636
|
id: "doc.command.switch-mode",
|
|
5637
5637
|
type: D.COMMAND,
|
|
5638
5638
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
5639
5639
|
handler: (n) => {
|
|
5640
|
-
var I, S, v,
|
|
5641
|
-
const e = n.get(T), t = n.get(
|
|
5640
|
+
var I, S, v, R, E;
|
|
5641
|
+
const e = n.get(T), t = n.get(fe), o = n.get(Y), s = n.get(L).getCurrentUniverDocInstance();
|
|
5642
5642
|
if (s == null)
|
|
5643
5643
|
return !1;
|
|
5644
|
-
const i = s.getUnitId(), a = (I = t.getRenderById(i)) == null ? void 0 : I.with(de).getSkeleton(), c = (S = t.getRenderById(i)) == null ? void 0 : S.with(
|
|
5644
|
+
const i = s.getUnitId(), a = (I = t.getRenderById(i)) == null ? void 0 : I.with(de).getSkeleton(), c = (S = t.getRenderById(i)) == null ? void 0 : S.with(Re);
|
|
5645
5645
|
if (a == null || c == null)
|
|
5646
5646
|
return !1;
|
|
5647
5647
|
const d = c == null ? void 0 : c.getSegment(), l = c == null ? void 0 : c.getSegmentPage(), A = s.getSnapshot().documentStyle.documentFlavor, h = o.getDocRanges(), u = {
|
|
@@ -5658,28 +5658,28 @@ const Ho = {
|
|
|
5658
5658
|
else
|
|
5659
5659
|
return !1;
|
|
5660
5660
|
if (A !== we.MODERN) {
|
|
5661
|
-
const
|
|
5661
|
+
const b = s.getSnapshot(), { drawings: y = {}, body: C } = b, B = (v = C == null ? void 0 : C.customBlocks) != null ? v : [];
|
|
5662
5662
|
for (const x in y) {
|
|
5663
5663
|
const M = y[x], P = B.find((he) => he.blockId === x);
|
|
5664
5664
|
if (P == null)
|
|
5665
5665
|
continue;
|
|
5666
5666
|
const F = M.docTransform.positionV, { relativeFrom: w, posOffset: N } = F;
|
|
5667
|
-
if (w ===
|
|
5667
|
+
if (w === gt.PARAGRAPH)
|
|
5668
5668
|
continue;
|
|
5669
|
-
const { startIndex: ee } = P, $ = a.findNodeByCharIndex(ee, d, l), U = (
|
|
5669
|
+
const { startIndex: ee } = P, $ = 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;
|
|
5670
5670
|
if ($ == null || U == null || k == null || H == null || ne == null)
|
|
5671
5671
|
continue;
|
|
5672
5672
|
let ie = 0;
|
|
5673
|
-
w ===
|
|
5673
|
+
w === gt.LINE ? ie -= U.top : w === gt.PAGE && (ie += ne.marginTop), ie += k.top;
|
|
5674
5674
|
const ae = {
|
|
5675
5675
|
...F,
|
|
5676
|
-
relativeFrom:
|
|
5676
|
+
relativeFrom: gt.PARAGRAPH,
|
|
5677
5677
|
posOffset: (N != null ? N : 0) - ie
|
|
5678
5678
|
}, oe = g.replaceOp(["drawings", x, "docTransform", "positionV"], F, ae);
|
|
5679
5679
|
oe && f.push(oe);
|
|
5680
5680
|
}
|
|
5681
5681
|
}
|
|
5682
|
-
return u.params.actions = f.reduce((
|
|
5682
|
+
return u.params.actions = f.reduce((b, y) => W.compose(b, y), null), !!e.syncExecuteCommand(u.id, u.params);
|
|
5683
5683
|
}
|
|
5684
5684
|
}, pA = "doc.command.create-table", ja = {
|
|
5685
5685
|
id: pA,
|
|
@@ -5699,9 +5699,9 @@ const Ho = {
|
|
|
5699
5699
|
const { startOffset: p } = c, I = ((ae = h.paragraphs) != null ? ae : []).find((At) => At.startIndex >= p), S = f.findNodeByCharIndex(p, d, l);
|
|
5700
5700
|
if (S == null)
|
|
5701
5701
|
return !1;
|
|
5702
|
-
const v = new Ee(),
|
|
5703
|
-
startOffset:
|
|
5704
|
-
endOffset:
|
|
5702
|
+
const v = new Ee(), R = W.getInstance(), E = [], b = p + 4, y = [{
|
|
5703
|
+
startOffset: b,
|
|
5704
|
+
endOffset: b,
|
|
5705
5705
|
collapsed: !0
|
|
5706
5706
|
}], C = {
|
|
5707
5707
|
id: X.id,
|
|
@@ -5722,7 +5722,7 @@ const Ho = {
|
|
|
5722
5722
|
},
|
|
5723
5723
|
len: 1
|
|
5724
5724
|
});
|
|
5725
|
-
const B = a.getDefaultStyle(), x = a.getStyleCache(), M =
|
|
5725
|
+
const B = a.getDefaultStyle(), x = a.getStyleCache(), M = Bo(
|
|
5726
5726
|
h,
|
|
5727
5727
|
p,
|
|
5728
5728
|
B,
|
|
@@ -5753,8 +5753,8 @@ const Ho = {
|
|
|
5753
5753
|
len: P.length
|
|
5754
5754
|
});
|
|
5755
5755
|
const k = Ae(A, d);
|
|
5756
|
-
E.push(
|
|
5757
|
-
const ne =
|
|
5756
|
+
E.push(R.editOp(v.serialize(), k));
|
|
5757
|
+
const ne = R.insertOp(["tableSource", H.tableId], H);
|
|
5758
5758
|
return E.push(ne), C.params.actions = E.reduce((At, $e) => W.compose(At, $e), null), !!i.syncExecuteCommand(C.id, C.params);
|
|
5759
5759
|
}
|
|
5760
5760
|
}, Is = {
|
|
@@ -5774,10 +5774,10 @@ const Ho = {
|
|
|
5774
5774
|
const A = l.getViewModel(), h = c == null ? void 0 : c.getUnitId(), u = new Ee(), g = W.getInstance(), f = Ia(i, A);
|
|
5775
5775
|
if (f == null)
|
|
5776
5776
|
return !1;
|
|
5777
|
-
const { offset: p, rowIndexes: m, len: I, tableId: S, cursor: v, selectWholeTable:
|
|
5778
|
-
if (
|
|
5777
|
+
const { offset: p, rowIndexes: m, len: I, tableId: S, cursor: v, selectWholeTable: R } = f;
|
|
5778
|
+
if (R)
|
|
5779
5779
|
return o.executeCommand(kn.id);
|
|
5780
|
-
const E = [],
|
|
5780
|
+
const E = [], b = [{
|
|
5781
5781
|
startOffset: v,
|
|
5782
5782
|
endOffset: v,
|
|
5783
5783
|
collapsed: !0
|
|
@@ -5786,7 +5786,7 @@ const Ho = {
|
|
|
5786
5786
|
params: {
|
|
5787
5787
|
unitId: h,
|
|
5788
5788
|
actions: [],
|
|
5789
|
-
textRanges:
|
|
5789
|
+
textRanges: b
|
|
5790
5790
|
}
|
|
5791
5791
|
};
|
|
5792
5792
|
p > 0 && u.push({
|
|
@@ -5818,13 +5818,13 @@ const Ho = {
|
|
|
5818
5818
|
const l = qe(n, c.getUnitId());
|
|
5819
5819
|
if (l == null)
|
|
5820
5820
|
return !1;
|
|
5821
|
-
const A = l.getViewModel(), h = c == null ? void 0 : c.getUnitId(), u = new Ee(), g = W.getInstance(), f =
|
|
5821
|
+
const A = l.getViewModel(), h = c == null ? void 0 : c.getUnitId(), u = new Ee(), g = W.getInstance(), f = Rd(i, A);
|
|
5822
5822
|
if (f == null)
|
|
5823
5823
|
return !1;
|
|
5824
|
-
const { offsets: p, columnIndexes: m, tableId: I, cursor: S, rowCount: v, selectWholeTable:
|
|
5825
|
-
if (
|
|
5824
|
+
const { offsets: p, columnIndexes: m, tableId: I, cursor: S, rowCount: v, selectWholeTable: R } = f;
|
|
5825
|
+
if (R)
|
|
5826
5826
|
return o.executeCommand(kn.id);
|
|
5827
|
-
const E = [],
|
|
5827
|
+
const E = [], b = [{
|
|
5828
5828
|
startOffset: S,
|
|
5829
5829
|
endOffset: S,
|
|
5830
5830
|
collapsed: !0
|
|
@@ -5833,7 +5833,7 @@ const Ho = {
|
|
|
5833
5833
|
params: {
|
|
5834
5834
|
unitId: h,
|
|
5835
5835
|
actions: [],
|
|
5836
|
-
textRanges:
|
|
5836
|
+
textRanges: b
|
|
5837
5837
|
}
|
|
5838
5838
|
};
|
|
5839
5839
|
for (const x of p) {
|
|
@@ -5876,7 +5876,7 @@ const Ho = {
|
|
|
5876
5876
|
const A = l.getViewModel(), h = c == null ? void 0 : c.getUnitId(), u = new Ee(), g = W.getInstance(), f = Sa(i, A);
|
|
5877
5877
|
if (f == null)
|
|
5878
5878
|
return !1;
|
|
5879
|
-
const { offset: p, len: m, tableId: I, cursor: S } = f, v = [],
|
|
5879
|
+
const { offset: p, len: m, tableId: I, cursor: S } = f, v = [], R = [{
|
|
5880
5880
|
startOffset: S,
|
|
5881
5881
|
endOffset: S,
|
|
5882
5882
|
collapsed: !0
|
|
@@ -5885,7 +5885,7 @@ const Ho = {
|
|
|
5885
5885
|
params: {
|
|
5886
5886
|
unitId: h,
|
|
5887
5887
|
actions: [],
|
|
5888
|
-
textRanges:
|
|
5888
|
+
textRanges: R
|
|
5889
5889
|
}
|
|
5890
5890
|
};
|
|
5891
5891
|
p > 0 && u.push({
|
|
@@ -5895,19 +5895,19 @@ const Ho = {
|
|
|
5895
5895
|
t: G.DELETE,
|
|
5896
5896
|
len: m
|
|
5897
5897
|
});
|
|
5898
|
-
const
|
|
5899
|
-
v.push(g.editOp(u.serialize(),
|
|
5898
|
+
const b = Ae(c, a);
|
|
5899
|
+
v.push(g.editOp(u.serialize(), b));
|
|
5900
5900
|
const y = g.removeOp(["tableSource", I]);
|
|
5901
5901
|
return v.push(y), E.params.actions = v.reduce((B, x) => W.compose(B, x), null), !!o.syncExecuteCommand(E.id, E.params);
|
|
5902
5902
|
}
|
|
5903
|
-
}, vs = "doc.command.table-insert-row", Cs = "doc.command.table-insert-column", mA = "doc.command.table-insert-row-above", EA = "doc.command.table-insert-row-bellow", IA = "doc.command.table-insert-column-left", SA = "doc.command.table-insert-column-right",
|
|
5903
|
+
}, vs = "doc.command.table-insert-row", Cs = "doc.command.table-insert-column", mA = "doc.command.table-insert-row-above", EA = "doc.command.table-insert-row-bellow", IA = "doc.command.table-insert-column-left", SA = "doc.command.table-insert-column-right", Rs = {
|
|
5904
5904
|
id: mA,
|
|
5905
5905
|
type: D.COMMAND,
|
|
5906
|
-
handler: async (n) => n.get(T).executeCommand(vs, { position:
|
|
5907
|
-
},
|
|
5906
|
+
handler: async (n) => n.get(T).executeCommand(vs, { position: _o.ABOVE })
|
|
5907
|
+
}, bs = {
|
|
5908
5908
|
id: EA,
|
|
5909
5909
|
type: D.COMMAND,
|
|
5910
|
-
handler: async (n) => n.get(T).executeCommand(vs, { position:
|
|
5910
|
+
handler: async (n) => n.get(T).executeCommand(vs, { position: _o.BELLOW })
|
|
5911
5911
|
}, ys = {
|
|
5912
5912
|
id: IA,
|
|
5913
5913
|
type: D.COMMAND,
|
|
@@ -5933,9 +5933,9 @@ const Ho = {
|
|
|
5933
5933
|
const u = h.getViewModel(), g = l == null ? void 0 : l.getUnitId(), f = new Ee(), p = W.getInstance(), m = Sd(c, t, u);
|
|
5934
5934
|
if (m == null)
|
|
5935
5935
|
return !1;
|
|
5936
|
-
const { offset: I, colCount: S, tableId: v, insertRowIndex:
|
|
5937
|
-
startOffset:
|
|
5938
|
-
endOffset:
|
|
5936
|
+
const { offset: I, colCount: S, tableId: v, insertRowIndex: R } = m, E = [], b = I + 2, y = [{
|
|
5937
|
+
startOffset: b,
|
|
5938
|
+
endOffset: b,
|
|
5939
5939
|
collapsed: !0
|
|
5940
5940
|
}], C = {
|
|
5941
5941
|
id: X.id,
|
|
@@ -5957,7 +5957,7 @@ const Ho = {
|
|
|
5957
5957
|
});
|
|
5958
5958
|
const x = Ae(l, d);
|
|
5959
5959
|
E.push(p.editOp(f.serialize(), x));
|
|
5960
|
-
const M = qr(S), P = p.insertOp(["tableSource", v, "tableRows",
|
|
5960
|
+
const M = qr(S), P = p.insertOp(["tableSource", v, "tableRows", R], M);
|
|
5961
5961
|
return E.push(P), C.params.actions = E.reduce((w, N) => W.compose(w, N), null), !!s.syncExecuteCommand(C.id, C.params);
|
|
5962
5962
|
}
|
|
5963
5963
|
}, vA = {
|
|
@@ -5978,9 +5978,9 @@ const Ho = {
|
|
|
5978
5978
|
const u = h.getViewModel(), g = l == null ? void 0 : l.getUnitId(), f = new Ee(), p = W.getInstance(), m = vd(c, t, u);
|
|
5979
5979
|
if (m == null)
|
|
5980
5980
|
return !1;
|
|
5981
|
-
const { offsets: I, columnIndex: S, tableId: v, rowCount:
|
|
5982
|
-
startOffset:
|
|
5983
|
-
endOffset:
|
|
5981
|
+
const { offsets: I, columnIndex: S, tableId: v, rowCount: R } = m, E = [], b = I[0] + 1, y = [{
|
|
5982
|
+
startOffset: b,
|
|
5983
|
+
endOffset: b,
|
|
5984
5984
|
collapsed: !0
|
|
5985
5985
|
}], C = {
|
|
5986
5986
|
id: X.id,
|
|
@@ -6004,7 +6004,7 @@ const Ho = {
|
|
|
6004
6004
|
}
|
|
6005
6005
|
const B = Ae(l, d);
|
|
6006
6006
|
E.push(p.editOp(f.serialize(), B));
|
|
6007
|
-
for (let oe = 0; oe <
|
|
6007
|
+
for (let oe = 0; oe < R; oe++) {
|
|
6008
6008
|
const he = Kr(), Pe = p.insertOp(["tableSource", v, "tableRows", oe, "tableCells", S], he);
|
|
6009
6009
|
E.push(Pe);
|
|
6010
6010
|
}
|
|
@@ -6028,7 +6028,7 @@ const Ho = {
|
|
|
6028
6028
|
if (h == null || c == null)
|
|
6029
6029
|
return !1;
|
|
6030
6030
|
let u = null;
|
|
6031
|
-
if (t ? u = $s(h, c,
|
|
6031
|
+
if (t ? u = $s(h, c, Ar.PREV) : u = $s(h, c, Ar.NEXT), u) {
|
|
6032
6032
|
const { startOffset: f, endOffset: p } = u, m = [{
|
|
6033
6033
|
startOffset: f,
|
|
6034
6034
|
endOffset: p
|
|
@@ -6036,10 +6036,10 @@ const Ho = {
|
|
|
6036
6036
|
return o.replaceDocRanges(m), !0;
|
|
6037
6037
|
}
|
|
6038
6038
|
return t === !1 ? await s.executeCommand(za.id, {
|
|
6039
|
-
position:
|
|
6039
|
+
position: _o.BELLOW
|
|
6040
6040
|
}) : !0;
|
|
6041
6041
|
}
|
|
6042
|
-
}, Ya = "COMPONENT_DOC_CREATE_TABLE_CONFIRM",
|
|
6042
|
+
}, Ya = "COMPONENT_DOC_CREATE_TABLE_CONFIRM", $o = "doc.component.create-table-confirm", Os = {
|
|
6043
6043
|
id: "doc.operation.create-table",
|
|
6044
6044
|
type: D.COMMAND,
|
|
6045
6045
|
handler: async (n) => {
|
|
@@ -6050,7 +6050,7 @@ const Ho = {
|
|
|
6050
6050
|
r.rowCount = i, r.colCount = a;
|
|
6051
6051
|
};
|
|
6052
6052
|
return await t.open({
|
|
6053
|
-
id:
|
|
6053
|
+
id: $o,
|
|
6054
6054
|
children: {
|
|
6055
6055
|
label: {
|
|
6056
6056
|
name: Ya,
|
|
@@ -6063,18 +6063,18 @@ const Ho = {
|
|
|
6063
6063
|
width: 400,
|
|
6064
6064
|
title: { title: e.t("toolbar.table.insert") },
|
|
6065
6065
|
onConfirm: () => {
|
|
6066
|
-
o.executeCommand(ja.id, r), t.close(
|
|
6066
|
+
o.executeCommand(ja.id, r), t.close($o);
|
|
6067
6067
|
},
|
|
6068
6068
|
onClose: () => {
|
|
6069
|
-
t.close(
|
|
6069
|
+
t.close($o);
|
|
6070
6070
|
}
|
|
6071
6071
|
}), !0;
|
|
6072
6072
|
}
|
|
6073
|
-
},
|
|
6073
|
+
}, Et = {
|
|
6074
6074
|
id: "doc.operation.move-cursor",
|
|
6075
6075
|
type: D.OPERATION,
|
|
6076
6076
|
handler: (n, e) => !!e
|
|
6077
|
-
},
|
|
6077
|
+
}, It = {
|
|
6078
6078
|
id: "doc.operation.move-selection",
|
|
6079
6079
|
type: D.OPERATION,
|
|
6080
6080
|
handler: (n, e) => !!e
|
|
@@ -6099,11 +6099,11 @@ var We = function() {
|
|
|
6099
6099
|
return Ka(t, "".concat(o), { defIds: t.defIds, idSuffix: c.current }, We({ ref: e, className: a }, i), s);
|
|
6100
6100
|
});
|
|
6101
6101
|
function Ka(n, e, t, o, r) {
|
|
6102
|
-
return Be(n.tag, We(We({ key: e },
|
|
6102
|
+
return Be(n.tag, We(We({ key: e }, RA(n, t, r)), o), (bA(n, t).children || []).map(function(s, i) {
|
|
6103
6103
|
return Ka(s, "".concat(e, "-").concat(n.tag, "-").concat(i), t, void 0, r);
|
|
6104
6104
|
}));
|
|
6105
6105
|
}
|
|
6106
|
-
function
|
|
6106
|
+
function RA(n, e, t) {
|
|
6107
6107
|
var o = We({}, n.attrs);
|
|
6108
6108
|
t != null && t.colorChannel1 && o.fill === "colorChannel1" && (o.fill = t.colorChannel1), n.tag === "mask" && o.id && (o.id = o.id + e.idSuffix), Object.entries(o).forEach(function(s) {
|
|
6109
6109
|
var i = s[0], a = s[1];
|
|
@@ -6115,7 +6115,7 @@ function bA(n, e, t) {
|
|
|
6115
6115
|
typeof a == "string" && (o[i] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
6116
6116
|
})), o;
|
|
6117
6117
|
}
|
|
6118
|
-
function
|
|
6118
|
+
function bA(n, e) {
|
|
6119
6119
|
var t, o = e.defIds;
|
|
6120
6120
|
return !o || o.length === 0 ? n : n.tag === "defs" && (!((t = n.children) === null || t === void 0) && t.length) ? We(We({}, n), { children: n.children.map(function(r) {
|
|
6121
6121
|
return typeof r.attrs.id == "string" && o && o.includes(r.attrs.id) ? We(We({}, r), { attrs: We(We({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
|
|
@@ -6284,34 +6284,34 @@ function Ac(n) {
|
|
|
6284
6284
|
}
|
|
6285
6285
|
return 0;
|
|
6286
6286
|
}
|
|
6287
|
-
class WA extends
|
|
6287
|
+
class WA extends pe {
|
|
6288
6288
|
constructor(t, o, r, s, i, a) {
|
|
6289
6289
|
super();
|
|
6290
6290
|
// Emit change event when editor lose focus.
|
|
6291
|
-
O(this, "_change$", new
|
|
6291
|
+
O(this, "_change$", new be());
|
|
6292
6292
|
O(this, "change$", this._change$.asObservable());
|
|
6293
6293
|
// The input event fires when the value of a editor has been changed as a direct result of a user action.
|
|
6294
|
-
O(this, "_input$", new
|
|
6294
|
+
O(this, "_input$", new be());
|
|
6295
6295
|
O(this, "input$", this._input$.asObservable());
|
|
6296
6296
|
// paste event.
|
|
6297
|
-
O(this, "_paste$", new
|
|
6297
|
+
O(this, "_paste$", new be());
|
|
6298
6298
|
O(this, "paste$", this._paste$.asObservable());
|
|
6299
6299
|
// Editor get focus.
|
|
6300
|
-
O(this, "_focus$", new
|
|
6300
|
+
O(this, "_focus$", new be());
|
|
6301
6301
|
O(this, "focus$", this._focus$.asObservable());
|
|
6302
6302
|
// Editor lose focus.
|
|
6303
|
-
O(this, "_blur$", new
|
|
6303
|
+
O(this, "_blur$", new be());
|
|
6304
6304
|
O(this, "blur$", this._blur$.asObservable());
|
|
6305
6305
|
// Emit when doc selection changed.
|
|
6306
|
-
O(this, "_selectionChange$", new
|
|
6306
|
+
O(this, "_selectionChange$", new be());
|
|
6307
6307
|
O(this, "selectionChange$", this._selectionChange$.asObservable());
|
|
6308
6308
|
this._param = t, this._univerInstanceService = o, this._docSelectionManagerService = r, this._commandService = s, this._undoRedoService = i, this._injector = a, this._listenSelection();
|
|
6309
6309
|
}
|
|
6310
6310
|
get docSelectionRenderService() {
|
|
6311
|
-
return this._param.render.with(
|
|
6311
|
+
return this._param.render.with(Re);
|
|
6312
6312
|
}
|
|
6313
6313
|
_listenSelection() {
|
|
6314
|
-
const t = this._param.render.with(
|
|
6314
|
+
const t = this._param.render.with(Re);
|
|
6315
6315
|
this.disposeWithMe(
|
|
6316
6316
|
t.onBlur$.subscribe((o) => {
|
|
6317
6317
|
this._blur$.next(o);
|
|
@@ -6332,7 +6332,7 @@ class WA extends fe {
|
|
|
6332
6332
|
), this.disposeWithMe(
|
|
6333
6333
|
ha(
|
|
6334
6334
|
t.onInput$,
|
|
6335
|
-
t.onKeydown$.pipe(
|
|
6335
|
+
t.onKeydown$.pipe(dr((o) => {
|
|
6336
6336
|
const r = o.event;
|
|
6337
6337
|
return r.ctrlKey || r.metaKey ? [q.X, q.V].includes(r.keyCode) : [q.BACKSPACE].includes(r.keyCode);
|
|
6338
6338
|
})),
|
|
@@ -6360,7 +6360,7 @@ class WA extends fe {
|
|
|
6360
6360
|
);
|
|
6361
6361
|
}
|
|
6362
6362
|
isFocus() {
|
|
6363
|
-
const t = this._param.render.with(
|
|
6363
|
+
const t = this._param.render.with(Re);
|
|
6364
6364
|
return t.isFocusing && !!t.getActiveTextRange();
|
|
6365
6365
|
}
|
|
6366
6366
|
/**
|
|
@@ -6368,13 +6368,13 @@ class WA extends fe {
|
|
|
6368
6368
|
*/
|
|
6369
6369
|
focus() {
|
|
6370
6370
|
const t = this._univerInstanceService.getCurrentUnitForType(_.UNIVER_DOC), o = this.getEditorId();
|
|
6371
|
-
(t == null || t.getUnitId() !== o) && this._univerInstanceService.setCurrentUnitForType(o), this._param.render.with(
|
|
6371
|
+
(t == null || t.getUnitId() !== o) && this._univerInstanceService.setCurrentUnitForType(o), this._param.render.with(Re).focus();
|
|
6372
6372
|
}
|
|
6373
6373
|
/**
|
|
6374
6374
|
* @deprecated use `IEditorService.blur` as instead. this is for internal usage.
|
|
6375
6375
|
*/
|
|
6376
6376
|
blur() {
|
|
6377
|
-
this._param.render.with(
|
|
6377
|
+
this._param.render.with(Re).blur();
|
|
6378
6378
|
}
|
|
6379
6379
|
// Selects the entire content of the editor.
|
|
6380
6380
|
// Calling editor.select() will not necessarily focus the editor, so it is often used with Editor.focus
|
|
@@ -6488,10 +6488,10 @@ class WA extends fe {
|
|
|
6488
6488
|
}
|
|
6489
6489
|
getSkeleton() {
|
|
6490
6490
|
var o;
|
|
6491
|
-
return (o = this._injector.get(
|
|
6491
|
+
return (o = this._injector.get(fe).getRenderById(this._getEditorId())) == null ? void 0 : o.with(de).getSkeleton();
|
|
6492
6492
|
}
|
|
6493
6493
|
isSheetEditor() {
|
|
6494
|
-
return
|
|
6494
|
+
return vt(this._getEditorId());
|
|
6495
6495
|
}
|
|
6496
6496
|
/**
|
|
6497
6497
|
* @deprecated use getDocumentData.
|
|
@@ -6539,7 +6539,7 @@ var jA = Object.getOwnPropertyDescriptor, zA = (n, e, t, o) => {
|
|
|
6539
6539
|
for (var r = o > 1 ? void 0 : o ? jA(e, t) : e, s = n.length - 1, i; s >= 0; s--)
|
|
6540
6540
|
(i = n[s]) && (r = i(r) || r);
|
|
6541
6541
|
return r;
|
|
6542
|
-
},
|
|
6542
|
+
}, xt = (n, e) => (t, o) => e(t, o, n);
|
|
6543
6543
|
const GA = [
|
|
6544
6544
|
"editor",
|
|
6545
6545
|
"render-canvas"
|
|
@@ -6547,14 +6547,14 @@ const GA = [
|
|
|
6547
6547
|
// 'univer-range-selector-editor',
|
|
6548
6548
|
// 'univer-text-editor-container-placeholder',
|
|
6549
6549
|
];
|
|
6550
|
-
let
|
|
6550
|
+
let Sr = class extends pe {
|
|
6551
6551
|
constructor(e, t, o, r, s, i, a) {
|
|
6552
6552
|
super();
|
|
6553
6553
|
O(this, "_editors", /* @__PURE__ */ new Map());
|
|
6554
6554
|
O(this, "_focusEditorUnitId");
|
|
6555
|
-
O(this, "_blur$", new
|
|
6555
|
+
O(this, "_blur$", new be());
|
|
6556
6556
|
O(this, "blur$", this._blur$.asObservable());
|
|
6557
|
-
O(this, "_focus$", new
|
|
6557
|
+
O(this, "_focus$", new be());
|
|
6558
6558
|
O(this, "focus$", this._focus$.asObservable());
|
|
6559
6559
|
this._univerInstanceService = e, this._renderManagerService = t, this._docSelectionManagerService = o, this._contextService = r, this._commandService = s, this._undoRedoService = i, this._injector = a, this._initUniverFocusListener();
|
|
6560
6560
|
}
|
|
@@ -6603,7 +6603,7 @@ let Ir = class extends fe {
|
|
|
6603
6603
|
return;
|
|
6604
6604
|
this._univerInstanceService.setCurrentUnitForType(e);
|
|
6605
6605
|
const o = t.getValue().length;
|
|
6606
|
-
this._contextService.setContextValue(to, !0),
|
|
6606
|
+
this._contextService.setContextValue(to, !0), vt(e) || this._contextService.setContextValue(Us, !0), t.focus(), this._setFocusId(e), this._focus$.next({
|
|
6607
6607
|
startOffset: o,
|
|
6608
6608
|
endOffset: o
|
|
6609
6609
|
});
|
|
@@ -6673,16 +6673,16 @@ let Ir = class extends fe {
|
|
|
6673
6673
|
};
|
|
6674
6674
|
}
|
|
6675
6675
|
};
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
],
|
|
6685
|
-
const Ye = Yi("univer.editor.service"),
|
|
6676
|
+
Sr = zA([
|
|
6677
|
+
xt(0, L),
|
|
6678
|
+
xt(1, fe),
|
|
6679
|
+
xt(2, j(Y)),
|
|
6680
|
+
xt(3, Fr),
|
|
6681
|
+
xt(4, T),
|
|
6682
|
+
xt(5, xo),
|
|
6683
|
+
xt(6, j(Pn))
|
|
6684
|
+
], Sr);
|
|
6685
|
+
const Ye = Yi("univer.editor.service"), vr = "COMPONENT_DOC_HEADER_FOOTER_PANEL";
|
|
6686
6686
|
function YA(n, e, t) {
|
|
6687
6687
|
const {
|
|
6688
6688
|
useFirstPageHeaderFooter: o,
|
|
@@ -6697,20 +6697,20 @@ function YA(n, e, t) {
|
|
|
6697
6697
|
return e === ve.HEADER ? o === z.TRUE ? t === 0 ? a : r === z.TRUE && t % 2 === 1 ? d : s : r === z.TRUE && t % 2 === 1 ? d : s : o === z.TRUE ? t === 0 ? c : r === z.TRUE && t % 2 === 1 ? l : i : r === z.TRUE && t % 2 === 1 ? l : i;
|
|
6698
6698
|
}
|
|
6699
6699
|
const KA = (n) => {
|
|
6700
|
-
const e = J(Ke), t = J(L), o = J(
|
|
6701
|
-
var
|
|
6700
|
+
const e = J(Ke), t = J(L), o = J(fe), r = J(T), s = J(Oo), { unitId: i } = n, a = o.getRenderById(i).with(Re), [c, d] = me({}), l = (u, g) => {
|
|
6701
|
+
var b;
|
|
6702
6702
|
d((y) => ({
|
|
6703
6703
|
...y,
|
|
6704
6704
|
[g]: u ? z.TRUE : z.FALSE
|
|
6705
6705
|
}));
|
|
6706
|
-
const f = t.getUniverDocInstance(i), p = f == null ? void 0 : f.getSnapshot().documentStyle, m = (
|
|
6706
|
+
const f = t.getUniverDocInstance(i), p = f == null ? void 0 : f.getSnapshot().documentStyle, m = (b = o.getRenderById(i)) == null ? void 0 : b.with(de), I = m == null ? void 0 : m.getViewModel();
|
|
6707
6707
|
if (p == null || I == null)
|
|
6708
6708
|
return;
|
|
6709
6709
|
const S = I.getEditArea();
|
|
6710
6710
|
let v = !1;
|
|
6711
|
-
const
|
|
6711
|
+
const R = a.getSegmentPage();
|
|
6712
6712
|
let E = !1;
|
|
6713
|
-
if (g === "useFirstPageHeaderFooter" && u === !0 && ((S === ve.HEADER && !p.firstPageHeaderId || S === ve.FOOTER && !p.firstPageFooterId) && (v = !0), v &&
|
|
6713
|
+
if (g === "useFirstPageHeaderFooter" && u === !0 && ((S === ve.HEADER && !p.firstPageHeaderId || S === ve.FOOTER && !p.firstPageFooterId) && (v = !0), v && R === 0 && (E = !0)), g === "evenAndOddHeaders" && u === !0 && ((S === ve.HEADER && !p.evenPageHeaderId || S === ve.FOOTER && !p.evenPageFooterId) && (v = !0), v && R % 2 === 1 && (E = !0)), v) {
|
|
6714
6714
|
const C = ge(6);
|
|
6715
6715
|
E && a.setSegment(C), r.executeCommand(eo, {
|
|
6716
6716
|
unitId: i,
|
|
@@ -6828,7 +6828,7 @@ const KA = (n) => {
|
|
|
6828
6828
|
] });
|
|
6829
6829
|
}, qA = () => {
|
|
6830
6830
|
var d;
|
|
6831
|
-
const n = J(Ke), e = J(
|
|
6831
|
+
const n = J(Ke), e = J(fe), r = J(L).getCurrentUniverDocInstance().getUnitId(), i = ((d = e.getRenderById(r)) == null ? void 0 : d.with(de)).getViewModel(), [a, c] = me(!0);
|
|
6832
6832
|
return Ce(() => {
|
|
6833
6833
|
const l = i.getEditArea();
|
|
6834
6834
|
c(l !== ve.BODY);
|
|
@@ -6839,7 +6839,7 @@ const KA = (n) => {
|
|
|
6839
6839
|
A.unsubscribe();
|
|
6840
6840
|
};
|
|
6841
6841
|
}, []), /* @__PURE__ */ Q("div", { className: "univer-text-sm", children: a ? /* @__PURE__ */ Q(KA, { unitId: r }) : /* @__PURE__ */ Q("div", { className: "univer-text-gray-400", children: n.t("headerFooter.disableText") }) });
|
|
6842
|
-
}, Ii = 18, Si = 200,
|
|
6842
|
+
}, Ii = 18, Si = 200, er = 6, XA = 4;
|
|
6843
6843
|
function ZA(n, e) {
|
|
6844
6844
|
let { radius: t, width: o, height: r } = e;
|
|
6845
6845
|
t = t != null ? t : 0, o = o != null ? o : 30, r = r != null ? r : 30;
|
|
@@ -6857,7 +6857,7 @@ class co extends ul {
|
|
|
6857
6857
|
const { text: r, color: s } = o;
|
|
6858
6858
|
t.save(), t.font = "13px Source Han Sans CN";
|
|
6859
6859
|
const i = t.measureText(r).width, a = Math.min(
|
|
6860
|
-
i + 2 *
|
|
6860
|
+
i + 2 * er,
|
|
6861
6861
|
Si
|
|
6862
6862
|
);
|
|
6863
6863
|
ZA(t, {
|
|
@@ -6866,7 +6866,7 @@ class co extends ul {
|
|
|
6866
6866
|
radius: 4,
|
|
6867
6867
|
fill: s
|
|
6868
6868
|
}), t.fillStyle = "rgba(58, 96, 247, 1)";
|
|
6869
|
-
const c =
|
|
6869
|
+
const c = er, d = Ii - XA, l = Si - 2 * er;
|
|
6870
6870
|
if (i > l) {
|
|
6871
6871
|
let A = "", h = 0;
|
|
6872
6872
|
for (const u of r) {
|
|
@@ -6943,7 +6943,7 @@ function eu(n, e, t) {
|
|
|
6943
6943
|
throw new Error(`Invalid editArea: ${e}`);
|
|
6944
6944
|
}
|
|
6945
6945
|
}
|
|
6946
|
-
let
|
|
6946
|
+
let Cr = class extends pe {
|
|
6947
6947
|
constructor(e, t, o, r, s, i, a, c, d) {
|
|
6948
6948
|
super();
|
|
6949
6949
|
O(this, "_loadedMap", /* @__PURE__ */ new WeakSet());
|
|
@@ -6966,19 +6966,19 @@ let vr = class extends fe {
|
|
|
6966
6966
|
);
|
|
6967
6967
|
}
|
|
6968
6968
|
_initCustomComponents() {
|
|
6969
|
-
this._componentManager.get(
|
|
6969
|
+
this._componentManager.get(vr) || this.disposeWithMe(this._componentManager.register(vr, qA));
|
|
6970
6970
|
}
|
|
6971
6971
|
_init() {
|
|
6972
|
-
const { unitId: e } = this._context, t =
|
|
6972
|
+
const { unitId: e } = this._context, t = pt(this._context);
|
|
6973
6973
|
t == null || t.document == null || this._loadedMap.has(t.document) || (this._initialMain(e), this._loadedMap.add(t.document));
|
|
6974
6974
|
}
|
|
6975
6975
|
_initialMain(e) {
|
|
6976
|
-
const t =
|
|
6976
|
+
const t = pt(this._context), { document: o } = t;
|
|
6977
6977
|
this.disposeWithMe(o.onDblclick$.subscribeEvent(async (r) => {
|
|
6978
6978
|
if (this._isEditorReadOnly(e) || !this._isTraditionalMode())
|
|
6979
6979
|
return;
|
|
6980
6980
|
const { offsetX: s, offsetY: i } = r, {
|
|
6981
|
-
pageLayoutType: a =
|
|
6981
|
+
pageLayoutType: a = Rn.VERTICAL,
|
|
6982
6982
|
pageMarginLeft: c,
|
|
6983
6983
|
pageMarginTop: d
|
|
6984
6984
|
} = o.getOffsetConfig(), l = this._getTransformCoordForDocumentOffset(s, i);
|
|
@@ -7007,7 +7007,7 @@ let vr = class extends fe {
|
|
|
7007
7007
|
}));
|
|
7008
7008
|
}
|
|
7009
7009
|
_getTransformCoordForDocumentOffset(e, t) {
|
|
7010
|
-
const o =
|
|
7010
|
+
const o = pt(this._context), { document: r, scene: s } = o, { documentTransform: i } = r.getOffsetConfig(), a = s.getViewports()[0];
|
|
7011
7011
|
if (a == null)
|
|
7012
7012
|
return;
|
|
7013
7013
|
const c = a.transformVector2SceneCoord(Cn.FromArray([e, t]));
|
|
@@ -7092,16 +7092,16 @@ let vr = class extends fe {
|
|
|
7092
7092
|
return this._context.unit.getSnapshot().documentStyle.documentFlavor === we.TRADITIONAL;
|
|
7093
7093
|
}
|
|
7094
7094
|
};
|
|
7095
|
-
|
|
7095
|
+
Cr = $A([
|
|
7096
7096
|
ut(1, T),
|
|
7097
7097
|
ut(2, Ye),
|
|
7098
7098
|
ut(3, L),
|
|
7099
|
-
ut(4,
|
|
7099
|
+
ut(4, fe),
|
|
7100
7100
|
ut(5, j(de)),
|
|
7101
|
-
ut(6, j(
|
|
7101
|
+
ut(6, j(Re)),
|
|
7102
7102
|
ut(7, j(Ke)),
|
|
7103
7103
|
ut(8, j(sn))
|
|
7104
|
-
],
|
|
7104
|
+
], Cr);
|
|
7105
7105
|
const Ts = {
|
|
7106
7106
|
id: "sidebar.operation.doc-header-footer-panel",
|
|
7107
7107
|
type: D.OPERATION,
|
|
@@ -7111,7 +7111,7 @@ const Ts = {
|
|
|
7111
7111
|
case "open":
|
|
7112
7112
|
t.open({
|
|
7113
7113
|
header: { title: o.t("headerFooter.panel") },
|
|
7114
|
-
children: { label:
|
|
7114
|
+
children: { label: vr },
|
|
7115
7115
|
onClose: () => {
|
|
7116
7116
|
},
|
|
7117
7117
|
width: 400
|
|
@@ -7125,7 +7125,7 @@ const Ts = {
|
|
|
7125
7125
|
return !0;
|
|
7126
7126
|
}
|
|
7127
7127
|
};
|
|
7128
|
-
function
|
|
7128
|
+
function Ri() {
|
|
7129
7129
|
return {
|
|
7130
7130
|
dataStream: `\r
|
|
7131
7131
|
`,
|
|
@@ -7155,15 +7155,15 @@ function bi() {
|
|
|
7155
7155
|
]
|
|
7156
7156
|
};
|
|
7157
7157
|
}
|
|
7158
|
-
function
|
|
7158
|
+
function tr(n, e, t, o) {
|
|
7159
7159
|
const r = W.getInstance(), s = 6, i = n != null ? n : ge(s), a = e === Qe.DEFAULT_HEADER || e === Qe.FIRST_PAGE_HEADER || e === Qe.EVEN_PAGE_HEADER, c = r.insertOp([a ? "headers" : "footers", i], {
|
|
7160
7160
|
[a ? "headerId" : "footerId"]: i,
|
|
7161
|
-
body:
|
|
7161
|
+
body: Ri()
|
|
7162
7162
|
});
|
|
7163
7163
|
o.push(c);
|
|
7164
7164
|
const d = ge(s), l = r.insertOp([a ? "footers" : "headers", d], {
|
|
7165
7165
|
[a ? "footerId" : "headerId"]: d,
|
|
7166
|
-
body:
|
|
7166
|
+
body: Ri()
|
|
7167
7167
|
});
|
|
7168
7168
|
o.push(l);
|
|
7169
7169
|
let A = "defaultHeaderId", h = "defaultFooterId";
|
|
@@ -7205,7 +7205,7 @@ const eo = "doc.command.core-header-footer", uc = {
|
|
|
7205
7205
|
// eslint-disable-next-line max-lines-per-function
|
|
7206
7206
|
handler: async (n, e) => {
|
|
7207
7207
|
var v;
|
|
7208
|
-
const t = n.get(T), o = n.get(L), r = n.get(
|
|
7208
|
+
const t = n.get(T), o = n.get(L), r = n.get(fe), { unitId: s, segmentId: i, createType: a, headerFooterProps: c } = e, d = (v = r.getRenderById(s)) == null ? void 0 : v.with(de), l = o.getUniverDocInstance(s), A = d == null ? void 0 : d.getViewModel();
|
|
7209
7209
|
if (l == null || A == null)
|
|
7210
7210
|
return !1;
|
|
7211
7211
|
const h = A.getEditArea(), { documentStyle: u } = l.getSnapshot(), g = (c == null ? void 0 : c.marginFooter) != null || (c == null ? void 0 : c.marginHeader) != null, f = [{
|
|
@@ -7223,19 +7223,19 @@ const eo = "doc.command.core-header-footer", uc = {
|
|
|
7223
7223
|
};
|
|
7224
7224
|
g && (p.params.noNeedSetTextRange = !0);
|
|
7225
7225
|
const m = W.getInstance(), I = [];
|
|
7226
|
-
return a != null &&
|
|
7227
|
-
const E = c[
|
|
7228
|
-
if (E ===
|
|
7226
|
+
return a != null && tr(i, a, u, I), c != null && Object.keys(c).forEach((R) => {
|
|
7227
|
+
const E = c[R], b = u[R];
|
|
7228
|
+
if (E === b)
|
|
7229
7229
|
return;
|
|
7230
7230
|
let y;
|
|
7231
|
-
if (
|
|
7231
|
+
if (b === void 0 ? y = m.insertOp(["documentStyle", R], E) : y = m.replaceOp(["documentStyle", R], b, E), I.push(y), R === "useFirstPageHeaderFooter" && E === z.TRUE && !u.firstPageHeaderId) {
|
|
7232
7232
|
const C = h === ve.HEADER ? Qe.FIRST_PAGE_HEADER : Qe.FIRST_PAGE_FOOTER;
|
|
7233
|
-
|
|
7234
|
-
} else if (
|
|
7233
|
+
tr(i, C, u, I);
|
|
7234
|
+
} else if (R === "evenAndOddHeaders" && E === z.TRUE && !u.evenPageHeaderId) {
|
|
7235
7235
|
const C = h === ve.HEADER ? Qe.EVEN_PAGE_HEADER : Qe.EVEN_PAGE_FOOTER;
|
|
7236
|
-
|
|
7236
|
+
tr(i, C, u, I);
|
|
7237
7237
|
}
|
|
7238
|
-
}), I.length === 0 ? !1 : (p.params.actions = I.reduce((
|
|
7238
|
+
}), I.length === 0 ? !1 : (p.params.actions = I.reduce((R, E) => W.compose(R, E), null), !!t.syncExecuteCommand(p.id, p.params));
|
|
7239
7239
|
}
|
|
7240
7240
|
}, Bs = {
|
|
7241
7241
|
id: "doc.command.open-header-footer-panel",
|
|
@@ -7246,10 +7246,10 @@ const eo = "doc.command.core-header-footer", uc = {
|
|
|
7246
7246
|
type: D.COMMAND,
|
|
7247
7247
|
handler: async (n, e) => {
|
|
7248
7248
|
var g;
|
|
7249
|
-
const t = n.get(T), o = n.get(
|
|
7249
|
+
const t = n.get(T), o = n.get(fe), r = n.get(Y), s = n.get(L), { unitId: i } = e, a = o.getRenderById(i);
|
|
7250
7250
|
if (a == null)
|
|
7251
7251
|
return !1;
|
|
7252
|
-
const { scene: c } = a, d = c.getTransformerByCreate(), l = a.with(de), A = a.with(
|
|
7252
|
+
const { scene: c } = a, d = c.getTransformerByCreate(), l = a.with(de), A = a.with(Re), h = l == null ? void 0 : l.getSkeleton(), u = l == null ? void 0 : l.getViewModel();
|
|
7253
7253
|
return u == null || h == null ? !1 : (r.replaceDocRanges([]), d.clearSelectedObjects(), A.setSegment(""), A.setSegmentPage(-1), u.setEditArea(ve.BODY), h.calculate(), (g = a.mainComponent) == null || g.makeDirty(!0), queueMicrotask(() => {
|
|
7254
7254
|
const f = s.getUnit(i), p = f == null ? void 0 : f.getSnapshot();
|
|
7255
7255
|
if (p == null)
|
|
@@ -7348,8 +7348,8 @@ const eo = "doc.command.core-header-footer", uc = {
|
|
|
7348
7348
|
options: ou
|
|
7349
7349
|
}
|
|
7350
7350
|
), fc = `${hc}_ORDER_LIST_TYPE_COMPONENT`, pc = `${hc}_BULLET_LIST_TYPE_COMPONENT`, su = (n) => {
|
|
7351
|
-
const t = Object.keys(
|
|
7352
|
-
const { width: r, height: s } =
|
|
7351
|
+
const t = Object.keys(ar).find((o) => {
|
|
7352
|
+
const { width: r, height: s } = ar[o];
|
|
7353
7353
|
return n.width === r && n.height === s;
|
|
7354
7354
|
});
|
|
7355
7355
|
return t != null ? t : "A4";
|
|
@@ -7460,7 +7460,7 @@ function iu(n) {
|
|
|
7460
7460
|
] })
|
|
7461
7461
|
] });
|
|
7462
7462
|
}
|
|
7463
|
-
const
|
|
7463
|
+
const Rr = "docs.component.page-setting", mc = {
|
|
7464
7464
|
id: "docs.command.page-setup",
|
|
7465
7465
|
type: D.COMMAND,
|
|
7466
7466
|
// eslint-disable-next-line complexity, max-lines-per-function
|
|
@@ -7526,19 +7526,19 @@ const Cr = "docs.component.page-setting", mc = {
|
|
|
7526
7526
|
textRanges: void 0
|
|
7527
7527
|
}
|
|
7528
7528
|
};
|
|
7529
|
-
return v.params.actions = S.reduce((E,
|
|
7529
|
+
return v.params.actions = S.reduce((E, b) => W.compose(E, b), null), !!o.syncExecuteCommand(v.id, v.params);
|
|
7530
7530
|
}
|
|
7531
7531
|
}, _s = {
|
|
7532
7532
|
id: "docs.operation.open-page-setting",
|
|
7533
7533
|
type: D.OPERATION,
|
|
7534
7534
|
handler: (n) => {
|
|
7535
7535
|
const e = n.get(ca), t = n.get(T), o = n.get(Ke), r = e.open({
|
|
7536
|
-
id:
|
|
7536
|
+
id: Rr,
|
|
7537
7537
|
title: {
|
|
7538
7538
|
label: o.t("page-settings.document-setting")
|
|
7539
7539
|
},
|
|
7540
7540
|
children: {
|
|
7541
|
-
label:
|
|
7541
|
+
label: Rr
|
|
7542
7542
|
},
|
|
7543
7543
|
width: 528,
|
|
7544
7544
|
onClose: () => {
|
|
@@ -7546,7 +7546,7 @@ const Cr = "docs.component.page-setting", mc = {
|
|
|
7546
7546
|
},
|
|
7547
7547
|
onConfirm: (s) => {
|
|
7548
7548
|
if (r.dispose(), !s) return;
|
|
7549
|
-
const i =
|
|
7549
|
+
const i = ar[s.paperSize];
|
|
7550
7550
|
t.executeCommand(mc.id, {
|
|
7551
7551
|
pageOrient: s.orientation,
|
|
7552
7552
|
marginTop: s.margins.top,
|
|
@@ -7563,7 +7563,7 @@ const Cr = "docs.component.page-setting", mc = {
|
|
|
7563
7563
|
}
|
|
7564
7564
|
};
|
|
7565
7565
|
function au(n) {
|
|
7566
|
-
const e = n.get(L), t = n.get(
|
|
7566
|
+
const e = n.get(L), t = n.get(fe);
|
|
7567
7567
|
return new Ie((o) => {
|
|
7568
7568
|
const r = e.focused$.subscribe((s) => {
|
|
7569
7569
|
if (s == null || e.getUnitType(s) !== _.UNIVER_DOC)
|
|
@@ -7687,7 +7687,7 @@ function du(n) {
|
|
|
7687
7687
|
t.next(i === z.TRUE);
|
|
7688
7688
|
}, r = e.onCommandExecuted((s) => {
|
|
7689
7689
|
const i = s.id;
|
|
7690
|
-
(i === Le.id || i ===
|
|
7690
|
+
(i === Le.id || i === Rt.id) && o();
|
|
7691
7691
|
});
|
|
7692
7692
|
return o(), r.dispose;
|
|
7693
7693
|
}),
|
|
@@ -7715,7 +7715,7 @@ function Au(n) {
|
|
|
7715
7715
|
t.next(i === z.TRUE);
|
|
7716
7716
|
}, r = e.onCommandExecuted((s) => {
|
|
7717
7717
|
const i = s.id;
|
|
7718
|
-
(i === Le.id || i ===
|
|
7718
|
+
(i === Le.id || i === Rt.id) && o();
|
|
7719
7719
|
});
|
|
7720
7720
|
return o(), r.dispose;
|
|
7721
7721
|
}),
|
|
@@ -7743,7 +7743,7 @@ function uu(n) {
|
|
|
7743
7743
|
t.next((i == null ? void 0 : i.s) === z.TRUE);
|
|
7744
7744
|
}, r = e.onCommandExecuted((s) => {
|
|
7745
7745
|
const i = s.id;
|
|
7746
|
-
(i === Le.id || i ===
|
|
7746
|
+
(i === Le.id || i === Rt.id) && o();
|
|
7747
7747
|
});
|
|
7748
7748
|
return o(), r.dispose;
|
|
7749
7749
|
}),
|
|
@@ -7771,7 +7771,7 @@ function hu(n) {
|
|
|
7771
7771
|
t.next((i == null ? void 0 : i.s) === z.TRUE);
|
|
7772
7772
|
}, r = e.onCommandExecuted((s) => {
|
|
7773
7773
|
const i = s.id;
|
|
7774
|
-
(i === Le.id || i ===
|
|
7774
|
+
(i === Le.id || i === Rt.id) && o();
|
|
7775
7775
|
});
|
|
7776
7776
|
return o(), r.dispose;
|
|
7777
7777
|
}),
|
|
@@ -7782,7 +7782,7 @@ function hu(n) {
|
|
|
7782
7782
|
function gu(n) {
|
|
7783
7783
|
const e = n.get(T);
|
|
7784
7784
|
return {
|
|
7785
|
-
id:
|
|
7785
|
+
id: Ct.id,
|
|
7786
7786
|
type: Z.BUTTON,
|
|
7787
7787
|
icon: "SubscriptIcon",
|
|
7788
7788
|
tooltip: "toolbar.subscript",
|
|
@@ -7798,7 +7798,7 @@ function gu(n) {
|
|
|
7798
7798
|
t.next(i === Ve.SUBSCRIPT);
|
|
7799
7799
|
}, r = e.onCommandExecuted((s) => {
|
|
7800
7800
|
const i = s.id;
|
|
7801
|
-
(i === Le.id || i ===
|
|
7801
|
+
(i === Le.id || i === Rt.id) && o();
|
|
7802
7802
|
});
|
|
7803
7803
|
return o(), r.dispose;
|
|
7804
7804
|
}),
|
|
@@ -7825,7 +7825,7 @@ function fu(n) {
|
|
|
7825
7825
|
t.next(i === Ve.SUPERSCRIPT);
|
|
7826
7826
|
}, r = e.onCommandExecuted((s) => {
|
|
7827
7827
|
const i = s.id;
|
|
7828
|
-
(i === Le.id || i ===
|
|
7828
|
+
(i === Le.id || i === Rt.id) && o();
|
|
7829
7829
|
});
|
|
7830
7830
|
return o(), r.dispose;
|
|
7831
7831
|
}),
|
|
@@ -7996,7 +7996,7 @@ function Cu(n) {
|
|
|
7996
7996
|
hidden$: Nn(se(n, _.UNIVER_DOC, void 0, ot), au(n), (e, t) => e || t)
|
|
7997
7997
|
};
|
|
7998
7998
|
}
|
|
7999
|
-
function
|
|
7999
|
+
function Ru(n) {
|
|
8000
8000
|
return {
|
|
8001
8001
|
id: Os.id,
|
|
8002
8002
|
title: "toolbar.table.insert",
|
|
@@ -8004,10 +8004,10 @@ function bu(n) {
|
|
|
8004
8004
|
hidden$: se(n, _.UNIVER_DOC)
|
|
8005
8005
|
};
|
|
8006
8006
|
}
|
|
8007
|
-
function
|
|
8007
|
+
function bu(n) {
|
|
8008
8008
|
const e = n.get(T);
|
|
8009
8009
|
return {
|
|
8010
|
-
id:
|
|
8010
|
+
id: Qo.id,
|
|
8011
8011
|
type: Z.BUTTON,
|
|
8012
8012
|
icon: "LeftJustifyingIcon",
|
|
8013
8013
|
tooltip: "toolbar.alignLeft",
|
|
@@ -8032,7 +8032,7 @@ function Ru(n) {
|
|
|
8032
8032
|
function yu(n) {
|
|
8033
8033
|
const e = n.get(T);
|
|
8034
8034
|
return {
|
|
8035
|
-
id:
|
|
8035
|
+
id: Uo.id,
|
|
8036
8036
|
type: Z.BUTTON,
|
|
8037
8037
|
icon: "HorizontallyIcon",
|
|
8038
8038
|
tooltip: "toolbar.alignCenter",
|
|
@@ -8057,7 +8057,7 @@ function yu(n) {
|
|
|
8057
8057
|
function xu(n) {
|
|
8058
8058
|
const e = n.get(T);
|
|
8059
8059
|
return {
|
|
8060
|
-
id:
|
|
8060
|
+
id: Fo.id,
|
|
8061
8061
|
type: Z.BUTTON,
|
|
8062
8062
|
icon: "RightJustifyingIcon",
|
|
8063
8063
|
tooltip: "toolbar.alignRight",
|
|
@@ -8082,7 +8082,7 @@ function xu(n) {
|
|
|
8082
8082
|
function Ou(n) {
|
|
8083
8083
|
const e = n.get(T);
|
|
8084
8084
|
return {
|
|
8085
|
-
id:
|
|
8085
|
+
id: Ho.id,
|
|
8086
8086
|
type: Z.BUTTON,
|
|
8087
8087
|
icon: "AlignTextBothIcon",
|
|
8088
8088
|
tooltip: "toolbar.alignJustify",
|
|
@@ -8106,7 +8106,7 @@ function Ou(n) {
|
|
|
8106
8106
|
}
|
|
8107
8107
|
function Tu(n) {
|
|
8108
8108
|
return {
|
|
8109
|
-
id:
|
|
8109
|
+
id: wo.id,
|
|
8110
8110
|
type: Z.BUTTON,
|
|
8111
8111
|
icon: "ReduceIcon",
|
|
8112
8112
|
tooltip: "toolbar.horizontalLine",
|
|
@@ -8142,7 +8142,7 @@ const Bn = (n) => new Ie((e) => {
|
|
|
8142
8142
|
s.unsubscribe(), r == null || r.unsubscribe();
|
|
8143
8143
|
};
|
|
8144
8144
|
});
|
|
8145
|
-
function
|
|
8145
|
+
function bi(n) {
|
|
8146
8146
|
return {
|
|
8147
8147
|
id: Tn.id,
|
|
8148
8148
|
type: Z.BUTTON_SELECTOR,
|
|
@@ -8200,7 +8200,7 @@ function xi(n) {
|
|
|
8200
8200
|
function Bu(n) {
|
|
8201
8201
|
const e = n.get(T), t = n.get(L);
|
|
8202
8202
|
return {
|
|
8203
|
-
id:
|
|
8203
|
+
id: ko.id,
|
|
8204
8204
|
type: Z.BUTTON,
|
|
8205
8205
|
icon: "KeyboardIcon",
|
|
8206
8206
|
tooltip: "toolbar.documentFlavor",
|
|
@@ -8331,7 +8331,7 @@ const Pu = {
|
|
|
8331
8331
|
[K.TITLE]: { key: "TextTypeIcon", component: mn },
|
|
8332
8332
|
[K.SUBTITLE]: { key: "TextTypeIcon", component: mn },
|
|
8333
8333
|
[K.NAMED_STYLE_TYPE_UNSPECIFIED]: { key: "TextTypeIcon", component: mn }
|
|
8334
|
-
},
|
|
8334
|
+
}, yt = (n) => (e) => {
|
|
8335
8335
|
const t = e.get(T), o = e.get(sn), r = Ic[n];
|
|
8336
8336
|
return o.get(r.key) || o.register(r.key, r.component), {
|
|
8337
8337
|
id: Pu[n].id,
|
|
@@ -8357,9 +8357,9 @@ const Pu = {
|
|
|
8357
8357
|
return a(), c.dispose;
|
|
8358
8358
|
})
|
|
8359
8359
|
};
|
|
8360
|
-
}, wu =
|
|
8361
|
-
|
|
8362
|
-
|
|
8360
|
+
}, wu = yt(K.HEADING_1), Nu = yt(K.HEADING_2), Lu = yt(K.HEADING_3), Qu = yt(K.HEADING_4), Uu = yt(K.HEADING_5), Fu = yt(K.NORMAL_TEXT);
|
|
8361
|
+
yt(K.TITLE);
|
|
8362
|
+
yt(K.SUBTITLE);
|
|
8363
8363
|
const Hu = (n) => ({
|
|
8364
8364
|
id: os.id,
|
|
8365
8365
|
type: Z.BUTTON,
|
|
@@ -8444,19 +8444,19 @@ function Bi(n, e, t) {
|
|
|
8444
8444
|
y: d
|
|
8445
8445
|
};
|
|
8446
8446
|
}
|
|
8447
|
-
const
|
|
8447
|
+
const nr = (n, e) => {
|
|
8448
8448
|
const { scene: t, mainComponent: o, engine: r } = e, s = e.with(de).getSkeleton(), i = s.findNodePositionByCharIndex(n.startOffset, !0, n.segmentId, n.segmentPage), a = n.collapsed ? n.startOffset : n.endOffset - 1, c = s.findNodePositionByCharIndex(a, !0, n.segmentId, n.segmentPage), d = o;
|
|
8449
8449
|
if (!c || !i)
|
|
8450
8450
|
return;
|
|
8451
|
-
const l = d.getOffsetConfig(), { docsLeft: A, docsTop: h } = l, u = r.getCanvasElement(), g = u.getBoundingClientRect(), f = na(u.style.width), { top: p, left: m, width: I } = g, S = I / f, { scaleX: v, scaleY:
|
|
8452
|
-
return Es(
|
|
8451
|
+
const l = d.getOffsetConfig(), { docsLeft: A, docsTop: h } = l, u = r.getCanvasElement(), g = u.getBoundingClientRect(), f = na(u.style.width), { top: p, left: m, width: I } = g, S = I / f, { scaleX: v, scaleY: R } = t.getAncestorScale(), E = new mt(l, s), { borderBoxPointGroup: b } = E.getRangePointData(i, c);
|
|
8452
|
+
return Es(b).map((B) => vc(B, t)).map((B) => ({
|
|
8453
8453
|
left: (B.left + A * v) * S + m,
|
|
8454
8454
|
right: (B.right + A * v) * S + m,
|
|
8455
|
-
top: (B.top + h *
|
|
8456
|
-
bottom: (B.bottom + h *
|
|
8455
|
+
top: (B.top + h * R) * S + p,
|
|
8456
|
+
bottom: (B.bottom + h * R) * S + p
|
|
8457
8457
|
}));
|
|
8458
8458
|
};
|
|
8459
|
-
let Mn = class extends
|
|
8459
|
+
let Mn = class extends pe {
|
|
8460
8460
|
constructor(n, e, t, o) {
|
|
8461
8461
|
super(), this._globalPopupManagerService = n, this._renderManagerService = e, this._univerInstanceService = t, this._commandService = o;
|
|
8462
8462
|
}
|
|
@@ -8499,16 +8499,16 @@ let Mn = class extends fe {
|
|
|
8499
8499
|
}
|
|
8500
8500
|
_createRangePositionObserver(n, e) {
|
|
8501
8501
|
var i;
|
|
8502
|
-
const t = (i =
|
|
8502
|
+
const t = (i = nr(n, e)) != null ? i : [], o = new Fe(t), r = new Sn();
|
|
8503
8503
|
r.add(this._commandService.onCommandExecuted((a) => {
|
|
8504
8504
|
if ((a.id === nt.id || a.id === X.id) && a.params.unitId === e.unitId) {
|
|
8505
|
-
const d =
|
|
8505
|
+
const d = nr(n, e);
|
|
8506
8506
|
d && o.next(d);
|
|
8507
8507
|
}
|
|
8508
8508
|
}));
|
|
8509
8509
|
const s = e.scene.getViewport(je.VIEW_MAIN);
|
|
8510
8510
|
return s && r.add(s.onScrollAfter$.subscribeEvent(() => {
|
|
8511
|
-
const a =
|
|
8511
|
+
const a = nr(n, e);
|
|
8512
8512
|
a && o.next(a);
|
|
8513
8513
|
})), {
|
|
8514
8514
|
positions: t,
|
|
@@ -8598,7 +8598,7 @@ let Mn = class extends fe {
|
|
|
8598
8598
|
};
|
|
8599
8599
|
Mn = qu([
|
|
8600
8600
|
jn(0, j(wl)),
|
|
8601
|
-
jn(1,
|
|
8601
|
+
jn(1, fe),
|
|
8602
8602
|
jn(2, L),
|
|
8603
8603
|
jn(3, T)
|
|
8604
8604
|
], Mn);
|
|
@@ -8618,7 +8618,7 @@ const $u = (n, e, t, o) => {
|
|
|
8618
8618
|
const a = t.findNodePositionByCharIndex(i, !0, n.segmentId, o);
|
|
8619
8619
|
if (!a || !r)
|
|
8620
8620
|
return;
|
|
8621
|
-
const c = e.getOffsetConfig(), d = new
|
|
8621
|
+
const c = e.getOffsetConfig(), d = new mt(c, t), { borderBoxPointGroup: l } = d.getRangePointData(r, a);
|
|
8622
8622
|
return Es(l).map((m) => ({
|
|
8623
8623
|
top: m.top + c.docsTop - Oi,
|
|
8624
8624
|
bottom: m.bottom + c.docsTop + Oi,
|
|
@@ -8665,7 +8665,7 @@ const $u = (n, e, t, o) => {
|
|
|
8665
8665
|
const r = t.findPositionByGlyph(n, o);
|
|
8666
8666
|
if (!r)
|
|
8667
8667
|
return;
|
|
8668
|
-
const s = e.getOffsetConfig(), i = { ...r, isBack: !0 }, a = new
|
|
8668
|
+
const s = e.getOffsetConfig(), i = { ...r, isBack: !0 }, a = new mt(s, t), { borderBoxPointGroup: c } = a.getRangePointData(i, i), l = Es(c)[0];
|
|
8669
8669
|
return {
|
|
8670
8670
|
top: l.top + s.docsTop,
|
|
8671
8671
|
bottom: l.bottom + s.docsTop,
|
|
@@ -8673,20 +8673,20 @@ const $u = (n, e, t, o) => {
|
|
|
8673
8673
|
right: l.left + s.docsLeft + n.width
|
|
8674
8674
|
};
|
|
8675
8675
|
};
|
|
8676
|
-
function
|
|
8676
|
+
function Ot(n, e, t) {
|
|
8677
8677
|
const { left: o, right: r, top: s, bottom: i } = t;
|
|
8678
8678
|
return n >= o && n <= r && e >= s && e <= i;
|
|
8679
8679
|
}
|
|
8680
|
-
let wt = class extends
|
|
8680
|
+
let wt = class extends pe {
|
|
8681
8681
|
constructor(e, t) {
|
|
8682
8682
|
super();
|
|
8683
8683
|
O(this, "_hoverCustomRanges$", new Fe([]));
|
|
8684
8684
|
O(this, "hoverCustomRanges$", this._hoverCustomRanges$.pipe(Wt((e, t) => e.length === t.length && e.every((o, r) => t[r].range.rangeId === o.range.rangeId && t[r].segmentId === o.segmentId && t[r].segmentPageIndex === o.segmentPageIndex && t[r].range.startIndex === o.range.startIndex))));
|
|
8685
|
-
O(this, "_clickCustomRanges$", new
|
|
8685
|
+
O(this, "_clickCustomRanges$", new be());
|
|
8686
8686
|
O(this, "clickCustomRanges$", this._clickCustomRanges$.asObservable());
|
|
8687
|
-
O(this, "_hoverBullet$", new
|
|
8687
|
+
O(this, "_hoverBullet$", new be());
|
|
8688
8688
|
O(this, "hoverBullet$", this._hoverBullet$.pipe(Wt((e, t) => (e == null ? void 0 : e.paragraph.startIndex) === (t == null ? void 0 : t.paragraph.startIndex) && (e == null ? void 0 : e.segmentId) === (t == null ? void 0 : t.segmentId) && (e == null ? void 0 : e.segmentPageIndex) === (t == null ? void 0 : t.segmentPageIndex))));
|
|
8689
|
-
O(this, "_clickBullet$", new
|
|
8689
|
+
O(this, "_clickBullet$", new be());
|
|
8690
8690
|
O(this, "clickBullets$", this._clickBullet$.asObservable());
|
|
8691
8691
|
O(this, "_hoverParagraph$", new Fe(null));
|
|
8692
8692
|
O(this, "hoverParagraph$", this._hoverParagraph$.pipe(Wt((e, t) => (e == null ? void 0 : e.startIndex) === (t == null ? void 0 : t.startIndex) && (e == null ? void 0 : e.segmentId) === (t == null ? void 0 : t.segmentId) && (e == null ? void 0 : e.pageIndex) === (t == null ? void 0 : t.pageIndex))));
|
|
@@ -8694,10 +8694,10 @@ let wt = class extends fe {
|
|
|
8694
8694
|
O(this, "_hoverParagraphLeft$", new Fe(null));
|
|
8695
8695
|
O(this, "hoverParagraphLeft$", this._hoverParagraphLeft$.pipe(Wt((e, t) => (e == null ? void 0 : e.startIndex) === (t == null ? void 0 : t.startIndex) && (e == null ? void 0 : e.segmentId) === (t == null ? void 0 : t.segmentId) && (e == null ? void 0 : e.pageIndex) === (t == null ? void 0 : t.pageIndex))));
|
|
8696
8696
|
O(this, "hoverParagraphLeftRealTime$", this._hoverParagraphLeft$.asObservable());
|
|
8697
|
-
O(this, "_hoverTableCell$", new
|
|
8697
|
+
O(this, "_hoverTableCell$", new be());
|
|
8698
8698
|
O(this, "hoverTableCell$", this._hoverTableCell$.pipe(Wt((e, t) => (e == null ? void 0 : e.rowIndex) === (t == null ? void 0 : t.rowIndex) && (e == null ? void 0 : e.colIndex) === (t == null ? void 0 : t.colIndex) && (e == null ? void 0 : e.tableId) === (t == null ? void 0 : t.tableId) && (e == null ? void 0 : e.pageIndex) === (t == null ? void 0 : t.pageIndex))));
|
|
8699
8699
|
O(this, "hoverTableCellRealTime$", this._hoverTableCell$.asObservable());
|
|
8700
|
-
O(this, "_hoverTable$", new
|
|
8700
|
+
O(this, "_hoverTable$", new be());
|
|
8701
8701
|
O(this, "hoverTable$", this._hoverTable$.pipe(Wt((e, t) => (e == null ? void 0 : e.tableId) === (t == null ? void 0 : t.tableId) && (e == null ? void 0 : e.pageIndex) === (t == null ? void 0 : t.pageIndex))));
|
|
8702
8702
|
O(this, "hoverTableRealTime$", this._hoverTable$.asObservable());
|
|
8703
8703
|
O(this, "_customRangeDirty", !0);
|
|
@@ -8758,7 +8758,7 @@ let wt = class extends fe {
|
|
|
8758
8758
|
);
|
|
8759
8759
|
}
|
|
8760
8760
|
_initEvents() {
|
|
8761
|
-
this.disposeWithMe(Bt(this._context.scene.onPointerMove$).pipe(
|
|
8761
|
+
this.disposeWithMe(Bt(this._context.scene.onPointerMove$).pipe(bn(30)).subscribe((o) => {
|
|
8762
8762
|
if (o.buttons > 0) {
|
|
8763
8763
|
this._hoverBullet$.next(null), this._hoverCustomRanges$.next([]), this._hoverParagraph$.next(null), this._hoverParagraphLeft$.next(null), this._hoverTableCell$.next(null), this._hoverTable$.next(null);
|
|
8764
8764
|
return;
|
|
@@ -8821,7 +8821,7 @@ let wt = class extends fe {
|
|
|
8821
8821
|
_calcActiveRanges(e) {
|
|
8822
8822
|
this._buildCustomRangeBounds();
|
|
8823
8823
|
const { x: t, y: o } = e;
|
|
8824
|
-
return this._customRangeBounds.filter((s) => s.rects.some((i) =>
|
|
8824
|
+
return this._customRangeBounds.filter((s) => s.rects.some((i) => Ot(t, o, i))).map(
|
|
8825
8825
|
(s) => ({
|
|
8826
8826
|
segmentId: s.segmentId,
|
|
8827
8827
|
range: s.customRange,
|
|
@@ -8841,15 +8841,15 @@ let wt = class extends fe {
|
|
|
8841
8841
|
const I = [...m.sections];
|
|
8842
8842
|
if (m.skeTables) {
|
|
8843
8843
|
const S = Array.from(m.skeTables.values());
|
|
8844
|
-
I.push(...S.map((v) => v.rows.map((
|
|
8844
|
+
I.push(...S.map((v) => v.rows.map((R) => R.cells.map((E) => E.sections))).flat(4));
|
|
8845
8845
|
}
|
|
8846
8846
|
for (const S of I)
|
|
8847
8847
|
for (const v of S.columns)
|
|
8848
|
-
for (const
|
|
8849
|
-
if (
|
|
8850
|
-
const E = r.find((
|
|
8848
|
+
for (const R of v.lines)
|
|
8849
|
+
if (R.paragraphStart) {
|
|
8850
|
+
const E = r.find((b) => b.startIndex === R.paragraphIndex);
|
|
8851
8851
|
if (E) {
|
|
8852
|
-
const
|
|
8852
|
+
const b = R, y = (p = (f = (g = b == null ? void 0 : b.divides) == null ? void 0 : g[0]) == null ? void 0 : f.glyphGroup) == null ? void 0 : p[0];
|
|
8853
8853
|
if (!y)
|
|
8854
8854
|
continue;
|
|
8855
8855
|
const C = eh(y, this._documents, this._skeleton, t);
|
|
@@ -8881,7 +8881,7 @@ let wt = class extends fe {
|
|
|
8881
8881
|
_calcActiveBullet(e) {
|
|
8882
8882
|
this._buildBulletBounds();
|
|
8883
8883
|
const { x: t, y: o } = e;
|
|
8884
|
-
return this._bulletBounds.find((s) =>
|
|
8884
|
+
return this._bulletBounds.find((s) => Ot(t, o, s.rect));
|
|
8885
8885
|
}
|
|
8886
8886
|
// eslint-disable-next-line max-lines-per-function
|
|
8887
8887
|
_buildParagraphBoundsBySegment(e) {
|
|
@@ -8912,8 +8912,8 @@ let wt = class extends fe {
|
|
|
8912
8912
|
for (let h = 0; h < d.length; h++) {
|
|
8913
8913
|
const u = d[h], g = ((u.pageHeight === 1 / 0 ? 0 : u.pageHeight) + r.pageMarginTop) * h + u.marginTop + r.docsTop, f = u.marginLeft + r.docsLeft;
|
|
8914
8914
|
u.skeTables && Array.from(u.skeTables.values()).forEach((p) => {
|
|
8915
|
-
const m = p.left + f, I = p.top + g, S = m + p.width, v = I + p.height,
|
|
8916
|
-
this._tableBounds.set(
|
|
8915
|
+
const m = p.left + f, I = p.top + g, S = m + p.width, v = I + p.height, R = p.tableId;
|
|
8916
|
+
this._tableBounds.set(R, {
|
|
8917
8917
|
rect: {
|
|
8918
8918
|
left: m,
|
|
8919
8919
|
top: I,
|
|
@@ -8921,12 +8921,12 @@ let wt = class extends fe {
|
|
|
8921
8921
|
bottom: v
|
|
8922
8922
|
},
|
|
8923
8923
|
pageIndex: h,
|
|
8924
|
-
tableId:
|
|
8925
|
-
}), p.rows.forEach((E,
|
|
8924
|
+
tableId: R
|
|
8925
|
+
}), p.rows.forEach((E, b) => {
|
|
8926
8926
|
E.cells.forEach((y, C) => {
|
|
8927
8927
|
const B = ((u.pageHeight === 1 / 0 ? 0 : u.pageHeight) + r.pageMarginTop) * h + p.top + r.docsTop + u.marginTop + E.top + y.marginTop, x = p.left + r.docsLeft + u.marginLeft + y.left + y.marginLeft, M = Mi(y.sections, B, x, y.pageWidth - y.marginLeft - y.marginRight);
|
|
8928
|
-
let P = this._tableParagraphBounds.get(
|
|
8929
|
-
P || (P = [], this._tableParagraphBounds.set(
|
|
8928
|
+
let P = this._tableParagraphBounds.get(R);
|
|
8929
|
+
P || (P = [], this._tableParagraphBounds.set(R, P)), P.push(
|
|
8930
8930
|
...M.map((w) => ({
|
|
8931
8931
|
rect: w.rect,
|
|
8932
8932
|
paragraphStart: w.paragraphStart,
|
|
@@ -8934,14 +8934,14 @@ let wt = class extends fe {
|
|
|
8934
8934
|
startIndex: w.startIndex,
|
|
8935
8935
|
pageIndex: h,
|
|
8936
8936
|
segmentId: e,
|
|
8937
|
-
rowIndex:
|
|
8937
|
+
rowIndex: b,
|
|
8938
8938
|
colIndex: C,
|
|
8939
8939
|
firstLine: w.fisrtLine,
|
|
8940
|
-
tableId:
|
|
8940
|
+
tableId: R
|
|
8941
8941
|
}))
|
|
8942
8942
|
);
|
|
8943
|
-
let F = this._tableCellBounds.get(
|
|
8944
|
-
F || (F = [], this._tableCellBounds.set(
|
|
8943
|
+
let F = this._tableCellBounds.get(R);
|
|
8944
|
+
F || (F = [], this._tableCellBounds.set(R, F)), F.push({
|
|
8945
8945
|
rect: {
|
|
8946
8946
|
top: B,
|
|
8947
8947
|
left: x,
|
|
@@ -8949,9 +8949,9 @@ let wt = class extends fe {
|
|
|
8949
8949
|
bottom: B + y.pageHeight - y.marginBottom - y.marginTop
|
|
8950
8950
|
},
|
|
8951
8951
|
pageIndex: h,
|
|
8952
|
-
rowIndex:
|
|
8952
|
+
rowIndex: b,
|
|
8953
8953
|
colIndex: C,
|
|
8954
|
-
tableId:
|
|
8954
|
+
tableId: R
|
|
8955
8955
|
});
|
|
8956
8956
|
});
|
|
8957
8957
|
});
|
|
@@ -8989,12 +8989,12 @@ let wt = class extends fe {
|
|
|
8989
8989
|
_calcActiveParagraph(e) {
|
|
8990
8990
|
var i, a;
|
|
8991
8991
|
this._buildParagraphBounds();
|
|
8992
|
-
const { x: t, y: o } = e, r = Array.from(this._tableBounds.values()).find((c) =>
|
|
8992
|
+
const { x: t, y: o } = e, r = Array.from(this._tableBounds.values()).find((c) => Ot(t, o, c.rect));
|
|
8993
8993
|
if (this._hoverTable$.next(r), r) {
|
|
8994
|
-
const c = (i = this._tableCellBounds.get(r.tableId)) == null ? void 0 : i.find((A) =>
|
|
8994
|
+
const c = (i = this._tableCellBounds.get(r.tableId)) == null ? void 0 : i.find((A) => Ot(t, o, A.rect));
|
|
8995
8995
|
if (this._hoverTableCell$.next(c), !c)
|
|
8996
8996
|
return null;
|
|
8997
|
-
const d = (a = this._tableParagraphBounds.get(c.tableId)) == null ? void 0 : a.filter((A) => A.colIndex === c.colIndex && A.rowIndex === c.rowIndex), l = d == null ? void 0 : d.find((A) =>
|
|
8997
|
+
const d = (a = this._tableParagraphBounds.get(c.tableId)) == null ? void 0 : a.filter((A) => A.colIndex === c.colIndex && A.rowIndex === c.rowIndex), l = d == null ? void 0 : d.find((A) => Ot(t, o, A.rect));
|
|
8998
8998
|
return l && {
|
|
8999
8999
|
...l,
|
|
9000
9000
|
rects: [l.rect]
|
|
@@ -9003,7 +9003,7 @@ let wt = class extends fe {
|
|
|
9003
9003
|
let s;
|
|
9004
9004
|
for (const c of this._paragraphBounds) {
|
|
9005
9005
|
const d = c[1];
|
|
9006
|
-
if (d.rects.some((l) =>
|
|
9006
|
+
if (d.rects.some((l) => Ot(t, o, l))) {
|
|
9007
9007
|
s = d;
|
|
9008
9008
|
break;
|
|
9009
9009
|
}
|
|
@@ -9013,7 +9013,7 @@ let wt = class extends fe {
|
|
|
9013
9013
|
_calcActiveParagraphLeft(e) {
|
|
9014
9014
|
this._buildParagraphBounds();
|
|
9015
9015
|
const { x: t, y: o } = e;
|
|
9016
|
-
return this._paragraphLeftBounds.find((s) =>
|
|
9016
|
+
return this._paragraphLeftBounds.find((s) => Ot(t, o, s.rect));
|
|
9017
9017
|
}
|
|
9018
9018
|
get paragraphBounds() {
|
|
9019
9019
|
return this._buildParagraphBounds(), this._paragraphBounds;
|
|
@@ -9033,7 +9033,7 @@ const th = [
|
|
|
9033
9033
|
Ut.id,
|
|
9034
9034
|
Ft.id,
|
|
9035
9035
|
Ht.id,
|
|
9036
|
-
|
|
9036
|
+
Ct.id,
|
|
9037
9037
|
kt.id,
|
|
9038
9038
|
Dt.id,
|
|
9039
9039
|
Pt.id
|
|
@@ -9078,11 +9078,11 @@ const ih = [
|
|
|
9078
9078
|
V.CUSTOM_BLOCK,
|
|
9079
9079
|
V.PARAGRAPH
|
|
9080
9080
|
];
|
|
9081
|
-
let lo = class extends
|
|
9081
|
+
let lo = class extends pe {
|
|
9082
9082
|
constructor(e, t, o, r, s, i) {
|
|
9083
9083
|
super();
|
|
9084
9084
|
O(this, "_floatMenu", null);
|
|
9085
|
-
this._context = e, this._docSelectionManagerService = t, this._docCanvasPopManagerService = o, this._componentManager = r, this._univerInstanceService = s, this._docSelectionRenderService = i, !
|
|
9085
|
+
this._context = e, this._docSelectionManagerService = t, this._docCanvasPopManagerService = o, this._componentManager = r, this._univerInstanceService = s, this._docSelectionRenderService = i, !vt(this._context.unitId) && (this._registerFloatMenu(), this._initSelectionChange(), this.disposeWithMe(() => {
|
|
9086
9086
|
this._hideFloatMenu();
|
|
9087
9087
|
}));
|
|
9088
9088
|
}
|
|
@@ -9144,18 +9144,18 @@ lo = rh([
|
|
|
9144
9144
|
dn(2, j(Mn)),
|
|
9145
9145
|
dn(3, j(sn)),
|
|
9146
9146
|
dn(4, j(L)),
|
|
9147
|
-
dn(5, j(
|
|
9147
|
+
dn(5, j(Re))
|
|
9148
9148
|
], lo);
|
|
9149
9149
|
var ah = Object.getOwnPropertyDescriptor, ch = (n, e, t, o) => {
|
|
9150
9150
|
for (var r = o > 1 ? void 0 : o ? ah(e, t) : e, s = n.length - 1, i; s >= 0; s--)
|
|
9151
9151
|
(i = n[s]) && (r = i(r) || r);
|
|
9152
9152
|
return r;
|
|
9153
9153
|
}, An = (n, e) => (t, o) => e(t, o, n);
|
|
9154
|
-
let Ao = class extends
|
|
9154
|
+
let Ao = class extends pe {
|
|
9155
9155
|
constructor(e, t, o, r, s, i) {
|
|
9156
9156
|
super();
|
|
9157
9157
|
O(this, "_paragrahMenu", null);
|
|
9158
|
-
this._context = e, this._docSelectionManagerService = t, this._docEventManagerService = o, this._docPopupManagerService = r, this._docSkeletonManagerService = s, this._floatMenuService = i, !
|
|
9158
|
+
this._context = e, this._docSelectionManagerService = t, this._docEventManagerService = o, this._docPopupManagerService = r, this._docSkeletonManagerService = s, this._floatMenuService = i, !vt(this._context.unitId) && this._init();
|
|
9159
9159
|
}
|
|
9160
9160
|
get activeParagraph() {
|
|
9161
9161
|
var e;
|
|
@@ -9187,7 +9187,7 @@ let Ao = class extends fe {
|
|
|
9187
9187
|
this.hideParagraphMenu(!0);
|
|
9188
9188
|
};
|
|
9189
9189
|
this.disposeWithMe(
|
|
9190
|
-
Nn([this._docEventManagerService.hoverParagraphRealTime$, this._docEventManagerService.hoverParagraphLeft$]).pipe(
|
|
9190
|
+
Nn([this._docEventManagerService.hoverParagraphRealTime$, this._docEventManagerService.hoverParagraphLeft$]).pipe(bn(16)).subscribe(([o, r]) => {
|
|
9191
9191
|
const s = o != null ? o : r;
|
|
9192
9192
|
e(s);
|
|
9193
9193
|
})
|
|
@@ -9239,16 +9239,16 @@ Ao = ch([
|
|
|
9239
9239
|
An(5, j(lo))
|
|
9240
9240
|
], Ao);
|
|
9241
9241
|
const lh = ({ popup: n }) => {
|
|
9242
|
-
var E,
|
|
9243
|
-
const [e, t] = me(!1), o = ke(null), r = J(T), s = J(
|
|
9242
|
+
var E, b;
|
|
9243
|
+
const [e, t] = me(!1), o = ke(null), r = J(T), s = J(Oo), i = ke(null), a = ke(!1), c = J(fe), 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(wt), g = tt(u == null ? void 0 : u.hoverParagraph$), f = tt(u == null ? void 0 : u.hoverParagraphLeft$), p = (E = g != null ? g : f) == null ? void 0 : E.startIndex, m = _e(() => {
|
|
9244
9244
|
var y, C;
|
|
9245
9245
|
return (C = (y = A == null ? void 0 : A.getBody()) == null ? void 0 : y.paragraphs) == null ? void 0 : C.find((B) => B.startIndex === p);
|
|
9246
|
-
}, [A, g]), I = (
|
|
9246
|
+
}, [A, g]), I = (b = m == null ? void 0 : m.paragraphStyle) == null ? void 0 : b.namedStyleType, S = Ic[I != null ? I : K.NORMAL_TEXT], v = _e(() => new Fe({
|
|
9247
9247
|
left: 0,
|
|
9248
9248
|
right: 0,
|
|
9249
9249
|
top: 0,
|
|
9250
9250
|
bottom: 0
|
|
9251
|
-
}), []),
|
|
9251
|
+
}), []), R = () => {
|
|
9252
9252
|
t(!1), h == null || h.hideParagraphMenu(!0);
|
|
9253
9253
|
};
|
|
9254
9254
|
return /* @__PURE__ */ re(Zl, { children: [
|
|
@@ -9302,7 +9302,7 @@ const lh = ({ popup: n }) => {
|
|
|
9302
9302
|
maskZIndex: 100,
|
|
9303
9303
|
anchorRect$: v,
|
|
9304
9304
|
direction: "left",
|
|
9305
|
-
onMaskClick:
|
|
9305
|
+
onMaskClick: R,
|
|
9306
9306
|
children: /* @__PURE__ */ Q(
|
|
9307
9307
|
"section",
|
|
9308
9308
|
{
|
|
@@ -9321,7 +9321,7 @@ const lh = ({ popup: n }) => {
|
|
|
9321
9321
|
menuType: oo.PARAGRAPH,
|
|
9322
9322
|
onOptionSelect: (y) => {
|
|
9323
9323
|
const { label: C, commandId: B, value: x } = y;
|
|
9324
|
-
r && r.executeCommand(B != null ? B : C, { value: x }), s.focus(),
|
|
9324
|
+
r && r.executeCommand(B != null ? B : C, { value: x }), s.focus(), R();
|
|
9325
9325
|
}
|
|
9326
9326
|
}
|
|
9327
9327
|
)
|
|
@@ -9365,7 +9365,7 @@ const Ah = {
|
|
|
9365
9365
|
binding: q.X | te.SHIFT | te.CTRL_COMMAND,
|
|
9366
9366
|
preconditions: Se
|
|
9367
9367
|
}, mh = {
|
|
9368
|
-
id:
|
|
9368
|
+
id: Ct.id,
|
|
9369
9369
|
binding: q.COMMA | te.CTRL_COMMAND,
|
|
9370
9370
|
preconditions: Se
|
|
9371
9371
|
}, Eh = {
|
|
@@ -9373,30 +9373,30 @@ const Ah = {
|
|
|
9373
9373
|
binding: q.PERIOD | te.CTRL_COMMAND,
|
|
9374
9374
|
preconditions: Se
|
|
9375
9375
|
}, Ih = {
|
|
9376
|
-
id:
|
|
9376
|
+
id: Qo.id,
|
|
9377
9377
|
binding: q.L | te.CTRL_COMMAND | te.SHIFT,
|
|
9378
9378
|
preconditions: Se
|
|
9379
9379
|
}, Sh = {
|
|
9380
|
-
id:
|
|
9380
|
+
id: Fo.id,
|
|
9381
9381
|
binding: q.R | te.CTRL_COMMAND | te.SHIFT,
|
|
9382
9382
|
preconditions: Se
|
|
9383
9383
|
}, vh = {
|
|
9384
|
-
id:
|
|
9384
|
+
id: Uo.id,
|
|
9385
9385
|
binding: q.E | te.CTRL_COMMAND | te.SHIFT,
|
|
9386
9386
|
preconditions: Se
|
|
9387
9387
|
}, Ch = {
|
|
9388
|
-
id:
|
|
9388
|
+
id: Ho.id,
|
|
9389
9389
|
binding: q.J | te.CTRL_COMMAND | te.SHIFT,
|
|
9390
9390
|
preconditions: Se
|
|
9391
|
-
},
|
|
9391
|
+
}, Rh = {
|
|
9392
9392
|
id: Tn.id,
|
|
9393
9393
|
binding: q.Digit7 | te.CTRL_COMMAND | te.SHIFT,
|
|
9394
9394
|
preconditions: Se
|
|
9395
|
-
},
|
|
9395
|
+
}, bh = {
|
|
9396
9396
|
id: On.id,
|
|
9397
9397
|
binding: q.Digit8 | te.CTRL_COMMAND | te.SHIFT,
|
|
9398
9398
|
preconditions: Se
|
|
9399
|
-
},
|
|
9399
|
+
}, Vo = "docs-ui.config", Di = {
|
|
9400
9400
|
layout: {
|
|
9401
9401
|
docContainerConfig: sd,
|
|
9402
9402
|
toolbarConfig: rd
|
|
@@ -9439,7 +9439,7 @@ function Th(n) {
|
|
|
9439
9439
|
}
|
|
9440
9440
|
function Bh() {
|
|
9441
9441
|
var r, s, i;
|
|
9442
|
-
const n = J(L), e = ua(
|
|
9442
|
+
const n = J(L), e = ua(Vo), t = tt(() => n.getCurrentTypeOfUnit$(_.UNIVER_SHEET), void 0, void 0, []), o = (i = (s = (r = e == null ? void 0 : e.layout) == null ? void 0 : r.docContainerConfig) == null ? void 0 : s.footer) != null ? i : !0;
|
|
9443
9443
|
return t ? null : o && /* @__PURE__ */ re(
|
|
9444
9444
|
"div",
|
|
9445
9445
|
{
|
|
@@ -9460,7 +9460,7 @@ const Mh = "univer-overflow-hidden univer-font-[500] univer-truncate univer-h-[2
|
|
|
9460
9460
|
if (!I.current || I.current.findIndex((M) => M.id === v) === -1 || !m.current) return;
|
|
9461
9461
|
const E = document.getElementById(`univer-side-menu-${v}`);
|
|
9462
9462
|
if (!E) return;
|
|
9463
|
-
const
|
|
9463
|
+
const b = E.offsetTop, y = m.current.clientHeight, C = m.current.scrollHeight - y, B = Math.max(0, Math.min(b - y / 2 + E.clientHeight / 2, C));
|
|
9464
9464
|
(x = m.current) == null || x.scrollTo({
|
|
9465
9465
|
behavior: "smooth",
|
|
9466
9466
|
top: B
|
|
@@ -9573,18 +9573,18 @@ function Lh(n, e, t, o) {
|
|
|
9573
9573
|
const Pi = "__title";
|
|
9574
9574
|
function Qh() {
|
|
9575
9575
|
var e, t, o;
|
|
9576
|
-
const n = ua(
|
|
9576
|
+
const n = ua(Vo);
|
|
9577
9577
|
return (o = (t = (e = n == null ? void 0 : n.layout) == null ? void 0 : e.docContainerConfig) == null ? void 0 : t.sideMenu) == null || o ? /* @__PURE__ */ Q(Uh, {}) : null;
|
|
9578
9578
|
}
|
|
9579
9579
|
function Uh() {
|
|
9580
9580
|
var B, x, M, P, F, w, N, ee, $;
|
|
9581
|
-
const n = J(T), e = J(L), t = tt(_e(() => e.getCurrentTypeOfUnit$(_.UNIVER_DOC), [])), o = J(
|
|
9581
|
+
const n = J(T), e = J(L), t = tt(_e(() => e.getCurrentTypeOfUnit$(_.UNIVER_DOC), [])), o = J(fe), r = (x = (B = t == null ? void 0 : t.getBody()) == null ? void 0 : B.dataStream) != null ? x : "", [s, i] = me(0), [a, c] = me(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(wt), u = h == null ? void 0 : h.paragraphBounds, g = (F = (P = l == null ? void 0 : l.mainComponent) == null ? void 0 : P.left) != null ? F : 0, f = (w = l == null ? void 0 : l.engine.height) != null ? w : 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 = _e(() => {
|
|
9582
9582
|
const U = /* @__PURE__ */ new Map();
|
|
9583
9583
|
return m.forEach((H) => {
|
|
9584
9584
|
U.set(H.startIndex, H);
|
|
9585
9585
|
}), U;
|
|
9586
9586
|
}, [m]);
|
|
9587
|
-
tt(_e(() => l != null && l.engine.onTransformChange$ ? Bt(l == null ? void 0 : l.engine.onTransformChange$).pipe(
|
|
9587
|
+
tt(_e(() => l != null && l.engine.onTransformChange$ ? Bt(l == null ? void 0 : l.engine.onTransformChange$).pipe(bn(33)) : Yl(null), [l == null ? void 0 : l.engine.onTransformChange$]));
|
|
9588
9588
|
const S = g < 180 ? "float" : "side-bar", v = m == null ? void 0 : m.filter(
|
|
9589
9589
|
(U) => {
|
|
9590
9590
|
var H;
|
|
@@ -9601,7 +9601,7 @@ function Uh() {
|
|
|
9601
9601
|
level: H,
|
|
9602
9602
|
isTitle: ((ae = U.paragraphStyle) == null ? void 0 : ae.namedStyleType) === K.TITLE
|
|
9603
9603
|
};
|
|
9604
|
-
}).filter((U) => U == null ? void 0 : U.text),
|
|
9604
|
+
}).filter((U) => U == null ? void 0 : U.text), R = En((U) => {
|
|
9605
9605
|
const H = U.viewportScrollY, k = H + f / p, ne = Lh(u, I, H, k);
|
|
9606
9606
|
ne && c(ne);
|
|
9607
9607
|
}), E = v != null && v.find((U) => U.isTitle) ? v : [
|
|
@@ -9612,7 +9612,7 @@ function Uh() {
|
|
|
9612
9612
|
isTitle: !0
|
|
9613
9613
|
}] : [],
|
|
9614
9614
|
...v != null ? v : []
|
|
9615
|
-
].filter(Boolean), [
|
|
9615
|
+
].filter(Boolean), [b, y] = me(!0);
|
|
9616
9616
|
Ce(() => {
|
|
9617
9617
|
const U = kr(i, 100), H = n.onCommandExecuted((k) => {
|
|
9618
9618
|
k.id === X.id && k.params.unitId === (t == null ? void 0 : t.getUnitId()) && U((ie) => ie + 1);
|
|
@@ -9624,7 +9624,7 @@ function Uh() {
|
|
|
9624
9624
|
const U = l == null ? void 0 : l.scene.getViewport(je.VIEW_MAIN);
|
|
9625
9625
|
if (!U)
|
|
9626
9626
|
return;
|
|
9627
|
-
const H = Bt(U.onScrollAfter$).pipe(
|
|
9627
|
+
const H = Bt(U.onScrollAfter$).pipe(bn(33)).subscribe(R);
|
|
9628
9628
|
return () => {
|
|
9629
9629
|
H.unsubscribe();
|
|
9630
9630
|
};
|
|
@@ -9646,7 +9646,7 @@ function Uh() {
|
|
|
9646
9646
|
const ne = u == null ? void 0 : u.get(k.startIndex);
|
|
9647
9647
|
ne && (H.scrollToViewportPos({ viewportScrollY: ne.rect.top }), c(U.id));
|
|
9648
9648
|
});
|
|
9649
|
-
return !t ||
|
|
9649
|
+
return !t || vt(d) || !(E != null && E.length) ? null : /* @__PURE__ */ Q(
|
|
9650
9650
|
"div",
|
|
9651
9651
|
{
|
|
9652
9652
|
className: "univer-absolute univer-bottom-0 univer-left-0 univer-top-0 univer-z-[100] univer-w-[0px]",
|
|
@@ -9654,7 +9654,7 @@ function Uh() {
|
|
|
9654
9654
|
wh,
|
|
9655
9655
|
{
|
|
9656
9656
|
menus: E,
|
|
9657
|
-
open:
|
|
9657
|
+
open: b,
|
|
9658
9658
|
onOpenChange: y,
|
|
9659
9659
|
mode: S,
|
|
9660
9660
|
maxWidth: S === "float" ? void 0 : Math.floor(g),
|
|
@@ -9671,11 +9671,11 @@ const rt = {
|
|
|
9671
9671
|
id: "doc-paragraph-setting.command",
|
|
9672
9672
|
type: D.COMMAND,
|
|
9673
9673
|
handler: async (n, e) => {
|
|
9674
|
-
var S, v,
|
|
9674
|
+
var S, v, R, E, b;
|
|
9675
9675
|
const t = n.get(Y), o = n.get(L), r = n.get(T), s = o.getCurrentUnitForType(_.UNIVER_DOC), i = t.getDocRanges();
|
|
9676
9676
|
if (!s || i.length === 0 || !e)
|
|
9677
9677
|
return !1;
|
|
9678
|
-
const a = i[0].segmentId, c = s.getUnitId(), d = s.getSelfOrHeaderFooterModel(a), l = (v = (S = d.getBody()) == null ? void 0 : S.paragraphs) != null ? v : [], A = (E = (
|
|
9678
|
+
const a = i[0].segmentId, c = s.getUnitId(), d = s.getSelfOrHeaderFooterModel(a), l = (v = (S = d.getBody()) == null ? void 0 : S.paragraphs) != null ? v : [], A = (E = (R = d.getBody()) == null ? void 0 : R.dataStream) != null ? E : "", h = (b = ce.range.getParagraphsInRanges(i, l, A)) != null ? b : [], u = {
|
|
9679
9679
|
id: X.id,
|
|
9680
9680
|
params: {
|
|
9681
9681
|
unitId: c,
|
|
@@ -9790,7 +9790,7 @@ const rt = {
|
|
|
9790
9790
|
paragraph: { spaceBelow: { v: s } }
|
|
9791
9791
|
}))];
|
|
9792
9792
|
}, Kh = (n) => {
|
|
9793
|
-
const e = J(T), t = J(
|
|
9793
|
+
const e = J(T), t = J(fe), o = J(L), r = _e(() => {
|
|
9794
9794
|
var g;
|
|
9795
9795
|
const u = o.getCurrentUnitForType(_.UNIVER_DOC);
|
|
9796
9796
|
if (u)
|
|
@@ -9818,9 +9818,9 @@ const rt = {
|
|
|
9818
9818
|
};
|
|
9819
9819
|
return Ce(() => {
|
|
9820
9820
|
const u = s.pipe(
|
|
9821
|
-
|
|
9821
|
+
dr((g) => !!Object.keys(g).length),
|
|
9822
9822
|
ql(16),
|
|
9823
|
-
|
|
9823
|
+
dr((g) => !!g.length),
|
|
9824
9824
|
Xl((g) => g.reduce((f, p) => (Object.keys(p).forEach((m) => {
|
|
9825
9825
|
f[m] = p[m];
|
|
9826
9826
|
}), f), {}))
|
|
@@ -9832,7 +9832,7 @@ const rt = {
|
|
|
9832
9832
|
lineSpacing: [i, A],
|
|
9833
9833
|
spacingRule: [d, h]
|
|
9834
9834
|
};
|
|
9835
|
-
},
|
|
9835
|
+
}, Tt = (n) => {
|
|
9836
9836
|
const { value: e, onChange: t, className: o = "", min: r = 0, max: s = 100, step: i = 1 } = n, a = ke(null);
|
|
9837
9837
|
return /* @__PURE__ */ Q(
|
|
9838
9838
|
it,
|
|
@@ -9860,7 +9860,7 @@ function qh() {
|
|
|
9860
9860
|
{ label: n.t("toolbar.alignCenter"), value: String(Ue.CENTER), icon: /* @__PURE__ */ Q(ic, {}) },
|
|
9861
9861
|
{ label: n.t("toolbar.alignRight"), value: String(Ue.RIGHT), icon: /* @__PURE__ */ Q(lc, {}) },
|
|
9862
9862
|
{ label: n.t("toolbar.alignJustify"), value: String(Ue.JUSTIFIED), icon: /* @__PURE__ */ Q(qa, {}) }
|
|
9863
|
-
], []), t = Hh(), [o, r] = kh(t, e[0].value), [s, i] = Vh(t), [a, c] = Wh(t), [d, l] = jh(t), [A, h] = zh(t), [u, g] = Gh(t), [f, p] = Yh(t), { lineSpacing: [m, I], spacingRule: [S, v] } = Kh(t),
|
|
9863
|
+
], []), t = Hh(), [o, r] = kh(t, e[0].value), [s, i] = Vh(t), [a, c] = Wh(t), [d, l] = jh(t), [A, h] = zh(t), [u, g] = Gh(t), [f, p] = Yh(t), { lineSpacing: [m, I], spacingRule: [S, v] } = Kh(t), R = _e(() => S === Xt.AUTO ? { min: 1, max: 5, step: m < 2 ? 0.5 : 1 } : { min: 1, max: 100 }, [S, m]);
|
|
9864
9864
|
return /* @__PURE__ */ re("div", { children: [
|
|
9865
9865
|
/* @__PURE__ */ Q("div", { className: "univer-t-4 univer-text-sm univer-font-medium", children: n.t("doc.paragraphSetting.alignment") }),
|
|
9866
9866
|
/* @__PURE__ */ Q(
|
|
@@ -9886,28 +9886,28 @@ function qh() {
|
|
|
9886
9886
|
n.t("doc.paragraphSetting.left"),
|
|
9887
9887
|
"(px)"
|
|
9888
9888
|
] }),
|
|
9889
|
-
/* @__PURE__ */ Q(
|
|
9889
|
+
/* @__PURE__ */ Q(Tt, { className: "univer-mt-4", value: s, onChange: (E) => i(E != null ? E : 0) })
|
|
9890
9890
|
] }),
|
|
9891
9891
|
/* @__PURE__ */ re("div", { className: "univer-item-center univer-flex univer-justify-between", children: [
|
|
9892
9892
|
/* @__PURE__ */ re("div", { className: "univer-mt-3 univer-text-xs", children: [
|
|
9893
9893
|
n.t("doc.paragraphSetting.right"),
|
|
9894
9894
|
"(px)"
|
|
9895
9895
|
] }),
|
|
9896
|
-
/* @__PURE__ */ Q(
|
|
9896
|
+
/* @__PURE__ */ Q(Tt, { className: "univer-mt-4", value: a, onChange: (E) => c(E != null ? E : 0) })
|
|
9897
9897
|
] }),
|
|
9898
9898
|
/* @__PURE__ */ re("div", { className: "univer-item-center univer-flex univer-justify-between", children: [
|
|
9899
9899
|
/* @__PURE__ */ re("div", { className: "univer-mt-3 univer-text-xs", children: [
|
|
9900
9900
|
n.t("doc.paragraphSetting.firstLine"),
|
|
9901
9901
|
"(px)"
|
|
9902
9902
|
] }),
|
|
9903
|
-
/* @__PURE__ */ Q(
|
|
9903
|
+
/* @__PURE__ */ Q(Tt, { className: "univer-mt-4", value: d, onChange: (E) => l(E != null ? E : 0) })
|
|
9904
9904
|
] }),
|
|
9905
9905
|
/* @__PURE__ */ re("div", { className: "univer-item-center univer-flex univer-justify-between", children: [
|
|
9906
9906
|
/* @__PURE__ */ re("div", { className: "univer-mt-3 univer-text-xs", children: [
|
|
9907
9907
|
n.t("doc.paragraphSetting.hanging"),
|
|
9908
9908
|
"(px)"
|
|
9909
9909
|
] }),
|
|
9910
|
-
/* @__PURE__ */ Q(
|
|
9910
|
+
/* @__PURE__ */ Q(Tt, { className: "univer-mt-4", value: A, onChange: (E) => h(E != null ? E : 0) })
|
|
9911
9911
|
] })
|
|
9912
9912
|
] }),
|
|
9913
9913
|
/* @__PURE__ */ Q("div", { className: "univer-t-4 univer-text-sm univer-font-medium", children: n.t("doc.paragraphSetting.spacing") }),
|
|
@@ -9917,14 +9917,14 @@ function qh() {
|
|
|
9917
9917
|
n.t("doc.paragraphSetting.before"),
|
|
9918
9918
|
"(px)"
|
|
9919
9919
|
] }),
|
|
9920
|
-
/* @__PURE__ */ Q(
|
|
9920
|
+
/* @__PURE__ */ Q(Tt, { className: "univer-mt-4", value: u, onChange: (E) => g(E != null ? E : 0) })
|
|
9921
9921
|
] }),
|
|
9922
9922
|
/* @__PURE__ */ re("div", { className: "univer-item-center univer-flex univer-justify-between", children: [
|
|
9923
9923
|
/* @__PURE__ */ re("div", { className: "univer-mt-3 univer-text-xs", children: [
|
|
9924
9924
|
n.t("doc.paragraphSetting.after"),
|
|
9925
9925
|
"(px)"
|
|
9926
9926
|
] }),
|
|
9927
|
-
/* @__PURE__ */ Q(
|
|
9927
|
+
/* @__PURE__ */ Q(Tt, { className: "univer-mt-4", value: f, onChange: (E) => p(E != null ? E : 0) })
|
|
9928
9928
|
] }),
|
|
9929
9929
|
/* @__PURE__ */ re("div", { className: "item-center univer-flex univer-justify-between", children: [
|
|
9930
9930
|
/* @__PURE__ */ Q("div", { className: "univer-mt-3 univer-text-xs", children: n.t("doc.paragraphSetting.lineSpace") }),
|
|
@@ -9945,9 +9945,9 @@ function qh() {
|
|
|
9945
9945
|
}
|
|
9946
9946
|
),
|
|
9947
9947
|
/* @__PURE__ */ Q(
|
|
9948
|
-
|
|
9948
|
+
Tt,
|
|
9949
9949
|
{
|
|
9950
|
-
...
|
|
9950
|
+
...R,
|
|
9951
9951
|
value: m,
|
|
9952
9952
|
onChange: (E) => I(E != null ? E : 0)
|
|
9953
9953
|
}
|
|
@@ -9979,9 +9979,9 @@ var Jh = Object.getOwnPropertyDescriptor, $h = (n, e, t, o) => {
|
|
|
9979
9979
|
for (var r = o > 1 ? void 0 : o ? Jh(e, t) : e, s = n.length - 1, i; s >= 0; s--)
|
|
9980
9980
|
(i = n[s]) && (r = i(r) || r);
|
|
9981
9981
|
return r;
|
|
9982
|
-
},
|
|
9982
|
+
}, or = (n, e) => (t, o) => e(t, o, n);
|
|
9983
9983
|
const wi = "doc_ui_paragraph-setting-panel";
|
|
9984
|
-
let nn = class extends
|
|
9984
|
+
let nn = class extends pe {
|
|
9985
9985
|
constructor(e, t, o) {
|
|
9986
9986
|
super();
|
|
9987
9987
|
O(this, "_id");
|
|
@@ -10006,9 +10006,9 @@ let nn = class extends fe {
|
|
|
10006
10006
|
}
|
|
10007
10007
|
};
|
|
10008
10008
|
nn = $h([
|
|
10009
|
-
|
|
10010
|
-
|
|
10011
|
-
|
|
10009
|
+
or(0, T),
|
|
10010
|
+
or(1, j(sn)),
|
|
10011
|
+
or(2, j(la))
|
|
10012
10012
|
], nn);
|
|
10013
10013
|
const Ds = {
|
|
10014
10014
|
id: "sidebar.operation.doc-paragraph-setting-panel",
|
|
@@ -10084,7 +10084,7 @@ const dt = (n) => {
|
|
|
10084
10084
|
title: "rightClick.paste",
|
|
10085
10085
|
hidden$: se(n, _.UNIVER_DOC)
|
|
10086
10086
|
}), sg = (n) => ({
|
|
10087
|
-
id:
|
|
10087
|
+
id: Do.id,
|
|
10088
10088
|
type: Z.BUTTON,
|
|
10089
10089
|
icon: "PasteSpecialDoubleIcon",
|
|
10090
10090
|
title: "rightClick.delete",
|
|
@@ -10102,7 +10102,7 @@ function ig(n) {
|
|
|
10102
10102
|
}
|
|
10103
10103
|
function ag(n) {
|
|
10104
10104
|
return {
|
|
10105
|
-
id:
|
|
10105
|
+
id: Rs.id,
|
|
10106
10106
|
type: Z.BUTTON,
|
|
10107
10107
|
title: "table.insertRowAbove",
|
|
10108
10108
|
icon: "InsertRowAboveDoubleIcon",
|
|
@@ -10112,7 +10112,7 @@ function ag(n) {
|
|
|
10112
10112
|
}
|
|
10113
10113
|
function cg(n) {
|
|
10114
10114
|
return {
|
|
10115
|
-
id:
|
|
10115
|
+
id: bs.id,
|
|
10116
10116
|
type: Z.BUTTON,
|
|
10117
10117
|
title: "table.insertRowBelow",
|
|
10118
10118
|
icon: "InsertRowBelowDoubleIcon",
|
|
@@ -10140,10 +10140,10 @@ function dg(n) {
|
|
|
10140
10140
|
hidden$: se(n, _.UNIVER_DOC)
|
|
10141
10141
|
};
|
|
10142
10142
|
}
|
|
10143
|
-
const
|
|
10143
|
+
const Rc = "doc.menu.table-delete";
|
|
10144
10144
|
function Ag(n) {
|
|
10145
10145
|
return {
|
|
10146
|
-
id:
|
|
10146
|
+
id: Rc,
|
|
10147
10147
|
type: Z.SUBITEMS,
|
|
10148
10148
|
title: "table.delete",
|
|
10149
10149
|
icon: "ReduceDoubleIcon",
|
|
@@ -10198,7 +10198,7 @@ const fg = {
|
|
|
10198
10198
|
order: 3,
|
|
10199
10199
|
menuItemFactory: hu
|
|
10200
10200
|
},
|
|
10201
|
-
[
|
|
10201
|
+
[Ct.id]: {
|
|
10202
10202
|
order: 4,
|
|
10203
10203
|
menuItemFactory: gu
|
|
10204
10204
|
},
|
|
@@ -10232,29 +10232,29 @@ const fg = {
|
|
|
10232
10232
|
}
|
|
10233
10233
|
},
|
|
10234
10234
|
[Ys.LAYOUT]: {
|
|
10235
|
-
[
|
|
10235
|
+
[Qo.id]: {
|
|
10236
10236
|
order: 2,
|
|
10237
|
-
menuItemFactory:
|
|
10237
|
+
menuItemFactory: bu
|
|
10238
10238
|
},
|
|
10239
|
-
[
|
|
10239
|
+
[Uo.id]: {
|
|
10240
10240
|
order: 3,
|
|
10241
10241
|
menuItemFactory: yu
|
|
10242
10242
|
},
|
|
10243
|
-
[
|
|
10243
|
+
[Fo.id]: {
|
|
10244
10244
|
order: 4,
|
|
10245
10245
|
menuItemFactory: xu
|
|
10246
10246
|
},
|
|
10247
|
-
[
|
|
10247
|
+
[Ho.id]: {
|
|
10248
10248
|
order: 5,
|
|
10249
10249
|
menuItemFactory: Ou
|
|
10250
10250
|
},
|
|
10251
|
-
[
|
|
10251
|
+
[wo.id]: {
|
|
10252
10252
|
order: 6,
|
|
10253
10253
|
menuItemFactory: Tu
|
|
10254
10254
|
},
|
|
10255
10255
|
[Tn.id]: {
|
|
10256
10256
|
order: 7,
|
|
10257
|
-
menuItemFactory:
|
|
10257
|
+
menuItemFactory: bi
|
|
10258
10258
|
},
|
|
10259
10259
|
[On.id]: {
|
|
10260
10260
|
order: 8,
|
|
@@ -10268,7 +10268,7 @@ const fg = {
|
|
|
10268
10268
|
order: 10,
|
|
10269
10269
|
menuItemFactory: Su
|
|
10270
10270
|
},
|
|
10271
|
-
[
|
|
10271
|
+
[ko.id]: {
|
|
10272
10272
|
order: 11,
|
|
10273
10273
|
menuItemFactory: Bu
|
|
10274
10274
|
},
|
|
@@ -10283,7 +10283,7 @@ const fg = {
|
|
|
10283
10283
|
menuItemFactory: Cu,
|
|
10284
10284
|
[Os.id]: {
|
|
10285
10285
|
order: 0,
|
|
10286
|
-
menuItemFactory:
|
|
10286
|
+
menuItemFactory: Ru
|
|
10287
10287
|
}
|
|
10288
10288
|
}
|
|
10289
10289
|
},
|
|
@@ -10301,7 +10301,7 @@ const fg = {
|
|
|
10301
10301
|
order: 2,
|
|
10302
10302
|
menuItemFactory: rg
|
|
10303
10303
|
},
|
|
10304
|
-
[
|
|
10304
|
+
[Do.id]: {
|
|
10305
10305
|
order: 3,
|
|
10306
10306
|
menuItemFactory: sg
|
|
10307
10307
|
}
|
|
@@ -10314,11 +10314,11 @@ const fg = {
|
|
|
10314
10314
|
[Cc]: {
|
|
10315
10315
|
order: 1,
|
|
10316
10316
|
menuItemFactory: ig,
|
|
10317
|
-
[
|
|
10317
|
+
[Rs.id]: {
|
|
10318
10318
|
order: 1,
|
|
10319
10319
|
menuItemFactory: ag
|
|
10320
10320
|
},
|
|
10321
|
-
[
|
|
10321
|
+
[bs.id]: {
|
|
10322
10322
|
order: 2,
|
|
10323
10323
|
menuItemFactory: cg
|
|
10324
10324
|
},
|
|
@@ -10331,7 +10331,7 @@ const fg = {
|
|
|
10331
10331
|
menuItemFactory: dg
|
|
10332
10332
|
}
|
|
10333
10333
|
},
|
|
10334
|
-
[
|
|
10334
|
+
[Rc]: {
|
|
10335
10335
|
order: 2,
|
|
10336
10336
|
menuItemFactory: Ag,
|
|
10337
10337
|
[Is.id]: {
|
|
@@ -10377,7 +10377,7 @@ const fg = {
|
|
|
10377
10377
|
},
|
|
10378
10378
|
[Tn.id]: {
|
|
10379
10379
|
order: 6,
|
|
10380
|
-
menuItemFactory:
|
|
10380
|
+
menuItemFactory: bi
|
|
10381
10381
|
},
|
|
10382
10382
|
[On.id]: {
|
|
10383
10383
|
order: 7,
|
|
@@ -10431,7 +10431,7 @@ var pg = Object.getOwnPropertyDescriptor, mg = (n, e, t, o) => {
|
|
|
10431
10431
|
(i = n[s]) && (r = i(r) || r);
|
|
10432
10432
|
return r;
|
|
10433
10433
|
}, st = (n, e) => (t, o) => e(t, o, n);
|
|
10434
|
-
let uo = class extends
|
|
10434
|
+
let uo = class extends pe {
|
|
10435
10435
|
constructor(n, e, t, o, r, s, i, a, c) {
|
|
10436
10436
|
super(), this._injector = n, this._componentManager = e, this._commandService = t, this._layoutService = o, this._menuManagerService = r, this._uiPartsService = s, this._univerInstanceService = i, this._shortcutService = a, this._configService = c, this._init();
|
|
10437
10437
|
}
|
|
@@ -10443,7 +10443,7 @@ let uo = class extends fe {
|
|
|
10443
10443
|
["doc.paragraph.menu", lh],
|
|
10444
10444
|
["CutIcon", Za],
|
|
10445
10445
|
["DeleteIcon", Ja],
|
|
10446
|
-
[
|
|
10446
|
+
[Rr, iu],
|
|
10447
10447
|
["DocumentSettingIcon", $a]
|
|
10448
10448
|
].forEach(([n, e]) => {
|
|
10449
10449
|
this.disposeWithMe(
|
|
@@ -10469,8 +10469,8 @@ let uo = class extends fe {
|
|
|
10469
10469
|
Ch,
|
|
10470
10470
|
Sh,
|
|
10471
10471
|
Ih,
|
|
10472
|
-
bh,
|
|
10473
10472
|
Rh,
|
|
10473
|
+
bh,
|
|
10474
10474
|
Ah
|
|
10475
10475
|
].forEach((n) => {
|
|
10476
10476
|
this.disposeWithMe(this._shortcutService.registerShortcut(n));
|
|
@@ -10489,7 +10489,7 @@ let uo = class extends fe {
|
|
|
10489
10489
|
_initFocusHandler() {
|
|
10490
10490
|
this.disposeWithMe(
|
|
10491
10491
|
this._layoutService.registerFocusHandler(_.UNIVER_DOC, (n) => {
|
|
10492
|
-
this._injector.get(
|
|
10492
|
+
this._injector.get(fe).getRenderById(n).with(Re).focus();
|
|
10493
10493
|
})
|
|
10494
10494
|
);
|
|
10495
10495
|
}
|
|
@@ -10498,29 +10498,29 @@ uo = mg([
|
|
|
10498
10498
|
st(0, j(Pn)),
|
|
10499
10499
|
st(1, j(sn)),
|
|
10500
10500
|
st(2, T),
|
|
10501
|
-
st(3,
|
|
10501
|
+
st(3, Oo),
|
|
10502
10502
|
st(4, Aa),
|
|
10503
10503
|
st(5, kl),
|
|
10504
10504
|
st(6, L),
|
|
10505
|
-
st(7,
|
|
10505
|
+
st(7, To),
|
|
10506
10506
|
st(8, Vr)
|
|
10507
10507
|
], uo);
|
|
10508
10508
|
var Eg = Object.getOwnPropertyDescriptor, Ig = (n, e, t, o) => {
|
|
10509
10509
|
for (var r = o > 1 ? void 0 : o ? Eg(e, t) : e, s = n.length - 1, i; s >= 0; s--)
|
|
10510
10510
|
(i = n[s]) && (r = i(r) || r);
|
|
10511
10511
|
return r;
|
|
10512
|
-
},
|
|
10512
|
+
}, rr = (n, e) => (t, o) => e(t, o, n);
|
|
10513
10513
|
const Li = 1.5;
|
|
10514
|
-
let ho = class extends
|
|
10514
|
+
let ho = class extends St {
|
|
10515
10515
|
constructor(n, e, t, o) {
|
|
10516
10516
|
super(), this._context = n, this._textSelectionManagerService = e, this._editorService = t, this._docSkeletonManagerService = o, this._init();
|
|
10517
10517
|
}
|
|
10518
10518
|
_init() {
|
|
10519
|
-
this._textSelectionManagerService.textSelection$.pipe(
|
|
10519
|
+
this._textSelectionManagerService.textSelection$.pipe(ft(this.dispose$)).subscribe((n) => {
|
|
10520
10520
|
if (n == null)
|
|
10521
10521
|
return;
|
|
10522
10522
|
const { isEditing: e, unitId: t } = n;
|
|
10523
|
-
t !== this._context.unitId || !e || this._context.unitId !==
|
|
10523
|
+
t !== this._context.unitId || !e || this._context.unitId !== yo && this._scrollToSelection();
|
|
10524
10524
|
});
|
|
10525
10525
|
}
|
|
10526
10526
|
scrollToRange(n) {
|
|
@@ -10535,7 +10535,7 @@ let ho = class extends It {
|
|
|
10535
10535
|
const { unitId: e, scene: t, mainComponent: o } = this._context, r = this._docSkeletonManagerService.getSkeleton();
|
|
10536
10536
|
if (o == null || r == null)
|
|
10537
10537
|
return;
|
|
10538
|
-
const s = o.getOffsetConfig(), { docsLeft: i, docsTop: a } = s, c = new
|
|
10538
|
+
const s = o.getOffsetConfig(), { docsLeft: i, docsTop: a } = s, c = new mt(s, r), { contentBoxPointGroup: d } = c.getRangePointData(n, n), { left: l, top: A, height: h } = $n(d), u = l + i, g = A + a, f = t.getViewport(je.VIEW_MAIN), p = this._editorService.getEditor(e);
|
|
10539
10539
|
if (f == null)
|
|
10540
10540
|
return;
|
|
10541
10541
|
const {
|
|
@@ -10544,10 +10544,10 @@ let ho = class extends It {
|
|
|
10544
10544
|
right: S,
|
|
10545
10545
|
bottom: v
|
|
10546
10546
|
} = f.getBounding().viewBound;
|
|
10547
|
-
let
|
|
10548
|
-
const
|
|
10549
|
-
g < I ?
|
|
10550
|
-
const y = f.transViewportScroll2ScrollValue(E,
|
|
10547
|
+
let R = 0, E = 0;
|
|
10548
|
+
const b = p ? (C = p.params.backScrollOffset) != null ? C : 0 : 100;
|
|
10549
|
+
g < I ? R = g - I - b : g > v - h && (R = g - v + h + b), u < m ? E = u - m : u > S - Li && (E = u - S + Li);
|
|
10550
|
+
const y = f.transViewportScroll2ScrollValue(E, R);
|
|
10551
10551
|
f.scrollByBarDeltaValue(y);
|
|
10552
10552
|
}
|
|
10553
10553
|
// Let the selection show on the current screen.
|
|
@@ -10560,16 +10560,16 @@ let ho = class extends It {
|
|
|
10560
10560
|
}
|
|
10561
10561
|
};
|
|
10562
10562
|
ho = Ig([
|
|
10563
|
-
|
|
10564
|
-
|
|
10565
|
-
|
|
10563
|
+
rr(1, j(Y)),
|
|
10564
|
+
rr(2, Ye),
|
|
10565
|
+
rr(3, j(de))
|
|
10566
10566
|
], ho);
|
|
10567
10567
|
var Sg = Object.getOwnPropertyDescriptor, vg = (n, e, t, o) => {
|
|
10568
10568
|
for (var r = o > 1 ? void 0 : o ? Sg(e, t) : e, s = n.length - 1, i; s >= 0; s--)
|
|
10569
10569
|
(i = n[s]) && (r = i(r) || r);
|
|
10570
10570
|
return r;
|
|
10571
10571
|
}, zt = (n, e) => (t, o) => e(t, o, n);
|
|
10572
|
-
let br = class extends
|
|
10572
|
+
let br = class extends St {
|
|
10573
10573
|
constructor(n, e, t, o, r, s, i) {
|
|
10574
10574
|
super(), this._context = n, this._commandService = e, this._docSelectionRenderService = t, this._docSkeletonManagerService = o, this._editorService = r, this._renderManagerService = s, this._univerInstanceService = i, this._addNewRender(), this._initRenderRefresh(), this._initCommandListener();
|
|
10575
10575
|
}
|
|
@@ -10605,8 +10605,8 @@ let br = class extends It {
|
|
|
10605
10605
|
d *= a.deltaY > 0 ? -1 : 1, n.scaleX < 1 && (d /= 2), n.scaleX + d > 4 ? n.scale(4, 4) : n.scaleX + d < 0.1 ? n.scale(0.1, 0.1) : a.preventDefault();
|
|
10606
10606
|
} else
|
|
10607
10607
|
t.onMouseWheel(a, s);
|
|
10608
|
-
}), new
|
|
10609
|
-
new zs(n, [],
|
|
10608
|
+
}), new lr(t), n.addLayer(
|
|
10609
|
+
new zs(n, [], zo),
|
|
10610
10610
|
new zs(n, [], cd)
|
|
10611
10611
|
), this._addComponent();
|
|
10612
10612
|
const o = () => n.render();
|
|
@@ -10621,10 +10621,10 @@ let br = class extends It {
|
|
|
10621
10621
|
}, i = new gl(et.MAIN, void 0, s);
|
|
10622
10622
|
i.zIndex = Js;
|
|
10623
10623
|
const a = new fl(et.BACKGROUND, void 0, s);
|
|
10624
|
-
a.zIndex = Js, this._context.mainComponent = i, t.set(et.MAIN, i), t.set(et.BACKGROUND, a), n.addObjects([i],
|
|
10624
|
+
a.zIndex = Js, this._context.mainComponent = i, t.set(et.MAIN, i), t.set(et.BACKGROUND, a), n.addObjects([i], zo), n.addObjects([a], ad), this._editorService.getEditor(e.getUnitId()) == null && n.enableLayerCache(zo);
|
|
10625
10625
|
}
|
|
10626
10626
|
_initRenderRefresh() {
|
|
10627
|
-
this._docSkeletonManagerService.currentSkeletonBefore$.pipe(
|
|
10627
|
+
this._docSkeletonManagerService.currentSkeletonBefore$.pipe(ft(this.dispose$)).subscribe((n) => {
|
|
10628
10628
|
this._create(n);
|
|
10629
10629
|
});
|
|
10630
10630
|
}
|
|
@@ -10664,7 +10664,7 @@ let br = class extends It {
|
|
|
10664
10664
|
const S = Cg(p);
|
|
10665
10665
|
m = S.pageWidth, I = S.pageHeight;
|
|
10666
10666
|
}
|
|
10667
|
-
s.pageLayoutType ===
|
|
10667
|
+
s.pageLayoutType === Rn.VERTICAL ? (d += I, d += s.pageMarginTop, g === f - 1 && (d += s.pageMarginTop), c = Math.max(c, m)) : s.pageLayoutType === Rn.HORIZONTAL && (c += m, g !== f - 1 && (c += s.pageMarginLeft), d = Math.max(d, I));
|
|
10668
10668
|
}
|
|
10669
10669
|
s.resize(c, d), i.resize(c, d);
|
|
10670
10670
|
const h = this._editorService.getEditor(o);
|
|
@@ -10673,10 +10673,10 @@ let br = class extends It {
|
|
|
10673
10673
|
};
|
|
10674
10674
|
br = vg([
|
|
10675
10675
|
zt(1, T),
|
|
10676
|
-
zt(2, j(
|
|
10676
|
+
zt(2, j(Re)),
|
|
10677
10677
|
zt(3, j(de)),
|
|
10678
10678
|
zt(4, Ye),
|
|
10679
|
-
zt(5,
|
|
10679
|
+
zt(5, fe),
|
|
10680
10680
|
zt(6, L)
|
|
10681
10681
|
], br);
|
|
10682
10682
|
function Cg(n) {
|
|
@@ -10689,12 +10689,12 @@ function Cg(n) {
|
|
|
10689
10689
|
e = Math.max(e, d.left + d.width + o + r), t = Math.max(t, d.top + d.height + s + i);
|
|
10690
10690
|
return { pageWidth: e, pageHeight: t };
|
|
10691
10691
|
}
|
|
10692
|
-
var
|
|
10693
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
10692
|
+
var Rg = Object.getOwnPropertyDescriptor, bg = (n, e, t, o) => {
|
|
10693
|
+
for (var r = o > 1 ? void 0 : o ? Rg(e, t) : e, s = n.length - 1, i; s >= 0; s--)
|
|
10694
10694
|
(i = n[s]) && (r = i(r) || r);
|
|
10695
10695
|
return r;
|
|
10696
|
-
},
|
|
10697
|
-
let
|
|
10696
|
+
}, sr = (n, e) => (t, o) => e(t, o, n);
|
|
10697
|
+
let yr = class {
|
|
10698
10698
|
constructor(n, e, t) {
|
|
10699
10699
|
O(this, "_docContainer");
|
|
10700
10700
|
// 获取SheetContainer组件
|
|
@@ -10717,7 +10717,7 @@ let Rr = class {
|
|
|
10717
10717
|
getUIConfig() {
|
|
10718
10718
|
return {
|
|
10719
10719
|
injector: this._injector,
|
|
10720
|
-
config: this._configService.getConfig(
|
|
10720
|
+
config: this._configService.getConfig(Vo),
|
|
10721
10721
|
changeLocale: this.changeLocale,
|
|
10722
10722
|
getComponent: this.getComponent
|
|
10723
10723
|
};
|
|
@@ -10733,21 +10733,21 @@ let Rr = class {
|
|
|
10733
10733
|
return this._docContainer;
|
|
10734
10734
|
}
|
|
10735
10735
|
};
|
|
10736
|
-
|
|
10737
|
-
|
|
10738
|
-
|
|
10739
|
-
|
|
10740
|
-
],
|
|
10736
|
+
yr = bg([
|
|
10737
|
+
sr(0, j(Ke)),
|
|
10738
|
+
sr(1, j(Pn)),
|
|
10739
|
+
sr(2, Vr)
|
|
10740
|
+
], yr);
|
|
10741
10741
|
var yg = Object.getOwnPropertyDescriptor, xg = (n, e, t, o) => {
|
|
10742
10742
|
for (var r = o > 1 ? void 0 : o ? yg(e, t) : e, s = n.length - 1, i; s >= 0; s--)
|
|
10743
10743
|
(i = n[s]) && (r = i(r) || r);
|
|
10744
10744
|
return r;
|
|
10745
10745
|
}, Og = (n, e) => (t, o) => e(t, o, n);
|
|
10746
|
-
let go = class extends
|
|
10746
|
+
let go = class extends St {
|
|
10747
10747
|
constructor(e) {
|
|
10748
10748
|
super();
|
|
10749
10749
|
O(this, "_docContainerController");
|
|
10750
|
-
this._injector = e, this._docContainerController = this._injector.createInstance(
|
|
10750
|
+
this._injector = e, this._docContainerController = this._injector.createInstance(yr);
|
|
10751
10751
|
}
|
|
10752
10752
|
};
|
|
10753
10753
|
go = xg([
|
|
@@ -10758,7 +10758,7 @@ var Tg = Object.getOwnPropertyDescriptor, Bg = (n, e, t, o) => {
|
|
|
10758
10758
|
(i = n[s]) && (r = i(r) || r);
|
|
10759
10759
|
return r;
|
|
10760
10760
|
}, Qi = (n, e) => (t, o) => e(t, o, n);
|
|
10761
|
-
let fo = class extends
|
|
10761
|
+
let fo = class extends pe {
|
|
10762
10762
|
constructor(n, e) {
|
|
10763
10763
|
super(), this._docAutoFormatService = n, this._renderManagerService = e, this._initListTabAutoFormat(), this._initSpaceAutoFormat(), this._initDefaultEnterFormat(), this._initExitListAutoFormat();
|
|
10764
10764
|
}
|
|
@@ -10783,7 +10783,7 @@ let fo = class extends fe {
|
|
|
10783
10783
|
getMutations(n) {
|
|
10784
10784
|
const e = n.commandParams;
|
|
10785
10785
|
return [{
|
|
10786
|
-
id:
|
|
10786
|
+
id: gr.id,
|
|
10787
10787
|
params: {
|
|
10788
10788
|
type: e != null && e.shift ? Xn.decrease : Xn.increase
|
|
10789
10789
|
}
|
|
@@ -10814,20 +10814,20 @@ let fo = class extends fe {
|
|
|
10814
10814
|
_initSpaceAutoFormat() {
|
|
10815
10815
|
this.disposeWithMe(
|
|
10816
10816
|
this._docAutoFormatService.registerAutoFormat({
|
|
10817
|
-
id:
|
|
10817
|
+
id: Mo.id,
|
|
10818
10818
|
match: (n) => {
|
|
10819
10819
|
var s;
|
|
10820
10820
|
const { selection: e, paragraphs: t, unit: o } = n;
|
|
10821
10821
|
if (!e.collapsed || t.length !== 1 || !e.collapsed)
|
|
10822
10822
|
return !1;
|
|
10823
10823
|
const r = (s = o.getBody()) == null ? void 0 : s.dataStream.slice(t[0].paragraphStart, e.startOffset - 1);
|
|
10824
|
-
return !!(r && (Object.keys(
|
|
10824
|
+
return !!(r && (Object.keys(jo).includes(r) || Object.keys(qo).includes(r)));
|
|
10825
10825
|
},
|
|
10826
10826
|
getMutations(n) {
|
|
10827
10827
|
var s;
|
|
10828
10828
|
const { paragraphs: e, unit: t, selection: o } = n, r = (s = t.getBody()) == null ? void 0 : s.dataStream.slice(e[0].paragraphStart, o.startOffset - 1);
|
|
10829
|
-
if (r && Object.keys(
|
|
10830
|
-
const i =
|
|
10829
|
+
if (r && Object.keys(jo).includes(r)) {
|
|
10830
|
+
const i = jo[r];
|
|
10831
10831
|
return [{
|
|
10832
10832
|
id: La.id,
|
|
10833
10833
|
params: {
|
|
@@ -10836,8 +10836,8 @@ let fo = class extends fe {
|
|
|
10836
10836
|
}
|
|
10837
10837
|
}];
|
|
10838
10838
|
}
|
|
10839
|
-
if (r && Object.keys(
|
|
10840
|
-
const i =
|
|
10839
|
+
if (r && Object.keys(qo).includes(r)) {
|
|
10840
|
+
const i = qo[r];
|
|
10841
10841
|
return [{
|
|
10842
10842
|
id: Qa.id,
|
|
10843
10843
|
params: {
|
|
@@ -10861,7 +10861,7 @@ let fo = class extends fe {
|
|
|
10861
10861
|
getMutations: (n) => {
|
|
10862
10862
|
const e = n.paragraphs[0].bullet;
|
|
10863
10863
|
return e ? e.nestingLevel > 0 ? [{
|
|
10864
|
-
id:
|
|
10864
|
+
id: gr.id,
|
|
10865
10865
|
params: {
|
|
10866
10866
|
type: Xn.decrease
|
|
10867
10867
|
}
|
|
@@ -10892,7 +10892,7 @@ let fo = class extends fe {
|
|
|
10892
10892
|
};
|
|
10893
10893
|
fo = Bg([
|
|
10894
10894
|
Qi(0, j(_t)),
|
|
10895
|
-
Qi(1,
|
|
10895
|
+
Qi(1, fe)
|
|
10896
10896
|
], fo);
|
|
10897
10897
|
function Mg(n) {
|
|
10898
10898
|
return n.rows[0].cells[0].sections[0].columns[0].lines[0];
|
|
@@ -10927,7 +10927,7 @@ function Ui(n) {
|
|
|
10927
10927
|
lineAfterTable: o
|
|
10928
10928
|
};
|
|
10929
10929
|
}
|
|
10930
|
-
function
|
|
10930
|
+
function bc(n) {
|
|
10931
10931
|
return n.sections[0].columns[0].lines.length === 0;
|
|
10932
10932
|
}
|
|
10933
10933
|
function yc(n) {
|
|
@@ -10953,7 +10953,7 @@ function yc(n) {
|
|
|
10953
10953
|
}
|
|
10954
10954
|
if (s != null) {
|
|
10955
10955
|
const c = s.cells[r];
|
|
10956
|
-
return
|
|
10956
|
+
return bc(c) ? yc(c) : c;
|
|
10957
10957
|
}
|
|
10958
10958
|
}
|
|
10959
10959
|
function xc(n) {
|
|
@@ -10979,7 +10979,7 @@ function xc(n) {
|
|
|
10979
10979
|
}
|
|
10980
10980
|
if (o != null) {
|
|
10981
10981
|
const a = o.cells[r];
|
|
10982
|
-
return
|
|
10982
|
+
return bc(a) ? xc(a) : a;
|
|
10983
10983
|
}
|
|
10984
10984
|
}
|
|
10985
10985
|
function Pg(n, e) {
|
|
@@ -11004,7 +11004,7 @@ var Lg = Object.getOwnPropertyDescriptor, Qg = (n, e, t, o) => {
|
|
|
11004
11004
|
(i = n[s]) && (r = i(r) || r);
|
|
11005
11005
|
return r;
|
|
11006
11006
|
}, zn = (n, e) => (t, o) => e(t, o, n);
|
|
11007
|
-
let po = class extends
|
|
11007
|
+
let po = class extends pe {
|
|
11008
11008
|
constructor(e, t, o, r) {
|
|
11009
11009
|
super();
|
|
11010
11010
|
O(this, "_onInputSubscription");
|
|
@@ -11015,16 +11015,16 @@ let po = class extends fe {
|
|
|
11015
11015
|
super.dispose(), (e = this._onInputSubscription) == null || e.unsubscribe();
|
|
11016
11016
|
}
|
|
11017
11017
|
_commandExecutedListener() {
|
|
11018
|
-
const e = [
|
|
11018
|
+
const e = [Et.id, It.id];
|
|
11019
11019
|
this.disposeWithMe(
|
|
11020
11020
|
this._commandService.onCommandExecuted((t) => {
|
|
11021
11021
|
if (!e.includes(t.id))
|
|
11022
11022
|
return;
|
|
11023
11023
|
const o = t.params;
|
|
11024
11024
|
switch (t.id) {
|
|
11025
|
-
case mt.id:
|
|
11026
|
-
return this._handleMoveCursor(o.direction);
|
|
11027
11025
|
case Et.id:
|
|
11026
|
+
return this._handleMoveCursor(o.direction);
|
|
11027
|
+
case It.id:
|
|
11028
11028
|
return this._handleShiftMoveSelection(o.direction);
|
|
11029
11029
|
default:
|
|
11030
11030
|
throw new Error("Unknown command");
|
|
@@ -11034,7 +11034,7 @@ let po = class extends fe {
|
|
|
11034
11034
|
}
|
|
11035
11035
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
11036
11036
|
_handleShiftMoveSelection(e) {
|
|
11037
|
-
var S, v,
|
|
11037
|
+
var S, v, R;
|
|
11038
11038
|
const t = this._textSelectionManagerService.getActiveTextRange(), o = this._textSelectionManagerService.getTextRanges(), r = this._univerInstanceService.getCurrentUniverDocInstance();
|
|
11039
11039
|
if (r == null)
|
|
11040
11040
|
return;
|
|
@@ -11053,13 +11053,13 @@ let po = class extends fe {
|
|
|
11053
11053
|
segmentPage: f
|
|
11054
11054
|
} = t;
|
|
11055
11055
|
if (o.length > 1) {
|
|
11056
|
-
let E = Number.POSITIVE_INFINITY,
|
|
11056
|
+
let E = Number.POSITIVE_INFINITY, b = Number.NEGATIVE_INFINITY;
|
|
11057
11057
|
for (const y of o)
|
|
11058
|
-
E = Math.min(E, y.startOffset),
|
|
11058
|
+
E = Math.min(E, y.startOffset), b = Math.max(b, y.endOffset);
|
|
11059
11059
|
this._textSelectionManagerService.replaceTextRanges([
|
|
11060
11060
|
{
|
|
11061
|
-
startOffset: e === le.LEFT || e === le.UP ?
|
|
11062
|
-
endOffset: e === le.LEFT || e === le.UP ? E :
|
|
11061
|
+
startOffset: e === le.LEFT || e === le.UP ? b : E,
|
|
11062
|
+
endOffset: e === le.LEFT || e === le.UP ? E : b,
|
|
11063
11063
|
style: d
|
|
11064
11064
|
}
|
|
11065
11065
|
], !1);
|
|
@@ -11069,8 +11069,8 @@ let po = class extends fe {
|
|
|
11069
11069
|
let m = l || A === De.FORWARD ? c : a;
|
|
11070
11070
|
const I = (v = r.getSelfOrHeaderFooterModel(h).getBody().dataStream.length) != null ? v : Number.POSITIVE_INFINITY;
|
|
11071
11071
|
if (e === le.LEFT || e === le.RIGHT) {
|
|
11072
|
-
const E = s.findNodeByCharIndex(m - 1, h, f),
|
|
11073
|
-
m = e === le.RIGHT ? m +
|
|
11072
|
+
const E = s.findNodeByCharIndex(m - 1, h, f), b = s.findNodeByCharIndex(m, h, f);
|
|
11073
|
+
m = e === le.RIGHT ? m + b.count : m - ((R = E == null ? void 0 : E.count) != null ? R : 0), m = Math.min(I - 2, Math.max(0, m)), this._textSelectionManagerService.replaceTextRanges([
|
|
11074
11074
|
{
|
|
11075
11075
|
startOffset: p,
|
|
11076
11076
|
endOffset: m,
|
|
@@ -11078,7 +11078,7 @@ let po = class extends fe {
|
|
|
11078
11078
|
}
|
|
11079
11079
|
], !1), this._scrollToFocusNodePosition(r.getUnitId(), m);
|
|
11080
11080
|
} else {
|
|
11081
|
-
const E = s.findNodeByCharIndex(m, h, f),
|
|
11081
|
+
const E = s.findNodeByCharIndex(m, h, f), b = i.document.getOffsetConfig(), y = l ? u : A === De.FORWARD ? g : u, C = this._getTopOrBottomPosition(s, E, y, e === le.DOWN, !0);
|
|
11082
11082
|
if (C == null) {
|
|
11083
11083
|
const x = e === le.UP ? 0 : I - 2;
|
|
11084
11084
|
if (x === m)
|
|
@@ -11092,7 +11092,7 @@ let po = class extends fe {
|
|
|
11092
11092
|
], !1);
|
|
11093
11093
|
return;
|
|
11094
11094
|
}
|
|
11095
|
-
const B = new
|
|
11095
|
+
const B = new mt(b, s).getRangePointData(
|
|
11096
11096
|
C,
|
|
11097
11097
|
C
|
|
11098
11098
|
).cursorList[0];
|
|
@@ -11107,7 +11107,7 @@ let po = class extends fe {
|
|
|
11107
11107
|
}
|
|
11108
11108
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
11109
11109
|
_handleMoveCursor(e) {
|
|
11110
|
-
var I, S, v,
|
|
11110
|
+
var I, S, v, R;
|
|
11111
11111
|
const t = this._textSelectionManagerService.getActiveTextRange(), o = this._textSelectionManagerService.getTextRanges(), r = this._univerInstanceService.getCurrentUniverDocInstance();
|
|
11112
11112
|
if (r == null)
|
|
11113
11113
|
return !1;
|
|
@@ -11127,9 +11127,9 @@ let po = class extends fe {
|
|
|
11127
11127
|
E = e === le.LEFT ? C : B;
|
|
11128
11128
|
} else {
|
|
11129
11129
|
const C = s.findNodeByCharIndex(a - 1, A, g), B = s.findNodeByCharIndex(a, A, g), x = s.findNodeByCharIndex(a + 1, A, g);
|
|
11130
|
-
e === le.LEFT ? E = Math.max(0, a - ((
|
|
11130
|
+
e === le.LEFT ? E = Math.max(0, a - ((R = C == null ? void 0 : C.count) != null ? R : 1)) : E = Math.min(p - 2, c + B.count + ((x == null ? void 0 : x.streamType) === V.SECTION_BREAK ? 1 : 0));
|
|
11131
11131
|
}
|
|
11132
|
-
const
|
|
11132
|
+
const b = [
|
|
11133
11133
|
V.TABLE_START,
|
|
11134
11134
|
V.TABLE_END,
|
|
11135
11135
|
V.TABLE_ROW_START,
|
|
@@ -11139,10 +11139,10 @@ let po = class extends fe {
|
|
|
11139
11139
|
V.SECTION_BREAK
|
|
11140
11140
|
];
|
|
11141
11141
|
if (e === le.LEFT)
|
|
11142
|
-
for (;
|
|
11142
|
+
for (; b.includes(f.dataStream[E]); )
|
|
11143
11143
|
E--;
|
|
11144
11144
|
else
|
|
11145
|
-
for (;
|
|
11145
|
+
for (; b.includes(f.dataStream[E]); )
|
|
11146
11146
|
E++;
|
|
11147
11147
|
m.filter((C) => C.wholeEntity && C.startIndex < E && C.endIndex >= E).forEach((C) => {
|
|
11148
11148
|
e === le.LEFT ? E = Math.min(C.startIndex, E) : E = Math.max(C.endIndex + 1, E);
|
|
@@ -11154,9 +11154,9 @@ let po = class extends fe {
|
|
|
11154
11154
|
}
|
|
11155
11155
|
], !1), this._scrollToFocusNodePosition(r.getUnitId(), E);
|
|
11156
11156
|
} else {
|
|
11157
|
-
const E = s.findNodeByCharIndex(a, A, g),
|
|
11157
|
+
const E = s.findNodeByCharIndex(a, A, g), b = s.findNodeByCharIndex(c, A, g), y = i.document.getOffsetConfig(), C = this._getTopOrBottomPosition(
|
|
11158
11158
|
s,
|
|
11159
|
-
e === le.UP || l ? E :
|
|
11159
|
+
e === le.UP || l ? E : b,
|
|
11160
11160
|
e === le.UP || l ? h : u,
|
|
11161
11161
|
e === le.DOWN
|
|
11162
11162
|
);
|
|
@@ -11171,7 +11171,7 @@ let po = class extends fe {
|
|
|
11171
11171
|
], !1);
|
|
11172
11172
|
return;
|
|
11173
11173
|
}
|
|
11174
|
-
const B = new
|
|
11174
|
+
const B = new mt(y, s).getRangePointData(
|
|
11175
11175
|
C,
|
|
11176
11176
|
C
|
|
11177
11177
|
).cursorList[0];
|
|
@@ -11220,7 +11220,7 @@ let po = class extends fe {
|
|
|
11220
11220
|
}
|
|
11221
11221
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
11222
11222
|
_getNextOrPrevLine(e, t, o = !1) {
|
|
11223
|
-
var f, p, m, I, S, v,
|
|
11223
|
+
var f, p, m, I, S, v, R, E, b, y, C, B;
|
|
11224
11224
|
const r = e.parent, s = r == null ? void 0 : r.parent, i = s == null ? void 0 : s.parent, a = i == null ? void 0 : i.parent, c = a == null ? void 0 : a.parent;
|
|
11225
11225
|
if (r == null || s == null || i == null || a == null || c == null)
|
|
11226
11226
|
return;
|
|
@@ -11267,7 +11267,7 @@ let po = class extends fe {
|
|
|
11267
11267
|
if (t === !0)
|
|
11268
11268
|
l = (S = (I = c.sections[h - 1]) == null ? void 0 : I.columns[0]) == null ? void 0 : S.lines[0];
|
|
11269
11269
|
else {
|
|
11270
|
-
const x = (
|
|
11270
|
+
const x = (R = (v = c.sections) == null ? void 0 : v[h - 1]) == null ? void 0 : R.columns, M = x == null ? void 0 : x[x.length - 1], P = M == null ? void 0 : M.lines;
|
|
11271
11271
|
l = P == null ? void 0 : P[P.length - 1];
|
|
11272
11272
|
}
|
|
11273
11273
|
if (l != null)
|
|
@@ -11280,7 +11280,7 @@ let po = class extends fe {
|
|
|
11280
11280
|
const g = u.pages.indexOf(c);
|
|
11281
11281
|
if (g !== -1) {
|
|
11282
11282
|
if (t === !0)
|
|
11283
|
-
l = (y = (
|
|
11283
|
+
l = (y = (b = (E = u.pages[g + 1]) == null ? void 0 : E.sections[0]) == null ? void 0 : b.columns[0]) == null ? void 0 : y.lines[0];
|
|
11284
11284
|
else {
|
|
11285
11285
|
const x = (C = u.pages[g - 1]) == null ? void 0 : C.sections;
|
|
11286
11286
|
if (x == null)
|
|
@@ -11307,7 +11307,7 @@ let po = class extends fe {
|
|
|
11307
11307
|
};
|
|
11308
11308
|
po = Qg([
|
|
11309
11309
|
zn(0, L),
|
|
11310
|
-
zn(1,
|
|
11310
|
+
zn(1, fe),
|
|
11311
11311
|
zn(2, j(Y)),
|
|
11312
11312
|
zn(3, T)
|
|
11313
11313
|
], po);
|
|
@@ -11383,7 +11383,7 @@ var Fg = Object.getOwnPropertyDescriptor, Hg = (n, e, t, o) => {
|
|
|
11383
11383
|
(i = n[s]) && (r = i(r) || r);
|
|
11384
11384
|
return r;
|
|
11385
11385
|
}, Hi = (n, e) => (t, o) => e(t, o, n);
|
|
11386
|
-
let mo = class extends
|
|
11386
|
+
let mo = class extends pe {
|
|
11387
11387
|
constructor(n, e) {
|
|
11388
11388
|
super(), this._commandService = n, this._componentManager = e, this._initialize();
|
|
11389
11389
|
}
|
|
@@ -11411,7 +11411,7 @@ var kg = Object.getOwnPropertyDescriptor, Vg = (n, e, t, o) => {
|
|
|
11411
11411
|
(i = n[s]) && (r = i(r) || r);
|
|
11412
11412
|
return r;
|
|
11413
11413
|
}, Gn = (n, e) => (t, o) => e(t, o, n);
|
|
11414
|
-
let
|
|
11414
|
+
let xr = class extends pe {
|
|
11415
11415
|
constructor(n, e, t, o, r) {
|
|
11416
11416
|
super(), this._context = n, this._docSkeletonManagerService = e, this._commandService = t, this._docEventManagerService = o, this._textSelectionManagerService = r, this._initPointerDownObserver(), this._initHoverCursor();
|
|
11417
11417
|
}
|
|
@@ -11438,18 +11438,18 @@ let yr = class extends fe {
|
|
|
11438
11438
|
return r.clone().invert().applyPoint(s);
|
|
11439
11439
|
}
|
|
11440
11440
|
};
|
|
11441
|
-
|
|
11441
|
+
xr = Vg([
|
|
11442
11442
|
Gn(1, j(de)),
|
|
11443
11443
|
Gn(2, T),
|
|
11444
11444
|
Gn(3, j(wt)),
|
|
11445
11445
|
Gn(4, j(Y))
|
|
11446
|
-
],
|
|
11446
|
+
], xr);
|
|
11447
11447
|
var Wg = Object.getOwnPropertyDescriptor, jg = (n, e, t, o) => {
|
|
11448
11448
|
for (var r = o > 1 ? void 0 : o ? Wg(e, t) : e, s = n.length - 1, i; s >= 0; s--)
|
|
11449
11449
|
(i = n[s]) && (r = i(r) || r);
|
|
11450
11450
|
return r;
|
|
11451
11451
|
}, un = (n, e) => (t, o) => e(t, o, n);
|
|
11452
|
-
let Eo = class extends
|
|
11452
|
+
let Eo = class extends St {
|
|
11453
11453
|
constructor(n, e, t, o, r, s) {
|
|
11454
11454
|
super(), this._context = n, this._commandService = e, this._docClipboardService = t, this._docSelectionRenderService = o, this._contextService = r, this._editorService = s, this._init();
|
|
11455
11455
|
}
|
|
@@ -11458,9 +11458,9 @@ let Eo = class extends It {
|
|
|
11458
11458
|
}
|
|
11459
11459
|
_initLegacyPasteCommand() {
|
|
11460
11460
|
var n;
|
|
11461
|
-
(n = this._docSelectionRenderService) == null || n.onPaste$.pipe(
|
|
11461
|
+
(n = this._docSelectionRenderService) == null || n.onPaste$.pipe(ft(this.dispose$)).subscribe((e) => {
|
|
11462
11462
|
var a, c, d;
|
|
11463
|
-
if (!
|
|
11463
|
+
if (!Po(this._contextService))
|
|
11464
11464
|
return;
|
|
11465
11465
|
e.event.preventDefault();
|
|
11466
11466
|
const t = e.event;
|
|
@@ -11473,7 +11473,7 @@ let Eo = class extends It {
|
|
|
11473
11473
|
Eo = jg([
|
|
11474
11474
|
un(1, T),
|
|
11475
11475
|
un(2, Lt),
|
|
11476
|
-
un(3, j(
|
|
11476
|
+
un(3, j(Re)),
|
|
11477
11477
|
un(4, Fr),
|
|
11478
11478
|
un(5, Ye)
|
|
11479
11479
|
], Eo);
|
|
@@ -11485,10 +11485,10 @@ var zg = Object.getOwnPropertyDescriptor, Gg = (n, e, t, o) => {
|
|
|
11485
11485
|
const Yg = [
|
|
11486
11486
|
qi,
|
|
11487
11487
|
Yc,
|
|
11488
|
-
|
|
11488
|
+
yo,
|
|
11489
11489
|
ot
|
|
11490
11490
|
];
|
|
11491
|
-
let
|
|
11491
|
+
let Or = class extends pe {
|
|
11492
11492
|
constructor(n, e, t) {
|
|
11493
11493
|
super(), this._context = n, this._contextMenuService = e, this._commandService = t, Yg.includes(this._context.unitId) || (this._initPointerDown(), this._initEditChange());
|
|
11494
11494
|
}
|
|
@@ -11507,16 +11507,16 @@ let xr = class extends fe {
|
|
|
11507
11507
|
);
|
|
11508
11508
|
}
|
|
11509
11509
|
};
|
|
11510
|
-
|
|
11510
|
+
Or = Gg([
|
|
11511
11511
|
ki(1, Wl),
|
|
11512
11512
|
ki(2, T)
|
|
11513
|
-
],
|
|
11513
|
+
], Or);
|
|
11514
11514
|
var Kg = Object.getOwnPropertyDescriptor, qg = (n, e, t, o) => {
|
|
11515
11515
|
for (var r = o > 1 ? void 0 : o ? Kg(e, t) : e, s = n.length - 1, i; s >= 0; s--)
|
|
11516
11516
|
(i = n[s]) && (r = i(r) || r);
|
|
11517
11517
|
return r;
|
|
11518
11518
|
}, Gt = (n, e) => (t, o) => e(t, o, n);
|
|
11519
|
-
let Io = class extends
|
|
11519
|
+
let Io = class extends pe {
|
|
11520
11520
|
constructor(e, t, o, r, s, i, a) {
|
|
11521
11521
|
super();
|
|
11522
11522
|
O(this, "_initialEditors", /* @__PURE__ */ new Set());
|
|
@@ -11612,16 +11612,16 @@ Io = qg([
|
|
|
11612
11612
|
Gt(1, L),
|
|
11613
11613
|
Gt(2, Ye),
|
|
11614
11614
|
Gt(3, T),
|
|
11615
|
-
Gt(4, j(
|
|
11615
|
+
Gt(4, j(Re)),
|
|
11616
11616
|
Gt(5, j(de)),
|
|
11617
|
-
Gt(6,
|
|
11617
|
+
Gt(6, fe)
|
|
11618
11618
|
], Io);
|
|
11619
11619
|
var Xg = Object.getOwnPropertyDescriptor, Zg = (n, e, t, o) => {
|
|
11620
11620
|
for (var r = o > 1 ? void 0 : o ? Xg(e, t) : e, s = n.length - 1, i; s >= 0; s--)
|
|
11621
11621
|
(i = n[s]) && (r = i(r) || r);
|
|
11622
11622
|
return r;
|
|
11623
11623
|
}, Yn = (n, e) => (t, o) => e(t, o, n);
|
|
11624
|
-
let
|
|
11624
|
+
let Tr = class extends pe {
|
|
11625
11625
|
constructor(e, t, o, r, s) {
|
|
11626
11626
|
super();
|
|
11627
11627
|
O(this, "_previousIMEContent", "");
|
|
@@ -11676,18 +11676,18 @@ let Or = class extends fe {
|
|
|
11676
11676
|
this._previousIMEContent = "", this._isCompositionStart = !0, this._docImeInputManagerService.clearUndoRedoMutationParamsCache(), this._docImeInputManagerService.setActiveRange(null);
|
|
11677
11677
|
}
|
|
11678
11678
|
};
|
|
11679
|
-
|
|
11680
|
-
Yn(1, j(
|
|
11681
|
-
Yn(2, j(
|
|
11679
|
+
Tr = Zg([
|
|
11680
|
+
Yn(1, j(Re)),
|
|
11681
|
+
Yn(2, j(No)),
|
|
11682
11682
|
Yn(3, j(de)),
|
|
11683
11683
|
Yn(4, T)
|
|
11684
|
-
],
|
|
11684
|
+
], Tr);
|
|
11685
11685
|
var Jg = Object.getOwnPropertyDescriptor, $g = (n, e, t, o) => {
|
|
11686
11686
|
for (var r = o > 1 ? void 0 : o ? Jg(e, t) : e, s = n.length - 1, i; s >= 0; s--)
|
|
11687
11687
|
(i = n[s]) && (r = i(r) || r);
|
|
11688
11688
|
return r;
|
|
11689
11689
|
}, Kn = (n, e) => (t, o) => e(t, o, n);
|
|
11690
|
-
let
|
|
11690
|
+
let Br = class extends pe {
|
|
11691
11691
|
constructor(e, t, o, r, s) {
|
|
11692
11692
|
super();
|
|
11693
11693
|
O(this, "_onInputSubscription");
|
|
@@ -11708,7 +11708,7 @@ let Tr = class extends fe {
|
|
|
11708
11708
|
const { unitId: t } = this._context, { event: o, content: r = "", activeRange: s } = e, i = o, a = this._docSkeletonManagerService.getSkeleton();
|
|
11709
11709
|
if (i.data == null || a == null || s == null)
|
|
11710
11710
|
return;
|
|
11711
|
-
const { segmentId: c } = s, l = this._context.unit.getSelfOrHeaderFooterModel(c).getBody(), A = this._docMenuStyleService.getDefaultStyle(), h = this._docMenuStyleService.getStyleCache(), u = jr((p = l == null ? void 0 : l.customRanges) != null ? p : [], s.endOffset, In.includes(t)), g =
|
|
11711
|
+
const { segmentId: c } = s, l = this._context.unit.getSelfOrHeaderFooterModel(c).getBody(), A = this._docMenuStyleService.getDefaultStyle(), h = this._docMenuStyleService.getStyleCache(), u = jr((p = l == null ? void 0 : l.customRanges) != null ? p : [], s.endOffset, In.includes(t)), g = Bo(l, s.endOffset, A, h, In.includes(t)), f = zr((m = l == null ? void 0 : l.customDecorations) != null ? m : [], s.endOffset);
|
|
11712
11712
|
await this._commandService.executeCommand(Ca.id, {
|
|
11713
11713
|
unitId: t,
|
|
11714
11714
|
body: {
|
|
@@ -11733,23 +11733,23 @@ let Tr = class extends fe {
|
|
|
11733
11733
|
},
|
|
11734
11734
|
range: s,
|
|
11735
11735
|
segmentId: c
|
|
11736
|
-
}), r === " " && await this._commandService.executeCommand(
|
|
11736
|
+
}), r === " " && await this._commandService.executeCommand(Mo.id);
|
|
11737
11737
|
});
|
|
11738
11738
|
}
|
|
11739
11739
|
};
|
|
11740
|
-
|
|
11741
|
-
Kn(1, j(
|
|
11740
|
+
Br = $g([
|
|
11741
|
+
Kn(1, j(Re)),
|
|
11742
11742
|
Kn(2, j(de)),
|
|
11743
11743
|
Kn(3, T),
|
|
11744
11744
|
Kn(4, j(at))
|
|
11745
|
-
],
|
|
11746
|
-
class ws extends
|
|
11745
|
+
], Br);
|
|
11746
|
+
class ws extends pe {
|
|
11747
11747
|
constructor(e) {
|
|
11748
11748
|
super(), this._context = e;
|
|
11749
11749
|
}
|
|
11750
11750
|
calculatePagePosition() {
|
|
11751
|
-
var v,
|
|
11752
|
-
const e =
|
|
11751
|
+
var v, R;
|
|
11752
|
+
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;
|
|
11753
11753
|
if (a == null || c === Number.POSITIVE_INFINITY || d === Number.POSITIVE_INFINITY)
|
|
11754
11754
|
return;
|
|
11755
11755
|
const { width: h, height: u } = a;
|
|
@@ -11766,34 +11766,34 @@ var ef = Object.getOwnPropertyDescriptor, tf = (n, e, t, o) => {
|
|
|
11766
11766
|
(i = n[s]) && (r = i(r) || r);
|
|
11767
11767
|
return r;
|
|
11768
11768
|
}, Vi = (n, e) => (t, o) => e(t, o, n);
|
|
11769
|
-
let
|
|
11769
|
+
let Mr = class extends pe {
|
|
11770
11770
|
constructor(n, e, t) {
|
|
11771
11771
|
super(), this._context = n, this._docPageLayoutService = e, this._textSelectionManagerService = t;
|
|
11772
11772
|
const o = this._context.unitId;
|
|
11773
|
-
if (
|
|
11773
|
+
if (vt(o) && o !== ot) return this;
|
|
11774
11774
|
this._initResize();
|
|
11775
11775
|
}
|
|
11776
11776
|
_initResize() {
|
|
11777
11777
|
this.disposeWithMe(
|
|
11778
11778
|
Bt(this._context.engine.onTransformChange$).pipe(
|
|
11779
11779
|
ro((n) => n.type === oa.resize),
|
|
11780
|
-
|
|
11780
|
+
bn(0, Kl)
|
|
11781
11781
|
).subscribe(() => {
|
|
11782
11782
|
this._docPageLayoutService.calculatePagePosition(), this._textSelectionManagerService.refreshSelection();
|
|
11783
11783
|
})
|
|
11784
11784
|
);
|
|
11785
11785
|
}
|
|
11786
11786
|
};
|
|
11787
|
-
|
|
11787
|
+
Mr = tf([
|
|
11788
11788
|
Vi(1, j(ws)),
|
|
11789
11789
|
Vi(2, j(Y))
|
|
11790
|
-
],
|
|
11790
|
+
], Mr);
|
|
11791
11791
|
var nf = Object.getOwnPropertyDescriptor, of = (n, e, t, o) => {
|
|
11792
11792
|
for (var r = o > 1 ? void 0 : o ? nf(e, t) : e, s = n.length - 1, i; s >= 0; s--)
|
|
11793
11793
|
(i = n[s]) && (r = i(r) || r);
|
|
11794
11794
|
return r;
|
|
11795
11795
|
}, Yt = (n, e) => (t, o) => e(t, o, n);
|
|
11796
|
-
let
|
|
11796
|
+
let _r = class extends pe {
|
|
11797
11797
|
constructor(e, t, o, r, s, i, a) {
|
|
11798
11798
|
super();
|
|
11799
11799
|
O(this, "_loadedMap", /* @__PURE__ */ new WeakSet());
|
|
@@ -11803,7 +11803,7 @@ let Mr = class extends fe {
|
|
|
11803
11803
|
this._init(), this._skeletonListener(), this._commandExecutedListener(), this._refreshListener(), this._syncSelection();
|
|
11804
11804
|
}
|
|
11805
11805
|
_init() {
|
|
11806
|
-
const { unitId: e } = this._context, t =
|
|
11806
|
+
const { unitId: e } = this._context, t = pt(this._context);
|
|
11807
11807
|
t == null || t.document == null || this._loadedMap.has(t.document) || (this._initialMain(e), this._loadedMap.add(t.document));
|
|
11808
11808
|
}
|
|
11809
11809
|
_refreshListener() {
|
|
@@ -11828,7 +11828,7 @@ let Mr = class extends fe {
|
|
|
11828
11828
|
}
|
|
11829
11829
|
// eslint-disable-next-line max-lines-per-function
|
|
11830
11830
|
_initialMain(e) {
|
|
11831
|
-
const t =
|
|
11831
|
+
const t = pt(this._context), { document: o, scene: r } = t;
|
|
11832
11832
|
this.disposeWithMe(o.onPointerEnter$.subscribeEvent(() => {
|
|
11833
11833
|
this._isEditorReadOnly(e) || (o.cursor = Mt.TEXT);
|
|
11834
11834
|
})), this.disposeWithMe(o.onPointerLeave$.subscribeEvent(() => {
|
|
@@ -11841,7 +11841,7 @@ let Mr = class extends fe {
|
|
|
11841
11841
|
const c = this._docSkeletonManagerService.getSkeleton(), { offsetX: d, offsetY: l } = s, A = this._getTransformCoordForDocumentOffset(d, l);
|
|
11842
11842
|
if (A != null) {
|
|
11843
11843
|
const {
|
|
11844
|
-
pageLayoutType: h =
|
|
11844
|
+
pageLayoutType: h = Rn.VERTICAL,
|
|
11845
11845
|
pageMarginLeft: u,
|
|
11846
11846
|
pageMarginTop: g
|
|
11847
11847
|
} = o.getOffsetConfig(), { editArea: f } = c.findEditAreaByCoord(
|
|
@@ -11867,7 +11867,7 @@ let Mr = class extends fe {
|
|
|
11867
11867
|
}));
|
|
11868
11868
|
}
|
|
11869
11869
|
_getTransformCoordForDocumentOffset(e, t) {
|
|
11870
|
-
const o =
|
|
11870
|
+
const o = pt(this._context), { document: r, scene: s } = o, { documentTransform: i } = r.getOffsetConfig(), a = s.getViewports()[0];
|
|
11871
11871
|
if (a == null)
|
|
11872
11872
|
return;
|
|
11873
11873
|
const c = a.transformVector2SceneCoord(Cn.FromArray([e, t]));
|
|
@@ -11898,7 +11898,7 @@ let Mr = class extends fe {
|
|
|
11898
11898
|
this.disposeWithMe(this._docSkeletonManagerService.currentSkeleton$.subscribe((e) => {
|
|
11899
11899
|
if (!e) return;
|
|
11900
11900
|
const { unitId: t } = this._context;
|
|
11901
|
-
if (!
|
|
11901
|
+
if (!vt(t)) {
|
|
11902
11902
|
this._docSelectionRenderService.focus();
|
|
11903
11903
|
const s = this._context.unit.getSnapshot(), i = Ac(s);
|
|
11904
11904
|
this._docSelectionManagerService.replaceDocRanges([
|
|
@@ -11914,111 +11914,117 @@ let Mr = class extends fe {
|
|
|
11914
11914
|
}));
|
|
11915
11915
|
}
|
|
11916
11916
|
};
|
|
11917
|
-
|
|
11917
|
+
_r = of([
|
|
11918
11918
|
Yt(1, T),
|
|
11919
11919
|
Yt(2, Ye),
|
|
11920
11920
|
Yt(3, L),
|
|
11921
|
-
Yt(4, j(
|
|
11921
|
+
Yt(4, j(Re)),
|
|
11922
11922
|
Yt(5, j(de)),
|
|
11923
11923
|
Yt(6, j(Y))
|
|
11924
|
-
],
|
|
11924
|
+
], _r);
|
|
11925
11925
|
var rf = Object.getOwnPropertyDescriptor, sf = (n, e, t, o) => {
|
|
11926
11926
|
for (var r = o > 1 ? void 0 : o ? rf(e, t) : e, s = n.length - 1, i; s >= 0; s--)
|
|
11927
11927
|
(i = n[s]) && (r = i(r) || r);
|
|
11928
11928
|
return r;
|
|
11929
|
-
},
|
|
11930
|
-
let
|
|
11931
|
-
constructor(
|
|
11932
|
-
super()
|
|
11929
|
+
}, ht = (n, e) => (t, o) => e(t, o, n);
|
|
11930
|
+
let Dr = class extends pe {
|
|
11931
|
+
constructor(e, t, o, r, s, i, a, c, d) {
|
|
11932
|
+
super();
|
|
11933
|
+
O(this, "_isSheetEditor", !1);
|
|
11934
|
+
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 === yo;
|
|
11935
|
+
const l = this._univerInstanceService.getCurrentUnitOfType(_.UNIVER_SHEET), A = l && this._renderManagerService.getRenderById(l.getUnitId());
|
|
11936
|
+
setTimeout(() => this.updateViewZoom(A && this._isSheetEditor ? A.scene.scaleX : 1, !0), 20), vt(this._context.unitId) || this._initZoomEventListener();
|
|
11933
11937
|
}
|
|
11934
11938
|
_initRenderRefresher() {
|
|
11935
|
-
this._docSkeletonManagerService.currentSkeleton$.subscribe((
|
|
11936
|
-
if (
|
|
11939
|
+
this._docSkeletonManagerService.currentSkeleton$.subscribe((e) => {
|
|
11940
|
+
if (e == null)
|
|
11937
11941
|
return;
|
|
11938
|
-
const { unitId:
|
|
11939
|
-
this._editorService.isEditor(
|
|
11940
|
-
if (!
|
|
11942
|
+
const { unitId: t, scene: o } = this._context;
|
|
11943
|
+
this._editorService.isEditor(t) || this.disposeWithMe(o.onMouseWheel$.subscribeEvent((r) => {
|
|
11944
|
+
if (!r.ctrlKey || !this._contextService.getContextValue(Dn))
|
|
11941
11945
|
return;
|
|
11942
|
-
const
|
|
11943
|
-
if (!
|
|
11946
|
+
const s = this._univerInstanceService.getCurrentUniverDocInstance();
|
|
11947
|
+
if (!s)
|
|
11944
11948
|
return;
|
|
11945
|
-
const { documentFlavor:
|
|
11946
|
-
if (
|
|
11949
|
+
const { documentFlavor: i } = s.getSnapshot().documentStyle;
|
|
11950
|
+
if (i === we.MODERN)
|
|
11947
11951
|
return;
|
|
11948
|
-
const
|
|
11949
|
-
let
|
|
11950
|
-
|
|
11951
|
-
const
|
|
11952
|
-
let
|
|
11953
|
-
|
|
11954
|
-
zoomRatio:
|
|
11955
|
-
unitId:
|
|
11956
|
-
}),
|
|
11952
|
+
const a = Math.abs(r.deltaX);
|
|
11953
|
+
let c = a < 40 ? 0.2 : a < 80 ? 0.4 : 0.2;
|
|
11954
|
+
c *= r.deltaY > 0 ? -1 : 1, o.scaleX < 1 && (c /= 2);
|
|
11955
|
+
const d = s.zoomRatio;
|
|
11956
|
+
let l = +Number.parseFloat(`${d + c}`).toFixed(1);
|
|
11957
|
+
l = l >= 4 ? 4 : l <= 0.1 ? 0.1 : l, this._commandService.executeCommand(Zn.id, {
|
|
11958
|
+
zoomRatio: l,
|
|
11959
|
+
unitId: s.getUnitId()
|
|
11960
|
+
}), r.preventDefault();
|
|
11957
11961
|
}));
|
|
11958
11962
|
});
|
|
11959
11963
|
}
|
|
11960
11964
|
_initSkeletonListener() {
|
|
11961
|
-
this.disposeWithMe(this._docSkeletonManagerService.currentSkeleton$.subscribe((
|
|
11962
|
-
if (
|
|
11965
|
+
this.disposeWithMe(this._docSkeletonManagerService.currentSkeleton$.subscribe((e) => {
|
|
11966
|
+
if (e == null)
|
|
11963
11967
|
return;
|
|
11964
|
-
const
|
|
11965
|
-
|
|
11966
|
-
|
|
11967
|
-
|
|
11968
|
+
const t = this._univerInstanceService.getCurrentUniverDocInstance();
|
|
11969
|
+
t && setTimeout(() => {
|
|
11970
|
+
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;
|
|
11971
|
+
this.updateViewZoom(s, !1);
|
|
11972
|
+
});
|
|
11968
11973
|
}));
|
|
11969
11974
|
}
|
|
11970
11975
|
_initCommandExecutedListener() {
|
|
11971
|
-
const
|
|
11972
|
-
this.disposeWithMe(this._commandService.onCommandExecuted((
|
|
11973
|
-
if (
|
|
11974
|
-
const
|
|
11975
|
-
this.updateViewZoom(
|
|
11976
|
+
const e = [nt.id];
|
|
11977
|
+
this.disposeWithMe(this._commandService.onCommandExecuted((t) => {
|
|
11978
|
+
if (e.includes(t.id) && t.params.unitId === this._context.unitId) {
|
|
11979
|
+
const r = this._context.unit.zoomRatio || 1;
|
|
11980
|
+
this.updateViewZoom(r);
|
|
11976
11981
|
}
|
|
11977
11982
|
})), this.disposeWithMe(
|
|
11978
|
-
this._commandService.beforeCommandExecuted((
|
|
11979
|
-
|
|
11983
|
+
this._commandService.beforeCommandExecuted((t) => {
|
|
11984
|
+
t.id === ko.id && this._commandService.executeCommand(Zn.id, {
|
|
11980
11985
|
zoomRatio: 1,
|
|
11981
11986
|
unitId: this._context.unitId
|
|
11982
11987
|
});
|
|
11983
11988
|
})
|
|
11984
11989
|
);
|
|
11985
11990
|
}
|
|
11986
|
-
updateViewZoom(
|
|
11987
|
-
var
|
|
11988
|
-
const
|
|
11989
|
-
|
|
11991
|
+
updateViewZoom(e, t = !0) {
|
|
11992
|
+
var r;
|
|
11993
|
+
const o = pt(this._context);
|
|
11994
|
+
o.scene.scale(e, e), this._editorService.isEditor(this._context.unitId) || this._docPageLayoutService.calculatePagePosition(), t && !this._editorService.isEditor(this._context.unitId) && this._textSelectionManagerService.refreshSelection(), (r = o.scene.getTransformer()) == null || r.clearSelectedObjects();
|
|
11990
11995
|
}
|
|
11991
11996
|
_initZoomEventListener() {
|
|
11992
|
-
const
|
|
11997
|
+
const e = this._context.scene;
|
|
11993
11998
|
this.disposeWithMe(
|
|
11994
11999
|
// hold ctrl & mousewheel ---> zoom
|
|
11995
|
-
|
|
11996
|
-
if (!
|
|
12000
|
+
e.onMouseWheel$.subscribeEvent((t) => {
|
|
12001
|
+
if (!t.ctrlKey)
|
|
11997
12002
|
return;
|
|
11998
|
-
const
|
|
11999
|
-
let
|
|
12000
|
-
|
|
12001
|
-
const
|
|
12002
|
-
let
|
|
12003
|
-
|
|
12004
|
-
zoomRatio: Math.round(
|
|
12003
|
+
const o = Math.abs(t.deltaX);
|
|
12004
|
+
let r = o < 40 ? 0.2 : o < 80 ? 0.4 : 0.2;
|
|
12005
|
+
r *= t.deltaY > 0 ? -1 : 1, e.scaleX < 1 && (r /= 2);
|
|
12006
|
+
const s = this._context.unit.zoomRatio;
|
|
12007
|
+
let i = +Number.parseFloat(`${s + r}`).toFixed(1);
|
|
12008
|
+
i = i >= 4 ? 4 : i <= 0.1 ? 0.1 : i, this._commandService.executeCommand(Zn.id, {
|
|
12009
|
+
zoomRatio: Math.round(i * 10) / 10,
|
|
12005
12010
|
documentId: this._context.unitId
|
|
12006
|
-
}),
|
|
12011
|
+
}), t.preventDefault();
|
|
12007
12012
|
})
|
|
12008
12013
|
);
|
|
12009
12014
|
}
|
|
12010
12015
|
};
|
|
12011
|
-
|
|
12012
|
-
|
|
12013
|
-
|
|
12014
|
-
|
|
12015
|
-
|
|
12016
|
-
|
|
12017
|
-
|
|
12018
|
-
|
|
12019
|
-
|
|
12016
|
+
Dr = sf([
|
|
12017
|
+
ht(1, Fr),
|
|
12018
|
+
ht(2, j(de)),
|
|
12019
|
+
ht(3, L),
|
|
12020
|
+
ht(4, T),
|
|
12021
|
+
ht(5, j(Y)),
|
|
12022
|
+
ht(6, Ye),
|
|
12023
|
+
ht(7, j(ws)),
|
|
12024
|
+
ht(8, fe)
|
|
12025
|
+
], Dr);
|
|
12020
12026
|
const af = Ji("PRINTING_COMPONENT_COLLECT"), cf = Ji("PRINTING_DOM_COLLECT");
|
|
12021
|
-
class lf extends
|
|
12027
|
+
class lf extends pe {
|
|
12022
12028
|
constructor() {
|
|
12023
12029
|
super();
|
|
12024
12030
|
O(this, "_printComponentMap", /* @__PURE__ */ new Map());
|
|
@@ -12047,7 +12053,7 @@ var df = Object.getOwnPropertyDescriptor, Af = (n, e, t, o) => {
|
|
|
12047
12053
|
return r;
|
|
12048
12054
|
}, hn = (n, e) => (t, o) => e(t, o, n);
|
|
12049
12055
|
const Wi = 300;
|
|
12050
|
-
let So = class extends
|
|
12056
|
+
let So = class extends St {
|
|
12051
12057
|
constructor(e, t, o, r, s) {
|
|
12052
12058
|
super();
|
|
12053
12059
|
O(this, "_docStateChange$", new Fe(null));
|
|
@@ -12087,11 +12093,11 @@ let So = class extends It {
|
|
|
12087
12093
|
);
|
|
12088
12094
|
}
|
|
12089
12095
|
_listenDocStateChange() {
|
|
12090
|
-
this._docStateEmitService.docStateChangeParams$.pipe(
|
|
12096
|
+
this._docStateEmitService.docStateChangeParams$.pipe(ft(this.dispose$)).subscribe((e) => {
|
|
12091
12097
|
var a;
|
|
12092
12098
|
if (e == null)
|
|
12093
12099
|
return;
|
|
12094
|
-
const { isCompositionEnd: t, isSync: o, syncer: r, ...s } = e, i = (a = this._renderManagerService.getRenderById(o ? r : e.unitId)) == null ? void 0 : a.with(
|
|
12100
|
+
const { isCompositionEnd: t, isSync: o, syncer: r, ...s } = e, i = (a = this._renderManagerService.getRenderById(o ? r : e.unitId)) == null ? void 0 : a.with(No);
|
|
12095
12101
|
if (i != null) {
|
|
12096
12102
|
if (t) {
|
|
12097
12103
|
const c = i.fetchComposedUndoRedoMutationParams();
|
|
@@ -12167,11 +12173,11 @@ let So = class extends It {
|
|
|
12167
12173
|
}
|
|
12168
12174
|
};
|
|
12169
12175
|
So = Af([
|
|
12170
|
-
hn(0, j(
|
|
12176
|
+
hn(0, j(xo)),
|
|
12171
12177
|
hn(1, T),
|
|
12172
12178
|
hn(2, L),
|
|
12173
12179
|
hn(3, j(tl)),
|
|
12174
|
-
hn(4,
|
|
12180
|
+
hn(4, fe)
|
|
12175
12181
|
], So);
|
|
12176
12182
|
var uf = Object.getOwnPropertyDescriptor, hf = (n, e, t, o) => {
|
|
12177
12183
|
for (var r = o > 1 ? void 0 : o ? uf(e, t) : e, s = n.length - 1, i; s >= 0; s--)
|
|
@@ -12179,12 +12185,12 @@ var uf = Object.getOwnPropertyDescriptor, hf = (n, e, t, o) => {
|
|
|
12179
12185
|
return r;
|
|
12180
12186
|
}, ji = (n, e) => (t, o) => e(t, o, n);
|
|
12181
12187
|
const zi = "univer-doc-main-canvas";
|
|
12182
|
-
let vo = class extends
|
|
12188
|
+
let vo = class extends St {
|
|
12183
12189
|
constructor(n, e) {
|
|
12184
12190
|
super(), this._instanceSrv = n, this._renderManagerService = e, this._init();
|
|
12185
12191
|
}
|
|
12186
12192
|
_init() {
|
|
12187
|
-
this._renderManagerService.createRender$.pipe(
|
|
12193
|
+
this._renderManagerService.createRender$.pipe(ft(this.dispose$)).subscribe((n) => this._createRenderWithId(n)), this._instanceSrv.getAllUnitsForType(_.UNIVER_DOC).forEach((n) => this._createRenderer(n)), this._instanceSrv.getTypeOfUnitAdded$(_.UNIVER_DOC).pipe(ft(this.dispose$)).subscribe((n) => this._createRenderer(n)), this._instanceSrv.getTypeOfUnitDisposed$(_.UNIVER_DOC).pipe(ft(this.dispose$)).subscribe((n) => this._disposeRenderer(n));
|
|
12188
12194
|
}
|
|
12189
12195
|
_createRenderer(n) {
|
|
12190
12196
|
var o;
|
|
@@ -12203,14 +12209,14 @@ let vo = class extends It {
|
|
|
12203
12209
|
};
|
|
12204
12210
|
vo = hf([
|
|
12205
12211
|
ji(0, L),
|
|
12206
|
-
ji(1,
|
|
12212
|
+
ji(1, fe)
|
|
12207
12213
|
], vo);
|
|
12208
12214
|
const gf = {
|
|
12209
12215
|
id: yn.id,
|
|
12210
12216
|
preconditions: dh,
|
|
12211
12217
|
binding: q.ENTER
|
|
12212
12218
|
}, ff = {
|
|
12213
|
-
id:
|
|
12219
|
+
id: Do.id,
|
|
12214
12220
|
preconditions: Se,
|
|
12215
12221
|
binding: q.BACKSPACE
|
|
12216
12222
|
}, pf = {
|
|
@@ -12218,56 +12224,56 @@ const gf = {
|
|
|
12218
12224
|
preconditions: Se,
|
|
12219
12225
|
binding: q.DELETE
|
|
12220
12226
|
}, mf = {
|
|
12221
|
-
id:
|
|
12227
|
+
id: Et.id,
|
|
12222
12228
|
binding: q.ARROW_UP,
|
|
12223
12229
|
preconditions: Se,
|
|
12224
12230
|
staticParameters: {
|
|
12225
12231
|
direction: le.UP
|
|
12226
12232
|
}
|
|
12227
12233
|
}, Ef = {
|
|
12228
|
-
id:
|
|
12234
|
+
id: Et.id,
|
|
12229
12235
|
binding: q.ARROW_DOWN,
|
|
12230
12236
|
preconditions: Se,
|
|
12231
12237
|
staticParameters: {
|
|
12232
12238
|
direction: le.DOWN
|
|
12233
12239
|
}
|
|
12234
12240
|
}, If = {
|
|
12235
|
-
id:
|
|
12241
|
+
id: Et.id,
|
|
12236
12242
|
binding: q.ARROW_LEFT,
|
|
12237
12243
|
preconditions: Se,
|
|
12238
12244
|
staticParameters: {
|
|
12239
12245
|
direction: le.LEFT
|
|
12240
12246
|
}
|
|
12241
12247
|
}, Sf = {
|
|
12242
|
-
id:
|
|
12248
|
+
id: Et.id,
|
|
12243
12249
|
binding: q.ARROW_RIGHT,
|
|
12244
12250
|
preconditions: Se,
|
|
12245
12251
|
staticParameters: {
|
|
12246
12252
|
direction: le.RIGHT
|
|
12247
12253
|
}
|
|
12248
12254
|
}, vf = {
|
|
12249
|
-
id:
|
|
12255
|
+
id: It.id,
|
|
12250
12256
|
binding: q.ARROW_UP | te.SHIFT,
|
|
12251
12257
|
preconditions: Se,
|
|
12252
12258
|
staticParameters: {
|
|
12253
12259
|
direction: le.UP
|
|
12254
12260
|
}
|
|
12255
12261
|
}, Cf = {
|
|
12256
|
-
id:
|
|
12262
|
+
id: It.id,
|
|
12257
12263
|
binding: q.ARROW_DOWN | te.SHIFT,
|
|
12258
12264
|
preconditions: Se,
|
|
12259
12265
|
staticParameters: {
|
|
12260
12266
|
direction: le.DOWN
|
|
12261
12267
|
}
|
|
12262
|
-
},
|
|
12263
|
-
id:
|
|
12268
|
+
}, Rf = {
|
|
12269
|
+
id: It.id,
|
|
12264
12270
|
binding: q.ARROW_LEFT | te.SHIFT,
|
|
12265
12271
|
preconditions: Se,
|
|
12266
12272
|
staticParameters: {
|
|
12267
12273
|
direction: le.LEFT
|
|
12268
12274
|
}
|
|
12269
|
-
},
|
|
12270
|
-
id:
|
|
12275
|
+
}, bf = {
|
|
12276
|
+
id: It.id,
|
|
12271
12277
|
binding: q.ARROW_RIGHT | te.SHIFT,
|
|
12272
12278
|
preconditions: Se,
|
|
12273
12279
|
staticParameters: {
|
|
@@ -12283,7 +12289,7 @@ var xf = Object.defineProperty, Of = Object.getOwnPropertyDescriptor, Tf = (n, e
|
|
|
12283
12289
|
(i = n[s]) && (r = i(r) || r);
|
|
12284
12290
|
return r;
|
|
12285
12291
|
}, gn = (n, e) => (t, o) => e(t, o, n), Mf = (n, e, t) => Tf(n, e + "", t);
|
|
12286
|
-
let
|
|
12292
|
+
let Pr = class extends Zc {
|
|
12287
12293
|
// static override type = UniverInstanceType.UNIVER_DOC;
|
|
12288
12294
|
constructor(n = Di, e, t, o, r, s) {
|
|
12289
12295
|
super(), this._config = n, this._injector = e, this._renderManagerSrv = t, this._commandService = o, this._logService = r, this._configService = s;
|
|
@@ -12292,7 +12298,7 @@ let Dr = class extends Zc {
|
|
|
12292
12298
|
Di,
|
|
12293
12299
|
this._config
|
|
12294
12300
|
);
|
|
12295
|
-
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(
|
|
12301
|
+
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(Vo, a), this._initDependencies(e), this._initializeShortcut(), this._initCommand();
|
|
12296
12302
|
}
|
|
12297
12303
|
onReady() {
|
|
12298
12304
|
this._initRenderBasics(), this._markDocAsFocused(), ks(this._injector, [
|
|
@@ -12314,41 +12320,41 @@ let Dr = class extends Zc {
|
|
|
12314
12320
|
// eslint-disable-next-line max-lines-per-function
|
|
12315
12321
|
_initCommand() {
|
|
12316
12322
|
[
|
|
12317
|
-
|
|
12323
|
+
Do,
|
|
12318
12324
|
ya,
|
|
12319
12325
|
Qt,
|
|
12320
12326
|
Ut,
|
|
12321
12327
|
Ft,
|
|
12322
12328
|
Ht,
|
|
12323
|
-
|
|
12329
|
+
Ct,
|
|
12324
12330
|
kt,
|
|
12325
12331
|
ct,
|
|
12326
12332
|
tn,
|
|
12327
12333
|
Dt,
|
|
12328
12334
|
Fn,
|
|
12329
12335
|
Pt,
|
|
12330
|
-
|
|
12336
|
+
Rt,
|
|
12331
12337
|
Gr,
|
|
12332
12338
|
Ca,
|
|
12333
12339
|
xn,
|
|
12334
12340
|
Zr,
|
|
12335
|
-
ba,
|
|
12336
|
-
Jr,
|
|
12337
12341
|
Ra,
|
|
12342
|
+
Jr,
|
|
12343
|
+
ba,
|
|
12338
12344
|
nt,
|
|
12339
12345
|
Tn,
|
|
12340
12346
|
On,
|
|
12341
12347
|
Hn,
|
|
12342
|
-
Lo,
|
|
12343
12348
|
Qo,
|
|
12344
12349
|
Uo,
|
|
12345
|
-
lt,
|
|
12346
12350
|
Fo,
|
|
12347
|
-
|
|
12351
|
+
lt,
|
|
12352
|
+
Ho,
|
|
12353
|
+
wo,
|
|
12348
12354
|
ja,
|
|
12349
12355
|
za,
|
|
12350
|
-
bs,
|
|
12351
12356
|
Rs,
|
|
12357
|
+
bs,
|
|
12352
12358
|
vA,
|
|
12353
12359
|
ys,
|
|
12354
12360
|
xs,
|
|
@@ -12358,15 +12364,15 @@ let Dr = class extends Zc {
|
|
|
12358
12364
|
Ms,
|
|
12359
12365
|
Ga,
|
|
12360
12366
|
Jt,
|
|
12361
|
-
|
|
12367
|
+
Mo,
|
|
12362
12368
|
yn,
|
|
12363
|
-
|
|
12364
|
-
|
|
12369
|
+
gr,
|
|
12370
|
+
Lo,
|
|
12365
12371
|
io,
|
|
12366
12372
|
Na,
|
|
12367
12373
|
La,
|
|
12368
12374
|
Ba,
|
|
12369
|
-
|
|
12375
|
+
ko,
|
|
12370
12376
|
rt,
|
|
12371
12377
|
va,
|
|
12372
12378
|
$t,
|
|
@@ -12376,8 +12382,8 @@ let Dr = class extends Zc {
|
|
|
12376
12382
|
Zn,
|
|
12377
12383
|
Ta,
|
|
12378
12384
|
Ds,
|
|
12379
|
-
mt,
|
|
12380
12385
|
Et,
|
|
12386
|
+
It,
|
|
12381
12387
|
$d,
|
|
12382
12388
|
wa,
|
|
12383
12389
|
eA,
|
|
@@ -12412,15 +12418,15 @@ let Dr = class extends Zc {
|
|
|
12412
12418
|
If,
|
|
12413
12419
|
vf,
|
|
12414
12420
|
Cf,
|
|
12415
|
-
bf,
|
|
12416
12421
|
Rf,
|
|
12422
|
+
bf,
|
|
12417
12423
|
yf,
|
|
12418
12424
|
ff,
|
|
12419
12425
|
pf,
|
|
12420
12426
|
gf,
|
|
12421
12427
|
uh
|
|
12422
12428
|
].forEach((n) => {
|
|
12423
|
-
this._injector.get(
|
|
12429
|
+
this._injector.get(To).registerShortcut(n);
|
|
12424
12430
|
});
|
|
12425
12431
|
}
|
|
12426
12432
|
_initDependencies(n) {
|
|
@@ -12434,8 +12440,8 @@ let Dr = class extends Zc {
|
|
|
12434
12440
|
[po],
|
|
12435
12441
|
[go],
|
|
12436
12442
|
[nn],
|
|
12437
|
-
[Ye, { useClass:
|
|
12438
|
-
[Lt, { useClass:
|
|
12443
|
+
[Ye, { useClass: Sr }],
|
|
12444
|
+
[Lt, { useClass: ur }],
|
|
12439
12445
|
[Mn],
|
|
12440
12446
|
[vo],
|
|
12441
12447
|
[So],
|
|
@@ -12460,12 +12466,12 @@ let Dr = class extends Zc {
|
|
|
12460
12466
|
_initRenderBasics() {
|
|
12461
12467
|
[
|
|
12462
12468
|
[de],
|
|
12463
|
-
[
|
|
12469
|
+
[Re],
|
|
12464
12470
|
[nl],
|
|
12465
12471
|
[ws],
|
|
12466
|
-
[
|
|
12472
|
+
[No],
|
|
12467
12473
|
[br],
|
|
12468
|
-
[
|
|
12474
|
+
[Dr]
|
|
12469
12475
|
].forEach((n) => {
|
|
12470
12476
|
this._renderManagerSrv.registerRenderModule(_.UNIVER_DOC, n);
|
|
12471
12477
|
});
|
|
@@ -12476,31 +12482,31 @@ let Dr = class extends Zc {
|
|
|
12476
12482
|
[lo],
|
|
12477
12483
|
[Ao],
|
|
12478
12484
|
[ho],
|
|
12485
|
+
[_r],
|
|
12486
|
+
[Cr],
|
|
12479
12487
|
[Mr],
|
|
12480
|
-
[
|
|
12481
|
-
[Br],
|
|
12488
|
+
[Or],
|
|
12482
12489
|
[xr],
|
|
12483
|
-
[yr],
|
|
12484
12490
|
[Eo],
|
|
12491
|
+
[Br],
|
|
12485
12492
|
[Tr],
|
|
12486
|
-
[Or],
|
|
12487
12493
|
[Io]
|
|
12488
12494
|
].forEach((n) => {
|
|
12489
12495
|
this._renderManagerSrv.registerRenderModule(_.UNIVER_DOC, n);
|
|
12490
12496
|
});
|
|
12491
12497
|
}
|
|
12492
12498
|
};
|
|
12493
|
-
Mf(
|
|
12494
|
-
|
|
12499
|
+
Mf(Pr, "pluginName", id);
|
|
12500
|
+
Pr = Bf([
|
|
12495
12501
|
Xc(Il),
|
|
12496
12502
|
gn(1, j(Pn)),
|
|
12497
|
-
gn(2,
|
|
12503
|
+
gn(2, fe),
|
|
12498
12504
|
gn(3, T),
|
|
12499
|
-
gn(4,
|
|
12505
|
+
gn(4, Qr),
|
|
12500
12506
|
gn(5, Vr)
|
|
12501
|
-
],
|
|
12507
|
+
], Pr);
|
|
12502
12508
|
function _f(n, e, t) {
|
|
12503
|
-
const o = J(T), r = J(
|
|
12509
|
+
const o = J(T), r = J(To), s = _e(() => ge(4), []);
|
|
12504
12510
|
Ce(() => {
|
|
12505
12511
|
if (!t || !n || !e)
|
|
12506
12512
|
return;
|
|
@@ -12548,12 +12554,12 @@ const Df = (n, e = !0, t, o) => {
|
|
|
12548
12554
|
c.transformByState({
|
|
12549
12555
|
width: p,
|
|
12550
12556
|
height: m
|
|
12551
|
-
}), d == null || d.resize(p, m), e ? A > u ? (f == null ? l && new
|
|
12557
|
+
}), d == null || d.resize(p, m), e ? A > u ? (f == null ? l && new lr(l, {
|
|
12552
12558
|
barSize: 8,
|
|
12553
12559
|
enableVertical: !1,
|
|
12554
12560
|
enableHorizontal: !0,
|
|
12555
12561
|
minThumbSizeV: 8
|
|
12556
|
-
}) : l == null || l.resetCanvasSizeAndUpdateScroll(), o && (l == null || l.scrollToBarPos({ x: 1 / 0, y: 0 }))) : (f = null, l == null || l.scrollToBarPos({ x: 0, y: 0 }), (S = l == null ? void 0 : l.getScrollBar()) == null || S.dispose()) : h > g ? (f == null ? l && (f = new
|
|
12562
|
+
}) : l == null || l.resetCanvasSizeAndUpdateScroll(), o && (l == null || l.scrollToBarPos({ x: 1 / 0, y: 0 }))) : (f = null, l == null || l.scrollToBarPos({ x: 0, y: 0 }), (S = l == null ? void 0 : l.getScrollBar()) == null || S.dispose()) : h > g ? (f == null ? l && (f = new lr(l, {
|
|
12557
12563
|
enableHorizontal: !1,
|
|
12558
12564
|
enableVertical: !0,
|
|
12559
12565
|
barSize: 8,
|
|
@@ -12627,7 +12633,7 @@ function Pf(n) {
|
|
|
12627
12633
|
}, []), a;
|
|
12628
12634
|
}
|
|
12629
12635
|
const wf = (n, e, t, o) => {
|
|
12630
|
-
const r = J(T), s = J(
|
|
12636
|
+
const r = J(T), s = J(To), i = ke(e);
|
|
12631
12637
|
i.current = e;
|
|
12632
12638
|
const a = ke(o);
|
|
12633
12639
|
a.current = o, Ce(() => {
|
|
@@ -12639,9 +12645,9 @@ const wf = (n, e, t, o) => {
|
|
|
12639
12645
|
return;
|
|
12640
12646
|
}
|
|
12641
12647
|
let f = le.LEFT;
|
|
12642
|
-
u === q.ARROW_DOWN ? f = le.DOWN : u === q.ARROW_UP ? f = le.UP : u === q.ARROW_RIGHT && (f = le.RIGHT), g === te.SHIFT ? r.executeCommand(
|
|
12648
|
+
u === q.ARROW_DOWN ? f = le.DOWN : u === q.ARROW_UP ? f = le.UP : u === q.ARROW_RIGHT && (f = le.RIGHT), g === te.SHIFT ? r.executeCommand(It.id, {
|
|
12643
12649
|
direction: f
|
|
12644
|
-
}) : r.executeCommand(
|
|
12650
|
+
}) : r.executeCommand(Et.id, {
|
|
12645
12651
|
direction: f
|
|
12646
12652
|
});
|
|
12647
12653
|
};
|
|
@@ -12722,13 +12728,13 @@ const ep = (n) => {
|
|
|
12722
12728
|
icon: f,
|
|
12723
12729
|
editorRef: p,
|
|
12724
12730
|
placeholder: m
|
|
12725
|
-
} = n, I = J(Ye), S = En(o), v = En(s), [
|
|
12731
|
+
} = n, I = J(Ye), S = En(o), v = En(s), [R, E] = me(u), b = ke(null), y = _e(() => l != null ? l : el(`RICH_TEXT_EDITOR-${ge(4)}`), [l]), C = Pf({
|
|
12726
12732
|
editorId: y,
|
|
12727
12733
|
initialValue: r,
|
|
12728
|
-
container:
|
|
12734
|
+
container: b,
|
|
12729
12735
|
autoFocus: t,
|
|
12730
12736
|
isSingle: d
|
|
12731
|
-
}), x = J(
|
|
12737
|
+
}), x = J(fe).getRenderById(y), M = x == null ? void 0 : x.with(Re), P = tt(M == null ? void 0 : M.textSelectionInner$), F = !!((H = M == null ? void 0 : M.isFocusing) != null && H && (P != null && P.textRanges.some((k) => k.collapsed))), w = ke(null), [N, ee] = me(() => {
|
|
12732
12738
|
var k, ne;
|
|
12733
12739
|
return !ce.transform.getPlainText((ne = (k = C == null ? void 0 : C.getDocumentData().body) == null ? void 0 : k.dataStream) != null ? ne : "");
|
|
12734
12740
|
}), { checkScrollBar: $ } = Df(C, d, !0, !0);
|
|
@@ -12774,13 +12780,13 @@ const ep = (n) => {
|
|
|
12774
12780
|
className: Ge("univer-relative univer-box-border univer-flex univer-h-8 univer-w-full univer-items-center univer-justify-around univer-gap-2 univer-rounded-md univer-pb-0.5 univer-pl-1.5 univer-pr-2 univer-pt-1.5", Ln, {
|
|
12775
12781
|
"univer-border-primary-500": F
|
|
12776
12782
|
}),
|
|
12777
|
-
style: { height:
|
|
12783
|
+
style: { height: R },
|
|
12778
12784
|
ref: w,
|
|
12779
12785
|
children: [
|
|
12780
12786
|
/* @__PURE__ */ Q(
|
|
12781
12787
|
"div",
|
|
12782
12788
|
{
|
|
12783
|
-
ref:
|
|
12789
|
+
ref: b,
|
|
12784
12790
|
className: "univer-relative univer-size-full",
|
|
12785
12791
|
onMouseUp: () => C == null ? void 0 : C.focus()
|
|
12786
12792
|
}
|
|
@@ -12798,17 +12804,17 @@ const ep = (n) => {
|
|
|
12798
12804
|
) });
|
|
12799
12805
|
};
|
|
12800
12806
|
export {
|
|
12801
|
-
|
|
12802
|
-
|
|
12803
|
-
|
|
12804
|
-
|
|
12807
|
+
Mo as AfterSpaceCommand,
|
|
12808
|
+
Uo as AlignCenterCommand,
|
|
12809
|
+
Ho as AlignJustifyCommand,
|
|
12810
|
+
Qo as AlignLeftCommand,
|
|
12805
12811
|
lt as AlignOperationCommand,
|
|
12806
|
-
|
|
12812
|
+
Fo as AlignRightCommand,
|
|
12807
12813
|
Gr as BreakLineCommand,
|
|
12808
12814
|
On as BulletListCommand,
|
|
12809
|
-
|
|
12815
|
+
gr as ChangeListNestingLevelCommand,
|
|
12810
12816
|
Xn as ChangeListNestingLevelType,
|
|
12811
|
-
|
|
12817
|
+
Lo as ChangeListTypeCommand,
|
|
12812
12818
|
io as CheckListCommand,
|
|
12813
12819
|
Zd as CoverContentCommand,
|
|
12814
12820
|
ja as CreateDocTableCommand,
|
|
@@ -12816,7 +12822,7 @@ export {
|
|
|
12816
12822
|
ad as DOCS_COMPONENT_BACKGROUND_LAYER_INDEX,
|
|
12817
12823
|
Js as DOCS_COMPONENT_DEFAULT_Z_INDEX,
|
|
12818
12824
|
cd as DOCS_COMPONENT_HEADER_LAYER_INDEX,
|
|
12819
|
-
|
|
12825
|
+
zo as DOCS_COMPONENT_MAIN_LAYER_INDEX,
|
|
12820
12826
|
et as DOCS_VIEW_KEY,
|
|
12821
12827
|
id as DOC_UI_PLUGIN_NAME,
|
|
12822
12828
|
Oi as DOC_VERTICAL_PADDING,
|
|
@@ -12824,7 +12830,7 @@ export {
|
|
|
12824
12830
|
rd as DefaultToolbarConfig,
|
|
12825
12831
|
xn as DeleteCommand,
|
|
12826
12832
|
Zr as DeleteCustomBlockCommand,
|
|
12827
|
-
|
|
12833
|
+
Do as DeleteLeftCommand,
|
|
12828
12834
|
ya as DeleteRightCommand,
|
|
12829
12835
|
_t as DocAutoFormatService,
|
|
12830
12836
|
ho as DocBackScrollRenderController,
|
|
@@ -12833,12 +12839,12 @@ export {
|
|
|
12833
12839
|
Os as DocCreateTableOperation,
|
|
12834
12840
|
rs as DocCutCommand,
|
|
12835
12841
|
wt as DocEventManagerService,
|
|
12836
|
-
|
|
12842
|
+
No as DocIMEInputManagerService,
|
|
12837
12843
|
is as DocPasteCommand,
|
|
12838
12844
|
lf as DocPrintInterceptorService,
|
|
12839
12845
|
br as DocRenderController,
|
|
12840
12846
|
Ta as DocSelectAllCommand,
|
|
12841
|
-
|
|
12847
|
+
Re as DocSelectionRenderService,
|
|
12842
12848
|
So as DocStateChangeManagerService,
|
|
12843
12849
|
Ss as DocTableDeleteColumnsCommand,
|
|
12844
12850
|
Is as DocTableDeleteRowsCommand,
|
|
@@ -12846,8 +12852,8 @@ export {
|
|
|
12846
12852
|
vA as DocTableInsertColumnCommand,
|
|
12847
12853
|
ys as DocTableInsertColumnLeftCommand,
|
|
12848
12854
|
xs as DocTableInsertColumnRightCommand,
|
|
12849
|
-
|
|
12850
|
-
|
|
12855
|
+
Rs as DocTableInsertRowAboveCommand,
|
|
12856
|
+
bs as DocTableInsertRowBellowCommand,
|
|
12851
12857
|
za as DocTableInsertRowCommand,
|
|
12852
12858
|
Ga as DocTableTabCommand,
|
|
12853
12859
|
uo as DocUIController,
|
|
@@ -12855,9 +12861,9 @@ export {
|
|
|
12855
12861
|
fg as DocsUIMenuSchema,
|
|
12856
12862
|
WA as Editor,
|
|
12857
12863
|
Dd as EditorInsertTextCommandId,
|
|
12858
|
-
|
|
12864
|
+
Sr as EditorService,
|
|
12859
12865
|
yn as EnterCommand,
|
|
12860
|
-
|
|
12866
|
+
wo as HorizontalLineCommand,
|
|
12861
12867
|
Lt as IDocClipboardService,
|
|
12862
12868
|
Ye as IEditorService,
|
|
12863
12869
|
Ba as IMEInputCommand,
|
|
@@ -12866,10 +12872,10 @@ export {
|
|
|
12866
12872
|
eA as InsertCustomRangeCommand,
|
|
12867
12873
|
Hn as ListOperationCommand,
|
|
12868
12874
|
Jr as MergeTwoParagraphCommand,
|
|
12869
|
-
|
|
12870
|
-
|
|
12875
|
+
Et as MoveCursorOperation,
|
|
12876
|
+
It as MoveSelectionOperation,
|
|
12871
12877
|
Yf as NORMAL_TEXT_SELECTION_PLUGIN_NAME,
|
|
12872
|
-
|
|
12878
|
+
mt as NodePositionConvertToCursor,
|
|
12873
12879
|
Va as NodePositionConvertToRectRange,
|
|
12874
12880
|
Tn as OrderListCommand,
|
|
12875
12881
|
Fd as PastePluginLark,
|
|
@@ -12886,30 +12892,30 @@ export {
|
|
|
12886
12892
|
Zn as SetDocZoomRatioCommand,
|
|
12887
12893
|
nt as SetDocZoomRatioOperation,
|
|
12888
12894
|
Qt as SetInlineFormatBoldCommand,
|
|
12889
|
-
|
|
12895
|
+
Rt as SetInlineFormatCommand,
|
|
12890
12896
|
tn as SetInlineFormatFontFamilyCommand,
|
|
12891
12897
|
ct as SetInlineFormatFontSizeCommand,
|
|
12892
12898
|
Ut as SetInlineFormatItalicCommand,
|
|
12893
12899
|
Ht as SetInlineFormatStrikethroughCommand,
|
|
12894
|
-
|
|
12900
|
+
Ct as SetInlineFormatSubscriptCommand,
|
|
12895
12901
|
kt as SetInlineFormatSuperscriptCommand,
|
|
12896
12902
|
Pt as SetInlineFormatTextBackgroundColorCommand,
|
|
12897
12903
|
Dt as SetInlineFormatTextColorCommand,
|
|
12898
12904
|
Ft as SetInlineFormatUnderlineCommand,
|
|
12899
12905
|
Ze as SetParagraphNamedStyleCommand,
|
|
12900
|
-
|
|
12901
|
-
|
|
12906
|
+
ko as SwitchDocModeCommand,
|
|
12907
|
+
mr as TEXT_RANGE_LAYER_INDEX,
|
|
12902
12908
|
Jt as TabCommand,
|
|
12903
12909
|
Zt as TextRange,
|
|
12904
12910
|
Na as ToggleCheckListCommand,
|
|
12905
|
-
|
|
12906
|
-
|
|
12911
|
+
Pr as UniverDocsUIPlugin,
|
|
12912
|
+
Ra as UpdateCommand,
|
|
12907
12913
|
je as VIEWPORT_KEY,
|
|
12908
12914
|
qf as addCustomDecorationBySelectionFactory,
|
|
12909
12915
|
dd as addCustomDecorationFactory,
|
|
12910
|
-
|
|
12916
|
+
nr as calcDocRangePositions,
|
|
12911
12917
|
jd as convertBodyToHtml,
|
|
12912
|
-
|
|
12918
|
+
Jo as convertPositionsToRectRanges,
|
|
12913
12919
|
Xf as deleteCustomDecorationFactory,
|
|
12914
12920
|
Jf as docDrawingPositionToTransform,
|
|
12915
12921
|
Ea as genTableSource,
|
|
@@ -12931,7 +12937,7 @@ export {
|
|
|
12931
12937
|
Zf as hasParagraphInTable,
|
|
12932
12938
|
Ha as isInSameTableCell,
|
|
12933
12939
|
oA as isValidRectRange,
|
|
12934
|
-
|
|
12940
|
+
pt as neoGetDocObject,
|
|
12935
12941
|
$f as transformToDocDrawingPosition,
|
|
12936
12942
|
_f as useKeyboardEvent,
|
|
12937
12943
|
Df as useResize,
|