@opentiny/tiny-engine-plugin-bridge 2.5.0-rc.2 → 2.5.0-rc.4
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 +157 -157
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import "./style.css";
|
|
2
|
-
import { reactive as
|
|
3
|
-
import { SvgButton as j, SearchEmpty as
|
|
4
|
-
import { getMetaApi as
|
|
2
|
+
import { reactive as M, ref as U, watchEffect as ee, resolveComponent as p, createElementBlock as O, openBlock as h, createElementVNode as E, createVNode as a, withCtx as l, Fragment as oe, renderList as ae, withModifiers as X, normalizeClass as se, toDisplayString as B, computed as b, watch as re, onMounted as le, nextTick as ie, createBlock as C, createCommentVNode as N, createTextVNode as L, provide as ce } from "vue";
|
|
3
|
+
import { SvgButton as j, SearchEmpty as de, ButtonGroup as pe, VueMonaco as ue, PluginSetting as me, PluginPanel as ge } from "@opentiny/tiny-engine-common";
|
|
4
|
+
import { getMetaApi as S, META_SERVICE as x, useResource as I, useNotify as T, useModal as ye, useLayout as te, getMergeMeta as fe } from "@opentiny/tiny-engine-meta-register";
|
|
5
5
|
import { isVsCodeEnv as _e } from "@opentiny/tiny-engine-common/js/environments";
|
|
6
|
-
import { generateBridge as ve, generateUtil as
|
|
7
|
-
import { Search as
|
|
8
|
-
import { iconSearch as
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
ve(t.bridge),
|
|
6
|
+
import { generateBridge as ve, generateUtil as he } from "@opentiny/tiny-engine-common/js/vscodeGenerateFile";
|
|
7
|
+
import { Search as Ee, Radio as Re, RadioGroup as be, Checkbox as Ce, FormItem as Ve, Button as Se, Input as xe, Form as Ne } from "@opentiny/vue";
|
|
8
|
+
import { iconSearch as Te } from "@opentiny/vue-icon";
|
|
9
|
+
const Ue = (n, t) => S(x.Http).get(`/app-center/api/apps/extension/list?app=${n}&category=${t}`), ke = (n) => S(x.Http).post("/app-center/api/apps/extension/create", n), Be = (n) => S(x.Http).post("/app-center/api/apps/extension/update", n), Ie = (n) => S(x.Http).get(`/app-center/api/apps/extension/delete?${n}`), we = (n) => {
|
|
10
|
+
S(x.Http).get(`/app-center/api/apps/schema/${n}`).then((t) => {
|
|
11
|
+
ve(t.bridge), he(t.utils);
|
|
12
12
|
});
|
|
13
|
-
}, m =
|
|
13
|
+
}, m = M({
|
|
14
14
|
actionType: "",
|
|
15
15
|
type: "",
|
|
16
16
|
category: "",
|
|
@@ -30,146 +30,146 @@ const Ne = (n, t) => V(B.Http).get(`/app-center/api/apps/extension/list?app=${n}
|
|
|
30
30
|
destructuring: !0,
|
|
31
31
|
main: ""
|
|
32
32
|
}
|
|
33
|
-
},
|
|
33
|
+
}, Le = {
|
|
34
34
|
name: "",
|
|
35
35
|
type: "function",
|
|
36
36
|
content: {
|
|
37
37
|
type: "JSFunction",
|
|
38
38
|
value: ""
|
|
39
39
|
}
|
|
40
|
-
},
|
|
40
|
+
}, V = {
|
|
41
41
|
Util: "utils",
|
|
42
42
|
Bridge: "bridge"
|
|
43
|
-
},
|
|
43
|
+
}, P = {
|
|
44
44
|
Npm: "npm",
|
|
45
45
|
Function: "function"
|
|
46
|
-
},
|
|
47
|
-
[
|
|
48
|
-
[
|
|
49
|
-
},
|
|
46
|
+
}, Oe = {
|
|
47
|
+
[V.Util]: "新建工具类",
|
|
48
|
+
[V.Bridge]: "新建桥接源"
|
|
49
|
+
}, w = {
|
|
50
50
|
Edit: "edit"
|
|
51
|
-
},
|
|
51
|
+
}, G = () => S(x.GlobalService).getBaseInfo().id, Pe = (n) => m.resourceNames[n], Ae = (n, t) => {
|
|
52
52
|
m.resourceNames[n] = t;
|
|
53
|
-
},
|
|
54
|
-
const t =
|
|
55
|
-
return
|
|
56
|
-
}, H = () => m.actionType,
|
|
53
|
+
}, Fe = (n) => {
|
|
54
|
+
const t = G();
|
|
55
|
+
return Ue(t, n);
|
|
56
|
+
}, H = () => m.actionType, D = (n) => {
|
|
57
57
|
m.actionType = n;
|
|
58
|
-
},
|
|
59
|
-
n || (n = m.category ===
|
|
60
|
-
},
|
|
58
|
+
}, Ge = () => m.resource, q = (n = Z) => {
|
|
59
|
+
n || (n = m.category === P.Function ? Le : Z), m.resource = n;
|
|
60
|
+
}, A = () => m.type, $ = (n) => {
|
|
61
61
|
m.type = n;
|
|
62
62
|
}, z = (n) => {
|
|
63
63
|
m.category = n;
|
|
64
64
|
}, Y = () => m.category, ne = (...n) => {
|
|
65
|
-
_e &&
|
|
66
|
-
},
|
|
67
|
-
const e = H() ===
|
|
65
|
+
_e && we(...n);
|
|
66
|
+
}, Me = async (n, t, u) => {
|
|
67
|
+
const e = H() === w.Edit;
|
|
68
68
|
try {
|
|
69
69
|
if (e) {
|
|
70
70
|
n.id = m.resource.id;
|
|
71
|
-
const i = await
|
|
71
|
+
const i = await Be(n);
|
|
72
72
|
if (i) {
|
|
73
|
-
const g =
|
|
73
|
+
const g = I().appSchemaState[n.category].findIndex((y) => y.name === i.name);
|
|
74
74
|
if (g === -1) {
|
|
75
|
-
|
|
75
|
+
T({
|
|
76
76
|
type: "error",
|
|
77
77
|
message: "修改失败"
|
|
78
78
|
});
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
|
|
81
|
+
I().appSchemaState[n.category][g] = i;
|
|
82
82
|
}
|
|
83
83
|
} else {
|
|
84
|
-
const i = await
|
|
85
|
-
i &&
|
|
84
|
+
const i = await ke(n);
|
|
85
|
+
i && I().appSchemaState[n.category].push(i);
|
|
86
86
|
}
|
|
87
|
-
ne(
|
|
87
|
+
ne(G()), T({
|
|
88
88
|
type: "success",
|
|
89
89
|
message: `${e ? "修改" : "创建"}成功`
|
|
90
|
-
}),
|
|
90
|
+
}), u("refresh", m.type), m.refresh = !0, t();
|
|
91
91
|
} catch (i) {
|
|
92
|
-
|
|
92
|
+
T({
|
|
93
93
|
type: "error",
|
|
94
94
|
message: `工具类${e ? "修改" : "创建"}失败:${i.message}`
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
|
-
},
|
|
97
|
+
}, De = (n, t, u) => {
|
|
98
98
|
var i;
|
|
99
|
-
const e = `app=${
|
|
100
|
-
|
|
99
|
+
const e = `app=${G()}&id=${(i = m.resource) == null ? void 0 : i.id}`;
|
|
100
|
+
Ie(e).then((g) => {
|
|
101
101
|
if (g) {
|
|
102
|
-
const y =
|
|
102
|
+
const y = I().appSchemaState[m.type].findIndex((o) => o.name === g.name);
|
|
103
103
|
if (y === -1) {
|
|
104
|
-
|
|
104
|
+
T({
|
|
105
105
|
type: "error",
|
|
106
106
|
message: "删除失败"
|
|
107
107
|
});
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
|
|
110
|
+
I().appSchemaState[m.type].splice(y, 1), ne(G()), T({
|
|
111
111
|
type: "success",
|
|
112
112
|
message: "删除成功"
|
|
113
|
-
}),
|
|
113
|
+
}), u("refresh", m.type), m.refresh = !0, t();
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
116
|
}, qe = {
|
|
117
117
|
components: {
|
|
118
|
-
TinySearch:
|
|
119
|
-
TinyIconSearch:
|
|
120
|
-
SearchEmpty:
|
|
118
|
+
TinySearch: Ee,
|
|
119
|
+
TinyIconSearch: Te(),
|
|
120
|
+
SearchEmpty: de,
|
|
121
121
|
SvgButton: j
|
|
122
122
|
},
|
|
123
123
|
props: {
|
|
124
124
|
name: {
|
|
125
125
|
type: String,
|
|
126
|
-
default:
|
|
126
|
+
default: V.Util
|
|
127
127
|
}
|
|
128
128
|
},
|
|
129
129
|
emits: ["open"],
|
|
130
130
|
setup(n, { emit: t }) {
|
|
131
|
-
const
|
|
131
|
+
const u = U([]), e = M({
|
|
132
132
|
resourceList: [],
|
|
133
133
|
activeIndex: -1,
|
|
134
134
|
searchValue: ""
|
|
135
135
|
}), i = (r = e.resourceList, s = e.searchValue) => r.filter((f) => f.name.toLowerCase().indexOf(s.toLowerCase()) > -1), g = async (r) => {
|
|
136
|
-
e.resourceList = await
|
|
136
|
+
e.resourceList = await Fe(r), Ae(
|
|
137
137
|
r,
|
|
138
138
|
Array.isArray(e.resourceList) ? e.resourceList.map((s) => s.name) : []
|
|
139
|
-
),
|
|
139
|
+
), u.value = i(e.resourceList);
|
|
140
140
|
};
|
|
141
141
|
return ee(async () => {
|
|
142
142
|
g(n.name);
|
|
143
143
|
}), {
|
|
144
144
|
state: e,
|
|
145
|
-
list:
|
|
145
|
+
list: u,
|
|
146
146
|
add: (r) => {
|
|
147
|
-
|
|
147
|
+
D(""), $(n.name), q(""), z(r), t("open");
|
|
148
148
|
},
|
|
149
149
|
openRead: (r, s) => {
|
|
150
|
-
e.activeIndex = s, q(r),
|
|
150
|
+
e.activeIndex = s, q(r), D(w.Edit), t("open");
|
|
151
151
|
},
|
|
152
152
|
openEdit: (r, s) => {
|
|
153
|
-
e.activeIndex = s, q(r),
|
|
153
|
+
e.activeIndex = s, q(r), D(w.Edit), $(n.name), z(r.type), t("open");
|
|
154
154
|
},
|
|
155
155
|
refresh: g,
|
|
156
|
-
getType:
|
|
157
|
-
RESOURCE_TYPE:
|
|
156
|
+
getType: A,
|
|
157
|
+
RESOURCE_TYPE: V,
|
|
158
158
|
searchBridgeData: (r) => {
|
|
159
|
-
|
|
159
|
+
u.value = i(e.resourceList, r);
|
|
160
160
|
}
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
163
|
}, J = (n, t) => {
|
|
164
|
-
const
|
|
164
|
+
const u = n.__vccOpts || n;
|
|
165
165
|
for (const [e, i] of t)
|
|
166
|
-
|
|
167
|
-
return
|
|
166
|
+
u[e] = i;
|
|
167
|
+
return u;
|
|
168
168
|
}, Ye = { class: "manage-panel" }, He = { class: "manage-panel-search" }, ze = { class: "list lowcode-scrollbar" }, je = ["onClick"], Je = { class: "item-label" };
|
|
169
|
-
function We(n, t,
|
|
170
|
-
const y =
|
|
171
|
-
return
|
|
172
|
-
|
|
169
|
+
function We(n, t, u, e, i, g) {
|
|
170
|
+
const y = p("tiny-icon-search"), o = p("tiny-search"), R = p("svg-icon"), v = p("svg-button"), r = p("search-empty");
|
|
171
|
+
return h(), O("div", Ye, [
|
|
172
|
+
E("div", He, [
|
|
173
173
|
a(o, {
|
|
174
174
|
modelValue: e.state.searchValue,
|
|
175
175
|
"onUpdate:modelValue": [
|
|
@@ -185,22 +185,22 @@ function We(n, t, p, e, i, g) {
|
|
|
185
185
|
_: 1
|
|
186
186
|
}, 8, ["modelValue", "onUpdate:modelValue"])
|
|
187
187
|
]),
|
|
188
|
-
|
|
189
|
-
(
|
|
188
|
+
E("div", ze, [
|
|
189
|
+
(h(!0), O(oe, null, ae(e.list, (s, f) => (h(), O("div", {
|
|
190
190
|
key: s.name,
|
|
191
191
|
class: se(["list-item", f === e.state.activeIndex ? "active" : ""]),
|
|
192
|
-
onClick: X((
|
|
192
|
+
onClick: X((k) => e.openEdit(s, f), ["stop"])
|
|
193
193
|
}, [
|
|
194
|
-
a(
|
|
194
|
+
a(R, {
|
|
195
195
|
name: "plugin-icon-sresources",
|
|
196
196
|
class: "list-item-icon"
|
|
197
197
|
}),
|
|
198
|
-
|
|
198
|
+
E("div", Je, B(s.name), 1),
|
|
199
199
|
a(v, {
|
|
200
200
|
class: "setting-icon",
|
|
201
201
|
hoverBgColor: !1,
|
|
202
202
|
name: "setting",
|
|
203
|
-
onClick: X((
|
|
203
|
+
onClick: X((k) => e.openEdit(s, f), ["stop"])
|
|
204
204
|
}, null, 8, ["onClick"])
|
|
205
205
|
], 10, je))), 128)),
|
|
206
206
|
a(r, {
|
|
@@ -209,67 +209,67 @@ function We(n, t, p, e, i, g) {
|
|
|
209
209
|
])
|
|
210
210
|
]);
|
|
211
211
|
}
|
|
212
|
-
const Ke = /* @__PURE__ */ J(qe, [["render", We], ["__scopeId", "data-v-accaf761"]]), W =
|
|
212
|
+
const Ke = /* @__PURE__ */ J(qe, [["render", We], ["__scopeId", "data-v-accaf761"]]), W = U(!1), Qe = () => {
|
|
213
213
|
W.value = !0, ie(() => window.dispatchEvent(new Event("resize")));
|
|
214
|
-
},
|
|
214
|
+
}, F = () => {
|
|
215
215
|
W.value = !1;
|
|
216
216
|
}, Xe = {
|
|
217
217
|
components: {
|
|
218
|
-
TinyForm:
|
|
219
|
-
TinyInput:
|
|
220
|
-
TinyButton:
|
|
221
|
-
TinyFormItem:
|
|
222
|
-
TinyCheckbox:
|
|
218
|
+
TinyForm: Ne,
|
|
219
|
+
TinyInput: xe,
|
|
220
|
+
TinyButton: Se,
|
|
221
|
+
TinyFormItem: Ve,
|
|
222
|
+
TinyCheckbox: Ce,
|
|
223
223
|
PluginSetting: me,
|
|
224
|
-
MonacoEditor:
|
|
225
|
-
TinyRadioGroup:
|
|
226
|
-
TinyRadio:
|
|
224
|
+
MonacoEditor: ue,
|
|
225
|
+
TinyRadioGroup: be,
|
|
226
|
+
TinyRadio: Re,
|
|
227
227
|
SvgButton: j,
|
|
228
|
-
ButtonGroup:
|
|
228
|
+
ButtonGroup: pe
|
|
229
229
|
},
|
|
230
230
|
setup(n, { emit: t }) {
|
|
231
|
-
const
|
|
231
|
+
const u = {
|
|
232
232
|
language: "javascript",
|
|
233
233
|
mouseStyle: "default",
|
|
234
234
|
minimap: { enabled: !1 },
|
|
235
235
|
// 禁用滚动条边边一直显示的边框
|
|
236
236
|
overviewRulerBorder: !1,
|
|
237
237
|
renderLineHighlightOnlyWhenFocus: !0
|
|
238
|
-
}, { confirm: e } = ye(), { PLUGIN_NAME: i, getPluginByLayout: g } = te(), y =
|
|
239
|
-
resource:
|
|
238
|
+
}, { confirm: e } = ye(), { PLUGIN_NAME: i, getPluginByLayout: g } = te(), y = b(() => g(i.Bridge)), o = M({
|
|
239
|
+
resource: b(() => Ge()),
|
|
240
240
|
name: "",
|
|
241
241
|
value: "",
|
|
242
242
|
content: {},
|
|
243
|
-
status:
|
|
244
|
-
category:
|
|
245
|
-
mode:
|
|
246
|
-
var
|
|
247
|
-
return ((
|
|
243
|
+
status: b(() => H() === w.Edit),
|
|
244
|
+
category: b(() => Y() === P.Npm),
|
|
245
|
+
mode: b(() => {
|
|
246
|
+
var d;
|
|
247
|
+
return ((d = fe("engine.config")) == null ? void 0 : d.dslMode) !== "Vue";
|
|
248
248
|
}),
|
|
249
249
|
isInstance: !1,
|
|
250
|
-
title:
|
|
251
|
-
const
|
|
252
|
-
return
|
|
250
|
+
title: b(() => {
|
|
251
|
+
const d = H() === w.Edit ? "编辑" : "添加", _ = A() === V.Bridge ? "桥接源" : "工具类";
|
|
252
|
+
return d + _;
|
|
253
253
|
}),
|
|
254
|
-
type:
|
|
255
|
-
}),
|
|
256
|
-
const
|
|
257
|
-
let _ =
|
|
258
|
-
o.content.destructuring && (o.name && o.name === o.content.exportName ? _ = `{ ${o.content.exportName || "exportName"} }` : _ = `{ ${o.content.exportName || "exportName"} as ${
|
|
254
|
+
type: P.Npm
|
|
255
|
+
}), R = b(() => {
|
|
256
|
+
const d = o.name || "name";
|
|
257
|
+
let _ = d;
|
|
258
|
+
o.content.destructuring && (o.name && o.name === o.content.exportName ? _ = `{ ${o.content.exportName || "exportName"} }` : _ = `{ ${o.content.exportName || "exportName"} as ${d} }`);
|
|
259
259
|
const c = `${o.content.package || "package"}${o.content.main || ""}`;
|
|
260
260
|
return `import ${_} from '${c}'
|
|
261
|
-
export { ${
|
|
261
|
+
export { ${d} }`;
|
|
262
262
|
});
|
|
263
263
|
ee(() => {
|
|
264
|
-
var
|
|
265
|
-
o.name = o.resource.name, o.content = o.resource.content || {}, o.value = ((_ = (
|
|
264
|
+
var d, _;
|
|
265
|
+
o.name = o.resource.name, o.content = o.resource.content || {}, o.value = ((_ = (d = o.resource) == null ? void 0 : d.content) == null ? void 0 : _.value) || "", o.type = Y();
|
|
266
266
|
}), re(
|
|
267
267
|
() => o.isInstance,
|
|
268
|
-
(
|
|
269
|
-
|
|
268
|
+
(d) => {
|
|
269
|
+
d || (o.content.instance = "");
|
|
270
270
|
}
|
|
271
271
|
);
|
|
272
|
-
const v =
|
|
272
|
+
const v = U(null), r = U(null);
|
|
273
273
|
return le(() => window.dispatchEvent(new Event("resize"))), {
|
|
274
274
|
align: y,
|
|
275
275
|
PLUGIN_NAME: i,
|
|
@@ -277,8 +277,8 @@ export { ${u} }`;
|
|
|
277
277
|
name: [
|
|
278
278
|
{ required: !0, message: "必填", trigger: "change" },
|
|
279
279
|
{
|
|
280
|
-
validator: (
|
|
281
|
-
const Q =
|
|
280
|
+
validator: (d, _, c) => {
|
|
281
|
+
const Q = Pe(A());
|
|
282
282
|
Array.isArray(Q) && Q.includes(_) ? c(new Error("资源名称已存在")) : c();
|
|
283
283
|
},
|
|
284
284
|
trigger: "change"
|
|
@@ -291,15 +291,15 @@ export { ${u} }`;
|
|
|
291
291
|
resourceForm: r,
|
|
292
292
|
editor: v,
|
|
293
293
|
state: o,
|
|
294
|
-
codePreview:
|
|
294
|
+
codePreview: R,
|
|
295
295
|
isOpen: W,
|
|
296
|
-
closePanel:
|
|
296
|
+
closePanel: F,
|
|
297
297
|
save: () => {
|
|
298
|
-
const
|
|
299
|
-
category:
|
|
298
|
+
const d = {
|
|
299
|
+
category: A(),
|
|
300
300
|
type: Y(),
|
|
301
301
|
name: o.name,
|
|
302
|
-
app:
|
|
302
|
+
app: S(x.GlobalService).getBaseInfo().id,
|
|
303
303
|
content: o.category ? o.content : {
|
|
304
304
|
type: "JSFunction",
|
|
305
305
|
value: v.value.getEditor().getValue()
|
|
@@ -308,13 +308,13 @@ export { ${u} }`;
|
|
|
308
308
|
r.value.validate((_) => {
|
|
309
309
|
if (_) {
|
|
310
310
|
if (!o.category && !v.value.getEditor().getValue()) {
|
|
311
|
-
|
|
311
|
+
T({
|
|
312
312
|
type: "error",
|
|
313
313
|
message: "function 内容必填"
|
|
314
314
|
});
|
|
315
315
|
return;
|
|
316
316
|
}
|
|
317
|
-
|
|
317
|
+
Me(d, F, t);
|
|
318
318
|
}
|
|
319
319
|
});
|
|
320
320
|
},
|
|
@@ -323,32 +323,32 @@ export { ${u} }`;
|
|
|
323
323
|
title: "删除资源",
|
|
324
324
|
message: "如果删除正在使用的资源,将无法正常预览页面,确认要删除吗?",
|
|
325
325
|
exec: () => {
|
|
326
|
-
|
|
326
|
+
De(o.name, F, t);
|
|
327
327
|
}
|
|
328
328
|
});
|
|
329
329
|
},
|
|
330
|
-
options:
|
|
331
|
-
handleChangeType: (
|
|
332
|
-
z(
|
|
330
|
+
options: u,
|
|
331
|
+
handleChangeType: (d) => {
|
|
332
|
+
z(d);
|
|
333
333
|
},
|
|
334
|
-
RESOURCE_CATEGORY:
|
|
334
|
+
RESOURCE_CATEGORY: P
|
|
335
335
|
};
|
|
336
336
|
}
|
|
337
337
|
}, Ze = { class: "title-wrap" }, $e = { class: "right-item" }, et = { key: 2 }, tt = { class: "code-preview" };
|
|
338
|
-
function nt(n, t,
|
|
339
|
-
const y =
|
|
340
|
-
return e.isOpen ? (
|
|
338
|
+
function nt(n, t, u, e, i, g) {
|
|
339
|
+
const y = p("tiny-button"), o = p("svg-button"), R = p("button-group"), v = p("tiny-radio"), r = p("tiny-radio-group"), s = p("tiny-form-item"), f = p("tiny-input"), k = p("tiny-checkbox"), K = p("monaco-editor"), d = p("tiny-form"), _ = p("plugin-setting");
|
|
340
|
+
return e.isOpen ? (h(), C(_, {
|
|
341
341
|
key: 0,
|
|
342
342
|
align: e.align,
|
|
343
343
|
"fixed-name": e.PLUGIN_NAME.Bridge
|
|
344
344
|
}, {
|
|
345
345
|
title: l(() => [
|
|
346
|
-
|
|
347
|
-
|
|
346
|
+
E("div", Ze, [
|
|
347
|
+
E("span", null, B(e.state.title), 1)
|
|
348
348
|
])
|
|
349
349
|
]),
|
|
350
350
|
header: l(() => [
|
|
351
|
-
a(
|
|
351
|
+
a(R, null, {
|
|
352
352
|
default: l(() => [
|
|
353
353
|
a(y, {
|
|
354
354
|
class: "save-btn",
|
|
@@ -356,16 +356,16 @@ function nt(n, t, p, e, i, g) {
|
|
|
356
356
|
onClick: e.save
|
|
357
357
|
}, {
|
|
358
358
|
default: l(() => t[10] || (t[10] = [
|
|
359
|
-
|
|
359
|
+
L("保存")
|
|
360
360
|
])),
|
|
361
361
|
_: 1
|
|
362
362
|
}, 8, ["onClick"]),
|
|
363
|
-
e.state.status ? (
|
|
363
|
+
e.state.status ? (h(), C(o, {
|
|
364
364
|
key: 0,
|
|
365
365
|
class: "delete-btn",
|
|
366
366
|
name: "delete",
|
|
367
367
|
onClick: e.deleteReSource
|
|
368
|
-
}, null, 8, ["onClick"])) :
|
|
368
|
+
}, null, 8, ["onClick"])) : N("", !0),
|
|
369
369
|
a(o, {
|
|
370
370
|
class: "close-btn",
|
|
371
371
|
name: "close",
|
|
@@ -376,7 +376,7 @@ function nt(n, t, p, e, i, g) {
|
|
|
376
376
|
})
|
|
377
377
|
]),
|
|
378
378
|
content: l(() => [
|
|
379
|
-
a(
|
|
379
|
+
a(d, {
|
|
380
380
|
ref: "resourceForm",
|
|
381
381
|
class: "resource-form",
|
|
382
382
|
rules: e.rules,
|
|
@@ -387,8 +387,8 @@ function nt(n, t, p, e, i, g) {
|
|
|
387
387
|
"label-align": !0
|
|
388
388
|
}, {
|
|
389
389
|
default: l(() => [
|
|
390
|
-
|
|
391
|
-
e.state.status ?
|
|
390
|
+
E("div", $e, [
|
|
391
|
+
e.state.status ? N("", !0) : (h(), C(s, {
|
|
392
392
|
key: 0,
|
|
393
393
|
label: "工具类型",
|
|
394
394
|
prop: "type"
|
|
@@ -405,7 +405,7 @@ function nt(n, t, p, e, i, g) {
|
|
|
405
405
|
label: e.RESOURCE_CATEGORY.Npm
|
|
406
406
|
}, {
|
|
407
407
|
default: l(() => [
|
|
408
|
-
|
|
408
|
+
L(B(e.RESOURCE_CATEGORY.Npm), 1)
|
|
409
409
|
]),
|
|
410
410
|
_: 1
|
|
411
411
|
}, 8, ["label"]),
|
|
@@ -413,7 +413,7 @@ function nt(n, t, p, e, i, g) {
|
|
|
413
413
|
label: e.RESOURCE_CATEGORY.Function
|
|
414
414
|
}, {
|
|
415
415
|
default: l(() => [
|
|
416
|
-
|
|
416
|
+
L(B(e.RESOURCE_CATEGORY.Function), 1)
|
|
417
417
|
]),
|
|
418
418
|
_: 1
|
|
419
419
|
}, 8, ["label"])
|
|
@@ -423,7 +423,7 @@ function nt(n, t, p, e, i, g) {
|
|
|
423
423
|
]),
|
|
424
424
|
_: 1
|
|
425
425
|
})),
|
|
426
|
-
e.state.status ?
|
|
426
|
+
e.state.status ? N("", !0) : (h(), C(s, {
|
|
427
427
|
key: 1,
|
|
428
428
|
label: "工具名称",
|
|
429
429
|
prop: "name"
|
|
@@ -437,7 +437,7 @@ function nt(n, t, p, e, i, g) {
|
|
|
437
437
|
]),
|
|
438
438
|
_: 1
|
|
439
439
|
})),
|
|
440
|
-
e.state.category ? (
|
|
440
|
+
e.state.category ? (h(), O("div", et, [
|
|
441
441
|
a(s, {
|
|
442
442
|
label: "npm包名",
|
|
443
443
|
prop: "content.package"
|
|
@@ -466,31 +466,31 @@ function nt(n, t, p, e, i, g) {
|
|
|
466
466
|
}),
|
|
467
467
|
a(s, { label: "" }, {
|
|
468
468
|
default: l(() => [
|
|
469
|
-
a(
|
|
469
|
+
a(k, {
|
|
470
470
|
modelValue: e.state.content.destructuring,
|
|
471
471
|
"onUpdate:modelValue": t[4] || (t[4] = (c) => e.state.content.destructuring = c)
|
|
472
472
|
}, {
|
|
473
473
|
default: l(() => t[11] || (t[11] = [
|
|
474
|
-
|
|
474
|
+
L("解构npm包")
|
|
475
475
|
])),
|
|
476
476
|
_: 1
|
|
477
477
|
}, 8, ["modelValue"])
|
|
478
478
|
]),
|
|
479
479
|
_: 1
|
|
480
480
|
}),
|
|
481
|
-
e.state.mode ? (
|
|
481
|
+
e.state.mode ? (h(), C(s, {
|
|
482
482
|
key: 0,
|
|
483
483
|
label: "是否作为实例"
|
|
484
484
|
}, {
|
|
485
485
|
default: l(() => [
|
|
486
|
-
a(
|
|
486
|
+
a(k, {
|
|
487
487
|
modelValue: e.state.isInstance,
|
|
488
488
|
"onUpdate:modelValue": t[5] || (t[5] = (c) => e.state.isInstance = c)
|
|
489
489
|
}, null, 8, ["modelValue"])
|
|
490
490
|
]),
|
|
491
491
|
_: 1
|
|
492
|
-
})) :
|
|
493
|
-
e.state.isInstance ? (
|
|
492
|
+
})) : N("", !0),
|
|
493
|
+
e.state.isInstance ? (h(), C(s, {
|
|
494
494
|
key: 1,
|
|
495
495
|
label: "实例名称",
|
|
496
496
|
prop: "content.instanceName"
|
|
@@ -502,7 +502,7 @@ function nt(n, t, p, e, i, g) {
|
|
|
502
502
|
}, null, 8, ["modelValue"])
|
|
503
503
|
]),
|
|
504
504
|
_: 1
|
|
505
|
-
})) :
|
|
505
|
+
})) : N("", !0),
|
|
506
506
|
a(s, { label: "入口路径" }, {
|
|
507
507
|
default: l(() => [
|
|
508
508
|
a(f, {
|
|
@@ -525,8 +525,8 @@ function nt(n, t, p, e, i, g) {
|
|
|
525
525
|
}),
|
|
526
526
|
a(s, null, {
|
|
527
527
|
label: l(() => t[12] || (t[12] = [
|
|
528
|
-
|
|
529
|
-
|
|
528
|
+
E("div", { class: "cdn-label-wrap" }, [
|
|
529
|
+
E("span", null, "CDN")
|
|
530
530
|
], -1)
|
|
531
531
|
])),
|
|
532
532
|
default: l(() => [
|
|
@@ -535,19 +535,19 @@ function nt(n, t, p, e, i, g) {
|
|
|
535
535
|
"onUpdate:modelValue": t[9] || (t[9] = (c) => e.state.content.cdnLink = c),
|
|
536
536
|
placeholder: "CDN"
|
|
537
537
|
}, null, 8, ["modelValue"]),
|
|
538
|
-
t[13] || (t[13] =
|
|
538
|
+
t[13] || (t[13] = E("div", { class: "tip" }, "浏览器直接可用的生产包链接,请确保可用,否则可能会造成页面预览失败", -1))
|
|
539
539
|
]),
|
|
540
540
|
_: 1
|
|
541
541
|
}),
|
|
542
542
|
a(s, { label: "生成utils.js代码预览" }, {
|
|
543
543
|
default: l(() => [
|
|
544
|
-
|
|
545
|
-
|
|
544
|
+
E("div", tt, [
|
|
545
|
+
E("pre", null, B(e.codePreview), 1)
|
|
546
546
|
])
|
|
547
547
|
]),
|
|
548
548
|
_: 1
|
|
549
549
|
})
|
|
550
|
-
])) : (
|
|
550
|
+
])) : (h(), C(K, {
|
|
551
551
|
key: 3,
|
|
552
552
|
ref: "editor",
|
|
553
553
|
value: e.state.value,
|
|
@@ -560,7 +560,7 @@ function nt(n, t, p, e, i, g) {
|
|
|
560
560
|
}, 8, ["rules", "model"])
|
|
561
561
|
]),
|
|
562
562
|
_: 1
|
|
563
|
-
}, 8, ["align", "fixed-name"])) :
|
|
563
|
+
}, 8, ["align", "fixed-name"])) : N("", !0);
|
|
564
564
|
}
|
|
565
565
|
const ot = /* @__PURE__ */ J(Xe, [["render", nt], ["__scopeId", "data-v-a30fa265"]]), at = {
|
|
566
566
|
components: {
|
|
@@ -575,7 +575,7 @@ const ot = /* @__PURE__ */ J(Xe, [["render", nt], ["__scopeId", "data-v-a30fa265
|
|
|
575
575
|
}
|
|
576
576
|
},
|
|
577
577
|
setup(n, { emit: t }) {
|
|
578
|
-
const
|
|
578
|
+
const u = U(V.Util), e = U(null), i = b(() => Oe[u.value]), { PLUGIN_NAME: g } = te(), y = M({
|
|
579
579
|
emitEvent: t
|
|
580
580
|
});
|
|
581
581
|
return ce("panelState", y), {
|
|
@@ -583,12 +583,12 @@ const ot = /* @__PURE__ */ J(Xe, [["render", nt], ["__scopeId", "data-v-a30fa265
|
|
|
583
583
|
addResource: (r) => {
|
|
584
584
|
e.value.add(r);
|
|
585
585
|
},
|
|
586
|
-
RESOURCE_TYPE:
|
|
587
|
-
activedName:
|
|
586
|
+
RESOURCE_TYPE: V,
|
|
587
|
+
activedName: u,
|
|
588
588
|
openBridgePanel: () => {
|
|
589
589
|
Qe();
|
|
590
590
|
},
|
|
591
|
-
closePanel:
|
|
591
|
+
closePanel: F,
|
|
592
592
|
refreshList: (r) => {
|
|
593
593
|
e.value.refresh(r);
|
|
594
594
|
},
|
|
@@ -597,13 +597,13 @@ const ot = /* @__PURE__ */ J(Xe, [["render", nt], ["__scopeId", "data-v-a30fa265
|
|
|
597
597
|
};
|
|
598
598
|
}
|
|
599
599
|
};
|
|
600
|
-
function st(n, t,
|
|
601
|
-
const y =
|
|
602
|
-
return
|
|
600
|
+
function st(n, t, u, e, i, g) {
|
|
601
|
+
const y = p("svg-button"), o = p("bridge-manage"), R = p("bridge-setting"), v = p("plugin-panel");
|
|
602
|
+
return h(), C(v, {
|
|
603
603
|
title: "资源管理",
|
|
604
604
|
class: "plugin-bridge",
|
|
605
605
|
"fixed-name": e.PLUGIN_NAME.Bridge,
|
|
606
|
-
fixedPanels:
|
|
606
|
+
fixedPanels: u.fixedPanels,
|
|
607
607
|
onClose: e.closePanel
|
|
608
608
|
}, {
|
|
609
609
|
header: l(() => [
|
|
@@ -620,7 +620,7 @@ function st(n, t, p, e, i, g) {
|
|
|
620
620
|
name: e.RESOURCE_TYPE.Util,
|
|
621
621
|
onOpen: e.openBridgePanel
|
|
622
622
|
}, null, 8, ["name", "onOpen"]),
|
|
623
|
-
a(
|
|
623
|
+
a(R, { onRefresh: e.refreshList }, null, 8, ["onRefresh"])
|
|
624
624
|
]),
|
|
625
625
|
_: 1
|
|
626
626
|
}, 8, ["fixed-name", "fixedPanels", "onClose"]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/tiny-engine-plugin-bridge",
|
|
3
|
-
"version": "2.5.0-rc.
|
|
3
|
+
"version": "2.5.0-rc.4",
|
|
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.5.0-rc.
|
|
29
|
-
"@opentiny/tiny-engine-meta-register": "2.5.0-rc.
|
|
28
|
+
"@opentiny/tiny-engine-common": "2.5.0-rc.4",
|
|
29
|
+
"@opentiny/tiny-engine-meta-register": "2.5.0-rc.4"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.5.0-rc.
|
|
32
|
+
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.5.0-rc.4",
|
|
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.20.0",
|
|
40
40
|
"vue": "^3.4.15"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "37ad17e95ed469c5b0b64d8246698d7c7e78393d"
|
|
43
43
|
}
|