@univerjs/docs 1.5.2 → 1.6.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/lib/cjs/facade.js +9 -9
- package/lib/cjs/index.js +20 -16
- package/lib/cjs/{protocol-BLe1zbTz.js → protocol-BfcveOck.js} +8 -7
- package/lib/cjs/worker.js +4 -6
- package/lib/es/facade.js +10 -10
- package/lib/es/index.js +23 -20
- package/lib/es/{protocol-C0XOY5qI.js → protocol-RIk-lM8_.js} +8 -7
- package/lib/es/worker.js +5 -7
- package/lib/facade.js +10 -10
- package/lib/index.js +23 -20
- package/lib/{protocol-C0XOY5qI.js → protocol-RIk-lM8_.js} +8 -7
- package/lib/types/commands/mutations/core-editing.mutation.d.ts +2 -0
- package/lib/types/facade/f-document-paragraph.d.ts +2 -2
- package/lib/types/index.d.ts +1 -1
- package/lib/types/services/doc-state-change-manager.service.d.ts +1 -1
- package/lib/types/services/doc-state-emit.service.d.ts +1 -0
- package/lib/types/services/permission/document-permission.d.ts +5 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +2 -2
- package/lib/worker.js +5 -7
- package/package.json +8 -8
package/lib/cjs/facade.js
CHANGED
|
@@ -302,14 +302,14 @@ function stripBlockTokens(text) {
|
|
|
302
302
|
return Array.from(text).map((char) => char === _univerjs_core.DataStreamTreeTokenType.PARAGRAPH ? "\n" : char).filter((char) => char !== _univerjs_core.DataStreamTreeTokenType.BLOCK_START && char !== _univerjs_core.DataStreamTreeTokenType.BLOCK_END && char !== _univerjs_core.DataStreamTreeTokenType.SECTION_BREAK).join("").replace(/\n$/, "");
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
// \0@oxc-project+runtime@0.
|
|
305
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/decorateParam.js
|
|
306
306
|
function __decorateParam(paramIndex, decorator) {
|
|
307
307
|
return function(target, key) {
|
|
308
308
|
decorator(target, key, paramIndex);
|
|
309
309
|
};
|
|
310
310
|
}
|
|
311
311
|
|
|
312
|
-
// \0@oxc-project+runtime@0.
|
|
312
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/decorate.js
|
|
313
313
|
function __decorate(decorators, target, key, desc) {
|
|
314
314
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
315
315
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -782,7 +782,7 @@ let FDocumentParagraph = class FDocumentParagraph extends _univerjs_core_facade.
|
|
|
782
782
|
*/
|
|
783
783
|
isListItem() {
|
|
784
784
|
const { paragraph } = this.getInfo();
|
|
785
|
-
return Boolean(
|
|
785
|
+
return Boolean((0, _univerjs_core.resolveDocumentParagraphBullet)(this._document.getDocumentDataModel().getSnapshot(), paragraph));
|
|
786
786
|
}
|
|
787
787
|
/**
|
|
788
788
|
* Check whether this paragraph is a task/checklist item.
|
|
@@ -795,9 +795,9 @@ let FDocumentParagraph = class FDocumentParagraph extends _univerjs_core_facade.
|
|
|
795
795
|
* ```
|
|
796
796
|
*/
|
|
797
797
|
isTask() {
|
|
798
|
-
var
|
|
798
|
+
var _resolveDocumentParag;
|
|
799
799
|
const { paragraph } = this.getInfo();
|
|
800
|
-
const listType = (
|
|
800
|
+
const listType = (_resolveDocumentParag = (0, _univerjs_core.resolveDocumentParagraphBullet)(this._document.getDocumentDataModel().getSnapshot(), paragraph)) === null || _resolveDocumentParag === void 0 ? void 0 : _resolveDocumentParag.listType;
|
|
801
801
|
return listType === _univerjs_core.PresetListType.CHECK_LIST || listType === _univerjs_core.PresetListType.CHECK_LIST_CHECKED;
|
|
802
802
|
}
|
|
803
803
|
/**
|
|
@@ -1447,7 +1447,7 @@ let FDocumentSection = class FDocumentSection {
|
|
|
1447
1447
|
};
|
|
1448
1448
|
FDocumentSection = __decorate([__decorateParam(2, _univerjs_core.ICommandService), __decorateParam(3, _univerjs_core.IPermissionService)], FDocumentSection);
|
|
1449
1449
|
|
|
1450
|
-
// \0@oxc-project+runtime@0.
|
|
1450
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/typeof.js
|
|
1451
1451
|
function _typeof(o) {
|
|
1452
1452
|
"@babel/helpers - typeof";
|
|
1453
1453
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -1457,7 +1457,7 @@ function _typeof(o) {
|
|
|
1457
1457
|
}, _typeof(o);
|
|
1458
1458
|
}
|
|
1459
1459
|
|
|
1460
|
-
// \0@oxc-project+runtime@0.
|
|
1460
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/toPrimitive.js
|
|
1461
1461
|
function toPrimitive(t, e) {
|
|
1462
1462
|
if ("object" != _typeof(t) || !t) return t;
|
|
1463
1463
|
var r;
|
|
@@ -1469,13 +1469,13 @@ function toPrimitive(t, e) {
|
|
|
1469
1469
|
return ("string" === e ? String : Number)(t);
|
|
1470
1470
|
}
|
|
1471
1471
|
|
|
1472
|
-
// \0@oxc-project+runtime@0.
|
|
1472
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/toPropertyKey.js
|
|
1473
1473
|
function toPropertyKey(t) {
|
|
1474
1474
|
var i = toPrimitive(t, "string");
|
|
1475
1475
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
1476
1476
|
}
|
|
1477
1477
|
|
|
1478
|
-
// \0@oxc-project+runtime@0.
|
|
1478
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/defineProperty.js
|
|
1479
1479
|
function _defineProperty(e, r, t) {
|
|
1480
1480
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
1481
1481
|
value: t,
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_protocol = require("./protocol-
|
|
2
|
+
const require_protocol = require("./protocol-BfcveOck.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");
|
|
@@ -232,7 +232,7 @@ let DocSkeletonManagerService = class DocSkeletonManagerService extends _univerj
|
|
|
232
232
|
supportsIncrementalLayout() {
|
|
233
233
|
var _this$_context$unit$g;
|
|
234
234
|
const documentFlavor = (_this$_context$unit$g = this._context.unit.getSnapshot().documentStyle) === null || _this$_context$unit$g === void 0 ? void 0 : _this$_context$unit$g.documentFlavor;
|
|
235
|
-
return this._docLayoutExecutorService.getExecutor() != null && !(0, _univerjs_core.isInternalEditorID)(this._context.unitId) && !(0, _univerjs_engine_render.getDocumentLayoutPresentation)(this._context.unit) && (documentFlavor === _univerjs_core.DocumentFlavor.TRADITIONAL || documentFlavor === _univerjs_core.DocumentFlavor.MODERN);
|
|
235
|
+
return this._docLayoutExecutorService.getExecutor() != null && !(0, _univerjs_core.isInternalEditorID)(this._context.unitId) && !(0, _univerjs_engine_render.getDocumentLayoutPresentation)(this._context.unit) && !(0, _univerjs_engine_render.hasDocumentHeaderFooterReferenceLayout)(this._context.unit) && !(0, _univerjs_engine_render.hasDocumentReferenceLayout)(this._context.unit) && (documentFlavor === _univerjs_core.DocumentFlavor.TRADITIONAL || documentFlavor === _univerjs_core.DocumentFlavor.MODERN);
|
|
236
236
|
}
|
|
237
237
|
recalculate() {
|
|
238
238
|
const skeleton = this._skeleton;
|
|
@@ -689,7 +689,7 @@ const RichTextEditingMutation = {
|
|
|
689
689
|
type: _univerjs_core.CommandType.MUTATION,
|
|
690
690
|
handler: (accessor, params, options) => {
|
|
691
691
|
var _renderManagerService;
|
|
692
|
-
const { unitId, segmentId = "", actions, textRanges, prevTextRanges, trigger, noHistory, isCompositionEnd, debounce, isEditing = true, isSync: paramsIsSync, syncer } = params;
|
|
692
|
+
const { unitId, segmentId = "", actions, textRanges, prevTextRanges, trigger, noHistory, skipHistory, isCompositionEnd, debounce, isEditing = true, isSync: paramsIsSync, syncer } = params;
|
|
693
693
|
const isSync = Boolean(paramsIsSync || (options === null || options === void 0 ? void 0 : options.fromCollab) || (options === null || options === void 0 ? void 0 : options.fromChangeset));
|
|
694
694
|
const univerInstanceService = accessor.get(_univerjs_core.IUniverInstanceService);
|
|
695
695
|
const renderManagerService = accessor.get(_univerjs_engine_render.IRenderManagerService);
|
|
@@ -736,6 +736,7 @@ const RichTextEditingMutation = {
|
|
|
736
736
|
segmentId,
|
|
737
737
|
trigger,
|
|
738
738
|
noHistory,
|
|
739
|
+
skipHistory,
|
|
739
740
|
debounce,
|
|
740
741
|
redoState: {
|
|
741
742
|
...presentation ? { layoutState: params.layoutState } : {},
|
|
@@ -1304,6 +1305,13 @@ function getDocumentPermissionValue(permissionService, unitId, objectId, action)
|
|
|
1304
1305
|
var _permissionService$ge;
|
|
1305
1306
|
return ((_permissionService$ge = permissionService.getPermissionPoint(createDocumentPermissionPoint(unitId, objectId, action).id)) === null || _permissionService$ge === void 0 ? void 0 : _permissionService$ge.value) ?? true;
|
|
1306
1307
|
}
|
|
1308
|
+
/**
|
|
1309
|
+
* Whether comments can be written in the document. Reads are not restricted by
|
|
1310
|
+
* this point; a user who can open the document can also read its comments.
|
|
1311
|
+
*/
|
|
1312
|
+
function getDocumentCommentPermission(permissionService, unitId) {
|
|
1313
|
+
return getDocumentPermissionValue(permissionService, unitId, unitId, _univerjs_protocol.UnitAction.Comment);
|
|
1314
|
+
}
|
|
1307
1315
|
function setDocumentPermissionValue(permissionService, unitId, objectId, action, value) {
|
|
1308
1316
|
const point = createDocumentPermissionPoint(unitId, objectId, action);
|
|
1309
1317
|
if (!permissionService.getPermissionPoint(point.id)) permissionService.addPermissionPoint(point);
|
|
@@ -1826,7 +1834,7 @@ function getCurrentParagraph(body, params) {
|
|
|
1826
1834
|
const paragraph = matches[0];
|
|
1827
1835
|
return (0, _univerjs_core.getParagraphContentStartOffset)(body, paragraph) === params.startOffset && paragraph.startIndex === params.endOffset && body.dataStream[params.endOffset] === "\r" ? paragraph : null;
|
|
1828
1836
|
}
|
|
1829
|
-
function createParagraphStyleTextX(body, paragraph, params) {
|
|
1837
|
+
function createParagraphStyleTextX(body, paragraph, params, documentDataModel) {
|
|
1830
1838
|
const textX = new _univerjs_core.TextX();
|
|
1831
1839
|
const initializesTextRuns = Boolean(params.style.textStyle && params.startOffset < params.endOffset && body.textRuns == null);
|
|
1832
1840
|
if (params.startOffset > 0) textX.push({
|
|
@@ -1855,10 +1863,7 @@ function createParagraphStyleTextX(body, paragraph, params) {
|
|
|
1855
1863
|
paragraphs: [{
|
|
1856
1864
|
..._univerjs_core.Tools.deepClone(paragraph),
|
|
1857
1865
|
startIndex: 0,
|
|
1858
|
-
paragraphStyle:
|
|
1859
|
-
..._univerjs_core.Tools.deepClone(paragraph.paragraphStyle ?? {}),
|
|
1860
|
-
..._univerjs_core.Tools.deepClone(params.style)
|
|
1861
|
-
}
|
|
1866
|
+
paragraphStyle: (0, _univerjs_core.getDocumentParagraphStyleForUpdate)(documentDataModel.getSnapshot(), paragraph, params.style)
|
|
1862
1867
|
}]
|
|
1863
1868
|
};
|
|
1864
1869
|
Object.defineProperty(paragraphBody, _univerjs_core.RESTORE_INSERTED_PARAGRAPH_IDS, {
|
|
@@ -1890,7 +1895,7 @@ const UpdateDocumentParagraphStyleCommand = {
|
|
|
1890
1895
|
if (!documentDataModel || !body) return false;
|
|
1891
1896
|
const paragraph = getCurrentParagraph(body, params);
|
|
1892
1897
|
if (!paragraph) return false;
|
|
1893
|
-
const { textX, initializesTextRuns } = createParagraphStyleTextX(body, paragraph, params);
|
|
1898
|
+
const { textX, initializesTextRuns } = createParagraphStyleTextX(body, paragraph, params, documentDataModel);
|
|
1894
1899
|
const jsonX = _univerjs_core.JSONX.getInstance();
|
|
1895
1900
|
const path = (0, _univerjs_core.getRichTextEditPath)(documentDataModel, segmentId);
|
|
1896
1901
|
let actions = jsonX.editOp(textX.serialize(), path);
|
|
@@ -2784,8 +2789,8 @@ let DocStateChangeManagerService = class DocStateChangeManagerService extends _u
|
|
|
2784
2789
|
});
|
|
2785
2790
|
}
|
|
2786
2791
|
_cacheChangeState(changeState, type = "history") {
|
|
2787
|
-
const { trigger, unitId, noHistory, debounce = false } = changeState;
|
|
2788
|
-
if (noHistory || type === "history" && trigger == null) return;
|
|
2792
|
+
const { trigger, unitId, noHistory, skipHistory, debounce = false } = changeState;
|
|
2793
|
+
if (noHistory || type === "history" && (skipHistory || trigger == null)) return;
|
|
2789
2794
|
if (type === "history" && (trigger === _univerjs_core.RedoCommandId || trigger === _univerjs_core.UndoCommandId)) return;
|
|
2790
2795
|
const stateCache = type === "history" ? this._historyStateCache : this._changeStateCache;
|
|
2791
2796
|
const cb = type === "history" ? this._pushHistory.bind(this) : this._emitChangeState.bind(this);
|
|
@@ -3136,10 +3141,7 @@ function createDocsLayoutWorkerMessageProtocol(worker, performanceTracker) {
|
|
|
3136
3141
|
const handler = (event) => subscriber.next(event.data);
|
|
3137
3142
|
worker.addEventListener("message", handler);
|
|
3138
3143
|
return () => worker.removeEventListener("message", handler);
|
|
3139
|
-
}).pipe((0, rxjs.
|
|
3140
|
-
bufferSize: 1,
|
|
3141
|
-
refCount: true
|
|
3142
|
-
}))
|
|
3144
|
+
}).pipe((0, rxjs.share)())
|
|
3143
3145
|
};
|
|
3144
3146
|
}
|
|
3145
3147
|
var DocsLayoutWorkerClientService = class extends _univerjs_core.Disposable {
|
|
@@ -3504,7 +3506,8 @@ function generateParagraphs(dataStream, prevParagraph, borderBottom, existingPar
|
|
|
3504
3506
|
});
|
|
3505
3507
|
}
|
|
3506
3508
|
for (const paragraph of paragraphs) {
|
|
3507
|
-
if (prevParagraph === null || prevParagraph === void 0 ? void 0 : prevParagraph.
|
|
3509
|
+
if ((prevParagraph === null || prevParagraph === void 0 ? void 0 : prevParagraph.styleId) !== void 0) paragraph.styleId = prevParagraph.styleId;
|
|
3510
|
+
if ((prevParagraph === null || prevParagraph === void 0 ? void 0 : prevParagraph.bullet) !== void 0) paragraph.bullet = _univerjs_core.Tools.deepClone(prevParagraph.bullet);
|
|
3508
3511
|
if (prevParagraph === null || prevParagraph === void 0 ? void 0 : prevParagraph.paragraphStyle) {
|
|
3509
3512
|
paragraph.paragraphStyle = _univerjs_core.Tools.deepClone(prevParagraph.paragraphStyle);
|
|
3510
3513
|
delete paragraph.paragraphStyle.borderBottom;
|
|
@@ -3734,6 +3737,7 @@ exports.deleteCustomRangeFactory = deleteCustomRangeFactory;
|
|
|
3734
3737
|
exports.docDrawingPositionToTransform = docDrawingPositionToTransform;
|
|
3735
3738
|
exports.generateParagraphs = generateParagraphs;
|
|
3736
3739
|
exports.getContentInsertRange = getContentInsertRange;
|
|
3740
|
+
exports.getDocumentCommentPermission = getDocumentCommentPermission;
|
|
3737
3741
|
exports.getDocumentDrawingSegmentId = getDocumentDrawingSegmentId;
|
|
3738
3742
|
exports.getDocumentEditTargetObjectIds = getDocumentEditTargetObjectIds;
|
|
3739
3743
|
exports.getDocumentEntityParentPermissionObjectIds = getDocumentEntityParentPermissionObjectIds;
|
|
@@ -2,7 +2,7 @@ let _univerjs_core = require("@univerjs/core");
|
|
|
2
2
|
let _univerjs_engine_render = require("@univerjs/engine-render");
|
|
3
3
|
let rxjs = require("rxjs");
|
|
4
4
|
|
|
5
|
-
// \0@oxc-project+runtime@0.
|
|
5
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/typeof.js
|
|
6
6
|
function _typeof(o) {
|
|
7
7
|
"@babel/helpers - typeof";
|
|
8
8
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -12,7 +12,7 @@ function _typeof(o) {
|
|
|
12
12
|
}, _typeof(o);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
// \0@oxc-project+runtime@0.
|
|
15
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/toPrimitive.js
|
|
16
16
|
function toPrimitive(t, e) {
|
|
17
17
|
if ("object" != _typeof(t) || !t) return t;
|
|
18
18
|
var r;
|
|
@@ -24,13 +24,13 @@ function toPrimitive(t, e) {
|
|
|
24
24
|
return ("string" === e ? String : Number)(t);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
// \0@oxc-project+runtime@0.
|
|
27
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/toPropertyKey.js
|
|
28
28
|
function toPropertyKey(t) {
|
|
29
29
|
var i = toPrimitive(t, "string");
|
|
30
30
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
// \0@oxc-project+runtime@0.
|
|
33
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/defineProperty.js
|
|
34
34
|
function _defineProperty(e, r, t) {
|
|
35
35
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
36
36
|
value: t,
|
|
@@ -40,14 +40,14 @@ function _defineProperty(e, r, t) {
|
|
|
40
40
|
}) : e[r] = t, e;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
// \0@oxc-project+runtime@0.
|
|
43
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/decorateParam.js
|
|
44
44
|
function __decorateParam(paramIndex, decorator) {
|
|
45
45
|
return function(target, key) {
|
|
46
46
|
decorator(target, key, paramIndex);
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
// \0@oxc-project+runtime@0.
|
|
50
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/decorate.js
|
|
51
51
|
function __decorate(decorators, target, key, desc) {
|
|
52
52
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
53
53
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -632,6 +632,7 @@ let DocLayoutExecutorService = _DocLayoutExecutorService = class DocLayoutExecut
|
|
|
632
632
|
collectSegment("", dataModel.getBody());
|
|
633
633
|
for (const [segmentId, headerModel] of dataModel.headerModelMap) collectSegment(segmentId, headerModel.getBody());
|
|
634
634
|
for (const [segmentId, footerModel] of dataModel.footerModelMap) collectSegment(segmentId, footerModel.getBody());
|
|
635
|
+
for (const [segmentId, noteModel] of dataModel.noteModelMap) collectSegment(segmentId, noteModel.getBody());
|
|
635
636
|
return presentations;
|
|
636
637
|
}
|
|
637
638
|
_isEligible(dataModel) {
|
|
@@ -710,7 +711,7 @@ DocLayoutExecutorService = _DocLayoutExecutorService = __decorate([
|
|
|
710
711
|
|
|
711
712
|
// package.json
|
|
712
713
|
var name = "@univerjs/docs";
|
|
713
|
-
var version = "1.
|
|
714
|
+
var version = "1.6.0";
|
|
714
715
|
|
|
715
716
|
// src/config/config.ts
|
|
716
717
|
/**
|
package/lib/cjs/worker.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_protocol = require("./protocol-
|
|
2
|
+
const require_protocol = require("./protocol-BfcveOck.js");
|
|
3
3
|
let _univerjs_core = require("@univerjs/core");
|
|
4
4
|
let rxjs = require("rxjs");
|
|
5
5
|
let _univerjs_rpc = require("@univerjs/rpc");
|
|
@@ -25,10 +25,7 @@ function createDocsLayoutWorkerMessageProtocol(performanceTracker) {
|
|
|
25
25
|
const handler = (event) => subscriber.next(event.data);
|
|
26
26
|
addEventListener("message", handler);
|
|
27
27
|
return () => removeEventListener("message", handler);
|
|
28
|
-
}).pipe((0, rxjs.
|
|
29
|
-
bufferSize: 1,
|
|
30
|
-
refCount: true
|
|
31
|
-
}))
|
|
28
|
+
}).pipe((0, rxjs.share)())
|
|
32
29
|
};
|
|
33
30
|
}
|
|
34
31
|
function getCustomRangePresentationKey(entry) {
|
|
@@ -165,7 +162,8 @@ var DocsLayoutWorkerRuntime = class {
|
|
|
165
162
|
const segmentModels = [
|
|
166
163
|
["", dataModel],
|
|
167
164
|
...dataModel.headerModelMap,
|
|
168
|
-
...dataModel.footerModelMap
|
|
165
|
+
...dataModel.footerModelMap,
|
|
166
|
+
...dataModel.noteModelMap
|
|
169
167
|
];
|
|
170
168
|
for (const [segmentId, segmentModel] of segmentModels) {
|
|
171
169
|
var _segmentModel$getBody;
|
package/lib/es/facade.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BooleanNumber, ColumnSeparatorType, DashStyleType, DataStreamTreeTokenType, DocumentFlavor, ICommandService, IPermissionService, IResourceLoaderService, IUniverInstanceService, Inject, Injector, JSONX, PageOrientType, PresetListType, RESTORE_INSERTED_PARAGRAPH_IDS, RedoCommand, SectionType, TextX, TextXActionType, Tools, UndoCommand, UniverInstanceType, UpdateDocsAttributeType, createParagraphId, createSectionId, generateRandomId, getParagraphContentStartOffset, getRichTextEditPath, getSectionHeaderFooterReferenceKey, regexp, resolveSectionHeaderFooterReference } from "@univerjs/core";
|
|
1
|
+
import { BooleanNumber, ColumnSeparatorType, DashStyleType, DataStreamTreeTokenType, DocumentFlavor, ICommandService, IPermissionService, IResourceLoaderService, IUniverInstanceService, Inject, Injector, JSONX, PageOrientType, PresetListType, RESTORE_INSERTED_PARAGRAPH_IDS, RedoCommand, SectionType, TextX, TextXActionType, Tools, UndoCommand, UniverInstanceType, UpdateDocsAttributeType, createParagraphId, createSectionId, generateRandomId, getParagraphContentStartOffset, getRichTextEditPath, getSectionHeaderFooterReferenceKey, regexp, resolveDocumentParagraphBullet, resolveSectionHeaderFooterReference } from "@univerjs/core";
|
|
2
2
|
import { FBaseInitialable, FEnum, FUniver } from "@univerjs/core/facade";
|
|
3
3
|
import { CreateHeaderFooterCommand, DeleteDocumentSectionBreakCommand, HeaderFooterType, InsertDocumentColumnBreakCommand, InsertDocumentSectionBreakCommand, InsertTextCommand, RichTextEditingMutation, SetDocumentNameCommand, SetDocumentPermissionCommand, SetDocumentPermissionsCommand, SetSectionHeaderFooterLinkCommand, UpdateDocumentParagraphStyleCommand, UpdateDocumentSectionCommand, canEditDocumentTargets, createSectionColumnProperties, generateParagraphs, getDocumentEntityParentPermissionObjectIds, getDocumentEntityPermissionObjectId, getDocumentParagraphParentPermissionObjectIds, getDocumentParagraphPermissionObjectId, getDocumentPermissionValue, getDocumentSectionPermissionObjectId, getEffectiveSectionPageSetup, getSectionContentWidth, getTopLevelSectionBreaks } from "@univerjs/docs";
|
|
4
4
|
import { UnitAction } from "@univerjs/protocol";
|
|
@@ -301,14 +301,14 @@ function stripBlockTokens(text) {
|
|
|
301
301
|
return Array.from(text).map((char) => char === DataStreamTreeTokenType.PARAGRAPH ? "\n" : char).filter((char) => char !== DataStreamTreeTokenType.BLOCK_START && char !== DataStreamTreeTokenType.BLOCK_END && char !== DataStreamTreeTokenType.SECTION_BREAK).join("").replace(/\n$/, "");
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
-
// \0@oxc-project+runtime@0.
|
|
304
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/decorateParam.js
|
|
305
305
|
function __decorateParam(paramIndex, decorator) {
|
|
306
306
|
return function(target, key) {
|
|
307
307
|
decorator(target, key, paramIndex);
|
|
308
308
|
};
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
-
// \0@oxc-project+runtime@0.
|
|
311
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/decorate.js
|
|
312
312
|
function __decorate(decorators, target, key, desc) {
|
|
313
313
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
314
314
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -781,7 +781,7 @@ let FDocumentParagraph = class FDocumentParagraph extends FBaseInitialable {
|
|
|
781
781
|
*/
|
|
782
782
|
isListItem() {
|
|
783
783
|
const { paragraph } = this.getInfo();
|
|
784
|
-
return Boolean(
|
|
784
|
+
return Boolean(resolveDocumentParagraphBullet(this._document.getDocumentDataModel().getSnapshot(), paragraph));
|
|
785
785
|
}
|
|
786
786
|
/**
|
|
787
787
|
* Check whether this paragraph is a task/checklist item.
|
|
@@ -794,9 +794,9 @@ let FDocumentParagraph = class FDocumentParagraph extends FBaseInitialable {
|
|
|
794
794
|
* ```
|
|
795
795
|
*/
|
|
796
796
|
isTask() {
|
|
797
|
-
var
|
|
797
|
+
var _resolveDocumentParag;
|
|
798
798
|
const { paragraph } = this.getInfo();
|
|
799
|
-
const listType = (
|
|
799
|
+
const listType = (_resolveDocumentParag = resolveDocumentParagraphBullet(this._document.getDocumentDataModel().getSnapshot(), paragraph)) === null || _resolveDocumentParag === void 0 ? void 0 : _resolveDocumentParag.listType;
|
|
800
800
|
return listType === PresetListType.CHECK_LIST || listType === PresetListType.CHECK_LIST_CHECKED;
|
|
801
801
|
}
|
|
802
802
|
/**
|
|
@@ -1446,7 +1446,7 @@ let FDocumentSection = class FDocumentSection {
|
|
|
1446
1446
|
};
|
|
1447
1447
|
FDocumentSection = __decorate([__decorateParam(2, ICommandService), __decorateParam(3, IPermissionService)], FDocumentSection);
|
|
1448
1448
|
|
|
1449
|
-
// \0@oxc-project+runtime@0.
|
|
1449
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/typeof.js
|
|
1450
1450
|
function _typeof(o) {
|
|
1451
1451
|
"@babel/helpers - typeof";
|
|
1452
1452
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -1456,7 +1456,7 @@ function _typeof(o) {
|
|
|
1456
1456
|
}, _typeof(o);
|
|
1457
1457
|
}
|
|
1458
1458
|
|
|
1459
|
-
// \0@oxc-project+runtime@0.
|
|
1459
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/toPrimitive.js
|
|
1460
1460
|
function toPrimitive(t, e) {
|
|
1461
1461
|
if ("object" != _typeof(t) || !t) return t;
|
|
1462
1462
|
var r;
|
|
@@ -1468,13 +1468,13 @@ function toPrimitive(t, e) {
|
|
|
1468
1468
|
return ("string" === e ? String : Number)(t);
|
|
1469
1469
|
}
|
|
1470
1470
|
|
|
1471
|
-
// \0@oxc-project+runtime@0.
|
|
1471
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/toPropertyKey.js
|
|
1472
1472
|
function toPropertyKey(t) {
|
|
1473
1473
|
var i = toPrimitive(t, "string");
|
|
1474
1474
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
1475
1475
|
}
|
|
1476
1476
|
|
|
1477
|
-
// \0@oxc-project+runtime@0.
|
|
1477
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/defineProperty.js
|
|
1478
1478
|
function _defineProperty(e, r, t) {
|
|
1479
1479
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
1480
1480
|
value: t,
|
package/lib/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { _ as _defineProperty, c as name, d as DocLayoutExecutorState, f as DocLayoutExecutorType, g as __decorateParam, h as __decorate, i as DOCS_PLUGIN_CONFIG_KEY, l as version, m as RICH_TEXT_EDITING_MUTATION_ID, n as DocsLayoutWorkerPerformanceTracker, o as defaultPluginConfig, p as DocLayoutSessionStatus, r as DocsLayoutFontLoader, t as DOCS_LAYOUT_WORKER_CHANNEL, u as DocLayoutExecutorService } from "./protocol-
|
|
2
|
-
import { AlignTypeH, BooleanNumber, BuildTextUtils, ColumnSeparatorType, CommandType, CustomCommandExecutionError, CustomRangeType, DEFAULT_STYLES, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, DataStreamTreeTokenType, DeleteDirection, DependentOn, Disposable, DisposableCollection, DocumentFlavor, DocxBreakType, DrawingTypeEnum, ErrorService, ICommandService, IConfigService, IPermissionService, IResourceManagerService, IUndoRedoService, IUniverInstanceService, Inject, Injector, JSON1, JSONX, LocaleService, MemoryCursor, ObjectPermissionRuleModel, ObjectPermissionService, ObjectRelativeFromH, ObjectRelativeFromV, Optional, PAGE_SIZE, PageOrientType, PaperType, PermissionStatus, Plugin, PositionedObjectLayoutType, RESTORE_INSERTED_PARAGRAPH_IDS, RedoCommandId, RxDisposable, SHEET_TEXT_LINE_GAP, SectionType, TRADITIONAL_DOCUMENT_DEFAULT_MARGIN, TextX, TextXActionType, Tools, UndoCommandId, UniverInstanceType, UpdateDocsAttributeType, composeInterceptors, containsInteriorInsertionOffset, createIdentifier, createInterceptorKey, createParagraphId, createSectionId, generateRandomId, getBlockRangeInterval, getColumnGroupRangeInterval, getParagraphContentStartOffset, getParagraphContentStartOffsets, getRichTextEditPath, getSdtBindingKey, getSdtBindingValue, getSectionHeaderFooterReferenceKey, getTableRangeInterval, isInternalEditorID, merge, remove, resolveSectionHeaderFooterReference, toDisposable, validateDocBodyStructure, validateDocumentStructure } from "@univerjs/core";
|
|
3
|
-
import { DocumentSkeleton, DocumentViewModel, FontCache, IRenderManagerService, NORMAL_TEXT_SELECTION_PLUGIN_STYLE, SheetCellDocumentViewModel, getDocumentLayoutPresentation, getFontStyleString } from "@univerjs/engine-render";
|
|
4
|
-
import { BehaviorSubject, Observable, Subject,
|
|
1
|
+
import { _ as _defineProperty, c as name, d as DocLayoutExecutorState, f as DocLayoutExecutorType, g as __decorateParam, h as __decorate, i as DOCS_PLUGIN_CONFIG_KEY, l as version, m as RICH_TEXT_EDITING_MUTATION_ID, n as DocsLayoutWorkerPerformanceTracker, o as defaultPluginConfig, p as DocLayoutSessionStatus, r as DocsLayoutFontLoader, t as DOCS_LAYOUT_WORKER_CHANNEL, u as DocLayoutExecutorService } from "./protocol-RIk-lM8_.js";
|
|
2
|
+
import { AlignTypeH, BooleanNumber, BuildTextUtils, ColumnSeparatorType, CommandType, CustomCommandExecutionError, CustomRangeType, DEFAULT_STYLES, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, DataStreamTreeTokenType, DeleteDirection, DependentOn, Disposable, DisposableCollection, DocumentFlavor, DocxBreakType, DrawingTypeEnum, ErrorService, ICommandService, IConfigService, IPermissionService, IResourceManagerService, IUndoRedoService, IUniverInstanceService, Inject, Injector, JSON1, JSONX, LocaleService, MemoryCursor, ObjectPermissionRuleModel, ObjectPermissionService, ObjectRelativeFromH, ObjectRelativeFromV, Optional, PAGE_SIZE, PageOrientType, PaperType, PermissionStatus, Plugin, PositionedObjectLayoutType, RESTORE_INSERTED_PARAGRAPH_IDS, RedoCommandId, RxDisposable, SHEET_TEXT_LINE_GAP, SectionType, TRADITIONAL_DOCUMENT_DEFAULT_MARGIN, TextX, TextXActionType, Tools, UndoCommandId, UniverInstanceType, UpdateDocsAttributeType, composeInterceptors, containsInteriorInsertionOffset, createIdentifier, createInterceptorKey, createParagraphId, createSectionId, generateRandomId, getBlockRangeInterval, getColumnGroupRangeInterval, getDocumentParagraphStyleForUpdate, getParagraphContentStartOffset, getParagraphContentStartOffsets, getRichTextEditPath, getSdtBindingKey, getSdtBindingValue, getSectionHeaderFooterReferenceKey, getTableRangeInterval, isInternalEditorID, merge, remove, resolveSectionHeaderFooterReference, toDisposable, validateDocBodyStructure, validateDocumentStructure } from "@univerjs/core";
|
|
3
|
+
import { DocumentSkeleton, DocumentViewModel, FontCache, IRenderManagerService, NORMAL_TEXT_SELECTION_PLUGIN_STYLE, SheetCellDocumentViewModel, getDocumentLayoutPresentation, getFontStyleString, hasDocumentHeaderFooterReferenceLayout, hasDocumentReferenceLayout } from "@univerjs/engine-render";
|
|
4
|
+
import { BehaviorSubject, Observable, Subject, share, takeUntil } from "rxjs";
|
|
5
5
|
import { UnitAction, UnitObject } from "@univerjs/protocol";
|
|
6
6
|
import { ChannelService, toModule } from "@univerjs/rpc";
|
|
7
7
|
|
|
@@ -231,7 +231,7 @@ let DocSkeletonManagerService = class DocSkeletonManagerService extends RxDispos
|
|
|
231
231
|
supportsIncrementalLayout() {
|
|
232
232
|
var _this$_context$unit$g;
|
|
233
233
|
const documentFlavor = (_this$_context$unit$g = this._context.unit.getSnapshot().documentStyle) === null || _this$_context$unit$g === void 0 ? void 0 : _this$_context$unit$g.documentFlavor;
|
|
234
|
-
return this._docLayoutExecutorService.getExecutor() != null && !isInternalEditorID(this._context.unitId) && !getDocumentLayoutPresentation(this._context.unit) && (documentFlavor === DocumentFlavor.TRADITIONAL || documentFlavor === DocumentFlavor.MODERN);
|
|
234
|
+
return this._docLayoutExecutorService.getExecutor() != null && !isInternalEditorID(this._context.unitId) && !getDocumentLayoutPresentation(this._context.unit) && !hasDocumentHeaderFooterReferenceLayout(this._context.unit) && !hasDocumentReferenceLayout(this._context.unit) && (documentFlavor === DocumentFlavor.TRADITIONAL || documentFlavor === DocumentFlavor.MODERN);
|
|
235
235
|
}
|
|
236
236
|
recalculate() {
|
|
237
237
|
const skeleton = this._skeleton;
|
|
@@ -688,7 +688,7 @@ const RichTextEditingMutation = {
|
|
|
688
688
|
type: CommandType.MUTATION,
|
|
689
689
|
handler: (accessor, params, options) => {
|
|
690
690
|
var _renderManagerService;
|
|
691
|
-
const { unitId, segmentId = "", actions, textRanges, prevTextRanges, trigger, noHistory, isCompositionEnd, debounce, isEditing = true, isSync: paramsIsSync, syncer } = params;
|
|
691
|
+
const { unitId, segmentId = "", actions, textRanges, prevTextRanges, trigger, noHistory, skipHistory, isCompositionEnd, debounce, isEditing = true, isSync: paramsIsSync, syncer } = params;
|
|
692
692
|
const isSync = Boolean(paramsIsSync || (options === null || options === void 0 ? void 0 : options.fromCollab) || (options === null || options === void 0 ? void 0 : options.fromChangeset));
|
|
693
693
|
const univerInstanceService = accessor.get(IUniverInstanceService);
|
|
694
694
|
const renderManagerService = accessor.get(IRenderManagerService);
|
|
@@ -735,6 +735,7 @@ const RichTextEditingMutation = {
|
|
|
735
735
|
segmentId,
|
|
736
736
|
trigger,
|
|
737
737
|
noHistory,
|
|
738
|
+
skipHistory,
|
|
738
739
|
debounce,
|
|
739
740
|
redoState: {
|
|
740
741
|
...presentation ? { layoutState: params.layoutState } : {},
|
|
@@ -1303,6 +1304,13 @@ function getDocumentPermissionValue(permissionService, unitId, objectId, action)
|
|
|
1303
1304
|
var _permissionService$ge;
|
|
1304
1305
|
return ((_permissionService$ge = permissionService.getPermissionPoint(createDocumentPermissionPoint(unitId, objectId, action).id)) === null || _permissionService$ge === void 0 ? void 0 : _permissionService$ge.value) ?? true;
|
|
1305
1306
|
}
|
|
1307
|
+
/**
|
|
1308
|
+
* Whether comments can be written in the document. Reads are not restricted by
|
|
1309
|
+
* this point; a user who can open the document can also read its comments.
|
|
1310
|
+
*/
|
|
1311
|
+
function getDocumentCommentPermission(permissionService, unitId) {
|
|
1312
|
+
return getDocumentPermissionValue(permissionService, unitId, unitId, UnitAction.Comment);
|
|
1313
|
+
}
|
|
1306
1314
|
function setDocumentPermissionValue(permissionService, unitId, objectId, action, value) {
|
|
1307
1315
|
const point = createDocumentPermissionPoint(unitId, objectId, action);
|
|
1308
1316
|
if (!permissionService.getPermissionPoint(point.id)) permissionService.addPermissionPoint(point);
|
|
@@ -1825,7 +1833,7 @@ function getCurrentParagraph(body, params) {
|
|
|
1825
1833
|
const paragraph = matches[0];
|
|
1826
1834
|
return getParagraphContentStartOffset(body, paragraph) === params.startOffset && paragraph.startIndex === params.endOffset && body.dataStream[params.endOffset] === "\r" ? paragraph : null;
|
|
1827
1835
|
}
|
|
1828
|
-
function createParagraphStyleTextX(body, paragraph, params) {
|
|
1836
|
+
function createParagraphStyleTextX(body, paragraph, params, documentDataModel) {
|
|
1829
1837
|
const textX = new TextX();
|
|
1830
1838
|
const initializesTextRuns = Boolean(params.style.textStyle && params.startOffset < params.endOffset && body.textRuns == null);
|
|
1831
1839
|
if (params.startOffset > 0) textX.push({
|
|
@@ -1854,10 +1862,7 @@ function createParagraphStyleTextX(body, paragraph, params) {
|
|
|
1854
1862
|
paragraphs: [{
|
|
1855
1863
|
...Tools.deepClone(paragraph),
|
|
1856
1864
|
startIndex: 0,
|
|
1857
|
-
paragraphStyle:
|
|
1858
|
-
...Tools.deepClone(paragraph.paragraphStyle ?? {}),
|
|
1859
|
-
...Tools.deepClone(params.style)
|
|
1860
|
-
}
|
|
1865
|
+
paragraphStyle: getDocumentParagraphStyleForUpdate(documentDataModel.getSnapshot(), paragraph, params.style)
|
|
1861
1866
|
}]
|
|
1862
1867
|
};
|
|
1863
1868
|
Object.defineProperty(paragraphBody, RESTORE_INSERTED_PARAGRAPH_IDS, {
|
|
@@ -1889,7 +1894,7 @@ const UpdateDocumentParagraphStyleCommand = {
|
|
|
1889
1894
|
if (!documentDataModel || !body) return false;
|
|
1890
1895
|
const paragraph = getCurrentParagraph(body, params);
|
|
1891
1896
|
if (!paragraph) return false;
|
|
1892
|
-
const { textX, initializesTextRuns } = createParagraphStyleTextX(body, paragraph, params);
|
|
1897
|
+
const { textX, initializesTextRuns } = createParagraphStyleTextX(body, paragraph, params, documentDataModel);
|
|
1893
1898
|
const jsonX = JSONX.getInstance();
|
|
1894
1899
|
const path = getRichTextEditPath(documentDataModel, segmentId);
|
|
1895
1900
|
let actions = jsonX.editOp(textX.serialize(), path);
|
|
@@ -2783,8 +2788,8 @@ let DocStateChangeManagerService = class DocStateChangeManagerService extends Rx
|
|
|
2783
2788
|
});
|
|
2784
2789
|
}
|
|
2785
2790
|
_cacheChangeState(changeState, type = "history") {
|
|
2786
|
-
const { trigger, unitId, noHistory, debounce = false } = changeState;
|
|
2787
|
-
if (noHistory || type === "history" && trigger == null) return;
|
|
2791
|
+
const { trigger, unitId, noHistory, skipHistory, debounce = false } = changeState;
|
|
2792
|
+
if (noHistory || type === "history" && (skipHistory || trigger == null)) return;
|
|
2788
2793
|
if (type === "history" && (trigger === RedoCommandId || trigger === UndoCommandId)) return;
|
|
2789
2794
|
const stateCache = type === "history" ? this._historyStateCache : this._changeStateCache;
|
|
2790
2795
|
const cb = type === "history" ? this._pushHistory.bind(this) : this._emitChangeState.bind(this);
|
|
@@ -3135,10 +3140,7 @@ function createDocsLayoutWorkerMessageProtocol(worker, performanceTracker) {
|
|
|
3135
3140
|
const handler = (event) => subscriber.next(event.data);
|
|
3136
3141
|
worker.addEventListener("message", handler);
|
|
3137
3142
|
return () => worker.removeEventListener("message", handler);
|
|
3138
|
-
}).pipe(
|
|
3139
|
-
bufferSize: 1,
|
|
3140
|
-
refCount: true
|
|
3141
|
-
}))
|
|
3143
|
+
}).pipe(share())
|
|
3142
3144
|
};
|
|
3143
3145
|
}
|
|
3144
3146
|
var DocsLayoutWorkerClientService = class extends Disposable {
|
|
@@ -3503,7 +3505,8 @@ function generateParagraphs(dataStream, prevParagraph, borderBottom, existingPar
|
|
|
3503
3505
|
});
|
|
3504
3506
|
}
|
|
3505
3507
|
for (const paragraph of paragraphs) {
|
|
3506
|
-
if (prevParagraph === null || prevParagraph === void 0 ? void 0 : prevParagraph.
|
|
3508
|
+
if ((prevParagraph === null || prevParagraph === void 0 ? void 0 : prevParagraph.styleId) !== void 0) paragraph.styleId = prevParagraph.styleId;
|
|
3509
|
+
if ((prevParagraph === null || prevParagraph === void 0 ? void 0 : prevParagraph.bullet) !== void 0) paragraph.bullet = Tools.deepClone(prevParagraph.bullet);
|
|
3507
3510
|
if (prevParagraph === null || prevParagraph === void 0 ? void 0 : prevParagraph.paragraphStyle) {
|
|
3508
3511
|
paragraph.paragraphStyle = Tools.deepClone(prevParagraph.paragraphStyle);
|
|
3509
3512
|
delete paragraph.paragraphStyle.borderBottom;
|
|
@@ -3639,4 +3642,4 @@ function normalizeTextRange(textRange) {
|
|
|
3639
3642
|
};
|
|
3640
3643
|
}
|
|
3641
3644
|
|
|
3642
|
-
export { CreateHeaderFooterCommand, DOCUMENT_UNIT_PERMISSION_ACTIONS, DOC_INTERCEPTOR_POINT, DOC_SELECTION_OPTION_PRESERVE_CARET, DeleteDocumentSectionBreakCommand, DeleteTextCommand, DocBlockMoveValidatorService, DocContentInsertService, DocHistoryAction, DocInterceptorService, DocLayoutExecutorService, DocLayoutExecutorState, DocLayoutExecutorType, DocLayoutSessionStatus, DocSelectionManagerService, DocSkeletonManagerService, DocStateChangeManagerService, DocStateEmitService, DocTextResolverService, DocsLayoutWorkerCapabilityError, DocsLayoutWorkerClientService, EMBED_DOCS_CUSTOM_BLOCK_DEFAULT_COMPONENT_KEY, HeaderFooterType, IDocStateChangeInterceptorService, InsertDocumentColumnBreakCommand, InsertDocumentSectionBreakCommand, InsertTextCommand, RichTextEditingMutation, SetDocumentDefaultParagraphStyleCommand, SetDocumentNameCommand, SetDocumentPermissionCommand, SetDocumentPermissionRuleMutation, SetDocumentPermissionRulesMutation, SetDocumentPermissionsCommand, SetHeadingCollapsedCommand, SetSectionHeaderFooterLinkCommand, SetTextSelectionsOperation, UniverDocsLayoutWorkerPlugin, UniverDocsPlugin, UpdateDocumentParagraphStyleCommand, UpdateDocumentSectionCommand, UpdateTextCommand, addCustomRangeBySelectionFactory, addCustomRangeFactory, buildDocTransform, canEditDocumentTargets, consumeContentInsertRange, createDocsCustomBlockDrawing, createDocsCustomBlockInsertMutation, createDocsCustomBlockRemoveMutation, createDocumentPermissionPoint, createEmbedDocsCustomBlockData, createInsertCustomBlockActions, createRemoveCustomBlockActions, createSectionColumnProperties, deleteCustomRangeFactory, docDrawingPositionToTransform, generateParagraphs, getContentInsertRange, getDocumentDrawingSegmentId, getDocumentEditTargetObjectIds, getDocumentEntityParentPermissionObjectIds, getDocumentEntityPermissionObjectId, getDocumentParagraphParentPermissionObjectIds, getDocumentParagraphPermissionObjectId, getDocumentPermissionValue, getDocumentSectionPermissionObjectId, getEffectiveSectionPageSetup, getSectionContentWidth, getTopLevelSectionBreaks, isEmbedDocsCustomBlockData, isHeaderFooterSelection, isSheetLikeDocsCustomBlockChildType, normalizeTextRange, replaceSelectionFactory, resolveDocsCustomBlockSize, setDocumentPermissionValue, shouldUseInlineTextSelectionForDocsCustomBlockDrawing, transformDocumentTextRanges, transformToDocDrawingPosition };
|
|
3645
|
+
export { CreateHeaderFooterCommand, DOCUMENT_UNIT_PERMISSION_ACTIONS, DOC_INTERCEPTOR_POINT, DOC_SELECTION_OPTION_PRESERVE_CARET, DeleteDocumentSectionBreakCommand, DeleteTextCommand, DocBlockMoveValidatorService, DocContentInsertService, DocHistoryAction, DocInterceptorService, DocLayoutExecutorService, DocLayoutExecutorState, DocLayoutExecutorType, DocLayoutSessionStatus, DocSelectionManagerService, DocSkeletonManagerService, DocStateChangeManagerService, DocStateEmitService, DocTextResolverService, DocsLayoutWorkerCapabilityError, DocsLayoutWorkerClientService, EMBED_DOCS_CUSTOM_BLOCK_DEFAULT_COMPONENT_KEY, HeaderFooterType, IDocStateChangeInterceptorService, InsertDocumentColumnBreakCommand, InsertDocumentSectionBreakCommand, InsertTextCommand, RichTextEditingMutation, SetDocumentDefaultParagraphStyleCommand, SetDocumentNameCommand, SetDocumentPermissionCommand, SetDocumentPermissionRuleMutation, SetDocumentPermissionRulesMutation, SetDocumentPermissionsCommand, SetHeadingCollapsedCommand, SetSectionHeaderFooterLinkCommand, SetTextSelectionsOperation, UniverDocsLayoutWorkerPlugin, UniverDocsPlugin, UpdateDocumentParagraphStyleCommand, UpdateDocumentSectionCommand, UpdateTextCommand, addCustomRangeBySelectionFactory, addCustomRangeFactory, buildDocTransform, canEditDocumentTargets, consumeContentInsertRange, createDocsCustomBlockDrawing, createDocsCustomBlockInsertMutation, createDocsCustomBlockRemoveMutation, createDocumentPermissionPoint, createEmbedDocsCustomBlockData, createInsertCustomBlockActions, createRemoveCustomBlockActions, createSectionColumnProperties, deleteCustomRangeFactory, docDrawingPositionToTransform, generateParagraphs, getContentInsertRange, getDocumentCommentPermission, getDocumentDrawingSegmentId, getDocumentEditTargetObjectIds, getDocumentEntityParentPermissionObjectIds, getDocumentEntityPermissionObjectId, getDocumentParagraphParentPermissionObjectIds, getDocumentParagraphPermissionObjectId, getDocumentPermissionValue, getDocumentSectionPermissionObjectId, getEffectiveSectionPageSetup, getSectionContentWidth, getTopLevelSectionBreaks, isEmbedDocsCustomBlockData, isHeaderFooterSelection, isSheetLikeDocsCustomBlockChildType, normalizeTextRange, replaceSelectionFactory, resolveDocsCustomBlockSize, setDocumentPermissionValue, shouldUseInlineTextSelectionForDocsCustomBlockDrawing, transformDocumentTextRanges, transformToDocDrawingPosition };
|
|
@@ -2,7 +2,7 @@ import { Disposable, DocumentFlavor, ICommandService, ILogService, IUniverInstan
|
|
|
2
2
|
import { FontCache, getDocsCustomBlockRenderViewport } from "@univerjs/engine-render";
|
|
3
3
|
import { BehaviorSubject } from "rxjs";
|
|
4
4
|
|
|
5
|
-
// \0@oxc-project+runtime@0.
|
|
5
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/typeof.js
|
|
6
6
|
function _typeof(o) {
|
|
7
7
|
"@babel/helpers - typeof";
|
|
8
8
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -12,7 +12,7 @@ function _typeof(o) {
|
|
|
12
12
|
}, _typeof(o);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
// \0@oxc-project+runtime@0.
|
|
15
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/toPrimitive.js
|
|
16
16
|
function toPrimitive(t, e) {
|
|
17
17
|
if ("object" != _typeof(t) || !t) return t;
|
|
18
18
|
var r;
|
|
@@ -24,13 +24,13 @@ function toPrimitive(t, e) {
|
|
|
24
24
|
return ("string" === e ? String : Number)(t);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
// \0@oxc-project+runtime@0.
|
|
27
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/toPropertyKey.js
|
|
28
28
|
function toPropertyKey(t) {
|
|
29
29
|
var i = toPrimitive(t, "string");
|
|
30
30
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
// \0@oxc-project+runtime@0.
|
|
33
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/defineProperty.js
|
|
34
34
|
function _defineProperty(e, r, t) {
|
|
35
35
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
36
36
|
value: t,
|
|
@@ -40,14 +40,14 @@ function _defineProperty(e, r, t) {
|
|
|
40
40
|
}) : e[r] = t, e;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
// \0@oxc-project+runtime@0.
|
|
43
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/decorateParam.js
|
|
44
44
|
function __decorateParam(paramIndex, decorator) {
|
|
45
45
|
return function(target, key) {
|
|
46
46
|
decorator(target, key, paramIndex);
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
// \0@oxc-project+runtime@0.
|
|
50
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/decorate.js
|
|
51
51
|
function __decorate(decorators, target, key, desc) {
|
|
52
52
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
53
53
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -632,6 +632,7 @@ let DocLayoutExecutorService = _DocLayoutExecutorService = class DocLayoutExecut
|
|
|
632
632
|
collectSegment("", dataModel.getBody());
|
|
633
633
|
for (const [segmentId, headerModel] of dataModel.headerModelMap) collectSegment(segmentId, headerModel.getBody());
|
|
634
634
|
for (const [segmentId, footerModel] of dataModel.footerModelMap) collectSegment(segmentId, footerModel.getBody());
|
|
635
|
+
for (const [segmentId, noteModel] of dataModel.noteModelMap) collectSegment(segmentId, noteModel.getBody());
|
|
635
636
|
return presentations;
|
|
636
637
|
}
|
|
637
638
|
_isEligible(dataModel) {
|
|
@@ -710,7 +711,7 @@ DocLayoutExecutorService = _DocLayoutExecutorService = __decorate([
|
|
|
710
711
|
|
|
711
712
|
// package.json
|
|
712
713
|
var name = "@univerjs/docs";
|
|
713
|
-
var version = "1.
|
|
714
|
+
var version = "1.6.0";
|
|
714
715
|
|
|
715
716
|
// src/config/config.ts
|
|
716
717
|
/**
|
package/lib/es/worker.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as _defineProperty, a as DOCS_WORKER_PLUGIN_CONFIG_KEY, c as name, f as DocLayoutExecutorType, g as __decorateParam, h as __decorate, l as version, n as DocsLayoutWorkerPerformanceTracker, p as DocLayoutSessionStatus, r as DocsLayoutFontLoader, s as defaultPluginWorkerConfig, t as DOCS_LAYOUT_WORKER_CHANNEL } from "./protocol-
|
|
1
|
+
import { _ as _defineProperty, a as DOCS_WORKER_PLUGIN_CONFIG_KEY, c as name, f as DocLayoutExecutorType, g as __decorateParam, h as __decorate, l as version, n as DocsLayoutWorkerPerformanceTracker, p as DocLayoutSessionStatus, r as DocsLayoutFontLoader, s as defaultPluginWorkerConfig, t as DOCS_LAYOUT_WORKER_CHANNEL } from "./protocol-RIk-lM8_.js";
|
|
2
2
|
import { DocumentDataModel, IConfigService, Inject, Injector, LocaleService, Plugin, Tools, merge, requestImmediateMacroTask } from "@univerjs/core";
|
|
3
|
-
import { Observable,
|
|
3
|
+
import { Observable, share } from "rxjs";
|
|
4
4
|
import { ChannelService, fromModule } from "@univerjs/rpc";
|
|
5
5
|
import { DocumentLayoutSession, FontCache, setDocsCustomBlockRenderViewportProvider } from "@univerjs/engine-render/worker";
|
|
6
6
|
|
|
@@ -24,10 +24,7 @@ function createDocsLayoutWorkerMessageProtocol(performanceTracker) {
|
|
|
24
24
|
const handler = (event) => subscriber.next(event.data);
|
|
25
25
|
addEventListener("message", handler);
|
|
26
26
|
return () => removeEventListener("message", handler);
|
|
27
|
-
}).pipe(
|
|
28
|
-
bufferSize: 1,
|
|
29
|
-
refCount: true
|
|
30
|
-
}))
|
|
27
|
+
}).pipe(share())
|
|
31
28
|
};
|
|
32
29
|
}
|
|
33
30
|
function getCustomRangePresentationKey(entry) {
|
|
@@ -164,7 +161,8 @@ var DocsLayoutWorkerRuntime = class {
|
|
|
164
161
|
const segmentModels = [
|
|
165
162
|
["", dataModel],
|
|
166
163
|
...dataModel.headerModelMap,
|
|
167
|
-
...dataModel.footerModelMap
|
|
164
|
+
...dataModel.footerModelMap,
|
|
165
|
+
...dataModel.noteModelMap
|
|
168
166
|
];
|
|
169
167
|
for (const [segmentId, segmentModel] of segmentModels) {
|
|
170
168
|
var _segmentModel$getBody;
|