@univerjs/core 0.24.0 → 0.25.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 +15 -9
- package/lib/cjs/index.js +906 -694
- package/lib/es/facade.js +15 -9
- package/lib/es/index.js +897 -695
- package/lib/facade.js +15 -9
- package/lib/index.js +897 -695
- package/lib/types/common/url.d.ts +1 -0
- package/lib/types/docs/data-model/text-x/apply-utils/common.d.ts +3 -1
- package/lib/types/docs/data-model/text-x/utils.d.ts +3 -2
- package/lib/types/docs/data-model/types.d.ts +3 -0
- package/lib/types/facade/f-univer.d.ts +9 -3
- package/lib/types/index.d.ts +1 -1
- package/lib/types/shared/index.d.ts +1 -1
- package/lib/types/shared/numfmt.d.ts +2 -1
- package/lib/types/shared/tools.d.ts +5 -0
- package/lib/types/types/const/const.d.ts +3 -0
- package/lib/types/types/const/page-size.d.ts +7 -0
- package/lib/types/types/enum/locale-type.d.ts +8 -1
- package/lib/types/types/interfaces/i-document-data.d.ts +7 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +10 -9
- package/package.json +5 -5
- package/lib/types/shared/coder.d.ts +0 -17
package/lib/index.js
CHANGED
|
@@ -395,7 +395,7 @@ function throttle(fn, wait = 16) {
|
|
|
395
395
|
}
|
|
396
396
|
|
|
397
397
|
//#endregion
|
|
398
|
-
//#region \0@oxc-project+runtime@0.
|
|
398
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/typeof.js
|
|
399
399
|
function _typeof(o) {
|
|
400
400
|
"@babel/helpers - typeof";
|
|
401
401
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -406,7 +406,7 @@ function _typeof(o) {
|
|
|
406
406
|
}
|
|
407
407
|
|
|
408
408
|
//#endregion
|
|
409
|
-
//#region \0@oxc-project+runtime@0.
|
|
409
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPrimitive.js
|
|
410
410
|
function toPrimitive(t, r) {
|
|
411
411
|
if ("object" != _typeof(t) || !t) return t;
|
|
412
412
|
var e = t[Symbol.toPrimitive];
|
|
@@ -419,14 +419,14 @@ function toPrimitive(t, r) {
|
|
|
419
419
|
}
|
|
420
420
|
|
|
421
421
|
//#endregion
|
|
422
|
-
//#region \0@oxc-project+runtime@0.
|
|
422
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPropertyKey.js
|
|
423
423
|
function toPropertyKey(t) {
|
|
424
424
|
var i = toPrimitive(t, "string");
|
|
425
425
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
426
426
|
}
|
|
427
427
|
|
|
428
428
|
//#endregion
|
|
429
|
-
//#region \0@oxc-project+runtime@0.
|
|
429
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/defineProperty.js
|
|
430
430
|
function _defineProperty(e, r, t) {
|
|
431
431
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
432
432
|
value: t,
|
|
@@ -1353,7 +1353,7 @@ const topLevelDomainSet = new Set([
|
|
|
1353
1353
|
"zm",
|
|
1354
1354
|
"zw"
|
|
1355
1355
|
]);
|
|
1356
|
-
const re_weburl = new RegExp("^(?:(?:(?:https?|ftp):)?\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u00a1-\\uffff][a-z0-9\\u00a1-\\uffff_-]{0,62})?[a-z0-9\\u00a1-\\uffff]\\.)+(?:[a-z\\u00a1-\\uffff]{2,}\\.?))(?::\\d{2,5})?(?:[/?#]\\S*)?$", "i");
|
|
1356
|
+
const re_weburl = /* @__PURE__ */ new RegExp("^(?:(?:(?:https?|ftp):)?\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u00a1-\\uffff][a-z0-9\\u00a1-\\uffff_-]{0,62})?[a-z0-9\\u00a1-\\uffff]\\.)+(?:[a-z\\u00a1-\\uffff]{2,}\\.?))(?::\\d{2,5})?(?:[/?#]\\S*)?$", "i");
|
|
1357
1357
|
function isLegalUrl(url) {
|
|
1358
1358
|
if (!Number.isNaN(+url)) return false;
|
|
1359
1359
|
if (url.startsWith("http://localhost:3002") || url.startsWith("localhost:3002")) return true;
|
|
@@ -1381,6 +1381,20 @@ function normalizeUrl(urlStr) {
|
|
|
1381
1381
|
* @param {string} baseURL - The base URL to use for resolution.
|
|
1382
1382
|
* @returns {string} - The resolved URL.
|
|
1383
1383
|
*/
|
|
1384
|
+
function isSafeUrl(url) {
|
|
1385
|
+
if (!url || typeof url !== "string") return false;
|
|
1386
|
+
try {
|
|
1387
|
+
const base = typeof window !== "undefined" && window.location ? window.location.origin : "http://localhost";
|
|
1388
|
+
const parsed = new URL(url, base);
|
|
1389
|
+
return [
|
|
1390
|
+
"http:",
|
|
1391
|
+
"https:",
|
|
1392
|
+
"mailto:"
|
|
1393
|
+
].includes(parsed.protocol);
|
|
1394
|
+
} catch {
|
|
1395
|
+
return false;
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1384
1398
|
function resolveWithBasePath(url, baseURL) {
|
|
1385
1399
|
try {
|
|
1386
1400
|
const base = new URL(baseURL);
|
|
@@ -1485,8 +1499,12 @@ var Tools = class Tools {
|
|
|
1485
1499
|
/** @deprecated This method is deprecated, please use `import { merge } from '@univerjs/core` instead */
|
|
1486
1500
|
static deepMerge(target, ...sources) {
|
|
1487
1501
|
sources.forEach((item) => item && deepItem(item));
|
|
1502
|
+
function isDangerousKey(key) {
|
|
1503
|
+
return key === "__proto__" || key === "constructor" || key === "prototype";
|
|
1504
|
+
}
|
|
1488
1505
|
function deepArray(array, to) {
|
|
1489
1506
|
array.forEach((value, key) => {
|
|
1507
|
+
if (typeof key === "string" && isDangerousKey(key)) return;
|
|
1490
1508
|
if (Tools.isArray(value)) {
|
|
1491
1509
|
var _to$key;
|
|
1492
1510
|
const origin = (_to$key = to[key]) !== null && _to$key !== void 0 ? _to$key : [];
|
|
@@ -1506,6 +1524,7 @@ var Tools = class Tools {
|
|
|
1506
1524
|
}
|
|
1507
1525
|
function deepObject(object, to) {
|
|
1508
1526
|
Object.keys(object).forEach((key) => {
|
|
1527
|
+
if (isDangerousKey(key)) return;
|
|
1509
1528
|
const value = object[key];
|
|
1510
1529
|
if (Tools.isObject(value)) {
|
|
1511
1530
|
var _to$key3;
|
|
@@ -1526,6 +1545,7 @@ var Tools = class Tools {
|
|
|
1526
1545
|
}
|
|
1527
1546
|
function deepItem(item) {
|
|
1528
1547
|
Object.keys(item).forEach((key) => {
|
|
1548
|
+
if (isDangerousKey(key)) return;
|
|
1529
1549
|
const value = item[key];
|
|
1530
1550
|
if (Tools.isArray(value)) {
|
|
1531
1551
|
var _target$key;
|
|
@@ -1677,7 +1697,8 @@ var Tools = class Tools {
|
|
|
1677
1697
|
*/
|
|
1678
1698
|
static chatAtABC(n) {
|
|
1679
1699
|
const ord_a = "a".charCodeAt(0);
|
|
1680
|
-
|
|
1700
|
+
"z".charCodeAt(0);
|
|
1701
|
+
const len = 26;
|
|
1681
1702
|
let s = "";
|
|
1682
1703
|
while (n >= 0) {
|
|
1683
1704
|
s = String.fromCharCode(n % len + ord_a) + s;
|
|
@@ -1754,9 +1775,16 @@ const isNodeEnv = () => {
|
|
|
1754
1775
|
* @returns {RegExp} The generated regular expression
|
|
1755
1776
|
*/
|
|
1756
1777
|
function createREGEXFromWildChar(wildChar) {
|
|
1757
|
-
const regexpStr = wildChar
|
|
1778
|
+
const regexpStr = escapeRegExp(wildChar).replace(/\\\*/g, ".*").replace(/\\\?/g, ".");
|
|
1758
1779
|
return new RegExp(`^${regexpStr}$`, "i");
|
|
1759
1780
|
}
|
|
1781
|
+
/**
|
|
1782
|
+
* Escapes characters that have special meaning in a regular expression so the
|
|
1783
|
+
* returned string can be safely embedded in a RegExp pattern as literal text.
|
|
1784
|
+
*/
|
|
1785
|
+
function escapeRegExp(str) {
|
|
1786
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1787
|
+
}
|
|
1760
1788
|
|
|
1761
1789
|
//#endregion
|
|
1762
1790
|
//#region src/types/enum/auto-fill-series.ts
|
|
@@ -2081,6 +2109,7 @@ let LocaleType = /* @__PURE__ */ function(LocaleType) {
|
|
|
2081
2109
|
LocaleType["ZH_CN"] = "zhCN";
|
|
2082
2110
|
LocaleType["RU_RU"] = "ruRU";
|
|
2083
2111
|
LocaleType["ZH_TW"] = "zhTW";
|
|
2112
|
+
LocaleType["ZH_HK"] = "zhHK";
|
|
2084
2113
|
LocaleType["VI_VN"] = "viVN";
|
|
2085
2114
|
LocaleType["FA_IR"] = "faIR";
|
|
2086
2115
|
LocaleType["JA_JP"] = "jaJP";
|
|
@@ -2088,6 +2117,12 @@ let LocaleType = /* @__PURE__ */ function(LocaleType) {
|
|
|
2088
2117
|
LocaleType["ES_ES"] = "esES";
|
|
2089
2118
|
LocaleType["CA_ES"] = "caES";
|
|
2090
2119
|
LocaleType["SK_SK"] = "skSK";
|
|
2120
|
+
LocaleType["PT_BR"] = "ptBR";
|
|
2121
|
+
LocaleType["DE_DE"] = "deDE";
|
|
2122
|
+
LocaleType["IT_IT"] = "itIT";
|
|
2123
|
+
LocaleType["ID_ID"] = "idID";
|
|
2124
|
+
LocaleType["PL_PL"] = "plPL";
|
|
2125
|
+
LocaleType["AR_SA"] = "arSA";
|
|
2091
2126
|
return LocaleType;
|
|
2092
2127
|
}({});
|
|
2093
2128
|
|
|
@@ -2949,245 +2984,554 @@ const STYLE_KEYS = defineExactKeys()([
|
|
|
2949
2984
|
]);
|
|
2950
2985
|
|
|
2951
2986
|
//#endregion
|
|
2952
|
-
//#region src/
|
|
2953
|
-
function getEmptySnapshot$1(unitID = generateRandomId(6), locale = "enUS", title = "") {
|
|
2954
|
-
return {
|
|
2955
|
-
id: unitID,
|
|
2956
|
-
locale,
|
|
2957
|
-
title,
|
|
2958
|
-
tableSource: {},
|
|
2959
|
-
drawings: {},
|
|
2960
|
-
drawingsOrder: [],
|
|
2961
|
-
headers: {},
|
|
2962
|
-
footers: {},
|
|
2963
|
-
body: {
|
|
2964
|
-
dataStream: "\r\n",
|
|
2965
|
-
textRuns: [],
|
|
2966
|
-
customBlocks: [],
|
|
2967
|
-
tables: [],
|
|
2968
|
-
paragraphs: [{
|
|
2969
|
-
startIndex: 0,
|
|
2970
|
-
paragraphStyle: {
|
|
2971
|
-
spaceAbove: { v: 5 },
|
|
2972
|
-
lineSpacing: 1,
|
|
2973
|
-
spaceBelow: { v: 0 }
|
|
2974
|
-
}
|
|
2975
|
-
}],
|
|
2976
|
-
sectionBreaks: [{ startIndex: 1 }]
|
|
2977
|
-
},
|
|
2978
|
-
documentStyle: {
|
|
2979
|
-
pageSize: {
|
|
2980
|
-
width: 595 / .75,
|
|
2981
|
-
height: 842 / .75
|
|
2982
|
-
},
|
|
2983
|
-
documentFlavor: 1,
|
|
2984
|
-
marginTop: 50,
|
|
2985
|
-
marginBottom: 50,
|
|
2986
|
-
marginRight: 50,
|
|
2987
|
-
marginLeft: 50,
|
|
2988
|
-
renderConfig: {
|
|
2989
|
-
zeroWidthParagraphBreak: 0,
|
|
2990
|
-
vertexAngle: 0,
|
|
2991
|
-
centerAngle: 0,
|
|
2992
|
-
background: { rgb: "#ccc" }
|
|
2993
|
-
},
|
|
2994
|
-
autoHyphenation: 1,
|
|
2995
|
-
doNotHyphenateCaps: 0,
|
|
2996
|
-
consecutiveHyphenLimit: 2,
|
|
2997
|
-
defaultHeaderId: "",
|
|
2998
|
-
defaultFooterId: "",
|
|
2999
|
-
evenPageHeaderId: "",
|
|
3000
|
-
evenPageFooterId: "",
|
|
3001
|
-
firstPageHeaderId: "",
|
|
3002
|
-
firstPageFooterId: "",
|
|
3003
|
-
evenAndOddHeaders: 0,
|
|
3004
|
-
useFirstPageHeaderFooter: 0,
|
|
3005
|
-
marginHeader: 30,
|
|
3006
|
-
marginFooter: 30
|
|
3007
|
-
},
|
|
3008
|
-
settings: {}
|
|
3009
|
-
};
|
|
3010
|
-
}
|
|
3011
|
-
|
|
3012
|
-
//#endregion
|
|
3013
|
-
//#region src/shared/command-enum.ts
|
|
2987
|
+
//#region src/types/const/const.ts
|
|
3014
2988
|
/**
|
|
3015
|
-
*
|
|
3016
|
-
*
|
|
3017
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3018
|
-
* you may not use this file except in compliance with the License.
|
|
3019
|
-
* You may obtain a copy of the License at
|
|
3020
|
-
*
|
|
3021
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3022
|
-
*
|
|
3023
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3024
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3025
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3026
|
-
* See the License for the specific language governing permissions and
|
|
3027
|
-
* limitations under the License.
|
|
2989
|
+
* Used as an illegal range array return value
|
|
3028
2990
|
*/
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
TextXActionType["RETAIN"] = "r";
|
|
3039
|
-
TextXActionType["INSERT"] = "i";
|
|
3040
|
-
TextXActionType["DELETE"] = "d";
|
|
3041
|
-
return TextXActionType;
|
|
3042
|
-
}({});
|
|
3043
|
-
|
|
3044
|
-
//#endregion
|
|
3045
|
-
//#region src/services/config/config.service.ts
|
|
2991
|
+
const DEFAULT_RANGE_ARRAY = {
|
|
2992
|
+
sheetId: "",
|
|
2993
|
+
range: {
|
|
2994
|
+
startRow: -1,
|
|
2995
|
+
endRow: -1,
|
|
2996
|
+
startColumn: -1,
|
|
2997
|
+
endColumn: -1
|
|
2998
|
+
}
|
|
2999
|
+
};
|
|
3046
3000
|
/**
|
|
3047
|
-
*
|
|
3001
|
+
* Used as an illegal range return value
|
|
3048
3002
|
*/
|
|
3049
|
-
const
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
_defineProperty(this, "_config", /* @__PURE__ */ new Map());
|
|
3055
|
-
}
|
|
3056
|
-
dispose() {
|
|
3057
|
-
this._config.clear();
|
|
3058
|
-
this._configChanged$.complete();
|
|
3059
|
-
}
|
|
3060
|
-
getConfig(id) {
|
|
3061
|
-
return this._config.get(id);
|
|
3062
|
-
}
|
|
3063
|
-
setConfig(id, value, options) {
|
|
3064
|
-
var _this$_config$get;
|
|
3065
|
-
const { merge: isMerge = false } = options || {};
|
|
3066
|
-
let nextValue = (_this$_config$get = this._config.get(id)) !== null && _this$_config$get !== void 0 ? _this$_config$get : {};
|
|
3067
|
-
if (isMerge) nextValue = merge(nextValue, value);
|
|
3068
|
-
else nextValue = value;
|
|
3069
|
-
this._config.set(id, nextValue);
|
|
3070
|
-
this._configChanged$.next({ [id]: nextValue });
|
|
3071
|
-
}
|
|
3072
|
-
deleteConfig(id) {
|
|
3073
|
-
return this._config.delete(id);
|
|
3074
|
-
}
|
|
3075
|
-
subscribeConfigValue$(key) {
|
|
3076
|
-
return new Observable((observer) => {
|
|
3077
|
-
if (Object.prototype.hasOwnProperty.call(this._config, key)) observer.next(this._config.get(key));
|
|
3078
|
-
const sub = this.configChanged$.pipe(filter((c) => Object.prototype.hasOwnProperty.call(c, key))).subscribe((c) => observer.next(c[key]));
|
|
3079
|
-
return () => sub.unsubscribe();
|
|
3080
|
-
});
|
|
3081
|
-
}
|
|
3003
|
+
const DEFAULT_RANGE = {
|
|
3004
|
+
startRow: -1,
|
|
3005
|
+
startColumn: -1,
|
|
3006
|
+
endRow: -1,
|
|
3007
|
+
endColumn: -1
|
|
3082
3008
|
};
|
|
3083
|
-
|
|
3084
|
-
//#endregion
|
|
3085
|
-
//#region src/services/context/context.service.ts
|
|
3086
3009
|
/**
|
|
3087
|
-
*
|
|
3088
|
-
*
|
|
3089
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3090
|
-
* you may not use this file except in compliance with the License.
|
|
3091
|
-
* You may obtain a copy of the License at
|
|
3092
|
-
*
|
|
3093
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3094
|
-
*
|
|
3095
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3096
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3097
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3098
|
-
* See the License for the specific language governing permissions and
|
|
3099
|
-
* limitations under the License.
|
|
3010
|
+
* Used as an init selection return value
|
|
3100
3011
|
*/
|
|
3101
|
-
const
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
_defineProperty(this, "contextChanged$", this._contextChanged$.asObservable());
|
|
3107
|
-
_defineProperty(this, "_contextMap", /* @__PURE__ */ new Map());
|
|
3108
|
-
}
|
|
3109
|
-
dispose() {
|
|
3110
|
-
super.dispose();
|
|
3111
|
-
this._contextChanged$.complete();
|
|
3112
|
-
this._contextMap.clear();
|
|
3113
|
-
}
|
|
3114
|
-
getContextValue(key) {
|
|
3115
|
-
var _this$_contextMap$get;
|
|
3116
|
-
return (_this$_contextMap$get = this._contextMap.get(key)) !== null && _this$_contextMap$get !== void 0 ? _this$_contextMap$get : false;
|
|
3117
|
-
}
|
|
3118
|
-
setContextValue(key, value) {
|
|
3119
|
-
this._contextMap.set(key, value);
|
|
3120
|
-
this._contextChanged$.next({ [key]: value });
|
|
3121
|
-
}
|
|
3122
|
-
subscribeContextValue$(key) {
|
|
3123
|
-
return new Observable((observer) => {
|
|
3124
|
-
const contextChangeSubscription = this._contextChanged$.pipe(filter((event) => typeof event[key] !== "undefined")).subscribe((event) => observer.next(event[key]));
|
|
3125
|
-
if (this._contextMap.has(key)) observer.next(this._contextMap.get(key));
|
|
3126
|
-
return () => contextChangeSubscription.unsubscribe();
|
|
3127
|
-
});
|
|
3128
|
-
}
|
|
3012
|
+
const DEFAULT_SELECTION = {
|
|
3013
|
+
startRow: 0,
|
|
3014
|
+
startColumn: 0,
|
|
3015
|
+
endRow: 0,
|
|
3016
|
+
endColumn: 0
|
|
3129
3017
|
};
|
|
3130
|
-
|
|
3131
|
-
//#endregion
|
|
3132
|
-
//#region src/services/log/log.service.ts
|
|
3133
3018
|
/**
|
|
3134
|
-
*
|
|
3135
|
-
*
|
|
3136
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3137
|
-
* you may not use this file except in compliance with the License.
|
|
3138
|
-
* You may obtain a copy of the License at
|
|
3139
|
-
*
|
|
3140
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3141
|
-
*
|
|
3142
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3143
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3144
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3145
|
-
* See the License for the specific language governing permissions and
|
|
3146
|
-
* limitations under the License.
|
|
3019
|
+
* Used as an init cell return value
|
|
3147
3020
|
*/
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
}
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3021
|
+
const DEFAULT_CELL = {
|
|
3022
|
+
row: 0,
|
|
3023
|
+
column: 0
|
|
3024
|
+
};
|
|
3025
|
+
/**
|
|
3026
|
+
* Default styles.
|
|
3027
|
+
*/
|
|
3028
|
+
const DEFAULT_STYLES = {
|
|
3029
|
+
/**
|
|
3030
|
+
* fontFamily
|
|
3031
|
+
*/
|
|
3032
|
+
ff: "Arial",
|
|
3033
|
+
/**
|
|
3034
|
+
* fontSize
|
|
3035
|
+
*/
|
|
3036
|
+
fs: 11,
|
|
3037
|
+
/**
|
|
3038
|
+
* italic
|
|
3039
|
+
* 0: false
|
|
3040
|
+
* 1: true
|
|
3041
|
+
*/
|
|
3042
|
+
it: 0,
|
|
3043
|
+
/**
|
|
3044
|
+
* bold
|
|
3045
|
+
* 0: false
|
|
3046
|
+
* 1: true
|
|
3047
|
+
*/
|
|
3048
|
+
bl: 0,
|
|
3049
|
+
/**
|
|
3050
|
+
* underline
|
|
3051
|
+
*/
|
|
3052
|
+
ul: { s: 0 },
|
|
3053
|
+
/**
|
|
3054
|
+
* strikethrough
|
|
3055
|
+
*/
|
|
3056
|
+
st: { s: 0 },
|
|
3057
|
+
/**
|
|
3058
|
+
* overline
|
|
3059
|
+
*/
|
|
3060
|
+
ol: { s: 0 },
|
|
3061
|
+
/**
|
|
3062
|
+
* textRotation
|
|
3063
|
+
*/
|
|
3064
|
+
tr: {
|
|
3065
|
+
a: 0,
|
|
3066
|
+
/**
|
|
3067
|
+
* true : 1
|
|
3068
|
+
* false : 0
|
|
3069
|
+
*/
|
|
3070
|
+
v: 0
|
|
3071
|
+
},
|
|
3072
|
+
/**
|
|
3073
|
+
* textDirection
|
|
3074
|
+
*/
|
|
3075
|
+
td: 0,
|
|
3076
|
+
/**
|
|
3077
|
+
* color
|
|
3078
|
+
*/
|
|
3079
|
+
cl: { rgb: "#000000" },
|
|
3080
|
+
/**
|
|
3081
|
+
* background
|
|
3082
|
+
*/
|
|
3083
|
+
bg: { rgb: "#fff" },
|
|
3084
|
+
/**
|
|
3085
|
+
* horizontalAlignment
|
|
3086
|
+
*/
|
|
3087
|
+
ht: 0,
|
|
3088
|
+
/**
|
|
3089
|
+
* verticalAlignment
|
|
3090
|
+
*/
|
|
3091
|
+
vt: 0,
|
|
3092
|
+
/**
|
|
3093
|
+
* wrapStrategy
|
|
3094
|
+
*/
|
|
3095
|
+
tb: 0,
|
|
3096
|
+
/**
|
|
3097
|
+
* padding
|
|
3098
|
+
*/
|
|
3099
|
+
pd: {
|
|
3100
|
+
t: 0,
|
|
3101
|
+
r: 0,
|
|
3102
|
+
b: 0,
|
|
3103
|
+
l: 0
|
|
3104
|
+
},
|
|
3105
|
+
n: null,
|
|
3106
|
+
/**
|
|
3107
|
+
* border
|
|
3108
|
+
*/
|
|
3109
|
+
bd: {
|
|
3110
|
+
b: null,
|
|
3111
|
+
l: null,
|
|
3112
|
+
r: null,
|
|
3113
|
+
t: null
|
|
3114
|
+
}
|
|
3115
|
+
};
|
|
3116
|
+
const SHEET_EDITOR_UNITS = [
|
|
3117
|
+
DOCS_NORMAL_EDITOR_UNIT_ID_KEY,
|
|
3118
|
+
DOCS_ZEN_EDITOR_UNIT_ID_KEY,
|
|
3119
|
+
DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY
|
|
3120
|
+
];
|
|
3121
|
+
const NAMED_STYLE_MAP = {
|
|
3122
|
+
[4]: {
|
|
3123
|
+
fs: 20,
|
|
3124
|
+
bl: 1
|
|
3125
|
+
},
|
|
3126
|
+
[5]: {
|
|
3127
|
+
fs: 18,
|
|
3128
|
+
bl: 1
|
|
3129
|
+
},
|
|
3130
|
+
[6]: {
|
|
3131
|
+
fs: 16,
|
|
3132
|
+
bl: 1
|
|
3133
|
+
},
|
|
3134
|
+
[7]: {
|
|
3135
|
+
fs: 14,
|
|
3136
|
+
bl: 1
|
|
3137
|
+
},
|
|
3138
|
+
[8]: {
|
|
3139
|
+
fs: 12,
|
|
3140
|
+
bl: 1
|
|
3141
|
+
},
|
|
3142
|
+
[1]: null,
|
|
3143
|
+
[2]: {
|
|
3144
|
+
fs: 26,
|
|
3145
|
+
bl: 1
|
|
3146
|
+
},
|
|
3147
|
+
[3]: {
|
|
3148
|
+
fs: 15,
|
|
3149
|
+
cl: { rgb: "#999999" }
|
|
3150
|
+
},
|
|
3151
|
+
[0]: null
|
|
3152
|
+
};
|
|
3153
|
+
const DEFAULT_DOCUMENT_PARAGRAPH_LINE_SPACING = 1.5;
|
|
3154
|
+
const DEFAULT_DOCUMENT_PARAGRAPH_SPACE_ABOVE = 0;
|
|
3155
|
+
const DEFAULT_DOCUMENT_PARAGRAPH_SPACE_BELOW = 8;
|
|
3156
|
+
const NAMED_STYLE_SPACE_MAP = {
|
|
3157
|
+
[4]: {
|
|
3158
|
+
spaceAbove: { v: 20 },
|
|
3159
|
+
spaceBelow: { v: 10 }
|
|
3160
|
+
},
|
|
3161
|
+
[5]: {
|
|
3162
|
+
spaceAbove: { v: 18 },
|
|
3163
|
+
spaceBelow: { v: 10 }
|
|
3164
|
+
},
|
|
3165
|
+
[6]: {
|
|
3166
|
+
spaceAbove: { v: 16 },
|
|
3167
|
+
spaceBelow: { v: 10 }
|
|
3168
|
+
},
|
|
3169
|
+
[7]: {
|
|
3170
|
+
spaceAbove: { v: 14 },
|
|
3171
|
+
spaceBelow: { v: 8 }
|
|
3172
|
+
},
|
|
3173
|
+
[8]: {
|
|
3174
|
+
spaceAbove: { v: 12 },
|
|
3175
|
+
spaceBelow: { v: 8 }
|
|
3176
|
+
},
|
|
3177
|
+
[1]: {
|
|
3178
|
+
spaceAbove: { v: 0 },
|
|
3179
|
+
spaceBelow: { v: 8 }
|
|
3180
|
+
},
|
|
3181
|
+
[2]: {
|
|
3182
|
+
spaceAbove: { v: 0 },
|
|
3183
|
+
spaceBelow: { v: 7 }
|
|
3184
|
+
},
|
|
3185
|
+
[3]: {
|
|
3186
|
+
spaceAbove: { v: 0 },
|
|
3187
|
+
spaceBelow: { v: 16 }
|
|
3188
|
+
},
|
|
3189
|
+
[0]: null
|
|
3190
|
+
};
|
|
3191
|
+
const PRINT_CHART_COMPONENT_KEY = "univer-sheets-chart-print-chart";
|
|
3192
|
+
const DOC_DRAWING_PRINTING_COMPONENT_KEY = "univer-docs-drawing-printing";
|
|
3193
|
+
|
|
3194
|
+
//#endregion
|
|
3195
|
+
//#region src/types/const/extension-names.ts
|
|
3196
|
+
/**
|
|
3197
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3198
|
+
*
|
|
3199
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3200
|
+
* you may not use this file except in compliance with the License.
|
|
3201
|
+
* You may obtain a copy of the License at
|
|
3202
|
+
*
|
|
3203
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3204
|
+
*
|
|
3205
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3206
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3207
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3208
|
+
* See the License for the specific language governing permissions and
|
|
3209
|
+
* limitations under the License.
|
|
3210
|
+
*/
|
|
3211
|
+
let EXTENSION_NAMES = /* @__PURE__ */ function(EXTENSION_NAMES) {
|
|
3212
|
+
EXTENSION_NAMES["ARRAY_CONVERTOR"] = "ARRAY_CONVERTOR";
|
|
3213
|
+
EXTENSION_NAMES["MATRIX_CONVERTOR"] = "MATRIX_CONVERTOR";
|
|
3214
|
+
return EXTENSION_NAMES;
|
|
3215
|
+
}({});
|
|
3216
|
+
|
|
3217
|
+
//#endregion
|
|
3218
|
+
//#region src/types/const/page-size.ts
|
|
3219
|
+
const PAGE_SIZE = {
|
|
3220
|
+
["A3"]: {
|
|
3221
|
+
width: 1123,
|
|
3222
|
+
height: 1587
|
|
3223
|
+
},
|
|
3224
|
+
["A4"]: {
|
|
3225
|
+
width: 794,
|
|
3226
|
+
height: 1124
|
|
3227
|
+
},
|
|
3228
|
+
["A5"]: {
|
|
3229
|
+
width: 559,
|
|
3230
|
+
height: 794
|
|
3231
|
+
},
|
|
3232
|
+
["B4"]: {
|
|
3233
|
+
width: 944,
|
|
3234
|
+
height: 1344
|
|
3235
|
+
},
|
|
3236
|
+
["B5"]: {
|
|
3237
|
+
width: 665,
|
|
3238
|
+
height: 944
|
|
3239
|
+
},
|
|
3240
|
+
["Executive"]: {
|
|
3241
|
+
width: 696,
|
|
3242
|
+
height: 1008
|
|
3243
|
+
},
|
|
3244
|
+
["Folio"]: {
|
|
3245
|
+
width: 816,
|
|
3246
|
+
height: 1248
|
|
3247
|
+
},
|
|
3248
|
+
["Legal"]: {
|
|
3249
|
+
width: 816,
|
|
3250
|
+
height: 1344
|
|
3251
|
+
},
|
|
3252
|
+
["Letter"]: {
|
|
3253
|
+
width: 816,
|
|
3254
|
+
height: 1056
|
|
3255
|
+
},
|
|
3256
|
+
["Statement"]: {
|
|
3257
|
+
width: 528,
|
|
3258
|
+
height: 816
|
|
3259
|
+
},
|
|
3260
|
+
["Tabloid"]: {
|
|
3261
|
+
width: 1056,
|
|
3262
|
+
height: 1632
|
|
3263
|
+
}
|
|
3264
|
+
};
|
|
3265
|
+
let ModernDocumentWidthMode = /* @__PURE__ */ function(ModernDocumentWidthMode) {
|
|
3266
|
+
ModernDocumentWidthMode["NARROW"] = "narrow";
|
|
3267
|
+
ModernDocumentWidthMode["MEDIUM"] = "medium";
|
|
3268
|
+
ModernDocumentWidthMode["WIDE"] = "wide";
|
|
3269
|
+
return ModernDocumentWidthMode;
|
|
3270
|
+
}({});
|
|
3271
|
+
const MODERN_DOCUMENT_WIDTH = {
|
|
3272
|
+
["narrow"]: PAGE_SIZE["A4"].width,
|
|
3273
|
+
["medium"]: 960,
|
|
3274
|
+
["wide"]: PAGE_SIZE["A3"].width
|
|
3275
|
+
};
|
|
3276
|
+
const MODERN_DOCUMENT_DEFAULT_MARGIN = 50 / .75;
|
|
3277
|
+
|
|
3278
|
+
//#endregion
|
|
3279
|
+
//#region src/types/const/theme-color-map.ts
|
|
3280
|
+
const THEME_COLORS = { ["Office"]: {
|
|
3281
|
+
[4]: "#4472C4",
|
|
3282
|
+
[5]: "#ED7D31",
|
|
3283
|
+
[6]: "#A5A5A5",
|
|
3284
|
+
[7]: "#70AD47",
|
|
3285
|
+
[8]: "#5B9BD5",
|
|
3286
|
+
[9]: "#70AD47",
|
|
3287
|
+
[0]: "#000000",
|
|
3288
|
+
[2]: "#44546A",
|
|
3289
|
+
[1]: "#FFFFFF",
|
|
3290
|
+
[3]: "#E7E6E6",
|
|
3291
|
+
[10]: "#0563C1",
|
|
3292
|
+
[11]: "#954F72"
|
|
3293
|
+
} };
|
|
3294
|
+
|
|
3295
|
+
//#endregion
|
|
3296
|
+
//#region src/docs/data-model/empty-snapshot.ts
|
|
3297
|
+
function getEmptySnapshot$1(unitID = generateRandomId(6), locale = "enUS", title = "") {
|
|
3298
|
+
return {
|
|
3299
|
+
id: unitID,
|
|
3300
|
+
locale,
|
|
3301
|
+
title,
|
|
3302
|
+
tableSource: {},
|
|
3303
|
+
drawings: {},
|
|
3304
|
+
drawingsOrder: [],
|
|
3305
|
+
headers: {},
|
|
3306
|
+
footers: {},
|
|
3307
|
+
body: {
|
|
3308
|
+
dataStream: "\r\n",
|
|
3309
|
+
textRuns: [],
|
|
3310
|
+
customBlocks: [],
|
|
3311
|
+
tables: [],
|
|
3312
|
+
paragraphs: [{
|
|
3313
|
+
startIndex: 0,
|
|
3314
|
+
paragraphStyle: {
|
|
3315
|
+
spaceAbove: { v: 0 },
|
|
3316
|
+
lineSpacing: DEFAULT_DOCUMENT_PARAGRAPH_LINE_SPACING,
|
|
3317
|
+
spaceBelow: { v: 8 }
|
|
3318
|
+
}
|
|
3319
|
+
}],
|
|
3320
|
+
sectionBreaks: [{ startIndex: 1 }]
|
|
3321
|
+
},
|
|
3322
|
+
documentStyle: {
|
|
3323
|
+
pageSize: {
|
|
3324
|
+
width: MODERN_DOCUMENT_WIDTH["medium"],
|
|
3325
|
+
height: 842 / .75
|
|
3326
|
+
},
|
|
3327
|
+
documentFlavor: 2,
|
|
3328
|
+
marginTop: 50,
|
|
3329
|
+
marginBottom: 50,
|
|
3330
|
+
marginRight: 50,
|
|
3331
|
+
marginLeft: 50,
|
|
3332
|
+
renderConfig: {
|
|
3333
|
+
zeroWidthParagraphBreak: 0,
|
|
3334
|
+
vertexAngle: 0,
|
|
3335
|
+
centerAngle: 0,
|
|
3336
|
+
background: { rgb: "#ccc" }
|
|
3337
|
+
},
|
|
3338
|
+
autoHyphenation: 1,
|
|
3339
|
+
doNotHyphenateCaps: 0,
|
|
3340
|
+
consecutiveHyphenLimit: 2,
|
|
3341
|
+
defaultHeaderId: "",
|
|
3342
|
+
defaultFooterId: "",
|
|
3343
|
+
evenPageHeaderId: "",
|
|
3344
|
+
evenPageFooterId: "",
|
|
3345
|
+
firstPageHeaderId: "",
|
|
3346
|
+
firstPageFooterId: "",
|
|
3347
|
+
evenAndOddHeaders: 0,
|
|
3348
|
+
useFirstPageHeaderFooter: 0,
|
|
3349
|
+
marginHeader: 30,
|
|
3350
|
+
marginFooter: 30
|
|
3351
|
+
},
|
|
3352
|
+
settings: {}
|
|
3353
|
+
};
|
|
3354
|
+
}
|
|
3355
|
+
|
|
3356
|
+
//#endregion
|
|
3357
|
+
//#region src/shared/command-enum.ts
|
|
3358
|
+
/**
|
|
3359
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3360
|
+
*
|
|
3361
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3362
|
+
* you may not use this file except in compliance with the License.
|
|
3363
|
+
* You may obtain a copy of the License at
|
|
3364
|
+
*
|
|
3365
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3366
|
+
*
|
|
3367
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3368
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3369
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3370
|
+
* See the License for the specific language governing permissions and
|
|
3371
|
+
* limitations under the License.
|
|
3372
|
+
*/
|
|
3373
|
+
let UpdateDocsAttributeType = /* @__PURE__ */ function(UpdateDocsAttributeType) {
|
|
3374
|
+
UpdateDocsAttributeType[UpdateDocsAttributeType["COVER"] = 0] = "COVER";
|
|
3375
|
+
UpdateDocsAttributeType[UpdateDocsAttributeType["REPLACE"] = 1] = "REPLACE";
|
|
3376
|
+
return UpdateDocsAttributeType;
|
|
3377
|
+
}({});
|
|
3378
|
+
|
|
3379
|
+
//#endregion
|
|
3380
|
+
//#region src/docs/data-model/text-x/action-types.ts
|
|
3381
|
+
let TextXActionType = /* @__PURE__ */ function(TextXActionType) {
|
|
3382
|
+
TextXActionType["RETAIN"] = "r";
|
|
3383
|
+
TextXActionType["INSERT"] = "i";
|
|
3384
|
+
TextXActionType["DELETE"] = "d";
|
|
3385
|
+
return TextXActionType;
|
|
3386
|
+
}({});
|
|
3387
|
+
|
|
3388
|
+
//#endregion
|
|
3389
|
+
//#region src/services/config/config.service.ts
|
|
3390
|
+
/**
|
|
3391
|
+
* IConfig provides universal configuration for the whole application.
|
|
3392
|
+
*/
|
|
3393
|
+
const IConfigService = createIdentifier("univer.config-service");
|
|
3394
|
+
var ConfigService = class {
|
|
3395
|
+
constructor() {
|
|
3396
|
+
_defineProperty(this, "_configChanged$", new Subject());
|
|
3397
|
+
_defineProperty(this, "configChanged$", this._configChanged$.asObservable());
|
|
3398
|
+
_defineProperty(this, "_config", /* @__PURE__ */ new Map());
|
|
3399
|
+
}
|
|
3400
|
+
dispose() {
|
|
3401
|
+
this._config.clear();
|
|
3402
|
+
this._configChanged$.complete();
|
|
3403
|
+
}
|
|
3404
|
+
getConfig(id) {
|
|
3405
|
+
return this._config.get(id);
|
|
3406
|
+
}
|
|
3407
|
+
setConfig(id, value, options) {
|
|
3408
|
+
var _this$_config$get;
|
|
3409
|
+
const { merge: isMerge = false } = options || {};
|
|
3410
|
+
let nextValue = (_this$_config$get = this._config.get(id)) !== null && _this$_config$get !== void 0 ? _this$_config$get : {};
|
|
3411
|
+
if (isMerge) nextValue = merge(nextValue, value);
|
|
3412
|
+
else nextValue = value;
|
|
3413
|
+
this._config.set(id, nextValue);
|
|
3414
|
+
this._configChanged$.next({ [id]: nextValue });
|
|
3415
|
+
}
|
|
3416
|
+
deleteConfig(id) {
|
|
3417
|
+
return this._config.delete(id);
|
|
3418
|
+
}
|
|
3419
|
+
subscribeConfigValue$(key) {
|
|
3420
|
+
return new Observable((observer) => {
|
|
3421
|
+
if (Object.prototype.hasOwnProperty.call(this._config, key)) observer.next(this._config.get(key));
|
|
3422
|
+
const sub = this.configChanged$.pipe(filter((c) => Object.prototype.hasOwnProperty.call(c, key))).subscribe((c) => observer.next(c[key]));
|
|
3423
|
+
return () => sub.unsubscribe();
|
|
3424
|
+
});
|
|
3425
|
+
}
|
|
3426
|
+
};
|
|
3427
|
+
|
|
3428
|
+
//#endregion
|
|
3429
|
+
//#region src/services/context/context.service.ts
|
|
3430
|
+
/**
|
|
3431
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3432
|
+
*
|
|
3433
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3434
|
+
* you may not use this file except in compliance with the License.
|
|
3435
|
+
* You may obtain a copy of the License at
|
|
3436
|
+
*
|
|
3437
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3438
|
+
*
|
|
3439
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3440
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3441
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3442
|
+
* See the License for the specific language governing permissions and
|
|
3443
|
+
* limitations under the License.
|
|
3444
|
+
*/
|
|
3445
|
+
const IContextService = createIdentifier("univer.context-service");
|
|
3446
|
+
var ContextService = class extends Disposable {
|
|
3447
|
+
constructor(..._args) {
|
|
3448
|
+
super(..._args);
|
|
3449
|
+
_defineProperty(this, "_contextChanged$", new Subject());
|
|
3450
|
+
_defineProperty(this, "contextChanged$", this._contextChanged$.asObservable());
|
|
3451
|
+
_defineProperty(this, "_contextMap", /* @__PURE__ */ new Map());
|
|
3452
|
+
}
|
|
3453
|
+
dispose() {
|
|
3454
|
+
super.dispose();
|
|
3455
|
+
this._contextChanged$.complete();
|
|
3456
|
+
this._contextMap.clear();
|
|
3457
|
+
}
|
|
3458
|
+
getContextValue(key) {
|
|
3459
|
+
var _this$_contextMap$get;
|
|
3460
|
+
return (_this$_contextMap$get = this._contextMap.get(key)) !== null && _this$_contextMap$get !== void 0 ? _this$_contextMap$get : false;
|
|
3461
|
+
}
|
|
3462
|
+
setContextValue(key, value) {
|
|
3463
|
+
this._contextMap.set(key, value);
|
|
3464
|
+
this._contextChanged$.next({ [key]: value });
|
|
3465
|
+
}
|
|
3466
|
+
subscribeContextValue$(key) {
|
|
3467
|
+
return new Observable((observer) => {
|
|
3468
|
+
const contextChangeSubscription = this._contextChanged$.pipe(filter((event) => typeof event[key] !== "undefined")).subscribe((event) => observer.next(event[key]));
|
|
3469
|
+
if (this._contextMap.has(key)) observer.next(this._contextMap.get(key));
|
|
3470
|
+
return () => contextChangeSubscription.unsubscribe();
|
|
3471
|
+
});
|
|
3472
|
+
}
|
|
3473
|
+
};
|
|
3474
|
+
|
|
3475
|
+
//#endregion
|
|
3476
|
+
//#region src/services/log/log.service.ts
|
|
3477
|
+
/**
|
|
3478
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3479
|
+
*
|
|
3480
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3481
|
+
* you may not use this file except in compliance with the License.
|
|
3482
|
+
* You may obtain a copy of the License at
|
|
3483
|
+
*
|
|
3484
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3485
|
+
*
|
|
3486
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3487
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3488
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3489
|
+
* See the License for the specific language governing permissions and
|
|
3490
|
+
* limitations under the License.
|
|
3491
|
+
*/
|
|
3492
|
+
let LogLevel = /* @__PURE__ */ function(LogLevel) {
|
|
3493
|
+
LogLevel[LogLevel["SILENT"] = 0] = "SILENT";
|
|
3494
|
+
LogLevel[LogLevel["ERROR"] = 1] = "ERROR";
|
|
3495
|
+
LogLevel[LogLevel["WARN"] = 2] = "WARN";
|
|
3496
|
+
LogLevel[LogLevel["INFO"] = 3] = "INFO";
|
|
3497
|
+
LogLevel[LogLevel["VERBOSE"] = 4] = "VERBOSE";
|
|
3498
|
+
return LogLevel;
|
|
3499
|
+
}({});
|
|
3500
|
+
const ILogService = createIdentifier("univer.log");
|
|
3501
|
+
var DesktopLogService = class extends Disposable {
|
|
3502
|
+
constructor(..._args) {
|
|
3503
|
+
super(..._args);
|
|
3504
|
+
_defineProperty(this, "_logLevel", 3);
|
|
3505
|
+
_defineProperty(this, "_deduction", /* @__PURE__ */ new Set());
|
|
3506
|
+
}
|
|
3507
|
+
dispose() {
|
|
3508
|
+
super.dispose();
|
|
3509
|
+
this._logLevel = 3;
|
|
3510
|
+
this._deduction.clear();
|
|
3511
|
+
}
|
|
3512
|
+
debug(...args) {
|
|
3513
|
+
if (this._logLevel >= 4) this._log(console.debug, ...args);
|
|
3514
|
+
}
|
|
3515
|
+
log(...args) {
|
|
3516
|
+
if (this._logLevel >= 3) this._log(console.log, ...args);
|
|
3517
|
+
}
|
|
3518
|
+
warn(...args) {
|
|
3519
|
+
if (this._logLevel >= 2) this._log(console.warn, ...args);
|
|
3520
|
+
}
|
|
3521
|
+
error(...args) {
|
|
3522
|
+
if (this._logLevel >= 1) this._log(console.error, ...args);
|
|
3523
|
+
}
|
|
3524
|
+
deprecate(...args) {
|
|
3525
|
+
if (this._logLevel >= 2) this._logWithDeduplication(console.error, ...args);
|
|
3526
|
+
}
|
|
3527
|
+
setLogLevel(logLevel) {
|
|
3528
|
+
this._logLevel = logLevel;
|
|
3529
|
+
}
|
|
3530
|
+
_log(method, ...args) {
|
|
3531
|
+
const firstArg = args[0];
|
|
3532
|
+
if (/^\[(.*?)\]/g.test(firstArg)) method(`\x1B[97;104m${firstArg}\x1B[0m`, ...args.slice(1));
|
|
3533
|
+
else method(...args);
|
|
3534
|
+
}
|
|
3191
3535
|
_logWithDeduplication(method, ...args) {
|
|
3192
3536
|
const hashed = hashLogContent(...args);
|
|
3193
3537
|
if (this._deduction.has(hashed)) return;
|
|
@@ -3200,7 +3544,7 @@ function hashLogContent(...args) {
|
|
|
3200
3544
|
}
|
|
3201
3545
|
|
|
3202
3546
|
//#endregion
|
|
3203
|
-
//#region \0@oxc-project+runtime@0.
|
|
3547
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorateParam.js
|
|
3204
3548
|
function __decorateParam(paramIndex, decorator) {
|
|
3205
3549
|
return function(target, key) {
|
|
3206
3550
|
decorator(target, key, paramIndex);
|
|
@@ -3208,7 +3552,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
3208
3552
|
}
|
|
3209
3553
|
|
|
3210
3554
|
//#endregion
|
|
3211
|
-
//#region \0@oxc-project+runtime@0.
|
|
3555
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorate.js
|
|
3212
3556
|
function __decorate(decorators, target, key, desc) {
|
|
3213
3557
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3214
3558
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -4946,11 +5290,10 @@ function getCellValueType(cell) {
|
|
|
4946
5290
|
}
|
|
4947
5291
|
function isNullCell(cell) {
|
|
4948
5292
|
if (cell == null) return true;
|
|
4949
|
-
const { v, f, si, p
|
|
5293
|
+
const { v, f, si, p } = cell;
|
|
4950
5294
|
if (!(v == null || typeof v === "string" && v.length === 0)) return false;
|
|
4951
5295
|
if (f != null && f.length > 0 || si != null && si.length > 0) return false;
|
|
4952
5296
|
if (p != null) return false;
|
|
4953
|
-
if (custom != null) return false;
|
|
4954
5297
|
return true;
|
|
4955
5298
|
}
|
|
4956
5299
|
function isCellV(cell) {
|
|
@@ -5058,23 +5401,6 @@ let CellModeEnum = /* @__PURE__ */ function(CellModeEnum) {
|
|
|
5058
5401
|
return CellModeEnum;
|
|
5059
5402
|
}({});
|
|
5060
5403
|
|
|
5061
|
-
//#endregion
|
|
5062
|
-
//#region src/types/const/theme-color-map.ts
|
|
5063
|
-
const THEME_COLORS = { ["Office"]: {
|
|
5064
|
-
[4]: "#4472C4",
|
|
5065
|
-
[5]: "#ED7D31",
|
|
5066
|
-
[6]: "#A5A5A5",
|
|
5067
|
-
[7]: "#70AD47",
|
|
5068
|
-
[8]: "#5B9BD5",
|
|
5069
|
-
[9]: "#70AD47",
|
|
5070
|
-
[0]: "#000000",
|
|
5071
|
-
[2]: "#44546A",
|
|
5072
|
-
[1]: "#FFFFFF",
|
|
5073
|
-
[3]: "#E7E6E6",
|
|
5074
|
-
[10]: "#0563C1",
|
|
5075
|
-
[11]: "#954F72"
|
|
5076
|
-
} };
|
|
5077
|
-
|
|
5078
5404
|
//#endregion
|
|
5079
5405
|
//#region src/shared/numfmt.ts
|
|
5080
5406
|
/**
|
|
@@ -5134,16 +5460,42 @@ const isPatternEqualWithoutDecimal = (patternA, patternB) => {
|
|
|
5134
5460
|
};
|
|
5135
5461
|
const ignoreCommonPatterns = new Set(["m d"]);
|
|
5136
5462
|
const ignoreAMPMPatterns = new Set(["h:mm AM/PM", "hh:mm AM/PM"]);
|
|
5137
|
-
const currencySymbols =
|
|
5463
|
+
const currencySymbols = [
|
|
5464
|
+
"Rp",
|
|
5465
|
+
"zł",
|
|
5466
|
+
"NT$",
|
|
5467
|
+
"R$",
|
|
5468
|
+
"HK$",
|
|
5138
5469
|
"$",
|
|
5470
|
+
"£",
|
|
5139
5471
|
"¥",
|
|
5140
|
-
"
|
|
5472
|
+
"¤",
|
|
5473
|
+
"֏",
|
|
5474
|
+
"؋",
|
|
5475
|
+
"৳",
|
|
5476
|
+
"฿",
|
|
5477
|
+
"៛",
|
|
5478
|
+
"₡",
|
|
5479
|
+
"₦",
|
|
5480
|
+
"₩",
|
|
5481
|
+
"₪",
|
|
5141
5482
|
"₫",
|
|
5142
|
-
"NT$",
|
|
5143
5483
|
"€",
|
|
5144
|
-
"
|
|
5484
|
+
"₭",
|
|
5485
|
+
"₮",
|
|
5486
|
+
"₱",
|
|
5487
|
+
"₲",
|
|
5488
|
+
"₴",
|
|
5489
|
+
"₸",
|
|
5490
|
+
"₹",
|
|
5491
|
+
"₺",
|
|
5492
|
+
"₼",
|
|
5493
|
+
"₽",
|
|
5494
|
+
"₾",
|
|
5495
|
+
"₿",
|
|
5145
5496
|
"﷼"
|
|
5146
|
-
]
|
|
5497
|
+
];
|
|
5498
|
+
const currencySymbolSet = new Set(currencySymbols);
|
|
5147
5499
|
/**
|
|
5148
5500
|
* Get the numfmt parse value, and filter out the parse error.
|
|
5149
5501
|
*/
|
|
@@ -5173,7 +5525,7 @@ const getNumfmtParseValueFilter = (value) => {
|
|
|
5173
5525
|
*/
|
|
5174
5526
|
if (z.includes("#,##0")) {
|
|
5175
5527
|
if (/[.,]$/.test(value)) return null;
|
|
5176
|
-
const normalized = value.replace(new RegExp(`^[${[...
|
|
5528
|
+
const normalized = value.replace(new RegExp(`^[${[...currencySymbolSet].join("")}]+`), "").trim();
|
|
5177
5529
|
if (normalized.includes(",")) {
|
|
5178
5530
|
if (!/^-?\d{1,3}(,\d{3})*(\.\d+)?$/.test(normalized)) return null;
|
|
5179
5531
|
}
|
|
@@ -6635,26 +6987,11 @@ function mergeIntervals(intervals) {
|
|
|
6635
6987
|
}
|
|
6636
6988
|
}
|
|
6637
6989
|
merged.push([currentStart, currentEnd]);
|
|
6638
|
-
return merged;
|
|
6639
|
-
}
|
|
6640
|
-
|
|
6641
|
-
//#endregion
|
|
6642
|
-
//#region src/shared/locale.ts
|
|
6643
|
-
/**
|
|
6644
|
-
* Copyright 2023-present DreamNum Co., Ltd.
|
|
6645
|
-
*
|
|
6646
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6647
|
-
* you may not use this file except in compliance with the License.
|
|
6648
|
-
* You may obtain a copy of the License at
|
|
6649
|
-
*
|
|
6650
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6651
|
-
*
|
|
6652
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
6653
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6654
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6655
|
-
* See the License for the specific language governing permissions and
|
|
6656
|
-
* limitations under the License.
|
|
6657
|
-
*/
|
|
6990
|
+
return merged;
|
|
6991
|
+
}
|
|
6992
|
+
|
|
6993
|
+
//#endregion
|
|
6994
|
+
//#region src/shared/locale.ts
|
|
6658
6995
|
/**
|
|
6659
6996
|
* Merges multiple locale objects into a single locale object.
|
|
6660
6997
|
* It can accept either multiple locale objects as arguments or a single array of locale objects.
|
|
@@ -6665,7 +7002,7 @@ function mergeLocales(...locales) {
|
|
|
6665
7002
|
let mergedLocales;
|
|
6666
7003
|
if (locales.length === 1 && Array.isArray(locales[0])) mergedLocales = locales[0];
|
|
6667
7004
|
else mergedLocales = locales;
|
|
6668
|
-
return
|
|
7005
|
+
return Object.assign({}, ...mergedLocales);
|
|
6669
7006
|
}
|
|
6670
7007
|
|
|
6671
7008
|
//#endregion
|
|
@@ -6888,337 +7225,92 @@ var LRUMap = class {
|
|
|
6888
7225
|
return e ? e.value : void 0;
|
|
6889
7226
|
}
|
|
6890
7227
|
delete(key) {
|
|
6891
|
-
const entry = this._keymap.get(key);
|
|
6892
|
-
if (!entry) return;
|
|
6893
|
-
this._keymap.delete(entry.key);
|
|
6894
|
-
if (entry[NEWER] && entry[OLDER]) {
|
|
6895
|
-
entry[OLDER][NEWER] = entry[NEWER];
|
|
6896
|
-
entry[NEWER][OLDER] = entry[OLDER];
|
|
6897
|
-
} else if (entry[NEWER]) {
|
|
6898
|
-
entry[NEWER][OLDER] = void 0;
|
|
6899
|
-
this.oldest = entry[NEWER];
|
|
6900
|
-
} else if (entry[OLDER]) {
|
|
6901
|
-
entry[OLDER][NEWER] = void 0;
|
|
6902
|
-
this.newest = entry[OLDER];
|
|
6903
|
-
} else this.oldest = this.newest = void 0;
|
|
6904
|
-
this.size--;
|
|
6905
|
-
return entry.value;
|
|
6906
|
-
}
|
|
6907
|
-
clear() {
|
|
6908
|
-
this.oldest = void 0;
|
|
6909
|
-
this.newest = void 0;
|
|
6910
|
-
this.size = 0;
|
|
6911
|
-
this._keymap.clear();
|
|
6912
|
-
}
|
|
6913
|
-
keys() {
|
|
6914
|
-
return new KeyIterator(this.oldest);
|
|
6915
|
-
}
|
|
6916
|
-
values() {
|
|
6917
|
-
return new ValueIterator(this.oldest);
|
|
6918
|
-
}
|
|
6919
|
-
entries() {
|
|
6920
|
-
return this[Symbol.iterator]();
|
|
6921
|
-
}
|
|
6922
|
-
[_Symbol$iterator4]() {
|
|
6923
|
-
return new EntryIterator(this.oldest);
|
|
6924
|
-
}
|
|
6925
|
-
forEach(fun, thisObj) {
|
|
6926
|
-
if (typeof thisObj !== "object") thisObj = this;
|
|
6927
|
-
let entry = this.oldest;
|
|
6928
|
-
while (entry) {
|
|
6929
|
-
fun.call(thisObj, entry.value, entry.key, this);
|
|
6930
|
-
entry = entry[NEWER];
|
|
6931
|
-
}
|
|
6932
|
-
}
|
|
6933
|
-
toJSON() {
|
|
6934
|
-
const s = new Array(this.size);
|
|
6935
|
-
let i = 0;
|
|
6936
|
-
let entry = this.oldest;
|
|
6937
|
-
while (entry) {
|
|
6938
|
-
s[i++] = {
|
|
6939
|
-
key: entry.key,
|
|
6940
|
-
value: entry.value
|
|
6941
|
-
};
|
|
6942
|
-
entry = entry[NEWER];
|
|
6943
|
-
}
|
|
6944
|
-
return s;
|
|
6945
|
-
}
|
|
6946
|
-
toString() {
|
|
6947
|
-
let s = String();
|
|
6948
|
-
let entry = this.oldest;
|
|
6949
|
-
while (entry) {
|
|
6950
|
-
s += `${String(entry.key)}:${entry.value}`;
|
|
6951
|
-
entry = entry[NEWER];
|
|
6952
|
-
if (entry) s += " < ";
|
|
6953
|
-
}
|
|
6954
|
-
return s;
|
|
6955
|
-
}
|
|
6956
|
-
};
|
|
6957
|
-
var LRUHelper = class {
|
|
6958
|
-
static hasLength(array, size) {
|
|
6959
|
-
return array.length === size;
|
|
6960
|
-
}
|
|
6961
|
-
static getValueType(value) {
|
|
6962
|
-
return Object.prototype.toString.apply(value);
|
|
6963
|
-
}
|
|
6964
|
-
static isObject(value) {
|
|
6965
|
-
return this.getValueType(value) === "[object Object]";
|
|
6966
|
-
}
|
|
6967
|
-
static isIterable(value) {
|
|
6968
|
-
return value[Symbol.iterator] != null;
|
|
6969
|
-
}
|
|
6970
|
-
static isNumber(value) {
|
|
6971
|
-
return this.getValueType(value) === "[object Number]";
|
|
6972
|
-
}
|
|
6973
|
-
};
|
|
6974
|
-
|
|
6975
|
-
//#endregion
|
|
6976
|
-
//#region src/shared/max-row-column.ts
|
|
6977
|
-
/**
|
|
6978
|
-
* Copyright 2023-present DreamNum Co., Ltd.
|
|
6979
|
-
*
|
|
6980
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6981
|
-
* you may not use this file except in compliance with the License.
|
|
6982
|
-
* You may obtain a copy of the License at
|
|
6983
|
-
*
|
|
6984
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6985
|
-
*
|
|
6986
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
6987
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6988
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6989
|
-
* See the License for the specific language governing permissions and
|
|
6990
|
-
* limitations under the License.
|
|
6991
|
-
*/
|
|
6992
|
-
/**
|
|
6993
|
-
* Convert Excel column label to number
|
|
6994
|
-
* @param label Column label (e.g., "A", "Z", "AA", "XFD")
|
|
6995
|
-
* @returns Column number (e.g., 1, 26, 27, 16384)
|
|
6996
|
-
*/
|
|
6997
|
-
function columnLabelToNumber(label) {
|
|
6998
|
-
let n = 0;
|
|
6999
|
-
for (let i = 0; i < label.length; i++) {
|
|
7000
|
-
const c = label.charCodeAt(i);
|
|
7001
|
-
if (c < 65 || c > 90) return -1;
|
|
7002
|
-
n = n * 26 + (c - 64);
|
|
7003
|
-
}
|
|
7004
|
-
return n;
|
|
7005
|
-
}
|
|
7006
|
-
/**
|
|
7007
|
-
* Maximum number of rows and columns in Excel
|
|
7008
|
-
* Rows: 1,048,576
|
|
7009
|
-
* Columns: 16,384 (equivalent to column XFD)
|
|
7010
|
-
*/
|
|
7011
|
-
const MAX_ROW_COUNT = 1048576;
|
|
7012
|
-
const MAX_COLUMN_COUNT = 16384;
|
|
7013
|
-
|
|
7014
|
-
//#endregion
|
|
7015
|
-
//#region src/types/const/const.ts
|
|
7016
|
-
/**
|
|
7017
|
-
* Used as an illegal range array return value
|
|
7018
|
-
*/
|
|
7019
|
-
const DEFAULT_RANGE_ARRAY = {
|
|
7020
|
-
sheetId: "",
|
|
7021
|
-
range: {
|
|
7022
|
-
startRow: -1,
|
|
7023
|
-
endRow: -1,
|
|
7024
|
-
startColumn: -1,
|
|
7025
|
-
endColumn: -1
|
|
7026
|
-
}
|
|
7027
|
-
};
|
|
7028
|
-
/**
|
|
7029
|
-
* Used as an illegal range return value
|
|
7030
|
-
*/
|
|
7031
|
-
const DEFAULT_RANGE = {
|
|
7032
|
-
startRow: -1,
|
|
7033
|
-
startColumn: -1,
|
|
7034
|
-
endRow: -1,
|
|
7035
|
-
endColumn: -1
|
|
7036
|
-
};
|
|
7037
|
-
/**
|
|
7038
|
-
* Used as an init selection return value
|
|
7039
|
-
*/
|
|
7040
|
-
const DEFAULT_SELECTION = {
|
|
7041
|
-
startRow: 0,
|
|
7042
|
-
startColumn: 0,
|
|
7043
|
-
endRow: 0,
|
|
7044
|
-
endColumn: 0
|
|
7045
|
-
};
|
|
7046
|
-
/**
|
|
7047
|
-
* Used as an init cell return value
|
|
7048
|
-
*/
|
|
7049
|
-
const DEFAULT_CELL = {
|
|
7050
|
-
row: 0,
|
|
7051
|
-
column: 0
|
|
7052
|
-
};
|
|
7053
|
-
/**
|
|
7054
|
-
* Default styles.
|
|
7055
|
-
*/
|
|
7056
|
-
const DEFAULT_STYLES = {
|
|
7057
|
-
/**
|
|
7058
|
-
* fontFamily
|
|
7059
|
-
*/
|
|
7060
|
-
ff: "Arial",
|
|
7061
|
-
/**
|
|
7062
|
-
* fontSize
|
|
7063
|
-
*/
|
|
7064
|
-
fs: 11,
|
|
7065
|
-
/**
|
|
7066
|
-
* italic
|
|
7067
|
-
* 0: false
|
|
7068
|
-
* 1: true
|
|
7069
|
-
*/
|
|
7070
|
-
it: 0,
|
|
7071
|
-
/**
|
|
7072
|
-
* bold
|
|
7073
|
-
* 0: false
|
|
7074
|
-
* 1: true
|
|
7075
|
-
*/
|
|
7076
|
-
bl: 0,
|
|
7077
|
-
/**
|
|
7078
|
-
* underline
|
|
7079
|
-
*/
|
|
7080
|
-
ul: { s: 0 },
|
|
7081
|
-
/**
|
|
7082
|
-
* strikethrough
|
|
7083
|
-
*/
|
|
7084
|
-
st: { s: 0 },
|
|
7085
|
-
/**
|
|
7086
|
-
* overline
|
|
7087
|
-
*/
|
|
7088
|
-
ol: { s: 0 },
|
|
7089
|
-
/**
|
|
7090
|
-
* textRotation
|
|
7091
|
-
*/
|
|
7092
|
-
tr: {
|
|
7093
|
-
a: 0,
|
|
7094
|
-
/**
|
|
7095
|
-
* true : 1
|
|
7096
|
-
* false : 0
|
|
7097
|
-
*/
|
|
7098
|
-
v: 0
|
|
7099
|
-
},
|
|
7100
|
-
/**
|
|
7101
|
-
* textDirection
|
|
7102
|
-
*/
|
|
7103
|
-
td: 0,
|
|
7104
|
-
/**
|
|
7105
|
-
* color
|
|
7106
|
-
*/
|
|
7107
|
-
cl: { rgb: "#000000" },
|
|
7108
|
-
/**
|
|
7109
|
-
* background
|
|
7110
|
-
*/
|
|
7111
|
-
bg: { rgb: "#fff" },
|
|
7112
|
-
/**
|
|
7113
|
-
* horizontalAlignment
|
|
7114
|
-
*/
|
|
7115
|
-
ht: 0,
|
|
7116
|
-
/**
|
|
7117
|
-
* verticalAlignment
|
|
7118
|
-
*/
|
|
7119
|
-
vt: 0,
|
|
7120
|
-
/**
|
|
7121
|
-
* wrapStrategy
|
|
7122
|
-
*/
|
|
7123
|
-
tb: 0,
|
|
7124
|
-
/**
|
|
7125
|
-
* padding
|
|
7126
|
-
*/
|
|
7127
|
-
pd: {
|
|
7128
|
-
t: 0,
|
|
7129
|
-
r: 0,
|
|
7130
|
-
b: 0,
|
|
7131
|
-
l: 0
|
|
7132
|
-
},
|
|
7133
|
-
n: null,
|
|
7134
|
-
/**
|
|
7135
|
-
* border
|
|
7136
|
-
*/
|
|
7137
|
-
bd: {
|
|
7138
|
-
b: null,
|
|
7139
|
-
l: null,
|
|
7140
|
-
r: null,
|
|
7141
|
-
t: null
|
|
7228
|
+
const entry = this._keymap.get(key);
|
|
7229
|
+
if (!entry) return;
|
|
7230
|
+
this._keymap.delete(entry.key);
|
|
7231
|
+
if (entry[NEWER] && entry[OLDER]) {
|
|
7232
|
+
entry[OLDER][NEWER] = entry[NEWER];
|
|
7233
|
+
entry[NEWER][OLDER] = entry[OLDER];
|
|
7234
|
+
} else if (entry[NEWER]) {
|
|
7235
|
+
entry[NEWER][OLDER] = void 0;
|
|
7236
|
+
this.oldest = entry[NEWER];
|
|
7237
|
+
} else if (entry[OLDER]) {
|
|
7238
|
+
entry[OLDER][NEWER] = void 0;
|
|
7239
|
+
this.newest = entry[OLDER];
|
|
7240
|
+
} else this.oldest = this.newest = void 0;
|
|
7241
|
+
this.size--;
|
|
7242
|
+
return entry.value;
|
|
7243
|
+
}
|
|
7244
|
+
clear() {
|
|
7245
|
+
this.oldest = void 0;
|
|
7246
|
+
this.newest = void 0;
|
|
7247
|
+
this.size = 0;
|
|
7248
|
+
this._keymap.clear();
|
|
7249
|
+
}
|
|
7250
|
+
keys() {
|
|
7251
|
+
return new KeyIterator(this.oldest);
|
|
7252
|
+
}
|
|
7253
|
+
values() {
|
|
7254
|
+
return new ValueIterator(this.oldest);
|
|
7255
|
+
}
|
|
7256
|
+
entries() {
|
|
7257
|
+
return this[Symbol.iterator]();
|
|
7258
|
+
}
|
|
7259
|
+
[_Symbol$iterator4]() {
|
|
7260
|
+
return new EntryIterator(this.oldest);
|
|
7261
|
+
}
|
|
7262
|
+
forEach(fun, thisObj) {
|
|
7263
|
+
if (typeof thisObj !== "object") thisObj = this;
|
|
7264
|
+
let entry = this.oldest;
|
|
7265
|
+
while (entry) {
|
|
7266
|
+
fun.call(thisObj, entry.value, entry.key, this);
|
|
7267
|
+
entry = entry[NEWER];
|
|
7268
|
+
}
|
|
7269
|
+
}
|
|
7270
|
+
toJSON() {
|
|
7271
|
+
const s = new Array(this.size);
|
|
7272
|
+
let i = 0;
|
|
7273
|
+
let entry = this.oldest;
|
|
7274
|
+
while (entry) {
|
|
7275
|
+
s[i++] = {
|
|
7276
|
+
key: entry.key,
|
|
7277
|
+
value: entry.value
|
|
7278
|
+
};
|
|
7279
|
+
entry = entry[NEWER];
|
|
7280
|
+
}
|
|
7281
|
+
return s;
|
|
7282
|
+
}
|
|
7283
|
+
toString() {
|
|
7284
|
+
let s = String();
|
|
7285
|
+
let entry = this.oldest;
|
|
7286
|
+
while (entry) {
|
|
7287
|
+
s += `${String(entry.key)}:${entry.value}`;
|
|
7288
|
+
entry = entry[NEWER];
|
|
7289
|
+
if (entry) s += " < ";
|
|
7290
|
+
}
|
|
7291
|
+
return s;
|
|
7142
7292
|
}
|
|
7143
7293
|
};
|
|
7144
|
-
|
|
7145
|
-
|
|
7146
|
-
|
|
7147
|
-
|
|
7148
|
-
|
|
7149
|
-
|
|
7150
|
-
|
|
7151
|
-
|
|
7152
|
-
|
|
7153
|
-
}
|
|
7154
|
-
|
|
7155
|
-
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
bl: 1
|
|
7161
|
-
},
|
|
7162
|
-
[7]: {
|
|
7163
|
-
fs: 14,
|
|
7164
|
-
bl: 1
|
|
7165
|
-
},
|
|
7166
|
-
[8]: {
|
|
7167
|
-
fs: 12,
|
|
7168
|
-
bl: 1
|
|
7169
|
-
},
|
|
7170
|
-
[1]: null,
|
|
7171
|
-
[2]: {
|
|
7172
|
-
fs: 26,
|
|
7173
|
-
bl: 1
|
|
7174
|
-
},
|
|
7175
|
-
[3]: {
|
|
7176
|
-
fs: 15,
|
|
7177
|
-
cl: { rgb: "#999999" }
|
|
7178
|
-
},
|
|
7179
|
-
[0]: null
|
|
7180
|
-
};
|
|
7181
|
-
const BOTTOM_P = 4;
|
|
7182
|
-
const NAMED_STYLE_SPACE_MAP = {
|
|
7183
|
-
[4]: {
|
|
7184
|
-
spaceAbove: { v: 20 },
|
|
7185
|
-
spaceBelow: { v: 6 + BOTTOM_P }
|
|
7186
|
-
},
|
|
7187
|
-
[5]: {
|
|
7188
|
-
spaceAbove: { v: 18 },
|
|
7189
|
-
spaceBelow: { v: 6 + BOTTOM_P }
|
|
7190
|
-
},
|
|
7191
|
-
[6]: {
|
|
7192
|
-
spaceAbove: { v: 16 },
|
|
7193
|
-
spaceBelow: { v: 6 + BOTTOM_P }
|
|
7194
|
-
},
|
|
7195
|
-
[7]: {
|
|
7196
|
-
spaceAbove: { v: 14 },
|
|
7197
|
-
spaceBelow: { v: 4 + BOTTOM_P }
|
|
7198
|
-
},
|
|
7199
|
-
[8]: {
|
|
7200
|
-
spaceAbove: { v: 12 },
|
|
7201
|
-
spaceBelow: { v: 4 + BOTTOM_P }
|
|
7202
|
-
},
|
|
7203
|
-
[1]: {
|
|
7204
|
-
spaceAbove: { v: 0 },
|
|
7205
|
-
spaceBelow: { v: 0 }
|
|
7206
|
-
},
|
|
7207
|
-
[2]: {
|
|
7208
|
-
spaceAbove: { v: 0 },
|
|
7209
|
-
spaceBelow: { v: 3 + BOTTOM_P }
|
|
7210
|
-
},
|
|
7211
|
-
[3]: {
|
|
7212
|
-
spaceAbove: { v: 0 },
|
|
7213
|
-
spaceBelow: { v: 16 }
|
|
7214
|
-
},
|
|
7215
|
-
[0]: null
|
|
7294
|
+
var LRUHelper = class {
|
|
7295
|
+
static hasLength(array, size) {
|
|
7296
|
+
return array.length === size;
|
|
7297
|
+
}
|
|
7298
|
+
static getValueType(value) {
|
|
7299
|
+
return Object.prototype.toString.apply(value);
|
|
7300
|
+
}
|
|
7301
|
+
static isObject(value) {
|
|
7302
|
+
return this.getValueType(value) === "[object Object]";
|
|
7303
|
+
}
|
|
7304
|
+
static isIterable(value) {
|
|
7305
|
+
return value[Symbol.iterator] != null;
|
|
7306
|
+
}
|
|
7307
|
+
static isNumber(value) {
|
|
7308
|
+
return this.getValueType(value) === "[object Number]";
|
|
7309
|
+
}
|
|
7216
7310
|
};
|
|
7217
|
-
const PRINT_CHART_COMPONENT_KEY = "univer-sheets-chart-print-chart";
|
|
7218
|
-
const DOC_DRAWING_PRINTING_COMPONENT_KEY = "univer-docs-drawing-printing";
|
|
7219
7311
|
|
|
7220
7312
|
//#endregion
|
|
7221
|
-
//#region src/
|
|
7313
|
+
//#region src/shared/max-row-column.ts
|
|
7222
7314
|
/**
|
|
7223
7315
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
7224
7316
|
*
|
|
@@ -7234,60 +7326,27 @@ const DOC_DRAWING_PRINTING_COMPONENT_KEY = "univer-docs-drawing-printing";
|
|
|
7234
7326
|
* See the License for the specific language governing permissions and
|
|
7235
7327
|
* limitations under the License.
|
|
7236
7328
|
*/
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
const
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
height: 1587
|
|
7249
|
-
},
|
|
7250
|
-
["A4"]: {
|
|
7251
|
-
width: 794,
|
|
7252
|
-
height: 1124
|
|
7253
|
-
},
|
|
7254
|
-
["A5"]: {
|
|
7255
|
-
width: 559,
|
|
7256
|
-
height: 794
|
|
7257
|
-
},
|
|
7258
|
-
["B4"]: {
|
|
7259
|
-
width: 944,
|
|
7260
|
-
height: 1344
|
|
7261
|
-
},
|
|
7262
|
-
["B5"]: {
|
|
7263
|
-
width: 665,
|
|
7264
|
-
height: 944
|
|
7265
|
-
},
|
|
7266
|
-
["Executive"]: {
|
|
7267
|
-
width: 696,
|
|
7268
|
-
height: 1008
|
|
7269
|
-
},
|
|
7270
|
-
["Folio"]: {
|
|
7271
|
-
width: 816,
|
|
7272
|
-
height: 1248
|
|
7273
|
-
},
|
|
7274
|
-
["Legal"]: {
|
|
7275
|
-
width: 816,
|
|
7276
|
-
height: 1344
|
|
7277
|
-
},
|
|
7278
|
-
["Letter"]: {
|
|
7279
|
-
width: 816,
|
|
7280
|
-
height: 1056
|
|
7281
|
-
},
|
|
7282
|
-
["Statement"]: {
|
|
7283
|
-
width: 528,
|
|
7284
|
-
height: 816
|
|
7285
|
-
},
|
|
7286
|
-
["Tabloid"]: {
|
|
7287
|
-
width: 1056,
|
|
7288
|
-
height: 1632
|
|
7329
|
+
/**
|
|
7330
|
+
* Convert Excel column label to number
|
|
7331
|
+
* @param label Column label (e.g., "A", "Z", "AA", "XFD")
|
|
7332
|
+
* @returns Column number (e.g., 1, 26, 27, 16384)
|
|
7333
|
+
*/
|
|
7334
|
+
function columnLabelToNumber(label) {
|
|
7335
|
+
let n = 0;
|
|
7336
|
+
for (let i = 0; i < label.length; i++) {
|
|
7337
|
+
const c = label.charCodeAt(i);
|
|
7338
|
+
if (c < 65 || c > 90) return -1;
|
|
7339
|
+
n = n * 26 + (c - 64);
|
|
7289
7340
|
}
|
|
7290
|
-
|
|
7341
|
+
return n;
|
|
7342
|
+
}
|
|
7343
|
+
/**
|
|
7344
|
+
* Maximum number of rows and columns in Excel
|
|
7345
|
+
* Rows: 1,048,576
|
|
7346
|
+
* Columns: 16,384 (equivalent to column XFD)
|
|
7347
|
+
*/
|
|
7348
|
+
const MAX_ROW_COUNT = 1048576;
|
|
7349
|
+
const MAX_COLUMN_COUNT = 16384;
|
|
7291
7350
|
|
|
7292
7351
|
//#endregion
|
|
7293
7352
|
//#region src/sheets/range.ts
|
|
@@ -8782,7 +8841,7 @@ function ABCToNumber(a) {
|
|
|
8782
8841
|
return numOut - 1;
|
|
8783
8842
|
}
|
|
8784
8843
|
const orderA = "A".charCodeAt(0);
|
|
8785
|
-
|
|
8844
|
+
"Z".charCodeAt(0);
|
|
8786
8845
|
const order_a = "a".charCodeAt(0);
|
|
8787
8846
|
"z".charCodeAt(0);
|
|
8788
8847
|
/**
|
|
@@ -8791,7 +8850,7 @@ const order_a = "a".charCodeAt(0);
|
|
|
8791
8850
|
* @returns
|
|
8792
8851
|
*/
|
|
8793
8852
|
function numberToABC(n) {
|
|
8794
|
-
const len =
|
|
8853
|
+
const len = 26;
|
|
8795
8854
|
let s = "";
|
|
8796
8855
|
while (n >= 0) {
|
|
8797
8856
|
s = String.fromCharCode(n % len + orderA) + s;
|
|
@@ -8820,7 +8879,7 @@ function repeatStringNumTimes(string, times) {
|
|
|
8820
8879
|
* @returns
|
|
8821
8880
|
*/
|
|
8822
8881
|
function numberToListABC(n, uppercase = false) {
|
|
8823
|
-
const len =
|
|
8882
|
+
const len = 26;
|
|
8824
8883
|
let order = order_a;
|
|
8825
8884
|
if (uppercase) order = orderA;
|
|
8826
8885
|
return repeatStringNumTimes(String.fromCharCode(n % len + order), Math.floor(n / len) + 1);
|
|
@@ -9043,6 +9102,30 @@ function insertTables(body, insertBody, textLength, currentIndex) {
|
|
|
9043
9102
|
tables.sort(sortRulesFactory("startIndex"));
|
|
9044
9103
|
}
|
|
9045
9104
|
}
|
|
9105
|
+
function insertBlockRanges(body, insertBody, textLength, currentIndex) {
|
|
9106
|
+
var _insertBody$blockRang;
|
|
9107
|
+
if (!body.blockRanges && !((_insertBody$blockRang = insertBody.blockRanges) === null || _insertBody$blockRang === void 0 ? void 0 : _insertBody$blockRang.length)) return;
|
|
9108
|
+
if (!body.blockRanges) body.blockRanges = [];
|
|
9109
|
+
const { blockRanges } = body;
|
|
9110
|
+
for (let i = 0, len = blockRanges.length; i < len; i++) {
|
|
9111
|
+
const blockRange = blockRanges[i];
|
|
9112
|
+
const { startIndex, endIndex } = blockRange;
|
|
9113
|
+
if (startIndex >= currentIndex) {
|
|
9114
|
+
blockRange.startIndex += textLength;
|
|
9115
|
+
blockRange.endIndex += textLength;
|
|
9116
|
+
} else if (endIndex >= currentIndex) blockRange.endIndex += textLength;
|
|
9117
|
+
}
|
|
9118
|
+
const insertBlockRanges = insertBody.blockRanges;
|
|
9119
|
+
if (insertBlockRanges) {
|
|
9120
|
+
for (let i = 0, len = insertBlockRanges.length; i < len; i++) {
|
|
9121
|
+
const blockRange = insertBlockRanges[i];
|
|
9122
|
+
blockRange.startIndex += currentIndex;
|
|
9123
|
+
blockRange.endIndex += currentIndex;
|
|
9124
|
+
}
|
|
9125
|
+
blockRanges.push(...insertBlockRanges);
|
|
9126
|
+
blockRanges.sort(sortRulesFactory("startIndex"));
|
|
9127
|
+
}
|
|
9128
|
+
}
|
|
9046
9129
|
const ID_SPLIT_SYMBOL = "$";
|
|
9047
9130
|
const getRootId = (id) => id.split(ID_SPLIT_SYMBOL)[0];
|
|
9048
9131
|
function mergeContinuousRanges(ranges) {
|
|
@@ -9378,6 +9461,37 @@ function deleteCustomRanges(body, textLength, currentIndex) {
|
|
|
9378
9461
|
}
|
|
9379
9462
|
return removeCustomRanges;
|
|
9380
9463
|
}
|
|
9464
|
+
function deleteBlockRanges(body, textLength, currentIndex) {
|
|
9465
|
+
const { blockRanges } = body;
|
|
9466
|
+
const startIndex = currentIndex;
|
|
9467
|
+
const endIndex = currentIndex + textLength - 1;
|
|
9468
|
+
const removeBlockRanges = [];
|
|
9469
|
+
if (blockRanges) {
|
|
9470
|
+
const newBlockRanges = [];
|
|
9471
|
+
for (let i = 0, len = blockRanges.length; i < len; i++) {
|
|
9472
|
+
const blockRange = blockRanges[i];
|
|
9473
|
+
const { startIndex: st, endIndex: ed } = blockRange;
|
|
9474
|
+
if (st >= startIndex && ed <= endIndex) {
|
|
9475
|
+
removeBlockRanges.push(blockRange);
|
|
9476
|
+
continue;
|
|
9477
|
+
} else if (Math.max(startIndex, st) <= Math.min(endIndex, ed)) {
|
|
9478
|
+
const segments = horizontalLineSegmentsSubtraction(st, ed, startIndex, endIndex);
|
|
9479
|
+
if (segments.length === 0) {
|
|
9480
|
+
removeBlockRanges.push(blockRange);
|
|
9481
|
+
continue;
|
|
9482
|
+
}
|
|
9483
|
+
blockRange.startIndex = segments[0];
|
|
9484
|
+
blockRange.endIndex = segments[1];
|
|
9485
|
+
} else if (endIndex < st) {
|
|
9486
|
+
blockRange.startIndex -= textLength;
|
|
9487
|
+
blockRange.endIndex -= textLength;
|
|
9488
|
+
}
|
|
9489
|
+
newBlockRanges.push(blockRange);
|
|
9490
|
+
}
|
|
9491
|
+
body.blockRanges = newBlockRanges;
|
|
9492
|
+
}
|
|
9493
|
+
return removeBlockRanges;
|
|
9494
|
+
}
|
|
9381
9495
|
function deleteCustomDecorations(body, textLength, currentIndex, needOffset = true) {
|
|
9382
9496
|
const { customDecorations } = body;
|
|
9383
9497
|
const startIndex = currentIndex;
|
|
@@ -9844,6 +9958,7 @@ function updateAttribute(body, updateBody, textLength, currentIndex, coverType)
|
|
|
9844
9958
|
sectionBreaks: updateSectionBreaks(body, updateBody, textLength, currentIndex, coverType),
|
|
9845
9959
|
customBlocks: updateCustomBlocks(body, updateBody, textLength, currentIndex, coverType),
|
|
9846
9960
|
tables: updateTables(body, updateBody, textLength, currentIndex, coverType),
|
|
9961
|
+
blockRanges: updateBlockRanges(body, updateBody, textLength, currentIndex, coverType),
|
|
9847
9962
|
customRanges: updateCustomRanges(body, updateBody, textLength, currentIndex, coverType),
|
|
9848
9963
|
customDecorations: updateCustomDecorations(body, updateBody, textLength, currentIndex, coverType)
|
|
9849
9964
|
};
|
|
@@ -10085,6 +10200,21 @@ function updateTables(body, updateBody, textLength, currentIndex, coverType) {
|
|
|
10085
10200
|
insertTables(body, updateBody, textLength, currentIndex);
|
|
10086
10201
|
return removeTables;
|
|
10087
10202
|
}
|
|
10203
|
+
function updateBlockRanges(body, updateBody, textLength, currentIndex, coverType) {
|
|
10204
|
+
const { blockRanges } = body;
|
|
10205
|
+
const { blockRanges: updateDataBlockRanges } = updateBody;
|
|
10206
|
+
if (blockRanges == null || updateDataBlockRanges == null) return;
|
|
10207
|
+
const removeBlockRanges = deleteBlockRanges(body, textLength, currentIndex);
|
|
10208
|
+
if (coverType !== 1) updateBody.blockRanges = updateDataBlockRanges.map((updateBlockRange) => {
|
|
10209
|
+
const removeBlockRange = removeBlockRanges.find((blockRange) => blockRange.blockId === updateBlockRange.blockId);
|
|
10210
|
+
return removeBlockRange ? {
|
|
10211
|
+
...removeBlockRange,
|
|
10212
|
+
...updateBlockRange
|
|
10213
|
+
} : updateBlockRange;
|
|
10214
|
+
});
|
|
10215
|
+
insertBlockRanges(body, updateBody, textLength, currentIndex);
|
|
10216
|
+
return removeBlockRanges;
|
|
10217
|
+
}
|
|
10088
10218
|
function updateCustomRanges(body, updateBody, textLength, currentIndex, _coverType) {
|
|
10089
10219
|
if (!body.customRanges) body.customRanges = [];
|
|
10090
10220
|
splitCustomRangesByIndex(body.customRanges, currentIndex);
|
|
@@ -10199,21 +10329,50 @@ function getTableSlice(body, startOffset, endOffset) {
|
|
|
10199
10329
|
for (const table of tables) {
|
|
10200
10330
|
const clonedTable = Tools.deepClone(table);
|
|
10201
10331
|
const { startIndex, endIndex } = clonedTable;
|
|
10202
|
-
if (startIndex
|
|
10332
|
+
if (Math.max(startIndex, startOffset) < Math.min(endIndex, endOffset)) newTables.push({
|
|
10203
10333
|
...clonedTable,
|
|
10334
|
+
startIndex: Math.max(startIndex, startOffset) - startOffset,
|
|
10335
|
+
endIndex: Math.min(endIndex, endOffset) - startOffset
|
|
10336
|
+
});
|
|
10337
|
+
}
|
|
10338
|
+
return newTables;
|
|
10339
|
+
}
|
|
10340
|
+
function getBlockRangeSlice(body, startOffset, endOffset) {
|
|
10341
|
+
const { blockRanges = [] } = body;
|
|
10342
|
+
const newBlockRanges = [];
|
|
10343
|
+
for (const blockRange of blockRanges) {
|
|
10344
|
+
const clonedBlockRange = Tools.deepClone(blockRange);
|
|
10345
|
+
const { startIndex, endIndex } = clonedBlockRange;
|
|
10346
|
+
if (startIndex >= startOffset && endIndex < endOffset) newBlockRanges.push({
|
|
10347
|
+
...clonedBlockRange,
|
|
10204
10348
|
startIndex: startIndex - startOffset,
|
|
10205
10349
|
endIndex: endIndex - startOffset
|
|
10206
10350
|
});
|
|
10207
10351
|
}
|
|
10208
|
-
return
|
|
10352
|
+
return newBlockRanges;
|
|
10209
10353
|
}
|
|
10210
|
-
function getParagraphsSlice(body, startOffset, endOffset) {
|
|
10354
|
+
function getParagraphsSlice(body, startOffset, endOffset, type = 1) {
|
|
10211
10355
|
const { paragraphs = [] } = body;
|
|
10212
10356
|
const newParagraphs = [];
|
|
10213
|
-
|
|
10214
|
-
const
|
|
10215
|
-
|
|
10357
|
+
if (type === 1) {
|
|
10358
|
+
for (const paragraph of paragraphs) {
|
|
10359
|
+
const { startIndex } = paragraph;
|
|
10360
|
+
if (startIndex >= startOffset && startIndex < endOffset) newParagraphs.push(Tools.deepClone(paragraph));
|
|
10361
|
+
}
|
|
10362
|
+
if (newParagraphs.length) return newParagraphs.map((p) => ({
|
|
10363
|
+
...p,
|
|
10364
|
+
startIndex: p.startIndex - startOffset
|
|
10365
|
+
}));
|
|
10366
|
+
return;
|
|
10367
|
+
}
|
|
10368
|
+
const sortedParagraphs = [...paragraphs].sort((a, b) => a.startIndex - b.startIndex);
|
|
10369
|
+
for (let index = 0; index < sortedParagraphs.length; index++) {
|
|
10370
|
+
const paragraph = sortedParagraphs[index];
|
|
10371
|
+
const paragraphStart = index > 0 ? sortedParagraphs[index - 1].startIndex + 1 : 0;
|
|
10372
|
+
const paragraphEnd = paragraph.startIndex;
|
|
10373
|
+
if (paragraphEnd >= startOffset && paragraphEnd < endOffset || Math.max(paragraphStart, startOffset) < Math.min(paragraphEnd, endOffset)) {
|
|
10216
10374
|
const copy = Tools.deepClone(paragraph);
|
|
10375
|
+
copy.startIndex = Math.min(Math.max(paragraphEnd, startOffset), endOffset);
|
|
10217
10376
|
newParagraphs.push(copy);
|
|
10218
10377
|
}
|
|
10219
10378
|
}
|
|
@@ -10252,7 +10411,9 @@ function getBodySlice(body, startOffset, endOffset, returnEmptyArray = true, typ
|
|
|
10252
10411
|
docBody.textRuns = getTextRunSlice(body, startOffset, endOffset, returnEmptyArray);
|
|
10253
10412
|
const newTables = getTableSlice(body, startOffset, endOffset);
|
|
10254
10413
|
if (newTables.length) docBody.tables = newTables;
|
|
10255
|
-
|
|
10414
|
+
const newBlockRanges = getBlockRangeSlice(body, startOffset, endOffset);
|
|
10415
|
+
if (newBlockRanges.length) docBody.blockRanges = newBlockRanges;
|
|
10416
|
+
docBody.paragraphs = getParagraphsSlice(body, startOffset, endOffset, type);
|
|
10256
10417
|
if (type === 1) {
|
|
10257
10418
|
const customDecorations = getCustomDecorationSlice(body, startOffset, endOffset);
|
|
10258
10419
|
if (customDecorations) docBody.customDecorations = customDecorations;
|
|
@@ -10265,7 +10426,7 @@ function getBodySlice(body, startOffset, endOffset, returnEmptyArray = true, typ
|
|
|
10265
10426
|
return docBody;
|
|
10266
10427
|
}
|
|
10267
10428
|
function normalizeBody(body) {
|
|
10268
|
-
const { dataStream, textRuns, paragraphs, customRanges, customDecorations, tables } = body;
|
|
10429
|
+
const { dataStream, textRuns, paragraphs, customRanges, customDecorations, tables, blockRanges } = body;
|
|
10269
10430
|
let leftOffset = 0;
|
|
10270
10431
|
let rightOffset = 0;
|
|
10271
10432
|
customRanges === null || customRanges === void 0 || customRanges.forEach((range) => {
|
|
@@ -10303,7 +10464,8 @@ function normalizeBody(body) {
|
|
|
10303
10464
|
paragraphs,
|
|
10304
10465
|
customRanges,
|
|
10305
10466
|
customDecorations,
|
|
10306
|
-
tables
|
|
10467
|
+
tables,
|
|
10468
|
+
blockRanges
|
|
10307
10469
|
};
|
|
10308
10470
|
}
|
|
10309
10471
|
function getCustomRangeSlice(body, startOffset, endOffset) {
|
|
@@ -10365,8 +10527,8 @@ function composeCustomDecorations(updateDataCustomDecorations, originCustomDecor
|
|
|
10365
10527
|
function composeBody(thisBody, otherBody, coverType = 0) {
|
|
10366
10528
|
if (otherBody.dataStream !== "") throw new Error("Cannot compose other body with non-empty dataStream");
|
|
10367
10529
|
const retBody = { dataStream: thisBody.dataStream };
|
|
10368
|
-
const { textRuns: thisTextRuns, paragraphs: thisParagraphs = [], customRanges: thisCustomRanges, customDecorations: thisCustomDecorations = [] } = thisBody;
|
|
10369
|
-
const { textRuns: otherTextRuns, paragraphs: otherParagraphs = [], customRanges: otherCustomRanges, customDecorations: otherCustomDecorations = [] } = otherBody;
|
|
10530
|
+
const { textRuns: thisTextRuns, paragraphs: thisParagraphs = [], customRanges: thisCustomRanges, customDecorations: thisCustomDecorations = [], blockRanges: thisBlockRanges = [] } = thisBody;
|
|
10531
|
+
const { textRuns: otherTextRuns, paragraphs: otherParagraphs = [], customRanges: otherCustomRanges, customDecorations: otherCustomDecorations = [], blockRanges: otherBlockRanges = [] } = otherBody;
|
|
10370
10532
|
retBody.textRuns = composeTextRuns(otherTextRuns, thisTextRuns, coverType);
|
|
10371
10533
|
retBody.customRanges = composeCustomRanges(otherCustomRanges, thisCustomRanges, coverType);
|
|
10372
10534
|
const customDecorations = composeCustomDecorations(otherCustomDecorations, thisCustomDecorations, coverType);
|
|
@@ -10394,13 +10556,22 @@ function composeBody(thisBody, otherBody, coverType = 0) {
|
|
|
10394
10556
|
if (thisIndex < thisParagraphs.length) paragraphs.push(...thisParagraphs.slice(thisIndex));
|
|
10395
10557
|
if (otherIndex < otherParagraphs.length) paragraphs.push(...otherParagraphs.slice(otherIndex));
|
|
10396
10558
|
if (paragraphs.length) retBody.paragraphs = paragraphs;
|
|
10559
|
+
const blockRanges = composeDocumentBlockRanges(thisBlockRanges, otherBlockRanges);
|
|
10560
|
+
if (blockRanges.length) retBody.blockRanges = blockRanges;
|
|
10397
10561
|
return retBody;
|
|
10398
10562
|
}
|
|
10563
|
+
function composeDocumentBlockRanges(thisRanges, otherRanges) {
|
|
10564
|
+
if (!thisRanges.length) return otherRanges;
|
|
10565
|
+
if (!otherRanges.length) return thisRanges;
|
|
10566
|
+
const byId = new Map(thisRanges.map((range) => [range.blockId, Tools.deepClone(range)]));
|
|
10567
|
+
otherRanges.forEach((range) => byId.set(range.blockId, Tools.deepClone(range)));
|
|
10568
|
+
return Array.from(byId.values()).sort((left, right) => left.startIndex - right.startIndex);
|
|
10569
|
+
}
|
|
10399
10570
|
function isUselessRetainAction(action) {
|
|
10400
10571
|
const { body } = action;
|
|
10401
10572
|
if (body == null) return true;
|
|
10402
|
-
const { textRuns, paragraphs, customRanges, customBlocks, customDecorations, tables } = body;
|
|
10403
|
-
if (textRuns == null && paragraphs == null && customRanges == null && customBlocks == null && customDecorations == null && tables == null) return true;
|
|
10573
|
+
const { textRuns, paragraphs, customRanges, customBlocks, customDecorations, tables, blockRanges } = body;
|
|
10574
|
+
if (textRuns == null && paragraphs == null && customRanges == null && customBlocks == null && customDecorations == null && tables == null && blockRanges == null) return true;
|
|
10404
10575
|
return false;
|
|
10405
10576
|
}
|
|
10406
10577
|
|
|
@@ -10487,6 +10658,7 @@ function updateAttributeByDelete(body, textLength, currentIndex) {
|
|
|
10487
10658
|
const removeSectionBreaks = deleteSectionBreaks(body, textLength, currentIndex);
|
|
10488
10659
|
const removeCustomBlocks = deleteCustomBlocks(body, textLength, currentIndex);
|
|
10489
10660
|
const removeTables = deleteTables(body, textLength, currentIndex);
|
|
10661
|
+
const removeBlockRanges = deleteBlockRanges(body, textLength, currentIndex);
|
|
10490
10662
|
const removeCustomRanges = deleteCustomRanges(body, textLength, currentIndex);
|
|
10491
10663
|
const removeCustomDecorations = deleteCustomDecorations(body, textLength, currentIndex);
|
|
10492
10664
|
let removeDataStream = "";
|
|
@@ -10501,6 +10673,7 @@ function updateAttributeByDelete(body, textLength, currentIndex) {
|
|
|
10501
10673
|
sectionBreaks: removeSectionBreaks,
|
|
10502
10674
|
customBlocks: removeCustomBlocks,
|
|
10503
10675
|
tables: removeTables,
|
|
10676
|
+
blockRanges: removeBlockRanges,
|
|
10504
10677
|
customRanges: removeCustomRanges,
|
|
10505
10678
|
customDecorations: removeCustomDecorations
|
|
10506
10679
|
};
|
|
@@ -10515,6 +10688,7 @@ function updateAttributeByInsert(body, insertBody, textLength, currentIndex) {
|
|
|
10515
10688
|
insertSectionBreaks(body, insertBody, textLength, currentIndex);
|
|
10516
10689
|
insertCustomBlocks(body, insertBody, textLength, currentIndex);
|
|
10517
10690
|
insertTables(body, insertBody, textLength, currentIndex);
|
|
10691
|
+
insertBlockRanges(body, insertBody, textLength, currentIndex);
|
|
10518
10692
|
insertCustomRanges(body, insertBody, textLength, currentIndex);
|
|
10519
10693
|
insertCustomDecorations(body, insertBody, textLength, currentIndex);
|
|
10520
10694
|
}
|
|
@@ -10730,8 +10904,8 @@ function transformBody(thisAction, otherAction, priority = false) {
|
|
|
10730
10904
|
if (thisBody == null || thisBody.dataStream !== "" || otherBody == null || otherBody.dataStream !== "") throw new Error("Data stream is not supported in retain transform.");
|
|
10731
10905
|
const retBody = { dataStream: "" };
|
|
10732
10906
|
const coverType = otherCoverType;
|
|
10733
|
-
const { textRuns: thisTextRuns, paragraphs: thisParagraphs = [], customRanges: thisCustomRanges, customDecorations: thisCustomDecorations } = thisBody;
|
|
10734
|
-
const { textRuns: otherTextRuns, paragraphs: otherParagraphs = [], customRanges: otherCustomRanges, customDecorations: otherCustomDecorations } = otherBody;
|
|
10907
|
+
const { textRuns: thisTextRuns, paragraphs: thisParagraphs = [], blockRanges: thisBlockRanges = [], customRanges: thisCustomRanges, customDecorations: thisCustomDecorations } = thisBody;
|
|
10908
|
+
const { textRuns: otherTextRuns, paragraphs: otherParagraphs = [], blockRanges: otherBlockRanges = [], customRanges: otherCustomRanges, customDecorations: otherCustomDecorations } = otherBody;
|
|
10735
10909
|
const textRuns = transformTextRuns(thisTextRuns, otherTextRuns, thisCoverType, otherCoverType, priority ? 1 : 0);
|
|
10736
10910
|
if (textRuns) retBody.textRuns = textRuns;
|
|
10737
10911
|
const customRanges = transformCustomRanges(thisCustomRanges, otherCustomRanges, thisCoverType, otherCoverType, priority ? 1 : 0);
|
|
@@ -10761,11 +10935,21 @@ function transformBody(thisAction, otherAction, priority = false) {
|
|
|
10761
10935
|
}
|
|
10762
10936
|
if (otherIndex < otherParagraphs.length) paragraphs.push(...otherParagraphs.slice(otherIndex));
|
|
10763
10937
|
if (paragraphs.length) retBody.paragraphs = paragraphs;
|
|
10938
|
+
const blockRanges = transformBlockRanges(thisBlockRanges, otherBlockRanges, priority);
|
|
10939
|
+
if (blockRanges.length) retBody.blockRanges = blockRanges;
|
|
10764
10940
|
return {
|
|
10765
10941
|
coverType,
|
|
10766
10942
|
body: retBody
|
|
10767
10943
|
};
|
|
10768
10944
|
}
|
|
10945
|
+
function transformBlockRanges(thisBlockRanges, otherBlockRanges, priority) {
|
|
10946
|
+
if (!thisBlockRanges.length) return otherBlockRanges;
|
|
10947
|
+
if (!otherBlockRanges.length) return [];
|
|
10948
|
+
return otherBlockRanges.map((otherBlockRange) => {
|
|
10949
|
+
const thisBlockRange = thisBlockRanges.find((blockRange) => blockRange.blockId === otherBlockRange.blockId);
|
|
10950
|
+
return thisBlockRange && priority ? Tools.deepMerge(otherBlockRange, thisBlockRange) : otherBlockRange;
|
|
10951
|
+
});
|
|
10952
|
+
}
|
|
10769
10953
|
|
|
10770
10954
|
//#endregion
|
|
10771
10955
|
//#region src/docs/data-model/text-x/text-x.ts
|
|
@@ -11098,6 +11282,7 @@ let DataStreamTreeNodeType = /* @__PURE__ */ function(DataStreamTreeNodeType) {
|
|
|
11098
11282
|
DataStreamTreeNodeType["TABLE"] = "TABLE";
|
|
11099
11283
|
DataStreamTreeNodeType["TABLE_ROW"] = "TABLE_ROW";
|
|
11100
11284
|
DataStreamTreeNodeType["TABLE_CELL"] = "TABLE_CELL";
|
|
11285
|
+
DataStreamTreeNodeType["BLOCK"] = "BLOCK";
|
|
11101
11286
|
DataStreamTreeNodeType["CUSTOM_BLOCK"] = "CUSTOM_BLOCK";
|
|
11102
11287
|
return DataStreamTreeNodeType;
|
|
11103
11288
|
}({});
|
|
@@ -11110,6 +11295,8 @@ let DataStreamTreeTokenType = /* @__PURE__ */ function(DataStreamTreeTokenType)
|
|
|
11110
11295
|
DataStreamTreeTokenType["TABLE_CELL_END"] = "";
|
|
11111
11296
|
DataStreamTreeTokenType["TABLE_ROW_END"] = "";
|
|
11112
11297
|
DataStreamTreeTokenType["TABLE_END"] = "";
|
|
11298
|
+
DataStreamTreeTokenType["BLOCK_START"] = "";
|
|
11299
|
+
DataStreamTreeTokenType["BLOCK_END"] = "";
|
|
11113
11300
|
/**
|
|
11114
11301
|
* @deprecated
|
|
11115
11302
|
*/
|
|
@@ -11140,11 +11327,13 @@ const tags = [
|
|
|
11140
11327
|
"",
|
|
11141
11328
|
"",
|
|
11142
11329
|
"",
|
|
11143
|
-
""
|
|
11330
|
+
"",
|
|
11331
|
+
"",
|
|
11332
|
+
""
|
|
11144
11333
|
];
|
|
11145
11334
|
const getPlainText = (dataStream) => {
|
|
11146
|
-
const text =
|
|
11147
|
-
return
|
|
11335
|
+
const text = tags.reduce((res, curr) => res.replaceAll(curr, ""), dataStream);
|
|
11336
|
+
return text.endsWith("\r\n") ? text.slice(0, -2) : text;
|
|
11148
11337
|
};
|
|
11149
11338
|
const isEmptyDocument = (dataStream) => {
|
|
11150
11339
|
if (!dataStream) return true;
|
|
@@ -14756,7 +14945,7 @@ const IURLImageService = createIdentifier("core.url-image.service");
|
|
|
14756
14945
|
//#endregion
|
|
14757
14946
|
//#region package.json
|
|
14758
14947
|
var name = "@univerjs/core";
|
|
14759
|
-
var version = "0.
|
|
14948
|
+
var version = "0.25.0";
|
|
14760
14949
|
|
|
14761
14950
|
//#endregion
|
|
14762
14951
|
//#region src/sheets/empty-snapshot.ts
|
|
@@ -14902,10 +15091,12 @@ function createDocumentModelWithStyle(content, textStyle, config = {}) {
|
|
|
14902
15091
|
width: Number.POSITIVE_INFINITY,
|
|
14903
15092
|
height: Number.POSITIVE_INFINITY
|
|
14904
15093
|
},
|
|
15094
|
+
documentFlavor: 0,
|
|
14905
15095
|
marginTop,
|
|
14906
15096
|
marginBottom,
|
|
14907
15097
|
marginRight,
|
|
14908
15098
|
marginLeft,
|
|
15099
|
+
paragraphLineGapDefault: 0,
|
|
14909
15100
|
renderConfig: {
|
|
14910
15101
|
horizontalAlign,
|
|
14911
15102
|
verticalAlign,
|
|
@@ -15010,14 +15201,7 @@ function getFontStyleString(textStyle) {
|
|
|
15010
15201
|
if (textStyle.bl === 0 || textStyle.bl === void 0) bold = "normal";
|
|
15011
15202
|
let originFontSize = defaultFontSize;
|
|
15012
15203
|
if (textStyle.fs) originFontSize = Math.ceil(textStyle.fs);
|
|
15013
|
-
|
|
15014
|
-
if (textStyle.ff) {
|
|
15015
|
-
let fontFamily = textStyle.ff;
|
|
15016
|
-
fontFamily = fontFamily.replace(/"/g, "").replace(/'/g, "");
|
|
15017
|
-
if (fontFamily.indexOf(" ") > -1) fontFamily = `"${fontFamily}"`;
|
|
15018
|
-
if (fontFamily == null) fontFamily = defaultFont;
|
|
15019
|
-
fontFamilyResult = fontFamily;
|
|
15020
|
-
}
|
|
15204
|
+
const fontFamilyResult = normalizeFontFamily(textStyle.ff, defaultFont);
|
|
15021
15205
|
const { va: baselineOffset } = textStyle;
|
|
15022
15206
|
let fontSize = originFontSize;
|
|
15023
15207
|
if (baselineOffset === 2 || baselineOffset === 3) {
|
|
@@ -15033,6 +15217,13 @@ function getFontStyleString(textStyle) {
|
|
|
15033
15217
|
fontFamily: fontFamilyResult
|
|
15034
15218
|
};
|
|
15035
15219
|
}
|
|
15220
|
+
function normalizeFontFamily(fontFamily, defaultFont) {
|
|
15221
|
+
if (!(fontFamily === null || fontFamily === void 0 ? void 0 : fontFamily.trim())) return defaultFont;
|
|
15222
|
+
return fontFamily.split(",").map((item) => {
|
|
15223
|
+
const family = item.trim().replace(/^['"]|['"]$/g, "");
|
|
15224
|
+
return family.includes(" ") ? `"${family}"` : family;
|
|
15225
|
+
}).filter(Boolean).join(", ");
|
|
15226
|
+
}
|
|
15036
15227
|
function getBaselineOffsetInfo(_fontFamily, fontSize) {
|
|
15037
15228
|
return getDefaultBaselineOffset(fontSize);
|
|
15038
15229
|
}
|
|
@@ -16853,6 +17044,8 @@ var Worksheet = class Worksheet {
|
|
|
16853
17044
|
width: Number.POSITIVE_INFINITY,
|
|
16854
17045
|
height: Number.POSITIVE_INFINITY
|
|
16855
17046
|
};
|
|
17047
|
+
documentData.documentStyle.documentFlavor = 0;
|
|
17048
|
+
documentData.documentStyle.paragraphLineGapDefault = 0;
|
|
16856
17049
|
documentData.documentStyle.renderConfig = {
|
|
16857
17050
|
...documentData.documentStyle.renderConfig,
|
|
16858
17051
|
...renderConfig
|
|
@@ -17975,7 +18168,14 @@ let PluginService = class PluginService {
|
|
|
17975
18168
|
const { type, pluginName, packageName, version } = ctor;
|
|
17976
18169
|
if (type === UniverInstanceType.UNRECOGNIZED) throw new Error(`[PluginService]: invalid plugin type for ${ctor.name}. Please assign a "type" to your plugin.`);
|
|
17977
18170
|
if (!pluginName) throw new Error(`[PluginService]: no plugin name for ${ctor.name}. Please assign a "pluginName" to your plugin.`);
|
|
17978
|
-
if (version && version !== Plugin.version)
|
|
18171
|
+
if (version && version !== Plugin.version) this._logService.error("[PluginService]", [
|
|
18172
|
+
"Plugin version mismatch.",
|
|
18173
|
+
` plugin: "${pluginName || ctor.name}"`,
|
|
18174
|
+
` package: "${packageName}"`,
|
|
18175
|
+
` plugin version: "${version}"`,
|
|
18176
|
+
` core version: "${Plugin.version}"`,
|
|
18177
|
+
" registration will continue, but please make sure all @univerjs packages use the same version."
|
|
18178
|
+
].join("\n"));
|
|
17979
18179
|
if (this._seenPlugins.has(pluginName)) throw new Error(`[PluginService]: duplicated plugin name for "${pluginName}". Maybe a plugin that dependents on "${pluginName} has already registered it. In that case please register "${pluginName}" before the that plugin.`);
|
|
17980
18180
|
this._seenPlugins.add(ctor.pluginName);
|
|
17981
18181
|
}
|
|
@@ -19428,6 +19628,8 @@ let SheetSkeleton = class SheetSkeleton extends Skeleton {
|
|
|
19428
19628
|
width: Number.POSITIVE_INFINITY,
|
|
19429
19629
|
height: Number.POSITIVE_INFINITY
|
|
19430
19630
|
};
|
|
19631
|
+
documentData.documentStyle.documentFlavor = 0;
|
|
19632
|
+
documentData.documentStyle.paragraphLineGapDefault = 0;
|
|
19431
19633
|
documentData.documentStyle.renderConfig = {
|
|
19432
19634
|
...documentData.documentStyle.renderConfig,
|
|
19433
19635
|
...renderConfig
|
|
@@ -20045,4 +20247,4 @@ function createUniverInjector(parentInjector, override) {
|
|
|
20045
20247
|
installShims();
|
|
20046
20248
|
|
|
20047
20249
|
//#endregion
|
|
20048
|
-
export { ABCToNumber, AUTO_HEIGHT_FOR_MERGED_CELLS, AbsoluteRefType, ActionIterator, AlignTypeH, AlignTypeV, ArrangeTypeEnum, AsyncInterceptorManager, AsyncLock, AuthzIoLocalService, AutoFillSeries, BORDER_KEYS, BORDER_STYLE_KEYS, 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_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, DOCS_ZEN_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, 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, MOVE_BUFFER_VALUE, Many, MemoryCursor, MentionIOLocalService, MentionType, NAMED_STYLE_MAP, NAMED_STYLE_SPACE_MAP, NamedStyleType, NilCommand, NumberUnitType, ObjectMatrix, ObjectRelativeFromH, ObjectRelativeFromV, Optional, PADDING_KEYS, PAGE_SIZE, PAPER_TYPES, 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, cloneCellData, cloneCellDataMatrix, cloneCellDataWithSpanAndDisplay, cloneValue, cloneWorksheetData, codeToBlob, columnLabelToNumber, composeBody, composeInterceptors, composeStyles, concatMatrixArray, convertCellToRange, convertObservableToBehaviorSubject, covertCellValue, covertCellValues, createAsyncInterceptorKey, createDefaultUser, createDocumentModelWithStyle, createIdentifier, createInterceptorKey, createInternalEditorID, createREGEXFromWildChar, createRowColIter, createSheetGapTestConfig, customNameCharacterCheck, dateKit, debounce, dedupe, dedupeBy, deepCompare, delayAnimationFrame, deleteContent, extractPureTextFromCell, forwardRef, fromCallback, fromEventSubject, generateIntervalsByPoints, generateRandomId, get, getArrayLength, getBodySlice, getBorderStyleType, getCellCoordByIndexSimple, getCellInfoInMergeData, getCellValueType, getCellWithCoordByIndexCore, getColorStyle, getCustomBlockSlice, getCustomDecorationSlice, getCustomRangeSlice, getDisplayValueFromCell, getDocsUpdateBody, getEmptyCell, getIntersectRange, getNumfmtParseValueFilter, getOriginCellValue, getParagraphsSlice, getPlainText, getReverseDirection, 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, 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, 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 };
|
|
20250
|
+
export { ABCToNumber, AUTO_HEIGHT_FOR_MERGED_CELLS, AbsoluteRefType, ActionIterator, AlignTypeH, AlignTypeV, ArrangeTypeEnum, AsyncInterceptorManager, AsyncLock, AuthzIoLocalService, AutoFillSeries, BORDER_KEYS, BORDER_STYLE_KEYS, 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, DOCS_ZEN_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, 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, 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, cloneCellData, cloneCellDataMatrix, cloneCellDataWithSpanAndDisplay, cloneValue, cloneWorksheetData, codeToBlob, columnLabelToNumber, composeBody, composeInterceptors, composeStyles, concatMatrixArray, convertCellToRange, convertObservableToBehaviorSubject, covertCellValue, covertCellValues, createAsyncInterceptorKey, createDefaultUser, createDocumentModelWithStyle, createIdentifier, createInterceptorKey, createInternalEditorID, createREGEXFromWildChar, 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, getEmptyCell, getIntersectRange, getNumfmtParseValueFilter, getOriginCellValue, getParagraphsSlice, getPlainText, getReverseDirection, 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 };
|