@univerjs/core 1.0.0-alpha.0 → 1.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/facade.js +5 -1
- package/lib/cjs/index.js +185 -39
- package/lib/es/facade.js +5 -1
- package/lib/es/index.js +182 -40
- package/lib/facade.js +5 -1
- package/lib/index.js +182 -40
- package/lib/types/docs/data-model/document-data-model.d.ts +1 -1
- package/lib/types/docs/data-model/text-x/apply-utils/common.d.ts +3 -1
- package/lib/types/docs/data-model/text-x/build-utils/paragraph.d.ts +1 -0
- package/lib/types/docs/data-model/text-x/utils.d.ts +2 -1
- package/lib/types/docs/data-model/types.d.ts +6 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/services/instance/instance.service.d.ts +0 -6
- package/lib/types/types/interfaces/i-document-data.d.ts +43 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +11 -11
- package/package.json +4 -4
package/lib/index.js
CHANGED
|
@@ -606,10 +606,9 @@ function diffArrays(oneArray, twoArray) {
|
|
|
606
606
|
}
|
|
607
607
|
function diffObject(oneObject, twoObject) {
|
|
608
608
|
const oneKeys = Object.keys(oneObject);
|
|
609
|
-
|
|
610
|
-
if (oneKeys.length !== twoKeys.length) return false;
|
|
609
|
+
if (oneKeys.length !== Object.keys(twoObject).length) return false;
|
|
611
610
|
for (const key of oneKeys) {
|
|
612
|
-
if (!
|
|
611
|
+
if (!Object.prototype.propertyIsEnumerable.call(twoObject, key)) return false;
|
|
613
612
|
const oneValue = oneObject[key];
|
|
614
613
|
const twoValue = twoObject[key];
|
|
615
614
|
if (!isValueEqual(oneValue, twoValue)) return false;
|
|
@@ -753,11 +752,9 @@ var Tools = class Tools {
|
|
|
753
752
|
return clone;
|
|
754
753
|
}
|
|
755
754
|
if (this.isObject(value)) {
|
|
755
|
+
const source = value;
|
|
756
756
|
const clone = {};
|
|
757
|
-
Object.
|
|
758
|
-
const item = value[key];
|
|
759
|
-
clone[key] = Tools.deepClone(item);
|
|
760
|
-
});
|
|
757
|
+
for (const key in source) if (Object.prototype.hasOwnProperty.call(source, key)) clone[key] = Tools.deepClone(source[key]);
|
|
761
758
|
Object.setPrototypeOf(clone, Object.getPrototypeOf(value));
|
|
762
759
|
return clone;
|
|
763
760
|
}
|
|
@@ -2892,6 +2889,18 @@ function generateRandomId(n = 21, alphabet) {
|
|
|
2892
2889
|
|
|
2893
2890
|
//#endregion
|
|
2894
2891
|
//#region src/types/interfaces/i-document-data.ts
|
|
2892
|
+
/**
|
|
2893
|
+
* The top-level block types in a document body.
|
|
2894
|
+
* These block types are used to represent the structure of the document and can be used to identify different sections or elements within the document.
|
|
2895
|
+
*/
|
|
2896
|
+
let DocumentBlockType = /* @__PURE__ */ function(DocumentBlockType) {
|
|
2897
|
+
DocumentBlockType["PARAGRAPH"] = "paragraph";
|
|
2898
|
+
DocumentBlockType["BLOCK_RANGE"] = "blockRange";
|
|
2899
|
+
DocumentBlockType["TABLE"] = "table";
|
|
2900
|
+
DocumentBlockType["CUSTOM_BLOCK"] = "customBlock";
|
|
2901
|
+
DocumentBlockType["COLUMN_GROUP"] = "columnGroup";
|
|
2902
|
+
return DocumentBlockType;
|
|
2903
|
+
}({});
|
|
2895
2904
|
let DocStyleType = /* @__PURE__ */ function(DocStyleType) {
|
|
2896
2905
|
DocStyleType[DocStyleType["character"] = 0] = "character";
|
|
2897
2906
|
DocStyleType[DocStyleType["paragraph"] = 1] = "paragraph";
|
|
@@ -3170,6 +3179,16 @@ let TableTextWrapType = /* @__PURE__ */ function(TableTextWrapType) {
|
|
|
3170
3179
|
TableTextWrapType[TableTextWrapType["WRAP"] = 1] = "WRAP";
|
|
3171
3180
|
return TableTextWrapType;
|
|
3172
3181
|
}({});
|
|
3182
|
+
let ColumnLayoutType = /* @__PURE__ */ function(ColumnLayoutType) {
|
|
3183
|
+
ColumnLayoutType["FIXED"] = "fixed";
|
|
3184
|
+
ColumnLayoutType["AUTO"] = "auto";
|
|
3185
|
+
return ColumnLayoutType;
|
|
3186
|
+
}({});
|
|
3187
|
+
let ColumnResponsiveType = /* @__PURE__ */ function(ColumnResponsiveType) {
|
|
3188
|
+
ColumnResponsiveType["STACK"] = "stack";
|
|
3189
|
+
ColumnResponsiveType["SHRINK"] = "shrink";
|
|
3190
|
+
return ColumnResponsiveType;
|
|
3191
|
+
}({});
|
|
3173
3192
|
let TableRowHeightRule = /* @__PURE__ */ function(TableRowHeightRule) {
|
|
3174
3193
|
TableRowHeightRule[TableRowHeightRule["AUTO"] = 0] = "AUTO";
|
|
3175
3194
|
TableRowHeightRule[TableRowHeightRule["AT_LEAST"] = 1] = "AT_LEAST";
|
|
@@ -3789,6 +3808,7 @@ function getEmptySnapshot$1(unitID = generateRandomId(6), locale = "enUS", title
|
|
|
3789
3808
|
textRuns: [],
|
|
3790
3809
|
customBlocks: [],
|
|
3791
3810
|
tables: [],
|
|
3811
|
+
columnGroups: [],
|
|
3792
3812
|
blockRanges: [],
|
|
3793
3813
|
customRanges: [],
|
|
3794
3814
|
customDecorations: [],
|
|
@@ -9256,7 +9276,7 @@ var RefAlias = class {
|
|
|
9256
9276
|
setValue(key, attr, value) {
|
|
9257
9277
|
const item = this.getValue(key);
|
|
9258
9278
|
if (item) {
|
|
9259
|
-
if (Object.
|
|
9279
|
+
if (Object.prototype.hasOwnProperty.call(item, attr)) item[attr] = value;
|
|
9260
9280
|
}
|
|
9261
9281
|
}
|
|
9262
9282
|
deleteValue(key, keyGroup) {
|
|
@@ -9631,7 +9651,7 @@ function insertTables(body, insertBody, textLength, currentIndex) {
|
|
|
9631
9651
|
for (let i = 0, len = tables.length; i < len; i++) {
|
|
9632
9652
|
const table = tables[i];
|
|
9633
9653
|
const { startIndex, endIndex } = table;
|
|
9634
|
-
if (startIndex
|
|
9654
|
+
if (startIndex >= currentIndex) {
|
|
9635
9655
|
table.startIndex += textLength;
|
|
9636
9656
|
table.endIndex += textLength;
|
|
9637
9657
|
} else if (endIndex > currentIndex) table.endIndex += textLength;
|
|
@@ -9647,6 +9667,30 @@ function insertTables(body, insertBody, textLength, currentIndex) {
|
|
|
9647
9667
|
tables.sort(sortRulesFactory("startIndex"));
|
|
9648
9668
|
}
|
|
9649
9669
|
}
|
|
9670
|
+
function insertColumnGroups(body, insertBody, textLength, currentIndex) {
|
|
9671
|
+
var _insertBody$columnGro;
|
|
9672
|
+
if (!body.columnGroups && !((_insertBody$columnGro = insertBody.columnGroups) === null || _insertBody$columnGro === void 0 ? void 0 : _insertBody$columnGro.length)) return;
|
|
9673
|
+
if (!body.columnGroups) body.columnGroups = [];
|
|
9674
|
+
const { columnGroups } = body;
|
|
9675
|
+
for (let i = 0, len = columnGroups.length; i < len; i++) {
|
|
9676
|
+
const columnGroup = columnGroups[i];
|
|
9677
|
+
const { startIndex, endIndex } = columnGroup;
|
|
9678
|
+
if (startIndex >= currentIndex) {
|
|
9679
|
+
columnGroup.startIndex += textLength;
|
|
9680
|
+
columnGroup.endIndex += textLength;
|
|
9681
|
+
} else if (endIndex >= currentIndex) columnGroup.endIndex += textLength;
|
|
9682
|
+
}
|
|
9683
|
+
const insertColumnGroups = insertBody.columnGroups;
|
|
9684
|
+
if (insertColumnGroups) {
|
|
9685
|
+
for (let i = 0, len = insertColumnGroups.length; i < len; i++) {
|
|
9686
|
+
const columnGroup = insertColumnGroups[i];
|
|
9687
|
+
columnGroup.startIndex += currentIndex;
|
|
9688
|
+
columnGroup.endIndex += currentIndex;
|
|
9689
|
+
}
|
|
9690
|
+
columnGroups.push(...insertColumnGroups);
|
|
9691
|
+
columnGroups.sort(sortRulesFactory("startIndex"));
|
|
9692
|
+
}
|
|
9693
|
+
}
|
|
9650
9694
|
function insertBlockRanges(body, insertBody, textLength, currentIndex) {
|
|
9651
9695
|
var _insertBody$blockRang;
|
|
9652
9696
|
if (!body.blockRanges && !((_insertBody$blockRang = insertBody.blockRanges) === null || _insertBody$blockRang === void 0 ? void 0 : _insertBody$blockRang.length)) return;
|
|
@@ -9978,6 +10022,39 @@ function deleteTables(body, textLength, currentIndex) {
|
|
|
9978
10022
|
}
|
|
9979
10023
|
return removeTables;
|
|
9980
10024
|
}
|
|
10025
|
+
function deleteColumnGroups(body, textLength, currentIndex) {
|
|
10026
|
+
const { columnGroups } = body;
|
|
10027
|
+
const startIndex = currentIndex;
|
|
10028
|
+
const endIndex = currentIndex + textLength - 1;
|
|
10029
|
+
const removeColumnGroups = [];
|
|
10030
|
+
if (columnGroups) {
|
|
10031
|
+
const newColumnGroups = [];
|
|
10032
|
+
for (let i = 0, len = columnGroups.length; i < len; i++) {
|
|
10033
|
+
const columnGroup = columnGroups[i];
|
|
10034
|
+
const { startIndex: st, endIndex: ed } = columnGroup;
|
|
10035
|
+
if (startIndex <= st && endIndex >= ed) {
|
|
10036
|
+
removeColumnGroups.push({
|
|
10037
|
+
...columnGroup,
|
|
10038
|
+
startIndex: st - currentIndex,
|
|
10039
|
+
endIndex: ed - currentIndex
|
|
10040
|
+
});
|
|
10041
|
+
continue;
|
|
10042
|
+
} else if (st <= startIndex && ed >= endIndex) {
|
|
10043
|
+
const segments = horizontalLineSegmentsSubtraction(st, ed, startIndex, endIndex);
|
|
10044
|
+
if (segments.length === 0) continue;
|
|
10045
|
+
columnGroup.startIndex = segments[0];
|
|
10046
|
+
columnGroup.endIndex = segments[1];
|
|
10047
|
+
if (columnGroup.startIndex === columnGroup.endIndex) continue;
|
|
10048
|
+
} else if (endIndex < st) {
|
|
10049
|
+
columnGroup.startIndex -= textLength;
|
|
10050
|
+
columnGroup.endIndex -= textLength;
|
|
10051
|
+
}
|
|
10052
|
+
newColumnGroups.push(columnGroup);
|
|
10053
|
+
}
|
|
10054
|
+
body.columnGroups = newColumnGroups;
|
|
10055
|
+
}
|
|
10056
|
+
return removeColumnGroups;
|
|
10057
|
+
}
|
|
9981
10058
|
function deleteCustomRanges(body, textLength, currentIndex) {
|
|
9982
10059
|
const { customRanges } = body;
|
|
9983
10060
|
const startIndex = currentIndex;
|
|
@@ -10503,6 +10580,7 @@ function updateAttribute(body, updateBody, textLength, currentIndex, coverType)
|
|
|
10503
10580
|
sectionBreaks: updateSectionBreaks(body, updateBody, textLength, currentIndex, coverType),
|
|
10504
10581
|
customBlocks: updateCustomBlocks(body, updateBody, textLength, currentIndex, coverType),
|
|
10505
10582
|
tables: updateTables(body, updateBody, textLength, currentIndex, coverType),
|
|
10583
|
+
columnGroups: updateColumnGroups(body, updateBody, textLength, currentIndex, coverType),
|
|
10506
10584
|
blockRanges: updateBlockRanges(body, updateBody, textLength, currentIndex, coverType),
|
|
10507
10585
|
customRanges: updateCustomRanges(body, updateBody, textLength, currentIndex, coverType),
|
|
10508
10586
|
customDecorations: updateCustomDecorations(body, updateBody, textLength, currentIndex, coverType)
|
|
@@ -10749,6 +10827,38 @@ function updateTables(body, updateBody, textLength, currentIndex, coverType) {
|
|
|
10749
10827
|
insertTables(body, updateBody, textLength, currentIndex);
|
|
10750
10828
|
return removeTables;
|
|
10751
10829
|
}
|
|
10830
|
+
function updateColumnGroups(body, updateBody, textLength, currentIndex, coverType) {
|
|
10831
|
+
const { columnGroups } = body;
|
|
10832
|
+
const { columnGroups: updateDataColumnGroups } = updateBody;
|
|
10833
|
+
if (columnGroups == null || updateDataColumnGroups == null) return;
|
|
10834
|
+
const removeColumnGroups = deleteColumnGroups(body, textLength, currentIndex);
|
|
10835
|
+
if (coverType !== 1) {
|
|
10836
|
+
const newUpdateColumnGroups = [];
|
|
10837
|
+
for (const updateColumnGroup of updateDataColumnGroups) {
|
|
10838
|
+
const { startIndex: updateStartIndex, endIndex: updateEndIndex } = updateColumnGroup;
|
|
10839
|
+
let splitUpdateColumnGroups = [];
|
|
10840
|
+
for (const removeColumnGroup of removeColumnGroups) {
|
|
10841
|
+
const { startIndex: removeStartIndex, endIndex: removeEndIndex } = removeColumnGroup;
|
|
10842
|
+
if (removeStartIndex >= updateStartIndex && removeEndIndex <= updateEndIndex) {
|
|
10843
|
+
if (coverType === 0) splitUpdateColumnGroups.push({
|
|
10844
|
+
...removeColumnGroup,
|
|
10845
|
+
...updateColumnGroup
|
|
10846
|
+
});
|
|
10847
|
+
else splitUpdateColumnGroups.push({
|
|
10848
|
+
...updateColumnGroup,
|
|
10849
|
+
...removeColumnGroup
|
|
10850
|
+
});
|
|
10851
|
+
break;
|
|
10852
|
+
}
|
|
10853
|
+
}
|
|
10854
|
+
newUpdateColumnGroups.push(...splitUpdateColumnGroups);
|
|
10855
|
+
splitUpdateColumnGroups = [];
|
|
10856
|
+
}
|
|
10857
|
+
updateBody.columnGroups = newUpdateColumnGroups;
|
|
10858
|
+
}
|
|
10859
|
+
insertColumnGroups(body, updateBody, textLength, currentIndex);
|
|
10860
|
+
return removeColumnGroups;
|
|
10861
|
+
}
|
|
10752
10862
|
function updateBlockRanges(body, updateBody, textLength, currentIndex, coverType) {
|
|
10753
10863
|
const { blockRanges } = body;
|
|
10754
10864
|
const { blockRanges: updateDataBlockRanges } = updateBody;
|
|
@@ -10900,6 +11010,20 @@ function getBlockRangeSlice(body, startOffset, endOffset) {
|
|
|
10900
11010
|
}
|
|
10901
11011
|
return newBlockRanges;
|
|
10902
11012
|
}
|
|
11013
|
+
function getColumnGroupSlice(body, startOffset, endOffset) {
|
|
11014
|
+
const { columnGroups = [] } = body;
|
|
11015
|
+
const newColumnGroups = [];
|
|
11016
|
+
for (const columnGroup of columnGroups) {
|
|
11017
|
+
const clonedColumnGroup = Tools.deepClone(columnGroup);
|
|
11018
|
+
const { startIndex, endIndex } = clonedColumnGroup;
|
|
11019
|
+
if (startIndex >= startOffset && endIndex < endOffset) newColumnGroups.push({
|
|
11020
|
+
...clonedColumnGroup,
|
|
11021
|
+
startIndex: startIndex - startOffset,
|
|
11022
|
+
endIndex: endIndex - startOffset
|
|
11023
|
+
});
|
|
11024
|
+
}
|
|
11025
|
+
return newColumnGroups;
|
|
11026
|
+
}
|
|
10903
11027
|
function getParagraphsSlice(body, startOffset, endOffset, type = 1) {
|
|
10904
11028
|
const { paragraphs = [] } = body;
|
|
10905
11029
|
const newParagraphs = [];
|
|
@@ -10962,6 +11086,8 @@ function getBodySlice(body, startOffset, endOffset, returnEmptyArray = true, typ
|
|
|
10962
11086
|
if (newTables.length) docBody.tables = newTables;
|
|
10963
11087
|
const newBlockRanges = getBlockRangeSlice(body, startOffset, endOffset);
|
|
10964
11088
|
if (newBlockRanges.length) docBody.blockRanges = newBlockRanges;
|
|
11089
|
+
const newColumnGroups = getColumnGroupSlice(body, startOffset, endOffset);
|
|
11090
|
+
if (newColumnGroups.length) docBody.columnGroups = newColumnGroups;
|
|
10965
11091
|
docBody.paragraphs = getParagraphsSlice(body, startOffset, endOffset, type);
|
|
10966
11092
|
if (type === 1) {
|
|
10967
11093
|
const customDecorations = getCustomDecorationSlice(body, startOffset, endOffset);
|
|
@@ -10975,7 +11101,7 @@ function getBodySlice(body, startOffset, endOffset, returnEmptyArray = true, typ
|
|
|
10975
11101
|
return docBody;
|
|
10976
11102
|
}
|
|
10977
11103
|
function normalizeBody(body) {
|
|
10978
|
-
const { dataStream, textRuns, paragraphs, customRanges, customDecorations, tables, blockRanges } = body;
|
|
11104
|
+
const { dataStream, textRuns, paragraphs, customRanges, customDecorations, tables, columnGroups, blockRanges } = body;
|
|
10979
11105
|
let leftOffset = 0;
|
|
10980
11106
|
let rightOffset = 0;
|
|
10981
11107
|
customRanges === null || customRanges === void 0 || customRanges.forEach((range) => {
|
|
@@ -11006,6 +11132,10 @@ function normalizeBody(body) {
|
|
|
11006
11132
|
table.startIndex += leftOffset;
|
|
11007
11133
|
table.endIndex += rightOffset;
|
|
11008
11134
|
});
|
|
11135
|
+
columnGroups === null || columnGroups === void 0 || columnGroups.forEach((columnGroup) => {
|
|
11136
|
+
columnGroup.startIndex += leftOffset;
|
|
11137
|
+
columnGroup.endIndex += rightOffset;
|
|
11138
|
+
});
|
|
11009
11139
|
return {
|
|
11010
11140
|
...body,
|
|
11011
11141
|
dataStream: newData,
|
|
@@ -11014,6 +11144,7 @@ function normalizeBody(body) {
|
|
|
11014
11144
|
customRanges,
|
|
11015
11145
|
customDecorations,
|
|
11016
11146
|
tables,
|
|
11147
|
+
columnGroups,
|
|
11017
11148
|
blockRanges
|
|
11018
11149
|
};
|
|
11019
11150
|
}
|
|
@@ -11076,8 +11207,8 @@ function composeCustomDecorations(updateDataCustomDecorations, originCustomDecor
|
|
|
11076
11207
|
function composeBody(thisBody, otherBody, coverType = 0) {
|
|
11077
11208
|
if (otherBody.dataStream !== "") throw new Error("Cannot compose other body with non-empty dataStream");
|
|
11078
11209
|
const retBody = { dataStream: thisBody.dataStream };
|
|
11079
|
-
const { textRuns: thisTextRuns, paragraphs: thisParagraphs = [], customRanges: thisCustomRanges, customDecorations: thisCustomDecorations = [], blockRanges: thisBlockRanges = [] } = thisBody;
|
|
11080
|
-
const { textRuns: otherTextRuns, paragraphs: otherParagraphs = [], customRanges: otherCustomRanges, customDecorations: otherCustomDecorations = [], blockRanges: otherBlockRanges = [] } = otherBody;
|
|
11210
|
+
const { textRuns: thisTextRuns, paragraphs: thisParagraphs = [], customRanges: thisCustomRanges, customDecorations: thisCustomDecorations = [], columnGroups: thisColumnGroups = [], blockRanges: thisBlockRanges = [] } = thisBody;
|
|
11211
|
+
const { textRuns: otherTextRuns, paragraphs: otherParagraphs = [], customRanges: otherCustomRanges, customDecorations: otherCustomDecorations = [], columnGroups: otherColumnGroups = [], blockRanges: otherBlockRanges = [] } = otherBody;
|
|
11081
11212
|
retBody.textRuns = composeTextRuns(otherTextRuns, thisTextRuns, coverType);
|
|
11082
11213
|
retBody.customRanges = composeCustomRanges(otherCustomRanges, thisCustomRanges, coverType);
|
|
11083
11214
|
const customDecorations = composeCustomDecorations(otherCustomDecorations, thisCustomDecorations, coverType);
|
|
@@ -11107,6 +11238,8 @@ function composeBody(thisBody, otherBody, coverType = 0) {
|
|
|
11107
11238
|
if (paragraphs.length) retBody.paragraphs = paragraphs;
|
|
11108
11239
|
const blockRanges = composeDocumentBlockRanges(thisBlockRanges, otherBlockRanges);
|
|
11109
11240
|
if (blockRanges.length) retBody.blockRanges = blockRanges;
|
|
11241
|
+
const columnGroups = composeColumnGroups(thisColumnGroups, otherColumnGroups);
|
|
11242
|
+
if (columnGroups.length) retBody.columnGroups = columnGroups;
|
|
11110
11243
|
return retBody;
|
|
11111
11244
|
}
|
|
11112
11245
|
function composeDocumentBlockRanges(thisRanges, otherRanges) {
|
|
@@ -11116,11 +11249,18 @@ function composeDocumentBlockRanges(thisRanges, otherRanges) {
|
|
|
11116
11249
|
otherRanges.forEach((range) => byId.set(range.blockId, Tools.deepClone(range)));
|
|
11117
11250
|
return Array.from(byId.values()).sort((left, right) => left.startIndex - right.startIndex);
|
|
11118
11251
|
}
|
|
11252
|
+
function composeColumnGroups(thisRanges, otherRanges) {
|
|
11253
|
+
if (!thisRanges.length) return otherRanges;
|
|
11254
|
+
if (!otherRanges.length) return thisRanges;
|
|
11255
|
+
const byId = new Map(thisRanges.map((range) => [range.columnGroupId, Tools.deepClone(range)]));
|
|
11256
|
+
otherRanges.forEach((range) => byId.set(range.columnGroupId, Tools.deepClone(range)));
|
|
11257
|
+
return Array.from(byId.values()).sort((left, right) => left.startIndex - right.startIndex);
|
|
11258
|
+
}
|
|
11119
11259
|
function isUselessRetainAction(action) {
|
|
11120
11260
|
const { body } = action;
|
|
11121
11261
|
if (body == null) return true;
|
|
11122
|
-
const { textRuns, paragraphs, customRanges, customBlocks, customDecorations, tables, blockRanges } = body;
|
|
11123
|
-
if (textRuns == null && paragraphs == null && customRanges == null && customBlocks == null && customDecorations == null && tables == null && blockRanges == null) return true;
|
|
11262
|
+
const { textRuns, paragraphs, customRanges, customBlocks, customDecorations, tables, columnGroups, blockRanges } = body;
|
|
11263
|
+
if (textRuns == null && paragraphs == null && customRanges == null && customBlocks == null && customDecorations == null && tables == null && columnGroups == null && blockRanges == null) return true;
|
|
11124
11264
|
return false;
|
|
11125
11265
|
}
|
|
11126
11266
|
function getRichTextEditPath(docDataModel, segmentId = "") {
|
|
@@ -11223,6 +11363,7 @@ function updateAttributeByDelete(body, textLength, currentIndex) {
|
|
|
11223
11363
|
const removeSectionBreaks = deleteSectionBreaks(body, textLength, currentIndex);
|
|
11224
11364
|
const removeCustomBlocks = deleteCustomBlocks(body, textLength, currentIndex);
|
|
11225
11365
|
const removeTables = deleteTables(body, textLength, currentIndex);
|
|
11366
|
+
const removeColumnGroups = deleteColumnGroups(body, textLength, currentIndex);
|
|
11226
11367
|
const removeBlockRanges = deleteBlockRanges(body, textLength, currentIndex);
|
|
11227
11368
|
const removeCustomRanges = deleteCustomRanges(body, textLength, currentIndex);
|
|
11228
11369
|
const removeCustomDecorations = deleteCustomDecorations(body, textLength, currentIndex);
|
|
@@ -11238,6 +11379,7 @@ function updateAttributeByDelete(body, textLength, currentIndex) {
|
|
|
11238
11379
|
sectionBreaks: removeSectionBreaks,
|
|
11239
11380
|
customBlocks: removeCustomBlocks,
|
|
11240
11381
|
tables: removeTables,
|
|
11382
|
+
columnGroups: removeColumnGroups,
|
|
11241
11383
|
blockRanges: removeBlockRanges,
|
|
11242
11384
|
customRanges: removeCustomRanges,
|
|
11243
11385
|
customDecorations: removeCustomDecorations
|
|
@@ -11253,6 +11395,7 @@ function updateAttributeByInsert(body, insertBody, textLength, currentIndex) {
|
|
|
11253
11395
|
insertSectionBreaks(body, insertBody, textLength, currentIndex);
|
|
11254
11396
|
insertCustomBlocks(body, insertBody, textLength, currentIndex);
|
|
11255
11397
|
insertTables(body, insertBody, textLength, currentIndex);
|
|
11398
|
+
insertColumnGroups(body, insertBody, textLength, currentIndex);
|
|
11256
11399
|
insertBlockRanges(body, insertBody, textLength, currentIndex);
|
|
11257
11400
|
insertCustomRanges(body, insertBody, textLength, currentIndex);
|
|
11258
11401
|
insertCustomDecorations(body, insertBody, textLength, currentIndex);
|
|
@@ -11864,6 +12007,8 @@ let DataStreamTreeNodeType = /* @__PURE__ */ function(DataStreamTreeNodeType) {
|
|
|
11864
12007
|
DataStreamTreeNodeType["TABLE"] = "TABLE";
|
|
11865
12008
|
DataStreamTreeNodeType["TABLE_ROW"] = "TABLE_ROW";
|
|
11866
12009
|
DataStreamTreeNodeType["TABLE_CELL"] = "TABLE_CELL";
|
|
12010
|
+
DataStreamTreeNodeType["COLUMN_GROUP"] = "COLUMN_GROUP";
|
|
12011
|
+
DataStreamTreeNodeType["COLUMN"] = "COLUMN";
|
|
11867
12012
|
DataStreamTreeNodeType["BLOCK"] = "BLOCK";
|
|
11868
12013
|
DataStreamTreeNodeType["CUSTOM_BLOCK"] = "CUSTOM_BLOCK";
|
|
11869
12014
|
return DataStreamTreeNodeType;
|
|
@@ -11877,6 +12022,10 @@ let DataStreamTreeTokenType = /* @__PURE__ */ function(DataStreamTreeTokenType)
|
|
|
11877
12022
|
DataStreamTreeTokenType["TABLE_CELL_END"] = "";
|
|
11878
12023
|
DataStreamTreeTokenType["TABLE_ROW_END"] = "";
|
|
11879
12024
|
DataStreamTreeTokenType["TABLE_END"] = "";
|
|
12025
|
+
DataStreamTreeTokenType["COLUMN_GROUP_START"] = "";
|
|
12026
|
+
DataStreamTreeTokenType["COLUMN_START"] = "";
|
|
12027
|
+
DataStreamTreeTokenType["COLUMN_END"] = "";
|
|
12028
|
+
DataStreamTreeTokenType["COLUMN_GROUP_END"] = "";
|
|
11880
12029
|
DataStreamTreeTokenType["BLOCK_START"] = "";
|
|
11881
12030
|
DataStreamTreeTokenType["BLOCK_END"] = "";
|
|
11882
12031
|
/**
|
|
@@ -12176,11 +12325,10 @@ var DocumentDataModel = class DocumentDataModel extends DocumentDataModelSimple
|
|
|
12176
12325
|
this.change$.next(this.change$.value + 1);
|
|
12177
12326
|
}
|
|
12178
12327
|
getSelfOrHeaderFooterModel(segmentId) {
|
|
12179
|
-
if (segmentId
|
|
12180
|
-
|
|
12181
|
-
|
|
12182
|
-
|
|
12183
|
-
return this;
|
|
12328
|
+
if (segmentId === null || segmentId === void 0 || segmentId === "") return this;
|
|
12329
|
+
if (this.headerModelMap.has(segmentId)) return this.headerModelMap.get(segmentId);
|
|
12330
|
+
if (this.footerModelMap.has(segmentId)) return this.footerModelMap.get(segmentId);
|
|
12331
|
+
return null;
|
|
12184
12332
|
}
|
|
12185
12333
|
getUnitId() {
|
|
12186
12334
|
return this._unitId;
|
|
@@ -12350,7 +12498,7 @@ function getSelectionForAddCustomRange(range, body) {
|
|
|
12350
12498
|
function deleteCustomRangeTextX(params) {
|
|
12351
12499
|
var _documentDataModel$ge, _insert$dataStream$le;
|
|
12352
12500
|
const { rangeId, segmentId, documentDataModel, insert } = params;
|
|
12353
|
-
const range = (_documentDataModel$ge = documentDataModel.getSelfOrHeaderFooterModel(segmentId).getBody()) === null || _documentDataModel$ge === void 0 || (_documentDataModel$ge = _documentDataModel$ge.customRanges) === null || _documentDataModel$ge === void 0 ? void 0 : _documentDataModel$ge.find((r) => r.rangeId === rangeId);
|
|
12501
|
+
const range = (_documentDataModel$ge = documentDataModel.getSelfOrHeaderFooterModel(segmentId)) === null || _documentDataModel$ge === void 0 || (_documentDataModel$ge = _documentDataModel$ge.getBody()) === null || _documentDataModel$ge === void 0 || (_documentDataModel$ge = _documentDataModel$ge.customRanges) === null || _documentDataModel$ge === void 0 ? void 0 : _documentDataModel$ge.find((r) => r.rangeId === rangeId);
|
|
12354
12502
|
if (!range) return false;
|
|
12355
12503
|
const { startIndex, endIndex } = range;
|
|
12356
12504
|
const textX = new TextX();
|
|
@@ -12638,15 +12786,15 @@ function getCustomBlockIdsInSelections(body, selections) {
|
|
|
12638
12786
|
return customBlockIds;
|
|
12639
12787
|
}
|
|
12640
12788
|
const addDrawing = (param) => {
|
|
12641
|
-
var _documentDataModel$ge, _documentDataModel$ge2;
|
|
12789
|
+
var _documentDataModel$ge, _documentDataModel$ge2, _documentDataModel$ge3;
|
|
12642
12790
|
const { selection, documentDataModel, drawings } = param;
|
|
12643
12791
|
const { collapsed, startOffset, segmentId } = selection;
|
|
12644
12792
|
const textX = new TextX();
|
|
12645
12793
|
const jsonX = JSONX.getInstance();
|
|
12646
12794
|
const rawActions = [];
|
|
12647
|
-
const body = documentDataModel.getSelfOrHeaderFooterModel(segmentId).getBody();
|
|
12795
|
+
const body = (_documentDataModel$ge = documentDataModel.getSelfOrHeaderFooterModel(segmentId)) === null || _documentDataModel$ge === void 0 ? void 0 : _documentDataModel$ge.getBody();
|
|
12648
12796
|
if (!body) return false;
|
|
12649
|
-
const drawingOrderLength = (_documentDataModel$
|
|
12797
|
+
const drawingOrderLength = (_documentDataModel$ge2 = (_documentDataModel$ge3 = documentDataModel.getSnapshot().drawingsOrder) === null || _documentDataModel$ge3 === void 0 ? void 0 : _documentDataModel$ge3.length) !== null && _documentDataModel$ge2 !== void 0 ? _documentDataModel$ge2 : 0;
|
|
12650
12798
|
let removeDrawingLen = 0;
|
|
12651
12799
|
const insertOffset = collapsed ? normalizeDrawingInsertOffset(body, startOffset !== null && startOffset !== void 0 ? startOffset : 0) : startOffset !== null && startOffset !== void 0 ? startOffset : 0;
|
|
12652
12800
|
if (collapsed) {
|
|
@@ -12655,12 +12803,12 @@ const addDrawing = (param) => {
|
|
|
12655
12803
|
len: insertOffset
|
|
12656
12804
|
});
|
|
12657
12805
|
} else {
|
|
12658
|
-
var _documentDataModel$
|
|
12806
|
+
var _documentDataModel$ge4, _documentDataModel$ge5;
|
|
12659
12807
|
const dos = deleteSelectionTextX([selection], body, 0, null, false);
|
|
12660
12808
|
textX.push(...dos);
|
|
12661
12809
|
const removedCustomBlockIds = getCustomBlockIdsInSelections(body, [selection]);
|
|
12662
|
-
const drawings = (_documentDataModel$
|
|
12663
|
-
const drawingOrder = (_documentDataModel$
|
|
12810
|
+
const drawings = (_documentDataModel$ge4 = documentDataModel.getDrawings()) !== null && _documentDataModel$ge4 !== void 0 ? _documentDataModel$ge4 : {};
|
|
12811
|
+
const drawingOrder = (_documentDataModel$ge5 = documentDataModel.getDrawingsOrder()) !== null && _documentDataModel$ge5 !== void 0 ? _documentDataModel$ge5 : [];
|
|
12664
12812
|
const sortedRemovedCustomBlockIds = removedCustomBlockIds.sort((a, b) => {
|
|
12665
12813
|
if (drawingOrder.indexOf(a) > drawingOrder.indexOf(b)) return -1;
|
|
12666
12814
|
else if (drawingOrder.indexOf(a) < drawingOrder.indexOf(b)) return 1;
|
|
@@ -12796,7 +12944,7 @@ const switchParagraphBullet = (params) => {
|
|
|
12796
12944
|
var _docDataModel$getSelf, _docDataModel$getSelf2;
|
|
12797
12945
|
const { paragraphs: currentParagraphs, segmentId, document: docDataModel } = params;
|
|
12798
12946
|
let listType = params.listType;
|
|
12799
|
-
const paragraphs = (_docDataModel$getSelf = (_docDataModel$getSelf2 = docDataModel.getSelfOrHeaderFooterModel(segmentId).getBody()) === null || _docDataModel$getSelf2 === void 0 ? void 0 : _docDataModel$getSelf2.paragraphs) !== null && _docDataModel$getSelf !== void 0 ? _docDataModel$getSelf : [];
|
|
12947
|
+
const paragraphs = (_docDataModel$getSelf = (_docDataModel$getSelf2 = docDataModel.getSelfOrHeaderFooterModel(segmentId)) === null || _docDataModel$getSelf2 === void 0 || (_docDataModel$getSelf2 = _docDataModel$getSelf2.getBody()) === null || _docDataModel$getSelf2 === void 0 ? void 0 : _docDataModel$getSelf2.paragraphs) !== null && _docDataModel$getSelf !== void 0 ? _docDataModel$getSelf : [];
|
|
12800
12948
|
const isAlreadyList = currentParagraphs.every((paragraph) => {
|
|
12801
12949
|
var _paragraph$bullet;
|
|
12802
12950
|
return ((_paragraph$bullet = paragraph.bullet) === null || _paragraph$bullet === void 0 ? void 0 : _paragraph$bullet.listType.indexOf(listType)) === 0;
|
|
@@ -12854,7 +13002,7 @@ const switchParagraphBullet = (params) => {
|
|
|
12854
13002
|
const toggleChecklistParagraph = (params) => {
|
|
12855
13003
|
var _docDataModel$getSelf3;
|
|
12856
13004
|
const { paragraphIndex, segmentId, document: docDataModel } = params;
|
|
12857
|
-
const paragraphs = (_docDataModel$getSelf3 = docDataModel.getSelfOrHeaderFooterModel(segmentId).getBody()) === null || _docDataModel$getSelf3 === void 0 ? void 0 : _docDataModel$getSelf3.paragraphs;
|
|
13005
|
+
const paragraphs = (_docDataModel$getSelf3 = docDataModel.getSelfOrHeaderFooterModel(segmentId)) === null || _docDataModel$getSelf3 === void 0 || (_docDataModel$getSelf3 = _docDataModel$getSelf3.getBody()) === null || _docDataModel$getSelf3 === void 0 ? void 0 : _docDataModel$getSelf3.paragraphs;
|
|
12858
13006
|
if (paragraphs == null) return false;
|
|
12859
13007
|
const currentParagraph = paragraphs.find((p) => p.startIndex === paragraphIndex);
|
|
12860
13008
|
if (!(currentParagraph === null || currentParagraph === void 0 ? void 0 : currentParagraph.bullet) || currentParagraph.bullet.listType.indexOf("CHECK_LIST") === -1) return false;
|
|
@@ -12889,9 +13037,9 @@ const toggleChecklistParagraph = (params) => {
|
|
|
12889
13037
|
};
|
|
12890
13038
|
const setParagraphBullet = (params) => {
|
|
12891
13039
|
var _docDataModel$getSelf4;
|
|
12892
|
-
const { paragraphs: currentParagraphs, listType, segmentId, document: docDataModel } = params;
|
|
12893
|
-
if (((_docDataModel$getSelf4 = docDataModel.getSelfOrHeaderFooterModel(segmentId).getBody()) === null || _docDataModel$getSelf4 === void 0 ? void 0 : _docDataModel$getSelf4.paragraphs) == null) return false;
|
|
12894
|
-
const listId = generateRandomId(6);
|
|
13040
|
+
const { paragraphs: currentParagraphs, listType, listId: explicitListId, segmentId, document: docDataModel } = params;
|
|
13041
|
+
if (((_docDataModel$getSelf4 = docDataModel.getSelfOrHeaderFooterModel(segmentId)) === null || _docDataModel$getSelf4 === void 0 || (_docDataModel$getSelf4 = _docDataModel$getSelf4.getBody()) === null || _docDataModel$getSelf4 === void 0 ? void 0 : _docDataModel$getSelf4.paragraphs) == null) return false;
|
|
13042
|
+
const listId = explicitListId !== null && explicitListId !== void 0 ? explicitListId : generateRandomId(6);
|
|
12895
13043
|
const memoryCursor = new MemoryCursor();
|
|
12896
13044
|
memoryCursor.reset();
|
|
12897
13045
|
const textX = new TextX();
|
|
@@ -12979,7 +13127,7 @@ const setParagraphStyle = (params) => {
|
|
|
12979
13127
|
var _segment$getBody$para, _segment$getBody, _segment$getBody$data, _segment$getBody2;
|
|
12980
13128
|
const { textRanges, segmentId, document: docDataModel, style, paragraphTextRun, cursor, deleteLen, textX: _textX } = params;
|
|
12981
13129
|
const segment = docDataModel.getSelfOrHeaderFooterModel(segmentId);
|
|
12982
|
-
const currentParagraphs = getParagraphsInRanges(textRanges, (_segment$getBody$para = (_segment$getBody = segment.getBody()) === null || _segment$getBody === void 0 ? void 0 : _segment$getBody.paragraphs) !== null && _segment$getBody$para !== void 0 ? _segment$getBody$para : [], (_segment$getBody$data = (_segment$getBody2 = segment.getBody()) === null || _segment$getBody2 === void 0 ? void 0 : _segment$getBody2.dataStream) !== null && _segment$getBody$data !== void 0 ? _segment$getBody$data : "");
|
|
13130
|
+
const currentParagraphs = getParagraphsInRanges(textRanges, (_segment$getBody$para = segment === null || segment === void 0 || (_segment$getBody = segment.getBody()) === null || _segment$getBody === void 0 ? void 0 : _segment$getBody.paragraphs) !== null && _segment$getBody$para !== void 0 ? _segment$getBody$para : [], (_segment$getBody$data = segment === null || segment === void 0 || (_segment$getBody2 = segment.getBody()) === null || _segment$getBody2 === void 0 ? void 0 : _segment$getBody2.dataStream) !== null && _segment$getBody$data !== void 0 ? _segment$getBody$data : "");
|
|
12983
13131
|
const memoryCursor = new MemoryCursor();
|
|
12984
13132
|
if (cursor) memoryCursor.moveCursorTo(cursor);
|
|
12985
13133
|
const textX = _textX !== null && _textX !== void 0 ? _textX : new TextX();
|
|
@@ -15567,7 +15715,7 @@ const IURLImageService = createIdentifier("core.url-image.service");
|
|
|
15567
15715
|
//#endregion
|
|
15568
15716
|
//#region package.json
|
|
15569
15717
|
var name = "@univerjs/core";
|
|
15570
|
-
var version = "1.0.0-alpha.
|
|
15718
|
+
var version = "1.0.0-alpha.2";
|
|
15571
15719
|
|
|
15572
15720
|
//#endregion
|
|
15573
15721
|
//#region src/sheets/empty-snapshot.ts
|
|
@@ -18194,12 +18342,6 @@ let UniverInstanceService = class UniverInstanceService extends Disposable {
|
|
|
18194
18342
|
if (type && (unit === null || unit === void 0 ? void 0 : unit.type) !== type) return null;
|
|
18195
18343
|
return unit;
|
|
18196
18344
|
}
|
|
18197
|
-
getCurrentUniverDocInstance() {
|
|
18198
|
-
return this.getCurrentUnitOfType(UniverInstanceType.UNIVER_DOC);
|
|
18199
|
-
}
|
|
18200
|
-
getUniverDocInstance(unitId) {
|
|
18201
|
-
return this.getUnit(unitId, UniverInstanceType.UNIVER_DOC);
|
|
18202
|
-
}
|
|
18203
18345
|
getUniverSheetInstance(unitId) {
|
|
18204
18346
|
return this.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
18205
18347
|
}
|
|
@@ -20890,4 +21032,4 @@ function createUniverInjector(parentInjector, override) {
|
|
|
20890
21032
|
installShims();
|
|
20891
21033
|
|
|
20892
21034
|
//#endregion
|
|
20893
|
-
export { ABCToNumber, AUTO_HEIGHT_FOR_MERGED_CELLS, AbsoluteRefType, ActionIterator, AlignTypeH, AlignTypeV, ArrangeTypeEnum, AsyncInterceptorManager, AsyncLock, AuthzIoLocalService, AutoFillSeries, BORDER_KEYS, BORDER_STYLE_KEYS, BaseDataModel, BaselineOffset, BlockType, BooleanNumber, BorderStyleTypes, BorderType, BuildTextUtils, BulletAlignment, COLORS, COLOR_STYLE_KEYS, COMMAND_LOG_EXECUTION_CONFIG_KEY, CanceledError, CellModeEnum, CellValueType, ColorKit, ColorType, ColumnSeparatorType, CommandService, CommandType, CommonHideTypes, ConfigService, ContextService, CopyPasteType, CustomCommandExecutionError, CustomDecorationType, CustomRangeType, DEFAULT_CELL, DEFAULT_DOC, DEFAULT_DOCUMENT_PARAGRAPH_LINE_SPACING, DEFAULT_DOCUMENT_PARAGRAPH_SPACE_ABOVE, DEFAULT_DOCUMENT_PARAGRAPH_SPACE_BELOW, DEFAULT_DOCUMENT_SUB_COMPONENT_ID, DEFAULT_EMPTY_DOCUMENT_VALUE, DEFAULT_NUMBER_FORMAT, DEFAULT_RANGE, DEFAULT_RANGE_ARRAY, DEFAULT_SELECTION, DEFAULT_STYLES, DEFAULT_TEXT_FORMAT, DEFAULT_TEXT_FORMAT_EXCEL, DEFAULT_WORKSHEET_COLUMN_COUNT, DEFAULT_WORKSHEET_COLUMN_COUNT_KEY, DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT, DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY, DEFAULT_WORKSHEET_COLUMN_WIDTH, DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY, DEFAULT_WORKSHEET_ROW_COUNT, DEFAULT_WORKSHEET_ROW_COUNT_KEY, DEFAULT_WORKSHEET_ROW_HEIGHT, DEFAULT_WORKSHEET_ROW_HEIGHT_KEY, DEFAULT_WORKSHEET_ROW_TITLE_WIDTH, DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY, DOCS_COMMENT_EDITOR_UNIT_ID_KEY, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, DOC_DRAWING_PRINTING_COMPONENT_KEY, DOC_RANGE_TYPE, DashStyleType, DataStreamTreeNodeType, DataStreamTreeTokenType, DataValidationErrorStyle, DataValidationImeMode, DataValidationOperator, DataValidationRenderMode, DataValidationStatus, DataValidationType, DeleteDirection, DependentOn, DesktopLogService, DeveloperMetadataVisibility, Dimension, Direction, Disposable, DisposableCollection, DocStyleType, DocumentBlockRangeType, DocumentDataModel, DocumentFlavor, DrawingTypeEnum, EDITOR_ACTIVATED, EXTENSION_NAMES, ErrorService, EventState, EventSubject, FOCUSING_COMMENT_EDITOR, FOCUSING_COMMON_DRAWINGS, FOCUSING_DOC, FOCUSING_EDITOR_BUT_HIDDEN, FOCUSING_EDITOR_INPUT_FORMULA, FOCUSING_EDITOR_STANDALONE, FOCUSING_FX_BAR_EDITOR, FOCUSING_PANEL_EDITOR, FOCUSING_SHAPE_TEXT_EDITOR, FOCUSING_SHEET, FOCUSING_SLIDE, FOCUSING_UNIT, FOCUSING_UNIVER_EDITOR, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE, FORMULA_EDITOR_ACTIVATED, FollowNumberWithType, FontItalic, FontStyleType, FontWeight, GridType, HorizontalAlign, IAuthzIoService, ICommandService, IConfigService, IConfirmService, IContextService, IImageIoService, ILocalStorageService, ILogService, IMentionIOService, IPermissionService, IResourceLoaderService, IResourceManagerService, IS_ROW_STYLE_PRECEDE_COLUMN_STYLE, IURLImageService, IUndoRedoService, IUniverInstanceService, ImageCacheMap, ImageSourceType, ImageUploadStatusType, Inject, InjectSelf, Injector, InterceptorEffectEnum, InterceptorManager, InterpolationPointType, json1 as JSON1, JSONX, LRUHelper, LRUMap, LifecycleService, LifecycleStages, LifecycleUnreachableError, ListGlyphType, LocalUndoRedoService, LocaleService, LocaleType, LogLevel, LookUp, MAX_COLUMN_COUNT, MAX_ROW_COUNT, MODERN_DOCUMENT_DEFAULT_MARGIN, MODERN_DOCUMENT_WIDTH, MOVE_BUFFER_VALUE, Many, MemoryCursor, MentionIOLocalService, MentionType, ModernDocumentWidthMode, NAMED_STYLE_MAP, NAMED_STYLE_SPACE_MAP, NamedStyleType, NilCommand, NumberUnitType, ObjectMatrix, ObjectRelativeFromH, ObjectRelativeFromV, Optional, PADDING_KEYS, PAGE_SIZE, PAPER_TYPES, PARAGRAPH_ID_PREFIX, PRESET_LIST_TYPE, PRINT_CHART_COMPONENT_KEY, PageOrientType, PaperType, ParagraphElementType, ParagraphStyleBuilder, ParagraphStyleValue, PermissionService, PermissionStatus, Plugin, PluginService, PositionedObjectLayoutType, PresetListType, ProtectionType, Quantity, QuickListType, QuickListTypeMap, RANGE_DIRECTION, RANGE_TYPE, RBush, RCDisposable, RGBA_PAREN, RGB_PAREN, ROTATE_BUFFER_VALUE, RTree, Range, Rectangle, RediError, RedoCommand, RedoCommandId, RefAlias, Registry, RegistryAsMap, RelativeDate, ResourceManagerService, RichTextBuilder, RichTextValue, RxDisposable, SHEET_EDITOR_UNITS, STYLE_KEYS, SectionType, Self, SheetSkeleton, SheetTypes, SheetViewModel, Skeleton, SkipSelf, SliceBodyType, SpacingRule, Styles, TEXT_DECORATION_KEYS, TEXT_ROTATION_KEYS, THEME_COLORS, TabStopAlignment, TableAlignmentType, TableLayoutType, TableRowHeightRule, TableSizeType, TableTextWrapType, TestConfirmService, TextDecoration, TextDecorationBuilder, TextDirection, TextDirectionType, TextStyleBuilder, TextStyleValue, TextX, TextXActionType, ThemeColorType, ThemeColors, ThemeService, Tools, UndoCommand, UndoCommandId, UnitModel, Univer, UniverInstanceService, UniverInstanceType, UpdateDocsAttributeType, UserManagerService, VerticalAlign, VerticalAlignmentType, WithNew, Workbook, Worksheet, WrapStrategy, WrapTextType, addLinkToDocumentModel, afterInitApply, afterTime, awaitTime, binSearchFirstGreaterThanTarget, binarySearchArray, bufferDebounceTime, cellToRange, characterSpacingControlType, checkForSubstrings, checkIfMove, checkParagraphHasBullet, checkParagraphHasIndent, checkParagraphHasIndentByStyle, cloneBodyWithFreshParagraphIds, cloneCellData, cloneCellDataMatrix, cloneCellDataWithSpanAndDisplay, cloneParagraphWithId, cloneValue, cloneWorksheetData, codeToBlob, columnLabelToNumber, composeBody, composeInterceptors, composeStyles, concatMatrixArray, convertCellToRange, convertObservableToBehaviorSubject, covertCellValue, covertCellValues, createAsyncInterceptorKey, createDefaultBaseTableSnapshot, createDefaultUser, createDocumentModelWithStyle, createIdentifier, createInterceptorKey, createInternalEditorID, createParagraphId, createREGEXFromWildChar, createRandomId, createRowColIter, createSheetGapTestConfig, currencySymbols, customNameCharacterCheck, dateKit, debounce, dedupe, dedupeBy, deepCompare, delayAnimationFrame, deleteContent, escapeRegExp, extractPureTextFromCell, forwardRef, fromCallback, fromEventSubject, generateIntervalsByPoints, generateRandomId, get, getArrayLength, getBodySlice, getBorderStyleType, getCellCoordByIndexSimple, getCellInfoInMergeData, getCellValueType, getCellWithCoordByIndexCore, getColorStyle, getCustomBlockSlice, getCustomDecorationSlice, getCustomRangeSlice, getDisplayValueFromCell, getDocsUpdateBody, getEmptyBaseSnapshot, getEmptyCell, getIntersectRange, getNumfmtParseValueFilter, getOriginCellValue, getParagraphsSlice, getPlainText, getReverseDirection, getRichTextEditPath, getSectionBreakSlice, getTableSlice, getTextRunSlice, getTransformOffsetX, getTransformOffsetY, getWorksheetUID, groupBy, handleStyleToString, hashAlgorithm, horizontalLineSegmentsSubtraction, insertMatrixArray, insertTextToContent, invertColorByHSL, invertColorByMatrix, isAsyncDependencyItem, isAsyncHook, isBlackColor, isBooleanString, isCellCoverable, isCellV, isClassDependencyItem, isCommentEditorID, isCtor, isDefaultFormat, isDisposable, isEmptyCell, isFactoryDependencyItem, isFormulaId, isFormulaString, isICellData, isInternalEditorID, isNodeEnv, isNotNullOrUndefined, isNullCell, isNumeric, isPatternEqualWithoutDecimal, isRangesEqual, isRealNum, isSafeNumeric, isSafeUrl, isSameStyleTextRun, isTextFormat, isUnitRangesEqual, isValidRange, isValueDependencyItem, isWhiteColor, makeArray, makeCellRangeToRangeData, makeCellToSelection, makeCustomRangeStream, mapObjectMatrix, merge, mergeIntervals, mergeLocales, mergeOverrideWithDependencies, mergeSets, mergeWith, mergeWorksheetSnapshotWithDefault, mixinClass, moveMatrixArray, moveRangeByOffset, nameCharacterCheck, noop, normalizeBody, normalizeTextRuns, normalizeUrl, numberToABC, numberToListABC, numfmt, queryObjectMatrix, registerDependencies, remove, repeatStringNumTimes, replaceInDocumentBody, requestImmediateMacroTask, resolveWithBasePath, rotate, searchArray, searchInOrderedArray, selectionToArray, sequence, sequenceAsync, sequenceExecute, sequenceExecuteAsync, set, setDependencies, shallowEqual, skipParseTagNames, sliceMatrixArray, sortRules, sortRulesByDesc, sortRulesFactory, spliceArray, splitIntoGrid, takeAfter, throttle, toDisposable, touchDependencies, updateAttributeByDelete, updateAttributeByInsert, willLoseNumericPrecision };
|
|
21035
|
+
export { ABCToNumber, AUTO_HEIGHT_FOR_MERGED_CELLS, AbsoluteRefType, ActionIterator, AlignTypeH, AlignTypeV, ArrangeTypeEnum, AsyncInterceptorManager, AsyncLock, AuthzIoLocalService, AutoFillSeries, BORDER_KEYS, BORDER_STYLE_KEYS, BaseDataModel, BaselineOffset, BlockType, BooleanNumber, BorderStyleTypes, BorderType, BuildTextUtils, BulletAlignment, COLORS, COLOR_STYLE_KEYS, COMMAND_LOG_EXECUTION_CONFIG_KEY, CanceledError, CellModeEnum, CellValueType, ColorKit, ColorType, ColumnLayoutType, ColumnResponsiveType, ColumnSeparatorType, CommandService, CommandType, CommonHideTypes, ConfigService, ContextService, CopyPasteType, CustomCommandExecutionError, CustomDecorationType, CustomRangeType, DEFAULT_CELL, DEFAULT_DOC, DEFAULT_DOCUMENT_PARAGRAPH_LINE_SPACING, DEFAULT_DOCUMENT_PARAGRAPH_SPACE_ABOVE, DEFAULT_DOCUMENT_PARAGRAPH_SPACE_BELOW, DEFAULT_DOCUMENT_SUB_COMPONENT_ID, DEFAULT_EMPTY_DOCUMENT_VALUE, DEFAULT_NUMBER_FORMAT, DEFAULT_RANGE, DEFAULT_RANGE_ARRAY, DEFAULT_SELECTION, DEFAULT_STYLES, DEFAULT_TEXT_FORMAT, DEFAULT_TEXT_FORMAT_EXCEL, DEFAULT_WORKSHEET_COLUMN_COUNT, DEFAULT_WORKSHEET_COLUMN_COUNT_KEY, DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT, DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY, DEFAULT_WORKSHEET_COLUMN_WIDTH, DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY, DEFAULT_WORKSHEET_ROW_COUNT, DEFAULT_WORKSHEET_ROW_COUNT_KEY, DEFAULT_WORKSHEET_ROW_HEIGHT, DEFAULT_WORKSHEET_ROW_HEIGHT_KEY, DEFAULT_WORKSHEET_ROW_TITLE_WIDTH, DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY, DOCS_COMMENT_EDITOR_UNIT_ID_KEY, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, DOC_DRAWING_PRINTING_COMPONENT_KEY, DOC_RANGE_TYPE, DashStyleType, DataStreamTreeNodeType, DataStreamTreeTokenType, DataValidationErrorStyle, DataValidationImeMode, DataValidationOperator, DataValidationRenderMode, DataValidationStatus, DataValidationType, DeleteDirection, DependentOn, DesktopLogService, DeveloperMetadataVisibility, Dimension, Direction, Disposable, DisposableCollection, DocStyleType, DocumentBlockRangeType, DocumentBlockType, DocumentDataModel, DocumentFlavor, DrawingTypeEnum, EDITOR_ACTIVATED, EXTENSION_NAMES, ErrorService, EventState, EventSubject, FOCUSING_COMMENT_EDITOR, FOCUSING_COMMON_DRAWINGS, FOCUSING_DOC, FOCUSING_EDITOR_BUT_HIDDEN, FOCUSING_EDITOR_INPUT_FORMULA, FOCUSING_EDITOR_STANDALONE, FOCUSING_FX_BAR_EDITOR, FOCUSING_PANEL_EDITOR, FOCUSING_SHAPE_TEXT_EDITOR, FOCUSING_SHEET, FOCUSING_SLIDE, FOCUSING_UNIT, FOCUSING_UNIVER_EDITOR, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE, FORMULA_EDITOR_ACTIVATED, FollowNumberWithType, FontItalic, FontStyleType, FontWeight, GridType, HorizontalAlign, IAuthzIoService, ICommandService, IConfigService, IConfirmService, IContextService, IImageIoService, ILocalStorageService, ILogService, IMentionIOService, IPermissionService, IResourceLoaderService, IResourceManagerService, IS_ROW_STYLE_PRECEDE_COLUMN_STYLE, IURLImageService, IUndoRedoService, IUniverInstanceService, ImageCacheMap, ImageSourceType, ImageUploadStatusType, Inject, InjectSelf, Injector, InterceptorEffectEnum, InterceptorManager, InterpolationPointType, json1 as JSON1, JSONX, LRUHelper, LRUMap, LifecycleService, LifecycleStages, LifecycleUnreachableError, ListGlyphType, LocalUndoRedoService, LocaleService, LocaleType, LogLevel, LookUp, MAX_COLUMN_COUNT, MAX_ROW_COUNT, MODERN_DOCUMENT_DEFAULT_MARGIN, MODERN_DOCUMENT_WIDTH, MOVE_BUFFER_VALUE, Many, MemoryCursor, MentionIOLocalService, MentionType, ModernDocumentWidthMode, NAMED_STYLE_MAP, NAMED_STYLE_SPACE_MAP, NamedStyleType, NilCommand, NumberUnitType, ObjectMatrix, ObjectRelativeFromH, ObjectRelativeFromV, Optional, PADDING_KEYS, PAGE_SIZE, PAPER_TYPES, PARAGRAPH_ID_PREFIX, PRESET_LIST_TYPE, PRINT_CHART_COMPONENT_KEY, PageOrientType, PaperType, ParagraphElementType, ParagraphStyleBuilder, ParagraphStyleValue, PermissionService, PermissionStatus, Plugin, PluginService, PositionedObjectLayoutType, PresetListType, ProtectionType, Quantity, QuickListType, QuickListTypeMap, RANGE_DIRECTION, RANGE_TYPE, RBush, RCDisposable, RESTORE_INSERTED_PARAGRAPH_IDS, RGBA_PAREN, RGB_PAREN, ROTATE_BUFFER_VALUE, RTree, Range, Rectangle, RediError, RedoCommand, RedoCommandId, RefAlias, Registry, RegistryAsMap, RelativeDate, ResourceManagerService, RichTextBuilder, RichTextValue, RxDisposable, SHEET_EDITOR_UNITS, STYLE_KEYS, SectionType, Self, SheetSkeleton, SheetTypes, SheetViewModel, Skeleton, SkipSelf, SliceBodyType, SpacingRule, Styles, TEXT_DECORATION_KEYS, TEXT_ROTATION_KEYS, THEME_COLORS, TabStopAlignment, TableAlignmentType, TableLayoutType, TableRowHeightRule, TableSizeType, TableTextWrapType, TestConfirmService, TextDecoration, TextDecorationBuilder, TextDirection, TextDirectionType, TextStyleBuilder, TextStyleValue, TextX, TextXActionType, ThemeColorType, ThemeColors, ThemeService, Tools, UndoCommand, UndoCommandId, UnitModel, Univer, UniverInstanceService, UniverInstanceType, UpdateDocsAttributeType, UserManagerService, VerticalAlign, VerticalAlignmentType, WithNew, Workbook, Worksheet, WrapStrategy, WrapTextType, addLinkToDocumentModel, afterInitApply, afterTime, awaitTime, binSearchFirstGreaterThanTarget, binarySearchArray, bufferDebounceTime, cellToRange, characterSpacingControlType, checkForSubstrings, checkIfMove, checkParagraphHasBullet, checkParagraphHasIndent, checkParagraphHasIndentByStyle, cloneBodyWithFreshParagraphIds, cloneCellData, cloneCellDataMatrix, cloneCellDataWithSpanAndDisplay, cloneParagraphWithId, cloneValue, cloneWorksheetData, codeToBlob, columnLabelToNumber, composeBody, composeInterceptors, composeStyles, concatMatrixArray, convertCellToRange, convertObservableToBehaviorSubject, covertCellValue, covertCellValues, createAsyncInterceptorKey, createDefaultBaseTableSnapshot, createDefaultUser, createDocumentModelWithStyle, createIdentifier, createInterceptorKey, createInternalEditorID, createParagraphId, createREGEXFromWildChar, createRandomId, createRowColIter, createSheetGapTestConfig, currencySymbols, customNameCharacterCheck, dateKit, debounce, dedupe, dedupeBy, deepCompare, delayAnimationFrame, deleteContent, escapeRegExp, extractPureTextFromCell, forwardRef, fromCallback, fromEventSubject, generateIntervalsByPoints, generateRandomId, get, getArrayLength, getBodySlice, getBorderStyleType, getCellCoordByIndexSimple, getCellInfoInMergeData, getCellValueType, getCellWithCoordByIndexCore, getColorStyle, getCustomBlockSlice, getCustomDecorationSlice, getCustomRangeSlice, getDisplayValueFromCell, getDocsUpdateBody, getEmptyBaseSnapshot, getEmptyCell, getIntersectRange, getNumfmtParseValueFilter, getOriginCellValue, getParagraphsSlice, getPlainText, getReverseDirection, getRichTextEditPath, getSectionBreakSlice, getTableSlice, getTextRunSlice, getTransformOffsetX, getTransformOffsetY, getWorksheetUID, groupBy, handleStyleToString, hashAlgorithm, horizontalLineSegmentsSubtraction, insertMatrixArray, insertTextToContent, invertColorByHSL, invertColorByMatrix, isAsyncDependencyItem, isAsyncHook, isBlackColor, isBooleanString, isCellCoverable, isCellV, isClassDependencyItem, isCommentEditorID, isCtor, isDefaultFormat, isDisposable, isEmptyCell, isFactoryDependencyItem, isFormulaId, isFormulaString, isICellData, isInternalEditorID, isNodeEnv, isNotNullOrUndefined, isNullCell, isNumeric, isPatternEqualWithoutDecimal, isRangesEqual, isRealNum, isSafeNumeric, isSafeUrl, isSameStyleTextRun, isTextFormat, isUnitRangesEqual, isValidRange, isValueDependencyItem, isWhiteColor, makeArray, makeCellRangeToRangeData, makeCellToSelection, makeCustomRangeStream, mapObjectMatrix, merge, mergeIntervals, mergeLocales, mergeOverrideWithDependencies, mergeSets, mergeWith, mergeWorksheetSnapshotWithDefault, mixinClass, moveMatrixArray, moveRangeByOffset, nameCharacterCheck, noop, normalizeBody, normalizeTextRuns, normalizeUrl, numberToABC, numberToListABC, numfmt, queryObjectMatrix, registerDependencies, remove, repeatStringNumTimes, replaceInDocumentBody, requestImmediateMacroTask, resolveWithBasePath, rotate, searchArray, searchInOrderedArray, selectionToArray, sequence, sequenceAsync, sequenceExecute, sequenceExecuteAsync, set, setDependencies, shallowEqual, skipParseTagNames, sliceMatrixArray, sortRules, sortRulesByDesc, sortRulesFactory, spliceArray, splitIntoGrid, takeAfter, throttle, toDisposable, touchDependencies, updateAttributeByDelete, updateAttributeByInsert, willLoseNumericPrecision };
|
|
@@ -74,7 +74,7 @@ export declare class DocumentDataModel extends DocumentDataModelSimple {
|
|
|
74
74
|
getCustomDecorations(): import("../..").ICustomDecoration[] | undefined;
|
|
75
75
|
getSettings(): import("../..").IDocumentSettings | undefined;
|
|
76
76
|
reset(snapshot: Partial<IDocumentData>): void;
|
|
77
|
-
getSelfOrHeaderFooterModel(segmentId?: string): DocumentDataModel;
|
|
77
|
+
getSelfOrHeaderFooterModel(segmentId?: string): DocumentDataModel | null;
|
|
78
78
|
getUnitId(): string;
|
|
79
79
|
apply(actions: JSONXActions): IDocumentData | undefined;
|
|
80
80
|
sliceBody(startOffset: number, endOffset: number, type?: SliceBodyType): Nullable<IDocumentBody>;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { ICustomBlock, ICustomDecoration, ICustomRange, ICustomTable, IDocumentBlockRange, IDocumentBody, IParagraph, ISectionBreak, ITextRun } from '../../../../types/interfaces';
|
|
16
|
+
import type { ICustomBlock, ICustomColumnGroup, ICustomDecoration, ICustomRange, ICustomTable, IDocumentBlockRange, IDocumentBody, IParagraph, ISectionBreak, ITextRun } from '../../../../types/interfaces';
|
|
17
17
|
export declare const RESTORE_INSERTED_PARAGRAPH_IDS = "__textXRestoreParagraphIds";
|
|
18
18
|
export declare function normalizeTextRuns(textRuns: ITextRun[], reserveEmptyTextRun?: boolean): ITextRun[];
|
|
19
19
|
/**
|
|
@@ -42,6 +42,7 @@ export declare function normalizeInsertedParagraphIdsForDocument(paragraphs: IPa
|
|
|
42
42
|
export declare function insertSectionBreaks(body: IDocumentBody, insertBody: IDocumentBody, textLength: number, currentIndex: number): void;
|
|
43
43
|
export declare function insertCustomBlocks(body: IDocumentBody, insertBody: IDocumentBody, textLength: number, currentIndex: number): void;
|
|
44
44
|
export declare function insertTables(body: IDocumentBody, insertBody: IDocumentBody, textLength: number, currentIndex: number): void;
|
|
45
|
+
export declare function insertColumnGroups(body: IDocumentBody, insertBody: IDocumentBody, textLength: number, currentIndex: number): void;
|
|
45
46
|
export declare function insertBlockRanges(body: IDocumentBody, insertBody: IDocumentBody, textLength: number, currentIndex: number): void;
|
|
46
47
|
export declare function sliceByParagraph(body: IDocumentBody): IDocumentBody[];
|
|
47
48
|
export declare function mergeContinuousRanges(ranges: ICustomRange[]): ICustomRange[];
|
|
@@ -56,6 +57,7 @@ export declare function deleteParagraphs(body: IDocumentBody, textLength: number
|
|
|
56
57
|
export declare function deleteSectionBreaks(body: IDocumentBody, textLength: number, currentIndex: number): ISectionBreak[];
|
|
57
58
|
export declare function deleteCustomBlocks(body: IDocumentBody, textLength: number, currentIndex: number): ICustomBlock[];
|
|
58
59
|
export declare function deleteTables(body: IDocumentBody, textLength: number, currentIndex: number): ICustomTable[];
|
|
60
|
+
export declare function deleteColumnGroups(body: IDocumentBody, textLength: number, currentIndex: number): ICustomColumnGroup[];
|
|
59
61
|
export declare function deleteCustomRanges(body: IDocumentBody, textLength: number, currentIndex: number): ICustomRange<Record<string, any>>[];
|
|
60
62
|
export declare function deleteBlockRanges(body: IDocumentBody, textLength: number, currentIndex: number): IDocumentBlockRange[];
|
|
61
63
|
export declare function deleteCustomDecorations(body: IDocumentBody, textLength: number, currentIndex: number, needOffset?: boolean): ICustomDecoration[];
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { ICustomDecoration, IDocumentBlockRange, IDocumentBody, ITextRun } from '../../../types/interfaces/i-document-data';
|
|
16
|
+
import type { ICustomColumnGroup, ICustomDecoration, IDocumentBlockRange, IDocumentBody, ITextRun } from '../../../types/interfaces/i-document-data';
|
|
17
17
|
import type { DocumentDataModel } from '../../data-model';
|
|
18
18
|
import type { IRetainAction } from './action-types';
|
|
19
19
|
import { UpdateDocsAttributeType } from '../../../shared/command-enum';
|
|
@@ -28,6 +28,7 @@ export declare function getTableSlice(body: IDocumentBody, startOffset: number,
|
|
|
28
28
|
tableId: string;
|
|
29
29
|
}[];
|
|
30
30
|
export declare function getBlockRangeSlice(body: IDocumentBody, startOffset: number, endOffset: number): IDocumentBlockRange[];
|
|
31
|
+
export declare function getColumnGroupSlice(body: IDocumentBody, startOffset: number, endOffset: number): ICustomColumnGroup[];
|
|
31
32
|
export declare function getParagraphsSlice(body: IDocumentBody, startOffset: number, endOffset: number, type?: SliceBodyType): {
|
|
32
33
|
startIndex: number;
|
|
33
34
|
paragraphId: string;
|
|
@@ -19,6 +19,8 @@ export declare enum DataStreamTreeNodeType {
|
|
|
19
19
|
TABLE = "TABLE",
|
|
20
20
|
TABLE_ROW = "TABLE_ROW",
|
|
21
21
|
TABLE_CELL = "TABLE_CELL",
|
|
22
|
+
COLUMN_GROUP = "COLUMN_GROUP",
|
|
23
|
+
COLUMN = "COLUMN",
|
|
22
24
|
BLOCK = "BLOCK",
|
|
23
25
|
CUSTOM_BLOCK = "CUSTOM_BLOCK"
|
|
24
26
|
}
|
|
@@ -31,6 +33,10 @@ export declare enum DataStreamTreeTokenType {
|
|
|
31
33
|
TABLE_CELL_END = "\u001D",// table cell end
|
|
32
34
|
TABLE_ROW_END = "\u000E",// table row end
|
|
33
35
|
TABLE_END = "\u000F",// table end
|
|
36
|
+
COLUMN_GROUP_START = "\u0012",// column group start
|
|
37
|
+
COLUMN_START = "\u0013",// column start
|
|
38
|
+
COLUMN_END = "\u0014",// column end
|
|
39
|
+
COLUMN_GROUP_END = "\u0015",// column group end
|
|
34
40
|
BLOCK_START = "\u0010",// block start
|
|
35
41
|
BLOCK_END = "\u0011",// block end
|
|
36
42
|
/**
|
package/lib/types/index.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export { DEFAULT_DOCUMENT_SUB_COMPONENT_ID } from './docs/data-model/subdocument
|
|
|
48
48
|
export { ActionIterator } from './docs/data-model/text-x/action-iterator';
|
|
49
49
|
export { TextXActionType } from './docs/data-model/text-x/action-types';
|
|
50
50
|
export type { IDeleteAction, IInsertAction, IRetainAction, TextXAction } from './docs/data-model/text-x/action-types';
|
|
51
|
-
export { normalizeTextRuns } from './docs/data-model/text-x/apply-utils/common';
|
|
51
|
+
export { normalizeTextRuns, RESTORE_INSERTED_PARAGRAPH_IDS } from './docs/data-model/text-x/apply-utils/common';
|
|
52
52
|
export { updateAttributeByDelete } from './docs/data-model/text-x/apply-utils/delete-apply';
|
|
53
53
|
export { updateAttributeByInsert } from './docs/data-model/text-x/apply-utils/insert-apply';
|
|
54
54
|
export { getPlainText } from './docs/data-model/text-x/build-utils/parse';
|
|
@@ -81,10 +81,6 @@ export interface IUniverInstanceService {
|
|
|
81
81
|
getUnitType(unitId: string): UniverInstanceType;
|
|
82
82
|
/** @deprecated */
|
|
83
83
|
getUniverSheetInstance(unitId: string): Nullable<Workbook>;
|
|
84
|
-
/** @deprecated */
|
|
85
|
-
getUniverDocInstance(unitId: string): Nullable<DocumentDataModel>;
|
|
86
|
-
/** @deprecated */
|
|
87
|
-
getCurrentUniverDocInstance(): Nullable<DocumentDataModel>;
|
|
88
84
|
}
|
|
89
85
|
export declare const IUniverInstanceService: import("@wendellhu/redi").IdentifierDecorator<IUniverInstanceService>;
|
|
90
86
|
export declare class UniverInstanceService extends Disposable implements IUniverInstanceService {
|
|
@@ -121,8 +117,6 @@ export declare class UniverInstanceService extends Disposable implements IUniver
|
|
|
121
117
|
readonly unitDisposed$: Observable<UnitModel<object, UniverInstanceType>>;
|
|
122
118
|
getTypeOfUnitDisposed$<T extends UnitModel<object, number>>(type: UniverInstanceType): Observable<T>;
|
|
123
119
|
getUnit<T extends UnitModel = UnitModel>(id: string, type?: UniverInstanceType): Nullable<T>;
|
|
124
|
-
getCurrentUniverDocInstance(): Nullable<DocumentDataModel>;
|
|
125
|
-
getUniverDocInstance(unitId: string): Nullable<DocumentDataModel>;
|
|
126
120
|
getUniverSheetInstance(unitId: string): Nullable<Workbook>;
|
|
127
121
|
getAllUnitsForType<T>(type: UniverInstanceType): T[];
|
|
128
122
|
changeDoc(unitId: string, doc: DocumentDataModel): void;
|