@univerjs/docs-ui 0.1.1 → 0.1.2

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