@univerjs/core 0.1.7 → 0.1.8
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/index.js +8 -8
- package/lib/es/index.js +4650 -4507
- package/lib/types/common/boolean.d.ts +16 -0
- package/lib/types/common/interceptor.d.ts +2 -2
- package/lib/types/common/number.d.ts +17 -0
- package/lib/types/{basics/index.d.ts → common/set.d.ts} +7 -5
- package/lib/types/common/type-util.d.ts +16 -0
- package/lib/types/common/unit.d.ts +9 -0
- package/lib/types/docs/data-model/document-data-model.d.ts +4 -1
- package/lib/types/index.d.ts +21 -9
- package/lib/types/services/command/command.service.d.ts +1 -0
- package/lib/types/services/floating-object/floating-object-manager.service.d.ts +1 -1
- package/lib/types/services/instance/instance.service.d.ts +71 -94
- package/lib/types/services/lifecycle/lifecycle.service.d.ts +2 -2
- package/lib/types/services/permission/permission.service.d.ts +0 -1
- package/lib/types/services/permission/univer.permission.service.d.ts +2 -2
- package/lib/types/services/plugin/plugin-holder.d.ts +25 -0
- package/lib/types/services/plugin/plugin-override.d.ts +8 -0
- package/lib/types/{plugin → services/plugin}/plugin.d.ts +11 -16
- package/lib/types/services/plugin/plugin.service.d.ts +24 -0
- package/lib/types/services/resource-loader/resource-loader.service.d.ts +14 -0
- package/lib/types/services/resource-loader/type.d.ts +7 -0
- package/lib/types/services/resource-manager/resource-manager.service.d.ts +11 -17
- package/lib/types/services/resource-manager/type.d.ts +15 -18
- package/lib/types/services/undoredo/undoredo.service.d.ts +2 -2
- package/lib/types/shared/__tests__/ref-alias.spec.d.ts +16 -0
- package/lib/types/shared/clipboard.d.ts +5 -0
- package/lib/types/shared/color/color.d.ts +1 -1
- package/lib/types/shared/index.d.ts +2 -0
- package/lib/types/shared/lifecycle.d.ts +8 -3
- package/lib/types/shared/range.d.ts +3 -0
- package/lib/types/sheets/__tests__/create-core-test-bed.d.ts +2 -2
- package/lib/types/sheets/column-manager.d.ts +1 -1
- package/lib/types/sheets/row-manager.d.ts +4 -2
- package/lib/types/sheets/view-model.d.ts +18 -10
- package/lib/types/sheets/workbook.d.ts +3 -2
- package/lib/types/sheets/worksheet.d.ts +33 -8
- package/lib/types/slides/{domain/slide-model.d.ts → slide-model.d.ts} +7 -5
- package/lib/types/types/enum/index.d.ts +0 -1
- package/lib/types/types/interfaces/i-cell-custom-render.d.ts +2 -0
- package/lib/types/types/interfaces/i-cell-data.d.ts +4 -0
- package/lib/types/types/interfaces/i-range.d.ts +3 -0
- package/lib/types/types/interfaces/i-style-data.d.ts +6 -0
- package/lib/types/types/interfaces/i-univer-data.d.ts +2 -13
- package/lib/types/univer.d.ts +43 -0
- package/lib/umd/index.js +9 -9
- package/package.json +8 -8
- package/lib/types/basics/plugin-holder.d.ts +0 -16
- package/lib/types/basics/univer-doc.d.ts +0 -16
- package/lib/types/basics/univer-sheet.d.ts +0 -16
- package/lib/types/basics/univer-slide.d.ts +0 -16
- package/lib/types/basics/univer.d.ts +0 -46
- package/lib/types/slides/domain/index.d.ts +0 -16
- package/lib/types/types/enum/condition-type.d.ts +0 -49
- /package/lib/types/{basics → common}/registry.d.ts +0 -0
- /package/lib/types/shared/{__test__ → __tests__}/common.spec.d.ts +0 -0
- /package/lib/types/shared/{__test__ → __tests__}/object-matrix.spec.d.ts +0 -0
- /package/lib/types/shared/{__test__/rectangle.spec.d.ts → __tests__/range.spec.d.ts} +0 -0
- /package/lib/types/shared/{__test__/ref-alias.spec.d.ts → __tests__/rectangle.spec.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Core library for Univer.",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -50,23 +50,23 @@
|
|
|
50
50
|
"npm": ">=8.0.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@wendellhu/redi": "0.13.
|
|
53
|
+
"@wendellhu/redi": "^0.13.3",
|
|
54
54
|
"rxjs": ">=7.0.0"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@univerjs/protocol": "^0.1.
|
|
58
|
-
"dayjs": "^1.11.10",
|
|
57
|
+
"@univerjs/protocol": "^0.1.20",
|
|
59
58
|
"nanoid": "5.0.7",
|
|
60
59
|
"numeral": "^2.0.6"
|
|
61
60
|
},
|
|
62
61
|
"devDependencies": {
|
|
63
62
|
"@types/numeral": "^2.0.5",
|
|
64
|
-
"@wendellhu/redi": "^0.13.
|
|
63
|
+
"@wendellhu/redi": "^0.13.3",
|
|
64
|
+
"dayjs": "^1.11.10",
|
|
65
65
|
"rxjs": "^7.8.1",
|
|
66
66
|
"typescript": "^5.4.5",
|
|
67
|
-
"vite": "^5.2.
|
|
68
|
-
"vitest": "^1.
|
|
69
|
-
"@univerjs/shared": "0.1.
|
|
67
|
+
"vite": "^5.2.10",
|
|
68
|
+
"vitest": "^1.5.0",
|
|
69
|
+
"@univerjs/shared": "0.1.8"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"test": "vitest run",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Disposable } from '../shared/lifecycle';
|
|
2
|
-
import { LifecycleInitializerService, LifecycleService } from '../services/lifecycle/lifecycle.service';
|
|
3
|
-
import { LifecycleStages } from '../services/lifecycle/lifecycle';
|
|
4
|
-
import { Plugin, PluginCtor } from '../plugin/plugin';
|
|
5
|
-
import { Injector } from '@wendellhu/redi';
|
|
6
|
-
|
|
7
|
-
export declare abstract class PluginHolder extends Disposable {
|
|
8
|
-
protected abstract get _lifecycleService(): LifecycleService;
|
|
9
|
-
protected abstract get _lifecycleInitializerService(): LifecycleInitializerService;
|
|
10
|
-
protected abstract get _injector(): Injector;
|
|
11
|
-
protected _started: boolean;
|
|
12
|
-
addPlugins(plugins: Array<[PluginCtor<any>, any]>): void;
|
|
13
|
-
protected _takePluginsThroughLifecycle(plugins: Plugin[], skipStarting?: boolean): void;
|
|
14
|
-
protected _pluginsRunLifecycle(plugins: Plugin[], lifecycle: LifecycleStages): void;
|
|
15
|
-
protected _initPlugin<T extends Plugin>(plugin: PluginCtor<T>, options: any): Plugin;
|
|
16
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { PluginHolder } from './plugin-holder';
|
|
2
|
-
import { IDocumentData } from '../types/interfaces/i-document-data';
|
|
3
|
-
import { LifecycleInitializerService, LifecycleService } from '../services/lifecycle/lifecycle.service';
|
|
4
|
-
import { DocumentDataModel } from '../docs/data-model/document-data-model';
|
|
5
|
-
import { Injector } from '@wendellhu/redi';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Externally provided UniverDoc root instance
|
|
9
|
-
*/
|
|
10
|
-
export declare class UniverDoc extends PluginHolder {
|
|
11
|
-
protected readonly _injector: Injector;
|
|
12
|
-
protected readonly _lifecycleService: LifecycleService;
|
|
13
|
-
protected readonly _lifecycleInitializerService: LifecycleInitializerService;
|
|
14
|
-
constructor(_injector: Injector, _lifecycleService: LifecycleService, _lifecycleInitializerService: LifecycleInitializerService);
|
|
15
|
-
createDoc(docData: Partial<IDocumentData>): DocumentDataModel;
|
|
16
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { PluginHolder } from './plugin-holder';
|
|
2
|
-
import { IWorkbookData } from '../types/interfaces/i-workbook-data';
|
|
3
|
-
import { Workbook } from '../sheets/workbook';
|
|
4
|
-
import { LifecycleInitializerService, LifecycleService } from '../services/lifecycle/lifecycle.service';
|
|
5
|
-
import { IDisposable, Injector } from '@wendellhu/redi';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Externally provided UniverSheet root instance
|
|
9
|
-
*/
|
|
10
|
-
export declare class UniverSheet extends PluginHolder implements IDisposable {
|
|
11
|
-
protected readonly _injector: Injector;
|
|
12
|
-
protected readonly _lifecycleService: LifecycleService;
|
|
13
|
-
protected readonly _lifecycleInitializerService: LifecycleInitializerService;
|
|
14
|
-
constructor(_injector: Injector, _lifecycleService: LifecycleService, _lifecycleInitializerService: LifecycleInitializerService);
|
|
15
|
-
createSheet(workbookConfig: Partial<IWorkbookData>): Workbook;
|
|
16
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { PluginHolder } from './plugin-holder';
|
|
2
|
-
import { ISlideData } from '../types/interfaces/i-slide-data';
|
|
3
|
-
import { SlideDataModel } from '../slides/domain/slide-model';
|
|
4
|
-
import { LifecycleInitializerService, LifecycleService } from '../services/lifecycle/lifecycle.service';
|
|
5
|
-
import { Injector } from '@wendellhu/redi';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Externally provided UniverSlide root instance
|
|
9
|
-
*/
|
|
10
|
-
export declare class UniverSlide extends PluginHolder {
|
|
11
|
-
protected readonly _injector: Injector;
|
|
12
|
-
protected readonly _lifecycleService: LifecycleService;
|
|
13
|
-
protected readonly _lifecycleInitializerService: LifecycleInitializerService;
|
|
14
|
-
constructor(_injector: Injector, _lifecycleService: LifecycleService, _lifecycleInitializerService: LifecycleInitializerService);
|
|
15
|
-
createSlide(data: Partial<ISlideData>): SlideDataModel;
|
|
16
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { PluginHolder } from './plugin-holder';
|
|
2
|
-
import { IDocumentData, ISlideData, IUniverData, IWorkbookData } from '../types/interfaces';
|
|
3
|
-
import { LocaleType } from '../types/enum/locale-type';
|
|
4
|
-
import { SlideDataModel } from '../slides/domain/slide-model';
|
|
5
|
-
import { Workbook } from '../sheets/workbook';
|
|
6
|
-
import { LifecycleInitializerService, LifecycleService } from '../services/lifecycle/lifecycle.service';
|
|
7
|
-
import { Plugin, PluginCtor } from '../plugin/plugin';
|
|
8
|
-
import { DocumentDataModel } from '../docs/data-model/document-data-model';
|
|
9
|
-
import { Injector } from '@wendellhu/redi';
|
|
10
|
-
|
|
11
|
-
export declare class Univer extends PluginHolder {
|
|
12
|
-
protected readonly _injector: Injector;
|
|
13
|
-
private readonly _univerPluginStore;
|
|
14
|
-
private readonly _univerPluginRegistry;
|
|
15
|
-
private _univerSheet;
|
|
16
|
-
private _univerDoc;
|
|
17
|
-
private _univerSlide;
|
|
18
|
-
private get _univerInstanceService();
|
|
19
|
-
protected get _lifecycleService(): LifecycleService;
|
|
20
|
-
protected get _lifecycleInitializerService(): LifecycleInitializerService;
|
|
21
|
-
constructor(univerData?: Partial<IUniverData>);
|
|
22
|
-
__getInjector(): Injector;
|
|
23
|
-
dispose(): void;
|
|
24
|
-
setLocale(locale: LocaleType): void;
|
|
25
|
-
/**
|
|
26
|
-
* Create a univer sheet instance with internal dependency injection.
|
|
27
|
-
*/
|
|
28
|
-
createUniverSheet(config: Partial<IWorkbookData>): Workbook;
|
|
29
|
-
createUniverDoc(config: Partial<IDocumentData>): DocumentDataModel;
|
|
30
|
-
createUniverSlide(config: Partial<ISlideData>): SlideDataModel;
|
|
31
|
-
private _initDependencies;
|
|
32
|
-
/**
|
|
33
|
-
* Initialize modules provided by Univer-type plugins.
|
|
34
|
-
*/
|
|
35
|
-
private _tryProgressToStart;
|
|
36
|
-
private _tryProgressToReady;
|
|
37
|
-
/** Register a plugin into univer. */
|
|
38
|
-
registerPlugin<T extends PluginCtor<Plugin>>(plugin: T, config?: ConstructorParameters<T>[0]): void;
|
|
39
|
-
private _initLazyPluginsTimer?;
|
|
40
|
-
private _scheduleInitPluginAfterStarted;
|
|
41
|
-
private _flushLazyPlugins;
|
|
42
|
-
private _registerUniverPlugin;
|
|
43
|
-
private _registerSheetsPlugin;
|
|
44
|
-
private _registerDocsPlugin;
|
|
45
|
-
private _registerSlidesPlugin;
|
|
46
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2023-present DreamNum Inc.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
export * from './slide-model';
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2023-present DreamNum Inc.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
export declare enum ConditionType {
|
|
17
|
-
CONDITION_TYPE_UNSPECIFIED = 0,// The default value, do not use.
|
|
18
|
-
NUMNUMBER_BETWEENR_GREATER = 1,// The cell's value must be greater than the condition's value. Supported by data validation, conditional formatting and filters. Requires a single ConditionValue
|
|
19
|
-
NUMBER_GREATER_THAN_EQ = 2,// The cell's value must be greater than or equal to the condition's value. Supported by data validation, conditional formatting and filters. Requires a single ConditionValue .
|
|
20
|
-
NUMBER_LESS = 3,// The cell's value must be less than the condition's value. Supported by data validation, conditional formatting and filters. Requires a single ConditionValue
|
|
21
|
-
NUMBER_LESS_THAN_EQ = 4,// The cell's value must be less than or equal to the condition's value. Supported by data validation, conditional formatting and filters. Requires a single ConditionValue .
|
|
22
|
-
NUMBER_EQ = 5,// The cell's value must be equal to the condition's value. Supported by data validation, conditional formatting and filters. Requires a single ConditionValue for data validation, conditional formatting, and filters on non-data source objects and at least one ConditionValue for filters on data source objects.
|
|
23
|
-
NUMBER_NOT_EQ = 6,// The cell's value must be not equal to the condition's value. Supported by data validation, conditional formatting and filters. Requires a single ConditionValue for data validation, conditional formatting, and filters on non-data source objects and at least one ConditionValue for filters on data source objects.
|
|
24
|
-
NUMBER_BETWEEN = 7,// The cell's value must be between the two condition values. Supported by data validation, conditional formatting and filters. Requires exactly two ConditionValues .
|
|
25
|
-
NUMBER_NOT_BETWEEN = 8,// The cell's value must not be between the two condition values. Supported by data validation, conditional formatting and filters. Requires exactly two ConditionValues .
|
|
26
|
-
TEXT_CONTAINS = 9,// The cell's value must contain the condition's value. Supported by data validation, conditional formatting and filters. Requires a single ConditionValue .
|
|
27
|
-
TEXT_NOT_CONTAINS = 10,// The cell's value must not contain the condition's value. Supported by data validation, conditional formatting and filters. Requires a single ConditionValue
|
|
28
|
-
TEXT_STARTS_WITH = 11,// The cell's value must start with the condition's value. Supported by conditional formatting and filters. Requires a single ConditionValue .
|
|
29
|
-
TEXT_ENDS_WITH = 12,// The cell's value must end with the condition's value. Supported by conditional formatting and filters. Requires a single ConditionValue .
|
|
30
|
-
TEXT_EQ = 13,// The cell's value must be exactly the condition's value. Supported by data validation, conditional formatting and filters. Requires a single ConditionValue for data validation, conditional formatting, and filters on non-data source objects and at least one ConditionValue for filters on data source objects.
|
|
31
|
-
TEXT_IS_EMAIL = 14,// The cell's value must be a valid email address. Supported by data validation. Requires no ConditionValues .
|
|
32
|
-
TEXT_IS_URL = 15,// The cell's value must be a valid URL. Supported by data validation. Requires no ConditionValues .
|
|
33
|
-
DATE_EQ = 16,// The cell's value must be the same date as the condition's value. Supported by data validation, conditional formatting and filters. Requires a single ConditionValue for data validation, conditional formatting, and filters on non-data source objects and at least one ConditionValue for filters on data source objects.
|
|
34
|
-
DATE_BEFORE = 17,// The cell's value must be before the date of the condition's value. Supported by data validation, conditional formatting and filters. Requires a single ConditionValue that may be a relative date .
|
|
35
|
-
DATE_AFTER = 18,// The cell's value must be after the date of the condition's value. Supported by data validation, conditional formatting and filters. Requires a single ConditionValue that may be a relative date .
|
|
36
|
-
DATE_ON_OR_BEFORE = 19,// The cell's value must be on or before the date of the condition's value. Supported by data validation. Requires a single ConditionValue that may be a relative date .
|
|
37
|
-
DATE_ON_OR_AFTER = 20,// The cell's value must be on or after the date of the condition's value. Supported by data validation. Requires a single ConditionValue that may be a relative date .
|
|
38
|
-
DATE_BETWEEN = 21,// The cell's value must be between the dates of the two condition values. Supported by data validation. Requires exactly two ConditionValues .
|
|
39
|
-
DATE_NOT_BETWEEN = 22,// The cell's value must be outside the dates of the two condition values. Supported by data validation. Requires exactly two ConditionValues .
|
|
40
|
-
DATE_IS_VALID = 23,// The cell's value must be a date. Supported by data validation. Requires no ConditionValues .
|
|
41
|
-
ONE_OF_RANGE = 24,// The cell's value must be listed in the grid in condition value's range. Supported by data validation. Requires a single ConditionValue , and the value must be a valid range in A1 notation.
|
|
42
|
-
ONE_OF_LIST = 25,// The cell's value must be in the list of condition values. Supported by data validation. Supports any number of condition values , one per item in the list. Formulas are not supported in the values.
|
|
43
|
-
BLANK = 26,// The cell's value must be empty. Supported by conditional formatting and filters. Requires no ConditionValues .
|
|
44
|
-
NOT_BLANK = 27,// The cell's value must not be empty. Supported by conditional formatting and filters. Requires no ConditionValues .
|
|
45
|
-
CUSTOM_FORMULA = 28,// The condition's formula must evaluate to true. Supported by data validation, conditional formatting and filters. Not supported by data source sheet filters. Requires a single ConditionValue .
|
|
46
|
-
BOOLEAN = 29,// The cell's value must be TRUE/FALSE or in the list of condition values. Supported by data validation. Renders as a cell checkbox. Supports zero, one or two ConditionValues . No values indicates the cell must be TRUE or FALSE, where TRUE renders as checked and FALSE renders as unchecked. One value indicates the cell will render as checked when it contains that value and unchecked when it is blank. Two values indicate that the cell will render as checked when it contains the first value and unchecked when it contains the second value. For example, ["Yes","No"] indicates that the cell will render a checked box when it has the value "Yes" and an unchecked box when it has the value "No".
|
|
47
|
-
TEXT_NOT_EQ = 30,// The cell's value must be exactly not the condition's value. Supported by filters on data source objects. Requires at least one ConditionValue .
|
|
48
|
-
DATE_NOT_EQ = 31
|
|
49
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|