@univerjs/docs 0.1.6 → 0.1.7

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,58 +1,58 @@
1
- var dt = Object.defineProperty;
2
- var ut = (o, e, t) => e in o ? dt(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
- var O = (o, e, t) => (ut(o, typeof e != "symbol" ? e + "" : e, t), t);
4
- import { CommandType as v, RxDisposable as ce, ICommandService as I, TextXActionType as y, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as qe, IUniverInstanceService as D, IUndoRedoService as ve, UndoCommandId as we, RedoCommandId as Le, TextX as b, DataStreamTreeTokenType as pe, Tools as W, LocaleService as mt, MemoryCursor as Q, getDocsUpdateBody as gt, UpdateDocsAttributeType as Ie, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as ft, BooleanNumber as z, BaselineOffset as V, PresetListType as Ke, HorizontalAlign as ee, OnLifecycle as Me, LifecycleStages as Ce, Disposable as Re, Direction as U, Plugin as ht, PluginType as pt } from "@univerjs/core";
5
- import { NORMAL_TEXT_SELECTION_PLUGIN_STYLE as St, ITextSelectionRenderManager as le, DocumentViewModel as _t, DocumentSkeleton as vt, hasListGlyph as It, isIndentByGlyph as Mt, isFirstGlyph as Ct, getParagraphByGlyph as Rt, RANGE_DIRECTION as Be, NodePositionConvertToCursor as Fe, IRenderManagerService as Qe, TextSelectionRenderManager as xt } from "@univerjs/engine-render";
6
- import { BehaviorSubject as Z, takeUntil as J } from "rxjs";
7
- import { Inject as B, Injector as yt } from "@wendellhu/redi";
8
- function et(o, e) {
9
- const n = o.getCurrentUniverDocInstance().getUnitId(), s = e.getRenderById(n);
10
- if (s == null)
1
+ var Rt = Object.defineProperty;
2
+ var yt = (o, e, t) => e in o ? Rt(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
+ var y = (o, e, t) => (yt(o, typeof e != "symbol" ? e + "" : e, t), t);
4
+ import { CommandType as v, RxDisposable as ue, ICommandService as I, TextXActionType as R, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as lt, IUniverInstanceService as E, IUndoRedoService as Oe, UndoCommandId as He, RedoCommandId as Xe, TextX as P, DataStreamTreeTokenType as xe, Tools as K, LocaleService as Ot, MemoryCursor as oe, getDocsUpdateBody as Tt, UpdateDocsAttributeType as Te, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Et, BooleanNumber as V, BaselineOffset as j, PRESET_LIST_TYPE as Dt, PresetListType as dt, HorizontalAlign as re, OnLifecycle as Ee, LifecycleStages as De, Disposable as Ae, Direction as b, Plugin as At, PluginType as bt } from "@univerjs/core";
5
+ import { NORMAL_TEXT_SELECTION_PLUGIN_STYLE as Nt, ITextSelectionRenderManager as me, DocumentViewModel as Pt, DocumentSkeleton as Ut, hasListGlyph as wt, isIndentByGlyph as Lt, isFirstGlyph as Bt, getParagraphByGlyph as Ft, getCharSpaceApply as $t, getNumberUnitValue as ve, RANGE_DIRECTION as Ye, NodePositionConvertToCursor as We, IRenderManagerService as ut, TextSelectionRenderManager as zt } from "@univerjs/engine-render";
6
+ import { BehaviorSubject as Q, takeUntil as ee } from "rxjs";
7
+ import { Inject as z, Injector as kt } from "@wendellhu/redi";
8
+ function mt(o, e) {
9
+ const n = o.getCurrentUniverDocInstance().getUnitId(), r = e.getRenderById(n);
10
+ if (r == null)
11
11
  return;
12
- const { mainComponent: r, scene: i, engine: a } = s;
12
+ const { mainComponent: s, scene: i, engine: a } = r;
13
13
  return {
14
- document: r,
14
+ document: s,
15
15
  scene: i,
16
16
  engine: a
17
17
  };
18
18
  }
19
- function En(o, e) {
19
+ function Gn(o, e) {
20
20
  const t = e.getRenderById(o);
21
21
  if (t == null)
22
22
  return;
23
- const { mainComponent: n, scene: s, engine: r } = t;
23
+ const { mainComponent: n, scene: r, engine: s } = t;
24
24
  return {
25
25
  document: n,
26
- scene: s,
27
- engine: r
26
+ scene: r,
27
+ engine: s
28
28
  };
29
29
  }
30
- var Ot = /* @__PURE__ */ ((o) => (o.MAIN = "__Document_Render_Main__", o))(Ot || {}), Tt = /* @__PURE__ */ ((o) => (o.VIEW_MAIN = "viewMain", o.VIEW_TOP = "viewTop", o.VIEW_LEFT = "viewLeft", o.VIEW_LEFT_TOP = "viewLeftTop", o))(Tt || {});
31
- const Dn = 0, An = 2, Pn = 10, Nn = "normalTextSelectionPluginName", tt = {
30
+ var Vt = /* @__PURE__ */ ((o) => (o.MAIN = "__Document_Render_Main__", o))(Vt || {}), jt = /* @__PURE__ */ ((o) => (o.VIEW_MAIN = "viewMain", o.VIEW_TOP = "viewTop", o.VIEW_LEFT = "viewLeft", o.VIEW_LEFT_TOP = "viewLeftTop", o))(jt || {});
31
+ const Hn = 0, Xn = 2, Yn = 10, Wn = "normalTextSelectionPluginName", gt = {
32
32
  id: "doc.operation.set-selections",
33
33
  type: v.OPERATION,
34
34
  handler: (o, e) => !0
35
35
  };
36
- var Et = Object.defineProperty, Dt = Object.getOwnPropertyDescriptor, At = (o, e, t, n) => {
37
- for (var s = n > 1 ? void 0 : n ? Dt(e, t) : e, r = o.length - 1, i; r >= 0; r--)
38
- (i = o[r]) && (s = (n ? i(e, t, s) : i(s)) || s);
39
- return n && s && Et(e, t, s), s;
40
- }, $e = (o, e) => (t, n) => e(t, n, o);
41
- function G(o) {
42
- const { startOffset: e, endOffset: t, collapsed: n } = o, s = {
36
+ var Gt = Object.defineProperty, Ht = Object.getOwnPropertyDescriptor, Xt = (o, e, t, n) => {
37
+ for (var r = n > 1 ? void 0 : n ? Ht(e, t) : e, s = o.length - 1, i; s >= 0; s--)
38
+ (i = o[s]) && (r = (n ? i(e, t, r) : i(r)) || r);
39
+ return n && r && Gt(e, t, r), r;
40
+ }, Ze = (o, e) => (t, n) => e(t, n, o);
41
+ function W(o) {
42
+ const { startOffset: e, endOffset: t, collapsed: n } = o, r = {
43
43
  startOffset: e,
44
44
  endOffset: t,
45
45
  collapsed: n
46
46
  };
47
- return typeof o.isActive == "function" && (s.isActive = o.isActive()), s;
47
+ return typeof o.isActive == "function" && (r.isActive = o.isActive()), r;
48
48
  }
49
- let T = class extends ce {
49
+ let T = class extends ue {
50
50
  constructor(e, t) {
51
51
  super();
52
- O(this, "_currentSelection", null);
53
- O(this, "_textSelectionInfo", /* @__PURE__ */ new Map());
54
- O(this, "_textSelection$", new Z(null));
55
- O(this, "textSelection$", this._textSelection$.asObservable());
52
+ y(this, "_currentSelection", null);
53
+ y(this, "_textSelectionInfo", /* @__PURE__ */ new Map());
54
+ y(this, "_textSelection$", new Q(null));
55
+ y(this, "textSelection$", this._textSelection$.asObservable());
56
56
  this._textSelectionRenderManager = e, this._commandService = t, this._syncSelectionFromRenderService();
57
57
  }
58
58
  getCurrentSelection() {
@@ -83,10 +83,10 @@ let T = class extends ce {
83
83
  const e = this._getTextRanges(this._currentSelection);
84
84
  if (e == null)
85
85
  return;
86
- const { textRanges: t, segmentId: n, style: s } = e, r = t.find((m) => m.isActive());
87
- if (r == null)
86
+ const { textRanges: t, segmentId: n, style: r } = e, s = t.find((m) => m.isActive());
87
+ if (s == null)
88
88
  return null;
89
- const { startOffset: i, endOffset: a, collapsed: c, startNodePosition: d, endNodePosition: l, direction: u } = r;
89
+ const { startOffset: i, endOffset: a, collapsed: c, startNodePosition: d, endNodePosition: l, direction: u } = s;
90
90
  return i == null || a == null ? null : {
91
91
  startOffset: i,
92
92
  endOffset: a,
@@ -95,7 +95,7 @@ let T = class extends ce {
95
95
  endNodePosition: l,
96
96
  direction: u,
97
97
  segmentId: n,
98
- style: s
98
+ style: r
99
99
  };
100
100
  }
101
101
  // **Only used in test case** because this does not go through the render layer.
@@ -105,7 +105,7 @@ let T = class extends ce {
105
105
  textRanges: e,
106
106
  segmentId: "",
107
107
  isEditing: t,
108
- style: St
108
+ style: Nt
109
109
  // mock style.
110
110
  });
111
111
  }
@@ -114,7 +114,7 @@ let T = class extends ce {
114
114
  }
115
115
  // All textRanges should be synchronized from the render layer.
116
116
  _syncSelectionFromRenderService() {
117
- this._textSelectionRenderManager.textSelectionInner$.pipe(J(this.dispose$)).subscribe((e) => {
117
+ this._textSelectionRenderManager.textSelectionInner$.pipe(ee(this.dispose$)).subscribe((e) => {
118
118
  e != null && this._replaceTextRangesWithNoRefresh(e);
119
119
  });
120
120
  }
@@ -126,66 +126,66 @@ let T = class extends ce {
126
126
  ...e
127
127
  };
128
128
  this._replaceByParam(t), this._textSelection$.next(t);
129
- const { unitId: n, subUnitId: s, segmentId: r, style: i, textRanges: a, isEditing: c } = t;
130
- this._commandService.executeCommand(tt.id, {
129
+ const { unitId: n, subUnitId: r, segmentId: s, style: i, textRanges: a, isEditing: c } = t;
130
+ this._commandService.executeCommand(gt.id, {
131
131
  unitId: n,
132
- subUnitId: s,
133
- segmentId: r,
132
+ subUnitId: r,
133
+ segmentId: s,
134
134
  style: i,
135
135
  isEditing: c,
136
- ranges: a.map(G)
136
+ ranges: a.map(W)
137
137
  });
138
138
  }
139
139
  _getTextRanges(e) {
140
- var s;
140
+ var r;
141
141
  if (e == null)
142
142
  return;
143
143
  const { unitId: t, subUnitId: n = "" } = e;
144
- return (s = this._textSelectionInfo.get(t)) == null ? void 0 : s.get(n);
144
+ return (r = this._textSelectionInfo.get(t)) == null ? void 0 : r.get(n);
145
145
  }
146
146
  _refresh(e) {
147
147
  const t = this._getTextRanges(e);
148
- this._textSelectionRenderManager.removeAllTextRanges(), t && Array.isArray(t.textRanges) && t.textRanges.length && this._textSelectionRenderManager.addTextRanges(t.textRanges.map(G));
148
+ this._textSelectionRenderManager.removeAllTextRanges(), t && Array.isArray(t.textRanges) && t.textRanges.length && this._textSelectionRenderManager.addTextRanges(t.textRanges.map(W));
149
149
  }
150
150
  _replaceByParam(e) {
151
- const { unitId: t, subUnitId: n, style: s, segmentId: r, textRanges: i, isEditing: a } = e;
152
- this._textSelectionInfo.has(t) || this._textSelectionInfo.set(t, /* @__PURE__ */ new Map()), this._textSelectionInfo.get(t).set(n, { textRanges: i, style: s, segmentId: r, isEditing: a });
151
+ const { unitId: t, subUnitId: n, style: r, segmentId: s, textRanges: i, isEditing: a } = e;
152
+ this._textSelectionInfo.has(t) || this._textSelectionInfo.set(t, /* @__PURE__ */ new Map()), this._textSelectionInfo.get(t).set(n, { textRanges: i, style: r, segmentId: s, isEditing: a });
153
153
  }
154
154
  _addByParam(e) {
155
- const { unitId: t, subUnitId: n, textRanges: s, style: r, segmentId: i, isEditing: a } = e;
155
+ const { unitId: t, subUnitId: n, textRanges: r, style: s, segmentId: i, isEditing: a } = e;
156
156
  this._textSelectionInfo.has(t) || this._textSelectionInfo.set(t, /* @__PURE__ */ new Map());
157
157
  const c = this._textSelectionInfo.get(t);
158
- c.has(n) ? c.get(n).textRanges.push(...s) : c.set(n, { textRanges: s, style: r, segmentId: i, isEditing: a });
158
+ c.has(n) ? c.get(n).textRanges.push(...r) : c.set(n, { textRanges: r, style: s, segmentId: i, isEditing: a });
159
159
  }
160
160
  };
161
- T = At([
162
- $e(0, le),
163
- $e(1, I)
161
+ T = Xt([
162
+ Ze(0, me),
163
+ Ze(1, I)
164
164
  ], T);
165
- function xe(o, e = "", t = 0) {
166
- const { startOffset: n, endOffset: s } = o, r = [], i = n - t, a = s - t;
167
- return i > 0 && r.push({
168
- t: y.RETAIN,
165
+ function be(o, e = "", t = 0) {
166
+ const { startOffset: n, endOffset: r } = o, s = [], i = n - t, a = r - t;
167
+ return i > 0 && s.push({
168
+ t: R.RETAIN,
169
169
  len: i,
170
170
  segmentId: e
171
- }), r.push({
172
- t: y.DELETE,
171
+ }), s.push({
172
+ t: R.DELETE,
173
173
  len: a - i,
174
174
  line: 0,
175
175
  segmentId: e
176
- }), r;
176
+ }), s;
177
177
  }
178
- var Pt = Object.defineProperty, Nt = Object.getOwnPropertyDescriptor, Ut = (o, e, t, n) => {
179
- for (var s = n > 1 ? void 0 : n ? Nt(e, t) : e, r = o.length - 1, i; r >= 0; r--)
180
- (i = o[r]) && (s = (n ? i(e, t, s) : i(s)) || s);
181
- return n && s && Pt(e, t, s), s;
182
- }, bt = (o, e) => (t, n) => e(t, n, o);
183
- let q = class extends ce {
178
+ var Yt = Object.defineProperty, Wt = Object.getOwnPropertyDescriptor, Zt = (o, e, t, n) => {
179
+ for (var r = n > 1 ? void 0 : n ? Wt(e, t) : e, s = o.length - 1, i; s >= 0; s--)
180
+ (i = o[s]) && (r = (n ? i(e, t, r) : i(r)) || r);
181
+ return n && r && Yt(e, t, r), r;
182
+ }, Jt = (o, e) => (t, n) => e(t, n, o);
183
+ let te = class extends ue {
184
184
  constructor(e) {
185
185
  super();
186
- O(this, "_docViewModelMap", /* @__PURE__ */ new Map());
187
- O(this, "_currentDocViewModel$", new Z(null));
188
- O(this, "currentDocViewModel$", this._currentDocViewModel$.asObservable());
186
+ y(this, "_docViewModelMap", /* @__PURE__ */ new Map());
187
+ y(this, "_currentDocViewModel$", new Q(null));
188
+ y(this, "currentDocViewModel$", this._currentDocViewModel$.asObservable());
189
189
  this._currentUniverService = e, this._initialize();
190
190
  }
191
191
  _initialize() {
@@ -195,11 +195,11 @@ let q = class extends ce {
195
195
  this._currentDocViewModel$.complete(), this._docViewModelMap.clear();
196
196
  }
197
197
  _init() {
198
- this._currentUniverService.currentDoc$.pipe(J(this.dispose$)).subscribe((e) => {
198
+ this._currentUniverService.currentDoc$.pipe(ee(this.dispose$)).subscribe((e) => {
199
199
  this._create(e);
200
200
  }), this._currentUniverService.getAllUniverDocsInstance().forEach((e) => {
201
201
  this._create(e);
202
- }), this._currentUniverService.docDisposed$.pipe(J(this.dispose$)).subscribe((e) => {
202
+ }), this._currentUniverService.docDisposed$.pipe(ee(this.dispose$)).subscribe((e) => {
203
203
  this._docViewModelMap.delete(e.getUnitId());
204
204
  });
205
205
  }
@@ -223,41 +223,41 @@ let q = class extends ce {
223
223
  throw new Error(`Document data model with id ${e} not found when build view model.`);
224
224
  if (t.getBody() != null) {
225
225
  if (!this._docViewModelMap.has(e)) {
226
- const s = this._buildDocViewModel(t);
226
+ const r = this._buildDocViewModel(t);
227
227
  this._docViewModelMap.set(e, {
228
228
  unitId: e,
229
- docViewModel: s
229
+ docViewModel: r
230
230
  });
231
231
  }
232
- if (e === qe) {
233
- const s = (n = this._docViewModelMap.get(e)) == null ? void 0 : n.docViewModel;
234
- if (s == null)
232
+ if (e === lt) {
233
+ const r = (n = this._docViewModelMap.get(e)) == null ? void 0 : n.docViewModel;
234
+ if (r == null)
235
235
  return;
236
- s.reset(t);
236
+ r.reset(t);
237
237
  }
238
238
  this._currentDocViewModel$.next(this._docViewModelMap.get(e));
239
239
  }
240
240
  }
241
241
  _buildDocViewModel(e) {
242
- return new _t(e);
242
+ return new Pt(e);
243
243
  }
244
244
  };
245
- q = Ut([
246
- bt(0, D)
247
- ], q);
248
- var wt = Object.defineProperty, Lt = Object.getOwnPropertyDescriptor, Bt = (o, e, t, n) => {
249
- for (var s = n > 1 ? void 0 : n ? Lt(e, t) : e, r = o.length - 1, i; r >= 0; r--)
250
- (i = o[r]) && (s = (n ? i(e, t, s) : i(s)) || s);
251
- return n && s && wt(e, t, s), s;
252
- }, ge = (o, e) => (t, n) => e(t, n, o);
253
- const Ft = 300;
254
- let ae = class extends ce {
245
+ te = Zt([
246
+ Jt(0, E)
247
+ ], te);
248
+ var qt = Object.defineProperty, Kt = Object.getOwnPropertyDescriptor, Qt = (o, e, t, n) => {
249
+ for (var r = n > 1 ? void 0 : n ? Kt(e, t) : e, s = o.length - 1, i; s >= 0; s--)
250
+ (i = o[s]) && (r = (n ? i(e, t, r) : i(r)) || r);
251
+ return n && r && qt(e, t, r), r;
252
+ }, Ie = (o, e) => (t, n) => e(t, n, o);
253
+ const en = 300;
254
+ let de = class extends ue {
255
255
  constructor(e, t, n) {
256
256
  super();
257
- O(this, "_docStateChange$", new Z(null));
258
- O(this, "docStateChange$", this._docStateChange$.asObservable());
259
- O(this, "_stateCache", /* @__PURE__ */ new Map());
260
- O(this, "_timer", null);
257
+ y(this, "_docStateChange$", new Q(null));
258
+ y(this, "docStateChange$", this._docStateChange$.asObservable());
259
+ y(this, "_stateCache", /* @__PURE__ */ new Map());
260
+ y(this, "_timer", null);
261
261
  this._undoRedoService = e, this._commandService = t, this._univerInstanceService = n, this._initialize();
262
262
  }
263
263
  setChangeState(e) {
@@ -267,7 +267,7 @@ let ae = class extends ce {
267
267
  _initialize() {
268
268
  this.disposeWithMe(
269
269
  this._commandService.beforeCommandExecuted((e) => {
270
- if (e.id === we || e.id === Le) {
270
+ if (e.id === He || e.id === Xe) {
271
271
  const t = this._univerInstanceService.getCurrentUniverDocInstance();
272
272
  if (t == null)
273
273
  return;
@@ -278,49 +278,49 @@ let ae = class extends ce {
278
278
  );
279
279
  }
280
280
  _cacheChangeState(e) {
281
- const { trigger: t, unitId: n, noHistory: s } = e;
282
- if (!(t === Le || t === we || s)) {
281
+ const { trigger: t, unitId: n, noHistory: r } = e;
282
+ if (!(t === Xe || t === He || r)) {
283
283
  if (this._stateCache.has(n)) {
284
- const r = this._stateCache.get(n);
285
- r == null || r.push(e);
284
+ const s = this._stateCache.get(n);
285
+ s == null || s.push(e);
286
286
  } else
287
287
  this._stateCache.set(n, [e]);
288
- t === ue.id || t === me.id ? (this._timer && clearTimeout(this._timer), this._timer = setTimeout(() => {
288
+ t === he.id || t === fe.id ? (this._timer && clearTimeout(this._timer), this._timer = setTimeout(() => {
289
289
  this._pushHistory(n);
290
- }, Ft)) : this._pushHistory(n);
290
+ }, en)) : this._pushHistory(n);
291
291
  }
292
292
  }
293
293
  _pushHistory(e) {
294
294
  const t = this._undoRedoService, n = this._stateCache.get(e);
295
295
  if (!Array.isArray(n) || n.length === 0)
296
296
  return;
297
- const s = n.length, r = n[0].commandId, i = n[0], a = n[s - 1], c = {
297
+ const r = n.length, s = n[0].commandId, i = n[0], a = n[r - 1], c = {
298
298
  unitId: e,
299
- actions: n.reduce((l, u) => b.compose(l, u.redoState.actions), []),
299
+ actions: n.reduce((l, u) => P.compose(l, u.redoState.actions), []),
300
300
  textRanges: a.redoState.textRanges
301
301
  }, d = {
302
302
  unitId: e,
303
303
  // Always need to put undoParams after redoParams, because `reverse` will change the `cacheStates` order.
304
- actions: n.reverse().reduce((l, u) => b.compose(l, u.undoState.actions), []),
304
+ actions: n.reverse().reduce((l, u) => P.compose(l, u.undoState.actions), []),
305
305
  textRanges: i.undoState.textRanges
306
306
  };
307
307
  t.pushUndoRedo({
308
308
  unitID: e,
309
- undoMutations: [{ id: r, params: d }],
310
- redoMutations: [{ id: r, params: c }]
309
+ undoMutations: [{ id: s, params: d }],
310
+ redoMutations: [{ id: s, params: c }]
311
311
  }), n.length = 0;
312
312
  }
313
313
  };
314
- ae = Bt([
315
- ge(0, B(ve)),
316
- ge(1, I),
317
- ge(2, D)
318
- ], ae);
319
- class de {
314
+ de = Qt([
315
+ Ie(0, z(Oe)),
316
+ Ie(1, I),
317
+ Ie(2, E)
318
+ ], de);
319
+ class ge {
320
320
  constructor() {
321
- O(this, "_previousActiveRange", null);
322
- O(this, "_undoMutationParamsCache", []);
323
- O(this, "_redoMutationParamsCache", []);
321
+ y(this, "_previousActiveRange", null);
322
+ y(this, "_undoMutationParamsCache", []);
323
+ y(this, "_redoMutationParamsCache", []);
324
324
  }
325
325
  clearUndoRedoMutationParamsCache() {
326
326
  this._undoMutationParamsCache = [], this._redoMutationParamsCache = [];
@@ -348,13 +348,13 @@ class de {
348
348
  return null;
349
349
  const { unitId: e } = this._undoMutationParamsCache[0], t = {
350
350
  unitId: e,
351
- actions: this._undoMutationParamsCache.reverse().reduce((s, r) => b.compose(s, r.actions), []),
351
+ actions: this._undoMutationParamsCache.reverse().reduce((r, s) => P.compose(r, s.actions), []),
352
352
  textRanges: []
353
353
  // Add empty array, will never use, just fix type error
354
354
  };
355
355
  return { redoMutationParams: {
356
356
  unitId: e,
357
- actions: this._redoMutationParamsCache.reduce((s, r) => b.compose(s, r.actions), []),
357
+ actions: this._redoMutationParamsCache.reduce((r, s) => P.compose(r, s.actions), []),
358
358
  textRanges: []
359
359
  // Add empty array, will never use, just fix type error
360
360
  }, undoMutationParams: t, previousActiveRange: this._previousActiveRange };
@@ -363,188 +363,188 @@ class de {
363
363
  this._undoMutationParamsCache = [], this._redoMutationParamsCache = [], this._previousActiveRange = null;
364
364
  }
365
365
  }
366
- const ze = "doc.mutation.rich-text-editing", w = {
367
- id: ze,
366
+ const Je = "doc.mutation.rich-text-editing", L = {
367
+ id: Je,
368
368
  type: v.MUTATION,
369
369
  handler: (o, e) => {
370
- var A;
370
+ var B;
371
371
  const {
372
372
  unitId: t,
373
373
  actions: n,
374
- textRanges: s,
375
- prevTextRanges: r,
374
+ textRanges: r,
375
+ prevTextRanges: s,
376
376
  trigger: i,
377
377
  noHistory: a,
378
378
  isCompositionEnd: c,
379
379
  noNeedSetTextRange: d
380
- } = e, u = o.get(D).getUniverDocInstance(t), g = o.get(q).getViewModel(t), p = o.get(T), f = ((A = p.getSelections()) != null ? A : []).map(G), S = o.get(ae), _ = o.get(de);
380
+ } = e, u = o.get(E).getUniverDocInstance(t), g = o.get(te).getViewModel(t), p = o.get(T), h = ((B = p.getSelections()) != null ? B : []).map(W), S = o.get(de), _ = o.get(ge);
381
381
  if (u == null || g == null)
382
382
  throw new Error(`DocumentDataModel or documentViewModel not found for unitId: ${t}`);
383
- const C = !!u.getSnapshot().disabled;
384
- if (n.length === 0 || C)
383
+ const x = !!u.getSnapshot().disabled;
384
+ if (n.length === 0 || x)
385
385
  return {
386
386
  unitId: t,
387
387
  actions: [],
388
- textRanges: f
388
+ textRanges: h
389
389
  };
390
- const R = u.apply(n), { segmentId: M } = n[0], P = u.getSelfOrHeaderFooterModel(M);
391
- g.getSelfOrHeaderFooterViewModel(M).reset(P), !d && s && i != null && queueMicrotask(() => {
392
- p.replaceTextRanges(s);
390
+ const C = u.apply(n), { segmentId: M } = n[0], D = u.getSelfOrHeaderFooterModel(M);
391
+ g.getSelfOrHeaderFooterViewModel(M).reset(D), !d && r && i != null && queueMicrotask(() => {
392
+ p.replaceTextRanges(r);
393
393
  });
394
- const E = {
395
- commandId: ze,
394
+ const N = {
395
+ commandId: Je,
396
396
  unitId: t,
397
397
  trigger: i,
398
398
  noHistory: a,
399
399
  redoState: {
400
400
  actions: n,
401
- textRanges: s
401
+ textRanges: r
402
402
  },
403
403
  undoState: {
404
- actions: R,
405
- textRanges: r != null ? r : f
404
+ actions: C,
405
+ textRanges: s != null ? s : h
406
406
  }
407
407
  };
408
408
  if (c) {
409
- const x = _.fetchComposedUndoRedoMutationParams();
410
- if (x == null)
409
+ const O = _.fetchComposedUndoRedoMutationParams();
410
+ if (O == null)
411
411
  throw new Error("historyParams is null in RichTextEditingMutation");
412
- const { undoMutationParams: $, redoMutationParams: L, previousActiveRange: ne } = x;
413
- E.redoState.actions = L.actions, E.undoState.actions = $.actions, E.undoState.textRanges = [ne];
412
+ const { undoMutationParams: U, redoMutationParams: w, previousActiveRange: X } = O;
413
+ N.redoState.actions = w.actions, N.undoState.actions = U.actions, N.undoState.textRanges = [X];
414
414
  }
415
- return S.setChangeState(E), {
415
+ return S.setChangeState(N), {
416
416
  unitId: t,
417
- actions: R,
418
- textRanges: f
417
+ actions: C,
418
+ textRanges: h
419
419
  };
420
420
  }
421
- }, ue = {
421
+ }, he = {
422
422
  id: "doc.command.insert-text",
423
423
  type: v.COMMAND,
424
424
  handler: async (o, e) => {
425
- const t = o.get(I), { range: n, segmentId: s, body: r, unitId: i, textRanges: a } = e, { startOffset: c, collapsed: d } = n, l = {
426
- id: w.id,
425
+ const t = o.get(I), { range: n, segmentId: r, body: s, unitId: i, textRanges: a } = e, { startOffset: c, collapsed: d } = n, l = {
426
+ id: L.id,
427
427
  params: {
428
428
  unitId: i,
429
429
  actions: [],
430
430
  textRanges: a
431
431
  }
432
- }, u = new b();
432
+ }, u = new P();
433
433
  return d ? c > 0 && u.push({
434
- t: y.RETAIN,
434
+ t: R.RETAIN,
435
435
  len: c,
436
- segmentId: s
437
- }) : u.push(...xe(n, s)), u.push({
438
- t: y.INSERT,
439
- body: r,
440
- len: r.dataStream.length,
436
+ segmentId: r
437
+ }) : u.push(...be(n, r)), u.push({
438
+ t: R.INSERT,
439
+ body: s,
440
+ len: s.dataStream.length,
441
441
  line: 0,
442
- segmentId: s
442
+ segmentId: r
443
443
  }), l.params.actions = u.serialize(), !!t.syncExecuteCommand(l.id, l.params);
444
444
  }
445
445
  };
446
- var k = /* @__PURE__ */ ((o) => (o[o.LEFT = 0] = "LEFT", o[o.RIGHT = 1] = "RIGHT", o))(k || {});
447
- const me = {
446
+ var G = /* @__PURE__ */ ((o) => (o[o.LEFT = 0] = "LEFT", o[o.RIGHT = 1] = "RIGHT", o))(G || {});
447
+ const fe = {
448
448
  id: "doc.command.delete-text",
449
449
  type: v.COMMAND,
450
450
  handler: async (o, e) => {
451
- const t = o.get(I), { range: n, segmentId: s, unitId: r, direction: i, textRanges: a, len: c = 1 } = e, { startOffset: d } = n, l = {
452
- id: w.id,
451
+ const t = o.get(I), { range: n, segmentId: r, unitId: s, direction: i, textRanges: a, len: c = 1 } = e, { startOffset: d } = n, l = {
452
+ id: L.id,
453
453
  params: {
454
- unitId: r,
454
+ unitId: s,
455
455
  actions: [],
456
456
  textRanges: a
457
457
  }
458
- }, u = new b();
458
+ }, u = new P();
459
459
  return d > 0 && u.push({
460
- t: y.RETAIN,
460
+ t: R.RETAIN,
461
461
  len: i === 0 ? d - c : d,
462
- segmentId: s
462
+ segmentId: r
463
463
  }), u.push({
464
- t: y.DELETE,
464
+ t: R.DELETE,
465
465
  len: c,
466
466
  line: 0,
467
- segmentId: s
467
+ segmentId: r
468
468
  }), l.params.actions = u.serialize(), !!t.syncExecuteCommand(l.id, l.params);
469
469
  }
470
- }, nt = {
470
+ }, ht = {
471
471
  id: "doc.command.update-text",
472
472
  type: v.COMMAND,
473
473
  handler: async (o, e) => {
474
- const { range: t, segmentId: n, updateBody: s, coverType: r, unitId: i, textRanges: a } = e, c = o.get(I), d = {
475
- id: w.id,
474
+ const { range: t, segmentId: n, updateBody: r, coverType: s, unitId: i, textRanges: a } = e, c = o.get(I), d = {
475
+ id: L.id,
476
476
  params: {
477
477
  unitId: i,
478
478
  actions: [],
479
479
  textRanges: a
480
480
  }
481
- }, l = new b(), { startOffset: u, endOffset: m } = t;
481
+ }, l = new P(), { startOffset: u, endOffset: m } = t;
482
482
  return l.push({
483
- t: y.RETAIN,
483
+ t: R.RETAIN,
484
484
  len: u,
485
485
  segmentId: n
486
486
  }), l.push({
487
- t: y.RETAIN,
488
- body: s,
487
+ t: R.RETAIN,
488
+ body: r,
489
489
  len: m - u,
490
490
  segmentId: n,
491
- coverType: r
491
+ coverType: s
492
492
  }), d.params.actions = l.serialize(), !!c.syncExecuteCommand(d.id, d.params);
493
493
  }
494
494
  };
495
- function $t(o, e) {
495
+ function tn(o, e) {
496
496
  const t = [];
497
- for (let n = 0, s = o.length; n < s; n++)
498
- o[n] === pe.PARAGRAPH && t.push({
497
+ for (let n = 0, r = o.length; n < r; n++)
498
+ o[n] === xe.PARAGRAPH && t.push({
499
499
  startIndex: n
500
500
  });
501
501
  if (e)
502
502
  for (const n of t)
503
- e.bullet && (n.bullet = W.deepClone(e.bullet)), e.paragraphStyle && (n.paragraphStyle = W.deepClone(e.paragraphStyle));
503
+ e.bullet && (n.bullet = K.deepClone(e.bullet)), e.paragraphStyle && (n.paragraphStyle = K.deepClone(e.paragraphStyle));
504
504
  return t;
505
505
  }
506
- const zt = {
506
+ const nn = {
507
507
  id: "doc.command.break-line",
508
508
  type: v.COMMAND,
509
509
  handler: async (o) => {
510
- var p, h;
511
- const e = o.get(T), t = o.get(D), n = o.get(I), s = e.getActiveRange();
512
- if (s == null)
510
+ var p, f;
511
+ const e = o.get(T), t = o.get(E), n = o.get(I), r = e.getActiveRange();
512
+ if (r == null)
513
513
  return !1;
514
- const r = t.getCurrentUniverDocInstance(), i = r.getUnitId(), { startOffset: a, segmentId: c, style: d } = s, l = [
514
+ const s = t.getCurrentUniverDocInstance(), i = s.getUnitId(), { startOffset: a, segmentId: c, style: d } = r, l = [
515
515
  {
516
516
  startOffset: a + 1,
517
517
  endOffset: a + 1,
518
518
  style: d
519
519
  }
520
- ], m = ((h = (p = r.getBody()) == null ? void 0 : p.paragraphs) != null ? h : []).find((f) => f.startIndex >= a);
521
- return await n.executeCommand(ue.id, {
520
+ ], m = ((f = (p = s.getBody()) == null ? void 0 : p.paragraphs) != null ? f : []).find((h) => h.startIndex >= a);
521
+ return await n.executeCommand(he.id, {
522
522
  unitId: i,
523
523
  body: {
524
- dataStream: pe.PARAGRAPH,
525
- paragraphs: $t(pe.PARAGRAPH, m)
524
+ dataStream: xe.PARAGRAPH,
525
+ paragraphs: tn(xe.PARAGRAPH, m)
526
526
  },
527
- range: s,
527
+ range: r,
528
528
  textRanges: l,
529
529
  segmentId: c
530
530
  });
531
531
  }
532
532
  };
533
- var Vt = Object.defineProperty, kt = Object.getOwnPropertyDescriptor, jt = (o, e, t, n) => {
534
- for (var s = n > 1 ? void 0 : n ? kt(e, t) : e, r = o.length - 1, i; r >= 0; r--)
535
- (i = o[r]) && (s = (n ? i(e, t, s) : i(s)) || s);
536
- return n && s && Vt(e, t, s), s;
537
- }, fe = (o, e) => (t, n) => e(t, n, o);
538
- let j = class extends ce {
533
+ var on = Object.defineProperty, rn = Object.getOwnPropertyDescriptor, sn = (o, e, t, n) => {
534
+ for (var r = n > 1 ? void 0 : n ? rn(e, t) : e, s = o.length - 1, i; s >= 0; s--)
535
+ (i = o[s]) && (r = (n ? i(e, t, r) : i(r)) || r);
536
+ return n && r && on(e, t, r), r;
537
+ }, Me = (o, e) => (t, n) => e(t, n, o);
538
+ let H = class extends ue {
539
539
  constructor(e, t, n) {
540
540
  super();
541
- O(this, "_currentSkeletonUnitId", "");
542
- O(this, "_docSkeletonMap", /* @__PURE__ */ new Map());
543
- O(this, "_currentSkeleton$", new Z(null));
544
- O(this, "currentSkeleton$", this._currentSkeleton$.asObservable());
541
+ y(this, "_currentSkeletonUnitId", "");
542
+ y(this, "_docSkeletonMap", /* @__PURE__ */ new Map());
543
+ y(this, "_currentSkeleton$", new Q(null));
544
+ y(this, "currentSkeleton$", this._currentSkeleton$.asObservable());
545
545
  // CurrentSkeletonBefore for pre-triggered logic during registration
546
- O(this, "_currentSkeletonBefore$", new Z(null));
547
- O(this, "currentSkeletonBefore$", this._currentSkeletonBefore$.asObservable());
546
+ y(this, "_currentSkeletonBefore$", new Q(null));
547
+ y(this, "currentSkeletonBefore$", this._currentSkeletonBefore$.asObservable());
548
548
  this._localeService = e, this._docViewModelManagerService = t, this._currentUniverService = n, this._initialize();
549
549
  }
550
550
  _initialize() {
@@ -554,11 +554,11 @@ let j = class extends ce {
554
554
  this._currentSkeletonBefore$.complete(), this._currentSkeleton$.complete(), this._docSkeletonMap.clear();
555
555
  }
556
556
  _init() {
557
- this._docViewModelManagerService.currentDocViewModel$.pipe(J(this.dispose$)).subscribe((e) => {
557
+ this._docViewModelManagerService.currentDocViewModel$.pipe(ee(this.dispose$)).subscribe((e) => {
558
558
  e != null && this._setCurrent(e);
559
559
  }), this._docViewModelManagerService.getAllModel().forEach((e) => {
560
560
  e != null && this._setCurrent(e);
561
- }), this._currentUniverService.docDisposed$.pipe(J(this.dispose$)).subscribe((e) => {
561
+ }), this._currentUniverService.docDisposed$.pipe(ee(this.dispose$)).subscribe((e) => {
562
562
  this._docSkeletonMap.delete(e.getUnitId()), this._currentSkeletonUnitId = this._currentUniverService.getCurrentUniverDocInstance().getUnitId();
563
563
  });
564
564
  }
@@ -594,164 +594,168 @@ let j = class extends ce {
594
594
  return this._currentSkeletonUnitId = t, this._currentSkeletonBefore$.next(this.getCurrent()), this._currentSkeleton$.next(this.getCurrent()), this.getCurrent();
595
595
  }
596
596
  _buildSkeleton(e) {
597
- return vt.create(e, this._localeService);
597
+ return Ut.create(e, this._localeService);
598
598
  }
599
599
  };
600
- j = jt([
601
- fe(0, B(mt)),
602
- fe(1, B(q)),
603
- fe(2, D)
604
- ], j);
605
- const Un = {
600
+ H = sn([
601
+ Me(0, z(Ot)),
602
+ Me(1, z(te)),
603
+ Me(2, E)
604
+ ], H);
605
+ const Zn = {
606
606
  id: "doc.command.inner-paste",
607
607
  type: v.COMMAND,
608
608
  handler: async (o, e) => {
609
- const { segmentId: t, body: n, textRanges: s } = e, r = o.get(I), i = o.get(T), a = o.get(D), c = i.getSelections();
609
+ const { segmentId: t, body: n, textRanges: r } = e, s = o.get(I), i = o.get(T), a = o.get(E), c = i.getSelections();
610
610
  if (!Array.isArray(c) || c.length === 0)
611
611
  return !1;
612
612
  const l = a.getCurrentUniverDocInstance().getUnitId(), u = {
613
- id: w.id,
613
+ id: L.id,
614
614
  params: {
615
615
  unitId: l,
616
616
  actions: [],
617
- textRanges: s
617
+ textRanges: r
618
618
  }
619
- }, m = new Q();
619
+ }, m = new oe();
620
620
  m.reset();
621
- const g = new b();
622
- for (const h of c) {
623
- const { startOffset: f, endOffset: S, collapsed: _ } = h, C = f - m.cursor;
621
+ const g = new P();
622
+ for (const f of c) {
623
+ const { startOffset: h, endOffset: S, collapsed: _ } = f, x = h - m.cursor;
624
624
  _ ? g.push({
625
- t: y.RETAIN,
626
- len: C,
625
+ t: R.RETAIN,
626
+ len: x,
627
627
  segmentId: t
628
- }) : g.push(...xe(h, t, m.cursor)), g.push({
629
- t: y.INSERT,
628
+ }) : g.push(...be(f, t, m.cursor)), g.push({
629
+ t: R.INSERT,
630
630
  body: n,
631
631
  len: n.dataStream.length,
632
632
  line: 0,
633
633
  segmentId: t
634
634
  }), m.reset(), m.moveCursor(S);
635
635
  }
636
- return u.params.actions = g.serialize(), !!r.syncExecuteCommand(u.id, u.params);
636
+ return u.params.actions = g.serialize(), !!s.syncExecuteCommand(u.id, u.params);
637
637
  }
638
- }, ot = {
638
+ }, ft = {
639
639
  id: "doc.command.inner-cut",
640
640
  type: v.COMMAND,
641
641
  handler: async (o, e) => {
642
- const { segmentId: t, textRanges: n } = e, s = o.get(I), r = o.get(T), i = o.get(D), a = r.getSelections();
642
+ const { segmentId: t, textRanges: n } = e, r = o.get(I), s = o.get(T), i = o.get(E), a = s.getSelections();
643
643
  if (!Array.isArray(a) || a.length === 0)
644
644
  return !1;
645
- const c = i.getCurrentUniverDocInstance().getUnitId(), d = i.getUniverDocInstance(c), l = gt(d.snapshot, t);
645
+ const c = i.getCurrentUniverDocInstance().getUnitId(), d = i.getUniverDocInstance(c), l = Tt(d.snapshot, t);
646
646
  if (l == null)
647
647
  return !1;
648
648
  const u = {
649
- id: w.id,
649
+ id: L.id,
650
650
  params: {
651
651
  unitId: c,
652
652
  actions: [],
653
653
  textRanges: n
654
654
  }
655
- }, m = new Q();
655
+ }, m = new oe();
656
656
  m.reset();
657
- const g = new b();
658
- for (const h of a) {
659
- const { startOffset: f, endOffset: S, collapsed: _ } = h, C = f - m.cursor;
657
+ const g = new P();
658
+ for (const f of a) {
659
+ const { startOffset: h, endOffset: S, collapsed: _ } = f, x = h - m.cursor;
660
660
  _ ? g.push({
661
- t: y.RETAIN,
662
- len: C,
661
+ t: R.RETAIN,
662
+ len: x,
663
663
  segmentId: t
664
- }) : g.push(...Gt(h, l, t, m.cursor)), m.reset(), m.moveCursor(S);
664
+ }) : g.push(...an(f, l, t, m.cursor)), m.reset(), m.moveCursor(S);
665
665
  }
666
- return u.params.actions = g.serialize(), !!s.syncExecuteCommand(u.id, u.params);
666
+ return u.params.actions = g.serialize(), !!r.syncExecuteCommand(u.id, u.params);
667
667
  }
668
668
  };
669
- function Gt(o, e, t = "", n = 0) {
670
- const { startOffset: s, endOffset: r } = o, i = [], { paragraphs: a = [] } = e, c = s - n, d = r - n, l = a == null ? void 0 : a.find(
669
+ function an(o, e, t = "", n = 0) {
670
+ const { startOffset: r, endOffset: s } = o, i = [], { paragraphs: a = [] } = e, c = r - n, d = s - n, l = a == null ? void 0 : a.find(
671
671
  (u) => u.startIndex - n >= c && u.startIndex - n <= d
672
672
  );
673
673
  if (c > 0 && i.push({
674
- t: y.RETAIN,
674
+ t: R.RETAIN,
675
675
  len: c,
676
676
  segmentId: t
677
677
  }), l && l.startIndex - n > c) {
678
678
  const u = l.startIndex - n;
679
679
  i.push({
680
- t: y.DELETE,
680
+ t: R.DELETE,
681
681
  len: u - c,
682
682
  line: 0,
683
683
  segmentId: t
684
684
  }), i.push({
685
- t: y.RETAIN,
685
+ t: R.RETAIN,
686
686
  len: 1,
687
687
  segmentId: t
688
688
  }), d > u + 1 && i.push({
689
- t: y.DELETE,
689
+ t: R.DELETE,
690
690
  len: d - u - 1,
691
691
  line: 0,
692
692
  segmentId: t
693
693
  });
694
694
  } else
695
695
  i.push({
696
- t: y.DELETE,
696
+ t: R.DELETE,
697
697
  len: d - c,
698
698
  line: 0,
699
699
  segmentId: t
700
700
  });
701
701
  return i;
702
702
  }
703
- const Ht = {
703
+ const cn = {
704
704
  id: "doc.command.delete-left",
705
705
  type: v.COMMAND,
706
706
  handler: async (o) => {
707
- var R;
708
- const e = o.get(T), t = o.get(j), n = o.get(D), s = o.get(I), r = e.getActiveRange(), i = e.getSelections(), a = (R = t.getCurrent()) == null ? void 0 : R.skeleton;
707
+ var C;
708
+ const e = o.get(T), t = o.get(H), n = o.get(E), r = o.get(I), s = e.getActiveRange(), i = e.getSelections(), a = (C = t.getCurrent()) == null ? void 0 : C.skeleton;
709
709
  let c = !0;
710
- if (r == null || a == null || i == null)
710
+ if (s == null || a == null || i == null)
711
711
  return !1;
712
- const d = n.getCurrentUniverDocInstance(), { startOffset: l, collapsed: u, segmentId: m, style: g } = r, p = a.findNodeByCharIndex(l), h = It(p), f = Mt(p, d.getBody());
712
+ const d = n.getCurrentUniverDocInstance(), { startOffset: l, collapsed: u, segmentId: m, style: g } = s, p = a.findNodeByCharIndex(l), f = wt(p), h = Lt(p, d.getBody());
713
713
  let S = l;
714
714
  const _ = a.findNodeByCharIndex(l - 1);
715
- if (Ct(p) && _ !== p && (h === !0 || f === !0)) {
716
- const M = Rt(p, d.getBody());
715
+ if (Bt(p) && _ !== p && (f === !0 || h === !0)) {
716
+ const M = Ft(p, d.getBody());
717
717
  if (M == null)
718
718
  return !1;
719
- const P = M == null ? void 0 : M.startIndex, N = { startIndex: 0 }, E = M.paragraphStyle;
720
- if (h === !0) {
721
- const x = M.paragraphStyle;
722
- x && (N.paragraphStyle = x);
723
- } else if (f === !0) {
724
- const x = M.bullet;
725
- x && (N.bullet = x), E != null && (N.paragraphStyle = { ...E }, delete N.paragraphStyle.hanging, delete N.paragraphStyle.indentStart);
719
+ const D = M == null ? void 0 : M.startIndex, A = { startIndex: 0 }, N = M.paragraphStyle;
720
+ if (f === !0) {
721
+ const O = M.paragraphStyle;
722
+ if (O) {
723
+ A.paragraphStyle = O;
724
+ const { hanging: U } = O;
725
+ U && (A.paragraphStyle.indentStart = U, A.paragraphStyle.hanging = void 0);
726
+ }
727
+ } else if (h === !0) {
728
+ const O = M.bullet;
729
+ O && (A.bullet = O), N != null && (A.paragraphStyle = { ...N }, delete A.paragraphStyle.hanging, delete A.paragraphStyle.indentStart);
726
730
  }
727
- const A = [
731
+ const B = [
728
732
  {
729
733
  startOffset: S,
730
734
  endOffset: S,
731
735
  style: g
732
736
  }
733
737
  ];
734
- c = await s.executeCommand(nt.id, {
738
+ c = await r.executeCommand(ht.id, {
735
739
  unitId: d.getUnitId(),
736
740
  updateBody: {
737
741
  dataStream: "",
738
- paragraphs: [{ ...N }]
742
+ paragraphs: [{ ...A }]
739
743
  },
740
744
  range: {
741
- startOffset: P,
742
- endOffset: P + 1
745
+ startOffset: D,
746
+ endOffset: D + 1
743
747
  },
744
- textRanges: A,
745
- coverType: Ie.REPLACE,
748
+ textRanges: B,
749
+ coverType: Te.REPLACE,
746
750
  segmentId: m
747
751
  });
748
752
  } else if (u === !0) {
749
753
  if (_ == null)
750
754
  return !0;
751
755
  if (_.content === "\r")
752
- c = await s.executeCommand(ye.id, {
753
- direction: k.LEFT,
754
- range: r
756
+ c = await r.executeCommand(Ne.id, {
757
+ direction: G.LEFT,
758
+ range: s
755
759
  });
756
760
  else {
757
761
  S -= _.count;
@@ -762,150 +766,150 @@ const Ht = {
762
766
  style: g
763
767
  }
764
768
  ];
765
- c = await s.executeCommand(me.id, {
769
+ c = await r.executeCommand(fe.id, {
766
770
  unitId: d.getUnitId(),
767
- range: r,
771
+ range: s,
768
772
  segmentId: m,
769
- direction: k.LEFT,
773
+ direction: G.LEFT,
770
774
  len: _.count,
771
775
  textRanges: M
772
776
  });
773
777
  }
774
778
  } else {
775
- const M = st(r, i);
776
- c = await s.executeCommand(ot.id, {
779
+ const M = pt(s, i);
780
+ c = await r.executeCommand(ft.id, {
777
781
  segmentId: m,
778
782
  textRanges: M
779
783
  });
780
784
  }
781
785
  return c;
782
786
  }
783
- }, Xt = {
787
+ }, ln = {
784
788
  id: "doc.command.delete-right",
785
789
  type: v.COMMAND,
786
790
  handler: async (o) => {
787
791
  var p;
788
- const e = o.get(T), t = o.get(j), n = o.get(D), s = o.get(I), r = e.getActiveRange(), i = e.getSelections(), a = (p = t.getCurrent()) == null ? void 0 : p.skeleton;
792
+ const e = o.get(T), t = o.get(H), n = o.get(E), r = o.get(I), s = e.getActiveRange(), i = e.getSelections(), a = (p = t.getCurrent()) == null ? void 0 : p.skeleton;
789
793
  let c;
790
- if (r == null || a == null || i == null)
794
+ if (s == null || a == null || i == null)
791
795
  return !1;
792
- const d = n.getCurrentUniverDocInstance(), { startOffset: l, collapsed: u, segmentId: m, style: g } = r;
796
+ const d = n.getCurrentUniverDocInstance(), { startOffset: l, collapsed: u, segmentId: m, style: g } = s;
793
797
  if (l === d.getBody().dataStream.length - 2 && u)
794
798
  return !0;
795
799
  if (u === !0) {
796
- const h = a.findNodeByCharIndex(l);
797
- if (h.content === "\r")
798
- c = await s.executeCommand(ye.id, {
799
- direction: k.RIGHT,
800
- range: r
800
+ const f = a.findNodeByCharIndex(l);
801
+ if (f.content === "\r")
802
+ c = await r.executeCommand(Ne.id, {
803
+ direction: G.RIGHT,
804
+ range: s
801
805
  });
802
806
  else {
803
- const f = [
807
+ const h = [
804
808
  {
805
809
  startOffset: l,
806
810
  endOffset: l,
807
811
  style: g
808
812
  }
809
813
  ];
810
- c = await s.executeCommand(me.id, {
814
+ c = await r.executeCommand(fe.id, {
811
815
  unitId: d.getUnitId(),
812
- range: r,
816
+ range: s,
813
817
  segmentId: m,
814
- direction: k.RIGHT,
815
- textRanges: f,
816
- len: h.count
818
+ direction: G.RIGHT,
819
+ textRanges: h,
820
+ len: f.count
817
821
  });
818
822
  }
819
823
  } else {
820
- const h = st(r, i);
821
- c = await s.executeCommand(ot.id, {
824
+ const f = pt(s, i);
825
+ c = await r.executeCommand(ft.id, {
822
826
  segmentId: m,
823
- textRanges: h
827
+ textRanges: f
824
828
  });
825
829
  }
826
830
  return c;
827
831
  }
828
- }, ye = {
832
+ }, Ne = {
829
833
  id: "doc.command.merge-two-paragraph",
830
834
  type: v.COMMAND,
831
835
  handler: async (o, e) => {
832
- var N, E, A;
833
- const t = o.get(T), n = o.get(D), s = o.get(I), { direction: r, range: i } = e, a = t.getActiveRange(), c = t.getSelections();
836
+ var A, N, B;
837
+ const t = o.get(T), n = o.get(E), r = o.get(I), { direction: s, range: i } = e, a = t.getActiveRange(), c = t.getSelections();
834
838
  if (a == null || c == null)
835
839
  return !1;
836
840
  const d = n.getCurrentUniverDocInstance(), { startOffset: l, collapsed: u, segmentId: m, style: g } = a;
837
841
  if (!u)
838
842
  return !1;
839
- const p = r === k.LEFT ? l : l + 1, h = (A = (E = (N = d.getBody()) == null ? void 0 : N.paragraphs) == null ? void 0 : E.find((x) => x.startIndex >= p)) == null ? void 0 : A.startIndex, f = Yt(d.getBody(), p, h), S = r === k.LEFT ? l - 1 : l, _ = d.getUnitId(), C = [
843
+ const p = s === G.LEFT ? l : l + 1, f = (B = (N = (A = d.getBody()) == null ? void 0 : A.paragraphs) == null ? void 0 : N.find((O) => O.startIndex >= p)) == null ? void 0 : B.startIndex, h = dn(d.getBody(), p, f), S = s === G.LEFT ? l - 1 : l, _ = d.getUnitId(), x = [
840
844
  {
841
845
  startOffset: S,
842
846
  endOffset: S,
843
847
  style: g
844
848
  }
845
- ], R = {
846
- id: w.id,
849
+ ], C = {
850
+ id: L.id,
847
851
  params: {
848
852
  unitId: _,
849
853
  actions: [],
850
- textRanges: C,
854
+ textRanges: x,
851
855
  prevTextRanges: [i]
852
856
  }
853
- }, M = new b();
857
+ }, M = new P();
854
858
  return M.push({
855
- t: y.RETAIN,
856
- len: r === k.LEFT ? l - 1 : l,
859
+ t: R.RETAIN,
860
+ len: s === G.LEFT ? l - 1 : l,
857
861
  segmentId: m
858
- }), f.dataStream.length && M.push({
859
- t: y.INSERT,
860
- body: f,
861
- len: f.dataStream.length,
862
+ }), h.dataStream.length && M.push({
863
+ t: R.INSERT,
864
+ body: h,
865
+ len: h.dataStream.length,
862
866
  line: 0,
863
867
  segmentId: m
864
868
  }), M.push({
865
- t: y.RETAIN,
869
+ t: R.RETAIN,
866
870
  len: 1,
867
871
  segmentId: m
868
872
  }), M.push({
869
- t: y.DELETE,
870
- len: h + 1 - p,
873
+ t: R.DELETE,
874
+ len: f + 1 - p,
871
875
  line: 0,
872
876
  segmentId: m
873
- }), R.params.actions = M.serialize(), !!s.syncExecuteCommand(R.id, R.params);
877
+ }), C.params.actions = M.serialize(), !!r.syncExecuteCommand(C.id, C.params);
874
878
  }
875
879
  };
876
- function Yt(o, e, t) {
877
- const { textRuns: n } = o, s = o.dataStream.substring(e, t);
880
+ function dn(o, e, t) {
881
+ const { textRuns: n } = o, r = o.dataStream.substring(e, t);
878
882
  if (n == null)
879
883
  return {
880
- dataStream: s
884
+ dataStream: r
881
885
  };
882
- const r = [];
886
+ const s = [];
883
887
  for (const i of n) {
884
888
  const { st: a, ed: c } = i;
885
- c <= e || a >= t || (a < e ? r.push({
889
+ c <= e || a >= t || (a < e ? s.push({
886
890
  ...i,
887
891
  st: 0,
888
892
  ed: c - e
889
- }) : c > t ? r.push({
893
+ }) : c > t ? s.push({
890
894
  ...i,
891
895
  st: a - e,
892
896
  ed: t - e
893
- }) : r.push({
897
+ }) : s.push({
894
898
  ...i,
895
899
  st: a - e,
896
900
  ed: c - e
897
901
  }));
898
902
  }
899
903
  return {
900
- dataStream: s,
901
- textRuns: r
904
+ dataStream: r,
905
+ textRuns: s
902
906
  };
903
907
  }
904
- function st(o, e) {
908
+ function pt(o, e) {
905
909
  let t = o.endOffset;
906
- for (const s of e) {
907
- const { startOffset: r, endOffset: i } = s;
908
- r == null || i == null || i <= o.endOffset && (t -= i - r);
910
+ for (const r of e) {
911
+ const { startOffset: s, endOffset: i } = r;
912
+ s == null || i == null || i <= o.endOffset && (t -= i - s);
909
913
  }
910
914
  return [
911
915
  {
@@ -915,11 +919,11 @@ function st(o, e) {
915
919
  }
916
920
  ];
917
921
  }
918
- const rt = {
922
+ const St = {
919
923
  id: "doc.command.ime-input",
920
924
  type: v.COMMAND,
921
925
  handler: async (o, e) => {
922
- const { unitId: t, newText: n, oldTextLen: s, isCompositionEnd: r, isCompositionStart: i } = e, a = o.get(I), c = o.get(de), d = c.getActiveRange();
926
+ const { unitId: t, newText: n, oldTextLen: r, isCompositionEnd: s, isCompositionStart: i } = e, a = o.get(I), c = o.get(ge), d = c.getActiveRange();
923
927
  if (d == null)
924
928
  return !1;
925
929
  const { startOffset: l, style: u, segmentId: m } = d, g = n.length, p = [
@@ -929,501 +933,540 @@ const rt = {
929
933
  collapsed: !0,
930
934
  style: u
931
935
  }
932
- ], h = {
933
- id: w.id,
936
+ ], f = {
937
+ id: L.id,
934
938
  params: {
935
939
  unitId: t,
936
940
  actions: [],
937
941
  textRanges: p
938
942
  }
939
- }, f = new b();
940
- !d.collapsed && i ? f.push(...xe(d, m)) : f.push({
941
- t: y.RETAIN,
943
+ }, h = new P();
944
+ !d.collapsed && i ? h.push(...be(d, m)) : h.push({
945
+ t: R.RETAIN,
942
946
  len: l,
943
947
  segmentId: m
944
- }), s > 0 && f.push({
945
- t: y.DELETE,
946
- len: s,
948
+ }), r > 0 && h.push({
949
+ t: R.DELETE,
950
+ len: r,
947
951
  line: 0,
948
952
  segmentId: m
949
- }), f.push({
950
- t: y.INSERT,
953
+ }), h.push({
954
+ t: R.INSERT,
951
955
  body: {
952
956
  dataStream: n
953
957
  },
954
958
  len: n.length,
955
959
  line: 0,
956
960
  segmentId: m
957
- }), h.params.actions = f.serialize(), h.params.noHistory = !r, h.params.isCompositionEnd = r;
958
- const S = a.syncExecuteCommand(h.id, h.params);
959
- return c.pushUndoRedoMutationParams(S, h.params), !!S;
961
+ }), f.params.actions = h.serialize(), f.params.noHistory = !s, f.params.isCompositionEnd = s;
962
+ const S = a.syncExecuteCommand(f.id, f.params);
963
+ return c.pushUndoRedoMutationParams(S, f.params), !!S;
960
964
  }
961
965
  };
962
966
  function F(o, e, t, n) {
963
- var r;
964
- const { segmentId: s } = (r = t.getActiveRange()) != null ? r : {};
965
- return s == null ? !1 : n.executeCommand(at.id, {
966
- segmentId: s,
967
+ var s;
968
+ const { segmentId: r } = (s = t.getActiveRange()) != null ? s : {};
969
+ return r == null ? !1 : n.executeCommand(vt.id, {
970
+ segmentId: r,
967
971
  preCommandId: o,
968
972
  ...e != null ? e : {}
969
973
  });
970
974
  }
971
- const Ve = "doc.command.set-inline-format-bold", Oe = {
972
- id: Ve,
975
+ const qe = "doc.command.set-inline-format-bold", Pe = {
976
+ id: qe,
973
977
  type: v.COMMAND,
974
978
  handler: async (o, e) => {
975
979
  const t = o.get(I), n = o.get(T);
976
980
  return F(
977
- Ve,
981
+ qe,
978
982
  e,
979
983
  n,
980
984
  t
981
985
  );
982
986
  }
983
- }, ke = "doc.command.set-inline-format-italic", Te = {
984
- id: ke,
987
+ }, Ke = "doc.command.set-inline-format-italic", Ue = {
988
+ id: Ke,
985
989
  type: v.COMMAND,
986
990
  handler: async (o, e) => {
987
991
  const t = o.get(I), n = o.get(T);
988
992
  return F(
989
- ke,
993
+ Ke,
990
994
  e,
991
995
  n,
992
996
  t
993
997
  );
994
998
  }
995
- }, je = "doc.command.set-inline-format-underline", Ee = {
996
- id: je,
999
+ }, Qe = "doc.command.set-inline-format-underline", we = {
1000
+ id: Qe,
997
1001
  type: v.COMMAND,
998
1002
  handler: async (o, e) => {
999
1003
  const t = o.get(I), n = o.get(T);
1000
1004
  return F(
1001
- je,
1005
+ Qe,
1006
+ e,
1007
+ n,
1008
+ t
1009
+ );
1010
+ }
1011
+ }, et = "doc.command.set-inline-format-strikethrough", Le = {
1012
+ id: et,
1013
+ type: v.COMMAND,
1014
+ handler: async (o, e) => {
1015
+ const t = o.get(I), n = o.get(T);
1016
+ return F(
1017
+ et,
1018
+ e,
1019
+ n,
1020
+ t
1021
+ );
1022
+ }
1023
+ }, tt = "doc.command.set-inline-format-subscript", ne = {
1024
+ id: tt,
1025
+ type: v.COMMAND,
1026
+ handler: async (o, e) => {
1027
+ const t = o.get(I), n = o.get(T);
1028
+ return F(
1029
+ tt,
1002
1030
  e,
1003
1031
  n,
1004
1032
  t
1005
1033
  );
1006
1034
  }
1007
- }, Ge = "doc.command.set-inline-format-strikethrough", De = {
1008
- id: Ge,
1035
+ }, nt = "doc.command.set-inline-format-superscript", Be = {
1036
+ id: nt,
1009
1037
  type: v.COMMAND,
1010
1038
  handler: async (o, e) => {
1011
1039
  const t = o.get(I), n = o.get(T);
1012
1040
  return F(
1013
- Ge,
1041
+ nt,
1014
1042
  e,
1015
1043
  n,
1016
1044
  t
1017
1045
  );
1018
1046
  }
1019
- }, He = "doc.command.set-inline-format-subscript", K = {
1020
- id: He,
1047
+ }, ot = "doc.command.set-inline-format-fontsize", Fe = {
1048
+ id: ot,
1021
1049
  type: v.COMMAND,
1022
1050
  handler: async (o, e) => {
1023
1051
  const t = o.get(I), n = o.get(T);
1024
1052
  return F(
1025
- He,
1053
+ ot,
1026
1054
  e,
1027
1055
  n,
1028
1056
  t
1029
1057
  );
1030
1058
  }
1031
- }, Xe = "doc.command.set-inline-format-superscript", Ae = {
1032
- id: Xe,
1059
+ }, rt = "doc.command.set-inline-format-font-family", $e = {
1060
+ id: rt,
1033
1061
  type: v.COMMAND,
1034
1062
  handler: async (o, e) => {
1035
1063
  const t = o.get(I), n = o.get(T);
1036
1064
  return F(
1037
- Xe,
1065
+ rt,
1038
1066
  e,
1039
1067
  n,
1040
1068
  t
1041
1069
  );
1042
1070
  }
1043
- }, Ye = "doc.command.set-inline-format-fontsize", Pe = {
1044
- id: Ye,
1071
+ }, st = "doc.command.set-inline-format-text-color", ze = {
1072
+ id: st,
1045
1073
  type: v.COMMAND,
1046
1074
  handler: async (o, e) => {
1047
1075
  const t = o.get(I), n = o.get(T);
1048
1076
  return F(
1049
- Ye,
1077
+ st,
1050
1078
  e,
1051
1079
  n,
1052
1080
  t
1053
1081
  );
1054
1082
  }
1055
- }, We = "doc.command.set-inline-format-font-family", Ne = {
1056
- id: We,
1083
+ }, it = "doc.command.set-inline-format-text-background-color", ke = {
1084
+ id: it,
1057
1085
  type: v.COMMAND,
1058
1086
  handler: async (o, e) => {
1059
1087
  const t = o.get(I), n = o.get(T);
1060
1088
  return F(
1061
- We,
1089
+ it,
1062
1090
  e,
1063
1091
  n,
1064
1092
  t
1065
1093
  );
1066
1094
  }
1067
- }, Ze = "doc.command.set-inline-format-text-color", Ue = {
1068
- id: Ze,
1095
+ }, at = "doc.command.reset-inline-format-text-background-color", Ve = {
1096
+ id: at,
1069
1097
  type: v.COMMAND,
1070
1098
  handler: async (o, e) => {
1071
1099
  const t = o.get(I), n = o.get(T);
1072
1100
  return F(
1073
- Ze,
1101
+ at,
1074
1102
  e,
1075
1103
  n,
1076
1104
  t
1077
1105
  );
1078
1106
  }
1079
- }, it = {
1080
- [Oe.id]: "bl",
1081
- [Te.id]: "it",
1082
- [Ee.id]: "ul",
1083
- [De.id]: "st",
1084
- [Pe.id]: "fs",
1085
- [Ne.id]: "ff",
1086
- [Ue.id]: "cl",
1087
- [K.id]: "va",
1088
- [Ae.id]: "va"
1089
- }, at = {
1107
+ }, _t = {
1108
+ [Pe.id]: "bl",
1109
+ [Ue.id]: "it",
1110
+ [we.id]: "ul",
1111
+ [Le.id]: "st",
1112
+ [Fe.id]: "fs",
1113
+ [$e.id]: "ff",
1114
+ [ze.id]: "cl",
1115
+ [ke.id]: "bg",
1116
+ [Ve.id]: "bg",
1117
+ [ne.id]: "va",
1118
+ [Be.id]: "va"
1119
+ }, vt = {
1090
1120
  id: "doc.command.set-inline-format",
1091
1121
  type: v.COMMAND,
1092
1122
  handler: async (o, e) => {
1093
- const { segmentId: t, value: n, preCommandId: s } = e, r = o.get(I), i = o.get(T), a = o.get(D), c = i.getSelections();
1123
+ const { segmentId: t, value: n, preCommandId: r } = e, s = o.get(I), i = o.get(T), a = o.get(E), c = i.getSelections();
1094
1124
  if (!Array.isArray(c) || c.length === 0)
1095
1125
  return !1;
1096
1126
  let d = a.getCurrentUniverDocInstance(), l = d.getUnitId();
1097
- l === ft && (d = a.getUniverDocInstance(qe), l = d.getUnitId());
1127
+ l === Et && (d = a.getUniverDocInstance(lt), l = d.getUnitId());
1098
1128
  let u;
1099
- switch (s) {
1100
- case Oe.id:
1101
- case Te.id:
1102
- case Ee.id:
1103
- case De.id:
1104
- case K.id:
1105
- case Ae.id: {
1106
- u = Zt(
1129
+ switch (r) {
1130
+ case Pe.id:
1131
+ case Ue.id:
1132
+ case we.id:
1133
+ case Le.id:
1134
+ case ne.id:
1135
+ case Be.id: {
1136
+ u = mn(
1107
1137
  d.getBody().textRuns,
1108
- s,
1138
+ r,
1109
1139
  c
1110
1140
  );
1111
1141
  break;
1112
1142
  }
1113
- case Pe.id:
1114
- case Ne.id: {
1143
+ case Fe.id:
1144
+ case $e.id: {
1115
1145
  u = n;
1116
1146
  break;
1117
1147
  }
1118
- case Ue.id: {
1148
+ case ze.id:
1149
+ case ke.id: {
1119
1150
  u = {
1120
1151
  rgb: n
1121
1152
  };
1122
1153
  break;
1123
1154
  }
1155
+ case Ve.id: {
1156
+ u = {
1157
+ rgb: null
1158
+ };
1159
+ break;
1160
+ }
1124
1161
  default:
1125
- throw new Error(`Unknown command: ${s} in handleInlineFormat`);
1162
+ throw new Error(`Unknown command: ${r} in handleInlineFormat`);
1126
1163
  }
1127
1164
  const m = {
1128
- id: w.id,
1165
+ id: L.id,
1129
1166
  params: {
1130
1167
  unitId: l,
1131
1168
  actions: [],
1132
- textRanges: c.map(G)
1169
+ textRanges: c.map(W)
1133
1170
  }
1134
- }, g = new b(), p = new Q();
1171
+ }, g = new P(), p = new oe();
1135
1172
  p.reset();
1136
- for (const f of c) {
1137
- const { startOffset: S, endOffset: _ } = f, C = {
1173
+ for (const h of c) {
1174
+ const { startOffset: S, endOffset: _ } = h, x = {
1138
1175
  dataStream: "",
1139
1176
  textRuns: [
1140
1177
  {
1141
1178
  st: 0,
1142
1179
  ed: _ - S,
1143
1180
  ts: {
1144
- [it[s]]: u
1181
+ [_t[r]]: u
1145
1182
  }
1146
1183
  }
1147
1184
  ]
1148
- }, R = S - p.cursor;
1149
- R !== 0 && g.push({
1150
- t: y.RETAIN,
1151
- len: R,
1185
+ }, C = S - p.cursor;
1186
+ C !== 0 && g.push({
1187
+ t: R.RETAIN,
1188
+ len: C,
1152
1189
  segmentId: t
1153
1190
  }), g.push({
1154
- t: y.RETAIN,
1155
- body: C,
1191
+ t: R.RETAIN,
1192
+ body: x,
1156
1193
  len: _ - S,
1157
1194
  segmentId: t
1158
1195
  }), p.reset(), p.moveCursor(_);
1159
1196
  }
1160
- return m.params.actions = g.serialize(), !!r.syncExecuteCommand(m.id, m.params);
1197
+ return m.params.actions = g.serialize(), !!s.syncExecuteCommand(m.id, m.params);
1161
1198
  }
1162
1199
  };
1163
- function Wt(o) {
1200
+ function un(o) {
1164
1201
  return o !== null && typeof o == "object";
1165
1202
  }
1166
- function Zt(o, e, t) {
1167
- let n = 0, s = 0;
1168
- const r = it[e];
1169
- for (; n !== o.length && s !== t.length; ) {
1170
- const { startOffset: i, endOffset: a } = t[s], { st: c, ed: d, ts: l } = o[n];
1203
+ function mn(o, e, t) {
1204
+ let n = 0, r = 0;
1205
+ const s = _t[e];
1206
+ for (; n !== o.length && r !== t.length; ) {
1207
+ const { startOffset: i, endOffset: a } = t[r], { st: c, ed: d, ts: l } = o[n];
1171
1208
  if (a <= c)
1172
- s++;
1209
+ r++;
1173
1210
  else if (d <= i)
1174
1211
  n++;
1175
1212
  else {
1176
- if (/bl|it/.test(r))
1177
- return (l == null ? void 0 : l[r]) === z.TRUE ? z.FALSE : z.TRUE;
1178
- if (/ul|st/.test(r))
1179
- return Wt(l == null ? void 0 : l[r]) && (l == null ? void 0 : l[r]).s === z.TRUE ? {
1180
- s: z.FALSE
1213
+ if (/bl|it/.test(s))
1214
+ return (l == null ? void 0 : l[s]) === V.TRUE ? V.FALSE : V.TRUE;
1215
+ if (/ul|st/.test(s))
1216
+ return un(l == null ? void 0 : l[s]) && (l == null ? void 0 : l[s]).s === V.TRUE ? {
1217
+ s: V.FALSE
1181
1218
  } : {
1182
- s: z.TRUE
1219
+ s: V.TRUE
1183
1220
  };
1184
- if (/va/.test(r))
1185
- return e === K.id ? (l == null ? void 0 : l[r]) === V.SUBSCRIPT ? V.NORMAL : V.SUBSCRIPT : (l == null ? void 0 : l[r]) === V.SUPERSCRIPT ? V.NORMAL : V.SUPERSCRIPT;
1221
+ if (/va/.test(s))
1222
+ return e === ne.id ? (l == null ? void 0 : l[s]) === j.SUBSCRIPT ? j.NORMAL : j.SUBSCRIPT : (l == null ? void 0 : l[s]) === j.SUPERSCRIPT ? j.NORMAL : j.SUPERSCRIPT;
1186
1223
  n++;
1187
1224
  }
1188
1225
  }
1189
- return /bl|it/.test(r) ? z.TRUE : /ul|st/.test(r) ? {
1190
- s: z.TRUE
1191
- } : e === K.id ? V.SUBSCRIPT : V.SUPERSCRIPT;
1226
+ return /bl|it/.test(s) ? V.TRUE : /ul|st/.test(s) ? {
1227
+ s: V.TRUE
1228
+ } : e === ne.id ? j.SUBSCRIPT : j.SUPERSCRIPT;
1192
1229
  }
1193
- const be = {
1230
+ const je = {
1194
1231
  id: "doc.command.list-operation",
1195
1232
  type: v.COMMAND,
1196
1233
  handler: (o, e) => {
1197
- var M, P, N;
1198
- const t = o.get(T), n = o.get(D), s = o.get(I), { listType: r } = e, i = n.getCurrentUniverDocInstance(), a = t.getActiveRange(), c = (M = t.getSelections()) != null ? M : [], d = (P = i.getBody()) == null ? void 0 : P.paragraphs, l = c.map(G);
1234
+ var O, U, w, X;
1235
+ const t = o.get(T), n = o.get(E), r = o.get(I), { listType: s } = e, i = n.getCurrentUniverDocInstance(), a = t.getActiveRange(), c = (O = t.getSelections()) != null ? O : [], d = (U = i.getBody()) == null ? void 0 : U.paragraphs, l = c.map(W);
1199
1236
  if (a == null || d == null)
1200
1237
  return !1;
1201
- const u = ct(a, d), { segmentId: m } = a, g = i.getUnitId(), p = u.every((E) => {
1202
- var A;
1203
- return ((A = E.bullet) == null ? void 0 : A.listType) === r;
1238
+ const u = It(a, d), { segmentId: m } = a, g = i.getUnitId(), p = u.every((Y) => {
1239
+ var $;
1240
+ return (($ = Y.bullet) == null ? void 0 : $.listType) === s;
1204
1241
  });
1205
- let f = W.generateRandomId(6);
1242
+ let h = K.generateRandomId(6);
1206
1243
  if (u.length === 1) {
1207
- const E = d.indexOf(u[0]), A = d[E - 1], x = d[E + 1];
1208
- A && A.bullet && A.bullet.listType === r ? f = A.bullet.listId : x && x.bullet && x.bullet.listType === r && (f = x.bullet.listId);
1244
+ const Y = d.indexOf(u[0]), $ = d[Y - 1], k = d[Y + 1];
1245
+ $ && $.bullet && $.bullet.listType === s ? h = $.bullet.listId : k && k.bullet && k.bullet.listType === s && (h = k.bullet.listId);
1209
1246
  }
1210
1247
  const S = {
1211
- id: w.id,
1248
+ id: L.id,
1212
1249
  params: {
1213
1250
  unitId: g,
1214
1251
  actions: [],
1215
1252
  textRanges: l
1216
1253
  }
1217
- }, _ = new Q();
1254
+ }, _ = new oe();
1218
1255
  _.reset();
1219
- const C = new b();
1220
- for (const E of u) {
1221
- const { startIndex: A } = E;
1222
- C.push({
1223
- t: y.RETAIN,
1224
- len: A - _.cursor,
1256
+ const x = new P(), C = (w = i.getSnapshot().lists) != null ? w : {}, M = {
1257
+ ...Dt,
1258
+ ...C
1259
+ }, { charSpace: D, defaultTabStop: A = 36, gridType: N } = i.getSnapshot().documentStyle;
1260
+ for (const Y of u) {
1261
+ const { startIndex: $, paragraphStyle: k = {} } = Y, { indentFirstLine: Ct = 0, snapToGrid: xt, indentStart: pe = 0 } = k, { hanging: Se, indentStart: Ge } = M[s].nestingLevel[0], _e = $t(D, A, N, xt);
1262
+ x.push({
1263
+ t: R.RETAIN,
1264
+ len: $ - _.cursor,
1225
1265
  segmentId: m
1226
- });
1227
- const x = {
1228
- ...E.paragraphStyle,
1229
- hanging: void 0,
1230
- indentStart: void 0
1231
- };
1232
- C.push({
1233
- t: y.RETAIN,
1266
+ }), x.push({
1267
+ t: R.RETAIN,
1234
1268
  len: 1,
1235
1269
  body: {
1236
1270
  dataStream: "",
1237
1271
  paragraphs: [
1238
1272
  p ? {
1239
- paragraphStyle: x,
1273
+ paragraphStyle: {
1274
+ ...k,
1275
+ hanging: void 0,
1276
+ indentStart: pe ? Math.max(0, ve(pe, _e) + Se - Ge) : void 0
1277
+ },
1240
1278
  startIndex: 0
1241
1279
  } : {
1242
- ...E,
1243
1280
  startIndex: 0,
1281
+ paragraphStyle: {
1282
+ ...k,
1283
+ indentFirstLine: void 0,
1284
+ hanging: Se,
1285
+ indentStart: Ge - Se + ve(Ct, _e) + ve(pe, _e)
1286
+ },
1244
1287
  bullet: {
1245
- ...(N = E.bullet) != null ? N : {
1288
+ ...(X = Y.bullet) != null ? X : {
1246
1289
  nestingLevel: 0,
1247
1290
  textStyle: {
1248
1291
  fs: 20
1249
1292
  }
1250
1293
  },
1251
- listType: r,
1252
- listId: f
1294
+ listType: s,
1295
+ listId: h
1253
1296
  }
1254
1297
  }
1255
1298
  ]
1256
1299
  },
1257
1300
  segmentId: m,
1258
- coverType: Ie.REPLACE
1259
- }), _.moveCursorTo(A + 1);
1301
+ coverType: Te.REPLACE
1302
+ }), _.moveCursorTo($ + 1);
1260
1303
  }
1261
- return S.params.actions = C.serialize(), !!s.syncExecuteCommand(S.id, S.params);
1304
+ return S.params.actions = x.serialize(), !!r.syncExecuteCommand(S.id, S.params);
1262
1305
  }
1263
- }, Jt = {
1306
+ }, gn = {
1264
1307
  id: "doc.command.bullet-list",
1265
1308
  type: v.COMMAND,
1266
- handler: (o) => o.get(I).syncExecuteCommand(be.id, {
1267
- listType: Ke.BULLET_LIST
1309
+ handler: (o) => o.get(I).syncExecuteCommand(je.id, {
1310
+ listType: dt.BULLET_LIST
1268
1311
  })
1269
- }, qt = {
1312
+ }, hn = {
1270
1313
  id: "doc.command.order-list",
1271
1314
  type: v.COMMAND,
1272
- handler: (o) => o.get(I).syncExecuteCommand(be.id, {
1273
- listType: Ke.ORDER_LIST
1315
+ handler: (o) => o.get(I).syncExecuteCommand(je.id, {
1316
+ listType: dt.ORDER_LIST
1274
1317
  })
1275
1318
  };
1276
- function ct(o, e) {
1277
- const { startOffset: t, endOffset: n } = o, s = [];
1278
- let r = -1;
1319
+ function It(o, e) {
1320
+ const { startOffset: t, endOffset: n } = o, r = [];
1321
+ let s = -1;
1279
1322
  for (const i of e) {
1280
1323
  const { startIndex: a } = i;
1281
- (t > r && t <= a || n > r && n <= a || a >= t && a <= n) && s.push(i), r = a;
1324
+ (t > s && t <= a || n > s && n <= a || a >= t && a <= n) && r.push(i), s = a;
1282
1325
  }
1283
- return s;
1326
+ return r;
1284
1327
  }
1285
- const te = {
1328
+ const se = {
1286
1329
  id: "doc.command.align-operation",
1287
1330
  type: v.COMMAND,
1288
1331
  handler: (o, e) => {
1289
- var C, R;
1290
- const t = o.get(T), n = o.get(D), s = o.get(I), { alignType: r } = e, i = n.getCurrentUniverDocInstance(), a = t.getActiveRange(), c = (C = t.getSelections()) != null ? C : [], d = (R = i.getBody()) == null ? void 0 : R.paragraphs, l = c.map(G);
1332
+ var x, C;
1333
+ const t = o.get(T), n = o.get(E), r = o.get(I), { alignType: s } = e, i = n.getCurrentUniverDocInstance(), a = t.getActiveRange(), c = (x = t.getSelections()) != null ? x : [], d = (C = i.getBody()) == null ? void 0 : C.paragraphs, l = c.map(W);
1291
1334
  if (a == null || d == null)
1292
1335
  return !1;
1293
- const u = ct(a, d), { segmentId: m } = a, g = i.getUnitId(), p = u.every((M) => {
1294
- var P;
1295
- return ((P = M.paragraphStyle) == null ? void 0 : P.horizontalAlign) === r;
1296
- }), h = {
1297
- id: w.id,
1336
+ const u = It(a, d), { segmentId: m } = a, g = i.getUnitId(), p = u.every((M) => {
1337
+ var D;
1338
+ return ((D = M.paragraphStyle) == null ? void 0 : D.horizontalAlign) === s;
1339
+ }), f = {
1340
+ id: L.id,
1298
1341
  params: {
1299
1342
  unitId: g,
1300
1343
  actions: [],
1301
1344
  textRanges: l
1302
1345
  }
1303
- }, f = new Q();
1304
- f.reset();
1305
- const S = new b();
1346
+ }, h = new oe();
1347
+ h.reset();
1348
+ const S = new P();
1306
1349
  for (const M of u) {
1307
- const { startIndex: P } = M;
1350
+ const { startIndex: D } = M;
1308
1351
  S.push({
1309
- t: y.RETAIN,
1310
- len: P - f.cursor,
1352
+ t: R.RETAIN,
1353
+ len: D - h.cursor,
1311
1354
  segmentId: m
1312
1355
  });
1313
- const N = {
1356
+ const A = {
1314
1357
  ...M.paragraphStyle,
1315
- horizontalAlign: p ? ee.UNSPECIFIED : r
1358
+ horizontalAlign: p ? re.UNSPECIFIED : s
1316
1359
  };
1317
1360
  S.push({
1318
- t: y.RETAIN,
1361
+ t: R.RETAIN,
1319
1362
  len: 1,
1320
1363
  body: {
1321
1364
  dataStream: "",
1322
1365
  paragraphs: [
1323
1366
  {
1324
1367
  ...M,
1325
- paragraphStyle: N,
1368
+ paragraphStyle: A,
1326
1369
  startIndex: 0
1327
1370
  }
1328
1371
  ]
1329
1372
  },
1330
1373
  segmentId: m,
1331
- coverType: Ie.REPLACE
1332
- }), f.moveCursorTo(P + 1);
1374
+ coverType: Te.REPLACE
1375
+ }), h.moveCursorTo(D + 1);
1333
1376
  }
1334
- return h.params.actions = S.serialize(), !!s.syncExecuteCommand(h.id, h.params);
1377
+ return f.params.actions = S.serialize(), !!r.syncExecuteCommand(f.id, f.params);
1335
1378
  }
1336
- }, Kt = {
1379
+ }, fn = {
1337
1380
  id: "doc.command.align-left",
1338
1381
  type: v.COMMAND,
1339
- handler: (o) => o.get(I).syncExecuteCommand(te.id, {
1340
- alignType: ee.LEFT
1382
+ handler: (o) => o.get(I).syncExecuteCommand(se.id, {
1383
+ alignType: re.LEFT
1341
1384
  })
1342
- }, Qt = {
1385
+ }, pn = {
1343
1386
  id: "doc.command.align-center",
1344
1387
  type: v.COMMAND,
1345
- handler: (o) => o.get(I).syncExecuteCommand(te.id, {
1346
- alignType: ee.CENTER
1388
+ handler: (o) => o.get(I).syncExecuteCommand(se.id, {
1389
+ alignType: re.CENTER
1347
1390
  })
1348
- }, en = {
1391
+ }, Sn = {
1349
1392
  id: "doc.command.align-right",
1350
1393
  type: v.COMMAND,
1351
- handler: (o) => o.get(I).syncExecuteCommand(te.id, {
1352
- alignType: ee.RIGHT
1394
+ handler: (o) => o.get(I).syncExecuteCommand(se.id, {
1395
+ alignType: re.RIGHT
1353
1396
  })
1354
- }, tn = {
1397
+ }, _n = {
1355
1398
  id: "doc.command.align-justify",
1356
1399
  type: v.COMMAND,
1357
- handler: (o) => o.get(I).syncExecuteCommand(te.id, {
1358
- alignType: ee.JUSTIFIED
1400
+ handler: (o) => o.get(I).syncExecuteCommand(se.id, {
1401
+ alignType: re.JUSTIFIED
1359
1402
  })
1360
- }, nn = {
1403
+ }, vn = {
1361
1404
  id: "doc.command-replace-content",
1362
1405
  type: v.COMMAND,
1363
1406
  handler: async (o, e) => {
1364
1407
  var g;
1365
- const { unitId: t, body: n, textRanges: s, segmentId: r = "" } = e, i = o.get(D), a = o.get(I), c = o.get(T), d = (g = i.getUniverDocInstance(t)) == null ? void 0 : g.getSnapshot().body, l = c.getSelections();
1408
+ const { unitId: t, body: n, textRanges: r, segmentId: s = "" } = e, i = o.get(E), a = o.get(I), c = o.get(T), d = (g = i.getUniverDocInstance(t)) == null ? void 0 : g.getSnapshot().body, l = c.getSelections();
1366
1409
  if (d == null || !Array.isArray(l) || l.length === 0)
1367
1410
  return !1;
1368
- const u = lt(t, r, d, n);
1369
- return u.params.textRanges = s, !!a.syncExecuteCommand(u.id, u.params);
1411
+ const u = Mt(t, s, d, n);
1412
+ return u.params.textRanges = r, !!a.syncExecuteCommand(u.id, u.params);
1370
1413
  }
1371
- }, on = {
1414
+ }, In = {
1372
1415
  id: "doc.command-cover-content",
1373
1416
  type: v.COMMAND,
1374
1417
  handler: async (o, e) => {
1375
1418
  var l;
1376
- const { unitId: t, body: n, segmentId: s = "" } = e, r = o.get(D), i = o.get(I), a = o.get(ve), c = (l = r.getUniverDocInstance(t)) == null ? void 0 : l.getSnapshot().body;
1419
+ const { unitId: t, body: n, segmentId: r = "" } = e, s = o.get(E), i = o.get(I), a = o.get(Oe), c = (l = s.getUniverDocInstance(t)) == null ? void 0 : l.getSnapshot().body;
1377
1420
  if (c == null)
1378
1421
  return !1;
1379
- const d = lt(t, s, c, n);
1422
+ const d = Mt(t, r, c, n);
1380
1423
  return d.params.noNeedSetTextRange = !0, d.params.noHistory = !0, i.syncExecuteCommand(
1381
1424
  d.id,
1382
1425
  d.params
1383
1426
  ), a.clearUndoRedo(t), !0;
1384
1427
  }
1385
1428
  };
1386
- function lt(o, e, t, n) {
1387
- const s = {
1388
- id: w.id,
1429
+ function Mt(o, e, t, n) {
1430
+ const r = {
1431
+ id: L.id,
1389
1432
  params: {
1390
1433
  unitId: o,
1391
1434
  actions: [],
1392
1435
  textRanges: []
1393
1436
  }
1394
- }, r = new b(), i = (t == null ? void 0 : t.dataStream.length) - 2;
1395
- return i > 0 && r.push({
1396
- t: y.DELETE,
1437
+ }, s = new P(), i = (t == null ? void 0 : t.dataStream.length) - 2;
1438
+ return i > 0 && s.push({
1439
+ t: R.DELETE,
1397
1440
  len: i,
1398
1441
  line: 0,
1399
1442
  segmentId: e
1400
- }), n.dataStream.length > 0 && r.push({
1401
- t: y.INSERT,
1443
+ }), n.dataStream.length > 0 && s.push({
1444
+ t: R.INSERT,
1402
1445
  body: n,
1403
1446
  len: n.dataStream.length,
1404
1447
  line: 0,
1405
1448
  segmentId: e
1406
- }), s.params.actions = r.serialize(), s;
1449
+ }), r.params.actions = s.serialize(), r;
1407
1450
  }
1408
- const Se = {
1451
+ const Re = {
1409
1452
  id: "doc.operation.move-cursor",
1410
1453
  type: v.OPERATION,
1411
1454
  handler: (o, e) => !!e
1412
- }, _e = {
1455
+ }, ye = {
1413
1456
  id: "doc.operation.move-selection",
1414
1457
  type: v.OPERATION,
1415
1458
  handler: (o, e) => !!e
1416
- }, sn = (o, e) => {
1417
- const t = o.get(D).getUniverDocInstance(e.unitId), n = (t == null ? void 0 : t.zoomRatio) || 1;
1459
+ }, Mn = (o, e) => {
1460
+ const t = o.get(E).getUniverDocInstance(e.unitId), n = (t == null ? void 0 : t.zoomRatio) || 1;
1418
1461
  return {
1419
- ...W.deepClone(e),
1462
+ ...K.deepClone(e),
1420
1463
  zoomRatio: n
1421
1464
  };
1422
- }, oe = {
1465
+ }, ie = {
1423
1466
  id: "doc.operation.set-zoom-ratio",
1424
1467
  type: v.OPERATION,
1425
1468
  handler: (o, e) => {
1426
- const t = o.get(D).getUniverDocInstance(e.unitId);
1469
+ const t = o.get(E).getUniverDocInstance(e.unitId);
1427
1470
  if (!t)
1428
1471
  return !1;
1429
1472
  const n = t.getSnapshot();
@@ -1431,55 +1474,55 @@ const Se = {
1431
1474
  zoomRatio: e.zoomRatio
1432
1475
  } : n.settings.zoomRatio = e.zoomRatio, !0;
1433
1476
  }
1434
- }, rn = {
1477
+ }, Cn = {
1435
1478
  type: v.COMMAND,
1436
1479
  id: "doc.command.set-zoom-ratio",
1437
1480
  handler: async (o, e) => {
1438
1481
  var u, m;
1439
- const t = o.get(I), n = o.get(ve), s = o.get(D);
1440
- let r = s.getCurrentUniverDocInstance().getUnitId(), i = 1;
1441
- if (e && (r = (u = e.documentId) != null ? u : r, i = (m = e.zoomRatio) != null ? m : i), !s.getUniverDocInstance(r))
1482
+ const t = o.get(I), n = o.get(Oe), r = o.get(E);
1483
+ let s = r.getCurrentUniverDocInstance().getUnitId(), i = 1;
1484
+ if (e && (s = (u = e.documentId) != null ? u : s, i = (m = e.zoomRatio) != null ? m : i), !r.getUniverDocInstance(s))
1442
1485
  return !1;
1443
1486
  const c = {
1444
1487
  zoomRatio: i,
1445
- unitId: r
1446
- }, d = sn(o, c);
1447
- return t.syncExecuteCommand(oe.id, c) ? (n.pushUndoRedo({
1448
- unitID: r,
1449
- undoMutations: [{ id: oe.id, params: d }],
1450
- redoMutations: [{ id: oe.id, params: c }]
1488
+ unitId: s
1489
+ }, d = Mn(o, c);
1490
+ return t.syncExecuteCommand(ie.id, c) ? (n.pushUndoRedo({
1491
+ unitID: s,
1492
+ undoMutations: [{ id: ie.id, params: d }],
1493
+ redoMutations: [{ id: ie.id, params: c }]
1451
1494
  }), !0) : !1;
1452
1495
  }
1453
- }, an = {
1496
+ }, xn = {
1454
1497
  id: "doc.operation.select-all",
1455
1498
  type: v.COMMAND,
1456
1499
  handler: async (o) => {
1457
- const e = o.get(D), t = o.get(T), n = e.getCurrentUniverDocInstance().getSnapshot().body;
1500
+ const e = o.get(E), t = o.get(T), n = e.getCurrentUniverDocInstance().getSnapshot().body;
1458
1501
  if (n == null)
1459
1502
  return !1;
1460
- const s = [
1503
+ const r = [
1461
1504
  {
1462
1505
  startOffset: 0,
1463
1506
  endOffset: n.dataStream.length - 2
1464
1507
  }
1465
1508
  ];
1466
- return t.replaceTextRanges(s, !1), !0;
1509
+ return t.replaceTextRanges(r, !1), !0;
1467
1510
  }
1468
1511
  };
1469
- var cn = Object.defineProperty, ln = Object.getOwnPropertyDescriptor, dn = (o, e, t, n) => {
1470
- for (var s = n > 1 ? void 0 : n ? ln(e, t) : e, r = o.length - 1, i; r >= 0; r--)
1471
- (i = o[r]) && (s = (n ? i(e, t, s) : i(s)) || s);
1472
- return n && s && cn(e, t, s), s;
1473
- }, H = (o, e) => (t, n) => e(t, n, o);
1474
- let se = class extends Re {
1475
- constructor(e, t, n, s, r) {
1512
+ var Rn = Object.defineProperty, yn = Object.getOwnPropertyDescriptor, On = (o, e, t, n) => {
1513
+ for (var r = n > 1 ? void 0 : n ? yn(e, t) : e, s = o.length - 1, i; s >= 0; s--)
1514
+ (i = o[s]) && (r = (n ? i(e, t, r) : i(r)) || r);
1515
+ return n && r && Rn(e, t, r), r;
1516
+ }, Z = (o, e) => (t, n) => e(t, n, o);
1517
+ let ae = class extends Ae {
1518
+ constructor(e, t, n, r, s) {
1476
1519
  super();
1477
- O(this, "_previousIMEContent", "");
1478
- O(this, "_isCompositionStart", !0);
1479
- O(this, "_onStartSubscription");
1480
- O(this, "_onUpdateSubscription");
1481
- O(this, "_onEndSubscription");
1482
- this._docSkeletonManagerService = e, this._currentUniverService = t, this._textSelectionRenderManager = n, this._imeInputManagerService = s, this._commandService = r, this._initialize();
1520
+ y(this, "_previousIMEContent", "");
1521
+ y(this, "_isCompositionStart", !0);
1522
+ y(this, "_onStartSubscription");
1523
+ y(this, "_onUpdateSubscription");
1524
+ y(this, "_onEndSubscription");
1525
+ this._docSkeletonManagerService = e, this._currentUniverService = t, this._textSelectionRenderManager = n, this._imeInputManagerService = r, this._commandService = s, this._initialize();
1483
1526
  }
1484
1527
  dispose() {
1485
1528
  var e, t, n;
@@ -1494,7 +1537,7 @@ let se = class extends Re {
1494
1537
  return;
1495
1538
  this._resetIME();
1496
1539
  const { activeRange: t } = e;
1497
- t != null && this._imeInputManagerService.setActiveRange(W.deepClone(t));
1540
+ t != null && this._imeInputManagerService.setActiveRange(K.deepClone(t));
1498
1541
  });
1499
1542
  }
1500
1543
  _initialOnCompositionUpdate() {
@@ -1512,12 +1555,12 @@ let se = class extends Re {
1512
1555
  const n = (d = this._docSkeletonManagerService.getCurrent()) == null ? void 0 : d.skeleton;
1513
1556
  if (e == null || n == null)
1514
1557
  return;
1515
- const s = this._currentUniverService.getCurrentUniverDocInstance(), { event: r, activeRange: i } = e;
1558
+ const r = this._currentUniverService.getCurrentUniverDocInstance(), { event: s, activeRange: i } = e;
1516
1559
  if (n == null || i == null)
1517
1560
  return;
1518
- const c = r.data;
1519
- c === this._previousIMEContent && t || (await this._commandService.executeCommand(rt.id, {
1520
- unitId: s.getUnitId(),
1561
+ const c = s.data;
1562
+ c === this._previousIMEContent && t || (await this._commandService.executeCommand(St.id, {
1563
+ unitId: r.getUnitId(),
1521
1564
  newText: c,
1522
1565
  oldTextLen: this._previousIMEContent.length,
1523
1566
  isCompositionStart: this._isCompositionStart,
@@ -1528,24 +1571,24 @@ let se = class extends Re {
1528
1571
  this._previousIMEContent = "", this._isCompositionStart = !0, this._imeInputManagerService.clearUndoRedoMutationParamsCache(), this._imeInputManagerService.setActiveRange(null);
1529
1572
  }
1530
1573
  };
1531
- se = dn([
1532
- Me(Ce.Rendered, se),
1533
- H(0, B(j)),
1534
- H(1, D),
1535
- H(2, le),
1536
- H(3, B(de)),
1537
- H(4, I)
1538
- ], se);
1539
- var un = Object.defineProperty, mn = Object.getOwnPropertyDescriptor, gn = (o, e, t, n) => {
1540
- for (var s = n > 1 ? void 0 : n ? mn(e, t) : e, r = o.length - 1, i; r >= 0; r--)
1541
- (i = o[r]) && (s = (n ? i(e, t, s) : i(s)) || s);
1542
- return n && s && un(e, t, s), s;
1543
- }, X = (o, e) => (t, n) => e(t, n, o);
1544
- let re = class extends Re {
1545
- constructor(e, t, n, s, r) {
1574
+ ae = On([
1575
+ Ee(De.Rendered, ae),
1576
+ Z(0, z(H)),
1577
+ Z(1, E),
1578
+ Z(2, me),
1579
+ Z(3, z(ge)),
1580
+ Z(4, I)
1581
+ ], ae);
1582
+ var Tn = Object.defineProperty, En = Object.getOwnPropertyDescriptor, Dn = (o, e, t, n) => {
1583
+ for (var r = n > 1 ? void 0 : n ? En(e, t) : e, s = o.length - 1, i; s >= 0; s--)
1584
+ (i = o[s]) && (r = (n ? i(e, t, r) : i(r)) || r);
1585
+ return n && r && Tn(e, t, r), r;
1586
+ }, J = (o, e) => (t, n) => e(t, n, o);
1587
+ let ce = class extends Ae {
1588
+ constructor(e, t, n, r, s) {
1546
1589
  super();
1547
- O(this, "_onInputSubscription");
1548
- this._docSkeletonManagerService = e, this._currentUniverService = t, this._renderManagerService = n, this._textSelectionManagerService = s, this._commandService = r, this._initialize(), this._commandExecutedListener();
1590
+ y(this, "_onInputSubscription");
1591
+ this._docSkeletonManagerService = e, this._currentUniverService = t, this._renderManagerService = n, this._textSelectionManagerService = r, this._commandService = s, this._initialize(), this._commandExecutedListener();
1549
1592
  }
1550
1593
  dispose() {
1551
1594
  var e;
@@ -1554,16 +1597,16 @@ let re = class extends Re {
1554
1597
  _initialize() {
1555
1598
  }
1556
1599
  _commandExecutedListener() {
1557
- const e = [Se.id, _e.id];
1600
+ const e = [Re.id, ye.id];
1558
1601
  this.disposeWithMe(
1559
1602
  this._commandService.onCommandExecuted((t) => {
1560
1603
  if (!e.includes(t.id))
1561
1604
  return;
1562
1605
  const n = t.params;
1563
1606
  switch (t.id) {
1564
- case Se.id:
1607
+ case Re.id:
1565
1608
  return this._handleMoveCursor(n.direction);
1566
- case _e.id:
1609
+ case ye.id:
1567
1610
  return this._handleShiftMoveSelection(n.direction);
1568
1611
  default:
1569
1612
  throw new Error("Unknown command");
@@ -1572,30 +1615,30 @@ let re = class extends Re {
1572
1615
  );
1573
1616
  }
1574
1617
  _handleShiftMoveSelection(e) {
1575
- var h, f, S;
1576
- const t = this._textSelectionManagerService.getActiveRange(), n = this._textSelectionManagerService.getSelections(), s = this._currentUniverService.getCurrentUniverDocInstance(), r = (h = this._docSkeletonManagerService.getCurrent()) == null ? void 0 : h.skeleton, i = this._getDocObject();
1577
- if (t == null || r == null || i == null)
1618
+ var f, h, S;
1619
+ const t = this._textSelectionManagerService.getActiveRange(), n = this._textSelectionManagerService.getSelections(), r = this._currentUniverService.getCurrentUniverDocInstance(), s = (f = this._docSkeletonManagerService.getCurrent()) == null ? void 0 : f.skeleton, i = this._getDocObject();
1620
+ if (t == null || s == null || i == null)
1578
1621
  return;
1579
1622
  const { startOffset: a, endOffset: c, style: d, collapsed: l, direction: u } = t;
1580
1623
  if (n.length > 1) {
1581
- let _ = Number.POSITIVE_INFINITY, C = Number.NEGATIVE_INFINITY;
1582
- for (const R of n)
1583
- _ = Math.min(_, R.startOffset), C = Math.max(C, R.endOffset);
1624
+ let _ = Number.POSITIVE_INFINITY, x = Number.NEGATIVE_INFINITY;
1625
+ for (const C of n)
1626
+ _ = Math.min(_, C.startOffset), x = Math.max(x, C.endOffset);
1584
1627
  this._textSelectionManagerService.replaceTextRanges([
1585
1628
  {
1586
- startOffset: e === U.LEFT || e === U.UP ? C : _,
1587
- endOffset: e === U.LEFT || e === U.UP ? _ : C,
1629
+ startOffset: e === b.LEFT || e === b.UP ? x : _,
1630
+ endOffset: e === b.LEFT || e === b.UP ? _ : x,
1588
1631
  style: d
1589
1632
  }
1590
1633
  ], !1);
1591
1634
  return;
1592
1635
  }
1593
- const m = l || u === Be.FORWARD ? a : c;
1594
- let g = l || u === Be.FORWARD ? c : a;
1595
- const p = (f = s.getBody().dataStream.length) != null ? f : Number.POSITIVE_INFINITY;
1596
- if (e === U.LEFT || e === U.RIGHT) {
1597
- const _ = r.findNodeByCharIndex(g - 1), C = r.findNodeByCharIndex(g);
1598
- g = e === U.RIGHT ? g + C.count : g - ((S = _ == null ? void 0 : _.count) != null ? S : 0), g = Math.min(p - 2, Math.max(0, g)), this._textSelectionManagerService.replaceTextRanges([
1636
+ const m = l || u === Ye.FORWARD ? a : c;
1637
+ let g = l || u === Ye.FORWARD ? c : a;
1638
+ const p = (h = r.getBody().dataStream.length) != null ? h : Number.POSITIVE_INFINITY;
1639
+ if (e === b.LEFT || e === b.RIGHT) {
1640
+ const _ = s.findNodeByCharIndex(g - 1), x = s.findNodeByCharIndex(g);
1641
+ g = e === b.RIGHT ? g + x.count : g - ((S = _ == null ? void 0 : _.count) != null ? S : 0), g = Math.min(p - 2, Math.max(0, g)), this._textSelectionManagerService.replaceTextRanges([
1599
1642
  {
1600
1643
  startOffset: m,
1601
1644
  endOffset: g,
@@ -1603,23 +1646,23 @@ let re = class extends Re {
1603
1646
  }
1604
1647
  ], !1);
1605
1648
  } else {
1606
- const _ = r.findNodeByCharIndex(g), C = i.document.getOffsetConfig(), R = this._getTopOrBottomPosition(r, _, e === U.DOWN);
1607
- if (R == null) {
1608
- const P = e === U.UP ? 0 : p - 2;
1609
- if (P === g)
1649
+ const _ = s.findNodeByCharIndex(g), x = i.document.getOffsetConfig(), C = this._getTopOrBottomPosition(s, _, e === b.DOWN);
1650
+ if (C == null) {
1651
+ const D = e === b.UP ? 0 : p - 2;
1652
+ if (D === g)
1610
1653
  return;
1611
1654
  this._textSelectionManagerService.replaceTextRanges([
1612
1655
  {
1613
1656
  startOffset: m,
1614
- endOffset: P,
1657
+ endOffset: D,
1615
1658
  style: d
1616
1659
  }
1617
1660
  ], !1);
1618
1661
  return;
1619
1662
  }
1620
- const M = new Fe(C, r).getRangePointData(
1621
- R,
1622
- R
1663
+ const M = new We(x, s).getRangePointData(
1664
+ C,
1665
+ C
1623
1666
  ).cursorList[0];
1624
1667
  this._textSelectionManagerService.replaceTextRanges([
1625
1668
  {
@@ -1632,52 +1675,52 @@ let re = class extends Re {
1632
1675
  }
1633
1676
  _handleMoveCursor(e) {
1634
1677
  var m, g, p;
1635
- const t = this._textSelectionManagerService.getActiveRange(), n = this._textSelectionManagerService.getSelections(), s = this._currentUniverService.getCurrentUniverDocInstance(), r = (m = this._docSkeletonManagerService.getCurrent()) == null ? void 0 : m.skeleton, i = this._getDocObject();
1636
- if (t == null || r == null || i == null || n == null)
1678
+ const t = this._textSelectionManagerService.getActiveRange(), n = this._textSelectionManagerService.getSelections(), r = this._currentUniverService.getCurrentUniverDocInstance(), s = (m = this._docSkeletonManagerService.getCurrent()) == null ? void 0 : m.skeleton, i = this._getDocObject();
1679
+ if (t == null || s == null || i == null || n == null)
1637
1680
  return;
1638
- const { startOffset: a, endOffset: c, style: d, collapsed: l } = t, u = (g = s.getBody().dataStream.length) != null ? g : Number.POSITIVE_INFINITY;
1639
- if (e === U.LEFT || e === U.RIGHT) {
1640
- let h;
1681
+ const { startOffset: a, endOffset: c, style: d, collapsed: l } = t, u = (g = r.getBody().dataStream.length) != null ? g : Number.POSITIVE_INFINITY;
1682
+ if (e === b.LEFT || e === b.RIGHT) {
1683
+ let f;
1641
1684
  if (!t.collapsed || n.length > 1) {
1642
- let f = Number.POSITIVE_INFINITY, S = Number.NEGATIVE_INFINITY;
1685
+ let h = Number.POSITIVE_INFINITY, S = Number.NEGATIVE_INFINITY;
1643
1686
  for (const _ of n)
1644
- f = Math.min(f, _.startOffset), S = Math.max(S, _.endOffset);
1645
- h = e === U.LEFT ? f : S;
1687
+ h = Math.min(h, _.startOffset), S = Math.max(S, _.endOffset);
1688
+ f = e === b.LEFT ? h : S;
1646
1689
  } else {
1647
- const f = r.findNodeByCharIndex(a - 1), S = r.findNodeByCharIndex(a);
1648
- e === U.LEFT ? h = Math.max(0, a - ((p = f == null ? void 0 : f.count) != null ? p : 0)) : h = Math.min(u - 2, c + S.count);
1690
+ const h = s.findNodeByCharIndex(a - 1), S = s.findNodeByCharIndex(a);
1691
+ e === b.LEFT ? f = Math.max(0, a - ((p = h == null ? void 0 : h.count) != null ? p : 0)) : f = Math.min(u - 2, c + S.count);
1649
1692
  }
1650
1693
  this._textSelectionManagerService.replaceTextRanges([
1651
1694
  {
1652
- startOffset: h,
1653
- endOffset: h,
1695
+ startOffset: f,
1696
+ endOffset: f,
1654
1697
  style: d
1655
1698
  }
1656
1699
  ], !1);
1657
1700
  } else {
1658
- const h = r.findNodeByCharIndex(a), f = r.findNodeByCharIndex(c), S = i.document.getOffsetConfig(), _ = this._getTopOrBottomPosition(
1659
- r,
1660
- e === U.UP ? h : f,
1661
- e === U.DOWN
1701
+ const f = s.findNodeByCharIndex(a), h = s.findNodeByCharIndex(c), S = i.document.getOffsetConfig(), _ = this._getTopOrBottomPosition(
1702
+ s,
1703
+ e === b.UP ? f : h,
1704
+ e === b.DOWN
1662
1705
  );
1663
1706
  if (_ == null) {
1664
- let R;
1665
- l ? R = e === U.UP ? 0 : u - 2 : R = e === U.UP ? a : c, this._textSelectionManagerService.replaceTextRanges([
1707
+ let C;
1708
+ l ? C = e === b.UP ? 0 : u - 2 : C = e === b.UP ? a : c, this._textSelectionManagerService.replaceTextRanges([
1666
1709
  {
1667
- startOffset: R,
1668
- endOffset: R,
1710
+ startOffset: C,
1711
+ endOffset: C,
1669
1712
  style: d
1670
1713
  }
1671
1714
  ], !1);
1672
1715
  return;
1673
1716
  }
1674
- const C = new Fe(S, r).getRangePointData(
1717
+ const x = new We(S, s).getRangePointData(
1675
1718
  _,
1676
1719
  _
1677
1720
  ).cursorList[0];
1678
1721
  this._textSelectionManagerService.replaceTextRanges([
1679
1722
  {
1680
- ...C,
1723
+ ...x,
1681
1724
  style: d
1682
1725
  }
1683
1726
  ], !1);
@@ -1686,10 +1729,10 @@ let re = class extends Re {
1686
1729
  _getTopOrBottomPosition(e, t, n) {
1687
1730
  if (t == null)
1688
1731
  return;
1689
- const s = this._getSpanLeftOffsetInLine(t), r = this._getNextOrPrevLine(t, n);
1690
- if (r == null)
1732
+ const r = this._getSpanLeftOffsetInLine(t), s = this._getNextOrPrevLine(t, n);
1733
+ if (s == null)
1691
1734
  return;
1692
- const i = this._matchPositionByLeftOffset(e, r, s);
1735
+ const i = this._matchPositionByLeftOffset(e, s, r);
1693
1736
  if (i != null)
1694
1737
  return { ...i, isBack: !0 };
1695
1738
  }
@@ -1697,51 +1740,51 @@ let re = class extends Re {
1697
1740
  const t = e.parent;
1698
1741
  if (t == null)
1699
1742
  return Number.NEGATIVE_INFINITY;
1700
- const n = t.left, { left: s } = e;
1701
- return n + s;
1743
+ const n = t.left, { left: r } = e;
1744
+ return n + r;
1702
1745
  }
1703
1746
  _matchPositionByLeftOffset(e, t, n) {
1704
- const s = {
1747
+ const r = {
1705
1748
  distance: Number.POSITIVE_INFINITY
1706
1749
  };
1707
- for (const r of t.divides) {
1708
- const i = r.left;
1709
- for (const a of r.glyphGroup) {
1750
+ for (const s of t.divides) {
1751
+ const i = s.left;
1752
+ for (const a of s.glyphGroup) {
1710
1753
  const { left: c } = a, d = i + c, l = Math.abs(n - d);
1711
- l < s.distance && (s.glyph = a, s.distance = l);
1754
+ l < r.distance && (r.glyph = a, r.distance = l);
1712
1755
  }
1713
1756
  }
1714
- if (s.glyph != null)
1715
- return e.findPositionByGlyph(s.glyph);
1757
+ if (r.glyph != null)
1758
+ return e.findPositionByGlyph(r.glyph);
1716
1759
  }
1717
1760
  _getNextOrPrevLine(e, t) {
1718
- var p, h, f, S, _, C, R, M, P, N, E, A;
1761
+ var p, f, h, S, _, x, C, M, D, A, N, B;
1719
1762
  const n = e.parent;
1720
1763
  if (n == null)
1721
1764
  return;
1722
- const s = n.parent;
1723
- if (s == null)
1724
- return;
1725
- const r = s.parent;
1765
+ const r = n.parent;
1726
1766
  if (r == null)
1727
1767
  return;
1728
- const i = r.lines.indexOf(s);
1768
+ const s = r.parent;
1769
+ if (s == null)
1770
+ return;
1771
+ const i = s.lines.indexOf(r);
1729
1772
  if (i === -1)
1730
1773
  return;
1731
1774
  let a;
1732
- if (t === !0 ? a = r.lines[i + 1] : a = r.lines[i - 1], a != null)
1775
+ if (t === !0 ? a = s.lines[i + 1] : a = s.lines[i - 1], a != null)
1733
1776
  return a;
1734
- const c = r.parent;
1777
+ const c = s.parent;
1735
1778
  if (c == null)
1736
1779
  return;
1737
- const d = c.columns.indexOf(r);
1780
+ const d = c.columns.indexOf(s);
1738
1781
  if (d === -1)
1739
1782
  return;
1740
1783
  if (t === !0)
1741
1784
  a = (p = c.columns[d + 1]) == null ? void 0 : p.lines[0];
1742
1785
  else {
1743
- const x = (f = (h = c.columns) == null ? void 0 : h[d - 1]) == null ? void 0 : f.lines;
1744
- a = x == null ? void 0 : x[x.length - 1];
1786
+ const O = (h = (f = c.columns) == null ? void 0 : f[d - 1]) == null ? void 0 : h.lines;
1787
+ a = O == null ? void 0 : O[O.length - 1];
1745
1788
  }
1746
1789
  if (a != null)
1747
1790
  return a;
@@ -1754,8 +1797,8 @@ let re = class extends Re {
1754
1797
  if (t === !0)
1755
1798
  a = (_ = (S = l.sections[u - 1]) == null ? void 0 : S.columns[0]) == null ? void 0 : _.lines[0];
1756
1799
  else {
1757
- const x = (R = (C = l.sections) == null ? void 0 : C[u - 1]) == null ? void 0 : R.columns, $ = x == null ? void 0 : x[x.length - 1], L = $ == null ? void 0 : $.lines;
1758
- a = L == null ? void 0 : L[L.length - 1];
1800
+ const O = (C = (x = l.sections) == null ? void 0 : x[u - 1]) == null ? void 0 : C.columns, U = O == null ? void 0 : O[O.length - 1], w = U == null ? void 0 : U.lines;
1801
+ a = w == null ? void 0 : w[w.length - 1];
1759
1802
  }
1760
1803
  if (a != null)
1761
1804
  return a;
@@ -1765,40 +1808,40 @@ let re = class extends Re {
1765
1808
  const g = m.pages.indexOf(l);
1766
1809
  if (g !== -1) {
1767
1810
  if (t === !0)
1768
- a = (N = (P = (M = m.pages[g + 1]) == null ? void 0 : M.sections[0]) == null ? void 0 : P.columns[0]) == null ? void 0 : N.lines[0];
1811
+ a = (A = (D = (M = m.pages[g + 1]) == null ? void 0 : M.sections[0]) == null ? void 0 : D.columns[0]) == null ? void 0 : A.lines[0];
1769
1812
  else {
1770
- const x = (E = m.pages[g - 1]) == null ? void 0 : E.sections;
1771
- if (x == null)
1813
+ const O = (N = m.pages[g - 1]) == null ? void 0 : N.sections;
1814
+ if (O == null)
1772
1815
  return;
1773
- const $ = (A = x[x.length - 1]) == null ? void 0 : A.columns, L = $[$.length - 1], ne = L == null ? void 0 : L.lines;
1774
- a = ne[ne.length - 1];
1816
+ const U = (B = O[O.length - 1]) == null ? void 0 : B.columns, w = U[U.length - 1], X = w == null ? void 0 : w.lines;
1817
+ a = X[X.length - 1];
1775
1818
  }
1776
1819
  if (a != null)
1777
1820
  return a;
1778
1821
  }
1779
1822
  }
1780
1823
  _getDocObject() {
1781
- return et(this._currentUniverService, this._renderManagerService);
1824
+ return mt(this._currentUniverService, this._renderManagerService);
1782
1825
  }
1783
1826
  };
1784
- re = gn([
1785
- Me(Ce.Rendered, re),
1786
- X(0, B(j)),
1787
- X(1, D),
1788
- X(2, Qe),
1789
- X(3, B(T)),
1790
- X(4, I)
1791
- ], re);
1792
- var fn = Object.defineProperty, hn = Object.getOwnPropertyDescriptor, pn = (o, e, t, n) => {
1793
- for (var s = n > 1 ? void 0 : n ? hn(e, t) : e, r = o.length - 1, i; r >= 0; r--)
1794
- (i = o[r]) && (s = (n ? i(e, t, s) : i(s)) || s);
1795
- return n && s && fn(e, t, s), s;
1796
- }, Y = (o, e) => (t, n) => e(t, n, o);
1797
- let ie = class extends Re {
1798
- constructor(e, t, n, s, r) {
1827
+ ce = Dn([
1828
+ Ee(De.Rendered, ce),
1829
+ J(0, z(H)),
1830
+ J(1, E),
1831
+ J(2, ut),
1832
+ J(3, z(T)),
1833
+ J(4, I)
1834
+ ], ce);
1835
+ var An = Object.defineProperty, bn = Object.getOwnPropertyDescriptor, Nn = (o, e, t, n) => {
1836
+ for (var r = n > 1 ? void 0 : n ? bn(e, t) : e, s = o.length - 1, i; s >= 0; s--)
1837
+ (i = o[s]) && (r = (n ? i(e, t, r) : i(r)) || r);
1838
+ return n && r && An(e, t, r), r;
1839
+ }, q = (o, e) => (t, n) => e(t, n, o);
1840
+ let le = class extends Ae {
1841
+ constructor(e, t, n, r, s) {
1799
1842
  super();
1800
- O(this, "_onInputSubscription");
1801
- this._docSkeletonManagerService = e, this._currentUniverService = t, this._renderManagerService = n, this._textSelectionRenderManager = s, this._commandService = r, this._initialize(), this._commandExecutedListener();
1843
+ y(this, "_onInputSubscription");
1844
+ this._docSkeletonManagerService = e, this._currentUniverService = t, this._renderManagerService = n, this._textSelectionRenderManager = r, this._commandService = s, this._initialize(), this._commandExecutedListener();
1802
1845
  }
1803
1846
  dispose() {
1804
1847
  var e;
@@ -1812,20 +1855,20 @@ let ie = class extends Re {
1812
1855
  var p;
1813
1856
  if (e == null)
1814
1857
  return;
1815
- const n = this._currentUniverService.getCurrentUniverDocInstance().getUnitId(), { event: s, content: r = "", activeRange: i } = e, a = s, c = (p = this._docSkeletonManagerService.getCurrent()) == null ? void 0 : p.skeleton;
1858
+ const n = this._currentUniverService.getCurrentUniverDocInstance().getUnitId(), { event: r, content: s = "", activeRange: i } = e, a = r, c = (p = this._docSkeletonManagerService.getCurrent()) == null ? void 0 : p.skeleton;
1816
1859
  if (a.data == null || c == null || !c || !i)
1817
1860
  return;
1818
- const { startOffset: d, segmentId: l, style: u } = i, m = r.length, g = [
1861
+ const { startOffset: d, segmentId: l, style: u } = i, m = s.length, g = [
1819
1862
  {
1820
1863
  startOffset: d + m,
1821
1864
  endOffset: d + m,
1822
1865
  style: u
1823
1866
  }
1824
1867
  ];
1825
- await this._commandService.executeCommand(ue.id, {
1868
+ await this._commandService.executeCommand(he.id, {
1826
1869
  unitId: n,
1827
1870
  body: {
1828
- dataStream: r
1871
+ dataStream: s
1829
1872
  },
1830
1873
  range: i,
1831
1874
  textRanges: g,
@@ -1836,71 +1879,73 @@ let ie = class extends Re {
1836
1879
  _commandExecutedListener() {
1837
1880
  }
1838
1881
  _getDocObject() {
1839
- return et(this._currentUniverService, this._renderManagerService);
1882
+ return mt(this._currentUniverService, this._renderManagerService);
1840
1883
  }
1841
1884
  };
1842
- ie = pn([
1843
- Me(Ce.Rendered, ie),
1844
- Y(0, B(j)),
1845
- Y(1, D),
1846
- Y(2, Qe),
1847
- Y(3, le),
1848
- Y(4, I)
1849
- ], ie);
1850
- var Sn = Object.defineProperty, _n = Object.getOwnPropertyDescriptor, vn = (o, e, t, n) => {
1851
- for (var s = n > 1 ? void 0 : n ? _n(e, t) : e, r = o.length - 1, i; r >= 0; r--)
1852
- (i = o[r]) && (s = (n ? i(e, t, s) : i(s)) || s);
1853
- return n && s && Sn(e, t, s), s;
1854
- }, In = (o, e) => (t, n) => e(t, n, o);
1855
- const Mn = {
1885
+ le = Nn([
1886
+ Ee(De.Rendered, le),
1887
+ q(0, z(H)),
1888
+ q(1, E),
1889
+ q(2, ut),
1890
+ q(3, me),
1891
+ q(4, I)
1892
+ ], le);
1893
+ var Pn = Object.defineProperty, Un = Object.getOwnPropertyDescriptor, wn = (o, e, t, n) => {
1894
+ for (var r = n > 1 ? void 0 : n ? Un(e, t) : e, s = o.length - 1, i; s >= 0; s--)
1895
+ (i = o[s]) && (r = (n ? i(e, t, r) : i(r)) || r);
1896
+ return n && r && Pn(e, t, r), r;
1897
+ }, Ln = (o, e) => (t, n) => e(t, n, o);
1898
+ const Bn = {
1856
1899
  hasScroll: !0
1857
- }, Cn = "docs";
1858
- var he;
1859
- let Je = (he = class extends ht {
1900
+ }, Fn = "docs";
1901
+ var Ce;
1902
+ let ct = (Ce = class extends At {
1860
1903
  constructor(e = {}, t) {
1861
- super(Cn);
1862
- O(this, "_config");
1863
- this._injector = t, this._config = Object.assign(Mn, e), this._initializeDependencies(t), this._initializeCommands();
1904
+ super(Fn);
1905
+ y(this, "_config");
1906
+ this._injector = t, this._config = Object.assign(Bn, e), this._initializeDependencies(t), this._initializeCommands();
1864
1907
  }
1865
1908
  initialize() {
1866
1909
  }
1867
1910
  _initializeCommands() {
1868
1911
  [
1869
- Se,
1870
- _e,
1871
- Ht,
1872
- Xt,
1873
- Oe,
1874
- Te,
1875
- Ee,
1876
- De,
1877
- K,
1878
- Ae,
1912
+ Re,
1913
+ ye,
1914
+ cn,
1915
+ ln,
1879
1916
  Pe,
1880
- Ne,
1881
1917
  Ue,
1882
- at,
1883
- zt,
1884
- ue,
1885
- me,
1886
- nt,
1887
- rt,
1888
- ye,
1889
- w,
1918
+ we,
1919
+ Le,
1920
+ ne,
1921
+ Be,
1922
+ Fe,
1923
+ $e,
1924
+ ze,
1925
+ Ve,
1926
+ ke,
1927
+ vt,
1890
1928
  nn,
1891
- on,
1892
- rn,
1893
- oe,
1894
- tt,
1895
- an,
1896
- qt,
1897
- Jt,
1898
- be,
1899
- Kt,
1900
- Qt,
1901
- en,
1902
- te,
1903
- tn
1929
+ he,
1930
+ fe,
1931
+ ht,
1932
+ St,
1933
+ Ne,
1934
+ L,
1935
+ vn,
1936
+ In,
1937
+ Cn,
1938
+ ie,
1939
+ gt,
1940
+ xn,
1941
+ hn,
1942
+ gn,
1943
+ je,
1944
+ fn,
1945
+ pn,
1946
+ Sn,
1947
+ se,
1948
+ _n
1904
1949
  ].forEach((e) => {
1905
1950
  this._injector.get(I).registerCommand(e);
1906
1951
  });
@@ -1911,76 +1956,78 @@ let Je = (he = class extends ht {
1911
1956
  _initializeDependencies(e) {
1912
1957
  [
1913
1958
  // services
1914
- [j],
1915
- [q],
1916
- [ae],
1959
+ [H],
1960
+ [te],
1917
1961
  [de],
1962
+ [ge],
1918
1963
  [
1919
- le,
1964
+ me,
1920
1965
  {
1921
- useClass: xt
1966
+ useClass: zt
1922
1967
  }
1923
1968
  ],
1924
1969
  [T],
1925
1970
  // controllers
1926
- [ie],
1927
- [se],
1928
- [re]
1971
+ [le],
1972
+ [ae],
1973
+ [ce]
1929
1974
  ].forEach((t) => e.add(t));
1930
1975
  }
1931
- }, O(he, "type", pt.Doc), he);
1932
- Je = vn([
1933
- In(1, B(yt))
1934
- ], Je);
1976
+ }, y(Ce, "type", bt.Doc), Ce);
1977
+ ct = wn([
1978
+ Ln(1, z(kt))
1979
+ ], ct);
1935
1980
  export {
1936
- Qt as AlignCenterCommand,
1937
- tn as AlignJustifyCommand,
1938
- Kt as AlignLeftCommand,
1939
- te as AlignOperationCommand,
1940
- en as AlignRightCommand,
1941
- zt as BreakLineCommand,
1942
- Jt as BulletListCommand,
1943
- on as CoverContentCommand,
1944
- ot as CutContentCommand,
1945
- Pn as DOCS_COMPONENT_DEFAULT_Z_INDEX,
1946
- An as DOCS_COMPONENT_HEADER_LAYER_INDEX,
1947
- Dn as DOCS_COMPONENT_MAIN_LAYER_INDEX,
1948
- Ot as DOCS_VIEW_KEY,
1949
- me as DeleteCommand,
1950
- Ht as DeleteLeftCommand,
1951
- Xt as DeleteRightCommand,
1952
- j as DocSkeletonManagerService,
1953
- ae as DocStateChangeManagerService,
1954
- q as DocViewModelManagerService,
1955
- rt as IMEInputCommand,
1956
- de as IMEInputManagerService,
1957
- Un as InnerPasteCommand,
1958
- ue as InsertCommand,
1959
- Se as MoveCursorOperation,
1960
- _e as MoveSelectionOperation,
1961
- Nn as NORMAL_TEXT_SELECTION_PLUGIN_NAME,
1962
- qt as OrderListCommand,
1963
- nn as ReplaceContentCommand,
1964
- w as RichTextEditingMutation,
1965
- an as SelectAllOperation,
1966
- rn as SetDocZoomRatioCommand,
1967
- oe as SetDocZoomRatioOperation,
1968
- Oe as SetInlineFormatBoldCommand,
1969
- at as SetInlineFormatCommand,
1970
- Ne as SetInlineFormatFontFamilyCommand,
1971
- Pe as SetInlineFormatFontSizeCommand,
1972
- Te as SetInlineFormatItalicCommand,
1973
- De as SetInlineFormatStrikethroughCommand,
1974
- K as SetInlineFormatSubscriptCommand,
1975
- Ae as SetInlineFormatSuperscriptCommand,
1976
- Ue as SetInlineFormatTextColorCommand,
1977
- Ee as SetInlineFormatUnderlineCommand,
1978
- tt as SetTextSelectionsOperation,
1981
+ pn as AlignCenterCommand,
1982
+ _n as AlignJustifyCommand,
1983
+ fn as AlignLeftCommand,
1984
+ se as AlignOperationCommand,
1985
+ Sn as AlignRightCommand,
1986
+ nn as BreakLineCommand,
1987
+ gn as BulletListCommand,
1988
+ In as CoverContentCommand,
1989
+ ft as CutContentCommand,
1990
+ Yn as DOCS_COMPONENT_DEFAULT_Z_INDEX,
1991
+ Xn as DOCS_COMPONENT_HEADER_LAYER_INDEX,
1992
+ Hn as DOCS_COMPONENT_MAIN_LAYER_INDEX,
1993
+ Vt as DOCS_VIEW_KEY,
1994
+ fe as DeleteCommand,
1995
+ cn as DeleteLeftCommand,
1996
+ ln as DeleteRightCommand,
1997
+ H as DocSkeletonManagerService,
1998
+ de as DocStateChangeManagerService,
1999
+ te as DocViewModelManagerService,
2000
+ St as IMEInputCommand,
2001
+ ge as IMEInputManagerService,
2002
+ Zn as InnerPasteCommand,
2003
+ he as InsertCommand,
2004
+ Re as MoveCursorOperation,
2005
+ ye as MoveSelectionOperation,
2006
+ Wn as NORMAL_TEXT_SELECTION_PLUGIN_NAME,
2007
+ hn as OrderListCommand,
2008
+ vn as ReplaceContentCommand,
2009
+ Ve as ResetInlineFormatTextBackgroundColorCommand,
2010
+ L as RichTextEditingMutation,
2011
+ xn as SelectAllOperation,
2012
+ Cn as SetDocZoomRatioCommand,
2013
+ ie as SetDocZoomRatioOperation,
2014
+ Pe as SetInlineFormatBoldCommand,
2015
+ vt as SetInlineFormatCommand,
2016
+ $e as SetInlineFormatFontFamilyCommand,
2017
+ Fe as SetInlineFormatFontSizeCommand,
2018
+ Ue as SetInlineFormatItalicCommand,
2019
+ Le as SetInlineFormatStrikethroughCommand,
2020
+ ne as SetInlineFormatSubscriptCommand,
2021
+ Be as SetInlineFormatSuperscriptCommand,
2022
+ ke as SetInlineFormatTextBackgroundColorCommand,
2023
+ ze as SetInlineFormatTextColorCommand,
2024
+ we as SetInlineFormatUnderlineCommand,
2025
+ gt as SetTextSelectionsOperation,
1979
2026
  T as TextSelectionManagerService,
1980
- Je as UniverDocsPlugin,
1981
- nt as UpdateCommand,
1982
- Tt as VIEWPORT_KEY,
1983
- et as getDocObject,
1984
- En as getDocObjectById,
1985
- G as serializeTextRange
2027
+ ct as UniverDocsPlugin,
2028
+ ht as UpdateCommand,
2029
+ jt as VIEWPORT_KEY,
2030
+ mt as getDocObject,
2031
+ Gn as getDocObjectById,
2032
+ W as serializeTextRange
1986
2033
  };