@univerjs/core 0.21.1 → 0.22.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/README.md +22 -49
- package/lib/cjs/facade.js +8 -7
- package/lib/cjs/index.js +618 -571
- package/lib/es/facade.js +8 -7
- package/lib/es/index.js +618 -572
- package/lib/facade.js +8 -7
- package/lib/index.js +618 -572
- package/lib/types/docs/data-model/types.d.ts +17 -17
- package/lib/types/index.d.ts +1 -1
- package/lib/types/sheets/worksheet.d.ts +1 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +9 -9
- package/package.json +14 -10
package/README.md
CHANGED
|
@@ -1,67 +1,40 @@
|
|
|
1
1
|
# @univerjs/core
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
| --- | --- | --- | --- | --- | :---: | :---: |
|
|
7
|
-
| `@univerjs/core` | `UniverCore` | [![][npm-version-shield]][npm-version-link] | ![][npm-license-shield] | ![][npm-downloads-shield] | ❌ | ❌ |
|
|
8
|
-
|
|
9
|
-
## Introduction
|
|
3
|
+
[](https://npmjs.com/package/@univerjs/core)
|
|
4
|
+
[](https://npmjs.com/package/@univerjs/core)
|
|
5
|
+
[](https://npmjs.com/package/@univerjs/core)
|
|
10
6
|
|
|
11
|
-
`@univerjs/core`
|
|
7
|
+
`@univerjs/core` is the foundation of Univer. It provides the Univer runtime, dependency injection, command and mutation services, data models, configuration, localization, and the shared Facade entry point used by higher-level packages.
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
* Basic models for each document type
|
|
15
|
-
* Definition or implementation of several fundamental services, such as:
|
|
16
|
-
* Permission control
|
|
17
|
-
* Command system
|
|
18
|
-
* Undo/Redo
|
|
19
|
-
* Configuration system
|
|
20
|
-
* Logging system
|
|
21
|
-
* Context system
|
|
22
|
-
* Lifecycle
|
|
23
|
-
* Local storage
|
|
24
|
-
* Internationalization
|
|
25
|
-
* Resource management
|
|
26
|
-
|
|
27
|
-
For more information about `@univerjs/core`'s API, please refer to the [API documentation](https://reference.univer.ai/).
|
|
28
|
-
|
|
29
|
-
## Usage
|
|
9
|
+
## Package Overview
|
|
30
10
|
|
|
31
|
-
|
|
11
|
+
| Package | UMD global | CSS | Locales | Facade entry |
|
|
12
|
+
| --- | --- | :---: | :---: | :---: |
|
|
13
|
+
| `@univerjs/core` | `UniverCore` | No | No | Yes |
|
|
32
14
|
|
|
33
|
-
|
|
34
|
-
# Using npm
|
|
35
|
-
npm install @univerjs/core
|
|
15
|
+
## Installation
|
|
36
16
|
|
|
37
|
-
|
|
17
|
+
```sh
|
|
38
18
|
pnpm add @univerjs/core
|
|
19
|
+
# or
|
|
20
|
+
npm install @univerjs/core
|
|
39
21
|
```
|
|
40
22
|
|
|
41
|
-
|
|
23
|
+
Keep all `@univerjs/*` packages on the same version.
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
42
26
|
|
|
43
|
-
```
|
|
44
|
-
import { Univer } from '@univerjs/core';
|
|
27
|
+
```ts
|
|
28
|
+
import { LocaleType, Univer } from '@univerjs/core';
|
|
45
29
|
|
|
46
|
-
new Univer({
|
|
47
|
-
theme: defaultTheme,
|
|
30
|
+
const univer = new Univer({
|
|
48
31
|
locale: LocaleType.EN_US,
|
|
49
|
-
locales,
|
|
50
|
-
logLevel: LogLevel.VERBOSE,
|
|
51
32
|
});
|
|
52
33
|
```
|
|
53
34
|
|
|
54
|
-
|
|
35
|
+
## Resources
|
|
55
36
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
| locale | [LocaleType](https://docs.univer.ai/guides/sheets/getting-started/i18n) | `LocaleType.ZH_CN` | The locale of the application. The default value is `LocaleType.ZH_CN`.
|
|
60
|
-
| locales | [ILocales](https://docs.univer.ai/guides/sheets/getting-started/i18n) | - | The supported locales of the application. By default, the application supports Chinese.
|
|
61
|
-
| logLevel | [LogLevel](https://github.com/dream-num/univer/blob/dev/packages/core/src/services/log/log.service.ts#L22) | `LogLevel.SILENT` | The log level of the application. |
|
|
37
|
+
- [Documentation](https://docs.univer.ai)
|
|
38
|
+
- [NPM package](https://npmjs.com/package/@univerjs/core)
|
|
39
|
+
- [GitHub repository](https://github.com/dream-num/univer)
|
|
62
40
|
|
|
63
|
-
<!-- Links -->
|
|
64
|
-
[npm-version-shield]: https://img.shields.io/npm/v/@univerjs/core?style=flat-square
|
|
65
|
-
[npm-version-link]: https://npmjs.com/package/@univerjs/core
|
|
66
|
-
[npm-license-shield]: https://img.shields.io/npm/l/@univerjs/core?style=flat-square
|
|
67
|
-
[npm-downloads-shield]: https://img.shields.io/npm/dm/@univerjs/core?style=flat-square
|
package/lib/cjs/facade.js
CHANGED
|
@@ -78,7 +78,7 @@ var FBaseInitialable = class extends _univerjs_core.Disposable {
|
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
//#endregion
|
|
81
|
-
//#region \0@oxc-project+runtime@0.
|
|
81
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/decorateParam.js
|
|
82
82
|
function __decorateParam(paramIndex, decorator) {
|
|
83
83
|
return function(target, key) {
|
|
84
84
|
decorator(target, key, paramIndex);
|
|
@@ -86,7 +86,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
//#endregion
|
|
89
|
-
//#region \0@oxc-project+runtime@0.
|
|
89
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/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);
|
|
@@ -173,7 +173,8 @@ let FBlob = _FBlob = class FBlob extends FBase {
|
|
|
173
173
|
return this;
|
|
174
174
|
}
|
|
175
175
|
setDataFromString(data, contentType) {
|
|
176
|
-
|
|
176
|
+
const blob = new Blob([data], { type: contentType !== null && contentType !== void 0 ? contentType : "text/plain" });
|
|
177
|
+
this._blob = blob;
|
|
177
178
|
return this;
|
|
178
179
|
}
|
|
179
180
|
/**
|
|
@@ -209,7 +210,7 @@ let FBlob = _FBlob = class FBlob extends FBase {
|
|
|
209
210
|
FBlob = _FBlob = __decorate([__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.Injector))], FBlob);
|
|
210
211
|
|
|
211
212
|
//#endregion
|
|
212
|
-
//#region \0@oxc-project+runtime@0.
|
|
213
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/typeof.js
|
|
213
214
|
function _typeof(o) {
|
|
214
215
|
"@babel/helpers - typeof";
|
|
215
216
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -220,7 +221,7 @@ function _typeof(o) {
|
|
|
220
221
|
}
|
|
221
222
|
|
|
222
223
|
//#endregion
|
|
223
|
-
//#region \0@oxc-project+runtime@0.
|
|
224
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/toPrimitive.js
|
|
224
225
|
function toPrimitive(t, r) {
|
|
225
226
|
if ("object" != _typeof(t) || !t) return t;
|
|
226
227
|
var e = t[Symbol.toPrimitive];
|
|
@@ -233,14 +234,14 @@ function toPrimitive(t, r) {
|
|
|
233
234
|
}
|
|
234
235
|
|
|
235
236
|
//#endregion
|
|
236
|
-
//#region \0@oxc-project+runtime@0.
|
|
237
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/toPropertyKey.js
|
|
237
238
|
function toPropertyKey(t) {
|
|
238
239
|
var i = toPrimitive(t, "string");
|
|
239
240
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
240
241
|
}
|
|
241
242
|
|
|
242
243
|
//#endregion
|
|
243
|
-
//#region \0@oxc-project+runtime@0.
|
|
244
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/defineProperty.js
|
|
244
245
|
function _defineProperty(e, r, t) {
|
|
245
246
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
246
247
|
value: t,
|