@univerjs/uniscript 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -2
- package/lib/types/commands/operations/panel.operation.d.ts +2 -16
- package/lib/types/controllers/menu.d.ts +3 -17
- package/lib/types/controllers/uniscript.controller.d.ts +3 -17
- package/lib/types/locale/en-US.d.ts +2 -16
- package/lib/types/plugin.d.ts +3 -17
- package/lib/types/services/command/batch-command.service.d.ts +3 -17
- package/lib/types/services/script-editor.service.d.ts +3 -17
- package/lib/types/services/script-execution.service.d.ts +2 -16
- package/lib/types/services/script-panel.service.d.ts +2 -16
- package/lib/types/views/components/ScriptEditorPanel.d.ts +2 -16
- package/package.json +14 -14
package/README.md
CHANGED
@@ -14,11 +14,11 @@
|
|
14
14
|
Users can write business logic in the code editor to meet more flexible business requirements. For instance, as shown in the illustration, users can write a Uniscript to read identity card numbers from a selected area and validate their legality, and mark the background of invalid identity card numbers with red.
|
15
15
|
|
16
16
|
:::caution
|
17
|
-
The Uniscript is currently in the experimental stage, and it is not recommended to use it in production environments. You can refer to the [Roadmap](https://univer.ai/
|
17
|
+
The Uniscript is currently in the experimental stage, and it is not recommended to use it in production environments. You can refer to the [Roadmap](https://univer.ai/guides/introduction/roadmap/) to understand the iteration plan of Uniscript.
|
18
18
|
:::
|
19
19
|
|
20
20
|
:::tip
|
21
|
-
Indeed, Uniscript's Domain-Specific Language (DSL) is a set of Facade APIs that encapsulate the internal implementation details of Univer. This API is defined [here](https://univer.ai/
|
21
|
+
Indeed, Uniscript's Domain-Specific Language (DSL) is a set of Facade APIs that encapsulate the internal implementation details of Univer. This API is defined [here](https://univer.ai/guides/facade/).
|
22
22
|
:::
|
23
23
|
|
24
24
|
## Usage
|
@@ -1,18 +1,4 @@
|
|
1
|
-
|
2
|
-
|
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
|
-
import type { IOperation } from '@univerjs/core';
|
1
|
+
import { IOperation } from '@univerjs/core';
|
2
|
+
|
17
3
|
export declare const ScriptPanelComponentName = "ScriptPanel";
|
18
4
|
export declare const ToggleScriptPanelOperation: IOperation;
|
@@ -1,18 +1,4 @@
|
|
1
|
-
|
2
|
-
|
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
|
-
import type { IMenuButtonItem } from '@univerjs/ui';
|
17
|
-
import type { IAccessor } from '@wendellhu/redi';
|
1
|
+
import { IAccessor } from '@wendellhu/redi';
|
2
|
+
import { IMenuButtonItem } from '@univerjs/ui';
|
3
|
+
|
18
4
|
export declare function UniscriptMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
@@ -1,21 +1,7 @@
|
|
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
|
-
import { Disposable, ICommandService } from '@univerjs/core';
|
17
|
-
import { ComponentManager, IMenuService } from '@univerjs/ui';
|
18
1
|
import { Injector } from '@wendellhu/redi';
|
2
|
+
import { ComponentManager, IMenuService } from '@univerjs/ui';
|
3
|
+
import { Disposable, ICommandService } from '@univerjs/core';
|
4
|
+
|
19
5
|
export declare class UniscriptController extends Disposable {
|
20
6
|
private readonly _injector;
|
21
7
|
constructor(_injector: Injector, menuService: IMenuService, commandService: ICommandService, componentManager: ComponentManager);
|
@@ -1,18 +1,4 @@
|
|
1
|
-
|
2
|
-
|
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
|
-
import type zhCN from './zh-CN';
|
1
|
+
import { default as zhCN } from './zh-CN';
|
2
|
+
|
17
3
|
declare const locale: typeof zhCN;
|
18
4
|
export default locale;
|
package/lib/types/plugin.d.ts
CHANGED
@@ -1,21 +1,7 @@
|
|
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
|
-
import { LocaleService, Plugin, PluginType } from '@univerjs/core';
|
1
|
+
import { IScriptEditorServiceConfig } from './services/script-editor.service';
|
17
2
|
import { Injector } from '@wendellhu/redi';
|
18
|
-
import
|
3
|
+
import { LocaleService, Plugin, PluginType } from '@univerjs/core';
|
4
|
+
|
19
5
|
export interface IUniscriptConfig extends IScriptEditorServiceConfig {
|
20
6
|
}
|
21
7
|
export declare class UniverUniscriptPlugin extends Plugin {
|
@@ -1,20 +1,6 @@
|
|
1
|
-
|
2
|
-
|
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
|
-
import type { CommandListener, ICommand, ICommandService, IExecutionOptions } from '@univerjs/core';
|
17
|
-
import type { IDisposable } from '@wendellhu/redi';
|
1
|
+
import { IDisposable } from '@wendellhu/redi';
|
2
|
+
import { CommandListener, ICommand, ICommandService, IExecutionOptions } from '@univerjs/core';
|
3
|
+
|
18
4
|
export declare class BatchCommandService implements ICommandService {
|
19
5
|
beforeCommandExecuted(listener: CommandListener): IDisposable;
|
20
6
|
registerCommand(command: ICommand<object, boolean>): IDisposable;
|
@@ -1,21 +1,7 @@
|
|
1
|
-
|
2
|
-
|
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
|
-
*/
|
1
|
+
import { editor } from 'monaco-editor';
|
2
|
+
import { IDisposable } from '@wendellhu/redi';
|
16
3
|
import { Disposable } from '@univerjs/core';
|
17
|
-
|
18
|
-
import type { editor } from 'monaco-editor';
|
4
|
+
|
19
5
|
export interface IScriptEditorServiceConfig {
|
20
6
|
getWorkerUrl(moduleID: string, label: string): string;
|
21
7
|
}
|
@@ -1,20 +1,6 @@
|
|
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
|
-
import { Disposable, ILogService } from '@univerjs/core';
|
17
1
|
import { Injector } from '@wendellhu/redi';
|
2
|
+
import { Disposable, ILogService } from '@univerjs/core';
|
3
|
+
|
18
4
|
/**
|
19
5
|
* This service is to
|
20
6
|
*/
|
@@ -1,22 +1,8 @@
|
|
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
1
|
import { Disposable } from '@univerjs/core';
|
2
|
+
|
17
3
|
export declare class ScriptPanelService extends Disposable {
|
18
4
|
private _open$;
|
19
|
-
open$: import(
|
5
|
+
open$: import('rxjs').Observable<boolean>;
|
20
6
|
get isOpen(): boolean;
|
21
7
|
dispose(): void;
|
22
8
|
open(): void;
|
@@ -1,17 +1,3 @@
|
|
1
|
-
|
2
|
-
|
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
|
-
import React from 'react';
|
1
|
+
import { default as React } from 'react';
|
2
|
+
|
17
3
|
export declare function ScriptEditorPanel(): React.JSX.Element;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@univerjs/uniscript",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.5",
|
4
4
|
"private": false,
|
5
5
|
"description": "UI component library for building exceptional Univer.",
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
@@ -57,26 +57,26 @@
|
|
57
57
|
"monaco-editor": ">=0.44.0",
|
58
58
|
"react": ">=16.9.0",
|
59
59
|
"rxjs": ">=7.0.0",
|
60
|
-
"@univerjs/
|
61
|
-
"@univerjs/
|
62
|
-
"@univerjs/facade": "0.1.
|
63
|
-
"@univerjs/ui": "0.1.
|
60
|
+
"@univerjs/core": "0.1.5",
|
61
|
+
"@univerjs/design": "0.1.5",
|
62
|
+
"@univerjs/facade": "0.1.5",
|
63
|
+
"@univerjs/ui": "0.1.5"
|
64
64
|
},
|
65
65
|
"devDependencies": {
|
66
|
-
"@types/react": "^18.2.
|
66
|
+
"@types/react": "^18.2.72",
|
67
67
|
"@wendellhu/redi": "^0.13.0",
|
68
68
|
"less": "^4.2.0",
|
69
69
|
"monaco-editor": "0.47.0",
|
70
70
|
"rxjs": "^7.8.1",
|
71
|
-
"typescript": "^5.4.
|
72
|
-
"vite": "^5.
|
71
|
+
"typescript": "^5.4.3",
|
72
|
+
"vite": "^5.2.6",
|
73
73
|
"vitest": "^1.4.0",
|
74
|
-
"@univerjs/
|
75
|
-
"@univerjs/
|
76
|
-
"@univerjs/
|
77
|
-
"@univerjs/
|
78
|
-
"@univerjs/ui": "0.1.
|
79
|
-
"@univerjs/
|
74
|
+
"@univerjs/core": "0.1.5",
|
75
|
+
"@univerjs/design": "0.1.5",
|
76
|
+
"@univerjs/sheets": "0.1.5",
|
77
|
+
"@univerjs/facade": "0.1.5",
|
78
|
+
"@univerjs/ui": "0.1.5",
|
79
|
+
"@univerjs/shared": "0.1.5"
|
80
80
|
},
|
81
81
|
"scripts": {
|
82
82
|
"test": "vitest run",
|