@univerjs/docs-ui 0.1.9 → 0.1.11
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/README.md +1 -1
- package/lib/cjs/index.js +3 -3
- package/lib/es/index.js +762 -788
- package/lib/types/controllers/app-ui-controller.d.ts +5 -5
- package/lib/types/controllers/back-scroll.controller.d.ts +3 -3
- package/lib/types/controllers/clipboard.controller.d.ts +3 -3
- package/lib/types/controllers/doc-container-ui-controller.d.ts +3 -3
- package/lib/types/controllers/doc-editor-bridge.controller.d.ts +3 -3
- package/lib/types/controllers/{floating-object.controller.d.ts → doc-floating-object.controller.d.ts} +4 -4
- package/lib/types/controllers/doc-render.controller.d.ts +3 -3
- package/lib/types/controllers/doc-ui.controller.d.ts +2 -2
- package/lib/types/controllers/menu/menu.d.ts +1 -1
- package/lib/types/controllers/text-selection.controller.d.ts +3 -3
- package/lib/types/controllers/zoom.controller.d.ts +3 -3
- package/lib/types/docs-ui-plugin.d.ts +2 -2
- package/lib/types/index.d.ts +1 -1
- package/lib/types/locale/index.d.ts +1 -0
- package/lib/types/locale/ru-RU.d.ts +4 -0
- package/lib/types/services/clipboard/clipboard.service.d.ts +3 -3
- package/lib/types/services/clipboard/html-to-udm/converter.d.ts +1 -1
- package/lib/types/views/doc-canvas-view.d.ts +2 -2
- package/lib/types/views/doc-container/DocContainer.d.ts +1 -1
- package/lib/umd/index.js +3 -3
- package/package.json +16 -16
- package/lib/types/controllers/page-render.controller.d.ts +0 -13
package/lib/es/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
var Bt = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { FOCUSING_DOC as
|
|
5
|
-
import { Inject as
|
|
6
|
-
import { KeyCode as
|
|
7
|
-
import { MoveCursorOperation as
|
|
8
|
-
import { connectInjector as
|
|
9
|
-
import { ITextSelectionRenderManager as
|
|
2
|
+
var $t = (i, e, t) => e in i ? Bt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
+
var p = (i, e, t) => ($t(i, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import { FOCUSING_DOC as De, FOCUSING_UNIVER_EDITOR as Ke, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE as Ft, Direction as V, EDITOR_ACTIVATED as Tt, LocaleService as Ze, RxDisposable as le, ICommandService as v, BooleanNumber as C, UniverInstanceType as m, BaselineOffset as J, ThemeService as It, HorizontalAlign as Pe, IUniverInstanceService as U, Disposable as ee, OnLifecycle as L, LifecycleStages as B, Tools as qe, LRUMap as wt, ColorKit as ot, toDisposable as j, ILogService as bt, CommandType as Je, IContextService as jt, checkForSubstrings as Vt, IConfigService as Wt, PositionedObjectLayoutType as kt, DEFAULT_DOCUMENT_SUB_COMPONENT_ID as zt, IFloatingObjectManagerService as Ht, Plugin as Yt } from "@univerjs/core";
|
|
5
|
+
import { Inject as R, Injector as Ue, Optional as Gt, createIdentifier as Xt } from "@wendellhu/redi";
|
|
6
|
+
import { KeyCode as D, MetaKeys as de, ILayoutService as yt, MenuGroup as I, MenuItemType as T, MenuPosition as b, getMenuHiddenObservable as y, FONT_FAMILY_LIST as st, FONT_SIZE_LIST as Kt, FontFamily as Zt, FontFamilyItem as qt, FontSize as Jt, DesktopUIPart as Qt, ComponentManager as en, IEditorService as $, IMenuService as tn, IUIController as nn, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as rn, HTML_CLIPBOARD_MIME_TYPE as on, IClipboardInterfaceService as Qe, CopyCommand as sn, CutCommand as an, PasteCommand as cn, SetEditorResizeOperation as ln, IShortcutService as dn } from "@univerjs/ui";
|
|
7
|
+
import { MoveCursorOperation as Ne, MoveSelectionOperation as Ae, SelectAllOperation as un, SetInlineFormatBoldCommand as hn, SetTextSelectionsOperation as P, SetInlineFormatCommand as te, SetInlineFormatItalicCommand as gn, SetInlineFormatUnderlineCommand as _n, SetInlineFormatStrikethroughCommand as pn, SetInlineFormatSubscriptCommand as fn, SetInlineFormatSuperscriptCommand as mn, SetInlineFormatFontFamilyCommand as at, SetInlineFormatFontSizeCommand as ct, SetInlineFormatTextColorCommand as lt, AlignLeftCommand as Sn, AlignOperationCommand as Le, AlignCenterCommand as vn, AlignRightCommand as Cn, AlignJustifyCommand as On, OrderListCommand as Rn, BulletListCommand as Tn, ResetInlineFormatTextBackgroundColorCommand as In, SetInlineFormatTextBackgroundColorCommand as He, TextSelectionManagerService as ne, BreakLineCommand as bn, DeleteLeftCommand as yn, DeleteRightCommand as Mn, CutContentCommand as Mt, InnerPasteCommand as Et, VIEWPORT_KEY as Be, CoverContentCommand as En, RichTextEditingMutation as et, DocSkeletonManagerService as ie, DOCS_VIEW_KEY as q, DOCS_COMPONENT_MAIN_LAYER_INDEX as We, DOCS_COMPONENT_HEADER_LAYER_INDEX as xn, DOCS_COMPONENT_DEFAULT_Z_INDEX as dt, DOCS_COMPONENT_BACKGROUND_LAYER_INDEX as Dn, SetDocZoomRatioOperation as tt, SetDocZoomRatioCommand as Pn, getDocObject as xt, getDocObjectById as Un } from "@univerjs/docs";
|
|
8
|
+
import { connectInjector as Nn } from "@wendellhu/redi/react-bindings";
|
|
9
|
+
import { ITextSelectionRenderManager as ue, pixelToPt as An, ptToPixel as ut, ScrollBar as Ye, IRenderManagerService as H, PageLayoutType as ht, Viewport as Ln, EVENT_TYPE as Bn, Layer as gt, Documents as $n, DocBackground as Fn, Liquid as wn, CURSOR_TYPE as _t, NodePositionConvertToCursor as jn, getAnchorBounding as Vn } from "@univerjs/engine-render";
|
|
10
10
|
import Wn from "react";
|
|
11
|
-
import { Observable as
|
|
12
|
-
import { ColorPicker as
|
|
11
|
+
import { Observable as M, takeUntil as ce, fromEvent as pt, BehaviorSubject as kn } from "rxjs";
|
|
12
|
+
import { ColorPicker as zn } from "@univerjs/design";
|
|
13
13
|
const Hn = {
|
|
14
14
|
undo: !0,
|
|
15
15
|
redo: !0,
|
|
@@ -51,89 +51,89 @@ const Hn = {
|
|
|
51
51
|
frozenContent: !1,
|
|
52
52
|
infoBar: !0,
|
|
53
53
|
toolbar: !0
|
|
54
|
-
},
|
|
54
|
+
}, Gn = {
|
|
55
55
|
layout: {
|
|
56
56
|
docContainerConfig: Yn,
|
|
57
57
|
toolbarConfig: Hn
|
|
58
58
|
}
|
|
59
|
-
},
|
|
60
|
-
function
|
|
61
|
-
return i.getContextValue(
|
|
59
|
+
}, Xn = "DocUI";
|
|
60
|
+
function A(i) {
|
|
61
|
+
return i.getContextValue(De) && i.getContextValue(Ke);
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
return i.getContextValue(
|
|
63
|
+
function Kn(i) {
|
|
64
|
+
return i.getContextValue(De) && i.getContextValue(Ke) && !i.getContextValue(Ft);
|
|
65
65
|
}
|
|
66
|
-
const
|
|
67
|
-
id:
|
|
68
|
-
binding:
|
|
69
|
-
preconditions:
|
|
66
|
+
const Zn = {
|
|
67
|
+
id: Ne.id,
|
|
68
|
+
binding: D.ARROW_UP,
|
|
69
|
+
preconditions: A,
|
|
70
70
|
staticParameters: {
|
|
71
71
|
direction: V.UP
|
|
72
72
|
}
|
|
73
|
-
},
|
|
74
|
-
id:
|
|
75
|
-
binding:
|
|
76
|
-
preconditions:
|
|
73
|
+
}, qn = {
|
|
74
|
+
id: Ne.id,
|
|
75
|
+
binding: D.ARROW_DOWN,
|
|
76
|
+
preconditions: A,
|
|
77
77
|
staticParameters: {
|
|
78
78
|
direction: V.DOWN
|
|
79
79
|
}
|
|
80
80
|
}, Jn = {
|
|
81
|
-
id:
|
|
82
|
-
binding:
|
|
83
|
-
preconditions:
|
|
81
|
+
id: Ne.id,
|
|
82
|
+
binding: D.ARROW_LEFT,
|
|
83
|
+
preconditions: A,
|
|
84
84
|
staticParameters: {
|
|
85
85
|
direction: V.LEFT
|
|
86
86
|
}
|
|
87
87
|
}, Qn = {
|
|
88
|
-
id:
|
|
89
|
-
binding:
|
|
90
|
-
preconditions:
|
|
88
|
+
id: Ne.id,
|
|
89
|
+
binding: D.ARROW_RIGHT,
|
|
90
|
+
preconditions: A,
|
|
91
91
|
staticParameters: {
|
|
92
92
|
direction: V.RIGHT
|
|
93
93
|
}
|
|
94
94
|
}, ei = {
|
|
95
|
-
id:
|
|
96
|
-
binding:
|
|
97
|
-
preconditions:
|
|
95
|
+
id: Ae.id,
|
|
96
|
+
binding: D.ARROW_UP | de.SHIFT,
|
|
97
|
+
preconditions: A,
|
|
98
98
|
staticParameters: {
|
|
99
99
|
direction: V.UP
|
|
100
100
|
}
|
|
101
101
|
}, ti = {
|
|
102
|
-
id:
|
|
103
|
-
binding:
|
|
104
|
-
preconditions:
|
|
102
|
+
id: Ae.id,
|
|
103
|
+
binding: D.ARROW_DOWN | de.SHIFT,
|
|
104
|
+
preconditions: A,
|
|
105
105
|
staticParameters: {
|
|
106
106
|
direction: V.DOWN
|
|
107
107
|
}
|
|
108
108
|
}, ni = {
|
|
109
|
-
id:
|
|
110
|
-
binding:
|
|
111
|
-
preconditions:
|
|
109
|
+
id: Ae.id,
|
|
110
|
+
binding: D.ARROW_LEFT | de.SHIFT,
|
|
111
|
+
preconditions: A,
|
|
112
112
|
staticParameters: {
|
|
113
113
|
direction: V.LEFT
|
|
114
114
|
}
|
|
115
115
|
}, ii = {
|
|
116
|
-
id:
|
|
117
|
-
binding:
|
|
118
|
-
preconditions:
|
|
116
|
+
id: Ae.id,
|
|
117
|
+
binding: D.ARROW_RIGHT | de.SHIFT,
|
|
118
|
+
preconditions: A,
|
|
119
119
|
staticParameters: {
|
|
120
120
|
direction: V.RIGHT
|
|
121
121
|
}
|
|
122
122
|
}, ri = {
|
|
123
123
|
id: un.id,
|
|
124
|
-
binding:
|
|
125
|
-
preconditions: (i) => i.getContextValue(
|
|
124
|
+
binding: D.A | de.CTRL_COMMAND,
|
|
125
|
+
preconditions: (i) => i.getContextValue(Ke) && (i.getContextValue(De) || i.getContextValue(Tt))
|
|
126
126
|
};
|
|
127
127
|
var oi = Object.defineProperty, si = Object.getOwnPropertyDescriptor, ai = (i, e, t, n) => {
|
|
128
|
-
for (var r = n > 1 ? void 0 : n ? si(e, t) : e,
|
|
129
|
-
(
|
|
128
|
+
for (var r = n > 1 ? void 0 : n ? si(e, t) : e, o = i.length - 1, s; o >= 0; o--)
|
|
129
|
+
(s = i[o]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
130
130
|
return n && r && oi(e, t, r), r;
|
|
131
|
-
},
|
|
132
|
-
let
|
|
131
|
+
}, ft = (i, e) => (t, n) => e(t, n, i);
|
|
132
|
+
let Ge = class {
|
|
133
133
|
constructor(i, e, t) {
|
|
134
|
-
|
|
134
|
+
p(this, "_docContainer");
|
|
135
135
|
// 获取SheetContainer组件
|
|
136
|
-
|
|
136
|
+
p(this, "getComponent", (i) => {
|
|
137
137
|
if (this._docContainer = i, !i.getContentRef().current)
|
|
138
138
|
throw new Error("container is not ready");
|
|
139
139
|
});
|
|
@@ -144,7 +144,7 @@ let Ye = class {
|
|
|
144
144
|
* e: {target: HTMLSelectElement } reference from https://stackoverflow.com/a/48443771
|
|
145
145
|
*
|
|
146
146
|
*/
|
|
147
|
-
|
|
147
|
+
p(this, "changeLocale", (i) => {
|
|
148
148
|
this._localeService.setLocale(i);
|
|
149
149
|
});
|
|
150
150
|
this._config = i, this._localeService = e, this._injector = t;
|
|
@@ -168,19 +168,19 @@ let Ye = class {
|
|
|
168
168
|
return this._docContainer;
|
|
169
169
|
}
|
|
170
170
|
};
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
],
|
|
171
|
+
Ge = ai([
|
|
172
|
+
ft(1, R(Ze)),
|
|
173
|
+
ft(2, R(Ue))
|
|
174
|
+
], Ge);
|
|
175
175
|
var ci = Object.defineProperty, li = Object.getOwnPropertyDescriptor, di = (i, e, t, n) => {
|
|
176
|
-
for (var r = n > 1 ? void 0 : n ? li(e, t) : e,
|
|
177
|
-
(
|
|
176
|
+
for (var r = n > 1 ? void 0 : n ? li(e, t) : e, o = i.length - 1, s; o >= 0; o--)
|
|
177
|
+
(s = i[o]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
178
178
|
return n && r && ci(e, t, r), r;
|
|
179
|
-
},
|
|
180
|
-
let
|
|
181
|
-
constructor(e, t, n, r,
|
|
179
|
+
}, fe = (i, e) => (t, n) => e(t, n, i);
|
|
180
|
+
let ae = class extends le {
|
|
181
|
+
constructor(e, t, n, r, o) {
|
|
182
182
|
super();
|
|
183
|
-
|
|
183
|
+
p(this, "_docContainerController");
|
|
184
184
|
/**
|
|
185
185
|
* Change language
|
|
186
186
|
* @param {string} locale new language
|
|
@@ -188,10 +188,10 @@ let se = class extends ce {
|
|
|
188
188
|
* e: {target: HTMLSelectElement } reference from https://stackoverflow.com/a/48443771
|
|
189
189
|
*
|
|
190
190
|
*/
|
|
191
|
-
|
|
191
|
+
p(this, "changeLocale", (e) => {
|
|
192
192
|
this._localeService.setLocale(e);
|
|
193
193
|
});
|
|
194
|
-
this._localeService = t, this._injector = n, this._textSelectionRenderManager = r, this._layoutService =
|
|
194
|
+
this._localeService = t, this._injector = n, this._textSelectionRenderManager = r, this._layoutService = o, this._docContainerController = this._injector.createInstance(Ge, e), this._registerContainer();
|
|
195
195
|
}
|
|
196
196
|
_registerContainer() {
|
|
197
197
|
this._layoutService && this.disposeWithMe(
|
|
@@ -203,14 +203,14 @@ let se = class extends ce {
|
|
|
203
203
|
return this._docContainerController;
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
],
|
|
212
|
-
const $e = "UI_PLUGIN_DOCS",
|
|
213
|
-
var
|
|
206
|
+
ae = di([
|
|
207
|
+
fe(1, R(Ze)),
|
|
208
|
+
fe(2, R(Ue)),
|
|
209
|
+
fe(3, ue),
|
|
210
|
+
fe(4, Gt(yt))
|
|
211
|
+
], ae);
|
|
212
|
+
const $e = "UI_PLUGIN_DOCS", nt = `${$e}_COLOR_PICKER_COMPONENT`, Dt = `${$e}_FONT_FAMILY_COMPONENT`, Pt = `${$e}_FONT_FAMILY_ITEM_COMPONENT`, Ut = `${$e}_FONT_SIZE_COMPONENT`;
|
|
213
|
+
var Nt = { exports: {} }, Fe = {};
|
|
214
214
|
/**
|
|
215
215
|
* @license React
|
|
216
216
|
* react-jsx-runtime.production.min.js
|
|
@@ -221,21 +221,21 @@ var Ut = { exports: {} }, Be = {};
|
|
|
221
221
|
* LICENSE file in the root directory of this source tree.
|
|
222
222
|
*/
|
|
223
223
|
var ui = Wn, hi = Symbol.for("react.element"), gi = Symbol.for("react.fragment"), _i = Object.prototype.hasOwnProperty, pi = ui.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, fi = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
224
|
-
function
|
|
225
|
-
var n, r = {},
|
|
226
|
-
t !== void 0 && (
|
|
224
|
+
function At(i, e, t) {
|
|
225
|
+
var n, r = {}, o = null, s = null;
|
|
226
|
+
t !== void 0 && (o = "" + t), e.key !== void 0 && (o = "" + e.key), e.ref !== void 0 && (s = e.ref);
|
|
227
227
|
for (n in e)
|
|
228
228
|
_i.call(e, n) && !fi.hasOwnProperty(n) && (r[n] = e[n]);
|
|
229
229
|
if (i && i.defaultProps)
|
|
230
230
|
for (n in e = i.defaultProps, e)
|
|
231
231
|
r[n] === void 0 && (r[n] = e[n]);
|
|
232
|
-
return { $$typeof: hi, type: i, key:
|
|
232
|
+
return { $$typeof: hi, type: i, key: o, ref: s, props: r, _owner: pi.current };
|
|
233
233
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
var mi =
|
|
234
|
+
Fe.Fragment = gi;
|
|
235
|
+
Fe.jsx = At;
|
|
236
|
+
Fe.jsxs = At;
|
|
237
|
+
Nt.exports = Fe;
|
|
238
|
+
var mi = Nt.exports;
|
|
239
239
|
const Si = "univer-docs-ui-canvas-background", vi = {
|
|
240
240
|
docsUiCanvasBackground: Si
|
|
241
241
|
}, Ci = () => /* @__PURE__ */ mi.jsx("div", { className: vi.docsUiCanvasBackground });
|
|
@@ -249,21 +249,21 @@ function Oi(i) {
|
|
|
249
249
|
title: "Set bold",
|
|
250
250
|
tooltip: "toolbar.bold",
|
|
251
251
|
positions: [b.TOOLBAR_START],
|
|
252
|
-
activated$: new
|
|
252
|
+
activated$: new M((t) => {
|
|
253
253
|
const n = e.onCommandExecuted((r) => {
|
|
254
|
-
var
|
|
255
|
-
const
|
|
256
|
-
if (
|
|
257
|
-
const a =
|
|
254
|
+
var s;
|
|
255
|
+
const o = r.id;
|
|
256
|
+
if (o === P.id || o === te.id) {
|
|
257
|
+
const a = W(i);
|
|
258
258
|
if (a == null)
|
|
259
259
|
return;
|
|
260
|
-
const c = (
|
|
260
|
+
const c = (s = a.ts) == null ? void 0 : s.bl;
|
|
261
261
|
t.next(c === C.TRUE);
|
|
262
262
|
}
|
|
263
263
|
});
|
|
264
264
|
return t.next(!1), n.dispose;
|
|
265
265
|
}),
|
|
266
|
-
hidden$:
|
|
266
|
+
hidden$: y(i, m.UNIVER_DOC)
|
|
267
267
|
};
|
|
268
268
|
}
|
|
269
269
|
function Ri(i) {
|
|
@@ -276,21 +276,21 @@ function Ri(i) {
|
|
|
276
276
|
title: "Set italic",
|
|
277
277
|
tooltip: "toolbar.italic",
|
|
278
278
|
positions: [b.TOOLBAR_START],
|
|
279
|
-
activated$: new
|
|
279
|
+
activated$: new M((t) => {
|
|
280
280
|
const n = e.onCommandExecuted((r) => {
|
|
281
|
-
var
|
|
282
|
-
const
|
|
283
|
-
if (
|
|
284
|
-
const a =
|
|
281
|
+
var s;
|
|
282
|
+
const o = r.id;
|
|
283
|
+
if (o === P.id || o === te.id) {
|
|
284
|
+
const a = W(i);
|
|
285
285
|
if (a == null)
|
|
286
286
|
return;
|
|
287
|
-
const c = (
|
|
287
|
+
const c = (s = a.ts) == null ? void 0 : s.it;
|
|
288
288
|
t.next(c === C.TRUE);
|
|
289
289
|
}
|
|
290
290
|
});
|
|
291
291
|
return t.next(!1), n.dispose;
|
|
292
292
|
}),
|
|
293
|
-
hidden$:
|
|
293
|
+
hidden$: y(i, m.UNIVER_DOC)
|
|
294
294
|
};
|
|
295
295
|
}
|
|
296
296
|
function Ti(i) {
|
|
@@ -303,21 +303,21 @@ function Ti(i) {
|
|
|
303
303
|
title: "Set underline",
|
|
304
304
|
tooltip: "toolbar.underline",
|
|
305
305
|
positions: [b.TOOLBAR_START],
|
|
306
|
-
activated$: new
|
|
306
|
+
activated$: new M((t) => {
|
|
307
307
|
const n = e.onCommandExecuted((r) => {
|
|
308
|
-
var
|
|
309
|
-
const
|
|
310
|
-
if (
|
|
311
|
-
const a =
|
|
308
|
+
var s;
|
|
309
|
+
const o = r.id;
|
|
310
|
+
if (o === P.id || o === te.id) {
|
|
311
|
+
const a = W(i);
|
|
312
312
|
if (a == null)
|
|
313
313
|
return;
|
|
314
|
-
const c = (
|
|
314
|
+
const c = (s = a.ts) == null ? void 0 : s.ul;
|
|
315
315
|
t.next((c == null ? void 0 : c.s) === C.TRUE);
|
|
316
316
|
}
|
|
317
317
|
});
|
|
318
318
|
return t.next(!1), n.dispose;
|
|
319
319
|
}),
|
|
320
|
-
hidden$:
|
|
320
|
+
hidden$: y(i, m.UNIVER_DOC)
|
|
321
321
|
};
|
|
322
322
|
}
|
|
323
323
|
function Ii(i) {
|
|
@@ -330,21 +330,21 @@ function Ii(i) {
|
|
|
330
330
|
title: "Set strike through",
|
|
331
331
|
tooltip: "toolbar.strikethrough",
|
|
332
332
|
positions: [b.TOOLBAR_START],
|
|
333
|
-
activated$: new
|
|
333
|
+
activated$: new M((t) => {
|
|
334
334
|
const n = e.onCommandExecuted((r) => {
|
|
335
|
-
var
|
|
336
|
-
const
|
|
337
|
-
if (
|
|
338
|
-
const a =
|
|
335
|
+
var s;
|
|
336
|
+
const o = r.id;
|
|
337
|
+
if (o === P.id || o === te.id) {
|
|
338
|
+
const a = W(i);
|
|
339
339
|
if (a == null)
|
|
340
340
|
return;
|
|
341
|
-
const c = (
|
|
341
|
+
const c = (s = a.ts) == null ? void 0 : s.st;
|
|
342
342
|
t.next((c == null ? void 0 : c.s) === C.TRUE);
|
|
343
343
|
}
|
|
344
344
|
});
|
|
345
345
|
return t.next(!1), n.dispose;
|
|
346
346
|
}),
|
|
347
|
-
hidden$:
|
|
347
|
+
hidden$: y(i, m.UNIVER_DOC)
|
|
348
348
|
};
|
|
349
349
|
}
|
|
350
350
|
function bi(i) {
|
|
@@ -356,24 +356,24 @@ function bi(i) {
|
|
|
356
356
|
icon: "SubscriptSingle",
|
|
357
357
|
tooltip: "toolbar.subscript",
|
|
358
358
|
positions: [b.TOOLBAR_START],
|
|
359
|
-
activated$: new
|
|
359
|
+
activated$: new M((t) => {
|
|
360
360
|
const n = e.onCommandExecuted((r) => {
|
|
361
|
-
var
|
|
362
|
-
const
|
|
363
|
-
if (
|
|
364
|
-
const a =
|
|
361
|
+
var s;
|
|
362
|
+
const o = r.id;
|
|
363
|
+
if (o === P.id || o === te.id) {
|
|
364
|
+
const a = W(i);
|
|
365
365
|
if (a == null)
|
|
366
366
|
return;
|
|
367
|
-
const c = (
|
|
367
|
+
const c = (s = a.ts) == null ? void 0 : s.va;
|
|
368
368
|
t.next(c === J.SUBSCRIPT);
|
|
369
369
|
}
|
|
370
370
|
});
|
|
371
371
|
return t.next(!1), n.dispose;
|
|
372
372
|
}),
|
|
373
|
-
hidden$:
|
|
373
|
+
hidden$: y(i, m.UNIVER_DOC)
|
|
374
374
|
};
|
|
375
375
|
}
|
|
376
|
-
function
|
|
376
|
+
function yi(i) {
|
|
377
377
|
const e = i.get(v);
|
|
378
378
|
return {
|
|
379
379
|
id: mn.id,
|
|
@@ -382,66 +382,66 @@ function Mi(i) {
|
|
|
382
382
|
icon: "SuperscriptSingle",
|
|
383
383
|
tooltip: "toolbar.superscript",
|
|
384
384
|
positions: [b.TOOLBAR_START],
|
|
385
|
-
activated$: new
|
|
385
|
+
activated$: new M((t) => {
|
|
386
386
|
const n = e.onCommandExecuted((r) => {
|
|
387
|
-
var
|
|
388
|
-
const
|
|
389
|
-
if (
|
|
390
|
-
const a =
|
|
387
|
+
var s;
|
|
388
|
+
const o = r.id;
|
|
389
|
+
if (o === P.id || o === te.id) {
|
|
390
|
+
const a = W(i);
|
|
391
391
|
if (a == null)
|
|
392
392
|
return;
|
|
393
|
-
const c = (
|
|
393
|
+
const c = (s = a.ts) == null ? void 0 : s.va;
|
|
394
394
|
t.next(c === J.SUPERSCRIPT);
|
|
395
395
|
}
|
|
396
396
|
});
|
|
397
397
|
return t.next(!1), n.dispose;
|
|
398
398
|
}),
|
|
399
|
-
hidden$:
|
|
399
|
+
hidden$: y(i, m.UNIVER_DOC)
|
|
400
400
|
};
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function Mi(i) {
|
|
403
403
|
const e = i.get(v);
|
|
404
404
|
return {
|
|
405
|
-
id:
|
|
405
|
+
id: at.id,
|
|
406
406
|
tooltip: "toolbar.font",
|
|
407
407
|
group: I.TOOLBAR_FORMAT,
|
|
408
408
|
type: T.SELECTOR,
|
|
409
|
-
label:
|
|
409
|
+
label: Dt,
|
|
410
410
|
positions: [b.TOOLBAR_START],
|
|
411
|
-
selections:
|
|
411
|
+
selections: st.map((t) => ({
|
|
412
412
|
label: {
|
|
413
|
-
name:
|
|
413
|
+
name: Pt,
|
|
414
414
|
hoverable: !0
|
|
415
415
|
},
|
|
416
416
|
value: t.value
|
|
417
417
|
})),
|
|
418
418
|
// disabled$: getCurrentSheetDisabled$(accessor),
|
|
419
|
-
value$: new
|
|
420
|
-
const n =
|
|
419
|
+
value$: new M((t) => {
|
|
420
|
+
const n = st[0].value, r = e.onCommandExecuted((o) => {
|
|
421
421
|
var a;
|
|
422
|
-
const
|
|
423
|
-
if (
|
|
424
|
-
const c =
|
|
422
|
+
const s = o.id;
|
|
423
|
+
if (s === P.id || s === at.id) {
|
|
424
|
+
const c = W(i);
|
|
425
425
|
if (c == null)
|
|
426
426
|
return;
|
|
427
|
-
const
|
|
428
|
-
t.next(
|
|
427
|
+
const l = (a = c.ts) == null ? void 0 : a.ff;
|
|
428
|
+
t.next(l != null ? l : n);
|
|
429
429
|
}
|
|
430
430
|
});
|
|
431
431
|
return t.next(n), r.dispose;
|
|
432
432
|
}),
|
|
433
|
-
hidden$:
|
|
433
|
+
hidden$: y(i, m.UNIVER_DOC)
|
|
434
434
|
};
|
|
435
435
|
}
|
|
436
436
|
function Ei(i) {
|
|
437
437
|
const e = i.get(v);
|
|
438
438
|
return {
|
|
439
|
-
id:
|
|
439
|
+
id: ct.id,
|
|
440
440
|
group: I.TOOLBAR_FORMAT,
|
|
441
441
|
type: T.SELECTOR,
|
|
442
442
|
tooltip: "toolbar.fontSize",
|
|
443
443
|
label: {
|
|
444
|
-
name:
|
|
444
|
+
name: Ut,
|
|
445
445
|
props: {
|
|
446
446
|
min: 1,
|
|
447
447
|
max: 400
|
|
@@ -449,29 +449,29 @@ function Ei(i) {
|
|
|
449
449
|
}
|
|
450
450
|
},
|
|
451
451
|
positions: [b.TOOLBAR_START],
|
|
452
|
-
selections:
|
|
452
|
+
selections: Kt,
|
|
453
453
|
// disabled$,
|
|
454
|
-
value$: new
|
|
455
|
-
const r = e.onCommandExecuted((
|
|
454
|
+
value$: new M((t) => {
|
|
455
|
+
const r = e.onCommandExecuted((o) => {
|
|
456
456
|
var a;
|
|
457
|
-
const
|
|
458
|
-
if (
|
|
459
|
-
const c =
|
|
457
|
+
const s = o.id;
|
|
458
|
+
if (s === P.id || s === ct.id) {
|
|
459
|
+
const c = W(i);
|
|
460
460
|
if (c == null)
|
|
461
461
|
return;
|
|
462
|
-
const
|
|
463
|
-
t.next(
|
|
462
|
+
const l = (a = c.ts) == null ? void 0 : a.fs;
|
|
463
|
+
t.next(l != null ? l : 14);
|
|
464
464
|
}
|
|
465
465
|
});
|
|
466
466
|
return t.next(14), r.dispose;
|
|
467
467
|
}),
|
|
468
|
-
hidden$:
|
|
468
|
+
hidden$: y(i, m.UNIVER_DOC)
|
|
469
469
|
};
|
|
470
470
|
}
|
|
471
471
|
function xi(i) {
|
|
472
|
-
const e = i.get(v), t = i.get(
|
|
472
|
+
const e = i.get(v), t = i.get(It);
|
|
473
473
|
return {
|
|
474
|
-
id:
|
|
474
|
+
id: lt.id,
|
|
475
475
|
icon: "FontColor",
|
|
476
476
|
tooltip: "toolbar.textColor.main",
|
|
477
477
|
group: I.TOOLBAR_FORMAT,
|
|
@@ -480,21 +480,21 @@ function xi(i) {
|
|
|
480
480
|
selections: [
|
|
481
481
|
{
|
|
482
482
|
label: {
|
|
483
|
-
name:
|
|
483
|
+
name: nt,
|
|
484
484
|
hoverable: !1
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
487
|
],
|
|
488
|
-
value$: new
|
|
489
|
-
const r = t.getCurrentTheme().textColor,
|
|
490
|
-
if (
|
|
491
|
-
const a =
|
|
488
|
+
value$: new M((n) => {
|
|
489
|
+
const r = t.getCurrentTheme().textColor, o = e.onCommandExecuted((s) => {
|
|
490
|
+
if (s.id === lt.id) {
|
|
491
|
+
const a = s.params.value;
|
|
492
492
|
n.next(a != null ? a : r);
|
|
493
493
|
}
|
|
494
494
|
});
|
|
495
|
-
return n.next(r),
|
|
495
|
+
return n.next(r), o.dispose;
|
|
496
496
|
}),
|
|
497
|
-
hidden$:
|
|
497
|
+
hidden$: y(i, m.UNIVER_DOC)
|
|
498
498
|
// disabled$: getCurrentSheetDisabled$(accessor),
|
|
499
499
|
};
|
|
500
500
|
}
|
|
@@ -507,21 +507,21 @@ function Di(i) {
|
|
|
507
507
|
icon: "LeftJustifyingSingle",
|
|
508
508
|
tooltip: "toolbar.alignLeft",
|
|
509
509
|
positions: [b.TOOLBAR_START],
|
|
510
|
-
activated$: new
|
|
510
|
+
activated$: new M((t) => {
|
|
511
511
|
const n = e.onCommandExecuted((r) => {
|
|
512
|
-
var
|
|
513
|
-
const
|
|
514
|
-
if (
|
|
515
|
-
const a =
|
|
512
|
+
var s;
|
|
513
|
+
const o = r.id;
|
|
514
|
+
if (o === P.id || o === Le.id) {
|
|
515
|
+
const a = we(i);
|
|
516
516
|
if (a == null)
|
|
517
517
|
return;
|
|
518
|
-
const c = (
|
|
519
|
-
t.next(c ===
|
|
518
|
+
const c = (s = a.paragraphStyle) == null ? void 0 : s.horizontalAlign;
|
|
519
|
+
t.next(c === Pe.LEFT);
|
|
520
520
|
}
|
|
521
521
|
});
|
|
522
522
|
return t.next(!1), n.dispose;
|
|
523
523
|
}),
|
|
524
|
-
hidden$:
|
|
524
|
+
hidden$: y(i, m.UNIVER_DOC)
|
|
525
525
|
};
|
|
526
526
|
}
|
|
527
527
|
function Pi(i) {
|
|
@@ -533,21 +533,21 @@ function Pi(i) {
|
|
|
533
533
|
icon: "HorizontallySingle",
|
|
534
534
|
tooltip: "toolbar.alignCenter",
|
|
535
535
|
positions: [b.TOOLBAR_START],
|
|
536
|
-
activated$: new
|
|
536
|
+
activated$: new M((t) => {
|
|
537
537
|
const n = e.onCommandExecuted((r) => {
|
|
538
|
-
var
|
|
539
|
-
const
|
|
540
|
-
if (
|
|
541
|
-
const a =
|
|
538
|
+
var s;
|
|
539
|
+
const o = r.id;
|
|
540
|
+
if (o === P.id || o === Le.id) {
|
|
541
|
+
const a = we(i);
|
|
542
542
|
if (a == null)
|
|
543
543
|
return;
|
|
544
|
-
const c = (
|
|
545
|
-
t.next(c ===
|
|
544
|
+
const c = (s = a.paragraphStyle) == null ? void 0 : s.horizontalAlign;
|
|
545
|
+
t.next(c === Pe.CENTER);
|
|
546
546
|
}
|
|
547
547
|
});
|
|
548
548
|
return t.next(!1), n.dispose;
|
|
549
549
|
}),
|
|
550
|
-
hidden$:
|
|
550
|
+
hidden$: y(i, m.UNIVER_DOC)
|
|
551
551
|
};
|
|
552
552
|
}
|
|
553
553
|
function Ui(i) {
|
|
@@ -559,24 +559,24 @@ function Ui(i) {
|
|
|
559
559
|
icon: "RightJustifyingSingle",
|
|
560
560
|
tooltip: "toolbar.alignRight",
|
|
561
561
|
positions: [b.TOOLBAR_START],
|
|
562
|
-
activated$: new
|
|
562
|
+
activated$: new M((t) => {
|
|
563
563
|
const n = e.onCommandExecuted((r) => {
|
|
564
|
-
var
|
|
565
|
-
const
|
|
566
|
-
if (
|
|
567
|
-
const a =
|
|
564
|
+
var s;
|
|
565
|
+
const o = r.id;
|
|
566
|
+
if (o === P.id || o === Le.id) {
|
|
567
|
+
const a = we(i);
|
|
568
568
|
if (a == null)
|
|
569
569
|
return;
|
|
570
|
-
const c = (
|
|
571
|
-
t.next(c ===
|
|
570
|
+
const c = (s = a.paragraphStyle) == null ? void 0 : s.horizontalAlign;
|
|
571
|
+
t.next(c === Pe.RIGHT);
|
|
572
572
|
}
|
|
573
573
|
});
|
|
574
574
|
return t.next(!1), n.dispose;
|
|
575
575
|
}),
|
|
576
|
-
hidden$:
|
|
576
|
+
hidden$: y(i, m.UNIVER_DOC)
|
|
577
577
|
};
|
|
578
578
|
}
|
|
579
|
-
function
|
|
579
|
+
function Ni(i) {
|
|
580
580
|
const e = i.get(v);
|
|
581
581
|
return {
|
|
582
582
|
id: On.id,
|
|
@@ -585,24 +585,24 @@ function Li(i) {
|
|
|
585
585
|
icon: "AlignTextBothSingle",
|
|
586
586
|
tooltip: "toolbar.alignJustify",
|
|
587
587
|
positions: [b.TOOLBAR_START],
|
|
588
|
-
activated$: new
|
|
588
|
+
activated$: new M((t) => {
|
|
589
589
|
const n = e.onCommandExecuted((r) => {
|
|
590
|
-
var
|
|
591
|
-
const
|
|
592
|
-
if (
|
|
593
|
-
const a =
|
|
590
|
+
var s;
|
|
591
|
+
const o = r.id;
|
|
592
|
+
if (o === P.id || o === Le.id) {
|
|
593
|
+
const a = we(i);
|
|
594
594
|
if (a == null)
|
|
595
595
|
return;
|
|
596
|
-
const c = (
|
|
597
|
-
t.next(c ===
|
|
596
|
+
const c = (s = a.paragraphStyle) == null ? void 0 : s.horizontalAlign;
|
|
597
|
+
t.next(c === Pe.JUSTIFIED);
|
|
598
598
|
}
|
|
599
599
|
});
|
|
600
600
|
return t.next(!1), n.dispose;
|
|
601
601
|
}),
|
|
602
|
-
hidden$:
|
|
602
|
+
hidden$: y(i, m.UNIVER_DOC)
|
|
603
603
|
};
|
|
604
604
|
}
|
|
605
|
-
function
|
|
605
|
+
function Ai(i) {
|
|
606
606
|
return {
|
|
607
607
|
id: Rn.id,
|
|
608
608
|
group: I.TOOLBAR_LAYOUT,
|
|
@@ -610,10 +610,10 @@ function Ni(i) {
|
|
|
610
610
|
icon: "OrderSingle",
|
|
611
611
|
tooltip: "toolbar.order",
|
|
612
612
|
positions: [b.TOOLBAR_START],
|
|
613
|
-
hidden$:
|
|
613
|
+
hidden$: y(i, m.UNIVER_DOC)
|
|
614
614
|
};
|
|
615
615
|
}
|
|
616
|
-
function
|
|
616
|
+
function Li(i) {
|
|
617
617
|
return {
|
|
618
618
|
id: Tn.id,
|
|
619
619
|
group: I.TOOLBAR_LAYOUT,
|
|
@@ -621,22 +621,22 @@ function Ai(i) {
|
|
|
621
621
|
icon: "UnorderSingle",
|
|
622
622
|
tooltip: "toolbar.unorder",
|
|
623
623
|
positions: [b.TOOLBAR_START],
|
|
624
|
-
hidden$:
|
|
624
|
+
hidden$: y(i, m.UNIVER_DOC)
|
|
625
625
|
};
|
|
626
626
|
}
|
|
627
|
-
function
|
|
627
|
+
function Bi(i) {
|
|
628
628
|
return {
|
|
629
629
|
id: In.id,
|
|
630
630
|
type: T.BUTTON,
|
|
631
631
|
title: "toolbar.resetColor",
|
|
632
632
|
icon: "NoColor",
|
|
633
|
-
positions:
|
|
633
|
+
positions: He.id
|
|
634
634
|
};
|
|
635
635
|
}
|
|
636
|
-
function
|
|
637
|
-
const e = i.get(v), t = i.get(
|
|
636
|
+
function $i(i) {
|
|
637
|
+
const e = i.get(v), t = i.get(It);
|
|
638
638
|
return {
|
|
639
|
-
id:
|
|
639
|
+
id: He.id,
|
|
640
640
|
tooltip: "toolbar.fillColor.main",
|
|
641
641
|
group: I.TOOLBAR_FORMAT,
|
|
642
642
|
type: T.BUTTON_SELECTOR,
|
|
@@ -645,64 +645,64 @@ function Bi(i) {
|
|
|
645
645
|
selections: [
|
|
646
646
|
{
|
|
647
647
|
label: {
|
|
648
|
-
name:
|
|
648
|
+
name: nt,
|
|
649
649
|
hoverable: !1
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
652
|
],
|
|
653
|
-
value$: new
|
|
654
|
-
const r = t.getCurrentTheme().primaryColor,
|
|
655
|
-
if (
|
|
656
|
-
const a =
|
|
653
|
+
value$: new M((n) => {
|
|
654
|
+
const r = t.getCurrentTheme().primaryColor, o = e.onCommandExecuted((s) => {
|
|
655
|
+
if (s.id === He.id) {
|
|
656
|
+
const a = s.params.value;
|
|
657
657
|
n.next(a != null ? a : r);
|
|
658
658
|
}
|
|
659
659
|
});
|
|
660
|
-
return n.next(r),
|
|
660
|
+
return n.next(r), o.dispose;
|
|
661
661
|
}),
|
|
662
|
-
hidden$:
|
|
662
|
+
hidden$: y(i, m.UNIVER_DOC)
|
|
663
663
|
};
|
|
664
664
|
}
|
|
665
|
-
function
|
|
665
|
+
function W(i) {
|
|
666
666
|
var c;
|
|
667
|
-
const e = i.get(
|
|
667
|
+
const e = i.get(U), t = i.get(ne), n = e.getCurrentUniverDocInstance(), r = t.getActiveRange();
|
|
668
668
|
if (n == null || r == null)
|
|
669
669
|
return;
|
|
670
|
-
const
|
|
671
|
-
if (
|
|
670
|
+
const o = (c = n.getBody()) == null ? void 0 : c.textRuns;
|
|
671
|
+
if (o == null)
|
|
672
672
|
return;
|
|
673
|
-
const { startOffset:
|
|
674
|
-
return
|
|
673
|
+
const { startOffset: s } = r;
|
|
674
|
+
return o.find(({ st: l, ed: u }) => s >= l && s < u);
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function we(i) {
|
|
677
677
|
var c;
|
|
678
|
-
const e = i.get(
|
|
678
|
+
const e = i.get(U), t = i.get(ne), n = e.getCurrentUniverDocInstance(), r = t.getActiveRange();
|
|
679
679
|
if (n == null || r == null)
|
|
680
680
|
return;
|
|
681
|
-
const
|
|
682
|
-
if (
|
|
681
|
+
const o = (c = n.getBody()) == null ? void 0 : c.paragraphs;
|
|
682
|
+
if (o == null)
|
|
683
683
|
return;
|
|
684
|
-
const { startOffset:
|
|
684
|
+
const { startOffset: s } = r;
|
|
685
685
|
let a = -1;
|
|
686
|
-
for (const
|
|
687
|
-
const { startIndex: u } =
|
|
688
|
-
if (
|
|
689
|
-
return
|
|
686
|
+
for (const l of o) {
|
|
687
|
+
const { startIndex: u } = l;
|
|
688
|
+
if (s > a && s <= u)
|
|
689
|
+
return l;
|
|
690
690
|
a = u;
|
|
691
691
|
}
|
|
692
692
|
return null;
|
|
693
693
|
}
|
|
694
694
|
var Fi = Object.defineProperty, wi = Object.getOwnPropertyDescriptor, ji = (i, e, t, n) => {
|
|
695
|
-
for (var r = n > 1 ? void 0 : n ? wi(e, t) : e,
|
|
696
|
-
(
|
|
695
|
+
for (var r = n > 1 ? void 0 : n ? wi(e, t) : e, o = i.length - 1, s; o >= 0; o--)
|
|
696
|
+
(s = i[o]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
697
697
|
return n && r && Fi(e, t, r), r;
|
|
698
698
|
}, k = (i, e) => (t, n) => e(t, n, i);
|
|
699
|
-
let
|
|
700
|
-
constructor(i, e, t, n, r,
|
|
701
|
-
super(), this._injector = i, this._componentManager = e, this._layoutService = t, this._editorService = n, this._menuService = r, this._uiController =
|
|
699
|
+
let Ce = class extends ee {
|
|
700
|
+
constructor(i, e, t, n, r, o, s) {
|
|
701
|
+
super(), this._injector = i, this._componentManager = e, this._layoutService = t, this._editorService = n, this._menuService = r, this._uiController = o, this._univerInstanceService = s, this._init();
|
|
702
702
|
}
|
|
703
703
|
_initCustomComponents() {
|
|
704
704
|
const i = this._componentManager;
|
|
705
|
-
this.disposeWithMe(i.register(
|
|
705
|
+
this.disposeWithMe(i.register(nt, zn)), this.disposeWithMe(i.register(Dt, Zt)), this.disposeWithMe(i.register(Pt, qt)), this.disposeWithMe(i.register(Ut, Jt));
|
|
706
706
|
}
|
|
707
707
|
_initMenus() {
|
|
708
708
|
[
|
|
@@ -711,18 +711,18 @@ let Se = class extends Y {
|
|
|
711
711
|
Ti,
|
|
712
712
|
Ii,
|
|
713
713
|
bi,
|
|
714
|
-
Mi,
|
|
715
|
-
Ei,
|
|
716
714
|
yi,
|
|
715
|
+
Ei,
|
|
716
|
+
Mi,
|
|
717
717
|
xi,
|
|
718
718
|
Di,
|
|
719
719
|
Pi,
|
|
720
720
|
Ui,
|
|
721
|
-
Li,
|
|
722
721
|
Ni,
|
|
723
722
|
Ai,
|
|
724
|
-
|
|
725
|
-
Bi
|
|
723
|
+
Li,
|
|
724
|
+
Bi,
|
|
725
|
+
$i
|
|
726
726
|
].forEach((i) => {
|
|
727
727
|
this.disposeWithMe(this._menuService.addMenuItem(this._injector.invoke(i)));
|
|
728
728
|
});
|
|
@@ -731,31 +731,31 @@ let Se = class extends Y {
|
|
|
731
731
|
this._initCustomComponents(), this._initMenus(), this._initDocBackground(), this._initFocusHandler();
|
|
732
732
|
}
|
|
733
733
|
_initDocBackground() {
|
|
734
|
-
const i = this._univerInstanceService.getAllUnitsForType(
|
|
734
|
+
const i = this._univerInstanceService.getAllUnitsForType(m.UNIVER_DOC)[0].getUnitId();
|
|
735
735
|
if (i == null)
|
|
736
736
|
return;
|
|
737
737
|
this._editorService.isEditor(i) || this.disposeWithMe(
|
|
738
|
-
this._uiController.registerComponent(Qt.CONTENT, () =>
|
|
738
|
+
this._uiController.registerComponent(Qt.CONTENT, () => Nn(Ci, this._injector))
|
|
739
739
|
);
|
|
740
740
|
}
|
|
741
741
|
_initFocusHandler() {
|
|
742
742
|
this.disposeWithMe(
|
|
743
|
-
this._layoutService.registerFocusHandler(
|
|
744
|
-
this._injector.get(
|
|
743
|
+
this._layoutService.registerFocusHandler(m.UNIVER_DOC, () => {
|
|
744
|
+
this._injector.get(ue).focus();
|
|
745
745
|
})
|
|
746
746
|
);
|
|
747
747
|
}
|
|
748
748
|
};
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
k(0,
|
|
752
|
-
k(1,
|
|
753
|
-
k(2,
|
|
749
|
+
Ce = ji([
|
|
750
|
+
L(B.Rendered, Ce),
|
|
751
|
+
k(0, R(Ue)),
|
|
752
|
+
k(1, R(en)),
|
|
753
|
+
k(2, yt),
|
|
754
754
|
k(3, $),
|
|
755
755
|
k(4, tn),
|
|
756
756
|
k(5, nn),
|
|
757
|
-
k(6,
|
|
758
|
-
],
|
|
757
|
+
k(6, U)
|
|
758
|
+
], Ce);
|
|
759
759
|
const Vi = {
|
|
760
760
|
toolbar: {
|
|
761
761
|
undo: "Undo",
|
|
@@ -784,7 +784,7 @@ const Vi = {
|
|
|
784
784
|
alignRight: "Align Right",
|
|
785
785
|
alignJustify: "Justify"
|
|
786
786
|
}
|
|
787
|
-
},
|
|
787
|
+
}, qr = Vi, Wi = {
|
|
788
788
|
toolbar: {
|
|
789
789
|
undo: "撤销",
|
|
790
790
|
redo: "重做",
|
|
@@ -812,29 +812,57 @@ const Vi = {
|
|
|
812
812
|
alignRight: "右对齐",
|
|
813
813
|
alignJustify: "两端对齐"
|
|
814
814
|
}
|
|
815
|
-
},
|
|
815
|
+
}, ki = Wi, zi = {
|
|
816
|
+
toolbar: {
|
|
817
|
+
undo: "Отменить",
|
|
818
|
+
redo: "Повторить",
|
|
819
|
+
font: "Шрифт",
|
|
820
|
+
fontSize: "Размер шрифта",
|
|
821
|
+
bold: "Полужирный",
|
|
822
|
+
italic: "Курсив",
|
|
823
|
+
strikethrough: "Зачеркнутый",
|
|
824
|
+
subscript: "Нижний индекс",
|
|
825
|
+
superscript: "Верхний индекс",
|
|
826
|
+
underline: "Подчеркнутый",
|
|
827
|
+
textColor: {
|
|
828
|
+
main: "Цвет текста",
|
|
829
|
+
right: "Выбрать цвет"
|
|
830
|
+
},
|
|
831
|
+
fillColor: {
|
|
832
|
+
main: "Цвет фона текста",
|
|
833
|
+
right: "Выбрать цвет"
|
|
834
|
+
},
|
|
835
|
+
resetColor: "Сбросить",
|
|
836
|
+
order: "Упорядоченный список",
|
|
837
|
+
unorder: "Неупорядоченный список",
|
|
838
|
+
alignLeft: "Выровнять по левому краю",
|
|
839
|
+
alignCenter: "Выровнять по центру",
|
|
840
|
+
alignRight: "Выровнять по правому краю",
|
|
841
|
+
alignJustify: "Выровнять по ширине"
|
|
842
|
+
}
|
|
843
|
+
}, Jr = zi, Hi = {
|
|
816
844
|
id: bn.id,
|
|
817
|
-
preconditions:
|
|
818
|
-
binding:
|
|
819
|
-
}, Hi = {
|
|
820
|
-
id: Mn.id,
|
|
821
|
-
preconditions: B,
|
|
822
|
-
binding: P.BACKSPACE
|
|
845
|
+
preconditions: Kn,
|
|
846
|
+
binding: D.ENTER
|
|
823
847
|
}, Yi = {
|
|
824
848
|
id: yn.id,
|
|
825
|
-
preconditions:
|
|
826
|
-
binding:
|
|
827
|
-
},
|
|
849
|
+
preconditions: A,
|
|
850
|
+
binding: D.BACKSPACE
|
|
851
|
+
}, Gi = {
|
|
852
|
+
id: Mn.id,
|
|
853
|
+
preconditions: A,
|
|
854
|
+
binding: D.DELETE
|
|
855
|
+
}, Xi = 10, Ki = 6;
|
|
828
856
|
function Zi() {
|
|
829
|
-
return qe.generateRandomId(
|
|
857
|
+
return qe.generateRandomId(Ki);
|
|
830
858
|
}
|
|
831
859
|
function qi(i) {
|
|
832
860
|
const e = i.match(/data-copy-id="([^\s]+)"/);
|
|
833
861
|
return e && e[1] ? e[1] : null;
|
|
834
862
|
}
|
|
835
|
-
class
|
|
863
|
+
class Ji {
|
|
836
864
|
constructor() {
|
|
837
|
-
|
|
865
|
+
p(this, "_cache", new wt(Xi));
|
|
838
866
|
}
|
|
839
867
|
set(e, t) {
|
|
840
868
|
this._cache.set(e, t);
|
|
@@ -846,8 +874,8 @@ class Ki {
|
|
|
846
874
|
this._cache.clear();
|
|
847
875
|
}
|
|
848
876
|
}
|
|
849
|
-
const
|
|
850
|
-
function
|
|
877
|
+
const mt = new Ji();
|
|
878
|
+
function it(i) {
|
|
851
879
|
const e = i.style, t = {}, n = i.tagName.toLowerCase();
|
|
852
880
|
switch (n) {
|
|
853
881
|
case "b":
|
|
@@ -879,44 +907,44 @@ function nt(i) {
|
|
|
879
907
|
}
|
|
880
908
|
}
|
|
881
909
|
for (let r = 0; r < e.length; r++) {
|
|
882
|
-
const
|
|
883
|
-
switch (
|
|
910
|
+
const o = e[r], s = e.getPropertyValue(o);
|
|
911
|
+
switch (o) {
|
|
884
912
|
case "font-family": {
|
|
885
|
-
t.ff =
|
|
913
|
+
t.ff = s;
|
|
886
914
|
break;
|
|
887
915
|
}
|
|
888
916
|
case "font-size": {
|
|
889
|
-
const a = Number.parseInt(
|
|
890
|
-
Number.isNaN(a) || (
|
|
917
|
+
const a = Number.parseInt(s);
|
|
918
|
+
Number.isNaN(a) || (s.endsWith("pt") ? t.fs = a : s.endsWith("px") && (t.fs = An(a)));
|
|
891
919
|
break;
|
|
892
920
|
}
|
|
893
921
|
case "font-style": {
|
|
894
|
-
|
|
922
|
+
s === "italic" && (t.it = C.TRUE);
|
|
895
923
|
break;
|
|
896
924
|
}
|
|
897
925
|
case "font-weight": {
|
|
898
|
-
Number(
|
|
926
|
+
Number(s) > 400 && (t.bl = C.TRUE);
|
|
899
927
|
break;
|
|
900
928
|
}
|
|
901
929
|
case "text-decoration": {
|
|
902
|
-
/underline/.test(
|
|
930
|
+
/underline/.test(s) ? t.ul = {
|
|
903
931
|
s: C.TRUE
|
|
904
|
-
} : /overline/.test(
|
|
932
|
+
} : /overline/.test(s) ? t.ol = {
|
|
905
933
|
s: C.TRUE
|
|
906
|
-
} : /line-through/.test(
|
|
934
|
+
} : /line-through/.test(s) && (t.st = {
|
|
907
935
|
s: C.TRUE
|
|
908
936
|
});
|
|
909
937
|
break;
|
|
910
938
|
}
|
|
911
939
|
case "color": {
|
|
912
|
-
const a = new
|
|
940
|
+
const a = new ot(s);
|
|
913
941
|
a.isValid && (t.cl = {
|
|
914
942
|
rgb: a.toRgbString()
|
|
915
943
|
});
|
|
916
944
|
break;
|
|
917
945
|
}
|
|
918
946
|
case "background-color": {
|
|
919
|
-
const a = new
|
|
947
|
+
const a = new ot(s);
|
|
920
948
|
a.isValid && (t.bg = {
|
|
921
949
|
rgb: a.toRgbString()
|
|
922
950
|
});
|
|
@@ -926,19 +954,19 @@ function nt(i) {
|
|
|
926
954
|
}
|
|
927
955
|
return t;
|
|
928
956
|
}
|
|
929
|
-
function
|
|
957
|
+
function Qi(i) {
|
|
930
958
|
const e = new DOMParser(), t = `<x-univer id="univer-root">${i}</x-univer>`;
|
|
931
959
|
return e.parseFromString(t, "text/html").querySelector("#univer-root");
|
|
932
960
|
}
|
|
933
|
-
function
|
|
961
|
+
function St(i, e) {
|
|
934
962
|
const t = i.tagName.toLowerCase();
|
|
935
963
|
return typeof e == "string" ? t === e : Array.isArray(e) ? e.some((n) => n === t) : e(i);
|
|
936
964
|
}
|
|
937
|
-
const
|
|
965
|
+
const xe = class xe {
|
|
938
966
|
constructor() {
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
967
|
+
p(this, "_styleCache", /* @__PURE__ */ new Map());
|
|
968
|
+
p(this, "_styleRules", []);
|
|
969
|
+
p(this, "_afterProcessRules", []);
|
|
942
970
|
}
|
|
943
971
|
static use(e) {
|
|
944
972
|
if (this._pluginList.includes(e))
|
|
@@ -946,7 +974,7 @@ const Ee = class Ee {
|
|
|
946
974
|
this._pluginList.push(e);
|
|
947
975
|
}
|
|
948
976
|
convert(e) {
|
|
949
|
-
const t =
|
|
977
|
+
const t = xe._pluginList.find((o) => o.checkPasteType(e)), n = Qi(e), r = {
|
|
950
978
|
dataStream: "",
|
|
951
979
|
textRuns: []
|
|
952
980
|
};
|
|
@@ -954,30 +982,30 @@ const Ee = class Ee {
|
|
|
954
982
|
}
|
|
955
983
|
_process(e, t, n) {
|
|
956
984
|
var r;
|
|
957
|
-
for (const
|
|
958
|
-
if (
|
|
959
|
-
const
|
|
985
|
+
for (const o of t)
|
|
986
|
+
if (o.nodeType === Node.TEXT_NODE) {
|
|
987
|
+
const s = (r = o.nodeValue) == null ? void 0 : r.replace(/[\r\n]/g, "");
|
|
960
988
|
let a;
|
|
961
|
-
e && this._styleCache.has(e) && (a = this._styleCache.get(e)), n.dataStream +=
|
|
962
|
-
st: n.dataStream.length -
|
|
989
|
+
e && this._styleCache.has(e) && (a = this._styleCache.get(e)), n.dataStream += s, a && Object.getOwnPropertyNames(a).length && n.textRuns.push({
|
|
990
|
+
st: n.dataStream.length - s.length,
|
|
963
991
|
ed: n.dataStream.length,
|
|
964
992
|
ts: a
|
|
965
993
|
});
|
|
966
|
-
} else if (
|
|
967
|
-
const
|
|
968
|
-
this._styleCache.set(
|
|
969
|
-
const { childNodes:
|
|
970
|
-
this._process(
|
|
994
|
+
} else if (o.nodeType === Node.ELEMENT_NODE) {
|
|
995
|
+
const s = e ? this._styleCache.get(e) : {}, a = this._styleRules.find(({ filter: h }) => St(o, h)), c = a ? a.getStyle(o) : it(o);
|
|
996
|
+
this._styleCache.set(o, { ...s, ...c });
|
|
997
|
+
const { childNodes: l } = o;
|
|
998
|
+
this._process(o, l, n);
|
|
971
999
|
const u = this._afterProcessRules.find(
|
|
972
|
-
({ filter: h }) =>
|
|
1000
|
+
({ filter: h }) => St(o, h)
|
|
973
1001
|
);
|
|
974
|
-
u && u.handler(n,
|
|
1002
|
+
u && u.handler(n, o);
|
|
975
1003
|
}
|
|
976
1004
|
}
|
|
977
1005
|
};
|
|
978
|
-
|
|
979
|
-
let Q =
|
|
980
|
-
const
|
|
1006
|
+
p(xe, "_pluginList", []);
|
|
1007
|
+
let Q = xe;
|
|
1008
|
+
const er = {
|
|
981
1009
|
name: "univer-doc-paste-plugin-lark",
|
|
982
1010
|
checkPasteType(i) {
|
|
983
1011
|
return /lark-record-clipboard/i.test(i);
|
|
@@ -987,7 +1015,7 @@ const Qi = {
|
|
|
987
1015
|
{
|
|
988
1016
|
filter: ["s"],
|
|
989
1017
|
getStyle(i) {
|
|
990
|
-
const e =
|
|
1018
|
+
const e = it(i);
|
|
991
1019
|
return {
|
|
992
1020
|
st: {
|
|
993
1021
|
s: C.TRUE
|
|
@@ -1009,32 +1037,32 @@ const Qi = {
|
|
|
1009
1037
|
}
|
|
1010
1038
|
}
|
|
1011
1039
|
]
|
|
1012
|
-
},
|
|
1013
|
-
function
|
|
1040
|
+
}, tr = er;
|
|
1041
|
+
function Lt(i) {
|
|
1014
1042
|
const e = i.style, t = {};
|
|
1015
1043
|
for (let n = 0; n < e.length; n++) {
|
|
1016
|
-
const r = e[n],
|
|
1044
|
+
const r = e[n], o = e.getPropertyValue(r);
|
|
1017
1045
|
switch (r) {
|
|
1018
1046
|
case "margin-top": {
|
|
1019
|
-
const
|
|
1020
|
-
t.spaceAbove = /pt/.test(
|
|
1047
|
+
const s = Number.parseInt(o);
|
|
1048
|
+
t.spaceAbove = /pt/.test(o) ? ut(s) : s;
|
|
1021
1049
|
break;
|
|
1022
1050
|
}
|
|
1023
1051
|
case "margin-bottom": {
|
|
1024
|
-
const
|
|
1025
|
-
t.spaceBelow = /pt/.test(
|
|
1052
|
+
const s = Number.parseInt(o);
|
|
1053
|
+
t.spaceBelow = /pt/.test(o) ? ut(s) : s;
|
|
1026
1054
|
break;
|
|
1027
1055
|
}
|
|
1028
1056
|
case "line-height": {
|
|
1029
|
-
const
|
|
1030
|
-
t.lineSpacing =
|
|
1057
|
+
const s = Number.parseFloat(o);
|
|
1058
|
+
t.lineSpacing = s;
|
|
1031
1059
|
break;
|
|
1032
1060
|
}
|
|
1033
1061
|
}
|
|
1034
1062
|
}
|
|
1035
1063
|
return Object.getOwnPropertyNames(t).length ? t : null;
|
|
1036
1064
|
}
|
|
1037
|
-
const
|
|
1065
|
+
const nr = {
|
|
1038
1066
|
name: "univer-doc-paste-plugin-word",
|
|
1039
1067
|
checkPasteType(i) {
|
|
1040
1068
|
return /word|mso/i.test(i);
|
|
@@ -1043,7 +1071,7 @@ const tr = {
|
|
|
1043
1071
|
{
|
|
1044
1072
|
filter: ["b"],
|
|
1045
1073
|
getStyle(i) {
|
|
1046
|
-
const e =
|
|
1074
|
+
const e = it(i);
|
|
1047
1075
|
return { bl: C.TRUE, ...e };
|
|
1048
1076
|
}
|
|
1049
1077
|
}
|
|
@@ -1057,12 +1085,12 @@ const tr = {
|
|
|
1057
1085
|
i.paragraphs == null && (i.paragraphs = []);
|
|
1058
1086
|
const t = {
|
|
1059
1087
|
startIndex: i.dataStream.length
|
|
1060
|
-
}, n =
|
|
1088
|
+
}, n = Lt(e);
|
|
1061
1089
|
n && (t.paragraphStyle = n), i.paragraphs.push(t), i.dataStream += "\r";
|
|
1062
1090
|
}
|
|
1063
1091
|
}
|
|
1064
1092
|
]
|
|
1065
|
-
},
|
|
1093
|
+
}, ir = nr, rr = {
|
|
1066
1094
|
name: "univer-doc-paste-plugin-univer",
|
|
1067
1095
|
checkPasteType(i) {
|
|
1068
1096
|
return /UniverNormal/i.test(i);
|
|
@@ -1077,69 +1105,69 @@ const tr = {
|
|
|
1077
1105
|
i.paragraphs == null && (i.paragraphs = []);
|
|
1078
1106
|
const t = {
|
|
1079
1107
|
startIndex: i.dataStream.length
|
|
1080
|
-
}, n =
|
|
1108
|
+
}, n = Lt(e);
|
|
1081
1109
|
n && (t.paragraphStyle = n), i.paragraphs.push(t), i.dataStream += "\r";
|
|
1082
1110
|
}
|
|
1083
1111
|
}
|
|
1084
1112
|
]
|
|
1085
|
-
},
|
|
1086
|
-
function
|
|
1087
|
-
const { st: t, ed: n, ts: r = {} } = e, { ff:
|
|
1088
|
-
let
|
|
1113
|
+
}, or = rr;
|
|
1114
|
+
function vt(i, e) {
|
|
1115
|
+
const { st: t, ed: n, ts: r = {} } = e, { ff: o, fs: s, it: a, bl: c, ul: l, st: u, ol: h, bg: f, cl: g, va: S } = r;
|
|
1116
|
+
let d = i.slice(t, n);
|
|
1089
1117
|
const _ = [];
|
|
1090
|
-
return a === C.TRUE && (
|
|
1118
|
+
return a === C.TRUE && (d = `<i>${d}</i>`), S === J.SUPERSCRIPT ? d = `<sup>${d}</sup>` : S === J.SUBSCRIPT && (d = `<sub>${d}</sub>`), (l == null ? void 0 : l.s) === C.TRUE && (d = `<u>${d}</u>`), (u == null ? void 0 : u.s) === C.TRUE && (d = `<s>${d}</s>`), c === C.TRUE && (d = `<strong>${d}</strong>`), o && _.push(`font-family: ${o}`), g && _.push(`color: ${g.rgb}`), s && _.push(`font-size: ${s}pt`), h && _.push("text-decoration: overline"), f && _.push(`background: ${f.rgb}`), _.length ? `<span style="${_.join("; ")};">${d}</span>` : d;
|
|
1091
1119
|
}
|
|
1092
|
-
function
|
|
1120
|
+
function ke(i, e, t) {
|
|
1093
1121
|
const { dataStream: n, textRuns: r = [] } = i;
|
|
1094
|
-
let
|
|
1095
|
-
const
|
|
1122
|
+
let o = e;
|
|
1123
|
+
const s = [];
|
|
1096
1124
|
for (const a of r) {
|
|
1097
|
-
const { st: c, ed:
|
|
1098
|
-
qe.hasIntersectionBetweenTwoRanges(e, t, c,
|
|
1125
|
+
const { st: c, ed: l } = a;
|
|
1126
|
+
qe.hasIntersectionBetweenTwoRanges(e, t, c, l) && (c > o ? (s.push(n.slice(o, c)), s.push(vt(n, {
|
|
1099
1127
|
...a,
|
|
1100
|
-
ed: Math.min(
|
|
1101
|
-
}))) :
|
|
1128
|
+
ed: Math.min(l, t)
|
|
1129
|
+
}))) : s.push(vt(n, {
|
|
1102
1130
|
...a,
|
|
1103
|
-
st:
|
|
1104
|
-
ed: Math.min(
|
|
1105
|
-
}))),
|
|
1131
|
+
st: o,
|
|
1132
|
+
ed: Math.min(l, t)
|
|
1133
|
+
}))), o = Math.max(e, Math.min(l, t));
|
|
1106
1134
|
}
|
|
1107
|
-
return
|
|
1135
|
+
return o !== t && s.push(n.slice(o, t)), s.join("");
|
|
1108
1136
|
}
|
|
1109
|
-
function
|
|
1137
|
+
function Ct(i, e = !0) {
|
|
1110
1138
|
var t;
|
|
1111
1139
|
if (e && ((t = i.paragraphs) != null && t.length)) {
|
|
1112
1140
|
const { dataStream: n, paragraphs: r = [] } = i;
|
|
1113
|
-
let
|
|
1141
|
+
let o = "", s = -1;
|
|
1114
1142
|
for (const a of r) {
|
|
1115
|
-
const { startIndex: c, paragraphStyle:
|
|
1116
|
-
u != null && (typeof u == "number" ? g.push(`margin-top: ${u}px`) : g.push(`margin-top: ${u.v}px`)), h != null && (typeof h == "number" ? g.push(`margin-bottom: ${h}px`) : g.push(`margin-bottom: ${h.v}px`)),
|
|
1143
|
+
const { startIndex: c, paragraphStyle: l = {} } = a, { spaceAbove: u, spaceBelow: h, lineSpacing: f } = l, g = [];
|
|
1144
|
+
u != null && (typeof u == "number" ? g.push(`margin-top: ${u}px`) : g.push(`margin-top: ${u.v}px`)), h != null && (typeof h == "number" ? g.push(`margin-bottom: ${h}px`) : g.push(`margin-bottom: ${h.v}px`)), f != null && g.push(`line-height: ${f}`), c > s + 1 ? o += `<p class="UniverNormal" ${g.length ? `style="${g.join("; ")};"` : ""}>${ke(i, s + 1, c)}</p>` : o += `<p class="UniverNormal" ${g.length ? `style="${g.join("; ")};"` : ""}></p>`, s = c;
|
|
1117
1145
|
}
|
|
1118
|
-
return
|
|
1146
|
+
return s !== n.length && (o += ke(i, s, n.length)), o;
|
|
1119
1147
|
} else
|
|
1120
|
-
return
|
|
1148
|
+
return ke(i, 0, i.dataStream.length);
|
|
1121
1149
|
}
|
|
1122
|
-
class
|
|
1150
|
+
class sr {
|
|
1123
1151
|
convert(e) {
|
|
1124
1152
|
if (e.length === 0)
|
|
1125
1153
|
throw new Error("The bodyList length at least to be 1");
|
|
1126
1154
|
if (e.length === 1)
|
|
1127
|
-
return
|
|
1155
|
+
return Ct(e[0]);
|
|
1128
1156
|
let t = "";
|
|
1129
1157
|
for (const n of e)
|
|
1130
|
-
t += '<p className="UniverNormal">', t +=
|
|
1158
|
+
t += '<p className="UniverNormal">', t += Ct(n, !1), t += "</p>";
|
|
1131
1159
|
return t;
|
|
1132
1160
|
}
|
|
1133
1161
|
}
|
|
1134
|
-
var
|
|
1135
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1136
|
-
(
|
|
1137
|
-
return n && r &&
|
|
1138
|
-
},
|
|
1139
|
-
Q.use(
|
|
1140
|
-
Q.use(
|
|
1141
|
-
Q.use(
|
|
1142
|
-
function
|
|
1162
|
+
var ar = Object.defineProperty, cr = Object.getOwnPropertyDescriptor, lr = (i, e, t, n) => {
|
|
1163
|
+
for (var r = n > 1 ? void 0 : n ? cr(e, t) : e, o = i.length - 1, s; o >= 0; o--)
|
|
1164
|
+
(s = i[o]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
1165
|
+
return n && r && ar(e, t, r), r;
|
|
1166
|
+
}, re = (i, e) => (t, n) => e(t, n, i);
|
|
1167
|
+
Q.use(ir);
|
|
1168
|
+
Q.use(tr);
|
|
1169
|
+
Q.use(or);
|
|
1170
|
+
function dr(i) {
|
|
1143
1171
|
const e = i.replace(/\n/g, "\r"), t = [];
|
|
1144
1172
|
for (let n = 0; n < e.length; n++)
|
|
1145
1173
|
e[n] === "\r" && t.push({ startIndex: n });
|
|
@@ -1148,14 +1176,14 @@ function lr(i) {
|
|
|
1148
1176
|
paragraphs: t
|
|
1149
1177
|
};
|
|
1150
1178
|
}
|
|
1151
|
-
const
|
|
1152
|
-
let Xe = class extends
|
|
1153
|
-
constructor(e, t, n, r,
|
|
1179
|
+
const he = Xt("doc.clipboard-service");
|
|
1180
|
+
let Xe = class extends ee {
|
|
1181
|
+
constructor(e, t, n, r, o) {
|
|
1154
1182
|
super();
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
this._univerInstanceService = e, this._logService = t, this._commandService = n, this._clipboardInterfaceService = r, this._textSelectionManagerService =
|
|
1183
|
+
p(this, "_clipboardHooks", []);
|
|
1184
|
+
p(this, "_htmlToUDM", new Q());
|
|
1185
|
+
p(this, "_umdToHtml", new sr());
|
|
1186
|
+
this._univerInstanceService = e, this._logService = t, this._commandService = n, this._clipboardInterfaceService = r, this._textSelectionManagerService = o;
|
|
1159
1187
|
}
|
|
1160
1188
|
async copy() {
|
|
1161
1189
|
const e = this._getDocumentBodyInRanges();
|
|
@@ -1180,25 +1208,25 @@ let Xe = class extends Y {
|
|
|
1180
1208
|
return this._paste(n);
|
|
1181
1209
|
}
|
|
1182
1210
|
async _cut() {
|
|
1183
|
-
var
|
|
1211
|
+
var o;
|
|
1184
1212
|
const {
|
|
1185
1213
|
segmentId: e,
|
|
1186
1214
|
endOffset: t,
|
|
1187
1215
|
style: n
|
|
1188
|
-
} = (
|
|
1216
|
+
} = (o = this._textSelectionManagerService.getActiveRange()) != null ? o : {}, r = this._textSelectionManagerService.getSelections();
|
|
1189
1217
|
if (e == null && this._logService.error("[DocClipboardController] segmentId is not existed"), t == null || r == null)
|
|
1190
1218
|
return !1;
|
|
1191
1219
|
this.copy();
|
|
1192
1220
|
try {
|
|
1193
|
-
let
|
|
1221
|
+
let s = t;
|
|
1194
1222
|
for (const c of r) {
|
|
1195
|
-
const { startOffset:
|
|
1196
|
-
|
|
1223
|
+
const { startOffset: l, endOffset: u } = c;
|
|
1224
|
+
l == null || u == null || u <= t && (s -= u - l);
|
|
1197
1225
|
}
|
|
1198
1226
|
const a = [
|
|
1199
1227
|
{
|
|
1200
|
-
startOffset:
|
|
1201
|
-
endOffset:
|
|
1228
|
+
startOffset: s,
|
|
1229
|
+
endOffset: s,
|
|
1202
1230
|
style: n
|
|
1203
1231
|
}
|
|
1204
1232
|
];
|
|
@@ -1208,14 +1236,14 @@ let Xe = class extends Y {
|
|
|
1208
1236
|
}
|
|
1209
1237
|
}
|
|
1210
1238
|
async _paste(e) {
|
|
1211
|
-
var
|
|
1212
|
-
const { segmentId: t, endOffset: n, style: r } = (
|
|
1213
|
-
if (t == null && this._logService.error("[DocClipboardController] segmentId does not exist!"), n == null ||
|
|
1239
|
+
var s;
|
|
1240
|
+
const { segmentId: t, endOffset: n, style: r } = (s = this._textSelectionManagerService.getActiveRange()) != null ? s : {}, o = this._textSelectionManagerService.getSelections();
|
|
1241
|
+
if (t == null && this._logService.error("[DocClipboardController] segmentId does not exist!"), n == null || o == null)
|
|
1214
1242
|
return !1;
|
|
1215
1243
|
try {
|
|
1216
1244
|
let a = n;
|
|
1217
|
-
for (const
|
|
1218
|
-
const { startOffset: u, endOffset: h } =
|
|
1245
|
+
for (const l of o) {
|
|
1246
|
+
const { startOffset: u, endOffset: h } = l;
|
|
1219
1247
|
u == null || h == null || h <= n && (a += e.dataStream.length - (h - u));
|
|
1220
1248
|
}
|
|
1221
1249
|
const c = [
|
|
@@ -1225,19 +1253,19 @@ let Xe = class extends Y {
|
|
|
1225
1253
|
style: r
|
|
1226
1254
|
}
|
|
1227
1255
|
];
|
|
1228
|
-
return this._commandService.executeCommand(
|
|
1256
|
+
return this._commandService.executeCommand(Et.id, { body: e, segmentId: t, textRanges: c });
|
|
1229
1257
|
} catch {
|
|
1230
1258
|
return this._logService.error("[DocClipboardController]", "clipboard is empty."), !1;
|
|
1231
1259
|
}
|
|
1232
1260
|
}
|
|
1233
1261
|
async _setClipboardData(e) {
|
|
1234
|
-
const t = Zi(), n = e.length > 1 ? e.map((
|
|
1262
|
+
const t = Zi(), n = e.length > 1 ? e.map((o) => o.dataStream).join(`
|
|
1235
1263
|
`) : e[0].dataStream;
|
|
1236
1264
|
let r = this._umdToHtml.convert(e);
|
|
1237
|
-
return e.length === 1 && (r = r.replace(/(<[a-z]+)/, (
|
|
1265
|
+
return e.length === 1 && (r = r.replace(/(<[a-z]+)/, (o, s) => `${s} data-copy-id="${t}"`), mt.set(t, e[0])), this._clipboardInterfaceService.write(n, r);
|
|
1238
1266
|
}
|
|
1239
1267
|
addClipboardHook(e) {
|
|
1240
|
-
return this._clipboardHooks.push(e),
|
|
1268
|
+
return this._clipboardHooks.push(e), j(() => {
|
|
1241
1269
|
const t = this._clipboardHooks.indexOf(e);
|
|
1242
1270
|
t > -1 && this._clipboardHooks.splice(t, 1);
|
|
1243
1271
|
});
|
|
@@ -1247,10 +1275,10 @@ let Xe = class extends Y {
|
|
|
1247
1275
|
if (e == null || !t)
|
|
1248
1276
|
return n;
|
|
1249
1277
|
for (const r of e) {
|
|
1250
|
-
const { startOffset:
|
|
1251
|
-
if (a ||
|
|
1278
|
+
const { startOffset: o, endOffset: s, collapsed: a } = r;
|
|
1279
|
+
if (a || o == null || s == null)
|
|
1252
1280
|
continue;
|
|
1253
|
-
const c = t.sliceBody(
|
|
1281
|
+
const c = t.sliceBody(o, s);
|
|
1254
1282
|
c != null && n.push(c);
|
|
1255
1283
|
}
|
|
1256
1284
|
return n;
|
|
@@ -1259,8 +1287,8 @@ let Xe = class extends Y {
|
|
|
1259
1287
|
try {
|
|
1260
1288
|
let t = "", n = "";
|
|
1261
1289
|
for (const r of e)
|
|
1262
|
-
for (const
|
|
1263
|
-
|
|
1290
|
+
for (const o of r.types)
|
|
1291
|
+
o === rn ? n = await r.getType(o).then((s) => s && s.text()) : o === on && (t = await r.getType(o).then((s) => s && s.text()));
|
|
1264
1292
|
return this._generateBodyFromHtmlAndText(t, n);
|
|
1265
1293
|
} catch (t) {
|
|
1266
1294
|
return Promise.reject(t);
|
|
@@ -1269,98 +1297,98 @@ let Xe = class extends Y {
|
|
|
1269
1297
|
_generateBodyFromHtmlAndText(e, t) {
|
|
1270
1298
|
if (!e) {
|
|
1271
1299
|
if (t)
|
|
1272
|
-
return
|
|
1300
|
+
return dr(t);
|
|
1273
1301
|
throw new Error("[DocClipboardService] html and text cannot be both empty!");
|
|
1274
1302
|
}
|
|
1275
1303
|
const n = qi(e);
|
|
1276
1304
|
if (n) {
|
|
1277
|
-
const r =
|
|
1305
|
+
const r = mt.get(n);
|
|
1278
1306
|
if (r)
|
|
1279
1307
|
return r;
|
|
1280
1308
|
}
|
|
1281
1309
|
return this._htmlToUDM.convert(e);
|
|
1282
1310
|
}
|
|
1283
1311
|
};
|
|
1284
|
-
Xe =
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1312
|
+
Xe = lr([
|
|
1313
|
+
re(0, U),
|
|
1314
|
+
re(1, bt),
|
|
1315
|
+
re(2, v),
|
|
1316
|
+
re(3, Qe),
|
|
1317
|
+
re(4, R(ne))
|
|
1290
1318
|
], Xe);
|
|
1291
|
-
function
|
|
1292
|
-
return i.getContextValue(
|
|
1319
|
+
function je(i) {
|
|
1320
|
+
return i.getContextValue(De) || i.getContextValue(Tt);
|
|
1293
1321
|
}
|
|
1294
|
-
const
|
|
1322
|
+
const rt = 999, ur = {
|
|
1295
1323
|
id: sn.id,
|
|
1296
1324
|
name: "doc.command.copy",
|
|
1297
|
-
type:
|
|
1325
|
+
type: Je.COMMAND,
|
|
1298
1326
|
multi: !0,
|
|
1299
|
-
priority:
|
|
1300
|
-
preconditions:
|
|
1301
|
-
handler: async (i) => i.get(
|
|
1302
|
-
},
|
|
1327
|
+
priority: rt,
|
|
1328
|
+
preconditions: je,
|
|
1329
|
+
handler: async (i) => i.get(he).copy()
|
|
1330
|
+
}, hr = {
|
|
1303
1331
|
id: an.id,
|
|
1304
1332
|
name: "doc.command.cut",
|
|
1305
|
-
type:
|
|
1333
|
+
type: Je.COMMAND,
|
|
1306
1334
|
multi: !0,
|
|
1307
|
-
priority:
|
|
1308
|
-
preconditions:
|
|
1309
|
-
handler: async (i) => i.get(
|
|
1310
|
-
},
|
|
1335
|
+
priority: rt,
|
|
1336
|
+
preconditions: je,
|
|
1337
|
+
handler: async (i) => i.get(he).cut()
|
|
1338
|
+
}, gr = {
|
|
1311
1339
|
id: cn.id,
|
|
1312
1340
|
name: "doc.command.paste",
|
|
1313
|
-
type:
|
|
1341
|
+
type: Je.COMMAND,
|
|
1314
1342
|
multi: !0,
|
|
1315
|
-
priority:
|
|
1316
|
-
preconditions:
|
|
1343
|
+
priority: rt,
|
|
1344
|
+
preconditions: je,
|
|
1317
1345
|
handler: async (i) => {
|
|
1318
|
-
const e = i.get(
|
|
1346
|
+
const e = i.get(he), n = await i.get(Qe).read();
|
|
1319
1347
|
return n.length === 0 ? !1 : e.paste(n);
|
|
1320
1348
|
}
|
|
1321
1349
|
};
|
|
1322
|
-
var
|
|
1323
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1324
|
-
(
|
|
1325
|
-
return n && r &&
|
|
1326
|
-
},
|
|
1327
|
-
let
|
|
1350
|
+
var _r = Object.defineProperty, pr = Object.getOwnPropertyDescriptor, fr = (i, e, t, n) => {
|
|
1351
|
+
for (var r = n > 1 ? void 0 : n ? pr(e, t) : e, o = i.length - 1, s; o >= 0; o--)
|
|
1352
|
+
(s = i[o]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
1353
|
+
return n && r && _r(e, t, r), r;
|
|
1354
|
+
}, oe = (i, e) => (t, n) => e(t, n, i);
|
|
1355
|
+
let Oe = class extends le {
|
|
1328
1356
|
constructor(i, e, t, n, r) {
|
|
1329
1357
|
super(), this._commandService = i, this._clipboardInterfaceService = e, this._docClipboardService = t, this._textSelectionRenderManager = n, this._contextService = r, this._init();
|
|
1330
1358
|
}
|
|
1331
1359
|
_init() {
|
|
1332
|
-
[
|
|
1360
|
+
[ur, hr, gr].forEach((i) => this.disposeWithMe(this._commandService.registerMultipleCommand(i))), [Et, Mt].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i))), this._initLegacyPasteCommand();
|
|
1333
1361
|
}
|
|
1334
1362
|
_initLegacyPasteCommand() {
|
|
1335
1363
|
var i;
|
|
1336
|
-
(i = this._textSelectionRenderManager) == null || i.onPaste$.pipe(
|
|
1337
|
-
var
|
|
1338
|
-
if (!
|
|
1364
|
+
(i = this._textSelectionRenderManager) == null || i.onPaste$.pipe(ce(this.dispose$)).subscribe((e) => {
|
|
1365
|
+
var o, s;
|
|
1366
|
+
if (!je(this._contextService))
|
|
1339
1367
|
return;
|
|
1340
1368
|
e.event.preventDefault();
|
|
1341
|
-
const t = e.event, n = (
|
|
1369
|
+
const t = e.event, n = (o = t.clipboardData) == null ? void 0 : o.getData("text/html"), r = (s = t.clipboardData) == null ? void 0 : s.getData("text/plain");
|
|
1342
1370
|
this._docClipboardService.legacyPaste(n, r);
|
|
1343
1371
|
});
|
|
1344
1372
|
}
|
|
1345
1373
|
};
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
],
|
|
1354
|
-
var
|
|
1355
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1356
|
-
(
|
|
1357
|
-
return n && r &&
|
|
1358
|
-
},
|
|
1359
|
-
let
|
|
1360
|
-
constructor(e, t, n, r,
|
|
1374
|
+
Oe = fr([
|
|
1375
|
+
L(B.Rendered, Oe),
|
|
1376
|
+
oe(0, v),
|
|
1377
|
+
oe(1, Qe),
|
|
1378
|
+
oe(2, he),
|
|
1379
|
+
oe(3, ue),
|
|
1380
|
+
oe(4, jt)
|
|
1381
|
+
], Oe);
|
|
1382
|
+
var mr = Object.defineProperty, Sr = Object.getOwnPropertyDescriptor, vr = (i, e, t, n) => {
|
|
1383
|
+
for (var r = n > 1 ? void 0 : n ? Sr(e, t) : e, o = i.length - 1, s; o >= 0; o--)
|
|
1384
|
+
(s = i[o]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
1385
|
+
return n && r && mr(e, t, r), r;
|
|
1386
|
+
}, X = (i, e) => (t, n) => e(t, n, i);
|
|
1387
|
+
let Re = class extends ee {
|
|
1388
|
+
constructor(e, t, n, r, o, s) {
|
|
1361
1389
|
super();
|
|
1362
|
-
|
|
1363
|
-
this._univerInstanceService = e, this._docSkeletonManagerService = t, this._editorService = n, this._commandService = r, this._textSelectionRenderManager =
|
|
1390
|
+
p(this, "_initialEditors", /* @__PURE__ */ new Set());
|
|
1391
|
+
this._univerInstanceService = e, this._docSkeletonManagerService = t, this._editorService = n, this._commandService = r, this._textSelectionRenderManager = o, this._renderManagerService = s, this._initialize();
|
|
1364
1392
|
}
|
|
1365
1393
|
_initialize() {
|
|
1366
1394
|
this.disposeWithMe(
|
|
@@ -1373,26 +1401,26 @@ let Ce = class extends Y {
|
|
|
1373
1401
|
}), this._commandExecutedListener(), this._initialSetValue(), this._initialBlur(), this._initialFocus(), this._initialValueChange();
|
|
1374
1402
|
}
|
|
1375
1403
|
_resize(e) {
|
|
1376
|
-
var
|
|
1404
|
+
var N, F, w;
|
|
1377
1405
|
if (e == null)
|
|
1378
1406
|
return;
|
|
1379
1407
|
const t = this._editorService.getEditor(e);
|
|
1380
1408
|
if ((t == null ? void 0 : t.cancelDefaultResizeListener) === !0)
|
|
1381
1409
|
return;
|
|
1382
|
-
const n = (
|
|
1410
|
+
const n = (N = this._docSkeletonManagerService.getSkeletonByUnitId(e)) == null ? void 0 : N.skeleton, r = this._univerInstanceService.getUniverDocInstance(e);
|
|
1383
1411
|
if (t == null || t.render == null || n == null || r == null)
|
|
1384
1412
|
return;
|
|
1385
1413
|
n.calculate();
|
|
1386
|
-
const { marginTop:
|
|
1387
|
-
let { actualHeight: h, actualWidth:
|
|
1388
|
-
h +=
|
|
1389
|
-
const { width: g, height:
|
|
1390
|
-
let _ =
|
|
1391
|
-
const
|
|
1392
|
-
|
|
1393
|
-
width:
|
|
1394
|
-
height:
|
|
1395
|
-
}), u == null || u.resize(
|
|
1414
|
+
const { marginTop: o = 0, marginBottom: s = 0, marginLeft: a = 0, marginRight: c = 0 } = r.getSnapshot().documentStyle, { scene: l, mainComponent: u } = t.render;
|
|
1415
|
+
let { actualHeight: h, actualWidth: f } = n.getActualSize();
|
|
1416
|
+
h += o + s, f += a + c;
|
|
1417
|
+
const { width: g, height: S } = t.getBoundingClientRect(), d = l.getViewport(Be.VIEW_MAIN);
|
|
1418
|
+
let _ = d == null ? void 0 : d.getScrollBar();
|
|
1419
|
+
const O = Math.max(f, g), E = Math.max(h, S);
|
|
1420
|
+
l.transformByState({
|
|
1421
|
+
width: O,
|
|
1422
|
+
height: E
|
|
1423
|
+
}), u == null || u.resize(O, E), t.isSingle() ? f > g ? _ == null ? d && new Ye(d, { barSize: 8, enableVertical: !1 }) : d == null || d.resetSizeAndScrollBar() : (_ = null, d == null || d.scrollTo({ x: 0, y: 0 }), (w = d == null ? void 0 : d.getScrollBar()) == null || w.dispose()) : h > S ? _ == null ? d && new Ye(d, { enableHorizontal: !1, barSize: 8 }) : d == null || d.resetSizeAndScrollBar() : (_ = null, d == null || d.scrollTo({ x: 0, y: 0 }), (F = d == null ? void 0 : d.getScrollBar()) == null || F.dispose());
|
|
1396
1424
|
}
|
|
1397
1425
|
_initialSetValue() {
|
|
1398
1426
|
this.disposeWithMe(
|
|
@@ -1434,17 +1462,17 @@ let Ce = class extends Y {
|
|
|
1434
1462
|
"univer-formula-help-param"
|
|
1435
1463
|
];
|
|
1436
1464
|
this.disposeWithMe(
|
|
1437
|
-
|
|
1438
|
-
const
|
|
1439
|
-
if (
|
|
1465
|
+
pt(window, "mousedown").subscribe((n) => {
|
|
1466
|
+
const o = n.target.classList[0] || "";
|
|
1467
|
+
if (Vt(o, e)) {
|
|
1440
1468
|
this._editorService.changeSpreadsheetFocusState(!0), n.stopPropagation();
|
|
1441
1469
|
return;
|
|
1442
1470
|
}
|
|
1443
1471
|
this._editorService.changeSpreadsheetFocusState(!1);
|
|
1444
1472
|
})
|
|
1445
|
-
), this._univerInstanceService.getAllUnitsForType(
|
|
1446
|
-
const r = n.getUnitId(),
|
|
1447
|
-
|
|
1473
|
+
), this._univerInstanceService.getAllUnitsForType(m.UNIVER_SHEET).forEach((n) => {
|
|
1474
|
+
const r = n.getUnitId(), o = this._renderManagerService.getRenderById(r), s = o == null ? void 0 : o.engine.getCanvas().getCanvasEle();
|
|
1475
|
+
s != null && pt(s, "mousedown").subscribe((a) => {
|
|
1448
1476
|
this._editorService.changeSpreadsheetFocusState(!0), a.stopPropagation();
|
|
1449
1477
|
});
|
|
1450
1478
|
});
|
|
@@ -1472,7 +1500,7 @@ let Ce = class extends Y {
|
|
|
1472
1500
|
* Listen to document edits to refresh the size of the normula editor.
|
|
1473
1501
|
*/
|
|
1474
1502
|
_commandExecutedListener() {
|
|
1475
|
-
const e = [
|
|
1503
|
+
const e = [et.id, ln.id];
|
|
1476
1504
|
this.disposeWithMe(
|
|
1477
1505
|
this._commandService.onCommandExecuted((t) => {
|
|
1478
1506
|
if (e.includes(t.id)) {
|
|
@@ -1485,28 +1513,28 @@ let Ce = class extends Y {
|
|
|
1485
1513
|
);
|
|
1486
1514
|
}
|
|
1487
1515
|
};
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
],
|
|
1497
|
-
var
|
|
1498
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1499
|
-
(
|
|
1500
|
-
return n && r &&
|
|
1501
|
-
},
|
|
1502
|
-
let
|
|
1516
|
+
Re = vr([
|
|
1517
|
+
L(B.Rendered, Re),
|
|
1518
|
+
X(0, U),
|
|
1519
|
+
X(1, R(ie)),
|
|
1520
|
+
X(2, $),
|
|
1521
|
+
X(3, v),
|
|
1522
|
+
X(4, ue),
|
|
1523
|
+
X(5, H)
|
|
1524
|
+
], Re);
|
|
1525
|
+
var Cr = Object.defineProperty, Or = Object.getOwnPropertyDescriptor, Rr = (i, e, t, n) => {
|
|
1526
|
+
for (var r = n > 1 ? void 0 : n ? Or(e, t) : e, o = i.length - 1, s; o >= 0; o--)
|
|
1527
|
+
(s = i[o]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
1528
|
+
return n && r && Cr(e, t, r), r;
|
|
1529
|
+
}, me = (i, e) => (t, n) => e(t, n, i);
|
|
1530
|
+
let Te = class extends le {
|
|
1503
1531
|
constructor(e, t, n, r) {
|
|
1504
1532
|
super();
|
|
1505
|
-
|
|
1533
|
+
p(this, "_docRenderMap", /* @__PURE__ */ new Set());
|
|
1506
1534
|
this._docSkeletonManagerService = e, this._renderManagerService = t, this._commandService = n, this._editorService = r, this._initialRenderRefresh(), this._commandExecutedListener();
|
|
1507
1535
|
}
|
|
1508
1536
|
_initialRenderRefresh() {
|
|
1509
|
-
this._docSkeletonManagerService.currentSkeletonBefore$.pipe(
|
|
1537
|
+
this._docSkeletonManagerService.currentSkeletonBefore$.pipe(ce(this.dispose$)).subscribe((e) => {
|
|
1510
1538
|
this._create(e);
|
|
1511
1539
|
});
|
|
1512
1540
|
}
|
|
@@ -1516,34 +1544,34 @@ let Oe = class extends ce {
|
|
|
1516
1544
|
const { skeleton: t, unitId: n } = e;
|
|
1517
1545
|
let r = this._renderManagerService.getRenderById(n);
|
|
1518
1546
|
r == null && (this._renderManagerService.create(n), r = this._renderManagerService.getRenderById(n));
|
|
1519
|
-
const { mainComponent: s } = r;
|
|
1520
|
-
|
|
1547
|
+
const { mainComponent: o, components: s } = r, a = o, c = s.get(q.BACKGROUND);
|
|
1548
|
+
a.changeSkeleton(t), c.changeSkeleton(t), this._recalculateSizeBySkeleton(r, t);
|
|
1521
1549
|
}
|
|
1522
1550
|
_recalculateSizeBySkeleton(e, t) {
|
|
1523
|
-
var
|
|
1524
|
-
const { mainComponent: n, scene: r, unitId: s } = e,
|
|
1525
|
-
if (
|
|
1551
|
+
var f;
|
|
1552
|
+
const { mainComponent: n, scene: r, unitId: o, components: s } = e, a = n, c = s.get(q.BACKGROUND), l = (f = t.getSkeletonData()) == null ? void 0 : f.pages;
|
|
1553
|
+
if (l == null)
|
|
1526
1554
|
return;
|
|
1527
|
-
let
|
|
1528
|
-
for (let
|
|
1529
|
-
const
|
|
1530
|
-
|
|
1555
|
+
let u = 0, h = 0;
|
|
1556
|
+
for (let g = 0, S = l.length; g < S; g++) {
|
|
1557
|
+
const d = l[g], { pageWidth: _, pageHeight: O } = d;
|
|
1558
|
+
a.pageLayoutType === ht.VERTICAL ? (h += O, h += a.pageMarginTop, g === S - 1 && (h += a.pageMarginTop), u = Math.max(u, _)) : a.pageLayoutType === ht.HORIZONTAL && (u += _, g !== S - 1 && (u += a.pageMarginLeft), h = Math.max(h, O));
|
|
1531
1559
|
}
|
|
1532
|
-
|
|
1560
|
+
a.resize(u, h), c.resize(u, h), this._editorService.isEditor(o) || r.resize(u, h);
|
|
1533
1561
|
}
|
|
1534
1562
|
_commandExecutedListener() {
|
|
1535
|
-
const e = [
|
|
1563
|
+
const e = [et.id];
|
|
1536
1564
|
this.disposeWithMe(
|
|
1537
1565
|
this._commandService.onCommandExecuted((t) => {
|
|
1538
1566
|
var n;
|
|
1539
1567
|
if (e.includes(t.id)) {
|
|
1540
|
-
const r = t.params, { unitId:
|
|
1541
|
-
if (
|
|
1568
|
+
const r = t.params, { unitId: o } = r, s = this._docSkeletonManagerService.getSkeletonByUnitId(o);
|
|
1569
|
+
if (s == null)
|
|
1542
1570
|
return;
|
|
1543
|
-
const { skeleton: a } =
|
|
1571
|
+
const { skeleton: a } = s, c = this._renderManagerService.getRenderById(o);
|
|
1544
1572
|
if (c == null || !!a.getViewModel().getDataModel().getSnapshot().disabled)
|
|
1545
1573
|
return;
|
|
1546
|
-
if (a.calculate(), this._editorService.isEditor(
|
|
1574
|
+
if (a.calculate(), this._editorService.isEditor(o)) {
|
|
1547
1575
|
(n = c.mainComponent) == null || n.makeDirty();
|
|
1548
1576
|
return;
|
|
1549
1577
|
}
|
|
@@ -1553,33 +1581,33 @@ let Oe = class extends ce {
|
|
|
1553
1581
|
);
|
|
1554
1582
|
}
|
|
1555
1583
|
};
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
],
|
|
1563
|
-
var
|
|
1564
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1565
|
-
(
|
|
1566
|
-
return n && r &&
|
|
1567
|
-
},
|
|
1568
|
-
let
|
|
1584
|
+
Te = Rr([
|
|
1585
|
+
L(B.Rendered, Te),
|
|
1586
|
+
me(0, R(ie)),
|
|
1587
|
+
me(1, H),
|
|
1588
|
+
me(2, v),
|
|
1589
|
+
me(3, $)
|
|
1590
|
+
], Te);
|
|
1591
|
+
var Tr = Object.defineProperty, Ir = Object.getOwnPropertyDescriptor, br = (i, e, t, n) => {
|
|
1592
|
+
for (var r = n > 1 ? void 0 : n ? Ir(e, t) : e, o = i.length - 1, s; o >= 0; o--)
|
|
1593
|
+
(s = i[o]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
1594
|
+
return n && r && Tr(e, t, r), r;
|
|
1595
|
+
}, Se = (i, e) => (t, n) => e(t, n, i);
|
|
1596
|
+
let Ie = class extends le {
|
|
1569
1597
|
constructor(e, t, n, r) {
|
|
1570
1598
|
super();
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1599
|
+
p(this, "_scene");
|
|
1600
|
+
p(this, "_currentDocumentModel");
|
|
1601
|
+
p(this, "_fps$", new kn(""));
|
|
1602
|
+
p(this, "fps$", this._fps$.asObservable());
|
|
1575
1603
|
this._renderManagerService = e, this._configService = t, this._univerInstanceService = n, this._editorService = r, this._initialize();
|
|
1576
1604
|
}
|
|
1577
1605
|
_initialize() {
|
|
1578
|
-
this._renderManagerService.createRender$.pipe(
|
|
1606
|
+
this._renderManagerService.createRender$.pipe(ce(this.dispose$)).subscribe((e) => {
|
|
1579
1607
|
this._create(e);
|
|
1580
|
-
}), this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1608
|
+
}), this._univerInstanceService.getCurrentTypeOfUnit$(m.UNIVER_DOC).pipe(ce(this.dispose$)).subscribe((e) => {
|
|
1581
1609
|
this._create(e == null ? void 0 : e.getUnitId());
|
|
1582
|
-
}), this._univerInstanceService.getAllUnitsForType(
|
|
1610
|
+
}), this._univerInstanceService.getAllUnitsForType(m.UNIVER_DOC).forEach((e) => {
|
|
1583
1611
|
this._create(e.getUnitId());
|
|
1584
1612
|
});
|
|
1585
1613
|
}
|
|
@@ -1592,65 +1620,62 @@ let Re = class extends ce {
|
|
|
1592
1620
|
const t = this._univerInstanceService.getUniverDocInstance(e);
|
|
1593
1621
|
t != null && (this._currentDocumentModel = t, this._renderManagerService.has(e) || this._addNewRender());
|
|
1594
1622
|
}
|
|
1595
|
-
// eslint-disable-next-line max-lines-per-function
|
|
1596
1623
|
_addNewRender() {
|
|
1597
|
-
const
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
n == null
|
|
1601
|
-
const s = this._renderManagerService.getRenderById(t);
|
|
1602
|
-
if (s == null)
|
|
1624
|
+
const t = this._currentDocumentModel.getUnitId();
|
|
1625
|
+
this._renderManagerService.createRender(t);
|
|
1626
|
+
const n = this._renderManagerService.getRenderById(t);
|
|
1627
|
+
if (n == null)
|
|
1603
1628
|
return;
|
|
1604
|
-
const { scene:
|
|
1605
|
-
|
|
1606
|
-
const
|
|
1629
|
+
const { scene: r, engine: o } = n;
|
|
1630
|
+
r.openTransformer(), this._scene = r;
|
|
1631
|
+
const s = new Ln(Be.VIEW_MAIN, r, {
|
|
1607
1632
|
left: 0,
|
|
1608
1633
|
top: 0,
|
|
1609
1634
|
bottom: 0,
|
|
1610
1635
|
right: 0,
|
|
1611
1636
|
isWheelPreventDefaultX: !0
|
|
1612
1637
|
});
|
|
1613
|
-
|
|
1614
|
-
const
|
|
1615
|
-
if (
|
|
1616
|
-
const f = Math.abs(
|
|
1617
|
-
let
|
|
1618
|
-
|
|
1638
|
+
r.attachControl(), r.on(Bn.wheel, (l, u) => {
|
|
1639
|
+
const h = l;
|
|
1640
|
+
if (h.ctrlKey) {
|
|
1641
|
+
const f = Math.abs(h.deltaX);
|
|
1642
|
+
let g = f < 40 ? 0.2 : f < 80 ? 0.4 : 0.2;
|
|
1643
|
+
g *= h.deltaY > 0 ? -1 : 1, r.scaleX < 1 && (g /= 2), r.scaleX + g > 4 ? r.scale(4, 4) : r.scaleX + g < 0.1 ? r.scale(0.1, 0.1) : h.preventDefault();
|
|
1619
1644
|
} else
|
|
1620
|
-
|
|
1621
|
-
}), this._configService.getConfig("hasScroll") !== !1 && new
|
|
1622
|
-
new
|
|
1623
|
-
new
|
|
1624
|
-
), this._addComponent(
|
|
1625
|
-
|
|
1645
|
+
s.onMouseWheel(h, u);
|
|
1646
|
+
}), this._configService.getConfig("hasScroll") !== !1 && new Ye(s), r.addLayer(
|
|
1647
|
+
new gt(r, [], We),
|
|
1648
|
+
new gt(r, [], xn)
|
|
1649
|
+
), this._addComponent(n), this._currentDocumentModel.getShouldRenderLoopImmediately() && o.runRenderLoop(() => {
|
|
1650
|
+
r.render(), this._fps$.next(Math.round(o.getFps()).toString());
|
|
1626
1651
|
}), this._renderManagerService.setCurrent(t);
|
|
1627
1652
|
}
|
|
1628
1653
|
_addComponent(e) {
|
|
1629
|
-
const t = this._scene, n = this._currentDocumentModel, r =
|
|
1654
|
+
const t = this._scene, n = this._currentDocumentModel, r = {
|
|
1630
1655
|
pageMarginLeft: n.documentStyle.marginLeft || 0,
|
|
1631
1656
|
pageMarginTop: n.documentStyle.marginTop || 0
|
|
1632
|
-
});
|
|
1633
|
-
|
|
1657
|
+
}, o = new $n(q.MAIN, void 0, r), s = new Fn(q.BACKGROUND, void 0, r);
|
|
1658
|
+
o.zIndex = dt, s.zIndex = dt, e.mainComponent = o, e.components.set(q.MAIN, o), e.components.set(q.BACKGROUND, s), t.addObjects([o], We), t.addObjects([s], Dn), this._editorService.getEditor(n.getUnitId()) == null && t.enableLayerCache(We);
|
|
1634
1659
|
}
|
|
1635
1660
|
};
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
],
|
|
1643
|
-
var
|
|
1644
|
-
for (var r = n > 1 ? void 0 : n ? Mr(e, t) : e,
|
|
1645
|
-
(
|
|
1646
|
-
return n && r &&
|
|
1647
|
-
},
|
|
1648
|
-
let
|
|
1649
|
-
constructor(e, t, n, r,
|
|
1661
|
+
Ie = br([
|
|
1662
|
+
L(B.Starting, Ie),
|
|
1663
|
+
Se(0, H),
|
|
1664
|
+
Se(1, Wt),
|
|
1665
|
+
Se(2, U),
|
|
1666
|
+
Se(3, $)
|
|
1667
|
+
], Ie);
|
|
1668
|
+
var yr = Object.defineProperty, Mr = Object.getOwnPropertyDescriptor, Er = (i, e, t, n) => {
|
|
1669
|
+
for (var r = n > 1 ? void 0 : n ? Mr(e, t) : e, o = i.length - 1, s; o >= 0; o--)
|
|
1670
|
+
(s = i[o]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
1671
|
+
return n && r && yr(e, t, r), r;
|
|
1672
|
+
}, K = (i, e) => (t, n) => e(t, n, i);
|
|
1673
|
+
let be = class extends ee {
|
|
1674
|
+
constructor(e, t, n, r, o, s) {
|
|
1650
1675
|
super();
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
this._docSkeletonManagerService = e, this._univerInstanceService = t, this._renderManagerService = n, this._commandService = r, this._floatingObjectManagerService =
|
|
1676
|
+
p(this, "_liquid", new wn());
|
|
1677
|
+
p(this, "_pageMarginCache", /* @__PURE__ */ new Map());
|
|
1678
|
+
this._docSkeletonManagerService = e, this._univerInstanceService = t, this._renderManagerService = n, this._commandService = r, this._floatingObjectManagerService = o, this._editorService = s, this._initialize(), this._commandExecutedListener();
|
|
1654
1679
|
}
|
|
1655
1680
|
_initialize() {
|
|
1656
1681
|
this._initialRenderRefresh(), this._updateOnPluginChange();
|
|
@@ -1660,19 +1685,19 @@ let Te = class extends Y {
|
|
|
1660
1685
|
const t = this._docSkeletonManagerService.getCurrent();
|
|
1661
1686
|
if (t == null)
|
|
1662
1687
|
return;
|
|
1663
|
-
const { unitId: n, skeleton: r } = t,
|
|
1664
|
-
if (
|
|
1688
|
+
const { unitId: n, skeleton: r } = t, o = this._renderManagerService.getRenderById(n);
|
|
1689
|
+
if (o == null)
|
|
1665
1690
|
return;
|
|
1666
|
-
const { mainComponent:
|
|
1667
|
-
e.forEach((
|
|
1668
|
-
const { unitId: g, subUnitId:
|
|
1669
|
-
r == null || r.getViewModel().getDataModel().updateDrawing(
|
|
1670
|
-
left:
|
|
1671
|
-
top:
|
|
1672
|
-
height:
|
|
1673
|
-
width:
|
|
1691
|
+
const { mainComponent: s, components: a, scene: c } = o, l = s, { left: u, top: h } = l;
|
|
1692
|
+
e.forEach((f) => {
|
|
1693
|
+
const { unitId: g, subUnitId: S, floatingObjectId: d, floatingObject: _ } = f, { left: O = 0, top: E = 0, width: N = 0, height: F = 0, angle: w, flipX: Y, flipY: G, skewX: ge, skewY: _e } = _, x = this._pageMarginCache.get(d), pe = (x == null ? void 0 : x.marginLeft) || 0, Ve = (x == null ? void 0 : x.marginTop) || 0;
|
|
1694
|
+
r == null || r.getViewModel().getDataModel().updateDrawing(d, {
|
|
1695
|
+
left: O - u - pe,
|
|
1696
|
+
top: E - h - Ve,
|
|
1697
|
+
height: F,
|
|
1698
|
+
width: N
|
|
1674
1699
|
});
|
|
1675
|
-
}), r == null || r.calculate(),
|
|
1700
|
+
}), r == null || r.calculate(), s == null || s.makeDirty();
|
|
1676
1701
|
});
|
|
1677
1702
|
}
|
|
1678
1703
|
_initialRenderRefresh() {
|
|
@@ -1682,135 +1707,83 @@ let Te = class extends Y {
|
|
|
1682
1707
|
const { skeleton: t, unitId: n } = e, r = this._renderManagerService.getRenderById(n);
|
|
1683
1708
|
if (r == null)
|
|
1684
1709
|
return;
|
|
1685
|
-
const { mainComponent:
|
|
1686
|
-
|
|
1710
|
+
const { mainComponent: o } = r;
|
|
1711
|
+
o.changeSkeleton(t), this._refreshFloatingObject(n, t, r);
|
|
1687
1712
|
});
|
|
1688
1713
|
}
|
|
1689
1714
|
_commandExecutedListener() {
|
|
1690
|
-
const e = [
|
|
1715
|
+
const e = [et.id, tt.id];
|
|
1691
1716
|
this.disposeWithMe(
|
|
1692
1717
|
this._commandService.onCommandExecuted((t) => {
|
|
1693
1718
|
var n;
|
|
1694
1719
|
if (e.includes(t.id)) {
|
|
1695
|
-
const r = t.params, { unitId:
|
|
1696
|
-
if (
|
|
1720
|
+
const r = t.params, { unitId: o } = r, s = this._docSkeletonManagerService.getCurrent();
|
|
1721
|
+
if (s == null)
|
|
1697
1722
|
return;
|
|
1698
|
-
const { unitId: a, skeleton: c } =
|
|
1699
|
-
if (
|
|
1723
|
+
const { unitId: a, skeleton: c } = s;
|
|
1724
|
+
if (o !== a)
|
|
1700
1725
|
return;
|
|
1701
|
-
const
|
|
1702
|
-
if (
|
|
1726
|
+
const l = this._renderManagerService.getRenderById(a);
|
|
1727
|
+
if (l == null)
|
|
1703
1728
|
return;
|
|
1704
1729
|
if (this._editorService.isEditor(a)) {
|
|
1705
|
-
(n =
|
|
1730
|
+
(n = l.mainComponent) == null || n.makeDirty();
|
|
1706
1731
|
return;
|
|
1707
1732
|
}
|
|
1708
|
-
this._refreshFloatingObject(a, c,
|
|
1733
|
+
this._refreshFloatingObject(a, c, l);
|
|
1709
1734
|
}
|
|
1710
1735
|
})
|
|
1711
1736
|
);
|
|
1712
1737
|
}
|
|
1713
1738
|
_refreshFloatingObject(e, t, n) {
|
|
1714
|
-
const r = t == null ? void 0 : t.getSkeletonData(), { mainComponent:
|
|
1739
|
+
const r = t == null ? void 0 : t.getSkeletonData(), { mainComponent: o, scene: s } = n, a = o;
|
|
1715
1740
|
if (!r)
|
|
1716
1741
|
return;
|
|
1717
|
-
const { left: c, top:
|
|
1718
|
-
|
|
1719
|
-
for (let
|
|
1720
|
-
const
|
|
1721
|
-
this._liquid.translatePagePadding(
|
|
1722
|
-
const { aLeft:
|
|
1723
|
-
|
|
1742
|
+
const { left: c, top: l, pageLayoutType: u, pageMarginLeft: h, pageMarginTop: f } = a, { pages: g } = r, S = [];
|
|
1743
|
+
s.getAncestorScale(), this._liquid.reset(), this._pageMarginCache.clear();
|
|
1744
|
+
for (let d = 0, _ = g.length; d < _; d++) {
|
|
1745
|
+
const O = g[d], { skeDrawings: E, marginLeft: N, marginTop: F } = O;
|
|
1746
|
+
this._liquid.translatePagePadding(O), E.forEach((w) => {
|
|
1747
|
+
const { aLeft: Y, aTop: G, height: ge, width: _e, objectId: x, drawingOrigin: pe } = w, Ve = pe.layoutType === kt.WRAP_NONE && pe.behindDoc === C.TRUE;
|
|
1748
|
+
S.push({
|
|
1724
1749
|
unitId: e,
|
|
1725
|
-
subUnitId:
|
|
1750
|
+
subUnitId: zt,
|
|
1726
1751
|
floatingObjectId: x,
|
|
1752
|
+
behindText: Ve,
|
|
1727
1753
|
floatingObject: {
|
|
1728
|
-
left:
|
|
1729
|
-
top: G +
|
|
1730
|
-
width:
|
|
1731
|
-
height:
|
|
1754
|
+
left: Y + c + this._liquid.x,
|
|
1755
|
+
top: G + l + this._liquid.y,
|
|
1756
|
+
width: _e,
|
|
1757
|
+
height: ge
|
|
1732
1758
|
}
|
|
1733
1759
|
}), this._pageMarginCache.set(x, {
|
|
1734
1760
|
marginLeft: this._liquid.x,
|
|
1735
1761
|
marginTop: this._liquid.y
|
|
1736
1762
|
});
|
|
1737
|
-
}), this._liquid.translatePage(
|
|
1763
|
+
}), this._liquid.restorePagePadding(O), this._liquid.translatePage(O, u, h, f);
|
|
1738
1764
|
}
|
|
1739
|
-
this._floatingObjectManagerService.
|
|
1765
|
+
this._floatingObjectManagerService.batchAddOrUpdate(S);
|
|
1740
1766
|
}
|
|
1741
1767
|
};
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
],
|
|
1751
|
-
var
|
|
1752
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1753
|
-
(
|
|
1754
|
-
return n && r &&
|
|
1755
|
-
},
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
constructor(i, e, t) {
|
|
1759
|
-
super(), this._renderManagerService = i, this._editorService = e, this._univerInstanceService = t, this._initialize(), this._commandExecutedListener();
|
|
1760
|
-
}
|
|
1761
|
-
_initialize() {
|
|
1762
|
-
this._initialRenderRefresh();
|
|
1763
|
-
}
|
|
1764
|
-
_initialRenderRefresh() {
|
|
1765
|
-
this._renderManagerService.currentRender$.subscribe((i) => {
|
|
1766
|
-
var s;
|
|
1767
|
-
if (i == null)
|
|
1768
|
-
return;
|
|
1769
|
-
const e = this._renderManagerService.getRenderById(i);
|
|
1770
|
-
if (this._editorService.isEditor(i) || this._univerInstanceService.getUniverDocInstance(i) == null || e == null)
|
|
1771
|
-
return;
|
|
1772
|
-
const { mainComponent: t } = e, n = t, r = (s = n.getSkeleton()) == null ? void 0 : s.getPageSize();
|
|
1773
|
-
this.disposeWithMe(
|
|
1774
|
-
F(
|
|
1775
|
-
n.onPageRenderObservable.add((o) => {
|
|
1776
|
-
var _, R, y, L;
|
|
1777
|
-
if (this._editorService.isEditor(i))
|
|
1778
|
-
return;
|
|
1779
|
-
const { page: a, pageLeft: c, pageTop: d, ctx: u } = o, { width: h, pageWidth: p, height: g, pageHeight: f } = a;
|
|
1780
|
-
u.save(), u.translate(c - 0.5, d - 0.5);
|
|
1781
|
-
const l = {
|
|
1782
|
-
width: (R = (_ = r == null ? void 0 : r.width) != null ? _ : p) != null ? R : h,
|
|
1783
|
-
height: (L = (y = r == null ? void 0 : r.height) != null ? y : f) != null ? L : g,
|
|
1784
|
-
strokeWidth: 1,
|
|
1785
|
-
stroke: Pr,
|
|
1786
|
-
fill: Ur,
|
|
1787
|
-
zIndex: 3
|
|
1788
|
-
};
|
|
1789
|
-
wn.drawWith(u, l), u.restore();
|
|
1790
|
-
})
|
|
1791
|
-
)
|
|
1792
|
-
);
|
|
1793
|
-
});
|
|
1794
|
-
}
|
|
1795
|
-
_commandExecutedListener() {
|
|
1796
|
-
}
|
|
1797
|
-
};
|
|
1798
|
-
Ie = Dr([
|
|
1799
|
-
N(A.Rendered, Ie),
|
|
1800
|
-
We(0, W),
|
|
1801
|
-
We(1, $),
|
|
1802
|
-
We(2, D)
|
|
1803
|
-
], Ie);
|
|
1804
|
-
var Lr = Object.defineProperty, Nr = Object.getOwnPropertyDescriptor, Ar = (i, e, t, n) => {
|
|
1805
|
-
for (var r = n > 1 ? void 0 : n ? Nr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1806
|
-
(o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
|
|
1807
|
-
return n && r && Lr(e, t, r), r;
|
|
1808
|
-
}, K = (i, e) => (t, n) => e(t, n, i);
|
|
1809
|
-
let be = class extends Y {
|
|
1810
|
-
constructor(e, t, n, r, s, o) {
|
|
1768
|
+
be = Er([
|
|
1769
|
+
L(B.Steady, be),
|
|
1770
|
+
K(0, R(ie)),
|
|
1771
|
+
K(1, U),
|
|
1772
|
+
K(2, H),
|
|
1773
|
+
K(3, v),
|
|
1774
|
+
K(4, Ht),
|
|
1775
|
+
K(5, $)
|
|
1776
|
+
], be);
|
|
1777
|
+
var xr = Object.defineProperty, Dr = Object.getOwnPropertyDescriptor, Pr = (i, e, t, n) => {
|
|
1778
|
+
for (var r = n > 1 ? void 0 : n ? Dr(e, t) : e, o = i.length - 1, s; o >= 0; o--)
|
|
1779
|
+
(s = i[o]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
1780
|
+
return n && r && xr(e, t, r), r;
|
|
1781
|
+
}, Z = (i, e) => (t, n) => e(t, n, i);
|
|
1782
|
+
let ye = class extends ee {
|
|
1783
|
+
constructor(e, t, n, r, o, s) {
|
|
1811
1784
|
super();
|
|
1812
|
-
|
|
1813
|
-
this._docSkeletonManagerService = e, this._univerInstanceService = t, this._commandService = n, this._renderManagerService = r, this._textSelectionManagerService =
|
|
1785
|
+
p(this, "_initializedRender", /* @__PURE__ */ new Set());
|
|
1786
|
+
this._docSkeletonManagerService = e, this._univerInstanceService = t, this._commandService = n, this._renderManagerService = r, this._textSelectionManagerService = o, this._editorService = s, this._initialize();
|
|
1814
1787
|
}
|
|
1815
1788
|
dispose() {
|
|
1816
1789
|
super.dispose();
|
|
@@ -1828,22 +1801,22 @@ let be = class extends Y {
|
|
|
1828
1801
|
this._initializedRender.add(t);
|
|
1829
1802
|
const { scene: r } = n;
|
|
1830
1803
|
this.disposeWithMe(
|
|
1831
|
-
|
|
1832
|
-
r.onMouseWheelObserver.add((
|
|
1833
|
-
if (!
|
|
1804
|
+
j(
|
|
1805
|
+
r.onMouseWheelObserver.add((o) => {
|
|
1806
|
+
if (!o.ctrlKey)
|
|
1834
1807
|
return;
|
|
1835
|
-
const
|
|
1836
|
-
if (!
|
|
1808
|
+
const s = this._univerInstanceService.getCurrentUniverDocInstance();
|
|
1809
|
+
if (!s)
|
|
1837
1810
|
return;
|
|
1838
|
-
const a = Math.abs(
|
|
1811
|
+
const a = Math.abs(o.deltaX);
|
|
1839
1812
|
let c = a < 40 ? 0.2 : a < 80 ? 0.4 : 0.2;
|
|
1840
|
-
c *=
|
|
1841
|
-
const
|
|
1842
|
-
let u = +Number.parseFloat(`${
|
|
1813
|
+
c *= o.deltaY > 0 ? -1 : 1, r.scaleX < 1 && (c /= 2);
|
|
1814
|
+
const l = s.zoomRatio;
|
|
1815
|
+
let u = +Number.parseFloat(`${l + c}`).toFixed(1);
|
|
1843
1816
|
u = u >= 4 ? 4 : u <= 0.1 ? 0.1 : u, this._commandService.executeCommand(Pn.id, {
|
|
1844
1817
|
zoomRatio: u,
|
|
1845
|
-
unitId:
|
|
1846
|
-
}),
|
|
1818
|
+
unitId: s.getUnitId()
|
|
1819
|
+
}), o.preventDefault();
|
|
1847
1820
|
})
|
|
1848
1821
|
)
|
|
1849
1822
|
);
|
|
@@ -1858,7 +1831,7 @@ let be = class extends Y {
|
|
|
1858
1831
|
// }
|
|
1859
1832
|
_skeletonListener() {
|
|
1860
1833
|
this.disposeWithMe(
|
|
1861
|
-
|
|
1834
|
+
j(
|
|
1862
1835
|
this._docSkeletonManagerService.currentSkeleton$.subscribe((e) => {
|
|
1863
1836
|
if (e == null)
|
|
1864
1837
|
return;
|
|
@@ -1872,18 +1845,18 @@ let be = class extends Y {
|
|
|
1872
1845
|
);
|
|
1873
1846
|
}
|
|
1874
1847
|
_commandExecutedListener() {
|
|
1875
|
-
const e = [
|
|
1848
|
+
const e = [tt.id];
|
|
1876
1849
|
this.disposeWithMe(
|
|
1877
1850
|
this._commandService.onCommandExecuted((t) => {
|
|
1878
1851
|
if (e.includes(t.id)) {
|
|
1879
1852
|
const n = this._univerInstanceService.getCurrentUniverDocInstance();
|
|
1880
1853
|
if (!n)
|
|
1881
1854
|
return;
|
|
1882
|
-
const r = t.params, { unitId:
|
|
1883
|
-
if (
|
|
1855
|
+
const r = t.params, { unitId: o } = r;
|
|
1856
|
+
if (o !== n.getUnitId())
|
|
1884
1857
|
return;
|
|
1885
|
-
const
|
|
1886
|
-
this._updateViewZoom(
|
|
1858
|
+
const s = n.zoomRatio || 1;
|
|
1859
|
+
this._updateViewZoom(s);
|
|
1887
1860
|
}
|
|
1888
1861
|
})
|
|
1889
1862
|
);
|
|
@@ -1894,44 +1867,44 @@ let be = class extends Y {
|
|
|
1894
1867
|
n != null && (n.scene.scale(e, e), this._calculatePagePosition(n, e), t && this._textSelectionManagerService.refreshSelection(), (r = n.scene.getTransformer()) == null || r.hideControl());
|
|
1895
1868
|
}
|
|
1896
1869
|
_calculatePagePosition(e, t) {
|
|
1897
|
-
const { document: n, scene: r } = e, s = r == null ? void 0 : r.getParent(), { width:
|
|
1898
|
-
if (s == null ||
|
|
1870
|
+
const { document: n, scene: r, docBackground: o } = e, s = r == null ? void 0 : r.getParent(), { width: a, height: c, pageMarginLeft: l, pageMarginTop: u } = n;
|
|
1871
|
+
if (s == null || a === Number.POSITIVE_INFINITY || c === Number.POSITIVE_INFINITY)
|
|
1899
1872
|
return;
|
|
1900
|
-
const { width:
|
|
1901
|
-
let
|
|
1902
|
-
|
|
1903
|
-
const
|
|
1904
|
-
if (
|
|
1905
|
-
const
|
|
1906
|
-
|
|
1907
|
-
x:
|
|
1873
|
+
const { width: h, height: f } = s;
|
|
1874
|
+
let g = 0, S = 0, d = 0, _ = 0, O = Number.POSITIVE_INFINITY;
|
|
1875
|
+
h > (a + l * 2) * t ? (g = h / 2 - a * t / 2, g /= t, d = (h - l * 2) / t, O = 0) : (g = l, d = a + l * 2, O = (d - h / t) / 2), f > c ? (S = f / 2 - c / 2, _ = (f - u * 2) / t) : (S = u, _ = c + u * 2), r.resize(d, _ + 200), n.translate(g, S), o.translate(g, S);
|
|
1876
|
+
const E = r.getViewport(Be.VIEW_MAIN);
|
|
1877
|
+
if (O !== Number.POSITIVE_INFINITY && E != null) {
|
|
1878
|
+
const N = E.getBarScroll(O, 0).x;
|
|
1879
|
+
E.scrollTo({
|
|
1880
|
+
x: N
|
|
1908
1881
|
});
|
|
1909
1882
|
}
|
|
1910
1883
|
return this;
|
|
1911
1884
|
}
|
|
1912
1885
|
_getDocObject() {
|
|
1913
|
-
return
|
|
1886
|
+
return xt(this._univerInstanceService, this._renderManagerService);
|
|
1914
1887
|
}
|
|
1915
1888
|
};
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
],
|
|
1925
|
-
var
|
|
1926
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1927
|
-
(
|
|
1928
|
-
return n && r &&
|
|
1929
|
-
},
|
|
1930
|
-
let Me = class extends
|
|
1931
|
-
constructor(e, t, n, r,
|
|
1889
|
+
ye = Pr([
|
|
1890
|
+
L(B.Rendered, ye),
|
|
1891
|
+
Z(0, R(ie)),
|
|
1892
|
+
Z(1, U),
|
|
1893
|
+
Z(2, v),
|
|
1894
|
+
Z(3, H),
|
|
1895
|
+
Z(4, R(ne)),
|
|
1896
|
+
Z(5, $)
|
|
1897
|
+
], ye);
|
|
1898
|
+
var Ur = Object.defineProperty, Nr = Object.getOwnPropertyDescriptor, Ar = (i, e, t, n) => {
|
|
1899
|
+
for (var r = n > 1 ? void 0 : n ? Nr(e, t) : e, o = i.length - 1, s; o >= 0; o--)
|
|
1900
|
+
(s = i[o]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
1901
|
+
return n && r && Ur(e, t, r), r;
|
|
1902
|
+
}, z = (i, e) => (t, n) => e(t, n, i);
|
|
1903
|
+
let Me = class extends ee {
|
|
1904
|
+
constructor(e, t, n, r, o, s, a) {
|
|
1932
1905
|
super();
|
|
1933
|
-
|
|
1934
|
-
this._docSkeletonManagerService = e, this._univerInstanceService = t, this._commandService = n, this._renderManagerService = r, this._textSelectionRenderManager =
|
|
1906
|
+
p(this, "_loadedMap", /* @__PURE__ */ new WeakSet());
|
|
1907
|
+
this._docSkeletonManagerService = e, this._univerInstanceService = t, this._commandService = n, this._renderManagerService = r, this._textSelectionRenderManager = o, this._textSelectionManagerService = s, this._editorService = a, this._initialize();
|
|
1935
1908
|
}
|
|
1936
1909
|
_initialize() {
|
|
1937
1910
|
this._init(), this._skeletonListener(), this._commandExecutedListener();
|
|
@@ -1951,46 +1924,47 @@ let Me = class extends Y {
|
|
|
1951
1924
|
const t = this._getDocObjectById(e);
|
|
1952
1925
|
t == null || t.document == null || this._loadedMap.has(t.document) || (this._initialMain(e), this._loadedMap.add(t.document));
|
|
1953
1926
|
}
|
|
1927
|
+
// eslint-disable-next-line max-lines-per-function
|
|
1954
1928
|
_initialMain(e) {
|
|
1955
1929
|
const t = this._getDocObjectById(e);
|
|
1956
1930
|
if (t == null)
|
|
1957
1931
|
return;
|
|
1958
1932
|
const { document: n, scene: r } = t;
|
|
1959
1933
|
this.disposeWithMe(
|
|
1960
|
-
|
|
1934
|
+
j(
|
|
1961
1935
|
n.onPointerEnterObserver.add(() => {
|
|
1962
|
-
this._isEditorReadOnly(e) || (n.cursor =
|
|
1936
|
+
this._isEditorReadOnly(e) || (n.cursor = _t.TEXT);
|
|
1963
1937
|
})
|
|
1964
1938
|
)
|
|
1965
1939
|
), this.disposeWithMe(
|
|
1966
|
-
|
|
1940
|
+
j(
|
|
1967
1941
|
n.onPointerLeaveObserver.add(() => {
|
|
1968
|
-
n.cursor =
|
|
1942
|
+
n.cursor = _t.DEFAULT, r.resetCursor();
|
|
1969
1943
|
})
|
|
1970
1944
|
)
|
|
1971
1945
|
), this.disposeWithMe(
|
|
1972
|
-
|
|
1973
|
-
n == null ? void 0 : n.onPointerDownObserver.add((
|
|
1946
|
+
j(
|
|
1947
|
+
n == null ? void 0 : n.onPointerDownObserver.add((o, s) => {
|
|
1974
1948
|
if (this._isEditorReadOnly(e))
|
|
1975
1949
|
return;
|
|
1976
1950
|
const a = this._univerInstanceService.getCurrentUniverDocInstance();
|
|
1977
|
-
(a == null ? void 0 : a.getUnitId()) !== e && this._univerInstanceService.setCurrentUnitForType(e), this._textSelectionRenderManager.eventTrigger(
|
|
1978
|
-
const { offsetX: c, offsetY:
|
|
1979
|
-
this._editorService.getEditor(e) && setTimeout(() => {
|
|
1980
|
-
this._setEditorFocus(e), this._textSelectionRenderManager.setCursorManually(c,
|
|
1981
|
-
}, 0),
|
|
1951
|
+
(a == null ? void 0 : a.getUnitId()) !== e && this._univerInstanceService.setCurrentUnitForType(e), this._textSelectionRenderManager.eventTrigger(o);
|
|
1952
|
+
const { offsetX: c, offsetY: l } = o;
|
|
1953
|
+
this._editorService.getEditor(e) && (this._setEditorFocus(e), setTimeout(() => {
|
|
1954
|
+
this._setEditorFocus(e), this._textSelectionRenderManager.setCursorManually(c, l);
|
|
1955
|
+
}, 0)), o.button !== 2 && s.stopPropagation();
|
|
1982
1956
|
})
|
|
1983
1957
|
)
|
|
1984
1958
|
), this.disposeWithMe(
|
|
1985
|
-
|
|
1986
|
-
n == null ? void 0 : n.onDblclickObserver.add((
|
|
1987
|
-
this._isEditorReadOnly(e) || this._textSelectionRenderManager.handleDblClick(
|
|
1959
|
+
j(
|
|
1960
|
+
n == null ? void 0 : n.onDblclickObserver.add((o) => {
|
|
1961
|
+
this._isEditorReadOnly(e) || this._textSelectionRenderManager.handleDblClick(o);
|
|
1988
1962
|
})
|
|
1989
1963
|
)
|
|
1990
1964
|
), this.disposeWithMe(
|
|
1991
|
-
|
|
1992
|
-
n == null ? void 0 : n.onTripleClickObserver.add((
|
|
1993
|
-
this._isEditorReadOnly(e) || this._textSelectionRenderManager.handleTripleClick(
|
|
1965
|
+
j(
|
|
1966
|
+
n == null ? void 0 : n.onTripleClickObserver.add((o) => {
|
|
1967
|
+
this._isEditorReadOnly(e) || this._textSelectionRenderManager.handleTripleClick(o);
|
|
1994
1968
|
})
|
|
1995
1969
|
)
|
|
1996
1970
|
);
|
|
@@ -2000,20 +1974,20 @@ let Me = class extends Y {
|
|
|
2000
1974
|
return t ? t.isReadOnly() : !1;
|
|
2001
1975
|
}
|
|
2002
1976
|
_setEditorFocus(e) {
|
|
2003
|
-
if (this._univerInstanceService.getAllUnitsForType(
|
|
2004
|
-
const n = this._univerInstanceService.getCurrentUnitForType(
|
|
1977
|
+
if (this._univerInstanceService.getAllUnitsForType(m.UNIVER_SHEET).length > 0) {
|
|
1978
|
+
const n = this._univerInstanceService.getCurrentUnitForType(m.UNIVER_SHEET);
|
|
2005
1979
|
this._editorService.setOperationSheetUnitId(n.getUnitId());
|
|
2006
1980
|
}
|
|
2007
1981
|
this._editorService.focusStyle(e);
|
|
2008
1982
|
}
|
|
2009
1983
|
_commandExecutedListener() {
|
|
2010
|
-
const e = [
|
|
1984
|
+
const e = [tt.id];
|
|
2011
1985
|
this.disposeWithMe(
|
|
2012
1986
|
this._commandService.onCommandExecuted((t) => {
|
|
2013
1987
|
var n;
|
|
2014
1988
|
if (e.includes(t.id)) {
|
|
2015
|
-
const r = t.params, { unitId:
|
|
2016
|
-
if (
|
|
1989
|
+
const r = t.params, { unitId: o } = r, s = (n = this._textSelectionManagerService.getCurrentSelection()) == null ? void 0 : n.unitId;
|
|
1990
|
+
if (o !== s)
|
|
2017
1991
|
return;
|
|
2018
1992
|
this._textSelectionManagerService.refreshSelection();
|
|
2019
1993
|
}
|
|
@@ -2028,8 +2002,8 @@ let Me = class extends Y {
|
|
|
2028
2002
|
const { unitId: t, skeleton: n } = e, r = this._renderManagerService.getRenderById(t);
|
|
2029
2003
|
if (r == null)
|
|
2030
2004
|
return;
|
|
2031
|
-
const { scene:
|
|
2032
|
-
this._textSelectionRenderManager.changeRuntime(n,
|
|
2005
|
+
const { scene: o, mainComponent: s } = r;
|
|
2006
|
+
this._textSelectionRenderManager.changeRuntime(n, o, s), this._textSelectionManagerService.setCurrentSelectionNotRefresh({
|
|
2033
2007
|
unitId: t,
|
|
2034
2008
|
subUnitId: ""
|
|
2035
2009
|
});
|
|
@@ -2037,31 +2011,31 @@ let Me = class extends Y {
|
|
|
2037
2011
|
);
|
|
2038
2012
|
}
|
|
2039
2013
|
_getDocObjectById(e) {
|
|
2040
|
-
return this._univerInstanceService.getUnitType(e) !==
|
|
2014
|
+
return this._univerInstanceService.getUnitType(e) !== m.UNIVER_DOC ? null : Un(e, this._renderManagerService);
|
|
2041
2015
|
}
|
|
2042
2016
|
};
|
|
2043
|
-
Me =
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2017
|
+
Me = Ar([
|
|
2018
|
+
L(B.Rendered, Me),
|
|
2019
|
+
z(0, R(ie)),
|
|
2020
|
+
z(1, U),
|
|
2021
|
+
z(2, v),
|
|
2022
|
+
z(3, H),
|
|
2023
|
+
z(4, ue),
|
|
2024
|
+
z(5, R(ne)),
|
|
2025
|
+
z(6, $)
|
|
2052
2026
|
], Me);
|
|
2053
|
-
var
|
|
2054
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2055
|
-
(
|
|
2056
|
-
return n && r &&
|
|
2057
|
-
},
|
|
2058
|
-
const
|
|
2059
|
-
let
|
|
2027
|
+
var Lr = Object.defineProperty, Br = Object.getOwnPropertyDescriptor, $r = (i, e, t, n) => {
|
|
2028
|
+
for (var r = n > 1 ? void 0 : n ? Br(e, t) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2029
|
+
(s = i[o]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
2030
|
+
return n && r && Lr(e, t, r), r;
|
|
2031
|
+
}, se = (i, e) => (t, n) => e(t, n, i);
|
|
2032
|
+
const Ot = 1.5;
|
|
2033
|
+
let Ee = class extends le {
|
|
2060
2034
|
constructor(i, e, t, n, r) {
|
|
2061
2035
|
super(), this._docSkeletonManagerService = i, this._textSelectionManagerService = e, this._editorService = t, this._univerInstanceService = n, this._renderManagerService = r, this._init();
|
|
2062
2036
|
}
|
|
2063
2037
|
_init() {
|
|
2064
|
-
this._textSelectionManagerService.textSelection$.pipe(
|
|
2038
|
+
this._textSelectionManagerService.textSelection$.pipe(ce(this.dispose$)).subscribe((i) => {
|
|
2065
2039
|
if (i == null)
|
|
2066
2040
|
return;
|
|
2067
2041
|
const { isEditing: e, unitId: t } = i;
|
|
@@ -2074,54 +2048,54 @@ let ye = class extends ce {
|
|
|
2074
2048
|
const e = this._textSelectionManagerService.getActiveRange(), t = this._getDocObject(), n = (x = this._docSkeletonManagerService.getCurrent()) == null ? void 0 : x.skeleton;
|
|
2075
2049
|
if (e == null || t == null || n == null)
|
|
2076
2050
|
return;
|
|
2077
|
-
const { collapsed: r, startNodePosition:
|
|
2051
|
+
const { collapsed: r, startNodePosition: o } = e;
|
|
2078
2052
|
if (!r)
|
|
2079
2053
|
return;
|
|
2080
|
-
const
|
|
2054
|
+
const s = t.document.getOffsetConfig(), { docsLeft: a, docsTop: c } = s, l = new jn(s, n), { contentBoxPointGroup: u } = l.getRangePointData(o, o), { left: h, top: f, height: g } = Vn(u), S = h + a, d = f + c, _ = t.scene.getViewport(Be.VIEW_MAIN), O = !!this._editorService.getEditor(i);
|
|
2081
2055
|
if (_ == null)
|
|
2082
2056
|
return;
|
|
2083
2057
|
const {
|
|
2084
|
-
left:
|
|
2085
|
-
top:
|
|
2086
|
-
right:
|
|
2087
|
-
bottom:
|
|
2058
|
+
left: E,
|
|
2059
|
+
top: N,
|
|
2060
|
+
right: F,
|
|
2061
|
+
bottom: w
|
|
2088
2062
|
} = _.getBounding().viewBound;
|
|
2089
|
-
let
|
|
2090
|
-
const
|
|
2091
|
-
|
|
2092
|
-
const
|
|
2093
|
-
_.scrollBy(
|
|
2063
|
+
let Y = 0, G = 0;
|
|
2064
|
+
const ge = O ? 0 : 100;
|
|
2065
|
+
d < N ? Y = d - N : d > w - g && (Y = d - w + g + ge), S < E ? G = S - E : S > F - Ot && (G = S - F + Ot);
|
|
2066
|
+
const _e = _.getBarScroll(G, Y);
|
|
2067
|
+
_.scrollBy(_e);
|
|
2094
2068
|
}
|
|
2095
2069
|
_getDocObject() {
|
|
2096
|
-
return
|
|
2070
|
+
return xt(this._univerInstanceService, this._renderManagerService);
|
|
2097
2071
|
}
|
|
2098
2072
|
};
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
],
|
|
2107
|
-
var
|
|
2108
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2109
|
-
(
|
|
2110
|
-
return n && r &&
|
|
2111
|
-
}, ze = (i, e) => (t, n) => e(t, n, i),
|
|
2112
|
-
let
|
|
2073
|
+
Ee = $r([
|
|
2074
|
+
L(B.Rendered, Ee),
|
|
2075
|
+
se(0, R(ie)),
|
|
2076
|
+
se(1, R(ne)),
|
|
2077
|
+
se(2, $),
|
|
2078
|
+
se(3, U),
|
|
2079
|
+
se(4, H)
|
|
2080
|
+
], Ee);
|
|
2081
|
+
var Fr = Object.defineProperty, wr = Object.getOwnPropertyDescriptor, jr = (i, e, t, n) => {
|
|
2082
|
+
for (var r = n > 1 ? void 0 : n ? wr(e, t) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2083
|
+
(s = i[o]) && (r = (n ? s(e, t, r) : s(r)) || r);
|
|
2084
|
+
return n && r && Fr(e, t, r), r;
|
|
2085
|
+
}, ze = (i, e) => (t, n) => e(t, n, i), ve;
|
|
2086
|
+
let Rt = (ve = class extends Yt {
|
|
2113
2087
|
constructor(i, e, t, n) {
|
|
2114
2088
|
super(), this._config = i, this._injector = e, this._localeService = t, this._logService = n, this._localeService.load({
|
|
2115
|
-
zhCN:
|
|
2116
|
-
}), this._config = qe.deepMerge({},
|
|
2089
|
+
zhCN: ki
|
|
2090
|
+
}), this._config = qe.deepMerge({}, Gn, this._config), this._initDependencies(e), this._initializeCommands();
|
|
2117
2091
|
}
|
|
2118
2092
|
onRendered() {
|
|
2119
2093
|
this._initModules(), this._markDocAsFocused();
|
|
2120
2094
|
}
|
|
2121
2095
|
_initializeCommands() {
|
|
2122
2096
|
[
|
|
2097
|
+
Zn,
|
|
2123
2098
|
qn,
|
|
2124
|
-
Kn,
|
|
2125
2099
|
Qn,
|
|
2126
2100
|
Jn,
|
|
2127
2101
|
ei,
|
|
@@ -2129,9 +2103,9 @@ let Ot = (me = class extends Yt {
|
|
|
2129
2103
|
ni,
|
|
2130
2104
|
ii,
|
|
2131
2105
|
ri,
|
|
2132
|
-
Hi,
|
|
2133
2106
|
Yi,
|
|
2134
|
-
|
|
2107
|
+
Gi,
|
|
2108
|
+
Hi
|
|
2135
2109
|
].forEach((i) => {
|
|
2136
2110
|
this._injector.get(dn).registerShortcut(i);
|
|
2137
2111
|
});
|
|
@@ -2139,36 +2113,35 @@ let Ot = (me = class extends Yt {
|
|
|
2139
2113
|
_initDependencies(i) {
|
|
2140
2114
|
[
|
|
2141
2115
|
// Controller
|
|
2142
|
-
[Se],
|
|
2143
|
-
[ve],
|
|
2144
2116
|
[Ce],
|
|
2145
2117
|
[Oe],
|
|
2118
|
+
[Re],
|
|
2146
2119
|
[Te],
|
|
2147
|
-
[Ie],
|
|
2148
2120
|
[be],
|
|
2149
|
-
[Me],
|
|
2150
2121
|
[ye],
|
|
2122
|
+
[Me],
|
|
2123
|
+
[Ee],
|
|
2151
2124
|
[
|
|
2152
2125
|
// controllers
|
|
2153
|
-
|
|
2126
|
+
ae,
|
|
2154
2127
|
{
|
|
2155
|
-
useFactory: () => this._injector.createInstance(
|
|
2128
|
+
useFactory: () => this._injector.createInstance(ae, this._config)
|
|
2156
2129
|
}
|
|
2157
2130
|
],
|
|
2158
2131
|
[
|
|
2159
|
-
|
|
2132
|
+
he,
|
|
2160
2133
|
{
|
|
2161
2134
|
useClass: Xe
|
|
2162
2135
|
}
|
|
2163
2136
|
],
|
|
2164
2137
|
// Render views
|
|
2165
|
-
[
|
|
2138
|
+
[Ie]
|
|
2166
2139
|
].forEach((t) => {
|
|
2167
2140
|
i.add(t);
|
|
2168
2141
|
});
|
|
2169
2142
|
}
|
|
2170
2143
|
_markDocAsFocused() {
|
|
2171
|
-
const i = this._injector.get(
|
|
2144
|
+
const i = this._injector.get(U), e = this._injector.get($);
|
|
2172
2145
|
try {
|
|
2173
2146
|
const t = i.getCurrentUniverDocInstance();
|
|
2174
2147
|
if (!t)
|
|
@@ -2180,24 +2153,25 @@ let Ot = (me = class extends Yt {
|
|
|
2180
2153
|
}
|
|
2181
2154
|
}
|
|
2182
2155
|
_initModules() {
|
|
2183
|
-
this._injector.get(
|
|
2184
|
-
}
|
|
2185
|
-
},
|
|
2186
|
-
|
|
2187
|
-
ze(1,
|
|
2188
|
-
ze(2,
|
|
2189
|
-
ze(3,
|
|
2190
|
-
],
|
|
2156
|
+
this._injector.get(ae);
|
|
2157
|
+
}
|
|
2158
|
+
}, p(ve, "pluginName", Xn), p(ve, "type", m.UNIVER_DOC), ve);
|
|
2159
|
+
Rt = jr([
|
|
2160
|
+
ze(1, R(Ue)),
|
|
2161
|
+
ze(2, R(Ze)),
|
|
2162
|
+
ze(3, bt)
|
|
2163
|
+
], Rt);
|
|
2191
2164
|
export {
|
|
2192
|
-
|
|
2165
|
+
Xn as DOC_UI_PLUGIN_NAME,
|
|
2193
2166
|
Yn as DefaultDocContainerConfig,
|
|
2194
|
-
|
|
2167
|
+
Gn as DefaultDocUiConfig,
|
|
2195
2168
|
Hn as DefaultToolbarConfig,
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2169
|
+
Ie as DocCanvasView,
|
|
2170
|
+
tr as PastePluginLark,
|
|
2171
|
+
or as PastePluginUniver,
|
|
2172
|
+
ir as PastePluginWord,
|
|
2173
|
+
Rt as UniverDocsUIPlugin,
|
|
2174
|
+
qr as enUS,
|
|
2175
|
+
Jr as ruRU,
|
|
2176
|
+
ki as zhCN
|
|
2203
2177
|
};
|