@univerjs/docs 0.5.5-nightly.202501241606 → 0.6.0-alpha.0
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/LICENSE +176 -0
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +427 -435
- package/lib/umd/index.js +1 -1
- package/package.json +4 -4
package/lib/es/index.js
CHANGED
|
@@ -1,96 +1,95 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
const SetTextSelectionsOperation = {
|
|
1
|
+
var ie = Object.defineProperty;
|
|
2
|
+
var re = (i, e, t) => e in i ? ie(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
+
var u = (i, e, t) => re(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { CommandType as N, RxDisposable as V, UniverInstanceType as b, ICommandService as B, IUniverInstanceService as p, Inject as w, LocaleService as oe, isInternalEditorID as ce, JSONX as O, Disposable as Q, BuildTextUtils as C, Injector as ae, Plugin as le, merge as ue, IConfigService as de, createInterceptorKey as Z, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as ge, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as _e, DisposableCollection as $, toDisposable as fe, remove as he, composeInterceptors as Se } from "@univerjs/core";
|
|
5
|
+
import { NORMAL_TEXT_SELECTION_PLUGIN_STYLE as pe, DocumentSkeleton as Ie, DocumentViewModel as me, IRenderManagerService as Re } from "@univerjs/engine-render";
|
|
6
|
+
import { Subject as ve, BehaviorSubject as x, takeUntil as ee } from "rxjs";
|
|
7
|
+
const j = {
|
|
9
8
|
id: "doc.operation.set-selections",
|
|
10
|
-
type:
|
|
11
|
-
handler:
|
|
9
|
+
type: N.OPERATION,
|
|
10
|
+
handler: () => !0
|
|
12
11
|
};
|
|
13
|
-
var
|
|
14
|
-
for (var
|
|
15
|
-
(
|
|
16
|
-
return
|
|
17
|
-
},
|
|
18
|
-
let
|
|
19
|
-
constructor(
|
|
12
|
+
var Oe = Object.defineProperty, xe = Object.getOwnPropertyDescriptor, Ce = (i, e, t, n) => {
|
|
13
|
+
for (var s = n > 1 ? void 0 : n ? xe(e, t) : e, r = i.length - 1, o; r >= 0; r--)
|
|
14
|
+
(o = i[r]) && (s = (n ? o(e, t, s) : o(s)) || s);
|
|
15
|
+
return n && s && Oe(e, t, s), s;
|
|
16
|
+
}, W = (i, e) => (t, n) => e(t, n, i);
|
|
17
|
+
let m = class extends V {
|
|
18
|
+
constructor(e, t) {
|
|
20
19
|
super();
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
this._commandService =
|
|
20
|
+
u(this, "_currentSelection", null);
|
|
21
|
+
u(this, "_textSelectionInfo", /* @__PURE__ */ new Map());
|
|
22
|
+
u(this, "_textSelection$", new ve());
|
|
23
|
+
u(this, "textSelection$", this._textSelection$.asObservable());
|
|
24
|
+
u(this, "_refreshSelection$", new x(null));
|
|
25
|
+
u(this, "refreshSelection$", this._refreshSelection$.asObservable());
|
|
26
|
+
this._commandService = e, this._univerInstanceService = t, this._listenCurrentUnit();
|
|
28
27
|
}
|
|
29
28
|
_listenCurrentUnit() {
|
|
30
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
31
|
-
if (
|
|
29
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(b.UNIVER_DOC).pipe(ee(this.dispose$)).subscribe((e) => {
|
|
30
|
+
if (e == null)
|
|
32
31
|
return;
|
|
33
|
-
const
|
|
32
|
+
const t = e.getUnitId();
|
|
34
33
|
this._setCurrentSelectionNotRefresh({
|
|
35
|
-
unitId,
|
|
36
|
-
subUnitId:
|
|
34
|
+
unitId: t,
|
|
35
|
+
subUnitId: t
|
|
37
36
|
});
|
|
38
37
|
});
|
|
39
38
|
}
|
|
40
39
|
__getCurrentSelection() {
|
|
41
40
|
return this._currentSelection;
|
|
42
41
|
}
|
|
43
|
-
getSelectionInfo(
|
|
44
|
-
return this._getTextRanges(
|
|
42
|
+
getSelectionInfo(e = this._currentSelection) {
|
|
43
|
+
return this._getTextRanges(e);
|
|
45
44
|
}
|
|
46
|
-
refreshSelection(
|
|
47
|
-
|
|
45
|
+
refreshSelection(e = this._currentSelection) {
|
|
46
|
+
e != null && this._refresh(e);
|
|
48
47
|
}
|
|
49
48
|
// **Only used in test case** because this does not go through the render layer.
|
|
50
|
-
__TEST_ONLY_setCurrentSelection(
|
|
51
|
-
this._currentSelection =
|
|
49
|
+
__TEST_ONLY_setCurrentSelection(e) {
|
|
50
|
+
this._currentSelection = e, this._refresh(e);
|
|
52
51
|
}
|
|
53
|
-
getTextRanges(
|
|
54
|
-
var
|
|
55
|
-
return (
|
|
52
|
+
getTextRanges(e = this._currentSelection) {
|
|
53
|
+
var t;
|
|
54
|
+
return (t = this._getTextRanges(e)) == null ? void 0 : t.textRanges;
|
|
56
55
|
}
|
|
57
|
-
getRectRanges(
|
|
58
|
-
var
|
|
59
|
-
return (
|
|
56
|
+
getRectRanges(e = this._currentSelection) {
|
|
57
|
+
var t;
|
|
58
|
+
return (t = this._getTextRanges(e)) == null ? void 0 : t.rectRanges;
|
|
60
59
|
}
|
|
61
|
-
getDocRanges(
|
|
62
|
-
var
|
|
63
|
-
const
|
|
64
|
-
return [...
|
|
60
|
+
getDocRanges(e = this._currentSelection) {
|
|
61
|
+
var r, o;
|
|
62
|
+
const t = (r = this.getTextRanges(e)) != null ? r : [], n = (o = this.getRectRanges(e)) != null ? o : [];
|
|
63
|
+
return [...t, ...n].filter((c) => c.startOffset != null && c.endOffset != null).sort((c, a) => c.startOffset > a.startOffset ? 1 : c.startOffset < a.startOffset ? -1 : 0);
|
|
65
64
|
}
|
|
66
65
|
getActiveTextRange() {
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
66
|
+
const e = this._getTextRanges(this._currentSelection);
|
|
67
|
+
if (e == null)
|
|
69
68
|
return;
|
|
70
|
-
const { textRanges } =
|
|
71
|
-
return
|
|
69
|
+
const { textRanges: t } = e;
|
|
70
|
+
return t.find((n) => n.isActive);
|
|
72
71
|
}
|
|
73
72
|
/**
|
|
74
73
|
*
|
|
75
74
|
* @deprecated
|
|
76
75
|
*/
|
|
77
76
|
getActiveRectRange() {
|
|
78
|
-
const
|
|
79
|
-
if (
|
|
77
|
+
const e = this._getTextRanges(this._currentSelection);
|
|
78
|
+
if (e == null)
|
|
80
79
|
return;
|
|
81
|
-
const { rectRanges } =
|
|
82
|
-
return
|
|
80
|
+
const { rectRanges: t } = e;
|
|
81
|
+
return t.find((n) => n.isActive);
|
|
83
82
|
}
|
|
84
83
|
// **Only used in test case** because this does not go through the render layer.
|
|
85
|
-
__TEST_ONLY_add(
|
|
84
|
+
__TEST_ONLY_add(e, t = !0) {
|
|
86
85
|
this._currentSelection != null && this._addByParam({
|
|
87
86
|
...this._currentSelection,
|
|
88
|
-
textRanges,
|
|
87
|
+
textRanges: e,
|
|
89
88
|
rectRanges: [],
|
|
90
89
|
segmentId: "",
|
|
91
90
|
segmentPage: -1,
|
|
92
|
-
isEditing,
|
|
93
|
-
style:
|
|
91
|
+
isEditing: t,
|
|
92
|
+
style: pe
|
|
94
93
|
// mock style.
|
|
95
94
|
});
|
|
96
95
|
}
|
|
@@ -98,104 +97,104 @@ let DocSelectionManagerService = (_a = class extends RxDisposable {
|
|
|
98
97
|
/**
|
|
99
98
|
* @deprecated pls use replaceDocRanges.
|
|
100
99
|
*/
|
|
101
|
-
replaceTextRanges(
|
|
100
|
+
replaceTextRanges(e, t = !0, n) {
|
|
102
101
|
return this.replaceDocRanges(
|
|
103
|
-
|
|
102
|
+
e,
|
|
104
103
|
this._currentSelection,
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
t,
|
|
105
|
+
n
|
|
107
106
|
);
|
|
108
107
|
}
|
|
109
|
-
replaceDocRanges(
|
|
110
|
-
if (
|
|
108
|
+
replaceDocRanges(e, t = this._currentSelection, n = !0, s) {
|
|
109
|
+
if (t == null)
|
|
111
110
|
return;
|
|
112
|
-
const { unitId, subUnitId } =
|
|
111
|
+
const { unitId: r, subUnitId: o } = t;
|
|
113
112
|
this._refreshSelection$.next({
|
|
114
|
-
unitId,
|
|
115
|
-
subUnitId,
|
|
116
|
-
docRanges,
|
|
117
|
-
isEditing,
|
|
118
|
-
options
|
|
113
|
+
unitId: r,
|
|
114
|
+
subUnitId: o,
|
|
115
|
+
docRanges: e,
|
|
116
|
+
isEditing: n,
|
|
117
|
+
options: s
|
|
119
118
|
});
|
|
120
119
|
}
|
|
121
120
|
// Only use in doc-selection-render.controller.ts
|
|
122
|
-
__replaceTextRangesWithNoRefresh(
|
|
121
|
+
__replaceTextRangesWithNoRefresh(e, t) {
|
|
123
122
|
if (this._currentSelection == null)
|
|
124
123
|
return;
|
|
125
|
-
const
|
|
126
|
-
...
|
|
127
|
-
...
|
|
124
|
+
const n = {
|
|
125
|
+
...e,
|
|
126
|
+
...t
|
|
128
127
|
};
|
|
129
|
-
this._replaceByParam(
|
|
130
|
-
const { unitId, subUnitId, segmentId, style, textRanges, rectRanges, isEditing } =
|
|
131
|
-
this._commandService.executeCommand(
|
|
132
|
-
unitId,
|
|
133
|
-
subUnitId,
|
|
134
|
-
segmentId,
|
|
135
|
-
style,
|
|
136
|
-
isEditing,
|
|
137
|
-
ranges
|
|
128
|
+
this._replaceByParam(n), this._textSelection$.next(n);
|
|
129
|
+
const { unitId: s, subUnitId: r, segmentId: o, style: c, textRanges: a, rectRanges: l, isEditing: d } = n, _ = [...a, ...l].filter((g) => g.startOffset != null && g.endOffset != null).sort((g, f) => g.startOffset > f.startOffset ? 1 : g.startOffset < f.startOffset ? -1 : 0);
|
|
130
|
+
this._commandService.executeCommand(j.id, {
|
|
131
|
+
unitId: s,
|
|
132
|
+
subUnitId: r,
|
|
133
|
+
segmentId: o,
|
|
134
|
+
style: c,
|
|
135
|
+
isEditing: d,
|
|
136
|
+
ranges: _
|
|
138
137
|
});
|
|
139
138
|
}
|
|
140
139
|
dispose() {
|
|
141
140
|
this._textSelection$.complete();
|
|
142
141
|
}
|
|
143
|
-
_setCurrentSelectionNotRefresh(
|
|
144
|
-
this._currentSelection =
|
|
142
|
+
_setCurrentSelectionNotRefresh(e) {
|
|
143
|
+
this._currentSelection = e;
|
|
145
144
|
}
|
|
146
|
-
_getTextRanges(
|
|
147
|
-
var
|
|
148
|
-
if (
|
|
145
|
+
_getTextRanges(e) {
|
|
146
|
+
var s;
|
|
147
|
+
if (e == null)
|
|
149
148
|
return;
|
|
150
|
-
const { unitId, subUnitId = "" } =
|
|
151
|
-
return (
|
|
149
|
+
const { unitId: t, subUnitId: n = "" } = e;
|
|
150
|
+
return (s = this._textSelectionInfo.get(t)) == null ? void 0 : s.get(n);
|
|
152
151
|
}
|
|
153
|
-
_refresh(
|
|
154
|
-
const
|
|
155
|
-
if (
|
|
152
|
+
_refresh(e) {
|
|
153
|
+
const t = this._getTextRanges(e);
|
|
154
|
+
if (t == null)
|
|
156
155
|
return;
|
|
157
|
-
const { textRanges, rectRanges } =
|
|
156
|
+
const { textRanges: n, rectRanges: s } = t, r = [...n, ...s], { unitId: o, subUnitId: c } = e;
|
|
158
157
|
this._refreshSelection$.next({
|
|
159
|
-
unitId,
|
|
160
|
-
subUnitId,
|
|
161
|
-
docRanges,
|
|
158
|
+
unitId: o,
|
|
159
|
+
subUnitId: c,
|
|
160
|
+
docRanges: r,
|
|
162
161
|
isEditing: !1
|
|
163
162
|
});
|
|
164
163
|
}
|
|
165
|
-
_replaceByParam(
|
|
166
|
-
const { unitId, subUnitId, ...
|
|
167
|
-
this._textSelectionInfo.has(
|
|
168
|
-
}
|
|
169
|
-
_addByParam(
|
|
170
|
-
const { unitId, subUnitId, ...
|
|
171
|
-
this._textSelectionInfo.has(
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
],
|
|
180
|
-
var
|
|
181
|
-
for (var
|
|
182
|
-
(
|
|
183
|
-
return
|
|
184
|
-
},
|
|
185
|
-
let
|
|
186
|
-
constructor(
|
|
164
|
+
_replaceByParam(e) {
|
|
165
|
+
const { unitId: t, subUnitId: n, ...s } = e;
|
|
166
|
+
this._textSelectionInfo.has(t) || this._textSelectionInfo.set(t, /* @__PURE__ */ new Map()), this._textSelectionInfo.get(t).set(n, { ...s });
|
|
167
|
+
}
|
|
168
|
+
_addByParam(e) {
|
|
169
|
+
const { unitId: t, subUnitId: n, ...s } = e;
|
|
170
|
+
this._textSelectionInfo.has(t) || this._textSelectionInfo.set(t, /* @__PURE__ */ new Map());
|
|
171
|
+
const r = this._textSelectionInfo.get(t);
|
|
172
|
+
r.has(n) ? r.get(n).textRanges.push(...e.textRanges) : r.set(n, { ...s });
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
m = Ce([
|
|
176
|
+
W(0, B),
|
|
177
|
+
W(1, p)
|
|
178
|
+
], m);
|
|
179
|
+
var Me = Object.defineProperty, De = Object.getOwnPropertyDescriptor, Te = (i, e, t, n) => {
|
|
180
|
+
for (var s = n > 1 ? void 0 : n ? De(e, t) : e, r = i.length - 1, o; r >= 0; r--)
|
|
181
|
+
(o = i[r]) && (s = (n ? o(e, t, s) : o(s)) || s);
|
|
182
|
+
return n && s && Me(e, t, s), s;
|
|
183
|
+
}, Y = (i, e) => (t, n) => e(t, n, i);
|
|
184
|
+
let D = class extends V {
|
|
185
|
+
constructor(e, t, n) {
|
|
187
186
|
super();
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
187
|
+
u(this, "_skeleton");
|
|
188
|
+
u(this, "_docViewModel");
|
|
189
|
+
u(this, "_currentSkeleton$", new x(null));
|
|
190
|
+
u(this, "currentSkeleton$", this._currentSkeleton$.asObservable());
|
|
192
191
|
// CurrentSkeletonBefore for pre-triggered logic during registration
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
this._context =
|
|
198
|
-
|
|
192
|
+
u(this, "_currentSkeletonBefore$", new x(null));
|
|
193
|
+
u(this, "currentSkeletonBefore$", this._currentSkeletonBefore$.asObservable());
|
|
194
|
+
u(this, "_currentViewModel$", new x(null));
|
|
195
|
+
u(this, "currentViewModel$", this._currentViewModel$.asObservable());
|
|
196
|
+
this._context = e, this._localeService = t, this._univerInstanceService = n, this._init(), this._univerInstanceService.getCurrentTypeOfUnit$(b.UNIVER_DOC).pipe(ee(this.dispose$)).subscribe((s) => {
|
|
197
|
+
s && s.getUnitId() === this._context.unitId && this._update(s);
|
|
199
198
|
});
|
|
200
199
|
}
|
|
201
200
|
dispose() {
|
|
@@ -208,410 +207,403 @@ let DocSkeletonManagerService = (_a2 = class extends RxDisposable {
|
|
|
208
207
|
return this._docViewModel;
|
|
209
208
|
}
|
|
210
209
|
_init() {
|
|
211
|
-
const
|
|
212
|
-
this._update(
|
|
210
|
+
const e = this._context.unit;
|
|
211
|
+
this._update(e);
|
|
213
212
|
}
|
|
214
|
-
_update(
|
|
215
|
-
const
|
|
216
|
-
if (
|
|
213
|
+
_update(e) {
|
|
214
|
+
const t = this._context.unitId;
|
|
215
|
+
if (e.getBody() == null)
|
|
217
216
|
return;
|
|
218
|
-
this._docViewModel &&
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
}
|
|
222
|
-
_buildSkeleton(
|
|
223
|
-
return
|
|
224
|
-
}
|
|
225
|
-
_buildDocViewModel(
|
|
226
|
-
return new
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
],
|
|
233
|
-
|
|
217
|
+
this._docViewModel && ce(t) ? (this._docViewModel.reset(e), this._context.unit = e) : this._docViewModel || (this._docViewModel = this._buildDocViewModel(e)), this._skeleton || (this._skeleton = this._buildSkeleton(this._docViewModel));
|
|
218
|
+
const n = this._skeleton;
|
|
219
|
+
n.calculate(), this._currentSkeletonBefore$.next(n), this._currentSkeleton$.next(n), this._currentViewModel$.next(this._docViewModel);
|
|
220
|
+
}
|
|
221
|
+
_buildSkeleton(e) {
|
|
222
|
+
return Ie.create(e, this._localeService);
|
|
223
|
+
}
|
|
224
|
+
_buildDocViewModel(e) {
|
|
225
|
+
return new me(e);
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
D = Te([
|
|
229
|
+
Y(1, w(oe)),
|
|
230
|
+
Y(2, p)
|
|
231
|
+
], D);
|
|
232
|
+
class te extends V {
|
|
234
233
|
constructor() {
|
|
235
234
|
super();
|
|
236
|
-
|
|
237
|
-
|
|
235
|
+
u(this, "_docStateChangeParams$", new x(null));
|
|
236
|
+
u(this, "docStateChangeParams$", this._docStateChangeParams$.asObservable());
|
|
238
237
|
}
|
|
239
|
-
emitStateChangeInfo(
|
|
240
|
-
this._docStateChangeParams$.next(
|
|
238
|
+
emitStateChangeInfo(t) {
|
|
239
|
+
this._docStateChangeParams$.next(t);
|
|
241
240
|
}
|
|
242
241
|
dispose() {
|
|
243
242
|
super.dispose(), this._docStateChangeParams$.complete();
|
|
244
243
|
}
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
id: RichTextEditingMutationId,
|
|
250
|
-
type: CommandType.MUTATION,
|
|
244
|
+
}
|
|
245
|
+
const K = "doc.mutation.rich-text-editing", M = {
|
|
246
|
+
id: K,
|
|
247
|
+
type: N.MUTATION,
|
|
251
248
|
// eslint-disable-next-line max-lines-per-function
|
|
252
|
-
handler:
|
|
253
|
-
var
|
|
249
|
+
handler: (i, e) => {
|
|
250
|
+
var z, F;
|
|
254
251
|
const {
|
|
255
|
-
unitId,
|
|
256
|
-
segmentId = "",
|
|
257
|
-
actions,
|
|
258
|
-
textRanges,
|
|
259
|
-
prevTextRanges,
|
|
260
|
-
trigger,
|
|
261
|
-
noHistory,
|
|
262
|
-
isCompositionEnd,
|
|
263
|
-
noNeedSetTextRange,
|
|
264
|
-
debounce,
|
|
265
|
-
isEditing = !0,
|
|
266
|
-
isSync,
|
|
267
|
-
syncer
|
|
268
|
-
} =
|
|
269
|
-
if (
|
|
270
|
-
throw new Error(`DocumentDataModel or documentViewModel not found for unitId: ${
|
|
271
|
-
const
|
|
272
|
-
if (
|
|
252
|
+
unitId: t,
|
|
253
|
+
segmentId: n = "",
|
|
254
|
+
actions: s,
|
|
255
|
+
textRanges: r,
|
|
256
|
+
prevTextRanges: o,
|
|
257
|
+
trigger: c,
|
|
258
|
+
noHistory: a,
|
|
259
|
+
isCompositionEnd: l,
|
|
260
|
+
noNeedSetTextRange: d,
|
|
261
|
+
debounce: _,
|
|
262
|
+
isEditing: g = !0,
|
|
263
|
+
isSync: f,
|
|
264
|
+
syncer: h
|
|
265
|
+
} = e, R = i.get(p), I = i.get(Re), v = i.get(te), S = R.getUniverDocInstance(t), L = (z = I.getRenderById(t)) == null ? void 0 : z.with(D).getViewModel();
|
|
266
|
+
if (S == null || L == null)
|
|
267
|
+
throw new Error(`DocumentDataModel or documentViewModel not found for unitId: ${t}`);
|
|
268
|
+
const X = i.get(m), y = (F = X.getDocRanges()) != null ? F : [], ne = !!S.getSnapshot().disabled;
|
|
269
|
+
if (O.isNoop(s) || s && s.length === 0 || ne)
|
|
273
270
|
return {
|
|
274
|
-
unitId,
|
|
271
|
+
unitId: t,
|
|
275
272
|
actions: [],
|
|
276
|
-
textRanges:
|
|
273
|
+
textRanges: y
|
|
277
274
|
};
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
|
|
275
|
+
const G = O.invertWithDoc(s, S.getSnapshot());
|
|
276
|
+
S.apply(s), L.reset(S), !d && r && c != null && !f && queueMicrotask(() => {
|
|
277
|
+
X.replaceDocRanges(r, { unitId: t, subUnitId: t }, g, e.options);
|
|
281
278
|
});
|
|
282
|
-
const
|
|
283
|
-
commandId:
|
|
284
|
-
unitId,
|
|
285
|
-
segmentId,
|
|
286
|
-
trigger,
|
|
287
|
-
noHistory,
|
|
288
|
-
debounce,
|
|
279
|
+
const se = {
|
|
280
|
+
commandId: K,
|
|
281
|
+
unitId: t,
|
|
282
|
+
segmentId: n,
|
|
283
|
+
trigger: c,
|
|
284
|
+
noHistory: a,
|
|
285
|
+
debounce: _,
|
|
289
286
|
redoState: {
|
|
290
|
-
actions,
|
|
291
|
-
textRanges
|
|
287
|
+
actions: s,
|
|
288
|
+
textRanges: r
|
|
292
289
|
},
|
|
293
290
|
undoState: {
|
|
294
|
-
actions:
|
|
295
|
-
textRanges:
|
|
291
|
+
actions: G,
|
|
292
|
+
textRanges: o != null ? o : y
|
|
296
293
|
},
|
|
297
|
-
isCompositionEnd,
|
|
298
|
-
isSync,
|
|
299
|
-
syncer
|
|
294
|
+
isCompositionEnd: l,
|
|
295
|
+
isSync: f,
|
|
296
|
+
syncer: h
|
|
300
297
|
};
|
|
301
|
-
return
|
|
302
|
-
unitId,
|
|
303
|
-
actions:
|
|
304
|
-
textRanges:
|
|
298
|
+
return v.emitStateChangeInfo(se), {
|
|
299
|
+
unitId: t,
|
|
300
|
+
actions: G,
|
|
301
|
+
textRanges: y
|
|
305
302
|
};
|
|
306
|
-
}
|
|
307
|
-
},
|
|
303
|
+
}
|
|
304
|
+
}, be = {
|
|
308
305
|
id: "doc.mutation.rename-doc",
|
|
309
|
-
type:
|
|
310
|
-
handler:
|
|
311
|
-
const
|
|
312
|
-
return
|
|
313
|
-
}
|
|
314
|
-
},
|
|
315
|
-
var
|
|
316
|
-
for (var
|
|
317
|
-
(
|
|
318
|
-
return
|
|
319
|
-
},
|
|
320
|
-
let
|
|
321
|
-
constructor(
|
|
322
|
-
super(), this._commandService =
|
|
323
|
-
}
|
|
324
|
-
_transformCustomRange(
|
|
325
|
-
var
|
|
326
|
-
const { startOffset, endOffset, collapsed } =
|
|
327
|
-
if (
|
|
328
|
-
let
|
|
329
|
-
return
|
|
330
|
-
|
|
306
|
+
type: N.MUTATION,
|
|
307
|
+
handler: (i, e) => {
|
|
308
|
+
const n = i.get(p).getUnit(e.unitId, b.UNIVER_DOC);
|
|
309
|
+
return n ? (n.setName(e.name), !0) : !1;
|
|
310
|
+
}
|
|
311
|
+
}, we = "docs.config", H = {};
|
|
312
|
+
var ye = Object.defineProperty, $e = Object.getOwnPropertyDescriptor, Ue = (i, e, t, n) => {
|
|
313
|
+
for (var s = n > 1 ? void 0 : n ? $e(e, t) : e, r = i.length - 1, o; r >= 0; r--)
|
|
314
|
+
(o = i[r]) && (s = (n ? o(e, t, s) : o(s)) || s);
|
|
315
|
+
return n && s && ye(e, t, s), s;
|
|
316
|
+
}, U = (i, e) => (t, n) => e(t, n, i);
|
|
317
|
+
let T = class extends Q {
|
|
318
|
+
constructor(i, e, t) {
|
|
319
|
+
super(), this._commandService = i, this._textSelectionManagerService = e, this._univerInstanceService = t, this._initSelectionChange();
|
|
320
|
+
}
|
|
321
|
+
_transformCustomRange(i, e) {
|
|
322
|
+
var o;
|
|
323
|
+
const { startOffset: t, endOffset: n, collapsed: s } = e, r = (o = i.getCustomRanges()) == null ? void 0 : o.filter((c) => !c.wholeEntity || t <= c.startIndex && n > c.endIndex ? !1 : s ? c.startIndex < t && c.endIndex >= n : C.range.isIntersects(t, n - 1, c.startIndex, c.endIndex));
|
|
324
|
+
if (r != null && r.length) {
|
|
325
|
+
let c = t, a = n;
|
|
326
|
+
return r.forEach((l) => {
|
|
327
|
+
c = Math.min(l.startIndex, c), a = Math.max(l.endIndex + 1, a);
|
|
331
328
|
}), {
|
|
332
|
-
...
|
|
333
|
-
startOffset:
|
|
334
|
-
endOffset:
|
|
335
|
-
collapsed:
|
|
329
|
+
...e,
|
|
330
|
+
startOffset: c,
|
|
331
|
+
endOffset: a,
|
|
332
|
+
collapsed: c === a
|
|
336
333
|
};
|
|
337
334
|
}
|
|
338
|
-
return
|
|
335
|
+
return e;
|
|
339
336
|
}
|
|
340
337
|
_initSelectionChange() {
|
|
341
|
-
this.disposeWithMe(this._commandService.onCommandExecuted((
|
|
342
|
-
if (
|
|
343
|
-
const
|
|
344
|
-
if (!
|
|
338
|
+
this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
|
|
339
|
+
if (i.id === j.id) {
|
|
340
|
+
const e = i.params, { unitId: t, ranges: n, isEditing: s } = e, r = this._univerInstanceService.getUnit(t);
|
|
341
|
+
if (!r)
|
|
345
342
|
return;
|
|
346
|
-
const
|
|
347
|
-
|
|
343
|
+
const o = n.map((c) => this._transformCustomRange(r, c));
|
|
344
|
+
o.some((c, a) => n[a] !== c) && this._textSelectionManagerService.replaceTextRanges(o, s);
|
|
348
345
|
}
|
|
349
346
|
}));
|
|
350
347
|
}
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
],
|
|
357
|
-
var
|
|
358
|
-
for (var
|
|
359
|
-
(
|
|
360
|
-
return
|
|
361
|
-
},
|
|
362
|
-
const
|
|
363
|
-
var
|
|
364
|
-
let
|
|
348
|
+
};
|
|
349
|
+
T = Ue([
|
|
350
|
+
U(0, B),
|
|
351
|
+
U(1, w(m)),
|
|
352
|
+
U(2, p)
|
|
353
|
+
], T);
|
|
354
|
+
var Ee = Object.defineProperty, Pe = Object.getOwnPropertyDescriptor, Ne = (i, e, t, n) => {
|
|
355
|
+
for (var s = n > 1 ? void 0 : n ? Pe(e, t) : e, r = i.length - 1, o; r >= 0; r--)
|
|
356
|
+
(o = i[r]) && (s = (n ? o(e, t, s) : o(s)) || s);
|
|
357
|
+
return n && s && Ee(e, t, s), s;
|
|
358
|
+
}, k = (i, e) => (t, n) => e(t, n, i);
|
|
359
|
+
const Ve = "DOCS_PLUGIN";
|
|
360
|
+
var P;
|
|
361
|
+
let q = (P = class extends le {
|
|
365
362
|
// static override type = UniverInstanceType.UNIVER_DOC;
|
|
366
|
-
constructor(
|
|
367
|
-
super(), this._config =
|
|
368
|
-
const { ...
|
|
363
|
+
constructor(i = H, e, t) {
|
|
364
|
+
super(), this._config = i, this._injector = e, this._configService = t;
|
|
365
|
+
const { ...n } = ue(
|
|
369
366
|
{},
|
|
370
|
-
|
|
367
|
+
H,
|
|
371
368
|
this._config
|
|
372
369
|
);
|
|
373
|
-
this._configService.setConfig(
|
|
370
|
+
this._configService.setConfig(we, n);
|
|
374
371
|
}
|
|
375
372
|
onStarting() {
|
|
376
373
|
this._initializeDependencies(), this._initializeCommands();
|
|
377
374
|
}
|
|
378
375
|
_initializeCommands() {
|
|
379
376
|
[
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
].forEach((
|
|
384
|
-
this._injector.get(
|
|
377
|
+
M,
|
|
378
|
+
be,
|
|
379
|
+
j
|
|
380
|
+
].forEach((i) => {
|
|
381
|
+
this._injector.get(B).registerCommand(i);
|
|
385
382
|
});
|
|
386
383
|
}
|
|
387
384
|
_initializeDependencies() {
|
|
388
385
|
[
|
|
389
|
-
[
|
|
390
|
-
[
|
|
391
|
-
[
|
|
392
|
-
].forEach((
|
|
386
|
+
[m],
|
|
387
|
+
[te],
|
|
388
|
+
[T]
|
|
389
|
+
].forEach((i) => this._injector.add(i));
|
|
393
390
|
}
|
|
394
391
|
onReady() {
|
|
395
|
-
this._injector.get(
|
|
396
|
-
}
|
|
397
|
-
},
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
],
|
|
402
|
-
const
|
|
403
|
-
CUSTOM_RANGE,
|
|
404
|
-
CUSTOM_DECORATION
|
|
392
|
+
this._injector.get(T);
|
|
393
|
+
}
|
|
394
|
+
}, u(P, "pluginName", Ve), P);
|
|
395
|
+
q = Ne([
|
|
396
|
+
k(1, w(ae)),
|
|
397
|
+
k(2, de)
|
|
398
|
+
], q);
|
|
399
|
+
const Be = Z("CUSTOM_RANGE"), je = Z("CUSTOM_DECORATION"), E = {
|
|
400
|
+
CUSTOM_RANGE: Be,
|
|
401
|
+
CUSTOM_DECORATION: je
|
|
405
402
|
};
|
|
406
|
-
var
|
|
407
|
-
for (var
|
|
408
|
-
(
|
|
409
|
-
return
|
|
410
|
-
},
|
|
411
|
-
let
|
|
412
|
-
constructor(
|
|
403
|
+
var Ae = Object.defineProperty, Le = Object.getOwnPropertyDescriptor, Xe = (i, e, t, n) => {
|
|
404
|
+
for (var s = n > 1 ? void 0 : n ? Le(e, t) : e, r = i.length - 1, o; r >= 0; r--)
|
|
405
|
+
(o = i[r]) && (s = (n ? o(e, t, s) : o(s)) || s);
|
|
406
|
+
return n && s && Ae(e, t, s), s;
|
|
407
|
+
}, Ge = (i, e) => (t, n) => e(t, n, i);
|
|
408
|
+
let J = class extends Q {
|
|
409
|
+
constructor(e, t) {
|
|
413
410
|
super();
|
|
414
|
-
|
|
415
|
-
this._context =
|
|
416
|
-
const
|
|
417
|
-
if (
|
|
411
|
+
u(this, "_interceptorsByName", /* @__PURE__ */ new Map());
|
|
412
|
+
this._context = e, this._docSkeletonManagerService = t;
|
|
413
|
+
const n = this._docSkeletonManagerService.getViewModel(), s = n.getDataModel().getUnitId();
|
|
414
|
+
if (s === ge || s === _e)
|
|
418
415
|
return;
|
|
419
|
-
this.disposeWithMe(this.interceptDocumentViewModel(
|
|
416
|
+
this.disposeWithMe(this.interceptDocumentViewModel(n)), this.disposeWithMe(this.intercept(E.CUSTOM_RANGE, {
|
|
420
417
|
priority: -1,
|
|
421
|
-
handler:
|
|
418
|
+
handler: (o, c, a) => a(o)
|
|
422
419
|
}));
|
|
423
|
-
let
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
420
|
+
let r = new $();
|
|
421
|
+
n.segmentViewModels$.subscribe((o) => {
|
|
422
|
+
r.dispose(), r = new $(), o.forEach((c) => {
|
|
423
|
+
r.add(this.interceptDocumentViewModel(c));
|
|
427
424
|
});
|
|
428
|
-
}), this.disposeWithMe(
|
|
429
|
-
}
|
|
430
|
-
intercept(
|
|
431
|
-
const
|
|
432
|
-
this._interceptorsByName.has(
|
|
433
|
-
const
|
|
434
|
-
return
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
var
|
|
438
|
-
return ((
|
|
425
|
+
}), this.disposeWithMe(r);
|
|
426
|
+
}
|
|
427
|
+
intercept(e, t) {
|
|
428
|
+
const n = e;
|
|
429
|
+
this._interceptorsByName.has(n) || this._interceptorsByName.set(n, []);
|
|
430
|
+
const s = this._interceptorsByName.get(n);
|
|
431
|
+
return s.push(t), this._interceptorsByName.set(
|
|
432
|
+
n,
|
|
433
|
+
s.sort((r, o) => {
|
|
434
|
+
var c, a;
|
|
435
|
+
return ((c = o.priority) != null ? c : 0) - ((a = r.priority) != null ? a : 0);
|
|
439
436
|
})
|
|
440
|
-
), this.disposeWithMe(
|
|
441
|
-
}
|
|
442
|
-
fetchThroughInterceptors(
|
|
443
|
-
const
|
|
444
|
-
return
|
|
445
|
-
}
|
|
446
|
-
interceptDocumentViewModel(
|
|
447
|
-
const
|
|
448
|
-
return
|
|
449
|
-
getCustomRange:
|
|
450
|
-
var
|
|
451
|
-
return this.fetchThroughInterceptors(
|
|
452
|
-
|
|
437
|
+
), this.disposeWithMe(fe(() => he(this._interceptorsByName.get(n), t)));
|
|
438
|
+
}
|
|
439
|
+
fetchThroughInterceptors(e) {
|
|
440
|
+
const t = e, n = this._interceptorsByName.get(t);
|
|
441
|
+
return Se(n || []);
|
|
442
|
+
}
|
|
443
|
+
interceptDocumentViewModel(e) {
|
|
444
|
+
const t = new $();
|
|
445
|
+
return t.add(e.registerCustomRangeInterceptor({
|
|
446
|
+
getCustomRange: (n) => {
|
|
447
|
+
var s;
|
|
448
|
+
return this.fetchThroughInterceptors(E.CUSTOM_RANGE)(
|
|
449
|
+
e.getCustomRangeRaw(n),
|
|
453
450
|
{
|
|
454
|
-
index,
|
|
455
|
-
unitId:
|
|
456
|
-
customRanges: (
|
|
451
|
+
index: n,
|
|
452
|
+
unitId: e.getDataModel().getUnitId(),
|
|
453
|
+
customRanges: (s = e.getDataModel().getCustomRanges()) != null ? s : []
|
|
457
454
|
}
|
|
458
455
|
);
|
|
459
|
-
},
|
|
460
|
-
getCustomDecoration:
|
|
461
|
-
var
|
|
462
|
-
return this.fetchThroughInterceptors(
|
|
463
|
-
|
|
456
|
+
},
|
|
457
|
+
getCustomDecoration: (n) => {
|
|
458
|
+
var s;
|
|
459
|
+
return this.fetchThroughInterceptors(E.CUSTOM_DECORATION)(
|
|
460
|
+
e.getCustomDecorationRaw(n),
|
|
464
461
|
{
|
|
465
|
-
index,
|
|
466
|
-
unitId:
|
|
467
|
-
customDecorations: (
|
|
462
|
+
index: n,
|
|
463
|
+
unitId: e.getDataModel().getUnitId(),
|
|
464
|
+
customDecorations: (s = e.getDataModel().getCustomDecorations()) != null ? s : []
|
|
468
465
|
}
|
|
469
466
|
);
|
|
470
|
-
}
|
|
471
|
-
})),
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
],
|
|
477
|
-
function
|
|
478
|
-
if (!
|
|
467
|
+
}
|
|
468
|
+
})), t;
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
J = Xe([
|
|
472
|
+
Ge(1, w(D))
|
|
473
|
+
], J);
|
|
474
|
+
function A(i, e = "") {
|
|
475
|
+
if (!e)
|
|
479
476
|
return ["body"];
|
|
480
|
-
const { headers, footers } =
|
|
481
|
-
if (
|
|
477
|
+
const { headers: t, footers: n } = i.getSnapshot();
|
|
478
|
+
if (t == null && n == null)
|
|
482
479
|
throw new Error("Document data model must have headers or footers when update by segment id");
|
|
483
|
-
if ((
|
|
484
|
-
return ["headers",
|
|
485
|
-
if ((
|
|
486
|
-
return ["footers",
|
|
480
|
+
if ((t == null ? void 0 : t[e]) != null)
|
|
481
|
+
return ["headers", e, "body"];
|
|
482
|
+
if ((n == null ? void 0 : n[e]) != null)
|
|
483
|
+
return ["footers", e, "body"];
|
|
487
484
|
throw new Error("Segment id not found in headers or footers");
|
|
488
485
|
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
if (!documentDataModel)
|
|
486
|
+
function Ke(i, e, t) {
|
|
487
|
+
const { unitId: n, segmentId: s } = e, o = i.get(p).getUnit(n);
|
|
488
|
+
if (!o)
|
|
493
489
|
return !1;
|
|
494
|
-
const
|
|
495
|
-
id:
|
|
490
|
+
const c = {
|
|
491
|
+
id: M.id,
|
|
496
492
|
params: {
|
|
497
|
-
unitId:
|
|
493
|
+
unitId: e.unitId,
|
|
498
494
|
actions: [],
|
|
499
495
|
textRanges: void 0
|
|
500
496
|
}
|
|
501
|
-
},
|
|
502
|
-
if (!
|
|
497
|
+
}, a = O.getInstance(), l = C.customRange.add({ ...e, body: t });
|
|
498
|
+
if (!l)
|
|
503
499
|
return !1;
|
|
504
|
-
const
|
|
505
|
-
return
|
|
500
|
+
const d = A(o, s);
|
|
501
|
+
return c.params.actions = a.editOp(l.serialize(), d), c;
|
|
506
502
|
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
if (!(selections != null && selections.length))
|
|
503
|
+
function He(i, e) {
|
|
504
|
+
var S;
|
|
505
|
+
const { rangeId: t, rangeType: n, wholeEntity: s, properties: r, unitId: o, selections: c } = e, a = i.get(m), l = i.get(p), d = c != null ? c : a.getTextRanges({ unitId: o, subUnitId: o }), _ = (S = d == null ? void 0 : d[0]) == null ? void 0 : S.segmentId;
|
|
506
|
+
if (!(d != null && d.length))
|
|
512
507
|
return !1;
|
|
513
|
-
const
|
|
514
|
-
if (!
|
|
508
|
+
const g = l.getUnit(o, b.UNIVER_DOC);
|
|
509
|
+
if (!g)
|
|
515
510
|
return !1;
|
|
516
|
-
const
|
|
517
|
-
if (!
|
|
511
|
+
const f = g.getSelfOrHeaderFooterModel(_).getBody();
|
|
512
|
+
if (!f)
|
|
518
513
|
return !1;
|
|
519
|
-
const
|
|
520
|
-
ranges:
|
|
521
|
-
rangeId,
|
|
522
|
-
rangeType,
|
|
523
|
-
segmentId,
|
|
524
|
-
wholeEntity,
|
|
525
|
-
properties,
|
|
526
|
-
body
|
|
514
|
+
const h = C.customRange.add({
|
|
515
|
+
ranges: d,
|
|
516
|
+
rangeId: t,
|
|
517
|
+
rangeType: n,
|
|
518
|
+
segmentId: _,
|
|
519
|
+
wholeEntity: s,
|
|
520
|
+
properties: r,
|
|
521
|
+
body: f
|
|
527
522
|
});
|
|
528
|
-
if (!
|
|
523
|
+
if (!h)
|
|
529
524
|
return !1;
|
|
530
|
-
const
|
|
531
|
-
id:
|
|
525
|
+
const R = O.getInstance(), I = {
|
|
526
|
+
id: M.id,
|
|
532
527
|
params: {
|
|
533
|
-
unitId,
|
|
528
|
+
unitId: o,
|
|
534
529
|
actions: [],
|
|
535
|
-
textRanges:
|
|
536
|
-
segmentId
|
|
530
|
+
textRanges: h.selections,
|
|
531
|
+
segmentId: _
|
|
537
532
|
},
|
|
538
|
-
textX
|
|
539
|
-
},
|
|
540
|
-
return
|
|
533
|
+
textX: h
|
|
534
|
+
}, v = A(g, _);
|
|
535
|
+
return I.params.actions = R.editOp(h.serialize(), v), I;
|
|
541
536
|
}
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
if (!documentDataModel)
|
|
537
|
+
function ke(i, e) {
|
|
538
|
+
const { unitId: t, segmentId: n, insert: s } = e, o = i.get(p).getUnit(t);
|
|
539
|
+
if (!o)
|
|
546
540
|
return !1;
|
|
547
|
-
const
|
|
548
|
-
id:
|
|
541
|
+
const c = {
|
|
542
|
+
id: M.id,
|
|
549
543
|
params: {
|
|
550
|
-
unitId:
|
|
544
|
+
unitId: e.unitId,
|
|
551
545
|
actions: [],
|
|
552
546
|
textRanges: void 0,
|
|
553
|
-
segmentId
|
|
547
|
+
segmentId: n
|
|
554
548
|
}
|
|
555
|
-
},
|
|
556
|
-
documentDataModel,
|
|
557
|
-
rangeId:
|
|
558
|
-
insert,
|
|
559
|
-
segmentId
|
|
549
|
+
}, a = O.getInstance(), l = C.customRange.delete({
|
|
550
|
+
documentDataModel: o,
|
|
551
|
+
rangeId: e.rangeId,
|
|
552
|
+
insert: s,
|
|
553
|
+
segmentId: n
|
|
560
554
|
});
|
|
561
|
-
if (!
|
|
555
|
+
if (!l)
|
|
562
556
|
return !1;
|
|
563
|
-
const
|
|
564
|
-
return
|
|
557
|
+
const d = A(o, n);
|
|
558
|
+
return c.params.actions = a.editOp(l.serialize(), d), c.params.textRanges = l.selections, c;
|
|
565
559
|
}
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
if (docDataModel || (docDataModel = accessor.get(IUniverInstanceService).getUnit(unitId)), !docDataModel)
|
|
560
|
+
function qe(i, e) {
|
|
561
|
+
var h, R, I, v;
|
|
562
|
+
const { unitId: t, body: n, doc: s } = e;
|
|
563
|
+
let r = s;
|
|
564
|
+
if (r || (r = i.get(p).getUnit(t)), !r)
|
|
572
565
|
return !1;
|
|
573
|
-
const
|
|
574
|
-
if (!
|
|
575
|
-
const
|
|
576
|
-
if (!
|
|
566
|
+
const o = (h = e.selection) == null ? void 0 : h.segmentId, c = (R = r.getSelfOrHeaderFooterModel(o)) == null ? void 0 : R.getBody();
|
|
567
|
+
if (!c) return !1;
|
|
568
|
+
const a = i.get(m), l = (I = e.selection) != null ? I : a.getActiveTextRange();
|
|
569
|
+
if (!l || !c)
|
|
577
570
|
return !1;
|
|
578
|
-
const
|
|
579
|
-
startOffset:
|
|
580
|
-
endOffset:
|
|
571
|
+
const d = (v = e.textRanges) != null ? v : [{
|
|
572
|
+
startOffset: l.startOffset + n.dataStream.length,
|
|
573
|
+
endOffset: l.startOffset + n.dataStream.length,
|
|
581
574
|
collapsed: !0,
|
|
582
|
-
segmentId
|
|
583
|
-
}],
|
|
584
|
-
selection,
|
|
585
|
-
body:
|
|
586
|
-
doc:
|
|
575
|
+
segmentId: o
|
|
576
|
+
}], _ = C.selection.replace({
|
|
577
|
+
selection: l,
|
|
578
|
+
body: n,
|
|
579
|
+
doc: r
|
|
587
580
|
});
|
|
588
|
-
if (!
|
|
581
|
+
if (!_)
|
|
589
582
|
return !1;
|
|
590
|
-
const
|
|
591
|
-
id:
|
|
583
|
+
const g = {
|
|
584
|
+
id: M.id,
|
|
592
585
|
params: {
|
|
593
|
-
unitId,
|
|
586
|
+
unitId: t,
|
|
594
587
|
actions: [],
|
|
595
|
-
textRanges,
|
|
588
|
+
textRanges: d,
|
|
596
589
|
debounce: !0,
|
|
597
|
-
segmentId
|
|
590
|
+
segmentId: o
|
|
598
591
|
},
|
|
599
|
-
textX
|
|
600
|
-
},
|
|
601
|
-
return
|
|
592
|
+
textX: _
|
|
593
|
+
}, f = O.getInstance();
|
|
594
|
+
return g.params.actions = f.editOp(_.serialize()), g;
|
|
602
595
|
}
|
|
603
|
-
__name(replaceSelectionFactory, "replaceSelectionFactory");
|
|
604
596
|
export {
|
|
605
|
-
DOC_INTERCEPTOR_POINT,
|
|
606
|
-
DocInterceptorService,
|
|
607
|
-
DocSelectionManagerService,
|
|
608
|
-
DocSkeletonManagerService,
|
|
609
|
-
DocStateEmitService,
|
|
610
|
-
RichTextEditingMutation,
|
|
611
|
-
SetTextSelectionsOperation,
|
|
612
|
-
UniverDocsPlugin,
|
|
613
|
-
addCustomRangeBySelectionFactory,
|
|
614
|
-
addCustomRangeFactory,
|
|
615
|
-
deleteCustomRangeFactory,
|
|
616
|
-
replaceSelectionFactory
|
|
597
|
+
E as DOC_INTERCEPTOR_POINT,
|
|
598
|
+
J as DocInterceptorService,
|
|
599
|
+
m as DocSelectionManagerService,
|
|
600
|
+
D as DocSkeletonManagerService,
|
|
601
|
+
te as DocStateEmitService,
|
|
602
|
+
M as RichTextEditingMutation,
|
|
603
|
+
j as SetTextSelectionsOperation,
|
|
604
|
+
q as UniverDocsPlugin,
|
|
605
|
+
He as addCustomRangeBySelectionFactory,
|
|
606
|
+
Ke as addCustomRangeFactory,
|
|
607
|
+
ke as deleteCustomRangeFactory,
|
|
608
|
+
qe as replaceSelectionFactory
|
|
617
609
|
};
|