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