@opentiny/tiny-engine-plugin-bridge 2.0.0-alpha.2 → 2.0.0-alpha.3
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 +99 -102
- package/package.json +10 -9
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import "./style.css";
|
|
2
|
-
import { reactive as j, ref as
|
|
3
|
-
import { SearchEmpty as
|
|
4
|
-
import { useApp as
|
|
2
|
+
import { reactive as j, ref as b, watchEffect as X, resolveComponent as m, openBlock as h, createElementBlock as L, createElementVNode as _, createVNode as s, withCtx as l, Fragment as ee, renderList as te, normalizeClass as ne, withModifiers as W, toDisplayString as U, computed as E, watch as oe, onMounted as ae, createBlock as C, createTextVNode as B, withDirectives as se, vShow as re, createCommentVNode as T, nextTick as le } from "vue";
|
|
3
|
+
import { SearchEmpty as ce, PluginSetting as ie, VueMonaco as de, SvgButton as Z, PluginPanel as pe } from "@opentiny/tiny-engine-common";
|
|
4
|
+
import { useApp as x, useCanvas as $, useResource as k, useNotify as N, useModal as ue, getMergeMeta as me } from "@opentiny/tiny-engine-meta-register";
|
|
5
5
|
import { isVsCodeEnv as ge } from "@opentiny/tiny-engine-common/js/environments";
|
|
6
|
-
import { useHttp as
|
|
7
|
-
import { generateBridge as ye, generateUtil as
|
|
8
|
-
import { Search as ve, Form as he, Input as Re, Button as Ee, FormItem as Ce, Checkbox as Ve, RadioGroup as Se, Radio as
|
|
9
|
-
import { iconSearch as
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
ye(t.bridge),
|
|
6
|
+
import { useHttp as fe } from "@opentiny/tiny-engine-http";
|
|
7
|
+
import { generateBridge as ye, generateUtil as _e } from "@opentiny/tiny-engine-common/js/vscodeGenerateFile";
|
|
8
|
+
import { Search as ve, Form as he, Input as Re, Button as Ee, FormItem as Ce, Checkbox as Ve, RadioGroup as Se, Radio as be } from "@opentiny/vue";
|
|
9
|
+
import { iconSearch as xe } from "@opentiny/vue-icon";
|
|
10
|
+
const w = fe(), Te = (n, t) => w.get(`/app-center/api/apps/extension/list?app=${n}&category=${t}`), Ue = (n) => w.post("/app-center/api/apps/extension/create", n), ke = (n) => w.post("/app-center/api/apps/extension/update", n), Ne = (n) => w.get(`/app-center/api/apps/extension/delete?${n}`), Ie = (n) => {
|
|
11
|
+
w.get(`/app-center/api/apps/schema/${n}`).then((t) => {
|
|
12
|
+
ye(t.bridge), _e(t.utils);
|
|
13
13
|
});
|
|
14
14
|
}, i = j({
|
|
15
15
|
actionType: "",
|
|
@@ -31,7 +31,7 @@ const B = _e(), Te = (n, t) => B.get(`/app-center/api/apps/extension/list?app=${
|
|
|
31
31
|
destructuring: !0,
|
|
32
32
|
main: ""
|
|
33
33
|
}
|
|
34
|
-
},
|
|
34
|
+
}, we = {
|
|
35
35
|
name: "",
|
|
36
36
|
type: "function",
|
|
37
37
|
content: {
|
|
@@ -44,21 +44,21 @@ const B = _e(), Te = (n, t) => B.get(`/app-center/api/apps/extension/list?app=${
|
|
|
44
44
|
}, A = {
|
|
45
45
|
Npm: "npm",
|
|
46
46
|
Function: "function"
|
|
47
|
-
},
|
|
47
|
+
}, Oe = {
|
|
48
48
|
[V.Util]: "新建工具类",
|
|
49
49
|
[V.Bridge]: "新建桥接源"
|
|
50
50
|
}, I = {
|
|
51
51
|
Read: "read",
|
|
52
52
|
Edit: "edit"
|
|
53
|
-
},
|
|
53
|
+
}, Be = (n) => i.resourceNames[n], Le = (n, t) => {
|
|
54
54
|
i.resourceNames[n] = t;
|
|
55
55
|
}, Ae = (n) => {
|
|
56
|
-
const t =
|
|
56
|
+
const t = x().appInfoState.selectedId;
|
|
57
57
|
return Te(t, n);
|
|
58
58
|
}, G = () => i.actionType, D = (n) => {
|
|
59
59
|
i.actionType = n;
|
|
60
60
|
}, Fe = () => i.resource, M = (n = K) => {
|
|
61
|
-
n || (n = i.category === A.Function ?
|
|
61
|
+
n || (n = i.category === A.Function ? we : K), i.resource = n;
|
|
62
62
|
}, F = () => i.type, Q = (n) => {
|
|
63
63
|
i.type = n;
|
|
64
64
|
}, Y = (n) => {
|
|
@@ -69,32 +69,31 @@ const B = _e(), Te = (n, t) => B.get(`/app-center/api/apps/extension/list?app=${
|
|
|
69
69
|
const { updateUtils: e } = $().canvasApi.value;
|
|
70
70
|
G() === I.Edit ? (n.id = i.resource.id, ke(n).then((o) => {
|
|
71
71
|
if (o) {
|
|
72
|
-
const
|
|
73
|
-
k().resState[n.category][
|
|
72
|
+
const f = k().resState[n.category].findIndex((c) => c.name === o.name);
|
|
73
|
+
k().resState[n.category][f] = o, e([o]), z(x().appInfoState.selectedId), N({
|
|
74
74
|
type: "success",
|
|
75
75
|
message: "修改成功"
|
|
76
76
|
}), u("refresh", i.type), i.refresh = !0, t();
|
|
77
77
|
}
|
|
78
78
|
})) : Ue(n).then((o) => {
|
|
79
|
-
o && (k().resState[n.category].push(o), e([o]), z(
|
|
79
|
+
o && (k().resState[n.category].push(o), e([o]), z(x().appInfoState.selectedId), N({
|
|
80
80
|
type: "success",
|
|
81
81
|
message: "创建成功"
|
|
82
82
|
}), u("refresh", i.type), i.refresh = !0, t());
|
|
83
83
|
});
|
|
84
84
|
}, De = (n, t, u) => {
|
|
85
|
-
var
|
|
86
|
-
const e = `app=${
|
|
87
|
-
Ne(e).then((
|
|
88
|
-
if (
|
|
89
|
-
const y = k().resState[i.type].findIndex((v) => v.name ===
|
|
90
|
-
k().resState[i.type].splice(y, 1), o([
|
|
85
|
+
var f;
|
|
86
|
+
const e = `app=${x().appInfoState.selectedId}&id=${(f = i.resource) == null ? void 0 : f.id}`, { deleteUtils: o } = $().canvasApi.value;
|
|
87
|
+
Ne(e).then((c) => {
|
|
88
|
+
if (c) {
|
|
89
|
+
const y = k().resState[i.type].findIndex((v) => v.name === c.name);
|
|
90
|
+
k().resState[i.type].splice(y, 1), o([c]), z(x().appInfoState.selectedId), N({
|
|
91
91
|
type: "success",
|
|
92
92
|
message: "删除成功"
|
|
93
93
|
}), u("refresh", i.type), i.refresh = !0, t();
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
|
-
}
|
|
97
|
-
const H = (n, t) => {
|
|
96
|
+
}, H = (n, t) => {
|
|
98
97
|
const u = n.__vccOpts || n;
|
|
99
98
|
for (const [e, o] of t)
|
|
100
99
|
u[e] = o;
|
|
@@ -102,8 +101,8 @@ const H = (n, t) => {
|
|
|
102
101
|
}, Me = {
|
|
103
102
|
components: {
|
|
104
103
|
TinySearch: ve,
|
|
105
|
-
TinyIconSearch:
|
|
106
|
-
SearchEmpty:
|
|
104
|
+
TinyIconSearch: xe(),
|
|
105
|
+
SearchEmpty: ce
|
|
107
106
|
},
|
|
108
107
|
props: {
|
|
109
108
|
name: {
|
|
@@ -113,18 +112,18 @@ const H = (n, t) => {
|
|
|
113
112
|
},
|
|
114
113
|
emits: ["open"],
|
|
115
114
|
setup(n, { emit: t }) {
|
|
116
|
-
const u =
|
|
115
|
+
const u = b([]), e = j({
|
|
117
116
|
resourceList: [],
|
|
118
117
|
activeIndex: -1,
|
|
119
118
|
searchValue: ""
|
|
120
|
-
}), o = (a = e.resourceList, d = e.searchValue) => a.filter((r) => r.name.toLowerCase().indexOf(d.toLowerCase()) > -1),
|
|
119
|
+
}), o = (a = e.resourceList, d = e.searchValue) => a.filter((r) => r.name.toLowerCase().indexOf(d.toLowerCase()) > -1), f = async (a) => {
|
|
121
120
|
e.resourceList = await Ae(a), Le(
|
|
122
121
|
a,
|
|
123
122
|
Array.isArray(e.resourceList) ? e.resourceList.map((d) => d.name) : []
|
|
124
123
|
), u.value = o(e.resourceList);
|
|
125
124
|
};
|
|
126
125
|
return X(async () => {
|
|
127
|
-
|
|
126
|
+
f(n.name);
|
|
128
127
|
}), {
|
|
129
128
|
state: e,
|
|
130
129
|
list: u,
|
|
@@ -137,7 +136,7 @@ const H = (n, t) => {
|
|
|
137
136
|
openEdit: (a, d) => {
|
|
138
137
|
e.activeIndex = d, M(a), D(I.Edit), Q(n.name), Y(a.type), t("open");
|
|
139
138
|
},
|
|
140
|
-
refresh:
|
|
139
|
+
refresh: f,
|
|
141
140
|
getType: F,
|
|
142
141
|
RESOURCE_TYPE: V,
|
|
143
142
|
searchBridgeData: (a) => {
|
|
@@ -146,10 +145,10 @@ const H = (n, t) => {
|
|
|
146
145
|
};
|
|
147
146
|
}
|
|
148
147
|
}, qe = { class: "manage-panel" }, Ge = { class: "manage-panel-search" }, Ye = { class: "list" }, ze = ["onClick"], je = { class: "item-label" };
|
|
149
|
-
function He(n, t, u, e, o,
|
|
150
|
-
const
|
|
148
|
+
function He(n, t, u, e, o, f) {
|
|
149
|
+
const c = m("tiny-icon-search"), y = m("tiny-search"), v = m("svg-icon"), R = m("search-empty");
|
|
151
150
|
return h(), L("div", qe, [
|
|
152
|
-
|
|
151
|
+
_("div", Ge, [
|
|
153
152
|
s(y, {
|
|
154
153
|
modelValue: e.state.searchValue,
|
|
155
154
|
"onUpdate:modelValue": [
|
|
@@ -159,20 +158,20 @@ function He(n, t, u, e, o, _) {
|
|
|
159
158
|
clearable: "",
|
|
160
159
|
placeholder: "搜索"
|
|
161
160
|
}, {
|
|
162
|
-
prefix:
|
|
163
|
-
s(
|
|
161
|
+
prefix: l(() => [
|
|
162
|
+
s(c)
|
|
164
163
|
]),
|
|
165
164
|
_: 1
|
|
166
165
|
}, 8, ["modelValue", "onUpdate:modelValue"])
|
|
167
166
|
]),
|
|
168
|
-
|
|
167
|
+
_("div", Ye, [
|
|
169
168
|
(h(!0), L(ee, null, te(e.list, (a, d) => (h(), L("div", {
|
|
170
169
|
key: a.name,
|
|
171
170
|
class: ne(["list-item", d === e.state.activeIndex ? "active" : ""]),
|
|
172
171
|
onClick: W((r) => e.openEdit(a, d), ["stop"])
|
|
173
172
|
}, [
|
|
174
173
|
s(v, { name: "resources" }),
|
|
175
|
-
|
|
174
|
+
_("div", je, U(a.name), 1),
|
|
176
175
|
s(v, {
|
|
177
176
|
class: "setting-icon",
|
|
178
177
|
name: "setting",
|
|
@@ -185,9 +184,8 @@ function He(n, t, u, e, o, _) {
|
|
|
185
184
|
])
|
|
186
185
|
]);
|
|
187
186
|
}
|
|
188
|
-
const Je = /* @__PURE__ */ H(Me, [["render", He], ["__scopeId", "data-v-c8f41500"]])
|
|
189
|
-
|
|
190
|
-
J.value = !0, ce(() => window.dispatchEvent(new Event("resize")));
|
|
187
|
+
const Je = /* @__PURE__ */ H(Me, [["render", He], ["__scopeId", "data-v-c8f41500"]]), J = b(!1), We = () => {
|
|
188
|
+
J.value = !0, le(() => window.dispatchEvent(new Event("resize")));
|
|
191
189
|
}, P = () => {
|
|
192
190
|
J.value = !1;
|
|
193
191
|
}, Ke = {
|
|
@@ -200,7 +198,7 @@ const J = x(!1), We = () => {
|
|
|
200
198
|
PluginSetting: ie,
|
|
201
199
|
MonacoEditor: de,
|
|
202
200
|
TinyRadioGroup: Se,
|
|
203
|
-
TinyRadio:
|
|
201
|
+
TinyRadio: be,
|
|
204
202
|
SvgButton: Z
|
|
205
203
|
},
|
|
206
204
|
setup(n, { emit: t }) {
|
|
@@ -228,7 +226,7 @@ const J = x(!1), We = () => {
|
|
|
228
226
|
return r + g;
|
|
229
227
|
}),
|
|
230
228
|
type: A.Npm
|
|
231
|
-
}),
|
|
229
|
+
}), f = E(() => {
|
|
232
230
|
const r = o.name || "name";
|
|
233
231
|
let g = r;
|
|
234
232
|
o.content.destructuring && (o.name && o.name === o.content.exportName ? g = `{ ${o.content.exportName || "exportName"} }` : g = `{ ${o.content.exportName || "exportName"} as ${r} }`);
|
|
@@ -245,15 +243,15 @@ export { ${r} }`;
|
|
|
245
243
|
r || (o.content.instance = "");
|
|
246
244
|
}
|
|
247
245
|
);
|
|
248
|
-
const
|
|
246
|
+
const c = b(null), y = b(null);
|
|
249
247
|
return ae(() => window.dispatchEvent(new Event("resize"))), {
|
|
250
248
|
rules: {
|
|
251
249
|
name: [
|
|
252
250
|
{ required: !0, message: "必填", trigger: "change" },
|
|
253
251
|
{
|
|
254
252
|
validator: (r, g, S) => {
|
|
255
|
-
const
|
|
256
|
-
Array.isArray(
|
|
253
|
+
const O = Be(F());
|
|
254
|
+
Array.isArray(O) && O.includes(g) ? S(new Error("资源名称已存在")) : S();
|
|
257
255
|
},
|
|
258
256
|
trigger: "change"
|
|
259
257
|
}
|
|
@@ -263,9 +261,9 @@ export { ${r} }`;
|
|
|
263
261
|
"content.instanceName": { required: !0, message: "必填", trigger: "change" }
|
|
264
262
|
},
|
|
265
263
|
resourceForm: y,
|
|
266
|
-
editor:
|
|
264
|
+
editor: c,
|
|
267
265
|
state: o,
|
|
268
|
-
codePreview:
|
|
266
|
+
codePreview: f,
|
|
269
267
|
isOpen: J,
|
|
270
268
|
closePanel: P,
|
|
271
269
|
save: () => {
|
|
@@ -273,10 +271,10 @@ export { ${r} }`;
|
|
|
273
271
|
category: F(),
|
|
274
272
|
type: q(),
|
|
275
273
|
name: o.name,
|
|
276
|
-
app:
|
|
274
|
+
app: x().appInfoState.selectedId,
|
|
277
275
|
content: o.category ? o.content : {
|
|
278
276
|
type: "JSFunction",
|
|
279
|
-
value:
|
|
277
|
+
value: c.value.getEditor().getValue()
|
|
280
278
|
}
|
|
281
279
|
};
|
|
282
280
|
y.value.validate((g) => {
|
|
@@ -287,7 +285,7 @@ export { ${r} }`;
|
|
|
287
285
|
});
|
|
288
286
|
return;
|
|
289
287
|
}
|
|
290
|
-
if (!o.category && !
|
|
288
|
+
if (!o.category && !c.value.getEditor().getValue()) {
|
|
291
289
|
N({
|
|
292
290
|
type: "error",
|
|
293
291
|
message: "function 内容必填"
|
|
@@ -314,23 +312,23 @@ export { ${r} }`;
|
|
|
314
312
|
};
|
|
315
313
|
}
|
|
316
314
|
}, Qe = { class: "title-wrap" }, Xe = { class: "header-wrap" }, Ze = { class: "right-item" }, $e = { key: 2 }, et = { class: "code-preview" };
|
|
317
|
-
function tt(n, t, u, e, o,
|
|
318
|
-
const
|
|
319
|
-
return e.isOpen ? (h(), C(
|
|
320
|
-
title:
|
|
321
|
-
|
|
322
|
-
|
|
315
|
+
function tt(n, t, u, e, o, f) {
|
|
316
|
+
const c = m("tiny-button"), y = m("svg-button"), v = m("tiny-radio"), R = m("tiny-radio-group"), a = m("tiny-form-item"), d = m("tiny-input"), r = m("tiny-checkbox"), g = m("monaco-editor"), S = m("tiny-form"), O = m("plugin-setting");
|
|
317
|
+
return e.isOpen ? (h(), C(O, { key: 0 }, {
|
|
318
|
+
title: l(() => [
|
|
319
|
+
_("div", Qe, [
|
|
320
|
+
_("span", null, U(e.state.title), 1)
|
|
323
321
|
])
|
|
324
322
|
]),
|
|
325
|
-
header:
|
|
326
|
-
|
|
327
|
-
s(
|
|
323
|
+
header: l(() => [
|
|
324
|
+
_("div", Xe, [
|
|
325
|
+
s(c, {
|
|
328
326
|
class: "save-btn",
|
|
329
327
|
type: "primary",
|
|
330
328
|
onClick: e.save
|
|
331
329
|
}, {
|
|
332
|
-
default:
|
|
333
|
-
|
|
330
|
+
default: l(() => t[10] || (t[10] = [
|
|
331
|
+
B("保存")
|
|
334
332
|
])),
|
|
335
333
|
_: 1
|
|
336
334
|
}, 8, ["onClick"]),
|
|
@@ -348,7 +346,7 @@ function tt(n, t, u, e, o, _) {
|
|
|
348
346
|
}, null, 8, ["onClick"])
|
|
349
347
|
])
|
|
350
348
|
]),
|
|
351
|
-
content:
|
|
349
|
+
content: l(() => [
|
|
352
350
|
s(S, {
|
|
353
351
|
ref: "resourceForm",
|
|
354
352
|
class: "resource-form",
|
|
@@ -359,34 +357,34 @@ function tt(n, t, u, e, o, _) {
|
|
|
359
357
|
"label-position": "top",
|
|
360
358
|
"label-align": !0
|
|
361
359
|
}, {
|
|
362
|
-
default:
|
|
363
|
-
|
|
360
|
+
default: l(() => [
|
|
361
|
+
_("div", Ze, [
|
|
364
362
|
e.state.status ? T("", !0) : (h(), C(a, {
|
|
365
363
|
key: 0,
|
|
366
364
|
label: "工具类型",
|
|
367
365
|
prop: "type"
|
|
368
366
|
}, {
|
|
369
|
-
default:
|
|
367
|
+
default: l(() => [
|
|
370
368
|
s(R, {
|
|
371
369
|
modelValue: e.state.type,
|
|
372
370
|
"onUpdate:modelValue": t[0] || (t[0] = (p) => e.state.type = p),
|
|
373
371
|
class: "resource-type-radio-group",
|
|
374
372
|
onChange: e.handleChangeType
|
|
375
373
|
}, {
|
|
376
|
-
default:
|
|
374
|
+
default: l(() => [
|
|
377
375
|
s(v, {
|
|
378
376
|
label: e.RESOURCE_CATEGORY.Npm
|
|
379
377
|
}, {
|
|
380
|
-
default:
|
|
381
|
-
|
|
378
|
+
default: l(() => [
|
|
379
|
+
B(U(e.RESOURCE_CATEGORY.Npm), 1)
|
|
382
380
|
]),
|
|
383
381
|
_: 1
|
|
384
382
|
}, 8, ["label"]),
|
|
385
383
|
s(v, {
|
|
386
384
|
label: e.RESOURCE_CATEGORY.Function
|
|
387
385
|
}, {
|
|
388
|
-
default:
|
|
389
|
-
|
|
386
|
+
default: l(() => [
|
|
387
|
+
B(U(e.RESOURCE_CATEGORY.Function), 1)
|
|
390
388
|
]),
|
|
391
389
|
_: 1
|
|
392
390
|
}, 8, ["label"])
|
|
@@ -401,7 +399,7 @@ function tt(n, t, u, e, o, _) {
|
|
|
401
399
|
label: "工具名称",
|
|
402
400
|
prop: "name"
|
|
403
401
|
}, {
|
|
404
|
-
default:
|
|
402
|
+
default: l(() => [
|
|
405
403
|
s(d, {
|
|
406
404
|
modelValue: e.state.name,
|
|
407
405
|
"onUpdate:modelValue": t[1] || (t[1] = (p) => e.state.name = p),
|
|
@@ -415,7 +413,7 @@ function tt(n, t, u, e, o, _) {
|
|
|
415
413
|
label: "npm包名",
|
|
416
414
|
prop: "content.package"
|
|
417
415
|
}, {
|
|
418
|
-
default:
|
|
416
|
+
default: l(() => [
|
|
419
417
|
s(d, {
|
|
420
418
|
modelValue: e.state.content.package,
|
|
421
419
|
"onUpdate:modelValue": t[2] || (t[2] = (p) => e.state.content.package = p),
|
|
@@ -428,7 +426,7 @@ function tt(n, t, u, e, o, _) {
|
|
|
428
426
|
label: "npm包导出名",
|
|
429
427
|
prop: "content.exportName"
|
|
430
428
|
}, {
|
|
431
|
-
default:
|
|
429
|
+
default: l(() => [
|
|
432
430
|
s(d, {
|
|
433
431
|
modelValue: e.state.content.exportName,
|
|
434
432
|
"onUpdate:modelValue": t[3] || (t[3] = (p) => e.state.content.exportName = p),
|
|
@@ -438,13 +436,13 @@ function tt(n, t, u, e, o, _) {
|
|
|
438
436
|
_: 1
|
|
439
437
|
}),
|
|
440
438
|
s(a, { label: "" }, {
|
|
441
|
-
default:
|
|
439
|
+
default: l(() => [
|
|
442
440
|
s(r, {
|
|
443
441
|
modelValue: e.state.content.destructuring,
|
|
444
442
|
"onUpdate:modelValue": t[4] || (t[4] = (p) => e.state.content.destructuring = p)
|
|
445
443
|
}, {
|
|
446
|
-
default:
|
|
447
|
-
|
|
444
|
+
default: l(() => t[11] || (t[11] = [
|
|
445
|
+
B("解构npm包")
|
|
448
446
|
])),
|
|
449
447
|
_: 1
|
|
450
448
|
}, 8, ["modelValue"])
|
|
@@ -455,7 +453,7 @@ function tt(n, t, u, e, o, _) {
|
|
|
455
453
|
key: 0,
|
|
456
454
|
label: "是否作为实例"
|
|
457
455
|
}, {
|
|
458
|
-
default:
|
|
456
|
+
default: l(() => [
|
|
459
457
|
s(r, {
|
|
460
458
|
modelValue: e.state.isInstance,
|
|
461
459
|
"onUpdate:modelValue": t[5] || (t[5] = (p) => e.state.isInstance = p)
|
|
@@ -468,7 +466,7 @@ function tt(n, t, u, e, o, _) {
|
|
|
468
466
|
label: "实例名称",
|
|
469
467
|
prop: "content.instanceName"
|
|
470
468
|
}, {
|
|
471
|
-
default:
|
|
469
|
+
default: l(() => [
|
|
472
470
|
s(d, {
|
|
473
471
|
modelValue: e.state.content.instance,
|
|
474
472
|
"onUpdate:modelValue": t[6] || (t[6] = (p) => e.state.content.instance = p)
|
|
@@ -477,7 +475,7 @@ function tt(n, t, u, e, o, _) {
|
|
|
477
475
|
_: 1
|
|
478
476
|
})) : T("", !0),
|
|
479
477
|
s(a, { label: "入口路径" }, {
|
|
480
|
-
default:
|
|
478
|
+
default: l(() => [
|
|
481
479
|
s(d, {
|
|
482
480
|
modelValue: e.state.content.main,
|
|
483
481
|
"onUpdate:modelValue": t[7] || (t[7] = (p) => e.state.content.main = p),
|
|
@@ -487,7 +485,7 @@ function tt(n, t, u, e, o, _) {
|
|
|
487
485
|
_: 1
|
|
488
486
|
}),
|
|
489
487
|
s(a, { label: "版本号" }, {
|
|
490
|
-
default:
|
|
488
|
+
default: l(() => [
|
|
491
489
|
s(d, {
|
|
492
490
|
modelValue: e.state.content.version,
|
|
493
491
|
"onUpdate:modelValue": t[8] || (t[8] = (p) => e.state.content.version = p),
|
|
@@ -497,25 +495,25 @@ function tt(n, t, u, e, o, _) {
|
|
|
497
495
|
_: 1
|
|
498
496
|
}),
|
|
499
497
|
s(a, null, {
|
|
500
|
-
label:
|
|
501
|
-
|
|
502
|
-
|
|
498
|
+
label: l(() => t[12] || (t[12] = [
|
|
499
|
+
_("div", { class: "cdn-label-wrap" }, [
|
|
500
|
+
_("span", null, "CDN")
|
|
503
501
|
], -1)
|
|
504
502
|
])),
|
|
505
|
-
default:
|
|
503
|
+
default: l(() => [
|
|
506
504
|
s(d, {
|
|
507
505
|
modelValue: e.state.content.cdnLink,
|
|
508
506
|
"onUpdate:modelValue": t[9] || (t[9] = (p) => e.state.content.cdnLink = p),
|
|
509
507
|
placeholder: "CDN"
|
|
510
508
|
}, null, 8, ["modelValue"]),
|
|
511
|
-
t[13] || (t[13] =
|
|
509
|
+
t[13] || (t[13] = _("div", { class: "tip" }, "浏览器直接可用的生产包链接,请确保可用,否则可能会造成页面预览失败", -1))
|
|
512
510
|
]),
|
|
513
511
|
_: 1
|
|
514
512
|
}),
|
|
515
513
|
s(a, { label: "生成utils.js代码预览" }, {
|
|
516
|
-
default:
|
|
517
|
-
|
|
518
|
-
|
|
514
|
+
default: l(() => [
|
|
515
|
+
_("div", et, [
|
|
516
|
+
_("pre", null, U(e.codePreview), 1)
|
|
519
517
|
])
|
|
520
518
|
]),
|
|
521
519
|
_: 1
|
|
@@ -535,8 +533,7 @@ function tt(n, t, u, e, o, _) {
|
|
|
535
533
|
_: 1
|
|
536
534
|
})) : T("", !0);
|
|
537
535
|
}
|
|
538
|
-
const nt = /* @__PURE__ */ H(Ke, [["render", tt], ["__scopeId", "data-v-0d684f9e"]])
|
|
539
|
-
const ot = {
|
|
536
|
+
const nt = /* @__PURE__ */ H(Ke, [["render", tt], ["__scopeId", "data-v-0d684f9e"]]), ot = {
|
|
540
537
|
components: {
|
|
541
538
|
PluginPanel: pe,
|
|
542
539
|
SvgButton: Z,
|
|
@@ -544,10 +541,10 @@ const ot = {
|
|
|
544
541
|
BridgeSetting: nt
|
|
545
542
|
},
|
|
546
543
|
setup() {
|
|
547
|
-
const n =
|
|
544
|
+
const n = b(V.Util), t = b(null), u = E(() => Oe[n.value]);
|
|
548
545
|
return {
|
|
549
|
-
addResource: (
|
|
550
|
-
n.value == t.value.add(
|
|
546
|
+
addResource: (c) => {
|
|
547
|
+
n.value == t.value.add(c);
|
|
551
548
|
},
|
|
552
549
|
RESOURCE_TYPE: V,
|
|
553
550
|
activedName: n,
|
|
@@ -555,30 +552,30 @@ const ot = {
|
|
|
555
552
|
We();
|
|
556
553
|
},
|
|
557
554
|
closePanel: P,
|
|
558
|
-
refreshList: (
|
|
559
|
-
|
|
555
|
+
refreshList: (c) => {
|
|
556
|
+
c == t.value.refresh(c);
|
|
560
557
|
},
|
|
561
558
|
utilsRef: t,
|
|
562
559
|
tips: u
|
|
563
560
|
};
|
|
564
561
|
}
|
|
565
562
|
};
|
|
566
|
-
function at(n, t, u, e, o,
|
|
567
|
-
const
|
|
563
|
+
function at(n, t, u, e, o, f) {
|
|
564
|
+
const c = m("svg-button"), y = m("bridge-manage"), v = m("bridge-setting"), R = m("plugin-panel");
|
|
568
565
|
return h(), C(R, {
|
|
569
566
|
title: "资源管理",
|
|
570
567
|
isCloseLeft: !1,
|
|
571
568
|
onClose: e.closePanel
|
|
572
569
|
}, {
|
|
573
|
-
header:
|
|
574
|
-
s(
|
|
570
|
+
header: l(() => [
|
|
571
|
+
s(c, {
|
|
575
572
|
name: "add-utils",
|
|
576
573
|
placement: "left",
|
|
577
574
|
tips: e.tips,
|
|
578
575
|
onClick: t[0] || (t[0] = (a) => e.addResource("npm"))
|
|
579
576
|
}, null, 8, ["tips"])
|
|
580
577
|
]),
|
|
581
|
-
content:
|
|
578
|
+
content: l(() => [
|
|
582
579
|
s(y, {
|
|
583
580
|
ref: "utilsRef",
|
|
584
581
|
name: e.RESOURCE_TYPE.Util,
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/tiny-engine-plugin-bridge",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "vite build"
|
|
9
9
|
},
|
|
10
|
+
"type": "module",
|
|
10
11
|
"main": "dist/index.js",
|
|
11
12
|
"module": "dist/index.js",
|
|
12
13
|
"files": [
|
|
@@ -24,20 +25,20 @@
|
|
|
24
25
|
"license": "MIT",
|
|
25
26
|
"homepage": "https://opentiny.design/tiny-engine",
|
|
26
27
|
"dependencies": {
|
|
27
|
-
"@opentiny/tiny-engine-common": "2.0.0-alpha.
|
|
28
|
-
"@opentiny/tiny-engine-http": "2.0.0-alpha.
|
|
29
|
-
"@opentiny/tiny-engine-meta-register": "2.0.0-alpha.
|
|
28
|
+
"@opentiny/tiny-engine-common": "2.0.0-alpha.3",
|
|
29
|
+
"@opentiny/tiny-engine-http": "2.0.0-alpha.3",
|
|
30
|
+
"@opentiny/tiny-engine-meta-register": "2.0.0-alpha.3"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
|
-
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.0.0-alpha.
|
|
33
|
-
"@vitejs/plugin-vue": "^
|
|
34
|
-
"@vitejs/plugin-vue-jsx": "^
|
|
35
|
-
"vite": "^4.
|
|
33
|
+
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.0.0-alpha.3",
|
|
34
|
+
"@vitejs/plugin-vue": "^5.1.2",
|
|
35
|
+
"@vitejs/plugin-vue-jsx": "^4.0.1",
|
|
36
|
+
"vite": "^5.4.2"
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
39
|
"@opentiny/vue": "^3.14.0",
|
|
39
40
|
"@opentiny/vue-icon": "^3.14.0",
|
|
40
41
|
"vue": "^3.4.15"
|
|
41
42
|
},
|
|
42
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "20aba1ffa81a1633feec954e3146586193c18f22"
|
|
43
44
|
}
|