@univerjs/uniscript 0.1.0-alpha.1 → 0.1.0-alpha.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. package/LICENSE.txt +178 -0
  2. package/README.md +1 -5
  3. package/lib/cjs/index.js +9 -863
  4. package/lib/es/index.js +366 -0
  5. package/lib/index.css +1 -9
  6. package/lib/types/commands/operations/panel.operation.d.ts +15 -1
  7. package/lib/types/controllers/menu.d.ts +15 -1
  8. package/lib/types/controllers/uniscript.controller.d.ts +15 -1
  9. package/lib/types/facade/facade.d.ts +15 -1
  10. package/lib/types/facade/sheet/f-range.d.ts +15 -1
  11. package/lib/types/facade/sheet/f-selection.d.ts +15 -1
  12. package/lib/types/facade/sheet/f-workbook.d.ts +15 -1
  13. package/lib/types/facade/sheet/f-worksheet.d.ts +16 -2
  14. package/lib/types/index.d.ts +17 -2
  15. package/lib/types/locale/en-US.d.ts +15 -1
  16. package/lib/types/locale/index.d.ts +15 -1
  17. package/lib/types/locale/zh-CN.d.ts +26 -2
  18. package/lib/types/plugin.d.ts +18 -4
  19. package/lib/types/services/command/batch-command.service.d.ts +16 -1
  20. package/lib/types/services/script-editor.service.d.ts +15 -1
  21. package/lib/types/services/script-execution.service.d.ts +15 -1
  22. package/lib/types/services/script-panel.service.d.ts +15 -1
  23. package/lib/types/views/components/ScriptEditorPanel.d.ts +15 -1
  24. package/lib/umd/index.js +9 -0
  25. package/package.json +35 -28
  26. package/LICENSE +0 -21
  27. package/lib/cjs/locale/en-US.js +0 -36
  28. package/lib/cjs/locale/zh-CN.js +0 -26
  29. package/lib/esm/index.js +0 -855
  30. package/lib/esm/locale/en-US.js +0 -15
  31. package/lib/esm/locale/zh-CN.js +0 -5
  32. package/lib/types/commands/operations/panel.operation.d.ts.map +0 -1
  33. package/lib/types/controllers/menu.d.ts.map +0 -1
  34. package/lib/types/controllers/uniscript.controller.d.ts.map +0 -1
  35. package/lib/types/facade/facade.d.ts.map +0 -1
  36. package/lib/types/facade/sheet/f-range.d.ts.map +0 -1
  37. package/lib/types/facade/sheet/f-selection.d.ts.map +0 -1
  38. package/lib/types/facade/sheet/f-workbook.d.ts.map +0 -1
  39. package/lib/types/facade/sheet/f-worksheet.d.ts.map +0 -1
  40. package/lib/types/index.d.ts.map +0 -1
  41. package/lib/types/locale/en-US.d.ts.map +0 -1
  42. package/lib/types/locale/index.d.ts.map +0 -1
  43. package/lib/types/locale/zh-CN.d.ts.map +0 -1
  44. package/lib/types/models/model.d.ts +0 -1
  45. package/lib/types/models/model.d.ts.map +0 -1
  46. package/lib/types/plugin.d.ts.map +0 -1
  47. package/lib/types/services/command/batch-command.service.d.ts.map +0 -1
  48. package/lib/types/services/script-editor.service.d.ts.map +0 -1
  49. package/lib/types/services/script-execution.service.d.ts.map +0 -1
  50. package/lib/types/services/script-panel.service.d.ts.map +0 -1
  51. package/lib/types/views/components/ScriptEditorPanel.d.ts.map +0 -1
  52. package/lib/types/views/parts/render.part.d.ts +0 -1
  53. package/lib/types/views/parts/render.part.d.ts.map +0 -1
@@ -1,14 +1,28 @@
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
16
  import { LocaleService, Plugin, PluginType } from '@univerjs/core';
2
17
  import { Injector } from '@wendellhu/redi';
3
18
  import type { IScriptEditorServiceConfig } from './services/script-editor.service';
