@univerjs/docs 0.1.1 → 0.1.2

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