@univerjs/core 1.4.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/lib/cjs/facade.js +11 -11
- package/lib/cjs/index.js +57 -22
- package/lib/es/facade.js +11 -11
- package/lib/es/index.js +57 -22
- package/lib/facade.js +11 -11
- package/lib/index.js +57 -22
- package/lib/types/common/interceptor.d.ts +6 -3
- package/lib/types/sheets/typedef.d.ts +8 -3
- package/lib/types/types/enum/sheet-types.d.ts +2 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +2 -2
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
## Package Overview
|
|
10
10
|
|
|
11
|
-
| Package | UMD global | CSS | Locales | Facade entry |
|
|
12
|
-
| --- | --- | :---: | :---: | :---: |
|
|
13
|
-
| `@univerjs/core` | `UniverCore` | No | No | Yes |
|
|
11
|
+
| Package | UMD global | CSS | Locales | Facade entry | Worker entry |
|
|
12
|
+
| --- | --- | :---: | :---: | :---: | :---: |
|
|
13
|
+
| `@univerjs/core` | `UniverCore` | No | No | Yes | No |
|
|
14
14
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
@@ -20,8 +20,6 @@ pnpm add @univerjs/core
|
|
|
20
20
|
npm install @univerjs/core
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Keep all `@univerjs/*` packages on the same version.
|
|
24
|
-
|
|
25
23
|
## Usage
|
|
26
24
|
|
|
27
25
|
```ts
|
|
@@ -32,6 +30,10 @@ const univer = new Univer({
|
|
|
32
30
|
});
|
|
33
31
|
```
|
|
34
32
|
|
|
33
|
+
## Integration Notes
|
|
34
|
+
|
|
35
|
+
- Import `@univerjs/core/facade` when using this package through Univer Facade APIs.
|
|
36
|
+
|
|
35
37
|
## Resources
|
|
36
38
|
|
|
37
39
|
- [Documentation](https://docs.univer.ai)
|
package/lib/cjs/facade.js
CHANGED
|
@@ -79,14 +79,14 @@ var FBaseInitialable = class extends _univerjs_core.Disposable {
|
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
81
|
|
|
82
|
-
// \0@oxc-project+runtime@0.
|
|
82
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/decorateParam.js
|
|
83
83
|
function __decorateParam(paramIndex, decorator) {
|
|
84
84
|
return function(target, key) {
|
|
85
85
|
decorator(target, key, paramIndex);
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
// \0@oxc-project+runtime@0.
|
|
89
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/decorate.js
|
|
90
90
|
function __decorate(decorators, target, key, desc) {
|
|
91
91
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
92
92
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -208,7 +208,7 @@ let FBlob = _FBlob = class FBlob extends FBase {
|
|
|
208
208
|
};
|
|
209
209
|
FBlob = _FBlob = __decorate([__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.Injector))], FBlob);
|
|
210
210
|
|
|
211
|
-
// \0@oxc-project+runtime@0.
|
|
211
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/typeof.js
|
|
212
212
|
function _typeof(o) {
|
|
213
213
|
"@babel/helpers - typeof";
|
|
214
214
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -218,25 +218,25 @@ function _typeof(o) {
|
|
|
218
218
|
}, _typeof(o);
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
// \0@oxc-project+runtime@0.
|
|
222
|
-
function toPrimitive(t,
|
|
221
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/toPrimitive.js
|
|
222
|
+
function toPrimitive(t, e) {
|
|
223
223
|
if ("object" != _typeof(t) || !t) return t;
|
|
224
|
-
var
|
|
225
|
-
if (void 0 !==
|
|
226
|
-
var i =
|
|
224
|
+
var r;
|
|
225
|
+
if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {
|
|
226
|
+
var i = r.call(t, e || "default");
|
|
227
227
|
if ("object" != _typeof(i)) return i;
|
|
228
228
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
229
229
|
}
|
|
230
|
-
return ("string" ===
|
|
230
|
+
return ("string" === e ? String : Number)(t);
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
// \0@oxc-project+runtime@0.
|
|
233
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/toPropertyKey.js
|
|
234
234
|
function toPropertyKey(t) {
|
|
235
235
|
var i = toPrimitive(t, "string");
|
|
236
236
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
-
// \0@oxc-project+runtime@0.
|
|
239
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/defineProperty.js
|
|
240
240
|
function _defineProperty(e, r, t) {
|
|
241
241
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
242
242
|
value: t,
|
package/lib/cjs/index.js
CHANGED
|
@@ -6,18 +6,18 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __exportAll = (all,
|
|
10
|
-
let target = {};
|
|
9
|
+
var __exportAll = (all, flags) => {
|
|
10
|
+
let target = Object.setPrototypeOf({}, null);
|
|
11
11
|
for (var name in all) {
|
|
12
12
|
__defProp(target, name, {
|
|
13
13
|
get: all[name],
|
|
14
14
|
enumerable: true
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
if (!
|
|
17
|
+
if (!(flags & 1)) {
|
|
18
18
|
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
19
19
|
}
|
|
20
|
-
return target;
|
|
20
|
+
return flags & 2 ? target : Object.preventExtensions(target);
|
|
21
21
|
};
|
|
22
22
|
var __copyProps = (to, from, except, desc) => {
|
|
23
23
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -150,7 +150,7 @@ function installShims() {
|
|
|
150
150
|
installStringAt();
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
// \0@oxc-project+runtime@0.
|
|
153
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/typeof.js
|
|
154
154
|
function _typeof(o) {
|
|
155
155
|
"@babel/helpers - typeof";
|
|
156
156
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -160,25 +160,25 @@ function _typeof(o) {
|
|
|
160
160
|
}, _typeof(o);
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
// \0@oxc-project+runtime@0.
|
|
164
|
-
function toPrimitive(t,
|
|
163
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/toPrimitive.js
|
|
164
|
+
function toPrimitive(t, e) {
|
|
165
165
|
if ("object" != _typeof(t) || !t) return t;
|
|
166
|
-
var
|
|
167
|
-
if (void 0 !==
|
|
168
|
-
var i =
|
|
166
|
+
var r;
|
|
167
|
+
if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {
|
|
168
|
+
var i = r.call(t, e || "default");
|
|
169
169
|
if ("object" != _typeof(i)) return i;
|
|
170
170
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
171
171
|
}
|
|
172
|
-
return ("string" ===
|
|
172
|
+
return ("string" === e ? String : Number)(t);
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
// \0@oxc-project+runtime@0.
|
|
175
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/toPropertyKey.js
|
|
176
176
|
function toPropertyKey(t) {
|
|
177
177
|
var i = toPrimitive(t, "string");
|
|
178
178
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
// \0@oxc-project+runtime@0.
|
|
181
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/defineProperty.js
|
|
182
182
|
function _defineProperty(e, r, t) {
|
|
183
183
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
184
184
|
value: t,
|
|
@@ -1450,6 +1450,7 @@ let SheetTypes = /* @__PURE__ */ function(SheetTypes) {
|
|
|
1450
1450
|
SheetTypes[SheetTypes["GRID"] = 0] = "GRID";
|
|
1451
1451
|
SheetTypes[SheetTypes["KANBAN"] = 1] = "KANBAN";
|
|
1452
1452
|
SheetTypes[SheetTypes["GANTT"] = 2] = "GANTT";
|
|
1453
|
+
SheetTypes[SheetTypes["CHART"] = 3] = "CHART";
|
|
1453
1454
|
return SheetTypes;
|
|
1454
1455
|
}({});
|
|
1455
1456
|
|
|
@@ -1671,7 +1672,7 @@ let ThemeColors = /* @__PURE__ */ function(ThemeColors) {
|
|
|
1671
1672
|
|
|
1672
1673
|
// package.json
|
|
1673
1674
|
var name = "@univerjs/core";
|
|
1674
|
-
var version = "1.
|
|
1675
|
+
var version = "1.5.1";
|
|
1675
1676
|
|
|
1676
1677
|
// src/common/array.ts
|
|
1677
1678
|
/**
|
|
@@ -2009,14 +2010,14 @@ function hashLogContent(...args) {
|
|
|
2009
2010
|
return args.map((a) => JSON.stringify(a)).join("");
|
|
2010
2011
|
}
|
|
2011
2012
|
|
|
2012
|
-
// \0@oxc-project+runtime@0.
|
|
2013
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/decorateParam.js
|
|
2013
2014
|
function __decorateParam(paramIndex, decorator) {
|
|
2014
2015
|
return function(target, key) {
|
|
2015
2016
|
decorator(target, key, paramIndex);
|
|
2016
2017
|
};
|
|
2017
2018
|
}
|
|
2018
2019
|
|
|
2019
|
-
// \0@oxc-project+runtime@0.
|
|
2020
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/decorate.js
|
|
2020
2021
|
function __decorate(decorators, target, key, desc) {
|
|
2021
2022
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2022
2023
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11776,8 +11777,9 @@ const composeInterceptors = (interceptors) => function(initialValue, context) {
|
|
|
11776
11777
|
}
|
|
11777
11778
|
return value;
|
|
11778
11779
|
};
|
|
11779
|
-
var InterceptorManager = class {
|
|
11780
|
+
var InterceptorManager = class extends Disposable {
|
|
11780
11781
|
constructor(interceptorPoints) {
|
|
11782
|
+
super();
|
|
11781
11783
|
_defineProperty(this, "_interceptorsByName", /* @__PURE__ */ new Map());
|
|
11782
11784
|
_defineProperty(this, "_interceptorPoints", void 0);
|
|
11783
11785
|
this._interceptorPoints = interceptorPoints;
|
|
@@ -11788,26 +11790,41 @@ var InterceptorManager = class {
|
|
|
11788
11790
|
* @param filter A callback function to filter the interceptors.
|
|
11789
11791
|
* @returns It will return a composed interceptor function. If you will perform the interceptor repeatedly,
|
|
11790
11792
|
* you should cache the result instead of calling this function multiple times.
|
|
11793
|
+
* A cached chain cannot start a new call after this manager is disposed.
|
|
11791
11794
|
*/
|
|
11792
11795
|
fetchThroughInterceptors(name, filter) {
|
|
11796
|
+
this.ensureNotDisposed();
|
|
11793
11797
|
const key = name;
|
|
11794
11798
|
let interceptors = this._interceptorsByName.get(key);
|
|
11795
11799
|
if (filter) interceptors = interceptors.filter(filter);
|
|
11796
|
-
|
|
11800
|
+
const handler = composeInterceptors(interceptors || []);
|
|
11801
|
+
return (initialValue, context) => {
|
|
11802
|
+
this.ensureNotDisposed();
|
|
11803
|
+
return handler(initialValue, context);
|
|
11804
|
+
};
|
|
11797
11805
|
}
|
|
11798
11806
|
intercept(name, interceptor) {
|
|
11807
|
+
this.ensureNotDisposed();
|
|
11799
11808
|
const key = name;
|
|
11800
11809
|
if (!this._interceptorsByName.has(key)) this._interceptorsByName.set(key, []);
|
|
11801
11810
|
const interceptors = this._interceptorsByName.get(key);
|
|
11802
11811
|
interceptors.push(interceptor);
|
|
11803
11812
|
this._interceptorsByName.set(key, interceptors.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0)));
|
|
11804
|
-
|
|
11813
|
+
let registration = interceptor;
|
|
11814
|
+
return () => {
|
|
11815
|
+
const current = registration;
|
|
11816
|
+
registration = void 0;
|
|
11817
|
+
if (!current || this._disposed) return false;
|
|
11818
|
+
const list = this._interceptorsByName.get(key);
|
|
11819
|
+
return list ? remove(list, current) : false;
|
|
11820
|
+
};
|
|
11805
11821
|
}
|
|
11806
11822
|
getInterceptPoints() {
|
|
11807
11823
|
return this._interceptorPoints;
|
|
11808
11824
|
}
|
|
11809
11825
|
dispose() {
|
|
11810
11826
|
this._interceptorsByName.clear();
|
|
11827
|
+
super.dispose();
|
|
11811
11828
|
}
|
|
11812
11829
|
};
|
|
11813
11830
|
function createAsyncInterceptorKey(key) {
|
|
@@ -11832,8 +11849,9 @@ const composeAsyncInterceptors = (interceptors) => {
|
|
|
11832
11849
|
return value;
|
|
11833
11850
|
};
|
|
11834
11851
|
};
|
|
11835
|
-
var AsyncInterceptorManager = class {
|
|
11852
|
+
var AsyncInterceptorManager = class extends Disposable {
|
|
11836
11853
|
constructor(asyncInterceptorPoints) {
|
|
11854
|
+
super();
|
|
11837
11855
|
_defineProperty(this, "_asyncInterceptorsByName", /* @__PURE__ */ new Map());
|
|
11838
11856
|
_defineProperty(this, "_asyncInterceptorPoints", void 0);
|
|
11839
11857
|
this._asyncInterceptorPoints = asyncInterceptorPoints;
|
|
@@ -11844,26 +11862,41 @@ var AsyncInterceptorManager = class {
|
|
|
11844
11862
|
* @param filter A callback function to filter the interceptors.
|
|
11845
11863
|
* @returns It will return a composed interceptor function. If you will perform the interceptor repeatedly,
|
|
11846
11864
|
* you should cache the result instead of calling this function multiple times.
|
|
11865
|
+
* A cached chain cannot start a new call after this manager is disposed.
|
|
11847
11866
|
*/
|
|
11848
11867
|
fetchThroughAsyncInterceptors(name, filter) {
|
|
11868
|
+
this.ensureNotDisposed();
|
|
11849
11869
|
const key = name;
|
|
11850
11870
|
let interceptors = this._asyncInterceptorsByName.get(key);
|
|
11851
11871
|
if (filter) interceptors = interceptors.filter(filter);
|
|
11852
|
-
|
|
11872
|
+
const handler = composeAsyncInterceptors(interceptors || []);
|
|
11873
|
+
return async (initialValue, context) => {
|
|
11874
|
+
this.ensureNotDisposed();
|
|
11875
|
+
return handler(initialValue, context);
|
|
11876
|
+
};
|
|
11853
11877
|
}
|
|
11854
11878
|
async interceptAsync(name, interceptor) {
|
|
11879
|
+
this.ensureNotDisposed();
|
|
11855
11880
|
const key = name;
|
|
11856
11881
|
if (!this._asyncInterceptorsByName.has(key)) this._asyncInterceptorsByName.set(key, []);
|
|
11857
11882
|
const interceptors = this._asyncInterceptorsByName.get(key);
|
|
11858
11883
|
interceptors.push(interceptor);
|
|
11859
11884
|
this._asyncInterceptorsByName.set(key, interceptors.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0)));
|
|
11860
|
-
|
|
11885
|
+
let registration = interceptor;
|
|
11886
|
+
return () => {
|
|
11887
|
+
const current = registration;
|
|
11888
|
+
registration = void 0;
|
|
11889
|
+
if (!current || this._disposed) return false;
|
|
11890
|
+
const list = this._asyncInterceptorsByName.get(key);
|
|
11891
|
+
return list ? remove(list, current) : false;
|
|
11892
|
+
};
|
|
11861
11893
|
}
|
|
11862
11894
|
getInterceptPoints() {
|
|
11863
11895
|
return this._asyncInterceptorPoints;
|
|
11864
11896
|
}
|
|
11865
11897
|
dispose() {
|
|
11866
11898
|
this._asyncInterceptorsByName.clear();
|
|
11899
|
+
super.dispose();
|
|
11867
11900
|
}
|
|
11868
11901
|
};
|
|
11869
11902
|
|
|
@@ -27458,12 +27491,14 @@ function cloneMergeData(ranges) {
|
|
|
27458
27491
|
function cloneWorksheetData(worksheet) {
|
|
27459
27492
|
const result = {
|
|
27460
27493
|
id: worksheet.id,
|
|
27494
|
+
...worksheet.type === void 0 ? {} : { type: worksheet.type },
|
|
27461
27495
|
name: worksheet.name,
|
|
27462
27496
|
tabColor: worksheet.tabColor,
|
|
27463
27497
|
hidden: worksheet.hidden,
|
|
27464
27498
|
rowCount: worksheet.rowCount,
|
|
27465
27499
|
columnCount: worksheet.columnCount,
|
|
27466
27500
|
zoomRatio: worksheet.zoomRatio,
|
|
27501
|
+
...worksheet.zoomToFit === void 0 ? {} : { zoomToFit: worksheet.zoomToFit },
|
|
27467
27502
|
scrollTop: worksheet.scrollTop,
|
|
27468
27503
|
scrollLeft: worksheet.scrollLeft,
|
|
27469
27504
|
defaultColumnWidth: worksheet.defaultColumnWidth,
|
package/lib/es/facade.js
CHANGED
|
@@ -78,14 +78,14 @@ var FBaseInitialable = class extends Disposable {
|
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
-
// \0@oxc-project+runtime@0.
|
|
81
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/decorateParam.js
|
|
82
82
|
function __decorateParam(paramIndex, decorator) {
|
|
83
83
|
return function(target, key) {
|
|
84
84
|
decorator(target, key, paramIndex);
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
// \0@oxc-project+runtime@0.
|
|
88
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/decorate.js
|
|
89
89
|
function __decorate(decorators, target, key, desc) {
|
|
90
90
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
91
91
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -207,7 +207,7 @@ let FBlob = _FBlob = class FBlob extends FBase {
|
|
|
207
207
|
};
|
|
208
208
|
FBlob = _FBlob = __decorate([__decorateParam(1, Inject(Injector))], FBlob);
|
|
209
209
|
|
|
210
|
-
// \0@oxc-project+runtime@0.
|
|
210
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/typeof.js
|
|
211
211
|
function _typeof(o) {
|
|
212
212
|
"@babel/helpers - typeof";
|
|
213
213
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -217,25 +217,25 @@ function _typeof(o) {
|
|
|
217
217
|
}, _typeof(o);
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
// \0@oxc-project+runtime@0.
|
|
221
|
-
function toPrimitive(t,
|
|
220
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/toPrimitive.js
|
|
221
|
+
function toPrimitive(t, e) {
|
|
222
222
|
if ("object" != _typeof(t) || !t) return t;
|
|
223
|
-
var
|
|
224
|
-
if (void 0 !==
|
|
225
|
-
var i =
|
|
223
|
+
var r;
|
|
224
|
+
if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {
|
|
225
|
+
var i = r.call(t, e || "default");
|
|
226
226
|
if ("object" != _typeof(i)) return i;
|
|
227
227
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
228
228
|
}
|
|
229
|
-
return ("string" ===
|
|
229
|
+
return ("string" === e ? String : Number)(t);
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
// \0@oxc-project+runtime@0.
|
|
232
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/toPropertyKey.js
|
|
233
233
|
function toPropertyKey(t) {
|
|
234
234
|
var i = toPrimitive(t, "string");
|
|
235
235
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
-
// \0@oxc-project+runtime@0.
|
|
238
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/defineProperty.js
|
|
239
239
|
function _defineProperty(e, r, t) {
|
|
240
240
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
241
241
|
value: t,
|
package/lib/es/index.js
CHANGED
|
@@ -12,18 +12,18 @@ import KDBush from "kdbush";
|
|
|
12
12
|
|
|
13
13
|
// \0rolldown/runtime.js
|
|
14
14
|
var __defProp = Object.defineProperty;
|
|
15
|
-
var __exportAll = (all,
|
|
16
|
-
let target = {};
|
|
15
|
+
var __exportAll = (all, flags) => {
|
|
16
|
+
let target = Object.setPrototypeOf({}, null);
|
|
17
17
|
for (var name in all) {
|
|
18
18
|
__defProp(target, name, {
|
|
19
19
|
get: all[name],
|
|
20
20
|
enumerable: true
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
-
if (!
|
|
23
|
+
if (!(flags & 1)) {
|
|
24
24
|
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
25
25
|
}
|
|
26
|
-
return target;
|
|
26
|
+
return flags & 2 ? target : Object.preventExtensions(target);
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
// src/common/shims.ts
|
|
@@ -121,7 +121,7 @@ function installShims() {
|
|
|
121
121
|
installStringAt();
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
// \0@oxc-project+runtime@0.
|
|
124
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/typeof.js
|
|
125
125
|
function _typeof(o) {
|
|
126
126
|
"@babel/helpers - typeof";
|
|
127
127
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -131,25 +131,25 @@ function _typeof(o) {
|
|
|
131
131
|
}, _typeof(o);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
// \0@oxc-project+runtime@0.
|
|
135
|
-
function toPrimitive(t,
|
|
134
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/toPrimitive.js
|
|
135
|
+
function toPrimitive(t, e) {
|
|
136
136
|
if ("object" != _typeof(t) || !t) return t;
|
|
137
|
-
var
|
|
138
|
-
if (void 0 !==
|
|
139
|
-
var i =
|
|
137
|
+
var r;
|
|
138
|
+
if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {
|
|
139
|
+
var i = r.call(t, e || "default");
|
|
140
140
|
if ("object" != _typeof(i)) return i;
|
|
141
141
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
142
142
|
}
|
|
143
|
-
return ("string" ===
|
|
143
|
+
return ("string" === e ? String : Number)(t);
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
// \0@oxc-project+runtime@0.
|
|
146
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/toPropertyKey.js
|
|
147
147
|
function toPropertyKey(t) {
|
|
148
148
|
var i = toPrimitive(t, "string");
|
|
149
149
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
// \0@oxc-project+runtime@0.
|
|
152
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/defineProperty.js
|
|
153
153
|
function _defineProperty(e, r, t) {
|
|
154
154
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
155
155
|
value: t,
|
|
@@ -1421,6 +1421,7 @@ let SheetTypes = /* @__PURE__ */ function(SheetTypes) {
|
|
|
1421
1421
|
SheetTypes[SheetTypes["GRID"] = 0] = "GRID";
|
|
1422
1422
|
SheetTypes[SheetTypes["KANBAN"] = 1] = "KANBAN";
|
|
1423
1423
|
SheetTypes[SheetTypes["GANTT"] = 2] = "GANTT";
|
|
1424
|
+
SheetTypes[SheetTypes["CHART"] = 3] = "CHART";
|
|
1424
1425
|
return SheetTypes;
|
|
1425
1426
|
}({});
|
|
1426
1427
|
|
|
@@ -1642,7 +1643,7 @@ let ThemeColors = /* @__PURE__ */ function(ThemeColors) {
|
|
|
1642
1643
|
|
|
1643
1644
|
// package.json
|
|
1644
1645
|
var name = "@univerjs/core";
|
|
1645
|
-
var version = "1.
|
|
1646
|
+
var version = "1.5.1";
|
|
1646
1647
|
|
|
1647
1648
|
// src/common/array.ts
|
|
1648
1649
|
/**
|
|
@@ -1980,14 +1981,14 @@ function hashLogContent(...args) {
|
|
|
1980
1981
|
return args.map((a) => JSON.stringify(a)).join("");
|
|
1981
1982
|
}
|
|
1982
1983
|
|
|
1983
|
-
// \0@oxc-project+runtime@0.
|
|
1984
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/decorateParam.js
|
|
1984
1985
|
function __decorateParam(paramIndex, decorator) {
|
|
1985
1986
|
return function(target, key) {
|
|
1986
1987
|
decorator(target, key, paramIndex);
|
|
1987
1988
|
};
|
|
1988
1989
|
}
|
|
1989
1990
|
|
|
1990
|
-
// \0@oxc-project+runtime@0.
|
|
1991
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/decorate.js
|
|
1991
1992
|
function __decorate(decorators, target, key, desc) {
|
|
1992
1993
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1993
1994
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -11747,8 +11748,9 @@ const composeInterceptors = (interceptors) => function(initialValue, context) {
|
|
|
11747
11748
|
}
|
|
11748
11749
|
return value;
|
|
11749
11750
|
};
|
|
11750
|
-
var InterceptorManager = class {
|
|
11751
|
+
var InterceptorManager = class extends Disposable {
|
|
11751
11752
|
constructor(interceptorPoints) {
|
|
11753
|
+
super();
|
|
11752
11754
|
_defineProperty(this, "_interceptorsByName", /* @__PURE__ */ new Map());
|
|
11753
11755
|
_defineProperty(this, "_interceptorPoints", void 0);
|
|
11754
11756
|
this._interceptorPoints = interceptorPoints;
|
|
@@ -11759,26 +11761,41 @@ var InterceptorManager = class {
|
|
|
11759
11761
|
* @param filter A callback function to filter the interceptors.
|
|
11760
11762
|
* @returns It will return a composed interceptor function. If you will perform the interceptor repeatedly,
|
|
11761
11763
|
* you should cache the result instead of calling this function multiple times.
|
|
11764
|
+
* A cached chain cannot start a new call after this manager is disposed.
|
|
11762
11765
|
*/
|
|
11763
11766
|
fetchThroughInterceptors(name, filter) {
|
|
11767
|
+
this.ensureNotDisposed();
|
|
11764
11768
|
const key = name;
|
|
11765
11769
|
let interceptors = this._interceptorsByName.get(key);
|
|
11766
11770
|
if (filter) interceptors = interceptors.filter(filter);
|
|
11767
|
-
|
|
11771
|
+
const handler = composeInterceptors(interceptors || []);
|
|
11772
|
+
return (initialValue, context) => {
|
|
11773
|
+
this.ensureNotDisposed();
|
|
11774
|
+
return handler(initialValue, context);
|
|
11775
|
+
};
|
|
11768
11776
|
}
|
|
11769
11777
|
intercept(name, interceptor) {
|
|
11778
|
+
this.ensureNotDisposed();
|
|
11770
11779
|
const key = name;
|
|
11771
11780
|
if (!this._interceptorsByName.has(key)) this._interceptorsByName.set(key, []);
|
|
11772
11781
|
const interceptors = this._interceptorsByName.get(key);
|
|
11773
11782
|
interceptors.push(interceptor);
|
|
11774
11783
|
this._interceptorsByName.set(key, interceptors.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0)));
|
|
11775
|
-
|
|
11784
|
+
let registration = interceptor;
|
|
11785
|
+
return () => {
|
|
11786
|
+
const current = registration;
|
|
11787
|
+
registration = void 0;
|
|
11788
|
+
if (!current || this._disposed) return false;
|
|
11789
|
+
const list = this._interceptorsByName.get(key);
|
|
11790
|
+
return list ? remove(list, current) : false;
|
|
11791
|
+
};
|
|
11776
11792
|
}
|
|
11777
11793
|
getInterceptPoints() {
|
|
11778
11794
|
return this._interceptorPoints;
|
|
11779
11795
|
}
|
|
11780
11796
|
dispose() {
|
|
11781
11797
|
this._interceptorsByName.clear();
|
|
11798
|
+
super.dispose();
|
|
11782
11799
|
}
|
|
11783
11800
|
};
|
|
11784
11801
|
function createAsyncInterceptorKey(key) {
|
|
@@ -11803,8 +11820,9 @@ const composeAsyncInterceptors = (interceptors) => {
|
|
|
11803
11820
|
return value;
|
|
11804
11821
|
};
|
|
11805
11822
|
};
|
|
11806
|
-
var AsyncInterceptorManager = class {
|
|
11823
|
+
var AsyncInterceptorManager = class extends Disposable {
|
|
11807
11824
|
constructor(asyncInterceptorPoints) {
|
|
11825
|
+
super();
|
|
11808
11826
|
_defineProperty(this, "_asyncInterceptorsByName", /* @__PURE__ */ new Map());
|
|
11809
11827
|
_defineProperty(this, "_asyncInterceptorPoints", void 0);
|
|
11810
11828
|
this._asyncInterceptorPoints = asyncInterceptorPoints;
|
|
@@ -11815,26 +11833,41 @@ var AsyncInterceptorManager = class {
|
|
|
11815
11833
|
* @param filter A callback function to filter the interceptors.
|
|
11816
11834
|
* @returns It will return a composed interceptor function. If you will perform the interceptor repeatedly,
|
|
11817
11835
|
* you should cache the result instead of calling this function multiple times.
|
|
11836
|
+
* A cached chain cannot start a new call after this manager is disposed.
|
|
11818
11837
|
*/
|
|
11819
11838
|
fetchThroughAsyncInterceptors(name, filter) {
|
|
11839
|
+
this.ensureNotDisposed();
|
|
11820
11840
|
const key = name;
|
|
11821
11841
|
let interceptors = this._asyncInterceptorsByName.get(key);
|
|
11822
11842
|
if (filter) interceptors = interceptors.filter(filter);
|
|
11823
|
-
|
|
11843
|
+
const handler = composeAsyncInterceptors(interceptors || []);
|
|
11844
|
+
return async (initialValue, context) => {
|
|
11845
|
+
this.ensureNotDisposed();
|
|
11846
|
+
return handler(initialValue, context);
|
|
11847
|
+
};
|
|
11824
11848
|
}
|
|
11825
11849
|
async interceptAsync(name, interceptor) {
|
|
11850
|
+
this.ensureNotDisposed();
|
|
11826
11851
|
const key = name;
|
|
11827
11852
|
if (!this._asyncInterceptorsByName.has(key)) this._asyncInterceptorsByName.set(key, []);
|
|
11828
11853
|
const interceptors = this._asyncInterceptorsByName.get(key);
|
|
11829
11854
|
interceptors.push(interceptor);
|
|
11830
11855
|
this._asyncInterceptorsByName.set(key, interceptors.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0)));
|
|
11831
|
-
|
|
11856
|
+
let registration = interceptor;
|
|
11857
|
+
return () => {
|
|
11858
|
+
const current = registration;
|
|
11859
|
+
registration = void 0;
|
|
11860
|
+
if (!current || this._disposed) return false;
|
|
11861
|
+
const list = this._asyncInterceptorsByName.get(key);
|
|
11862
|
+
return list ? remove(list, current) : false;
|
|
11863
|
+
};
|
|
11832
11864
|
}
|
|
11833
11865
|
getInterceptPoints() {
|
|
11834
11866
|
return this._asyncInterceptorPoints;
|
|
11835
11867
|
}
|
|
11836
11868
|
dispose() {
|
|
11837
11869
|
this._asyncInterceptorsByName.clear();
|
|
11870
|
+
super.dispose();
|
|
11838
11871
|
}
|
|
11839
11872
|
};
|
|
11840
11873
|
|
|
@@ -27429,12 +27462,14 @@ function cloneMergeData(ranges) {
|
|
|
27429
27462
|
function cloneWorksheetData(worksheet) {
|
|
27430
27463
|
const result = {
|
|
27431
27464
|
id: worksheet.id,
|
|
27465
|
+
...worksheet.type === void 0 ? {} : { type: worksheet.type },
|
|
27432
27466
|
name: worksheet.name,
|
|
27433
27467
|
tabColor: worksheet.tabColor,
|
|
27434
27468
|
hidden: worksheet.hidden,
|
|
27435
27469
|
rowCount: worksheet.rowCount,
|
|
27436
27470
|
columnCount: worksheet.columnCount,
|
|
27437
27471
|
zoomRatio: worksheet.zoomRatio,
|
|
27472
|
+
...worksheet.zoomToFit === void 0 ? {} : { zoomToFit: worksheet.zoomToFit },
|
|
27438
27473
|
scrollTop: worksheet.scrollTop,
|
|
27439
27474
|
scrollLeft: worksheet.scrollLeft,
|
|
27440
27475
|
defaultColumnWidth: worksheet.defaultColumnWidth,
|
package/lib/facade.js
CHANGED
|
@@ -78,14 +78,14 @@ var FBaseInitialable = class extends Disposable {
|
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
-
// \0@oxc-project+runtime@0.
|
|
81
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/decorateParam.js
|
|
82
82
|
function __decorateParam(paramIndex, decorator) {
|
|
83
83
|
return function(target, key) {
|
|
84
84
|
decorator(target, key, paramIndex);
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
// \0@oxc-project+runtime@0.
|
|
88
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/decorate.js
|
|
89
89
|
function __decorate(decorators, target, key, desc) {
|
|
90
90
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
91
91
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -207,7 +207,7 @@ let FBlob = _FBlob = class FBlob extends FBase {
|
|
|
207
207
|
};
|
|
208
208
|
FBlob = _FBlob = __decorate([__decorateParam(1, Inject(Injector))], FBlob);
|
|
209
209
|
|
|
210
|
-
// \0@oxc-project+runtime@0.
|
|
210
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/typeof.js
|
|
211
211
|
function _typeof(o) {
|
|
212
212
|
"@babel/helpers - typeof";
|
|
213
213
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -217,25 +217,25 @@ function _typeof(o) {
|
|
|
217
217
|
}, _typeof(o);
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
// \0@oxc-project+runtime@0.
|
|
221
|
-
function toPrimitive(t,
|
|
220
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/toPrimitive.js
|
|
221
|
+
function toPrimitive(t, e) {
|
|
222
222
|
if ("object" != _typeof(t) || !t) return t;
|
|
223
|
-
var
|
|
224
|
-
if (void 0 !==
|
|
225
|
-
var i =
|
|
223
|
+
var r;
|
|
224
|
+
if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {
|
|
225
|
+
var i = r.call(t, e || "default");
|
|
226
226
|
if ("object" != _typeof(i)) return i;
|
|
227
227
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
228
228
|
}
|
|
229
|
-
return ("string" ===
|
|
229
|
+
return ("string" === e ? String : Number)(t);
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
// \0@oxc-project+runtime@0.
|
|
232
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/toPropertyKey.js
|
|
233
233
|
function toPropertyKey(t) {
|
|
234
234
|
var i = toPrimitive(t, "string");
|
|
235
235
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
-
// \0@oxc-project+runtime@0.
|
|
238
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/defineProperty.js
|
|
239
239
|
function _defineProperty(e, r, t) {
|
|
240
240
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
241
241
|
value: t,
|