@univerjs/core 1.3.0 → 1.4.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 -30
- package/lib/cjs/index.js +398 -577
- package/lib/es/facade.js +15 -30
- package/lib/es/index.js +398 -578
- package/lib/facade.js +15 -30
- package/lib/index.js +398 -578
- package/lib/types/bases/typedef.d.ts +25 -25
- package/lib/types/common/regexp/index.d.ts +4 -4
- package/lib/types/docs/data-model/paragraph-style.d.ts +5 -2
- package/lib/types/docs/data-model/preset-list-type.d.ts +8 -8
- package/lib/types/docs/data-model/rich-text-builder.d.ts +1 -1
- package/lib/types/docs/data-model/text-x/build-utils/custom-range.d.ts +1 -1
- package/lib/types/docs/data-model/text-x/build-utils/index.d.ts +15 -13
- package/lib/types/docs/data-model/text-x/utils.d.ts +20 -20
- package/lib/types/index.d.ts +1 -0
- package/lib/types/services/lifecycle/lifecycle.d.ts +4 -4
- package/lib/types/services/resource-loader/type.d.ts +2 -2
- package/lib/types/services/user-manager/user-manager.service.d.ts +2 -2
- package/lib/types/shared/common.d.ts +1 -0
- package/lib/types/shared/r-tree.d.ts +3 -1
- package/lib/types/shared/sort-rules.d.ts +2 -2
- package/lib/types/sheets/sheet-skeleton.d.ts +12 -4
- package/lib/types/types/interfaces/i-document-data.d.ts +1 -5
- package/lib/types/types/interfaces/i-drawing.d.ts +3 -1
- package/lib/types/types/interfaces/index.d.ts +0 -3
- package/lib/types/univer.d.ts +1 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +26 -26
- package/package.json +8 -8
- package/lib/types/slides/slide-data-model.d.ts +0 -27
- package/lib/types/types/enum/place-holder-type.d.ts +0 -34
- package/lib/types/types/interfaces/i-image-properties.d.ts +0 -34
- package/lib/types/types/interfaces/i-placeholder.d.ts +0 -21
- package/lib/types/types/interfaces/i-shape-properties.d.ts +0 -30
package/lib/cjs/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// \0rolldown/runtime.js
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -38,7 +38,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
38
38
|
enumerable: true
|
|
39
39
|
}) : target, mod));
|
|
40
40
|
|
|
41
|
-
//#endregion
|
|
42
41
|
let rxjs = require("rxjs");
|
|
43
42
|
let _univerjs_protocol = require("@univerjs/protocol");
|
|
44
43
|
let rxjs_operators = require("rxjs/operators");
|
|
@@ -56,7 +55,7 @@ let _univerjs_themes = require("@univerjs/themes");
|
|
|
56
55
|
let kdbush = require("kdbush");
|
|
57
56
|
kdbush = __toESM(kdbush);
|
|
58
57
|
|
|
59
|
-
|
|
58
|
+
// src/common/shims.ts
|
|
60
59
|
/**
|
|
61
60
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
62
61
|
*
|
|
@@ -151,8 +150,7 @@ function installShims() {
|
|
|
151
150
|
installStringAt();
|
|
152
151
|
}
|
|
153
152
|
|
|
154
|
-
|
|
155
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
|
|
153
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/typeof.js
|
|
156
154
|
function _typeof(o) {
|
|
157
155
|
"@babel/helpers - typeof";
|
|
158
156
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -162,8 +160,7 @@ function _typeof(o) {
|
|
|
162
160
|
}, _typeof(o);
|
|
163
161
|
}
|
|
164
162
|
|
|
165
|
-
|
|
166
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
|
|
163
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPrimitive.js
|
|
167
164
|
function toPrimitive(t, r) {
|
|
168
165
|
if ("object" != _typeof(t) || !t) return t;
|
|
169
166
|
var e = t[Symbol.toPrimitive];
|
|
@@ -175,15 +172,13 @@ function toPrimitive(t, r) {
|
|
|
175
172
|
return ("string" === r ? String : Number)(t);
|
|
176
173
|
}
|
|
177
174
|
|
|
178
|
-
|
|
179
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
175
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPropertyKey.js
|
|
180
176
|
function toPropertyKey(t) {
|
|
181
177
|
var i = toPrimitive(t, "string");
|
|
182
178
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
183
179
|
}
|
|
184
180
|
|
|
185
|
-
|
|
186
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
181
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/defineProperty.js
|
|
187
182
|
function _defineProperty(e, r, t) {
|
|
188
183
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
189
184
|
value: t,
|
|
@@ -193,8 +188,7 @@ function _defineProperty(e, r, t) {
|
|
|
193
188
|
}) : e[r] = t, e;
|
|
194
189
|
}
|
|
195
190
|
|
|
196
|
-
|
|
197
|
-
//#region src/shared/lifecycle.ts
|
|
191
|
+
// src/shared/lifecycle.ts
|
|
198
192
|
function isSubscriptionLike(value) {
|
|
199
193
|
return value instanceof rxjs.Subscription || value instanceof rxjs.Subject || value && "closed" in value && typeof value.unsubscribe !== "undefined";
|
|
200
194
|
}
|
|
@@ -275,15 +269,13 @@ var RCDisposable = class extends Disposable {
|
|
|
275
269
|
}
|
|
276
270
|
};
|
|
277
271
|
|
|
278
|
-
|
|
279
|
-
//#region src/common/unit.ts
|
|
272
|
+
// src/common/unit.ts
|
|
280
273
|
/**
|
|
281
274
|
* The base class for all units.
|
|
282
275
|
*/
|
|
283
276
|
var UnitModel = class extends Disposable {};
|
|
284
277
|
|
|
285
|
-
|
|
286
|
-
//#region src/common/url.ts
|
|
278
|
+
// src/common/url.ts
|
|
287
279
|
/**
|
|
288
280
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
289
281
|
*
|
|
@@ -626,8 +618,7 @@ function resolveWithBasePath(url, baseURL) {
|
|
|
626
618
|
}
|
|
627
619
|
}
|
|
628
620
|
|
|
629
|
-
|
|
630
|
-
//#region src/shared/tools.ts
|
|
621
|
+
// src/shared/tools.ts
|
|
631
622
|
/**
|
|
632
623
|
* Deep diff between two object
|
|
633
624
|
* @param oneValue The first test value
|
|
@@ -912,8 +903,7 @@ const isNodeEnv = () => {
|
|
|
912
903
|
return typeof process !== "undefined" && process.versions != null && process.versions.node != null;
|
|
913
904
|
};
|
|
914
905
|
|
|
915
|
-
|
|
916
|
-
//#region src/types/enum/auto-fill-series.ts
|
|
906
|
+
// src/types/enum/auto-fill-series.ts
|
|
917
907
|
/**
|
|
918
908
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
919
909
|
*
|
|
@@ -941,8 +931,7 @@ let AutoFillSeries = /* @__PURE__ */ function(AutoFillSeries) {
|
|
|
941
931
|
return AutoFillSeries;
|
|
942
932
|
}({});
|
|
943
933
|
|
|
944
|
-
|
|
945
|
-
//#region src/types/enum/border-style-types.ts
|
|
934
|
+
// src/types/enum/border-style-types.ts
|
|
946
935
|
/**
|
|
947
936
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
948
937
|
*
|
|
@@ -997,8 +986,7 @@ let BorderType = /* @__PURE__ */ function(BorderType) {
|
|
|
997
986
|
return BorderType;
|
|
998
987
|
}({});
|
|
999
988
|
|
|
1000
|
-
|
|
1001
|
-
//#region src/types/enum/color-type.ts
|
|
989
|
+
// src/types/enum/color-type.ts
|
|
1002
990
|
/**
|
|
1003
991
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1004
992
|
*
|
|
@@ -1022,8 +1010,7 @@ let ColorType = /* @__PURE__ */ function(ColorType) {
|
|
|
1022
1010
|
return ColorType;
|
|
1023
1011
|
}({});
|
|
1024
1012
|
|
|
1025
|
-
|
|
1026
|
-
//#region src/types/enum/common-hide-types.ts
|
|
1013
|
+
// src/types/enum/common-hide-types.ts
|
|
1027
1014
|
/**
|
|
1028
1015
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1029
1016
|
*
|
|
@@ -1045,8 +1032,7 @@ let CommonHideTypes = /* @__PURE__ */ function(CommonHideTypes) {
|
|
|
1045
1032
|
return CommonHideTypes;
|
|
1046
1033
|
}({});
|
|
1047
1034
|
|
|
1048
|
-
|
|
1049
|
-
//#region src/types/enum/copy-paste-type.ts
|
|
1035
|
+
// src/types/enum/copy-paste-type.ts
|
|
1050
1036
|
/**
|
|
1051
1037
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1052
1038
|
*
|
|
@@ -1074,8 +1060,7 @@ let CopyPasteType = /* @__PURE__ */ function(CopyPasteType) {
|
|
|
1074
1060
|
return CopyPasteType;
|
|
1075
1061
|
}({});
|
|
1076
1062
|
|
|
1077
|
-
|
|
1078
|
-
//#region src/types/enum/date-system.ts
|
|
1063
|
+
// src/types/enum/date-system.ts
|
|
1079
1064
|
/**
|
|
1080
1065
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1081
1066
|
*
|
|
@@ -1100,8 +1085,7 @@ let DateSystem = /* @__PURE__ */ function(DateSystem) {
|
|
|
1100
1085
|
return DateSystem;
|
|
1101
1086
|
}({});
|
|
1102
1087
|
|
|
1103
|
-
|
|
1104
|
-
//#region src/types/enum/delete-direction.ts
|
|
1088
|
+
// src/types/enum/delete-direction.ts
|
|
1105
1089
|
/**
|
|
1106
1090
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1107
1091
|
*
|
|
@@ -1123,8 +1107,7 @@ let DeleteDirection = /* @__PURE__ */ function(DeleteDirection) {
|
|
|
1123
1107
|
return DeleteDirection;
|
|
1124
1108
|
}({});
|
|
1125
1109
|
|
|
1126
|
-
|
|
1127
|
-
//#region src/types/enum/developer-metadata-visibility.ts
|
|
1110
|
+
// src/types/enum/developer-metadata-visibility.ts
|
|
1128
1111
|
/**
|
|
1129
1112
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1130
1113
|
*
|
|
@@ -1146,8 +1129,7 @@ let DeveloperMetadataVisibility = /* @__PURE__ */ function(DeveloperMetadataVisi
|
|
|
1146
1129
|
return DeveloperMetadataVisibility;
|
|
1147
1130
|
}({});
|
|
1148
1131
|
|
|
1149
|
-
|
|
1150
|
-
//#region src/types/enum/dimension.ts
|
|
1132
|
+
// src/types/enum/dimension.ts
|
|
1151
1133
|
/**
|
|
1152
1134
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1153
1135
|
*
|
|
@@ -1175,8 +1157,7 @@ let Dimension = /* @__PURE__ */ function(Dimension) {
|
|
|
1175
1157
|
return Dimension;
|
|
1176
1158
|
}({});
|
|
1177
1159
|
|
|
1178
|
-
|
|
1179
|
-
//#region src/types/enum/direction.ts
|
|
1160
|
+
// src/types/enum/direction.ts
|
|
1180
1161
|
/**
|
|
1181
1162
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1182
1163
|
*
|
|
@@ -1208,8 +1189,7 @@ function getReverseDirection(direction) {
|
|
|
1208
1189
|
}
|
|
1209
1190
|
}
|
|
1210
1191
|
|
|
1211
|
-
|
|
1212
|
-
//#region src/types/enum/interpolation-point-type.ts
|
|
1192
|
+
// src/types/enum/interpolation-point-type.ts
|
|
1213
1193
|
/**
|
|
1214
1194
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1215
1195
|
*
|
|
@@ -1235,8 +1215,7 @@ let InterpolationPointType = /* @__PURE__ */ function(InterpolationPointType) {
|
|
|
1235
1215
|
return InterpolationPointType;
|
|
1236
1216
|
}({});
|
|
1237
1217
|
|
|
1238
|
-
|
|
1239
|
-
//#region src/types/enum/locale-type.ts
|
|
1218
|
+
// src/types/enum/locale-type.ts
|
|
1240
1219
|
/**
|
|
1241
1220
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1242
1221
|
*
|
|
@@ -1377,8 +1356,7 @@ const LOCALE_META = {
|
|
|
1377
1356
|
}
|
|
1378
1357
|
};
|
|
1379
1358
|
|
|
1380
|
-
|
|
1381
|
-
//#region src/types/enum/mention-type.ts
|
|
1359
|
+
// src/types/enum/mention-type.ts
|
|
1382
1360
|
/**
|
|
1383
1361
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1384
1362
|
*
|
|
@@ -1403,8 +1381,7 @@ let MentionType = /* @__PURE__ */ function(MentionType) {
|
|
|
1403
1381
|
return MentionType;
|
|
1404
1382
|
}({});
|
|
1405
1383
|
|
|
1406
|
-
|
|
1407
|
-
//#region src/types/enum/protection-type.ts
|
|
1384
|
+
// src/types/enum/protection-type.ts
|
|
1408
1385
|
/**
|
|
1409
1386
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1410
1387
|
*
|
|
@@ -1426,8 +1403,7 @@ let ProtectionType = /* @__PURE__ */ function(ProtectionType) {
|
|
|
1426
1403
|
return ProtectionType;
|
|
1427
1404
|
}({});
|
|
1428
1405
|
|
|
1429
|
-
|
|
1430
|
-
//#region src/types/enum/relative-date.ts
|
|
1406
|
+
// src/types/enum/relative-date.ts
|
|
1431
1407
|
/**
|
|
1432
1408
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1433
1409
|
*
|
|
@@ -1454,8 +1430,7 @@ let RelativeDate = /* @__PURE__ */ function(RelativeDate) {
|
|
|
1454
1430
|
return RelativeDate;
|
|
1455
1431
|
}({});
|
|
1456
1432
|
|
|
1457
|
-
|
|
1458
|
-
//#region src/types/enum/sheet-types.ts
|
|
1433
|
+
// src/types/enum/sheet-types.ts
|
|
1459
1434
|
/**
|
|
1460
1435
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1461
1436
|
*
|
|
@@ -1478,8 +1453,7 @@ let SheetTypes = /* @__PURE__ */ function(SheetTypes) {
|
|
|
1478
1453
|
return SheetTypes;
|
|
1479
1454
|
}({});
|
|
1480
1455
|
|
|
1481
|
-
|
|
1482
|
-
//#region src/types/enum/text-style.ts
|
|
1456
|
+
// src/types/enum/text-style.ts
|
|
1483
1457
|
/**
|
|
1484
1458
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1485
1459
|
*
|
|
@@ -1622,8 +1596,7 @@ let CellValueType = /* @__PURE__ */ function(CellValueType) {
|
|
|
1622
1596
|
return CellValueType;
|
|
1623
1597
|
}({});
|
|
1624
1598
|
|
|
1625
|
-
|
|
1626
|
-
//#region src/types/enum/theme-color-type.ts
|
|
1599
|
+
// src/types/enum/theme-color-type.ts
|
|
1627
1600
|
/**
|
|
1628
1601
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1629
1602
|
*
|
|
@@ -1696,13 +1669,11 @@ let ThemeColors = /* @__PURE__ */ function(ThemeColors) {
|
|
|
1696
1669
|
return ThemeColors;
|
|
1697
1670
|
}({});
|
|
1698
1671
|
|
|
1699
|
-
|
|
1700
|
-
//#region package.json
|
|
1672
|
+
// package.json
|
|
1701
1673
|
var name = "@univerjs/core";
|
|
1702
|
-
var version = "1.
|
|
1674
|
+
var version = "1.4.0";
|
|
1703
1675
|
|
|
1704
|
-
|
|
1705
|
-
//#region src/common/array.ts
|
|
1676
|
+
// src/common/array.ts
|
|
1706
1677
|
/**
|
|
1707
1678
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1708
1679
|
*
|
|
@@ -1788,8 +1759,7 @@ function makeArray(thing) {
|
|
|
1788
1759
|
return [thing];
|
|
1789
1760
|
}
|
|
1790
1761
|
|
|
1791
|
-
|
|
1792
|
-
//#region src/common/di.ts
|
|
1762
|
+
// src/common/di.ts
|
|
1793
1763
|
/**
|
|
1794
1764
|
* Register the dependencies to the injector.
|
|
1795
1765
|
* @param injector The injector to register the dependencies.
|
|
@@ -1809,8 +1779,7 @@ function touchDependencies(injector, dependencies) {
|
|
|
1809
1779
|
});
|
|
1810
1780
|
}
|
|
1811
1781
|
|
|
1812
|
-
|
|
1813
|
-
//#region src/common/error.ts
|
|
1782
|
+
// src/common/error.ts
|
|
1814
1783
|
/**
|
|
1815
1784
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1816
1785
|
*
|
|
@@ -1839,8 +1808,7 @@ var CanceledError = class extends CustomCommandExecutionError {
|
|
|
1839
1808
|
}
|
|
1840
1809
|
};
|
|
1841
1810
|
|
|
1842
|
-
|
|
1843
|
-
//#region src/common/sequence.ts
|
|
1811
|
+
// src/common/sequence.ts
|
|
1844
1812
|
/**
|
|
1845
1813
|
* Execute promise tasks in sequence, if one of the tasks return false, the sequence will be stopped.
|
|
1846
1814
|
* @param tasks All promise tasks that need to be triggered.
|
|
@@ -1888,8 +1856,7 @@ function sequence(tasks) {
|
|
|
1888
1856
|
};
|
|
1889
1857
|
}
|
|
1890
1858
|
|
|
1891
|
-
|
|
1892
|
-
//#region src/services/config/config.service.ts
|
|
1859
|
+
// src/services/config/config.service.ts
|
|
1893
1860
|
/**
|
|
1894
1861
|
* IConfig provides universal configuration for the whole application.
|
|
1895
1862
|
*/
|
|
@@ -1927,8 +1894,7 @@ var ConfigService = class {
|
|
|
1927
1894
|
}
|
|
1928
1895
|
};
|
|
1929
1896
|
|
|
1930
|
-
|
|
1931
|
-
//#region src/services/context/context.service.ts
|
|
1897
|
+
// src/services/context/context.service.ts
|
|
1932
1898
|
/**
|
|
1933
1899
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1934
1900
|
*
|
|
@@ -1973,8 +1939,7 @@ var ContextService = class extends Disposable {
|
|
|
1973
1939
|
}
|
|
1974
1940
|
};
|
|
1975
1941
|
|
|
1976
|
-
|
|
1977
|
-
//#region src/services/log/log.service.ts
|
|
1942
|
+
// src/services/log/log.service.ts
|
|
1978
1943
|
/**
|
|
1979
1944
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1980
1945
|
*
|
|
@@ -2044,16 +2009,14 @@ function hashLogContent(...args) {
|
|
|
2044
2009
|
return args.map((a) => JSON.stringify(a)).join("");
|
|
2045
2010
|
}
|
|
2046
2011
|
|
|
2047
|
-
|
|
2048
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
|
|
2012
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorateParam.js
|
|
2049
2013
|
function __decorateParam(paramIndex, decorator) {
|
|
2050
2014
|
return function(target, key) {
|
|
2051
2015
|
decorator(target, key, paramIndex);
|
|
2052
2016
|
};
|
|
2053
2017
|
}
|
|
2054
2018
|
|
|
2055
|
-
|
|
2056
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
|
|
2019
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorate.js
|
|
2057
2020
|
function __decorate(decorators, target, key, desc) {
|
|
2058
2021
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2059
2022
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2061,8 +2024,7 @@ function __decorate(decorators, target, key, desc) {
|
|
|
2061
2024
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2062
2025
|
}
|
|
2063
2026
|
|
|
2064
|
-
|
|
2065
|
-
//#region src/services/command/command.service.ts
|
|
2027
|
+
// src/services/command/command.service.ts
|
|
2066
2028
|
/**
|
|
2067
2029
|
* The config key for enabling command execution logging.
|
|
2068
2030
|
* Set via `logCommandExecution` in `IUniverConfig` when calling `new Univer()`.
|
|
@@ -2405,8 +2367,7 @@ function sequenceExecuteAsync(tasks, commandService, options) {
|
|
|
2405
2367
|
return sequenceAsync(promises);
|
|
2406
2368
|
}
|
|
2407
2369
|
|
|
2408
|
-
|
|
2409
|
-
//#region src/shared/rxjs.ts
|
|
2370
|
+
// src/shared/rxjs.ts
|
|
2410
2371
|
/**
|
|
2411
2372
|
* Creates an observable from a callback function.
|
|
2412
2373
|
*
|
|
@@ -2452,8 +2413,7 @@ function convertObservableToBehaviorSubject(observable, initValue) {
|
|
|
2452
2413
|
return subject;
|
|
2453
2414
|
}
|
|
2454
2415
|
|
|
2455
|
-
|
|
2456
|
-
//#region src/shared/after-init-apply.ts
|
|
2416
|
+
// src/shared/after-init-apply.ts
|
|
2457
2417
|
const afterInitApply = (commandService) => {
|
|
2458
2418
|
return new Promise((res) => {
|
|
2459
2419
|
(0, rxjs.merge)(fromCallback(commandService.onCommandExecuted.bind(commandService)).pipe((0, rxjs_operators.filter)(([info]) => {
|
|
@@ -2464,8 +2424,7 @@ const afterInitApply = (commandService) => {
|
|
|
2464
2424
|
});
|
|
2465
2425
|
};
|
|
2466
2426
|
|
|
2467
|
-
|
|
2468
|
-
//#region src/shared/array-search.ts
|
|
2427
|
+
// src/shared/array-search.ts
|
|
2469
2428
|
/**
|
|
2470
2429
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
2471
2430
|
*
|
|
@@ -2567,8 +2526,7 @@ function searchArray(arr, target, firstMatch = false) {
|
|
|
2567
2526
|
return index;
|
|
2568
2527
|
}
|
|
2569
2528
|
|
|
2570
|
-
|
|
2571
|
-
//#region src/shared/blob.ts
|
|
2529
|
+
// src/shared/blob.ts
|
|
2572
2530
|
/**
|
|
2573
2531
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
2574
2532
|
*
|
|
@@ -2589,8 +2547,7 @@ function codeToBlob(code) {
|
|
|
2589
2547
|
return window.URL.createObjectURL(blob);
|
|
2590
2548
|
}
|
|
2591
2549
|
|
|
2592
|
-
|
|
2593
|
-
//#region src/shared/check-if-move.ts
|
|
2550
|
+
// src/shared/check-if-move.ts
|
|
2594
2551
|
const MOVE_BUFFER_VALUE = 2;
|
|
2595
2552
|
const ROTATE_BUFFER_VALUE = 1;
|
|
2596
2553
|
function checkIfMove(transform, previousTransform) {
|
|
@@ -2604,8 +2561,7 @@ function checkIfMove(transform, previousTransform) {
|
|
|
2604
2561
|
return Math.abs(left - leftPrev) > 2 || Math.abs(top - topPrev) > 2 || Math.abs(allWidth - allWidthPrev) > 2 || Math.abs(allHeight - allHeightPrev) > 2 || Math.abs(angle - anglePrev) > 1;
|
|
2605
2562
|
}
|
|
2606
2563
|
|
|
2607
|
-
|
|
2608
|
-
//#region src/shared/color/color-kit.ts
|
|
2564
|
+
// src/shared/color/color-kit.ts
|
|
2609
2565
|
const RGB_PAREN = "rgb(";
|
|
2610
2566
|
const RGBA_PAREN = "rgba(";
|
|
2611
2567
|
const COLORS = {
|
|
@@ -3776,8 +3732,7 @@ function isWhiteColor(color) {
|
|
|
3776
3732
|
return false;
|
|
3777
3733
|
}
|
|
3778
3734
|
|
|
3779
|
-
|
|
3780
|
-
//#region src/shared/command-enum.ts
|
|
3735
|
+
// src/shared/command-enum.ts
|
|
3781
3736
|
/**
|
|
3782
3737
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3783
3738
|
*
|
|
@@ -3799,8 +3754,7 @@ let UpdateDocsAttributeType = /* @__PURE__ */ function(UpdateDocsAttributeType)
|
|
|
3799
3754
|
return UpdateDocsAttributeType;
|
|
3800
3755
|
}({});
|
|
3801
3756
|
|
|
3802
|
-
|
|
3803
|
-
//#region src/sheets/typedef.ts
|
|
3757
|
+
// src/sheets/typedef.ts
|
|
3804
3758
|
/** Worksheet-only hiding states; row/column and cell flags still use BooleanNumber. */
|
|
3805
3759
|
let WorksheetHiddenState = /* @__PURE__ */ function(WorksheetHiddenState) {
|
|
3806
3760
|
/** Visible in the sheet bar. Preserves the existing hidden: 0 value. */
|
|
@@ -3891,8 +3845,7 @@ let CellModeEnum = /* @__PURE__ */ function(CellModeEnum) {
|
|
|
3891
3845
|
return CellModeEnum;
|
|
3892
3846
|
}({});
|
|
3893
3847
|
|
|
3894
|
-
|
|
3895
|
-
//#region src/types/const/theme-color-map.ts
|
|
3848
|
+
// src/types/const/theme-color-map.ts
|
|
3896
3849
|
const THEME_COLORS = { ["Office"]: {
|
|
3897
3850
|
[4]: "#4472C4",
|
|
3898
3851
|
[5]: "#ED7D31",
|
|
@@ -3908,8 +3861,7 @@ const THEME_COLORS = { ["Office"]: {
|
|
|
3908
3861
|
[11]: "#954F72"
|
|
3909
3862
|
} };
|
|
3910
3863
|
|
|
3911
|
-
|
|
3912
|
-
//#region src/shared/numfmt/constants.ts
|
|
3864
|
+
// src/shared/numfmt/constants.ts
|
|
3913
3865
|
const MIN_L_DATE = -694324;
|
|
3914
3866
|
const MAX_L_DATE = 35830291;
|
|
3915
3867
|
const TOKEN_GENERAL = "general";
|
|
@@ -4034,8 +3986,7 @@ const currencySymbols$1 = [
|
|
|
4034
3986
|
];
|
|
4035
3987
|
const reCurrencySymbols = new RegExp(`[${currencySymbols$1.join("")}]`);
|
|
4036
3988
|
|
|
4037
|
-
|
|
4038
|
-
//#region src/shared/numfmt/decimal.ts
|
|
3989
|
+
// src/shared/numfmt/decimal.ts
|
|
4039
3990
|
function decimalFromNumber(value) {
|
|
4040
3991
|
if (!Number.isFinite(value)) throw new RangeError("decimalFromNumber requires a finite number");
|
|
4041
3992
|
const negative = value < 0 || Object.is(value, -0);
|
|
@@ -4123,8 +4074,7 @@ function roundScientificDecimal(value, integerDigits, hasIntegerPattern, fractio
|
|
|
4123
4074
|
};
|
|
4124
4075
|
}
|
|
4125
4076
|
|
|
4126
|
-
|
|
4127
|
-
//#region src/shared/numfmt/code-to-locale.ts
|
|
4077
|
+
// src/shared/numfmt/code-to-locale.ts
|
|
4128
4078
|
/**
|
|
4129
4079
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
4130
4080
|
*
|
|
@@ -4329,8 +4279,7 @@ const codeToLocale = Object.freeze({
|
|
|
4329
4279
|
1077: "zu"
|
|
4330
4280
|
});
|
|
4331
4281
|
|
|
4332
|
-
|
|
4333
|
-
//#region src/shared/numfmt/locale.ts
|
|
4282
|
+
// src/shared/numfmt/locale.ts
|
|
4334
4283
|
const re_locale = /^([a-z\d]+)(?:[_-]([a-z\d]+))?(?:\.([a-z\d]+))?(?:@([a-z\d]+))?$/i;
|
|
4335
4284
|
const locales = {};
|
|
4336
4285
|
/**
|
|
@@ -5010,8 +4959,7 @@ addLocale({
|
|
|
5010
4959
|
ampm: _("am;pm")
|
|
5011
4960
|
}, "hi");
|
|
5012
4961
|
|
|
5013
|
-
|
|
5014
|
-
//#region src/shared/numfmt/parse-format-section.ts
|
|
4962
|
+
// src/shared/numfmt/parse-format-section.ts
|
|
5015
4963
|
function getNumberPattern(part, prefix) {
|
|
5016
4964
|
switch (prefix) {
|
|
5017
4965
|
case "int": return part.int_pattern;
|
|
@@ -5400,8 +5348,7 @@ function parseFormatSection(inputTokens) {
|
|
|
5400
5348
|
return part;
|
|
5401
5349
|
}
|
|
5402
5350
|
|
|
5403
|
-
|
|
5404
|
-
//#region src/shared/numfmt/clamp.ts
|
|
5351
|
+
// src/shared/numfmt/clamp.ts
|
|
5405
5352
|
/**
|
|
5406
5353
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
5407
5354
|
*
|
|
@@ -5424,8 +5371,7 @@ function clamp(number) {
|
|
|
5424
5371
|
return isFinite(mag) ? Math.round(number * mag) / mag : 0;
|
|
5425
5372
|
}
|
|
5426
5373
|
|
|
5427
|
-
|
|
5428
|
-
//#region src/shared/numfmt/dec-to-frac.ts
|
|
5374
|
+
// src/shared/numfmt/dec-to-frac.ts
|
|
5429
5375
|
/**
|
|
5430
5376
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
5431
5377
|
*
|
|
@@ -5482,8 +5428,7 @@ function dec2frac(number, numeratorMaxDigits = 2, denominatorMaxDigits = 2) {
|
|
|
5482
5428
|
return r;
|
|
5483
5429
|
}
|
|
5484
5430
|
|
|
5485
|
-
|
|
5486
|
-
//#region src/shared/numfmt/num-dec.ts
|
|
5431
|
+
// src/shared/numfmt/num-dec.ts
|
|
5487
5432
|
const ZERO_DIGITS = {
|
|
5488
5433
|
total: 1,
|
|
5489
5434
|
sign: 0,
|
|
@@ -5509,8 +5454,7 @@ function numDec(value, includeSign = true) {
|
|
|
5509
5454
|
};
|
|
5510
5455
|
}
|
|
5511
5456
|
|
|
5512
|
-
|
|
5513
|
-
//#region src/shared/numfmt/number-props.ts
|
|
5457
|
+
// src/shared/numfmt/number-props.ts
|
|
5514
5458
|
/**
|
|
5515
5459
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
5516
5460
|
*
|
|
@@ -5535,8 +5479,7 @@ function getSignificand(number, exponent = 1) {
|
|
|
5535
5479
|
return number * 10 ** -exponent;
|
|
5536
5480
|
}
|
|
5537
5481
|
|
|
5538
|
-
|
|
5539
|
-
//#region src/shared/numfmt/round.ts
|
|
5482
|
+
// src/shared/numfmt/round.ts
|
|
5540
5483
|
/**
|
|
5541
5484
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
5542
5485
|
*
|
|
@@ -5570,8 +5513,7 @@ function round(number, places = 0) {
|
|
|
5570
5513
|
return Number.isFinite(rounded) ? rounded : number;
|
|
5571
5514
|
}
|
|
5572
5515
|
|
|
5573
|
-
|
|
5574
|
-
//#region src/shared/numfmt/general.ts
|
|
5516
|
+
// src/shared/numfmt/general.ts
|
|
5575
5517
|
function fixLocale(value, locale) {
|
|
5576
5518
|
return value.replace(/\./, locale.decimal);
|
|
5577
5519
|
}
|
|
@@ -5648,8 +5590,7 @@ function general(output, part, value, locale, decimalValue = null) {
|
|
|
5648
5590
|
return output;
|
|
5649
5591
|
}
|
|
5650
5592
|
|
|
5651
|
-
|
|
5652
|
-
//#region src/shared/numfmt/pad.ts
|
|
5593
|
+
// src/shared/numfmt/pad.ts
|
|
5653
5594
|
/**
|
|
5654
5595
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
5655
5596
|
*
|
|
@@ -5677,8 +5618,7 @@ function pad$1(char, nbsp = false) {
|
|
|
5677
5618
|
return "";
|
|
5678
5619
|
}
|
|
5679
5620
|
|
|
5680
|
-
|
|
5681
|
-
//#region src/shared/numfmt/to-ymd.ts
|
|
5621
|
+
// src/shared/numfmt/to-ymd.ts
|
|
5682
5622
|
const floor$1 = Math.floor;
|
|
5683
5623
|
function toYMD1900(serial, leap1900 = true) {
|
|
5684
5624
|
if (leap1900 && serial >= 0) {
|
|
@@ -5754,8 +5694,7 @@ function toYMD(serial, system = 0, leap1900 = true) {
|
|
|
5754
5694
|
return toYMD1900(int, leap1900);
|
|
5755
5695
|
}
|
|
5756
5696
|
|
|
5757
|
-
|
|
5758
|
-
//#region src/shared/numfmt/serial-date.ts
|
|
5697
|
+
// src/shared/numfmt/serial-date.ts
|
|
5759
5698
|
const floor = Math.floor;
|
|
5760
5699
|
const DAYSIZE$1 = 86400;
|
|
5761
5700
|
const MILLISECONDS_PER_DAY = DAYSIZE$1 * 1e3;
|
|
@@ -5923,8 +5862,7 @@ function dateFromSerial(serial, options) {
|
|
|
5923
5862
|
];
|
|
5924
5863
|
}
|
|
5925
5864
|
|
|
5926
|
-
|
|
5927
|
-
//#region src/shared/numfmt/run-part.ts
|
|
5865
|
+
// src/shared/numfmt/run-part.ts
|
|
5928
5866
|
const DAYSIZE = 86400;
|
|
5929
5867
|
function dateOverflows(inputValue, roundedValue, bigRange, dateSystem) {
|
|
5930
5868
|
if (bigRange) return inputValue < -694324 || roundedValue >= 35830291;
|
|
@@ -6238,8 +6176,7 @@ function runPart(value, part, options, locale, decimalValue = null) {
|
|
|
6238
6176
|
return output.join("");
|
|
6239
6177
|
}
|
|
6240
6178
|
|
|
6241
|
-
|
|
6242
|
-
//#region src/shared/numfmt/format-number.ts
|
|
6179
|
+
// src/shared/numfmt/format-number.ts
|
|
6243
6180
|
const defaultText = parseFormatSection([{
|
|
6244
6181
|
type: TOKEN_TEXT,
|
|
6245
6182
|
value: "@",
|
|
@@ -6296,8 +6233,7 @@ function formatValue(value, pattern, options) {
|
|
|
6296
6233
|
return part ? runPart(value, part, options, locale, decimalValue) : options.overflow;
|
|
6297
6234
|
}
|
|
6298
6235
|
|
|
6299
|
-
|
|
6300
|
-
//#region src/shared/numfmt/date-time-edit-pattern.ts
|
|
6236
|
+
// src/shared/numfmt/date-time-edit-pattern.ts
|
|
6301
6237
|
function isParsedSection$1(section) {
|
|
6302
6238
|
return !!section && "scale" in section;
|
|
6303
6239
|
}
|
|
@@ -6418,8 +6354,7 @@ function createDateTimeEditPattern(partitions, value) {
|
|
|
6418
6354
|
return datePattern ?? timePattern;
|
|
6419
6355
|
}
|
|
6420
6356
|
|
|
6421
|
-
|
|
6422
|
-
//#region src/shared/numfmt/format-info.ts
|
|
6357
|
+
// src/shared/numfmt/format-info.ts
|
|
6423
6358
|
function isParsedSection(part) {
|
|
6424
6359
|
return !!part && "scale" in part;
|
|
6425
6360
|
}
|
|
@@ -6573,8 +6508,7 @@ function dateInfo(partitions) {
|
|
|
6573
6508
|
};
|
|
6574
6509
|
}
|
|
6575
6510
|
|
|
6576
|
-
|
|
6577
|
-
//#region src/shared/numfmt/options.ts
|
|
6511
|
+
// src/shared/numfmt/options.ts
|
|
6578
6512
|
const defaultOptions = {
|
|
6579
6513
|
overflow: "######",
|
|
6580
6514
|
dateErrorThrows: false,
|
|
@@ -6594,8 +6528,7 @@ const defaultOptions = {
|
|
|
6594
6528
|
fillChar: ""
|
|
6595
6529
|
};
|
|
6596
6530
|
|
|
6597
|
-
|
|
6598
|
-
//#region src/shared/numfmt/tokenize.ts
|
|
6531
|
+
// src/shared/numfmt/tokenize.ts
|
|
6599
6532
|
const tokenHandlers = [
|
|
6600
6533
|
[
|
|
6601
6534
|
TOKEN_GENERAL,
|
|
@@ -6848,8 +6781,7 @@ function tokenize(pattern) {
|
|
|
6848
6781
|
return tokens;
|
|
6849
6782
|
}
|
|
6850
6783
|
|
|
6851
|
-
|
|
6852
|
-
//#region src/shared/numfmt/parse-pattern.ts
|
|
6784
|
+
// src/shared/numfmt/parse-pattern.ts
|
|
6853
6785
|
function maybeAddMinus(part) {
|
|
6854
6786
|
var _part$condition, _part$condition2;
|
|
6855
6787
|
const operator = (_part$condition = part.condition) === null || _part$condition === void 0 ? void 0 : _part$condition[0];
|
|
@@ -6960,8 +6892,7 @@ function parsePattern(pattern) {
|
|
|
6960
6892
|
};
|
|
6961
6893
|
}
|
|
6962
6894
|
|
|
6963
|
-
|
|
6964
|
-
//#region src/shared/numfmt/parse-value.ts
|
|
6895
|
+
// src/shared/numfmt/parse-value.ts
|
|
6965
6896
|
const okDateFormats = [
|
|
6966
6897
|
"!d-m-y",
|
|
6967
6898
|
"!d-m-Y",
|
|
@@ -7471,8 +7402,7 @@ function parseValue(value, options) {
|
|
|
7471
7402
|
return parseNumber(value, options) ?? parseDate(value, options) ?? parseTime(value, options) ?? parseBool(value, options);
|
|
7472
7403
|
}
|
|
7473
7404
|
|
|
7474
|
-
|
|
7475
|
-
//#region src/shared/numfmt/api.ts
|
|
7405
|
+
// src/shared/numfmt/api.ts
|
|
7476
7406
|
var api_exports = /* @__PURE__ */ __exportAll({
|
|
7477
7407
|
addLocale: () => addLocale,
|
|
7478
7408
|
dateFromSerial: () => dateFromSerial,
|
|
@@ -7623,8 +7553,7 @@ const tokenTypes = Object.freeze({
|
|
|
7623
7553
|
ZERO: TOKEN_ZERO
|
|
7624
7554
|
});
|
|
7625
7555
|
|
|
7626
|
-
|
|
7627
|
-
//#region src/common/regexp/factory.ts
|
|
7556
|
+
// src/common/regexp/factory.ts
|
|
7628
7557
|
/**
|
|
7629
7558
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
7630
7559
|
*
|
|
@@ -7664,8 +7593,7 @@ function normalizeRegExpFlags(flags) {
|
|
|
7664
7593
|
return flags;
|
|
7665
7594
|
}
|
|
7666
7595
|
|
|
7667
|
-
|
|
7668
|
-
//#region src/common/regexp/charset.ts
|
|
7596
|
+
// src/common/regexp/charset.ts
|
|
7669
7597
|
/**
|
|
7670
7598
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
7671
7599
|
*
|
|
@@ -7798,8 +7726,7 @@ function escapeCharClassCodePoint(point) {
|
|
|
7798
7726
|
return char;
|
|
7799
7727
|
}
|
|
7800
7728
|
|
|
7801
|
-
|
|
7802
|
-
//#region src/common/regexp/escape.ts
|
|
7729
|
+
// src/common/regexp/escape.ts
|
|
7803
7730
|
/**
|
|
7804
7731
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
7805
7732
|
*
|
|
@@ -7838,8 +7765,7 @@ function createFromWildcard(pattern) {
|
|
|
7838
7765
|
return createRegExpFromSafeFragment(`^${source}$`, "i");
|
|
7839
7766
|
}
|
|
7840
7767
|
|
|
7841
|
-
|
|
7842
|
-
//#region src/common/regexp/or.ts
|
|
7768
|
+
// src/common/regexp/or.ts
|
|
7843
7769
|
/**
|
|
7844
7770
|
* Builds a regex alternation from literal strings and character sets.
|
|
7845
7771
|
*
|
|
@@ -7901,8 +7827,7 @@ var Or = class Or {
|
|
|
7901
7827
|
*/
|
|
7902
7828
|
const or = (...inputs) => new Or(...inputs);
|
|
7903
7829
|
|
|
7904
|
-
|
|
7905
|
-
//#region src/common/regexp/index.ts
|
|
7830
|
+
// src/common/regexp/index.ts
|
|
7906
7831
|
/**
|
|
7907
7832
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
7908
7833
|
*
|
|
@@ -7937,8 +7862,7 @@ const regexp = {
|
|
|
7937
7862
|
createFromWildcard
|
|
7938
7863
|
};
|
|
7939
7864
|
|
|
7940
|
-
|
|
7941
|
-
//#region src/shared/numfmt/utils.ts
|
|
7865
|
+
// src/shared/numfmt/utils.ts
|
|
7942
7866
|
const DEFAULT_TEXT_FORMAT = "@@@";
|
|
7943
7867
|
const DEFAULT_TEXT_FORMAT_EXCEL = "@";
|
|
7944
7868
|
const DEFAULT_NUMBER_FORMAT = "General";
|
|
@@ -8078,8 +8002,7 @@ const getNumfmtParseValueFilter = (value, options = {}) => {
|
|
|
8078
8002
|
return parseData;
|
|
8079
8003
|
};
|
|
8080
8004
|
|
|
8081
|
-
|
|
8082
|
-
//#region src/shared/object-matrix.ts
|
|
8005
|
+
// src/shared/object-matrix.ts
|
|
8083
8006
|
function mapObjectMatrix(o, callback) {
|
|
8084
8007
|
const result = {};
|
|
8085
8008
|
for (const row in o) {
|
|
@@ -8616,8 +8539,7 @@ var ObjectMatrix = class ObjectMatrix {
|
|
|
8616
8539
|
}
|
|
8617
8540
|
};
|
|
8618
8541
|
|
|
8619
|
-
|
|
8620
|
-
//#region src/shared/common.ts
|
|
8542
|
+
// src/shared/common.ts
|
|
8621
8543
|
/**
|
|
8622
8544
|
* Data type convert, convert ICellWithCoord to IRangeWithCoord
|
|
8623
8545
|
* @param cellInfo
|
|
@@ -8916,7 +8838,29 @@ function cellToRange(row, col) {
|
|
|
8916
8838
|
};
|
|
8917
8839
|
}
|
|
8918
8840
|
/**
|
|
8841
|
+
* Writing content replaces the target formula, and writing a new formula disassociates the target
|
|
8842
|
+
* from its shared formula id. The formula controller performs both removals for the current client
|
|
8843
|
+
* with an `onlyLocal` mutation, which never reaches a collaboration changeset, so they have to be
|
|
8844
|
+
* part of the write itself.
|
|
8845
|
+
* @param {ICellData} cell - The cell data to normalize.
|
|
8846
|
+
* @returns {ICellData} The same instance when no formula identity has to be removed.
|
|
8847
|
+
*/
|
|
8848
|
+
function withFormulaIdentityCleared(cell) {
|
|
8849
|
+
if (cell.si !== void 0) return cell;
|
|
8850
|
+
if (cell.f !== void 0) return {
|
|
8851
|
+
...cell,
|
|
8852
|
+
si: null
|
|
8853
|
+
};
|
|
8854
|
+
if (cell.v === void 0 && cell.p === void 0) return cell;
|
|
8855
|
+
return {
|
|
8856
|
+
...cell,
|
|
8857
|
+
f: null,
|
|
8858
|
+
si: null
|
|
8859
|
+
};
|
|
8860
|
+
}
|
|
8861
|
+
/**
|
|
8919
8862
|
* Covert cell value to cell data.
|
|
8863
|
+
* A formula or content value also clears the shared formula id of the cell it replaces.
|
|
8920
8864
|
* @param {CellValue | ICellData} value - The cell value.
|
|
8921
8865
|
* @returns {ICellData} The cell data.
|
|
8922
8866
|
*/
|
|
@@ -8924,7 +8868,8 @@ function covertCellValue(value) {
|
|
|
8924
8868
|
if (isFormulaString(value)) return {
|
|
8925
8869
|
f: value,
|
|
8926
8870
|
v: null,
|
|
8927
|
-
p: null
|
|
8871
|
+
p: null,
|
|
8872
|
+
si: null
|
|
8928
8873
|
};
|
|
8929
8874
|
if (isCellV(value)) {
|
|
8930
8875
|
if (typeof value === "string") {
|
|
@@ -8933,16 +8878,18 @@ function covertCellValue(value) {
|
|
|
8933
8878
|
v: parseData.v,
|
|
8934
8879
|
p: null,
|
|
8935
8880
|
f: null,
|
|
8881
|
+
si: null,
|
|
8936
8882
|
s: { n: { pattern: parseData.z || "General" } }
|
|
8937
8883
|
};
|
|
8938
8884
|
}
|
|
8939
8885
|
return {
|
|
8940
8886
|
v: value,
|
|
8941
8887
|
p: null,
|
|
8942
|
-
f: null
|
|
8888
|
+
f: null,
|
|
8889
|
+
si: null
|
|
8943
8890
|
};
|
|
8944
8891
|
}
|
|
8945
|
-
if (isICellData(value)) return value;
|
|
8892
|
+
if (isICellData(value)) return withFormulaIdentityCleared(value);
|
|
8946
8893
|
return value;
|
|
8947
8894
|
}
|
|
8948
8895
|
/**
|
|
@@ -8961,8 +8908,7 @@ function covertCellValues(value, range) {
|
|
|
8961
8908
|
return cellValue.getMatrix();
|
|
8962
8909
|
}
|
|
8963
8910
|
|
|
8964
|
-
|
|
8965
|
-
//#region src/shared/compare.ts
|
|
8911
|
+
// src/shared/compare.ts
|
|
8966
8912
|
function deepCompare(arg1, arg2) {
|
|
8967
8913
|
if (Object.prototype.toString.call(arg1) === Object.prototype.toString.call(arg2)) {
|
|
8968
8914
|
if (Object.prototype.toString.call(arg1) === "[object Object]" || Object.prototype.toString.call(arg1) === "[object Array]") {
|
|
@@ -8988,8 +8934,7 @@ function checkForSubstrings(searchString, substrings) {
|
|
|
8988
8934
|
return substrings.some((substring) => searchString.indexOf(substring) > -1);
|
|
8989
8935
|
}
|
|
8990
8936
|
|
|
8991
|
-
|
|
8992
|
-
//#region src/shared/date-kit.ts
|
|
8937
|
+
// src/shared/date-kit.ts
|
|
8993
8938
|
const SECOND = 1e3;
|
|
8994
8939
|
const MINUTE = 60 * SECOND;
|
|
8995
8940
|
const HOUR = 60 * MINUTE;
|
|
@@ -9378,8 +9323,7 @@ const dateKit = Object.assign(createDateKit, {
|
|
|
9378
9323
|
unix: (timestamp) => createDateKit(timestamp * 1e3)
|
|
9379
9324
|
});
|
|
9380
9325
|
|
|
9381
|
-
|
|
9382
|
-
//#region src/shared/doc-tool.ts
|
|
9326
|
+
// src/shared/doc-tool.ts
|
|
9383
9327
|
function horizontalLineSegmentsSubtraction(aStart, aEnd, bStart, bEnd) {
|
|
9384
9328
|
if (aStart > aEnd) throw new Error("a1 should be less than a2");
|
|
9385
9329
|
if (bStart > bEnd) throw new Error("b1 should be less than b2");
|
|
@@ -9415,8 +9359,7 @@ function deleteContent(content, start, end) {
|
|
|
9415
9359
|
return content.slice(0, start) + content.slice(end);
|
|
9416
9360
|
}
|
|
9417
9361
|
|
|
9418
|
-
|
|
9419
|
-
//#region src/shared/generate.ts
|
|
9362
|
+
// src/shared/generate.ts
|
|
9420
9363
|
/**
|
|
9421
9364
|
* Determine whether it is a pure number, "12" and "12e+3" are both true
|
|
9422
9365
|
* @param val The number or string to be judged
|
|
@@ -9434,8 +9377,7 @@ function isRealNum(val) {
|
|
|
9434
9377
|
return false;
|
|
9435
9378
|
}
|
|
9436
9379
|
|
|
9437
|
-
|
|
9438
|
-
//#region src/shared/hash-algorithm.ts
|
|
9380
|
+
// src/shared/hash-algorithm.ts
|
|
9439
9381
|
/**
|
|
9440
9382
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
9441
9383
|
*
|
|
@@ -9457,8 +9399,7 @@ function hashAlgorithm(str) {
|
|
|
9457
9399
|
return hash >>> 0;
|
|
9458
9400
|
}
|
|
9459
9401
|
|
|
9460
|
-
|
|
9461
|
-
//#region src/shared/intervals.ts
|
|
9402
|
+
// src/shared/intervals.ts
|
|
9462
9403
|
/**
|
|
9463
9404
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
9464
9405
|
*
|
|
@@ -9519,8 +9460,7 @@ function mergeIntervals(intervals) {
|
|
|
9519
9460
|
return merged;
|
|
9520
9461
|
}
|
|
9521
9462
|
|
|
9522
|
-
|
|
9523
|
-
//#region src/shared/locale.ts
|
|
9463
|
+
// src/shared/locale.ts
|
|
9524
9464
|
/**
|
|
9525
9465
|
* Merges multiple locale objects into a single locale object.
|
|
9526
9466
|
* It can accept either multiple locale objects as arguments or a single array of locale objects.
|
|
@@ -9534,8 +9474,7 @@ function mergeLocales(...locales) {
|
|
|
9534
9474
|
return Object.assign({}, ...mergedLocales);
|
|
9535
9475
|
}
|
|
9536
9476
|
|
|
9537
|
-
|
|
9538
|
-
//#region src/shared/lru/lru-map.ts
|
|
9477
|
+
// src/shared/lru/lru-map.ts
|
|
9539
9478
|
let _Symbol$iterator;
|
|
9540
9479
|
let _Symbol$iterator2;
|
|
9541
9480
|
let _Symbol$iterator3;
|
|
@@ -9841,8 +9780,7 @@ var LRUHelper = class {
|
|
|
9841
9780
|
}
|
|
9842
9781
|
};
|
|
9843
9782
|
|
|
9844
|
-
|
|
9845
|
-
//#region src/shared/max-row-column.ts
|
|
9783
|
+
// src/shared/max-row-column.ts
|
|
9846
9784
|
/**
|
|
9847
9785
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
9848
9786
|
*
|
|
@@ -9880,8 +9818,7 @@ function columnLabelToNumber(label) {
|
|
|
9880
9818
|
const MAX_ROW_COUNT = 1048576;
|
|
9881
9819
|
const MAX_COLUMN_COUNT = 16384;
|
|
9882
9820
|
|
|
9883
|
-
|
|
9884
|
-
//#region src/shared/random-id.ts
|
|
9821
|
+
// src/shared/random-id.ts
|
|
9885
9822
|
/**
|
|
9886
9823
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
9887
9824
|
*
|
|
@@ -9930,8 +9867,7 @@ function generateRandomId(n = 21, alphabet) {
|
|
|
9930
9867
|
return createRandomId(n, alphabet);
|
|
9931
9868
|
}
|
|
9932
9869
|
|
|
9933
|
-
|
|
9934
|
-
//#region src/shared/rectangle.ts
|
|
9870
|
+
// src/shared/rectangle.ts
|
|
9935
9871
|
/**
|
|
9936
9872
|
* This class provides a set of methods to calculate and manipulate rectangular ranges (IRange).
|
|
9937
9873
|
* A range represents a rectangular area in a grid, defined by start/end rows and columns.
|
|
@@ -10364,8 +10300,7 @@ _defineProperty(Rectangle, "moveOffset", (range, offsetX, offsetY) => {
|
|
|
10364
10300
|
return _range;
|
|
10365
10301
|
});
|
|
10366
10302
|
|
|
10367
|
-
|
|
10368
|
-
//#region src/shared/range.ts
|
|
10303
|
+
// src/shared/range.ts
|
|
10369
10304
|
function moveRangeByOffset(range, refOffsetX, refOffsetY, ignoreAbsolute = false) {
|
|
10370
10305
|
if (refOffsetX === 0 && refOffsetY === 0) return range;
|
|
10371
10306
|
let newRange = { ...range };
|
|
@@ -10624,8 +10559,7 @@ function inferRangeType(startRow, endRow, startColumn, endColumn) {
|
|
|
10624
10559
|
else return 3;
|
|
10625
10560
|
}
|
|
10626
10561
|
|
|
10627
|
-
|
|
10628
|
-
//#region src/shared/ref-alias.ts
|
|
10562
|
+
// src/shared/ref-alias.ts
|
|
10629
10563
|
/**
|
|
10630
10564
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
10631
10565
|
*
|
|
@@ -10718,16 +10652,14 @@ var RefAlias = class {
|
|
|
10718
10652
|
}
|
|
10719
10653
|
};
|
|
10720
10654
|
|
|
10721
|
-
|
|
10722
|
-
//#region src/shared/row-col-iter.ts
|
|
10655
|
+
// src/shared/row-col-iter.ts
|
|
10723
10656
|
function createRowColIter(rowStart, rowEnd, colStart, colEnd) {
|
|
10724
10657
|
return { forEach(cb) {
|
|
10725
10658
|
for (let r = rowStart; r <= rowEnd; r++) for (let c = colStart; c <= colEnd; c++) cb(r, c);
|
|
10726
10659
|
} };
|
|
10727
10660
|
}
|
|
10728
10661
|
|
|
10729
|
-
|
|
10730
|
-
//#region src/shared/sequence.ts
|
|
10662
|
+
// src/shared/sequence.ts
|
|
10731
10663
|
/**
|
|
10732
10664
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
10733
10665
|
*
|
|
@@ -10801,8 +10733,7 @@ function numberToListABC(n, uppercase = false) {
|
|
|
10801
10733
|
return repeatStringNumTimes(String.fromCharCode(n % len + order), Math.floor(n / len) + 1);
|
|
10802
10734
|
}
|
|
10803
10735
|
|
|
10804
|
-
|
|
10805
|
-
//#region src/shared/sort-rules.ts
|
|
10736
|
+
// src/shared/sort-rules.ts
|
|
10806
10737
|
/**
|
|
10807
10738
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
10808
10739
|
*
|
|
@@ -10842,8 +10773,7 @@ function sortRulesFactory(key = "index", ruler = 1) {
|
|
|
10842
10773
|
};
|
|
10843
10774
|
}
|
|
10844
10775
|
|
|
10845
|
-
|
|
10846
|
-
//#region src/bases/typedef.ts
|
|
10776
|
+
// src/bases/typedef.ts
|
|
10847
10777
|
let BaseFieldType = /* @__PURE__ */ function(BaseFieldType) {
|
|
10848
10778
|
BaseFieldType["Text"] = "text";
|
|
10849
10779
|
BaseFieldType["SingleSelect"] = "singleSelect";
|
|
@@ -10968,8 +10898,7 @@ let BaseHierarchyInvalidReason = /* @__PURE__ */ function(BaseHierarchyInvalidRe
|
|
|
10968
10898
|
return BaseHierarchyInvalidReason;
|
|
10969
10899
|
}({});
|
|
10970
10900
|
|
|
10971
|
-
|
|
10972
|
-
//#region src/bases/record-identity.ts
|
|
10901
|
+
// src/bases/record-identity.ts
|
|
10973
10902
|
const BASE_RECORD_ID_FIELD_ID = "__record_id";
|
|
10974
10903
|
const BASE_RECORD_ID_FIELD_NAME = "record-id";
|
|
10975
10904
|
const BASE_RECORD_ID_PATTERN = /^[A-Za-z0-9_-]+$/;
|
|
@@ -11000,8 +10929,7 @@ function assertBaseTableRecordIdentity(table) {
|
|
|
11000
10929
|
for (const [recordKey, record] of Object.entries(table.records)) if (record.id !== recordKey || !isValidBaseRecordId(record.id) || record.values["__record_id"] !== record.id) throw new Error(`[BaseDataModel]: record "${recordKey}" has an invalid record-id projection.`);
|
|
11001
10930
|
}
|
|
11002
10931
|
|
|
11003
|
-
|
|
11004
|
-
//#region src/bases/empty-snapshot.ts
|
|
10932
|
+
// src/bases/empty-snapshot.ts
|
|
11005
10933
|
function createDefaultBaseTableSnapshot(options) {
|
|
11006
10934
|
const now = options.now ?? Date.now();
|
|
11007
10935
|
const primaryFieldId = options.primaryFieldId ?? generateRandomId(6);
|
|
@@ -11096,8 +11024,7 @@ function getEmptySnapshot(unitId = generateRandomId(), name = "", locale = "zhCN
|
|
|
11096
11024
|
};
|
|
11097
11025
|
}
|
|
11098
11026
|
|
|
11099
|
-
|
|
11100
|
-
//#region src/bases/base-data-model.ts
|
|
11027
|
+
// src/bases/base-data-model.ts
|
|
11101
11028
|
const BASE_LIST_VALUE_SEPARATOR = ", ";
|
|
11102
11029
|
const BASE_ATTACHMENT_RESOURCE_KEY_SEPARATOR = "";
|
|
11103
11030
|
var BaseDataModel = class extends UnitModel {
|
|
@@ -11427,8 +11354,7 @@ function normalizeBaseCellValueType(type, value) {
|
|
|
11427
11354
|
return inferPrimitiveType(value ?? null);
|
|
11428
11355
|
}
|
|
11429
11356
|
|
|
11430
|
-
|
|
11431
|
-
//#region src/bases/formula-table-name.ts
|
|
11357
|
+
// src/bases/formula-table-name.ts
|
|
11432
11358
|
function normalizeBaseFormulaTableName(displayName) {
|
|
11433
11359
|
const replaced = displayName.trim().replace(/[^A-Za-z0-9_.]+/g, "_");
|
|
11434
11360
|
const normalized = /[A-Za-z0-9]/.test(replaced) ? replaced : "Table";
|
|
@@ -11592,8 +11518,7 @@ function scanFormulaStringState(formula, start, end, initialState) {
|
|
|
11592
11518
|
return inString;
|
|
11593
11519
|
}
|
|
11594
11520
|
|
|
11595
|
-
|
|
11596
|
-
//#region src/common/boolean.ts
|
|
11521
|
+
// src/common/boolean.ts
|
|
11597
11522
|
/**
|
|
11598
11523
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
11599
11524
|
*
|
|
@@ -11614,8 +11539,7 @@ function isBooleanString(str) {
|
|
|
11614
11539
|
return BooleanStringSet.has(str.toLowerCase());
|
|
11615
11540
|
}
|
|
11616
11541
|
|
|
11617
|
-
|
|
11618
|
-
//#region src/common/const.ts
|
|
11542
|
+
// src/common/const.ts
|
|
11619
11543
|
/**
|
|
11620
11544
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
11621
11545
|
*
|
|
@@ -11649,8 +11573,7 @@ function isCommentEditorID(id) {
|
|
|
11649
11573
|
return id.startsWith(DOCS_COMMENT_EDITOR_UNIT_ID_KEY);
|
|
11650
11574
|
}
|
|
11651
11575
|
|
|
11652
|
-
|
|
11653
|
-
//#region src/types/interfaces/i-drawing.ts
|
|
11576
|
+
// src/types/interfaces/i-drawing.ts
|
|
11654
11577
|
/**
|
|
11655
11578
|
* The layer type of Drawing, used to distinguish between forward, backward, front, and back
|
|
11656
11579
|
*/
|
|
@@ -11729,11 +11652,12 @@ let DrawingTypeEnum = /* @__PURE__ */ function(DrawingTypeEnum) {
|
|
|
11729
11652
|
* Spreadsheet Timeline control.
|
|
11730
11653
|
*/
|
|
11731
11654
|
DrawingTypeEnum[DrawingTypeEnum["DRAWING_TIMELINE"] = 11] = "DRAWING_TIMELINE";
|
|
11655
|
+
/** Independent Office attachment; its preview image is separate from its original file. */
|
|
11656
|
+
DrawingTypeEnum[DrawingTypeEnum["DRAWING_OLE"] = 12] = "DRAWING_OLE";
|
|
11732
11657
|
return DrawingTypeEnum;
|
|
11733
11658
|
}({});
|
|
11734
11659
|
|
|
11735
|
-
|
|
11736
|
-
//#region src/common/drawing-order.ts
|
|
11660
|
+
// src/common/drawing-order.ts
|
|
11737
11661
|
/** Clamps a requested zero-based index to an available drawing order. */
|
|
11738
11662
|
function normalizeDrawingOrderIndex(index, length) {
|
|
11739
11663
|
const lastIndex = Math.max(0, length - 1);
|
|
@@ -11748,8 +11672,7 @@ function getDrawingOrderIndex(currentIndex, length, arrangeType) {
|
|
|
11748
11672
|
return 0;
|
|
11749
11673
|
}
|
|
11750
11674
|
|
|
11751
|
-
|
|
11752
|
-
//#region src/common/equal.ts
|
|
11675
|
+
// src/common/equal.ts
|
|
11753
11676
|
/**
|
|
11754
11677
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
11755
11678
|
*
|
|
@@ -11780,8 +11703,7 @@ function shallowEqual(objA, objB) {
|
|
|
11780
11703
|
return true;
|
|
11781
11704
|
}
|
|
11782
11705
|
|
|
11783
|
-
|
|
11784
|
-
//#region src/common/function.ts
|
|
11706
|
+
// src/common/function.ts
|
|
11785
11707
|
/**
|
|
11786
11708
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
11787
11709
|
*
|
|
@@ -11824,8 +11746,7 @@ function throttle(fn, wait = 16) {
|
|
|
11824
11746
|
};
|
|
11825
11747
|
}
|
|
11826
11748
|
|
|
11827
|
-
|
|
11828
|
-
//#region src/common/interceptor.ts
|
|
11749
|
+
// src/common/interceptor.ts
|
|
11829
11750
|
let InterceptorEffectEnum = /* @__PURE__ */ function(InterceptorEffectEnum) {
|
|
11830
11751
|
InterceptorEffectEnum[InterceptorEffectEnum["Style"] = 1] = "Style";
|
|
11831
11752
|
InterceptorEffectEnum[InterceptorEffectEnum["Value"] = 2] = "Value";
|
|
@@ -11946,8 +11867,7 @@ var AsyncInterceptorManager = class {
|
|
|
11946
11867
|
}
|
|
11947
11868
|
};
|
|
11948
11869
|
|
|
11949
|
-
|
|
11950
|
-
//#region src/common/invert-color/utils.ts
|
|
11870
|
+
// src/common/invert-color/utils.ts
|
|
11951
11871
|
function normalizeRGBColor(color) {
|
|
11952
11872
|
return color.map((c) => c / 255);
|
|
11953
11873
|
}
|
|
@@ -11955,8 +11875,7 @@ function denormalizeRGBColor(color) {
|
|
|
11955
11875
|
return color.map((c) => Math.round(c * 255));
|
|
11956
11876
|
}
|
|
11957
11877
|
|
|
11958
|
-
|
|
11959
|
-
//#region src/common/invert-color/invert-hsl.ts
|
|
11878
|
+
// src/common/invert-color/invert-hsl.ts
|
|
11960
11879
|
function rgbToHsl([r, g, b]) {
|
|
11961
11880
|
const max = Math.max(r, g, b);
|
|
11962
11881
|
const min = Math.min(r, g, b);
|
|
@@ -12056,8 +11975,7 @@ function invertColorByHSL(color) {
|
|
|
12056
11975
|
return denormalizeRGBColor(invertNormalizedColorByHSL(normalizeRGBColor(color)));
|
|
12057
11976
|
}
|
|
12058
11977
|
|
|
12059
|
-
|
|
12060
|
-
//#region src/common/invert-color/invert-rgb.ts
|
|
11978
|
+
// src/common/invert-color/invert-rgb.ts
|
|
12061
11979
|
const matrix = [
|
|
12062
11980
|
[
|
|
12063
11981
|
.333,
|
|
@@ -12109,8 +12027,7 @@ function invertColorByMatrix(color) {
|
|
|
12109
12027
|
return denormalizeRGBColor(invertNormalizedColorByMatrix(normalizeRGBColor(color)));
|
|
12110
12028
|
}
|
|
12111
12029
|
|
|
12112
|
-
|
|
12113
|
-
//#region src/common/memory-cursor.ts
|
|
12030
|
+
// src/common/memory-cursor.ts
|
|
12114
12031
|
/**
|
|
12115
12032
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
12116
12033
|
*
|
|
@@ -12142,8 +12059,7 @@ var MemoryCursor = class {
|
|
|
12142
12059
|
}
|
|
12143
12060
|
};
|
|
12144
12061
|
|
|
12145
|
-
|
|
12146
|
-
//#region src/common/mixin.ts
|
|
12062
|
+
// src/common/mixin.ts
|
|
12147
12063
|
/**
|
|
12148
12064
|
* Mixin some methods to targetObject as prototype, the static methods will not be mixed in
|
|
12149
12065
|
* @param {T} targetClassPrototype The target class to mixin
|
|
@@ -12153,8 +12069,7 @@ function mixinClass(targetClassPrototype, mixin) {
|
|
|
12153
12069
|
for (const key in mixin) if (mixin.hasOwnProperty(key)) targetClassPrototype[key] = mixin[key];
|
|
12154
12070
|
}
|
|
12155
12071
|
|
|
12156
|
-
|
|
12157
|
-
//#region src/common/number.ts
|
|
12072
|
+
// src/common/number.ts
|
|
12158
12073
|
/**
|
|
12159
12074
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
12160
12075
|
*
|
|
@@ -12186,8 +12101,7 @@ function willLoseNumericPrecision(str) {
|
|
|
12186
12101
|
return Number(str) > Number.MAX_SAFE_INTEGER || str.length >= 18;
|
|
12187
12102
|
}
|
|
12188
12103
|
|
|
12189
|
-
|
|
12190
|
-
//#region src/common/registry.ts
|
|
12104
|
+
// src/common/registry.ts
|
|
12191
12105
|
/**
|
|
12192
12106
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
12193
12107
|
*
|
|
@@ -12247,8 +12161,7 @@ var RegistryAsMap = class RegistryAsMap {
|
|
|
12247
12161
|
}
|
|
12248
12162
|
};
|
|
12249
12163
|
|
|
12250
|
-
|
|
12251
|
-
//#region src/common/request-immediate-macro-task.ts
|
|
12164
|
+
// src/common/request-immediate-macro-task.ts
|
|
12252
12165
|
/**
|
|
12253
12166
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
12254
12167
|
*
|
|
@@ -12288,8 +12201,7 @@ function requestImmediateMacroTask(callback) {
|
|
|
12288
12201
|
};
|
|
12289
12202
|
}
|
|
12290
12203
|
|
|
12291
|
-
|
|
12292
|
-
//#region src/common/set.ts
|
|
12204
|
+
// src/common/set.ts
|
|
12293
12205
|
/**
|
|
12294
12206
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
12295
12207
|
*
|
|
@@ -12316,8 +12228,7 @@ function mergeSets(s1, s2) {
|
|
|
12316
12228
|
return s1;
|
|
12317
12229
|
}
|
|
12318
12230
|
|
|
12319
|
-
|
|
12320
|
-
//#region src/docs/section-break-id.ts
|
|
12231
|
+
// src/docs/section-break-id.ts
|
|
12321
12232
|
const SECTION_ID_PREFIX = "section_";
|
|
12322
12233
|
function createSectionId(existingIds) {
|
|
12323
12234
|
let sectionId = `${SECTION_ID_PREFIX}${generateRandomId(12)}`;
|
|
@@ -12338,8 +12249,7 @@ function isValidSectionId(value) {
|
|
|
12338
12249
|
return typeof value === "string" && value.startsWith("section_") && value.length > 8;
|
|
12339
12250
|
}
|
|
12340
12251
|
|
|
12341
|
-
|
|
12342
|
-
//#region src/docs/data-model/types.ts
|
|
12252
|
+
// src/docs/data-model/types.ts
|
|
12343
12253
|
/**
|
|
12344
12254
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
12345
12255
|
*
|
|
@@ -12394,8 +12304,7 @@ let DataStreamTreeTokenType = /* @__PURE__ */ function(DataStreamTreeTokenType)
|
|
|
12394
12304
|
return DataStreamTreeTokenType;
|
|
12395
12305
|
}({});
|
|
12396
12306
|
|
|
12397
|
-
|
|
12398
|
-
//#region src/docs/data-model/document-statistics.ts
|
|
12307
|
+
// src/docs/data-model/document-statistics.ts
|
|
12399
12308
|
const CONTROL_TOKENS = /* @__PURE__ */ new Set([
|
|
12400
12309
|
"\r",
|
|
12401
12310
|
"\n",
|
|
@@ -12505,8 +12414,7 @@ async function calculateDocumentStatistics(dataStream, options) {
|
|
|
12505
12414
|
return statistics;
|
|
12506
12415
|
}
|
|
12507
12416
|
|
|
12508
|
-
|
|
12509
|
-
//#region src/types/interfaces/i-document-data.ts
|
|
12417
|
+
// src/types/interfaces/i-document-data.ts
|
|
12510
12418
|
/**
|
|
12511
12419
|
* The top-level block types in a document body.
|
|
12512
12420
|
* These block types are used to represent the structure of the document and can be used to identify different sections or elements within the document.
|
|
@@ -12953,8 +12861,7 @@ const PAPER_TYPES = [
|
|
|
12953
12861
|
"Folio"
|
|
12954
12862
|
];
|
|
12955
12863
|
|
|
12956
|
-
|
|
12957
|
-
//#region src/types/interfaces/i-style-data.ts
|
|
12864
|
+
// src/types/interfaces/i-style-data.ts
|
|
12958
12865
|
function defineExactKeys() {
|
|
12959
12866
|
return (keys) => keys;
|
|
12960
12867
|
}
|
|
@@ -13030,8 +12937,7 @@ const STYLE_KEYS = defineExactKeys()([
|
|
|
13030
12937
|
"pd"
|
|
13031
12938
|
]);
|
|
13032
12939
|
|
|
13033
|
-
|
|
13034
|
-
//#region src/types/const/const.ts
|
|
12940
|
+
// src/types/const/const.ts
|
|
13035
12941
|
/**
|
|
13036
12942
|
* Used as an illegal range array return value
|
|
13037
12943
|
*/
|
|
@@ -13233,8 +13139,7 @@ const NAMED_STYLE_SPACE_MAP = {
|
|
|
13233
13139
|
};
|
|
13234
13140
|
const DOC_DRAWING_PRINTING_COMPONENT_KEY = "univer-docs-drawing-printing";
|
|
13235
13141
|
|
|
13236
|
-
|
|
13237
|
-
//#region src/types/const/extension-names.ts
|
|
13142
|
+
// src/types/const/extension-names.ts
|
|
13238
13143
|
/**
|
|
13239
13144
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
13240
13145
|
*
|
|
@@ -13256,8 +13161,7 @@ let EXTENSION_NAMES = /* @__PURE__ */ function(EXTENSION_NAMES) {
|
|
|
13256
13161
|
return EXTENSION_NAMES;
|
|
13257
13162
|
}({});
|
|
13258
13163
|
|
|
13259
|
-
|
|
13260
|
-
//#region src/types/const/page-size.ts
|
|
13164
|
+
// src/types/const/page-size.ts
|
|
13261
13165
|
const PAGE_SIZE = {
|
|
13262
13166
|
["A3"]: {
|
|
13263
13167
|
width: 1123,
|
|
@@ -13319,8 +13223,7 @@ const MODERN_DOCUMENT_DEFAULT_MARGIN = 50 / .75;
|
|
|
13319
13223
|
/** Default margin for a paginated Traditional document, in 96-DPI layout pixels. */
|
|
13320
13224
|
const TRADITIONAL_DOCUMENT_DEFAULT_MARGIN = 72;
|
|
13321
13225
|
|
|
13322
|
-
|
|
13323
|
-
//#region src/docs/paragraph-id.ts
|
|
13226
|
+
// src/docs/paragraph-id.ts
|
|
13324
13227
|
const PARAGRAPH_ID_PREFIX = "para_";
|
|
13325
13228
|
function createParagraphId(existingIds) {
|
|
13326
13229
|
let paragraphId = `${PARAGRAPH_ID_PREFIX}${generateRandomId(12)}`;
|
|
@@ -13353,8 +13256,7 @@ function cloneParagraph(paragraph) {
|
|
|
13353
13256
|
return JSON.parse(JSON.stringify(paragraph));
|
|
13354
13257
|
}
|
|
13355
13258
|
|
|
13356
|
-
|
|
13357
|
-
//#region src/docs/data-model/empty-snapshot.ts
|
|
13259
|
+
// src/docs/data-model/empty-snapshot.ts
|
|
13358
13260
|
function getEmptySnapshot$1(unitID = generateRandomId(6), locale = "enUS", title = "", documentFlavor = 2) {
|
|
13359
13261
|
const EMPTY_DOCUMENT_DATA = {
|
|
13360
13262
|
id: unitID,
|
|
@@ -13434,8 +13336,7 @@ function getEmptySnapshot$1(unitID = generateRandomId(6), locale = "enUS", title
|
|
|
13434
13336
|
return EMPTY_DOCUMENT_DATA;
|
|
13435
13337
|
}
|
|
13436
13338
|
|
|
13437
|
-
|
|
13438
|
-
//#region src/docs/data-model/text-x/action-types.ts
|
|
13339
|
+
// src/docs/data-model/text-x/action-types.ts
|
|
13439
13340
|
const PRESERVE_INSERTED_PARAGRAPH_IDS = "__textXPreserveParagraphIds";
|
|
13440
13341
|
let TextXActionType = /* @__PURE__ */ function(TextXActionType) {
|
|
13441
13342
|
TextXActionType["RETAIN"] = "r";
|
|
@@ -13444,8 +13345,7 @@ let TextXActionType = /* @__PURE__ */ function(TextXActionType) {
|
|
|
13444
13345
|
return TextXActionType;
|
|
13445
13346
|
}({});
|
|
13446
13347
|
|
|
13447
|
-
|
|
13448
|
-
//#region src/docs/data-model/text-x/build-utils/range-interval.ts
|
|
13348
|
+
// src/docs/data-model/text-x/build-utils/range-interval.ts
|
|
13449
13349
|
/** Converts persisted inclusive indexes `[startIndex, endIndex]` to `[startOffset, endOffset)`. */
|
|
13450
13350
|
function getInclusiveRangeInterval(range) {
|
|
13451
13351
|
return {
|
|
@@ -13589,8 +13489,7 @@ function getPairedTokenInterval(dataStream, startOffset, startToken, endToken) {
|
|
|
13589
13489
|
return null;
|
|
13590
13490
|
}
|
|
13591
13491
|
|
|
13592
|
-
|
|
13593
|
-
//#region src/docs/data-model/text-x/apply-utils/common.ts
|
|
13492
|
+
// src/docs/data-model/text-x/apply-utils/common.ts
|
|
13594
13493
|
const RESTORE_INSERTED_PARAGRAPH_IDS = "__textXRestoreParagraphIds";
|
|
13595
13494
|
function normalizeTextRuns(textRuns, reserveEmptyTextRun = false) {
|
|
13596
13495
|
const results = [];
|
|
@@ -14413,8 +14312,7 @@ function deleteCustomDecorations(body, textLength, currentIndex, needOffset = tr
|
|
|
14413
14312
|
return removeCustomDecorations;
|
|
14414
14313
|
}
|
|
14415
14314
|
|
|
14416
|
-
|
|
14417
|
-
//#region src/docs/data-model/preset-list-type.ts
|
|
14315
|
+
// src/docs/data-model/preset-list-type.ts
|
|
14418
14316
|
let QuickListType = /* @__PURE__ */ function(QuickListType) {
|
|
14419
14317
|
QuickListType["ORDER_LIST_QUICK_1"] = "1.";
|
|
14420
14318
|
QuickListType["ORDER_LIST_QUICK_2"] = "a)";
|
|
@@ -14848,8 +14746,7 @@ const QuickListTypeMap = {
|
|
|
14848
14746
|
["*"]: "BULLET_LIST"
|
|
14849
14747
|
};
|
|
14850
14748
|
|
|
14851
|
-
|
|
14852
|
-
//#region src/docs/data-model/text-x/apply-utils/update-apply.ts
|
|
14749
|
+
// src/docs/data-model/text-x/apply-utils/update-apply.ts
|
|
14853
14750
|
function updateAttribute(body, updateBody, textLength, currentIndex, coverType) {
|
|
14854
14751
|
return {
|
|
14855
14752
|
dataStream: "",
|
|
@@ -15289,8 +15186,7 @@ function updateCustomDecorations(body, updateBody, textLength, currentIndex, cov
|
|
|
15289
15186
|
return removeCustomDecorations;
|
|
15290
15187
|
}
|
|
15291
15188
|
|
|
15292
|
-
|
|
15293
|
-
//#region src/docs/data-model/text-x/build-utils/selection.ts
|
|
15189
|
+
// src/docs/data-model/text-x/build-utils/selection.ts
|
|
15294
15190
|
function makeSelection(startOffset, endOffset) {
|
|
15295
15191
|
if (typeof endOffset === "undefined") return {
|
|
15296
15192
|
startOffset,
|
|
@@ -15362,8 +15258,7 @@ function transformParagraphs(paragraphs, dataStream) {
|
|
|
15362
15258
|
return results;
|
|
15363
15259
|
}
|
|
15364
15260
|
|
|
15365
|
-
|
|
15366
|
-
//#region src/docs/data-model/text-x/build-utils/paragraph.ts
|
|
15261
|
+
// src/docs/data-model/text-x/build-utils/paragraph.ts
|
|
15367
15262
|
const switchParagraphBullet = (params) => {
|
|
15368
15263
|
var _docDataModel$getSelf;
|
|
15369
15264
|
const { paragraphs: currentParagraphs, segmentId, document: docDataModel } = params;
|
|
@@ -15649,8 +15544,7 @@ const setParagraphStyle = (params) => {
|
|
|
15649
15544
|
return textX;
|
|
15650
15545
|
};
|
|
15651
15546
|
|
|
15652
|
-
|
|
15653
|
-
//#region src/docs/data-model/text-x/utils.ts
|
|
15547
|
+
// src/docs/data-model/text-x/utils.ts
|
|
15654
15548
|
let SliceBodyType = /* @__PURE__ */ function(SliceBodyType) {
|
|
15655
15549
|
SliceBodyType[SliceBodyType["copy"] = 0] = "copy";
|
|
15656
15550
|
SliceBodyType[SliceBodyType["cut"] = 1] = "cut";
|
|
@@ -16063,8 +15957,7 @@ function getRichTextEditPath(docDataModel, segmentId = "") {
|
|
|
16063
15957
|
else throw new Error("Segment id not found in headers or footers");
|
|
16064
15958
|
}
|
|
16065
15959
|
|
|
16066
|
-
|
|
16067
|
-
//#region src/docs/data-model/text-x/action-iterator.ts
|
|
15960
|
+
// src/docs/data-model/text-x/action-iterator.ts
|
|
16068
15961
|
var ActionIterator = class {
|
|
16069
15962
|
constructor(_actions) {
|
|
16070
15963
|
this._actions = _actions;
|
|
@@ -16135,8 +16028,7 @@ var ActionIterator = class {
|
|
|
16135
16028
|
}
|
|
16136
16029
|
};
|
|
16137
16030
|
|
|
16138
|
-
|
|
16139
|
-
//#region src/docs/data-model/text-x/apply-utils/delete-apply.ts
|
|
16031
|
+
// src/docs/data-model/text-x/apply-utils/delete-apply.ts
|
|
16140
16032
|
function updateAttributeByDelete(body, textLength, currentIndex) {
|
|
16141
16033
|
var _body$renderedPageBre;
|
|
16142
16034
|
const { dataStream } = body;
|
|
@@ -16179,8 +16071,7 @@ function updateAttributeByDelete(body, textLength, currentIndex) {
|
|
|
16179
16071
|
};
|
|
16180
16072
|
}
|
|
16181
16073
|
|
|
16182
|
-
|
|
16183
|
-
//#region src/docs/data-model/text-x/apply-utils/insert-apply.ts
|
|
16074
|
+
// src/docs/data-model/text-x/apply-utils/insert-apply.ts
|
|
16184
16075
|
function updateAttributeByInsert(body, insertBody, textLength, currentIndex) {
|
|
16185
16076
|
const originalDataStream = body.dataStream;
|
|
16186
16077
|
body.dataStream = insertTextToContent(body.dataStream, currentIndex, insertBody.dataStream);
|
|
@@ -16199,8 +16090,7 @@ function updateAttributeByInsert(body, insertBody, textLength, currentIndex) {
|
|
|
16199
16090
|
insertCustomDecorations(body, insertBody, textLength, currentIndex);
|
|
16200
16091
|
}
|
|
16201
16092
|
|
|
16202
|
-
|
|
16203
|
-
//#region src/docs/data-model/text-x/custom-range-update.ts
|
|
16093
|
+
// src/docs/data-model/text-x/custom-range-update.ts
|
|
16204
16094
|
function getChangedPropertyPaths(before, after, path = []) {
|
|
16205
16095
|
if (Tools.diffValue(before, after)) return [];
|
|
16206
16096
|
if (after && typeof after === "object" && !Array.isArray(after) && (before == null || typeof before === "object" && !Array.isArray(before))) {
|
|
@@ -16413,8 +16303,7 @@ function dropRemovedRangeAnchors(actions, suppressed, updates) {
|
|
|
16413
16303
|
return appendRangeUpdates(kept, moveRangeUpdates(updates, removed));
|
|
16414
16304
|
}
|
|
16415
16305
|
|
|
16416
|
-
|
|
16417
|
-
//#region src/docs/data-model/text-x/apply.ts
|
|
16306
|
+
// src/docs/data-model/text-x/apply.ts
|
|
16418
16307
|
function updateApply(doc, updateBody, textLength, currentIndex, coverType = 0) {
|
|
16419
16308
|
return updateAttribute(doc, updateBody, textLength, currentIndex, coverType);
|
|
16420
16309
|
}
|
|
@@ -16468,8 +16357,7 @@ function onlyHasDataStream$1(body) {
|
|
|
16468
16357
|
return Object.keys(body).length === 1 && typeof body.dataStream === "string";
|
|
16469
16358
|
}
|
|
16470
16359
|
|
|
16471
|
-
|
|
16472
|
-
//#region src/docs/data-model/text-x/transform-utils.ts
|
|
16360
|
+
// src/docs/data-model/text-x/transform-utils.ts
|
|
16473
16361
|
function transformTextRuns(originTextRuns, targetTextRuns, originCoverType, targetCoverType, transformType) {
|
|
16474
16362
|
if (originTextRuns == null || targetTextRuns == null) return targetTextRuns;
|
|
16475
16363
|
if (originTextRuns.length === 0 || targetTextRuns.length === 0) return [];
|
|
@@ -16710,8 +16598,7 @@ function transformBlockRanges(thisBlockRanges, otherBlockRanges, priority) {
|
|
|
16710
16598
|
});
|
|
16711
16599
|
}
|
|
16712
16600
|
|
|
16713
|
-
|
|
16714
|
-
//#region src/docs/data-model/text-x/text-x.ts
|
|
16601
|
+
// src/docs/data-model/text-x/text-x.ts
|
|
16715
16602
|
function onlyHasDataStream(body) {
|
|
16716
16603
|
return Object.keys(body).length === 1;
|
|
16717
16604
|
}
|
|
@@ -17097,8 +16984,7 @@ _defineProperty(TextX, "id", "text-x");
|
|
|
17097
16984
|
_defineProperty(TextX, "uri", "https://github.com/dream-num/univer#text-x");
|
|
17098
16985
|
Object.defineProperty(TextX, "name", { value: "text-x" });
|
|
17099
16986
|
|
|
17100
|
-
|
|
17101
|
-
//#region src/docs/data-model/json-x/json-x.ts
|
|
16987
|
+
// src/docs/data-model/json-x/json-x.ts
|
|
17102
16988
|
var JSONX = class JSONX {
|
|
17103
16989
|
static registerSubtype(subType) {
|
|
17104
16990
|
var _this$_subTypes$get;
|
|
@@ -17151,8 +17037,7 @@ _defineProperty(JSONX, "_subTypes", /* @__PURE__ */ new Map());
|
|
|
17151
17037
|
_defineProperty(JSONX, "_instance", null);
|
|
17152
17038
|
JSONX.registerSubtype(TextX);
|
|
17153
17039
|
|
|
17154
|
-
|
|
17155
|
-
//#region src/docs/data-model/text-x/build-utils/parse.ts
|
|
17040
|
+
// src/docs/data-model/text-x/build-utils/parse.ts
|
|
17156
17041
|
const tags = [
|
|
17157
17042
|
"",
|
|
17158
17043
|
"\x1B",
|
|
@@ -17222,8 +17107,7 @@ const fromPlainText = (text) => {
|
|
|
17222
17107
|
};
|
|
17223
17108
|
};
|
|
17224
17109
|
|
|
17225
|
-
|
|
17226
|
-
//#region src/docs/data-model/document-data-model.ts
|
|
17110
|
+
// src/docs/data-model/document-data-model.ts
|
|
17227
17111
|
const DEFAULT_DOC = {
|
|
17228
17112
|
id: "default_doc",
|
|
17229
17113
|
documentStyle: {}
|
|
@@ -17541,8 +17425,7 @@ var DocumentDataModel = class DocumentDataModel extends DocumentDataModelSimple
|
|
|
17541
17425
|
}
|
|
17542
17426
|
};
|
|
17543
17427
|
|
|
17544
|
-
|
|
17545
|
-
//#region src/docs/data-model/paragraph-style.ts
|
|
17428
|
+
// src/docs/data-model/paragraph-style.ts
|
|
17546
17429
|
function _definedStyle(style) {
|
|
17547
17430
|
if (style == null) return {};
|
|
17548
17431
|
const definedStyle = Tools.deepClone(style);
|
|
@@ -17592,9 +17475,17 @@ function resolveDocumentParagraphStyle(documentStyle, paragraphStyle, options =
|
|
|
17592
17475
|
...definedParagraphStyle
|
|
17593
17476
|
});
|
|
17594
17477
|
}
|
|
17478
|
+
/** Resolves word splitting without materializing inherited defaults in the snapshot. */
|
|
17479
|
+
function resolveDocumentParagraphWordWrap(document, paragraph) {
|
|
17480
|
+
const { documentStyle } = document;
|
|
17481
|
+
const { wordWrap } = resolveDocumentParagraphStyle(documentStyle, paragraph === null || paragraph === void 0 ? void 0 : paragraph.paragraphStyle, {
|
|
17482
|
+
styles: document.styles,
|
|
17483
|
+
paragraphStyleId: paragraph === null || paragraph === void 0 ? void 0 : paragraph.styleId
|
|
17484
|
+
});
|
|
17485
|
+
return wordWrap ?? 0;
|
|
17486
|
+
}
|
|
17595
17487
|
|
|
17596
|
-
|
|
17597
|
-
//#region src/docs/data-model/replacement.ts
|
|
17488
|
+
// src/docs/data-model/replacement.ts
|
|
17598
17489
|
function replaceInDocumentBody(body, query, target, caseSensitive) {
|
|
17599
17490
|
if (query === "") return body;
|
|
17600
17491
|
const documentDataModel = new DocumentDataModel({
|
|
@@ -17635,8 +17526,7 @@ function replaceInDocumentBody(body, query, target, caseSensitive) {
|
|
|
17635
17526
|
return newBody;
|
|
17636
17527
|
}
|
|
17637
17528
|
|
|
17638
|
-
|
|
17639
|
-
//#region src/docs/data-model/text-x/build-utils/custom-decoration.ts
|
|
17529
|
+
// src/docs/data-model/text-x/build-utils/custom-decoration.ts
|
|
17640
17530
|
function addCustomDecorationTextX(param) {
|
|
17641
17531
|
const { ranges, id, type } = param;
|
|
17642
17532
|
const textX = new TextX();
|
|
@@ -17694,8 +17584,7 @@ function deleteCustomDecorationTextX(params) {
|
|
|
17694
17584
|
return textX;
|
|
17695
17585
|
}
|
|
17696
17586
|
|
|
17697
|
-
|
|
17698
|
-
//#region src/docs/data-model/text-x/build-utils/custom-range.ts
|
|
17587
|
+
// src/docs/data-model/text-x/build-utils/custom-range.ts
|
|
17699
17588
|
/**
|
|
17700
17589
|
* Check if two ranges intersect
|
|
17701
17590
|
* @param line1Start - The start of the first range
|
|
@@ -17763,8 +17652,7 @@ function getSelectionForAddCustomRange(range, body) {
|
|
|
17763
17652
|
};
|
|
17764
17653
|
}
|
|
17765
17654
|
|
|
17766
|
-
|
|
17767
|
-
//#region src/docs/data-model/text-x/build-utils/text-x-utils.ts
|
|
17655
|
+
// src/docs/data-model/text-x/build-utils/text-x-utils.ts
|
|
17768
17656
|
function deleteCustomRangeTextX(params) {
|
|
17769
17657
|
var _documentDataModel$ge;
|
|
17770
17658
|
const { rangeId, segmentId, documentDataModel, insert } = params;
|
|
@@ -18298,8 +18186,7 @@ const replaceSelectionTextRuns = (params) => {
|
|
|
18298
18186
|
return textX;
|
|
18299
18187
|
};
|
|
18300
18188
|
|
|
18301
|
-
|
|
18302
|
-
//#region src/docs/data-model/text-x/build-utils/drawings.ts
|
|
18189
|
+
// src/docs/data-model/text-x/build-utils/drawings.ts
|
|
18303
18190
|
function getCustomBlockIdsInSelections(body, selections) {
|
|
18304
18191
|
const customBlockIds = [];
|
|
18305
18192
|
const { customBlocks = [] } = body;
|
|
@@ -18439,8 +18326,7 @@ function buildDrawingInsertBody(body, drawings, insertOffset) {
|
|
|
18439
18326
|
};
|
|
18440
18327
|
}
|
|
18441
18328
|
|
|
18442
|
-
|
|
18443
|
-
//#region src/docs/data-model/text-x/build-utils/data-stream-change.ts
|
|
18329
|
+
// src/docs/data-model/text-x/build-utils/data-stream-change.ts
|
|
18444
18330
|
/**
|
|
18445
18331
|
* Finds one contiguous dataStream change. Pure structural insertions and deletions
|
|
18446
18332
|
* are anchored by their stable ids before falling back to string comparison.
|
|
@@ -18504,8 +18390,7 @@ function collectNewStartOffsets(previousItems, nextItems, getId) {
|
|
|
18504
18390
|
return (nextItems ?? []).filter((item) => !previousIds.has(getId(item))).map((item) => item.startIndex);
|
|
18505
18391
|
}
|
|
18506
18392
|
|
|
18507
|
-
|
|
18508
|
-
//#region src/docs/data-model/text-x/build-utils/index.ts
|
|
18393
|
+
// src/docs/data-model/text-x/build-utils/index.ts
|
|
18509
18394
|
/**
|
|
18510
18395
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
18511
18396
|
*
|
|
@@ -18570,8 +18455,7 @@ _defineProperty(BuildTextUtils, "drawing", {
|
|
|
18570
18455
|
remove: removeDrawingReferences
|
|
18571
18456
|
});
|
|
18572
18457
|
|
|
18573
|
-
|
|
18574
|
-
//#region src/docs/data-model/rich-text-builder.ts
|
|
18458
|
+
// src/docs/data-model/rich-text-builder.ts
|
|
18575
18459
|
const NON_EDITABLE_RICH_TEXT_TOKENS = new Set(Object.values(DataStreamTreeTokenType).filter((token) => token !== "" && token !== " "));
|
|
18576
18460
|
function normalizeBody$1(body) {
|
|
18577
18461
|
if (!body.customRanges) body.customRanges = [];
|
|
@@ -21068,8 +20952,7 @@ function createParagraphSnapshot(data, paragraphId, range) {
|
|
|
21068
20952
|
};
|
|
21069
20953
|
}
|
|
21070
20954
|
|
|
21071
|
-
|
|
21072
|
-
//#region src/docs/data-model/subdocument.ts
|
|
20955
|
+
// src/docs/data-model/subdocument.ts
|
|
21073
20956
|
/**
|
|
21074
20957
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
21075
20958
|
*
|
|
@@ -21087,8 +20970,7 @@ function createParagraphSnapshot(data, paragraphId, range) {
|
|
|
21087
20970
|
*/
|
|
21088
20971
|
const DEFAULT_DOCUMENT_SUB_COMPONENT_ID = "__default_document_sub_component_id20231101__";
|
|
21089
20972
|
|
|
21090
|
-
|
|
21091
|
-
//#region src/docs/data-model/text-x/structure-validator.ts
|
|
20973
|
+
// src/docs/data-model/text-x/structure-validator.ts
|
|
21092
20974
|
const DOCUMENT_STRUCTURAL_TOKEN_PATTERN_SOURCE = `[${[
|
|
21093
20975
|
"\r",
|
|
21094
20976
|
"\n",
|
|
@@ -21459,8 +21341,7 @@ function validateDocumentStructure(snapshot) {
|
|
|
21459
21341
|
return issues;
|
|
21460
21342
|
}
|
|
21461
21343
|
|
|
21462
|
-
|
|
21463
|
-
//#region src/docs/section-header-footer.ts
|
|
21344
|
+
// src/docs/section-header-footer.ts
|
|
21464
21345
|
function getSectionHeaderFooterReferenceKey(kind, variant) {
|
|
21465
21346
|
return `${variant === "default" ? "default" : variant === "first" ? "firstPage" : "evenPage"}${kind === "header" ? "Header" : "Footer"}Id`;
|
|
21466
21347
|
}
|
|
@@ -21508,8 +21389,7 @@ function resolveSectionHeaderFooterReferences(documentStyle, sections, sectionIn
|
|
|
21508
21389
|
return result;
|
|
21509
21390
|
}
|
|
21510
21391
|
|
|
21511
|
-
|
|
21512
|
-
//#region src/docs/sdt-binding.ts
|
|
21392
|
+
// src/docs/sdt-binding.ts
|
|
21513
21393
|
function getSdtBindingKey(range) {
|
|
21514
21394
|
var _range$properties;
|
|
21515
21395
|
const binding = (_range$properties = range.properties) === null || _range$properties === void 0 ? void 0 : _range$properties.dataBinding;
|
|
@@ -21539,8 +21419,7 @@ function getSdtBindingValue(body, range) {
|
|
|
21539
21419
|
return ["text", "richText"].includes(range.properties.kind) ? text : void 0;
|
|
21540
21420
|
}
|
|
21541
21421
|
|
|
21542
|
-
|
|
21543
|
-
//#region src/observer/observable.ts
|
|
21422
|
+
// src/observer/observable.ts
|
|
21544
21423
|
/**
|
|
21545
21424
|
* A class serves as a medium between the observable and its observers
|
|
21546
21425
|
*/
|
|
@@ -21636,12 +21515,10 @@ function fromEventSubject(subject$) {
|
|
|
21636
21515
|
});
|
|
21637
21516
|
}
|
|
21638
21517
|
|
|
21639
|
-
|
|
21640
|
-
//#region src/services/resource-manager/type.ts
|
|
21518
|
+
// src/services/resource-manager/type.ts
|
|
21641
21519
|
const IResourceManagerService = (0, _wendellhu_redi.createIdentifier)("core.resource-manager.service");
|
|
21642
21520
|
|
|
21643
|
-
|
|
21644
|
-
//#region src/services/user-manager/const.ts
|
|
21521
|
+
// src/services/user-manager/const.ts
|
|
21645
21522
|
const nameMap = {
|
|
21646
21523
|
[_univerjs_protocol.UnitRole.Editor]: "Editor",
|
|
21647
21524
|
[_univerjs_protocol.UnitRole.Owner]: "Owner",
|
|
@@ -21666,8 +21543,7 @@ const isDevRole = (userId, type) => {
|
|
|
21666
21543
|
return userId.startsWith(nameMap[type]);
|
|
21667
21544
|
};
|
|
21668
21545
|
|
|
21669
|
-
|
|
21670
|
-
//#region src/services/user-manager/user-manager.service.ts
|
|
21546
|
+
// src/services/user-manager/user-manager.service.ts
|
|
21671
21547
|
/**
|
|
21672
21548
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
21673
21549
|
*
|
|
@@ -21734,8 +21610,7 @@ var UserManagerService = class extends Disposable {
|
|
|
21734
21610
|
}
|
|
21735
21611
|
};
|
|
21736
21612
|
|
|
21737
|
-
|
|
21738
|
-
//#region src/services/authz-io/authz-io-local.service.ts
|
|
21613
|
+
// src/services/authz-io/authz-io-local.service.ts
|
|
21739
21614
|
let AuthzIoLocalService = class AuthzIoLocalService {
|
|
21740
21615
|
constructor(_resourceManagerService, _userManagerService) {
|
|
21741
21616
|
this._resourceManagerService = _resourceManagerService;
|
|
@@ -22046,12 +21921,10 @@ let AuthzIoLocalService = class AuthzIoLocalService {
|
|
|
22046
21921
|
};
|
|
22047
21922
|
AuthzIoLocalService = __decorate([__decorateParam(0, IResourceManagerService), __decorateParam(1, (0, _wendellhu_redi.Inject)(UserManagerService))], AuthzIoLocalService);
|
|
22048
21923
|
|
|
22049
|
-
|
|
22050
|
-
//#region src/services/authz-io/type.ts
|
|
21924
|
+
// src/services/authz-io/type.ts
|
|
22051
21925
|
const IAuthzIoService = (0, _wendellhu_redi.createIdentifier)("IAuthzIoIoService");
|
|
22052
21926
|
|
|
22053
|
-
|
|
22054
|
-
//#region src/services/confirm/confirm.service.ts
|
|
21927
|
+
// src/services/confirm/confirm.service.ts
|
|
22055
21928
|
const IConfirmService = (0, _wendellhu_redi.createIdentifier)("univer.confirm-service");
|
|
22056
21929
|
/**
|
|
22057
21930
|
* This is a mock service for testing purposes.
|
|
@@ -22074,8 +21947,7 @@ var TestConfirmService = class {
|
|
|
22074
21947
|
}
|
|
22075
21948
|
};
|
|
22076
21949
|
|
|
22077
|
-
|
|
22078
|
-
//#region src/services/context/context.ts
|
|
21950
|
+
// src/services/context/context.ts
|
|
22079
21951
|
/**
|
|
22080
21952
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
22081
21953
|
*
|
|
@@ -22118,8 +21990,7 @@ const FOCUSING_COMMON_DRAWINGS = "FOCUSING_COMMON_DRAWINGS";
|
|
|
22118
21990
|
const FOCUSING_SHAPE_TEXT_EDITOR = "FOCUSING_SHAPE_TEXT_EDITOR";
|
|
22119
21991
|
const FORMULA_EDITOR_ACTIVATED = "FORMULA_EDITOR_ACTIVATED";
|
|
22120
21992
|
|
|
22121
|
-
|
|
22122
|
-
//#region src/services/error/error.service.ts
|
|
21993
|
+
// src/services/error/error.service.ts
|
|
22123
21994
|
/**
|
|
22124
21995
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
22125
21996
|
*
|
|
@@ -22156,8 +22027,7 @@ var ErrorService = class extends Disposable {
|
|
|
22156
22027
|
}
|
|
22157
22028
|
};
|
|
22158
22029
|
|
|
22159
|
-
|
|
22160
|
-
//#region src/services/image-io/image-io.service.ts
|
|
22030
|
+
// src/services/image-io/image-io.service.ts
|
|
22161
22031
|
/**
|
|
22162
22032
|
* The type of image data source
|
|
22163
22033
|
*/
|
|
@@ -22186,12 +22056,10 @@ let ImageUploadStatusType = /* @__PURE__ */ function(ImageUploadStatusType) {
|
|
|
22186
22056
|
}({});
|
|
22187
22057
|
const IImageIoService = (0, _wendellhu_redi.createIdentifier)("core.image-io.service");
|
|
22188
22058
|
|
|
22189
|
-
|
|
22190
|
-
//#region src/services/image-io/url-image.service.ts
|
|
22059
|
+
// src/services/image-io/url-image.service.ts
|
|
22191
22060
|
const IURLImageService = (0, _wendellhu_redi.createIdentifier)("core.url-image.service");
|
|
22192
22061
|
|
|
22193
|
-
|
|
22194
|
-
//#region src/sheets/calculation-settings.ts
|
|
22062
|
+
// src/sheets/calculation-settings.ts
|
|
22195
22063
|
const MAX_ITERATION_COUNT = 32767;
|
|
22196
22064
|
const DEFAULT_WORKBOOK_CALCULATION_SETTINGS = Object.freeze({
|
|
22197
22065
|
iterativeCalculation: false,
|
|
@@ -22207,8 +22075,7 @@ function normalizeWorkbookCalculationSettings(value) {
|
|
|
22207
22075
|
};
|
|
22208
22076
|
}
|
|
22209
22077
|
|
|
22210
|
-
|
|
22211
|
-
//#region src/sheets/empty-snapshot.ts
|
|
22078
|
+
// src/sheets/empty-snapshot.ts
|
|
22212
22079
|
function getEmptySnapshot$2(unitID = "", locale = "zhCN", name = "") {
|
|
22213
22080
|
return {
|
|
22214
22081
|
id: unitID,
|
|
@@ -22223,8 +22090,7 @@ function getEmptySnapshot$2(unitID = "", locale = "zhCN", name = "") {
|
|
|
22223
22090
|
};
|
|
22224
22091
|
}
|
|
22225
22092
|
|
|
22226
|
-
|
|
22227
|
-
//#region src/sheets/styles.ts
|
|
22093
|
+
// src/sheets/styles.ts
|
|
22228
22094
|
/**
|
|
22229
22095
|
* Styles in a workbook, cells locate styles based on style IDs
|
|
22230
22096
|
*
|
|
@@ -22304,8 +22170,7 @@ var Styles = class {
|
|
|
22304
22170
|
}
|
|
22305
22171
|
};
|
|
22306
22172
|
|
|
22307
|
-
|
|
22308
|
-
//#region src/sheets/util.ts
|
|
22173
|
+
// src/sheets/util.ts
|
|
22309
22174
|
const isRangesEqual = (oldRanges, ranges) => {
|
|
22310
22175
|
return ranges.length === oldRanges.length && !oldRanges.some((oldRange) => ranges.some((range) => !Rectangle.equals(range, oldRange)));
|
|
22311
22176
|
};
|
|
@@ -22450,8 +22315,7 @@ function getEmptyCell() {
|
|
|
22450
22315
|
};
|
|
22451
22316
|
}
|
|
22452
22317
|
|
|
22453
|
-
|
|
22454
|
-
//#region src/docs/data-model/utils.ts
|
|
22318
|
+
// src/docs/data-model/utils.ts
|
|
22455
22319
|
const DEFAULT_FONTFACE_PLANE = "\"Helvetica Neue\", Helvetica, Arial, \"PingFang SC\", \"Hiragino Sans GB\", \"Heiti SC\", \"Microsoft YaHei\", \"WenQuanYi Micro Hei\", sans-serif";
|
|
22456
22320
|
function getFontStyleString(textStyle) {
|
|
22457
22321
|
const defaultFont = DEFAULT_STYLES.ff;
|
|
@@ -22515,8 +22379,7 @@ function convertTextRotation(textRotation) {
|
|
|
22515
22379
|
};
|
|
22516
22380
|
}
|
|
22517
22381
|
|
|
22518
|
-
|
|
22519
|
-
//#region src/sheets/sheet-dimensions.ts
|
|
22382
|
+
// src/sheets/sheet-dimensions.ts
|
|
22520
22383
|
function isValidSheetDimension(value, allowZero = true) {
|
|
22521
22384
|
return typeof value === "number" && Number.isFinite(value) && (allowZero ? value >= 0 : value > 0);
|
|
22522
22385
|
}
|
|
@@ -22530,8 +22393,7 @@ function isValidRowDimensions(data) {
|
|
|
22530
22393
|
return ((data === null || data === void 0 ? void 0 : data.h) == null || isValidSheetDimension(data.h)) && ((data === null || data === void 0 ? void 0 : data.ah) == null || isValidSheetDimension(data.ah));
|
|
22531
22394
|
}
|
|
22532
22395
|
|
|
22533
|
-
|
|
22534
|
-
//#region src/sheets/sheet-snapshot-utils.ts
|
|
22396
|
+
// src/sheets/sheet-snapshot-utils.ts
|
|
22535
22397
|
const DEFAULT_WORKSHEET_ROW_COUNT_KEY = "DEFAULT_WORKSHEET_ROW_COUNT";
|
|
22536
22398
|
const DEFAULT_WORKSHEET_ROW_COUNT = 1e3;
|
|
22537
22399
|
const DEFAULT_WORKSHEET_COLUMN_COUNT_KEY = "DEFAULT_WORKSHEET_COLUMN_COUNT";
|
|
@@ -22605,8 +22467,7 @@ function mergeWorksheetSnapshotWithDefault(snapshot) {
|
|
|
22605
22467
|
return snapshot;
|
|
22606
22468
|
}
|
|
22607
22469
|
|
|
22608
|
-
|
|
22609
|
-
//#region src/sheets/column-manager.ts
|
|
22470
|
+
// src/sheets/column-manager.ts
|
|
22610
22471
|
/**
|
|
22611
22472
|
* Manage configuration information of all columns, get column width, column length, set column width, etc.
|
|
22612
22473
|
*/
|
|
@@ -22829,8 +22690,7 @@ var ColumnManager = class {
|
|
|
22829
22690
|
}
|
|
22830
22691
|
};
|
|
22831
22692
|
|
|
22832
|
-
|
|
22833
|
-
//#region src/sheets/range.ts
|
|
22693
|
+
// src/sheets/range.ts
|
|
22834
22694
|
function isAllFormatInTextRuns(key, body) {
|
|
22835
22695
|
const { textRuns = [] } = body;
|
|
22836
22696
|
let len = 0;
|
|
@@ -23368,8 +23228,7 @@ _defineProperty(Range, "transformRange", (range, worksheet) => {
|
|
|
23368
23228
|
};
|
|
23369
23229
|
});
|
|
23370
23230
|
|
|
23371
|
-
|
|
23372
|
-
//#region src/sheets/row-manager.ts
|
|
23231
|
+
// src/sheets/row-manager.ts
|
|
23373
23232
|
const MAXIMUM_ROW_HEIGHT = 2e3;
|
|
23374
23233
|
/**
|
|
23375
23234
|
* Manage configuration information of all rows, get row height, row length, set row height, etc.
|
|
@@ -23602,8 +23461,7 @@ var RowManager = class {
|
|
|
23602
23461
|
}
|
|
23603
23462
|
};
|
|
23604
23463
|
|
|
23605
|
-
|
|
23606
|
-
//#region src/sheets/span-model.ts
|
|
23464
|
+
// src/sheets/span-model.ts
|
|
23607
23465
|
var SpanModel = class extends Disposable {
|
|
23608
23466
|
constructor(mergeData) {
|
|
23609
23467
|
super();
|
|
@@ -23767,8 +23625,7 @@ var SpanModel = class extends Disposable {
|
|
|
23767
23625
|
}
|
|
23768
23626
|
};
|
|
23769
23627
|
|
|
23770
|
-
|
|
23771
|
-
//#region src/sheets/view-model.ts
|
|
23628
|
+
// src/sheets/view-model.ts
|
|
23772
23629
|
/**
|
|
23773
23630
|
* @internal
|
|
23774
23631
|
*/
|
|
@@ -23812,8 +23669,7 @@ var SheetViewModel = class extends Disposable {
|
|
|
23812
23669
|
}
|
|
23813
23670
|
};
|
|
23814
23671
|
|
|
23815
|
-
|
|
23816
|
-
//#region src/sheets/worksheet.ts
|
|
23672
|
+
// src/sheets/worksheet.ts
|
|
23817
23673
|
const DEFAULT_CELL_DOCUMENT_MODEL_OPTION = {
|
|
23818
23674
|
isDeepClone: false,
|
|
23819
23675
|
displayRawFormula: false,
|
|
@@ -24810,8 +24666,7 @@ function getOriginCellValue(cell) {
|
|
|
24810
24666
|
return cell === null || cell === void 0 ? void 0 : cell.v;
|
|
24811
24667
|
}
|
|
24812
24668
|
|
|
24813
|
-
|
|
24814
|
-
//#region src/sheets/workbook.ts
|
|
24669
|
+
// src/sheets/workbook.ts
|
|
24815
24670
|
function getWorksheetUID(workbook, worksheet) {
|
|
24816
24671
|
return `${workbook.getUnitId()}|${worksheet.getSheetId()}`;
|
|
24817
24672
|
}
|
|
@@ -25142,8 +24997,7 @@ let Workbook = class Workbook extends UnitModel {
|
|
|
25142
24997
|
};
|
|
25143
24998
|
Workbook = __decorate([__decorateParam(1, ILogService)], Workbook);
|
|
25144
24999
|
|
|
25145
|
-
|
|
25146
|
-
//#region src/services/instance/instance.service.ts
|
|
25000
|
+
// src/services/instance/instance.service.ts
|
|
25147
25001
|
const IUniverInstanceService = (0, _wendellhu_redi.createIdentifier)("univer.current");
|
|
25148
25002
|
let UniverInstanceService = class UniverInstanceService extends Disposable {
|
|
25149
25003
|
constructor(_injector, _contextService, _logService) {
|
|
@@ -25338,8 +25192,7 @@ UniverInstanceService = __decorate([
|
|
|
25338
25192
|
__decorateParam(2, (0, _wendellhu_redi.Inject)(ILogService))
|
|
25339
25193
|
], UniverInstanceService);
|
|
25340
25194
|
|
|
25341
|
-
|
|
25342
|
-
//#region src/services/lifecycle/lifecycle.ts
|
|
25195
|
+
// src/services/lifecycle/lifecycle.ts
|
|
25343
25196
|
/**
|
|
25344
25197
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
25345
25198
|
*
|
|
@@ -25385,8 +25238,7 @@ const LifecycleNameMap = {
|
|
|
25385
25238
|
[3]: "Steady"
|
|
25386
25239
|
};
|
|
25387
25240
|
|
|
25388
|
-
|
|
25389
|
-
//#region src/services/lifecycle/lifecycle.service.ts
|
|
25241
|
+
// src/services/lifecycle/lifecycle.service.ts
|
|
25390
25242
|
/**
|
|
25391
25243
|
* An error that indicates a lifecycle stage will never be reached, mostly due to the Univer instance is
|
|
25392
25244
|
* disposed.
|
|
@@ -25459,8 +25311,7 @@ function getLifecycleStagesAndBefore(lifecycleStage) {
|
|
|
25459
25311
|
}
|
|
25460
25312
|
}
|
|
25461
25313
|
|
|
25462
|
-
|
|
25463
|
-
//#region src/services/local-storage/local-storage.service.ts
|
|
25314
|
+
// src/services/local-storage/local-storage.service.ts
|
|
25464
25315
|
/**
|
|
25465
25316
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
25466
25317
|
*
|
|
@@ -25478,8 +25329,7 @@ function getLifecycleStagesAndBefore(lifecycleStage) {
|
|
|
25478
25329
|
*/
|
|
25479
25330
|
const ILocalStorageService = (0, _wendellhu_redi.createIdentifier)("ILocalStorageService");
|
|
25480
25331
|
|
|
25481
|
-
|
|
25482
|
-
//#region src/services/locale/locale.service.ts
|
|
25332
|
+
// src/services/locale/locale.service.ts
|
|
25483
25333
|
/**
|
|
25484
25334
|
* This service provides i18n and timezone / location features to other modules.
|
|
25485
25335
|
*/
|
|
@@ -25579,8 +25429,7 @@ var LocaleService = class extends Disposable {
|
|
|
25579
25429
|
}
|
|
25580
25430
|
};
|
|
25581
25431
|
|
|
25582
|
-
|
|
25583
|
-
//#region src/services/mention-io/mention-io-local.service.ts
|
|
25432
|
+
// src/services/mention-io/mention-io-local.service.ts
|
|
25584
25433
|
let MentionIOLocalService = class MentionIOLocalService {
|
|
25585
25434
|
constructor(_userManagerService) {
|
|
25586
25435
|
this._userManagerService = _userManagerService;
|
|
@@ -25606,12 +25455,10 @@ let MentionIOLocalService = class MentionIOLocalService {
|
|
|
25606
25455
|
};
|
|
25607
25456
|
MentionIOLocalService = __decorate([__decorateParam(0, (0, _wendellhu_redi.Inject)(UserManagerService))], MentionIOLocalService);
|
|
25608
25457
|
|
|
25609
|
-
|
|
25610
|
-
//#region src/services/mention-io/type.ts
|
|
25458
|
+
// src/services/mention-io/type.ts
|
|
25611
25459
|
const IMentionIOService = (0, _wendellhu_redi.createIdentifier)("univer.service.mention-io");
|
|
25612
25460
|
|
|
25613
|
-
|
|
25614
|
-
//#region src/services/permission/object-permission-rule.model.ts
|
|
25461
|
+
// src/services/permission/object-permission-rule.model.ts
|
|
25615
25462
|
/** Shared storage only; each product owns its rule type, resource name and mutation. */
|
|
25616
25463
|
var ObjectPermissionRuleModel = class extends Disposable {
|
|
25617
25464
|
constructor(resources, name, business, _objectTypes) {
|
|
@@ -25683,8 +25530,7 @@ var ObjectPermissionRuleModel = class extends Disposable {
|
|
|
25683
25530
|
}
|
|
25684
25531
|
};
|
|
25685
25532
|
|
|
25686
|
-
|
|
25687
|
-
//#region src/services/undoredo/undoredo.service.ts
|
|
25533
|
+
// src/services/undoredo/undoredo.service.ts
|
|
25688
25534
|
const IUndoRedoService = (0, _wendellhu_redi.createIdentifier)("univer.undo-redo.service");
|
|
25689
25535
|
const DEFAULT_UNDO_REDO_HISTORY_LIMIT = 50;
|
|
25690
25536
|
const UNDO_REDO_HISTORY_LIMIT_CONFIG_KEY = "undoRedo.historyLimit";
|
|
@@ -25930,8 +25776,7 @@ LocalUndoRedoService = __decorate([
|
|
|
25930
25776
|
__decorateParam(3, IConfigService)
|
|
25931
25777
|
], LocalUndoRedoService);
|
|
25932
25778
|
|
|
25933
|
-
|
|
25934
|
-
//#region src/services/permission/type.ts
|
|
25779
|
+
// src/services/permission/type.ts
|
|
25935
25780
|
let PermissionStatus = /* @__PURE__ */ function(PermissionStatus) {
|
|
25936
25781
|
PermissionStatus["INIT"] = "init";
|
|
25937
25782
|
PermissionStatus["FETCHING"] = "fetching";
|
|
@@ -25940,8 +25785,7 @@ let PermissionStatus = /* @__PURE__ */ function(PermissionStatus) {
|
|
|
25940
25785
|
}({});
|
|
25941
25786
|
const IPermissionService = (0, _wendellhu_redi.createIdentifier)("univer.permission-service");
|
|
25942
25787
|
|
|
25943
|
-
|
|
25944
|
-
//#region src/services/permission/object-permission.service.ts
|
|
25788
|
+
// src/services/permission/object-permission.service.ts
|
|
25945
25789
|
/** Frontend opt-in; does not change the Authz service interface or existing local setters. */
|
|
25946
25790
|
const OBJECT_PERMISSION_CONFIG_KEY = "objectPermissionTypes";
|
|
25947
25791
|
const ROOT_OBJECT_TYPES = {
|
|
@@ -26455,8 +26299,7 @@ ObjectPermissionService = __decorate([
|
|
|
26455
26299
|
__decorateParam(5, ICommandService)
|
|
26456
26300
|
], ObjectPermissionService);
|
|
26457
26301
|
|
|
26458
|
-
|
|
26459
|
-
//#region src/services/permission/permission.service.ts
|
|
26302
|
+
// src/services/permission/permission.service.ts
|
|
26460
26303
|
var PermissionService = class extends Disposable {
|
|
26461
26304
|
constructor(..._args) {
|
|
26462
26305
|
super(..._args);
|
|
@@ -26540,8 +26383,7 @@ var PermissionService = class extends Disposable {
|
|
|
26540
26383
|
}
|
|
26541
26384
|
};
|
|
26542
26385
|
|
|
26543
|
-
|
|
26544
|
-
//#region src/services/plugin/plugin-override.ts
|
|
26386
|
+
// src/services/plugin/plugin-override.ts
|
|
26545
26387
|
function mergeOverrideWithDependencies(dependencies, override) {
|
|
26546
26388
|
if (!override) return dependencies;
|
|
26547
26389
|
const result = [];
|
|
@@ -26555,8 +26397,7 @@ function mergeOverrideWithDependencies(dependencies, override) {
|
|
|
26555
26397
|
return result;
|
|
26556
26398
|
}
|
|
26557
26399
|
|
|
26558
|
-
|
|
26559
|
-
//#region src/services/plugin/plugin.service.ts
|
|
26400
|
+
// src/services/plugin/plugin.service.ts
|
|
26560
26401
|
const INIT_LAZY_PLUGINS_TIMEOUT = 4;
|
|
26561
26402
|
const DependentOnSymbol = Symbol("DependentOn");
|
|
26562
26403
|
/**
|
|
@@ -26754,8 +26595,7 @@ PluginService = __decorate([
|
|
|
26754
26595
|
__decorateParam(2, ILogService)
|
|
26755
26596
|
], PluginService);
|
|
26756
26597
|
|
|
26757
|
-
|
|
26758
|
-
//#region src/services/region/region.service.ts
|
|
26598
|
+
// src/services/region/region.service.ts
|
|
26759
26599
|
let RegionService = class RegionService extends Disposable {
|
|
26760
26600
|
constructor(_localeService) {
|
|
26761
26601
|
super();
|
|
@@ -26780,12 +26620,10 @@ let RegionService = class RegionService extends Disposable {
|
|
|
26780
26620
|
};
|
|
26781
26621
|
RegionService = __decorate([__decorateParam(0, (0, _wendellhu_redi.Inject)(LocaleService))], RegionService);
|
|
26782
26622
|
|
|
26783
|
-
|
|
26784
|
-
//#region src/services/resource-loader/type.ts
|
|
26623
|
+
// src/services/resource-loader/type.ts
|
|
26785
26624
|
const IResourceLoaderService = (0, _wendellhu_redi.createIdentifier)("resource-loader-service");
|
|
26786
26625
|
|
|
26787
|
-
|
|
26788
|
-
//#region src/services/resource-manager/resource-manager.service.ts
|
|
26626
|
+
// src/services/resource-manager/resource-manager.service.ts
|
|
26789
26627
|
let ResourceManagerService = class ResourceManagerService extends Disposable {
|
|
26790
26628
|
constructor(_logService) {
|
|
26791
26629
|
super();
|
|
@@ -26860,8 +26698,7 @@ let ResourceManagerService = class ResourceManagerService extends Disposable {
|
|
|
26860
26698
|
};
|
|
26861
26699
|
ResourceManagerService = __decorate([__decorateParam(0, ILogService)], ResourceManagerService);
|
|
26862
26700
|
|
|
26863
|
-
|
|
26864
|
-
//#region src/services/theme/theme.service.ts
|
|
26701
|
+
// src/services/theme/theme.service.ts
|
|
26865
26702
|
var ThemeService = class extends Disposable {
|
|
26866
26703
|
get darkMode() {
|
|
26867
26704
|
return this._darkMode$.getValue();
|
|
@@ -26934,8 +26771,7 @@ var ThemeService = class extends Disposable {
|
|
|
26934
26771
|
}
|
|
26935
26772
|
};
|
|
26936
26773
|
|
|
26937
|
-
|
|
26938
|
-
//#region src/shared/cache/image-cache.ts
|
|
26774
|
+
// src/shared/cache/image-cache.ts
|
|
26939
26775
|
var ImageCacheMap = class {
|
|
26940
26776
|
constructor(_injector, maxSize = 1e3) {
|
|
26941
26777
|
this._injector = _injector;
|
|
@@ -26980,8 +26816,7 @@ var ImageCacheMap = class {
|
|
|
26980
26816
|
}
|
|
26981
26817
|
};
|
|
26982
26818
|
|
|
26983
|
-
|
|
26984
|
-
//#region src/shared/name.ts
|
|
26819
|
+
// src/shared/name.ts
|
|
26985
26820
|
/**
|
|
26986
26821
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
26987
26822
|
*
|
|
@@ -27040,8 +26875,7 @@ function customNameCharacterCheck(name, sheetNameSet) {
|
|
|
27040
26875
|
return true;
|
|
27041
26876
|
}
|
|
27042
26877
|
|
|
27043
|
-
|
|
27044
|
-
//#region src/shared/r-tree.ts
|
|
26878
|
+
// src/shared/r-tree.ts
|
|
27045
26879
|
var RTree = class {
|
|
27046
26880
|
constructor(_enableOneCellCache = false) {
|
|
27047
26881
|
this._enableOneCellCache = _enableOneCellCache;
|
|
@@ -27205,8 +27039,10 @@ var RTree = class {
|
|
|
27205
27039
|
}
|
|
27206
27040
|
}
|
|
27207
27041
|
_removeRTreeItem(search) {
|
|
27042
|
+
var _this$_tree$get3;
|
|
27208
27043
|
const { unitId, sheetId: subUnitId, range, id } = search;
|
|
27209
|
-
const tree = this.
|
|
27044
|
+
const tree = (_this$_tree$get3 = this._tree.get(unitId)) === null || _this$_tree$get3 === void 0 ? void 0 : _this$_tree$get3.get(subUnitId);
|
|
27045
|
+
if (!tree) return;
|
|
27210
27046
|
const items = tree.search({
|
|
27211
27047
|
minX: range.startColumn,
|
|
27212
27048
|
minY: range.startRow,
|
|
@@ -27227,7 +27063,93 @@ var RTree = class {
|
|
|
27227
27063
|
} else this._removeRTreeItem(search);
|
|
27228
27064
|
}
|
|
27229
27065
|
bulkRemove(searchList) {
|
|
27230
|
-
|
|
27066
|
+
if (searchList.length < 2) {
|
|
27067
|
+
for (const search of searchList) this.remove(search);
|
|
27068
|
+
return;
|
|
27069
|
+
}
|
|
27070
|
+
const groups = /* @__PURE__ */ new Map();
|
|
27071
|
+
for (const search of searchList) {
|
|
27072
|
+
let sheets = groups.get(search.unitId);
|
|
27073
|
+
if (!sheets) {
|
|
27074
|
+
sheets = /* @__PURE__ */ new Map();
|
|
27075
|
+
groups.set(search.unitId, sheets);
|
|
27076
|
+
}
|
|
27077
|
+
let ids = sheets.get(search.sheetId);
|
|
27078
|
+
if (!ids) {
|
|
27079
|
+
ids = /* @__PURE__ */ new Map();
|
|
27080
|
+
sheets.set(search.sheetId, ids);
|
|
27081
|
+
}
|
|
27082
|
+
const ranges = ids.get(search.id);
|
|
27083
|
+
if (ranges) ranges.push(search);
|
|
27084
|
+
else ids.set(search.id, [search]);
|
|
27085
|
+
}
|
|
27086
|
+
for (const [unitId, sheets] of groups) for (const [sheetId, ids] of sheets) if (!this._removeSparseRanges(unitId, sheetId, ids)) this._bulkRemoveFromSheet(unitId, sheetId, ids);
|
|
27087
|
+
}
|
|
27088
|
+
_bulkRemoveFromSheet(unitId, sheetId, searches) {
|
|
27089
|
+
var _this$_tree$get4, _this$_oneCellCache$g2;
|
|
27090
|
+
if (searches.size === 1) {
|
|
27091
|
+
const [ranges] = searches.values();
|
|
27092
|
+
if (ranges.length === 1) {
|
|
27093
|
+
this.remove(ranges[0]);
|
|
27094
|
+
return;
|
|
27095
|
+
}
|
|
27096
|
+
}
|
|
27097
|
+
const matches = (id, bounds, rangedOnly = false) => {
|
|
27098
|
+
var _searches$get;
|
|
27099
|
+
return ((_searches$get = searches.get(id)) === null || _searches$get === void 0 ? void 0 : _searches$get.some(({ range }) => (!rangedOnly || !this._enableOneCellCache || range.startRow !== range.endRow || range.startColumn !== range.endColumn) && range.startColumn <= bounds.maxX && range.endColumn >= bounds.minX && range.startRow <= bounds.maxY && range.endRow >= bounds.minY)) ?? false;
|
|
27100
|
+
};
|
|
27101
|
+
const tree = (_this$_tree$get4 = this._tree.get(unitId)) === null || _this$_tree$get4 === void 0 ? void 0 : _this$_tree$get4.get(sheetId);
|
|
27102
|
+
if (tree) {
|
|
27103
|
+
const entries = tree.all();
|
|
27104
|
+
let retained = 0;
|
|
27105
|
+
for (const item of entries) if (!matches(item.id, item, true)) entries[retained++] = item;
|
|
27106
|
+
if (retained !== entries.length) {
|
|
27107
|
+
entries.length = retained;
|
|
27108
|
+
tree.clear();
|
|
27109
|
+
tree.load(entries);
|
|
27110
|
+
}
|
|
27111
|
+
}
|
|
27112
|
+
const cells = (_this$_oneCellCache$g2 = this._oneCellCache.get(unitId)) === null || _this$_oneCellCache$g2 === void 0 ? void 0 : _this$_oneCellCache$g2.get(sheetId);
|
|
27113
|
+
if (cells) for (const [row, columns] of cells) for (const [column, ids] of columns) {
|
|
27114
|
+
const bounds = {
|
|
27115
|
+
minX: column,
|
|
27116
|
+
maxX: column,
|
|
27117
|
+
minY: row,
|
|
27118
|
+
maxY: row
|
|
27119
|
+
};
|
|
27120
|
+
for (const id of ids) if (matches(id, bounds)) ids.delete(id);
|
|
27121
|
+
}
|
|
27122
|
+
}
|
|
27123
|
+
_removeSparseRanges(unitId, sheetId, searches) {
|
|
27124
|
+
var _this$_tree$get5, _this$_oneCellCache$g3;
|
|
27125
|
+
let remaining = 128;
|
|
27126
|
+
if (searches.size > remaining) return false;
|
|
27127
|
+
const visit = (node, range) => {
|
|
27128
|
+
if (--remaining < 0) return false;
|
|
27129
|
+
if (!node.leaf && range.startColumn <= node.minX && range.endColumn >= node.maxX && range.startRow <= node.minY && range.endRow >= node.maxY) return false;
|
|
27130
|
+
for (const child of node.children) if (range.startColumn <= child.maxX && range.endColumn >= child.minX && range.startRow <= child.maxY && range.endRow >= child.minY) {
|
|
27131
|
+
if (node.leaf) {
|
|
27132
|
+
if (--remaining < 0) return false;
|
|
27133
|
+
} else if (!visit(child, range)) return false;
|
|
27134
|
+
}
|
|
27135
|
+
return true;
|
|
27136
|
+
};
|
|
27137
|
+
const tree = (_this$_tree$get5 = this._tree.get(unitId)) === null || _this$_tree$get5 === void 0 ? void 0 : _this$_tree$get5.get(sheetId);
|
|
27138
|
+
const root = tree === null || tree === void 0 ? void 0 : tree.toJSON();
|
|
27139
|
+
const cells = (_this$_oneCellCache$g3 = this._oneCellCache.get(unitId)) === null || _this$_oneCellCache$g3 === void 0 ? void 0 : _this$_oneCellCache$g3.get(sheetId);
|
|
27140
|
+
for (const [id, ranges] of searches) {
|
|
27141
|
+
if (Number.isNaN(id)) return false;
|
|
27142
|
+
for (const { range } of ranges) {
|
|
27143
|
+
if (--remaining < 0) return false;
|
|
27144
|
+
if (this._enableOneCellCache) {
|
|
27145
|
+
if (range.startRow === range.endRow && range.startColumn === range.endColumn) continue;
|
|
27146
|
+
if (cells) return false;
|
|
27147
|
+
}
|
|
27148
|
+
if (root && !visit(root, range)) return false;
|
|
27149
|
+
}
|
|
27150
|
+
}
|
|
27151
|
+
for (const ranges of searches.values()) for (const search of ranges) this.remove(search);
|
|
27152
|
+
return true;
|
|
27231
27153
|
}
|
|
27232
27154
|
clear() {
|
|
27233
27155
|
this._tree.clear();
|
|
@@ -27256,8 +27178,7 @@ var RTree = class {
|
|
|
27256
27178
|
}
|
|
27257
27179
|
};
|
|
27258
27180
|
|
|
27259
|
-
|
|
27260
|
-
//#region src/types/enum/record-filter.ts
|
|
27181
|
+
// src/types/enum/record-filter.ts
|
|
27261
27182
|
/**
|
|
27262
27183
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
27263
27184
|
*
|
|
@@ -27291,8 +27212,7 @@ let FilterSelectionMode = /* @__PURE__ */ function(FilterSelectionMode) {
|
|
|
27291
27212
|
return FilterSelectionMode;
|
|
27292
27213
|
}({});
|
|
27293
27214
|
|
|
27294
|
-
|
|
27295
|
-
//#region src/shared/record-value.ts
|
|
27215
|
+
// src/shared/record-value.ts
|
|
27296
27216
|
function getRecordValueKey(_value) {
|
|
27297
27217
|
const value = _value;
|
|
27298
27218
|
if (!isRecord(value) || typeof value.type !== "string") throw new TypeError("Invalid record value.");
|
|
@@ -27319,8 +27239,7 @@ function isRecord(value) {
|
|
|
27319
27239
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
27320
27240
|
}
|
|
27321
27241
|
|
|
27322
|
-
|
|
27323
|
-
//#region src/shared/timer.ts
|
|
27242
|
+
// src/shared/timer.ts
|
|
27324
27243
|
/**
|
|
27325
27244
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
27326
27245
|
*
|
|
@@ -27365,8 +27284,7 @@ function delayAnimationFrame(frames = 1) {
|
|
|
27365
27284
|
});
|
|
27366
27285
|
}
|
|
27367
27286
|
|
|
27368
|
-
|
|
27369
|
-
//#region src/shared/units.ts
|
|
27287
|
+
// src/shared/units.ts
|
|
27370
27288
|
/**
|
|
27371
27289
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
27372
27290
|
*
|
|
@@ -27391,8 +27309,7 @@ function emuToCssPx(value) {
|
|
|
27391
27309
|
return value / EMU_PER_CSS_PX;
|
|
27392
27310
|
}
|
|
27393
27311
|
|
|
27394
|
-
|
|
27395
|
-
//#region src/sheets/clone.ts
|
|
27312
|
+
// src/sheets/clone.ts
|
|
27396
27313
|
/**
|
|
27397
27314
|
* Fast clone for primitive values and simple objects.
|
|
27398
27315
|
* Avoids type checking overhead when we know the structure.
|
|
@@ -27587,8 +27504,7 @@ function cloneWorksheetData(worksheet) {
|
|
|
27587
27504
|
return result;
|
|
27588
27505
|
}
|
|
27589
27506
|
|
|
27590
|
-
|
|
27591
|
-
//#region src/skeleton.ts
|
|
27507
|
+
// src/skeleton.ts
|
|
27592
27508
|
let Skeleton = class Skeleton extends Disposable {
|
|
27593
27509
|
constructor(_localeService) {
|
|
27594
27510
|
super();
|
|
@@ -27614,8 +27530,7 @@ let Skeleton = class Skeleton extends Disposable {
|
|
|
27614
27530
|
};
|
|
27615
27531
|
Skeleton = __decorate([__decorateParam(0, (0, _wendellhu_redi.Inject)(LocaleService))], Skeleton);
|
|
27616
27532
|
|
|
27617
|
-
|
|
27618
|
-
//#region src/sheets/sheet-skeleton.ts
|
|
27533
|
+
// src/sheets/sheet-skeleton.ts
|
|
27619
27534
|
/**
|
|
27620
27535
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
27621
27536
|
*
|
|
@@ -27927,35 +27842,19 @@ let SheetSkeleton = class SheetSkeleton extends Skeleton {
|
|
|
27927
27842
|
}
|
|
27928
27843
|
_getOverflowBound(row, startColumn, endColumn, contentWidth, horizontalAlign = 1) {
|
|
27929
27844
|
let cumWidth = 0;
|
|
27930
|
-
|
|
27931
|
-
|
|
27932
|
-
for (let i = startColumn; i >= endColumn; i--) {
|
|
27933
|
-
const column = i;
|
|
27934
|
-
const cell = this.worksheet.getCell(row, column);
|
|
27935
|
-
if (!isCellCoverable(cell) && column !== startColumn || this.intersectMergeRange(row, column)) {
|
|
27936
|
-
if (column === startColumn) return column;
|
|
27937
|
-
return column + 1 > columnCount ? columnCount : column + 1;
|
|
27938
|
-
}
|
|
27939
|
-
const { startX, endX } = getCellWithCoordByIndexCore(row, column, this.rowHeightAccumulation, this.columnWidthAccumulation, void 0, this.getGapSizeGetter());
|
|
27940
|
-
if (horizontalAlign === 2 && column === startColumn) cumWidth += (endX - startX) / 2;
|
|
27941
|
-
else cumWidth += endX - startX;
|
|
27942
|
-
if (contentWidth < cumWidth) return column;
|
|
27943
|
-
}
|
|
27944
|
-
return startColumn;
|
|
27945
|
-
}
|
|
27946
|
-
for (let i = startColumn; i <= endColumn; i++) {
|
|
27947
|
-
const column = i;
|
|
27845
|
+
const direction = startColumn > endColumn ? -1 : 1;
|
|
27846
|
+
for (let column = startColumn; direction === 1 ? column <= endColumn : column >= endColumn; column += direction) {
|
|
27948
27847
|
const cell = this.worksheet.getCell(row, column);
|
|
27949
27848
|
if (!isCellCoverable(cell) && column !== startColumn || this.intersectMergeRange(row, column)) {
|
|
27950
27849
|
if (column === startColumn) return column;
|
|
27951
|
-
return column -
|
|
27850
|
+
return Tools.clamp(column - direction, 0, this._columnWidthAccumulation.length - 1);
|
|
27952
27851
|
}
|
|
27953
27852
|
const { startX, endX } = getCellWithCoordByIndexCore(row, column, this.rowHeightAccumulation, this.columnWidthAccumulation, void 0, this.getGapSizeGetter());
|
|
27954
27853
|
if (horizontalAlign === 2 && column === startColumn) cumWidth += (endX - startX) / 2;
|
|
27955
27854
|
else cumWidth += endX - startX;
|
|
27956
27855
|
if (contentWidth < cumWidth) return column;
|
|
27957
27856
|
}
|
|
27958
|
-
return endColumn;
|
|
27857
|
+
return direction === 1 ? endColumn : startColumn;
|
|
27959
27858
|
}
|
|
27960
27859
|
/**
|
|
27961
27860
|
* Calculate data for row col & cell position.
|
|
@@ -28015,30 +27914,22 @@ let SheetSkeleton = class SheetSkeleton extends Skeleton {
|
|
|
28015
27914
|
let lastSearchedMergeCell = null;
|
|
28016
27915
|
while (isSearching) {
|
|
28017
27916
|
isSearching = false;
|
|
28018
|
-
for (
|
|
28019
|
-
|
|
28020
|
-
if (
|
|
28021
|
-
const rect1 = {
|
|
27917
|
+
for (const mergeRange of mergeData) {
|
|
27918
|
+
if (searchedMerge.getValue(mergeRange.startRow, mergeRange.startColumn)) continue;
|
|
27919
|
+
if (getIntersectRange({
|
|
28022
27920
|
startColumn,
|
|
28023
27921
|
startRow,
|
|
28024
27922
|
endColumn,
|
|
28025
27923
|
endRow
|
|
28026
|
-
}
|
|
28027
|
-
|
|
28028
|
-
startColumn
|
|
28029
|
-
|
|
28030
|
-
endColumn
|
|
28031
|
-
|
|
28032
|
-
};
|
|
28033
|
-
if (getIntersectRange(rect1, rect2)) {
|
|
28034
|
-
startRow = Math.min(startRow, mainStartRow);
|
|
28035
|
-
startColumn = Math.min(startColumn, mainStartColumn);
|
|
28036
|
-
endRow = Math.max(endRow, mainEndRow);
|
|
28037
|
-
endColumn = Math.max(endColumn, mainEndColumn);
|
|
28038
|
-
searchedMerge.setValue(mainStartRow, mainStartColumn, true);
|
|
27924
|
+
}, mergeRange)) {
|
|
27925
|
+
startRow = Math.min(startRow, mergeRange.startRow);
|
|
27926
|
+
startColumn = Math.min(startColumn, mergeRange.startColumn);
|
|
27927
|
+
endRow = Math.max(endRow, mergeRange.endRow);
|
|
27928
|
+
endColumn = Math.max(endColumn, mergeRange.endColumn);
|
|
27929
|
+
searchedMerge.setValue(mergeRange.startRow, mergeRange.startColumn, true);
|
|
28039
27930
|
isSearching = true;
|
|
28040
27931
|
searchedMergeSize++;
|
|
28041
|
-
lastSearchedMergeCell =
|
|
27932
|
+
lastSearchedMergeCell = mergeRange;
|
|
28042
27933
|
}
|
|
28043
27934
|
}
|
|
28044
27935
|
}
|
|
@@ -28096,10 +27987,10 @@ let SheetSkeleton = class SheetSkeleton extends Skeleton {
|
|
|
28096
27987
|
*/
|
|
28097
27988
|
getRowIndexByOffsetY(offsetY, scaleY, scrollXY, options) {
|
|
28098
27989
|
const { rowHeightAccumulation } = this;
|
|
28099
|
-
|
|
28100
|
-
let row = searchArray(rowHeightAccumulation,
|
|
27990
|
+
const transformedOffsetY = getTransformOffsetY(offsetY, scaleY, scrollXY, this.columnHeaderHeightAndMarginTop);
|
|
27991
|
+
let row = searchArray(rowHeightAccumulation, transformedOffsetY, options === null || options === void 0 ? void 0 : options.firstMatch);
|
|
28101
27992
|
if (options === null || options === void 0 ? void 0 : options.closeFirst) {
|
|
28102
|
-
if (Math.abs(rowHeightAccumulation[row] -
|
|
27993
|
+
if (Math.abs(rowHeightAccumulation[row] - transformedOffsetY) < Math.abs(transformedOffsetY - (rowHeightAccumulation[row - 1] ?? 0))) row = row + 1;
|
|
28103
27994
|
}
|
|
28104
27995
|
return row;
|
|
28105
27996
|
}
|
|
@@ -28186,6 +28077,8 @@ let SheetSkeleton = class SheetSkeleton extends Skeleton {
|
|
|
28186
28077
|
* @param scaleX render scene scale x-axis, scene.getAncestorScale
|
|
28187
28078
|
* @param scaleY render scene scale y-axis, scene.getAncestorScale
|
|
28188
28079
|
* @param scrollXY render viewportScroll {x, y}
|
|
28080
|
+
* @param scrollXY.x horizontal scroll offset
|
|
28081
|
+
* @param scrollXY.y vertical scroll offset
|
|
28189
28082
|
* @param options {IGetRowColByPosOptions}
|
|
28190
28083
|
* @returns {ICellWithCoord} Selection data with coordinates
|
|
28191
28084
|
*/
|
|
@@ -28330,76 +28223,40 @@ function getCellCoordByIndexSimple(row, column, rowHeightAccumulation, columnWid
|
|
|
28330
28223
|
* @returns {ICellWithCoord} The cell position information of the specified row and column, including the position information of the cell and the merge information of the cell
|
|
28331
28224
|
*/
|
|
28332
28225
|
function getCellWithCoordByIndexCore(row, column, rowHeightAccumulation, columnWidthAccumulation, mergeDataInfo, gapSizeGetter) {
|
|
28333
|
-
|
|
28334
|
-
|
|
28335
|
-
|
|
28336
|
-
|
|
28337
|
-
startY,
|
|
28338
|
-
endY,
|
|
28339
|
-
startX,
|
|
28340
|
-
endX,
|
|
28226
|
+
const actualRow = Tools.clamp(row, 0, rowHeightAccumulation.length - 1);
|
|
28227
|
+
const actualColumn = Tools.clamp(column, 0, columnWidthAccumulation.length - 1);
|
|
28228
|
+
const position = getCellCoordByIndexSimple(actualRow, actualColumn, rowHeightAccumulation, columnWidthAccumulation, (gapSizeGetter === null || gapSizeGetter === void 0 ? void 0 : gapSizeGetter.row(actualRow)) ?? 0, (gapSizeGetter === null || gapSizeGetter === void 0 ? void 0 : gapSizeGetter.col(actualColumn)) ?? 0);
|
|
28229
|
+
const { isMerged, isMergedMainCell, startRow, startColumn, endRow, endColumn } = mergeDataInfo ?? {
|
|
28341
28230
|
isMerged: false,
|
|
28342
28231
|
isMergedMainCell: false,
|
|
28343
|
-
|
|
28344
|
-
|
|
28345
|
-
|
|
28346
|
-
|
|
28347
|
-
endY,
|
|
28348
|
-
startX,
|
|
28349
|
-
endX,
|
|
28350
|
-
startRow: row,
|
|
28351
|
-
startColumn: column,
|
|
28352
|
-
endRow: row,
|
|
28353
|
-
endColumn: column
|
|
28354
|
-
}
|
|
28232
|
+
startRow: actualRow,
|
|
28233
|
+
startColumn: actualColumn,
|
|
28234
|
+
endRow: actualRow,
|
|
28235
|
+
endColumn: actualColumn
|
|
28355
28236
|
};
|
|
28356
|
-
const
|
|
28357
|
-
|
|
28237
|
+
const mergeInfo = {
|
|
28238
|
+
...position,
|
|
28358
28239
|
startRow,
|
|
28359
28240
|
startColumn,
|
|
28360
28241
|
endRow,
|
|
28361
|
-
endColumn
|
|
28362
|
-
startY,
|
|
28363
|
-
endY,
|
|
28364
|
-
startX,
|
|
28365
|
-
endX
|
|
28242
|
+
endColumn
|
|
28366
28243
|
};
|
|
28367
|
-
|
|
28368
|
-
|
|
28369
|
-
|
|
28370
|
-
|
|
28371
|
-
|
|
28372
|
-
|
|
28373
|
-
|
|
28374
|
-
|
|
28375
|
-
|
|
28376
|
-
mergeInfo = {
|
|
28377
|
-
...mergeInfo,
|
|
28378
|
-
startY: mergeStartY,
|
|
28379
|
-
endY: mergeEndY,
|
|
28380
|
-
startX: mergeStartX,
|
|
28381
|
-
endX: mergeEndX
|
|
28382
|
-
};
|
|
28383
|
-
} else if (!isMerged && endRow !== -1 && endColumn !== -1) {
|
|
28384
|
-
const mergeEndY = rowHeightAccumulation[endRow] || rowHeightAccumulation[rowAccumulationCount];
|
|
28385
|
-
const mergeEndX = columnWidthAccumulation[endColumn] || columnWidthAccumulation[columnAccumulationCount];
|
|
28386
|
-
mergeInfo = {
|
|
28387
|
-
...mergeInfo,
|
|
28388
|
-
startY,
|
|
28389
|
-
endY: mergeEndY,
|
|
28390
|
-
startX,
|
|
28391
|
-
endX: mergeEndX
|
|
28392
|
-
};
|
|
28244
|
+
if (isMerged ? startRow !== -1 && startColumn !== -1 : endRow !== -1 && endColumn !== -1) {
|
|
28245
|
+
if (isMerged) {
|
|
28246
|
+
const mergeRowGapSize = (gapSizeGetter === null || gapSizeGetter === void 0 ? void 0 : gapSizeGetter.row(startRow)) ?? 0;
|
|
28247
|
+
const mergeColGapSize = (gapSizeGetter === null || gapSizeGetter === void 0 ? void 0 : gapSizeGetter.col(startColumn)) ?? 0;
|
|
28248
|
+
mergeInfo.startY = (rowHeightAccumulation[startRow - 1] ?? 0) + mergeRowGapSize;
|
|
28249
|
+
mergeInfo.startX = (columnWidthAccumulation[startColumn - 1] ?? 0) + mergeColGapSize;
|
|
28250
|
+
}
|
|
28251
|
+
mergeInfo.endY = rowHeightAccumulation[endRow] ?? rowHeightAccumulation[rowHeightAccumulation.length - 1];
|
|
28252
|
+
mergeInfo.endX = columnWidthAccumulation[endColumn] ?? columnWidthAccumulation[columnWidthAccumulation.length - 1];
|
|
28393
28253
|
}
|
|
28394
28254
|
return {
|
|
28255
|
+
...position,
|
|
28395
28256
|
isMerged,
|
|
28396
28257
|
isMergedMainCell,
|
|
28397
|
-
actualRow
|
|
28398
|
-
actualColumn
|
|
28399
|
-
startY,
|
|
28400
|
-
endY,
|
|
28401
|
-
startX,
|
|
28402
|
-
endX,
|
|
28258
|
+
actualRow,
|
|
28259
|
+
actualColumn,
|
|
28403
28260
|
mergeInfo
|
|
28404
28261
|
};
|
|
28405
28262
|
}
|
|
@@ -28408,6 +28265,8 @@ function getCellWithCoordByIndexCore(row, column, rowHeightAccumulation, columnW
|
|
|
28408
28265
|
* @param offsetX Offset value from PointerEvent in canvas element.
|
|
28409
28266
|
* @param scaleX from scene.getAncestorScale
|
|
28410
28267
|
* @param scrollXY Scroll value of viewport
|
|
28268
|
+
* @param scrollXY.x horizontal scroll offset
|
|
28269
|
+
* @param scrollXY.y vertical scroll offset
|
|
28411
28270
|
* @returns {number} x in sheet coordinate.
|
|
28412
28271
|
*/
|
|
28413
28272
|
function getTransformOffsetX(offsetX, scaleX, scrollXY, rowHeaderWidth) {
|
|
@@ -28418,15 +28277,15 @@ function getTransformOffsetX(offsetX, scaleX, scrollXY, rowHeaderWidth) {
|
|
|
28418
28277
|
* @param offsetY
|
|
28419
28278
|
* @param scaleY
|
|
28420
28279
|
* @param scrollXY
|
|
28280
|
+
* @param scrollXY.x horizontal scroll offset
|
|
28281
|
+
* @param scrollXY.y vertical scroll offset
|
|
28421
28282
|
*/
|
|
28422
28283
|
function getTransformOffsetY(offsetY, scaleY, scrollXY, columnHeight) {
|
|
28423
28284
|
const { y: scrollY } = scrollXY;
|
|
28424
|
-
|
|
28425
|
-
return offsetY;
|
|
28285
|
+
return offsetY / scaleY + scrollY - columnHeight;
|
|
28426
28286
|
}
|
|
28427
28287
|
|
|
28428
|
-
|
|
28429
|
-
//#region src/types/const/clipboard.ts
|
|
28288
|
+
// src/types/const/clipboard.ts
|
|
28430
28289
|
/**
|
|
28431
28290
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
28432
28291
|
*
|
|
@@ -28450,8 +28309,7 @@ const skipParseTagNames = [
|
|
|
28450
28309
|
"link"
|
|
28451
28310
|
];
|
|
28452
28311
|
|
|
28453
|
-
|
|
28454
|
-
//#region src/types/enum/data-validation-error-style.ts
|
|
28312
|
+
// src/types/enum/data-validation-error-style.ts
|
|
28455
28313
|
/**
|
|
28456
28314
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
28457
28315
|
*
|
|
@@ -28474,8 +28332,7 @@ let DataValidationErrorStyle = /* @__PURE__ */ function(DataValidationErrorStyle
|
|
|
28474
28332
|
return DataValidationErrorStyle;
|
|
28475
28333
|
}({});
|
|
28476
28334
|
|
|
28477
|
-
|
|
28478
|
-
//#region src/types/enum/data-validation-ime-mode.ts
|
|
28335
|
+
// src/types/enum/data-validation-ime-mode.ts
|
|
28479
28336
|
/**
|
|
28480
28337
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
28481
28338
|
*
|
|
@@ -28506,8 +28363,7 @@ let DataValidationImeMode = /* @__PURE__ */ function(DataValidationImeMode) {
|
|
|
28506
28363
|
return DataValidationImeMode;
|
|
28507
28364
|
}({});
|
|
28508
28365
|
|
|
28509
|
-
|
|
28510
|
-
//#region src/types/enum/data-validation-operator.ts
|
|
28366
|
+
// src/types/enum/data-validation-operator.ts
|
|
28511
28367
|
/**
|
|
28512
28368
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
28513
28369
|
*
|
|
@@ -28535,8 +28391,7 @@ let DataValidationOperator = /* @__PURE__ */ function(DataValidationOperator) {
|
|
|
28535
28391
|
return DataValidationOperator;
|
|
28536
28392
|
}({});
|
|
28537
28393
|
|
|
28538
|
-
|
|
28539
|
-
//#region src/types/enum/data-validation-render-mode.ts
|
|
28394
|
+
// src/types/enum/data-validation-render-mode.ts
|
|
28540
28395
|
/**
|
|
28541
28396
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
28542
28397
|
*
|
|
@@ -28559,8 +28414,7 @@ let DataValidationRenderMode = /* @__PURE__ */ function(DataValidationRenderMode
|
|
|
28559
28414
|
return DataValidationRenderMode;
|
|
28560
28415
|
}({});
|
|
28561
28416
|
|
|
28562
|
-
|
|
28563
|
-
//#region src/types/enum/data-validation-status.ts
|
|
28417
|
+
// src/types/enum/data-validation-status.ts
|
|
28564
28418
|
/**
|
|
28565
28419
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
28566
28420
|
*
|
|
@@ -28583,8 +28437,7 @@ let DataValidationStatus = /* @__PURE__ */ function(DataValidationStatus) {
|
|
|
28583
28437
|
return DataValidationStatus;
|
|
28584
28438
|
}({});
|
|
28585
28439
|
|
|
28586
|
-
|
|
28587
|
-
//#region src/types/enum/data-validation-type.ts
|
|
28440
|
+
// src/types/enum/data-validation-type.ts
|
|
28588
28441
|
/**
|
|
28589
28442
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
28590
28443
|
*
|
|
@@ -28624,8 +28477,7 @@ let DataValidationType = /* @__PURE__ */ function(DataValidationType) {
|
|
|
28624
28477
|
return DataValidationType;
|
|
28625
28478
|
}({});
|
|
28626
28479
|
|
|
28627
|
-
|
|
28628
|
-
//#region src/services/resource-loader/resource-loader.service.ts
|
|
28480
|
+
// src/services/resource-loader/resource-loader.service.ts
|
|
28629
28481
|
let ResourceLoaderService = class ResourceLoaderService extends Disposable {
|
|
28630
28482
|
constructor(_resourceManagerService, _univerInstanceService) {
|
|
28631
28483
|
super();
|
|
@@ -28724,36 +28576,7 @@ let ResourceLoaderService = class ResourceLoaderService extends Disposable {
|
|
|
28724
28576
|
};
|
|
28725
28577
|
ResourceLoaderService = __decorate([__decorateParam(0, (0, _wendellhu_redi.Inject)(IResourceManagerService)), __decorateParam(1, (0, _wendellhu_redi.Inject)(IUniverInstanceService))], ResourceLoaderService);
|
|
28726
28578
|
|
|
28727
|
-
|
|
28728
|
-
//#region src/slides/slide-data-model.ts
|
|
28729
|
-
var SlideDataModel = class extends UnitModel {
|
|
28730
|
-
constructor(..._args) {
|
|
28731
|
-
super(..._args);
|
|
28732
|
-
_defineProperty(this, "type", void 0);
|
|
28733
|
-
_defineProperty(this, "name$", void 0);
|
|
28734
|
-
}
|
|
28735
|
-
getUnitId() {
|
|
28736
|
-
throw new Error("Method not implemented.");
|
|
28737
|
-
}
|
|
28738
|
-
setName(name) {
|
|
28739
|
-
throw new Error("Method not implemented.");
|
|
28740
|
-
}
|
|
28741
|
-
getSnapshot() {
|
|
28742
|
-
throw new Error("Method not implemented.");
|
|
28743
|
-
}
|
|
28744
|
-
getRev() {
|
|
28745
|
-
throw new Error("Method not implemented.");
|
|
28746
|
-
}
|
|
28747
|
-
incrementRev() {
|
|
28748
|
-
throw new Error("Method not implemented.");
|
|
28749
|
-
}
|
|
28750
|
-
setRev(rev) {
|
|
28751
|
-
throw new Error("Method not implemented.");
|
|
28752
|
-
}
|
|
28753
|
-
};
|
|
28754
|
-
|
|
28755
|
-
//#endregion
|
|
28756
|
-
//#region src/univer.ts
|
|
28579
|
+
// src/univer.ts
|
|
28757
28580
|
/**
|
|
28758
28581
|
* @hideconstructor
|
|
28759
28582
|
*/
|
|
@@ -28821,7 +28644,6 @@ var Univer = class {
|
|
|
28821
28644
|
_init(injector) {
|
|
28822
28645
|
this._univerInstanceService.registerCtorForType(_univerjs_protocol.UniverType.UNIVER_SHEET, Workbook);
|
|
28823
28646
|
this._univerInstanceService.registerCtorForType(_univerjs_protocol.UniverType.UNIVER_DOC, DocumentDataModel);
|
|
28824
|
-
this._univerInstanceService.registerCtorForType(_univerjs_protocol.UniverType.UNIVER_SLIDE, SlideDataModel);
|
|
28825
28647
|
const univerInstanceService = injector.get(IUniverInstanceService);
|
|
28826
28648
|
univerInstanceService.__setCreateHandler((type, data, ctor, options) => {
|
|
28827
28649
|
const isFirstTime = !this._startedTypes.has(type);
|
|
@@ -28897,8 +28719,7 @@ function createUniverInjector(parentInjector, override) {
|
|
|
28897
28719
|
return injector;
|
|
28898
28720
|
}
|
|
28899
28721
|
|
|
28900
|
-
|
|
28901
|
-
//#region src/index.ts
|
|
28722
|
+
// src/index.ts
|
|
28902
28723
|
/**
|
|
28903
28724
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
28904
28725
|
*
|
|
@@ -28916,7 +28737,6 @@ function createUniverInjector(parentInjector, override) {
|
|
|
28916
28737
|
*/
|
|
28917
28738
|
installShims();
|
|
28918
28739
|
|
|
28919
|
-
//#endregion
|
|
28920
28740
|
exports.ABCToNumber = ABCToNumber;
|
|
28921
28741
|
exports.AUTO_HEIGHT_FOR_MERGED_CELLS = AUTO_HEIGHT_FOR_MERGED_CELLS;
|
|
28922
28742
|
exports.AbsoluteRefType = AbsoluteRefType;
|
|
@@ -29637,6 +29457,7 @@ exports.repeatStringNumTimes = repeatStringNumTimes;
|
|
|
29637
29457
|
exports.replaceInDocumentBody = replaceInDocumentBody;
|
|
29638
29458
|
exports.requestImmediateMacroTask = requestImmediateMacroTask;
|
|
29639
29459
|
exports.resolveDocumentParagraphStyle = resolveDocumentParagraphStyle;
|
|
29460
|
+
exports.resolveDocumentParagraphWordWrap = resolveDocumentParagraphWordWrap;
|
|
29640
29461
|
exports.resolveSectionHeaderFooterReference = resolveSectionHeaderFooterReference;
|
|
29641
29462
|
exports.resolveSectionHeaderFooterReferences = resolveSectionHeaderFooterReferences;
|
|
29642
29463
|
exports.resolveWithBasePath = resolveWithBasePath;
|