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