@univerjs/uniscript 0.1.3 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -2,21 +2,23 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@univerjs/uniscript)](https://npmjs.org/package/@univerjs/uniscript)
4
4
  [![license](https://img.shields.io/npm/l/@univerjs/uniscript)](https://img.shields.io/npm/l/@univerjs/uniscript)
5
+ ![CSS Included](https://img.shields.io/badge/CSS_Included-blue?logo=CSS3)
6
+ ![i18n](https://img.shields.io/badge/zh--CN%20%7C%20en--US-cornflowerblue?label=i18n)
5
7
 
6
8
  ## Introduction
7
9
 
8
- ![](./assets//uniscript.jpeg)
10
+ ![](./assets/uniscript.jpeg)
9
11
 
10
12
  `@univerjs/uniscript` uses the DSL (Domain-Specific Language) provided by `@univerjs/facade` and creates a code editor for Users to write code for operating Univer's data structures and business logic.
11
13
 
12
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.
13
15
 
14
16
  :::caution
15
- 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/en-us/guides/roadmap/) to understand the iteration plan of Uniscript.
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.
16
18
  :::
17
19
 
18
20
  :::tip
19
- 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/en-us/guides/facade/).
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/).
20
22
  :::
21
23
 
22
24
  ## Usage
@@ -1,18 +1,4 @@
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 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
- * 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 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
- * 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 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;
@@ -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 type { IScriptEditorServiceConfig } from './services/script-editor.service';
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
- * 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 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
- * 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
- */
1
+ import { editor } from 'monaco-editor';
2
+ import { IDisposable } from '@wendellhu/redi';
16
3
  import { Disposable } from '@univerjs/core';
17
- import type { IDisposable } from '@wendellhu/redi';
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("rxjs").Observable<boolean>;
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
- * 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 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",
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>",
@@ -17,7 +17,9 @@
17
17
  "bugs": {
18
18
  "url": "https://github.com/dream-num/univer/issues"
19
19
  },
20
- "keywords": [],
20
+ "keywords": [
21
+ "univer"
22
+ ],
21
23
  "sideEffects": [
22
24
  "**/*.css"
23
25
  ],
@@ -55,26 +57,26 @@
55
57
  "monaco-editor": ">=0.44.0",
56
58
  "react": ">=16.9.0",
57
59
  "rxjs": ">=7.0.0",
58
- "@univerjs/core": "0.1.3",
59
- "@univerjs/facade": "0.1.3",
60
- "@univerjs/design": "0.1.3",
61
- "@univerjs/ui": "0.1.3"
60
+ "@univerjs/core": "0.1.5",
61
+ "@univerjs/design": "0.1.5",
62
+ "@univerjs/facade": "0.1.5",
63
+ "@univerjs/ui": "0.1.5"
62
64
  },
63
65
  "devDependencies": {
64
- "@types/react": "^18.2.66",
66
+ "@types/react": "^18.2.72",
65
67
  "@wendellhu/redi": "^0.13.0",
66
68
  "less": "^4.2.0",
67
69
  "monaco-editor": "0.47.0",
68
70
  "rxjs": "^7.8.1",
69
- "typescript": "^5.4.2",
70
- "vite": "^5.1.6",
71
- "vitest": "^1.3.1",
72
- "@univerjs/core": "0.1.3",
73
- "@univerjs/design": "0.1.3",
74
- "@univerjs/facade": "0.1.3",
75
- "@univerjs/shared": "0.1.3",
76
- "@univerjs/sheets": "0.1.3",
77
- "@univerjs/ui": "0.1.3"
71
+ "typescript": "^5.4.3",
72
+ "vite": "^5.2.6",
73
+ "vitest": "^1.4.0",
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"
78
80
  },
79
81
  "scripts": {
80
82
  "test": "vitest run",