4
- export interface IUniscriptPluginConfig extends IScriptEditorServiceConfig {
19
+ export interface IUniscriptConfig extends IScriptEditorServiceConfig {
5
20
  }
6
- export declare class UniscriptPlugin extends Plugin {
21
+ export declare class UniverUniscriptPlugin extends Plugin {
7
22
  private readonly _config;
8
23
  protected _injector: Injector;
9
24
  private readonly _localeService;
10
25
  static type: PluginType;
11
- constructor(_config: IUniscriptPluginConfig, _injector: Injector, _localeService: LocaleService);
26
+ constructor(_config: IUniscriptConfig, _injector: Injector, _localeService: LocaleService);
12
27
  onStarting(injector: Injector): void;
13
28
  }
14
- //# sourceMappingURL=plugin.d.ts.map
@@ -1,10 +1,25 @@
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
16
  import type { CommandListener, ICommand, ICommandService, IExecutionOptions } from '@univerjs/core';
2
17
  import type { IDisposable } from '@wendellhu/redi';
3
18
  export declare class BatchCommandService implements ICommandService {
19
+ beforeCommandExecuted(listener: CommandListener): IDisposable;
4
20
  registerCommand(command: ICommand<object, boolean>): IDisposable;
5
21
  registerAsMultipleCommand(command: ICommand<object, boolean>): IDisposable;
6
22
  executeCommand<P extends object = object, R = boolean>(id: string, params?: P | undefined, options?: IExecutionOptions | undefined): Promise<R>;
7
23
  syncExecuteCommand<P extends object = object, R = boolean>(id: string, params?: P | undefined, options?: IExecutionOptions | undefined): R;
8
24
  onCommandExecuted(listener: CommandListener): IDisposable;
9
25
  }
10
- //# sourceMappingURL=batch-command.service.d.ts.map
@@ -1,3 +1,18 @@
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
16
  import { Disposable } from '@univerjs/core';
2
17
  export interface IScriptEditorServiceConfig {
3
18
  getWorkerUrl(moduleID: string, label: string): string;
@@ -10,4 +25,3 @@ export declare class ScriptEditorService extends Disposable {
10
25
  constructor(_config: IScriptEditorServiceConfig);
11
26
  requireVscodeEditor(): void;
12
27
  }
13
- //# sourceMappingURL=script-editor.service.d.ts.map
@@ -1,3 +1,18 @@
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
16
  import { Disposable, ILogService } from '@univerjs/core';
2
17
  import { Injector } from '@wendellhu/redi';
3
18
  /**
@@ -9,4 +24,3 @@ export declare class UniscriptExecutionService extends Disposable {
9
24
  constructor(_logService: ILogService, _injector: Injector);
10
25
  execute(code: string): Promise<boolean>;
11
26
  }
12
- //# sourceMappingURL=script-execution.service.d.ts.map
@@ -1,3 +1,18 @@
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
16
  import { Disposable } from '@univerjs/core';
2
17
  export declare class ScriptPanelService extends Disposable {
3
18
  private _open$;
@@ -7,4 +22,3 @@ export declare class ScriptPanelService extends Disposable {
7
22
  open(): void;
8
23
  close(): void;
9
24
  }
10
- //# sourceMappingURL=script-panel.service.d.ts.map
@@ -1,3 +1,17 @@
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
16
  import React from 'react';
2
17
  export declare function ScriptEditorPanel(): React.JSX.Element;
3
- //# sourceMappingURL=ScriptEditorPanel.d.ts.map
@@ -0,0 +1,9 @@
1
+ (function(a,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("@univerjs/core"),require("@wendellhu/redi"),require("@univerjs/ui"),require("rxjs"),require("react"),require("@univerjs/design"),require("@wendellhu/redi/react-bindings"),require("monaco-editor"),require("@univerjs/sheets")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@wendellhu/redi","@univerjs/ui","rxjs","react","@univerjs/design","@wendellhu/redi/react-bindings","monaco-editor","@univerjs/sheets"],c):(a=typeof globalThis<"u"?globalThis:a||self,c(a.UniverUniscript={},a.UniverCore,a["@wendellhu/redi"],a.UniverUi,a.rxjs,a.React,a.UniverDesign,a["@wendellhu/redi/react-bindings"],a.monaco,a.UniverSheets))})(this,function(a,c,l,v,M,h,C,d,Y,T){"use strict";var Te=Object.defineProperty;var Ne=(a,c,l)=>c in a?Te(a,c,{enumerable:!0,configurable:!0,writable:!0,value:l}):a[c]=l;var b=(a,c,l)=>(Ne(a,typeof c!="symbol"?c+"":c,l),l);var R;const K={"script-panel":{title:"Uniscript",tooltip:{"menu-button":"Toggle Uniscript Panel"},panel:{execute:"Execute Script"}}},N={"script-panel":{title:"Uniscript",tooltip:{"menu-button":"打开收起 Uniscript 面板"},panel:{execute:"执行 Uniscript"}}};class A extends c.Disposable{constructor(){super(...arguments);b(this,"_open$",new M.BehaviorSubject(!1));b(this,"open$",this._open$.pipe(M.distinctUntilChanged()))}get isOpen(){return this._open$.getValue()}dispose(){this._open$.next(!1),this._open$.complete()}open(){this._open$.next(!0)}close(){this._open$.next(!1)}}const F="ScriptPanel",W={type:c.CommandType.OPERATION,id:"univer.operation.toggle-script-panel",handler:t=>{const e=t.get(A),i=t.get(v.ISidebarService);return e.isOpen?(e.close(),i.close()):(e.open(),i.open({header:{title:"script-panel.title"},children:{label:F},width:600})),!0}};var L={exports:{}},m={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Q=h,X=Symbol.for("react.element"),Z=Symbol.for("react.fragment"),ee=Object.prototype.hasOwnProperty,te=Q.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,re={key:!0,ref:!0,__self:!0,__source:!0};function q(t,e,i){var r,n={},s=null,o=null;i!==void 0&&(s=""+i),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)ee.call(e,r)&&!re.hasOwnProperty(r)&&(n[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)n[r]===void 0&&(n[r]=e[r]);return{$$typeof:X,type:t,key:s,ref:o,props:n,_owner:te.current}}m.Fragment=Z,m.jsx=q,m.jsxs=q,L.exports=m;var f=L.exports;class y extends c.Disposable{constructor(e){super(),this._config=e}requireVscodeEditor(){window.MonacoEnvironment||(window.MonacoEnvironment={getWorkerUrl:this._config.getWorkerUrl})}}var ne=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,se=(t,e,i,r)=>{for(var n=r>1?void 0:r?ie(e,i):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(r?o(e,i,n):o(n))||n);return r&&n&&ne(e,i,n),n},z=(t,e)=>(i,r)=>e(i,r,t);let S=class{constructor(t,e,i,r,n){this._workbook=t,this._worksheet=e,this._range=i,this._injector=r,this._commandService=n}getRow(){return this._range.startRow}getColumn(){return this._range.startColumn}getWidth(){return this._range.endColumn-this._range.startColumn+1}getHeight(){return this._range.endRow-this._range.startRow+1}getValue(){var t;return((t=this._worksheet.getCell(this._range.startRow,this._range.startColumn))==null?void 0:t.v)??null}setBackgroundColor(t){this._commandService.executeCommand(T.SetStyleCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),range:this._range,style:{type:"bg",value:{rgb:t}}})}};S=se([z(3,l.Inject(l.Injector)),z(4,c.ICommandService)],S);var oe=Object.defineProperty,ce=Object.getOwnPropertyDescriptor,ae=(t,e,i,r)=>{for(var n=r>1?void 0:r?ce(e,i):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(r?o(e,i,n):o(n))||n);return r&&n&&oe(e,i,n),n},le=(t,e)=>(i,r)=>e(i,r,t);let E=class{constructor(t,e,i,r){this._workbook=t,this._worksheet=e,this._selections=i,this._injector=r}getActiveRange(){const t=this._selections.find(e=>!!e.primary);return t?this._injector.createInstance(S,this._workbook,this._worksheet,t.range):null}};E=ae([le(3,l.Inject(l.Injector))],E);var ue=Object.defineProperty,pe=Object.getOwnPropertyDescriptor,ve=(t,e,i,r)=>{for(var n=r>1?void 0:r?pe(e,i):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(r?o(e,i,n):o(n))||n);return r&&n&&ue(e,i,n),n},V=(t,e)=>(i,r)=>e(i,r,t);let U=class{constructor(t,e,i,r){this._workbook=t,this._worksheet=e,this._injector=i,this._selectionManagerService=r}getSelection(){const t=this._selectionManagerService.getSelections();return t?this._injector.createInstance(E,this._workbook,this._worksheet,t):null}getRange(t,e,i,r){const n={startRow:t,endRow:t+(i??1)-1,startColumn:e,endColumn:e+(r??1)-1};return this._injector.createInstance(S,this._workbook,this._worksheet,n)}};U=ve([V(2,l.Inject(l.Injector)),V(3,l.Inject(T.SelectionManagerService))],U);var _e=Object.defineProperty,he=Object.getOwnPropertyDescriptor,de=(t,e,i,r)=>{for(var n=r>1?void 0:r?he(e,i):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(r?o(e,i,n):o(n))||n);return r&&n&&_e(e,i,n),n},fe=(t,e)=>(i,r)=>e(i,r,t);let x=class{constructor(t,e){this._workbook=t,this._injector=e}getActiveSheet(){const t=this._workbook.getActiveSheet();return t?this._injector.createInstance(U,this._workbook,t):null}};x=de([fe(1,l.Inject(l.Injector))],x);var ge=Object.defineProperty,me=Object.getOwnPropertyDescriptor,Se=(t,e,i,r)=>{for(var n=r>1?void 0:r?me(e,i):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(r?o(e,i,n):o(n))||n);return r&&n&&ge(e,i,n),n},k=(t,e)=>(i,r)=>e(i,r,t);let j=class{constructor(t,e){this._injector=t,this._univerInstanceService=e}static newInstance(t){return t.createInstance(j)}getCurrentSheet(){const t=this._univerInstanceService.getCurrentUniverSheetInstance();return t?this._injector.createInstance(x,t):null}};j=Se([k(0,l.Inject(l.Injector)),k(1,c.IUniverInstanceService)],j);var je=Object.defineProperty,we=Object.getOwnPropertyDescriptor,Pe=(t,e,i,r)=>{for(var n=r>1?void 0:r?we(e,i):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(r?o(e,i,n):o(n))||n);return r&&n&&je(e,i,n),n},B=(t,e)=>(i,r)=>e(i,r,t);let w=class extends c.Disposable{constructor(t,e){super(),this._logService=t,this._injector=e}async execute(t){this._logService.log("[UniscriptExecutionService]","executing Uniscript...");const e=j.newInstance(this._injector),i=new Function("Univer",`(() => {${t}})()`);try{return i(e),!0}catch(r){return this._logService.error(r),!1}}};w=Pe([B(0,c.ILogService),B(1,l.Inject(l.Injector))],w);const P={scriptEditorPanel:"univer-script-editor-panel",scriptEditorContent:"univer-script-editor-content",scriptEditorActions:"univer-script-editor-actions"};function Oe(){const t=h.useRef(null),e=h.useRef(null),i=h.useRef(null),r=d.useDependency(c.LocaleService),n=d.useDependency(w),s=d.useDependency(v.IShortcutService),o=d.useDependency(y),H=d.useDependency(v.IMessageService);h.useEffect(()=>{const g=e.current,u=t.current;let _=null,I=null;if(g&&u){o.requireVscodeEditor();const $=i.current=Y.editor.create(g,{value:"",language:"javascript"});I=new ResizeObserver(()=>{let J=requestIdleCallback(()=>{if(!J)return;const{height:$e,width:Me}=u.getBoundingClientRect();$.layout({width:Me,height:$e}),J=void 0})}),I.observe(u);let p;_=new c.DisposableCollection,_.add($.onDidFocusEditorWidget(()=>{p=s.forceEscape()})),_.add($.onDidBlurEditorWidget(()=>{p==null||p.dispose(),p=void 0})),_.add(c.toDisposable(()=>p==null?void 0:p.dispose()))}return()=>{I&&u&&I.unobserve(u),_==null||_.dispose()}},[]);const Re=h.useCallback(()=>{var u;const g=(u=i.current)==null?void 0:u.getModel();g&&n.execute(g.getValue()).then(()=>{H.show({content:"Execution completed",type:C.MessageType.Success})}).catch(()=>{H.show({content:"Execution failed",type:C.MessageType.Error})})},[n]);return f.jsxs("div",{className:P.scriptEditorPanel,children:[f.jsx("div",{className:P.scriptEditorContent,ref:t,children:f.jsx("div",{className:P.scriptEditorContainer,ref:e})}),f.jsx("div",{className:P.scriptEditorActions,children:f.jsx(C.Button,{type:"primary",size:"small",onClick:Re,children:r.t("script-panel.panel.execute")})})]})}function Ie(){return{id:W.id,title:"toggle-script-panel",tooltip:"script-panel.tooltip.menu-button",icon:"CodeSingle",type:v.MenuItemType.BUTTON,positions:[v.MenuPosition.TOOLBAR_START]}}var be=Object.defineProperty,Ce=Object.getOwnPropertyDescriptor,ye=(t,e,i,r)=>{for(var n=r>1?void 0:r?Ce(e,i):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(r?o(e,i,n):o(n))||n);return r&&n&&be(e,i,n),n},D=(t,e)=>(i,r)=>e(i,r,t);let O=class extends c.Disposable{constructor(t,e,i){super(),this.disposeWithMe(t.addMenuItem(Ie())),this.disposeWithMe(i.register(F,Oe)),this.disposeWithMe(e.registerCommand(W))}};O=ye([c.OnLifecycle(c.LifecycleStages.Steady,O),D(0,v.IMenuService),D(1,c.ICommandService),D(2,l.Inject(v.ComponentManager))],O);var Ee=Object.defineProperty,Ue=Object.getOwnPropertyDescriptor,xe=(t,e,i,r)=>{for(var n=r>1?void 0:r?Ue(e,i):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(r?o(e,i,n):o(n))||n);return r&&n&&Ee(e,i,n),n},G=(t,e)=>(i,r)=>e(i,r,t);const De="uniscript";a.UniverUniscriptPlugin=(R=class extends c.Plugin{constructor(e,i,r){super(De),this._config=e,this._injector=i,this._localeService=r}onStarting(e){[[O],[y,{useFactory:()=>e.createInstance(y,this._config)}],[A],[w]].forEach(r=>e.add(r)),this._localeService.load({zhCN:N})}},b(R,"type",c.PluginType.Univer),R),a.UniverUniscriptPlugin=xe([G(1,l.Inject(l.Injector)),G(2,l.Inject(c.LocaleService))],a.UniverUniscriptPlugin),a.enUS=K,a.zhCN=N,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,32 +1,28 @@
1
1
  {
2
2
  "name": "@univerjs/uniscript",
3
- "version": "0.1.0-alpha.1",
3
+ "version": "0.1.0-alpha.3",
4
4
  "description": "UI component library for building exceptional Univer.",
5
5
  "keywords": [],
6
6
  "author": "DreamNum <developer@univer.ai>",
7
- "license": "MIT",
7
+ "license": "Apache-2.0",
8
8
  "main": "./lib/cjs/index.js",
9
- "module": "./lib/esm/index.js",
9
+ "module": "./lib/es/index.js",
10
10
  "types": "./lib/types/index.d.ts",
11
11
  "publishConfig": {
12
12
  "access": "public"
13
13
  },
14
14
  "exports": {
15
15
  ".": {
16
- "import": "./lib/esm/index.js",
16
+ "import": "./lib/es/index.js",
17
17
  "require": "./lib/cjs/index.js",
18
18
  "types": "./lib/types/index.d.ts"
19
19
  },
20
20
  "./*": {
21
- "import": "./lib/esm/*",
21
+ "import": "./lib/es/*",
22
22
  "require": "./lib/cjs/*",
23
23
  "types": "./lib/types/index.d.ts"
24
24
  },
25
- "./locale/*": {
26
- "import": "./lib/esm/locale/*.js",
27
- "require": "./lib/cjs/locale/*.js",
28
- "types": "./lib/types/index.d.ts"
29
- }
25
+ "./lib/*": "./lib/*"
30
26
  },
31
27
  "directories": {
32
28
  "lib": "lib"
@@ -34,33 +30,44 @@
34
30
  "files": [
35
31
  "lib"
36
32
  ],
33
+ "sideEffects": [
34
+ "**/*.css"
35
+ ],
37
36
  "private": false,
38
- "dependencies": {
39
- "@wendellhu/redi": "^0.12.11",
40
- "rxjs": "^7.8.1",
41
- "@univerjs/sheets": "0.1.0-alpha.1",
42
- "@univerjs/ui": "0.1.0-alpha.1",
43
- "@univerjs/design": "0.1.0-alpha.1",
44
- "@univerjs/core": "0.1.0-alpha.1",
45
- "@univerjs/sheets-ui": "0.1.0-alpha.1"
46
- },
47
37
  "devDependencies": {
48
- "@types/react": "^18.2.40",
49
- "@vitest/coverage-istanbul": "^0.34.6",
50
- "esbuild": "^0.19.8",
38
+ "@types/react": "^18.2.42",
39
+ "@vitejs/plugin-react": "^4.2.1",
40
+ "@vitest/coverage-istanbul": "^1.0.4",
41
+ "@wendellhu/redi": "^0.12.12",
51
42
  "less": "^4.2.0",
52
- "ts-node": "^10.9.1",
53
- "typescript": "^5.3.2",
54
- "vitest": "^0.34.6"
43
+ "monaco-editor": "0.45.0",
44
+ "rxjs": "^7.8.1",
45
+ "typescript": "^5.3.3",
46
+ "vite": "^5.0.8",
47
+ "vite-plugin-dts": "^3.6.4",
48
+ "vite-plugin-externals": "^0.6.2",
49
+ "vitest": "^1.0.4",
50
+ "@univerjs/design": "0.1.0-alpha.3",
51
+ "@univerjs/core": "0.1.0-alpha.3",
52
+ "@univerjs/sheets": "0.1.0-alpha.3",
53
+ "@univerjs/ui": "0.1.0-alpha.3",
54
+ "@univerjs/sheets-ui": "0.1.0-alpha.3"
55
55
  },
56
56
  "peerDependencies": {
57
- "monaco-editor": "0.44.0",
58
- "react": ">=16.9.0"
57
+ "@wendellhu/redi": ">=0.12.12",
58
+ "monaco-editor": ">=0.44.0",
59
+ "react": ">=16.9.0",
60
+ "rxjs": ">=7.0.0",
61
+ "@univerjs/design": "0.1.0-alpha.3",
62
+ "@univerjs/core": "0.1.0-alpha.3",
63
+ "@univerjs/sheets": "0.1.0-alpha.3",
64
+ "@univerjs/sheets-ui": "0.1.0-alpha.3",
65
+ "@univerjs/ui": "0.1.0-alpha.3"
59
66
  },
60
67
  "scripts": {
61
68
  "test": "vitest run",
62
69
  "test:watch": "vitest",
63
70
  "coverage": "vitest run --coverage",
64
- "esbuild": "node ./esbuild.config.mjs && tsc -p tsconfig.esbuild.json"
71
+ "build": "tsc && vite build"
65
72
  }
66
73
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2020-present, DreamNum
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
@@ -1,36 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/locale/en-US.ts
21
- var en_US_exports = {};
22
- __export(en_US_exports, {
23
- default: () => en_US_default
24
- });
25
- module.exports = __toCommonJS(en_US_exports);
26
- var en_US_default = {
27
- "script-panel": {
28
- title: "Uniscript",
29
- tooltip: {
30
- "menu-button": "Toggle Uniscript Panel"
31
- },
32
- panel: {
33
- execute: "Execute Script"
34
- }
35
- }
36
- };
@@ -1,26 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/locale/zh-CN.ts
21
- var zh_CN_exports = {};
22
- __export(zh_CN_exports, {
23
- default: () => zh_CN_default
24
- });
25
- module.exports = __toCommonJS(zh_CN_exports);
26
- var zh_CN_default = {};