@univerjs/uniscript 0.1.0-alpha.1 → 0.1.0-alpha.2
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE.txt +178 -0
- package/lib/cjs/index.js +9 -863
- package/lib/es/index.js +365 -0
- package/lib/index.css +1 -9
- package/lib/types/commands/operations/panel.operation.d.ts +15 -1
- package/lib/types/controllers/menu.d.ts +15 -1
- package/lib/types/controllers/uniscript.controller.d.ts +15 -1
- package/lib/types/facade/facade.d.ts +15 -1
- package/lib/types/facade/sheet/f-range.d.ts +15 -1
- package/lib/types/facade/sheet/f-selection.d.ts +15 -1
- package/lib/types/facade/sheet/f-workbook.d.ts +15 -1
- package/lib/types/facade/sheet/f-worksheet.d.ts +15 -1
- package/lib/types/index.d.ts +17 -2
- package/lib/types/locale/en-US.d.ts +15 -1
- package/lib/types/locale/index.d.ts +15 -1
- package/lib/types/locale/zh-CN.d.ts +26 -2
- package/lib/types/plugin.d.ts +18 -4
- package/lib/types/services/command/batch-command.service.d.ts +16 -1
- package/lib/types/services/script-editor.service.d.ts +15 -1
- package/lib/types/services/script-execution.service.d.ts +15 -1
- package/lib/types/services/script-panel.service.d.ts +15 -1
- package/lib/types/views/components/ScriptEditorPanel.d.ts +15 -1
- package/lib/umd/index.js +9 -0
- package/package.json +35 -28
- package/LICENSE +0 -21
- package/lib/cjs/locale/en-US.js +0 -36
- package/lib/cjs/locale/zh-CN.js +0 -26
- package/lib/esm/index.js +0 -855
- package/lib/esm/locale/en-US.js +0 -15
- package/lib/esm/locale/zh-CN.js +0 -5
- package/lib/types/commands/operations/panel.operation.d.ts.map +0 -1
- package/lib/types/controllers/menu.d.ts.map +0 -1
- package/lib/types/controllers/uniscript.controller.d.ts.map +0 -1
- package/lib/types/facade/facade.d.ts.map +0 -1
- package/lib/types/facade/sheet/f-range.d.ts.map +0 -1
- package/lib/types/facade/sheet/f-selection.d.ts.map +0 -1
- package/lib/types/facade/sheet/f-workbook.d.ts.map +0 -1
- package/lib/types/facade/sheet/f-worksheet.d.ts.map +0 -1
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/locale/en-US.d.ts.map +0 -1
- package/lib/types/locale/index.d.ts.map +0 -1
- package/lib/types/locale/zh-CN.d.ts.map +0 -1
- package/lib/types/models/model.d.ts +0 -1
- package/lib/types/models/model.d.ts.map +0 -1
- package/lib/types/plugin.d.ts.map +0 -1
- package/lib/types/services/command/batch-command.service.d.ts.map +0 -1
- package/lib/types/services/script-editor.service.d.ts.map +0 -1
- package/lib/types/services/script-execution.service.d.ts.map +0 -1
- package/lib/types/services/script-panel.service.d.ts.map +0 -1
- package/lib/types/views/components/ScriptEditorPanel.d.ts.map +0 -1
- package/lib/types/views/parts/render.part.d.ts +0 -1
- package/lib/types/views/parts/render.part.d.ts.map +0 -1
package/lib/es/index.js
ADDED
@@ -0,0 +1,365 @@
|
|
1
|
+
var Q = Object.defineProperty;
|
2
|
+
var X = (t, e, r) => e in t ? Q(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
3
|
+
var f = (t, e, r) => (X(t, typeof e != "symbol" ? e + "" : e, r), r);
|
4
|
+
import { Disposable as O, CommandType as Z, ICommandService as B, IUniverInstanceService as ee, ILogService as te, LocaleService as k, DisposableCollection as re, toDisposable as ne, OnLifecycle as oe, LifecycleStages as ie, Plugin as se, PluginType as ce } from "@univerjs/core";
|
5
|
+
import { Inject as c, Injector as u } from "@wendellhu/redi";
|
6
|
+
import { ISidebarService as ae, IShortcutService as le, IMessageService as pe, MenuItemType as ue, MenuPosition as _e, ComponentManager as ve, IMenuService as he } from "@univerjs/ui";
|
7
|
+
import { BehaviorSubject as de, distinctUntilChanged as fe } from "rxjs";
|
8
|
+
import ge, { useRef as C, useEffect as me, useCallback as Se } from "react";
|
9
|
+
import { MessageType as M, Button as we } from "@univerjs/design";
|
10
|
+
import { useDependency as v } from "@wendellhu/redi/react-bindings";
|
11
|
+
import { editor as Pe } from "monaco-editor";
|
12
|
+
import { SetStyleCommand as Oe, SelectionManagerService as be } from "@univerjs/sheets";
|
13
|
+
const mt = {
|
14
|
+
"script-panel": {
|
15
|
+
title: "Uniscript",
|
16
|
+
tooltip: {
|
17
|
+
"menu-button": "Toggle Uniscript Panel"
|
18
|
+
},
|
19
|
+
panel: {
|
20
|
+
execute: "Execute Script"
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}, je = {
|
24
|
+
"script-panel": {
|
25
|
+
title: "Uniscript",
|
26
|
+
tooltip: {
|
27
|
+
"menu-button": "打开收起 Uniscript 面板"
|
28
|
+
},
|
29
|
+
panel: {
|
30
|
+
execute: "执行 Uniscript"
|
31
|
+
}
|
32
|
+
}
|
33
|
+
};
|
34
|
+
class q extends O {
|
35
|
+
constructor() {
|
36
|
+
super(...arguments);
|
37
|
+
f(this, "_open$", new de(!1));
|
38
|
+
f(this, "open$", this._open$.pipe(fe()));
|
39
|
+
}
|
40
|
+
get isOpen() {
|
41
|
+
return this._open$.getValue();
|
42
|
+
}
|
43
|
+
dispose() {
|
44
|
+
this._open$.next(!1), this._open$.complete();
|
45
|
+
}
|
46
|
+
open() {
|
47
|
+
this._open$.next(!0);
|
48
|
+
}
|
49
|
+
close() {
|
50
|
+
this._open$.next(!1);
|
51
|
+
}
|
52
|
+
}
|
53
|
+
const V = "ScriptPanel", z = {
|
54
|
+
type: Z.OPERATION,
|
55
|
+
id: "univer.operation.toggle-script-panel",
|
56
|
+
handler: (t) => {
|
57
|
+
const e = t.get(q), r = t.get(ae);
|
58
|
+
return e.isOpen ? (e.close(), r.close()) : (e.open(), r.open({
|
59
|
+
header: { title: "script-panel.title" },
|
60
|
+
children: { label: V },
|
61
|
+
width: 600
|
62
|
+
})), !0;
|
63
|
+
}
|
64
|
+
};
|
65
|
+
var G = { exports: {} }, b = {};
|
66
|
+
/**
|
67
|
+
* @license React
|
68
|
+
* react-jsx-runtime.production.min.js
|
69
|
+
*
|
70
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
71
|
+
*
|
72
|
+
* This source code is licensed under the MIT license found in the
|
73
|
+
* LICENSE file in the root directory of this source tree.
|
74
|
+
*/
|
75
|
+
var Ce = ge, $e = Symbol.for("react.element"), xe = Symbol.for("react.fragment"), ye = Object.prototype.hasOwnProperty, Ee = Ce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Ie = { key: !0, ref: !0, __self: !0, __source: !0 };
|
76
|
+
function H(t, e, r) {
|
77
|
+
var n, o = {}, i = null, s = null;
|
78
|
+
r !== void 0 && (i = "" + r), e.key !== void 0 && (i = "" + e.key), e.ref !== void 0 && (s = e.ref);
|
79
|
+
for (n in e)
|
80
|
+
ye.call(e, n) && !Ie.hasOwnProperty(n) && (o[n] = e[n]);
|
81
|
+
if (t && t.defaultProps)
|
82
|
+
for (n in e = t.defaultProps, e)
|
83
|
+
o[n] === void 0 && (o[n] = e[n]);
|
84
|
+
return { $$typeof: $e, type: t, key: i, ref: s, props: o, _owner: Ee.current };
|
85
|
+
}
|
86
|
+
b.Fragment = xe;
|
87
|
+
b.jsx = H;
|
88
|
+
b.jsxs = H;
|
89
|
+
G.exports = b;
|
90
|
+
var h = G.exports;
|
91
|
+
class y extends O {
|
92
|
+
constructor(e) {
|
93
|
+
super(), this._config = e;
|
94
|
+
}
|
95
|
+
requireVscodeEditor() {
|
96
|
+
window.MonacoEnvironment || (window.MonacoEnvironment = {
|
97
|
+
getWorkerUrl: this._config.getWorkerUrl
|
98
|
+
});
|
99
|
+
}
|
100
|
+
}
|
101
|
+
var Re = Object.defineProperty, Ue = Object.getOwnPropertyDescriptor, De = (t, e, r, n) => {
|
102
|
+
for (var o = n > 1 ? void 0 : n ? Ue(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
103
|
+
(s = t[i]) && (o = (n ? s(e, r, o) : s(o)) || o);
|
104
|
+
return n && o && Re(e, r, o), o;
|
105
|
+
}, T = (t, e) => (r, n) => e(r, n, t);
|
106
|
+
let S = class {
|
107
|
+
constructor(t, e, r, n, o) {
|
108
|
+
this._workbook = t, this._worksheet = e, this._range = r, this._injector = n, this._commandService = o;
|
109
|
+
}
|
110
|
+
getRow() {
|
111
|
+
return this._range.startRow;
|
112
|
+
}
|
113
|
+
getColumn() {
|
114
|
+
return this._range.startColumn;
|
115
|
+
}
|
116
|
+
getWidth() {
|
117
|
+
return this._range.endColumn - this._range.startColumn + 1;
|
118
|
+
}
|
119
|
+
getHeight() {
|
120
|
+
return this._range.endRow - this._range.startRow + 1;
|
121
|
+
}
|
122
|
+
getValue() {
|
123
|
+
var t;
|
124
|
+
return ((t = this._worksheet.getCell(this._range.startRow, this._range.startColumn)) == null ? void 0 : t.v) ?? null;
|
125
|
+
}
|
126
|
+
setBackgroundColor(t) {
|
127
|
+
this._commandService.executeCommand(Oe.id, {
|
128
|
+
workbookId: this._workbook.getUnitId(),
|
129
|
+
worksheetId: this._worksheet.getSheetId(),
|
130
|
+
range: this._range,
|
131
|
+
style: {
|
132
|
+
type: "bg",
|
133
|
+
value: {
|
134
|
+
rgb: t
|
135
|
+
}
|
136
|
+
}
|
137
|
+
});
|
138
|
+
}
|
139
|
+
};
|
140
|
+
S = De([
|
141
|
+
T(3, c(u)),
|
142
|
+
T(4, B)
|
143
|
+
], S);
|
144
|
+
var Me = Object.defineProperty, Te = Object.getOwnPropertyDescriptor, Ne = (t, e, r, n) => {
|
145
|
+
for (var o = n > 1 ? void 0 : n ? Te(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
146
|
+
(s = t[i]) && (o = (n ? s(e, r, o) : s(o)) || o);
|
147
|
+
return n && o && Me(e, r, o), o;
|
148
|
+
}, Fe = (t, e) => (r, n) => e(r, n, t);
|
149
|
+
let E = class {
|
150
|
+
constructor(t, e, r, n) {
|
151
|
+
this._workbook = t, this._worksheet = e, this._selections = r, this._injector = n;
|
152
|
+
}
|
153
|
+
getActiveRange() {
|
154
|
+
const t = this._selections.find((e) => !!e.primary);
|
155
|
+
return t ? this._injector.createInstance(S, this._workbook, this._worksheet, t.range) : null;
|
156
|
+
}
|
157
|
+
};
|
158
|
+
E = Ne([
|
159
|
+
Fe(3, c(u))
|
160
|
+
], E);
|
161
|
+
var We = Object.defineProperty, Ae = Object.getOwnPropertyDescriptor, Le = (t, e, r, n) => {
|
162
|
+
for (var o = n > 1 ? void 0 : n ? Ae(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
163
|
+
(s = t[i]) && (o = (n ? s(e, r, o) : s(o)) || o);
|
164
|
+
return n && o && We(e, r, o), o;
|
165
|
+
}, N = (t, e) => (r, n) => e(r, n, t);
|
166
|
+
let I = class {
|
167
|
+
constructor(t, e, r, n) {
|
168
|
+
this._workbook = t, this._worksheet = e, this._injector = r, this._selectionManagerService = n;
|
169
|
+
}
|
170
|
+
getSelection() {
|
171
|
+
const t = this._selectionManagerService.getSelections();
|
172
|
+
return t ? this._injector.createInstance(E, this._workbook, this._worksheet, t) : null;
|
173
|
+
}
|
174
|
+
getRange(t, e) {
|
175
|
+
const r = {
|
176
|
+
startRow: t,
|
177
|
+
endRow: t,
|
178
|
+
startColumn: e,
|
179
|
+
endColumn: e
|
180
|
+
};
|
181
|
+
return this._injector.createInstance(S, this._workbook, this._worksheet, r);
|
182
|
+
}
|
183
|
+
};
|
184
|
+
I = Le([
|
185
|
+
N(2, c(u)),
|
186
|
+
N(3, c(be))
|
187
|
+
], I);
|
188
|
+
var Be = Object.defineProperty, ke = Object.getOwnPropertyDescriptor, qe = (t, e, r, n) => {
|
189
|
+
for (var o = n > 1 ? void 0 : n ? ke(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
190
|
+
(s = t[i]) && (o = (n ? s(e, r, o) : s(o)) || o);
|
191
|
+
return n && o && Be(e, r, o), o;
|
192
|
+
}, Ve = (t, e) => (r, n) => e(r, n, t);
|
193
|
+
let R = class {
|
194
|
+
constructor(t, e) {
|
195
|
+
this._workbook = t, this._injector = e;
|
196
|
+
}
|
197
|
+
getActiveSheet() {
|
198
|
+
const t = this._workbook.getActiveSheet();
|
199
|
+
return t ? this._injector.createInstance(I, this._workbook, t) : null;
|
200
|
+
}
|
201
|
+
};
|
202
|
+
R = qe([
|
203
|
+
Ve(1, c(u))
|
204
|
+
], R);
|
205
|
+
var ze = Object.defineProperty, Ge = Object.getOwnPropertyDescriptor, He = (t, e, r, n) => {
|
206
|
+
for (var o = n > 1 ? void 0 : n ? Ge(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
207
|
+
(s = t[i]) && (o = (n ? s(e, r, o) : s(o)) || o);
|
208
|
+
return n && o && ze(e, r, o), o;
|
209
|
+
}, F = (t, e) => (r, n) => e(r, n, t);
|
210
|
+
let w = class {
|
211
|
+
constructor(t, e) {
|
212
|
+
this._injector = t, this._univerInstanceService = e;
|
213
|
+
}
|
214
|
+
static newInstance(t) {
|
215
|
+
return t.createInstance(w);
|
216
|
+
}
|
217
|
+
getCurrentSheet() {
|
218
|
+
const t = this._univerInstanceService.getCurrentUniverSheetInstance();
|
219
|
+
return t ? this._injector.createInstance(R, t) : null;
|
220
|
+
}
|
221
|
+
};
|
222
|
+
w = He([
|
223
|
+
F(0, c(u)),
|
224
|
+
F(1, ee)
|
225
|
+
], w);
|
226
|
+
var Je = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, Ke = (t, e, r, n) => {
|
227
|
+
for (var o = n > 1 ? void 0 : n ? Ye(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
228
|
+
(s = t[i]) && (o = (n ? s(e, r, o) : s(o)) || o);
|
229
|
+
return n && o && Je(e, r, o), o;
|
230
|
+
}, W = (t, e) => (r, n) => e(r, n, t);
|
231
|
+
let P = class extends O {
|
232
|
+
constructor(t, e) {
|
233
|
+
super(), this._logService = t, this._injector = e;
|
234
|
+
}
|
235
|
+
async execute(t) {
|
236
|
+
this._logService.log("[UniscriptExecutionService]", "executing Uniscript...");
|
237
|
+
const e = w.newInstance(this._injector), r = new Function("Univer", `(() => {${t}})()`);
|
238
|
+
try {
|
239
|
+
return r(e), !0;
|
240
|
+
} catch (n) {
|
241
|
+
return this._logService.error(n), !1;
|
242
|
+
}
|
243
|
+
}
|
244
|
+
};
|
245
|
+
P = Ke([
|
246
|
+
W(0, te),
|
247
|
+
W(1, c(u))
|
248
|
+
], P);
|
249
|
+
const Qe = "univer-script-editor-panel", Xe = "univer-script-editor-content", g = {
|
250
|
+
scriptEditorPanel: Qe,
|
251
|
+
scriptEditorContent: Xe
|
252
|
+
};
|
253
|
+
function Ze() {
|
254
|
+
const t = C(null), e = C(null), r = C(null), n = v(k), o = v(P), i = v(le), s = v(y), U = v(pe);
|
255
|
+
me(() => {
|
256
|
+
const _ = e.current, a = t.current;
|
257
|
+
let p = null, d = null;
|
258
|
+
if (_ && a) {
|
259
|
+
s.requireVscodeEditor();
|
260
|
+
const j = r.current = Pe.create(_, {
|
261
|
+
value: "",
|
262
|
+
language: "javascript"
|
263
|
+
});
|
264
|
+
d = new ResizeObserver(() => {
|
265
|
+
let D = requestIdleCallback(() => {
|
266
|
+
if (!D)
|
267
|
+
return;
|
268
|
+
const { height: Y, width: K } = a.getBoundingClientRect();
|
269
|
+
j.layout({ width: K, height: Y }), D = void 0;
|
270
|
+
});
|
271
|
+
}), d.observe(a);
|
272
|
+
let l;
|
273
|
+
p = new re(), p.add(
|
274
|
+
j.onDidFocusEditorWidget(() => {
|
275
|
+
l = i.forceEscape();
|
276
|
+
})
|
277
|
+
), p.add(
|
278
|
+
j.onDidBlurEditorWidget(() => {
|
279
|
+
l == null || l.dispose(), l = void 0;
|
280
|
+
})
|
281
|
+
), p.add(ne(() => l == null ? void 0 : l.dispose()));
|
282
|
+
}
|
283
|
+
return () => {
|
284
|
+
d && a && d.unobserve(a), p == null || p.dispose();
|
285
|
+
};
|
286
|
+
}, []);
|
287
|
+
const J = Se(() => {
|
288
|
+
var a;
|
289
|
+
const _ = (a = r.current) == null ? void 0 : a.getModel();
|
290
|
+
_ && o.execute(_.getValue()).then(() => {
|
291
|
+
U.show({
|
292
|
+
content: "Execution completed",
|
293
|
+
type: M.Success
|
294
|
+
});
|
295
|
+
}).catch(() => {
|
296
|
+
U.show({
|
297
|
+
content: "Execution failed",
|
298
|
+
type: M.Error
|
299
|
+
});
|
300
|
+
});
|
301
|
+
}, [o]);
|
302
|
+
return /* @__PURE__ */ h.jsxs("div", { className: g.scriptEditorPanel, children: [
|
303
|
+
/* @__PURE__ */ h.jsx("div", { className: g.scriptEditorContent, ref: t, children: /* @__PURE__ */ h.jsx("div", { className: g.scriptEditorContainer, ref: e }) }),
|
304
|
+
/* @__PURE__ */ h.jsx("div", { className: g.scriptEditorActions, children: /* @__PURE__ */ h.jsx(we, { type: "primary", size: "small", onClick: J, children: n.t("script-panel.panel.execute") }) })
|
305
|
+
] });
|
306
|
+
}
|
307
|
+
function et() {
|
308
|
+
return {
|
309
|
+
id: z.id,
|
310
|
+
title: "toggle-script-panel",
|
311
|
+
tooltip: "script-panel.tooltip.menu-button",
|
312
|
+
icon: "CodeSingle",
|
313
|
+
type: ue.BUTTON,
|
314
|
+
positions: [_e.TOOLBAR_START]
|
315
|
+
};
|
316
|
+
}
|
317
|
+
var tt = Object.defineProperty, rt = Object.getOwnPropertyDescriptor, nt = (t, e, r, n) => {
|
318
|
+
for (var o = n > 1 ? void 0 : n ? rt(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
319
|
+
(s = t[i]) && (o = (n ? s(e, r, o) : s(o)) || o);
|
320
|
+
return n && o && tt(e, r, o), o;
|
321
|
+
}, $ = (t, e) => (r, n) => e(r, n, t);
|
322
|
+
let m = class extends O {
|
323
|
+
constructor(t, e, r) {
|
324
|
+
super(), this.disposeWithMe(t.addMenuItem(et())), this.disposeWithMe(r.register(V, Ze)), this.disposeWithMe(e.registerCommand(z));
|
325
|
+
}
|
326
|
+
};
|
327
|
+
m = nt([
|
328
|
+
oe(ie.Steady, m),
|
329
|
+
$(0, he),
|
330
|
+
$(1, B),
|
331
|
+
$(2, c(ve))
|
332
|
+
], m);
|
333
|
+
var ot = Object.defineProperty, it = Object.getOwnPropertyDescriptor, st = (t, e, r, n) => {
|
334
|
+
for (var o = n > 1 ? void 0 : n ? it(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
335
|
+
(s = t[i]) && (o = (n ? s(e, r, o) : s(o)) || o);
|
336
|
+
return n && o && ot(e, r, o), o;
|
337
|
+
}, A = (t, e) => (r, n) => e(r, n, t);
|
338
|
+
const ct = "uniscript";
|
339
|
+
var x;
|
340
|
+
let L = (x = class extends se {
|
341
|
+
constructor(t, e, r) {
|
342
|
+
super(ct), this._config = t, this._injector = e, this._localeService = r;
|
343
|
+
}
|
344
|
+
onStarting(t) {
|
345
|
+
[
|
346
|
+
// controllers
|
347
|
+
[m],
|
348
|
+
// services
|
349
|
+
[y, { useFactory: () => t.createInstance(y, this._config) }],
|
350
|
+
[q],
|
351
|
+
[P]
|
352
|
+
].forEach((r) => t.add(r)), this._localeService.load({
|
353
|
+
zhCN: je
|
354
|
+
});
|
355
|
+
}
|
356
|
+
}, f(x, "type", ce.Univer), x);
|
357
|
+
L = st([
|
358
|
+
A(1, c(u)),
|
359
|
+
A(2, c(k))
|
360
|
+
], L);
|
361
|
+
export {
|
362
|
+
L as UniverUniscriptPlugin,
|
363
|
+
mt as enUS,
|
364
|
+
je as zhCN
|
365
|
+
};
|
package/lib/index.css
CHANGED
@@ -1,9 +1 @@
|
|
1
|
-
|
2
|
-
.univer-script-editor-panel {
|
3
|
-
height: 100%;
|
4
|
-
}
|
5
|
-
.univer-script-editor-content {
|
6
|
-
overflow: hidden;
|
7
|
-
width: 100%;
|
8
|
-
height: calc(100% - 80px);
|
9
|
-
}
|
1
|
+
.univer-script-editor-panel{height:100%}.univer-script-editor-content{overflow:hidden;width:100%;height:calc(100% - 80px)}
|
@@ -1,4 +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 type { IOperation } from '@univerjs/core';
|
2
17
|
export declare const ScriptPanelComponentName = "ScriptPanel";
|
3
18
|
export declare const ToggleScriptPanelOperation: IOperation;
|
4
|
-
//# sourceMappingURL=panel.operation.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 type { IMenuButtonItem } from '@univerjs/ui';
|
2
17
|
export declare function UniscriptMenuItemFactory(): IMenuButtonItem;
|
3
|
-
//# sourceMappingURL=menu.d.ts.map
|
@@ -1,6 +1,20 @@
|
|
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, ICommandService } from '@univerjs/core';
|
2
17
|
import { ComponentManager, IMenuService } from '@univerjs/ui';
|
3
18
|
export declare class UniscriptController extends Disposable {
|
4
19
|
constructor(menuService: IMenuService, commandService: ICommandService, componentManager: ComponentManager);
|
5
20
|
}
|
6
|
-
//# sourceMappingURL=uniscript.controller.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 { IUniverInstanceService } from '@univerjs/core';
|
2
17
|
import { Injector } from '@wendellhu/redi';
|
3
18
|
import { FWorkbook } from './sheet/f-workbook';
|
@@ -8,4 +23,3 @@ export declare class FUniver {
|
|
8
23
|
constructor(_injector: Injector, _univerInstanceService: IUniverInstanceService);
|
9
24
|
getCurrentSheet(): FWorkbook | null;
|
10
25
|
}
|
11
|
-
//# sourceMappingURL=facade.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 type { ICellV, IRange, Workbook, Worksheet } from '@univerjs/core';
|
2
17
|
import { ICommandService } from '@univerjs/core';
|
3
18
|
import { Injector } from '@wendellhu/redi';
|
@@ -15,4 +30,3 @@ export declare class FRange {
|
|
15
30
|
getValue(): ICellV | null;
|
16
31
|
setBackgroundColor(color: string): void;
|
17
32
|
}
|
18
|
-
//# sourceMappingURL=f-range.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 type { Workbook, Worksheet } from '@univerjs/core';
|
2
17
|
import type { ISelectionWithStyle } from '@univerjs/sheets';
|
3
18
|
import { Injector } from '@wendellhu/redi';
|
@@ -10,4 +25,3 @@ export declare class FSelection {
|
|
10
25
|
constructor(_workbook: Workbook, _worksheet: Worksheet, _selections: Readonly<ISelectionWithStyle[]>, _injector: Injector);
|
11
26
|
getActiveRange(): FRange | null;
|
12
27
|
}
|
13
|
-
//# sourceMappingURL=f-selection.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 type { Workbook } from '@univerjs/core';
|
2
17
|
import { Injector } from '@wendellhu/redi';
|
3
18
|
import { FWorksheet } from './f-worksheet';
|
@@ -7,4 +22,3 @@ export declare class FWorkbook {
|
|
7
22
|
constructor(_workbook: Workbook, _injector: Injector);
|
8
23
|
getActiveSheet(): FWorksheet | null;
|
9
24
|
}
|
10
|
-
//# sourceMappingURL=f-workbook.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 type { Workbook, Worksheet } from '@univerjs/core';
|
2
17
|
import { SelectionManagerService } from '@univerjs/sheets';
|
3
18
|
import { Injector } from '@wendellhu/redi';
|
@@ -12,4 +27,3 @@ export declare class FWorksheet {
|
|
12
27
|
getSelection(): FSelection | null;
|
13
28
|
getRange(row: number, col: number): FRange | null;
|
14
29
|
}
|
15
|
-
//# sourceMappingURL=f-worksheet.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
@@ -1,2 +1,17 @@
|
|
1
|
-
|
2
|
-
|
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
|
+
export { enUS, zhCN } from './locale';
|
17
|
+
export { type IUniscriptConfig, UniverUniscriptPlugin } from './plugin';
|
@@ -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
|
declare const _default: {
|
2
17
|
'script-panel': {
|
3
18
|
title: string;
|
@@ -10,4 +25,3 @@ declare const _default: {
|
|
10
25
|
};
|
11
26
|
};
|
12
27
|
export default _default;
|
13
|
-
//# sourceMappingURL=en-US.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
|
export { default as enUS } from './en-US';
|
2
17
|
export { default as zhCN } from './zh-CN';
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
@@ -1,3 +1,27 @@
|
|
1
|
-
|
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
|
+
declare const _default: {
|
17
|
+
'script-panel': {
|
18
|
+
title: string;
|
19
|
+
tooltip: {
|
20
|
+
'menu-button': string;
|
21
|
+
};
|
22
|
+
panel: {
|
23
|
+
execute: string;
|
24
|
+
};
|
25
|
+
};
|
26
|
+
};
|
2
27
|
export default _default;
|
3
|
-
//# sourceMappingURL=zh-CN.d.ts.map
|