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