@univerjs/docs 1.4.0 → 1.5.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/README.md +12 -46
- package/lib/cjs/facade.js +11 -11
- package/lib/cjs/index.js +126 -126
- package/lib/cjs/{worker-BkTyL8zs.js → protocol-CvmouuxB.js} +14 -352
- package/lib/cjs/worker.js +342 -9
- package/lib/es/facade.js +11 -11
- package/lib/es/index.js +4 -3
- package/lib/es/{worker-Dny9WctR.js → protocol-D1XjAOOp.js} +17 -349
- package/lib/es/worker.js +335 -2
- package/lib/facade.js +11 -11
- package/lib/index.js +4 -3
- package/lib/{worker-Dny9WctR.js → protocol-D1XjAOOp.js} +17 -349
- package/lib/types/index.d.ts +0 -3
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +2 -2
- package/lib/worker.js +335 -2
- package/package.json +8 -8
package/lib/cjs/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
2
|
+
const require_protocol = require("./protocol-CvmouuxB.js");
|
|
3
3
|
let _univerjs_core = require("@univerjs/core");
|
|
4
4
|
let _univerjs_engine_render = require("@univerjs/engine-render");
|
|
5
5
|
let rxjs = require("rxjs");
|
|
@@ -26,12 +26,12 @@ let DocSelectionManagerService = class DocSelectionManagerService extends _unive
|
|
|
26
26
|
super();
|
|
27
27
|
this._commandService = _commandService;
|
|
28
28
|
this._univerInstanceService = _univerInstanceService;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
require_protocol._defineProperty(this, "_currentSelection", null);
|
|
30
|
+
require_protocol._defineProperty(this, "_textSelectionInfo", /* @__PURE__ */ new Map());
|
|
31
|
+
require_protocol._defineProperty(this, "_textSelection$", new rxjs.Subject());
|
|
32
|
+
require_protocol._defineProperty(this, "textSelection$", this._textSelection$.asObservable());
|
|
33
|
+
require_protocol._defineProperty(this, "_refreshSelection$", new rxjs.BehaviorSubject(null));
|
|
34
|
+
require_protocol._defineProperty(this, "refreshSelection$", this._refreshSelection$.asObservable());
|
|
35
35
|
this._listenCurrentUnit();
|
|
36
36
|
}
|
|
37
37
|
_listenCurrentUnit() {
|
|
@@ -191,7 +191,7 @@ let DocSelectionManagerService = class DocSelectionManagerService extends _unive
|
|
|
191
191
|
else unitTextRange.get(subUnitId).textRanges.push(...insertParam.textRanges);
|
|
192
192
|
}
|
|
193
193
|
};
|
|
194
|
-
DocSelectionManagerService =
|
|
194
|
+
DocSelectionManagerService = require_protocol.__decorate([require_protocol.__decorateParam(0, _univerjs_core.ICommandService), require_protocol.__decorateParam(1, _univerjs_core.IUniverInstanceService)], DocSelectionManagerService);
|
|
195
195
|
|
|
196
196
|
// src/services/doc-skeleton-manager.service.ts
|
|
197
197
|
let DocSkeletonManagerService = class DocSkeletonManagerService extends _univerjs_core.RxDisposable {
|
|
@@ -202,14 +202,14 @@ let DocSkeletonManagerService = class DocSkeletonManagerService extends _univerj
|
|
|
202
202
|
this._univerInstanceService = _univerInstanceService;
|
|
203
203
|
this._docLayoutExecutorService = _docLayoutExecutorService;
|
|
204
204
|
this._configService = _configService;
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
205
|
+
require_protocol._defineProperty(this, "_skeleton", void 0);
|
|
206
|
+
require_protocol._defineProperty(this, "_docViewModel", void 0);
|
|
207
|
+
require_protocol._defineProperty(this, "_currentSkeleton$", new rxjs.BehaviorSubject(null));
|
|
208
|
+
require_protocol._defineProperty(this, "currentSkeleton$", this._currentSkeleton$.asObservable());
|
|
209
|
+
require_protocol._defineProperty(this, "_currentSkeletonBefore$", new rxjs.BehaviorSubject(null));
|
|
210
|
+
require_protocol._defineProperty(this, "currentSkeletonBefore$", this._currentSkeletonBefore$.asObservable());
|
|
211
|
+
require_protocol._defineProperty(this, "_currentViewModel$", new rxjs.BehaviorSubject(null));
|
|
212
|
+
require_protocol._defineProperty(this, "currentViewModel$", this._currentViewModel$.asObservable());
|
|
213
213
|
this._init();
|
|
214
214
|
this._univerInstanceService.getCurrentTypeOfUnit$(_univerjs_core.UniverInstanceType.UNIVER_DOC).pipe((0, rxjs.takeUntil)(this.dispose$)).subscribe((documentModel) => {
|
|
215
215
|
if (documentModel && documentModel.getUnitId() === this._context.unitId) this._update(documentModel);
|
|
@@ -268,19 +268,19 @@ let DocSkeletonManagerService = class DocSkeletonManagerService extends _univerj
|
|
|
268
268
|
return this._context.unitId === _univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY || this._context.unitId === _univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY ? new _univerjs_engine_render.SheetCellDocumentViewModel(documentDataModel) : new _univerjs_engine_render.DocumentViewModel(documentDataModel);
|
|
269
269
|
}
|
|
270
270
|
};
|
|
271
|
-
DocSkeletonManagerService =
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
271
|
+
DocSkeletonManagerService = require_protocol.__decorate([
|
|
272
|
+
require_protocol.__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.LocaleService)),
|
|
273
|
+
require_protocol.__decorateParam(2, _univerjs_core.IUniverInstanceService),
|
|
274
|
+
require_protocol.__decorateParam(3, (0, _univerjs_core.Inject)(require_protocol.DocLayoutExecutorService)),
|
|
275
|
+
require_protocol.__decorateParam(4, _univerjs_core.IConfigService)
|
|
276
276
|
], DocSkeletonManagerService);
|
|
277
277
|
|
|
278
278
|
// src/services/doc-state-emit.service.ts
|
|
279
279
|
var DocStateEmitService = class extends _univerjs_core.RxDisposable {
|
|
280
280
|
constructor() {
|
|
281
281
|
super();
|
|
282
|
-
|
|
283
|
-
|
|
282
|
+
require_protocol._defineProperty(this, "_docStateChangeParams$", new rxjs.BehaviorSubject(null));
|
|
283
|
+
require_protocol._defineProperty(this, "docStateChangeParams$", this._docStateChangeParams$.asObservable());
|
|
284
284
|
}
|
|
285
285
|
emitStateChangeInfo(params) {
|
|
286
286
|
this._docStateChangeParams$.next(params);
|
|
@@ -675,7 +675,8 @@ function scheduleDocumentSelectionUpdate(selectionManager, params, isSync) {
|
|
|
675
675
|
}, selectionTarget);
|
|
676
676
|
const updatedSelection = selectionManager.getSelectionInfo(selectionTarget);
|
|
677
677
|
queueMicrotask(() => {
|
|
678
|
-
|
|
678
|
+
var _selectionManager$__g;
|
|
679
|
+
if (((_selectionManager$__g = selectionManager.__getCurrentSelection()) === null || _selectionManager$__g === void 0 ? void 0 : _selectionManager$__g.unitId) !== unitId || selectionManager.getSelectionInfo(selectionTarget) !== updatedSelection) return;
|
|
679
680
|
selectionManager.replaceDocRanges(logicalTextRanges, selectionTarget, isEditing, params.options);
|
|
680
681
|
});
|
|
681
682
|
}
|
|
@@ -684,7 +685,7 @@ function scheduleDocumentSelectionUpdate(selectionManager, params, isSync) {
|
|
|
684
685
|
* send to undo redo service (will be used by the triggering command).
|
|
685
686
|
*/
|
|
686
687
|
const RichTextEditingMutation = {
|
|
687
|
-
id:
|
|
688
|
+
id: require_protocol.RICH_TEXT_EDITING_MUTATION_ID,
|
|
688
689
|
type: _univerjs_core.CommandType.MUTATION,
|
|
689
690
|
handler: (accessor, params, options) => {
|
|
690
691
|
var _renderManagerService;
|
|
@@ -730,7 +731,7 @@ const RichTextEditingMutation = {
|
|
|
730
731
|
resetDocumentViewModel(documentViewModel, documentDataModel, segmentId, appliedActions, preservesStructure);
|
|
731
732
|
scheduleDocumentSelectionUpdate(docSelectionManagerService, params, isSync);
|
|
732
733
|
const changeState = {
|
|
733
|
-
commandId:
|
|
734
|
+
commandId: require_protocol.RICH_TEXT_EDITING_MUTATION_ID,
|
|
734
735
|
unitId,
|
|
735
736
|
segmentId,
|
|
736
737
|
trigger,
|
|
@@ -1155,11 +1156,11 @@ const SetDocumentNameCommand = {
|
|
|
1155
1156
|
var DocumentCommentPermission = class {
|
|
1156
1157
|
constructor(unitId) {
|
|
1157
1158
|
this.unitId = unitId;
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1159
|
+
require_protocol._defineProperty(this, "type", _univerjs_protocol.UnitObject.Document);
|
|
1160
|
+
require_protocol._defineProperty(this, "subType", _univerjs_protocol.UnitAction.Comment);
|
|
1161
|
+
require_protocol._defineProperty(this, "status", _univerjs_core.PermissionStatus.INIT);
|
|
1162
|
+
require_protocol._defineProperty(this, "id", void 0);
|
|
1163
|
+
require_protocol._defineProperty(this, "value", true);
|
|
1163
1164
|
this.id = `${this.type}.${this.subType}_${unitId}`;
|
|
1164
1165
|
}
|
|
1165
1166
|
};
|
|
@@ -1168,11 +1169,11 @@ var DocumentCommentPermission = class {
|
|
|
1168
1169
|
var DocumentCopyPermission = class {
|
|
1169
1170
|
constructor(unitId) {
|
|
1170
1171
|
this.unitId = unitId;
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1172
|
+
require_protocol._defineProperty(this, "type", _univerjs_protocol.UnitObject.Document);
|
|
1173
|
+
require_protocol._defineProperty(this, "subType", _univerjs_protocol.UnitAction.Copy);
|
|
1174
|
+
require_protocol._defineProperty(this, "status", _univerjs_core.PermissionStatus.INIT);
|
|
1175
|
+
require_protocol._defineProperty(this, "id", void 0);
|
|
1176
|
+
require_protocol._defineProperty(this, "value", true);
|
|
1176
1177
|
this.id = `${this.type}.${this.subType}_${unitId}`;
|
|
1177
1178
|
}
|
|
1178
1179
|
};
|
|
@@ -1181,11 +1182,11 @@ var DocumentCopyPermission = class {
|
|
|
1181
1182
|
var DocumentEditablePermission = class {
|
|
1182
1183
|
constructor(unitId) {
|
|
1183
1184
|
this.unitId = unitId;
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1185
|
+
require_protocol._defineProperty(this, "type", _univerjs_protocol.UnitObject.Document);
|
|
1186
|
+
require_protocol._defineProperty(this, "subType", _univerjs_protocol.UnitAction.Edit);
|
|
1187
|
+
require_protocol._defineProperty(this, "status", _univerjs_core.PermissionStatus.INIT);
|
|
1188
|
+
require_protocol._defineProperty(this, "id", void 0);
|
|
1189
|
+
require_protocol._defineProperty(this, "value", true);
|
|
1189
1190
|
this.id = `${this.type}.${this.subType}_${unitId}`;
|
|
1190
1191
|
}
|
|
1191
1192
|
};
|
|
@@ -1194,11 +1195,11 @@ var DocumentEditablePermission = class {
|
|
|
1194
1195
|
var DocumentExportPermission = class {
|
|
1195
1196
|
constructor(unitId) {
|
|
1196
1197
|
this.unitId = unitId;
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1198
|
+
require_protocol._defineProperty(this, "type", _univerjs_protocol.UnitObject.Document);
|
|
1199
|
+
require_protocol._defineProperty(this, "subType", _univerjs_protocol.UnitAction.Export);
|
|
1200
|
+
require_protocol._defineProperty(this, "status", _univerjs_core.PermissionStatus.INIT);
|
|
1201
|
+
require_protocol._defineProperty(this, "id", void 0);
|
|
1202
|
+
require_protocol._defineProperty(this, "value", true);
|
|
1202
1203
|
this.id = `${this.type}.${this.subType}_${unitId}`;
|
|
1203
1204
|
}
|
|
1204
1205
|
};
|
|
@@ -1207,11 +1208,11 @@ var DocumentExportPermission = class {
|
|
|
1207
1208
|
var DocumentPrintPermission = class {
|
|
1208
1209
|
constructor(unitId) {
|
|
1209
1210
|
this.unitId = unitId;
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1211
|
+
require_protocol._defineProperty(this, "type", _univerjs_protocol.UnitObject.Document);
|
|
1212
|
+
require_protocol._defineProperty(this, "subType", _univerjs_protocol.UnitAction.Print);
|
|
1213
|
+
require_protocol._defineProperty(this, "status", _univerjs_core.PermissionStatus.INIT);
|
|
1214
|
+
require_protocol._defineProperty(this, "id", void 0);
|
|
1215
|
+
require_protocol._defineProperty(this, "value", true);
|
|
1215
1216
|
this.id = `${this.type}.${this.subType}_${unitId}`;
|
|
1216
1217
|
}
|
|
1217
1218
|
};
|
|
@@ -1221,11 +1222,11 @@ var DocumentEntityEditPermission = class {
|
|
|
1221
1222
|
constructor(unitId, objectId) {
|
|
1222
1223
|
this.unitId = unitId;
|
|
1223
1224
|
this.objectId = objectId;
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1225
|
+
require_protocol._defineProperty(this, "type", _univerjs_protocol.UnitObject.DocumentEntity);
|
|
1226
|
+
require_protocol._defineProperty(this, "subType", _univerjs_protocol.UnitAction.Edit);
|
|
1227
|
+
require_protocol._defineProperty(this, "status", _univerjs_core.PermissionStatus.INIT);
|
|
1228
|
+
require_protocol._defineProperty(this, "id", void 0);
|
|
1229
|
+
require_protocol._defineProperty(this, "value", true);
|
|
1229
1230
|
this.id = `${this.type}.${this.subType}_${unitId}_${objectId}`;
|
|
1230
1231
|
}
|
|
1231
1232
|
};
|
|
@@ -1235,11 +1236,11 @@ var DocumentParagraphEditPermission = class {
|
|
|
1235
1236
|
constructor(unitId, objectId) {
|
|
1236
1237
|
this.unitId = unitId;
|
|
1237
1238
|
this.objectId = objectId;
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1239
|
+
require_protocol._defineProperty(this, "type", _univerjs_protocol.UnitObject.DocumentParagraph);
|
|
1240
|
+
require_protocol._defineProperty(this, "subType", _univerjs_protocol.UnitAction.Edit);
|
|
1241
|
+
require_protocol._defineProperty(this, "status", _univerjs_core.PermissionStatus.INIT);
|
|
1242
|
+
require_protocol._defineProperty(this, "id", void 0);
|
|
1243
|
+
require_protocol._defineProperty(this, "value", true);
|
|
1243
1244
|
this.id = `${this.type}.${this.subType}_${unitId}_${objectId}`;
|
|
1244
1245
|
}
|
|
1245
1246
|
};
|
|
@@ -1249,11 +1250,11 @@ var DocumentSectionEditPermission = class {
|
|
|
1249
1250
|
constructor(unitId, objectId) {
|
|
1250
1251
|
this.unitId = unitId;
|
|
1251
1252
|
this.objectId = objectId;
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1253
|
+
require_protocol._defineProperty(this, "type", _univerjs_protocol.UnitObject.DocumentSection);
|
|
1254
|
+
require_protocol._defineProperty(this, "subType", _univerjs_protocol.UnitAction.Edit);
|
|
1255
|
+
require_protocol._defineProperty(this, "status", _univerjs_core.PermissionStatus.INIT);
|
|
1256
|
+
require_protocol._defineProperty(this, "id", void 0);
|
|
1257
|
+
require_protocol._defineProperty(this, "value", true);
|
|
1257
1258
|
this.id = `${this.type}.${this.subType}_${unitId}_${objectId}`;
|
|
1258
1259
|
}
|
|
1259
1260
|
};
|
|
@@ -2208,7 +2209,7 @@ let DocumentPermissionRuleModel = class DocumentPermissionRuleModel extends _uni
|
|
|
2208
2209
|
]);
|
|
2209
2210
|
}
|
|
2210
2211
|
};
|
|
2211
|
-
DocumentPermissionRuleModel =
|
|
2212
|
+
DocumentPermissionRuleModel = require_protocol.__decorate([require_protocol.__decorateParam(0, _univerjs_core.IResourceManagerService)], DocumentPermissionRuleModel);
|
|
2212
2213
|
|
|
2213
2214
|
// src/commands/mutations/set-document-permission-rule.mutation.ts
|
|
2214
2215
|
const SetDocumentPermissionRuleMutation = {
|
|
@@ -2435,10 +2436,10 @@ let DocCustomRangeController = class DocCustomRangeController extends _univerjs_
|
|
|
2435
2436
|
}));
|
|
2436
2437
|
}
|
|
2437
2438
|
};
|
|
2438
|
-
DocCustomRangeController =
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2439
|
+
DocCustomRangeController = require_protocol.__decorate([
|
|
2440
|
+
require_protocol.__decorateParam(0, _univerjs_core.ICommandService),
|
|
2441
|
+
require_protocol.__decorateParam(1, (0, _univerjs_core.Inject)(DocSelectionManagerService)),
|
|
2442
|
+
require_protocol.__decorateParam(2, _univerjs_core.IUniverInstanceService)
|
|
2442
2443
|
], DocCustomRangeController);
|
|
2443
2444
|
|
|
2444
2445
|
// src/controllers/doc-permission.controller.ts
|
|
@@ -2515,11 +2516,11 @@ let DocPermissionController = class DocPermissionController extends _univerjs_co
|
|
|
2515
2516
|
return isDocumentEditCommand(commandInfo.id) || isDocumentDataMutation(commandInfo) ? [] : null;
|
|
2516
2517
|
}
|
|
2517
2518
|
};
|
|
2518
|
-
DocPermissionController =
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2519
|
+
DocPermissionController = require_protocol.__decorate([
|
|
2520
|
+
require_protocol.__decorateParam(0, (0, _univerjs_core.Inject)(_univerjs_core.Injector)),
|
|
2521
|
+
require_protocol.__decorateParam(1, _univerjs_core.ICommandService),
|
|
2522
|
+
require_protocol.__decorateParam(2, _univerjs_core.IPermissionService),
|
|
2523
|
+
require_protocol.__decorateParam(3, _univerjs_core.IUniverInstanceService)
|
|
2523
2524
|
], DocPermissionController);
|
|
2524
2525
|
function isDocumentEditCommand(id) {
|
|
2525
2526
|
if (NON_EDIT_DOCUMENT_COMMAND_IDS.has(id)) return false;
|
|
@@ -2647,8 +2648,8 @@ function isRecord(value) {
|
|
|
2647
2648
|
var DocBlockMoveValidatorService = class extends _univerjs_core.Disposable {
|
|
2648
2649
|
constructor(..._args) {
|
|
2649
2650
|
super(..._args);
|
|
2650
|
-
|
|
2651
|
-
|
|
2651
|
+
require_protocol._defineProperty(this, "_validators", []);
|
|
2652
|
+
require_protocol._defineProperty(this, "_transformers", []);
|
|
2652
2653
|
}
|
|
2653
2654
|
registerValidator(validator) {
|
|
2654
2655
|
this._validators.push(validator);
|
|
@@ -2688,7 +2689,7 @@ var DocBlockMoveValidatorService = class extends _univerjs_core.Disposable {
|
|
|
2688
2689
|
var DocContentInsertService = class extends _univerjs_core.Disposable {
|
|
2689
2690
|
constructor(..._args) {
|
|
2690
2691
|
super(..._args);
|
|
2691
|
-
|
|
2692
|
+
require_protocol._defineProperty(this, "_range", null);
|
|
2692
2693
|
}
|
|
2693
2694
|
setInsertRange(range) {
|
|
2694
2695
|
this._range = range;
|
|
@@ -2716,12 +2717,12 @@ let DocStateChangeManagerService = class DocStateChangeManagerService extends _u
|
|
|
2716
2717
|
this._univerInstanceService = _univerInstanceService;
|
|
2717
2718
|
this._docStateEmitService = _docStateEmitService;
|
|
2718
2719
|
this._docStateChangeInterceptorService = _docStateChangeInterceptorService;
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2720
|
+
require_protocol._defineProperty(this, "_docStateChange$", new rxjs.BehaviorSubject(null));
|
|
2721
|
+
require_protocol._defineProperty(this, "docStateChange$", this._docStateChange$.asObservable());
|
|
2722
|
+
require_protocol._defineProperty(this, "_historyStateCache", /* @__PURE__ */ new Map());
|
|
2723
|
+
require_protocol._defineProperty(this, "_changeStateCache", /* @__PURE__ */ new Map());
|
|
2724
|
+
require_protocol._defineProperty(this, "_historyTimer", null);
|
|
2725
|
+
require_protocol._defineProperty(this, "_changeStateCacheTimer", null);
|
|
2725
2726
|
this._initialize();
|
|
2726
2727
|
this._listenDocStateChange();
|
|
2727
2728
|
}
|
|
@@ -2884,12 +2885,12 @@ let DocStateChangeManagerService = class DocStateChangeManagerService extends _u
|
|
|
2884
2885
|
this._docStateChange$.next(changeState);
|
|
2885
2886
|
}
|
|
2886
2887
|
};
|
|
2887
|
-
DocStateChangeManagerService =
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2888
|
+
DocStateChangeManagerService = require_protocol.__decorate([
|
|
2889
|
+
require_protocol.__decorateParam(0, (0, _univerjs_core.Optional)(_univerjs_core.IUndoRedoService)),
|
|
2890
|
+
require_protocol.__decorateParam(1, _univerjs_core.ICommandService),
|
|
2891
|
+
require_protocol.__decorateParam(2, _univerjs_core.IUniverInstanceService),
|
|
2892
|
+
require_protocol.__decorateParam(3, (0, _univerjs_core.Inject)(DocStateEmitService)),
|
|
2893
|
+
require_protocol.__decorateParam(4, (0, _univerjs_core.Optional)(IDocStateChangeInterceptorService))
|
|
2893
2894
|
], DocStateChangeManagerService);
|
|
2894
2895
|
|
|
2895
2896
|
// src/services/doc-text-resolver.service.ts
|
|
@@ -2904,9 +2905,9 @@ DocStateChangeManagerService = require_worker.__decorate([
|
|
|
2904
2905
|
var DocTextResolverService = class extends _univerjs_core.Disposable {
|
|
2905
2906
|
constructor(..._args) {
|
|
2906
2907
|
super(..._args);
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2908
|
+
require_protocol._defineProperty(this, "_resolvers", /* @__PURE__ */ new Set());
|
|
2909
|
+
require_protocol._defineProperty(this, "_textChanged$", new rxjs.Subject());
|
|
2910
|
+
require_protocol._defineProperty(this, "textChanged$", this._textChanged$.asObservable());
|
|
2910
2911
|
}
|
|
2911
2912
|
register(resolver) {
|
|
2912
2913
|
this._resolvers.add(resolver);
|
|
@@ -2966,13 +2967,13 @@ var DocTextResolverService = class extends _univerjs_core.Disposable {
|
|
|
2966
2967
|
|
|
2967
2968
|
// src/plugin.ts
|
|
2968
2969
|
let UniverDocsPlugin = class UniverDocsPlugin extends _univerjs_core.Plugin {
|
|
2969
|
-
constructor(_config =
|
|
2970
|
+
constructor(_config = require_protocol.defaultPluginConfig, _injector, _configService) {
|
|
2970
2971
|
super();
|
|
2971
2972
|
this._config = _config;
|
|
2972
2973
|
this._injector = _injector;
|
|
2973
2974
|
this._configService = _configService;
|
|
2974
|
-
const { ...rest } = (0, _univerjs_core.merge)({},
|
|
2975
|
-
this._configService.setConfig(
|
|
2975
|
+
const { ...rest } = (0, _univerjs_core.merge)({}, require_protocol.defaultPluginConfig, this._config);
|
|
2976
|
+
this._configService.setConfig(require_protocol.DOCS_PLUGIN_CONFIG_KEY, rest);
|
|
2976
2977
|
}
|
|
2977
2978
|
onStarting() {
|
|
2978
2979
|
this._injector.add([DocumentPermissionRuleModel]);
|
|
@@ -3032,7 +3033,7 @@ let UniverDocsPlugin = class UniverDocsPlugin extends _univerjs_core.Plugin {
|
|
|
3032
3033
|
[DocStateChangeManagerService],
|
|
3033
3034
|
[DocBlockMoveValidatorService],
|
|
3034
3035
|
[DocContentInsertService],
|
|
3035
|
-
[
|
|
3036
|
+
[require_protocol.DocLayoutExecutorService],
|
|
3036
3037
|
[DocTextResolverService],
|
|
3037
3038
|
[DocCustomRangeController],
|
|
3038
3039
|
[DocPermissionController]
|
|
@@ -3044,10 +3045,10 @@ let UniverDocsPlugin = class UniverDocsPlugin extends _univerjs_core.Plugin {
|
|
|
3044
3045
|
this._injector.get(DocPermissionController);
|
|
3045
3046
|
}
|
|
3046
3047
|
};
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
UniverDocsPlugin =
|
|
3048
|
+
require_protocol._defineProperty(UniverDocsPlugin, "pluginName", "DOCS_PLUGIN");
|
|
3049
|
+
require_protocol._defineProperty(UniverDocsPlugin, "packageName", require_protocol.name);
|
|
3050
|
+
require_protocol._defineProperty(UniverDocsPlugin, "version", require_protocol.version);
|
|
3051
|
+
UniverDocsPlugin = require_protocol.__decorate([require_protocol.__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.Injector)), require_protocol.__decorateParam(2, _univerjs_core.IConfigService)], UniverDocsPlugin);
|
|
3051
3052
|
|
|
3052
3053
|
// src/layout-worker/config/config.ts
|
|
3053
3054
|
/**
|
|
@@ -3147,15 +3148,15 @@ var DocsLayoutWorkerClientService = class extends _univerjs_core.Disposable {
|
|
|
3147
3148
|
this._workerFactory = _workerFactory;
|
|
3148
3149
|
this._requestTimeoutMs = _requestTimeoutMs;
|
|
3149
3150
|
this._fontFaces = _fontFaces;
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3151
|
+
require_protocol._defineProperty(this, "type", "worker");
|
|
3152
|
+
require_protocol._defineProperty(this, "_worker", null);
|
|
3153
|
+
require_protocol._defineProperty(this, "_channelService", null);
|
|
3154
|
+
require_protocol._defineProperty(this, "_runtime", null);
|
|
3155
|
+
require_protocol._defineProperty(this, "_initialization", void 0);
|
|
3156
|
+
require_protocol._defineProperty(this, "_initialized", false);
|
|
3157
|
+
require_protocol._defineProperty(this, "_performanceTracker", new require_protocol.DocsLayoutWorkerPerformanceTracker());
|
|
3158
|
+
require_protocol._defineProperty(this, "_fontFamilies", /* @__PURE__ */ new Map());
|
|
3159
|
+
require_protocol._defineProperty(this, "_fontLoader", new require_protocol.DocsLayoutFontLoader());
|
|
3159
3160
|
this.disposeWithMe(this._fontLoader);
|
|
3160
3161
|
this._initialization = this._replaceRuntime();
|
|
3161
3162
|
}
|
|
@@ -3249,7 +3250,7 @@ var DocsLayoutWorkerClientService = class extends _univerjs_core.Disposable {
|
|
|
3249
3250
|
const channelService = new _univerjs_rpc.ChannelService(createDocsLayoutWorkerMessageProtocol(worker, this._performanceTracker));
|
|
3250
3251
|
this._worker = worker;
|
|
3251
3252
|
this._channelService = channelService;
|
|
3252
|
-
this._runtime = (0, _univerjs_rpc.toModule)(channelService.requestChannel(
|
|
3253
|
+
this._runtime = (0, _univerjs_rpc.toModule)(channelService.requestChannel(require_protocol.DOCS_LAYOUT_WORKER_CHANNEL));
|
|
3253
3254
|
try {
|
|
3254
3255
|
await this._withTimeout(this._runtime.initialize(this._fontFaces), "load Worker fonts");
|
|
3255
3256
|
await this._withTimeout(this._verifyCapabilities(), "verify capabilities");
|
|
@@ -3318,14 +3319,14 @@ let UniverDocsLayoutWorkerPlugin = class UniverDocsLayoutWorkerPlugin extends _u
|
|
|
3318
3319
|
this.disposeWithMe(this._layoutExecutorService.register(client));
|
|
3319
3320
|
}
|
|
3320
3321
|
};
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
UniverDocsLayoutWorkerPlugin =
|
|
3322
|
+
require_protocol._defineProperty(UniverDocsLayoutWorkerPlugin, "pluginName", "DOCS_LAYOUT_WORKER_PLUGIN");
|
|
3323
|
+
require_protocol._defineProperty(UniverDocsLayoutWorkerPlugin, "packageName", require_protocol.name);
|
|
3324
|
+
require_protocol._defineProperty(UniverDocsLayoutWorkerPlugin, "version", require_protocol.version);
|
|
3325
|
+
UniverDocsLayoutWorkerPlugin = require_protocol.__decorate([
|
|
3325
3326
|
(0, _univerjs_core.DependentOn)(UniverDocsPlugin),
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3327
|
+
require_protocol.__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.Injector)),
|
|
3328
|
+
require_protocol.__decorateParam(2, (0, _univerjs_core.Inject)(require_protocol.DocLayoutExecutorService)),
|
|
3329
|
+
require_protocol.__decorateParam(3, _univerjs_core.IConfigService)
|
|
3329
3330
|
], UniverDocsLayoutWorkerPlugin);
|
|
3330
3331
|
|
|
3331
3332
|
// src/services/doc-interceptor/interceptor-const.ts
|
|
@@ -3342,7 +3343,7 @@ let DocInterceptorService = class DocInterceptorService extends _univerjs_core.D
|
|
|
3342
3343
|
super();
|
|
3343
3344
|
this._context = _context;
|
|
3344
3345
|
this._docSkeletonManagerService = _docSkeletonManagerService;
|
|
3345
|
-
|
|
3346
|
+
require_protocol._defineProperty(this, "_interceptorsByName", /* @__PURE__ */ new Map());
|
|
3346
3347
|
const viewModel = this._docSkeletonManagerService.getViewModel();
|
|
3347
3348
|
const unitId = viewModel.getDataModel().getUnitId();
|
|
3348
3349
|
if (unitId === _univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY || unitId === _univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY) return;
|
|
@@ -3398,7 +3399,7 @@ let DocInterceptorService = class DocInterceptorService extends _univerjs_core.D
|
|
|
3398
3399
|
return disposableCollection;
|
|
3399
3400
|
}
|
|
3400
3401
|
};
|
|
3401
|
-
DocInterceptorService =
|
|
3402
|
+
DocInterceptorService = require_protocol.__decorate([require_protocol.__decorateParam(1, (0, _univerjs_core.Inject)(DocSkeletonManagerService))], DocInterceptorService);
|
|
3402
3403
|
|
|
3403
3404
|
// src/utils/custom-range-factory.ts
|
|
3404
3405
|
function addCustomRangeFactory(accessor, param, body) {
|
|
@@ -3657,12 +3658,12 @@ Object.defineProperty(exports, "DocInterceptorService", {
|
|
|
3657
3658
|
Object.defineProperty(exports, "DocLayoutExecutorService", {
|
|
3658
3659
|
enumerable: true,
|
|
3659
3660
|
get: function () {
|
|
3660
|
-
return
|
|
3661
|
+
return require_protocol.DocLayoutExecutorService;
|
|
3661
3662
|
}
|
|
3662
3663
|
});
|
|
3663
|
-
exports.DocLayoutExecutorState =
|
|
3664
|
-
exports.DocLayoutExecutorType =
|
|
3665
|
-
exports.DocLayoutSessionStatus =
|
|
3664
|
+
exports.DocLayoutExecutorState = require_protocol.DocLayoutExecutorState;
|
|
3665
|
+
exports.DocLayoutExecutorType = require_protocol.DocLayoutExecutorType;
|
|
3666
|
+
exports.DocLayoutSessionStatus = require_protocol.DocLayoutSessionStatus;
|
|
3666
3667
|
Object.defineProperty(exports, "DocSelectionManagerService", {
|
|
3667
3668
|
enumerable: true,
|
|
3668
3669
|
get: function () {
|
|
@@ -3752,6 +3753,5 @@ exports.replaceSelectionFactory = replaceSelectionFactory;
|
|
|
3752
3753
|
exports.resolveDocsCustomBlockSize = resolveDocsCustomBlockSize;
|
|
3753
3754
|
exports.setDocumentPermissionValue = setDocumentPermissionValue;
|
|
3754
3755
|
exports.shouldUseInlineTextSelectionForDocsCustomBlockDrawing = shouldUseInlineTextSelectionForDocsCustomBlockDrawing;
|
|
3755
|
-
exports.startDocsLayoutWorker = require_worker.startDocsLayoutWorker;
|
|
3756
3756
|
exports.transformDocumentTextRanges = transformDocumentTextRanges;
|
|
3757
3757
|
exports.transformToDocDrawingPosition = transformToDocDrawingPosition;
|