@opentiny/tiny-engine-plugin-bridge 2.6.0-alpha.1 → 2.6.0-alpha.10
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 +131 -128
- package/dist/style.css +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "./style.css";
|
|
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
|
|
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 s, withCtx as r, Fragment as oe, renderList as ae, withModifiers as X, normalizeClass as se, toDisplayString as B, computed as C, watch as re, onMounted as le, nextTick as ce, createBlock as b, createCommentVNode as N, createTextVNode as L, provide as ie } from "vue";
|
|
3
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
4
|
import { getMetaApi as S, META_SERVICE as x, useResource as I, useNotify as T, useModal as _e, useLayout as te, getMergeMeta as ye } from "@opentiny/tiny-engine-meta-register";
|
|
5
5
|
import { isVsCodeEnv as fe } from "@opentiny/tiny-engine-common/js/environments";
|
|
6
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
|
|
7
|
+
import { Search as Ee, Radio as Re, RadioGroup as Ce, Checkbox as be, FormItem as Ve, Button as Se, Input as xe, Form as Ne } from "@opentiny/vue";
|
|
8
8
|
import { iconSearch as Te } from "@opentiny/vue-icon";
|
|
9
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
10
|
S(x.Http).get(`/app-center/api/apps/schema/${n}`).then((t) => {
|
|
@@ -68,9 +68,9 @@ const Ue = (n, t) => S(x.Http).get(`/app-center/api/apps/extension/list?app=${n}
|
|
|
68
68
|
try {
|
|
69
69
|
if (e) {
|
|
70
70
|
n.id = m.resource.id;
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
73
|
-
const g = I().appSchemaState[n.category].findIndex((_) => _.name ===
|
|
71
|
+
const l = await Be(n);
|
|
72
|
+
if (l) {
|
|
73
|
+
const g = I().appSchemaState[n.category].findIndex((_) => _.name === l.name);
|
|
74
74
|
if (g === -1) {
|
|
75
75
|
T({
|
|
76
76
|
type: "error",
|
|
@@ -78,25 +78,25 @@ const Ue = (n, t) => S(x.Http).get(`/app-center/api/apps/extension/list?app=${n}
|
|
|
78
78
|
});
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
I().appSchemaState[n.category][g] =
|
|
81
|
+
I().appSchemaState[n.category][g] = l;
|
|
82
82
|
}
|
|
83
83
|
} else {
|
|
84
|
-
const
|
|
85
|
-
|
|
84
|
+
const l = await ke(n);
|
|
85
|
+
l && I().appSchemaState[n.category].push(l);
|
|
86
86
|
}
|
|
87
87
|
ne(G()), T({
|
|
88
88
|
type: "success",
|
|
89
89
|
message: `${e ? "修改" : "创建"}成功`
|
|
90
90
|
}), u("refresh", m.type), m.refresh = !0, t();
|
|
91
|
-
} catch (
|
|
91
|
+
} catch (l) {
|
|
92
92
|
T({
|
|
93
93
|
type: "error",
|
|
94
|
-
message: `工具类${e ? "修改" : "创建"}失败:${
|
|
94
|
+
message: `工具类${e ? "修改" : "创建"}失败:${l.message}`
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
}, De = (n, t, u) => {
|
|
98
|
-
var
|
|
99
|
-
const e = `app=${G()}&id=${(
|
|
98
|
+
var l;
|
|
99
|
+
const e = `app=${G()}&id=${(l = m.resource) == null ? void 0 : l.id}`;
|
|
100
100
|
Ie(e).then((g) => {
|
|
101
101
|
if (g) {
|
|
102
102
|
const _ = I().appSchemaState[m.type].findIndex((o) => o.name === g.name);
|
|
@@ -132,85 +132,85 @@ const Ue = (n, t) => S(x.Http).get(`/app-center/api/apps/extension/list?app=${n}
|
|
|
132
132
|
resourceList: [],
|
|
133
133
|
activeIndex: -1,
|
|
134
134
|
searchValue: ""
|
|
135
|
-
}),
|
|
136
|
-
e.resourceList = await Fe(
|
|
137
|
-
|
|
138
|
-
Array.isArray(e.resourceList) ? e.resourceList.map((
|
|
139
|
-
), u.value =
|
|
135
|
+
}), l = (i = e.resourceList, a = e.searchValue) => i.filter((y) => y.name.toLowerCase().indexOf(a.toLowerCase()) > -1), g = async (i) => {
|
|
136
|
+
e.resourceList = await Fe(i), Ae(
|
|
137
|
+
i,
|
|
138
|
+
Array.isArray(e.resourceList) ? e.resourceList.map((a) => a.name) : []
|
|
139
|
+
), u.value = l(e.resourceList);
|
|
140
140
|
};
|
|
141
141
|
return ee(async () => {
|
|
142
142
|
g(n.name);
|
|
143
143
|
}), {
|
|
144
144
|
state: e,
|
|
145
145
|
list: u,
|
|
146
|
-
add: (
|
|
147
|
-
D(""), $(n.name), q(""), z(
|
|
146
|
+
add: (i) => {
|
|
147
|
+
D(""), $(n.name), q(""), z(i), t("open");
|
|
148
148
|
},
|
|
149
|
-
openRead: (
|
|
150
|
-
e.activeIndex =
|
|
149
|
+
openRead: (i, a) => {
|
|
150
|
+
e.activeIndex = a, q(i), D(w.Edit), t("open");
|
|
151
151
|
},
|
|
152
|
-
openEdit: (
|
|
153
|
-
e.activeIndex =
|
|
152
|
+
openEdit: (i, a) => {
|
|
153
|
+
e.activeIndex = a, q(i), D(w.Edit), $(n.name), z(i.type), t("open");
|
|
154
154
|
},
|
|
155
155
|
refresh: g,
|
|
156
156
|
getType: A,
|
|
157
157
|
RESOURCE_TYPE: V,
|
|
158
|
-
searchBridgeData: (
|
|
159
|
-
u.value =
|
|
158
|
+
searchBridgeData: (i) => {
|
|
159
|
+
u.value = l(e.resourceList, i);
|
|
160
160
|
}
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
163
|
}, J = (n, t) => {
|
|
164
164
|
const u = n.__vccOpts || n;
|
|
165
|
-
for (const [e,
|
|
166
|
-
u[e] =
|
|
165
|
+
for (const [e, l] of t)
|
|
166
|
+
u[e] = l;
|
|
167
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, u, e,
|
|
170
|
-
const _ = p("tiny-icon-search"), o = p("tiny-search"), R = p("svg-icon"), v = p("svg-button"),
|
|
169
|
+
function We(n, t, u, e, l, g) {
|
|
170
|
+
const _ = p("tiny-icon-search"), o = p("tiny-search"), R = p("svg-icon"), v = p("svg-button"), i = p("search-empty");
|
|
171
171
|
return h(), O("div", Ye, [
|
|
172
172
|
E("div", He, [
|
|
173
|
-
|
|
173
|
+
s(o, {
|
|
174
174
|
modelValue: e.state.searchValue,
|
|
175
175
|
"onUpdate:modelValue": [
|
|
176
|
-
t[0] || (t[0] = (
|
|
176
|
+
t[0] || (t[0] = (a) => e.state.searchValue = a),
|
|
177
177
|
e.searchBridgeData
|
|
178
178
|
],
|
|
179
179
|
clearable: "",
|
|
180
180
|
placeholder: "搜索"
|
|
181
181
|
}, {
|
|
182
|
-
prefix:
|
|
183
|
-
|
|
182
|
+
prefix: r(() => [
|
|
183
|
+
s(_)
|
|
184
184
|
]),
|
|
185
185
|
_: 1
|
|
186
186
|
}, 8, ["modelValue", "onUpdate:modelValue"])
|
|
187
187
|
]),
|
|
188
188
|
E("div", ze, [
|
|
189
|
-
(h(!0), O(oe, null, ae(e.list, (
|
|
190
|
-
key:
|
|
189
|
+
(h(!0), O(oe, null, ae(e.list, (a, y) => (h(), O("div", {
|
|
190
|
+
key: a.name,
|
|
191
191
|
class: se(["list-item", y === e.state.activeIndex ? "active" : ""]),
|
|
192
|
-
onClick: X((k) => e.openEdit(
|
|
192
|
+
onClick: X((k) => e.openEdit(a, y), ["stop"])
|
|
193
193
|
}, [
|
|
194
|
-
|
|
194
|
+
s(R, {
|
|
195
195
|
name: "plugin-icon-sresources",
|
|
196
196
|
class: "list-item-icon"
|
|
197
197
|
}),
|
|
198
|
-
E("div", Je, B(
|
|
199
|
-
|
|
198
|
+
E("div", Je, B(a.name), 1),
|
|
199
|
+
s(v, {
|
|
200
200
|
class: "setting-icon",
|
|
201
201
|
hoverBgColor: !1,
|
|
202
202
|
name: "setting",
|
|
203
|
-
onClick: X((k) => e.openEdit(
|
|
203
|
+
onClick: X((k) => e.openEdit(a, y), ["stop"])
|
|
204
204
|
}, null, 8, ["onClick"])
|
|
205
205
|
], 10, je))), 128)),
|
|
206
|
-
|
|
206
|
+
s(i, {
|
|
207
207
|
isShow: !e.list.length
|
|
208
208
|
}, null, 8, ["isShow"])
|
|
209
209
|
])
|
|
210
210
|
]);
|
|
211
211
|
}
|
|
212
212
|
const Ke = /* @__PURE__ */ J(qe, [["render", We], ["__scopeId", "data-v-accaf761"]]), W = U(!1), Qe = () => {
|
|
213
|
-
W.value = !0,
|
|
213
|
+
W.value = !0, ce(() => window.dispatchEvent(new Event("resize")));
|
|
214
214
|
}, F = () => {
|
|
215
215
|
W.value = !1;
|
|
216
216
|
}, Xe = {
|
|
@@ -219,10 +219,10 @@ const Ke = /* @__PURE__ */ J(qe, [["render", We], ["__scopeId", "data-v-accaf761
|
|
|
219
219
|
TinyInput: xe,
|
|
220
220
|
TinyButton: Se,
|
|
221
221
|
TinyFormItem: Ve,
|
|
222
|
-
TinyCheckbox:
|
|
222
|
+
TinyCheckbox: be,
|
|
223
223
|
PluginSetting: me,
|
|
224
224
|
MonacoEditor: ue,
|
|
225
|
-
TinyRadioGroup:
|
|
225
|
+
TinyRadioGroup: Ce,
|
|
226
226
|
TinyRadio: Re,
|
|
227
227
|
SvgButton: j,
|
|
228
228
|
ButtonGroup: pe
|
|
@@ -235,24 +235,24 @@ const Ke = /* @__PURE__ */ J(qe, [["render", We], ["__scopeId", "data-v-accaf761
|
|
|
235
235
|
// 禁用滚动条边边一直显示的边框
|
|
236
236
|
overviewRulerBorder: !1,
|
|
237
237
|
renderLineHighlightOnlyWhenFocus: !0
|
|
238
|
-
}, { confirm: e } = _e(), { PLUGIN_NAME:
|
|
239
|
-
resource:
|
|
238
|
+
}, { confirm: e } = _e(), { PLUGIN_NAME: l, getPluginByLayout: g } = te(), _ = C(() => g(l.Bridge)), o = M({
|
|
239
|
+
resource: C(() => Ge()),
|
|
240
240
|
name: "",
|
|
241
241
|
value: "",
|
|
242
242
|
content: {},
|
|
243
|
-
status:
|
|
244
|
-
category:
|
|
245
|
-
mode:
|
|
243
|
+
status: C(() => H() === w.Edit),
|
|
244
|
+
category: C(() => Y() === P.Npm),
|
|
245
|
+
mode: C(() => {
|
|
246
246
|
var d;
|
|
247
247
|
return ((d = ye("engine.config")) == null ? void 0 : d.dslMode) !== "Vue";
|
|
248
248
|
}),
|
|
249
249
|
isInstance: !1,
|
|
250
|
-
title:
|
|
250
|
+
title: C(() => {
|
|
251
251
|
const d = H() === w.Edit ? "编辑" : "添加", f = A() === V.Bridge ? "桥接源" : "工具类";
|
|
252
252
|
return d + f;
|
|
253
253
|
}),
|
|
254
254
|
type: P.Npm
|
|
255
|
-
}), R =
|
|
255
|
+
}), R = C(() => {
|
|
256
256
|
const d = o.name || "name";
|
|
257
257
|
let f = d;
|
|
258
258
|
o.content.destructuring && (o.name && o.name === o.content.exportName ? f = `{ ${o.content.exportName || "exportName"} }` : f = `{ ${o.content.exportName || "exportName"} as ${d} }`);
|
|
@@ -269,10 +269,10 @@ export { ${d} }`;
|
|
|
269
269
|
d || (o.content.instance = "");
|
|
270
270
|
}
|
|
271
271
|
);
|
|
272
|
-
const v = U(null),
|
|
272
|
+
const v = U(null), i = U(null);
|
|
273
273
|
return le(() => window.dispatchEvent(new Event("resize"))), {
|
|
274
274
|
align: _,
|
|
275
|
-
PLUGIN_NAME:
|
|
275
|
+
PLUGIN_NAME: l,
|
|
276
276
|
rules: {
|
|
277
277
|
name: [
|
|
278
278
|
{ required: !0, message: "必填", trigger: "change" },
|
|
@@ -288,7 +288,7 @@ export { ${d} }`;
|
|
|
288
288
|
"content.exportName": [{ required: !0, message: "必填", trigger: "change" }],
|
|
289
289
|
"content.instanceName": { required: !0, message: "必填", trigger: "change" }
|
|
290
290
|
},
|
|
291
|
-
resourceForm:
|
|
291
|
+
resourceForm: i,
|
|
292
292
|
editor: v,
|
|
293
293
|
state: o,
|
|
294
294
|
codePreview: R,
|
|
@@ -305,7 +305,7 @@ export { ${d} }`;
|
|
|
305
305
|
value: v.value.getEditor().getValue()
|
|
306
306
|
}
|
|
307
307
|
};
|
|
308
|
-
|
|
308
|
+
i.value.validate((f) => {
|
|
309
309
|
if (f) {
|
|
310
310
|
if (!o.category && !v.value.getEditor().getValue()) {
|
|
311
311
|
T({
|
|
@@ -335,39 +335,39 @@ export { ${d} }`;
|
|
|
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, u, e,
|
|
339
|
-
const _ = p("tiny-button"), o = p("svg-button"), R = p("button-group"), v = p("tiny-radio"),
|
|
340
|
-
return e.isOpen ? (h(),
|
|
338
|
+
function nt(n, t, u, e, l, g) {
|
|
339
|
+
const _ = p("tiny-button"), o = p("svg-button"), R = p("button-group"), v = p("tiny-radio"), i = p("tiny-radio-group"), a = p("tiny-form-item"), y = p("tiny-input"), k = p("tiny-checkbox"), K = p("monaco-editor"), d = p("tiny-form"), f = p("plugin-setting");
|
|
340
|
+
return e.isOpen ? (h(), b(f, {
|
|
341
341
|
key: 0,
|
|
342
342
|
align: e.align,
|
|
343
343
|
"fixed-name": e.PLUGIN_NAME.Bridge
|
|
344
344
|
}, {
|
|
345
|
-
title:
|
|
345
|
+
title: r(() => [
|
|
346
346
|
E("div", Ze, [
|
|
347
347
|
E("span", null, B(e.state.title), 1)
|
|
348
348
|
])
|
|
349
349
|
]),
|
|
350
|
-
header:
|
|
351
|
-
|
|
352
|
-
default:
|
|
353
|
-
|
|
350
|
+
header: r(() => [
|
|
351
|
+
s(R, null, {
|
|
352
|
+
default: r(() => [
|
|
353
|
+
s(_, {
|
|
354
354
|
class: "save-btn",
|
|
355
355
|
type: "primary",
|
|
356
356
|
onClick: e.save
|
|
357
357
|
}, {
|
|
358
|
-
default:
|
|
358
|
+
default: r(() => t[10] || (t[10] = [
|
|
359
359
|
L("保存")
|
|
360
360
|
])),
|
|
361
361
|
_: 1,
|
|
362
362
|
__: [10]
|
|
363
363
|
}, 8, ["onClick"]),
|
|
364
|
-
e.state.status ? (h(),
|
|
364
|
+
e.state.status ? (h(), b(o, {
|
|
365
365
|
key: 0,
|
|
366
366
|
class: "delete-btn",
|
|
367
367
|
name: "delete",
|
|
368
368
|
onClick: e.deleteReSource
|
|
369
369
|
}, null, 8, ["onClick"])) : N("", !0),
|
|
370
|
-
|
|
370
|
+
s(o, {
|
|
371
371
|
class: "close-btn",
|
|
372
372
|
name: "close",
|
|
373
373
|
onClick: e.closePanel
|
|
@@ -376,8 +376,8 @@ function nt(n, t, u, e, i, g) {
|
|
|
376
376
|
_: 1
|
|
377
377
|
})
|
|
378
378
|
]),
|
|
379
|
-
content:
|
|
380
|
-
|
|
379
|
+
content: r(() => [
|
|
380
|
+
s(d, {
|
|
381
381
|
ref: "resourceForm",
|
|
382
382
|
class: "resource-form",
|
|
383
383
|
rules: e.rules,
|
|
@@ -387,33 +387,33 @@ function nt(n, t, u, e, i, g) {
|
|
|
387
387
|
"label-position": "top",
|
|
388
388
|
"label-align": !0
|
|
389
389
|
}, {
|
|
390
|
-
default:
|
|
390
|
+
default: r(() => [
|
|
391
391
|
E("div", $e, [
|
|
392
|
-
e.state.status ? N("", !0) : (h(),
|
|
392
|
+
e.state.status ? N("", !0) : (h(), b(a, {
|
|
393
393
|
key: 0,
|
|
394
394
|
label: "工具类型",
|
|
395
395
|
prop: "type"
|
|
396
396
|
}, {
|
|
397
|
-
default:
|
|
398
|
-
|
|
397
|
+
default: r(() => [
|
|
398
|
+
s(i, {
|
|
399
399
|
modelValue: e.state.type,
|
|
400
400
|
"onUpdate:modelValue": t[0] || (t[0] = (c) => e.state.type = c),
|
|
401
401
|
class: "resource-type-radio-group",
|
|
402
402
|
onChange: e.handleChangeType
|
|
403
403
|
}, {
|
|
404
|
-
default:
|
|
405
|
-
|
|
404
|
+
default: r(() => [
|
|
405
|
+
s(v, {
|
|
406
406
|
label: e.RESOURCE_CATEGORY.Npm
|
|
407
407
|
}, {
|
|
408
|
-
default:
|
|
408
|
+
default: r(() => [
|
|
409
409
|
L(B(e.RESOURCE_CATEGORY.Npm), 1)
|
|
410
410
|
]),
|
|
411
411
|
_: 1
|
|
412
412
|
}, 8, ["label"]),
|
|
413
|
-
|
|
413
|
+
s(v, {
|
|
414
414
|
label: e.RESOURCE_CATEGORY.Function
|
|
415
415
|
}, {
|
|
416
|
-
default:
|
|
416
|
+
default: r(() => [
|
|
417
417
|
L(B(e.RESOURCE_CATEGORY.Function), 1)
|
|
418
418
|
]),
|
|
419
419
|
_: 1
|
|
@@ -424,13 +424,13 @@ function nt(n, t, u, e, i, g) {
|
|
|
424
424
|
]),
|
|
425
425
|
_: 1
|
|
426
426
|
})),
|
|
427
|
-
e.state.status ? N("", !0) : (h(),
|
|
427
|
+
e.state.status ? N("", !0) : (h(), b(a, {
|
|
428
428
|
key: 1,
|
|
429
429
|
label: "工具名称",
|
|
430
430
|
prop: "name"
|
|
431
431
|
}, {
|
|
432
|
-
default:
|
|
433
|
-
|
|
432
|
+
default: r(() => [
|
|
433
|
+
s(y, {
|
|
434
434
|
modelValue: e.state.name,
|
|
435
435
|
"onUpdate:modelValue": t[1] || (t[1] = (c) => e.state.name = c),
|
|
436
436
|
placeholder: "请输入工具类名称"
|
|
@@ -439,12 +439,12 @@ function nt(n, t, u, e, i, g) {
|
|
|
439
439
|
_: 1
|
|
440
440
|
})),
|
|
441
441
|
e.state.category ? (h(), O("div", et, [
|
|
442
|
-
a
|
|
442
|
+
s(a, {
|
|
443
443
|
label: "npm包名",
|
|
444
444
|
prop: "content.package"
|
|
445
445
|
}, {
|
|
446
|
-
default:
|
|
447
|
-
|
|
446
|
+
default: r(() => [
|
|
447
|
+
s(y, {
|
|
448
448
|
modelValue: e.state.content.package,
|
|
449
449
|
"onUpdate:modelValue": t[2] || (t[2] = (c) => e.state.content.package = c),
|
|
450
450
|
placeholder: "请输入npm包名称"
|
|
@@ -452,12 +452,12 @@ function nt(n, t, u, e, i, g) {
|
|
|
452
452
|
]),
|
|
453
453
|
_: 1
|
|
454
454
|
}),
|
|
455
|
-
a
|
|
455
|
+
s(a, {
|
|
456
456
|
label: "npm包导出名",
|
|
457
457
|
prop: "content.exportName"
|
|
458
458
|
}, {
|
|
459
|
-
default:
|
|
460
|
-
|
|
459
|
+
default: r(() => [
|
|
460
|
+
s(y, {
|
|
461
461
|
modelValue: e.state.content.exportName,
|
|
462
462
|
"onUpdate:modelValue": t[3] || (t[3] = (c) => e.state.content.exportName = c),
|
|
463
463
|
placeholder: "请输入npm包的导出名称"
|
|
@@ -465,13 +465,13 @@ function nt(n, t, u, e, i, g) {
|
|
|
465
465
|
]),
|
|
466
466
|
_: 1
|
|
467
467
|
}),
|
|
468
|
-
a
|
|
469
|
-
default:
|
|
470
|
-
|
|
468
|
+
s(a, { label: "" }, {
|
|
469
|
+
default: r(() => [
|
|
470
|
+
s(k, {
|
|
471
471
|
modelValue: e.state.content.destructuring,
|
|
472
472
|
"onUpdate:modelValue": t[4] || (t[4] = (c) => e.state.content.destructuring = c)
|
|
473
473
|
}, {
|
|
474
|
-
default:
|
|
474
|
+
default: r(() => t[11] || (t[11] = [
|
|
475
475
|
L("解构npm包")
|
|
476
476
|
])),
|
|
477
477
|
_: 1,
|
|
@@ -480,34 +480,34 @@ function nt(n, t, u, e, i, g) {
|
|
|
480
480
|
]),
|
|
481
481
|
_: 1
|
|
482
482
|
}),
|
|
483
|
-
e.state.mode ? (h(),
|
|
483
|
+
e.state.mode ? (h(), b(a, {
|
|
484
484
|
key: 0,
|
|
485
485
|
label: "是否作为实例"
|
|
486
486
|
}, {
|
|
487
|
-
default:
|
|
488
|
-
|
|
487
|
+
default: r(() => [
|
|
488
|
+
s(k, {
|
|
489
489
|
modelValue: e.state.isInstance,
|
|
490
490
|
"onUpdate:modelValue": t[5] || (t[5] = (c) => e.state.isInstance = c)
|
|
491
491
|
}, null, 8, ["modelValue"])
|
|
492
492
|
]),
|
|
493
493
|
_: 1
|
|
494
494
|
})) : N("", !0),
|
|
495
|
-
e.state.isInstance ? (h(),
|
|
495
|
+
e.state.isInstance ? (h(), b(a, {
|
|
496
496
|
key: 1,
|
|
497
497
|
label: "实例名称",
|
|
498
498
|
prop: "content.instanceName"
|
|
499
499
|
}, {
|
|
500
|
-
default:
|
|
501
|
-
|
|
500
|
+
default: r(() => [
|
|
501
|
+
s(y, {
|
|
502
502
|
modelValue: e.state.content.instance,
|
|
503
503
|
"onUpdate:modelValue": t[6] || (t[6] = (c) => e.state.content.instance = c)
|
|
504
504
|
}, null, 8, ["modelValue"])
|
|
505
505
|
]),
|
|
506
506
|
_: 1
|
|
507
507
|
})) : N("", !0),
|
|
508
|
-
a
|
|
509
|
-
default:
|
|
510
|
-
|
|
508
|
+
s(a, { label: "入口路径" }, {
|
|
509
|
+
default: r(() => [
|
|
510
|
+
s(y, {
|
|
511
511
|
modelValue: e.state.content.main,
|
|
512
512
|
"onUpdate:modelValue": t[7] || (t[7] = (c) => e.state.content.main = c),
|
|
513
513
|
placeholder: "main"
|
|
@@ -515,9 +515,9 @@ function nt(n, t, u, e, i, g) {
|
|
|
515
515
|
]),
|
|
516
516
|
_: 1
|
|
517
517
|
}),
|
|
518
|
-
a
|
|
519
|
-
default:
|
|
520
|
-
|
|
518
|
+
s(a, { label: "版本号" }, {
|
|
519
|
+
default: r(() => [
|
|
520
|
+
s(y, {
|
|
521
521
|
modelValue: e.state.content.version,
|
|
522
522
|
"onUpdate:modelValue": t[8] || (t[8] = (c) => e.state.content.version = c),
|
|
523
523
|
placeholder: "latest"
|
|
@@ -525,14 +525,14 @@ function nt(n, t, u, e, i, g) {
|
|
|
525
525
|
]),
|
|
526
526
|
_: 1
|
|
527
527
|
}),
|
|
528
|
-
a
|
|
529
|
-
label:
|
|
528
|
+
s(a, null, {
|
|
529
|
+
label: r(() => t[12] || (t[12] = [
|
|
530
530
|
E("div", { class: "cdn-label-wrap" }, [
|
|
531
531
|
E("span", null, "CDN")
|
|
532
532
|
], -1)
|
|
533
533
|
])),
|
|
534
|
-
default:
|
|
535
|
-
|
|
534
|
+
default: r(() => [
|
|
535
|
+
s(y, {
|
|
536
536
|
modelValue: e.state.content.cdnLink,
|
|
537
537
|
"onUpdate:modelValue": t[9] || (t[9] = (c) => e.state.content.cdnLink = c),
|
|
538
538
|
placeholder: "CDN"
|
|
@@ -542,15 +542,15 @@ function nt(n, t, u, e, i, g) {
|
|
|
542
542
|
_: 1,
|
|
543
543
|
__: [13]
|
|
544
544
|
}),
|
|
545
|
-
a
|
|
546
|
-
default:
|
|
545
|
+
s(a, { label: "生成utils.js代码预览" }, {
|
|
546
|
+
default: r(() => [
|
|
547
547
|
E("div", tt, [
|
|
548
548
|
E("pre", null, B(e.codePreview), 1)
|
|
549
549
|
])
|
|
550
550
|
]),
|
|
551
551
|
_: 1
|
|
552
552
|
})
|
|
553
|
-
])) : (h(),
|
|
553
|
+
])) : (h(), b(K, {
|
|
554
554
|
key: 3,
|
|
555
555
|
ref: "editor",
|
|
556
556
|
value: e.state.value,
|
|
@@ -565,7 +565,7 @@ function nt(n, t, u, e, i, g) {
|
|
|
565
565
|
_: 1
|
|
566
566
|
}, 8, ["align", "fixed-name"])) : N("", !0);
|
|
567
567
|
}
|
|
568
|
-
const ot = /* @__PURE__ */ J(Xe, [["render", nt], ["__scopeId", "data-v-
|
|
568
|
+
const ot = /* @__PURE__ */ J(Xe, [["render", nt], ["__scopeId", "data-v-614e0f16"]]), at = {
|
|
569
569
|
components: {
|
|
570
570
|
PluginPanel: ge,
|
|
571
571
|
SvgButton: j,
|
|
@@ -578,13 +578,13 @@ const ot = /* @__PURE__ */ J(Xe, [["render", nt], ["__scopeId", "data-v-a30fa265
|
|
|
578
578
|
}
|
|
579
579
|
},
|
|
580
580
|
setup(n, { emit: t }) {
|
|
581
|
-
const u = U(V.Util), e = U(null),
|
|
581
|
+
const u = U(V.Util), e = U(null), l = C(() => Oe[u.value]), g = "资源管理插件提供「工具类方法」功能,支持自定义函数和npm包引用,实现代码复用。轻松添加公共函数或第三方库,应用内全局调用,提升开发效率。", { PLUGIN_NAME: _ } = te(), o = M({
|
|
582
582
|
emitEvent: t
|
|
583
583
|
});
|
|
584
|
-
return
|
|
585
|
-
PLUGIN_NAME:
|
|
586
|
-
addResource: (
|
|
587
|
-
e.value.add(
|
|
584
|
+
return ie("panelState", o), {
|
|
585
|
+
PLUGIN_NAME: _,
|
|
586
|
+
addResource: (a) => {
|
|
587
|
+
e.value.add(a);
|
|
588
588
|
},
|
|
589
589
|
RESOURCE_TYPE: V,
|
|
590
590
|
activedName: u,
|
|
@@ -592,43 +592,46 @@ const ot = /* @__PURE__ */ J(Xe, [["render", nt], ["__scopeId", "data-v-a30fa265
|
|
|
592
592
|
Qe();
|
|
593
593
|
},
|
|
594
594
|
closePanel: F,
|
|
595
|
-
refreshList: (
|
|
596
|
-
e.value.refresh(
|
|
595
|
+
refreshList: (a) => {
|
|
596
|
+
e.value.refresh(a);
|
|
597
597
|
},
|
|
598
598
|
utilsRef: e,
|
|
599
|
-
tips:
|
|
599
|
+
tips: l,
|
|
600
|
+
docsContent: g
|
|
600
601
|
};
|
|
601
602
|
}
|
|
602
603
|
};
|
|
603
|
-
function st(n, t, u, e,
|
|
604
|
+
function st(n, t, u, e, l, g) {
|
|
604
605
|
const _ = p("svg-button"), o = p("bridge-manage"), R = p("bridge-setting"), v = p("plugin-panel");
|
|
605
|
-
return h(),
|
|
606
|
+
return h(), b(v, {
|
|
606
607
|
title: "资源管理",
|
|
607
608
|
class: "plugin-bridge",
|
|
608
609
|
"fixed-name": e.PLUGIN_NAME.Bridge,
|
|
609
610
|
fixedPanels: u.fixedPanels,
|
|
611
|
+
docsContent: e.docsContent,
|
|
612
|
+
isShowDocsIcon: !0,
|
|
610
613
|
onClose: e.closePanel
|
|
611
614
|
}, {
|
|
612
|
-
header:
|
|
613
|
-
|
|
615
|
+
header: r(() => [
|
|
616
|
+
s(_, {
|
|
614
617
|
name: "add-utils",
|
|
615
618
|
placement: "left",
|
|
616
619
|
tips: e.tips,
|
|
617
|
-
onClick: t[0] || (t[0] = (
|
|
620
|
+
onClick: t[0] || (t[0] = (i) => e.addResource("npm"))
|
|
618
621
|
}, null, 8, ["tips"])
|
|
619
622
|
]),
|
|
620
|
-
content:
|
|
621
|
-
|
|
623
|
+
content: r(() => [
|
|
624
|
+
s(o, {
|
|
622
625
|
ref: "utilsRef",
|
|
623
626
|
name: e.RESOURCE_TYPE.Util,
|
|
624
627
|
onOpen: e.openBridgePanel
|
|
625
628
|
}, null, 8, ["name", "onOpen"]),
|
|
626
|
-
|
|
629
|
+
s(R, { onRefresh: e.refreshList }, null, 8, ["onRefresh"])
|
|
627
630
|
]),
|
|
628
631
|
_: 1
|
|
629
|
-
}, 8, ["fixed-name", "fixedPanels", "onClose"]);
|
|
632
|
+
}, 8, ["fixed-name", "fixedPanels", "docsContent", "onClose"]);
|
|
630
633
|
}
|
|
631
|
-
const rt = /* @__PURE__ */ J(at, [["render", st], ["__scopeId", "data-v-
|
|
634
|
+
const rt = /* @__PURE__ */ J(at, [["render", st], ["__scopeId", "data-v-d1d1d35d"]]), lt = {
|
|
632
635
|
id: "engine.plugins.bridge",
|
|
633
636
|
title: "资源管理",
|
|
634
637
|
type: "plugins",
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.manage-panel[data-v-accaf761]{height:100%;display:flex;flex-direction:column;position:relative}.manage-panel .manage-panel-search[data-v-accaf761]{padding:0 12px 12px}.manage-panel .add-button[data-v-accaf761]{align-self:flex-end;margin:6px}.manage-panel .list[data-v-accaf761]{flex:1;border-top:1px solid var(--te-bridge-list-border-color);overflow:auto;padding:12px 0}.manage-panel .list-item[data-v-accaf761]{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(--te-bridge-list-text-color);cursor:pointer;font-size:12px}.manage-panel .list-item[data-v-accaf761]:hover,.manage-panel .list-item.active[data-v-accaf761]{background:var(--te-bridge-list-bg-color)}.manage-panel .list-item:hover .setting-icon[data-v-accaf761],.manage-panel .list-item.active .setting-icon[data-v-accaf761]{display:grid}.manage-panel .list-item .setting-icon[data-v-accaf761]{display:none}.manage-panel .list-item .list-item-icon[data-v-accaf761]{color:var(--te-bridge-list-icon-color);margin-right:8px}.plugin-setting[data-v-
|
|
1
|
+
.manage-panel[data-v-accaf761]{height:100%;display:flex;flex-direction:column;position:relative}.manage-panel .manage-panel-search[data-v-accaf761]{padding:0 12px 12px}.manage-panel .add-button[data-v-accaf761]{align-self:flex-end;margin:6px}.manage-panel .list[data-v-accaf761]{flex:1;border-top:1px solid var(--te-bridge-list-border-color);overflow:auto;padding:12px 0}.manage-panel .list-item[data-v-accaf761]{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(--te-bridge-list-text-color);cursor:pointer;font-size:12px}.manage-panel .list-item[data-v-accaf761]:hover,.manage-panel .list-item.active[data-v-accaf761]{background:var(--te-bridge-list-bg-color)}.manage-panel .list-item:hover .setting-icon[data-v-accaf761],.manage-panel .list-item.active .setting-icon[data-v-accaf761]{display:grid}.manage-panel .list-item .setting-icon[data-v-accaf761]{display:none}.manage-panel .list-item .list-item-icon[data-v-accaf761]{color:var(--te-bridge-list-icon-color);margin-right:8px}.plugin-setting[data-v-614e0f16] .icon-wrap{margin-right:8px}.plugin-setting .resource-form .tip[data-v-614e0f16]{font-size:12px;line-height:18px;margin-top:8px;color:var(--te-bridge-setting-tip-text-color)}.plugin-setting .resource-form[data-v-614e0f16] .tiny-form-item__label .cdn-tips-icon{margin-left:4px}.plugin-setting .title-wrap[data-v-614e0f16]{font-size:12px;font-weight:700;color:var(--te-bridge-setting-title-text-color)}.plugin-setting .title-wrap .help-link[data-v-614e0f16]{display:inline-block;color:var(--te-bridge-setting-link-text-color);font-size:12px;margin-left:16px}.plugin-setting .title-wrap .help-link[data-v-614e0f16]:hover{text-decoration:underline}.plugin-setting .header-wrap[data-v-614e0f16]{display:flex;align-items:center;column-gap:6px}.plugin-setting .header-wrap .tiny-button[data-v-614e0f16]{width:40px;padding:0;min-width:40px;margin-right:2px}.plugin-setting .monaco-editor[data-v-614e0f16]{height:500px;margin-top:8px;border:1px solid var(--te-bridge-editor-border-color)}.plugin-setting .cdn-label-wrap[data-v-614e0f16]{display:flex;align-items:center}.code-preview[data-v-614e0f16]{font-size:12px;line-height:20px;background:var(--te-bridge-setting-code-bg-color);color:var(--te-bridge-setting-code-text-color);border-radius:4px}.code-preview .pre-title[data-v-614e0f16]{font-family:Microsoft YaHei}.code-preview>pre[data-v-614e0f16]{margin:0;padding:8px 20px;font-family:Consolas,Courier New,monospace}[data-v-d1d1d35d] .tiny-button{border-radius:4px;height:24px;line-height:24px}.plugin-bridge{--te-bridge-list-text-color: var(--te-common-text-primary);--te-bridge-list-bg-color: var(--te-common-bg-container);--te-bridge-list-icon-color: var(--te-common-icon-secondary);--te-bridge-list-border-color: var(--te-common-border-default);--te-bridge-editor-border-color: var(--te-common-border-divider);--te-bridge-setting-tip-text-color: var(--te-common-text-weaken);--te-bridge-setting-title-text-color: var(--te-common-text-primary);--te-bridge-setting-link-text-color: var(--te-common-text-link);--te-bridge-setting-code-text-color: var(--te-common-text-weaken);--te-bridge-setting-code-bg-color: var(--te-common-bg-container)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/tiny-engine-plugin-bridge",
|
|
3
|
-
"version": "2.6.0-alpha.
|
|
3
|
+
"version": "2.6.0-alpha.10",
|
|
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.6.0-alpha.
|
|
29
|
-
"@opentiny/tiny-engine-meta-register": "2.6.0-alpha.
|
|
28
|
+
"@opentiny/tiny-engine-common": "2.6.0-alpha.10",
|
|
29
|
+
"@opentiny/tiny-engine-meta-register": "2.6.0-alpha.10"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.6.0-alpha.
|
|
32
|
+
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.6.0-alpha.10",
|
|
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": "5f2a0daecfa5d064ce48ab2c24a919369ef997d6"
|
|
43
43
|
}
|