@univerjs/docs-ui 0.2.3 → 0.2.4-alpha.0
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 +4 -4
- package/lib/es/index.js +1072 -1051
- package/lib/index.css +1 -1
- package/lib/types/controllers/app-ui-controller.d.ts +1 -2
- package/lib/types/controllers/doc-container-ui-controller.d.ts +1 -2
- package/lib/types/controllers/doc-ui.controller.d.ts +3 -8
- package/lib/types/controllers/menu/menu.d.ts +1 -1
- package/lib/types/docs-ui-plugin.d.ts +1 -2
- package/lib/types/services/clipboard/clipboard.service.d.ts +8 -7
- package/lib/types/services/doc-popup-manager.service.d.ts +1 -2
- package/lib/umd/index.js +4 -4
- package/package.json +14 -16
- package/lib/types/views/doc-background/DocBackground.d.ts +0 -6
package/lib/es/index.js
CHANGED
|
@@ -1,33 +1,31 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var C = (t, e, n) =>
|
|
4
|
-
import { FOCUSING_DOC as
|
|
5
|
-
import { IClipboardInterfaceService as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
function W(t) {
|
|
15
|
-
return t.getContextValue(Ne) && t.getContextValue(lt) && !t.getContextValue(Gt);
|
|
1
|
+
var Sn = Object.defineProperty;
|
|
2
|
+
var vn = (t, e, n) => e in t ? Sn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var C = (t, e, n) => vn(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { FOCUSING_DOC as Ue, FOCUSING_UNIVER_EDITOR as dt, FOCUSING_COMMON_DRAWINGS as Xt, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE as Rn, Tools as j, LRUMap as On, BaselineOffset as ae, BooleanNumber as S, ColorKit as ft, DataStreamTreeTokenType as Pe, CustomRangeType as Kt, skipParseTagNames as Cn, createIdentifier as En, Inject as E, IUniverInstanceService as w, ILogService as Zt, ICommandService as O, Disposable as Q, SliceBodyType as mt, normalizeBody as Tn, UniverInstanceType as v, toDisposable as Jt, RxDisposable as Se, Direction as K, EDITOR_ACTIVATED as qt, LocaleService as le, Injector as Le, Optional as In, useDependency as z, CommandType as de, DocumentFlavor as bn, JSONX as Qe, ThemeService as Qt, HorizontalAlign as we, OnLifecycle as Be, LifecycleStages as $e, IContextService as Mn, checkForSubstrings as yn, IConfigService as xn, isInternalEditorID as Pn, DisposableCollection as St, Plugin as Dn, ObjectRelativeFromH as An, ObjectRelativeFromV as Nn } from "@univerjs/core";
|
|
5
|
+
import { IClipboardInterfaceService as ut, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as Fn, HTML_CLIPBOARD_MIME_TYPE as Un, IEditorService as ee, KeyCode as H, MetaKeys as ve, ILayoutService as en, ISidebarService as Ln, ComponentManager as tn, MenuGroup as x, MenuItemType as y, MenuPosition as P, getMenuHiddenObservable as D, FONT_FAMILY_LIST as vt, FONT_SIZE_LIST as wn, getHeaderFooterMenuHiddenObservable as Bn, FontFamily as $n, FontFamilyItem as Hn, FontSize as Vn, IMenuService as jn, CopyCommand as Wn, CutCommand as kn, PasteCommand as Gn, SetEditorResizeOperation as zn, ICanvasPopupService as Yn, IShortcutService as Xn } from "@univerjs/ui";
|
|
6
|
+
import { TextSelectionManagerService as te, DocCustomRangeService as Kn, CutContentCommand as nn, InnerPasteCommand as on, getDeleteSelection as Zn, DocSkeletonManagerService as L, VIEWPORT_KEY as q, getDocObject as Jn, MoveCursorOperation as He, MoveSelectionOperation as Ve, SelectAllOperation as qn, neoGetDocObject as J, RichTextEditingMutation as ht, SetInlineFormatBoldCommand as Qn, SetTextSelectionsOperation as V, SetInlineFormatCommand as ue, SetInlineFormatItalicCommand as eo, SetInlineFormatUnderlineCommand as to, SetInlineFormatStrikethroughCommand as no, SetInlineFormatSubscriptCommand as oo, SetInlineFormatSuperscriptCommand as ro, SetInlineFormatFontFamilyCommand as Rt, SetInlineFormatFontSizeCommand as Ot, SetInlineFormatTextColorCommand as Ct, AlignLeftCommand as io, AlignOperationCommand as je, AlignCenterCommand as so, AlignRightCommand as ao, AlignJustifyCommand as co, OrderListCommand as lo, BulletListCommand as uo, ResetInlineFormatTextBackgroundColorCommand as ho, SetInlineFormatTextBackgroundColorCommand as et, BreakLineCommand as go, DeleteLeftCommand as po, DeleteRightCommand as _o, CoverContentCommand as fo, DOCS_COMPONENT_MAIN_LAYER_INDEX as Ye, DOCS_COMPONENT_HEADER_LAYER_INDEX as mo, DOCS_VIEW_KEY as oe, DOCS_COMPONENT_DEFAULT_Z_INDEX as Et, DOCS_COMPONENT_BACKGROUND_LAYER_INDEX as So, SetDocZoomRatioCommand as vo, SetDocZoomRatioOperation as De, DocInterceptorService as Ro } from "@univerjs/docs";
|
|
7
|
+
import { pixelToPt as Oo, ptToPixel as Tt, NodePositionConvertToCursor as rn, getAnchorBounding as Co, IRenderManagerService as W, ITextSelectionRenderManager as ne, Shape as Eo, DocumentEditArea as F, PageLayoutType as Ae, Vector2 as sn, Rect as Xe, Path as It, ScrollBar as tt, Viewport as To, Layer as bt, Documents as Io, DocBackground as bo, CURSOR_TYPE as Mt, getLineBounding as Mo } from "@univerjs/engine-render";
|
|
8
|
+
import { takeUntil as se, Observable as B, combineLatest as yo, fromEvent as yt, BehaviorSubject as xt, map as xo } from "rxjs";
|
|
9
|
+
import Po, { useState as an, useEffect as cn } from "react";
|
|
10
|
+
import { Checkbox as Pt, InputNumber as Dt, Button as Do, ColorPicker as Ao } from "@univerjs/design";
|
|
11
|
+
import No from "clsx";
|
|
12
|
+
function k(t) {
|
|
13
|
+
return t.getContextValue(Ue) && t.getContextValue(dt) && !t.getContextValue(Xt);
|
|
16
14
|
}
|
|
17
|
-
function
|
|
18
|
-
return t.getContextValue(
|
|
15
|
+
function Fo(t) {
|
|
16
|
+
return t.getContextValue(Ue) && t.getContextValue(dt) && !t.getContextValue(Rn) && !t.getContextValue(Xt);
|
|
19
17
|
}
|
|
20
|
-
const
|
|
21
|
-
function
|
|
22
|
-
return
|
|
18
|
+
const Uo = 10, Lo = 6;
|
|
19
|
+
function wo() {
|
|
20
|
+
return j.generateRandomId(Lo);
|
|
23
21
|
}
|
|
24
|
-
function
|
|
22
|
+
function Bo(t) {
|
|
25
23
|
const e = t.match(/data-copy-id="([^\s]+)"/);
|
|
26
24
|
return e && e[1] ? e[1] : null;
|
|
27
25
|
}
|
|
28
|
-
class
|
|
26
|
+
class $o {
|
|
29
27
|
constructor() {
|
|
30
|
-
C(this, "_cache", new
|
|
28
|
+
C(this, "_cache", new On(Uo));
|
|
31
29
|
}
|
|
32
30
|
set(e, n) {
|
|
33
31
|
this._cache.set(e, n);
|
|
@@ -39,8 +37,8 @@ class wo {
|
|
|
39
37
|
this._cache.clear();
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
|
-
const
|
|
43
|
-
function
|
|
40
|
+
const At = new $o();
|
|
41
|
+
function gt(t) {
|
|
44
42
|
const e = t.style, n = {}, o = t.tagName.toLowerCase();
|
|
45
43
|
switch (o) {
|
|
46
44
|
case "b":
|
|
@@ -71,16 +69,16 @@ function ht(t) {
|
|
|
71
69
|
break;
|
|
72
70
|
}
|
|
73
71
|
}
|
|
74
|
-
for (let
|
|
75
|
-
const
|
|
76
|
-
switch (
|
|
72
|
+
for (let r = 0; r < e.length; r++) {
|
|
73
|
+
const i = e[r], s = e.getPropertyValue(i);
|
|
74
|
+
switch (i) {
|
|
77
75
|
case "font-family": {
|
|
78
76
|
n.ff = s;
|
|
79
77
|
break;
|
|
80
78
|
}
|
|
81
79
|
case "font-size": {
|
|
82
80
|
const a = Number.parseInt(s);
|
|
83
|
-
Number.isNaN(a) || (s.endsWith("pt") ? n.fs = a : s.endsWith("px") && (n.fs =
|
|
81
|
+
Number.isNaN(a) || (s.endsWith("pt") ? n.fs = a : s.endsWith("px") && (n.fs = Oo(a)));
|
|
84
82
|
break;
|
|
85
83
|
}
|
|
86
84
|
case "font-style": {
|
|
@@ -119,11 +117,11 @@ function ht(t) {
|
|
|
119
117
|
}
|
|
120
118
|
return n;
|
|
121
119
|
}
|
|
122
|
-
function
|
|
120
|
+
function Ho(t) {
|
|
123
121
|
const e = new DOMParser(), n = `<x-univer id="univer-root">${t}</x-univer>`;
|
|
124
122
|
return e.parseFromString(n, "text/html").querySelector("#univer-root");
|
|
125
123
|
}
|
|
126
|
-
function
|
|
124
|
+
function Nt(t, e) {
|
|
127
125
|
const n = t.tagName.toLowerCase();
|
|
128
126
|
return typeof e == "string" ? n === e : Array.isArray(e) ? e.some((o) => o === n) : e(t);
|
|
129
127
|
}
|
|
@@ -139,44 +137,58 @@ const Fe = class Fe {
|
|
|
139
137
|
this._pluginList.push(e);
|
|
140
138
|
}
|
|
141
139
|
convert(e) {
|
|
142
|
-
const n = Fe._pluginList.find((
|
|
140
|
+
const n = Fe._pluginList.find((i) => i.checkPasteType(e)), o = Ho(e), r = {
|
|
143
141
|
dataStream: "",
|
|
144
142
|
textRuns: []
|
|
145
143
|
};
|
|
146
|
-
return n && (this._styleRules = [...n.stylesRules], this._afterProcessRules = [...n.afterProcessRules]), this._styleCache.clear(), this._process(null, o == null ? void 0 : o.childNodes,
|
|
144
|
+
return n && (this._styleRules = [...n.stylesRules], this._afterProcessRules = [...n.afterProcessRules]), this._styleCache.clear(), this._process(null, o == null ? void 0 : o.childNodes, r), this._styleCache.clear(), this._styleRules = [], this._afterProcessRules = [], r;
|
|
147
145
|
}
|
|
148
146
|
_process(e, n, o) {
|
|
149
|
-
var i,
|
|
150
|
-
for (const
|
|
151
|
-
if (
|
|
152
|
-
if (((
|
|
147
|
+
var r, i, s;
|
|
148
|
+
for (const a of n)
|
|
149
|
+
if (a.nodeType === Node.TEXT_NODE) {
|
|
150
|
+
if (((r = a.nodeValue) == null ? void 0 : r.trim()) === "")
|
|
153
151
|
continue;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
152
|
+
let c = (i = a.nodeValue) == null ? void 0 : i.replace(/[\r\n]/g, ""), d;
|
|
153
|
+
if (e && e.nodeType === Node.ELEMENT_NODE && e.tagName.toUpperCase() === "A") {
|
|
154
|
+
const g = j.generateRandomId();
|
|
155
|
+
c = `${Pe.CUSTOM_RANGE_START}${c}${Pe.CUSTOM_RANGE_END}`, o.customRanges = [
|
|
156
|
+
...(s = o.customRanges) != null ? s : [],
|
|
157
|
+
{
|
|
158
|
+
startIndex: o.dataStream.length,
|
|
159
|
+
endIndex: o.dataStream.length + c.length - 1,
|
|
160
|
+
rangeId: g,
|
|
161
|
+
rangeType: Kt.HYPERLINK
|
|
162
|
+
}
|
|
163
|
+
], o.payloads = {
|
|
164
|
+
...o.payloads,
|
|
165
|
+
[g]: e.href
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
e && this._styleCache.has(e) && (d = this._styleCache.get(e)), o.dataStream += c, d && Object.getOwnPropertyNames(d).length && o.textRuns.push({
|
|
169
|
+
st: o.dataStream.length - c.length,
|
|
158
170
|
ed: o.dataStream.length,
|
|
159
|
-
ts:
|
|
171
|
+
ts: d
|
|
160
172
|
});
|
|
161
173
|
} else {
|
|
162
|
-
if (
|
|
174
|
+
if (Cn.includes(a.nodeName.toLowerCase()))
|
|
163
175
|
continue;
|
|
164
|
-
if (
|
|
165
|
-
const
|
|
166
|
-
this._styleCache.set(
|
|
167
|
-
const { childNodes:
|
|
168
|
-
this._process(
|
|
169
|
-
const
|
|
170
|
-
({ filter:
|
|
176
|
+
if (a.nodeType === Node.ELEMENT_NODE) {
|
|
177
|
+
const c = e ? this._styleCache.get(e) : {}, d = this._styleRules.find(({ filter: l }) => Nt(a, l)), g = d ? d.getStyle(a) : gt(a);
|
|
178
|
+
this._styleCache.set(a, { ...c, ...g });
|
|
179
|
+
const { childNodes: h } = a;
|
|
180
|
+
this._process(a, h, o);
|
|
181
|
+
const p = this._afterProcessRules.find(
|
|
182
|
+
({ filter: l }) => Nt(a, l)
|
|
171
183
|
);
|
|
172
|
-
|
|
184
|
+
p && p.handler(o, a);
|
|
173
185
|
}
|
|
174
186
|
}
|
|
175
187
|
}
|
|
176
188
|
};
|
|
177
189
|
C(Fe, "_pluginList", []);
|
|
178
190
|
let ce = Fe;
|
|
179
|
-
const
|
|
191
|
+
const Vo = {
|
|
180
192
|
name: "univer-doc-paste-plugin-lark",
|
|
181
193
|
checkPasteType(t) {
|
|
182
194
|
return /lark-record-clipboard/i.test(t);
|
|
@@ -186,7 +198,7 @@ const $o = {
|
|
|
186
198
|
{
|
|
187
199
|
filter: ["s"],
|
|
188
200
|
getStyle(t) {
|
|
189
|
-
const e =
|
|
201
|
+
const e = gt(t);
|
|
190
202
|
return {
|
|
191
203
|
st: {
|
|
192
204
|
s: S.TRUE
|
|
@@ -208,24 +220,24 @@ const $o = {
|
|
|
208
220
|
}
|
|
209
221
|
}
|
|
210
222
|
]
|
|
211
|
-
},
|
|
212
|
-
function
|
|
223
|
+
}, jo = Vo;
|
|
224
|
+
function ln(t) {
|
|
213
225
|
const e = t.style, n = {};
|
|
214
226
|
for (let o = 0; o < e.length; o++) {
|
|
215
|
-
const
|
|
216
|
-
switch (
|
|
227
|
+
const r = e[o], i = e.getPropertyValue(r);
|
|
228
|
+
switch (r) {
|
|
217
229
|
case "margin-top": {
|
|
218
|
-
const s = Number.parseInt(
|
|
219
|
-
n.spaceAbove = /pt/.test(
|
|
230
|
+
const s = Number.parseInt(i);
|
|
231
|
+
n.spaceAbove = { v: /pt/.test(i) ? Tt(s) : s };
|
|
220
232
|
break;
|
|
221
233
|
}
|
|
222
234
|
case "margin-bottom": {
|
|
223
|
-
const s = Number.parseInt(
|
|
224
|
-
n.spaceBelow = /pt/.test(
|
|
235
|
+
const s = Number.parseInt(i);
|
|
236
|
+
n.spaceBelow = { v: /pt/.test(i) ? Tt(s) : s };
|
|
225
237
|
break;
|
|
226
238
|
}
|
|
227
239
|
case "line-height": {
|
|
228
|
-
const s = Number.parseFloat(
|
|
240
|
+
const s = Number.parseFloat(i);
|
|
229
241
|
n.lineSpacing = s;
|
|
230
242
|
break;
|
|
231
243
|
}
|
|
@@ -233,7 +245,7 @@ function sn(t) {
|
|
|
233
245
|
}
|
|
234
246
|
return Object.getOwnPropertyNames(n).length ? n : null;
|
|
235
247
|
}
|
|
236
|
-
const
|
|
248
|
+
const Wo = {
|
|
237
249
|
name: "univer-doc-paste-plugin-word",
|
|
238
250
|
checkPasteType(t) {
|
|
239
251
|
return /word|mso/i.test(t);
|
|
@@ -242,7 +254,7 @@ const Vo = {
|
|
|
242
254
|
{
|
|
243
255
|
filter: ["b"],
|
|
244
256
|
getStyle(t) {
|
|
245
|
-
const e =
|
|
257
|
+
const e = gt(t);
|
|
246
258
|
return { bl: S.TRUE, ...e };
|
|
247
259
|
}
|
|
248
260
|
}
|
|
@@ -256,12 +268,12 @@ const Vo = {
|
|
|
256
268
|
t.paragraphs == null && (t.paragraphs = []);
|
|
257
269
|
const n = {
|
|
258
270
|
startIndex: t.dataStream.length
|
|
259
|
-
}, o =
|
|
271
|
+
}, o = ln(e);
|
|
260
272
|
o && (n.paragraphStyle = o), t.paragraphs.push(n), t.dataStream += "\r";
|
|
261
273
|
}
|
|
262
274
|
}
|
|
263
275
|
]
|
|
264
|
-
},
|
|
276
|
+
}, ko = Wo, Go = {
|
|
265
277
|
name: "univer-doc-paste-plugin-univer",
|
|
266
278
|
checkPasteType(t) {
|
|
267
279
|
return /UniverNormal/i.test(t);
|
|
@@ -276,95 +288,86 @@ const Vo = {
|
|
|
276
288
|
t.paragraphs == null && (t.paragraphs = []);
|
|
277
289
|
const n = {
|
|
278
290
|
startIndex: t.dataStream.length
|
|
279
|
-
}, o =
|
|
291
|
+
}, o = ln(e);
|
|
280
292
|
o && (n.paragraphStyle = o), t.paragraphs.push(n), t.dataStream += "\r";
|
|
281
293
|
}
|
|
282
294
|
}
|
|
283
295
|
]
|
|
284
|
-
},
|
|
285
|
-
function
|
|
286
|
-
const { st: n, ed: o, ts:
|
|
296
|
+
}, zo = Go;
|
|
297
|
+
function Ft(t, e) {
|
|
298
|
+
const { st: n, ed: o, ts: r = {} } = e, { ff: i, fs: s, it: a, bl: c, ul: d, st: g, ol: h, bg: p, cl: l, va: _ } = r;
|
|
287
299
|
let u = t.slice(n, o);
|
|
288
|
-
const
|
|
289
|
-
return a === S.TRUE && (u = `<i>${u}</i>`),
|
|
300
|
+
const f = [];
|
|
301
|
+
return a === S.TRUE && (u = `<i>${u}</i>`), _ === ae.SUPERSCRIPT ? u = `<sup>${u}</sup>` : _ === ae.SUBSCRIPT && (u = `<sub>${u}</sub>`), (d == null ? void 0 : d.s) === S.TRUE && (u = `<u>${u}</u>`), (g == null ? void 0 : g.s) === S.TRUE && (u = `<s>${u}</s>`), c === S.TRUE && (u = `<strong>${u}</strong>`), i && f.push(`font-family: ${i}`), l && f.push(`color: ${l.rgb}`), s && f.push(`font-size: ${s}pt`), h && f.push("text-decoration: overline"), p && f.push(`background: ${p.rgb}`), f.length ? `<span style="${f.join("; ")};">${u}</span>` : u;
|
|
290
302
|
}
|
|
291
|
-
function
|
|
292
|
-
const { dataStream: o, textRuns:
|
|
293
|
-
let
|
|
303
|
+
function Ke(t, e, n) {
|
|
304
|
+
const { dataStream: o, textRuns: r = [] } = t;
|
|
305
|
+
let i = e;
|
|
294
306
|
const s = [];
|
|
295
|
-
for (const a of
|
|
307
|
+
for (const a of r) {
|
|
296
308
|
const { st: c, ed: d } = a;
|
|
297
|
-
|
|
309
|
+
j.hasIntersectionBetweenTwoRanges(e, n, c, d) && (c > i ? (s.push(o.slice(i, c)), s.push(Ft(o, {
|
|
298
310
|
...a,
|
|
299
311
|
ed: Math.min(d, n)
|
|
300
|
-
}))) : s.push(
|
|
312
|
+
}))) : s.push(Ft(o, {
|
|
301
313
|
...a,
|
|
302
|
-
st:
|
|
314
|
+
st: i,
|
|
303
315
|
ed: Math.min(d, n)
|
|
304
|
-
}))),
|
|
316
|
+
}))), i = Math.max(e, Math.min(d, n));
|
|
305
317
|
}
|
|
306
|
-
return
|
|
318
|
+
return i !== n && s.push(o.slice(i, n)), s.join("");
|
|
307
319
|
}
|
|
308
|
-
function
|
|
320
|
+
function Ut(t, e = !0) {
|
|
309
321
|
var n;
|
|
310
322
|
if (e && ((n = t.paragraphs) != null && n.length)) {
|
|
311
|
-
const { dataStream: o, paragraphs:
|
|
312
|
-
let
|
|
313
|
-
for (const a of
|
|
314
|
-
const { startIndex: c, paragraphStyle: d = {} } = a, { spaceAbove:
|
|
315
|
-
|
|
323
|
+
const { dataStream: o, paragraphs: r = [] } = t;
|
|
324
|
+
let i = "", s = -1;
|
|
325
|
+
for (const a of r) {
|
|
326
|
+
const { startIndex: c, paragraphStyle: d = {} } = a, { spaceAbove: g, spaceBelow: h, lineSpacing: p } = d, l = [];
|
|
327
|
+
g != null && (typeof g == "number" ? l.push(`margin-top: ${g}px`) : l.push(`margin-top: ${g.v}px`)), h != null && (typeof h == "number" ? l.push(`margin-bottom: ${h}px`) : l.push(`margin-bottom: ${h.v}px`)), p != null && l.push(`line-height: ${p}`), c > s + 1 ? i += `<p class="UniverNormal" ${l.length ? `style="${l.join("; ")};"` : ""}>${Ke(t, s + 1, c)}</p>` : i += `<p class="UniverNormal" ${l.length ? `style="${l.join("; ")};"` : ""}></p>`, s = c;
|
|
316
328
|
}
|
|
317
|
-
return s !== o.length && (
|
|
329
|
+
return s !== o.length && (i += Ke(t, s, o.length)), i;
|
|
318
330
|
} else
|
|
319
|
-
return
|
|
331
|
+
return Ke(t, 0, t.dataStream.length);
|
|
320
332
|
}
|
|
321
|
-
class
|
|
333
|
+
class Yo {
|
|
322
334
|
convert(e) {
|
|
323
335
|
if (e.length === 0)
|
|
324
336
|
throw new Error("The bodyList length at least to be 1");
|
|
325
337
|
if (e.length === 1)
|
|
326
|
-
return
|
|
338
|
+
return Ut(e[0]);
|
|
327
339
|
let n = "";
|
|
328
340
|
for (const o of e)
|
|
329
|
-
n += '<p className="UniverNormal">', n +=
|
|
341
|
+
n += '<p className="UniverNormal">', n += Ut(o, !1), n += "</p>";
|
|
330
342
|
return n;
|
|
331
343
|
}
|
|
332
344
|
}
|
|
333
|
-
var
|
|
334
|
-
for (var
|
|
335
|
-
(s = t[
|
|
336
|
-
return o &&
|
|
337
|
-
},
|
|
338
|
-
ce.use(jo);
|
|
339
|
-
ce.use(Ho);
|
|
345
|
+
var Xo = Object.defineProperty, Ko = Object.getOwnPropertyDescriptor, Zo = (t, e, n, o) => {
|
|
346
|
+
for (var r = o > 1 ? void 0 : o ? Ko(e, n) : e, i = t.length - 1, s; i >= 0; i--)
|
|
347
|
+
(s = t[i]) && (r = (o ? s(e, n, r) : s(r)) || r);
|
|
348
|
+
return o && r && Xo(e, n, r), r;
|
|
349
|
+
}, re = (t, e) => (n, o) => e(n, o, t);
|
|
340
350
|
ce.use(ko);
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
dataStream: e,
|
|
347
|
-
paragraphs: n
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
|
-
const Oe = zn("doc.clipboard-service");
|
|
351
|
-
let tt = class extends te {
|
|
352
|
-
constructor(e, n, o, i, r) {
|
|
351
|
+
ce.use(jo);
|
|
352
|
+
ce.use(zo);
|
|
353
|
+
const Re = En("doc.clipboard-service");
|
|
354
|
+
let nt = class extends Q {
|
|
355
|
+
constructor(e, n, o, r, i, s) {
|
|
353
356
|
super();
|
|
354
357
|
C(this, "_clipboardHooks", []);
|
|
355
358
|
C(this, "_htmlToUDM", new ce());
|
|
356
|
-
C(this, "_umdToHtml", new
|
|
357
|
-
this._univerInstanceService = e, this._logService = n, this._commandService = o, this._clipboardInterfaceService =
|
|
359
|
+
C(this, "_umdToHtml", new Yo());
|
|
360
|
+
this._univerInstanceService = e, this._logService = n, this._commandService = o, this._clipboardInterfaceService = r, this._textSelectionManagerService = i, this._docCustomRangeService = s;
|
|
358
361
|
}
|
|
359
|
-
async copy() {
|
|
360
|
-
const
|
|
361
|
-
if (
|
|
362
|
+
async copy(e = mt.copy) {
|
|
363
|
+
const n = this._getDocumentBodyInRanges(e);
|
|
364
|
+
if (n.length === 0)
|
|
362
365
|
return !1;
|
|
363
366
|
try {
|
|
364
|
-
const
|
|
365
|
-
this._setClipboardData(
|
|
366
|
-
} catch (
|
|
367
|
-
return this._logService.error("[DocClipboardService] copy failed",
|
|
367
|
+
const o = this._textSelectionManagerService.getActiveRange(), r = !!(o != null && o.segmentId);
|
|
368
|
+
this._setClipboardData(n, !r);
|
|
369
|
+
} catch (o) {
|
|
370
|
+
return this._logService.error("[DocClipboardService] copy failed", o), !1;
|
|
368
371
|
}
|
|
369
372
|
return !0;
|
|
370
373
|
}
|
|
@@ -380,20 +383,20 @@ let tt = class extends te {
|
|
|
380
383
|
return this._paste(o);
|
|
381
384
|
}
|
|
382
385
|
async _cut() {
|
|
383
|
-
var
|
|
386
|
+
var i;
|
|
384
387
|
const {
|
|
385
388
|
segmentId: e,
|
|
386
389
|
endOffset: n,
|
|
387
390
|
style: o
|
|
388
|
-
} = (
|
|
389
|
-
if (e == null && this._logService.error("[DocClipboardController] segmentId is not existed"), n == null ||
|
|
391
|
+
} = (i = this._textSelectionManagerService.getActiveRange()) != null ? i : {}, r = this._textSelectionManagerService.getCurrentSelections();
|
|
392
|
+
if (e == null && this._logService.error("[DocClipboardController] segmentId is not existed"), n == null || r == null)
|
|
390
393
|
return !1;
|
|
391
|
-
this.copy();
|
|
394
|
+
this.copy(mt.cut);
|
|
392
395
|
try {
|
|
393
396
|
let s = n;
|
|
394
|
-
for (const c of
|
|
395
|
-
const { startOffset: d, endOffset:
|
|
396
|
-
d == null ||
|
|
397
|
+
for (const c of r) {
|
|
398
|
+
const { startOffset: d, endOffset: g } = c;
|
|
399
|
+
d == null || g == null || g <= n && (s -= g - d);
|
|
397
400
|
}
|
|
398
401
|
const a = [
|
|
399
402
|
{
|
|
@@ -402,71 +405,75 @@ let tt = class extends te {
|
|
|
402
405
|
style: o
|
|
403
406
|
}
|
|
404
407
|
];
|
|
405
|
-
return this._commandService.executeCommand(
|
|
408
|
+
return this._commandService.executeCommand(nn.id, { segmentId: e, textRanges: a });
|
|
406
409
|
} catch {
|
|
407
410
|
return this._logService.error("[DocClipboardController] cut content failed"), !1;
|
|
408
411
|
}
|
|
409
412
|
}
|
|
410
413
|
async _paste(e) {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
414
|
+
var d, g;
|
|
415
|
+
let n = Tn(e);
|
|
416
|
+
const o = (d = this._univerInstanceService.getCurrentUnitForType(v.UNIVER_DOC)) == null ? void 0 : d.getUnitId();
|
|
417
|
+
if (!o)
|
|
418
|
+
return !1;
|
|
419
|
+
this._clipboardHooks.forEach((h) => {
|
|
420
|
+
h.onBeforePaste && (n = h.onBeforePaste(n));
|
|
421
|
+
}), n.customRanges = (g = n.customRanges) == null ? void 0 : g.map((h) => this._docCustomRangeService.copyCustomRange(o, h));
|
|
422
|
+
const r = this._textSelectionManagerService.getActiveRange(), { segmentId: i, endOffset: s, style: a } = r || {}, c = this._textSelectionManagerService.getCurrentSelections();
|
|
423
|
+
if (i == null && this._logService.error("[DocClipboardController] segmentId does not exist!"), s == null || c == null)
|
|
417
424
|
return !1;
|
|
418
425
|
try {
|
|
419
|
-
let
|
|
420
|
-
for (const
|
|
421
|
-
const { startOffset:
|
|
422
|
-
|
|
426
|
+
let h = s;
|
|
427
|
+
for (const l of c) {
|
|
428
|
+
const { startOffset: _, endOffset: u } = l;
|
|
429
|
+
_ == null || u == null || u <= s && (h += n.dataStream.length - (u - _));
|
|
423
430
|
}
|
|
424
|
-
const
|
|
431
|
+
const p = [
|
|
425
432
|
{
|
|
426
|
-
startOffset:
|
|
427
|
-
endOffset:
|
|
428
|
-
style:
|
|
433
|
+
startOffset: h,
|
|
434
|
+
endOffset: h,
|
|
435
|
+
style: a
|
|
429
436
|
}
|
|
430
437
|
];
|
|
431
|
-
return this._commandService.executeCommand(
|
|
438
|
+
return this._commandService.executeCommand(on.id, { body: n, segmentId: i, textRanges: p });
|
|
432
439
|
} catch {
|
|
433
440
|
return this._logService.error("[DocClipboardController]", "clipboard is empty."), !1;
|
|
434
441
|
}
|
|
435
442
|
}
|
|
436
443
|
async _setClipboardData(e, n = !0) {
|
|
437
|
-
const o =
|
|
444
|
+
const o = wo(), r = e.length > 1 ? e.map((s) => s.dataStream).join(`
|
|
438
445
|
`) : e[0].dataStream;
|
|
439
|
-
let
|
|
440
|
-
return e.length === 1 && n && (
|
|
446
|
+
let i = this._umdToHtml.convert(e);
|
|
447
|
+
return e.length === 1 && n && (i = i.replace(/(<[a-z]+)/, (s, a) => `${a} data-copy-id="${o}"`), At.set(o, e[0])), this._clipboardInterfaceService.write(r, i);
|
|
441
448
|
}
|
|
442
449
|
addClipboardHook(e) {
|
|
443
|
-
return this._clipboardHooks.push(e),
|
|
450
|
+
return this._clipboardHooks.push(e), Jt(() => {
|
|
444
451
|
const n = this._clipboardHooks.indexOf(e);
|
|
445
452
|
n > -1 && this._clipboardHooks.splice(n, 1);
|
|
446
453
|
});
|
|
447
454
|
}
|
|
448
|
-
_getDocumentBodyInRanges() {
|
|
449
|
-
const
|
|
450
|
-
if (
|
|
455
|
+
_getDocumentBodyInRanges(e) {
|
|
456
|
+
const n = this._textSelectionManagerService.getCurrentSelections(), o = this._textSelectionManagerService.getActiveRange(), r = this._univerInstanceService.getCurrentUniverDocInstance(), i = [], s = r == null ? void 0 : r.getBody();
|
|
457
|
+
if (n == null || r == null || s == null || o == null)
|
|
451
458
|
return i;
|
|
452
|
-
const { segmentId:
|
|
453
|
-
for (const
|
|
454
|
-
const { startOffset:
|
|
455
|
-
if (
|
|
459
|
+
const { segmentId: a } = o;
|
|
460
|
+
for (const c of n) {
|
|
461
|
+
const { startOffset: d, endOffset: g, collapsed: h } = c;
|
|
462
|
+
if (h || d == null || g == null)
|
|
456
463
|
continue;
|
|
457
|
-
const
|
|
458
|
-
if (
|
|
459
|
-
if (
|
|
460
|
-
const
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
}),
|
|
464
|
-
let
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
}),
|
|
464
|
+
const p = Zn({ startOffset: d, endOffset: g, collapsed: h }, s), l = r.getSelfOrHeaderFooterModel(a).sliceBody(p.startOffset, p.endOffset, e);
|
|
465
|
+
if (l != null) {
|
|
466
|
+
if (l.customRanges) {
|
|
467
|
+
const _ = [];
|
|
468
|
+
l.customRanges.forEach((m) => {
|
|
469
|
+
m.startIndex === m.endIndex && _.push(m);
|
|
470
|
+
}), l.customRanges = l.customRanges.filter((m) => _.indexOf(m) === -1);
|
|
471
|
+
let u = "", f = 0;
|
|
472
|
+
_.forEach((m) => {
|
|
473
|
+
u += l.dataStream.slice(f, m.endIndex), f = m.endIndex + 1;
|
|
474
|
+
}), u += l.dataStream.slice(f, l.dataStream.length), l.dataStream = u;
|
|
468
475
|
}
|
|
469
|
-
i.push(
|
|
476
|
+
i.push(l);
|
|
470
477
|
}
|
|
471
478
|
}
|
|
472
479
|
return i;
|
|
@@ -474,45 +481,72 @@ let tt = class extends te {
|
|
|
474
481
|
async _generateBodyFromClipboardItems(e) {
|
|
475
482
|
try {
|
|
476
483
|
let n = "", o = "";
|
|
477
|
-
for (const
|
|
478
|
-
for (const
|
|
479
|
-
|
|
484
|
+
for (const r of e)
|
|
485
|
+
for (const i of r.types)
|
|
486
|
+
i === Fn ? o = await r.getType(i).then((s) => s && s.text()) : i === Un && (n = await r.getType(i).then((s) => s && s.text()));
|
|
480
487
|
return this._generateBodyFromHtmlAndText(n, o);
|
|
481
488
|
} catch (n) {
|
|
482
489
|
return Promise.reject(n);
|
|
483
490
|
}
|
|
484
491
|
}
|
|
492
|
+
_generateBody(e) {
|
|
493
|
+
const n = e.replace(/\n/g, "\r");
|
|
494
|
+
if (!e.includes("\r") && j.isLegalUrl(e)) {
|
|
495
|
+
const r = j.generateRandomId(), i = this._univerInstanceService.getCurrentUnitForType(v.UNIVER_DOC), s = this._docCustomRangeService.copyCustomRange(
|
|
496
|
+
i.getUnitId(),
|
|
497
|
+
{
|
|
498
|
+
startIndex: 0,
|
|
499
|
+
endIndex: n.length - 1,
|
|
500
|
+
rangeId: r,
|
|
501
|
+
rangeType: Kt.HYPERLINK,
|
|
502
|
+
data: e
|
|
503
|
+
}
|
|
504
|
+
);
|
|
505
|
+
return {
|
|
506
|
+
dataStream: `${Pe.CUSTOM_RANGE_START}${n}${Pe.CUSTOM_RANGE_END}`,
|
|
507
|
+
customRanges: [s]
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
const o = [];
|
|
511
|
+
for (let r = 0; r < n.length; r++)
|
|
512
|
+
n[r] === "\r" && o.push({ startIndex: r });
|
|
513
|
+
return {
|
|
514
|
+
dataStream: n,
|
|
515
|
+
paragraphs: o
|
|
516
|
+
};
|
|
517
|
+
}
|
|
485
518
|
_generateBodyFromHtmlAndText(e, n) {
|
|
486
519
|
if (!e) {
|
|
487
520
|
if (n)
|
|
488
|
-
return
|
|
521
|
+
return this._generateBody(n);
|
|
489
522
|
throw new Error("[DocClipboardService] html and text cannot be both empty!");
|
|
490
523
|
}
|
|
491
|
-
const o =
|
|
524
|
+
const o = Bo(e);
|
|
492
525
|
if (o) {
|
|
493
|
-
const
|
|
494
|
-
if (
|
|
495
|
-
return
|
|
526
|
+
const r = At.get(o);
|
|
527
|
+
if (r)
|
|
528
|
+
return r;
|
|
496
529
|
}
|
|
497
530
|
return this._htmlToUDM.convert(e);
|
|
498
531
|
}
|
|
499
532
|
};
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
533
|
+
nt = Zo([
|
|
534
|
+
re(0, w),
|
|
535
|
+
re(1, Zt),
|
|
536
|
+
re(2, O),
|
|
537
|
+
re(3, ut),
|
|
538
|
+
re(4, E(te)),
|
|
539
|
+
re(5, E(Kn))
|
|
540
|
+
], nt);
|
|
541
|
+
var Jo = Object.defineProperty, qo = Object.getOwnPropertyDescriptor, Qo = (t, e, n, o) => {
|
|
542
|
+
for (var r = o > 1 ? void 0 : o ? qo(e, n) : e, i = t.length - 1, s; i >= 0; i--)
|
|
543
|
+
(s = t[i]) && (r = (o ? s(e, n, r) : s(r)) || r);
|
|
544
|
+
return o && r && Jo(e, n, r), r;
|
|
545
|
+
}, Oe = (t, e) => (n, o) => e(n, o, t);
|
|
546
|
+
const Lt = 1.5;
|
|
547
|
+
let ot = class extends Se {
|
|
548
|
+
constructor(t, e, n, o, r) {
|
|
549
|
+
super(), this._context = t, this._textSelectionManagerService = e, this._editorService = n, this._univerInstanceService = o, this._renderManagerService = r, this._init();
|
|
516
550
|
}
|
|
517
551
|
_init() {
|
|
518
552
|
this._textSelectionManagerService.textSelection$.pipe(se(this.dispose$)).subscribe((t) => {
|
|
@@ -524,31 +558,31 @@ let nt = class extends ve {
|
|
|
524
558
|
}
|
|
525
559
|
scrollToRange(t, e) {
|
|
526
560
|
var s;
|
|
527
|
-
const n = (s = this._renderManagerService.getRenderById(t)) == null ? void 0 : s.with(
|
|
561
|
+
const n = (s = this._renderManagerService.getRenderById(t)) == null ? void 0 : s.with(L), o = n == null ? void 0 : n.getSkeleton();
|
|
528
562
|
if (!o)
|
|
529
563
|
return;
|
|
530
|
-
const { startOffset:
|
|
531
|
-
this.scrollToNode(t,
|
|
564
|
+
const { startOffset: r } = e, i = o.findNodePositionByCharIndex(r);
|
|
565
|
+
this.scrollToNode(t, i);
|
|
532
566
|
}
|
|
533
567
|
scrollToNode(t, e) {
|
|
534
|
-
var
|
|
535
|
-
const n = this._getDocObject(), o = (
|
|
536
|
-
if (n == null ||
|
|
568
|
+
var G;
|
|
569
|
+
const n = this._getDocObject(), o = (G = this._renderManagerService.getRenderById(t)) == null ? void 0 : G.with(L), r = o == null ? void 0 : o.getSkeleton();
|
|
570
|
+
if (n == null || r == null)
|
|
537
571
|
return;
|
|
538
|
-
const
|
|
572
|
+
const i = n.document.getOffsetConfig(), { docsLeft: s, docsTop: a } = i, c = new rn(i, r), { contentBoxPointGroup: d } = c.getRangePointData(e, e), { left: g, top: h, height: p } = Co(d), l = g + s, _ = h + a, u = n.scene.getViewport(q.VIEW_MAIN), f = !!this._editorService.getEditor(t);
|
|
539
573
|
if (u == null)
|
|
540
574
|
return;
|
|
541
575
|
const {
|
|
542
576
|
left: m,
|
|
543
577
|
top: R,
|
|
544
|
-
right:
|
|
545
|
-
bottom:
|
|
578
|
+
right: I,
|
|
579
|
+
bottom: b
|
|
546
580
|
} = u.getBounding().viewBound;
|
|
547
|
-
let
|
|
548
|
-
const
|
|
549
|
-
|
|
550
|
-
const
|
|
551
|
-
u.scrollBy(
|
|
581
|
+
let T = 0, A = 0;
|
|
582
|
+
const N = f ? 0 : 100;
|
|
583
|
+
_ < R ? T = _ - R - N : _ > b - p && (T = _ - b + p + N), l < m ? A = l - m : l > I - Lt && (A = l - I + Lt);
|
|
584
|
+
const Y = u.transViewportScroll2ScrollValue(A, T);
|
|
585
|
+
u.scrollBy(Y);
|
|
552
586
|
}
|
|
553
587
|
// Let the selection show on the current screen.
|
|
554
588
|
_scrollToSelection(t) {
|
|
@@ -559,16 +593,16 @@ let nt = class extends ve {
|
|
|
559
593
|
n && this.scrollToNode(t, o);
|
|
560
594
|
}
|
|
561
595
|
_getDocObject() {
|
|
562
|
-
return
|
|
596
|
+
return Jn(this._univerInstanceService, this._renderManagerService);
|
|
563
597
|
}
|
|
564
598
|
};
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
],
|
|
571
|
-
const
|
|
599
|
+
ot = Qo([
|
|
600
|
+
Oe(1, E(te)),
|
|
601
|
+
Oe(2, ee),
|
|
602
|
+
Oe(3, E(w)),
|
|
603
|
+
Oe(4, W)
|
|
604
|
+
], ot);
|
|
605
|
+
const er = {
|
|
572
606
|
undo: !0,
|
|
573
607
|
redo: !0,
|
|
574
608
|
// Undo redo
|
|
@@ -596,7 +630,7 @@ const Qo = {
|
|
|
596
630
|
// 'Wrap mode'
|
|
597
631
|
textRotateMode: !0
|
|
598
632
|
// 'Text Rotation Mode'
|
|
599
|
-
},
|
|
633
|
+
}, tr = {
|
|
600
634
|
outerLeft: !1,
|
|
601
635
|
outerRight: !1,
|
|
602
636
|
header: !0,
|
|
@@ -609,78 +643,78 @@ const Qo = {
|
|
|
609
643
|
frozenContent: !1,
|
|
610
644
|
infoBar: !0,
|
|
611
645
|
toolbar: !0
|
|
612
|
-
},
|
|
646
|
+
}, nr = {
|
|
613
647
|
layout: {
|
|
614
|
-
docContainerConfig:
|
|
615
|
-
toolbarConfig:
|
|
648
|
+
docContainerConfig: tr,
|
|
649
|
+
toolbarConfig: er
|
|
616
650
|
}
|
|
617
|
-
},
|
|
618
|
-
id:
|
|
651
|
+
}, or = "DocUI", rr = {
|
|
652
|
+
id: He.id,
|
|
619
653
|
binding: H.ARROW_UP,
|
|
620
|
-
preconditions:
|
|
654
|
+
preconditions: k,
|
|
621
655
|
staticParameters: {
|
|
622
|
-
direction:
|
|
656
|
+
direction: K.UP
|
|
623
657
|
}
|
|
624
|
-
},
|
|
625
|
-
id:
|
|
658
|
+
}, ir = {
|
|
659
|
+
id: He.id,
|
|
626
660
|
binding: H.ARROW_DOWN,
|
|
627
|
-
preconditions:
|
|
661
|
+
preconditions: k,
|
|
628
662
|
staticParameters: {
|
|
629
|
-
direction:
|
|
663
|
+
direction: K.DOWN
|
|
630
664
|
}
|
|
631
|
-
},
|
|
632
|
-
id:
|
|
665
|
+
}, sr = {
|
|
666
|
+
id: He.id,
|
|
633
667
|
binding: H.ARROW_LEFT,
|
|
634
|
-
preconditions:
|
|
668
|
+
preconditions: k,
|
|
635
669
|
staticParameters: {
|
|
636
|
-
direction:
|
|
670
|
+
direction: K.LEFT
|
|
637
671
|
}
|
|
638
|
-
},
|
|
639
|
-
id:
|
|
672
|
+
}, ar = {
|
|
673
|
+
id: He.id,
|
|
640
674
|
binding: H.ARROW_RIGHT,
|
|
641
|
-
preconditions:
|
|
675
|
+
preconditions: k,
|
|
642
676
|
staticParameters: {
|
|
643
|
-
direction:
|
|
677
|
+
direction: K.RIGHT
|
|
644
678
|
}
|
|
645
|
-
},
|
|
646
|
-
id:
|
|
647
|
-
binding: H.ARROW_UP |
|
|
648
|
-
preconditions:
|
|
679
|
+
}, cr = {
|
|
680
|
+
id: Ve.id,
|
|
681
|
+
binding: H.ARROW_UP | ve.SHIFT,
|
|
682
|
+
preconditions: k,
|
|
649
683
|
staticParameters: {
|
|
650
|
-
direction:
|
|
684
|
+
direction: K.UP
|
|
651
685
|
}
|
|
652
|
-
},
|
|
653
|
-
id:
|
|
654
|
-
binding: H.ARROW_DOWN |
|
|
655
|
-
preconditions:
|
|
686
|
+
}, lr = {
|
|
687
|
+
id: Ve.id,
|
|
688
|
+
binding: H.ARROW_DOWN | ve.SHIFT,
|
|
689
|
+
preconditions: k,
|
|
656
690
|
staticParameters: {
|
|
657
|
-
direction:
|
|
691
|
+
direction: K.DOWN
|
|
658
692
|
}
|
|
659
|
-
},
|
|
660
|
-
id:
|
|
661
|
-
binding: H.ARROW_LEFT |
|
|
662
|
-
preconditions:
|
|
693
|
+
}, dr = {
|
|
694
|
+
id: Ve.id,
|
|
695
|
+
binding: H.ARROW_LEFT | ve.SHIFT,
|
|
696
|
+
preconditions: k,
|
|
663
697
|
staticParameters: {
|
|
664
|
-
direction:
|
|
698
|
+
direction: K.LEFT
|
|
665
699
|
}
|
|
666
|
-
},
|
|
667
|
-
id:
|
|
668
|
-
binding: H.ARROW_RIGHT |
|
|
669
|
-
preconditions:
|
|
700
|
+
}, ur = {
|
|
701
|
+
id: Ve.id,
|
|
702
|
+
binding: H.ARROW_RIGHT | ve.SHIFT,
|
|
703
|
+
preconditions: k,
|
|
670
704
|
staticParameters: {
|
|
671
|
-
direction:
|
|
705
|
+
direction: K.RIGHT
|
|
672
706
|
}
|
|
673
|
-
},
|
|
674
|
-
id:
|
|
675
|
-
binding: H.A |
|
|
676
|
-
preconditions: (t) => t.getContextValue(
|
|
707
|
+
}, hr = {
|
|
708
|
+
id: qn.id,
|
|
709
|
+
binding: H.A | ve.CTRL_COMMAND,
|
|
710
|
+
preconditions: (t) => t.getContextValue(dt) && (t.getContextValue(Ue) || t.getContextValue(qt))
|
|
677
711
|
};
|
|
678
|
-
var
|
|
679
|
-
for (var
|
|
680
|
-
(s = t[
|
|
681
|
-
return o &&
|
|
682
|
-
},
|
|
683
|
-
let
|
|
712
|
+
var gr = Object.defineProperty, pr = Object.getOwnPropertyDescriptor, _r = (t, e, n, o) => {
|
|
713
|
+
for (var r = o > 1 ? void 0 : o ? pr(e, n) : e, i = t.length - 1, s; i >= 0; i--)
|
|
714
|
+
(s = t[i]) && (r = (o ? s(e, n, r) : s(r)) || r);
|
|
715
|
+
return o && r && gr(e, n, r), r;
|
|
716
|
+
}, wt = (t, e) => (n, o) => e(n, o, t);
|
|
717
|
+
let rt = class {
|
|
684
718
|
constructor(t, e, n) {
|
|
685
719
|
C(this, "_docContainer");
|
|
686
720
|
// 获取SheetContainer组件
|
|
@@ -719,17 +753,17 @@ let ot = class {
|
|
|
719
753
|
return this._docContainer;
|
|
720
754
|
}
|
|
721
755
|
};
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
],
|
|
726
|
-
var
|
|
727
|
-
for (var
|
|
728
|
-
(s = t[
|
|
729
|
-
return o &&
|
|
730
|
-
},
|
|
731
|
-
let
|
|
732
|
-
constructor(e, n, o,
|
|
756
|
+
rt = _r([
|
|
757
|
+
wt(1, E(le)),
|
|
758
|
+
wt(2, E(Le))
|
|
759
|
+
], rt);
|
|
760
|
+
var fr = Object.defineProperty, mr = Object.getOwnPropertyDescriptor, Sr = (t, e, n, o) => {
|
|
761
|
+
for (var r = o > 1 ? void 0 : o ? mr(e, n) : e, i = t.length - 1, s; i >= 0; i--)
|
|
762
|
+
(s = t[i]) && (r = (o ? s(e, n, r) : s(r)) || r);
|
|
763
|
+
return o && r && fr(e, n, r), r;
|
|
764
|
+
}, Ce = (t, e) => (n, o) => e(n, o, t);
|
|
765
|
+
let fe = class extends Se {
|
|
766
|
+
constructor(e, n, o, r, i) {
|
|
733
767
|
super();
|
|
734
768
|
C(this, "_docContainerController");
|
|
735
769
|
/**
|
|
@@ -742,7 +776,7 @@ let me = class extends ve {
|
|
|
742
776
|
C(this, "changeLocale", (e) => {
|
|
743
777
|
this._localeService.setLocale(e);
|
|
744
778
|
});
|
|
745
|
-
this._localeService = n, this._injector = o, this._textSelectionRenderManager =
|
|
779
|
+
this._localeService = n, this._injector = o, this._textSelectionRenderManager = r, this._layoutService = i, this._docContainerController = this._injector.createInstance(rt, e), this._registerContainer();
|
|
746
780
|
}
|
|
747
781
|
_registerContainer() {
|
|
748
782
|
this._layoutService && this.disposeWithMe(
|
|
@@ -754,46 +788,20 @@ let me = class extends ve {
|
|
|
754
788
|
return this._docContainerController;
|
|
755
789
|
}
|
|
756
790
|
};
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
],
|
|
763
|
-
const
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
770
|
-
*
|
|
771
|
-
* This source code is licensed under the MIT license found in the
|
|
772
|
-
* LICENSE file in the root directory of this source tree.
|
|
773
|
-
*/
|
|
774
|
-
var Si = xo, vi = Symbol.for("react.element"), Ri = Symbol.for("react.fragment"), Oi = Object.prototype.hasOwnProperty, Ci = Si.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Ei = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
775
|
-
function un(t, e, n) {
|
|
776
|
-
var o, i = {}, r = null, s = null;
|
|
777
|
-
n !== void 0 && (r = "" + n), e.key !== void 0 && (r = "" + e.key), e.ref !== void 0 && (s = e.ref);
|
|
778
|
-
for (o in e) Oi.call(e, o) && !Ei.hasOwnProperty(o) && (i[o] = e[o]);
|
|
779
|
-
if (t && t.defaultProps) for (o in e = t.defaultProps, e) i[o] === void 0 && (i[o] = e[o]);
|
|
780
|
-
return { $$typeof: vi, type: t, key: r, ref: s, props: i, _owner: Ci.current };
|
|
791
|
+
fe = Sr([
|
|
792
|
+
Ce(1, E(le)),
|
|
793
|
+
Ce(2, E(Le)),
|
|
794
|
+
Ce(3, ne),
|
|
795
|
+
Ce(4, In(en))
|
|
796
|
+
], fe);
|
|
797
|
+
const We = "UI_PLUGIN_DOCS", pt = `${We}_COLOR_PICKER_COMPONENT`, dn = `${We}_FONT_FAMILY_COMPONENT`, un = `${We}_FONT_FAMILY_ITEM_COMPONENT`, hn = `${We}_FONT_SIZE_COMPONENT`, Bt = 18, $t = 200, Ze = 6, vr = 4;
|
|
798
|
+
function Rr(t, e) {
|
|
799
|
+
let { radius: n, width: o, height: r } = e;
|
|
800
|
+
n = n != null ? n : 0, o = o != null ? o : 30, r = r != null ? r : 30;
|
|
801
|
+
let i = 0;
|
|
802
|
+
i = Math.min(n, o / 2, r / 2), t.beginPath(), t.moveTo(0, 0), t.lineTo(o, 0), t.lineTo(o, r - i), t.arc(o - i, r - i, i, 0, Math.PI / 2, !1), t.lineTo(0, r), t.lineTo(0, 0), t.closePath(), e.fill && (t.save(), t.fillStyle = e.fill, e.fillRule === "evenodd" ? t.fill("evenodd") : t.fill(), t.restore());
|
|
781
803
|
}
|
|
782
|
-
|
|
783
|
-
We.jsx = un;
|
|
784
|
-
We.jsxs = un;
|
|
785
|
-
dn.exports = We;
|
|
786
|
-
var I = dn.exports;
|
|
787
|
-
const Ii = "univer-docs-ui-canvas-background", Ti = {
|
|
788
|
-
docsUiCanvasBackground: Ii
|
|
789
|
-
}, bi = () => /* @__PURE__ */ I.jsx("div", { className: Ti.docsUiCanvasBackground }), Lt = 18, wt = 200, Ke = 6, Mi = 4;
|
|
790
|
-
function xi(t, e) {
|
|
791
|
-
let { radius: n, width: o, height: i } = e;
|
|
792
|
-
n = n != null ? n : 0, o = o != null ? o : 30, i = i != null ? i : 30;
|
|
793
|
-
let r = 0;
|
|
794
|
-
r = Math.min(n, o / 2, i / 2), t.beginPath(), t.moveTo(0, 0), t.lineTo(o, 0), t.lineTo(o, i - r), t.arc(o - r, i - r, r, 0, Math.PI / 2, !1), t.lineTo(0, i), t.lineTo(0, 0), t.closePath(), e.fill && (t.save(), t.fillStyle = e.fill, e.fillRule === "evenodd" ? t.fill("evenodd") : t.fill(), t.restore());
|
|
795
|
-
}
|
|
796
|
-
class Ae extends Ro {
|
|
804
|
+
class Ne extends Eo {
|
|
797
805
|
constructor(n, o) {
|
|
798
806
|
super(n, o);
|
|
799
807
|
C(this, "color");
|
|
@@ -801,26 +809,26 @@ class Ae extends Ro {
|
|
|
801
809
|
this.color = o == null ? void 0 : o.color, this.text = o == null ? void 0 : o.text;
|
|
802
810
|
}
|
|
803
811
|
static drawWith(n, o) {
|
|
804
|
-
const { text:
|
|
812
|
+
const { text: r, color: i } = o;
|
|
805
813
|
n.save(), n.font = "13px Source Han Sans CN";
|
|
806
|
-
const s = n.measureText(
|
|
807
|
-
s + 2 *
|
|
808
|
-
|
|
814
|
+
const s = n.measureText(r).width, a = Math.min(
|
|
815
|
+
s + 2 * Ze,
|
|
816
|
+
$t
|
|
809
817
|
);
|
|
810
|
-
|
|
811
|
-
height:
|
|
818
|
+
Rr(n, {
|
|
819
|
+
height: Bt,
|
|
812
820
|
width: a,
|
|
813
821
|
radius: 4,
|
|
814
|
-
fill:
|
|
822
|
+
fill: i,
|
|
815
823
|
evented: !1
|
|
816
824
|
}), n.fillStyle = "rgba(58, 96, 247, 1)";
|
|
817
|
-
const c =
|
|
818
|
-
if (s >
|
|
819
|
-
let h = "",
|
|
820
|
-
for (const l of
|
|
821
|
-
const
|
|
822
|
-
if (
|
|
823
|
-
h += l,
|
|
825
|
+
const c = Ze, d = Bt - vr, g = $t - 2 * Ze;
|
|
826
|
+
if (s > g) {
|
|
827
|
+
let h = "", p = 0;
|
|
828
|
+
for (const l of r) {
|
|
829
|
+
const _ = n.measureText(l).width;
|
|
830
|
+
if (p + _ <= g - n.measureText("...").width)
|
|
831
|
+
h += l, p += _;
|
|
824
832
|
else {
|
|
825
833
|
h += "...";
|
|
826
834
|
break;
|
|
@@ -828,103 +836,127 @@ class Ae extends Ro {
|
|
|
828
836
|
}
|
|
829
837
|
n.fillText(h, c, d);
|
|
830
838
|
} else
|
|
831
|
-
n.fillText(
|
|
839
|
+
n.fillText(r, c, d);
|
|
832
840
|
n.restore();
|
|
833
841
|
}
|
|
834
842
|
_draw(n) {
|
|
835
|
-
|
|
843
|
+
Ne.drawWith(n, this);
|
|
836
844
|
}
|
|
837
845
|
}
|
|
838
|
-
const
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
846
|
+
const gn = "COMPONENT_DOC_HEADER_FOOTER_PANEL";
|
|
847
|
+
var pn = { exports: {} }, ke = {};
|
|
848
|
+
/**
|
|
849
|
+
* @license React
|
|
850
|
+
* react-jsx-runtime.production.min.js
|
|
851
|
+
*
|
|
852
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
853
|
+
*
|
|
854
|
+
* This source code is licensed under the MIT license found in the
|
|
855
|
+
* LICENSE file in the root directory of this source tree.
|
|
856
|
+
*/
|
|
857
|
+
var Or = Po, Cr = Symbol.for("react.element"), Er = Symbol.for("react.fragment"), Tr = Object.prototype.hasOwnProperty, Ir = Or.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, br = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
858
|
+
function _n(t, e, n) {
|
|
859
|
+
var o, r = {}, i = null, s = null;
|
|
860
|
+
n !== void 0 && (i = "" + n), e.key !== void 0 && (i = "" + e.key), e.ref !== void 0 && (s = e.ref);
|
|
861
|
+
for (o in e) Tr.call(e, o) && !br.hasOwnProperty(o) && (r[o] = e[o]);
|
|
862
|
+
if (t && t.defaultProps) for (o in e = t.defaultProps, e) r[o] === void 0 && (r[o] = e[o]);
|
|
863
|
+
return { $$typeof: Cr, type: t, key: i, ref: s, props: r, _owner: Ir.current };
|
|
864
|
+
}
|
|
865
|
+
ke.Fragment = Er;
|
|
866
|
+
ke.jsx = _n;
|
|
867
|
+
ke.jsxs = _n;
|
|
868
|
+
pn.exports = ke;
|
|
869
|
+
var M = pn.exports;
|
|
870
|
+
const Mr = "univer-panel", yr = "univer-options-section", xr = "univer-options-form-item", Pr = "univer-options-input", Dr = "univer-options-margin-setting", $ = {
|
|
871
|
+
panel: Mr,
|
|
872
|
+
optionsSection: yr,
|
|
873
|
+
optionsFormItem: xr,
|
|
874
|
+
optionsInput: Pr,
|
|
875
|
+
optionsMarginSetting: Dr
|
|
876
|
+
}, Ar = (t) => {
|
|
877
|
+
const e = z(le), n = z(w), o = z(W), r = z(O), i = z(ne), s = z(te), { unitId: a } = t, [c, d] = an({}), g = (l, _) => {
|
|
878
|
+
var N;
|
|
879
|
+
d((Y) => ({
|
|
880
|
+
...Y,
|
|
881
|
+
[_]: l ? S.TRUE : S.FALSE
|
|
850
882
|
}));
|
|
851
|
-
const u = n.getUniverDocInstance(a),
|
|
852
|
-
if (
|
|
883
|
+
const u = n.getUniverDocInstance(a), f = u == null ? void 0 : u.getSnapshot().documentStyle, m = (N = o.getRenderById(a)) == null ? void 0 : N.with(L), R = m == null ? void 0 : m.getViewModel();
|
|
884
|
+
if (f == null || R == null)
|
|
853
885
|
return;
|
|
854
|
-
const
|
|
855
|
-
let
|
|
856
|
-
const
|
|
886
|
+
const I = R.getEditArea();
|
|
887
|
+
let b = !1;
|
|
888
|
+
const T = i.getSegmentPage();
|
|
857
889
|
let A = !1;
|
|
858
|
-
if (
|
|
859
|
-
const
|
|
860
|
-
A &&
|
|
890
|
+
if (_ === "useFirstPageHeaderFooter" && l === !0 && ((I === F.HEADER && !f.firstPageHeaderId || I === F.FOOTER && !f.firstPageFooterId) && (b = !0), b && T === 0 && (A = !0)), _ === "evenAndOddHeaders" && l === !0 && ((I === F.HEADER && !f.evenPageHeaderId || I === F.FOOTER && !f.evenPageFooterId) && (b = !0), b && T % 2 === 1 && (A = !0)), b) {
|
|
891
|
+
const G = j.generateRandomId(6);
|
|
892
|
+
A && i.setSegment(G), r.executeCommand(be, {
|
|
861
893
|
unitId: a,
|
|
862
|
-
segmentId:
|
|
894
|
+
segmentId: G,
|
|
863
895
|
headerFooterProps: {
|
|
864
|
-
[
|
|
896
|
+
[_]: l ? S.TRUE : S.FALSE
|
|
865
897
|
}
|
|
866
898
|
});
|
|
867
899
|
} else
|
|
868
|
-
|
|
900
|
+
r.executeCommand(be, {
|
|
869
901
|
unitId: a,
|
|
870
902
|
headerFooterProps: {
|
|
871
|
-
[
|
|
903
|
+
[_]: l ? S.TRUE : S.FALSE
|
|
872
904
|
}
|
|
873
905
|
});
|
|
874
|
-
}, h = async (l,
|
|
906
|
+
}, h = async (l, _) => {
|
|
875
907
|
d((u) => ({
|
|
876
908
|
...u,
|
|
877
|
-
[
|
|
878
|
-
})), await
|
|
909
|
+
[_]: l
|
|
910
|
+
})), await r.executeCommand(be, {
|
|
879
911
|
unitId: a,
|
|
880
912
|
headerFooterProps: {
|
|
881
|
-
[
|
|
913
|
+
[_]: l
|
|
882
914
|
}
|
|
883
|
-
}),
|
|
884
|
-
},
|
|
915
|
+
}), i.removeAllTextRanges(), i.blur();
|
|
916
|
+
}, p = () => {
|
|
885
917
|
var m, R;
|
|
886
|
-
const l = (m = o.getRenderById(a)) == null ? void 0 : m.with(
|
|
887
|
-
|
|
918
|
+
const l = (m = o.getRenderById(a)) == null ? void 0 : m.with(L), _ = l == null ? void 0 : l.getSkeleton(), u = l == null ? void 0 : l.getViewModel(), f = o.getRenderById(a);
|
|
919
|
+
f == null || u == null || _ == null || (s.replaceTextRanges([]), i.setSegment(""), i.setSegmentPage(-1), u.setEditArea(F.BODY), _.calculate(), (R = f.mainComponent) == null || R.makeDirty(!0));
|
|
888
920
|
};
|
|
889
|
-
return
|
|
890
|
-
const l = n.getUniverDocInstance(a),
|
|
891
|
-
if (
|
|
892
|
-
const { marginHeader: u, marginFooter:
|
|
921
|
+
return cn(() => {
|
|
922
|
+
const l = n.getUniverDocInstance(a), _ = l == null ? void 0 : l.getSnapshot().documentStyle;
|
|
923
|
+
if (_) {
|
|
924
|
+
const { marginHeader: u, marginFooter: f, useFirstPageHeaderFooter: m, evenAndOddHeaders: R } = _;
|
|
893
925
|
d({
|
|
894
926
|
marginHeader: u,
|
|
895
|
-
marginFooter:
|
|
927
|
+
marginFooter: f,
|
|
896
928
|
useFirstPageHeaderFooter: m,
|
|
897
929
|
evenAndOddHeaders: R
|
|
898
930
|
});
|
|
899
931
|
}
|
|
900
|
-
}, [a]), /* @__PURE__ */
|
|
901
|
-
/* @__PURE__ */
|
|
902
|
-
/* @__PURE__ */
|
|
903
|
-
|
|
932
|
+
}, [a]), /* @__PURE__ */ M.jsxs("div", { className: $.options, children: [
|
|
933
|
+
/* @__PURE__ */ M.jsxs("div", { className: $.optionsSection, children: [
|
|
934
|
+
/* @__PURE__ */ M.jsx("div", { className: $.optionsFormItem, children: /* @__PURE__ */ M.jsx(
|
|
935
|
+
Pt,
|
|
904
936
|
{
|
|
905
937
|
checked: c.useFirstPageHeaderFooter === S.TRUE,
|
|
906
938
|
onChange: (l) => {
|
|
907
|
-
|
|
939
|
+
g(l, "useFirstPageHeaderFooter");
|
|
908
940
|
},
|
|
909
941
|
children: e.t("headerFooter.firstPageCheckBox")
|
|
910
942
|
}
|
|
911
943
|
) }),
|
|
912
|
-
/* @__PURE__ */
|
|
913
|
-
|
|
944
|
+
/* @__PURE__ */ M.jsx("div", { className: $.optionsFormItem, children: /* @__PURE__ */ M.jsx(
|
|
945
|
+
Pt,
|
|
914
946
|
{
|
|
915
947
|
checked: c.evenAndOddHeaders === S.TRUE,
|
|
916
948
|
onChange: (l) => {
|
|
917
|
-
|
|
949
|
+
g(l, "evenAndOddHeaders");
|
|
918
950
|
},
|
|
919
951
|
children: e.t("headerFooter.oddEvenCheckBox")
|
|
920
952
|
}
|
|
921
953
|
) })
|
|
922
954
|
] }),
|
|
923
|
-
/* @__PURE__ */
|
|
924
|
-
/* @__PURE__ */
|
|
925
|
-
/* @__PURE__ */
|
|
926
|
-
/* @__PURE__ */
|
|
927
|
-
|
|
955
|
+
/* @__PURE__ */ M.jsxs("div", { className: No($.optionsSection, $.optionsMarginSetting), children: [
|
|
956
|
+
/* @__PURE__ */ M.jsxs("div", { className: $.optionsMarginItem, children: [
|
|
957
|
+
/* @__PURE__ */ M.jsx("span", { children: e.t("headerFooter.headerTopMargin") }),
|
|
958
|
+
/* @__PURE__ */ M.jsx(
|
|
959
|
+
Dt,
|
|
928
960
|
{
|
|
929
961
|
min: 0,
|
|
930
962
|
max: 200,
|
|
@@ -937,10 +969,10 @@ const hn = "COMPONENT_DOC_HEADER_FOOTER_PANEL", yi = "univer-panel", Pi = "unive
|
|
|
937
969
|
}
|
|
938
970
|
)
|
|
939
971
|
] }),
|
|
940
|
-
/* @__PURE__ */
|
|
941
|
-
/* @__PURE__ */
|
|
942
|
-
/* @__PURE__ */
|
|
943
|
-
|
|
972
|
+
/* @__PURE__ */ M.jsxs("div", { className: $.optionsMarginItem, children: [
|
|
973
|
+
/* @__PURE__ */ M.jsx("span", { children: e.t("headerFooter.footerBottomMargin") }),
|
|
974
|
+
/* @__PURE__ */ M.jsx(
|
|
975
|
+
Dt,
|
|
944
976
|
{
|
|
945
977
|
min: 0,
|
|
946
978
|
max: 200,
|
|
@@ -954,31 +986,31 @@ const hn = "COMPONENT_DOC_HEADER_FOOTER_PANEL", yi = "univer-panel", Pi = "unive
|
|
|
954
986
|
)
|
|
955
987
|
] })
|
|
956
988
|
] }),
|
|
957
|
-
/* @__PURE__ */
|
|
989
|
+
/* @__PURE__ */ M.jsx("div", { className: $.optionsSection, children: /* @__PURE__ */ M.jsx(Do, { onClick: p, children: e.t("headerFooter.closeHeaderFooter") }) })
|
|
958
990
|
] });
|
|
959
|
-
},
|
|
991
|
+
}, Nr = () => {
|
|
960
992
|
var d;
|
|
961
|
-
const t = z(le), e = z(
|
|
962
|
-
return
|
|
963
|
-
const
|
|
964
|
-
c(
|
|
965
|
-
const h = s.editAreaChange$.subscribe((
|
|
966
|
-
|
|
993
|
+
const t = z(le), e = z(W), r = z(w).getCurrentUniverDocInstance().getUnitId(), s = ((d = e.getRenderById(r)) == null ? void 0 : d.with(L)).getViewModel(), [a, c] = an(!0);
|
|
994
|
+
return cn(() => {
|
|
995
|
+
const g = s.getEditArea();
|
|
996
|
+
c(g !== F.BODY);
|
|
997
|
+
const h = s.editAreaChange$.subscribe((p) => {
|
|
998
|
+
p != null && c(p !== F.BODY);
|
|
967
999
|
});
|
|
968
1000
|
return () => {
|
|
969
1001
|
h.unsubscribe();
|
|
970
1002
|
};
|
|
971
|
-
}, []), /* @__PURE__ */
|
|
972
|
-
},
|
|
1003
|
+
}, []), /* @__PURE__ */ M.jsx("div", { className: $.panel, children: a ? /* @__PURE__ */ M.jsx(Ar, { unitId: r }) : /* @__PURE__ */ M.jsx("div", { className: $.panelDisableText, children: t.t("headerFooter.disableText") }) });
|
|
1004
|
+
}, fn = {
|
|
973
1005
|
id: "sidebar.operation.doc-header-footer-panel",
|
|
974
1006
|
type: de.COMMAND,
|
|
975
1007
|
handler: async (t, e) => {
|
|
976
|
-
const n = t.get(
|
|
1008
|
+
const n = t.get(Ln), o = t.get(le);
|
|
977
1009
|
switch (e.value) {
|
|
978
1010
|
case "open":
|
|
979
1011
|
n.open({
|
|
980
1012
|
header: { title: o.t("headerFooter.panel") },
|
|
981
|
-
children: { label:
|
|
1013
|
+
children: { label: gn },
|
|
982
1014
|
onClose: () => {
|
|
983
1015
|
},
|
|
984
1016
|
width: 400
|
|
@@ -992,54 +1024,54 @@ const hn = "COMPONENT_DOC_HEADER_FOOTER_PANEL", yi = "univer-panel", Pi = "unive
|
|
|
992
1024
|
return !0;
|
|
993
1025
|
}
|
|
994
1026
|
};
|
|
995
|
-
var
|
|
996
|
-
for (var
|
|
997
|
-
(s = t[
|
|
998
|
-
return o &&
|
|
999
|
-
},
|
|
1000
|
-
const
|
|
1001
|
-
var
|
|
1002
|
-
function
|
|
1027
|
+
var Fr = Object.defineProperty, Ur = Object.getOwnPropertyDescriptor, Lr = (t, e, n, o) => {
|
|
1028
|
+
for (var r = o > 1 ? void 0 : o ? Ur(e, n) : e, i = t.length - 1, s; i >= 0; i--)
|
|
1029
|
+
(s = t[i]) && (r = (o ? s(e, n, r) : s(r)) || r);
|
|
1030
|
+
return o && r && Fr(e, n, r), r;
|
|
1031
|
+
}, X = (t, e) => (n, o) => e(n, o, t);
|
|
1032
|
+
const Ht = "rgba(58, 96, 247, 1)", Vt = "rgba(58, 96, 247, 0.08)";
|
|
1033
|
+
var U = /* @__PURE__ */ ((t) => (t[t.FIRST_PAGE_HEADER = 0] = "FIRST_PAGE_HEADER", t[t.FIRST_PAGE_FOOTER = 1] = "FIRST_PAGE_FOOTER", t[t.DEFAULT_HEADER = 2] = "DEFAULT_HEADER", t[t.DEFAULT_FOOTER = 3] = "DEFAULT_FOOTER", t[t.EVEN_PAGE_HEADER = 4] = "EVEN_PAGE_HEADER", t[t.EVEN_PAGE_FOOTER = 5] = "EVEN_PAGE_FOOTER", t))(U || {});
|
|
1034
|
+
function wr(t, e, n) {
|
|
1003
1035
|
const { documentStyle: o } = t.getDataModel().getSnapshot(), {
|
|
1004
|
-
defaultHeaderId:
|
|
1005
|
-
defaultFooterId:
|
|
1036
|
+
defaultHeaderId: r,
|
|
1037
|
+
defaultFooterId: i,
|
|
1006
1038
|
evenPageHeaderId: s,
|
|
1007
1039
|
evenPageFooterId: a,
|
|
1008
1040
|
firstPageHeaderId: c,
|
|
1009
1041
|
firstPageFooterId: d,
|
|
1010
|
-
evenAndOddHeaders:
|
|
1042
|
+
evenAndOddHeaders: g,
|
|
1011
1043
|
useFirstPageHeaderFooter: h
|
|
1012
1044
|
} = o;
|
|
1013
1045
|
switch (e) {
|
|
1014
|
-
case
|
|
1046
|
+
case F.BODY:
|
|
1015
1047
|
return {
|
|
1016
1048
|
createType: null,
|
|
1017
1049
|
headerFooterId: null
|
|
1018
1050
|
};
|
|
1019
|
-
case
|
|
1051
|
+
case F.HEADER:
|
|
1020
1052
|
return h === S.TRUE && !c ? {
|
|
1021
1053
|
createType: 0,
|
|
1022
1054
|
headerFooterId: null
|
|
1023
|
-
} :
|
|
1055
|
+
} : g === S.TRUE && n % 2 === 0 && !s ? {
|
|
1024
1056
|
createType: 4,
|
|
1025
1057
|
headerFooterId: null
|
|
1026
|
-
} :
|
|
1058
|
+
} : r ? {
|
|
1027
1059
|
createType: null,
|
|
1028
|
-
headerFooterId:
|
|
1060
|
+
headerFooterId: r
|
|
1029
1061
|
} : {
|
|
1030
1062
|
createType: 2,
|
|
1031
1063
|
headerFooterId: null
|
|
1032
1064
|
};
|
|
1033
|
-
case
|
|
1065
|
+
case F.FOOTER:
|
|
1034
1066
|
return h === S.TRUE && !d ? {
|
|
1035
1067
|
createType: 1,
|
|
1036
1068
|
headerFooterId: null
|
|
1037
|
-
} :
|
|
1069
|
+
} : g === S.TRUE && n % 2 === 0 && !a ? {
|
|
1038
1070
|
createType: 5,
|
|
1039
1071
|
headerFooterId: null
|
|
1040
|
-
} :
|
|
1072
|
+
} : i ? {
|
|
1041
1073
|
createType: null,
|
|
1042
|
-
headerFooterId:
|
|
1074
|
+
headerFooterId: i
|
|
1043
1075
|
} : {
|
|
1044
1076
|
createType: 3,
|
|
1045
1077
|
headerFooterId: null
|
|
@@ -1048,69 +1080,69 @@ function $i(t, e, n) {
|
|
|
1048
1080
|
throw new Error(`Invalid editArea: ${e}`);
|
|
1049
1081
|
}
|
|
1050
1082
|
}
|
|
1051
|
-
let it = class extends
|
|
1052
|
-
constructor(e, n, o,
|
|
1083
|
+
let it = class extends Q {
|
|
1084
|
+
constructor(e, n, o, r, i, s, a, c, d) {
|
|
1053
1085
|
super();
|
|
1054
1086
|
C(this, "_loadedMap", /* @__PURE__ */ new WeakSet());
|
|
1055
|
-
this._context = e, this._commandService = n, this._editorService = o, this._instanceSrv =
|
|
1087
|
+
this._context = e, this._commandService = n, this._editorService = o, this._instanceSrv = r, this._renderManagerService = i, this._docSkeletonManagerService = s, this._textSelectionRenderManager = a, this._localeService = c, this._componentManager = d, this._initialize();
|
|
1056
1088
|
}
|
|
1057
1089
|
_initialize() {
|
|
1058
|
-
this._context.unit.getSnapshot().documentStyle.documentFlavor ===
|
|
1090
|
+
this._context.unit.getSnapshot().documentStyle.documentFlavor === bn.TRADITIONAL && (this._init(), this._drawHeaderFooterLabel(), this._registerCommands(), this._initCustomComponents());
|
|
1059
1091
|
}
|
|
1060
1092
|
_registerCommands() {
|
|
1061
1093
|
[
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1094
|
+
Wt,
|
|
1095
|
+
mn,
|
|
1096
|
+
fn
|
|
1065
1097
|
].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e)));
|
|
1066
1098
|
}
|
|
1067
1099
|
_initCustomComponents() {
|
|
1068
1100
|
const e = this._componentManager;
|
|
1069
|
-
this.disposeWithMe(e.register(
|
|
1101
|
+
this.disposeWithMe(e.register(gn, Nr));
|
|
1070
1102
|
}
|
|
1071
1103
|
_init() {
|
|
1072
|
-
const { unitId: e } = this._context, n =
|
|
1104
|
+
const { unitId: e } = this._context, n = J(this._context);
|
|
1073
1105
|
n == null || n.document == null || this._loadedMap.has(n.document) || (this._initialMain(e), this._loadedMap.add(n.document));
|
|
1074
1106
|
}
|
|
1075
1107
|
_initialMain(e) {
|
|
1076
|
-
const n =
|
|
1077
|
-
this.disposeWithMe(o.onDblclick$.subscribeEvent(async (
|
|
1108
|
+
const n = J(this._context), { document: o } = n;
|
|
1109
|
+
this.disposeWithMe(o.onDblclick$.subscribeEvent(async (r) => {
|
|
1078
1110
|
if (this._isEditorReadOnly(e))
|
|
1079
1111
|
return;
|
|
1080
|
-
const { offsetX:
|
|
1081
|
-
pageLayoutType: a =
|
|
1112
|
+
const { offsetX: i, offsetY: s } = r, {
|
|
1113
|
+
pageLayoutType: a = Ae.VERTICAL,
|
|
1082
1114
|
pageMarginLeft: c,
|
|
1083
1115
|
pageMarginTop: d
|
|
1084
|
-
} = o.getOffsetConfig(),
|
|
1085
|
-
if (
|
|
1116
|
+
} = o.getOffsetConfig(), g = this._getTransformCoordForDocumentOffset(i, s);
|
|
1117
|
+
if (g == null)
|
|
1086
1118
|
return;
|
|
1087
|
-
const h = this._docSkeletonManagerService.getViewModel(),
|
|
1088
|
-
|
|
1119
|
+
const h = this._docSkeletonManagerService.getViewModel(), p = this._docSkeletonManagerService.getSkeleton(), l = h.getEditArea(), { editArea: _, pageNumber: u } = p.findEditAreaByCoord(
|
|
1120
|
+
g,
|
|
1089
1121
|
a,
|
|
1090
1122
|
c,
|
|
1091
1123
|
d
|
|
1092
1124
|
);
|
|
1093
|
-
if (l ===
|
|
1125
|
+
if (l === _)
|
|
1094
1126
|
return;
|
|
1095
|
-
h.setEditArea(
|
|
1096
|
-
const { createType:
|
|
1097
|
-
if (
|
|
1098
|
-
this._textSelectionRenderManager.setSegment(""), this._textSelectionRenderManager.setSegmentPage(-1), this._textSelectionRenderManager.setCursorManually(
|
|
1099
|
-
else if (
|
|
1100
|
-
const
|
|
1101
|
-
this._textSelectionRenderManager.setSegment(
|
|
1127
|
+
h.setEditArea(_);
|
|
1128
|
+
const { createType: f, headerFooterId: m } = wr(h, _, u);
|
|
1129
|
+
if (_ === F.BODY)
|
|
1130
|
+
this._textSelectionRenderManager.setSegment(""), this._textSelectionRenderManager.setSegmentPage(-1), this._textSelectionRenderManager.setCursorManually(i, s);
|
|
1131
|
+
else if (f != null) {
|
|
1132
|
+
const I = j.generateRandomId(6);
|
|
1133
|
+
this._textSelectionRenderManager.setSegment(I), this._textSelectionRenderManager.setSegmentPage(u), await this._commandService.executeCommand(Wt.id, {
|
|
1102
1134
|
unitId: e,
|
|
1103
|
-
createType:
|
|
1104
|
-
segmentId:
|
|
1135
|
+
createType: f,
|
|
1136
|
+
segmentId: I
|
|
1105
1137
|
});
|
|
1106
|
-
} else m != null && (this._textSelectionRenderManager.setSegment(m), this._textSelectionRenderManager.setSegmentPage(u), this._textSelectionRenderManager.setCursorManually(
|
|
1138
|
+
} else m != null && (this._textSelectionRenderManager.setSegment(m), this._textSelectionRenderManager.setSegmentPage(u), this._textSelectionRenderManager.setCursorManually(i, s));
|
|
1107
1139
|
}));
|
|
1108
1140
|
}
|
|
1109
1141
|
_getTransformCoordForDocumentOffset(e, n) {
|
|
1110
|
-
const o =
|
|
1142
|
+
const o = J(this._context), { document: r, scene: i } = o, { documentTransform: s } = r.getOffsetConfig(), a = i.getViewports()[0];
|
|
1111
1143
|
if (a == null)
|
|
1112
1144
|
return;
|
|
1113
|
-
const c = a.transformVector2SceneCoord(
|
|
1145
|
+
const c = a.transformVector2SceneCoord(sn.FromArray([e, n]));
|
|
1114
1146
|
return s.clone().invert().applyPoint(c);
|
|
1115
1147
|
}
|
|
1116
1148
|
// eslint-disable-next-line max-lines-per-function
|
|
@@ -1122,60 +1154,60 @@ let it = class extends te {
|
|
|
1122
1154
|
const o = this._renderManagerService.getRenderById(n);
|
|
1123
1155
|
if (this._editorService.isEditor(n) || this._instanceSrv.getUniverDocInstance(n) == null || o == null)
|
|
1124
1156
|
return;
|
|
1125
|
-
const { mainComponent:
|
|
1157
|
+
const { mainComponent: r } = o, i = r;
|
|
1126
1158
|
this.disposeWithMe(
|
|
1127
|
-
|
|
1159
|
+
Jt(
|
|
1128
1160
|
// eslint-disable-next-line max-lines-per-function
|
|
1129
|
-
|
|
1161
|
+
i.pageRender$.subscribe((s) => {
|
|
1130
1162
|
if (this._editorService.isEditor(n))
|
|
1131
1163
|
return;
|
|
1132
|
-
const d = this._docSkeletonManagerService.getViewModel().getEditArea() ===
|
|
1133
|
-
if (l.save(), l.translate(h - 0.5,
|
|
1164
|
+
const d = this._docSkeletonManagerService.getViewModel().getEditArea() === F.BODY, { page: g, pageLeft: h, pageTop: p, ctx: l } = s, { pageWidth: _, pageHeight: u, marginTop: f, marginBottom: m } = g;
|
|
1165
|
+
if (l.save(), l.translate(h - 0.5, p - 0.5), d ? (Xe.drawWith(l, {
|
|
1134
1166
|
left: 0,
|
|
1135
1167
|
top: 0,
|
|
1136
|
-
width:
|
|
1137
|
-
height:
|
|
1168
|
+
width: _,
|
|
1169
|
+
height: f,
|
|
1138
1170
|
fill: "rgba(255, 255, 255, 0.5)"
|
|
1139
|
-
}), l.save(), l.translate(0, u - m),
|
|
1171
|
+
}), l.save(), l.translate(0, u - m), Xe.drawWith(l, {
|
|
1140
1172
|
left: 0,
|
|
1141
1173
|
top: 0,
|
|
1142
|
-
width:
|
|
1174
|
+
width: _,
|
|
1143
1175
|
height: m,
|
|
1144
1176
|
fill: "rgba(255, 255, 255, 0.5)"
|
|
1145
|
-
}), l.restore()) : (l.save(), l.translate(0,
|
|
1177
|
+
}), l.restore()) : (l.save(), l.translate(0, f), Xe.drawWith(l, {
|
|
1146
1178
|
left: 0,
|
|
1147
|
-
top:
|
|
1148
|
-
width:
|
|
1149
|
-
height: u -
|
|
1179
|
+
top: f,
|
|
1180
|
+
width: _,
|
|
1181
|
+
height: u - f - m,
|
|
1150
1182
|
fill: "rgba(255, 255, 255, 0.5)"
|
|
1151
1183
|
}), l.restore()), !d) {
|
|
1152
1184
|
const R = {
|
|
1153
1185
|
dataArray: [{
|
|
1154
1186
|
command: "M",
|
|
1155
|
-
points: [0,
|
|
1187
|
+
points: [0, f]
|
|
1156
1188
|
}, {
|
|
1157
1189
|
command: "L",
|
|
1158
|
-
points: [
|
|
1190
|
+
points: [_, f]
|
|
1159
1191
|
}],
|
|
1160
1192
|
strokeWidth: 1,
|
|
1161
|
-
stroke:
|
|
1162
|
-
},
|
|
1193
|
+
stroke: Ht
|
|
1194
|
+
}, I = {
|
|
1163
1195
|
dataArray: [{
|
|
1164
1196
|
command: "M",
|
|
1165
1197
|
points: [0, u - m]
|
|
1166
1198
|
}, {
|
|
1167
1199
|
command: "L",
|
|
1168
|
-
points: [
|
|
1200
|
+
points: [_, u - m]
|
|
1169
1201
|
}],
|
|
1170
1202
|
strokeWidth: 1,
|
|
1171
|
-
stroke:
|
|
1203
|
+
stroke: Ht
|
|
1172
1204
|
};
|
|
1173
|
-
|
|
1205
|
+
It.drawWith(l, R), It.drawWith(l, I), l.translate(0, f + 1), Ne.drawWith(l, {
|
|
1174
1206
|
text: e.t("headerFooter.header"),
|
|
1175
|
-
color:
|
|
1176
|
-
}), l.translate(0, u -
|
|
1207
|
+
color: Vt
|
|
1208
|
+
}), l.translate(0, u - f - m), Ne.drawWith(l, {
|
|
1177
1209
|
text: e.t("headerFooter.footer"),
|
|
1178
|
-
color:
|
|
1210
|
+
color: Vt
|
|
1179
1211
|
});
|
|
1180
1212
|
}
|
|
1181
1213
|
l.restore();
|
|
@@ -1192,17 +1224,17 @@ let it = class extends te {
|
|
|
1192
1224
|
return this._context.unit;
|
|
1193
1225
|
}
|
|
1194
1226
|
};
|
|
1195
|
-
it =
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1227
|
+
it = Lr([
|
|
1228
|
+
X(1, O),
|
|
1229
|
+
X(2, ee),
|
|
1230
|
+
X(3, w),
|
|
1231
|
+
X(4, W),
|
|
1232
|
+
X(5, E(L)),
|
|
1233
|
+
X(6, ne),
|
|
1234
|
+
X(7, E(le)),
|
|
1235
|
+
X(8, E(tn))
|
|
1204
1236
|
], it);
|
|
1205
|
-
function
|
|
1237
|
+
function jt() {
|
|
1206
1238
|
return {
|
|
1207
1239
|
dataStream: `\r
|
|
1208
1240
|
`,
|
|
@@ -1219,9 +1251,9 @@ function Ht() {
|
|
|
1219
1251
|
{
|
|
1220
1252
|
startIndex: 0,
|
|
1221
1253
|
paragraphStyle: {
|
|
1222
|
-
spaceAbove: 0,
|
|
1254
|
+
spaceAbove: { v: 0 },
|
|
1223
1255
|
lineSpacing: 1.5,
|
|
1224
|
-
spaceBelow: 0
|
|
1256
|
+
spaceBelow: { v: 0 }
|
|
1225
1257
|
}
|
|
1226
1258
|
}
|
|
1227
1259
|
],
|
|
@@ -1232,108 +1264,108 @@ function Ht() {
|
|
|
1232
1264
|
]
|
|
1233
1265
|
};
|
|
1234
1266
|
}
|
|
1235
|
-
function
|
|
1236
|
-
const
|
|
1267
|
+
function Je(t, e, n, o) {
|
|
1268
|
+
const r = Qe.getInstance(), i = 6, s = t != null ? t : j.generateRandomId(i), a = e === U.DEFAULT_HEADER || e === U.FIRST_PAGE_HEADER || e === U.EVEN_PAGE_HEADER, c = r.insertOp([a ? "headers" : "footers", s], {
|
|
1237
1269
|
[a ? "headerId" : "footerId"]: s,
|
|
1238
|
-
body:
|
|
1270
|
+
body: jt()
|
|
1239
1271
|
});
|
|
1240
1272
|
o.push(c);
|
|
1241
|
-
const d =
|
|
1273
|
+
const d = j.generateRandomId(i), g = r.insertOp([a ? "footers" : "headers", d], {
|
|
1242
1274
|
[a ? "footers" : "headers"]: d,
|
|
1243
|
-
body:
|
|
1275
|
+
body: jt()
|
|
1244
1276
|
});
|
|
1245
|
-
o.push(
|
|
1246
|
-
let h = "defaultHeaderId",
|
|
1277
|
+
o.push(g);
|
|
1278
|
+
let h = "defaultHeaderId", p = "defaultFooterId";
|
|
1247
1279
|
switch (e) {
|
|
1248
|
-
case
|
|
1249
|
-
h = "defaultHeaderId",
|
|
1280
|
+
case U.DEFAULT_HEADER:
|
|
1281
|
+
h = "defaultHeaderId", p = "defaultFooterId";
|
|
1250
1282
|
break;
|
|
1251
|
-
case
|
|
1252
|
-
h = "defaultFooterId",
|
|
1283
|
+
case U.DEFAULT_FOOTER:
|
|
1284
|
+
h = "defaultFooterId", p = "defaultHeaderId";
|
|
1253
1285
|
break;
|
|
1254
|
-
case
|
|
1255
|
-
h = "firstPageHeaderId",
|
|
1286
|
+
case U.FIRST_PAGE_HEADER:
|
|
1287
|
+
h = "firstPageHeaderId", p = "firstPageFooterId";
|
|
1256
1288
|
break;
|
|
1257
|
-
case
|
|
1258
|
-
h = "firstPageFooterId",
|
|
1289
|
+
case U.FIRST_PAGE_FOOTER:
|
|
1290
|
+
h = "firstPageFooterId", p = "firstPageHeaderId";
|
|
1259
1291
|
break;
|
|
1260
|
-
case
|
|
1261
|
-
h = "evenPageHeaderId",
|
|
1292
|
+
case U.EVEN_PAGE_HEADER:
|
|
1293
|
+
h = "evenPageHeaderId", p = "evenPageFooterId";
|
|
1262
1294
|
break;
|
|
1263
|
-
case
|
|
1264
|
-
h = "evenPageFooterId",
|
|
1295
|
+
case U.EVEN_PAGE_FOOTER:
|
|
1296
|
+
h = "evenPageFooterId", p = "evenPageHeaderId";
|
|
1265
1297
|
break;
|
|
1266
1298
|
default:
|
|
1267
1299
|
throw new Error(`Unknown header footer type: ${e}`);
|
|
1268
1300
|
}
|
|
1269
|
-
for (const [l,
|
|
1301
|
+
for (const [l, _] of [[h, s], [p, d]])
|
|
1270
1302
|
if (n[l] != null) {
|
|
1271
|
-
const u =
|
|
1303
|
+
const u = r.replaceOp(["documentStyle", l], n[l], _);
|
|
1272
1304
|
o.push(u);
|
|
1273
1305
|
} else {
|
|
1274
|
-
const u =
|
|
1306
|
+
const u = r.insertOp(["documentStyle", l], _);
|
|
1275
1307
|
o.push(u);
|
|
1276
1308
|
}
|
|
1277
1309
|
return o;
|
|
1278
1310
|
}
|
|
1279
|
-
const be = "doc.command.core-header-footer",
|
|
1311
|
+
const be = "doc.command.core-header-footer", Wt = {
|
|
1280
1312
|
id: be,
|
|
1281
1313
|
type: de.COMMAND,
|
|
1282
1314
|
// eslint-disable-next-line max-lines-per-function
|
|
1283
1315
|
handler: async (t, e) => {
|
|
1284
|
-
var
|
|
1285
|
-
const n = t.get(O), o = t.get(
|
|
1286
|
-
if (
|
|
1316
|
+
var b;
|
|
1317
|
+
const n = t.get(O), o = t.get(w), r = t.get(W), { unitId: i, segmentId: s, createType: a, headerFooterProps: c } = e, d = (b = r.getRenderById(i)) == null ? void 0 : b.with(L), g = o.getUniverDocInstance(i), h = d == null ? void 0 : d.getViewModel();
|
|
1318
|
+
if (g == null || h == null)
|
|
1287
1319
|
return !1;
|
|
1288
|
-
const
|
|
1320
|
+
const p = h.getEditArea(), { documentStyle: l } = g.getSnapshot(), _ = (c == null ? void 0 : c.marginFooter) != null || (c == null ? void 0 : c.marginHeader) != null, u = [{
|
|
1289
1321
|
startOffset: 0,
|
|
1290
1322
|
endOffset: 0,
|
|
1291
1323
|
collapsed: !0
|
|
1292
|
-
}],
|
|
1293
|
-
id:
|
|
1324
|
+
}], f = {
|
|
1325
|
+
id: ht.id,
|
|
1294
1326
|
params: {
|
|
1295
|
-
unitId:
|
|
1327
|
+
unitId: i,
|
|
1296
1328
|
actions: [],
|
|
1297
1329
|
textRanges: u,
|
|
1298
1330
|
debounce: !0
|
|
1299
1331
|
}
|
|
1300
1332
|
};
|
|
1301
|
-
|
|
1302
|
-
const m =
|
|
1303
|
-
return a != null &&
|
|
1304
|
-
const A = c[
|
|
1305
|
-
if (A ===
|
|
1333
|
+
_ && (f.params.noNeedSetTextRange = !0);
|
|
1334
|
+
const m = Qe.getInstance(), R = [];
|
|
1335
|
+
return a != null && Je(s, a, l, R), c != null && Object.keys(c).forEach((T) => {
|
|
1336
|
+
const A = c[T], N = l[T];
|
|
1337
|
+
if (A === N)
|
|
1306
1338
|
return;
|
|
1307
|
-
let
|
|
1308
|
-
if (
|
|
1309
|
-
const
|
|
1310
|
-
|
|
1311
|
-
} else if (
|
|
1312
|
-
const
|
|
1313
|
-
|
|
1339
|
+
let Y;
|
|
1340
|
+
if (N === void 0 ? Y = m.insertOp(["documentStyle", T], A) : Y = m.replaceOp(["documentStyle", T], N, A), R.push(Y), T === "useFirstPageHeaderFooter" && A === S.TRUE && !l.firstPageHeaderId) {
|
|
1341
|
+
const G = p === F.HEADER ? U.FIRST_PAGE_HEADER : U.FIRST_PAGE_FOOTER;
|
|
1342
|
+
Je(s, G, l, R);
|
|
1343
|
+
} else if (T === "evenAndOddHeaders" && A === S.TRUE && !l.evenPageHeaderId) {
|
|
1344
|
+
const G = p === F.HEADER ? U.EVEN_PAGE_HEADER : U.EVEN_PAGE_FOOTER;
|
|
1345
|
+
Je(s, G, l, R);
|
|
1314
1346
|
}
|
|
1315
|
-
}), R.length === 0 ? !1 : (
|
|
1347
|
+
}), R.length === 0 ? !1 : (f.params.actions = R.reduce((T, A) => Qe.compose(T, A), null), !!n.syncExecuteCommand(f.id, f.params));
|
|
1316
1348
|
}
|
|
1317
|
-
},
|
|
1349
|
+
}, mn = {
|
|
1318
1350
|
id: "doc.command.open-header-footer-panel",
|
|
1319
1351
|
type: de.COMMAND,
|
|
1320
|
-
handler: async (t, e) => t.get(O).executeCommand(
|
|
1352
|
+
handler: async (t, e) => t.get(O).executeCommand(fn.id, { value: "open" })
|
|
1321
1353
|
};
|
|
1322
|
-
function
|
|
1354
|
+
function Br(t) {
|
|
1323
1355
|
const e = t.get(O);
|
|
1324
1356
|
return {
|
|
1325
|
-
id:
|
|
1326
|
-
group:
|
|
1327
|
-
type:
|
|
1357
|
+
id: Qn.id,
|
|
1358
|
+
group: x.TOOLBAR_FORMAT,
|
|
1359
|
+
type: y.BUTTON,
|
|
1328
1360
|
icon: "BoldSingle",
|
|
1329
1361
|
title: "Set bold",
|
|
1330
1362
|
tooltip: "toolbar.bold",
|
|
1331
1363
|
positions: [P.TOOLBAR_START],
|
|
1332
1364
|
activated$: new B((n) => {
|
|
1333
|
-
const o = e.onCommandExecuted((
|
|
1365
|
+
const o = e.onCommandExecuted((r) => {
|
|
1334
1366
|
var s;
|
|
1335
|
-
const
|
|
1336
|
-
if (
|
|
1367
|
+
const i = r.id;
|
|
1368
|
+
if (i === V.id || i === ue.id) {
|
|
1337
1369
|
const a = Z(t);
|
|
1338
1370
|
if (a == null)
|
|
1339
1371
|
return;
|
|
@@ -1346,21 +1378,21 @@ function Hi(t) {
|
|
|
1346
1378
|
hidden$: D(t, v.UNIVER_DOC)
|
|
1347
1379
|
};
|
|
1348
1380
|
}
|
|
1349
|
-
function
|
|
1381
|
+
function $r(t) {
|
|
1350
1382
|
const e = t.get(O);
|
|
1351
1383
|
return {
|
|
1352
|
-
id:
|
|
1353
|
-
group:
|
|
1354
|
-
type:
|
|
1384
|
+
id: eo.id,
|
|
1385
|
+
group: x.TOOLBAR_FORMAT,
|
|
1386
|
+
type: y.BUTTON,
|
|
1355
1387
|
icon: "ItalicSingle",
|
|
1356
1388
|
title: "Set italic",
|
|
1357
1389
|
tooltip: "toolbar.italic",
|
|
1358
1390
|
positions: [P.TOOLBAR_START],
|
|
1359
1391
|
activated$: new B((n) => {
|
|
1360
|
-
const o = e.onCommandExecuted((
|
|
1392
|
+
const o = e.onCommandExecuted((r) => {
|
|
1361
1393
|
var s;
|
|
1362
|
-
const
|
|
1363
|
-
if (
|
|
1394
|
+
const i = r.id;
|
|
1395
|
+
if (i === V.id || i === ue.id) {
|
|
1364
1396
|
const a = Z(t);
|
|
1365
1397
|
if (a == null)
|
|
1366
1398
|
return;
|
|
@@ -1373,21 +1405,21 @@ function Vi(t) {
|
|
|
1373
1405
|
hidden$: D(t, v.UNIVER_DOC)
|
|
1374
1406
|
};
|
|
1375
1407
|
}
|
|
1376
|
-
function
|
|
1408
|
+
function Hr(t) {
|
|
1377
1409
|
const e = t.get(O);
|
|
1378
1410
|
return {
|
|
1379
|
-
id:
|
|
1380
|
-
group:
|
|
1381
|
-
type:
|
|
1411
|
+
id: to.id,
|
|
1412
|
+
group: x.TOOLBAR_FORMAT,
|
|
1413
|
+
type: y.BUTTON,
|
|
1382
1414
|
icon: "UnderlineSingle",
|
|
1383
1415
|
title: "Set underline",
|
|
1384
1416
|
tooltip: "toolbar.underline",
|
|
1385
1417
|
positions: [P.TOOLBAR_START],
|
|
1386
1418
|
activated$: new B((n) => {
|
|
1387
|
-
const o = e.onCommandExecuted((
|
|
1419
|
+
const o = e.onCommandExecuted((r) => {
|
|
1388
1420
|
var s;
|
|
1389
|
-
const
|
|
1390
|
-
if (
|
|
1421
|
+
const i = r.id;
|
|
1422
|
+
if (i === V.id || i === ue.id) {
|
|
1391
1423
|
const a = Z(t);
|
|
1392
1424
|
if (a == null)
|
|
1393
1425
|
return;
|
|
@@ -1400,21 +1432,21 @@ function ji(t) {
|
|
|
1400
1432
|
hidden$: D(t, v.UNIVER_DOC)
|
|
1401
1433
|
};
|
|
1402
1434
|
}
|
|
1403
|
-
function
|
|
1435
|
+
function Vr(t) {
|
|
1404
1436
|
const e = t.get(O);
|
|
1405
1437
|
return {
|
|
1406
|
-
id:
|
|
1407
|
-
group:
|
|
1408
|
-
type:
|
|
1438
|
+
id: no.id,
|
|
1439
|
+
group: x.TOOLBAR_FORMAT,
|
|
1440
|
+
type: y.BUTTON,
|
|
1409
1441
|
icon: "StrikethroughSingle",
|
|
1410
1442
|
title: "Set strike through",
|
|
1411
1443
|
tooltip: "toolbar.strikethrough",
|
|
1412
1444
|
positions: [P.TOOLBAR_START],
|
|
1413
1445
|
activated$: new B((n) => {
|
|
1414
|
-
const o = e.onCommandExecuted((
|
|
1446
|
+
const o = e.onCommandExecuted((r) => {
|
|
1415
1447
|
var s;
|
|
1416
|
-
const
|
|
1417
|
-
if (
|
|
1448
|
+
const i = r.id;
|
|
1449
|
+
if (i === V.id || i === ue.id) {
|
|
1418
1450
|
const a = Z(t);
|
|
1419
1451
|
if (a == null)
|
|
1420
1452
|
return;
|
|
@@ -1427,20 +1459,20 @@ function Wi(t) {
|
|
|
1427
1459
|
hidden$: D(t, v.UNIVER_DOC)
|
|
1428
1460
|
};
|
|
1429
1461
|
}
|
|
1430
|
-
function
|
|
1462
|
+
function jr(t) {
|
|
1431
1463
|
const e = t.get(O);
|
|
1432
1464
|
return {
|
|
1433
|
-
id:
|
|
1434
|
-
group:
|
|
1435
|
-
type:
|
|
1465
|
+
id: oo.id,
|
|
1466
|
+
group: x.TOOLBAR_FORMAT,
|
|
1467
|
+
type: y.BUTTON,
|
|
1436
1468
|
icon: "SubscriptSingle",
|
|
1437
1469
|
tooltip: "toolbar.subscript",
|
|
1438
1470
|
positions: [P.TOOLBAR_START],
|
|
1439
1471
|
activated$: new B((n) => {
|
|
1440
|
-
const o = e.onCommandExecuted((
|
|
1472
|
+
const o = e.onCommandExecuted((r) => {
|
|
1441
1473
|
var s;
|
|
1442
|
-
const
|
|
1443
|
-
if (
|
|
1474
|
+
const i = r.id;
|
|
1475
|
+
if (i === V.id || i === ue.id) {
|
|
1444
1476
|
const a = Z(t);
|
|
1445
1477
|
if (a == null)
|
|
1446
1478
|
return;
|
|
@@ -1453,20 +1485,20 @@ function ki(t) {
|
|
|
1453
1485
|
hidden$: D(t, v.UNIVER_DOC)
|
|
1454
1486
|
};
|
|
1455
1487
|
}
|
|
1456
|
-
function
|
|
1488
|
+
function Wr(t) {
|
|
1457
1489
|
const e = t.get(O);
|
|
1458
1490
|
return {
|
|
1459
|
-
id:
|
|
1460
|
-
group:
|
|
1461
|
-
type:
|
|
1491
|
+
id: ro.id,
|
|
1492
|
+
group: x.TOOLBAR_FORMAT,
|
|
1493
|
+
type: y.BUTTON,
|
|
1462
1494
|
icon: "SuperscriptSingle",
|
|
1463
1495
|
tooltip: "toolbar.superscript",
|
|
1464
1496
|
positions: [P.TOOLBAR_START],
|
|
1465
1497
|
activated$: new B((n) => {
|
|
1466
|
-
const o = e.onCommandExecuted((
|
|
1498
|
+
const o = e.onCommandExecuted((r) => {
|
|
1467
1499
|
var s;
|
|
1468
|
-
const
|
|
1469
|
-
if (
|
|
1500
|
+
const i = r.id;
|
|
1501
|
+
if (i === V.id || i === ue.id) {
|
|
1470
1502
|
const a = Z(t);
|
|
1471
1503
|
if (a == null)
|
|
1472
1504
|
return;
|
|
@@ -1479,28 +1511,28 @@ function zi(t) {
|
|
|
1479
1511
|
hidden$: D(t, v.UNIVER_DOC)
|
|
1480
1512
|
};
|
|
1481
1513
|
}
|
|
1482
|
-
function
|
|
1514
|
+
function kr(t) {
|
|
1483
1515
|
const e = t.get(O);
|
|
1484
1516
|
return {
|
|
1485
|
-
id:
|
|
1517
|
+
id: Rt.id,
|
|
1486
1518
|
tooltip: "toolbar.font",
|
|
1487
|
-
group:
|
|
1488
|
-
type:
|
|
1489
|
-
label:
|
|
1519
|
+
group: x.TOOLBAR_FORMAT,
|
|
1520
|
+
type: y.SELECTOR,
|
|
1521
|
+
label: dn,
|
|
1490
1522
|
positions: [P.TOOLBAR_START],
|
|
1491
|
-
selections:
|
|
1523
|
+
selections: vt.map((n) => ({
|
|
1492
1524
|
label: {
|
|
1493
|
-
name:
|
|
1525
|
+
name: un,
|
|
1494
1526
|
hoverable: !0
|
|
1495
1527
|
},
|
|
1496
1528
|
value: n.value
|
|
1497
1529
|
})),
|
|
1498
1530
|
// disabled$: getCurrentSheetDisabled$(accessor),
|
|
1499
1531
|
value$: new B((n) => {
|
|
1500
|
-
const o =
|
|
1532
|
+
const o = vt[0].value, r = e.onCommandExecuted((i) => {
|
|
1501
1533
|
var a;
|
|
1502
|
-
const s =
|
|
1503
|
-
if (s === V.id || s ===
|
|
1534
|
+
const s = i.id;
|
|
1535
|
+
if (s === V.id || s === Rt.id) {
|
|
1504
1536
|
const c = Z(t);
|
|
1505
1537
|
if (c == null)
|
|
1506
1538
|
return;
|
|
@@ -1508,20 +1540,20 @@ function Gi(t) {
|
|
|
1508
1540
|
n.next(d != null ? d : o);
|
|
1509
1541
|
}
|
|
1510
1542
|
});
|
|
1511
|
-
return n.next(o),
|
|
1543
|
+
return n.next(o), r.dispose;
|
|
1512
1544
|
}),
|
|
1513
1545
|
hidden$: D(t, v.UNIVER_DOC)
|
|
1514
1546
|
};
|
|
1515
1547
|
}
|
|
1516
|
-
function
|
|
1548
|
+
function Gr(t) {
|
|
1517
1549
|
const e = t.get(O);
|
|
1518
1550
|
return {
|
|
1519
|
-
id:
|
|
1520
|
-
group:
|
|
1521
|
-
type:
|
|
1551
|
+
id: Ot.id,
|
|
1552
|
+
group: x.TOOLBAR_FORMAT,
|
|
1553
|
+
type: y.SELECTOR,
|
|
1522
1554
|
tooltip: "toolbar.fontSize",
|
|
1523
1555
|
label: {
|
|
1524
|
-
name:
|
|
1556
|
+
name: hn,
|
|
1525
1557
|
props: {
|
|
1526
1558
|
min: 1,
|
|
1527
1559
|
max: 400
|
|
@@ -1529,13 +1561,13 @@ function Yi(t) {
|
|
|
1529
1561
|
}
|
|
1530
1562
|
},
|
|
1531
1563
|
positions: [P.TOOLBAR_START],
|
|
1532
|
-
selections:
|
|
1564
|
+
selections: wn,
|
|
1533
1565
|
// disabled$,
|
|
1534
1566
|
value$: new B((n) => {
|
|
1535
|
-
const
|
|
1567
|
+
const r = e.onCommandExecuted((i) => {
|
|
1536
1568
|
var a;
|
|
1537
|
-
const s =
|
|
1538
|
-
if (s === V.id || s ===
|
|
1569
|
+
const s = i.id;
|
|
1570
|
+
if (s === V.id || s === Ot.id) {
|
|
1539
1571
|
const c = Z(t);
|
|
1540
1572
|
if (c == null)
|
|
1541
1573
|
return;
|
|
@@ -1543,71 +1575,71 @@ function Yi(t) {
|
|
|
1543
1575
|
n.next(d != null ? d : 14);
|
|
1544
1576
|
}
|
|
1545
1577
|
});
|
|
1546
|
-
return n.next(14),
|
|
1578
|
+
return n.next(14), r.dispose;
|
|
1547
1579
|
}),
|
|
1548
1580
|
hidden$: D(t, v.UNIVER_DOC)
|
|
1549
1581
|
};
|
|
1550
1582
|
}
|
|
1551
|
-
function
|
|
1552
|
-
const e = t.get(O), n = t.get(
|
|
1583
|
+
function zr(t) {
|
|
1584
|
+
const e = t.get(O), n = t.get(Qt);
|
|
1553
1585
|
return {
|
|
1554
|
-
id:
|
|
1586
|
+
id: Ct.id,
|
|
1555
1587
|
icon: "FontColor",
|
|
1556
1588
|
tooltip: "toolbar.textColor.main",
|
|
1557
|
-
group:
|
|
1558
|
-
type:
|
|
1589
|
+
group: x.TOOLBAR_FORMAT,
|
|
1590
|
+
type: y.BUTTON_SELECTOR,
|
|
1559
1591
|
positions: [P.TOOLBAR_START],
|
|
1560
1592
|
selections: [
|
|
1561
1593
|
{
|
|
1562
1594
|
label: {
|
|
1563
|
-
name:
|
|
1595
|
+
name: pt,
|
|
1564
1596
|
hoverable: !1
|
|
1565
1597
|
}
|
|
1566
1598
|
}
|
|
1567
1599
|
],
|
|
1568
1600
|
value$: new B((o) => {
|
|
1569
|
-
const
|
|
1570
|
-
if (s.id ===
|
|
1601
|
+
const r = n.getCurrentTheme().textColor, i = e.onCommandExecuted((s) => {
|
|
1602
|
+
if (s.id === Ct.id) {
|
|
1571
1603
|
const a = s.params.value;
|
|
1572
|
-
o.next(a != null ? a :
|
|
1604
|
+
o.next(a != null ? a : r);
|
|
1573
1605
|
}
|
|
1574
1606
|
});
|
|
1575
|
-
return o.next(
|
|
1607
|
+
return o.next(r), i.dispose;
|
|
1576
1608
|
}),
|
|
1577
1609
|
hidden$: D(t, v.UNIVER_DOC)
|
|
1578
1610
|
// disabled$: getCurrentSheetDisabled$(accessor),
|
|
1579
1611
|
};
|
|
1580
1612
|
}
|
|
1581
|
-
function
|
|
1613
|
+
function Yr(t) {
|
|
1582
1614
|
return {
|
|
1583
|
-
id:
|
|
1584
|
-
group:
|
|
1585
|
-
type:
|
|
1615
|
+
id: mn.id,
|
|
1616
|
+
group: x.TOOLBAR_OTHERS,
|
|
1617
|
+
type: y.BUTTON,
|
|
1586
1618
|
icon: "FreezeRowSingle",
|
|
1587
1619
|
tooltip: "toolbar.headerFooter",
|
|
1588
1620
|
positions: [P.TOOLBAR_START],
|
|
1589
|
-
hidden$:
|
|
1621
|
+
hidden$: yo(D(t, v.UNIVER_DOC), Bn(t), (e, n) => e || n)
|
|
1590
1622
|
};
|
|
1591
1623
|
}
|
|
1592
|
-
function
|
|
1624
|
+
function Xr(t) {
|
|
1593
1625
|
const e = t.get(O);
|
|
1594
1626
|
return {
|
|
1595
|
-
id:
|
|
1596
|
-
group:
|
|
1597
|
-
type:
|
|
1627
|
+
id: io.id,
|
|
1628
|
+
group: x.TOOLBAR_LAYOUT,
|
|
1629
|
+
type: y.BUTTON,
|
|
1598
1630
|
icon: "LeftJustifyingSingle",
|
|
1599
1631
|
tooltip: "toolbar.alignLeft",
|
|
1600
1632
|
positions: [P.TOOLBAR_START],
|
|
1601
1633
|
activated$: new B((n) => {
|
|
1602
|
-
const o = e.onCommandExecuted((
|
|
1634
|
+
const o = e.onCommandExecuted((r) => {
|
|
1603
1635
|
var s;
|
|
1604
|
-
const
|
|
1605
|
-
if (
|
|
1606
|
-
const a =
|
|
1636
|
+
const i = r.id;
|
|
1637
|
+
if (i === V.id || i === je.id) {
|
|
1638
|
+
const a = Ge(t);
|
|
1607
1639
|
if (a == null)
|
|
1608
1640
|
return;
|
|
1609
1641
|
const c = (s = a.paragraphStyle) == null ? void 0 : s.horizontalAlign;
|
|
1610
|
-
n.next(c ===
|
|
1642
|
+
n.next(c === we.LEFT);
|
|
1611
1643
|
}
|
|
1612
1644
|
});
|
|
1613
1645
|
return n.next(!1), o.dispose;
|
|
@@ -1615,25 +1647,25 @@ function Zi(t) {
|
|
|
1615
1647
|
hidden$: D(t, v.UNIVER_DOC)
|
|
1616
1648
|
};
|
|
1617
1649
|
}
|
|
1618
|
-
function
|
|
1650
|
+
function Kr(t) {
|
|
1619
1651
|
const e = t.get(O);
|
|
1620
1652
|
return {
|
|
1621
|
-
id:
|
|
1622
|
-
group:
|
|
1623
|
-
type:
|
|
1653
|
+
id: so.id,
|
|
1654
|
+
group: x.TOOLBAR_LAYOUT,
|
|
1655
|
+
type: y.BUTTON,
|
|
1624
1656
|
icon: "HorizontallySingle",
|
|
1625
1657
|
tooltip: "toolbar.alignCenter",
|
|
1626
1658
|
positions: [P.TOOLBAR_START],
|
|
1627
1659
|
activated$: new B((n) => {
|
|
1628
|
-
const o = e.onCommandExecuted((
|
|
1660
|
+
const o = e.onCommandExecuted((r) => {
|
|
1629
1661
|
var s;
|
|
1630
|
-
const
|
|
1631
|
-
if (
|
|
1632
|
-
const a =
|
|
1662
|
+
const i = r.id;
|
|
1663
|
+
if (i === V.id || i === je.id) {
|
|
1664
|
+
const a = Ge(t);
|
|
1633
1665
|
if (a == null)
|
|
1634
1666
|
return;
|
|
1635
1667
|
const c = (s = a.paragraphStyle) == null ? void 0 : s.horizontalAlign;
|
|
1636
|
-
n.next(c ===
|
|
1668
|
+
n.next(c === we.CENTER);
|
|
1637
1669
|
}
|
|
1638
1670
|
});
|
|
1639
1671
|
return n.next(!1), o.dispose;
|
|
@@ -1641,25 +1673,25 @@ function Ji(t) {
|
|
|
1641
1673
|
hidden$: D(t, v.UNIVER_DOC)
|
|
1642
1674
|
};
|
|
1643
1675
|
}
|
|
1644
|
-
function
|
|
1676
|
+
function Zr(t) {
|
|
1645
1677
|
const e = t.get(O);
|
|
1646
1678
|
return {
|
|
1647
|
-
id:
|
|
1648
|
-
group:
|
|
1649
|
-
type:
|
|
1679
|
+
id: ao.id,
|
|
1680
|
+
group: x.TOOLBAR_LAYOUT,
|
|
1681
|
+
type: y.BUTTON,
|
|
1650
1682
|
icon: "RightJustifyingSingle",
|
|
1651
1683
|
tooltip: "toolbar.alignRight",
|
|
1652
1684
|
positions: [P.TOOLBAR_START],
|
|
1653
1685
|
activated$: new B((n) => {
|
|
1654
|
-
const o = e.onCommandExecuted((
|
|
1686
|
+
const o = e.onCommandExecuted((r) => {
|
|
1655
1687
|
var s;
|
|
1656
|
-
const
|
|
1657
|
-
if (
|
|
1658
|
-
const a =
|
|
1688
|
+
const i = r.id;
|
|
1689
|
+
if (i === V.id || i === je.id) {
|
|
1690
|
+
const a = Ge(t);
|
|
1659
1691
|
if (a == null)
|
|
1660
1692
|
return;
|
|
1661
1693
|
const c = (s = a.paragraphStyle) == null ? void 0 : s.horizontalAlign;
|
|
1662
|
-
n.next(c ===
|
|
1694
|
+
n.next(c === we.RIGHT);
|
|
1663
1695
|
}
|
|
1664
1696
|
});
|
|
1665
1697
|
return n.next(!1), o.dispose;
|
|
@@ -1667,25 +1699,25 @@ function qi(t) {
|
|
|
1667
1699
|
hidden$: D(t, v.UNIVER_DOC)
|
|
1668
1700
|
};
|
|
1669
1701
|
}
|
|
1670
|
-
function
|
|
1702
|
+
function Jr(t) {
|
|
1671
1703
|
const e = t.get(O);
|
|
1672
1704
|
return {
|
|
1673
|
-
id:
|
|
1674
|
-
group:
|
|
1675
|
-
type:
|
|
1705
|
+
id: co.id,
|
|
1706
|
+
group: x.TOOLBAR_LAYOUT,
|
|
1707
|
+
type: y.BUTTON,
|
|
1676
1708
|
icon: "AlignTextBothSingle",
|
|
1677
1709
|
tooltip: "toolbar.alignJustify",
|
|
1678
1710
|
positions: [P.TOOLBAR_START],
|
|
1679
1711
|
activated$: new B((n) => {
|
|
1680
|
-
const o = e.onCommandExecuted((
|
|
1712
|
+
const o = e.onCommandExecuted((r) => {
|
|
1681
1713
|
var s;
|
|
1682
|
-
const
|
|
1683
|
-
if (
|
|
1684
|
-
const a =
|
|
1714
|
+
const i = r.id;
|
|
1715
|
+
if (i === V.id || i === je.id) {
|
|
1716
|
+
const a = Ge(t);
|
|
1685
1717
|
if (a == null)
|
|
1686
1718
|
return;
|
|
1687
1719
|
const c = (s = a.paragraphStyle) == null ? void 0 : s.horizontalAlign;
|
|
1688
|
-
n.next(c ===
|
|
1720
|
+
n.next(c === we.JUSTIFIED);
|
|
1689
1721
|
}
|
|
1690
1722
|
});
|
|
1691
1723
|
return n.next(!1), o.dispose;
|
|
@@ -1693,258 +1725,247 @@ function Qi(t) {
|
|
|
1693
1725
|
hidden$: D(t, v.UNIVER_DOC)
|
|
1694
1726
|
};
|
|
1695
1727
|
}
|
|
1696
|
-
function
|
|
1728
|
+
function qr(t) {
|
|
1697
1729
|
return {
|
|
1698
|
-
id:
|
|
1699
|
-
group:
|
|
1700
|
-
type:
|
|
1730
|
+
id: lo.id,
|
|
1731
|
+
group: x.TOOLBAR_LAYOUT,
|
|
1732
|
+
type: y.BUTTON,
|
|
1701
1733
|
icon: "OrderSingle",
|
|
1702
1734
|
tooltip: "toolbar.order",
|
|
1703
1735
|
positions: [P.TOOLBAR_START],
|
|
1704
1736
|
hidden$: D(t, v.UNIVER_DOC)
|
|
1705
1737
|
};
|
|
1706
1738
|
}
|
|
1707
|
-
function
|
|
1739
|
+
function Qr(t) {
|
|
1708
1740
|
return {
|
|
1709
|
-
id:
|
|
1710
|
-
group:
|
|
1711
|
-
type:
|
|
1741
|
+
id: uo.id,
|
|
1742
|
+
group: x.TOOLBAR_LAYOUT,
|
|
1743
|
+
type: y.BUTTON,
|
|
1712
1744
|
icon: "UnorderSingle",
|
|
1713
1745
|
tooltip: "toolbar.unorder",
|
|
1714
1746
|
positions: [P.TOOLBAR_START],
|
|
1715
1747
|
hidden$: D(t, v.UNIVER_DOC)
|
|
1716
1748
|
};
|
|
1717
1749
|
}
|
|
1718
|
-
function
|
|
1750
|
+
function ei(t) {
|
|
1719
1751
|
return {
|
|
1720
|
-
id:
|
|
1721
|
-
type:
|
|
1752
|
+
id: ho.id,
|
|
1753
|
+
type: y.BUTTON,
|
|
1722
1754
|
title: "toolbar.resetColor",
|
|
1723
1755
|
icon: "NoColor",
|
|
1724
|
-
positions:
|
|
1756
|
+
positions: et.id
|
|
1725
1757
|
};
|
|
1726
1758
|
}
|
|
1727
|
-
function
|
|
1728
|
-
const e = t.get(O), n = t.get(
|
|
1759
|
+
function ti(t) {
|
|
1760
|
+
const e = t.get(O), n = t.get(Qt);
|
|
1729
1761
|
return {
|
|
1730
|
-
id:
|
|
1762
|
+
id: et.id,
|
|
1731
1763
|
tooltip: "toolbar.fillColor.main",
|
|
1732
|
-
group:
|
|
1733
|
-
type:
|
|
1764
|
+
group: x.TOOLBAR_FORMAT,
|
|
1765
|
+
type: y.BUTTON_SELECTOR,
|
|
1734
1766
|
positions: [P.TOOLBAR_START],
|
|
1735
1767
|
icon: "PaintBucket",
|
|
1736
1768
|
selections: [
|
|
1737
1769
|
{
|
|
1738
1770
|
label: {
|
|
1739
|
-
name:
|
|
1771
|
+
name: pt,
|
|
1740
1772
|
hoverable: !1
|
|
1741
1773
|
}
|
|
1742
1774
|
}
|
|
1743
1775
|
],
|
|
1744
1776
|
value$: new B((o) => {
|
|
1745
|
-
const
|
|
1746
|
-
if (s.id ===
|
|
1777
|
+
const r = n.getCurrentTheme().primaryColor, i = e.onCommandExecuted((s) => {
|
|
1778
|
+
if (s.id === et.id) {
|
|
1747
1779
|
const a = s.params.value;
|
|
1748
|
-
o.next(a != null ? a :
|
|
1780
|
+
o.next(a != null ? a : r);
|
|
1749
1781
|
}
|
|
1750
1782
|
});
|
|
1751
|
-
return o.next(
|
|
1783
|
+
return o.next(r), i.dispose;
|
|
1752
1784
|
}),
|
|
1753
1785
|
hidden$: D(t, v.UNIVER_DOC)
|
|
1754
1786
|
};
|
|
1755
1787
|
}
|
|
1756
1788
|
function Z(t) {
|
|
1757
1789
|
var d;
|
|
1758
|
-
const e = t.get(
|
|
1759
|
-
if (o == null ||
|
|
1790
|
+
const e = t.get(w), n = t.get(te), o = e.getCurrentUniverDocInstance(), r = n.getActiveRange();
|
|
1791
|
+
if (o == null || r == null)
|
|
1760
1792
|
return;
|
|
1761
|
-
const { startOffset:
|
|
1793
|
+
const { startOffset: i, segmentId: s } = r, a = (d = o.getSelfOrHeaderFooterModel(s).getBody()) == null ? void 0 : d.textRuns;
|
|
1762
1794
|
if (a == null)
|
|
1763
1795
|
return;
|
|
1764
1796
|
let c;
|
|
1765
|
-
for (let
|
|
1766
|
-
const h = a[
|
|
1767
|
-
if (
|
|
1768
|
-
c =
|
|
1797
|
+
for (let g = 0; g < a.length; g++) {
|
|
1798
|
+
const h = a[g], p = a[g + 1];
|
|
1799
|
+
if (p && p.st === p.ed && i === p.st) {
|
|
1800
|
+
c = p;
|
|
1769
1801
|
break;
|
|
1770
1802
|
}
|
|
1771
|
-
if (h.st <=
|
|
1803
|
+
if (h.st <= i && i <= h.ed) {
|
|
1772
1804
|
c = h;
|
|
1773
1805
|
break;
|
|
1774
1806
|
}
|
|
1775
1807
|
}
|
|
1776
1808
|
return c;
|
|
1777
1809
|
}
|
|
1778
|
-
function
|
|
1810
|
+
function Ge(t) {
|
|
1779
1811
|
var d;
|
|
1780
|
-
const e = t.get(
|
|
1781
|
-
if (o == null ||
|
|
1812
|
+
const e = t.get(w), n = t.get(te), o = e.getCurrentUniverDocInstance(), r = n.getActiveRange();
|
|
1813
|
+
if (o == null || r == null)
|
|
1782
1814
|
return;
|
|
1783
|
-
const { startOffset:
|
|
1815
|
+
const { startOffset: i, segmentId: s } = r, a = (d = o.getSelfOrHeaderFooterModel(s).getBody()) == null ? void 0 : d.paragraphs;
|
|
1784
1816
|
if (a == null)
|
|
1785
1817
|
return;
|
|
1786
1818
|
let c = -1;
|
|
1787
|
-
for (const
|
|
1788
|
-
const { startIndex: h } =
|
|
1789
|
-
if (
|
|
1790
|
-
return
|
|
1819
|
+
for (const g of a) {
|
|
1820
|
+
const { startIndex: h } = g;
|
|
1821
|
+
if (i > c && i <= h)
|
|
1822
|
+
return g;
|
|
1791
1823
|
c = h;
|
|
1792
1824
|
}
|
|
1793
1825
|
return null;
|
|
1794
1826
|
}
|
|
1795
|
-
var
|
|
1796
|
-
for (var
|
|
1797
|
-
(s = t[
|
|
1798
|
-
return o &&
|
|
1799
|
-
},
|
|
1800
|
-
let
|
|
1801
|
-
constructor(t, e, n, o,
|
|
1802
|
-
super(), this._config = t, this._injector = e, this._componentManager = n, this._layoutService = o, this.
|
|
1827
|
+
var ni = Object.defineProperty, oi = Object.getOwnPropertyDescriptor, ri = (t, e, n, o) => {
|
|
1828
|
+
for (var r = o > 1 ? void 0 : o ? oi(e, n) : e, i = t.length - 1, s; i >= 0; i--)
|
|
1829
|
+
(s = t[i]) && (r = (o ? s(e, n, r) : s(r)) || r);
|
|
1830
|
+
return o && r && ni(e, n, r), r;
|
|
1831
|
+
}, Ee = (t, e) => (n, o) => e(n, o, t);
|
|
1832
|
+
let me = class extends Q {
|
|
1833
|
+
constructor(t, e, n, o, r) {
|
|
1834
|
+
super(), this._config = t, this._injector = e, this._componentManager = n, this._layoutService = o, this._menuService = r, this._init();
|
|
1803
1835
|
}
|
|
1804
1836
|
_initCustomComponents() {
|
|
1805
1837
|
const t = this._componentManager;
|
|
1806
|
-
this.disposeWithMe(t.register(
|
|
1838
|
+
this.disposeWithMe(t.register(pt, Ao)), this.disposeWithMe(t.register(dn, $n)), this.disposeWithMe(t.register(un, Hn)), this.disposeWithMe(t.register(hn, Vn));
|
|
1807
1839
|
}
|
|
1808
1840
|
_initMenus() {
|
|
1809
1841
|
const { menu: t = {} } = this._config;
|
|
1810
1842
|
[
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1843
|
+
Br,
|
|
1844
|
+
$r,
|
|
1845
|
+
Hr,
|
|
1846
|
+
Vr,
|
|
1847
|
+
jr,
|
|
1848
|
+
Wr,
|
|
1849
|
+
Gr,
|
|
1850
|
+
kr,
|
|
1851
|
+
zr,
|
|
1852
|
+
Yr,
|
|
1853
|
+
Xr,
|
|
1854
|
+
Kr,
|
|
1855
|
+
Zr,
|
|
1856
|
+
Jr,
|
|
1857
|
+
qr,
|
|
1858
|
+
Qr,
|
|
1859
|
+
ei,
|
|
1860
|
+
ti
|
|
1829
1861
|
].forEach((e) => {
|
|
1830
1862
|
this.disposeWithMe(this._menuService.addMenuItem(this._injector.invoke(e), t));
|
|
1831
1863
|
});
|
|
1832
1864
|
}
|
|
1833
1865
|
_init() {
|
|
1834
|
-
this._initCustomComponents(), this._initMenus(), this.
|
|
1835
|
-
}
|
|
1836
|
-
_initDocBackground() {
|
|
1837
|
-
const t = this._univerInstanceService.getAllUnitsForType(v.UNIVER_DOC)[0].getUnitId();
|
|
1838
|
-
if (t == null)
|
|
1839
|
-
return;
|
|
1840
|
-
this._editorService.isEditor(t) || this.disposeWithMe(
|
|
1841
|
-
this._uiPartsService.registerComponent(Ln.CONTENT, () => Mo(bi, this._injector))
|
|
1842
|
-
);
|
|
1866
|
+
this._initCustomComponents(), this._initMenus(), this._initFocusHandler();
|
|
1843
1867
|
}
|
|
1844
1868
|
_initFocusHandler() {
|
|
1845
1869
|
this.disposeWithMe(
|
|
1846
1870
|
this._layoutService.registerFocusHandler(v.UNIVER_DOC, () => {
|
|
1847
|
-
this._injector.get(
|
|
1871
|
+
this._injector.get(ne).focus();
|
|
1848
1872
|
})
|
|
1849
1873
|
);
|
|
1850
1874
|
}
|
|
1851
1875
|
};
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
const ar = {
|
|
1863
|
-
id: lo.id,
|
|
1864
|
-
preconditions: Ao,
|
|
1876
|
+
me = ri([
|
|
1877
|
+
Be($e.Rendered, me),
|
|
1878
|
+
Ee(1, E(Le)),
|
|
1879
|
+
Ee(2, E(tn)),
|
|
1880
|
+
Ee(3, en),
|
|
1881
|
+
Ee(4, jn)
|
|
1882
|
+
], me);
|
|
1883
|
+
const ii = {
|
|
1884
|
+
id: go.id,
|
|
1885
|
+
preconditions: Fo,
|
|
1865
1886
|
binding: H.ENTER
|
|
1866
|
-
},
|
|
1867
|
-
id:
|
|
1868
|
-
preconditions:
|
|
1887
|
+
}, si = {
|
|
1888
|
+
id: po.id,
|
|
1889
|
+
preconditions: k,
|
|
1869
1890
|
binding: H.BACKSPACE
|
|
1870
|
-
},
|
|
1871
|
-
id:
|
|
1872
|
-
preconditions:
|
|
1891
|
+
}, ai = {
|
|
1892
|
+
id: _o.id,
|
|
1893
|
+
preconditions: k,
|
|
1873
1894
|
binding: H.DELETE
|
|
1874
1895
|
};
|
|
1875
1896
|
function ze(t) {
|
|
1876
|
-
return t.getContextValue(
|
|
1897
|
+
return t.getContextValue(Ue) || t.getContextValue(qt);
|
|
1877
1898
|
}
|
|
1878
|
-
const
|
|
1879
|
-
id:
|
|
1899
|
+
const _t = 999, ci = {
|
|
1900
|
+
id: Wn.id,
|
|
1880
1901
|
name: "doc.command.copy",
|
|
1881
1902
|
type: de.COMMAND,
|
|
1882
1903
|
multi: !0,
|
|
1883
|
-
priority:
|
|
1904
|
+
priority: _t,
|
|
1884
1905
|
preconditions: ze,
|
|
1885
|
-
handler: async (t) => t.get(
|
|
1886
|
-
},
|
|
1887
|
-
id:
|
|
1906
|
+
handler: async (t) => t.get(Re).copy()
|
|
1907
|
+
}, li = {
|
|
1908
|
+
id: kn.id,
|
|
1888
1909
|
name: "doc.command.cut",
|
|
1889
1910
|
type: de.COMMAND,
|
|
1890
1911
|
multi: !0,
|
|
1891
|
-
priority:
|
|
1912
|
+
priority: _t,
|
|
1892
1913
|
preconditions: ze,
|
|
1893
|
-
handler: async (t) => t.get(
|
|
1894
|
-
},
|
|
1895
|
-
id:
|
|
1914
|
+
handler: async (t) => t.get(Re).cut()
|
|
1915
|
+
}, di = {
|
|
1916
|
+
id: Gn.id,
|
|
1896
1917
|
name: "doc.command.paste",
|
|
1897
1918
|
type: de.COMMAND,
|
|
1898
1919
|
multi: !0,
|
|
1899
|
-
priority:
|
|
1920
|
+
priority: _t,
|
|
1900
1921
|
preconditions: ze,
|
|
1901
1922
|
handler: async (t) => {
|
|
1902
|
-
const e = t.get(
|
|
1923
|
+
const e = t.get(Re), o = await t.get(ut).read();
|
|
1903
1924
|
return o.length === 0 ? !1 : e.paste(o);
|
|
1904
1925
|
}
|
|
1905
1926
|
};
|
|
1906
|
-
var
|
|
1907
|
-
for (var
|
|
1908
|
-
(s = t[
|
|
1909
|
-
return o &&
|
|
1910
|
-
},
|
|
1911
|
-
let Me = class extends
|
|
1912
|
-
constructor(t, e, n, o,
|
|
1913
|
-
super(), this._commandService = t, this._clipboardInterfaceService = e, this._docClipboardService = n, this._textSelectionRenderManager = o, this._contextService =
|
|
1927
|
+
var ui = Object.defineProperty, hi = Object.getOwnPropertyDescriptor, gi = (t, e, n, o) => {
|
|
1928
|
+
for (var r = o > 1 ? void 0 : o ? hi(e, n) : e, i = t.length - 1, s; i >= 0; i--)
|
|
1929
|
+
(s = t[i]) && (r = (o ? s(e, n, r) : s(r)) || r);
|
|
1930
|
+
return o && r && ui(e, n, r), r;
|
|
1931
|
+
}, he = (t, e) => (n, o) => e(n, o, t);
|
|
1932
|
+
let Me = class extends Se {
|
|
1933
|
+
constructor(t, e, n, o, r) {
|
|
1934
|
+
super(), this._commandService = t, this._clipboardInterfaceService = e, this._docClipboardService = n, this._textSelectionRenderManager = o, this._contextService = r, this._init();
|
|
1914
1935
|
}
|
|
1915
1936
|
_init() {
|
|
1916
|
-
[
|
|
1937
|
+
[ci, li, di].forEach((t) => this.disposeWithMe(this._commandService.registerMultipleCommand(t))), [on, nn].forEach((t) => this.disposeWithMe(this._commandService.registerCommand(t))), this._initLegacyPasteCommand();
|
|
1917
1938
|
}
|
|
1918
1939
|
_initLegacyPasteCommand() {
|
|
1919
1940
|
var t;
|
|
1920
1941
|
(t = this._textSelectionRenderManager) == null || t.onPaste$.pipe(se(this.dispose$)).subscribe((e) => {
|
|
1921
|
-
var
|
|
1942
|
+
var i, s;
|
|
1922
1943
|
if (!ze(this._contextService))
|
|
1923
1944
|
return;
|
|
1924
1945
|
e.event.preventDefault();
|
|
1925
|
-
const n = e.event, o = (
|
|
1926
|
-
this._docClipboardService.legacyPaste(o,
|
|
1946
|
+
const n = e.event, o = (i = n.clipboardData) == null ? void 0 : i.getData("text/html"), r = (s = n.clipboardData) == null ? void 0 : s.getData("text/plain");
|
|
1947
|
+
this._docClipboardService.legacyPaste(o, r);
|
|
1927
1948
|
});
|
|
1928
1949
|
}
|
|
1929
1950
|
};
|
|
1930
|
-
Me =
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1951
|
+
Me = gi([
|
|
1952
|
+
Be($e.Rendered, Me),
|
|
1953
|
+
he(0, O),
|
|
1954
|
+
he(1, ut),
|
|
1955
|
+
he(2, Re),
|
|
1956
|
+
he(3, ne),
|
|
1957
|
+
he(4, Mn)
|
|
1937
1958
|
], Me);
|
|
1938
|
-
var
|
|
1939
|
-
for (var
|
|
1940
|
-
(s = t[
|
|
1941
|
-
return o &&
|
|
1942
|
-
},
|
|
1943
|
-
let
|
|
1944
|
-
constructor(e, n, o,
|
|
1959
|
+
var pi = Object.defineProperty, _i = Object.getOwnPropertyDescriptor, fi = (t, e, n, o) => {
|
|
1960
|
+
for (var r = o > 1 ? void 0 : o ? _i(e, n) : e, i = t.length - 1, s; i >= 0; i--)
|
|
1961
|
+
(s = t[i]) && (r = (o ? s(e, n, r) : s(r)) || r);
|
|
1962
|
+
return o && r && pi(e, n, r), r;
|
|
1963
|
+
}, ge = (t, e) => (n, o) => e(n, o, t);
|
|
1964
|
+
let ye = class extends Q {
|
|
1965
|
+
constructor(e, n, o, r, i) {
|
|
1945
1966
|
super();
|
|
1946
1967
|
C(this, "_initialEditors", /* @__PURE__ */ new Set());
|
|
1947
|
-
this._univerInstanceService = e, this._editorService = n, this._commandService = o, this._textSelectionRenderManager =
|
|
1968
|
+
this._univerInstanceService = e, this._editorService = n, this._commandService = o, this._textSelectionRenderManager = r, this._renderManagerService = i, this._initialize();
|
|
1948
1969
|
}
|
|
1949
1970
|
_initialize() {
|
|
1950
1971
|
this.disposeWithMe(
|
|
@@ -1957,7 +1978,7 @@ let xe = class extends te {
|
|
|
1957
1978
|
}), this._commandExecutedListener(), this._initialSetValue(), this._initialBlur(), this._initialFocus(), this._initialValueChange();
|
|
1958
1979
|
}
|
|
1959
1980
|
_resize(e) {
|
|
1960
|
-
var
|
|
1981
|
+
var I, b, T;
|
|
1961
1982
|
if (e == null)
|
|
1962
1983
|
return;
|
|
1963
1984
|
const n = this._editorService.getEditor(e);
|
|
@@ -1966,25 +1987,25 @@ let xe = class extends te {
|
|
|
1966
1987
|
const o = this._univerInstanceService.getUniverDocInstance(e);
|
|
1967
1988
|
if (!o)
|
|
1968
1989
|
return;
|
|
1969
|
-
const
|
|
1970
|
-
if (n == null || n.render == null ||
|
|
1990
|
+
const r = (I = this._renderManagerService.getRenderById(o.getUnitId())) == null ? void 0 : I.with(L).getSkeleton();
|
|
1991
|
+
if (n == null || n.render == null || r == null || o == null)
|
|
1971
1992
|
return;
|
|
1972
|
-
|
|
1973
|
-
const { marginTop:
|
|
1974
|
-
let { actualHeight: h, actualWidth:
|
|
1975
|
-
h +=
|
|
1976
|
-
const { width: l, height:
|
|
1977
|
-
let
|
|
1978
|
-
const m = Math.max(
|
|
1993
|
+
r.calculate();
|
|
1994
|
+
const { marginTop: i = 0, marginBottom: s = 0, marginLeft: a = 0, marginRight: c = 0 } = o.getSnapshot().documentStyle, { scene: d, mainComponent: g } = n.render;
|
|
1995
|
+
let { actualHeight: h, actualWidth: p } = r.getActualSize();
|
|
1996
|
+
h += i + s, p += a + c;
|
|
1997
|
+
const { width: l, height: _ } = n.getBoundingClientRect(), u = d.getViewport(q.VIEW_MAIN);
|
|
1998
|
+
let f = u == null ? void 0 : u.getScrollBar();
|
|
1999
|
+
const m = Math.max(p, l), R = Math.max(h, _);
|
|
1979
2000
|
d.transformByState({
|
|
1980
2001
|
width: m,
|
|
1981
2002
|
height: R
|
|
1982
|
-
}),
|
|
2003
|
+
}), g == null || g.resize(m, R), n.isSingle() ? p > l ? f == null ? u && new tt(u, { barSize: 8, enableVertical: !1 }) : u == null || u.resetCanvasSizeAndUpdateScrollBar() : (f = null, u == null || u.scrollTo({ x: 0, y: 0 }), (T = u == null ? void 0 : u.getScrollBar()) == null || T.dispose()) : h > _ ? f == null ? u && new tt(u, { enableHorizontal: !1, barSize: 8 }) : u == null || u.resetCanvasSizeAndUpdateScrollBar() : (f = null, u == null || u.scrollTo({ x: 0, y: 0 }), (b = u == null ? void 0 : u.getScrollBar()) == null || b.dispose());
|
|
1983
2004
|
}
|
|
1984
2005
|
_initialSetValue() {
|
|
1985
2006
|
this.disposeWithMe(
|
|
1986
2007
|
this._editorService.setValue$.subscribe((e) => {
|
|
1987
|
-
this._commandService.executeCommand(
|
|
2008
|
+
this._commandService.executeCommand(fo.id, {
|
|
1988
2009
|
unitId: e.editorUnitId,
|
|
1989
2010
|
body: e.body,
|
|
1990
2011
|
segmentId: null
|
|
@@ -1999,8 +2020,8 @@ let xe = class extends te {
|
|
|
1999
2020
|
})
|
|
2000
2021
|
), this.disposeWithMe(
|
|
2001
2022
|
this._textSelectionRenderManager.onBlur$.subscribe(() => {
|
|
2002
|
-
var
|
|
2003
|
-
const e = (
|
|
2023
|
+
var r;
|
|
2024
|
+
const e = (r = this._univerInstanceService.getCurrentUniverDocInstance()) == null ? void 0 : r.getUnitId();
|
|
2004
2025
|
if (e == null)
|
|
2005
2026
|
return;
|
|
2006
2027
|
const n = this._editorService.getEditor(e), o = this._editorService.getFocusEditor();
|
|
@@ -2021,17 +2042,17 @@ let xe = class extends te {
|
|
|
2021
2042
|
"univer-formula-help-param"
|
|
2022
2043
|
];
|
|
2023
2044
|
this.disposeWithMe(
|
|
2024
|
-
|
|
2025
|
-
const
|
|
2026
|
-
if (
|
|
2045
|
+
yt(window, "mousedown").subscribe((o) => {
|
|
2046
|
+
const i = o.target.classList[0] || "";
|
|
2047
|
+
if (yn(i, e)) {
|
|
2027
2048
|
this._editorService.changeSpreadsheetFocusState(!0), o.stopPropagation();
|
|
2028
2049
|
return;
|
|
2029
2050
|
}
|
|
2030
2051
|
this._editorService.changeSpreadsheetFocusState(!1);
|
|
2031
2052
|
})
|
|
2032
2053
|
), this._univerInstanceService.getAllUnitsForType(v.UNIVER_SHEET).forEach((o) => {
|
|
2033
|
-
const
|
|
2034
|
-
s != null &&
|
|
2054
|
+
const r = o.getUnitId(), i = this._renderManagerService.getRenderById(r), s = i == null ? void 0 : i.engine.getCanvas().getCanvasEle();
|
|
2055
|
+
s != null && yt(s, "mousedown").subscribe((a) => {
|
|
2035
2056
|
this._editorService.changeSpreadsheetFocusState(!0), a.stopPropagation();
|
|
2036
2057
|
});
|
|
2037
2058
|
});
|
|
@@ -2059,49 +2080,49 @@ let xe = class extends te {
|
|
|
2059
2080
|
* Listen to document edits to refresh the size of the formula editor.
|
|
2060
2081
|
*/
|
|
2061
2082
|
_commandExecutedListener() {
|
|
2062
|
-
const e = [
|
|
2083
|
+
const e = [ht.id, zn.id];
|
|
2063
2084
|
this.disposeWithMe(
|
|
2064
2085
|
this._commandService.onCommandExecuted((n) => {
|
|
2065
2086
|
if (e.includes(n.id)) {
|
|
2066
|
-
const o = n.params, { unitId:
|
|
2067
|
-
if (this._editorService.isSheetEditor(
|
|
2087
|
+
const o = n.params, { unitId: r } = o;
|
|
2088
|
+
if (this._editorService.isSheetEditor(r))
|
|
2068
2089
|
return;
|
|
2069
|
-
this._resize(
|
|
2090
|
+
this._resize(r), this._valueChange();
|
|
2070
2091
|
}
|
|
2071
2092
|
})
|
|
2072
2093
|
);
|
|
2073
2094
|
}
|
|
2074
2095
|
};
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
],
|
|
2083
|
-
var
|
|
2084
|
-
for (var
|
|
2085
|
-
(s = t[
|
|
2086
|
-
return o &&
|
|
2087
|
-
},
|
|
2088
|
-
let
|
|
2089
|
-
constructor(t, e, n, o,
|
|
2090
|
-
super(), this._context = t, this._commandService = e, this._docSkeletonManagerService = n, this._configService = o, this._editorService =
|
|
2096
|
+
ye = fi([
|
|
2097
|
+
Be($e.Rendered, ye),
|
|
2098
|
+
ge(0, w),
|
|
2099
|
+
ge(1, ee),
|
|
2100
|
+
ge(2, O),
|
|
2101
|
+
ge(3, ne),
|
|
2102
|
+
ge(4, W)
|
|
2103
|
+
], ye);
|
|
2104
|
+
var mi = Object.defineProperty, Si = Object.getOwnPropertyDescriptor, vi = (t, e, n, o) => {
|
|
2105
|
+
for (var r = o > 1 ? void 0 : o ? Si(e, n) : e, i = t.length - 1, s; i >= 0; i--)
|
|
2106
|
+
(s = t[i]) && (r = (o ? s(e, n, r) : s(r)) || r);
|
|
2107
|
+
return o && r && mi(e, n, r), r;
|
|
2108
|
+
}, pe = (t, e) => (n, o) => e(n, o, t);
|
|
2109
|
+
let st = class extends Se {
|
|
2110
|
+
constructor(t, e, n, o, r, i) {
|
|
2111
|
+
super(), this._context = t, this._commandService = e, this._docSkeletonManagerService = n, this._configService = o, this._editorService = r, this._renderManagerService = i, this._addNewRender(), this._initRenderRefresh(), this._initCommandListener();
|
|
2091
2112
|
}
|
|
2092
2113
|
reRender(t) {
|
|
2093
|
-
var
|
|
2094
|
-
const e = (
|
|
2114
|
+
var r, i;
|
|
2115
|
+
const e = (r = this._renderManagerService.getRenderById(t)) == null ? void 0 : r.with(L), n = e == null ? void 0 : e.getSkeleton();
|
|
2095
2116
|
if (!(!n || n.getViewModel().getDataModel().getSnapshot().disabled)) {
|
|
2096
2117
|
if (n.calculate(), this._editorService.isEditor(t)) {
|
|
2097
|
-
(
|
|
2118
|
+
(i = this._context.mainComponent) == null || i.makeDirty();
|
|
2098
2119
|
return;
|
|
2099
2120
|
}
|
|
2100
2121
|
this._recalculateSizeBySkeleton(n);
|
|
2101
2122
|
}
|
|
2102
2123
|
}
|
|
2103
2124
|
_addNewRender() {
|
|
2104
|
-
const { scene: t, engine: e, unit: n } = this._context, o = new
|
|
2125
|
+
const { scene: t, engine: e, unit: n } = this._context, o = new To(q.VIEW_MAIN, t, {
|
|
2105
2126
|
left: 0,
|
|
2106
2127
|
top: 0,
|
|
2107
2128
|
bottom: 0,
|
|
@@ -2114,13 +2135,13 @@ let rt = class extends ve {
|
|
|
2114
2135
|
const c = s;
|
|
2115
2136
|
if (c.ctrlKey) {
|
|
2116
2137
|
const d = Math.abs(c.deltaX);
|
|
2117
|
-
let
|
|
2118
|
-
|
|
2138
|
+
let g = d < 40 ? 0.2 : d < 80 ? 0.4 : 0.2;
|
|
2139
|
+
g *= c.deltaY > 0 ? -1 : 1, t.scaleX < 1 && (g /= 2), t.scaleX + g > 4 ? t.scale(4, 4) : t.scaleX + g < 0.1 ? t.scale(0.1, 0.1) : c.preventDefault();
|
|
2119
2140
|
} else
|
|
2120
2141
|
o.onMouseWheel(c, a);
|
|
2121
|
-
}), this._configService.getConfig("hasScroll") !== !1 && new
|
|
2122
|
-
new
|
|
2123
|
-
new
|
|
2142
|
+
}), this._configService.getConfig("hasScroll") !== !1 && new tt(o), t.addLayer(
|
|
2143
|
+
new bt(t, [], Ye),
|
|
2144
|
+
new bt(t, [], mo)
|
|
2124
2145
|
), this._addComponent(), n.getShouldRenderLoopImmediately() && e.runRenderLoop(() => {
|
|
2125
2146
|
t.render();
|
|
2126
2147
|
});
|
|
@@ -2129,10 +2150,10 @@ let rt = class extends ve {
|
|
|
2129
2150
|
const { scene: t, unit: e, components: n } = this._context, o = {
|
|
2130
2151
|
pageMarginLeft: e.documentStyle.marginLeft || 0,
|
|
2131
2152
|
pageMarginTop: e.documentStyle.marginTop || 0
|
|
2132
|
-
},
|
|
2133
|
-
|
|
2134
|
-
const
|
|
2135
|
-
|
|
2153
|
+
}, r = new Io(oe.MAIN, void 0, o);
|
|
2154
|
+
r.zIndex = Et;
|
|
2155
|
+
const i = new bo(oe.BACKGROUND, void 0, o);
|
|
2156
|
+
i.zIndex = Et, this._context.mainComponent = r, n.set(oe.MAIN, r), n.set(oe.BACKGROUND, i), t.addObjects([r], Ye), t.addObjects([i], So), this._editorService.getEditor(e.getUnitId()) == null && t.enableLayerCache(Ye);
|
|
2136
2157
|
}
|
|
2137
2158
|
_initRenderRefresh() {
|
|
2138
2159
|
this._docSkeletonManagerService.currentSkeletonBefore$.pipe(se(this.dispose$)).subscribe((t) => {
|
|
@@ -2142,11 +2163,11 @@ let rt = class extends ve {
|
|
|
2142
2163
|
_create(t) {
|
|
2143
2164
|
if (!t)
|
|
2144
2165
|
return;
|
|
2145
|
-
const { mainComponent: e, components: n } = this._context, o = e,
|
|
2146
|
-
o.changeSkeleton(t),
|
|
2166
|
+
const { mainComponent: e, components: n } = this._context, o = e, r = n.get(oe.BACKGROUND);
|
|
2167
|
+
o.changeSkeleton(t), r.changeSkeleton(t), this._recalculateSizeBySkeleton(t);
|
|
2147
2168
|
}
|
|
2148
2169
|
_initCommandListener() {
|
|
2149
|
-
const t = [
|
|
2170
|
+
const t = [ht.id];
|
|
2150
2171
|
this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
|
|
2151
2172
|
if (t.includes(e.id)) {
|
|
2152
2173
|
const n = e.params, { unitId: o } = n;
|
|
@@ -2155,33 +2176,33 @@ let rt = class extends ve {
|
|
|
2155
2176
|
}));
|
|
2156
2177
|
}
|
|
2157
2178
|
_recalculateSizeBySkeleton(t) {
|
|
2158
|
-
var
|
|
2159
|
-
const { mainComponent: e, scene: n, unitId: o, components:
|
|
2179
|
+
var g;
|
|
2180
|
+
const { mainComponent: e, scene: n, unitId: o, components: r } = this._context, i = e, s = r.get(oe.BACKGROUND), a = (g = t.getSkeletonData()) == null ? void 0 : g.pages;
|
|
2160
2181
|
if (a == null)
|
|
2161
2182
|
return;
|
|
2162
2183
|
let c = 0, d = 0;
|
|
2163
|
-
for (let h = 0,
|
|
2164
|
-
const l = a[h], { pageWidth:
|
|
2165
|
-
|
|
2184
|
+
for (let h = 0, p = a.length; h < p; h++) {
|
|
2185
|
+
const l = a[h], { pageWidth: _, pageHeight: u } = l;
|
|
2186
|
+
i.pageLayoutType === Ae.VERTICAL ? (d += u, d += i.pageMarginTop, h === p - 1 && (d += i.pageMarginTop), c = Math.max(c, _)) : i.pageLayoutType === Ae.HORIZONTAL && (c += _, h !== p - 1 && (c += i.pageMarginLeft), d = Math.max(d, u));
|
|
2166
2187
|
}
|
|
2167
|
-
|
|
2188
|
+
i.resize(c, d), s.resize(c, d), this._editorService.isEditor(o) || n.resize(c, d);
|
|
2168
2189
|
}
|
|
2169
2190
|
};
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
],
|
|
2177
|
-
var
|
|
2178
|
-
for (var
|
|
2179
|
-
(s = t[
|
|
2180
|
-
return o &&
|
|
2191
|
+
st = vi([
|
|
2192
|
+
pe(1, O),
|
|
2193
|
+
pe(2, E(L)),
|
|
2194
|
+
pe(3, xn),
|
|
2195
|
+
pe(4, ee),
|
|
2196
|
+
pe(5, W)
|
|
2197
|
+
], st);
|
|
2198
|
+
var Ri = Object.defineProperty, Oi = Object.getOwnPropertyDescriptor, Ci = (t, e, n, o) => {
|
|
2199
|
+
for (var r = o > 1 ? void 0 : o ? Oi(e, n) : e, i = t.length - 1, s; i >= 0; i--)
|
|
2200
|
+
(s = t[i]) && (r = (o ? s(e, n, r) : s(r)) || r);
|
|
2201
|
+
return o && r && Ri(e, n, r), r;
|
|
2181
2202
|
}, _e = (t, e) => (n, o) => e(n, o, t);
|
|
2182
|
-
let
|
|
2183
|
-
constructor(t, e, n, o,
|
|
2184
|
-
super(), this._context = t, this._docSkeletonManagerService = e, this._univerInstanceService = n, this._commandService = o, this._textSelectionManagerService =
|
|
2203
|
+
let at = class extends Q {
|
|
2204
|
+
constructor(t, e, n, o, r, i) {
|
|
2205
|
+
super(), this._context = t, this._docSkeletonManagerService = e, this._univerInstanceService = n, this._commandService = o, this._textSelectionManagerService = r, this._editorService = i, this._init();
|
|
2185
2206
|
}
|
|
2186
2207
|
_init() {
|
|
2187
2208
|
this._initSkeletonListener(), this._initCommandExecutedListener(), this._initRenderRefresher(), setTimeout(() => this._updateViewZoom(1, !0), 20);
|
|
@@ -2194,17 +2215,17 @@ let st = class extends te {
|
|
|
2194
2215
|
this._editorService.isEditor(e) || this.disposeWithMe(n.onMouseWheel$.subscribeEvent((o) => {
|
|
2195
2216
|
if (!o.ctrlKey)
|
|
2196
2217
|
return;
|
|
2197
|
-
const
|
|
2198
|
-
if (!
|
|
2218
|
+
const r = this._univerInstanceService.getCurrentUniverDocInstance();
|
|
2219
|
+
if (!r)
|
|
2199
2220
|
return;
|
|
2200
|
-
const
|
|
2201
|
-
let s =
|
|
2221
|
+
const i = Math.abs(o.deltaX);
|
|
2222
|
+
let s = i < 40 ? 0.2 : i < 80 ? 0.4 : 0.2;
|
|
2202
2223
|
s *= o.deltaY > 0 ? -1 : 1, n.scaleX < 1 && (s /= 2);
|
|
2203
|
-
const a =
|
|
2224
|
+
const a = r.zoomRatio;
|
|
2204
2225
|
let c = +Number.parseFloat(`${a + s}`).toFixed(1);
|
|
2205
|
-
c = c >= 4 ? 4 : c <= 0.1 ? 0.1 : c, this._commandService.executeCommand(
|
|
2226
|
+
c = c >= 4 ? 4 : c <= 0.1 ? 0.1 : c, this._commandService.executeCommand(vo.id, {
|
|
2206
2227
|
zoomRatio: c,
|
|
2207
|
-
unitId:
|
|
2228
|
+
unitId: r.getUnitId()
|
|
2208
2229
|
}), o.preventDefault();
|
|
2209
2230
|
}));
|
|
2210
2231
|
});
|
|
@@ -2220,34 +2241,34 @@ let st = class extends te {
|
|
|
2220
2241
|
}));
|
|
2221
2242
|
}
|
|
2222
2243
|
_initCommandExecutedListener() {
|
|
2223
|
-
const t = [
|
|
2244
|
+
const t = [De.id];
|
|
2224
2245
|
this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
|
|
2225
2246
|
if (t.includes(e.id)) {
|
|
2226
2247
|
const n = this._univerInstanceService.getCurrentUniverDocInstance();
|
|
2227
2248
|
if (!n) return;
|
|
2228
|
-
const o = e.params, { unitId:
|
|
2229
|
-
if (
|
|
2249
|
+
const o = e.params, { unitId: r } = o;
|
|
2250
|
+
if (r !== n.getUnitId())
|
|
2230
2251
|
return;
|
|
2231
|
-
const
|
|
2232
|
-
this._updateViewZoom(
|
|
2252
|
+
const i = n.zoomRatio || 1;
|
|
2253
|
+
this._updateViewZoom(i);
|
|
2233
2254
|
}
|
|
2234
2255
|
}));
|
|
2235
2256
|
}
|
|
2236
2257
|
_updateViewZoom(t, e = !0) {
|
|
2237
2258
|
var o;
|
|
2238
|
-
const n =
|
|
2259
|
+
const n = J(this._context);
|
|
2239
2260
|
n.scene.scale(t, t), this._calculatePagePosition(n, t), e && this._textSelectionManagerService.refreshSelection(), (o = n.scene.getTransformer()) == null || o.clearSelectedObjects();
|
|
2240
2261
|
}
|
|
2241
2262
|
_calculatePagePosition(t, e) {
|
|
2242
|
-
const { document: n, scene: o, docBackground:
|
|
2243
|
-
if (
|
|
2263
|
+
const { document: n, scene: o, docBackground: r } = t, i = o == null ? void 0 : o.getParent(), { width: s, height: a, pageMarginLeft: c, pageMarginTop: d } = n;
|
|
2264
|
+
if (i == null || s === Number.POSITIVE_INFINITY || a === Number.POSITIVE_INFINITY)
|
|
2244
2265
|
return;
|
|
2245
|
-
const { width:
|
|
2246
|
-
let
|
|
2247
|
-
|
|
2248
|
-
const m = o.getViewport(
|
|
2249
|
-
if (
|
|
2250
|
-
const R = m.transViewportScroll2ScrollValue(
|
|
2266
|
+
const { width: g, height: h } = i;
|
|
2267
|
+
let p = 0, l = 0, _ = 0, u = 0, f = Number.POSITIVE_INFINITY;
|
|
2268
|
+
g > (s + c * 2) * e ? (p = g / 2 - s * e / 2, p /= e, _ = (g - c * 2) / e, f = 0) : (p = c, _ = s + c * 2, f = (_ - g / e) / 2), h > a ? (l = h / 2 - a / 2, u = (h - d * 2) / e) : (l = d, u = a + d * 2), o.resize(_, u + 200), n.translate(p, l), r.translate(p, l);
|
|
2269
|
+
const m = o.getViewport(q.VIEW_MAIN);
|
|
2270
|
+
if (f !== Number.POSITIVE_INFINITY && m != null) {
|
|
2271
|
+
const R = m.transViewportScroll2ScrollValue(f, 0).x;
|
|
2251
2272
|
m.scrollTo({
|
|
2252
2273
|
x: R
|
|
2253
2274
|
});
|
|
@@ -2255,76 +2276,76 @@ let st = class extends te {
|
|
|
2255
2276
|
return this;
|
|
2256
2277
|
}
|
|
2257
2278
|
};
|
|
2258
|
-
|
|
2259
|
-
_e(1,
|
|
2260
|
-
_e(2,
|
|
2279
|
+
at = Ci([
|
|
2280
|
+
_e(1, E(L)),
|
|
2281
|
+
_e(2, w),
|
|
2261
2282
|
_e(3, O),
|
|
2262
|
-
_e(4,
|
|
2263
|
-
_e(5,
|
|
2264
|
-
],
|
|
2265
|
-
var
|
|
2266
|
-
for (var
|
|
2267
|
-
(s = t[
|
|
2268
|
-
return o &&
|
|
2269
|
-
},
|
|
2270
|
-
let
|
|
2271
|
-
constructor(e, n, o,
|
|
2283
|
+
_e(4, E(te)),
|
|
2284
|
+
_e(5, ee)
|
|
2285
|
+
], at);
|
|
2286
|
+
var Ei = Object.defineProperty, Ti = Object.getOwnPropertyDescriptor, Ii = (t, e, n, o) => {
|
|
2287
|
+
for (var r = o > 1 ? void 0 : o ? Ti(e, n) : e, i = t.length - 1, s; i >= 0; i--)
|
|
2288
|
+
(s = t[i]) && (r = (o ? s(e, n, r) : s(r)) || r);
|
|
2289
|
+
return o && r && Ei(e, n, r), r;
|
|
2290
|
+
}, ie = (t, e) => (n, o) => e(n, o, t);
|
|
2291
|
+
let ct = class extends Q {
|
|
2292
|
+
constructor(e, n, o, r, i, s, a) {
|
|
2272
2293
|
super();
|
|
2273
2294
|
C(this, "_loadedMap", /* @__PURE__ */ new WeakSet());
|
|
2274
|
-
this._context = e, this._commandService = n, this._editorService = o, this._instanceSrv =
|
|
2295
|
+
this._context = e, this._commandService = n, this._editorService = o, this._instanceSrv = r, this._textSelectionRenderManager = i, this._docSkeletonManagerService = s, this._textSelectionManagerService = a, this._initialize();
|
|
2275
2296
|
}
|
|
2276
2297
|
_initialize() {
|
|
2277
2298
|
this._init(), this._skeletonListener(), this._commandExecutedListener();
|
|
2278
2299
|
}
|
|
2279
2300
|
_init() {
|
|
2280
|
-
const { unitId: e } = this._context, n =
|
|
2301
|
+
const { unitId: e } = this._context, n = J(this._context);
|
|
2281
2302
|
n == null || n.document == null || this._loadedMap.has(n.document) || (this._initialMain(e), this._loadedMap.add(n.document));
|
|
2282
2303
|
}
|
|
2283
2304
|
// eslint-disable-next-line max-lines-per-function
|
|
2284
2305
|
_initialMain(e) {
|
|
2285
|
-
const n =
|
|
2306
|
+
const n = J(this._context), { document: o, scene: r } = n;
|
|
2286
2307
|
this.disposeWithMe(o.onPointerEnter$.subscribeEvent(() => {
|
|
2287
|
-
this._isEditorReadOnly(e) || (o.cursor =
|
|
2308
|
+
this._isEditorReadOnly(e) || (o.cursor = Mt.TEXT);
|
|
2288
2309
|
})), this.disposeWithMe(o.onPointerLeave$.subscribeEvent(() => {
|
|
2289
|
-
o.cursor =
|
|
2290
|
-
})), this.disposeWithMe(o.onPointerDown$.subscribeEvent((
|
|
2310
|
+
o.cursor = Mt.DEFAULT, r.resetCursor();
|
|
2311
|
+
})), this.disposeWithMe(o.onPointerDown$.subscribeEvent((i, s) => {
|
|
2291
2312
|
if (this._isEditorReadOnly(e))
|
|
2292
2313
|
return;
|
|
2293
2314
|
const a = this._instanceSrv.getCurrentUnitForType(v.UNIVER_DOC);
|
|
2294
2315
|
(a == null ? void 0 : a.getUnitId()) !== e && this._instanceSrv.setCurrentUnitForType(e);
|
|
2295
|
-
const c = this._docSkeletonManagerService.getSkeleton(), { offsetX: d, offsetY:
|
|
2316
|
+
const c = this._docSkeletonManagerService.getSkeleton(), { offsetX: d, offsetY: g } = i, h = this._getTransformCoordForDocumentOffset(d, g);
|
|
2296
2317
|
if (h != null) {
|
|
2297
2318
|
const {
|
|
2298
|
-
pageLayoutType:
|
|
2319
|
+
pageLayoutType: p = Ae.VERTICAL,
|
|
2299
2320
|
pageMarginLeft: l,
|
|
2300
|
-
pageMarginTop:
|
|
2321
|
+
pageMarginTop: _
|
|
2301
2322
|
} = o.getOffsetConfig(), { editArea: u } = c.findEditAreaByCoord(
|
|
2302
2323
|
h,
|
|
2303
|
-
|
|
2324
|
+
p,
|
|
2304
2325
|
l,
|
|
2305
|
-
|
|
2306
|
-
),
|
|
2307
|
-
m !==
|
|
2326
|
+
_
|
|
2327
|
+
), f = this._docSkeletonManagerService.getViewModel(), m = f.getEditArea();
|
|
2328
|
+
m !== F.BODY && u !== F.BODY && u !== m && f.setEditArea(u);
|
|
2308
2329
|
}
|
|
2309
|
-
if (this._textSelectionRenderManager.eventTrigger(
|
|
2330
|
+
if (this._textSelectionRenderManager.eventTrigger(i), this._editorService.getEditor(e)) {
|
|
2310
2331
|
this._setEditorFocus(e);
|
|
2311
|
-
const { offsetX:
|
|
2332
|
+
const { offsetX: p, offsetY: l } = i;
|
|
2312
2333
|
setTimeout(() => {
|
|
2313
|
-
this._setEditorFocus(e), this._textSelectionRenderManager.setCursorManually(
|
|
2334
|
+
this._setEditorFocus(e), this._textSelectionRenderManager.setCursorManually(p, l);
|
|
2314
2335
|
}, 0);
|
|
2315
2336
|
}
|
|
2316
|
-
|
|
2317
|
-
})), this.disposeWithMe(o.onDblclick$.subscribeEvent((
|
|
2318
|
-
this._isEditorReadOnly(e) || this._textSelectionRenderManager.handleDblClick(
|
|
2319
|
-
})), this.disposeWithMe(o.onTripleClick$.subscribeEvent((
|
|
2320
|
-
this._isEditorReadOnly(e) || this._textSelectionRenderManager.handleTripleClick(
|
|
2337
|
+
i.button !== 2 && s.stopPropagation();
|
|
2338
|
+
})), this.disposeWithMe(o.onDblclick$.subscribeEvent((i) => {
|
|
2339
|
+
this._isEditorReadOnly(e) || this._textSelectionRenderManager.handleDblClick(i);
|
|
2340
|
+
})), this.disposeWithMe(o.onTripleClick$.subscribeEvent((i) => {
|
|
2341
|
+
this._isEditorReadOnly(e) || this._textSelectionRenderManager.handleTripleClick(i);
|
|
2321
2342
|
}));
|
|
2322
2343
|
}
|
|
2323
2344
|
_getTransformCoordForDocumentOffset(e, n) {
|
|
2324
|
-
const o =
|
|
2345
|
+
const o = J(this._context), { document: r, scene: i } = o, { documentTransform: s } = r.getOffsetConfig(), a = i.getViewports()[0];
|
|
2325
2346
|
if (a == null)
|
|
2326
2347
|
return;
|
|
2327
|
-
const c = a.transformVector2SceneCoord(
|
|
2348
|
+
const c = a.transformVector2SceneCoord(sn.FromArray([e, n]));
|
|
2328
2349
|
return s.clone().invert().applyPoint(c);
|
|
2329
2350
|
}
|
|
2330
2351
|
_isEditorReadOnly(e) {
|
|
@@ -2335,13 +2356,13 @@ let at = class extends te {
|
|
|
2335
2356
|
this._editorService.focusStyle(e);
|
|
2336
2357
|
}
|
|
2337
2358
|
_commandExecutedListener() {
|
|
2338
|
-
const e = [
|
|
2359
|
+
const e = [De.id];
|
|
2339
2360
|
this.disposeWithMe(
|
|
2340
2361
|
this._commandService.onCommandExecuted((n) => {
|
|
2341
2362
|
var o;
|
|
2342
2363
|
if (e.includes(n.id)) {
|
|
2343
|
-
const
|
|
2344
|
-
if (
|
|
2364
|
+
const r = n.params, { unitId: i } = r, s = (o = this._textSelectionManagerService.getCurrentSelection()) == null ? void 0 : o.unitId;
|
|
2365
|
+
if (i !== s)
|
|
2345
2366
|
return;
|
|
2346
2367
|
this._textSelectionManagerService.refreshSelection();
|
|
2347
2368
|
}
|
|
@@ -2353,11 +2374,11 @@ let at = class extends te {
|
|
|
2353
2374
|
this._docSkeletonManagerService.currentSkeleton$.subscribe((e) => {
|
|
2354
2375
|
if (e == null)
|
|
2355
2376
|
return;
|
|
2356
|
-
const { scene: n, mainComponent: o, unitId:
|
|
2377
|
+
const { scene: n, mainComponent: o, unitId: r } = this._context;
|
|
2357
2378
|
this._textSelectionRenderManager.changeRuntime(e, n, o), this._textSelectionManagerService.setCurrentSelectionNotRefresh({
|
|
2358
|
-
unitId:
|
|
2379
|
+
unitId: r,
|
|
2359
2380
|
subUnitId: ""
|
|
2360
|
-
}),
|
|
2381
|
+
}), Pn(r) || this._textSelectionManagerService.replaceTextRanges([
|
|
2361
2382
|
{
|
|
2362
2383
|
startOffset: 0,
|
|
2363
2384
|
endOffset: 0
|
|
@@ -2367,21 +2388,21 @@ let at = class extends te {
|
|
|
2367
2388
|
);
|
|
2368
2389
|
}
|
|
2369
2390
|
};
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
],
|
|
2378
|
-
var
|
|
2379
|
-
for (var
|
|
2380
|
-
(s = t[
|
|
2381
|
-
return o &&
|
|
2382
|
-
},
|
|
2383
|
-
function
|
|
2384
|
-
const n =
|
|
2391
|
+
ct = Ii([
|
|
2392
|
+
ie(1, O),
|
|
2393
|
+
ie(2, ee),
|
|
2394
|
+
ie(3, w),
|
|
2395
|
+
ie(4, ne),
|
|
2396
|
+
ie(5, E(L)),
|
|
2397
|
+
ie(6, E(te))
|
|
2398
|
+
], ct);
|
|
2399
|
+
var bi = Object.defineProperty, Mi = Object.getOwnPropertyDescriptor, yi = (t, e, n, o) => {
|
|
2400
|
+
for (var r = o > 1 ? void 0 : o ? Mi(e, n) : e, i = t.length - 1, s; i >= 0; i--)
|
|
2401
|
+
(s = t[i]) && (r = (o ? s(e, n, r) : s(r)) || r);
|
|
2402
|
+
return o && r && bi(e, n, r), r;
|
|
2403
|
+
}, Te = (t, e) => (n, o) => e(n, o, t);
|
|
2404
|
+
function kt(t, e) {
|
|
2405
|
+
const n = Gt(t.left, t.top, e), o = Gt(t.right, t.bottom, e);
|
|
2385
2406
|
return {
|
|
2386
2407
|
left: n.x,
|
|
2387
2408
|
top: n.y,
|
|
@@ -2389,79 +2410,79 @@ function jt(t, e) {
|
|
|
2389
2410
|
bottom: o.y
|
|
2390
2411
|
};
|
|
2391
2412
|
}
|
|
2392
|
-
function
|
|
2393
|
-
const { scaleX: o, scaleY:
|
|
2394
|
-
if (!
|
|
2413
|
+
function Gt(t, e, n) {
|
|
2414
|
+
const { scaleX: o, scaleY: r } = n.getAncestorScale(), i = n.getViewport(q.VIEW_MAIN);
|
|
2415
|
+
if (!i)
|
|
2395
2416
|
return {
|
|
2396
2417
|
x: t,
|
|
2397
2418
|
y: e
|
|
2398
2419
|
};
|
|
2399
|
-
const { viewportScrollX: s, viewportScrollY: a } =
|
|
2420
|
+
const { viewportScrollX: s, viewportScrollY: a } = i, c = (t - s) * o, d = (e - a) * r;
|
|
2400
2421
|
return {
|
|
2401
2422
|
x: c,
|
|
2402
2423
|
y: d
|
|
2403
2424
|
};
|
|
2404
2425
|
}
|
|
2405
|
-
let
|
|
2426
|
+
let lt = class extends Q {
|
|
2406
2427
|
constructor(t, e, n, o) {
|
|
2407
2428
|
super(), this._globalPopupManagerService = t, this._renderManagerService = e, this._univerInstanceService = n, this._commandService = o;
|
|
2408
2429
|
}
|
|
2409
2430
|
// #region attach to object
|
|
2410
2431
|
_createObjectPositionObserver(t, e) {
|
|
2411
2432
|
const n = () => {
|
|
2412
|
-
const { scene: a, engine: c } = e, { left: d, top:
|
|
2433
|
+
const { scene: a, engine: c } = e, { left: d, top: g, width: h, height: p } = t, l = {
|
|
2413
2434
|
left: d,
|
|
2414
2435
|
right: d + h,
|
|
2415
|
-
top:
|
|
2416
|
-
bottom:
|
|
2417
|
-
},
|
|
2436
|
+
top: g,
|
|
2437
|
+
bottom: g + p
|
|
2438
|
+
}, _ = kt(l, a), u = c.getCanvasElement().getBoundingClientRect().top;
|
|
2418
2439
|
return {
|
|
2419
|
-
left:
|
|
2420
|
-
right:
|
|
2421
|
-
top:
|
|
2422
|
-
bottom:
|
|
2440
|
+
left: _.left,
|
|
2441
|
+
right: _.right,
|
|
2442
|
+
top: _.top + u,
|
|
2443
|
+
bottom: _.bottom + u
|
|
2423
2444
|
};
|
|
2424
|
-
}, o = n(),
|
|
2425
|
-
|
|
2426
|
-
a.id ===
|
|
2445
|
+
}, o = n(), r = new xt(o), i = new St();
|
|
2446
|
+
i.add(this._commandService.onCommandExecuted((a) => {
|
|
2447
|
+
a.id === De.id && r.next(n());
|
|
2427
2448
|
}));
|
|
2428
|
-
const s = e.scene.getViewport(
|
|
2429
|
-
return s &&
|
|
2430
|
-
|
|
2449
|
+
const s = e.scene.getViewport(q.VIEW_MAIN);
|
|
2450
|
+
return s && i.add(s.onScrollAfter$.subscribeEvent(() => {
|
|
2451
|
+
r.next(n());
|
|
2431
2452
|
})), {
|
|
2432
2453
|
position: o,
|
|
2433
|
-
position$:
|
|
2434
|
-
disposable:
|
|
2454
|
+
position$: r,
|
|
2455
|
+
disposable: i
|
|
2435
2456
|
};
|
|
2436
2457
|
}
|
|
2437
2458
|
_createRangePositionObserver(t, e) {
|
|
2438
2459
|
var a;
|
|
2439
2460
|
const n = () => {
|
|
2440
|
-
const { scene: c, mainComponent: d, engine:
|
|
2441
|
-
if (!l || !
|
|
2461
|
+
const { scene: c, mainComponent: d, engine: g } = e, h = e.with(L).getSkeleton(), p = h.findNodePositionByCharIndex(t.startOffset), l = h.findNodePositionByCharIndex(t.endOffset), _ = d;
|
|
2462
|
+
if (!l || !p)
|
|
2442
2463
|
return;
|
|
2443
|
-
const u =
|
|
2444
|
-
return
|
|
2445
|
-
left:
|
|
2446
|
-
right:
|
|
2447
|
-
top:
|
|
2448
|
-
bottom:
|
|
2464
|
+
const u = _.getOffsetConfig(), { docsLeft: f, docsTop: m } = u, R = g.getCanvasElement().getBoundingClientRect().top, I = new rn(u, h), { borderBoxPointGroup: b } = I.getRangePointData(p, l);
|
|
2465
|
+
return Mo(b).map((N) => kt(N, c)).map((N) => ({
|
|
2466
|
+
left: N.left + f,
|
|
2467
|
+
right: N.right + f,
|
|
2468
|
+
top: N.top + m + R,
|
|
2469
|
+
bottom: N.bottom + m + R
|
|
2449
2470
|
}));
|
|
2450
|
-
}, o = (a = n()) != null ? a : [],
|
|
2451
|
-
|
|
2452
|
-
if (c.id ===
|
|
2471
|
+
}, o = (a = n()) != null ? a : [], r = new xt(o), i = new St();
|
|
2472
|
+
i.add(this._commandService.onCommandExecuted((c) => {
|
|
2473
|
+
if (c.id === De.id) {
|
|
2453
2474
|
const d = n();
|
|
2454
|
-
d &&
|
|
2475
|
+
d && r.next(d);
|
|
2455
2476
|
}
|
|
2456
2477
|
}));
|
|
2457
|
-
const s = e.scene.getViewport(
|
|
2458
|
-
return s &&
|
|
2478
|
+
const s = e.scene.getViewport(q.VIEW_MAIN);
|
|
2479
|
+
return s && i.add(s.onScrollAfter$.subscribeEvent(() => {
|
|
2459
2480
|
const c = n();
|
|
2460
|
-
c &&
|
|
2481
|
+
c && r.next(c);
|
|
2461
2482
|
})), {
|
|
2462
2483
|
positions: o,
|
|
2463
|
-
positions$:
|
|
2464
|
-
disposable:
|
|
2484
|
+
positions$: r,
|
|
2485
|
+
disposable: i
|
|
2465
2486
|
};
|
|
2466
2487
|
}
|
|
2467
2488
|
/**
|
|
@@ -2471,17 +2492,17 @@ let ct = class extends te {
|
|
|
2471
2492
|
* @returns disposable
|
|
2472
2493
|
*/
|
|
2473
2494
|
attachPopupToObject(t, e) {
|
|
2474
|
-
const o = this._univerInstanceService.getCurrentUnitForType(v.UNIVER_DOC).getUnitId(),
|
|
2475
|
-
if (!
|
|
2495
|
+
const o = this._univerInstanceService.getCurrentUnitForType(v.UNIVER_DOC).getUnitId(), r = this._renderManagerService.getRenderById(o);
|
|
2496
|
+
if (!r)
|
|
2476
2497
|
return {
|
|
2477
2498
|
dispose: () => {
|
|
2478
2499
|
}
|
|
2479
2500
|
};
|
|
2480
|
-
const { position:
|
|
2501
|
+
const { position: i, position$: s, disposable: a } = this._createObjectPositionObserver(t, r), c = this._globalPopupManagerService.addPopup({
|
|
2481
2502
|
...e,
|
|
2482
2503
|
unitId: o,
|
|
2483
2504
|
subUnitId: "default",
|
|
2484
|
-
anchorRect:
|
|
2505
|
+
anchorRect: i,
|
|
2485
2506
|
anchorRect$: s
|
|
2486
2507
|
});
|
|
2487
2508
|
return {
|
|
@@ -2491,41 +2512,41 @@ let ct = class extends te {
|
|
|
2491
2512
|
};
|
|
2492
2513
|
}
|
|
2493
2514
|
attachPopupToRange(t, e) {
|
|
2494
|
-
const o = this._univerInstanceService.getCurrentUnitForType(v.UNIVER_DOC).getUnitId(), { direction:
|
|
2495
|
-
if (!
|
|
2515
|
+
const o = this._univerInstanceService.getCurrentUnitForType(v.UNIVER_DOC).getUnitId(), { direction: r = "top" } = e, i = this._renderManagerService.getRenderById(o);
|
|
2516
|
+
if (!i)
|
|
2496
2517
|
return {
|
|
2497
2518
|
dispose: () => {
|
|
2498
2519
|
}
|
|
2499
2520
|
};
|
|
2500
|
-
const { positions: s, positions$: a, disposable: c } = this._createRangePositionObserver(t,
|
|
2521
|
+
const { positions: s, positions$: a, disposable: c } = this._createRangePositionObserver(t, i), d = a.pipe(xo((h) => r === "top" ? h[0] : h[h.length - 1])), g = this._globalPopupManagerService.addPopup({
|
|
2501
2522
|
...e,
|
|
2502
2523
|
unitId: o,
|
|
2503
2524
|
subUnitId: "default",
|
|
2504
|
-
anchorRect:
|
|
2525
|
+
anchorRect: r === "top" ? s[0] : s[s.length - 1],
|
|
2505
2526
|
anchorRect$: d,
|
|
2506
2527
|
excludeRects: s,
|
|
2507
2528
|
excludeRects$: a,
|
|
2508
|
-
direction:
|
|
2529
|
+
direction: r === "top" ? "top" : "bottom"
|
|
2509
2530
|
});
|
|
2510
2531
|
return {
|
|
2511
2532
|
dispose: () => {
|
|
2512
|
-
this._globalPopupManagerService.removePopup(
|
|
2533
|
+
this._globalPopupManagerService.removePopup(g), a.complete(), c.dispose();
|
|
2513
2534
|
}
|
|
2514
2535
|
};
|
|
2515
2536
|
}
|
|
2516
2537
|
};
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
],
|
|
2523
|
-
var
|
|
2524
|
-
for (var
|
|
2525
|
-
(s = t[
|
|
2526
|
-
return o &&
|
|
2527
|
-
},
|
|
2528
|
-
let
|
|
2538
|
+
lt = yi([
|
|
2539
|
+
Te(0, E(Yn)),
|
|
2540
|
+
Te(1, W),
|
|
2541
|
+
Te(2, w),
|
|
2542
|
+
Te(3, O)
|
|
2543
|
+
], lt);
|
|
2544
|
+
var xi = Object.defineProperty, Pi = Object.getOwnPropertyDescriptor, Di = (t, e, n, o) => {
|
|
2545
|
+
for (var r = o > 1 ? void 0 : o ? Pi(e, n) : e, i = t.length - 1, s; i >= 0; i--)
|
|
2546
|
+
(s = t[i]) && (r = (o ? s(e, n, r) : s(r)) || r);
|
|
2547
|
+
return o && r && xi(e, n, r), r;
|
|
2548
|
+
}, zt = (t, e) => (n, o) => e(n, o, t);
|
|
2549
|
+
let xe = class extends Se {
|
|
2529
2550
|
constructor(t, e) {
|
|
2530
2551
|
super(), this._instanceSrv = t, this._renderManagerService = e, this._init();
|
|
2531
2552
|
}
|
|
@@ -2544,19 +2565,19 @@ let ye = class extends ve {
|
|
|
2544
2565
|
this._renderManagerService.removeRender(e);
|
|
2545
2566
|
}
|
|
2546
2567
|
};
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
],
|
|
2552
|
-
var
|
|
2553
|
-
for (var
|
|
2554
|
-
(s = t[
|
|
2555
|
-
return o &&
|
|
2556
|
-
},
|
|
2557
|
-
let
|
|
2568
|
+
xe = Di([
|
|
2569
|
+
Be($e.Ready, xe),
|
|
2570
|
+
zt(0, w),
|
|
2571
|
+
zt(1, W)
|
|
2572
|
+
], xe);
|
|
2573
|
+
var Ai = Object.defineProperty, Ni = Object.getOwnPropertyDescriptor, Fi = (t, e, n, o) => {
|
|
2574
|
+
for (var r = o > 1 ? void 0 : o ? Ni(e, n) : e, i = t.length - 1, s; i >= 0; i--)
|
|
2575
|
+
(s = t[i]) && (r = (o ? s(e, n, r) : s(r)) || r);
|
|
2576
|
+
return o && r && Ai(e, n, r), r;
|
|
2577
|
+
}, qe = (t, e) => (n, o) => e(n, o, t), Ie;
|
|
2578
|
+
let Yt = (Ie = class extends Dn {
|
|
2558
2579
|
constructor(t, e, n, o) {
|
|
2559
|
-
super(), this._config = t, this._injector = e, this._renderManagerSrv = n, this._logService = o, this._config =
|
|
2580
|
+
super(), this._config = t, this._injector = e, this._renderManagerSrv = n, this._logService = o, this._config = j.deepMerge({}, nr, this._config), this._initDependencies(e), this._initializeCommands();
|
|
2560
2581
|
}
|
|
2561
2582
|
onReady() {
|
|
2562
2583
|
this._initRenderBasics();
|
|
@@ -2566,35 +2587,35 @@ let zt = (Te = class extends Tn {
|
|
|
2566
2587
|
}
|
|
2567
2588
|
_initializeCommands() {
|
|
2568
2589
|
[
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
ai,
|
|
2574
|
-
ci,
|
|
2575
|
-
li,
|
|
2576
|
-
di,
|
|
2577
|
-
ui,
|
|
2590
|
+
rr,
|
|
2591
|
+
ir,
|
|
2592
|
+
ar,
|
|
2593
|
+
sr,
|
|
2578
2594
|
cr,
|
|
2579
2595
|
lr,
|
|
2580
|
-
|
|
2596
|
+
dr,
|
|
2597
|
+
ur,
|
|
2598
|
+
hr,
|
|
2599
|
+
si,
|
|
2600
|
+
ai,
|
|
2601
|
+
ii
|
|
2581
2602
|
].forEach((t) => {
|
|
2582
|
-
this._injector.get(
|
|
2603
|
+
this._injector.get(Xn).registerShortcut(t);
|
|
2583
2604
|
});
|
|
2584
2605
|
}
|
|
2585
2606
|
_initDependencies(t) {
|
|
2586
2607
|
[
|
|
2587
|
-
[
|
|
2608
|
+
[me, { useFactory: () => this._injector.createInstance(me, this._config) }],
|
|
2588
2609
|
[Me],
|
|
2589
|
-
[xe],
|
|
2590
2610
|
[ye],
|
|
2591
|
-
[
|
|
2592
|
-
[
|
|
2593
|
-
[
|
|
2611
|
+
[xe],
|
|
2612
|
+
[fe, { useFactory: () => this._injector.createInstance(fe, this._config) }],
|
|
2613
|
+
[Re, { useClass: nt }],
|
|
2614
|
+
[lt]
|
|
2594
2615
|
].forEach((n) => t.add(n));
|
|
2595
2616
|
}
|
|
2596
2617
|
_markDocAsFocused() {
|
|
2597
|
-
const t = this._injector.get(
|
|
2618
|
+
const t = this._injector.get(w), e = this._injector.get(ee);
|
|
2598
2619
|
try {
|
|
2599
2620
|
const n = t.getCurrentUnitForType(v.UNIVER_DOC);
|
|
2600
2621
|
if (!n) return;
|
|
@@ -2605,34 +2626,34 @@ let zt = (Te = class extends Tn {
|
|
|
2605
2626
|
}
|
|
2606
2627
|
}
|
|
2607
2628
|
_initUI() {
|
|
2608
|
-
this._injector.get(
|
|
2629
|
+
this._injector.get(fe);
|
|
2609
2630
|
}
|
|
2610
2631
|
_initRenderBasics() {
|
|
2611
2632
|
[
|
|
2612
|
-
[
|
|
2613
|
-
[
|
|
2614
|
-
[
|
|
2615
|
-
[
|
|
2633
|
+
[L],
|
|
2634
|
+
[Ro],
|
|
2635
|
+
[st],
|
|
2636
|
+
[at]
|
|
2616
2637
|
].forEach((t) => {
|
|
2617
2638
|
this._renderManagerSrv.registerRenderModule(v.UNIVER_DOC, t);
|
|
2618
2639
|
});
|
|
2619
2640
|
}
|
|
2620
2641
|
_initRenderModules() {
|
|
2621
2642
|
[
|
|
2622
|
-
[
|
|
2623
|
-
[
|
|
2643
|
+
[ot],
|
|
2644
|
+
[ct],
|
|
2624
2645
|
[it]
|
|
2625
2646
|
].forEach((t) => {
|
|
2626
2647
|
this._renderManagerSrv.registerRenderModule(v.UNIVER_DOC, t);
|
|
2627
2648
|
});
|
|
2628
2649
|
}
|
|
2629
|
-
}, C(
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
],
|
|
2635
|
-
function
|
|
2650
|
+
}, C(Ie, "pluginName", or), C(Ie, "type", v.UNIVER_DOC), Ie);
|
|
2651
|
+
Yt = Fi([
|
|
2652
|
+
qe(1, E(Le)),
|
|
2653
|
+
qe(2, W),
|
|
2654
|
+
qe(3, Zt)
|
|
2655
|
+
], Yt);
|
|
2656
|
+
function ki(t) {
|
|
2636
2657
|
return {
|
|
2637
2658
|
left: t.positionH.posOffset,
|
|
2638
2659
|
top: t.positionV.posOffset,
|
|
@@ -2640,41 +2661,41 @@ function Xr(t) {
|
|
|
2640
2661
|
height: t.size.height
|
|
2641
2662
|
};
|
|
2642
2663
|
}
|
|
2643
|
-
function
|
|
2664
|
+
function Gi(t, e = 0, n = 0) {
|
|
2644
2665
|
return {
|
|
2645
2666
|
size: {
|
|
2646
2667
|
width: t.width,
|
|
2647
2668
|
height: t.height
|
|
2648
2669
|
},
|
|
2649
2670
|
positionH: {
|
|
2650
|
-
relativeFrom:
|
|
2671
|
+
relativeFrom: An.MARGIN,
|
|
2651
2672
|
posOffset: (t.left || 0) - e
|
|
2652
2673
|
},
|
|
2653
2674
|
positionV: {
|
|
2654
|
-
relativeFrom:
|
|
2675
|
+
relativeFrom: Nn.PAGE,
|
|
2655
2676
|
posOffset: (t.top || 0) - n
|
|
2656
2677
|
},
|
|
2657
2678
|
angle: t.angle || 0
|
|
2658
2679
|
};
|
|
2659
2680
|
}
|
|
2660
2681
|
export {
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2682
|
+
or as DOC_UI_PLUGIN_NAME,
|
|
2683
|
+
tr as DefaultDocContainerConfig,
|
|
2684
|
+
nr as DefaultDocUiConfig,
|
|
2685
|
+
er as DefaultToolbarConfig,
|
|
2686
|
+
ot as DocBackScrollRenderController,
|
|
2687
|
+
lt as DocCanvasPopManagerService,
|
|
2688
|
+
ci as DocCopyCommand,
|
|
2689
|
+
li as DocCutCommand,
|
|
2690
|
+
di as DocPasteCommand,
|
|
2691
|
+
st as DocRenderController,
|
|
2692
|
+
xe as DocsRenderService,
|
|
2693
|
+
Re as IDocClipboardService,
|
|
2694
|
+
jo as PastePluginLark,
|
|
2695
|
+
zo as PastePluginUniver,
|
|
2696
|
+
ko as PastePluginWord,
|
|
2697
|
+
Yt as UniverDocsUIPlugin,
|
|
2698
|
+
ki as docDrawingPositionToTransform,
|
|
2699
|
+
Gi as transformToDocDrawingPosition,
|
|
2700
|
+
k as whenDocAndEditorFocused
|
|
2680
2701
|
};
|