@univerjs/docs 0.1.2 → 0.1.4

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