@univerjs/docs-ui 0.8.0-beta.0 → 0.8.0-nightly.202505261607
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 +10 -10
- package/lib/es/index.js +431 -431
- package/lib/index.js +431 -431
- package/lib/umd/index.js +10 -10
- package/package.json +8 -8
- package/LICENSE +0 -176
package/lib/es/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var _c = Object.defineProperty;
|
|
2
2
|
var Pc = (n, e, t) => e in n ? _c(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
3
|
var O = (n, e, t) => Pc(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { IUniverInstanceService as L, Inject as z, Disposable as ge, toDisposable as _n, UniverInstanceType as _, BuildTextUtils as le, JSONX as W, ObjectRelativeFromV as ht, ObjectRelativeFromH as Ro, ICommandService as T, generateRandomId as Fe, DisposableCollection as En, CommandType as P, debounce as Dr, IUndoRedoService as bo, TextX as me, Tools as te, TextXActionType as G, DOC_RANGE_TYPE as He, RANGE_DIRECTION as _e, COLORS as fn, BooleanNumber as j, Rectangle as Dc, ILogService as wr, RxDisposable as Et, DataStreamTreeTokenType as V, isInternalEditorID as
|
|
4
|
+
import { IUniverInstanceService as L, Inject as z, Disposable as ge, toDisposable as _n, UniverInstanceType as _, BuildTextUtils as le, JSONX as W, ObjectRelativeFromV as ht, ObjectRelativeFromH as Ro, ICommandService as T, generateRandomId as Fe, DisposableCollection as En, CommandType as P, debounce as Dr, IUndoRedoService as bo, TextX as me, Tools as te, TextXActionType as G, DOC_RANGE_TYPE as He, RANGE_DIRECTION as _e, COLORS as fn, BooleanNumber as j, Rectangle as Dc, ILogService as wr, RxDisposable as Et, DataStreamTreeTokenType as V, isInternalEditorID as It, IContextService as Nr, Injector as Pn, createIdentifier as Gi, EDITOR_ACTIVATED as to, FOCUSING_EDITOR_STANDALONE as Ls, HorizontalAlign as Qe, VerticalAlign as wc, DEFAULT_EMPTY_DOCUMENT_VALUE as Yi, Direction as de, getPlainText as no, createInternalEditorID as Nc, LocaleService as Ke, DocumentFlavor as De, PresetListType as be, TableRowHeightRule as Lc, TableSizeType as Ki, TableTextWrapType as Qc, TableAlignmentType as Uc, MemoryCursor as Nt, SHEET_EDITOR_UNITS as In, UpdateDocsAttributeType as on, PositionedObjectLayoutType as yo, BlockType as Fc, LRUMap as Hc, BaselineOffset as ke, ColorKit as Qs, DrawingTypeEnum as Lr, skipParseTagNames as kc, CustomRangeType as Qr, DataStreamTreeNodeType as an, SliceBodyType as sr, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ur, normalizeBody as Vc, getBodySlice as qi, FOCUSING_DOC as Dn, DashStyleType as Wc, PRESET_LIST_TYPE as zc, NamedStyleType as K, PageOrientType as jc, PAPER_TYPES as Gc, PAGE_SIZE as ir, DOCS_ZEN_EDITOR_UNIT_ID_KEY as ot, ThemeService as Xi, DEFAULT_STYLES as Ji, NAMED_STYLE_MAP as Yc, fromEventSubject as Bt, deepCompare as Kc, sequenceExecuteAsync as Fr, FOCUSING_UNIVER_EDITOR as Hr, FOCUSING_COMMON_DRAWINGS as Zi, SpacingRule as Xt, IConfigService as kr, QuickListTypeMap as Wo, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as qc, checkForSubstrings as Xc, createInterceptorKey as $i, InterceptorManager as Jc, UndoCommandId as Us, RedoCommandId as Fs, DependentOn as Zc, Plugin as $c, merge as el, touchDependencies as Hs, mergeOverrideWithDependencies as tl } from "@univerjs/core";
|
|
5
5
|
import { DocSelectionManagerService as Y, RichTextEditingMutation as X, DocSkeletonManagerService as Ae, SetTextSelectionsOperation as Ne, DocStateEmitService as nl, DocInterceptorService as ol } from "@univerjs/docs";
|
|
6
|
-
import { DeviceInputEventType as ea, ScrollBar as ar, IRenderManagerService as fe, Liquid as ta, GlyphType as na, DocumentSkeletonPageType as xe, getPageFromPath as cr, getTableIdAndSliceIndex as ks, NORMAL_TEXT_SELECTION_PLUGIN_STYLE as
|
|
7
|
-
import { useDependency as Z, IShortcutService as xo, ILayoutService as Oo, KeyCode as q, MetaKeys as ne, useEvent as Sn, useObservable as tt, ComponentManager as sn, ISidebarService as ia, IClipboardInterfaceService as aa, FILE_PNG_CLIPBOARD_MIME_TYPE as
|
|
8
|
-
import qs, { useMemo as Me, useEffect as
|
|
6
|
+
import { DeviceInputEventType as ea, ScrollBar as ar, IRenderManagerService as fe, Liquid as ta, GlyphType as na, DocumentSkeletonPageType as xe, getPageFromPath as cr, getTableIdAndSliceIndex as ks, NORMAL_TEXT_SELECTION_PLUGIN_STYLE as vn, getColor as pn, RegularPolygon as oa, Rect as qn, getOffsetRectForDom as rl, ScrollTimer as sl, CURSOR_TYPE as Mt, getSystemHighlightColor as il, Vector2 as Cn, PageLayoutType as Rn, DocumentEditArea as Ie, Shape as al, Path as Vs, hasListGlyph as cl, isIndentByGlyph as ll, isFirstGlyph as dl, getParagraphByGlyph as Al, pixelToPt as ul, ptToPixel as Ws, parseDataStreamToTree as hl, pxToNum as ra, TRANSFORM_CHANGE_OBSERVABLE_TYPE as sa, getNumberUnitValue as rn, Viewport as gl, Layer as zs, Documents as fl, DocBackground as pl, getLastLine as ml, lineIterator as Sl, getLastColumn as El, UniverRenderEnginePlugin as Il } from "@univerjs/engine-render";
|
|
7
|
+
import { useDependency as Z, IShortcutService as xo, ILayoutService as Oo, KeyCode as q, MetaKeys as ne, useEvent as Sn, useObservable as tt, ComponentManager as sn, ISidebarService as ia, IClipboardInterfaceService as aa, FILE_PNG_CLIPBOARD_MIME_TYPE as vl, FILE__WEBP_CLIPBOARD_MIME_TYPE as Cl, FILE__JPEG_CLIPBOARD_MIME_TYPE as Rl, FILE__BMP_CLIPBOARD_MIME_TYPE as bl, HTML_CLIPBOARD_MIME_TYPE as ca, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as la, CopyCommand as yl, CutCommand as xl, PasteCommand as Ol, IConfirmService as da, getMenuHiddenObservable as ie, MenuItemType as J, COLOR_PICKER_COMPONENT as Aa, FONT_FAMILY_LIST as Tl, FONT_FAMILY_COMPONENT as Bl, FONT_FAMILY_ITEM_COMPONENT as Ml, FONT_SIZE_LIST as _l, FONT_SIZE_COMPONENT as Pl, HEADING_LIST as js, COMMON_LABEL_COMPONENT as Dl, HEADING_ITEM_COMPONENT as wl, ICanvasPopupService as Nl, IMenuManagerService as ua, ToolbarItem as Ll, MenuManagerPosition as Ql, RectPopup as Ul, DesktopMenu as Fl, ContextMenuPosition as oo, Slider as Hl, useConfigValue as ha, ContextMenuGroup as cn, RibbonInsertGroup as kl, RibbonStartGroup as Gs, IUIPartsService as Vl, BuiltInUIPart as Ys, connectInjector as Ks, imageMimeTypeSet as Wl, IContextMenuService as zl } from "@univerjs/ui";
|
|
8
|
+
import qs, { useMemo as Me, useEffect as ve, useCallback as ga, useState as pe, useLayoutEffect as fa, useRef as Ge, forwardRef as Oe, createElement as Te, useImperativeHandle as jl } from "react";
|
|
9
9
|
import { jsx as Q, jsxs as se, Fragment as Gl } from "react/jsx-runtime";
|
|
10
10
|
import { clsx as je, borderClassName as wn, Checkbox as Xs, InputNumber as it, Button as Yl, Select as pa, scrollbarClassName as Kl, Tooltip as ql } from "@univerjs/design";
|
|
11
11
|
import { Subject as Re, BehaviorSubject as Ue, merge as ma, filter as ro, takeUntil as gt, fromEvent as ze, Observable as Se, map as Nn, combineLatest as Ln, distinctUntilChanged as Wt, throttleTime as bn, switchMap as Xl, take as Jl, first as Zl, of as $l, animationFrameScheduler as ed } from "rxjs";
|
|
@@ -47,7 +47,7 @@ let _t = class extends ge {
|
|
|
47
47
|
customRanges: le.customRange.getCustomRangesInterestsWithSelection(i, (g = (u = p.getBody()) == null ? void 0 : u.customRanges) != null ? g : []),
|
|
48
48
|
commandId: e,
|
|
49
49
|
commandParams: t
|
|
50
|
-
}, E = o.find((
|
|
50
|
+
}, E = o.find((I) => I.match(m));
|
|
51
51
|
return (f = E == null ? void 0 : E.getMutations(m)) != null ? f : [];
|
|
52
52
|
}
|
|
53
53
|
return [];
|
|
@@ -252,7 +252,7 @@ function ep(n, e = 0, t = 0) {
|
|
|
252
252
|
}
|
|
253
253
|
function ud(n, e, t) {
|
|
254
254
|
const o = Z(T), r = Z(xo), s = Me(() => Fe(4), []);
|
|
255
|
-
|
|
255
|
+
ve(() => {
|
|
256
256
|
if (!t || !n || !e)
|
|
257
257
|
return;
|
|
258
258
|
const a = `sheet.operation.editor-${t.getEditorId()}-keyboard-${s}`, c = new En();
|
|
@@ -290,7 +290,7 @@ const hd = (n, e = !0, t, o) => {
|
|
|
290
290
|
}), a == null || a.resize(l, d);
|
|
291
291
|
}
|
|
292
292
|
}, [n, e]), s = Me(() => Dr(() => {
|
|
293
|
-
var E,
|
|
293
|
+
var E, I;
|
|
294
294
|
if (!t || !n || !t)
|
|
295
295
|
return;
|
|
296
296
|
const a = n.render.with(Ae).getSkeleton(), { scene: c, mainComponent: l } = n.render, d = c.getViewport(We.VIEW_MAIN), { actualWidth: A, actualHeight: h } = a.getActualSize(), { width: u, height: g } = n.getBoundingClientRect();
|
|
@@ -304,14 +304,14 @@ const hd = (n, e = !0, t, o) => {
|
|
|
304
304
|
enableVertical: !1,
|
|
305
305
|
enableHorizontal: !0,
|
|
306
306
|
minThumbSizeV: 8
|
|
307
|
-
}) : d == null || d.resetCanvasSizeAndUpdateScroll(), o && (d == null || d.scrollToBarPos({ x: 1 / 0, y: 0 }))) : (f = null, d == null || d.scrollToBarPos({ x: 0, y: 0 }), (
|
|
307
|
+
}) : d == null || d.resetCanvasSizeAndUpdateScroll(), o && (d == null || d.scrollToBarPos({ x: 1 / 0, y: 0 }))) : (f = null, d == null || d.scrollToBarPos({ x: 0, y: 0 }), (I = d == null ? void 0 : d.getScrollBar()) == null || I.dispose()) : h > g ? (f == null ? d && (f = new ar(d, {
|
|
308
308
|
enableHorizontal: !1,
|
|
309
309
|
enableVertical: !0,
|
|
310
310
|
barSize: 8,
|
|
311
311
|
minThumbSizeV: 8
|
|
312
312
|
})) : d == null || d.resetCanvasSizeAndUpdateScroll(), o && (d == null || d.scrollToBarPos({ x: 0, y: 1 / 0 }))) : (f = null, d == null || d.scrollToBarPos({ x: 0, y: 0 }), (E = d == null ? void 0 : d.getScrollBar()) == null || E.dispose());
|
|
313
313
|
}, 30), [n, t, e, o]);
|
|
314
|
-
return
|
|
314
|
+
return ve(() => {
|
|
315
315
|
if (t && n) {
|
|
316
316
|
const i = setTimeout(() => {
|
|
317
317
|
r(), s();
|
|
@@ -320,7 +320,7 @@ const hd = (n, e = !0, t, o) => {
|
|
|
320
320
|
clearTimeout(i);
|
|
321
321
|
};
|
|
322
322
|
}
|
|
323
|
-
}, [n, t, r, s]),
|
|
323
|
+
}, [n, t, r, s]), ve(() => {
|
|
324
324
|
if (t && n) {
|
|
325
325
|
const i = n.input$.subscribe(() => {
|
|
326
326
|
s();
|
|
@@ -355,8 +355,8 @@ const Sa = {
|
|
|
355
355
|
const { unitId: t, snapshot: o, textRanges: r, segmentId: s = "", options: i } = e, a = n.get(L), c = n.get(T), l = n.get(Y), d = a.getUnit(t, _.UNIVER_DOC), A = d == null ? void 0 : d.getSelfOrHeaderFooterModel(s).getSnapshot();
|
|
356
356
|
if (d == null || A == null)
|
|
357
357
|
return !1;
|
|
358
|
-
const { body: h, tableSource: u, footers: g, headers: f, lists: p, drawings: m, drawingsOrder: E, documentStyle:
|
|
359
|
-
body:
|
|
358
|
+
const { body: h, tableSource: u, footers: g, headers: f, lists: p, drawings: m, drawingsOrder: E, documentStyle: I } = te.deepClone(o), {
|
|
359
|
+
body: v,
|
|
360
360
|
tableSource: R,
|
|
361
361
|
footers: S,
|
|
362
362
|
headers: b,
|
|
@@ -365,9 +365,9 @@ const Sa = {
|
|
|
365
365
|
drawingsOrder: B,
|
|
366
366
|
documentStyle: x
|
|
367
367
|
} = A;
|
|
368
|
-
if (h == null ||
|
|
368
|
+
if (h == null || v == null)
|
|
369
369
|
return !1;
|
|
370
|
-
if (te.diffValue(h,
|
|
370
|
+
if (te.diffValue(h, v) && r)
|
|
371
371
|
return l.replaceDocRanges(r, {
|
|
372
372
|
unitId: t,
|
|
373
373
|
subUnitId: t
|
|
@@ -382,12 +382,12 @@ const Sa = {
|
|
|
382
382
|
};
|
|
383
383
|
i && (M.params.options = i);
|
|
384
384
|
const D = [], F = W.getInstance();
|
|
385
|
-
if (!te.diffValue(x,
|
|
386
|
-
const N = F.replaceOp(["documentStyle"], x,
|
|
385
|
+
if (!te.diffValue(x, I)) {
|
|
386
|
+
const N = F.replaceOp(["documentStyle"], x, I);
|
|
387
387
|
N != null && D.push(N);
|
|
388
388
|
}
|
|
389
|
-
if (!te.diffValue(h,
|
|
390
|
-
const N = F.replaceOp(["body"],
|
|
389
|
+
if (!te.diffValue(h, v)) {
|
|
390
|
+
const N = F.replaceOp(["body"], v, h);
|
|
391
391
|
N != null && D.push(N);
|
|
392
392
|
}
|
|
393
393
|
if (!te.diffValue(u, R)) {
|
|
@@ -467,7 +467,7 @@ function Ea(n, e, t, o, r) {
|
|
|
467
467
|
}, i = pd(e, t, o, r);
|
|
468
468
|
return s.params.actions = i, s;
|
|
469
469
|
}
|
|
470
|
-
const
|
|
470
|
+
const Ia = {
|
|
471
471
|
id: "doc.command.replace-selection",
|
|
472
472
|
type: P.COMMAND,
|
|
473
473
|
handler(n, e) {
|
|
@@ -623,18 +623,18 @@ class pt {
|
|
|
623
623
|
);
|
|
624
624
|
const { start: a, end: c } = dr(e, t);
|
|
625
625
|
return this._selectionIterator(a, c, (l, d, A, h, u, g) => {
|
|
626
|
-
const { lineHeight: f, asc: p, paddingTop: m, marginTop: E, marginBottom:
|
|
627
|
-
if (
|
|
626
|
+
const { lineHeight: f, asc: p, paddingTop: m, marginTop: E, marginBottom: I } = g, { glyphGroup: v, st: R } = u;
|
|
627
|
+
if (v.length === 0)
|
|
628
628
|
return;
|
|
629
629
|
const { x: S, y: b } = this._liquid;
|
|
630
630
|
let y, C;
|
|
631
|
-
const B =
|
|
632
|
-
if (l === 0 && d ===
|
|
631
|
+
const B = v[l], x = v[d], M = v[l - 1], D = (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) === na.LIST, { startOffset: $, endOffset: U } = Sd(v, l, d, R), H = a.glyph === l && A ? a.isBack : !0, k = c.glyph === d && h ? c.isBack : !1, oe = a === c, ae = H && M != null ? M : B;
|
|
632
|
+
if (l === 0 && d === v.length - 1)
|
|
633
633
|
y = {
|
|
634
634
|
startX: S + D + (ee ? F : 0),
|
|
635
635
|
startY: b,
|
|
636
636
|
endX: S + w + (k ? 0 : N),
|
|
637
|
-
endY: b + f - E -
|
|
637
|
+
endY: b + f - E - I
|
|
638
638
|
}, C = {
|
|
639
639
|
startX: S + D + (ee ? F : 0),
|
|
640
640
|
startY: b + m + p - ae.bBox.ba,
|
|
@@ -647,7 +647,7 @@ class pt {
|
|
|
647
647
|
startX: S + D + (ce ? 0 : F),
|
|
648
648
|
startY: b,
|
|
649
649
|
endX: S + w + (k ? 0 : N),
|
|
650
|
-
endY: b + f - E -
|
|
650
|
+
endY: b + f - E - I
|
|
651
651
|
}, C = {
|
|
652
652
|
startX: S + D + (ce ? 0 : F),
|
|
653
653
|
startY: b + m + p - ae.bBox.ba,
|
|
@@ -723,7 +723,7 @@ class pt {
|
|
|
723
723
|
}
|
|
724
724
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
725
725
|
_selectionIterator(e, t, o) {
|
|
726
|
-
var
|
|
726
|
+
var v, R;
|
|
727
727
|
const r = this._docSkeleton;
|
|
728
728
|
if (!r)
|
|
729
729
|
return [];
|
|
@@ -740,11 +740,11 @@ class pt {
|
|
|
740
740
|
const b = c[S];
|
|
741
741
|
this._liquid.translatePage(b, f, p, m);
|
|
742
742
|
}
|
|
743
|
-
const
|
|
744
|
-
for (let S = E; S <=
|
|
743
|
+
const I = s === xe.BODY || s === xe.CELL ? u : g;
|
|
744
|
+
for (let S = E; S <= I; S++) {
|
|
745
745
|
const b = c[S], { headerId: y, footerId: C, pageWidth: B } = b;
|
|
746
746
|
let x = b;
|
|
747
|
-
if (s === xe.HEADER ? x = (
|
|
747
|
+
if (s === xe.HEADER ? x = (v = l.get(y)) == null ? void 0 : v.get(B) : s === xe.FOOTER ? x = (R = d.get(C)) == null ? void 0 : R.get(B) : s === xe.CELL && (x = cr(a, i)), x == null) {
|
|
748
748
|
this._liquid.translatePage(b, f, p, m);
|
|
749
749
|
continue;
|
|
750
750
|
}
|
|
@@ -816,7 +816,7 @@ class pt {
|
|
|
816
816
|
$e
|
|
817
817
|
);
|
|
818
818
|
let ws = !1, Ns = !1;
|
|
819
|
-
S === E && w === D && H === $ && re === ae && $e === Ze && (ws = !0), S ===
|
|
819
|
+
S === E && w === D && H === $ && re === ae && $e === Ze && (ws = !0), S === I && w === F && H === U && re === ce && $e === At && (Ns = !0), o && o(Bc, Mc, ws, Ns, Vo, he, k, N, x), this._liquid.translateRestore();
|
|
820
820
|
}
|
|
821
821
|
this._liquid.translateRestore();
|
|
822
822
|
}
|
|
@@ -836,23 +836,23 @@ function Ed(n, e) {
|
|
|
836
836
|
const A = t[s], h = o[s], u = t[i], g = o[i];
|
|
837
837
|
return !(A === h && u === g && c === d);
|
|
838
838
|
}
|
|
839
|
-
function
|
|
839
|
+
function va(n, e) {
|
|
840
840
|
const { path: t } = n, { path: o } = e;
|
|
841
841
|
return t.indexOf("cells") === -1 || o.indexOf("cells") === -1 || t.length !== o.length ? !1 : te.diffValue(t, o);
|
|
842
842
|
}
|
|
843
843
|
function Ca(n, e, t) {
|
|
844
|
-
var u, g, f, p, m, E,
|
|
844
|
+
var u, g, f, p, m, E, I, v;
|
|
845
845
|
const { path: o } = e, { path: r } = t;
|
|
846
846
|
if (o.indexOf("cells") === -1 || r.indexOf("cells") === -1)
|
|
847
847
|
return !1;
|
|
848
|
-
const s = n.findGlyphByPosition(e), i = n.findGlyphByPosition(t), a = (p = (f = (g = (u = s == null ? void 0 : s.parent) == null ? void 0 : u.parent) == null ? void 0 : g.parent) == null ? void 0 : f.parent) == null ? void 0 : p.parent, c = (
|
|
848
|
+
const s = n.findGlyphByPosition(e), i = n.findGlyphByPosition(t), a = (p = (f = (g = (u = s == null ? void 0 : s.parent) == null ? void 0 : u.parent) == null ? void 0 : g.parent) == null ? void 0 : f.parent) == null ? void 0 : p.parent, c = (v = (I = (E = (m = i == null ? void 0 : i.parent) == null ? void 0 : m.parent) == null ? void 0 : E.parent) == null ? void 0 : I.parent) == null ? void 0 : v.parent;
|
|
849
849
|
if (a == null || c == null)
|
|
850
850
|
return !1;
|
|
851
851
|
const l = a.parent, d = c.parent, A = l.cells.indexOf(a), h = d.cells.indexOf(c);
|
|
852
852
|
return A === h && l.index === d.index;
|
|
853
853
|
}
|
|
854
854
|
function jo(n, e) {
|
|
855
|
-
if (
|
|
855
|
+
if (va(n, e))
|
|
856
856
|
return jr(n, e);
|
|
857
857
|
const { path: t } = n, { path: o } = e, r = t[t.length - 5], s = o[o.length - 5];
|
|
858
858
|
if (r !== s && typeof r == "string" && typeof s == "string") {
|
|
@@ -865,7 +865,7 @@ function jo(n, e) {
|
|
|
865
865
|
function zt(n) {
|
|
866
866
|
return n.sections[0].columns[0].lines.length === 0;
|
|
867
867
|
}
|
|
868
|
-
function
|
|
868
|
+
function Id(n, e, t) {
|
|
869
869
|
let o = e, r = t, s = n[o], i = n[r];
|
|
870
870
|
for (; o < r && (zt(s) || zt(i)); )
|
|
871
871
|
zt(s) ? (o++, s = n[o]) : zt(i) && (r--, i = n[r]);
|
|
@@ -893,13 +893,13 @@ class Ra {
|
|
|
893
893
|
endColumnIndex: f
|
|
894
894
|
} = d;
|
|
895
895
|
this._liquid.reset();
|
|
896
|
-
const { pageLayoutType: p, pageMarginLeft: m, pageMarginTop: E } = this._documentOffsetConfig,
|
|
897
|
-
for (let
|
|
898
|
-
const R = i[
|
|
896
|
+
const { pageLayoutType: p, pageMarginLeft: m, pageMarginTop: E } = this._documentOffsetConfig, I = l === xe.BODY || l === xe.CELL ? c : a;
|
|
897
|
+
for (let v = 0; v < I; v++) {
|
|
898
|
+
const R = i[v];
|
|
899
899
|
this._liquid.translatePage(R, p, m, E);
|
|
900
900
|
}
|
|
901
|
-
for (let
|
|
902
|
-
const R = i[
|
|
901
|
+
for (let v = I; v < i.length; v++) {
|
|
902
|
+
const R = i[v];
|
|
903
903
|
this._liquid.translatePagePadding(R);
|
|
904
904
|
const { skeTables: S } = R;
|
|
905
905
|
let b = null;
|
|
@@ -913,7 +913,7 @@ class Ra {
|
|
|
913
913
|
const { x: y, y: C } = this._liquid, { left: B } = b;
|
|
914
914
|
for (const x of b.rows)
|
|
915
915
|
if (x.index >= h && x.index <= g) {
|
|
916
|
-
const M =
|
|
916
|
+
const M = Id(x.cells, u, f);
|
|
917
917
|
if (M == null)
|
|
918
918
|
continue;
|
|
919
919
|
const [D, F] = M, w = {
|
|
@@ -947,21 +947,21 @@ class Ra {
|
|
|
947
947
|
return;
|
|
948
948
|
const g = u.children[0].children.length;
|
|
949
949
|
if (d === 0 && h === g - 1) {
|
|
950
|
-
const p = u.children[l].children[d], m = this._docSkeleton.findNodePositionByCharIndex(p.startIndex + 1), E = u.children[A].children[h],
|
|
951
|
-
if (m == null ||
|
|
950
|
+
const p = u.children[l].children[d], m = this._docSkeleton.findNodePositionByCharIndex(p.startIndex + 1), E = u.children[A].children[h], I = this._docSkeleton.findNodePositionByCharIndex(E.endIndex - 2);
|
|
951
|
+
if (m == null || I == null)
|
|
952
952
|
return;
|
|
953
953
|
o.push({
|
|
954
|
-
anchor: i ? m :
|
|
955
|
-
focus: i ?
|
|
954
|
+
anchor: i ? m : I,
|
|
955
|
+
focus: i ? I : m
|
|
956
956
|
});
|
|
957
957
|
} else
|
|
958
958
|
for (let p = l; p <= A; p++) {
|
|
959
|
-
const m = u.children[p], E = m.children[d],
|
|
960
|
-
if (
|
|
959
|
+
const m = u.children[p], E = m.children[d], I = m.children[h], v = this._docSkeleton.findNodePositionByCharIndex(E.startIndex + 1), R = this._docSkeleton.findNodePositionByCharIndex(I.endIndex - 2);
|
|
960
|
+
if (v == null || R == null)
|
|
961
961
|
return;
|
|
962
962
|
o.push({
|
|
963
|
-
anchor: i ?
|
|
964
|
-
focus: i ? R :
|
|
963
|
+
anchor: i ? v : R,
|
|
964
|
+
focus: i ? R : v
|
|
965
965
|
});
|
|
966
966
|
}
|
|
967
967
|
return o;
|
|
@@ -984,7 +984,7 @@ class Ra {
|
|
|
984
984
|
};
|
|
985
985
|
}
|
|
986
986
|
}
|
|
987
|
-
const
|
|
987
|
+
const vd = "__TestSelectionRange__", Cd = "__TestSelectionAnchor__", ei = 6, Go = 500, Rd = 500, ur = 3;
|
|
988
988
|
function Jn(n) {
|
|
989
989
|
const e = n[0], t = e[0], o = e[2], { x: r, y: s } = t, { x: i, y: a } = o;
|
|
990
990
|
return {
|
|
@@ -1008,7 +1008,7 @@ function Gr(n) {
|
|
|
1008
1008
|
});
|
|
1009
1009
|
}
|
|
1010
1010
|
class Jt {
|
|
1011
|
-
constructor(e, t, o, r, s, i =
|
|
1011
|
+
constructor(e, t, o, r, s, i = vn, a = "", c = -1) {
|
|
1012
1012
|
O(this, "rangeType", He.TEXT);
|
|
1013
1013
|
// Identifies whether the range is the current one, most of which is the last range.
|
|
1014
1014
|
O(this, "_current", !1);
|
|
@@ -1176,7 +1176,7 @@ class Jt {
|
|
|
1176
1176
|
this._rangeShape.translate(t, o), this._rangeShape.updatePointGroup(e), this._rangeShape.show();
|
|
1177
1177
|
return;
|
|
1178
1178
|
}
|
|
1179
|
-
const r = 0.3, s = new oa(
|
|
1179
|
+
const r = 0.3, s = new oa(vd + te.generateRandomId(ei), {
|
|
1180
1180
|
pointsGroup: e,
|
|
1181
1181
|
fill: ((i = this.style) == null ? void 0 : i.fill) || pn(fn.black, r),
|
|
1182
1182
|
left: t,
|
|
@@ -1214,7 +1214,7 @@ class Jt {
|
|
|
1214
1214
|
}
|
|
1215
1215
|
}
|
|
1216
1216
|
const bd = "__DocTableRectRange__", yd = 6;
|
|
1217
|
-
function Yo(n, e, t, o, r, s =
|
|
1217
|
+
function Yo(n, e, t, o, r, s = vn, i = "", a = -1) {
|
|
1218
1218
|
const c = e.getOffsetConfig(), d = new Ra(c, t).getNodePositionGroup(o, r);
|
|
1219
1219
|
return (d != null ? d : []).map((A) => new ba(
|
|
1220
1220
|
n,
|
|
@@ -1228,7 +1228,7 @@ function Yo(n, e, t, o, r, s = In, i = "", a = -1) {
|
|
|
1228
1228
|
));
|
|
1229
1229
|
}
|
|
1230
1230
|
class ba {
|
|
1231
|
-
constructor(e, t, o, r, s, i =
|
|
1231
|
+
constructor(e, t, o, r, s, i = vn, a = "", c = -1) {
|
|
1232
1232
|
O(this, "rangeType", He.RECT);
|
|
1233
1233
|
// The rendered rect range
|
|
1234
1234
|
O(this, "_rangeShape");
|
|
@@ -1392,26 +1392,26 @@ function Od(n, e, t, o, r, s, i, a) {
|
|
|
1392
1392
|
function hr(n, e, t, o, r, s, i, a) {
|
|
1393
1393
|
const c = [], l = [], d = [t, o, r, n, e, s, i, a];
|
|
1394
1394
|
if (Ca(r, n, e)) {
|
|
1395
|
-
if (
|
|
1395
|
+
if (va(n, e))
|
|
1396
1396
|
return c.push(new Jt(...d)), {
|
|
1397
1397
|
textRanges: c,
|
|
1398
1398
|
rectRanges: l
|
|
1399
1399
|
};
|
|
1400
1400
|
{
|
|
1401
|
-
const
|
|
1401
|
+
const I = Yo(
|
|
1402
1402
|
...d
|
|
1403
1403
|
);
|
|
1404
|
-
return l.push(...
|
|
1404
|
+
return l.push(...I), {
|
|
1405
1405
|
textRanges: c,
|
|
1406
1406
|
rectRanges: l
|
|
1407
1407
|
};
|
|
1408
1408
|
}
|
|
1409
1409
|
}
|
|
1410
1410
|
if (Ed(n, e)) {
|
|
1411
|
-
const
|
|
1411
|
+
const I = Yo(
|
|
1412
1412
|
...d
|
|
1413
1413
|
);
|
|
1414
|
-
return l.push(...
|
|
1414
|
+
return l.push(...I), {
|
|
1415
1415
|
textRanges: c,
|
|
1416
1416
|
rectRanges: l
|
|
1417
1417
|
};
|
|
@@ -1421,9 +1421,9 @@ function hr(n, e, t, o, r, s, i, a) {
|
|
|
1421
1421
|
return;
|
|
1422
1422
|
const g = h <= u ? _e.FORWARD : _e.BACKWARD, f = Math.min(h, u), p = Math.max(h, u);
|
|
1423
1423
|
let m = f, E = p;
|
|
1424
|
-
for (const
|
|
1425
|
-
for (const
|
|
1426
|
-
const { startIndex: R, endIndex: S, children: b } =
|
|
1424
|
+
for (const I of A.getChildren())
|
|
1425
|
+
for (const v of I.children) {
|
|
1426
|
+
const { startIndex: R, endIndex: S, children: b } = v, y = I.children.indexOf(v), C = I.children[y + 1], B = b[0];
|
|
1427
1427
|
let x = !1;
|
|
1428
1428
|
if (B) {
|
|
1429
1429
|
const { startIndex: M, endIndex: D, children: F } = B;
|
|
@@ -1587,7 +1587,7 @@ let Ce = class extends Et {
|
|
|
1587
1587
|
O(this, "_focusNodePosition", null);
|
|
1588
1588
|
O(this, "_currentSegmentId", "");
|
|
1589
1589
|
O(this, "_currentSegmentPage", -1);
|
|
1590
|
-
O(this, "_selectionStyle",
|
|
1590
|
+
O(this, "_selectionStyle", vn);
|
|
1591
1591
|
O(this, "_onPointerEvent", !1);
|
|
1592
1592
|
O(this, "_viewPortObserverMap", /* @__PURE__ */ new Map());
|
|
1593
1593
|
O(this, "_isIMEInputApply", !1);
|
|
@@ -1631,7 +1631,7 @@ let Ce = class extends Et {
|
|
|
1631
1631
|
setReserveRangesStatus(e) {
|
|
1632
1632
|
this._reserveRanges = e;
|
|
1633
1633
|
}
|
|
1634
|
-
_setRangeStyle(e =
|
|
1634
|
+
_setRangeStyle(e = vn) {
|
|
1635
1635
|
this._selectionStyle = e;
|
|
1636
1636
|
}
|
|
1637
1637
|
// eslint-disable-next-line max-lines-per-function
|
|
@@ -1836,10 +1836,10 @@ let Ce = class extends Et {
|
|
|
1836
1836
|
this._scrollTimers.push(h), h.startScroll(s, i), this._onSelectionStart$.next((f = this._getActiveRangeInstance()) == null ? void 0 : f.startNodePosition), (p = t.getTransformer()) == null || p.clearSelectedObjects();
|
|
1837
1837
|
let u = s, g = i;
|
|
1838
1838
|
this._onPointerEvent = !0, this._scenePointerMoveSubs.push(t.onPointerMove$.subscribeEvent((m) => {
|
|
1839
|
-
const { offsetX: E, offsetY:
|
|
1840
|
-
t.setCursor(Mt.TEXT), !(Math.sqrt((E - u) ** 2 + (
|
|
1841
|
-
this._moving(E,
|
|
1842
|
-
}), u = E, g =
|
|
1839
|
+
const { offsetX: E, offsetY: I } = m;
|
|
1840
|
+
t.setCursor(Mt.TEXT), !(Math.sqrt((E - u) ** 2 + (I - g) ** 2) < 3) && (this._moving(E, I), h.scrolling(E, I, () => {
|
|
1841
|
+
this._moving(E, I);
|
|
1842
|
+
}), u = E, g = I);
|
|
1843
1843
|
})), this._scenePointerUpSubs.push(t.onPointerUp$.subscribeEvent(() => {
|
|
1844
1844
|
if ([...this._scenePointerMoveSubs, ...this._scenePointerUpSubs].forEach((E) => {
|
|
1845
1845
|
E.unsubscribe();
|
|
@@ -2447,7 +2447,7 @@ class Pd extends ge {
|
|
|
2447
2447
|
return (o = this._injector.get(fe).getRenderById(this._getEditorId())) == null ? void 0 : o.with(Ae).getSkeleton();
|
|
2448
2448
|
}
|
|
2449
2449
|
isSheetEditor() {
|
|
2450
|
-
return
|
|
2450
|
+
return It(this._getEditorId());
|
|
2451
2451
|
}
|
|
2452
2452
|
/**
|
|
2453
2453
|
* @deprecated use getDocumentData.
|
|
@@ -2559,7 +2559,7 @@ let fr = class extends ge {
|
|
|
2559
2559
|
return;
|
|
2560
2560
|
this._univerInstanceService.setCurrentUnitForType(e);
|
|
2561
2561
|
const o = t.getValue().length;
|
|
2562
|
-
this._contextService.setContextValue(to, !0),
|
|
2562
|
+
this._contextService.setContextValue(to, !0), It(e) || this._contextService.setContextValue(Ls, !0), t.focus(), this._setFocusId(e), this._focus$.next({
|
|
2563
2563
|
startOffset: o,
|
|
2564
2564
|
endOffset: o
|
|
2565
2565
|
});
|
|
@@ -2697,7 +2697,7 @@ const mt = {
|
|
|
2697
2697
|
const r = Z(T), s = Z(xo), i = Ge(e);
|
|
2698
2698
|
i.current = e;
|
|
2699
2699
|
const a = Ge(o);
|
|
2700
|
-
a.current = o,
|
|
2700
|
+
a.current = o, ve(() => {
|
|
2701
2701
|
if (!t || !n)
|
|
2702
2702
|
return;
|
|
2703
2703
|
const l = `sheet.formula-embedding-editor.${t.getEditorId()}`, d = new En(), A = (u, g) => {
|
|
@@ -2754,7 +2754,7 @@ const mt = {
|
|
|
2754
2754
|
};
|
|
2755
2755
|
function Ud(n, e) {
|
|
2756
2756
|
const t = Z(T);
|
|
2757
|
-
|
|
2757
|
+
ve(() => {
|
|
2758
2758
|
if (!n) return;
|
|
2759
2759
|
const o = t.onCommandExecuted((r) => {
|
|
2760
2760
|
var s, i;
|
|
@@ -2789,7 +2789,7 @@ const tp = (n) => {
|
|
|
2789
2789
|
icon: f,
|
|
2790
2790
|
editorRef: p,
|
|
2791
2791
|
placeholder: m
|
|
2792
|
-
} = n, E = Z(Ye),
|
|
2792
|
+
} = n, E = Z(Ye), I = Sn(o), v = Sn(s), [R, S] = pe(u), b = qs.useRef(null), y = Me(() => d != null ? d : Nc(`RICH_TEXT_EDITOR-${Fe(4)}`), [d]), C = Ld({
|
|
2793
2793
|
editorId: y,
|
|
2794
2794
|
initialValue: r,
|
|
2795
2795
|
container: b,
|
|
@@ -2813,7 +2813,7 @@ const tp = (n) => {
|
|
|
2813
2813
|
const oe = x == null ? void 0 : x.with(Ae), ae = oe == null ? void 0 : oe.getSkeleton().getActualSize();
|
|
2814
2814
|
ae && (A == null || A(ae.actualHeight), S(Math.max(u, Math.min(ae.actualHeight + 10, g)))), h == null || h(k, no((re = (ce = k.body) == null ? void 0 : ce.dataStream) != null ? re : "")), $();
|
|
2815
2815
|
});
|
|
2816
|
-
return
|
|
2816
|
+
return ve(() => {
|
|
2817
2817
|
var oe, ae;
|
|
2818
2818
|
ee(!le.transform.getPlainText((ae = (oe = C == null ? void 0 : C.getDocumentData().body) == null ? void 0 : oe.dataStream) != null ? ae : ""));
|
|
2819
2819
|
const k = C == null ? void 0 : C.selectionChange$.subscribe(() => {
|
|
@@ -2821,21 +2821,21 @@ const tp = (n) => {
|
|
|
2821
2821
|
ee(!le.transform.getPlainText((re = (ce = C == null ? void 0 : C.getDocumentData().body) == null ? void 0 : ce.dataStream) != null ? re : ""));
|
|
2822
2822
|
});
|
|
2823
2823
|
return () => k == null ? void 0 : k.unsubscribe();
|
|
2824
|
-
}, [C]), tt(C == null ? void 0 : C.blur$), tt(C == null ? void 0 : C.focus$),
|
|
2824
|
+
}, [C]), tt(C == null ? void 0 : C.blur$), tt(C == null ? void 0 : C.focus$), ve(() => {
|
|
2825
2825
|
var oe, ae;
|
|
2826
2826
|
const k = C == null ? void 0 : C.getDocumentData();
|
|
2827
|
-
|
|
2828
|
-
}, [F,
|
|
2827
|
+
I == null || I(F, no((ae = (oe = k == null ? void 0 : k.body) == null ? void 0 : oe.dataStream) != null ? ae : ""));
|
|
2828
|
+
}, [F, I]), ve(() => {
|
|
2829
2829
|
const k = (ae) => {
|
|
2830
2830
|
var re, he;
|
|
2831
|
-
E.getFocusId() !== y || ((he = (re = ae.target) == null ? void 0 : re.dataset) == null ? void 0 : he.editorid) === y || w.current && !w.current.contains(ae.target) && (
|
|
2831
|
+
E.getFocusId() !== y || ((he = (re = ae.target) == null ? void 0 : re.dataset) == null ? void 0 : he.editorid) === y || w.current && !w.current.contains(ae.target) && (v == null || v());
|
|
2832
2832
|
}, oe = setTimeout(() => {
|
|
2833
2833
|
document.addEventListener("click", k);
|
|
2834
2834
|
}, 100);
|
|
2835
2835
|
return () => {
|
|
2836
2836
|
document.removeEventListener("click", k), clearTimeout(oe);
|
|
2837
2837
|
};
|
|
2838
|
-
}, [C, y, E,
|
|
2838
|
+
}, [C, y, E, v]), Qd(F && a, !1, C), ud(F, i, C), Ud(C, U), /* @__PURE__ */ Q("div", { className: e, style: c, children: /* @__PURE__ */ se(
|
|
2839
2839
|
"div",
|
|
2840
2840
|
{
|
|
2841
2841
|
className: je("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", wn, {
|
|
@@ -3072,7 +3072,7 @@ function Va(n) {
|
|
|
3072
3072
|
const pr = "COMPONENT_DOC_HEADER_FOOTER_PANEL";
|
|
3073
3073
|
function iA(n, e, t) {
|
|
3074
3074
|
const { useFirstPageHeaderFooter: o, evenAndOddHeaders: r, defaultHeaderId: s, defaultFooterId: i, firstPageHeaderId: a, firstPageFooterId: c, evenPageHeaderId: l, evenPageFooterId: d } = n;
|
|
3075
|
-
return e ===
|
|
3075
|
+
return e === Ie.HEADER ? o === j.TRUE ? t === 0 ? a : r === j.TRUE && t % 2 === 1 ? l : s : r === j.TRUE && t % 2 === 1 ? l : s : o === j.TRUE ? t === 0 ? c : r === j.TRUE && t % 2 === 1 ? d : i : r === j.TRUE && t % 2 === 1 ? d : i;
|
|
3076
3076
|
}
|
|
3077
3077
|
const aA = (n) => {
|
|
3078
3078
|
const e = Z(Ke), t = Z(L), o = Z(fe), r = Z(T), s = Z(Oo), { unitId: i } = n, a = o.getRenderById(i).with(Ce), [c, l] = pe({}), d = (u, g) => {
|
|
@@ -3084,11 +3084,11 @@ const aA = (n) => {
|
|
|
3084
3084
|
const f = t.getUniverDocInstance(i), p = f == null ? void 0 : f.getSnapshot().documentStyle, m = (b = o.getRenderById(i)) == null ? void 0 : b.with(Ae), E = m == null ? void 0 : m.getViewModel();
|
|
3085
3085
|
if (p == null || E == null)
|
|
3086
3086
|
return;
|
|
3087
|
-
const
|
|
3088
|
-
let
|
|
3087
|
+
const I = E.getEditArea();
|
|
3088
|
+
let v = !1;
|
|
3089
3089
|
const R = a.getSegmentPage();
|
|
3090
3090
|
let S = !1;
|
|
3091
|
-
if (g === "useFirstPageHeaderFooter" && u === !0 && ((
|
|
3091
|
+
if (g === "useFirstPageHeaderFooter" && u === !0 && ((I === Ie.HEADER && !p.firstPageHeaderId || I === Ie.FOOTER && !p.firstPageFooterId) && (v = !0), v && R === 0 && (S = !0)), g === "evenAndOddHeaders" && u === !0 && ((I === Ie.HEADER && !p.evenPageHeaderId || I === Ie.FOOTER && !p.evenPageFooterId) && (v = !0), v && R % 2 === 1 && (S = !0)), v) {
|
|
3092
3092
|
const C = te.generateRandomId(6);
|
|
3093
3093
|
S && a.setSegment(C), r.executeCommand(Zn, {
|
|
3094
3094
|
unitId: i,
|
|
@@ -3103,7 +3103,7 @@ const aA = (n) => {
|
|
|
3103
3103
|
...p,
|
|
3104
3104
|
[g]: u ? j.TRUE : j.FALSE
|
|
3105
3105
|
},
|
|
3106
|
-
|
|
3106
|
+
I,
|
|
3107
3107
|
y
|
|
3108
3108
|
);
|
|
3109
3109
|
B && B !== C && a.setSegment(B), r.executeCommand(Zn, {
|
|
@@ -3129,7 +3129,7 @@ const aA = (n) => {
|
|
|
3129
3129
|
unitId: i
|
|
3130
3130
|
});
|
|
3131
3131
|
};
|
|
3132
|
-
return
|
|
3132
|
+
return ve(() => {
|
|
3133
3133
|
const u = t.getUniverDocInstance(i), g = u == null ? void 0 : u.getSnapshot().documentStyle;
|
|
3134
3134
|
if (g) {
|
|
3135
3135
|
const {
|
|
@@ -3207,11 +3207,11 @@ const aA = (n) => {
|
|
|
3207
3207
|
}, cA = () => {
|
|
3208
3208
|
var l;
|
|
3209
3209
|
const n = Z(Ke), e = Z(fe), r = Z(L).getCurrentUniverDocInstance().getUnitId(), i = ((l = e.getRenderById(r)) == null ? void 0 : l.with(Ae)).getViewModel(), [a, c] = pe(!0);
|
|
3210
|
-
return
|
|
3210
|
+
return ve(() => {
|
|
3211
3211
|
const d = i.getEditArea();
|
|
3212
|
-
c(d !==
|
|
3212
|
+
c(d !== Ie.BODY);
|
|
3213
3213
|
const A = i.editAreaChange$.subscribe((h) => {
|
|
3214
|
-
h != null && c(h !==
|
|
3214
|
+
h != null && c(h !== Ie.BODY);
|
|
3215
3215
|
});
|
|
3216
3216
|
return () => {
|
|
3217
3217
|
A.unsubscribe();
|
|
@@ -3284,12 +3284,12 @@ function hA(n, e, t) {
|
|
|
3284
3284
|
useFirstPageHeaderFooter: A
|
|
3285
3285
|
} = o;
|
|
3286
3286
|
switch (e) {
|
|
3287
|
-
case
|
|
3287
|
+
case Ie.BODY:
|
|
3288
3288
|
return {
|
|
3289
3289
|
createType: null,
|
|
3290
3290
|
headerFooterId: null
|
|
3291
3291
|
};
|
|
3292
|
-
case
|
|
3292
|
+
case Ie.HEADER:
|
|
3293
3293
|
return A === j.TRUE && !c ? {
|
|
3294
3294
|
createType: 0,
|
|
3295
3295
|
headerFooterId: null
|
|
@@ -3303,7 +3303,7 @@ function hA(n, e, t) {
|
|
|
3303
3303
|
createType: 2,
|
|
3304
3304
|
headerFooterId: null
|
|
3305
3305
|
};
|
|
3306
|
-
case
|
|
3306
|
+
case Ie.FOOTER:
|
|
3307
3307
|
return A === j.TRUE && !l ? {
|
|
3308
3308
|
createType: 1,
|
|
3309
3309
|
headerFooterId: null
|
|
@@ -3336,7 +3336,7 @@ let mr = class extends ge {
|
|
|
3336
3336
|
this._commandService.onCommandExecuted((e) => {
|
|
3337
3337
|
if (X.id === e.id) {
|
|
3338
3338
|
const t = this._context.unit, r = this._docSkeletonManagerService.getViewModel().getEditArea(), s = t.getSnapshot().documentStyle.documentFlavor;
|
|
3339
|
-
r !==
|
|
3339
|
+
r !== Ie.BODY && s === De.MODERN && this._commandService.executeCommand(qr.id, {
|
|
3340
3340
|
unitId: this._context.unitId
|
|
3341
3341
|
});
|
|
3342
3342
|
}
|
|
@@ -3372,14 +3372,14 @@ let mr = class extends ge {
|
|
|
3372
3372
|
return;
|
|
3373
3373
|
A.setEditArea(g);
|
|
3374
3374
|
const { createType: p, headerFooterId: m } = hA(A, g, f);
|
|
3375
|
-
if (g ===
|
|
3375
|
+
if (g === Ie.BODY)
|
|
3376
3376
|
this._docSelectionRenderService.setSegment(""), this._docSelectionRenderService.setSegmentPage(-1), this._docSelectionRenderService.setCursorManually(s, i);
|
|
3377
3377
|
else if (p != null) {
|
|
3378
|
-
const
|
|
3379
|
-
this._docSelectionRenderService.setSegment(
|
|
3378
|
+
const I = te.generateRandomId(6);
|
|
3379
|
+
this._docSelectionRenderService.setSegment(I), this._docSelectionRenderService.setSegmentPage(f), await this._commandService.executeCommand(Wa.id, {
|
|
3380
3380
|
unitId: e,
|
|
3381
3381
|
createType: p,
|
|
3382
|
-
segmentId:
|
|
3382
|
+
segmentId: I
|
|
3383
3383
|
});
|
|
3384
3384
|
} else m != null && (this._docSelectionRenderService.setSegment(m), this._docSelectionRenderService.setSegmentPage(f), this._docSelectionRenderService.setCursorManually(s, i));
|
|
3385
3385
|
}));
|
|
@@ -3407,7 +3407,7 @@ let mr = class extends ge {
|
|
|
3407
3407
|
i.pageRender$.subscribe((a) => {
|
|
3408
3408
|
if (this._editorService.isEditor(o) || !this._isTraditionalMode())
|
|
3409
3409
|
return;
|
|
3410
|
-
const d = this._docSkeletonManagerService.getViewModel().getEditArea() ===
|
|
3410
|
+
const d = this._docSkeletonManagerService.getViewModel().getEditArea() === Ie.BODY, { page: A, pageLeft: h, pageTop: u, ctx: g } = a, { pageWidth: f, pageHeight: p, marginTop: m, marginBottom: E } = A;
|
|
3411
3411
|
if (g.save(), g.translate(h - 0.5, u - 0.5), d ? (qn.drawWith(g, {
|
|
3412
3412
|
left: 0,
|
|
3413
3413
|
top: 0,
|
|
@@ -3427,7 +3427,7 @@ let mr = class extends ge {
|
|
|
3427
3427
|
height: p - m - E,
|
|
3428
3428
|
fill: "rgba(255, 255, 255, 0.5)"
|
|
3429
3429
|
}), g.restore()), !d) {
|
|
3430
|
-
const
|
|
3430
|
+
const I = {
|
|
3431
3431
|
dataArray: [{
|
|
3432
3432
|
command: "M",
|
|
3433
3433
|
points: [0, m]
|
|
@@ -3437,7 +3437,7 @@ let mr = class extends ge {
|
|
|
3437
3437
|
}],
|
|
3438
3438
|
strokeWidth: 1,
|
|
3439
3439
|
stroke: si
|
|
3440
|
-
},
|
|
3440
|
+
}, v = {
|
|
3441
3441
|
dataArray: [{
|
|
3442
3442
|
command: "M",
|
|
3443
3443
|
points: [0, p - E]
|
|
@@ -3448,7 +3448,7 @@ let mr = class extends ge {
|
|
|
3448
3448
|
strokeWidth: 1,
|
|
3449
3449
|
stroke: si
|
|
3450
3450
|
};
|
|
3451
|
-
Vs.drawWith(g,
|
|
3451
|
+
Vs.drawWith(g, I), Vs.drawWith(g, v), g.translate(0, m + 1), so.drawWith(g, {
|
|
3452
3452
|
text: e.t("headerFooter.header"),
|
|
3453
3453
|
color: ii
|
|
3454
3454
|
}), g.translate(0, p - m - E), so.drawWith(g, {
|
|
@@ -3582,8 +3582,8 @@ const Zn = "doc.command.core-header-footer", Wa = {
|
|
|
3582
3582
|
type: P.COMMAND,
|
|
3583
3583
|
// eslint-disable-next-line max-lines-per-function
|
|
3584
3584
|
handler: async (n, e) => {
|
|
3585
|
-
var
|
|
3586
|
-
const t = n.get(T), o = n.get(L), r = n.get(fe), { unitId: s, segmentId: i, createType: a, headerFooterProps: c } = e, l = (
|
|
3585
|
+
var v;
|
|
3586
|
+
const t = n.get(T), o = n.get(L), r = n.get(fe), { unitId: s, segmentId: i, createType: a, headerFooterProps: c } = e, l = (v = r.getRenderById(s)) == null ? void 0 : v.with(Ae), d = o.getUniverDocInstance(s), A = l == null ? void 0 : l.getViewModel();
|
|
3587
3587
|
if (d == null || A == null)
|
|
3588
3588
|
return !1;
|
|
3589
3589
|
const h = A.getEditArea(), { documentStyle: u } = d.getSnapshot(), g = (c == null ? void 0 : c.marginFooter) != null || (c == null ? void 0 : c.marginHeader) != null, f = [{
|
|
@@ -3607,10 +3607,10 @@ const Zn = "doc.command.core-header-footer", Wa = {
|
|
|
3607
3607
|
return;
|
|
3608
3608
|
let y;
|
|
3609
3609
|
if (b === void 0 ? y = m.insertOp(["documentStyle", R], S) : y = m.replaceOp(["documentStyle", R], b, S), E.push(y), R === "useFirstPageHeaderFooter" && S === j.TRUE && !u.firstPageHeaderId) {
|
|
3610
|
-
const C = h ===
|
|
3610
|
+
const C = h === Ie.HEADER ? Le.FIRST_PAGE_HEADER : Le.FIRST_PAGE_FOOTER;
|
|
3611
3611
|
qo(i, C, u, E);
|
|
3612
3612
|
} else if (R === "evenAndOddHeaders" && S === j.TRUE && !u.evenPageHeaderId) {
|
|
3613
|
-
const C = h ===
|
|
3613
|
+
const C = h === Ie.HEADER ? Le.EVEN_PAGE_HEADER : Le.EVEN_PAGE_FOOTER;
|
|
3614
3614
|
qo(i, C, u, E);
|
|
3615
3615
|
}
|
|
3616
3616
|
}), E.length === 0 ? !1 : (p.params.actions = E.reduce((R, S) => W.compose(R, S), null), !!t.syncExecuteCommand(p.id, p.params));
|
|
@@ -3628,7 +3628,7 @@ const Zn = "doc.command.core-header-footer", Wa = {
|
|
|
3628
3628
|
if (a == null)
|
|
3629
3629
|
return !1;
|
|
3630
3630
|
const { scene: c } = a, l = c.getTransformerByCreate(), d = a.with(Ae), A = a.with(Ce), h = d == null ? void 0 : d.getSkeleton(), u = d == null ? void 0 : d.getViewModel();
|
|
3631
|
-
return u == null || h == null ? !1 : (r.replaceDocRanges([]), l.clearSelectedObjects(), A.setSegment(""), A.setSegmentPage(-1), u.setEditArea(
|
|
3631
|
+
return u == null || h == null ? !1 : (r.replaceDocRanges([]), l.clearSelectedObjects(), A.setSegment(""), A.setSegmentPage(-1), u.setEditArea(Ie.BODY), h.calculate(), (g = a.mainComponent) == null || g.makeDirty(!0), queueMicrotask(() => {
|
|
3632
3632
|
const f = s.getUnit(i), p = f == null ? void 0 : f.getSnapshot();
|
|
3633
3633
|
if (p == null)
|
|
3634
3634
|
return;
|
|
@@ -3885,7 +3885,7 @@ ${V.TABLE_CELL_END}`, t.push({
|
|
|
3885
3885
|
sectionBreaks: o
|
|
3886
3886
|
};
|
|
3887
3887
|
}
|
|
3888
|
-
function
|
|
3888
|
+
function IA() {
|
|
3889
3889
|
const n = `${V.TABLE_CELL_START}\r
|
|
3890
3890
|
${V.TABLE_CELL_END}`, e = [], t = [];
|
|
3891
3891
|
return e.push({
|
|
@@ -3903,7 +3903,7 @@ ${V.TABLE_CELL_END}`, e = [], t = [];
|
|
|
3903
3903
|
sectionBreaks: t
|
|
3904
3904
|
};
|
|
3905
3905
|
}
|
|
3906
|
-
function
|
|
3906
|
+
function vA(n, e, t) {
|
|
3907
3907
|
var A, h, u;
|
|
3908
3908
|
const { startOffset: o, endOffset: r, segmentId: s } = n, i = t.getSelfOrHeaderFooterViewModel(s), a = e === 0 ? o : r;
|
|
3909
3909
|
let c = null;
|
|
@@ -3938,14 +3938,14 @@ function CA(n, e, t) {
|
|
|
3938
3938
|
let d = null, A = -1;
|
|
3939
3939
|
for (const p of i.getChildren()) {
|
|
3940
3940
|
for (const m of p.children) {
|
|
3941
|
-
const { children: E } = m,
|
|
3942
|
-
if (
|
|
3943
|
-
if (a <
|
|
3941
|
+
const { children: E } = m, I = E[0];
|
|
3942
|
+
if (I) {
|
|
3943
|
+
if (a < I.startIndex || a > I.endIndex)
|
|
3944
3944
|
continue;
|
|
3945
|
-
d =
|
|
3946
|
-
for (const
|
|
3947
|
-
for (const R of
|
|
3948
|
-
const S =
|
|
3945
|
+
d = I;
|
|
3946
|
+
for (const v of I.children) {
|
|
3947
|
+
for (const R of v.children) {
|
|
3948
|
+
const S = v.children.indexOf(R);
|
|
3949
3949
|
if (a >= R.startIndex && a <= R.endIndex) {
|
|
3950
3950
|
A = S;
|
|
3951
3951
|
break;
|
|
@@ -3999,9 +3999,9 @@ function qa(n, e) {
|
|
|
3999
3999
|
if (t < E.startIndex || o > E.endIndex)
|
|
4000
4000
|
continue;
|
|
4001
4001
|
d = E.startIndex + 3;
|
|
4002
|
-
for (const
|
|
4003
|
-
const
|
|
4004
|
-
t >= R && t <= S ? (c = R, a.push(
|
|
4002
|
+
for (const I of E.children) {
|
|
4003
|
+
const v = E.children.indexOf(I), { startIndex: R, endIndex: S } = I;
|
|
4004
|
+
t >= R && t <= S ? (c = R, a.push(v), l += S - R + 1) : (R > t && S < o || o >= R && o <= S) && (a.push(v), l += S - R + 1), a.length === E.children.length && (A = !0);
|
|
4005
4005
|
}
|
|
4006
4006
|
}
|
|
4007
4007
|
if (a.length)
|
|
@@ -4027,12 +4027,12 @@ function bA(n, e) {
|
|
|
4027
4027
|
let d = -1, A = -1, h = -1;
|
|
4028
4028
|
for (const m of s.getChildren()) {
|
|
4029
4029
|
for (const E of m.children) {
|
|
4030
|
-
const { children:
|
|
4031
|
-
if (
|
|
4032
|
-
if (t <
|
|
4030
|
+
const { children: I } = E, v = I[0];
|
|
4031
|
+
if (v) {
|
|
4032
|
+
if (t < v.startIndex || o > v.endIndex)
|
|
4033
4033
|
continue;
|
|
4034
|
-
c =
|
|
4035
|
-
for (const R of
|
|
4034
|
+
c = v;
|
|
4035
|
+
for (const R of v.children)
|
|
4036
4036
|
for (const S of R.children) {
|
|
4037
4037
|
const b = R.children.indexOf(S);
|
|
4038
4038
|
t >= S.startIndex && t <= S.endIndex && (A = b), o >= S.startIndex && o <= S.endIndex && (h = b);
|
|
@@ -4050,11 +4050,11 @@ function bA(n, e) {
|
|
|
4050
4050
|
l.push(m);
|
|
4051
4051
|
let u = 0;
|
|
4052
4052
|
for (const m of c.children) {
|
|
4053
|
-
const E = m.children[A],
|
|
4053
|
+
const E = m.children[A], I = m.children[h];
|
|
4054
4054
|
a.push({
|
|
4055
4055
|
retain: E.startIndex - u,
|
|
4056
|
-
delete:
|
|
4057
|
-
}), u =
|
|
4056
|
+
delete: I.endIndex - E.startIndex + 1
|
|
4057
|
+
}), u = I.endIndex + 1;
|
|
4058
4058
|
}
|
|
4059
4059
|
return d = c.startIndex + 3, {
|
|
4060
4060
|
offsets: a,
|
|
@@ -4096,13 +4096,13 @@ function yA(n, e) {
|
|
|
4096
4096
|
let c = null, l = -1, d = -1, A = -1, h = -1;
|
|
4097
4097
|
for (const m of s.getChildren()) {
|
|
4098
4098
|
for (const E of m.children) {
|
|
4099
|
-
const { children:
|
|
4100
|
-
if (
|
|
4101
|
-
if (t <
|
|
4099
|
+
const { children: I } = E, v = I[0];
|
|
4100
|
+
if (v) {
|
|
4101
|
+
if (t < v.startIndex || o > v.endIndex)
|
|
4102
4102
|
continue;
|
|
4103
|
-
c =
|
|
4104
|
-
for (const R of
|
|
4105
|
-
const S =
|
|
4103
|
+
c = v;
|
|
4104
|
+
for (const R of v.children) {
|
|
4105
|
+
const S = v.children.indexOf(R);
|
|
4106
4106
|
for (const b of R.children) {
|
|
4107
4107
|
const y = R.children.indexOf(b);
|
|
4108
4108
|
t >= b.startIndex && t <= b.endIndex && (d = S, A = y), o >= b.startIndex && o <= b.endIndex && (h = y);
|
|
@@ -4197,7 +4197,7 @@ function OA(n) {
|
|
|
4197
4197
|
return t ? (t == null ? void 0 : t.path.indexOf("cells")) > -1 : !1;
|
|
4198
4198
|
});
|
|
4199
4199
|
}
|
|
4200
|
-
const TA =
|
|
4200
|
+
const TA = In, Ja = {
|
|
4201
4201
|
id: "doc.command.inner-paste",
|
|
4202
4202
|
type: P.COMMAND,
|
|
4203
4203
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
@@ -4219,7 +4219,7 @@ const TA = vn, Ja = {
|
|
|
4219
4219
|
}
|
|
4220
4220
|
}, m = new Nt();
|
|
4221
4221
|
m.reset();
|
|
4222
|
-
const E = new me(),
|
|
4222
|
+
const E = new me(), I = W.getInstance(), v = [], R = !!((C = d.tables) != null && C.length), S = !!((B = d.customBlocks) != null && B.length);
|
|
4223
4223
|
if (R && t || R && OA(c) || c.length && (l != null && l.length))
|
|
4224
4224
|
return !1;
|
|
4225
4225
|
for (let w = 0; w < c.length; w++) {
|
|
@@ -4230,8 +4230,8 @@ const TA = vn, Ja = {
|
|
|
4230
4230
|
ce.tableId = he;
|
|
4231
4231
|
const Pe = te.deepClone(A[re]);
|
|
4232
4232
|
Pe.tableId = he;
|
|
4233
|
-
const Ze =
|
|
4234
|
-
|
|
4233
|
+
const Ze = I.insertOp(["tableSource", he], Pe);
|
|
4234
|
+
v.push(Ze);
|
|
4235
4235
|
}
|
|
4236
4236
|
if (S && h) {
|
|
4237
4237
|
const ce = (M = (x = u.getSnapshot().drawingsOrder) == null ? void 0 : x.length) != null ? M : 0;
|
|
@@ -4240,8 +4240,8 @@ const TA = vn, Ja = {
|
|
|
4240
4240
|
re.blockId = Pe;
|
|
4241
4241
|
const Ze = te.deepClone(h[he]);
|
|
4242
4242
|
Ze.drawingId = Pe;
|
|
4243
|
-
const At =
|
|
4244
|
-
|
|
4243
|
+
const At = I.insertOp(["drawings", Pe], Ze), $e = I.insertOp(["drawingsOrder", ce], Pe);
|
|
4244
|
+
v.push(At), v.push($e);
|
|
4245
4245
|
}
|
|
4246
4246
|
}
|
|
4247
4247
|
const oe = Wr((D = g.customRanges) != null ? D : [], $, TA.includes(f)), ae = zr((F = g.customDecorations) != null ? F : [], $);
|
|
@@ -4269,7 +4269,7 @@ const TA = vn, Ja = {
|
|
|
4269
4269
|
m.reset(), m.moveCursor($);
|
|
4270
4270
|
}
|
|
4271
4271
|
const b = ue(u, t);
|
|
4272
|
-
return
|
|
4272
|
+
return v.push(I.editOp(E.serialize(), b)), p.params.actions = v.reduce((w, N) => W.compose(w, N), null), !!s.syncExecuteCommand(p.id, p.params);
|
|
4273
4273
|
}
|
|
4274
4274
|
};
|
|
4275
4275
|
function BA(n, e) {
|
|
@@ -4288,11 +4288,11 @@ function MA(n, e, t) {
|
|
|
4288
4288
|
const { tables: a = [] } = o, c = new Nt();
|
|
4289
4289
|
c.reset();
|
|
4290
4290
|
for (let p = 0; p < n.length; p++) {
|
|
4291
|
-
const m = BA(n[p], a), { startOffset: E, endOffset:
|
|
4292
|
-
|
|
4291
|
+
const m = BA(n[p], a), { startOffset: E, endOffset: I, collapsed: v } = m, R = E - c.cursor;
|
|
4292
|
+
v ? r.push({
|
|
4293
4293
|
t: G.RETAIN,
|
|
4294
4294
|
len: R
|
|
4295
|
-
}) : r.push(...le.selection.delete([m], o, c.cursor, null, !1)), c.reset(), c.moveCursor(
|
|
4295
|
+
}) : r.push(...le.selection.delete([m], o, c.cursor, null, !1)), c.reset(), c.moveCursor(I);
|
|
4296
4296
|
}
|
|
4297
4297
|
const l = ue(e, t);
|
|
4298
4298
|
i.push(s.editOp(r.serialize(), l));
|
|
@@ -4302,8 +4302,8 @@ function MA(n, e, t) {
|
|
|
4302
4302
|
const m = A[p], E = h.indexOf(p);
|
|
4303
4303
|
if (m == null || E < 0)
|
|
4304
4304
|
continue;
|
|
4305
|
-
const
|
|
4306
|
-
i.push(
|
|
4305
|
+
const I = s.removeOp(["drawings", p], m), v = s.removeOp(["drawingsOrder", E], p);
|
|
4306
|
+
i.push(I), i.push(v);
|
|
4307
4307
|
}
|
|
4308
4308
|
return i.reduce((p, m) => W.compose(p, m), null);
|
|
4309
4309
|
}
|
|
@@ -4328,13 +4328,13 @@ function _A(n, e, t, o) {
|
|
|
4328
4328
|
t: G.DELETE,
|
|
4329
4329
|
len: m
|
|
4330
4330
|
});
|
|
4331
|
-
const
|
|
4332
|
-
r.push(
|
|
4331
|
+
const I = a.removeOp(["tableSource", E]);
|
|
4332
|
+
r.push(I), c.moveCursorTo(p + m);
|
|
4333
4333
|
} else if (u) {
|
|
4334
4334
|
const f = qa({ startOffset: A, endOffset: h, segmentId: o }, t);
|
|
4335
4335
|
if (f == null)
|
|
4336
4336
|
continue;
|
|
4337
|
-
const { offset: p, rowIndexes: m, len: E, tableId:
|
|
4337
|
+
const { offset: p, rowIndexes: m, len: E, tableId: I } = f;
|
|
4338
4338
|
p - c.cursor > 0 && i.push({
|
|
4339
4339
|
t: G.RETAIN,
|
|
4340
4340
|
len: p - c.cursor
|
|
@@ -4342,8 +4342,8 @@ function _A(n, e, t, o) {
|
|
|
4342
4342
|
t: G.DELETE,
|
|
4343
4343
|
len: E
|
|
4344
4344
|
});
|
|
4345
|
-
for (const
|
|
4346
|
-
const R = a.removeOp(["tableSource",
|
|
4345
|
+
for (const v of m.reverse()) {
|
|
4346
|
+
const R = a.removeOp(["tableSource", I, "tableRows", v]);
|
|
4347
4347
|
r.push(R);
|
|
4348
4348
|
}
|
|
4349
4349
|
c.moveCursorTo(p + E);
|
|
@@ -4353,14 +4353,14 @@ function _A(n, e, t, o) {
|
|
|
4353
4353
|
continue;
|
|
4354
4354
|
const { offsets: p } = f;
|
|
4355
4355
|
for (const m of p) {
|
|
4356
|
-
const { retain: E, delete:
|
|
4356
|
+
const { retain: E, delete: I } = m;
|
|
4357
4357
|
E - c.cursor > 0 && i.push({
|
|
4358
4358
|
t: G.RETAIN,
|
|
4359
4359
|
len: E - c.cursor
|
|
4360
4360
|
}), i.push({
|
|
4361
4361
|
t: G.DELETE,
|
|
4362
|
-
len:
|
|
4363
|
-
}), c.moveCursorTo(E +
|
|
4362
|
+
len: I
|
|
4363
|
+
}), c.moveCursorTo(E + I);
|
|
4364
4364
|
}
|
|
4365
4365
|
}
|
|
4366
4366
|
}
|
|
@@ -4433,7 +4433,7 @@ const DA = "doc.command.insert-text", Za = {
|
|
|
4433
4433
|
textRanges: p,
|
|
4434
4434
|
debounce: !0
|
|
4435
4435
|
}
|
|
4436
|
-
}, E = new me(),
|
|
4436
|
+
}, E = new me(), I = W.getInstance();
|
|
4437
4437
|
if (g)
|
|
4438
4438
|
u > 0 && E.push({
|
|
4439
4439
|
t: G.RETAIN,
|
|
@@ -4452,8 +4452,8 @@ const DA = "doc.command.insert-text", Za = {
|
|
|
4452
4452
|
endOffset: u + f,
|
|
4453
4453
|
collapsed: g
|
|
4454
4454
|
}];
|
|
4455
|
-
const
|
|
4456
|
-
return m.params.actions =
|
|
4455
|
+
const v = ue(d, r);
|
|
4456
|
+
return m.params.actions = I.editOp(E.serialize(), v), !!t.syncExecuteCommand(m.id, m.params);
|
|
4457
4457
|
}
|
|
4458
4458
|
}, yn = {
|
|
4459
4459
|
id: "doc.command.delete-text",
|
|
@@ -4487,8 +4487,8 @@ const DA = "doc.command.insert-text", Za = {
|
|
|
4487
4487
|
t: G.DELETE,
|
|
4488
4488
|
len: u - h + 1
|
|
4489
4489
|
});
|
|
4490
|
-
const
|
|
4491
|
-
return f.params.actions = m.editOp(p.serialize(),
|
|
4490
|
+
const I = ue(l, s);
|
|
4491
|
+
return f.params.actions = m.editOp(p.serialize(), I), !!t.syncExecuteCommand(f.id, f.params);
|
|
4492
4492
|
}
|
|
4493
4493
|
}, $a = {
|
|
4494
4494
|
id: "doc.command.update-text",
|
|
@@ -4545,7 +4545,7 @@ const es = {
|
|
|
4545
4545
|
textRanges: f,
|
|
4546
4546
|
prevTextRanges: [c]
|
|
4547
4547
|
}
|
|
4548
|
-
}, m = new me(), E = W.getInstance(),
|
|
4548
|
+
}, m = new me(), E = W.getInstance(), I = [];
|
|
4549
4549
|
A > 0 && m.push({
|
|
4550
4550
|
t: G.RETAIN,
|
|
4551
4551
|
len: a === we.LEFT ? A - 1 : A
|
|
@@ -4553,10 +4553,10 @@ const es = {
|
|
|
4553
4553
|
t: G.DELETE,
|
|
4554
4554
|
len: 1
|
|
4555
4555
|
});
|
|
4556
|
-
const
|
|
4557
|
-
|
|
4556
|
+
const v = ue(i, h);
|
|
4557
|
+
I.push(E.editOp(m.serialize(), v));
|
|
4558
4558
|
const R = ((x = i.getDrawings()) != null ? x : {})[d], b = i.getDrawingsOrder().indexOf(d), y = E.removeOp(["drawings", d], R), C = E.removeOp(["drawingsOrder", b], d);
|
|
4559
|
-
return
|
|
4559
|
+
return I.push(y), I.push(C), p.params.actions = I.reduce((M, D) => W.compose(M, D), null), !!r.syncExecuteCommand(p.id, p.params);
|
|
4560
4560
|
}
|
|
4561
4561
|
}, ts = {
|
|
4562
4562
|
id: "doc.command.merge-two-paragraph",
|
|
@@ -4573,15 +4573,15 @@ const es = {
|
|
|
4573
4573
|
if (!m)
|
|
4574
4574
|
return !1;
|
|
4575
4575
|
const E = s === we.LEFT ? p : p + 1;
|
|
4576
|
-
let
|
|
4576
|
+
let I, v;
|
|
4577
4577
|
for (const F of h.paragraphs) {
|
|
4578
4578
|
if (F.startIndex >= E) {
|
|
4579
|
-
|
|
4579
|
+
v = F;
|
|
4580
4580
|
break;
|
|
4581
4581
|
}
|
|
4582
|
-
|
|
4582
|
+
I = F;
|
|
4583
4583
|
}
|
|
4584
|
-
if (
|
|
4584
|
+
if (I == null || v == null)
|
|
4585
4585
|
return !1;
|
|
4586
4586
|
const R = s === we.LEFT ? p - 1 : p, S = [
|
|
4587
4587
|
{
|
|
@@ -4598,17 +4598,17 @@ const es = {
|
|
|
4598
4598
|
prevTextRanges: [i]
|
|
4599
4599
|
}
|
|
4600
4600
|
}, y = new me(), C = W.getInstance();
|
|
4601
|
-
|
|
4601
|
+
I.startIndex > 0 && y.push({
|
|
4602
4602
|
t: G.RETAIN,
|
|
4603
|
-
len:
|
|
4603
|
+
len: I.startIndex
|
|
4604
4604
|
}), y.push({
|
|
4605
4605
|
t: G.DELETE,
|
|
4606
4606
|
len: 1
|
|
4607
|
-
}),
|
|
4607
|
+
}), v.startIndex > I.startIndex + 1 && y.push({
|
|
4608
4608
|
t: G.RETAIN,
|
|
4609
|
-
len:
|
|
4609
|
+
len: v.startIndex - I.startIndex - 1
|
|
4610
4610
|
});
|
|
4611
|
-
const B = Object.values(V), x = u[
|
|
4611
|
+
const B = Object.values(V), x = u[I.startIndex - 1];
|
|
4612
4612
|
(x && !B.includes(x) || x === " ") && y.push({
|
|
4613
4613
|
t: G.RETAIN,
|
|
4614
4614
|
len: 1,
|
|
@@ -4617,7 +4617,7 @@ const es = {
|
|
|
4617
4617
|
dataStream: "",
|
|
4618
4618
|
paragraphs: [
|
|
4619
4619
|
{
|
|
4620
|
-
...te.deepClone(
|
|
4620
|
+
...te.deepClone(I),
|
|
4621
4621
|
startIndex: 0
|
|
4622
4622
|
}
|
|
4623
4623
|
]
|
|
@@ -4681,8 +4681,8 @@ const es = {
|
|
|
4681
4681
|
]
|
|
4682
4682
|
}
|
|
4683
4683
|
});
|
|
4684
|
-
const
|
|
4685
|
-
return p.params.actions = E.editOp(m.serialize(),
|
|
4684
|
+
const I = ue(c, i);
|
|
4685
|
+
return p.params.actions = E.editOp(m.serialize(), I), !!o.syncExecuteCommand(p.id, p.params);
|
|
4686
4686
|
}
|
|
4687
4687
|
};
|
|
4688
4688
|
function ns(n, e) {
|
|
@@ -4736,15 +4736,15 @@ const Mo = {
|
|
|
4736
4736
|
const { segmentId: h, style: u, segmentPage: g } = c, f = s.getSelfOrHeaderFooterModel(h).getBody();
|
|
4737
4737
|
if (f == null)
|
|
4738
4738
|
return !1;
|
|
4739
|
-
const p = c, { startOffset: m, collapsed: E } = p,
|
|
4739
|
+
const p = c, { startOffset: m, collapsed: E } = p, I = A.findNodeByCharIndex(m, h, g), v = cl(I), R = ll(I, f);
|
|
4740
4740
|
let S = m;
|
|
4741
4741
|
const b = A.findNodeByCharIndex(m - 1, h, g);
|
|
4742
|
-
if (dl(
|
|
4743
|
-
const w = Al(
|
|
4742
|
+
if (dl(I) && b !== I && (v === !0 || R === !0) && E) {
|
|
4743
|
+
const w = Al(I, f);
|
|
4744
4744
|
if (w == null)
|
|
4745
4745
|
return !1;
|
|
4746
4746
|
const N = w == null ? void 0 : w.startIndex, ee = { startIndex: 0 }, $ = w.paragraphStyle;
|
|
4747
|
-
if (
|
|
4747
|
+
if (v === !0) {
|
|
4748
4748
|
const H = w.paragraphStyle;
|
|
4749
4749
|
if (H) {
|
|
4750
4750
|
ee.paragraphStyle = H;
|
|
@@ -4846,7 +4846,7 @@ const Mo = {
|
|
|
4846
4846
|
type: P.COMMAND,
|
|
4847
4847
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
4848
4848
|
handler: async (n) => {
|
|
4849
|
-
var
|
|
4849
|
+
var I, v;
|
|
4850
4850
|
const e = n.get(Y), o = n.get(L).getCurrentUniverDocInstance();
|
|
4851
4851
|
if (!o)
|
|
4852
4852
|
return !1;
|
|
@@ -4882,7 +4882,7 @@ const Mo = {
|
|
|
4882
4882
|
range: i
|
|
4883
4883
|
});
|
|
4884
4884
|
else if (R.streamType === "\b") {
|
|
4885
|
-
const b = (
|
|
4885
|
+
const b = (v = o.getSnapshot().drawings) == null ? void 0 : v[(I = R.drawingId) != null ? I : ""];
|
|
4886
4886
|
if (b == null)
|
|
4887
4887
|
return !0;
|
|
4888
4888
|
if (b.layoutType === yo.INLINE) {
|
|
@@ -5421,40 +5421,40 @@ function zA(n, e, t) {
|
|
|
5421
5421
|
const o = n.body, r = n.drawings || {}, { customRanges: s = [], customBlocks: i = [] } = o || {}, a = [...i], c = s.filter((u) => u.startIndex >= e && u.endIndex <= t);
|
|
5422
5422
|
let l = e, d = "";
|
|
5423
5423
|
const A = (u, g) => {
|
|
5424
|
-
let f = "", p = 0, m = u, E = a.findIndex((
|
|
5424
|
+
let f = "", p = 0, m = u, E = a.findIndex((I) => u <= I.startIndex && g >= I.startIndex);
|
|
5425
5425
|
if (E === -1)
|
|
5426
5426
|
return f = Jo(o, u, g), { sliceHtml: f, customBlockLength: p };
|
|
5427
5427
|
for (; E !== -1; ) {
|
|
5428
|
-
const
|
|
5429
|
-
a.splice(E, 1), f += Jo(o, m,
|
|
5430
|
-
const
|
|
5431
|
-
if (
|
|
5432
|
-
switch (
|
|
5428
|
+
const I = a[E];
|
|
5429
|
+
a.splice(E, 1), f += Jo(o, m, I.startIndex);
|
|
5430
|
+
const v = r[I.blockId];
|
|
5431
|
+
if (v)
|
|
5432
|
+
switch (v.drawingType) {
|
|
5433
5433
|
case Lr.DRAWING_IMAGE: {
|
|
5434
|
-
f += WA(
|
|
5434
|
+
f += WA(v), p++;
|
|
5435
5435
|
break;
|
|
5436
5436
|
}
|
|
5437
5437
|
}
|
|
5438
|
-
m =
|
|
5438
|
+
m = I.startIndex + 1, E = a.findIndex((R) => m <= R.startIndex && g >= R.startIndex);
|
|
5439
5439
|
}
|
|
5440
5440
|
return f = f + Jo(o, m, g + 1), { sliceHtml: f, customBlockLength: p };
|
|
5441
5441
|
};
|
|
5442
5442
|
c.forEach((u) => {
|
|
5443
|
-
var
|
|
5443
|
+
var v, R;
|
|
5444
5444
|
const { startIndex: g, endIndex: f, rangeType: p, rangeId: m } = u, E = A(l, g);
|
|
5445
5445
|
d += E.sliceHtml;
|
|
5446
|
-
const
|
|
5446
|
+
const I = A(g, f + 1);
|
|
5447
5447
|
switch (p) {
|
|
5448
5448
|
case Qr.HYPERLINK: {
|
|
5449
|
-
d += `<a data-rangeid="${m}" href="${(R = (
|
|
5449
|
+
d += `<a data-rangeid="${m}" href="${(R = (v = u.properties) == null ? void 0 : v.url) != null ? R : ""}">${I.sliceHtml}</a>`;
|
|
5450
5450
|
break;
|
|
5451
5451
|
}
|
|
5452
5452
|
default: {
|
|
5453
|
-
d +=
|
|
5453
|
+
d += I.sliceHtml;
|
|
5454
5454
|
break;
|
|
5455
5455
|
}
|
|
5456
5456
|
}
|
|
5457
|
-
l = f + 1 + (E.customBlockLength +
|
|
5457
|
+
l = f + 1 + (E.customBlockLength + I.customBlockLength);
|
|
5458
5458
|
});
|
|
5459
5459
|
const h = A(l, t);
|
|
5460
5460
|
return d += h.sliceHtml, d;
|
|
@@ -5723,8 +5723,8 @@ let Er = class extends ge {
|
|
|
5723
5723
|
if (f === He.RECT) {
|
|
5724
5724
|
i = !1;
|
|
5725
5725
|
const { spanEntireRow: E } = A;
|
|
5726
|
-
let
|
|
5727
|
-
|
|
5726
|
+
let I;
|
|
5727
|
+
I = ui(c, h, u), s.push(I);
|
|
5728
5728
|
continue;
|
|
5729
5729
|
}
|
|
5730
5730
|
const p = { startOffset: h, endOffset: u }, m = o.getSelfOrHeaderFooterModel(a).sliceBody(p.startOffset, p.endOffset, e);
|
|
@@ -5756,7 +5756,7 @@ let Er = class extends ge {
|
|
|
5756
5756
|
case bl:
|
|
5757
5757
|
case Rl:
|
|
5758
5758
|
case Cl:
|
|
5759
|
-
case
|
|
5759
|
+
case vl: {
|
|
5760
5760
|
const a = await s.getType(i), c = new File([a], `pasted_image.${i.split("/")[1]}`, { type: i });
|
|
5761
5761
|
r.push(c);
|
|
5762
5762
|
break;
|
|
@@ -5956,7 +5956,7 @@ let at = class extends ge {
|
|
|
5956
5956
|
const t = e == null ? void 0 : e.getUnitId(), o = (i = this._renderManagerService.getRenderById(t)) == null ? void 0 : i.with(Ae), r = o == null ? void 0 : o.getViewModel();
|
|
5957
5957
|
return r == null ? {
|
|
5958
5958
|
...Wn
|
|
5959
|
-
} : r.getEditArea() ===
|
|
5959
|
+
} : r.getEditArea() === Ie.BODY ? {
|
|
5960
5960
|
...Wn
|
|
5961
5961
|
} : {
|
|
5962
5962
|
...Wn,
|
|
@@ -6014,7 +6014,7 @@ const ds = {
|
|
|
6014
6014
|
const h = d.getUnitId(), { startOffset: u, endOffset: g } = i, p = ((ee = A.paragraphs) != null ? ee : []).find((k) => k.startIndex >= u);
|
|
6015
6015
|
if (!p)
|
|
6016
6016
|
return !1;
|
|
6017
|
-
const m = u === p.startIndex, E = p.startIndex,
|
|
6017
|
+
const m = u === p.startIndex, E = p.startIndex, I = s.getDefaultStyle(), v = s.getStyleCache(), R = To(A, g, I, v), S = {
|
|
6018
6018
|
dataStream: V.PARAGRAPH,
|
|
6019
6019
|
paragraphs: rc(
|
|
6020
6020
|
V.PARAGRAPH,
|
|
@@ -6175,7 +6175,7 @@ const hi = "doc.command.set-inline-format-bold", Qt = {
|
|
|
6175
6175
|
t
|
|
6176
6176
|
);
|
|
6177
6177
|
}
|
|
6178
|
-
}, mi = "doc.command.set-inline-format-subscript",
|
|
6178
|
+
}, mi = "doc.command.set-inline-format-subscript", vt = {
|
|
6179
6179
|
id: mi,
|
|
6180
6180
|
type: P.COMMAND,
|
|
6181
6181
|
handler: async (n, e) => {
|
|
@@ -6208,24 +6208,24 @@ const hi = "doc.command.set-inline-format-bold", Qt = {
|
|
|
6208
6208
|
t
|
|
6209
6209
|
);
|
|
6210
6210
|
}
|
|
6211
|
-
},
|
|
6212
|
-
id:
|
|
6211
|
+
}, Ii = "doc.command.set-inline-format-font-family", en = {
|
|
6212
|
+
id: Ii,
|
|
6213
6213
|
type: P.COMMAND,
|
|
6214
6214
|
handler: async (n, e) => {
|
|
6215
6215
|
const t = n.get(T);
|
|
6216
6216
|
return Xe(
|
|
6217
|
-
|
|
6217
|
+
Ii,
|
|
6218
6218
|
e,
|
|
6219
6219
|
t
|
|
6220
6220
|
);
|
|
6221
6221
|
}
|
|
6222
|
-
},
|
|
6223
|
-
id:
|
|
6222
|
+
}, vi = "doc.command.set-inline-format-text-color", Pt = {
|
|
6223
|
+
id: vi,
|
|
6224
6224
|
type: P.COMMAND,
|
|
6225
6225
|
handler: async (n, e) => {
|
|
6226
6226
|
const t = n.get(T);
|
|
6227
6227
|
return Xe(
|
|
6228
|
-
|
|
6228
|
+
vi,
|
|
6229
6229
|
e,
|
|
6230
6230
|
t
|
|
6231
6231
|
);
|
|
@@ -6252,7 +6252,7 @@ const hi = "doc.command.set-inline-format-bold", Qt = {
|
|
|
6252
6252
|
t
|
|
6253
6253
|
);
|
|
6254
6254
|
}
|
|
6255
|
-
},
|
|
6255
|
+
}, Ir = {
|
|
6256
6256
|
[Qt.id]: "bl",
|
|
6257
6257
|
[Ut.id]: "it",
|
|
6258
6258
|
[Ft.id]: "ul",
|
|
@@ -6262,7 +6262,7 @@ const hi = "doc.command.set-inline-format-bold", Qt = {
|
|
|
6262
6262
|
[Pt.id]: "cl",
|
|
6263
6263
|
[Dt.id]: "bg",
|
|
6264
6264
|
[Fn.id]: "bg",
|
|
6265
|
-
[
|
|
6265
|
+
[vt.id]: "va",
|
|
6266
6266
|
[kt.id]: "va"
|
|
6267
6267
|
}, Ct = {
|
|
6268
6268
|
id: "doc.command.set-inline-format",
|
|
@@ -6290,7 +6290,7 @@ const hi = "doc.command.set-inline-format-bold", Qt = {
|
|
|
6290
6290
|
// fallthrough
|
|
6291
6291
|
case Ht.id:
|
|
6292
6292
|
// fallthrough
|
|
6293
|
-
case
|
|
6293
|
+
case vt.id:
|
|
6294
6294
|
// fallthrough
|
|
6295
6295
|
case kt.id: {
|
|
6296
6296
|
const S = a.getDefaultStyle(), b = ic(
|
|
@@ -6339,7 +6339,7 @@ const hi = "doc.command.set-inline-format-bold", Qt = {
|
|
|
6339
6339
|
if (b == null || y == null)
|
|
6340
6340
|
continue;
|
|
6341
6341
|
if (C === He.RECT && (b = b - 1), b === y) {
|
|
6342
|
-
const M = a.getStyleCache(), D =
|
|
6342
|
+
const M = a.getStyleCache(), D = Ir[o];
|
|
6343
6343
|
a.setStyleCache(
|
|
6344
6344
|
{
|
|
6345
6345
|
[D]: (M == null ? void 0 : M[D]) !== void 0 ? sc(
|
|
@@ -6358,7 +6358,7 @@ const hi = "doc.command.set-inline-format-bold", Qt = {
|
|
|
6358
6358
|
st: 0,
|
|
6359
6359
|
ed: y - b,
|
|
6360
6360
|
ts: {
|
|
6361
|
-
[
|
|
6361
|
+
[Ir[o]]: g
|
|
6362
6362
|
}
|
|
6363
6363
|
}
|
|
6364
6364
|
]
|
|
@@ -6372,8 +6372,8 @@ const hi = "doc.command.set-inline-format-bold", Qt = {
|
|
|
6372
6372
|
len: y - b
|
|
6373
6373
|
}), E.reset(), E.moveCursor(y);
|
|
6374
6374
|
}
|
|
6375
|
-
const
|
|
6376
|
-
return f.params.actions = m.editOp(p.serialize(),
|
|
6375
|
+
const I = ue(A, d);
|
|
6376
|
+
return f.params.actions = m.editOp(p.serialize(), I), !!r.syncExecuteCommand(f.id, f.params);
|
|
6377
6377
|
}
|
|
6378
6378
|
};
|
|
6379
6379
|
function $A(n) {
|
|
@@ -6389,10 +6389,10 @@ function sc(n, e, t) {
|
|
|
6389
6389
|
s: j.TRUE
|
|
6390
6390
|
};
|
|
6391
6391
|
if (/va/.test(e))
|
|
6392
|
-
return t ===
|
|
6392
|
+
return t === vt.id ? (n == null ? void 0 : n[e]) === ke.SUBSCRIPT ? ke.NORMAL : ke.SUBSCRIPT : (n == null ? void 0 : n[e]) === ke.SUPERSCRIPT ? ke.NORMAL : ke.SUPERSCRIPT;
|
|
6393
6393
|
}
|
|
6394
6394
|
function ic(n, e, t) {
|
|
6395
|
-
var d, A, h, u, g, f, p, m, E,
|
|
6395
|
+
var d, A, h, u, g, f, p, m, E, I, v, R, S, b;
|
|
6396
6396
|
const { startOffset: o, endOffset: r, collapsed: s } = e;
|
|
6397
6397
|
if (s) {
|
|
6398
6398
|
const y = (d = n.textRuns) != null ? d : [];
|
|
@@ -6428,10 +6428,10 @@ function ic(n, e, t) {
|
|
|
6428
6428
|
}) ? (f = i[0].ts) == null ? void 0 : f.st : a.st, a.bg = (E = (m = (p = i.find((y) => {
|
|
6429
6429
|
var C;
|
|
6430
6430
|
return ((C = y.ts) == null ? void 0 : C.bg) != null;
|
|
6431
|
-
})) == null ? void 0 : p.ts) == null ? void 0 : m.bg) != null ? E : a.bg, a.cl = (R = (
|
|
6431
|
+
})) == null ? void 0 : p.ts) == null ? void 0 : m.bg) != null ? E : a.bg, a.cl = (R = (v = (I = i.find((y) => {
|
|
6432
6432
|
var C;
|
|
6433
6433
|
return ((C = y.ts) == null ? void 0 : C.cl) != null;
|
|
6434
|
-
})) == null ? void 0 :
|
|
6434
|
+
})) == null ? void 0 : I.ts) == null ? void 0 : v.cl) != null ? R : a.cl;
|
|
6435
6435
|
const l = i.filter((y) => {
|
|
6436
6436
|
var C;
|
|
6437
6437
|
return ((C = y == null ? void 0 : y.ts) == null ? void 0 : C.va) != null;
|
|
@@ -6449,15 +6449,15 @@ function ic(n, e, t) {
|
|
|
6449
6449
|
return a;
|
|
6450
6450
|
}
|
|
6451
6451
|
function eu(n, e) {
|
|
6452
|
-
const t =
|
|
6452
|
+
const t = Ir[e];
|
|
6453
6453
|
return sc(n, t, e);
|
|
6454
6454
|
}
|
|
6455
6455
|
const Hn = {
|
|
6456
6456
|
id: "doc.command.list-operation",
|
|
6457
6457
|
type: P.COMMAND,
|
|
6458
6458
|
handler: (n, e) => {
|
|
6459
|
-
var
|
|
6460
|
-
const t = n.get(Y), o = n.get(L), r = n.get(T), s = e.listType, i = o.getCurrentUnitForType(_.UNIVER_DOC), a = (R = (
|
|
6459
|
+
var v, R, S, b, y, C;
|
|
6460
|
+
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 : [];
|
|
6461
6461
|
if (i == null || a.length === 0)
|
|
6462
6462
|
return !1;
|
|
6463
6463
|
const c = a[0].segmentId, l = i.getSelfOrHeaderFooterModel(c), d = (b = (S = l.getBody()) == null ? void 0 : S.paragraphs) != null ? b : [], A = (C = (y = l.getBody()) == null ? void 0 : y.dataStream) != null ? C : "";
|
|
@@ -6485,11 +6485,11 @@ const Hn = {
|
|
|
6485
6485
|
id: "doc.command.change-list-type",
|
|
6486
6486
|
type: P.COMMAND,
|
|
6487
6487
|
handler: (n, e) => {
|
|
6488
|
-
var
|
|
6489
|
-
const t = n.get(Y), o = n.get(L), r = n.get(T), { listType: s } = e, i = o.getCurrentUnitForType(_.UNIVER_DOC), a = (
|
|
6488
|
+
var I, v, R, S, b;
|
|
6489
|
+
const t = n.get(Y), o = n.get(L), r = n.get(T), { listType: s } = e, i = o.getCurrentUnitForType(_.UNIVER_DOC), a = (I = e.docRange) != null ? I : t.getDocRanges();
|
|
6490
6490
|
if (i == null || a == null || !a.length)
|
|
6491
6491
|
return !1;
|
|
6492
|
-
const { segmentId: c } = a[0], l = i.getSelfOrHeaderFooterModel(c), d = (R = (
|
|
6492
|
+
const { segmentId: c } = a[0], l = i.getSelfOrHeaderFooterModel(c), d = (R = (v = l.getBody()) == null ? void 0 : v.paragraphs) != null ? R : [], A = (b = (S = l.getBody()) == null ? void 0 : S.dataStream) != null ? b : "";
|
|
6493
6493
|
if (!d.length)
|
|
6494
6494
|
return !1;
|
|
6495
6495
|
const h = le.range.getParagraphsInRanges(a, d, A), u = i.getUnitId(), g = le.paragraph.bullet.set({
|
|
@@ -6513,17 +6513,17 @@ const Hn = {
|
|
|
6513
6513
|
}
|
|
6514
6514
|
};
|
|
6515
6515
|
var $n = /* @__PURE__ */ ((n) => (n[n.increase = 1] = "increase", n[n.decrease = -1] = "decrease", n))($n || {});
|
|
6516
|
-
const
|
|
6516
|
+
const vr = {
|
|
6517
6517
|
id: "doc.command.change-list-nesting-level",
|
|
6518
6518
|
type: P.COMMAND,
|
|
6519
6519
|
handler: (n, e) => {
|
|
6520
|
-
var
|
|
6520
|
+
var v, R, S, b, y;
|
|
6521
6521
|
if (!e)
|
|
6522
6522
|
return !1;
|
|
6523
6523
|
const { type: t } = e, o = n.get(Y), r = n.get(L), s = n.get(T), i = r.getCurrentUnitForType(_.UNIVER_DOC), a = o.getActiveTextRange();
|
|
6524
6524
|
if (i == null || a == null)
|
|
6525
6525
|
return !1;
|
|
6526
|
-
const { segmentId: c } = a, l = (
|
|
6526
|
+
const { segmentId: c } = a, l = (v = o.getDocRanges()) != null ? v : [], d = i.getSelfOrHeaderFooterModel(c), A = (S = (R = d.getBody()) == null ? void 0 : R.paragraphs) != null ? S : [], h = (y = (b = d.getBody()) == null ? void 0 : b.dataStream) != null ? y : "";
|
|
6527
6527
|
if (!A.length)
|
|
6528
6528
|
return !1;
|
|
6529
6529
|
const u = le.range.getParagraphsInRange(a, A, h), g = i.getUnitId(), f = W.getInstance(), p = le.paragraph.bullet.changeNestLevel({
|
|
@@ -6620,9 +6620,9 @@ const Ir = {
|
|
|
6620
6620
|
if (s == null || i == null)
|
|
6621
6621
|
return !1;
|
|
6622
6622
|
const { segmentId: a, startOffset: c } = i, { listType: l, paragraph: d } = e, { paragraphStart: A, paragraphEnd: h } = d, u = new me(), g = W.getInstance(), { paragraphStyle: f = {} } = d, m = (zc[l].nestingLevel[0].paragraphProperties || {}).textStyle;
|
|
6623
|
-
let
|
|
6624
|
-
const
|
|
6625
|
-
S && S.bullet && S.bullet.listType.indexOf(l) === 0 ?
|
|
6623
|
+
let I = te.generateRandomId(6);
|
|
6624
|
+
const v = (M = (x = s.getBody()) == null ? void 0 : x.paragraphs) != null ? M : [], R = v.findIndex((F) => F.startIndex === d.startIndex), S = v[R - 1], b = v[R + 1];
|
|
6625
|
+
S && S.bullet && S.bullet.listType.indexOf(l) === 0 ? I = S.bullet.listId : b && b.bullet && b.bullet.listType.indexOf(l) === 0 && (I = b.bullet.listId);
|
|
6626
6626
|
const y = {
|
|
6627
6627
|
id: X.id,
|
|
6628
6628
|
params: {
|
|
@@ -6669,7 +6669,7 @@ const Ir = {
|
|
|
6669
6669
|
}
|
|
6670
6670
|
},
|
|
6671
6671
|
listType: l,
|
|
6672
|
-
listId:
|
|
6672
|
+
listId: I
|
|
6673
6673
|
}
|
|
6674
6674
|
}
|
|
6675
6675
|
]
|
|
@@ -6817,8 +6817,8 @@ const hs = {
|
|
|
6817
6817
|
textX: f,
|
|
6818
6818
|
paragraphTextRun: {}
|
|
6819
6819
|
});
|
|
6820
|
-
const
|
|
6821
|
-
return E.params.actions = p.editOp(f.serialize(),
|
|
6820
|
+
const I = ue(i, c);
|
|
6821
|
+
return E.params.actions = p.editOp(f.serialize(), I), !!s.syncExecuteCommand(E.id, E.params);
|
|
6822
6822
|
}
|
|
6823
6823
|
}, $o = {
|
|
6824
6824
|
"#": K.HEADING_1,
|
|
@@ -6850,7 +6850,7 @@ const hs = {
|
|
|
6850
6850
|
handler: (n) => n.get(T).syncExecuteCommand(Je.id, {
|
|
6851
6851
|
value: K.HEADING_4
|
|
6852
6852
|
})
|
|
6853
|
-
},
|
|
6853
|
+
}, Is = {
|
|
6854
6854
|
id: "doc.command.h5-heading",
|
|
6855
6855
|
type: P.COMMAND,
|
|
6856
6856
|
handler: (n) => n.get(T).syncExecuteCommand(Je.id, {
|
|
@@ -6928,8 +6928,8 @@ const hs = {
|
|
|
6928
6928
|
coverType: on.REPLACE
|
|
6929
6929
|
}), p.moveCursorTo(B + 1);
|
|
6930
6930
|
}
|
|
6931
|
-
const
|
|
6932
|
-
return f.params.actions = E.editOp(m.serialize(),
|
|
6931
|
+
const I = ue(i, c);
|
|
6932
|
+
return f.params.actions = E.editOp(m.serialize(), I), !!r.syncExecuteCommand(f.id, f.params);
|
|
6933
6933
|
}
|
|
6934
6934
|
}, wo = {
|
|
6935
6935
|
id: "doc.command.align-left",
|
|
@@ -6960,11 +6960,11 @@ const hs = {
|
|
|
6960
6960
|
type: P.COMMAND,
|
|
6961
6961
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
6962
6962
|
handler: (n) => {
|
|
6963
|
-
var E,
|
|
6963
|
+
var E, I, v, R, S;
|
|
6964
6964
|
const e = n.get(T), t = n.get(fe), o = n.get(Y), s = n.get(L).getCurrentUniverDocInstance();
|
|
6965
6965
|
if (s == null)
|
|
6966
6966
|
return !1;
|
|
6967
|
-
const i = s.getUnitId(), a = (E = t.getRenderById(i)) == null ? void 0 : E.with(Ae).getSkeleton(), c = (
|
|
6967
|
+
const i = s.getUnitId(), a = (E = t.getRenderById(i)) == null ? void 0 : E.with(Ae).getSkeleton(), c = (I = t.getRenderById(i)) == null ? void 0 : I.with(Ce);
|
|
6968
6968
|
if (a == null || c == null)
|
|
6969
6969
|
return !1;
|
|
6970
6970
|
const l = c == null ? void 0 : c.getSegment(), d = c == null ? void 0 : c.getSegmentPage(), A = s.getSnapshot().documentStyle.documentFlavor, h = o.getDocRanges(), u = {
|
|
@@ -6981,7 +6981,7 @@ const hs = {
|
|
|
6981
6981
|
else
|
|
6982
6982
|
return !1;
|
|
6983
6983
|
if (A !== De.MODERN) {
|
|
6984
|
-
const b = s.getSnapshot(), { drawings: y = {}, body: C } = b, B = (
|
|
6984
|
+
const b = s.getSnapshot(), { drawings: y = {}, body: C } = b, B = (v = C == null ? void 0 : C.customBlocks) != null ? v : [];
|
|
6985
6985
|
for (const x in y) {
|
|
6986
6986
|
const M = y[x], D = B.find((he) => he.blockId === x);
|
|
6987
6987
|
if (D == null)
|
|
@@ -7019,10 +7019,10 @@ const hs = {
|
|
|
7019
7019
|
const u = A.getUnitId(), g = qe(n, u), f = g == null ? void 0 : g.getSkeleton();
|
|
7020
7020
|
if (f == null)
|
|
7021
7021
|
return !1;
|
|
7022
|
-
const { startOffset: p } = c, E = ((ce = h.paragraphs) != null ? ce : []).find((At) => At.startIndex >= p),
|
|
7023
|
-
if (
|
|
7022
|
+
const { startOffset: p } = c, E = ((ce = h.paragraphs) != null ? ce : []).find((At) => At.startIndex >= p), I = f.findNodeByCharIndex(p, l, d);
|
|
7023
|
+
if (I == null)
|
|
7024
7024
|
return !1;
|
|
7025
|
-
const
|
|
7025
|
+
const v = new me(), R = W.getInstance(), S = [], b = p + 4, y = [{
|
|
7026
7026
|
startOffset: b,
|
|
7027
7027
|
endOffset: b,
|
|
7028
7028
|
collapsed: !0
|
|
@@ -7034,10 +7034,10 @@ const hs = {
|
|
|
7034
7034
|
textRanges: y
|
|
7035
7035
|
}
|
|
7036
7036
|
};
|
|
7037
|
-
p > 0 &&
|
|
7037
|
+
p > 0 && v.push({
|
|
7038
7038
|
t: G.RETAIN,
|
|
7039
7039
|
len: p
|
|
7040
|
-
}),
|
|
7040
|
+
}), v.push({
|
|
7041
7041
|
t: G.INSERT,
|
|
7042
7042
|
body: {
|
|
7043
7043
|
dataStream: V.PARAGRAPH,
|
|
@@ -7050,11 +7050,11 @@ const hs = {
|
|
|
7050
7050
|
p,
|
|
7051
7051
|
B,
|
|
7052
7052
|
x
|
|
7053
|
-
), { dataStream: D, paragraphs: F, sectionBreaks: w } = SA(t, o), N = (Ze = (Pe = (he = (re =
|
|
7053
|
+
), { dataStream: D, paragraphs: F, sectionBreaks: w } = SA(t, o), N = (Ze = (Pe = (he = (re = I.parent) == null ? void 0 : re.parent) == null ? void 0 : he.parent) == null ? void 0 : Pe.parent) == null ? void 0 : Ze.parent;
|
|
7054
7054
|
if (N == null)
|
|
7055
7055
|
return !1;
|
|
7056
7056
|
const { pageWidth: ee, marginLeft: $, marginRight: U } = N, H = Ka(t, o, ee - $ - U);
|
|
7057
|
-
|
|
7057
|
+
v.push({
|
|
7058
7058
|
t: G.INSERT,
|
|
7059
7059
|
body: {
|
|
7060
7060
|
dataStream: D,
|
|
@@ -7076,11 +7076,11 @@ const hs = {
|
|
|
7076
7076
|
len: D.length
|
|
7077
7077
|
});
|
|
7078
7078
|
const k = ue(A, l);
|
|
7079
|
-
S.push(R.editOp(
|
|
7079
|
+
S.push(R.editOp(v.serialize(), k));
|
|
7080
7080
|
const oe = R.insertOp(["tableSource", H.tableId], H);
|
|
7081
7081
|
return S.push(oe), C.params.actions = S.reduce((At, $e) => W.compose(At, $e), null), !!i.syncExecuteCommand(C.id, C.params);
|
|
7082
7082
|
}
|
|
7083
|
-
}, er = "doc.component.create-table-confirm",
|
|
7083
|
+
}, er = "doc.component.create-table-confirm", vs = {
|
|
7084
7084
|
id: "doc.operation.create-table",
|
|
7085
7085
|
type: P.COMMAND,
|
|
7086
7086
|
handler: async (n) => {
|
|
@@ -7132,7 +7132,7 @@ function ou(n) {
|
|
|
7132
7132
|
}
|
|
7133
7133
|
};
|
|
7134
7134
|
});
|
|
7135
|
-
|
|
7135
|
+
ve(() => {
|
|
7136
7136
|
e.beforeClose = () => i, e.beforeConfirm = () => i;
|
|
7137
7137
|
}, [i]);
|
|
7138
7138
|
const c = (d) => {
|
|
@@ -7239,50 +7239,50 @@ const Cr = "docs.component.page-setting", gc = {
|
|
|
7239
7239
|
marginTop: p,
|
|
7240
7240
|
pageOrient: m,
|
|
7241
7241
|
pageSize: E
|
|
7242
|
-
} = h,
|
|
7242
|
+
} = h, I = [];
|
|
7243
7243
|
if (u === void 0) {
|
|
7244
7244
|
const S = A.insertOp(["documentStyle", "marginBottom"], a);
|
|
7245
|
-
S &&
|
|
7245
|
+
S && I.push(S);
|
|
7246
7246
|
} else {
|
|
7247
7247
|
const S = A.replaceOp(["documentStyle", "marginBottom"], u, a);
|
|
7248
|
-
S &&
|
|
7248
|
+
S && I.push(S);
|
|
7249
7249
|
}
|
|
7250
7250
|
if (g === void 0) {
|
|
7251
7251
|
const S = A.insertOp(["documentStyle", "marginLeft"], s);
|
|
7252
|
-
S &&
|
|
7252
|
+
S && I.push(S);
|
|
7253
7253
|
} else {
|
|
7254
7254
|
const S = A.replaceOp(["documentStyle", "marginLeft"], g, s);
|
|
7255
|
-
S &&
|
|
7255
|
+
S && I.push(S);
|
|
7256
7256
|
}
|
|
7257
7257
|
if (f === void 0) {
|
|
7258
7258
|
const S = A.insertOp(["documentStyle", "marginRight"], i);
|
|
7259
|
-
S &&
|
|
7259
|
+
S && I.push(S);
|
|
7260
7260
|
} else {
|
|
7261
7261
|
const S = A.replaceOp(["documentStyle", "marginRight"], f, i);
|
|
7262
|
-
S &&
|
|
7262
|
+
S && I.push(S);
|
|
7263
7263
|
}
|
|
7264
7264
|
if (p === void 0) {
|
|
7265
7265
|
const S = A.insertOp(["documentStyle", "marginTop"], c);
|
|
7266
|
-
S &&
|
|
7266
|
+
S && I.push(S);
|
|
7267
7267
|
} else {
|
|
7268
7268
|
const S = A.replaceOp(["documentStyle", "marginTop"], p, c);
|
|
7269
|
-
S &&
|
|
7269
|
+
S && I.push(S);
|
|
7270
7270
|
}
|
|
7271
7271
|
if (E === void 0) {
|
|
7272
7272
|
const S = A.insertOp(["documentStyle", "pageSize"], d);
|
|
7273
|
-
S &&
|
|
7273
|
+
S && I.push(S);
|
|
7274
7274
|
} else {
|
|
7275
7275
|
const S = A.replaceOp(["documentStyle", "pageSize"], E, d);
|
|
7276
|
-
S &&
|
|
7276
|
+
S && I.push(S);
|
|
7277
7277
|
}
|
|
7278
7278
|
if (m === void 0) {
|
|
7279
7279
|
const S = A.insertOp(["documentStyle", "pageOrient"], l);
|
|
7280
|
-
S &&
|
|
7280
|
+
S && I.push(S);
|
|
7281
7281
|
} else {
|
|
7282
7282
|
const S = A.replaceOp(["documentStyle", "pageOrient"], m, l);
|
|
7283
|
-
S &&
|
|
7283
|
+
S && I.push(S);
|
|
7284
7284
|
}
|
|
7285
|
-
const
|
|
7285
|
+
const v = {
|
|
7286
7286
|
id: X.id,
|
|
7287
7287
|
params: {
|
|
7288
7288
|
unitId: r.getUnitId(),
|
|
@@ -7290,7 +7290,7 @@ const Cr = "docs.component.page-setting", gc = {
|
|
|
7290
7290
|
textRanges: void 0
|
|
7291
7291
|
}
|
|
7292
7292
|
};
|
|
7293
|
-
return
|
|
7293
|
+
return v.params.actions = I.reduce((S, b) => W.compose(S, b), null), !!o.syncExecuteCommand(v.id, v.params);
|
|
7294
7294
|
}
|
|
7295
7295
|
}, Cs = {
|
|
7296
7296
|
id: "docs.operation.open-page-setting",
|
|
@@ -7334,7 +7334,7 @@ function ru(n) {
|
|
|
7334
7334
|
if (a == null)
|
|
7335
7335
|
return o.next(!0);
|
|
7336
7336
|
a.with(Ae).getViewModel().editAreaChange$.subscribe((l) => {
|
|
7337
|
-
o.next(l ===
|
|
7337
|
+
o.next(l === Ie.HEADER || l === Ie.FOOTER);
|
|
7338
7338
|
});
|
|
7339
7339
|
});
|
|
7340
7340
|
return () => r.unsubscribe();
|
|
@@ -7544,7 +7544,7 @@ function du(n) {
|
|
|
7544
7544
|
function Au(n) {
|
|
7545
7545
|
const e = n.get(T);
|
|
7546
7546
|
return {
|
|
7547
|
-
id:
|
|
7547
|
+
id: vt.id,
|
|
7548
7548
|
type: J.BUTTON,
|
|
7549
7549
|
icon: "SubscriptSingle",
|
|
7550
7550
|
tooltip: "toolbar.subscript",
|
|
@@ -7758,15 +7758,15 @@ function Eu(n) {
|
|
|
7758
7758
|
hidden$: Ln(ie(n, _.UNIVER_DOC, void 0, ot), ru(n), (e, t) => e || t)
|
|
7759
7759
|
};
|
|
7760
7760
|
}
|
|
7761
|
-
function
|
|
7761
|
+
function Iu(n) {
|
|
7762
7762
|
return {
|
|
7763
|
-
id:
|
|
7763
|
+
id: vs.id,
|
|
7764
7764
|
title: "toolbar.table.insert",
|
|
7765
7765
|
type: J.BUTTON,
|
|
7766
7766
|
hidden$: ie(n, _.UNIVER_DOC)
|
|
7767
7767
|
};
|
|
7768
7768
|
}
|
|
7769
|
-
function
|
|
7769
|
+
function vu(n) {
|
|
7770
7770
|
const e = n.get(T);
|
|
7771
7771
|
return {
|
|
7772
7772
|
id: wo.id,
|
|
@@ -7890,8 +7890,8 @@ const Tn = (n) => new Se((e) => {
|
|
|
7890
7890
|
const f = a.getSelfOrHeaderFooterModel(l == null ? void 0 : l.segmentId), p = le.range.getParagraphsInRange(l, (h = (A = f.getBody()) == null ? void 0 : A.paragraphs) != null ? h : [], (g = (u = f.getBody()) == null ? void 0 : u.dataStream) != null ? g : "");
|
|
7891
7891
|
let m;
|
|
7892
7892
|
if (p.every((E) => {
|
|
7893
|
-
var
|
|
7894
|
-
return m || (m = (
|
|
7893
|
+
var I;
|
|
7894
|
+
return m || (m = (I = E.bullet) == null ? void 0 : I.listType), E.bullet && E.bullet.listType === m;
|
|
7895
7895
|
})) {
|
|
7896
7896
|
e.next(m);
|
|
7897
7897
|
return;
|
|
@@ -8078,7 +8078,7 @@ const Mu = {
|
|
|
8078
8078
|
[K.HEADING_2]: ms,
|
|
8079
8079
|
[K.HEADING_3]: Ss,
|
|
8080
8080
|
[K.HEADING_4]: Es,
|
|
8081
|
-
[K.HEADING_5]:
|
|
8081
|
+
[K.HEADING_5]: Is,
|
|
8082
8082
|
[K.NORMAL_TEXT]: co,
|
|
8083
8083
|
[K.TITLE]: dc,
|
|
8084
8084
|
[K.SUBTITLE]: Ac,
|
|
@@ -8228,12 +8228,12 @@ const tr = (n, e) => {
|
|
|
8228
8228
|
const { scene: t, mainComponent: o, engine: r } = e, s = e.with(Ae).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), l = o;
|
|
8229
8229
|
if (!c || !i)
|
|
8230
8230
|
return;
|
|
8231
|
-
const d = l.getOffsetConfig(), { docsLeft: A, docsTop: h } = d, u = r.getCanvasElement(), g = u.getBoundingClientRect(), f = ra(u.style.width), { top: p, left: m, width: E } = g,
|
|
8231
|
+
const d = l.getOffsetConfig(), { docsLeft: A, docsTop: h } = d, u = r.getCanvasElement(), g = u.getBoundingClientRect(), f = ra(u.style.width), { top: p, left: m, width: E } = g, I = E / f, { scaleX: v, scaleY: R } = t.getAncestorScale(), S = new pt(d, s), { borderBoxPointGroup: b } = S.getRangePointData(i, c);
|
|
8232
8232
|
return Gr(b).map((B) => Sc(B, t)).map((B) => ({
|
|
8233
|
-
left: (B.left + A *
|
|
8234
|
-
right: (B.right + A *
|
|
8235
|
-
top: (B.top + h * R) *
|
|
8236
|
-
bottom: (B.bottom + h * R) *
|
|
8233
|
+
left: (B.left + A * v) * I + m,
|
|
8234
|
+
right: (B.right + A * v) * I + m,
|
|
8235
|
+
top: (B.top + h * R) * I + p,
|
|
8236
|
+
bottom: (B.bottom + h * R) * I + p
|
|
8237
8237
|
}));
|
|
8238
8238
|
};
|
|
8239
8239
|
let Bn = class extends ge {
|
|
@@ -8620,12 +8620,12 @@ let wt = class extends ge {
|
|
|
8620
8620
|
for (const m of u) {
|
|
8621
8621
|
const E = [...m.sections];
|
|
8622
8622
|
if (m.skeTables) {
|
|
8623
|
-
const
|
|
8624
|
-
E.push(...
|
|
8623
|
+
const I = Array.from(m.skeTables.values());
|
|
8624
|
+
E.push(...I.map((v) => v.rows.map((R) => R.cells.map((S) => S.sections))).flat(4));
|
|
8625
8625
|
}
|
|
8626
|
-
for (const
|
|
8627
|
-
for (const
|
|
8628
|
-
for (const R of
|
|
8626
|
+
for (const I of E)
|
|
8627
|
+
for (const v of I.columns)
|
|
8628
|
+
for (const R of v.lines)
|
|
8629
8629
|
if (R.paragraphStart) {
|
|
8630
8630
|
const S = r.find((b) => b.startIndex === R.paragraphIndex);
|
|
8631
8631
|
if (S) {
|
|
@@ -8692,13 +8692,13 @@ let wt = class extends ge {
|
|
|
8692
8692
|
for (let h = 0; h < l.length; h++) {
|
|
8693
8693
|
const u = l[h], g = ((u.pageHeight === 1 / 0 ? 0 : u.pageHeight) + r.pageMarginTop) * h + u.marginTop + r.docsTop, f = u.marginLeft + r.docsLeft;
|
|
8694
8694
|
u.skeTables && Array.from(u.skeTables.values()).forEach((p) => {
|
|
8695
|
-
const m = p.left + f, E = p.top + g,
|
|
8695
|
+
const m = p.left + f, E = p.top + g, I = m + p.width, v = E + p.height, R = p.tableId;
|
|
8696
8696
|
this._tableBounds.set(R, {
|
|
8697
8697
|
rect: {
|
|
8698
8698
|
left: m,
|
|
8699
8699
|
top: E,
|
|
8700
|
-
right:
|
|
8701
|
-
bottom:
|
|
8700
|
+
right: I,
|
|
8701
|
+
bottom: v
|
|
8702
8702
|
},
|
|
8703
8703
|
pageIndex: h,
|
|
8704
8704
|
tableId: R
|
|
@@ -8805,14 +8805,14 @@ const $u = [
|
|
|
8805
8805
|
Ut.id,
|
|
8806
8806
|
Ft.id,
|
|
8807
8807
|
Ht.id,
|
|
8808
|
-
|
|
8808
|
+
vt.id,
|
|
8809
8809
|
kt.id,
|
|
8810
8810
|
Pt.id,
|
|
8811
8811
|
Dt.id
|
|
8812
8812
|
];
|
|
8813
8813
|
function eh(n) {
|
|
8814
8814
|
const { avaliableMenus: e = $u } = n, t = Z(ua), [o, r] = pe([]);
|
|
8815
|
-
return
|
|
8815
|
+
return ve(() => {
|
|
8816
8816
|
function s() {
|
|
8817
8817
|
const a = t.getFlatMenuByPositionKey(Ql.RIBBON), c = [];
|
|
8818
8818
|
for (const l of e) {
|
|
@@ -8854,7 +8854,7 @@ let lo = class extends ge {
|
|
|
8854
8854
|
constructor(e, t, o, r, s, i) {
|
|
8855
8855
|
super();
|
|
8856
8856
|
O(this, "_floatMenu", null);
|
|
8857
|
-
this._context = e, this._docSelectionManagerService = t, this._docCanvasPopManagerService = o, this._componentManager = r, this._univerInstanceService = s, this._docSelectionRenderService = i, !
|
|
8857
|
+
this._context = e, this._docSelectionManagerService = t, this._docCanvasPopManagerService = o, this._componentManager = r, this._univerInstanceService = s, this._docSelectionRenderService = i, !It(this._context.unitId) && (this._registerFloatMenu(), this._initSelectionChange(), this.disposeWithMe(() => {
|
|
8858
8858
|
this._hideFloatMenu();
|
|
8859
8859
|
}));
|
|
8860
8860
|
}
|
|
@@ -8927,7 +8927,7 @@ let Ao = class extends ge {
|
|
|
8927
8927
|
constructor(e, t, o, r, s, i) {
|
|
8928
8928
|
super();
|
|
8929
8929
|
O(this, "_paragrahMenu", null);
|
|
8930
|
-
this._context = e, this._docSelectionManagerService = t, this._docEventManagerService = o, this._docPopupManagerService = r, this._docSkeletonManagerService = s, this._floatMenuService = i, !
|
|
8930
|
+
this._context = e, this._docSelectionManagerService = t, this._docEventManagerService = o, this._docPopupManagerService = r, this._docSkeletonManagerService = s, this._floatMenuService = i, !It(this._context.unitId) && this._init();
|
|
8931
8931
|
}
|
|
8932
8932
|
get activeParagraph() {
|
|
8933
8933
|
var e;
|
|
@@ -8948,7 +8948,7 @@ let Ao = class extends ge {
|
|
|
8948
8948
|
_init() {
|
|
8949
8949
|
const e = (o) => {
|
|
8950
8950
|
var s;
|
|
8951
|
-
if (this._docSkeletonManagerService.getViewModel().getEditArea() ===
|
|
8951
|
+
if (this._docSkeletonManagerService.getViewModel().getEditArea() === Ie.BODY && !this._floatMenuService.floatMenu && !this._context.unit.getDisabled()) {
|
|
8952
8952
|
if ((s = this._paragrahMenu) != null && s.active)
|
|
8953
8953
|
return;
|
|
8954
8954
|
if (o) {
|
|
@@ -9015,7 +9015,7 @@ const ah = ({ popup: n }) => {
|
|
|
9015
9015
|
const [e, t] = pe(!1), o = Ge(null), r = Z(T), s = Z(Oo), i = Ge(null), a = Ge(!1), c = Z(fe), l = Z(L), d = c.getRenderById(n.unitId), A = l.getUnit(n.unitId, _.UNIVER_DOC), h = d == null ? void 0 : d.with(Ao), u = d == null ? void 0 : d.with(wt), g = tt(u == null ? void 0 : u.hoverParagraph$), f = tt(u == null ? void 0 : u.hoverParagraphLeft$), p = (S = g != null ? g : f) == null ? void 0 : S.startIndex, m = Me(() => {
|
|
9016
9016
|
var y, C;
|
|
9017
9017
|
return (C = (y = A == null ? void 0 : A.getBody()) == null ? void 0 : y.paragraphs) == null ? void 0 : C.find((B) => B.startIndex === p);
|
|
9018
|
-
}, [A, g]), E = (b = m == null ? void 0 : m.paragraphStyle) == null ? void 0 : b.namedStyleType,
|
|
9018
|
+
}, [A, g]), E = (b = m == null ? void 0 : m.paragraphStyle) == null ? void 0 : b.namedStyleType, I = pc[E != null ? E : K.NORMAL_TEXT], v = Me(() => new Ue({
|
|
9019
9019
|
left: 0,
|
|
9020
9020
|
right: 0,
|
|
9021
9021
|
top: 0,
|
|
@@ -9037,7 +9037,7 @@ const ah = ({ popup: n }) => {
|
|
|
9037
9037
|
var B, x, M, D, F, w;
|
|
9038
9038
|
(B = n.onPointerEnter) == null || B.call(n, y), a.current = !0;
|
|
9039
9039
|
const C = (x = i.current) == null ? void 0 : x.getBoundingClientRect();
|
|
9040
|
-
|
|
9040
|
+
v.next({
|
|
9041
9041
|
left: ((M = C == null ? void 0 : C.left) != null ? M : 0) - 4,
|
|
9042
9042
|
right: (D = C == null ? void 0 : C.right) != null ? D : 0,
|
|
9043
9043
|
top: (F = C == null ? void 0 : C.top) != null ? F : 0,
|
|
@@ -9052,7 +9052,7 @@ const ah = ({ popup: n }) => {
|
|
|
9052
9052
|
},
|
|
9053
9053
|
children: [
|
|
9054
9054
|
/* @__PURE__ */ Q(
|
|
9055
|
-
|
|
9055
|
+
I.component,
|
|
9056
9056
|
{
|
|
9057
9057
|
className: "univer-size-4 univer-text-gray-900 dark:!univer-text-white"
|
|
9058
9058
|
}
|
|
@@ -9072,7 +9072,7 @@ const ah = ({ popup: n }) => {
|
|
|
9072
9072
|
portal: !0,
|
|
9073
9073
|
mask: !0,
|
|
9074
9074
|
maskZIndex: 100,
|
|
9075
|
-
anchorRect$:
|
|
9075
|
+
anchorRect$: v,
|
|
9076
9076
|
direction: "left",
|
|
9077
9077
|
onMaskClick: R,
|
|
9078
9078
|
children: /* @__PURE__ */ Q(
|
|
@@ -9158,7 +9158,7 @@ const Ah = {
|
|
|
9158
9158
|
binding: q.X | ne.SHIFT | ne.CTRL_COMMAND,
|
|
9159
9159
|
preconditions: Ee
|
|
9160
9160
|
}, mh = {
|
|
9161
|
-
id:
|
|
9161
|
+
id: vt.id,
|
|
9162
9162
|
binding: q.COMMA | ne.CTRL_COMMAND,
|
|
9163
9163
|
preconditions: Ee
|
|
9164
9164
|
}, Sh = {
|
|
@@ -9169,11 +9169,11 @@ const Ah = {
|
|
|
9169
9169
|
id: wo.id,
|
|
9170
9170
|
binding: q.L | ne.CTRL_COMMAND | ne.SHIFT,
|
|
9171
9171
|
preconditions: Ee
|
|
9172
|
-
},
|
|
9172
|
+
}, Ih = {
|
|
9173
9173
|
id: Lo.id,
|
|
9174
9174
|
binding: q.R | ne.CTRL_COMMAND | ne.SHIFT,
|
|
9175
9175
|
preconditions: Ee
|
|
9176
|
-
},
|
|
9176
|
+
}, vh = {
|
|
9177
9177
|
id: No.id,
|
|
9178
9178
|
binding: q.E | ne.CTRL_COMMAND | ne.SHIFT,
|
|
9179
9179
|
preconditions: Ee
|
|
@@ -9202,7 +9202,7 @@ function Oh() {
|
|
|
9202
9202
|
const c = ((d = (l = o.getSettings()) == null ? void 0 : l.zoomRatio) != null ? d : 1) * 100;
|
|
9203
9203
|
return Math.round(c);
|
|
9204
9204
|
}, [o]), [s, i] = pe(() => r());
|
|
9205
|
-
|
|
9205
|
+
ve(() => (i(r()), n.onCommandExecuted((l) => {
|
|
9206
9206
|
if (l.id === nt.id) {
|
|
9207
9207
|
const d = r();
|
|
9208
9208
|
i(d);
|
|
@@ -9247,11 +9247,11 @@ function Bh() {
|
|
|
9247
9247
|
const Mh = "univer-overflow-hidden univer-font-[500] univer-truncate univer-h-[24px] univer-mb-2 univer-leading-[24px] univer-ellipsis univer-cursor-pointer", _h = "univer-text-base univer-font-semibold", Ph = "univer-text-sm univer-font-semibold", Dh = "univer-text-sm", wh = Oe((n, e) => {
|
|
9248
9248
|
const { menus: t, onClick: o, className: r, style: s, mode: i, maxHeight: a, activeId: c, open: l, onOpenChange: d, maxWidth: A, wrapperClass: h, wrapperStyle: u, iconClass: g, iconStyle: f } = n, p = i === "side-bar", m = Ge(null), E = Ge(t);
|
|
9249
9249
|
E.current = t;
|
|
9250
|
-
const
|
|
9251
|
-
scrollTo: (
|
|
9250
|
+
const I = Me(() => ({
|
|
9251
|
+
scrollTo: (v) => {
|
|
9252
9252
|
var x;
|
|
9253
|
-
if (!E.current || E.current.findIndex((M) => M.id ===
|
|
9254
|
-
const S = document.getElementById(`univer-side-menu-${
|
|
9253
|
+
if (!E.current || E.current.findIndex((M) => M.id === v) === -1 || !m.current) return;
|
|
9254
|
+
const S = document.getElementById(`univer-side-menu-${v}`);
|
|
9255
9255
|
if (!S) return;
|
|
9256
9256
|
const b = S.offsetTop, y = m.current.clientHeight, C = m.current.scrollHeight - y, B = Math.max(0, Math.min(b - y / 2 + S.clientHeight / 2, C));
|
|
9257
9257
|
(x = m.current) == null || x.scrollTo({
|
|
@@ -9260,9 +9260,9 @@ const Mh = "univer-overflow-hidden univer-font-[500] univer-truncate univer-h-[2
|
|
|
9260
9260
|
});
|
|
9261
9261
|
}
|
|
9262
9262
|
}), []);
|
|
9263
|
-
return jl(e, () =>
|
|
9264
|
-
c &&
|
|
9265
|
-
}, [c,
|
|
9263
|
+
return jl(e, () => I), ve(() => {
|
|
9264
|
+
c && I.scrollTo(c);
|
|
9265
|
+
}, [c, I]), /* @__PURE__ */ se("div", { className: je("univer-relative", h), style: u, children: [
|
|
9266
9266
|
/* @__PURE__ */ Q(
|
|
9267
9267
|
"div",
|
|
9268
9268
|
{
|
|
@@ -9298,29 +9298,29 @@ const Mh = "univer-overflow-hidden univer-font-[500] univer-truncate univer-h-[2
|
|
|
9298
9298
|
{
|
|
9299
9299
|
ref: m,
|
|
9300
9300
|
className: je("univer-flex-1 univer-overflow-y-auto univer-overflow-x-hidden", Kl),
|
|
9301
|
-
children: t == null ? void 0 : t.map((
|
|
9301
|
+
children: t == null ? void 0 : t.map((v) => /* @__PURE__ */ Q(
|
|
9302
9302
|
"div",
|
|
9303
9303
|
{
|
|
9304
|
-
id: `univer-side-menu-${
|
|
9304
|
+
id: `univer-side-menu-${v.id}`,
|
|
9305
9305
|
className: je(
|
|
9306
9306
|
Mh,
|
|
9307
9307
|
{
|
|
9308
|
-
[_h]:
|
|
9309
|
-
[Ph]:
|
|
9310
|
-
[Dh]:
|
|
9311
|
-
"univer-text-gray-500 dark:!univer-text-gray-400":
|
|
9312
|
-
"univer-text-gray-800 dark:!univer-text-gray-200":
|
|
9308
|
+
[_h]: v.isTitle,
|
|
9309
|
+
[Ph]: v.level === 1,
|
|
9310
|
+
[Dh]: v.level > 1,
|
|
9311
|
+
"univer-text-gray-500 dark:!univer-text-gray-400": v.id !== c,
|
|
9312
|
+
"univer-text-gray-800 dark:!univer-text-gray-200": v.id === c
|
|
9313
9313
|
}
|
|
9314
9314
|
),
|
|
9315
9315
|
style: {
|
|
9316
|
-
paddingLeft: (
|
|
9316
|
+
paddingLeft: (v.level - 1) * 12
|
|
9317
9317
|
},
|
|
9318
9318
|
onClick: () => {
|
|
9319
|
-
o == null || o(
|
|
9319
|
+
o == null || o(v);
|
|
9320
9320
|
},
|
|
9321
|
-
children:
|
|
9321
|
+
children: v.text
|
|
9322
9322
|
},
|
|
9323
|
-
|
|
9323
|
+
v.id
|
|
9324
9324
|
))
|
|
9325
9325
|
}
|
|
9326
9326
|
)
|
|
@@ -9378,7 +9378,7 @@ function Uh() {
|
|
|
9378
9378
|
}), U;
|
|
9379
9379
|
}, [m]);
|
|
9380
9380
|
tt(Me(() => d != null && d.engine.onTransformChange$ ? Bt(d == null ? void 0 : d.engine.onTransformChange$).pipe(bn(33)) : $l(null), [d == null ? void 0 : d.engine.onTransformChange$]));
|
|
9381
|
-
const
|
|
9381
|
+
const I = g < 180 ? "float" : "side-bar", v = m == null ? void 0 : m.filter(
|
|
9382
9382
|
(U) => {
|
|
9383
9383
|
var H;
|
|
9384
9384
|
return ((H = U.paragraphStyle) == null ? void 0 : H.namedStyleType) !== void 0 && U.paragraphStyle.namedStyleType !== K.SUBTITLE && U.paragraphStyle.namedStyleType !== K.NORMAL_TEXT;
|
|
@@ -9397,23 +9397,23 @@ function Uh() {
|
|
|
9397
9397
|
}).filter((U) => U == null ? void 0 : U.text), R = Sn((U) => {
|
|
9398
9398
|
const H = U.viewportScrollY, k = H + f / p, oe = Lh(u, E, H, k);
|
|
9399
9399
|
oe && c(oe);
|
|
9400
|
-
}), S =
|
|
9400
|
+
}), S = v != null && v.find((U) => U.isTitle) ? v : [
|
|
9401
9401
|
...A ? [{
|
|
9402
9402
|
id: Di,
|
|
9403
9403
|
text: A,
|
|
9404
9404
|
level: 1,
|
|
9405
9405
|
isTitle: !0
|
|
9406
9406
|
}] : [],
|
|
9407
|
-
...
|
|
9407
|
+
...v != null ? v : []
|
|
9408
9408
|
].filter(Boolean), [b, y] = pe(!0);
|
|
9409
|
-
|
|
9409
|
+
ve(() => {
|
|
9410
9410
|
const U = Dr(i, 100), H = n.onCommandExecuted((k) => {
|
|
9411
9411
|
k.id === X.id && k.params.unitId === (t == null ? void 0 : t.getUnitId()) && U((ae) => ae + 1);
|
|
9412
9412
|
});
|
|
9413
9413
|
return () => {
|
|
9414
9414
|
H.dispose();
|
|
9415
9415
|
};
|
|
9416
|
-
}, [n, t]),
|
|
9416
|
+
}, [n, t]), ve(() => {
|
|
9417
9417
|
const U = d == null ? void 0 : d.scene.getViewport(We.VIEW_MAIN);
|
|
9418
9418
|
if (!U)
|
|
9419
9419
|
return;
|
|
@@ -9439,7 +9439,7 @@ function Uh() {
|
|
|
9439
9439
|
const oe = u == null ? void 0 : u.get(k.startIndex);
|
|
9440
9440
|
oe && (H.scrollToViewportPos({ viewportScrollY: oe.rect.top }), c(U.id));
|
|
9441
9441
|
});
|
|
9442
|
-
return !t ||
|
|
9442
|
+
return !t || It(l) || !(S != null && S.length) ? null : /* @__PURE__ */ Q(
|
|
9443
9443
|
"div",
|
|
9444
9444
|
{
|
|
9445
9445
|
className: "univer-absolute univer-bottom-0 univer-left-0 univer-top-0 univer-z-[100] univer-w-[0px]",
|
|
@@ -9449,8 +9449,8 @@ function Uh() {
|
|
|
9449
9449
|
menus: S,
|
|
9450
9450
|
open: b,
|
|
9451
9451
|
onOpenChange: y,
|
|
9452
|
-
mode:
|
|
9453
|
-
maxWidth:
|
|
9452
|
+
mode: I,
|
|
9453
|
+
maxWidth: I === "float" ? void 0 : Math.floor(g),
|
|
9454
9454
|
wrapperClass: "univer-mt-12",
|
|
9455
9455
|
activeId: a,
|
|
9456
9456
|
onClick: C,
|
|
@@ -9477,12 +9477,12 @@ const Rs = {
|
|
|
9477
9477
|
const A = d.getViewModel(), h = c == null ? void 0 : c.getUnitId(), u = new me(), g = W.getInstance(), f = qa(i, A);
|
|
9478
9478
|
if (f == null)
|
|
9479
9479
|
return !1;
|
|
9480
|
-
const { offset: p, rowIndexes: m, len: E, tableId:
|
|
9480
|
+
const { offset: p, rowIndexes: m, len: E, tableId: I, cursor: v, selectWholeTable: R } = f;
|
|
9481
9481
|
if (R)
|
|
9482
9482
|
return o.executeCommand(kn.id);
|
|
9483
9483
|
const S = [], b = [{
|
|
9484
|
-
startOffset:
|
|
9485
|
-
endOffset:
|
|
9484
|
+
startOffset: v,
|
|
9485
|
+
endOffset: v,
|
|
9486
9486
|
collapsed: !0
|
|
9487
9487
|
}], y = {
|
|
9488
9488
|
id: X.id,
|
|
@@ -9502,7 +9502,7 @@ const Rs = {
|
|
|
9502
9502
|
const C = ue(c, a);
|
|
9503
9503
|
S.push(g.editOp(u.serialize(), C));
|
|
9504
9504
|
for (const x of m.reverse()) {
|
|
9505
|
-
const M = g.removeOp(["tableSource",
|
|
9505
|
+
const M = g.removeOp(["tableSource", I, "tableRows", x]);
|
|
9506
9506
|
S.push(M);
|
|
9507
9507
|
}
|
|
9508
9508
|
return y.params.actions = S.reduce((x, M) => W.compose(x, M), null), !!o.syncExecuteCommand(y.id, y.params);
|
|
@@ -9524,12 +9524,12 @@ const Rs = {
|
|
|
9524
9524
|
const A = d.getViewModel(), h = c == null ? void 0 : c.getUnitId(), u = new me(), g = W.getInstance(), f = bA(i, A);
|
|
9525
9525
|
if (f == null)
|
|
9526
9526
|
return !1;
|
|
9527
|
-
const { offsets: p, columnIndexes: m, tableId: E, cursor:
|
|
9527
|
+
const { offsets: p, columnIndexes: m, tableId: E, cursor: I, rowCount: v, selectWholeTable: R } = f;
|
|
9528
9528
|
if (R)
|
|
9529
9529
|
return o.executeCommand(kn.id);
|
|
9530
9530
|
const S = [], b = [{
|
|
9531
|
-
startOffset:
|
|
9532
|
-
endOffset:
|
|
9531
|
+
startOffset: I,
|
|
9532
|
+
endOffset: I,
|
|
9533
9533
|
collapsed: !0
|
|
9534
9534
|
}], y = {
|
|
9535
9535
|
id: X.id,
|
|
@@ -9551,7 +9551,7 @@ const Rs = {
|
|
|
9551
9551
|
}
|
|
9552
9552
|
const C = ue(c, a);
|
|
9553
9553
|
S.push(g.editOp(u.serialize(), C)), m.reverse();
|
|
9554
|
-
for (let x = 0; x <
|
|
9554
|
+
for (let x = 0; x < v; x++)
|
|
9555
9555
|
for (const M of m) {
|
|
9556
9556
|
const D = g.removeOp(["tableSource", E, "tableRows", x, "tableCells", M]);
|
|
9557
9557
|
S.push(D);
|
|
@@ -9579,9 +9579,9 @@ const Rs = {
|
|
|
9579
9579
|
const A = d.getViewModel(), h = c == null ? void 0 : c.getUnitId(), u = new me(), g = W.getInstance(), f = Xa(i, A);
|
|
9580
9580
|
if (f == null)
|
|
9581
9581
|
return !1;
|
|
9582
|
-
const { offset: p, len: m, tableId: E, cursor:
|
|
9583
|
-
startOffset:
|
|
9584
|
-
endOffset:
|
|
9582
|
+
const { offset: p, len: m, tableId: E, cursor: I } = f, v = [], R = [{
|
|
9583
|
+
startOffset: I,
|
|
9584
|
+
endOffset: I,
|
|
9585
9585
|
collapsed: !0
|
|
9586
9586
|
}], S = {
|
|
9587
9587
|
id: X.id,
|
|
@@ -9599,9 +9599,9 @@ const Rs = {
|
|
|
9599
9599
|
len: m
|
|
9600
9600
|
});
|
|
9601
9601
|
const b = ue(c, a);
|
|
9602
|
-
|
|
9602
|
+
v.push(g.editOp(u.serialize(), b));
|
|
9603
9603
|
const y = g.removeOp(["tableSource", E]);
|
|
9604
|
-
return
|
|
9604
|
+
return v.push(y), S.params.actions = v.reduce((B, x) => W.compose(B, x), null), !!o.syncExecuteCommand(S.id, S.params);
|
|
9605
9605
|
}
|
|
9606
9606
|
}, ys = "doc.command.table-insert-row", xs = "doc.command.table-insert-column", Fh = "doc.command.table-insert-row-above", Hh = "doc.command.table-insert-row-bellow", kh = "doc.command.table-insert-column-left", Vh = "doc.command.table-insert-column-right", Os = {
|
|
9607
9607
|
id: Fh,
|
|
@@ -9633,10 +9633,10 @@ const Rs = {
|
|
|
9633
9633
|
const h = qe(n, d.getUnitId());
|
|
9634
9634
|
if (h == null)
|
|
9635
9635
|
return !1;
|
|
9636
|
-
const u = h.getViewModel(), g = d == null ? void 0 : d.getUnitId(), f = new me(), p = W.getInstance(), m =
|
|
9636
|
+
const u = h.getViewModel(), g = d == null ? void 0 : d.getUnitId(), f = new me(), p = W.getInstance(), m = vA(c, t, u);
|
|
9637
9637
|
if (m == null)
|
|
9638
9638
|
return !1;
|
|
9639
|
-
const { offset: E, colCount:
|
|
9639
|
+
const { offset: E, colCount: I, tableId: v, insertRowIndex: R } = m, S = [], b = E + 2, y = [{
|
|
9640
9640
|
startOffset: b,
|
|
9641
9641
|
endOffset: b,
|
|
9642
9642
|
collapsed: !0
|
|
@@ -9652,7 +9652,7 @@ const Rs = {
|
|
|
9652
9652
|
t: G.RETAIN,
|
|
9653
9653
|
len: E
|
|
9654
9654
|
});
|
|
9655
|
-
const B = EA(
|
|
9655
|
+
const B = EA(I);
|
|
9656
9656
|
f.push({
|
|
9657
9657
|
t: G.INSERT,
|
|
9658
9658
|
body: B,
|
|
@@ -9660,7 +9660,7 @@ const Rs = {
|
|
|
9660
9660
|
});
|
|
9661
9661
|
const x = ue(d, l);
|
|
9662
9662
|
S.push(p.editOp(f.serialize(), x));
|
|
9663
|
-
const M = Zr(
|
|
9663
|
+
const M = Zr(I), D = p.insertOp(["tableSource", v, "tableRows", R], M);
|
|
9664
9664
|
return S.push(D), C.params.actions = S.reduce((w, N) => W.compose(w, N), null), !!s.syncExecuteCommand(C.id, C.params);
|
|
9665
9665
|
}
|
|
9666
9666
|
}, Wh = {
|
|
@@ -9681,7 +9681,7 @@ const Rs = {
|
|
|
9681
9681
|
const u = h.getViewModel(), g = d == null ? void 0 : d.getUnitId(), f = new me(), p = W.getInstance(), m = CA(c, t, u);
|
|
9682
9682
|
if (m == null)
|
|
9683
9683
|
return !1;
|
|
9684
|
-
const { offsets: E, columnIndex:
|
|
9684
|
+
const { offsets: E, columnIndex: I, tableId: v, rowCount: R } = m, S = [], b = E[0] + 1, y = [{
|
|
9685
9685
|
startOffset: b,
|
|
9686
9686
|
endOffset: b,
|
|
9687
9687
|
collapsed: !0
|
|
@@ -9698,7 +9698,7 @@ const Rs = {
|
|
|
9698
9698
|
t: G.RETAIN,
|
|
9699
9699
|
len: re
|
|
9700
9700
|
});
|
|
9701
|
-
const he =
|
|
9701
|
+
const he = IA();
|
|
9702
9702
|
f.push({
|
|
9703
9703
|
t: G.INSERT,
|
|
9704
9704
|
body: he,
|
|
@@ -9708,26 +9708,26 @@ const Rs = {
|
|
|
9708
9708
|
const B = ue(d, l);
|
|
9709
9709
|
S.push(p.editOp(f.serialize(), B));
|
|
9710
9710
|
for (let re = 0; re < R; re++) {
|
|
9711
|
-
const he = Jr(), Pe = p.insertOp(["tableSource",
|
|
9711
|
+
const he = Jr(), Pe = p.insertOp(["tableSource", v, "tableRows", re, "tableCells", I], he);
|
|
9712
9712
|
S.push(Pe);
|
|
9713
9713
|
}
|
|
9714
|
-
const x = d.getSnapshot(), M = x.documentStyle, { marginLeft: D = 0, marginRight: F = 0 } = M, w = ((ae = (oe = M.pageSize) == null ? void 0 : oe.width) != null ? ae : 800) - D - F, N = (ce = x == null ? void 0 : x.tableSource) == null ? void 0 : ce[
|
|
9714
|
+
const x = d.getSnapshot(), M = x.documentStyle, { marginLeft: D = 0, marginRight: F = 0 } = M, w = ((ae = (oe = M.pageSize) == null ? void 0 : oe.width) != null ? ae : 800) - D - F, N = (ce = x == null ? void 0 : x.tableSource) == null ? void 0 : ce[v].tableColumns, { newColWidth: ee, widths: $ } = RA(w, N, I);
|
|
9715
9715
|
for (let re = 0; re < $.length; re++) {
|
|
9716
|
-
const he = p.replaceOp(["tableSource",
|
|
9716
|
+
const he = p.replaceOp(["tableSource", v, "tableColumns", re, "size", "width", "v"], N[re].size.width.v, $[re]);
|
|
9717
9717
|
S.push(he);
|
|
9718
9718
|
}
|
|
9719
|
-
const U = $r(ee), H = p.insertOp(["tableSource",
|
|
9719
|
+
const U = $r(ee), H = p.insertOp(["tableSource", v, "tableColumns", I], U);
|
|
9720
9720
|
return S.push(H), C.params.actions = S.reduce((re, he) => W.compose(re, he), null), !!s.syncExecuteCommand(C.id, C.params);
|
|
9721
9721
|
}
|
|
9722
9722
|
}, rt = {
|
|
9723
9723
|
id: "doc-paragraph-setting.command",
|
|
9724
9724
|
type: P.COMMAND,
|
|
9725
9725
|
handler: async (n, e) => {
|
|
9726
|
-
var
|
|
9726
|
+
var I, v, R, S, b;
|
|
9727
9727
|
const t = n.get(Y), o = n.get(L), r = n.get(T), s = o.getCurrentUnitForType(_.UNIVER_DOC), i = t.getDocRanges();
|
|
9728
9728
|
if (!s || i.length === 0 || !e)
|
|
9729
9729
|
return !1;
|
|
9730
|
-
const a = i[0].segmentId, c = s.getUnitId(), l = s.getSelfOrHeaderFooterModel(a), d = (
|
|
9730
|
+
const a = i[0].segmentId, c = s.getUnitId(), l = s.getSelfOrHeaderFooterModel(a), d = (v = (I = l.getBody()) == null ? void 0 : I.paragraphs) != null ? v : [], A = (S = (R = l.getBody()) == null ? void 0 : R.dataStream) != null ? S : "", h = (b = le.range.getParagraphsInRanges(i, d, A)) != null ? b : [], u = {
|
|
9731
9731
|
id: X.id,
|
|
9732
9732
|
params: {
|
|
9733
9733
|
unitId: c,
|
|
@@ -9768,7 +9768,7 @@ const Rs = {
|
|
|
9768
9768
|
}
|
|
9769
9769
|
}, zh = () => {
|
|
9770
9770
|
const n = Z(Y), e = Z(nn), t = Me(() => n.getDocRanges(), []);
|
|
9771
|
-
return
|
|
9771
|
+
return ve(() => {
|
|
9772
9772
|
t.length || e.closePanel();
|
|
9773
9773
|
}, [t]), t;
|
|
9774
9774
|
}, jh = () => {
|
|
@@ -9868,7 +9868,7 @@ const Rs = {
|
|
|
9868
9868
|
c.current = i, A(g), d(u), s.next({ spacingRule: u });
|
|
9869
9869
|
}
|
|
9870
9870
|
};
|
|
9871
|
-
return
|
|
9871
|
+
return ve(() => {
|
|
9872
9872
|
const u = s.pipe(
|
|
9873
9873
|
lr((g) => !!Object.keys(g).length),
|
|
9874
9874
|
td(16),
|
|
@@ -9912,7 +9912,7 @@ function eg() {
|
|
|
9912
9912
|
{ label: n.t("toolbar.alignCenter"), value: String(Qe.CENTER), icon: /* @__PURE__ */ Q(Qa, {}) },
|
|
9913
9913
|
{ label: n.t("toolbar.alignRight"), value: String(Qe.RIGHT), icon: /* @__PURE__ */ Q(Ha, {}) },
|
|
9914
9914
|
{ label: n.t("toolbar.alignJustify"), value: String(Qe.JUSTIFIED), icon: /* @__PURE__ */ Q(xa, {}) }
|
|
9915
|
-
], []), t = jh(), [o, r] = Gh(t, e[0].value), [s, i] = Yh(t), [a, c] = Kh(t), [l, d] = qh(t), [A, h] = Xh(t), [u, g] = Jh(t), [f, p] = Zh(t), { lineSpacing: [m, E], spacingRule: [
|
|
9915
|
+
], []), t = jh(), [o, r] = Gh(t, e[0].value), [s, i] = Yh(t), [a, c] = Kh(t), [l, d] = qh(t), [A, h] = Xh(t), [u, g] = Jh(t), [f, p] = Zh(t), { lineSpacing: [m, E], spacingRule: [I, v] } = $h(t), R = Me(() => I === Xt.AUTO ? { min: 1, max: 5, step: m < 2 ? 0.5 : 1 } : { min: 1, max: 100 }, [I, m]);
|
|
9916
9916
|
return /* @__PURE__ */ se("div", { children: [
|
|
9917
9917
|
/* @__PURE__ */ Q("div", { className: "univer-t-4 univer-text-sm univer-font-medium", children: n.t("doc.paragraphSetting.alignment") }),
|
|
9918
9918
|
/* @__PURE__ */ Q(
|
|
@@ -9988,12 +9988,12 @@ function eg() {
|
|
|
9988
9988
|
/* @__PURE__ */ Q(
|
|
9989
9989
|
pa,
|
|
9990
9990
|
{
|
|
9991
|
-
value: `${
|
|
9991
|
+
value: `${I}`,
|
|
9992
9992
|
options: [
|
|
9993
9993
|
{ label: n.t("doc.paragraphSetting.multiSpace"), value: `${Xt.AUTO}` },
|
|
9994
9994
|
{ label: n.t("doc.paragraphSetting.fixedValue"), value: `${Xt.AT_LEAST}` }
|
|
9995
9995
|
],
|
|
9996
|
-
onChange: (S) =>
|
|
9996
|
+
onChange: (S) => v(Number(S))
|
|
9997
9997
|
}
|
|
9998
9998
|
),
|
|
9999
9999
|
/* @__PURE__ */ Q(
|
|
@@ -10014,7 +10014,7 @@ function eg() {
|
|
|
10014
10014
|
const tg = (n, e) => e.length === n.length && n.some((t) => e.some((o) => o.startOffset === t.startOffset && o.endOffset === t.endOffset));
|
|
10015
10015
|
function ng() {
|
|
10016
10016
|
const n = Z(T), e = Z(Ke), t = tt(e.currentLocale$), [o, r] = pe(""), s = Me(() => Dr(() => r(Fe(4)), 300), []), i = Ge([]);
|
|
10017
|
-
return
|
|
10017
|
+
return ve(() => {
|
|
10018
10018
|
const a = n.onCommandExecuted((c) => {
|
|
10019
10019
|
if (Ne.id === c.id) {
|
|
10020
10020
|
const l = c.params.ranges;
|
|
@@ -10023,9 +10023,9 @@ function ng() {
|
|
|
10023
10023
|
X.id === c.id && c.params.trigger !== rt.id && s();
|
|
10024
10024
|
});
|
|
10025
10025
|
return () => a.dispose();
|
|
10026
|
-
}, [s]),
|
|
10026
|
+
}, [s]), ve(() => {
|
|
10027
10027
|
r(Fe(4));
|
|
10028
|
-
}, [t]),
|
|
10028
|
+
}, [t]), ve(() => () => s.cancel(), [s]), /* @__PURE__ */ Q(eg, {}, o);
|
|
10029
10029
|
}
|
|
10030
10030
|
var og = Object.getOwnPropertyDescriptor, rg = (n, e, t, o) => {
|
|
10031
10031
|
for (var r = o > 1 ? void 0 : o ? og(e, t) : e, s = n.length - 1, i; s >= 0; s--)
|
|
@@ -10142,10 +10142,10 @@ const dt = (n) => {
|
|
|
10142
10142
|
title: "rightClick.delete",
|
|
10143
10143
|
disabled$: Ps(n),
|
|
10144
10144
|
hidden$: ie(n, _.UNIVER_DOC)
|
|
10145
|
-
}),
|
|
10145
|
+
}), Ic = "doc.menu.table-insert";
|
|
10146
10146
|
function Ag(n) {
|
|
10147
10147
|
return {
|
|
10148
|
-
id:
|
|
10148
|
+
id: Ic,
|
|
10149
10149
|
type: J.SUBITEMS,
|
|
10150
10150
|
title: "table.insert",
|
|
10151
10151
|
icon: "Insert",
|
|
@@ -10192,10 +10192,10 @@ function fg(n) {
|
|
|
10192
10192
|
hidden$: ie(n, _.UNIVER_DOC)
|
|
10193
10193
|
};
|
|
10194
10194
|
}
|
|
10195
|
-
const
|
|
10195
|
+
const vc = "doc.menu.table-delete";
|
|
10196
10196
|
function pg(n) {
|
|
10197
10197
|
return {
|
|
10198
|
-
id:
|
|
10198
|
+
id: vc,
|
|
10199
10199
|
type: J.SUBITEMS,
|
|
10200
10200
|
title: "table.delete",
|
|
10201
10201
|
icon: "Reduce",
|
|
@@ -10232,7 +10232,7 @@ function Eg(n) {
|
|
|
10232
10232
|
hidden$: ie(n, _.UNIVER_DOC)
|
|
10233
10233
|
};
|
|
10234
10234
|
}
|
|
10235
|
-
const
|
|
10235
|
+
const Ig = {
|
|
10236
10236
|
[Gs.FORMAT]: {
|
|
10237
10237
|
[Qt.id]: {
|
|
10238
10238
|
order: 0,
|
|
@@ -10250,7 +10250,7 @@ const vg = {
|
|
|
10250
10250
|
order: 3,
|
|
10251
10251
|
menuItemFactory: du
|
|
10252
10252
|
},
|
|
10253
|
-
[
|
|
10253
|
+
[vt.id]: {
|
|
10254
10254
|
order: 4,
|
|
10255
10255
|
menuItemFactory: Au
|
|
10256
10256
|
},
|
|
@@ -10286,7 +10286,7 @@ const vg = {
|
|
|
10286
10286
|
[Gs.LAYOUT]: {
|
|
10287
10287
|
[wo.id]: {
|
|
10288
10288
|
order: 2,
|
|
10289
|
-
menuItemFactory:
|
|
10289
|
+
menuItemFactory: vu
|
|
10290
10290
|
},
|
|
10291
10291
|
[No.id]: {
|
|
10292
10292
|
order: 3,
|
|
@@ -10333,9 +10333,9 @@ const vg = {
|
|
|
10333
10333
|
[fc]: {
|
|
10334
10334
|
order: 2,
|
|
10335
10335
|
menuItemFactory: Eu,
|
|
10336
|
-
[
|
|
10336
|
+
[vs.id]: {
|
|
10337
10337
|
order: 0,
|
|
10338
|
-
menuItemFactory:
|
|
10338
|
+
menuItemFactory: Iu
|
|
10339
10339
|
}
|
|
10340
10340
|
}
|
|
10341
10341
|
},
|
|
@@ -10363,7 +10363,7 @@ const vg = {
|
|
|
10363
10363
|
order: 0,
|
|
10364
10364
|
menuItemFactory: ag
|
|
10365
10365
|
},
|
|
10366
|
-
[
|
|
10366
|
+
[Ic]: {
|
|
10367
10367
|
order: 1,
|
|
10368
10368
|
menuItemFactory: Ag,
|
|
10369
10369
|
[Os.id]: {
|
|
@@ -10383,7 +10383,7 @@ const vg = {
|
|
|
10383
10383
|
menuItemFactory: fg
|
|
10384
10384
|
}
|
|
10385
10385
|
},
|
|
10386
|
-
[
|
|
10386
|
+
[vc]: {
|
|
10387
10387
|
order: 2,
|
|
10388
10388
|
menuItemFactory: pg,
|
|
10389
10389
|
[Rs.id]: {
|
|
@@ -10419,7 +10419,7 @@ const vg = {
|
|
|
10419
10419
|
order: 3,
|
|
10420
10420
|
menuItemFactory: wu
|
|
10421
10421
|
},
|
|
10422
|
-
[
|
|
10422
|
+
[Is.id]: {
|
|
10423
10423
|
order: 4,
|
|
10424
10424
|
menuItemFactory: Nu
|
|
10425
10425
|
},
|
|
@@ -10478,8 +10478,8 @@ const vg = {
|
|
|
10478
10478
|
}
|
|
10479
10479
|
}
|
|
10480
10480
|
};
|
|
10481
|
-
var
|
|
10482
|
-
for (var r = o > 1 ? void 0 : o ?
|
|
10481
|
+
var vg = Object.getOwnPropertyDescriptor, Cg = (n, e, t, o) => {
|
|
10482
|
+
for (var r = o > 1 ? void 0 : o ? vg(e, t) : e, s = n.length - 1, i; s >= 0; s--)
|
|
10483
10483
|
(i = n[s]) && (r = i(r) || r);
|
|
10484
10484
|
return r;
|
|
10485
10485
|
}, st = (n, e) => (t, o) => e(t, o, n);
|
|
@@ -10495,7 +10495,7 @@ let uo = class extends ge {
|
|
|
10495
10495
|
this.disposeWithMe(this._uiPartsService.registerComponent(Ys.FOOTER, () => Ks(Bh, this._injector))), this.disposeWithMe(this._uiPartsService.registerComponent(Ys.CONTENT, () => Ks(Qh, this._injector)));
|
|
10496
10496
|
}
|
|
10497
10497
|
_initMenus() {
|
|
10498
|
-
this._menuManagerService.mergeMenu(
|
|
10498
|
+
this._menuManagerService.mergeMenu(Ig);
|
|
10499
10499
|
}
|
|
10500
10500
|
_initShortCut() {
|
|
10501
10501
|
[
|
|
@@ -10505,9 +10505,9 @@ let uo = class extends ge {
|
|
|
10505
10505
|
ph,
|
|
10506
10506
|
mh,
|
|
10507
10507
|
Sh,
|
|
10508
|
-
Ih,
|
|
10509
|
-
Ch,
|
|
10510
10508
|
vh,
|
|
10509
|
+
Ch,
|
|
10510
|
+
Ih,
|
|
10511
10511
|
Eh,
|
|
10512
10512
|
Rh,
|
|
10513
10513
|
bh,
|
|
@@ -10581,12 +10581,12 @@ let ho = class extends Et {
|
|
|
10581
10581
|
const {
|
|
10582
10582
|
left: m,
|
|
10583
10583
|
top: E,
|
|
10584
|
-
right:
|
|
10585
|
-
bottom:
|
|
10584
|
+
right: I,
|
|
10585
|
+
bottom: v
|
|
10586
10586
|
} = f.getBounding().viewBound;
|
|
10587
10587
|
let R = 0, S = 0;
|
|
10588
10588
|
const b = p ? (C = p.params.backScrollOffset) != null ? C : 0 : 100;
|
|
10589
|
-
g < E ? R = g - E - b : g >
|
|
10589
|
+
g < E ? R = g - E - b : g > v - h && (R = g - v + h + b), u < m ? S = u - m : u > I - Li && (S = u - I + Li);
|
|
10590
10590
|
const y = f.transViewportScroll2ScrollValue(S, R);
|
|
10591
10591
|
f.scrollByBarDeltaValue(y);
|
|
10592
10592
|
}
|
|
@@ -10701,8 +10701,8 @@ let Rr = class extends Et {
|
|
|
10701
10701
|
const p = a[g];
|
|
10702
10702
|
let { pageWidth: m, pageHeight: E } = p;
|
|
10703
10703
|
if (A === De.MODERN) {
|
|
10704
|
-
const
|
|
10705
|
-
m =
|
|
10704
|
+
const I = Og(p);
|
|
10705
|
+
m = I.pageWidth, E = I.pageHeight;
|
|
10706
10706
|
}
|
|
10707
10707
|
s.pageLayoutType === Rn.VERTICAL ? (l += E, l += s.pageMarginTop, g === f - 1 && (l += s.pageMarginTop), c = Math.max(c, m)) : s.pageLayoutType === Rn.HORIZONTAL && (c += m, g !== f - 1 && (c += s.pageMarginLeft), l = Math.max(l, E));
|
|
10708
10708
|
}
|
|
@@ -10835,10 +10835,10 @@ const Rc = {
|
|
|
10835
10835
|
if (p == null)
|
|
10836
10836
|
return !1;
|
|
10837
10837
|
Object.assign(u, u);
|
|
10838
|
-
const { startOffset: E, endOffset:
|
|
10838
|
+
const { startOffset: E, endOffset: I } = u, v = o.length, R = [
|
|
10839
10839
|
{
|
|
10840
|
-
startOffset: E +
|
|
10841
|
-
endOffset: E +
|
|
10840
|
+
startOffset: E + v,
|
|
10841
|
+
endOffset: E + v,
|
|
10842
10842
|
collapsed: !0,
|
|
10843
10843
|
style: g
|
|
10844
10844
|
}
|
|
@@ -10849,18 +10849,18 @@ const Rc = {
|
|
|
10849
10849
|
actions: [],
|
|
10850
10850
|
textRanges: R
|
|
10851
10851
|
}
|
|
10852
|
-
}, b = d.getDefaultStyle(), y = d.getStyleCache(), C = Wr((ee = p.customRanges) != null ? ee : [], E + r,
|
|
10852
|
+
}, b = d.getDefaultStyle(), y = d.getStyleCache(), C = Wr((ee = p.customRanges) != null ? ee : [], E + r, In.includes(t)), B = To(
|
|
10853
10853
|
p,
|
|
10854
|
-
i ?
|
|
10854
|
+
i ? I : E + r,
|
|
10855
10855
|
b,
|
|
10856
10856
|
y,
|
|
10857
|
-
|
|
10857
|
+
In.includes(t)
|
|
10858
10858
|
), x = zr(($ = p.customDecorations) != null ? $ : [], E + r), M = new me(), D = W.getInstance();
|
|
10859
10859
|
if (!u.collapsed && i) {
|
|
10860
10860
|
const U = le.selection.delete([u], p, 0, null, !1);
|
|
10861
10861
|
M.push(...U), S.params.textRanges = [{
|
|
10862
|
-
startOffset: E +
|
|
10863
|
-
endOffset: E +
|
|
10862
|
+
startOffset: E + v,
|
|
10863
|
+
endOffset: E + v,
|
|
10864
10864
|
collapsed: !0
|
|
10865
10865
|
}];
|
|
10866
10866
|
} else
|
|
@@ -10918,7 +10918,7 @@ const Rc = {
|
|
|
10918
10918
|
}]
|
|
10919
10919
|
}
|
|
10920
10920
|
};
|
|
10921
|
-
return t.syncExecuteCommand(
|
|
10921
|
+
return t.syncExecuteCommand(Ia.id, l);
|
|
10922
10922
|
}
|
|
10923
10923
|
}, eo = {
|
|
10924
10924
|
type: P.COMMAND,
|
|
@@ -11058,7 +11058,7 @@ let fo = class extends ge {
|
|
|
11058
11058
|
getMutations(n) {
|
|
11059
11059
|
const e = n.commandParams;
|
|
11060
11060
|
return [{
|
|
11061
|
-
id:
|
|
11061
|
+
id: vr.id,
|
|
11062
11062
|
params: {
|
|
11063
11063
|
type: e != null && e.shift ? $n.decrease : $n.increase
|
|
11064
11064
|
}
|
|
@@ -11136,7 +11136,7 @@ let fo = class extends ge {
|
|
|
11136
11136
|
getMutations: (n) => {
|
|
11137
11137
|
const e = n.paragraphs[0].bullet;
|
|
11138
11138
|
return e ? e.nestingLevel > 0 ? [{
|
|
11139
|
-
id:
|
|
11139
|
+
id: vr.id,
|
|
11140
11140
|
params: {
|
|
11141
11141
|
type: $n.decrease
|
|
11142
11142
|
}
|
|
@@ -11309,11 +11309,11 @@ let po = class extends ge {
|
|
|
11309
11309
|
}
|
|
11310
11310
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
11311
11311
|
_handleShiftMoveSelection(e) {
|
|
11312
|
-
var
|
|
11312
|
+
var I, v, R;
|
|
11313
11313
|
const t = this._textSelectionManagerService.getActiveTextRange(), o = this._textSelectionManagerService.getTextRanges(), r = this._univerInstanceService.getCurrentUniverDocInstance();
|
|
11314
11314
|
if (r == null)
|
|
11315
11315
|
return;
|
|
11316
|
-
const s = (
|
|
11316
|
+
const s = (I = this._renderManagerService.getRenderById(r.getUnitId())) == null ? void 0 : I.with(Ae).getSkeleton(), i = this._getDocObject();
|
|
11317
11317
|
if (t == null || s == null || i == null)
|
|
11318
11318
|
return;
|
|
11319
11319
|
const {
|
|
@@ -11342,7 +11342,7 @@ let po = class extends ge {
|
|
|
11342
11342
|
}
|
|
11343
11343
|
const p = d || A === _e.FORWARD ? a : c;
|
|
11344
11344
|
let m = d || A === _e.FORWARD ? c : a;
|
|
11345
|
-
const E = (
|
|
11345
|
+
const E = (v = r.getSelfOrHeaderFooterModel(h).getBody().dataStream.length) != null ? v : Number.POSITIVE_INFINITY;
|
|
11346
11346
|
if (e === de.LEFT || e === de.RIGHT) {
|
|
11347
11347
|
const S = s.findNodeByCharIndex(m - 1, h, f), b = s.findNodeByCharIndex(m, h, f);
|
|
11348
11348
|
m = e === de.RIGHT ? m + b.count : m - ((R = S == null ? void 0 : S.count) != null ? R : 0), m = Math.min(E - 2, Math.max(0, m)), this._textSelectionManagerService.replaceTextRanges([
|
|
@@ -11382,7 +11382,7 @@ let po = class extends ge {
|
|
|
11382
11382
|
}
|
|
11383
11383
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
11384
11384
|
_handleMoveCursor(e) {
|
|
11385
|
-
var E,
|
|
11385
|
+
var E, I, v, R;
|
|
11386
11386
|
const t = this._textSelectionManagerService.getActiveTextRange(), o = this._textSelectionManagerService.getTextRanges(), r = this._univerInstanceService.getCurrentUniverDocInstance();
|
|
11387
11387
|
if (r == null)
|
|
11388
11388
|
return !1;
|
|
@@ -11392,7 +11392,7 @@ let po = class extends ge {
|
|
|
11392
11392
|
const { startOffset: a, endOffset: c, style: l, collapsed: d, segmentId: A, startNodePosition: h, endNodePosition: u, segmentPage: g } = t, f = r.getSelfOrHeaderFooterModel(A).getBody();
|
|
11393
11393
|
if (f == null)
|
|
11394
11394
|
return;
|
|
11395
|
-
const p = (
|
|
11395
|
+
const p = (I = f.dataStream.length) != null ? I : Number.POSITIVE_INFINITY, m = (v = r.getCustomRanges()) != null ? v : [];
|
|
11396
11396
|
if (e === de.LEFT || e === de.RIGHT) {
|
|
11397
11397
|
let S;
|
|
11398
11398
|
if (!t.collapsed || o.length > 1) {
|
|
@@ -11495,7 +11495,7 @@ let po = class extends ge {
|
|
|
11495
11495
|
}
|
|
11496
11496
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
11497
11497
|
_getNextOrPrevLine(e, t, o = !1) {
|
|
11498
|
-
var f, p, m, E,
|
|
11498
|
+
var f, p, m, E, I, v, R, S, b, y, C, B;
|
|
11499
11499
|
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;
|
|
11500
11500
|
if (r == null || s == null || i == null || a == null || c == null)
|
|
11501
11501
|
return;
|
|
@@ -11540,9 +11540,9 @@ let po = class extends ge {
|
|
|
11540
11540
|
if (h === -1)
|
|
11541
11541
|
return;
|
|
11542
11542
|
if (t === !0)
|
|
11543
|
-
d = (
|
|
11543
|
+
d = (I = (E = c.sections[h - 1]) == null ? void 0 : E.columns[0]) == null ? void 0 : I.lines[0];
|
|
11544
11544
|
else {
|
|
11545
|
-
const x = (R = (
|
|
11545
|
+
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], D = M == null ? void 0 : M.lines;
|
|
11546
11546
|
d = D == null ? void 0 : D[D.length - 1];
|
|
11547
11547
|
}
|
|
11548
11548
|
if (d != null)
|
|
@@ -11616,7 +11616,7 @@ const zg = ({
|
|
|
11616
11616
|
function a(c, l) {
|
|
11617
11617
|
r(c), i(l), n(c, l);
|
|
11618
11618
|
}
|
|
11619
|
-
return
|
|
11619
|
+
return ve(() => {
|
|
11620
11620
|
r(e.rowCount), i(e.colCount);
|
|
11621
11621
|
}, [e]), /* @__PURE__ */ se("div", { className: "univer-flex univer-items-center univer-justify-between", children: [
|
|
11622
11622
|
/* @__PURE__ */ se("div", { className: "univer-flex univer-items-center univer-gap-2", children: [
|
|
@@ -11667,7 +11667,7 @@ let mo = class extends ge {
|
|
|
11667
11667
|
}
|
|
11668
11668
|
_registerCommands() {
|
|
11669
11669
|
[
|
|
11670
|
-
|
|
11670
|
+
vs
|
|
11671
11671
|
].forEach((n) => this.disposeWithMe(this._commandService.registerCommand(n)));
|
|
11672
11672
|
}
|
|
11673
11673
|
_initCustomComponents() {
|
|
@@ -11983,7 +11983,7 @@ let Tr = class extends ge {
|
|
|
11983
11983
|
const { unitId: t } = this._context, { event: o, content: r = "", activeRange: s } = e, i = o, a = this._docSkeletonManagerService.getSkeleton();
|
|
11984
11984
|
if (i.data == null || a == null || s == null)
|
|
11985
11985
|
return;
|
|
11986
|
-
const { segmentId: c } = s, d = this._context.unit.getSelfOrHeaderFooterModel(c).getBody(), A = this._docMenuStyleService.getDefaultStyle(), h = this._docMenuStyleService.getStyleCache(), u = Wr((p = d == null ? void 0 : d.customRanges) != null ? p : [], s.endOffset,
|
|
11986
|
+
const { segmentId: c } = s, d = this._context.unit.getSelfOrHeaderFooterModel(c).getBody(), A = this._docMenuStyleService.getDefaultStyle(), h = this._docMenuStyleService.getStyleCache(), u = Wr((p = d == null ? void 0 : d.customRanges) != null ? p : [], s.endOffset, In.includes(t)), g = To(d, s.endOffset, A, h, In.includes(t)), f = zr((m = d == null ? void 0 : d.customDecorations) != null ? m : [], s.endOffset);
|
|
11987
11987
|
await this._commandService.executeCommand(Za.id, {
|
|
11988
11988
|
unitId: t,
|
|
11989
11989
|
body: {
|
|
@@ -12023,15 +12023,15 @@ class Ds extends ge {
|
|
|
12023
12023
|
super(), this._context = e;
|
|
12024
12024
|
}
|
|
12025
12025
|
calculatePagePosition() {
|
|
12026
|
-
var
|
|
12027
|
-
const e = ft(this._context), o = (R = (
|
|
12026
|
+
var v, R;
|
|
12027
|
+
const e = ft(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: l, pageMarginLeft: d, pageMarginTop: A } = r;
|
|
12028
12028
|
if (a == null || c === Number.POSITIVE_INFINITY || l === Number.POSITIVE_INFINITY)
|
|
12029
12029
|
return;
|
|
12030
12030
|
const { width: h, height: u } = a;
|
|
12031
12031
|
let g = 0, f = A, p = 0, m = 0, E = Number.POSITIVE_INFINITY;
|
|
12032
12032
|
h > (c + d * 2) * o ? (g = h / 2 - c * o / 2, g /= o, p = (h - d * 2) / o, E = 0) : (g = d, p = c + d * 2, E = (p - h / o) / 2), u > l ? m = (u - A * 2) / o : m = l + A * 2, s.resize(p, m), h <= 1 && (g = -1e4, f = -1e4), r.translate(g, f), i.translate(g, f);
|
|
12033
|
-
const
|
|
12034
|
-
return E !== Number.POSITIVE_INFINITY &&
|
|
12033
|
+
const I = s.getViewport(We.VIEW_MAIN);
|
|
12034
|
+
return E !== Number.POSITIVE_INFINITY && I != null && I.scrollToViewportPos({
|
|
12035
12035
|
viewportScrollX: E
|
|
12036
12036
|
}), this;
|
|
12037
12037
|
}
|
|
@@ -12045,7 +12045,7 @@ let Br = class extends ge {
|
|
|
12045
12045
|
constructor(n, e, t) {
|
|
12046
12046
|
super(), this._context = n, this._docPageLayoutService = e, this._textSelectionManagerService = t;
|
|
12047
12047
|
const o = this._context.unitId;
|
|
12048
|
-
if (
|
|
12048
|
+
if (It(o) && o !== ot) return this;
|
|
12049
12049
|
this._initResize();
|
|
12050
12050
|
}
|
|
12051
12051
|
_initResize() {
|
|
@@ -12125,7 +12125,7 @@ let Mr = class extends ge {
|
|
|
12125
12125
|
u,
|
|
12126
12126
|
g
|
|
12127
12127
|
), p = this._docSkeletonManagerService.getViewModel(), m = p.getEditArea();
|
|
12128
|
-
m !==
|
|
12128
|
+
m !== Ie.BODY && f !== Ie.BODY && f !== m && p.setEditArea(f);
|
|
12129
12129
|
}
|
|
12130
12130
|
if (this._docSelectionRenderService.__onPointDown(s), this._editorService.getEditor(e)) {
|
|
12131
12131
|
this._setEditorFocus(e);
|
|
@@ -12173,7 +12173,7 @@ let Mr = class extends ge {
|
|
|
12173
12173
|
this.disposeWithMe(this._docSkeletonManagerService.currentSkeleton$.subscribe((e) => {
|
|
12174
12174
|
if (!e) return;
|
|
12175
12175
|
const { unitId: t } = this._context;
|
|
12176
|
-
if (!
|
|
12176
|
+
if (!It(t)) {
|
|
12177
12177
|
this._docSelectionRenderService.focus();
|
|
12178
12178
|
const s = this._context.unit.getSnapshot(), i = Va(s);
|
|
12179
12179
|
this._docSelectionManagerService.replaceDocRanges([
|
|
@@ -12204,7 +12204,7 @@ var Af = Object.getOwnPropertyDescriptor, uf = (n, e, t, o) => {
|
|
|
12204
12204
|
}, Tt = (n, e) => (t, o) => e(t, o, n);
|
|
12205
12205
|
let _r = class extends ge {
|
|
12206
12206
|
constructor(n, e, t, o, r, s, i, a) {
|
|
12207
|
-
super(), this._context = n, this._contextService = e, this._docSkeletonManagerService = t, this._univerInstanceService = o, this._commandService = r, this._textSelectionManagerService = s, this._editorService = i, this._docPageLayoutService = a, this._initSkeletonListener(), this._initCommandExecutedListener(), this._initRenderRefresher(), setTimeout(() => this.updateViewZoom(1, !0), 20),
|
|
12207
|
+
super(), this._context = n, this._contextService = e, this._docSkeletonManagerService = t, this._univerInstanceService = o, this._commandService = r, this._textSelectionManagerService = s, this._editorService = i, this._docPageLayoutService = a, this._initSkeletonListener(), this._initCommandExecutedListener(), this._initRenderRefresher(), setTimeout(() => this.updateViewZoom(1, !0), 20), It(this._context.unitId) || this._initZoomEventListener();
|
|
12208
12208
|
}
|
|
12209
12209
|
_initRenderRefresher() {
|
|
12210
12210
|
this._docSkeletonManagerService.currentSkeleton$.subscribe((n) => {
|
|
@@ -12322,7 +12322,7 @@ var pf = Object.getOwnPropertyDescriptor, mf = (n, e, t, o) => {
|
|
|
12322
12322
|
return r;
|
|
12323
12323
|
}, hn = (n, e) => (t, o) => e(t, o, n);
|
|
12324
12324
|
const Wi = 300;
|
|
12325
|
-
let
|
|
12325
|
+
let Io = class extends Et {
|
|
12326
12326
|
constructor(e, t, o, r, s) {
|
|
12327
12327
|
super();
|
|
12328
12328
|
O(this, "_docStateChange$", new Ue(null));
|
|
@@ -12441,20 +12441,20 @@ let vo = class extends Et {
|
|
|
12441
12441
|
t.length = 0, this._docStateChange$.next(u);
|
|
12442
12442
|
}
|
|
12443
12443
|
};
|
|
12444
|
-
|
|
12444
|
+
Io = mf([
|
|
12445
12445
|
hn(0, z(bo)),
|
|
12446
12446
|
hn(1, T),
|
|
12447
12447
|
hn(2, L),
|
|
12448
12448
|
hn(3, z(nl)),
|
|
12449
12449
|
hn(4, fe)
|
|
12450
|
-
],
|
|
12450
|
+
], Io);
|
|
12451
12451
|
var Sf = Object.getOwnPropertyDescriptor, Ef = (n, e, t, o) => {
|
|
12452
12452
|
for (var r = o > 1 ? void 0 : o ? Sf(e, t) : e, s = n.length - 1, i; s >= 0; s--)
|
|
12453
12453
|
(i = n[s]) && (r = i(r) || r);
|
|
12454
12454
|
return r;
|
|
12455
12455
|
}, zi = (n, e) => (t, o) => e(t, o, n);
|
|
12456
12456
|
const ji = "univer-doc-main-canvas";
|
|
12457
|
-
let
|
|
12457
|
+
let vo = class extends Et {
|
|
12458
12458
|
constructor(n, e) {
|
|
12459
12459
|
super(), this._instanceSrv = n, this._renderManagerService = e, this._init();
|
|
12460
12460
|
}
|
|
@@ -12476,15 +12476,15 @@ let Io = class extends Et {
|
|
|
12476
12476
|
this._renderManagerService.removeRender(e);
|
|
12477
12477
|
}
|
|
12478
12478
|
};
|
|
12479
|
-
|
|
12479
|
+
vo = Ef([
|
|
12480
12480
|
zi(0, L),
|
|
12481
12481
|
zi(1, fe)
|
|
12482
|
-
],
|
|
12483
|
-
const
|
|
12482
|
+
], vo);
|
|
12483
|
+
const If = {
|
|
12484
12484
|
id: Mn.id,
|
|
12485
12485
|
preconditions: dh,
|
|
12486
12486
|
binding: q.ENTER
|
|
12487
|
-
},
|
|
12487
|
+
}, vf = {
|
|
12488
12488
|
id: Mo.id,
|
|
12489
12489
|
preconditions: Ee,
|
|
12490
12490
|
binding: q.BACKSPACE
|
|
@@ -12571,8 +12571,8 @@ let Pr = class extends $c {
|
|
|
12571
12571
|
}
|
|
12572
12572
|
onReady() {
|
|
12573
12573
|
this._initRenderBasics(), this._markDocAsFocused(), Hs(this._injector, [
|
|
12574
|
-
[
|
|
12575
|
-
[
|
|
12574
|
+
[Io],
|
|
12575
|
+
[vo]
|
|
12576
12576
|
]);
|
|
12577
12577
|
}
|
|
12578
12578
|
onRendered() {
|
|
@@ -12595,7 +12595,7 @@ let Pr = class extends $c {
|
|
|
12595
12595
|
Ut,
|
|
12596
12596
|
Ft,
|
|
12597
12597
|
Ht,
|
|
12598
|
-
|
|
12598
|
+
vt,
|
|
12599
12599
|
kt,
|
|
12600
12600
|
ct,
|
|
12601
12601
|
en,
|
|
@@ -12635,7 +12635,7 @@ let Pr = class extends $c {
|
|
|
12635
12635
|
tn,
|
|
12636
12636
|
Fo,
|
|
12637
12637
|
Mn,
|
|
12638
|
-
|
|
12638
|
+
vr,
|
|
12639
12639
|
Do,
|
|
12640
12640
|
ao,
|
|
12641
12641
|
ac,
|
|
@@ -12654,7 +12654,7 @@ let Pr = class extends $c {
|
|
|
12654
12654
|
mt,
|
|
12655
12655
|
St,
|
|
12656
12656
|
md,
|
|
12657
|
-
|
|
12657
|
+
Ia,
|
|
12658
12658
|
Tg,
|
|
12659
12659
|
Je,
|
|
12660
12660
|
lc,
|
|
@@ -12665,7 +12665,7 @@ let Pr = class extends $c {
|
|
|
12665
12665
|
ms,
|
|
12666
12666
|
Ss,
|
|
12667
12667
|
Es,
|
|
12668
|
-
|
|
12668
|
+
Is,
|
|
12669
12669
|
co,
|
|
12670
12670
|
dc,
|
|
12671
12671
|
Ac,
|
|
@@ -12690,9 +12690,9 @@ let Pr = class extends $c {
|
|
|
12690
12690
|
Bf,
|
|
12691
12691
|
Mf,
|
|
12692
12692
|
_f,
|
|
12693
|
-
If,
|
|
12694
|
-
Cf,
|
|
12695
12693
|
vf,
|
|
12694
|
+
Cf,
|
|
12695
|
+
If,
|
|
12696
12696
|
uh
|
|
12697
12697
|
].forEach((n) => {
|
|
12698
12698
|
this._injector.get(xo).registerShortcut(n);
|
|
@@ -12712,8 +12712,8 @@ let Pr = class extends $c {
|
|
|
12712
12712
|
[Ye, { useClass: fr }],
|
|
12713
12713
|
[Lt, { useClass: Er }],
|
|
12714
12714
|
[Bn],
|
|
12715
|
-
[Io],
|
|
12716
12715
|
[vo],
|
|
12716
|
+
[Io],
|
|
12717
12717
|
[_t],
|
|
12718
12718
|
[at]
|
|
12719
12719
|
], this._config.override).forEach((t) => n.add(t));
|
|
@@ -12767,7 +12767,7 @@ let Pr = class extends $c {
|
|
|
12767
12767
|
};
|
|
12768
12768
|
Lf(Pr, "pluginName", ad);
|
|
12769
12769
|
Pr = Nf([
|
|
12770
|
-
Zc(
|
|
12770
|
+
Zc(Il),
|
|
12771
12771
|
gn(1, z(Pn)),
|
|
12772
12772
|
gn(2, fe),
|
|
12773
12773
|
gn(3, T),
|
|
@@ -12783,7 +12783,7 @@ export {
|
|
|
12783
12783
|
Lo as AlignRightCommand,
|
|
12784
12784
|
ds as BreakLineCommand,
|
|
12785
12785
|
xn as BulletListCommand,
|
|
12786
|
-
|
|
12786
|
+
vr as ChangeListNestingLevelCommand,
|
|
12787
12787
|
$n as ChangeListNestingLevelType,
|
|
12788
12788
|
Do as ChangeListTypeCommand,
|
|
12789
12789
|
ao as CheckListCommand,
|
|
@@ -12807,7 +12807,7 @@ export {
|
|
|
12807
12807
|
ho as DocBackScrollRenderController,
|
|
12808
12808
|
Bn as DocCanvasPopManagerService,
|
|
12809
12809
|
io as DocCopyCommand,
|
|
12810
|
-
|
|
12810
|
+
vs as DocCreateTableOperation,
|
|
12811
12811
|
as as DocCutCommand,
|
|
12812
12812
|
wt as DocEventManagerService,
|
|
12813
12813
|
ko as DocIMEInputManagerService,
|
|
@@ -12816,7 +12816,7 @@ export {
|
|
|
12816
12816
|
Rr as DocRenderController,
|
|
12817
12817
|
Cc as DocSelectAllCommand,
|
|
12818
12818
|
Ce as DocSelectionRenderService,
|
|
12819
|
-
|
|
12819
|
+
Io as DocStateChangeManagerService,
|
|
12820
12820
|
bs as DocTableDeleteColumnsCommand,
|
|
12821
12821
|
Rs as DocTableDeleteRowsCommand,
|
|
12822
12822
|
kn as DocTableDeleteTableCommand,
|
|
@@ -12828,8 +12828,8 @@ export {
|
|
|
12828
12828
|
Ec as DocTableInsertRowCommand,
|
|
12829
12829
|
bc as DocTableTabCommand,
|
|
12830
12830
|
uo as DocUIController,
|
|
12831
|
-
|
|
12832
|
-
|
|
12831
|
+
vo as DocsRenderService,
|
|
12832
|
+
Ig as DocsUIMenuSchema,
|
|
12833
12833
|
Pd as Editor,
|
|
12834
12834
|
DA as EditorInsertTextCommandId,
|
|
12835
12835
|
fr as EditorService,
|
|
@@ -12855,7 +12855,7 @@ export {
|
|
|
12855
12855
|
cc as QuickListCommand,
|
|
12856
12856
|
ba as RectRange,
|
|
12857
12857
|
gd as ReplaceContentCommand,
|
|
12858
|
-
|
|
12858
|
+
Ia as ReplaceSelectionCommand,
|
|
12859
12859
|
Sa as ReplaceSnapshotCommand,
|
|
12860
12860
|
md as ReplaceTextRunsCommand,
|
|
12861
12861
|
Fn as ResetInlineFormatTextBackgroundColorCommand,
|
|
@@ -12868,7 +12868,7 @@ export {
|
|
|
12868
12868
|
ct as SetInlineFormatFontSizeCommand,
|
|
12869
12869
|
Ut as SetInlineFormatItalicCommand,
|
|
12870
12870
|
Ht as SetInlineFormatStrikethroughCommand,
|
|
12871
|
-
|
|
12871
|
+
vt as SetInlineFormatSubscriptCommand,
|
|
12872
12872
|
kt as SetInlineFormatSuperscriptCommand,
|
|
12873
12873
|
Dt as SetInlineFormatTextBackgroundColorCommand,
|
|
12874
12874
|
Pt as SetInlineFormatTextColorCommand,
|
|
@@ -12906,7 +12906,7 @@ export {
|
|
|
12906
12906
|
ue as getRichTextEditPath,
|
|
12907
12907
|
$r as getTableColumn,
|
|
12908
12908
|
Zf as hasParagraphInTable,
|
|
12909
|
-
|
|
12909
|
+
va as isInSameTableCell,
|
|
12910
12910
|
Ed as isValidRectRange,
|
|
12911
12911
|
ft as neoGetDocObject,
|
|
12912
12912
|
ep as transformToDocDrawingPosition,
|