@opentiny/tiny-engine-plugin-bridge 1.0.2 → 1.0.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 +38 -40
- package/dist/style.css +1 -1
- package/package.json +14 -11
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "./style.css";
|
|
2
|
-
import { reactive as
|
|
2
|
+
import { reactive as j, ref as V, watchEffect as $, resolveComponent as l, openBlock as h, createElementBlock as x, createElementVNode as v, createVNode as s, Fragment as ce, renderList as le, normalizeClass as ie, withModifiers as Q, toDisplayString as w, createCommentVNode as T, pushScopeId as ee, popScopeId as te, computed as C, watch as de, onMounted as pe, createBlock as R, withCtx as r, withDirectives as ue, vShow as me, createTextVNode as k, nextTick as _e } from "vue";
|
|
3
3
|
import { Search as ge, Form as ye, Input as fe, Button as ve, FormItem as he, Checkbox as be, Switch as Ee, Tooltip as Re, RadioGroup as Ce, Radio as Te, Tabs as Ve, TabItem as Se } from "@opentiny/vue";
|
|
4
4
|
import { PluginSetting as Ue, VueMonaco as ke, SvgButton as ne, PluginPanel as Ie, LinkButton as xe } from "@opentiny/tiny-engine-common";
|
|
5
5
|
import { useApp as S, useResource as N, useNotify as B, useModal as we, getGlobalConfig as Ne, useHelp as Be } from "@opentiny/tiny-engine-controller";
|
|
6
6
|
import { isVsCodeEnv as oe } from "@opentiny/tiny-engine-common/js/environments";
|
|
7
|
-
import { updateUtils as
|
|
7
|
+
import { updateUtils as X, deleteUtils as Oe } from "@opentiny/tiny-engine-canvas";
|
|
8
8
|
import { useHttp as Pe } from "@opentiny/tiny-engine-http";
|
|
9
9
|
import { generateBridge as Le, generateUtil as Fe } from "@opentiny/tiny-engine-common/js/vscodeGenerateFile";
|
|
10
10
|
import { iconUnknow as Ae } from "@opentiny/vue-icon";
|
|
@@ -13,7 +13,7 @@ const P = Pe(), Ye = (t, n) => P.get(`/app-center/api/apps/extension/list?app=${
|
|
|
13
13
|
P.get(`/app-center/api/apps/schema/${t}`).then((n) => {
|
|
14
14
|
Le(n.bridge), Fe(n.utils);
|
|
15
15
|
});
|
|
16
|
-
}, i =
|
|
16
|
+
}, i = j({
|
|
17
17
|
actionType: "",
|
|
18
18
|
type: "",
|
|
19
19
|
category: "",
|
|
@@ -22,7 +22,7 @@ const P = Pe(), Ye = (t, n) => P.get(`/app-center/api/apps/extension/list?app=${
|
|
|
22
22
|
resourceNames: {},
|
|
23
23
|
refresh: !1,
|
|
24
24
|
id: S().appInfoState.selectedId
|
|
25
|
-
}),
|
|
25
|
+
}), Z = {
|
|
26
26
|
name: "",
|
|
27
27
|
type: "npm",
|
|
28
28
|
content: {
|
|
@@ -57,27 +57,27 @@ const P = Pe(), Ye = (t, n) => P.get(`/app-center/api/apps/extension/list?app=${
|
|
|
57
57
|
}, Ke = (t) => {
|
|
58
58
|
const n = S().appInfoState.selectedId;
|
|
59
59
|
return Ye(n, t);
|
|
60
|
-
},
|
|
60
|
+
}, M = () => i.actionType, D = (t) => {
|
|
61
61
|
i.actionType = t;
|
|
62
|
-
}, Qe = () => i.resource, Y = (t =
|
|
63
|
-
t || (t = i.category === F.Function ? He :
|
|
64
|
-
}, A = () => i.type,
|
|
62
|
+
}, Qe = () => i.resource, Y = (t = Z) => {
|
|
63
|
+
t || (t = i.category === F.Function ? He : Z), i.resource = t;
|
|
64
|
+
}, A = () => i.type, q = (t) => {
|
|
65
65
|
i.type = t;
|
|
66
|
-
},
|
|
66
|
+
}, z = (t) => {
|
|
67
67
|
i.category = t;
|
|
68
|
-
},
|
|
68
|
+
}, G = () => i.category, H = (...t) => {
|
|
69
69
|
oe && ze(...t);
|
|
70
70
|
}, Xe = (t, n, d) => {
|
|
71
|
-
|
|
71
|
+
M() === O.Edit ? (t.id = i.resource.id, Me(t).then((e) => {
|
|
72
72
|
if (e) {
|
|
73
73
|
const o = N().resState[t.category].findIndex((g) => g.name === e.name);
|
|
74
|
-
N().resState[t.category][o] = e,
|
|
74
|
+
N().resState[t.category][o] = e, X([e]), H(S().appInfoState.selectedId), B({
|
|
75
75
|
type: "success",
|
|
76
76
|
message: "修改成功"
|
|
77
77
|
}), d("refresh", i.type), i.refresh = !0, n();
|
|
78
78
|
}
|
|
79
79
|
})) : Ge(t).then((e) => {
|
|
80
|
-
e && (N().resState[t.category].push(e),
|
|
80
|
+
e && (N().resState[t.category].push(e), X([e]), H(S().appInfoState.selectedId), B({
|
|
81
81
|
type: "success",
|
|
82
82
|
message: "创建成功"
|
|
83
83
|
}), d("refresh", i.type), i.refresh = !0, n());
|
|
@@ -88,14 +88,14 @@ const P = Pe(), Ye = (t, n) => P.get(`/app-center/api/apps/extension/list?app=${
|
|
|
88
88
|
qe(e).then((g) => {
|
|
89
89
|
if (g) {
|
|
90
90
|
const y = N().resState[i.type].findIndex((f) => f.name === g.name);
|
|
91
|
-
N().resState[i.type].splice(y, 1), Oe([g]),
|
|
91
|
+
N().resState[i.type].splice(y, 1), Oe([g]), H(S().appInfoState.selectedId), B({
|
|
92
92
|
type: "success",
|
|
93
93
|
message: "删除成功"
|
|
94
94
|
}), d("refresh", i.type), i.refresh = !0, n();
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
97
|
};
|
|
98
|
-
const
|
|
98
|
+
const J = (t, n) => {
|
|
99
99
|
const d = t.__vccOpts || t;
|
|
100
100
|
for (const [e, o] of n)
|
|
101
101
|
d[e] = o;
|
|
@@ -112,7 +112,7 @@ const j = (t, n) => {
|
|
|
112
112
|
},
|
|
113
113
|
emits: ["open"],
|
|
114
114
|
setup(t, { emit: n }) {
|
|
115
|
-
const d = V([]), e =
|
|
115
|
+
const d = V([]), e = j({
|
|
116
116
|
resourceList: [],
|
|
117
117
|
activeIndex: -1,
|
|
118
118
|
searchValue: ""
|
|
@@ -128,13 +128,13 @@ const j = (t, n) => {
|
|
|
128
128
|
state: e,
|
|
129
129
|
list: d,
|
|
130
130
|
add: (a) => {
|
|
131
|
-
D(""),
|
|
131
|
+
D(""), q(t.name), Y(""), z(a), n("open");
|
|
132
132
|
},
|
|
133
133
|
openRead: (a, u) => {
|
|
134
134
|
e.activeIndex = u, Y(a), D(O.Edit), n("open");
|
|
135
135
|
},
|
|
136
136
|
openEdit: (a, u) => {
|
|
137
|
-
e.activeIndex = u, Y(a), D(O.Edit),
|
|
137
|
+
e.activeIndex = u, Y(a), D(O.Edit), q(t.name), z(a.type), n("open");
|
|
138
138
|
},
|
|
139
139
|
refresh: g,
|
|
140
140
|
getType: A,
|
|
@@ -166,14 +166,14 @@ function lt(t, n, d, e, o, g) {
|
|
|
166
166
|
(h(!0), x(ce, null, le(e.list, (_, b) => (h(), x("div", {
|
|
167
167
|
key: _.name,
|
|
168
168
|
class: ie(["list-item", b === e.state.activeIndex ? "active" : ""]),
|
|
169
|
-
onClick:
|
|
169
|
+
onClick: Q((a) => e.openEdit(_, b), ["stop"])
|
|
170
170
|
}, [
|
|
171
171
|
s(f, { name: "resources" }),
|
|
172
172
|
v("div", st, w(_.name), 1),
|
|
173
173
|
s(f, {
|
|
174
174
|
class: "setting-icon",
|
|
175
175
|
name: "setting",
|
|
176
|
-
onClick:
|
|
176
|
+
onClick: Q((a) => e.openEdit(_, b), ["stop"])
|
|
177
177
|
}, null, 8, ["onClick"])
|
|
178
178
|
], 10, at))), 128)),
|
|
179
179
|
e.list.length ? T("", !0) : (h(), x("div", rt, [
|
|
@@ -186,11 +186,11 @@ function lt(t, n, d, e, o, g) {
|
|
|
186
186
|
])
|
|
187
187
|
]);
|
|
188
188
|
}
|
|
189
|
-
const it = /* @__PURE__ */
|
|
190
|
-
const
|
|
191
|
-
|
|
189
|
+
const it = /* @__PURE__ */ J($e, [["render", lt], ["__scopeId", "data-v-70da6acf"]]);
|
|
190
|
+
const W = V(!1), dt = () => {
|
|
191
|
+
W.value = !0, _e(() => window.dispatchEvent(new Event("resize")));
|
|
192
192
|
}, I = () => {
|
|
193
|
-
|
|
193
|
+
W.value = !1;
|
|
194
194
|
}, pt = {
|
|
195
195
|
components: {
|
|
196
196
|
TinyForm: ye,
|
|
@@ -220,20 +220,20 @@ const J = V(!1), dt = () => {
|
|
|
220
220
|
// 禁用滚动条边边一直显示的边框
|
|
221
221
|
overviewRulerBorder: !1,
|
|
222
222
|
renderLineHighlightOnlyWhenFocus: !0
|
|
223
|
-
}, { confirm: e } = we(), o =
|
|
223
|
+
}, { confirm: e } = we(), o = j({
|
|
224
224
|
resource: C(() => Qe()),
|
|
225
225
|
name: "",
|
|
226
226
|
value: "",
|
|
227
227
|
content: {},
|
|
228
|
-
status: C(() =>
|
|
229
|
-
category: C(() =>
|
|
228
|
+
status: C(() => M() === O.Edit),
|
|
229
|
+
category: C(() => G() === F.Npm),
|
|
230
230
|
mode: C(() => {
|
|
231
231
|
var c;
|
|
232
232
|
return ((c = Ne()) == null ? void 0 : c.dslMode) !== "Vue";
|
|
233
233
|
}),
|
|
234
234
|
isInstance: !1,
|
|
235
235
|
title: C(() => {
|
|
236
|
-
const c =
|
|
236
|
+
const c = M() === O.Edit ? "编辑" : "添加", m = A() === E.Bridge ? "桥接源" : "工具类";
|
|
237
237
|
return c + m;
|
|
238
238
|
}),
|
|
239
239
|
type: F.Npm
|
|
@@ -247,7 +247,7 @@ export { ${c} }`;
|
|
|
247
247
|
});
|
|
248
248
|
$(() => {
|
|
249
249
|
var c, m;
|
|
250
|
-
o.name = o.resource.name, o.content = o.resource.content || {}, o.value = ((m = (c = o.resource) == null ? void 0 : c.content) == null ? void 0 : m.value) || "";
|
|
250
|
+
o.name = o.resource.name, o.content = o.resource.content || {}, o.value = ((m = (c = o.resource) == null ? void 0 : c.content) == null ? void 0 : m.value) || "", o.type = G();
|
|
251
251
|
}), de(
|
|
252
252
|
() => o.isInstance,
|
|
253
253
|
(c) => {
|
|
@@ -275,12 +275,12 @@ export { ${c} }`;
|
|
|
275
275
|
editor: y,
|
|
276
276
|
state: o,
|
|
277
277
|
codePreview: g,
|
|
278
|
-
isOpen:
|
|
278
|
+
isOpen: W,
|
|
279
279
|
closePanel: I,
|
|
280
280
|
save: () => {
|
|
281
281
|
const c = {
|
|
282
282
|
category: A(),
|
|
283
|
-
type:
|
|
283
|
+
type: G(),
|
|
284
284
|
name: o.name,
|
|
285
285
|
app: S().appInfoState.selectedId,
|
|
286
286
|
content: o.category ? o.content : {
|
|
@@ -317,12 +317,12 @@ export { ${c} }`;
|
|
|
317
317
|
},
|
|
318
318
|
options: d,
|
|
319
319
|
handleChangeType: (c) => {
|
|
320
|
-
|
|
320
|
+
z(c);
|
|
321
321
|
},
|
|
322
322
|
RESOURCE_CATEGORY: F
|
|
323
323
|
};
|
|
324
324
|
}
|
|
325
|
-
},
|
|
325
|
+
}, K = (t) => (ee("data-v-46796b24"), t = t(), te(), t), ut = { class: "title-wrap" }, mt = { class: "header-wrap" }, _t = { class: "right-item" }, gt = { key: 2 }, yt = { class: "cdn-label-wrap" }, ft = /* @__PURE__ */ K(() => /* @__PURE__ */ v("span", null, "CDN", -1)), vt = { class: "code-preview" }, ht = /* @__PURE__ */ K(() => /* @__PURE__ */ v("span", { class: "pre-title" }, "生成的", -1)), bt = /* @__PURE__ */ K(() => /* @__PURE__ */ v("span", { class: "pre-title" }, "代码预览", -1));
|
|
326
326
|
function Et(t, n, d, e, o, g) {
|
|
327
327
|
const y = l("svg-button"), f = l("tiny-button"), _ = l("tiny-radio"), b = l("tiny-radio-group"), a = l("tiny-form-item"), u = l("tiny-input"), c = l("tiny-switch"), m = l("tiny-checkbox"), U = l("icon-unknow"), L = l("tiny-tooltip"), ae = l("monaco-editor"), se = l("tiny-form"), re = l("plugin-setting");
|
|
328
328
|
return e.isOpen ? (h(), R(re, { key: 0 }, {
|
|
@@ -384,8 +384,7 @@ function Et(t, n, d, e, o, g) {
|
|
|
384
384
|
}, {
|
|
385
385
|
default: r(() => [
|
|
386
386
|
s(_, {
|
|
387
|
-
label: e.RESOURCE_CATEGORY.Npm
|
|
388
|
-
class: "resource-type-radio-item"
|
|
387
|
+
label: e.RESOURCE_CATEGORY.Npm
|
|
389
388
|
}, {
|
|
390
389
|
default: r(() => [
|
|
391
390
|
k(w(e.RESOURCE_CATEGORY.Npm), 1)
|
|
@@ -393,8 +392,7 @@ function Et(t, n, d, e, o, g) {
|
|
|
393
392
|
_: 1
|
|
394
393
|
}, 8, ["label"]),
|
|
395
394
|
s(_, {
|
|
396
|
-
label: e.RESOURCE_CATEGORY.Function
|
|
397
|
-
class: "resource-type-radio-item"
|
|
395
|
+
label: e.RESOURCE_CATEGORY.Function
|
|
398
396
|
}, {
|
|
399
397
|
default: r(() => [
|
|
400
398
|
k(w(e.RESOURCE_CATEGORY.Function), 1)
|
|
@@ -552,7 +550,7 @@ function Et(t, n, d, e, o, g) {
|
|
|
552
550
|
_: 1
|
|
553
551
|
})) : T("", !0);
|
|
554
552
|
}
|
|
555
|
-
const Rt = /* @__PURE__ */
|
|
553
|
+
const Rt = /* @__PURE__ */ J(pt, [["render", Et], ["__scopeId", "data-v-46796b24"]]);
|
|
556
554
|
const Ct = {
|
|
557
555
|
components: {
|
|
558
556
|
TinyTabs: Ve,
|
|
@@ -572,7 +570,7 @@ const Ct = {
|
|
|
572
570
|
RESOURCE_TYPE: E,
|
|
573
571
|
activedName: t,
|
|
574
572
|
switchTab: (a) => {
|
|
575
|
-
I(),
|
|
573
|
+
I(), q(a.name);
|
|
576
574
|
},
|
|
577
575
|
openBridgePanel: () => {
|
|
578
576
|
dt();
|
|
@@ -652,7 +650,7 @@ function Tt(t, n, d, e, o, g) {
|
|
|
652
650
|
_: 1
|
|
653
651
|
}, 8, ["onClose"]);
|
|
654
652
|
}
|
|
655
|
-
const Vt = /* @__PURE__ */
|
|
653
|
+
const Vt = /* @__PURE__ */ J(Ct, [["render", Tt], ["__scopeId", "data-v-e04eb86e"]]), Ft = {
|
|
656
654
|
id: "Bridge",
|
|
657
655
|
title: "资源管理",
|
|
658
656
|
icon: "plugin-icon-sresources",
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.manage-panel[data-v-70da6acf]{height:100%;display:flex;flex-direction:column;position:relative}.manage-panel .manage-panel-search[data-v-70da6acf]{padding:8px}.manage-panel .add-button[data-v-70da6acf]{align-self:flex-end;margin:6px}.manage-panel .list[data-v-70da6acf]{flex:1;border-top:1px solid var(--ti-lowcode-tabs-border-color);overflow:auto}.manage-panel .list-item[data-v-70da6acf]{height:28px;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-70da6acf]:hover,.manage-panel .list-item.active[data-v-70da6acf]{background:var(--ti-lowcode-bridge-list-bg)}.manage-panel .list-item svg[data-v-70da6acf]{color:var(--ti-lowcode-toolbar-more-hover-color)}.plugin-setting[data-v-
|
|
1
|
+
.manage-panel[data-v-70da6acf]{height:100%;display:flex;flex-direction:column;position:relative}.manage-panel .manage-panel-search[data-v-70da6acf]{padding:8px}.manage-panel .add-button[data-v-70da6acf]{align-self:flex-end;margin:6px}.manage-panel .list[data-v-70da6acf]{flex:1;border-top:1px solid var(--ti-lowcode-tabs-border-color);overflow:auto}.manage-panel .list-item[data-v-70da6acf]{height:28px;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-70da6acf]:hover,.manage-panel .list-item.active[data-v-70da6acf]{background:var(--ti-lowcode-bridge-list-bg)}.manage-panel .list-item svg[data-v-70da6acf]{color:var(--ti-lowcode-toolbar-more-hover-color)}.plugin-setting[data-v-46796b24] .icon-wrap{margin-right:8px}.plugin-setting .resource-form[data-v-46796b24] .tiny-form-item__label .cdn-tips-icon{margin-left:4px}.plugin-setting .title-wrap .help-link[data-v-46796b24]{display:inline-block;color:var(--ti-lowcode-common-primary-color);font-size:12px;margin-left:16px}.plugin-setting .title-wrap .help-link[data-v-46796b24]:hover{text-decoration:underline}.plugin-setting .header-wrap[data-v-46796b24]{display:flex;align-items:center;column-gap:16px}.plugin-setting .header-wrap .delete-btn[data-v-46796b24]{color:var(--ti-lowcode-common-text-color-5)}.plugin-setting .header-wrap .delete-btn[data-v-46796b24]:hover{color:var(--ti-lowcode-common-primary-text-color)}.plugin-setting .monaco-editor[data-v-46796b24]{height:500px;margin-top:8px;border:1px solid var(--ti-lowcode-birdge-editor-border-color)}.plugin-setting .resource-form-footer[data-v-46796b24]{padding:12px 0 12px 80px}.plugin-setting .resource-form-footer .tiny-svg[data-v-46796b24]{margin-right:6px}.plugin-setting .resource-form-footer .del[data-v-46796b24]:hover{background-color:var(--ti-lowcode-delete-button-hover-bg)}.plugin-setting .cdn-label-wrap[data-v-46796b24]{display:flex;align-items:center}.code-preview[data-v-46796b24]{font-size:14px;line-height:20px;margin-left:12px;color:var(--ti-lowcode-birdge-code-preview-color);background-color:var(--ti-lowcode-birdge-code-preview-bg-color);border-radius:6px}.code-preview .pre-title[data-v-46796b24]{font-family:Microsoft YaHei}.code-preview>pre[data-v-46796b24]{margin:0;padding:8px 20px;font-family:Consolas,Courier New,monospace}.tabs[data-v-e04eb86e]{height:calc(100% - 46px)}[data-v-e04eb86e] .tiny-tabs__header{padding:8px;border-bottom:1px solid var(--ti-lowcode-tabs-border-color)}[data-v-e04eb86e] .tiny-tabs__content{height:calc(100% - 45px);padding:0}[data-v-e04eb86e] .tiny-tabs__content>div{height:100%}[data-v-e04eb86e] .help-box{position:absolute;left:72px;top:3px}
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/tiny-engine-plugin-bridge",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "vite build"
|
|
9
|
+
},
|
|
7
10
|
"main": "dist/index.js",
|
|
8
11
|
"module": "dist/index.js",
|
|
9
12
|
"files": [
|
|
@@ -21,20 +24,20 @@
|
|
|
21
24
|
"license": "MIT",
|
|
22
25
|
"homepage": "https://opentiny.design/tiny-engine",
|
|
23
26
|
"dependencies": {
|
|
27
|
+
"@opentiny/tiny-engine-canvas": "1.0.3",
|
|
28
|
+
"@opentiny/tiny-engine-common": "1.0.2",
|
|
29
|
+
"@opentiny/tiny-engine-controller": "1.0.3",
|
|
30
|
+
"@opentiny/tiny-engine-http": "1.0.2",
|
|
24
31
|
"@opentiny/vue": "~3.10.0",
|
|
25
|
-
"@opentiny/vue-icon": "~3.10.0"
|
|
26
|
-
"vue": "3.2.45",
|
|
27
|
-
"@opentiny/tiny-engine-canvas": "1.0.2",
|
|
28
|
-
"@opentiny/tiny-engine-common": "1.0.1",
|
|
29
|
-
"@opentiny/tiny-engine-http": "1.0.1",
|
|
30
|
-
"@opentiny/tiny-engine-controller": "1.0.2"
|
|
32
|
+
"@opentiny/vue-icon": "~3.10.0"
|
|
31
33
|
},
|
|
32
34
|
"devDependencies": {
|
|
33
35
|
"@vitejs/plugin-vue": "^4.2.3",
|
|
34
36
|
"@vitejs/plugin-vue-jsx": "^1.3.10",
|
|
35
37
|
"vite": "^4.3.7"
|
|
36
38
|
},
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
}
|
|
40
|
-
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"vue": "^3.4.15"
|
|
41
|
+
},
|
|
42
|
+
"gitHead": "9a6cce3988accb39c97a9a21169c022c65a8e27f"
|
|
43
|
+
}
|