@opentiny/tiny-engine-plugin-bridge 2.0.0-rc.0 → 2.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +139 -140
- package/dist/style.css +1 -1
- package/package.json +5 -6
package/dist/index.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import "./style.css";
|
|
2
|
-
import { reactive as j, ref as
|
|
3
|
-
import { SearchEmpty as
|
|
4
|
-
import { getMetaApi as
|
|
5
|
-
import { isVsCodeEnv as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
ve(t.bridge), he(t.utils);
|
|
2
|
+
import { reactive as j, ref as T, watchEffect as Z, resolveComponent as m, openBlock as h, createElementBlock as L, createElementVNode as _, createVNode as s, withCtx as l, Fragment as te, renderList as ne, normalizeClass as oe, withModifiers as K, toDisplayString as k, computed as R, watch as ae, onMounted as se, createBlock as C, createTextVNode as A, withDirectives as re, vShow as le, createCommentVNode as U, nextTick as ce } from "vue";
|
|
3
|
+
import { SearchEmpty as ie, PluginSetting as de, VueMonaco as pe, SvgButton as $, PluginPanel as ue } from "@opentiny/tiny-engine-common";
|
|
4
|
+
import { getMetaApi as b, META_SERVICE as S, useCanvas as ee, useResource as N, useNotify as B, useModal as me, getMergeMeta as ge } from "@opentiny/tiny-engine-meta-register";
|
|
5
|
+
import { isVsCodeEnv as ye } from "@opentiny/tiny-engine-common/js/environments";
|
|
6
|
+
import { generateBridge as fe, generateUtil as _e } from "@opentiny/tiny-engine-common/js/vscodeGenerateFile";
|
|
7
|
+
import { Search as ve, Form as he, Input as Ee, Button as Re, FormItem as Ce, Checkbox as Ve, RadioGroup as be, Radio as Se } from "@opentiny/vue";
|
|
8
|
+
import { iconSearch as xe } from "@opentiny/vue-icon";
|
|
9
|
+
const Te = (n, t) => b(S.Http).get(`/app-center/api/apps/extension/list?app=${n}&category=${t}`), Ue = (n) => b(S.Http).post("/app-center/api/apps/extension/create", n), ke = (n) => b(S.Http).post("/app-center/api/apps/extension/update", n), Ne = (n) => b(S.Http).get(`/app-center/api/apps/extension/delete?${n}`), Be = (n) => {
|
|
10
|
+
b(S.Http).get(`/app-center/api/apps/schema/${n}`).then((t) => {
|
|
11
|
+
fe(t.bridge), _e(t.utils);
|
|
13
12
|
});
|
|
14
13
|
}, i = j({
|
|
15
14
|
actionType: "",
|
|
@@ -20,7 +19,7 @@ const w = _e(), ke = (n, t) => w.get(`/app-center/api/apps/extension/list?app=${
|
|
|
20
19
|
resourceNames: {},
|
|
21
20
|
refresh: !1,
|
|
22
21
|
id: ""
|
|
23
|
-
}),
|
|
22
|
+
}), Q = {
|
|
24
23
|
name: "",
|
|
25
24
|
type: "npm",
|
|
26
25
|
content: {
|
|
@@ -31,7 +30,7 @@ const w = _e(), ke = (n, t) => w.get(`/app-center/api/apps/extension/list?app=${
|
|
|
31
30
|
destructuring: !0,
|
|
32
31
|
main: ""
|
|
33
32
|
}
|
|
34
|
-
},
|
|
33
|
+
}, Ie = {
|
|
35
34
|
name: "",
|
|
36
35
|
type: "function",
|
|
37
36
|
content: {
|
|
@@ -41,68 +40,68 @@ const w = _e(), ke = (n, t) => w.get(`/app-center/api/apps/extension/list?app=${
|
|
|
41
40
|
}, V = {
|
|
42
41
|
Util: "utils",
|
|
43
42
|
Bridge: "bridge"
|
|
44
|
-
},
|
|
43
|
+
}, F = {
|
|
45
44
|
Npm: "npm",
|
|
46
45
|
Function: "function"
|
|
47
|
-
},
|
|
46
|
+
}, we = {
|
|
48
47
|
[V.Util]: "新建工具类",
|
|
49
48
|
[V.Bridge]: "新建桥接源"
|
|
50
|
-
},
|
|
49
|
+
}, I = {
|
|
51
50
|
Read: "read",
|
|
52
51
|
Edit: "edit"
|
|
53
|
-
},
|
|
52
|
+
}, w = () => b(S.GlobalService).getBaseInfo().id, Oe = (n) => i.resourceNames[n], Ae = (n, t) => {
|
|
54
53
|
i.resourceNames[n] = t;
|
|
55
|
-
},
|
|
56
|
-
const t =
|
|
57
|
-
return
|
|
58
|
-
},
|
|
54
|
+
}, Le = (n) => {
|
|
55
|
+
const t = w();
|
|
56
|
+
return Te(t, n);
|
|
57
|
+
}, Y = () => i.actionType, M = (n) => {
|
|
59
58
|
i.actionType = n;
|
|
60
|
-
},
|
|
61
|
-
n || (n = i.category ===
|
|
62
|
-
},
|
|
59
|
+
}, Fe = () => i.resource, G = (n = Q) => {
|
|
60
|
+
n || (n = i.category === F.Function ? Ie : Q), i.resource = n;
|
|
61
|
+
}, P = () => i.type, X = (n) => {
|
|
63
62
|
i.type = n;
|
|
64
|
-
},
|
|
63
|
+
}, H = (n) => {
|
|
65
64
|
i.category = n;
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
const { updateUtils: e } =
|
|
70
|
-
|
|
65
|
+
}, q = () => i.category, z = (...n) => {
|
|
66
|
+
ye && Be(...n);
|
|
67
|
+
}, Pe = (n, t, u) => {
|
|
68
|
+
const { updateUtils: e } = ee().canvasApi.value;
|
|
69
|
+
Y() === I.Edit ? (n.id = i.resource.id, ke(n).then((o) => {
|
|
71
70
|
if (o) {
|
|
72
|
-
const y =
|
|
73
|
-
|
|
71
|
+
const y = N().resState[n.category].findIndex((c) => c.name === o.name);
|
|
72
|
+
N().resState[n.category][y] = o, e([o]), z(w()), B({
|
|
74
73
|
type: "success",
|
|
75
74
|
message: "修改成功"
|
|
76
75
|
}), u("refresh", i.type), i.refresh = !0, t();
|
|
77
76
|
}
|
|
78
|
-
})) :
|
|
79
|
-
o && (
|
|
77
|
+
})) : Ue(n).then((o) => {
|
|
78
|
+
o && (N().resState[n.category].push(o), e([o]), z(w()), B({
|
|
80
79
|
type: "success",
|
|
81
80
|
message: "创建成功"
|
|
82
81
|
}), u("refresh", i.type), i.refresh = !0, t());
|
|
83
82
|
});
|
|
84
|
-
},
|
|
83
|
+
}, De = (n, t, u) => {
|
|
85
84
|
var y;
|
|
86
|
-
const e = `app=${
|
|
87
|
-
|
|
85
|
+
const e = `app=${w()}&id=${(y = i.resource) == null ? void 0 : y.id}`, { deleteUtils: o } = ee().canvasApi.value;
|
|
86
|
+
Ne(e).then((c) => {
|
|
88
87
|
if (c) {
|
|
89
|
-
const f =
|
|
90
|
-
|
|
88
|
+
const f = N().resState[i.type].findIndex((v) => v.name === c.name);
|
|
89
|
+
N().resState[i.type].splice(f, 1), o([c]), z(w()), B({
|
|
91
90
|
type: "success",
|
|
92
91
|
message: "删除成功"
|
|
93
92
|
}), u("refresh", i.type), i.refresh = !0, t();
|
|
94
93
|
}
|
|
95
94
|
});
|
|
96
|
-
},
|
|
95
|
+
}, J = (n, t) => {
|
|
97
96
|
const u = n.__vccOpts || n;
|
|
98
97
|
for (const [e, o] of t)
|
|
99
98
|
u[e] = o;
|
|
100
99
|
return u;
|
|
101
|
-
},
|
|
100
|
+
}, Me = {
|
|
102
101
|
components: {
|
|
103
|
-
TinySearch:
|
|
104
|
-
TinyIconSearch:
|
|
105
|
-
SearchEmpty:
|
|
102
|
+
TinySearch: ve,
|
|
103
|
+
TinyIconSearch: xe(),
|
|
104
|
+
SearchEmpty: ie
|
|
106
105
|
},
|
|
107
106
|
props: {
|
|
108
107
|
name: {
|
|
@@ -112,43 +111,43 @@ const w = _e(), ke = (n, t) => w.get(`/app-center/api/apps/extension/list?app=${
|
|
|
112
111
|
},
|
|
113
112
|
emits: ["open"],
|
|
114
113
|
setup(n, { emit: t }) {
|
|
115
|
-
const u =
|
|
114
|
+
const u = T([]), e = j({
|
|
116
115
|
resourceList: [],
|
|
117
116
|
activeIndex: -1,
|
|
118
117
|
searchValue: ""
|
|
119
118
|
}), o = (a = e.resourceList, d = e.searchValue) => a.filter((r) => r.name.toLowerCase().indexOf(d.toLowerCase()) > -1), y = async (a) => {
|
|
120
|
-
e.resourceList = await
|
|
119
|
+
e.resourceList = await Le(a), Ae(
|
|
121
120
|
a,
|
|
122
121
|
Array.isArray(e.resourceList) ? e.resourceList.map((d) => d.name) : []
|
|
123
122
|
), u.value = o(e.resourceList);
|
|
124
123
|
};
|
|
125
|
-
return
|
|
124
|
+
return Z(async () => {
|
|
126
125
|
y(n.name);
|
|
127
126
|
}), {
|
|
128
127
|
state: e,
|
|
129
128
|
list: u,
|
|
130
129
|
add: (a) => {
|
|
131
|
-
|
|
130
|
+
M(""), X(n.name), G(""), H(a), t("open");
|
|
132
131
|
},
|
|
133
132
|
openRead: (a, d) => {
|
|
134
|
-
e.activeIndex = d,
|
|
133
|
+
e.activeIndex = d, G(a), M(I.Edit), t("open");
|
|
135
134
|
},
|
|
136
135
|
openEdit: (a, d) => {
|
|
137
|
-
e.activeIndex = d,
|
|
136
|
+
e.activeIndex = d, G(a), M(I.Edit), X(n.name), H(a.type), t("open");
|
|
138
137
|
},
|
|
139
138
|
refresh: y,
|
|
140
|
-
getType:
|
|
139
|
+
getType: P,
|
|
141
140
|
RESOURCE_TYPE: V,
|
|
142
141
|
searchBridgeData: (a) => {
|
|
143
142
|
u.value = o(e.resourceList, a);
|
|
144
143
|
}
|
|
145
144
|
};
|
|
146
145
|
}
|
|
147
|
-
},
|
|
148
|
-
function
|
|
146
|
+
}, Ge = { class: "manage-panel" }, qe = { class: "manage-panel-search" }, Ye = { class: "list" }, He = ["onClick"], ze = { class: "item-label" };
|
|
147
|
+
function je(n, t, u, e, o, y) {
|
|
149
148
|
const c = m("tiny-icon-search"), f = m("tiny-search"), v = m("svg-icon"), E = m("search-empty");
|
|
150
|
-
return h(),
|
|
151
|
-
_("div",
|
|
149
|
+
return h(), L("div", Ge, [
|
|
150
|
+
_("div", qe, [
|
|
152
151
|
s(f, {
|
|
153
152
|
modelValue: e.state.searchValue,
|
|
154
153
|
"onUpdate:modelValue": [
|
|
@@ -164,18 +163,18 @@ function We(n, t, u, e, o, y) {
|
|
|
164
163
|
_: 1
|
|
165
164
|
}, 8, ["modelValue", "onUpdate:modelValue"])
|
|
166
165
|
]),
|
|
167
|
-
_("div",
|
|
168
|
-
(h(!0),
|
|
166
|
+
_("div", Ye, [
|
|
167
|
+
(h(!0), L(te, null, ne(e.list, (a, d) => (h(), L("div", {
|
|
169
168
|
key: a.name,
|
|
170
|
-
class:
|
|
171
|
-
onClick:
|
|
169
|
+
class: oe(["list-item", d === e.state.activeIndex ? "active" : ""]),
|
|
170
|
+
onClick: K((r) => e.openEdit(a, d), ["stop"])
|
|
172
171
|
}, [
|
|
173
172
|
s(v, { name: "plugin-icon-sresources" }),
|
|
174
|
-
_("div",
|
|
173
|
+
_("div", ze, k(a.name), 1),
|
|
175
174
|
s(v, {
|
|
176
175
|
class: "setting-icon",
|
|
177
176
|
name: "setting",
|
|
178
|
-
onClick:
|
|
177
|
+
onClick: K((r) => e.openEdit(a, d), ["stop"])
|
|
179
178
|
}, null, 8, ["onClick"])
|
|
180
179
|
], 10, He))), 128)),
|
|
181
180
|
s(E, {
|
|
@@ -184,22 +183,22 @@ function We(n, t, u, e, o, y) {
|
|
|
184
183
|
])
|
|
185
184
|
]);
|
|
186
185
|
}
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
},
|
|
190
|
-
|
|
191
|
-
},
|
|
186
|
+
const Je = /* @__PURE__ */ J(Me, [["render", je], ["__scopeId", "data-v-f297beff"]]), W = T(!1), We = () => {
|
|
187
|
+
W.value = !0, ce(() => window.dispatchEvent(new Event("resize")));
|
|
188
|
+
}, D = () => {
|
|
189
|
+
W.value = !1;
|
|
190
|
+
}, Ke = {
|
|
192
191
|
components: {
|
|
193
|
-
TinyForm:
|
|
194
|
-
TinyInput:
|
|
195
|
-
TinyButton:
|
|
196
|
-
TinyFormItem:
|
|
197
|
-
TinyCheckbox:
|
|
198
|
-
PluginSetting:
|
|
199
|
-
MonacoEditor:
|
|
200
|
-
TinyRadioGroup:
|
|
201
|
-
TinyRadio:
|
|
202
|
-
SvgButton:
|
|
192
|
+
TinyForm: he,
|
|
193
|
+
TinyInput: Ee,
|
|
194
|
+
TinyButton: Re,
|
|
195
|
+
TinyFormItem: Ce,
|
|
196
|
+
TinyCheckbox: Ve,
|
|
197
|
+
PluginSetting: de,
|
|
198
|
+
MonacoEditor: pe,
|
|
199
|
+
TinyRadioGroup: be,
|
|
200
|
+
TinyRadio: Se,
|
|
201
|
+
SvgButton: $
|
|
203
202
|
},
|
|
204
203
|
setup(n, { emit: t }) {
|
|
205
204
|
const u = {
|
|
@@ -209,49 +208,49 @@ const Ke = /* @__PURE__ */ H(qe, [["render", We], ["__scopeId", "data-v-f297beff
|
|
|
209
208
|
// 禁用滚动条边边一直显示的边框
|
|
210
209
|
overviewRulerBorder: !1,
|
|
211
210
|
renderLineHighlightOnlyWhenFocus: !0
|
|
212
|
-
}, { confirm: e } =
|
|
213
|
-
resource: R(() =>
|
|
211
|
+
}, { confirm: e } = me(), o = j({
|
|
212
|
+
resource: R(() => Fe()),
|
|
214
213
|
name: "",
|
|
215
214
|
value: "",
|
|
216
215
|
content: {},
|
|
217
|
-
status: R(() =>
|
|
218
|
-
category: R(() =>
|
|
216
|
+
status: R(() => Y() === I.Edit),
|
|
217
|
+
category: R(() => q() === F.Npm),
|
|
219
218
|
mode: R(() => {
|
|
220
219
|
var r;
|
|
221
|
-
return ((r =
|
|
220
|
+
return ((r = ge("engine.config")) == null ? void 0 : r.dslMode) !== "Vue";
|
|
222
221
|
}),
|
|
223
222
|
isInstance: !1,
|
|
224
223
|
title: R(() => {
|
|
225
|
-
const r =
|
|
224
|
+
const r = Y() === I.Edit ? "编辑" : "添加", g = P() === V.Bridge ? "桥接源" : "工具类";
|
|
226
225
|
return r + g;
|
|
227
226
|
}),
|
|
228
|
-
type:
|
|
227
|
+
type: F.Npm
|
|
229
228
|
}), y = R(() => {
|
|
230
229
|
const r = o.name || "name";
|
|
231
230
|
let g = r;
|
|
232
231
|
o.content.destructuring && (o.name && o.name === o.content.exportName ? g = `{ ${o.content.exportName || "exportName"} }` : g = `{ ${o.content.exportName || "exportName"} as ${r} }`);
|
|
233
|
-
const
|
|
234
|
-
return `import ${g} from '${
|
|
232
|
+
const x = `${o.content.package || "package"}${o.content.main || ""}`;
|
|
233
|
+
return `import ${g} from '${x}'
|
|
235
234
|
export { ${r} }`;
|
|
236
235
|
});
|
|
237
|
-
|
|
236
|
+
Z(() => {
|
|
238
237
|
var r, g;
|
|
239
|
-
o.name = o.resource.name, o.content = o.resource.content || {}, o.value = ((g = (r = o.resource) == null ? void 0 : r.content) == null ? void 0 : g.value) || "", o.type =
|
|
240
|
-
}),
|
|
238
|
+
o.name = o.resource.name, o.content = o.resource.content || {}, o.value = ((g = (r = o.resource) == null ? void 0 : r.content) == null ? void 0 : g.value) || "", o.type = q();
|
|
239
|
+
}), ae(
|
|
241
240
|
() => o.isInstance,
|
|
242
241
|
(r) => {
|
|
243
242
|
r || (o.content.instance = "");
|
|
244
243
|
}
|
|
245
244
|
);
|
|
246
|
-
const c =
|
|
247
|
-
return
|
|
245
|
+
const c = T(null), f = T(null);
|
|
246
|
+
return se(() => window.dispatchEvent(new Event("resize"))), {
|
|
248
247
|
rules: {
|
|
249
248
|
name: [
|
|
250
249
|
{ required: !0, message: "必填", trigger: "change" },
|
|
251
250
|
{
|
|
252
|
-
validator: (r, g,
|
|
253
|
-
const O =
|
|
254
|
-
Array.isArray(O) && O.includes(g) ?
|
|
251
|
+
validator: (r, g, x) => {
|
|
252
|
+
const O = Oe(P());
|
|
253
|
+
Array.isArray(O) && O.includes(g) ? x(new Error("资源名称已存在")) : x();
|
|
255
254
|
},
|
|
256
255
|
trigger: "change"
|
|
257
256
|
}
|
|
@@ -264,14 +263,14 @@ export { ${r} }`;
|
|
|
264
263
|
editor: c,
|
|
265
264
|
state: o,
|
|
266
265
|
codePreview: y,
|
|
267
|
-
isOpen:
|
|
268
|
-
closePanel:
|
|
266
|
+
isOpen: W,
|
|
267
|
+
closePanel: D,
|
|
269
268
|
save: () => {
|
|
270
269
|
const r = {
|
|
271
|
-
category:
|
|
272
|
-
type:
|
|
270
|
+
category: P(),
|
|
271
|
+
type: q(),
|
|
273
272
|
name: o.name,
|
|
274
|
-
app:
|
|
273
|
+
app: b(S.GlobalService).getBaseInfo().id,
|
|
275
274
|
content: o.category ? o.content : {
|
|
276
275
|
type: "JSFunction",
|
|
277
276
|
value: c.value.getEditor().getValue()
|
|
@@ -279,20 +278,20 @@ export { ${r} }`;
|
|
|
279
278
|
};
|
|
280
279
|
f.value.validate((g) => {
|
|
281
280
|
if (!g) {
|
|
282
|
-
|
|
281
|
+
B({
|
|
283
282
|
type: "error",
|
|
284
283
|
message: "请检查必填项"
|
|
285
284
|
});
|
|
286
285
|
return;
|
|
287
286
|
}
|
|
288
287
|
if (!o.category && !c.value.getEditor().getValue()) {
|
|
289
|
-
|
|
288
|
+
B({
|
|
290
289
|
type: "error",
|
|
291
290
|
message: "function 内容必填"
|
|
292
291
|
});
|
|
293
292
|
return;
|
|
294
293
|
}
|
|
295
|
-
|
|
294
|
+
Pe(r, D, t);
|
|
296
295
|
});
|
|
297
296
|
},
|
|
298
297
|
deleteReSource: () => {
|
|
@@ -300,44 +299,44 @@ export { ${r} }`;
|
|
|
300
299
|
title: "删除资源",
|
|
301
300
|
message: "如果删除正在使用的资源,将无法正常预览页面,确认要删除吗?",
|
|
302
301
|
exec: () => {
|
|
303
|
-
|
|
302
|
+
De(o.name, D, t);
|
|
304
303
|
}
|
|
305
304
|
});
|
|
306
305
|
},
|
|
307
306
|
options: u,
|
|
308
307
|
handleChangeType: (r) => {
|
|
309
|
-
|
|
308
|
+
H(r);
|
|
310
309
|
},
|
|
311
|
-
RESOURCE_CATEGORY:
|
|
310
|
+
RESOURCE_CATEGORY: F
|
|
312
311
|
};
|
|
313
312
|
}
|
|
314
|
-
},
|
|
315
|
-
function
|
|
316
|
-
const c = m("tiny-button"), f = m("svg-button"), v = m("tiny-radio"), E = m("tiny-radio-group"), a = m("tiny-form-item"), d = m("tiny-input"), r = m("tiny-checkbox"), g = m("monaco-editor"),
|
|
313
|
+
}, Qe = { class: "title-wrap" }, Xe = { class: "header-wrap" }, Ze = { class: "right-item" }, $e = { key: 2 }, et = { class: "code-preview" };
|
|
314
|
+
function tt(n, t, u, e, o, y) {
|
|
315
|
+
const c = m("tiny-button"), f = m("svg-button"), v = m("tiny-radio"), E = m("tiny-radio-group"), a = m("tiny-form-item"), d = m("tiny-input"), r = m("tiny-checkbox"), g = m("monaco-editor"), x = m("tiny-form"), O = m("plugin-setting");
|
|
317
316
|
return e.isOpen ? (h(), C(O, { key: 0 }, {
|
|
318
317
|
title: l(() => [
|
|
319
|
-
_("div",
|
|
320
|
-
_("span", null,
|
|
318
|
+
_("div", Qe, [
|
|
319
|
+
_("span", null, k(e.state.title), 1)
|
|
321
320
|
])
|
|
322
321
|
]),
|
|
323
322
|
header: l(() => [
|
|
324
|
-
_("div",
|
|
323
|
+
_("div", Xe, [
|
|
325
324
|
s(c, {
|
|
326
325
|
class: "save-btn",
|
|
327
326
|
type: "primary",
|
|
328
327
|
onClick: e.save
|
|
329
328
|
}, {
|
|
330
329
|
default: l(() => t[10] || (t[10] = [
|
|
331
|
-
|
|
330
|
+
A("保存")
|
|
332
331
|
])),
|
|
333
332
|
_: 1
|
|
334
333
|
}, 8, ["onClick"]),
|
|
335
|
-
|
|
334
|
+
re(s(f, {
|
|
336
335
|
class: "delete-btn",
|
|
337
336
|
name: "delete",
|
|
338
337
|
onClick: e.deleteReSource
|
|
339
338
|
}, null, 8, ["onClick"]), [
|
|
340
|
-
[
|
|
339
|
+
[le, e.state.status]
|
|
341
340
|
]),
|
|
342
341
|
s(f, {
|
|
343
342
|
class: "close-btn",
|
|
@@ -347,7 +346,7 @@ function ot(n, t, u, e, o, y) {
|
|
|
347
346
|
])
|
|
348
347
|
]),
|
|
349
348
|
content: l(() => [
|
|
350
|
-
s(
|
|
349
|
+
s(x, {
|
|
351
350
|
ref: "resourceForm",
|
|
352
351
|
class: "resource-form",
|
|
353
352
|
rules: e.rules,
|
|
@@ -358,8 +357,8 @@ function ot(n, t, u, e, o, y) {
|
|
|
358
357
|
"label-align": !0
|
|
359
358
|
}, {
|
|
360
359
|
default: l(() => [
|
|
361
|
-
_("div",
|
|
362
|
-
e.state.status ?
|
|
360
|
+
_("div", Ze, [
|
|
361
|
+
e.state.status ? U("", !0) : (h(), C(a, {
|
|
363
362
|
key: 0,
|
|
364
363
|
label: "工具类型",
|
|
365
364
|
prop: "type"
|
|
@@ -376,7 +375,7 @@ function ot(n, t, u, e, o, y) {
|
|
|
376
375
|
label: e.RESOURCE_CATEGORY.Npm
|
|
377
376
|
}, {
|
|
378
377
|
default: l(() => [
|
|
379
|
-
|
|
378
|
+
A(k(e.RESOURCE_CATEGORY.Npm), 1)
|
|
380
379
|
]),
|
|
381
380
|
_: 1
|
|
382
381
|
}, 8, ["label"]),
|
|
@@ -384,7 +383,7 @@ function ot(n, t, u, e, o, y) {
|
|
|
384
383
|
label: e.RESOURCE_CATEGORY.Function
|
|
385
384
|
}, {
|
|
386
385
|
default: l(() => [
|
|
387
|
-
|
|
386
|
+
A(k(e.RESOURCE_CATEGORY.Function), 1)
|
|
388
387
|
]),
|
|
389
388
|
_: 1
|
|
390
389
|
}, 8, ["label"])
|
|
@@ -394,7 +393,7 @@ function ot(n, t, u, e, o, y) {
|
|
|
394
393
|
]),
|
|
395
394
|
_: 1
|
|
396
395
|
})),
|
|
397
|
-
e.state.status ?
|
|
396
|
+
e.state.status ? U("", !0) : (h(), C(a, {
|
|
398
397
|
key: 1,
|
|
399
398
|
label: "工具名称",
|
|
400
399
|
prop: "name"
|
|
@@ -408,7 +407,7 @@ function ot(n, t, u, e, o, y) {
|
|
|
408
407
|
]),
|
|
409
408
|
_: 1
|
|
410
409
|
})),
|
|
411
|
-
e.state.category ? (h(),
|
|
410
|
+
e.state.category ? (h(), L("div", $e, [
|
|
412
411
|
s(a, {
|
|
413
412
|
label: "npm包名",
|
|
414
413
|
prop: "content.package"
|
|
@@ -442,7 +441,7 @@ function ot(n, t, u, e, o, y) {
|
|
|
442
441
|
"onUpdate:modelValue": t[4] || (t[4] = (p) => e.state.content.destructuring = p)
|
|
443
442
|
}, {
|
|
444
443
|
default: l(() => t[11] || (t[11] = [
|
|
445
|
-
|
|
444
|
+
A("解构npm包")
|
|
446
445
|
])),
|
|
447
446
|
_: 1
|
|
448
447
|
}, 8, ["modelValue"])
|
|
@@ -460,7 +459,7 @@ function ot(n, t, u, e, o, y) {
|
|
|
460
459
|
}, null, 8, ["modelValue"])
|
|
461
460
|
]),
|
|
462
461
|
_: 1
|
|
463
|
-
})) :
|
|
462
|
+
})) : U("", !0),
|
|
464
463
|
e.state.isInstance ? (h(), C(a, {
|
|
465
464
|
key: 1,
|
|
466
465
|
label: "实例名称",
|
|
@@ -473,7 +472,7 @@ function ot(n, t, u, e, o, y) {
|
|
|
473
472
|
}, null, 8, ["modelValue"])
|
|
474
473
|
]),
|
|
475
474
|
_: 1
|
|
476
|
-
})) :
|
|
475
|
+
})) : U("", !0),
|
|
477
476
|
s(a, { label: "入口路径" }, {
|
|
478
477
|
default: l(() => [
|
|
479
478
|
s(d, {
|
|
@@ -512,8 +511,8 @@ function ot(n, t, u, e, o, y) {
|
|
|
512
511
|
}),
|
|
513
512
|
s(a, { label: "生成utils.js代码预览" }, {
|
|
514
513
|
default: l(() => [
|
|
515
|
-
_("div",
|
|
516
|
-
_("pre", null,
|
|
514
|
+
_("div", et, [
|
|
515
|
+
_("pre", null, k(e.codePreview), 1)
|
|
517
516
|
])
|
|
518
517
|
]),
|
|
519
518
|
_: 1
|
|
@@ -531,17 +530,17 @@ function ot(n, t, u, e, o, y) {
|
|
|
531
530
|
}, 8, ["rules", "model"])
|
|
532
531
|
]),
|
|
533
532
|
_: 1
|
|
534
|
-
})) :
|
|
533
|
+
})) : U("", !0);
|
|
535
534
|
}
|
|
536
|
-
const
|
|
535
|
+
const nt = /* @__PURE__ */ J(Ke, [["render", tt], ["__scopeId", "data-v-335043fc"]]), ot = {
|
|
537
536
|
components: {
|
|
538
|
-
PluginPanel:
|
|
539
|
-
SvgButton:
|
|
540
|
-
BridgeManage:
|
|
541
|
-
BridgeSetting:
|
|
537
|
+
PluginPanel: ue,
|
|
538
|
+
SvgButton: $,
|
|
539
|
+
BridgeManage: Je,
|
|
540
|
+
BridgeSetting: nt
|
|
542
541
|
},
|
|
543
542
|
setup() {
|
|
544
|
-
const n =
|
|
543
|
+
const n = T(V.Util), t = T(null), u = R(() => we[n.value]);
|
|
545
544
|
return {
|
|
546
545
|
addResource: (c) => {
|
|
547
546
|
n.value == t.value.add(c);
|
|
@@ -549,9 +548,9 @@ const at = /* @__PURE__ */ H(Xe, [["render", ot], ["__scopeId", "data-v-6ca97625
|
|
|
549
548
|
RESOURCE_TYPE: V,
|
|
550
549
|
activedName: n,
|
|
551
550
|
openBridgePanel: () => {
|
|
552
|
-
|
|
551
|
+
We();
|
|
553
552
|
},
|
|
554
|
-
closePanel:
|
|
553
|
+
closePanel: D,
|
|
555
554
|
refreshList: (c) => {
|
|
556
555
|
c == t.value.refresh(c);
|
|
557
556
|
},
|
|
@@ -560,7 +559,7 @@ const at = /* @__PURE__ */ H(Xe, [["render", ot], ["__scopeId", "data-v-6ca97625
|
|
|
560
559
|
};
|
|
561
560
|
}
|
|
562
561
|
};
|
|
563
|
-
function
|
|
562
|
+
function at(n, t, u, e, o, y) {
|
|
564
563
|
const c = m("svg-button"), f = m("bridge-manage"), v = m("bridge-setting"), E = m("plugin-panel");
|
|
565
564
|
return h(), C(E, {
|
|
566
565
|
title: "资源管理",
|
|
@@ -586,16 +585,16 @@ function rt(n, t, u, e, o, y) {
|
|
|
586
585
|
_: 1
|
|
587
586
|
}, 8, ["onClose"]);
|
|
588
587
|
}
|
|
589
|
-
const
|
|
588
|
+
const st = /* @__PURE__ */ J(ot, [["render", at], ["__scopeId", "data-v-c14cfd0a"]]), rt = {
|
|
590
589
|
id: "engine.plugins.bridge",
|
|
591
590
|
title: "资源管理",
|
|
592
591
|
type: "plugins",
|
|
593
592
|
align: "top",
|
|
594
593
|
icon: "plugin-icon-sresources"
|
|
595
|
-
},
|
|
596
|
-
...
|
|
597
|
-
entry:
|
|
594
|
+
}, yt = {
|
|
595
|
+
...rt,
|
|
596
|
+
entry: st
|
|
598
597
|
};
|
|
599
598
|
export {
|
|
600
|
-
|
|
599
|
+
yt as default
|
|
601
600
|
};
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.manage-panel[data-v-f297beff]{height:100%;display:flex;flex-direction:column;position:relative}.manage-panel .manage-panel-search[data-v-f297beff]{padding:0 12px 12px}.manage-panel .add-button[data-v-f297beff]{align-self:flex-end;margin:6px}.manage-panel .list[data-v-f297beff]{flex:1;border-top:1px solid var(--ti-lowcode-tabs-border-color);overflow:auto;padding:12px 0}.manage-panel .list-item[data-v-f297beff]{height:24px;line-height:24px;display:grid;grid-template-columns:16px 1fr auto;column-gap:8px;align-items:center;padding:0 12px;position:relative;color:var(--ti-lowcode-bridge-list-color);cursor:pointer;font-size:12px}.manage-panel .list-item[data-v-f297beff]:hover,.manage-panel .list-item.active[data-v-f297beff]{background:var(--ti-lowcode-bridge-list-bg)}.manage-panel .list-item:hover .setting-icon[data-v-f297beff],.manage-panel .list-item.active .setting-icon[data-v-f297beff]{display:block}.manage-panel .list-item .setting-icon[data-v-f297beff]{display:none;color:var(--ti-lowcode-toolbar-more-hover-color)}.plugin-setting[data-v-
|
|
1
|
+
.manage-panel[data-v-f297beff]{height:100%;display:flex;flex-direction:column;position:relative}.manage-panel .manage-panel-search[data-v-f297beff]{padding:0 12px 12px}.manage-panel .add-button[data-v-f297beff]{align-self:flex-end;margin:6px}.manage-panel .list[data-v-f297beff]{flex:1;border-top:1px solid var(--ti-lowcode-tabs-border-color);overflow:auto;padding:12px 0}.manage-panel .list-item[data-v-f297beff]{height:24px;line-height:24px;display:grid;grid-template-columns:16px 1fr auto;column-gap:8px;align-items:center;padding:0 12px;position:relative;color:var(--ti-lowcode-bridge-list-color);cursor:pointer;font-size:12px}.manage-panel .list-item[data-v-f297beff]:hover,.manage-panel .list-item.active[data-v-f297beff]{background:var(--ti-lowcode-bridge-list-bg)}.manage-panel .list-item:hover .setting-icon[data-v-f297beff],.manage-panel .list-item.active .setting-icon[data-v-f297beff]{display:block}.manage-panel .list-item .setting-icon[data-v-f297beff]{display:none;color:var(--ti-lowcode-toolbar-more-hover-color)}.plugin-setting[data-v-335043fc] .icon-wrap{margin-right:8px}.plugin-setting .resource-form .tip[data-v-335043fc]{font-size:11px;line-height:18px;margin-top:8px;color:var(--ti-lowcode-datasource-tip-color)}.plugin-setting .resource-form[data-v-335043fc] .tiny-form-item__label .cdn-tips-icon{margin-left:4px}.plugin-setting .title-wrap[data-v-335043fc]{font-size:12px;font-weight:700;color:var(--ti-lowcode-data-source-color)}.plugin-setting .title-wrap .help-link[data-v-335043fc]{display:inline-block;color:var(--ti-lowcode-common-primary-color);font-size:12px;margin-left:16px}.plugin-setting .title-wrap .help-link[data-v-335043fc]:hover{text-decoration:underline}.plugin-setting .header-wrap[data-v-335043fc]{display:flex;align-items:center;column-gap:6px}.plugin-setting .header-wrap .tiny-button[data-v-335043fc]{width:40px;padding:0;min-width:40px;margin-right:2px}.plugin-setting .monaco-editor[data-v-335043fc]{height:500px;margin-top:8px;border:1px solid var(--ti-lowcode-birdge-editor-border-color)}.plugin-setting .resource-form-footer[data-v-335043fc]{padding:12px 0 12px 80px}.plugin-setting .resource-form-footer .tiny-svg[data-v-335043fc]{margin-right:6px}.plugin-setting .resource-form-footer .del[data-v-335043fc]:hover{background-color:var(--ti-lowcode-delete-button-hover-bg)}.plugin-setting .cdn-label-wrap[data-v-335043fc]{display:flex;align-items:center}.code-preview[data-v-335043fc]{font-size:14px;line-height:20px;color:var(--ti-lowcode-birdge-code-preview-color);background-color:var(--ti-lowcode-birdge-code-preview-bg-color);border-radius:6px}.code-preview .pre-title[data-v-335043fc]{font-family:Microsoft YaHei}.code-preview>pre[data-v-335043fc]{margin:0;padding:8px 20px;font-family:Consolas,Courier New,monospace}[data-v-c14cfd0a] .tiny-button{border-radius:4px;height:24px;line-height:24px}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/tiny-engine-plugin-bridge",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -25,12 +25,11 @@
|
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"homepage": "https://opentiny.design/tiny-engine",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@opentiny/tiny-engine-common": "2.0.0-rc.
|
|
29
|
-
"@opentiny/tiny-engine-
|
|
30
|
-
"@opentiny/tiny-engine-meta-register": "2.0.0-rc.0"
|
|
28
|
+
"@opentiny/tiny-engine-common": "2.0.0-rc.2",
|
|
29
|
+
"@opentiny/tiny-engine-meta-register": "2.0.0-rc.2"
|
|
31
30
|
},
|
|
32
31
|
"devDependencies": {
|
|
33
|
-
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.0.0-rc.
|
|
32
|
+
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.0.0-rc.2",
|
|
34
33
|
"@vitejs/plugin-vue": "^5.1.2",
|
|
35
34
|
"@vitejs/plugin-vue-jsx": "^4.0.1",
|
|
36
35
|
"vite": "^5.4.2"
|
|
@@ -40,5 +39,5 @@
|
|
|
40
39
|
"@opentiny/vue-icon": "^3.14.0",
|
|
41
40
|
"vue": "^3.4.15"
|
|
42
41
|
},
|
|
43
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "67330d419fe12b04db77e67501c85d03eafa0de0"
|
|
44
43
|
}
|