@univerjs/uniscript 0.17.0 → 0.18.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/lib/cjs/index.js +1 -1
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/index.js +1 -237
- package/lib/es/locale/ca-ES.js +1 -20
- package/lib/es/locale/en-US.js +1 -20
- package/lib/es/locale/es-ES.js +1 -20
- package/lib/es/locale/fa-IR.js +1 -20
- package/lib/es/locale/fr-FR.js +1 -20
- package/lib/es/locale/ja-JP.js +1 -20
- package/lib/es/locale/ko-KR.js +1 -20
- package/lib/es/locale/ru-RU.js +1 -20
- package/lib/es/locale/sk-SK.js +1 -20
- package/lib/es/locale/vi-VN.js +1 -20
- package/lib/es/locale/zh-CN.js +1 -20
- package/lib/es/locale/zh-TW.js +1 -20
- package/lib/index.css +19 -1
- package/lib/index.js +1 -237
- package/lib/locale/ca-ES.js +1 -20
- package/lib/locale/en-US.js +1 -20
- package/lib/locale/es-ES.js +1 -20
- package/lib/locale/fa-IR.js +1 -20
- package/lib/locale/fr-FR.js +1 -20
- package/lib/locale/ja-JP.js +1 -20
- package/lib/locale/ko-KR.js +1 -20
- package/lib/locale/ru-RU.js +1 -20
- package/lib/locale/sk-SK.js +1 -20
- package/lib/locale/vi-VN.js +1 -20
- package/lib/locale/zh-CN.js +1 -20
- package/lib/locale/zh-TW.js +1 -20
- package/lib/types/commands/operations/panel.operation.d.ts +16 -1
- package/lib/types/config/config.d.ts +16 -1
- package/lib/types/controllers/uniscript.controller.d.ts +15 -0
- package/lib/types/locale/ca-ES.d.ts +16 -1
- package/lib/types/locale/es-ES.d.ts +16 -1
- package/lib/types/locale/fa-IR.d.ts +16 -1
- package/lib/types/locale/fr-FR.d.ts +16 -1
- package/lib/types/locale/ja-JP.d.ts +16 -1
- package/lib/types/locale/ko-KR.d.ts +16 -1
- package/lib/types/locale/ru-RU.d.ts +16 -1
- package/lib/types/locale/sk-SK.d.ts +16 -1
- package/lib/types/locale/vi-VN.d.ts +16 -1
- package/lib/types/locale/zh-CN.d.ts +16 -1
- package/lib/types/locale/zh-TW.d.ts +16 -1
- package/lib/types/menu/menu.d.ts +17 -2
- package/lib/types/menu/schema.d.ts +16 -1
- package/lib/types/plugin.d.ts +16 -1
- package/lib/types/services/script-editor.service.d.ts +18 -2
- package/lib/types/services/script-execution.service.d.ts +16 -1
- package/lib/types/services/script-panel.service.d.ts +16 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +11 -11
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 enUS from './en-US';
|
|
2
17
|
declare const locale: typeof enUS;
|
|
3
18
|
export default locale;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 enUS from './en-US';
|
|
2
17
|
declare const locale: typeof enUS;
|
|
3
18
|
export default locale;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 enUS from './en-US';
|
|
2
17
|
declare const locale: typeof enUS;
|
|
3
18
|
export default locale;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 enUS from './en-US';
|
|
2
17
|
declare const locale: typeof enUS;
|
|
3
18
|
export default locale;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 enUS from './en-US';
|
|
2
17
|
declare const locale: typeof enUS;
|
|
3
18
|
export default locale;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 enUS from './en-US';
|
|
2
17
|
declare const locale: typeof enUS;
|
|
3
18
|
export default locale;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 enUS from './en-US';
|
|
2
17
|
declare const locale: typeof enUS;
|
|
3
18
|
export default locale;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 enUS from './en-US';
|
|
2
17
|
declare const locale: typeof enUS;
|
|
3
18
|
export default locale;
|
package/lib/types/menu/menu.d.ts
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { IAccessor } from '@univerjs/core';
|
|
17
|
+
import type { IMenuButtonItem } from '@univerjs/ui';
|
|
3
18
|
export declare function UniscriptMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { MenuSchemaType } from '@univerjs/ui';
|
|
2
17
|
export declare const menuSchema: MenuSchemaType;
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { IUniverUniscriptConfig } from './config/config';
|
|
2
17
|
import { IConfigService, Injector, Plugin } from '@univerjs/core';
|
|
3
18
|
export declare class UniverUniscriptPlugin extends Plugin {
|
|
4
19
|
private readonly _config;
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { IDisposable } from '@univerjs/core';
|
|
17
|
+
import type { editor } from 'monaco-editor';
|
|
18
|
+
import { Disposable, IConfigService } from '@univerjs/core';
|
|
3
19
|
/**
|
|
4
20
|
* This service is for loading monaco editor and its resources. It also holds the
|
|
5
21
|
* monaco editor instance so user can interact with the editor programmatically.
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
16
|
import { Disposable, ILogService, Injector } from '@univerjs/core';
|
|
2
|
-
export declare const IUniscriptExecutionService: import(
|
|
17
|
+
export declare const IUniscriptExecutionService: import("@wendellhu/redi").IdentifierDecorator<IUniscriptExecutionService>;
|
|
3
18
|
export interface IUniscriptExecutionService {
|
|
4
19
|
execute(code: string): Promise<boolean>;
|
|
5
20
|
}
|
|
@@ -1,7 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
16
|
import { Disposable } from '@univerjs/core';
|
|
2
17
|
export declare class ScriptPanelService extends Disposable {
|
|
3
18
|
private _open$;
|
|
4
|
-
open$: import(
|
|
19
|
+
open$: import("rxjs").Observable<boolean>;
|
|
5
20
|
get isOpen(): boolean;
|
|
6
21
|
dispose(): void;
|
|
7
22
|
open(): void;
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@univerjs/core`),require(`@univerjs/ui`),require(`rxjs`),require(`@univerjs/sheets`),require(`@univerjs/sheets-ui`),require(`@univerjs/design`),require(`monaco-editor`),require(`react`),require(`@univerjs/core/facade`),require(`react/jsx-runtime`)):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`,`@univerjs/ui`,`rxjs`,`@univerjs/sheets`,`@univerjs/sheets-ui`,`@univerjs/design`,`monaco-editor`,`react`,`@univerjs/core/facade`,`react/jsx-runtime`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverUniscript={},e.UniverCore,e.UniverUi,e.rxjs,e.UniverSheets,e.UniverSheetsUi,e.UniverDesign,e.monaco,e.React,e.UniverCoreFacade,e.React))})(this,function(e,t,n,r,i,a,o,s,c,l,u){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function d(e){"@babel/helpers - typeof";return d=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},d(e)}function f(e,t){if(d(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(d(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function p(e){var t=f(e,`string`);return d(t)==`symbol`?t:t+``}function m(e,t,n){return(t=p(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h=class extends t.Disposable{constructor(...e){super(...e),m(this,`_open$`,new r.BehaviorSubject(!1)),m(this,`open$`,this._open$.pipe((0,r.distinctUntilChanged)()))}get isOpen(){return this._open$.getValue()}dispose(){super.dispose(),this._open$.next(!1),this._open$.complete()}open(){this._open$.next(!0)}close(){this._open$.next(!1)}};let g=`ScriptPanel`,_={type:t.CommandType.OPERATION,id:`univer.operation.toggle-script-panel`,handler:e=>{let t=e.get(h),r=e.get(n.ISidebarService);return t.isOpen?(t.close(),r.close()):(t.open(),r.open({header:{title:`script-panel.title`},children:{label:g},width:600})),!0}};var v=`@univerjs/uniscript`,y=`0.18.0`;let b=`uniscript.config`;Symbol(b);let x={};function S(e){return{id:_.id,title:`toggle-script-panel`,tooltip:`script-panel.tooltip.menu-button`,icon:`CodeIcon`,type:n.MenuItemType.BUTTON,hidden$:(0,n.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET),disabled$:(0,a.getCurrentRangeDisable$)(e,{workbookTypes:[i.WorkbookEditablePermission],worksheetTypes:[i.WorksheetEditPermission,i.WorksheetSetCellStylePermission,i.WorksheetSetCellValuePermission],rangeTypes:[i.RangeProtectionPermissionEditPoint]})}}let C={[n.RibbonOthersGroup.OTHERS]:{[_.id]:{order:0,menuItemFactory:S}}};function w(e,t){return function(n,r){t(n,r,e)}}function T(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let E=class extends t.Disposable{constructor(e){super(),this._configService=e,m(this,`_editorInstance`,null)}dispose(){super.dispose(),this._editorInstance&&this._editorInstance.dispose()}setEditorInstance(e){return this._editorInstance=e,(0,t.toDisposable)(()=>this._editorInstance=null)}getEditorInstance(){return this._editorInstance}requireVscodeEditor(){if(!window.MonacoEnvironment){let e=this._configService.getConfig(b);window.MonacoEnvironment={getWorkerUrl:e==null?void 0:e.getWorkerUrl}}}};E=T([w(0,t.IConfigService)],E);let D=(0,t.createIdentifier)(`univer.uniscript.execution-service`),O=class extends t.Disposable{constructor(e,t){super(),this._logService=e,this._injector=t}async execute(e){this._logService.log(`[UniscriptExecutionService]`,`executing Uniscript...`);let t=l.FUniver.newAPI(this._injector),n=Function(`univerAPI`,`(() => {${e}})()`);try{return n(t),!0}catch(e){return this._logService.error(e),!1}}};O=T([w(0,t.ILogService),w(1,(0,t.Inject)(t.Injector))],O);function k(){let e=(0,c.useRef)(null),r=(0,c.useRef)(null),i=(0,c.useRef)(null),a=(0,n.useDependency)(t.LocaleService),l=(0,n.useDependency)(n.IShortcutService),d=(0,n.useDependency)(E),f=(0,n.useDependency)(t.ThemeService);(0,c.useEffect)(()=>{let n=r.current,a=e.current,o=null,c=null;if(n&&a){d.requireVscodeEditor();let e=i.current=s.editor.create(n,{value:``,language:`javascript`,theme:f.darkMode?`vs-dark`:`vs-light`});c=new ResizeObserver(()=>{let t=requestIdleCallback(()=>{if(!t)return;let{height:n,width:r}=a.getBoundingClientRect();e.layout({width:r,height:n}),t=void 0})}),c.observe(a);let r;o=new t.DisposableCollection,o.add(d.setEditorInstance(e)),o.add(e.onDidFocusEditorWidget(()=>{r=l.forceEscape()})),o.add(e.onDidBlurEditorWidget(()=>{r==null||r.dispose(),r=void 0})),o.add((0,t.toDisposable)(()=>r==null?void 0:r.dispose()))}return()=>{c&&a&&c.unobserve(a),o==null||o.dispose()}},[d,l]);let p=A(i);return(0,u.jsxs)(`div`,{className:`univer-h-full`,children:[(0,u.jsx)(`div`,{ref:e,className:`univer-h-[calc(100%-60px)] univer-w-full univer-overflow-hidden`,children:(0,u.jsx)(`div`,{ref:r})}),(0,u.jsx)(`div`,{className:`univer-mt-2.5`,children:(0,u.jsx)(o.Button,{variant:`primary`,onClick:p,children:a.t(`script-panel.panel.execute`)})})]})}function A(e){let r=(0,n.useDependency)(D),i=(0,n.useDependency)(n.IMessageService),a=(0,n.useDependency)(t.LocaleService);return(0,c.useCallback)(()=>{var t;let n=(t=e.current)==null?void 0:t.getModel();n&&r.execute(n.getValue()).then(()=>{i.show({content:a.t(`uniscript.message.success`),type:o.MessageType.Success})}).catch(()=>{i.show({content:a.t(`uniscript.message.failed`),type:o.MessageType.Error})})},[a,i,e,r])}let j=class extends t.Disposable{constructor(e,t,n){super(),this._menuManagerService=e,this._menuManagerService.mergeMenu(C),this.disposeWithMe(n.register(g,k)),this.disposeWithMe(t.registerCommand(_))}};j=T([w(0,n.IMenuManagerService),w(1,t.ICommandService),w(2,(0,t.Inject)(n.ComponentManager))],j);let M=class extends t.Plugin{constructor(e=x,n,r){super(),this._config=e,this._injector=n,this._configService=r;let{menu:i,...a}=(0,t.merge)({},x,this._config);i&&this._configService.setConfig(`menu`,i,{merge:!0}),this._configService.setConfig(b,a)}onStarting(){let e=this._injector;[[j],[E],[h]].forEach(t=>e.add(t)),this.registerExecution()}onSteady(){this._injector.get(j)}registerExecution(){this._injector.add([D,{useClass:O}])}};m(M,`pluginName`,`UNIVER_UNISCRIPT_PLUGIN`),m(M,`packageName`,v),m(M,`version`,y),M=T([w(1,(0,t.Inject)(t.Injector)),w(2,t.IConfigService)],M),e.IUniscriptExecutionService=D,Object.defineProperty(e,`ScriptEditorService`,{enumerable:!0,get:function(){return E}}),e.ToggleScriptPanelOperation=_,Object.defineProperty(e,`UniverUniscriptPlugin`,{enumerable:!0,get:function(){return M}})});
|
package/lib/umd/locale/ca-ES.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverUniscriptCaES=t())})(this,function(){return{"script-panel":{title:`Uniscript`,tooltip:{"menu-button":`Mostra/Oculta el panell Uniscript`},panel:{execute:`Executa l'script`}},uniscript:{message:{success:`Execució correcta`,failed:`Execució fallida`}}}});
|
package/lib/umd/locale/en-US.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverUniscriptEnUS=t())})(this,function(){return{"script-panel":{title:`Uniscript`,tooltip:{"menu-button":`Toggle Uniscript Panel`},panel:{execute:`Execute Script`}},uniscript:{message:{success:`Execution Success`,failed:`Execution Failed`}}}});
|
package/lib/umd/locale/es-ES.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverUniscriptEsES=t())})(this,function(){return{"script-panel":{title:`Uniscript`,tooltip:{"menu-button":`Mostrar/Ocultar panel de Uniscript`},panel:{execute:`Ejecutar script`}},uniscript:{message:{success:`Ejecución exitosa`,failed:`Ejecución fallida`}}}});
|
package/lib/umd/locale/fa-IR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverUniscriptFaIR=t())})(this,function(){return{"script-panel":{title:`Uniscript`,tooltip:{"menu-button":`نمایش/مخفی کردن پنل Uniscript`},panel:{execute:`اجرای اسکریپت`}},uniscript:{message:{success:`اجرای موفق`,failed:`اجرای ناموفق`}}}});
|
package/lib/umd/locale/fr-FR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverUniscriptFrFR=t())})(this,function(){return{"script-panel":{title:`Uniscript`,tooltip:{"menu-button":`Basculer le panneau Uniscript`},panel:{execute:`Exécuter le script`}},uniscript:{message:{success:`Exécution réussie`,failed:`Échec de l'exécution`}}}});
|
package/lib/umd/locale/ja-JP.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverUniscriptJaJP=t())})(this,function(){return{"script-panel":{title:`Uniscript`,tooltip:{"menu-button":`Uniscriptパネルを切り替え`},panel:{execute:`スクリプトを実行`}},uniscript:{message:{success:`実行に成功しました`,failed:`実行に失敗しました`}}}});
|
package/lib/umd/locale/ko-KR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverUniscriptKoKR=t())})(this,function(){return{"script-panel":{title:`Uniscript`,tooltip:{"menu-button":`Uniscript 패널 전환`},panel:{execute:`스크립트 실행`}},uniscript:{message:{success:`실행 성공`,failed:`실행 실패`}}}});
|
package/lib/umd/locale/ru-RU.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverUniscriptRuRU=t())})(this,function(){return{"script-panel":{title:`Юнискрипт`,tooltip:{"menu-button":`Переключить панель Юнискрипт`},panel:{execute:`Выполнить скрипт`}},uniscript:{message:{success:`Выполнение успешно`,failed:`Выполнение не удалось`}}}});
|
package/lib/umd/locale/sk-SK.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverUniscriptSkSK=t())})(this,function(){return{"script-panel":{title:`Uniscript`,tooltip:{"menu-button":`Prepnúť panel Uniscript`},panel:{execute:`Spustiť skript`}},uniscript:{message:{success:`Spustenie úspešné`,failed:`Spustenie zlyhalo`}}}});
|
package/lib/umd/locale/vi-VN.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverUniscriptViVN=t())})(this,function(){return{"script-panel":{title:`Uniscript`,tooltip:{"menu-button":`Mở/Thu gọn bảng điều khiển Uniscript`},panel:{execute:`Thực thi Uniscript`}},uniscript:{message:{success:`Thực thi thành công`,failed:`Thực thi thất bại`}}}});
|
package/lib/umd/locale/zh-CN.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverUniscriptZhCN=t())})(this,function(){return{"script-panel":{title:`Uniscript`,tooltip:{"menu-button":`打开收起 Uniscript 面板`},panel:{execute:`执行 Uniscript`}},uniscript:{message:{success:`执行成功`,failed:`执行失败`}}}});
|
package/lib/umd/locale/zh-TW.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverUniscriptZhTW=t())})(this,function(){return{"script-panel":{title:`Uniscript`,tooltip:{"menu-button":`打開收起 Uniscript 面板`},panel:{execute:`執行 Uniscript`}},uniscript:{message:{success:`執行成功`,failed:`執行失敗`}}}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/uniscript",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "UI component library for building exceptional Univer.",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -50,17 +50,16 @@
|
|
|
50
50
|
"lib"
|
|
51
51
|
],
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"monaco-editor": ">=0.50.0",
|
|
54
53
|
"react": "^16.9.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
55
54
|
"rxjs": ">=7.0.0"
|
|
56
55
|
},
|
|
57
56
|
"dependencies": {
|
|
58
57
|
"monaco-editor": "0.55.1",
|
|
59
|
-
"@univerjs/design": "0.
|
|
60
|
-
"@univerjs/sheets
|
|
61
|
-
"@univerjs/core": "0.
|
|
62
|
-
"@univerjs/ui": "0.
|
|
63
|
-
"@univerjs/sheets": "0.
|
|
58
|
+
"@univerjs/design": "0.18.0",
|
|
59
|
+
"@univerjs/sheets": "0.18.0",
|
|
60
|
+
"@univerjs/core": "0.18.0",
|
|
61
|
+
"@univerjs/ui": "0.18.0",
|
|
62
|
+
"@univerjs/sheets-ui": "0.18.0"
|
|
64
63
|
},
|
|
65
64
|
"devDependencies": {
|
|
66
65
|
"postcss": "^8.5.8",
|
|
@@ -68,16 +67,17 @@
|
|
|
68
67
|
"rxjs": "^7.8.2",
|
|
69
68
|
"tailwindcss": "3.4.18",
|
|
70
69
|
"typescript": "^5.9.3",
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"@univerjs-infra/shared": "0.17.0"
|
|
70
|
+
"vitest": "^4.1.0",
|
|
71
|
+
"@univerjs-infra/shared": "0.18.0"
|
|
74
72
|
},
|
|
75
73
|
"scripts": {
|
|
76
74
|
"test": "vitest run",
|
|
77
75
|
"test:watch": "vitest",
|
|
78
76
|
"coverage": "vitest run --coverage",
|
|
79
77
|
"typecheck": "tsc --noEmit",
|
|
80
|
-
"build": "univer-cli build"
|
|
78
|
+
"build:bundle": "univer-cli build",
|
|
79
|
+
"build:types": "tsc -p tsconfig.node.json",
|
|
80
|
+
"build": "pnpm run build:bundle && pnpm run build:types"
|
|
81
81
|
},
|
|
82
82
|
"module": "./lib/es/index.js"
|
|
83
83
|
}
|