@univerjs/docs-ui 0.1.3 → 0.1.4

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