@univerjs/core 0.24.0 → 0.25.0-insiders.20260608-e4336f7
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 +39 -9
- package/lib/cjs/index.js +2916 -2279
- package/lib/es/facade.js +39 -9
- package/lib/es/index.js +2904 -2280
- package/lib/facade.js +39 -9
- package/lib/index.js +2904 -2280
- package/lib/types/base/base-data-model.d.ts +33 -0
- package/lib/types/{shared/coder.d.ts → base/base-performance.d.ts} +4 -2
- package/lib/types/base/index.d.ts +17 -0
- package/lib/types/base/typedef.d.ts +642 -0
- package/lib/types/common/url.d.ts +1 -0
- package/lib/types/docs/data-model/text-x/apply-utils/common.d.ts +3 -1
- package/lib/types/docs/data-model/text-x/build-utils/drawings.d.ts +0 -1
- package/lib/types/docs/data-model/text-x/utils.d.ts +5 -2
- package/lib/types/docs/data-model/types.d.ts +3 -0
- package/lib/types/facade/f-univer.d.ts +29 -3
- package/lib/types/index.d.ts +3 -2
- package/lib/types/services/resource-manager/resource-manager.service.d.ts +4 -3
- package/lib/types/services/resource-manager/type.d.ts +3 -2
- package/lib/types/shared/index.d.ts +1 -1
- package/lib/types/shared/numfmt.d.ts +2 -1
- package/lib/types/shared/tools.d.ts +5 -0
- package/lib/types/sheets/typedef.d.ts +20 -5
- package/lib/types/types/const/const.d.ts +3 -0
- package/lib/types/types/const/page-size.d.ts +7 -0
- package/lib/types/types/enum/locale-type.d.ts +8 -1
- package/lib/types/types/interfaces/i-document-data.d.ts +50 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +10 -9
- package/package.json +6 -6
- package/LICENSE +0 -176
package/lib/es/facade.js
CHANGED
|
@@ -77,7 +77,7 @@ var FBaseInitialable = class extends Disposable {
|
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
//#endregion
|
|
80
|
-
//#region \0@oxc-project+runtime@0.
|
|
80
|
+
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/decorateParam.js
|
|
81
81
|
function __decorateParam(paramIndex, decorator) {
|
|
82
82
|
return function(target, key) {
|
|
83
83
|
decorator(target, key, paramIndex);
|
|
@@ -85,7 +85,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
//#endregion
|
|
88
|
-
//#region \0@oxc-project+runtime@0.
|
|
88
|
+
//#region \0@oxc-project+runtime@0.134.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);
|
|
@@ -209,7 +209,7 @@ let FBlob = _FBlob = class FBlob extends FBase {
|
|
|
209
209
|
FBlob = _FBlob = __decorate([__decorateParam(1, Inject(Injector))], FBlob);
|
|
210
210
|
|
|
211
211
|
//#endregion
|
|
212
|
-
//#region \0@oxc-project+runtime@0.
|
|
212
|
+
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/typeof.js
|
|
213
213
|
function _typeof(o) {
|
|
214
214
|
"@babel/helpers - typeof";
|
|
215
215
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -220,7 +220,7 @@ function _typeof(o) {
|
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
//#endregion
|
|
223
|
-
//#region \0@oxc-project+runtime@0.
|
|
223
|
+
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/toPrimitive.js
|
|
224
224
|
function toPrimitive(t, r) {
|
|
225
225
|
if ("object" != _typeof(t) || !t) return t;
|
|
226
226
|
var e = t[Symbol.toPrimitive];
|
|
@@ -233,14 +233,14 @@ function toPrimitive(t, r) {
|
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
//#endregion
|
|
236
|
-
//#region \0@oxc-project+runtime@0.
|
|
236
|
+
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/toPropertyKey.js
|
|
237
237
|
function toPropertyKey(t) {
|
|
238
238
|
var i = toPrimitive(t, "string");
|
|
239
239
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
//#endregion
|
|
243
|
-
//#region \0@oxc-project+runtime@0.
|
|
243
|
+
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/defineProperty.js
|
|
244
244
|
function _defineProperty(e, r, t) {
|
|
245
245
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
246
246
|
value: t,
|
|
@@ -1385,6 +1385,30 @@ let FUniver = _FUniver = class FUniver extends Disposable {
|
|
|
1385
1385
|
this._injector.get(LocaleService).setLocale(locale);
|
|
1386
1386
|
}
|
|
1387
1387
|
/**
|
|
1388
|
+
* Get the current locale.
|
|
1389
|
+
* @returns {string} The current locale identifier.
|
|
1390
|
+
* @example
|
|
1391
|
+
* ```ts
|
|
1392
|
+
* const currentLocale = univerAPI.getCurrentLocale();
|
|
1393
|
+
* console.log(currentLocale);
|
|
1394
|
+
* ```
|
|
1395
|
+
*/
|
|
1396
|
+
getCurrentLocale() {
|
|
1397
|
+
return this._injector.get(LocaleService).getCurrentLocale();
|
|
1398
|
+
}
|
|
1399
|
+
/**
|
|
1400
|
+
* Get the locales for the current locale.
|
|
1401
|
+
* @returns {ILanguagePack | undefined} The locales object for the current locale, it returns undefined if the locales is not loaded.
|
|
1402
|
+
* @example
|
|
1403
|
+
* ```ts
|
|
1404
|
+
* const locales = univerAPI.getLocales();
|
|
1405
|
+
* console.log(locales);
|
|
1406
|
+
* ```
|
|
1407
|
+
*/
|
|
1408
|
+
getLocales() {
|
|
1409
|
+
return this._injector.get(LocaleService).getLocales();
|
|
1410
|
+
}
|
|
1411
|
+
/**
|
|
1388
1412
|
* Register a callback that will be triggered before invoking a command.
|
|
1389
1413
|
* @deprecated use `univerAPI.addEvent(univerAPI.Event.BeforeCommandExecute, (event) => {})` instead.
|
|
1390
1414
|
* @param {CommandListener} callback The callback.
|
|
@@ -1513,7 +1537,9 @@ let FUniver = _FUniver = class FUniver extends Disposable {
|
|
|
1513
1537
|
* @example
|
|
1514
1538
|
* ```ts
|
|
1515
1539
|
* const richText = univerAPI.newRichText({ body: { dataStream: 'Hello World\r\n' } });
|
|
1516
|
-
* const
|
|
1540
|
+
* const fWorksheet = univerAPI.getActiveWorkbook().getSheetByName('Sheet1');
|
|
1541
|
+
* if (!fWorksheet) return;
|
|
1542
|
+
* const range = fWorksheet.getRange('A1');
|
|
1517
1543
|
* range.setRichTextValueForCell(richText);
|
|
1518
1544
|
* ```
|
|
1519
1545
|
*/
|
|
@@ -1527,7 +1553,9 @@ let FUniver = _FUniver = class FUniver extends Disposable {
|
|
|
1527
1553
|
* @example
|
|
1528
1554
|
* ```ts
|
|
1529
1555
|
* const richTextValue = univerAPI.newRichTextValue({ body: { dataStream: 'Hello World\r\n' } });
|
|
1530
|
-
* const
|
|
1556
|
+
* const fWorksheet = univerAPI.getActiveWorkbook().getSheetByName('Sheet1');
|
|
1557
|
+
* if (!fWorksheet) return;
|
|
1558
|
+
* const range = fWorksheet.getRange('A1');
|
|
1531
1559
|
* range.setRichTextValueForCell(richTextValue);
|
|
1532
1560
|
* ```
|
|
1533
1561
|
*/
|
|
@@ -1543,7 +1571,9 @@ let FUniver = _FUniver = class FUniver extends Disposable {
|
|
|
1543
1571
|
* const richText = univerAPI.newRichText({ body: { dataStream: 'Hello World\r\n' } });
|
|
1544
1572
|
* const paragraphStyle = univerAPI.newParagraphStyle({ textStyle: { ff: 'Arial', fs: 12, it: univerAPI.Enum.BooleanNumber.TRUE, bl: univerAPI.Enum.BooleanNumber.TRUE } });
|
|
1545
1573
|
* richText.insertParagraph(paragraphStyle);
|
|
1546
|
-
* const
|
|
1574
|
+
* const fWorksheet = univerAPI.getActiveWorkbook().getSheetByName('Sheet1');
|
|
1575
|
+
* if (!fWorksheet) return;
|
|
1576
|
+
* const range = fWorksheet.getRange('A1');
|
|
1547
1577
|
* range.setRichTextValueForCell(richText);
|
|
1548
1578
|
* ```
|
|
1549
1579
|
*/
|