@univerjs/uniscript 0.1.4 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -2
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +118 -114
- 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/lib/umd/index.js +2 -2
- package/package.json +13 -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
|
package/lib/cjs/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";var
|
1
|
+
"use strict";var F=Object.defineProperty;var B=(r,e,t)=>e in r?F(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var f=(r,e,t)=>(B(r,typeof e!="symbol"?e+"":e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@univerjs/core"),a=require("@wendellhu/redi"),u=require("@univerjs/ui"),C=require("rxjs"),d=require("react"),O=require("@univerjs/design"),v=require("@wendellhu/redi/react-bindings"),W=require("monaco-editor"),z=require("@univerjs/facade"),V={"script-panel":{title:"Uniscript",tooltip:{"menu-button":"Toggle Uniscript Panel"},panel:{execute:"Execute Script"}},uniscript:{message:{success:"Execution Success",failed:"Execution Failed"}}},G=V,J={"script-panel":{title:"Uniscript",tooltip:{"menu-button":"打开收起 Uniscript 面板"},panel:{execute:"执行 Uniscript"}},uniscript:{message:{success:"执行成功",failed:"执行失败"}}},D=J;class R extends o.Disposable{constructor(){super(...arguments);f(this,"_open$",new C.BehaviorSubject(!1));f(this,"open$",this._open$.pipe(C.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 M="ScriptPanel",T={type:o.CommandType.OPERATION,id:"univer.operation.toggle-script-panel",handler:r=>{const e=r.get(R),t=r.get(u.ISidebarService);return e.isOpen?(e.close(),t.close()):(e.open(),t.open({header:{title:"script-panel.title"},children:{label:M},width:600})),!0}};var q={exports:{}},x={};/**
|
2
2
|
* @license React
|
3
3
|
* react-jsx-runtime.production.min.js
|
4
4
|
*
|
@@ -6,4 +6,4 @@
|
|
6
6
|
*
|
7
7
|
* This source code is licensed under the MIT license found in the
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
|
-
*/var
|
9
|
+
*/var Y=d,H=Symbol.for("react.element"),K=Symbol.for("react.fragment"),Q=Object.prototype.hasOwnProperty,X=Y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Z={key:!0,ref:!0,__self:!0,__source:!0};function N(r,e,t){var n,i={},s=null,c=null;t!==void 0&&(s=""+t),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(c=e.ref);for(n in e)Q.call(e,n)&&!Z.hasOwnProperty(n)&&(i[n]=e[n]);if(r&&r.defaultProps)for(n in e=r.defaultProps,e)i[n]===void 0&&(i[n]=e[n]);return{$$typeof:H,type:r,key:s,ref:c,props:i,_owner:X.current}}x.Fragment=K;x.jsx=N;x.jsxs=N;q.exports=x;var h=q.exports;class j extends o.Disposable{constructor(t){super();f(this,"_editorInstance",null);this._config=t}setEditorInstance(t){return this._editorInstance=t,o.toDisposable(()=>this._editorInstance=null)}getEditorInstance(){return this._editorInstance}requireVscodeEditor(){window.MonacoEnvironment||(window.MonacoEnvironment={getWorkerUrl:this._config.getWorkerUrl})}}var k=Object.defineProperty,ee=Object.getOwnPropertyDescriptor,te=(r,e,t,n)=>{for(var i=n>1?void 0:n?ee(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&k(e,t,i),i},$=(r,e)=>(t,n)=>e(t,n,r);let y=class extends o.Disposable{constructor(r,e){super(),this._logService=r,this._injector=e}async execute(r){this._logService.log("[UniscriptExecutionService]","executing Uniscript...");const e=z.FUniver.newAPI(this._injector),t=new Function("univerAPI",`(() => {${r}})()`);try{return t(e),!0}catch(n){return this._logService.error(n),!1}}};y=te([$(0,o.ILogService),$(1,a.Inject(a.Injector))],y);const ne="univer-script-editor-panel",re="univer-script-editor-content",ie="univer-script-editor-actions",m={scriptEditorPanel:ne,scriptEditorContent:re,scriptEditorActions:ie};function se(){const r=d.useRef(null),e=d.useRef(null),t=d.useRef(null),n=v.useDependency(o.LocaleService),i=v.useDependency(u.IShortcutService),s=v.useDependency(j);d.useEffect(()=>{const b=e.current,_=r.current;let l=null,g=null;if(b&&_){s.requireVscodeEditor();const S=t.current=W.editor.create(b,{value:"",language:"javascript"});g=new ResizeObserver(()=>{let U=requestIdleCallback(()=>{if(!U)return;const{height:L,width:A}=_.getBoundingClientRect();S.layout({width:A,height:L}),U=void 0})}),g.observe(_);let p;l=new o.DisposableCollection,l.add(s.setEditorInstance(S)),l.add(S.onDidFocusEditorWidget(()=>{p=i.forceEscape()})),l.add(S.onDidBlurEditorWidget(()=>{p==null||p.dispose(),p=void 0})),l.add(o.toDisposable(()=>p==null?void 0:p.dispose()))}return()=>{g&&_&&g.unobserve(_),l==null||l.dispose()}},[s,i]);const c=oe(t);return h.jsxs("div",{className:m.scriptEditorPanel,children:[h.jsx("div",{className:m.scriptEditorContent,ref:r,children:h.jsx("div",{className:m.scriptEditorContainer,ref:e})}),h.jsx("div",{className:m.scriptEditorActions,children:h.jsx(O.Button,{type:"primary",size:"small",onClick:c,children:n.t("script-panel.panel.execute")})})]})}function oe(r){const e=v.useDependency(y),t=v.useDependency(u.IMessageService),n=v.useDependency(o.LocaleService);return d.useCallback(()=>{var s;const i=(s=r.current)==null?void 0:s.getModel();i&&e.execute(i.getValue()).then(()=>{t.show({content:n.t("uniscript.message.success"),type:O.MessageType.Success})}).catch(()=>{t.show({content:n.t("uniscript.message.failed"),type:O.MessageType.Error})})},[n,t,r,e])}function ce(r){return{id:T.id,title:"toggle-script-panel",tooltip:"script-panel.tooltip.menu-button",icon:"CodeSingle",type:u.MenuItemType.BUTTON,positions:[u.MenuPosition.TOOLBAR_START]}}var le=Object.defineProperty,pe=Object.getOwnPropertyDescriptor,ae=(r,e,t,n)=>{for(var i=n>1?void 0:n?pe(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&le(e,t,i),i},E=(r,e)=>(t,n)=>e(t,n,r);let P=class extends o.Disposable{constructor(r,e,t,n){super(),this._injector=r,this.disposeWithMe(e.addMenuItem(this._injector.invoke(ce))),this.disposeWithMe(n.register(M,se)),this.disposeWithMe(t.registerCommand(T))}};P=ae([o.OnLifecycle(o.LifecycleStages.Steady,P),E(0,a.Inject(a.Injector)),E(1,u.IMenuService),E(2,o.ICommandService),E(3,a.Inject(u.ComponentManager))],P);var ue=Object.defineProperty,de=Object.getOwnPropertyDescriptor,ve=(r,e,t,n)=>{for(var i=n>1?void 0:n?de(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=(n?c(e,t,i):c(i))||i);return n&&i&&ue(e,t,i),i},w=(r,e)=>(t,n)=>e(t,n,r);const _e="uniscript";var I;exports.UniverUniscriptPlugin=(I=class extends o.Plugin{constructor(e,t,n){super(_e),this._config=e,this._injector=t,this._localeService=n}onStarting(e){[[P],[j,{useFactory:()=>e.createInstance(j,this._config)}],[R],[y]].forEach(n=>e.add(n)),this._localeService.load({zhCN:D})}},f(I,"type",o.PluginType.Univer),I);exports.UniverUniscriptPlugin=ve([w(1,a.Inject(a.Injector)),w(2,a.Inject(o.LocaleService))],exports.UniverUniscriptPlugin);exports.enUS=G;exports.zhCN=D;
|
package/lib/es/index.js
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
var
|
2
|
-
var
|
3
|
-
var u = (t, e, r) => (
|
4
|
-
import { Disposable as
|
5
|
-
import { Inject as
|
6
|
-
import { ISidebarService as
|
7
|
-
import { BehaviorSubject as
|
8
|
-
import
|
9
|
-
import {
|
10
|
-
import { useDependency as
|
11
|
-
import { editor as
|
12
|
-
import { FUniver as
|
13
|
-
const
|
1
|
+
var B = Object.defineProperty;
|
2
|
+
var q = (t, e, r) => e in t ? B(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
3
|
+
var u = (t, e, r) => (q(t, typeof e != "symbol" ? e + "" : e, r), r);
|
4
|
+
import { Disposable as E, CommandType as z, toDisposable as M, ILogService as V, LocaleService as I, DisposableCollection as G, OnLifecycle as J, LifecycleStages as Y, ICommandService as H, Plugin as K, PluginType as Q } from "@univerjs/core";
|
5
|
+
import { Inject as v, Injector as b } from "@wendellhu/redi";
|
6
|
+
import { ISidebarService as X, IShortcutService as Z, IMessageService as k, MenuItemType as ee, MenuPosition as te, ComponentManager as re, IMenuService as ne } from "@univerjs/ui";
|
7
|
+
import { BehaviorSubject as ie, distinctUntilChanged as oe } from "rxjs";
|
8
|
+
import se, { useRef as x, useEffect as ce, useCallback as le } from "react";
|
9
|
+
import { Button as pe, MessageType as w } from "@univerjs/design";
|
10
|
+
import { useDependency as p } from "@wendellhu/redi/react-bindings";
|
11
|
+
import { editor as ae } from "monaco-editor";
|
12
|
+
import { FUniver as ue } from "@univerjs/facade";
|
13
|
+
const de = {
|
14
14
|
"script-panel": {
|
15
15
|
title: "Uniscript",
|
16
16
|
tooltip: {
|
@@ -26,7 +26,7 @@ const fe = {
|
|
26
26
|
failed: "Execution Failed"
|
27
27
|
}
|
28
28
|
}
|
29
|
-
},
|
29
|
+
}, Ye = de, ve = {
|
30
30
|
"script-panel": {
|
31
31
|
title: "Uniscript",
|
32
32
|
tooltip: {
|
@@ -42,12 +42,12 @@ const fe = {
|
|
42
42
|
failed: "执行失败"
|
43
43
|
}
|
44
44
|
}
|
45
|
-
},
|
46
|
-
class
|
45
|
+
}, fe = ve;
|
46
|
+
class T extends E {
|
47
47
|
constructor() {
|
48
48
|
super(...arguments);
|
49
|
-
u(this, "_open$", new
|
50
|
-
u(this, "open$", this._open$.pipe(
|
49
|
+
u(this, "_open$", new ie(!1));
|
50
|
+
u(this, "open$", this._open$.pipe(oe()));
|
51
51
|
}
|
52
52
|
get isOpen() {
|
53
53
|
return this._open$.getValue();
|
@@ -62,19 +62,19 @@ class D extends P {
|
|
62
62
|
this._open$.next(!1);
|
63
63
|
}
|
64
64
|
}
|
65
|
-
const
|
66
|
-
type:
|
65
|
+
const D = "ScriptPanel", N = {
|
66
|
+
type: z.OPERATION,
|
67
67
|
id: "univer.operation.toggle-script-panel",
|
68
68
|
handler: (t) => {
|
69
|
-
const e = t.get(
|
69
|
+
const e = t.get(T), r = t.get(X);
|
70
70
|
return e.isOpen ? (e.close(), r.close()) : (e.open(), r.open({
|
71
71
|
header: { title: "script-panel.title" },
|
72
|
-
children: { label:
|
72
|
+
children: { label: D },
|
73
73
|
width: 600
|
74
74
|
})), !0;
|
75
75
|
}
|
76
76
|
};
|
77
|
-
var
|
77
|
+
var A = { exports: {} }, P = {};
|
78
78
|
/**
|
79
79
|
* @license React
|
80
80
|
* react-jsx-runtime.production.min.js
|
@@ -84,23 +84,23 @@ var F = { exports: {} }, x = {};
|
|
84
84
|
* This source code is licensed under the MIT license found in the
|
85
85
|
* LICENSE file in the root directory of this source tree.
|
86
86
|
*/
|
87
|
-
var
|
88
|
-
function
|
87
|
+
var _e = se, me = Symbol.for("react.element"), he = Symbol.for("react.fragment"), ge = Object.prototype.hasOwnProperty, Se = _e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Ee = { key: !0, ref: !0, __self: !0, __source: !0 };
|
88
|
+
function F(t, e, r) {
|
89
89
|
var n, i = {}, o = null, s = null;
|
90
90
|
r !== void 0 && (o = "" + r), e.key !== void 0 && (o = "" + e.key), e.ref !== void 0 && (s = e.ref);
|
91
91
|
for (n in e)
|
92
|
-
|
92
|
+
ge.call(e, n) && !Ee.hasOwnProperty(n) && (i[n] = e[n]);
|
93
93
|
if (t && t.defaultProps)
|
94
94
|
for (n in e = t.defaultProps, e)
|
95
95
|
i[n] === void 0 && (i[n] = e[n]);
|
96
|
-
return { $$typeof:
|
96
|
+
return { $$typeof: me, type: t, key: o, ref: s, props: i, _owner: Se.current };
|
97
97
|
}
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
var
|
103
|
-
class
|
98
|
+
P.Fragment = he;
|
99
|
+
P.jsx = F;
|
100
|
+
P.jsxs = F;
|
101
|
+
A.exports = P;
|
102
|
+
var d = A.exports;
|
103
|
+
class y extends E {
|
104
104
|
constructor(r) {
|
105
105
|
super();
|
106
106
|
u(this, "_editorInstance", null);
|
@@ -118,18 +118,18 @@ class I extends P {
|
|
118
118
|
});
|
119
119
|
}
|
120
120
|
}
|
121
|
-
var
|
122
|
-
for (var i = n > 1 ? void 0 : n ?
|
121
|
+
var Pe = Object.defineProperty, xe = Object.getOwnPropertyDescriptor, Oe = (t, e, r, n) => {
|
122
|
+
for (var i = n > 1 ? void 0 : n ? xe(e, r) : e, o = t.length - 1, s; o >= 0; o--)
|
123
123
|
(s = t[o]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
124
|
-
return n && i &&
|
124
|
+
return n && i && Pe(e, r, i), i;
|
125
125
|
}, $ = (t, e) => (r, n) => e(r, n, t);
|
126
|
-
let
|
126
|
+
let S = class extends E {
|
127
127
|
constructor(t, e) {
|
128
128
|
super(), this._logService = t, this._injector = e;
|
129
129
|
}
|
130
130
|
async execute(t) {
|
131
131
|
this._logService.log("[UniscriptExecutionService]", "executing Uniscript...");
|
132
|
-
const e =
|
132
|
+
const e = ue.newAPI(this._injector), r = new Function("univerAPI", `(() => {${t}})()`);
|
133
133
|
try {
|
134
134
|
return r(e), !0;
|
135
135
|
} catch (n) {
|
@@ -137,129 +137,133 @@ let E = class extends P {
|
|
137
137
|
}
|
138
138
|
}
|
139
139
|
};
|
140
|
-
|
141
|
-
$(0,
|
142
|
-
$(1,
|
143
|
-
],
|
144
|
-
const
|
145
|
-
scriptEditorPanel:
|
146
|
-
scriptEditorContent:
|
147
|
-
scriptEditorActions:
|
140
|
+
S = Oe([
|
141
|
+
$(0, V),
|
142
|
+
$(1, v(b))
|
143
|
+
], S);
|
144
|
+
const ye = "univer-script-editor-panel", Ie = "univer-script-editor-content", be = "univer-script-editor-actions", m = {
|
145
|
+
scriptEditorPanel: ye,
|
146
|
+
scriptEditorContent: Ie,
|
147
|
+
scriptEditorActions: be
|
148
148
|
};
|
149
|
-
function
|
150
|
-
const t =
|
151
|
-
|
152
|
-
const
|
153
|
-
let
|
154
|
-
if (
|
155
|
-
|
156
|
-
const
|
149
|
+
function je() {
|
150
|
+
const t = x(null), e = x(null), r = x(null), n = p(I), i = p(Z), o = p(y);
|
151
|
+
ce(() => {
|
152
|
+
const j = e.current, a = t.current;
|
153
|
+
let c = null, f = null;
|
154
|
+
if (j && a) {
|
155
|
+
o.requireVscodeEditor();
|
156
|
+
const _ = r.current = ae.create(j, {
|
157
157
|
value: "",
|
158
158
|
language: "javascript"
|
159
159
|
});
|
160
|
-
|
160
|
+
f = new ResizeObserver(() => {
|
161
161
|
let C = requestIdleCallback(() => {
|
162
162
|
if (!C)
|
163
163
|
return;
|
164
|
-
const { height:
|
165
|
-
|
164
|
+
const { height: L, width: W } = a.getBoundingClientRect();
|
165
|
+
_.layout({ width: W, height: L }), C = void 0;
|
166
166
|
});
|
167
|
-
}),
|
168
|
-
let
|
169
|
-
|
170
|
-
|
171
|
-
|
167
|
+
}), f.observe(a);
|
168
|
+
let l;
|
169
|
+
c = new G(), c.add(o.setEditorInstance(_)), c.add(
|
170
|
+
_.onDidFocusEditorWidget(() => {
|
171
|
+
l = i.forceEscape();
|
172
172
|
})
|
173
|
-
),
|
174
|
-
|
175
|
-
|
173
|
+
), c.add(
|
174
|
+
_.onDidBlurEditorWidget(() => {
|
175
|
+
l == null || l.dispose(), l = void 0;
|
176
176
|
})
|
177
|
-
),
|
177
|
+
), c.add(M(() => l == null ? void 0 : l.dispose()));
|
178
178
|
}
|
179
179
|
return () => {
|
180
|
-
|
180
|
+
f && a && f.unobserve(a), c == null || c.dispose();
|
181
181
|
};
|
182
|
-
}, []);
|
183
|
-
const
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
182
|
+
}, [o, i]);
|
183
|
+
const s = Ce(r);
|
184
|
+
return /* @__PURE__ */ d.jsxs("div", { className: m.scriptEditorPanel, children: [
|
185
|
+
/* @__PURE__ */ d.jsx("div", { className: m.scriptEditorContent, ref: t, children: /* @__PURE__ */ d.jsx("div", { className: m.scriptEditorContainer, ref: e }) }),
|
186
|
+
/* @__PURE__ */ d.jsx("div", { className: m.scriptEditorActions, children: /* @__PURE__ */ d.jsx(pe, { type: "primary", size: "small", onClick: s, children: n.t("script-panel.panel.execute") }) })
|
187
|
+
] });
|
188
|
+
}
|
189
|
+
function Ce(t) {
|
190
|
+
const e = p(S), r = p(k), n = p(I);
|
191
|
+
return le(() => {
|
192
|
+
var o;
|
193
|
+
const i = (o = t.current) == null ? void 0 : o.getModel();
|
194
|
+
i && e.execute(i.getValue()).then(() => {
|
195
|
+
r.show({
|
188
196
|
content: n.t("uniscript.message.success"),
|
189
197
|
type: w.Success
|
190
198
|
});
|
191
199
|
}).catch(() => {
|
192
|
-
|
200
|
+
r.show({
|
193
201
|
content: n.t("uniscript.message.failed"),
|
194
202
|
type: w.Error
|
195
203
|
});
|
196
204
|
});
|
197
|
-
}, [
|
198
|
-
return /* @__PURE__ */ v.jsxs("div", { className: h.scriptEditorPanel, children: [
|
199
|
-
/* @__PURE__ */ v.jsx("div", { className: h.scriptEditorContent, ref: t, children: /* @__PURE__ */ v.jsx("div", { className: h.scriptEditorContainer, ref: e }) }),
|
200
|
-
/* @__PURE__ */ v.jsx("div", { className: h.scriptEditorActions, children: /* @__PURE__ */ v.jsx(ue, { type: "primary", size: "small", onClick: W, children: n.t("script-panel.panel.execute") }) })
|
201
|
-
] });
|
205
|
+
}, [n, r, t, e]);
|
202
206
|
}
|
203
|
-
function
|
207
|
+
function we(t) {
|
204
208
|
return {
|
205
|
-
id:
|
209
|
+
id: N.id,
|
206
210
|
title: "toggle-script-panel",
|
207
211
|
tooltip: "script-panel.tooltip.menu-button",
|
208
212
|
icon: "CodeSingle",
|
209
|
-
type:
|
210
|
-
positions: [
|
213
|
+
type: ee.BUTTON,
|
214
|
+
positions: [te.TOOLBAR_START]
|
211
215
|
// FIXME hidden$ and disabled$ are not correctly in doc
|
212
216
|
// hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.SHEET),
|
213
217
|
// disabled$: getCurrentSheetDisabled$(accessor),
|
214
218
|
};
|
215
219
|
}
|
216
|
-
var
|
217
|
-
for (var i = n > 1 ? void 0 : n ?
|
220
|
+
var $e = Object.defineProperty, Ue = Object.getOwnPropertyDescriptor, Re = (t, e, r, n) => {
|
221
|
+
for (var i = n > 1 ? void 0 : n ? Ue(e, r) : e, o = t.length - 1, s; o >= 0; o--)
|
218
222
|
(s = t[o]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
219
|
-
return n && i &&
|
220
|
-
},
|
221
|
-
let
|
223
|
+
return n && i && $e(e, r, i), i;
|
224
|
+
}, h = (t, e) => (r, n) => e(r, n, t);
|
225
|
+
let g = class extends E {
|
222
226
|
constructor(t, e, r, n) {
|
223
|
-
super(), this._injector = t, this.disposeWithMe(e.addMenuItem(this._injector.invoke(
|
227
|
+
super(), this._injector = t, this.disposeWithMe(e.addMenuItem(this._injector.invoke(we))), this.disposeWithMe(n.register(D, je)), this.disposeWithMe(r.registerCommand(N));
|
224
228
|
}
|
225
229
|
};
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
],
|
233
|
-
var
|
234
|
-
for (var i = n > 1 ? void 0 : n ?
|
230
|
+
g = Re([
|
231
|
+
J(Y.Steady, g),
|
232
|
+
h(0, v(b)),
|
233
|
+
h(1, ne),
|
234
|
+
h(2, H),
|
235
|
+
h(3, v(re))
|
236
|
+
], g);
|
237
|
+
var Me = Object.defineProperty, Te = Object.getOwnPropertyDescriptor, De = (t, e, r, n) => {
|
238
|
+
for (var i = n > 1 ? void 0 : n ? Te(e, r) : e, o = t.length - 1, s; o >= 0; o--)
|
235
239
|
(s = t[o]) && (i = (n ? s(e, r, i) : s(i)) || i);
|
236
|
-
return n && i &&
|
240
|
+
return n && i && Me(e, r, i), i;
|
237
241
|
}, U = (t, e) => (r, n) => e(r, n, t);
|
238
|
-
const
|
239
|
-
var
|
240
|
-
let R = (
|
242
|
+
const Ne = "uniscript";
|
243
|
+
var O;
|
244
|
+
let R = (O = class extends K {
|
241
245
|
constructor(t, e, r) {
|
242
|
-
super(
|
246
|
+
super(Ne), this._config = t, this._injector = e, this._localeService = r;
|
243
247
|
}
|
244
248
|
onStarting(t) {
|
245
249
|
[
|
246
250
|
// controllers
|
247
|
-
[
|
251
|
+
[g],
|
248
252
|
// services
|
249
|
-
[
|
250
|
-
[
|
251
|
-
[
|
253
|
+
[y, { useFactory: () => t.createInstance(y, this._config) }],
|
254
|
+
[T],
|
255
|
+
[S]
|
252
256
|
].forEach((r) => t.add(r)), this._localeService.load({
|
253
|
-
zhCN:
|
257
|
+
zhCN: fe
|
254
258
|
});
|
255
259
|
}
|
256
|
-
}, u(
|
257
|
-
R =
|
258
|
-
U(1,
|
259
|
-
U(2,
|
260
|
+
}, u(O, "type", Q.Univer), O);
|
261
|
+
R = De([
|
262
|
+
U(1, v(b)),
|
263
|
+
U(2, v(I))
|
260
264
|
], R);
|
261
265
|
export {
|
262
266
|
R as UniverUniscriptPlugin,
|
263
|
-
|
264
|
-
|
267
|
+
Ye as enUS,
|
268
|
+
fe as zhCN
|
265
269
|
};
|
@@ -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/lib/umd/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
(function(
|
1
|
+
(function(c,s){typeof exports=="object"&&typeof module<"u"?s(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/facade")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@wendellhu/redi","@univerjs/ui","rxjs","react","@univerjs/design","@wendellhu/redi/react-bindings","monaco-editor","@univerjs/facade"],s):(c=typeof globalThis<"u"?globalThis:c||self,s(c.UniverUniscript={},c.UniverCore,c["@wendellhu/redi"],c.UniverUi,c.rxjs,c.React,c.UniverDesign,c["@wendellhu/redi/react-bindings"],c.monaco,c.UniverFacade))})(this,function(c,s,p,d,w,v,U,f,F,q){"use strict";var pe=Object.defineProperty;var ae=(c,s,p)=>s in c?pe(c,s,{enumerable:!0,configurable:!0,writable:!0,value:p}):c[s]=p;var S=(c,s,p)=>(ae(c,typeof s!="symbol"?s+"":s,p),p);var O;const W={"script-panel":{title:"Uniscript",tooltip:{"menu-button":"Toggle Uniscript Panel"},panel:{execute:"Execute Script"}},uniscript:{message:{success:"Execution Success",failed:"Execution Failed"}}},C={"script-panel":{title:"Uniscript",tooltip:{"menu-button":"打开收起 Uniscript 面板"},panel:{execute:"执行 Uniscript"}},uniscript:{message:{success:"执行成功",failed:"执行失败"}}};class b extends s.Disposable{constructor(){super(...arguments);S(this,"_open$",new w.BehaviorSubject(!1));S(this,"open$",this._open$.pipe(w.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 D="ScriptPanel",R={type:s.CommandType.OPERATION,id:"univer.operation.toggle-script-panel",handler:i=>{const e=i.get(b),n=i.get(d.ISidebarService);return e.isOpen?(e.close(),n.close()):(e.open(),n.open({header:{title:"script-panel.title"},children:{label:D},width:600})),!0}};var T={exports:{}},m={};/**
|
2
2
|
* @license React
|
3
3
|
* react-jsx-runtime.production.min.js
|
4
4
|
*
|
@@ -6,4 +6,4 @@
|
|
6
6
|
*
|
7
7
|
* This source code is licensed under the MIT license found in the
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
|
-
*/var
|
9
|
+
*/var z=v,V=Symbol.for("react.element"),B=Symbol.for("react.fragment"),G=Object.prototype.hasOwnProperty,J=z.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Y={key:!0,ref:!0,__self:!0,__source:!0};function M(i,e,n){var t,r={},o=null,l=null;n!==void 0&&(o=""+n),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(l=e.ref);for(t in e)G.call(e,t)&&!Y.hasOwnProperty(t)&&(r[t]=e[t]);if(i&&i.defaultProps)for(t in e=i.defaultProps,e)r[t]===void 0&&(r[t]=e[t]);return{$$typeof:V,type:i,key:o,ref:l,props:r,_owner:J.current}}m.Fragment=B,m.jsx=M,m.jsxs=M,T.exports=m;var _=T.exports;class I extends s.Disposable{constructor(n){super();S(this,"_editorInstance",null);this._config=n}setEditorInstance(n){return this._editorInstance=n,s.toDisposable(()=>this._editorInstance=null)}getEditorInstance(){return this._editorInstance}requireVscodeEditor(){window.MonacoEnvironment||(window.MonacoEnvironment={getWorkerUrl:this._config.getWorkerUrl})}}var H=Object.defineProperty,K=Object.getOwnPropertyDescriptor,Q=(i,e,n,t)=>{for(var r=t>1?void 0:t?K(e,n):e,o=i.length-1,l;o>=0;o--)(l=i[o])&&(r=(t?l(e,n,r):l(r))||r);return t&&r&&H(e,n,r),r},N=(i,e)=>(n,t)=>e(n,t,i);let g=class extends s.Disposable{constructor(i,e){super(),this._logService=i,this._injector=e}async execute(i){this._logService.log("[UniscriptExecutionService]","executing Uniscript...");const e=q.FUniver.newAPI(this._injector),n=new Function("univerAPI",`(() => {${i}})()`);try{return n(e),!0}catch(t){return this._logService.error(t),!1}}};g=Q([N(0,s.ILogService),N(1,p.Inject(p.Injector))],g);const E={scriptEditorPanel:"univer-script-editor-panel",scriptEditorContent:"univer-script-editor-content",scriptEditorActions:"univer-script-editor-actions"};function X(){const i=v.useRef(null),e=v.useRef(null),n=v.useRef(null),t=f.useDependency(s.LocaleService),r=f.useDependency(d.IShortcutService),o=f.useDependency(I);v.useEffect(()=>{const A=e.current,h=i.current;let a=null,P=null;if(A&&h){o.requireVscodeEditor();const x=n.current=F.editor.create(A,{value:"",language:"javascript"});P=new ResizeObserver(()=>{let L=requestIdleCallback(()=>{if(!L)return;const{height:oe,width:le}=h.getBoundingClientRect();x.layout({width:le,height:oe}),L=void 0})}),P.observe(h);let u;a=new s.DisposableCollection,a.add(o.setEditorInstance(x)),a.add(x.onDidFocusEditorWidget(()=>{u=r.forceEscape()})),a.add(x.onDidBlurEditorWidget(()=>{u==null||u.dispose(),u=void 0})),a.add(s.toDisposable(()=>u==null?void 0:u.dispose()))}return()=>{P&&h&&P.unobserve(h),a==null||a.dispose()}},[o,r]);const l=Z(n);return _.jsxs("div",{className:E.scriptEditorPanel,children:[_.jsx("div",{className:E.scriptEditorContent,ref:i,children:_.jsx("div",{className:E.scriptEditorContainer,ref:e})}),_.jsx("div",{className:E.scriptEditorActions,children:_.jsx(U.Button,{type:"primary",size:"small",onClick:l,children:t.t("script-panel.panel.execute")})})]})}function Z(i){const e=f.useDependency(g),n=f.useDependency(d.IMessageService),t=f.useDependency(s.LocaleService);return v.useCallback(()=>{var o;const r=(o=i.current)==null?void 0:o.getModel();r&&e.execute(r.getValue()).then(()=>{n.show({content:t.t("uniscript.message.success"),type:U.MessageType.Success})}).catch(()=>{n.show({content:t.t("uniscript.message.failed"),type:U.MessageType.Error})})},[t,n,i,e])}function k(i){return{id:R.id,title:"toggle-script-panel",tooltip:"script-panel.tooltip.menu-button",icon:"CodeSingle",type:d.MenuItemType.BUTTON,positions:[d.MenuPosition.TOOLBAR_START]}}var ee=Object.defineProperty,te=Object.getOwnPropertyDescriptor,ne=(i,e,n,t)=>{for(var r=t>1?void 0:t?te(e,n):e,o=i.length-1,l;o>=0;o--)(l=i[o])&&(r=(t?l(e,n,r):l(r))||r);return t&&r&&ee(e,n,r),r},j=(i,e)=>(n,t)=>e(n,t,i);let y=class extends s.Disposable{constructor(i,e,n,t){super(),this._injector=i,this.disposeWithMe(e.addMenuItem(this._injector.invoke(k))),this.disposeWithMe(t.register(D,X)),this.disposeWithMe(n.registerCommand(R))}};y=ne([s.OnLifecycle(s.LifecycleStages.Steady,y),j(0,p.Inject(p.Injector)),j(1,d.IMenuService),j(2,s.ICommandService),j(3,p.Inject(d.ComponentManager))],y);var ie=Object.defineProperty,re=Object.getOwnPropertyDescriptor,se=(i,e,n,t)=>{for(var r=t>1?void 0:t?re(e,n):e,o=i.length-1,l;o>=0;o--)(l=i[o])&&(r=(t?l(e,n,r):l(r))||r);return t&&r&&ie(e,n,r),r},$=(i,e)=>(n,t)=>e(n,t,i);const ce="uniscript";c.UniverUniscriptPlugin=(O=class extends s.Plugin{constructor(e,n,t){super(ce),this._config=e,this._injector=n,this._localeService=t}onStarting(e){[[y],[I,{useFactory:()=>e.createInstance(I,this._config)}],[b],[g]].forEach(t=>e.add(t)),this._localeService.load({zhCN:C})}},S(O,"type",s.PluginType.Univer),O),c.UniverUniscriptPlugin=se([$(1,p.Inject(p.Injector)),$(2,p.Inject(s.LocaleService))],c.UniverUniscriptPlugin),c.enUS=W,c.zhCN=C,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@univerjs/uniscript",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.6",
|
4
4
|
"private": false,
|
5
5
|
"description": "UI component library for building exceptional Univer.",
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
@@ -57,26 +57,25 @@
|
|
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.6",
|
61
|
+
"@univerjs/design": "0.1.6",
|
62
|
+
"@univerjs/facade": "0.1.6",
|
63
|
+
"@univerjs/ui": "0.1.6"
|
64
64
|
},
|
65
65
|
"devDependencies": {
|
66
|
-
"@types/react": "^18.2.
|
66
|
+
"@types/react": "^18.2.73",
|
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.7",
|
73
73
|
"vitest": "^1.4.0",
|
74
|
-
"@univerjs/
|
75
|
-
"@univerjs/
|
76
|
-
"@univerjs/facade": "0.1.
|
77
|
-
"@univerjs/
|
78
|
-
"@univerjs/ui": "0.1.
|
79
|
-
"@univerjs/core": "0.1.4"
|
74
|
+
"@univerjs/core": "0.1.6",
|
75
|
+
"@univerjs/design": "0.1.6",
|
76
|
+
"@univerjs/facade": "0.1.6",
|
77
|
+
"@univerjs/shared": "0.1.6",
|
78
|
+
"@univerjs/ui": "0.1.6"
|
80
79
|
},
|
81
80
|
"scripts": {
|
82
81
|
"test": "vitest run",
|