@opentiny/tiny-engine-plugin-bridge 2.0.0-alpha.6 → 2.0.0-rc.1

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 CHANGED
@@ -1,15 +1,14 @@
1
1
  import "./style.css";
2
- import { reactive as j, ref as S, watchEffect as X, resolveComponent as m, openBlock as h, createElementBlock as A, createElementVNode as _, createVNode as s, withCtx as l, Fragment as ne, renderList as oe, normalizeClass as ae, withModifiers as W, toDisplayString as T, computed as R, watch as se, onMounted as re, createBlock as C, createTextVNode as B, withDirectives as le, vShow as ce, createCommentVNode as x, nextTick as ie } from "vue";
3
- import { SearchEmpty as de, PluginSetting as pe, VueMonaco as ue, SvgButton as Z, PluginPanel as me } from "@opentiny/tiny-engine-common";
4
- import { getMetaApi as $, META_SERVICE as ee, useCanvas as te, useResource as U, useNotify as k, useModal as ge, getMergeMeta as ye } from "@opentiny/tiny-engine-meta-register";
5
- import { isVsCodeEnv as fe } from "@opentiny/tiny-engine-common/js/environments";
6
- import { useHttp as _e } from "@opentiny/tiny-engine-http";
7
- import { generateBridge as ve, generateUtil as he } from "@opentiny/tiny-engine-common/js/vscodeGenerateFile";
8
- import { Search as Ee, Form as Re, Input as Ce, Button as Ve, FormItem as be, Checkbox as Se, RadioGroup as xe, Radio as Te } from "@opentiny/vue";
9
- import { iconSearch as Ue } from "@opentiny/vue-icon";
10
- const w = _e(), ke = (n, t) => w.get(`/app-center/api/apps/extension/list?app=${n}&category=${t}`), Ne = (n) => w.post("/app-center/api/apps/extension/create", n), Ie = (n) => w.post("/app-center/api/apps/extension/update", n), we = (n) => w.get(`/app-center/api/apps/extension/delete?${n}`), Oe = (n) => {
11
- w.get(`/app-center/api/apps/schema/${n}`).then((t) => {
12
- ve(t.bridge), he(t.utils);
2
+ import { reactive as j, ref as T, watchEffect as Z, resolveComponent as m, openBlock as h, createElementBlock as L, createElementVNode as _, createVNode as s, withCtx as l, Fragment as te, renderList as ne, normalizeClass as oe, withModifiers as K, toDisplayString as k, computed as R, watch as ae, onMounted as se, createBlock as C, createTextVNode as A, withDirectives as re, vShow as le, createCommentVNode as U, nextTick as ce } from "vue";
3
+ import { SearchEmpty as ie, PluginSetting as de, VueMonaco as pe, SvgButton as $, PluginPanel as ue } from "@opentiny/tiny-engine-common";
4
+ import { getMetaApi as b, META_SERVICE as S, useCanvas as ee, useResource as N, useNotify as B, useModal as me, getMergeMeta as ge } from "@opentiny/tiny-engine-meta-register";
5
+ import { isVsCodeEnv as ye } from "@opentiny/tiny-engine-common/js/environments";
6
+ import { generateBridge as fe, generateUtil as _e } from "@opentiny/tiny-engine-common/js/vscodeGenerateFile";
7
+ import { Search as ve, Form as he, Input as Ee, Button as Re, FormItem as Ce, Checkbox as Ve, RadioGroup as be, Radio as Se } from "@opentiny/vue";
8
+ import { iconSearch as xe } from "@opentiny/vue-icon";
9
+ const Te = (n, t) => b(S.Http).get(`/app-center/api/apps/extension/list?app=${n}&category=${t}`), Ue = (n) => b(S.Http).post("/app-center/api/apps/extension/create", n), ke = (n) => b(S.Http).post("/app-center/api/apps/extension/update", n), Ne = (n) => b(S.Http).get(`/app-center/api/apps/extension/delete?${n}`), Be = (n) => {
10
+ b(S.Http).get(`/app-center/api/apps/schema/${n}`).then((t) => {
11
+ fe(t.bridge), _e(t.utils);
13
12
  });
14
13
  }, i = j({
15
14
  actionType: "",
@@ -20,7 +19,7 @@ const w = _e(), ke = (n, t) => w.get(`/app-center/api/apps/extension/list?app=${
20
19
  resourceNames: {},
21
20
  refresh: !1,
22
21
  id: ""
23
- }), K = {
22
+ }), Q = {
24
23
  name: "",
25
24
  type: "npm",
26
25
  content: {
@@ -31,7 +30,7 @@ const w = _e(), ke = (n, t) => w.get(`/app-center/api/apps/extension/list?app=${
31
30
  destructuring: !0,
32
31
  main: ""
33
32
  }
34
- }, Be = {
33
+ }, Ie = {
35
34
  name: "",
36
35
  type: "function",
37
36
  content: {
@@ -41,68 +40,68 @@ const w = _e(), ke = (n, t) => w.get(`/app-center/api/apps/extension/list?app=${
41
40
  }, V = {
42
41
  Util: "utils",
43
42
  Bridge: "bridge"
44
- }, L = {
43
+ }, F = {
45
44
  Npm: "npm",
46
45
  Function: "function"
47
- }, Ae = {
46
+ }, we = {
48
47
  [V.Util]: "新建工具类",
49
48
  [V.Bridge]: "新建桥接源"
50
- }, N = {
49
+ }, I = {
51
50
  Read: "read",
52
51
  Edit: "edit"
53
- }, I = () => $(ee.GlobalService).getState().appInfo.id, Le = (n) => i.resourceNames[n], Fe = (n, t) => {
52
+ }, w = () => b(S.GlobalService).getBaseInfo().id, Oe = (n) => i.resourceNames[n], Ae = (n, t) => {
54
53
  i.resourceNames[n] = t;
55
- }, Pe = (n) => {
56
- const t = I();
57
- return ke(t, n);
58
- }, q = () => i.actionType, D = (n) => {
54
+ }, Le = (n) => {
55
+ const t = w();
56
+ return Te(t, n);
57
+ }, Y = () => i.actionType, M = (n) => {
59
58
  i.actionType = n;
60
- }, De = () => i.resource, M = (n = K) => {
61
- n || (n = i.category === L.Function ? Be : K), i.resource = n;
62
- }, F = () => i.type, Q = (n) => {
59
+ }, Fe = () => i.resource, G = (n = Q) => {
60
+ n || (n = i.category === F.Function ? Ie : Q), i.resource = n;
61
+ }, P = () => i.type, X = (n) => {
63
62
  i.type = n;
64
- }, Y = (n) => {
63
+ }, H = (n) => {
65
64
  i.category = n;
66
- }, G = () => i.category, z = (...n) => {
67
- fe && Oe(...n);
68
- }, Me = (n, t, u) => {
69
- const { updateUtils: e } = te().canvasApi.value;
70
- q() === N.Edit ? (n.id = i.resource.id, Ie(n).then((o) => {
65
+ }, q = () => i.category, z = (...n) => {
66
+ ye && Be(...n);
67
+ }, Pe = (n, t, u) => {
68
+ const { updateUtils: e } = ee().canvasApi.value;
69
+ Y() === I.Edit ? (n.id = i.resource.id, ke(n).then((o) => {
71
70
  if (o) {
72
- const y = U().resState[n.category].findIndex((c) => c.name === o.name);
73
- U().resState[n.category][y] = o, e([o]), z(I()), k({
71
+ const y = N().resState[n.category].findIndex((c) => c.name === o.name);
72
+ N().resState[n.category][y] = o, e([o]), z(w()), B({
74
73
  type: "success",
75
74
  message: "修改成功"
76
75
  }), u("refresh", i.type), i.refresh = !0, t();
77
76
  }
78
- })) : Ne(n).then((o) => {
79
- o && (U().resState[n.category].push(o), e([o]), z(I()), k({
77
+ })) : Ue(n).then((o) => {
78
+ o && (N().resState[n.category].push(o), e([o]), z(w()), B({
80
79
  type: "success",
81
80
  message: "创建成功"
82
81
  }), u("refresh", i.type), i.refresh = !0, t());
83
82
  });
84
- }, Ge = (n, t, u) => {
83
+ }, De = (n, t, u) => {
85
84
  var y;
86
- const e = `app=${I()}&id=${(y = i.resource) == null ? void 0 : y.id}`, { deleteUtils: o } = te().canvasApi.value;
87
- we(e).then((c) => {
85
+ const e = `app=${w()}&id=${(y = i.resource) == null ? void 0 : y.id}`, { deleteUtils: o } = ee().canvasApi.value;
86
+ Ne(e).then((c) => {
88
87
  if (c) {
89
- const f = U().resState[i.type].findIndex((v) => v.name === c.name);
90
- U().resState[i.type].splice(f, 1), o([c]), z(I()), k({
88
+ const f = N().resState[i.type].findIndex((v) => v.name === c.name);
89
+ N().resState[i.type].splice(f, 1), o([c]), z(w()), B({
91
90
  type: "success",
92
91
  message: "删除成功"
93
92
  }), u("refresh", i.type), i.refresh = !0, t();
94
93
  }
95
94
  });
96
- }, H = (n, t) => {
95
+ }, J = (n, t) => {
97
96
  const u = n.__vccOpts || n;
98
97
  for (const [e, o] of t)
99
98
  u[e] = o;
100
99
  return u;
101
- }, qe = {
100
+ }, Me = {
102
101
  components: {
103
- TinySearch: Ee,
104
- TinyIconSearch: Ue(),
105
- SearchEmpty: de
102
+ TinySearch: ve,
103
+ TinyIconSearch: xe(),
104
+ SearchEmpty: ie
106
105
  },
107
106
  props: {
108
107
  name: {
@@ -112,43 +111,43 @@ const w = _e(), ke = (n, t) => w.get(`/app-center/api/apps/extension/list?app=${
112
111
  },
113
112
  emits: ["open"],
114
113
  setup(n, { emit: t }) {
115
- const u = S([]), e = j({
114
+ const u = T([]), e = j({
116
115
  resourceList: [],
117
116
  activeIndex: -1,
118
117
  searchValue: ""
119
118
  }), o = (a = e.resourceList, d = e.searchValue) => a.filter((r) => r.name.toLowerCase().indexOf(d.toLowerCase()) > -1), y = async (a) => {
120
- e.resourceList = await Pe(a), Fe(
119
+ e.resourceList = await Le(a), Ae(
121
120
  a,
122
121
  Array.isArray(e.resourceList) ? e.resourceList.map((d) => d.name) : []
123
122
  ), u.value = o(e.resourceList);
124
123
  };
125
- return X(async () => {
124
+ return Z(async () => {
126
125
  y(n.name);
127
126
  }), {
128
127
  state: e,
129
128
  list: u,
130
129
  add: (a) => {
131
- D(""), Q(n.name), M(""), Y(a), t("open");
130
+ M(""), X(n.name), G(""), H(a), t("open");
132
131
  },
133
132
  openRead: (a, d) => {
134
- e.activeIndex = d, M(a), D(N.Edit), t("open");
133
+ e.activeIndex = d, G(a), M(I.Edit), t("open");
135
134
  },
136
135
  openEdit: (a, d) => {
137
- e.activeIndex = d, M(a), D(N.Edit), Q(n.name), Y(a.type), t("open");
136
+ e.activeIndex = d, G(a), M(I.Edit), X(n.name), H(a.type), t("open");
138
137
  },
139
138
  refresh: y,
140
- getType: F,
139
+ getType: P,
141
140
  RESOURCE_TYPE: V,
142
141
  searchBridgeData: (a) => {
143
142
  u.value = o(e.resourceList, a);
144
143
  }
145
144
  };
146
145
  }
147
- }, Ye = { class: "manage-panel" }, ze = { class: "manage-panel-search" }, je = { class: "list" }, He = ["onClick"], Je = { class: "item-label" };
148
- function We(n, t, u, e, o, y) {
146
+ }, Ge = { class: "manage-panel" }, qe = { class: "manage-panel-search" }, Ye = { class: "list" }, He = ["onClick"], ze = { class: "item-label" };
147
+ function je(n, t, u, e, o, y) {
149
148
  const c = m("tiny-icon-search"), f = m("tiny-search"), v = m("svg-icon"), E = m("search-empty");
150
- return h(), A("div", Ye, [
151
- _("div", ze, [
149
+ return h(), L("div", Ge, [
150
+ _("div", qe, [
152
151
  s(f, {
153
152
  modelValue: e.state.searchValue,
154
153
  "onUpdate:modelValue": [
@@ -164,18 +163,18 @@ function We(n, t, u, e, o, y) {
164
163
  _: 1
165
164
  }, 8, ["modelValue", "onUpdate:modelValue"])
166
165
  ]),
167
- _("div", je, [
168
- (h(!0), A(ne, null, oe(e.list, (a, d) => (h(), A("div", {
166
+ _("div", Ye, [
167
+ (h(!0), L(te, null, ne(e.list, (a, d) => (h(), L("div", {
169
168
  key: a.name,
170
- class: ae(["list-item", d === e.state.activeIndex ? "active" : ""]),
171
- onClick: W((r) => e.openEdit(a, d), ["stop"])
169
+ class: oe(["list-item", d === e.state.activeIndex ? "active" : ""]),
170
+ onClick: K((r) => e.openEdit(a, d), ["stop"])
172
171
  }, [
173
172
  s(v, { name: "plugin-icon-sresources" }),
174
- _("div", Je, T(a.name), 1),
173
+ _("div", ze, k(a.name), 1),
175
174
  s(v, {
176
175
  class: "setting-icon",
177
176
  name: "setting",
178
- onClick: W((r) => e.openEdit(a, d), ["stop"])
177
+ onClick: K((r) => e.openEdit(a, d), ["stop"])
179
178
  }, null, 8, ["onClick"])
180
179
  ], 10, He))), 128)),
181
180
  s(E, {
@@ -184,22 +183,22 @@ function We(n, t, u, e, o, y) {
184
183
  ])
185
184
  ]);
186
185
  }
187
- const Ke = /* @__PURE__ */ H(qe, [["render", We], ["__scopeId", "data-v-f297beff"]]), J = S(!1), Qe = () => {
188
- J.value = !0, ie(() => window.dispatchEvent(new Event("resize")));
189
- }, P = () => {
190
- J.value = !1;
191
- }, Xe = {
186
+ const Je = /* @__PURE__ */ J(Me, [["render", je], ["__scopeId", "data-v-f297beff"]]), W = T(!1), We = () => {
187
+ W.value = !0, ce(() => window.dispatchEvent(new Event("resize")));
188
+ }, D = () => {
189
+ W.value = !1;
190
+ }, Ke = {
192
191
  components: {
193
- TinyForm: Re,
194
- TinyInput: Ce,
195
- TinyButton: Ve,
196
- TinyFormItem: be,
197
- TinyCheckbox: Se,
198
- PluginSetting: pe,
199
- MonacoEditor: ue,
200
- TinyRadioGroup: xe,
201
- TinyRadio: Te,
202
- SvgButton: Z
192
+ TinyForm: he,
193
+ TinyInput: Ee,
194
+ TinyButton: Re,
195
+ TinyFormItem: Ce,
196
+ TinyCheckbox: Ve,
197
+ PluginSetting: de,
198
+ MonacoEditor: pe,
199
+ TinyRadioGroup: be,
200
+ TinyRadio: Se,
201
+ SvgButton: $
203
202
  },
204
203
  setup(n, { emit: t }) {
205
204
  const u = {
@@ -209,49 +208,49 @@ const Ke = /* @__PURE__ */ H(qe, [["render", We], ["__scopeId", "data-v-f297beff
209
208
  // 禁用滚动条边边一直显示的边框
210
209
  overviewRulerBorder: !1,
211
210
  renderLineHighlightOnlyWhenFocus: !0
212
- }, { confirm: e } = ge(), o = j({
213
- resource: R(() => De()),
211
+ }, { confirm: e } = me(), o = j({
212
+ resource: R(() => Fe()),
214
213
  name: "",
215
214
  value: "",
216
215
  content: {},
217
- status: R(() => q() === N.Edit),
218
- category: R(() => G() === L.Npm),
216
+ status: R(() => Y() === I.Edit),
217
+ category: R(() => q() === F.Npm),
219
218
  mode: R(() => {
220
219
  var r;
221
- return ((r = ye("engine.config")) == null ? void 0 : r.dslMode) !== "Vue";
220
+ return ((r = ge("engine.config")) == null ? void 0 : r.dslMode) !== "Vue";
222
221
  }),
223
222
  isInstance: !1,
224
223
  title: R(() => {
225
- const r = q() === N.Edit ? "编辑" : "添加", g = F() === V.Bridge ? "桥接源" : "工具类";
224
+ const r = Y() === I.Edit ? "编辑" : "添加", g = P() === V.Bridge ? "桥接源" : "工具类";
226
225
  return r + g;
227
226
  }),
228
- type: L.Npm
227
+ type: F.Npm
229
228
  }), y = R(() => {
230
229
  const r = o.name || "name";
231
230
  let g = r;
232
231
  o.content.destructuring && (o.name && o.name === o.content.exportName ? g = `{ ${o.content.exportName || "exportName"} }` : g = `{ ${o.content.exportName || "exportName"} as ${r} }`);
233
- const b = `${o.content.package || "package"}${o.content.main || ""}`;
234
- return `import ${g} from '${b}'
232
+ const x = `${o.content.package || "package"}${o.content.main || ""}`;
233
+ return `import ${g} from '${x}'
235
234
  export { ${r} }`;
236
235
  });
237
- X(() => {
236
+ Z(() => {
238
237
  var r, g;
239
- o.name = o.resource.name, o.content = o.resource.content || {}, o.value = ((g = (r = o.resource) == null ? void 0 : r.content) == null ? void 0 : g.value) || "", o.type = G();
240
- }), se(
238
+ o.name = o.resource.name, o.content = o.resource.content || {}, o.value = ((g = (r = o.resource) == null ? void 0 : r.content) == null ? void 0 : g.value) || "", o.type = q();
239
+ }), ae(
241
240
  () => o.isInstance,
242
241
  (r) => {
243
242
  r || (o.content.instance = "");
244
243
  }
245
244
  );
246
- const c = S(null), f = S(null);
247
- return re(() => window.dispatchEvent(new Event("resize"))), {
245
+ const c = T(null), f = T(null);
246
+ return se(() => window.dispatchEvent(new Event("resize"))), {
248
247
  rules: {
249
248
  name: [
250
249
  { required: !0, message: "必填", trigger: "change" },
251
250
  {
252
- validator: (r, g, b) => {
253
- const O = Le(F());
254
- Array.isArray(O) && O.includes(g) ? b(new Error("资源名称已存在")) : b();
251
+ validator: (r, g, x) => {
252
+ const O = Oe(P());
253
+ Array.isArray(O) && O.includes(g) ? x(new Error("资源名称已存在")) : x();
255
254
  },
256
255
  trigger: "change"
257
256
  }
@@ -264,14 +263,14 @@ export { ${r} }`;
264
263
  editor: c,
265
264
  state: o,
266
265
  codePreview: y,
267
- isOpen: J,
268
- closePanel: P,
266
+ isOpen: W,
267
+ closePanel: D,
269
268
  save: () => {
270
269
  const r = {
271
- category: F(),
272
- type: G(),
270
+ category: P(),
271
+ type: q(),
273
272
  name: o.name,
274
- app: $(ee.GlobalService).getState().appInfo.id,
273
+ app: b(S.GlobalService).getBaseInfo().id,
275
274
  content: o.category ? o.content : {
276
275
  type: "JSFunction",
277
276
  value: c.value.getEditor().getValue()
@@ -279,20 +278,20 @@ export { ${r} }`;
279
278
  };
280
279
  f.value.validate((g) => {
281
280
  if (!g) {
282
- k({
281
+ B({
283
282
  type: "error",
284
283
  message: "请检查必填项"
285
284
  });
286
285
  return;
287
286
  }
288
287
  if (!o.category && !c.value.getEditor().getValue()) {
289
- k({
288
+ B({
290
289
  type: "error",
291
290
  message: "function 内容必填"
292
291
  });
293
292
  return;
294
293
  }
295
- Me(r, P, t);
294
+ Pe(r, D, t);
296
295
  });
297
296
  },
298
297
  deleteReSource: () => {
@@ -300,44 +299,44 @@ export { ${r} }`;
300
299
  title: "删除资源",
301
300
  message: "如果删除正在使用的资源,将无法正常预览页面,确认要删除吗?",
302
301
  exec: () => {
303
- Ge(o.name, P, t);
302
+ De(o.name, D, t);
304
303
  }
305
304
  });
306
305
  },
307
306
  options: u,
308
307
  handleChangeType: (r) => {
309
- Y(r);
308
+ H(r);
310
309
  },
311
- RESOURCE_CATEGORY: L
310
+ RESOURCE_CATEGORY: F
312
311
  };
313
312
  }
314
- }, Ze = { class: "title-wrap" }, $e = { class: "header-wrap" }, et = { class: "right-item" }, tt = { key: 2 }, nt = { class: "code-preview" };
315
- function ot(n, t, u, e, o, y) {
316
- const c = m("tiny-button"), f = m("svg-button"), v = m("tiny-radio"), E = m("tiny-radio-group"), a = m("tiny-form-item"), d = m("tiny-input"), r = m("tiny-checkbox"), g = m("monaco-editor"), b = m("tiny-form"), O = m("plugin-setting");
313
+ }, Qe = { class: "title-wrap" }, Xe = { class: "header-wrap" }, Ze = { class: "right-item" }, $e = { key: 2 }, et = { class: "code-preview" };
314
+ function tt(n, t, u, e, o, y) {
315
+ const c = m("tiny-button"), f = m("svg-button"), v = m("tiny-radio"), E = m("tiny-radio-group"), a = m("tiny-form-item"), d = m("tiny-input"), r = m("tiny-checkbox"), g = m("monaco-editor"), x = m("tiny-form"), O = m("plugin-setting");
317
316
  return e.isOpen ? (h(), C(O, { key: 0 }, {
318
317
  title: l(() => [
319
- _("div", Ze, [
320
- _("span", null, T(e.state.title), 1)
318
+ _("div", Qe, [
319
+ _("span", null, k(e.state.title), 1)
321
320
  ])
322
321
  ]),
323
322
  header: l(() => [
324
- _("div", $e, [
323
+ _("div", Xe, [
325
324
  s(c, {
326
325
  class: "save-btn",
327
326
  type: "primary",
328
327
  onClick: e.save
329
328
  }, {
330
329
  default: l(() => t[10] || (t[10] = [
331
- B("保存")
330
+ A("保存")
332
331
  ])),
333
332
  _: 1
334
333
  }, 8, ["onClick"]),
335
- le(s(f, {
334
+ re(s(f, {
336
335
  class: "delete-btn",
337
336
  name: "delete",
338
337
  onClick: e.deleteReSource
339
338
  }, null, 8, ["onClick"]), [
340
- [ce, e.state.status]
339
+ [le, e.state.status]
341
340
  ]),
342
341
  s(f, {
343
342
  class: "close-btn",
@@ -347,7 +346,7 @@ function ot(n, t, u, e, o, y) {
347
346
  ])
348
347
  ]),
349
348
  content: l(() => [
350
- s(b, {
349
+ s(x, {
351
350
  ref: "resourceForm",
352
351
  class: "resource-form",
353
352
  rules: e.rules,
@@ -358,8 +357,8 @@ function ot(n, t, u, e, o, y) {
358
357
  "label-align": !0
359
358
  }, {
360
359
  default: l(() => [
361
- _("div", et, [
362
- e.state.status ? x("", !0) : (h(), C(a, {
360
+ _("div", Ze, [
361
+ e.state.status ? U("", !0) : (h(), C(a, {
363
362
  key: 0,
364
363
  label: "工具类型",
365
364
  prop: "type"
@@ -376,7 +375,7 @@ function ot(n, t, u, e, o, y) {
376
375
  label: e.RESOURCE_CATEGORY.Npm
377
376
  }, {
378
377
  default: l(() => [
379
- B(T(e.RESOURCE_CATEGORY.Npm), 1)
378
+ A(k(e.RESOURCE_CATEGORY.Npm), 1)
380
379
  ]),
381
380
  _: 1
382
381
  }, 8, ["label"]),
@@ -384,7 +383,7 @@ function ot(n, t, u, e, o, y) {
384
383
  label: e.RESOURCE_CATEGORY.Function
385
384
  }, {
386
385
  default: l(() => [
387
- B(T(e.RESOURCE_CATEGORY.Function), 1)
386
+ A(k(e.RESOURCE_CATEGORY.Function), 1)
388
387
  ]),
389
388
  _: 1
390
389
  }, 8, ["label"])
@@ -394,7 +393,7 @@ function ot(n, t, u, e, o, y) {
394
393
  ]),
395
394
  _: 1
396
395
  })),
397
- e.state.status ? x("", !0) : (h(), C(a, {
396
+ e.state.status ? U("", !0) : (h(), C(a, {
398
397
  key: 1,
399
398
  label: "工具名称",
400
399
  prop: "name"
@@ -408,7 +407,7 @@ function ot(n, t, u, e, o, y) {
408
407
  ]),
409
408
  _: 1
410
409
  })),
411
- e.state.category ? (h(), A("div", tt, [
410
+ e.state.category ? (h(), L("div", $e, [
412
411
  s(a, {
413
412
  label: "npm包名",
414
413
  prop: "content.package"
@@ -442,7 +441,7 @@ function ot(n, t, u, e, o, y) {
442
441
  "onUpdate:modelValue": t[4] || (t[4] = (p) => e.state.content.destructuring = p)
443
442
  }, {
444
443
  default: l(() => t[11] || (t[11] = [
445
- B("解构npm包")
444
+ A("解构npm包")
446
445
  ])),
447
446
  _: 1
448
447
  }, 8, ["modelValue"])
@@ -460,7 +459,7 @@ function ot(n, t, u, e, o, y) {
460
459
  }, null, 8, ["modelValue"])
461
460
  ]),
462
461
  _: 1
463
- })) : x("", !0),
462
+ })) : U("", !0),
464
463
  e.state.isInstance ? (h(), C(a, {
465
464
  key: 1,
466
465
  label: "实例名称",
@@ -473,7 +472,7 @@ function ot(n, t, u, e, o, y) {
473
472
  }, null, 8, ["modelValue"])
474
473
  ]),
475
474
  _: 1
476
- })) : x("", !0),
475
+ })) : U("", !0),
477
476
  s(a, { label: "入口路径" }, {
478
477
  default: l(() => [
479
478
  s(d, {
@@ -512,8 +511,8 @@ function ot(n, t, u, e, o, y) {
512
511
  }),
513
512
  s(a, { label: "生成utils.js代码预览" }, {
514
513
  default: l(() => [
515
- _("div", nt, [
516
- _("pre", null, T(e.codePreview), 1)
514
+ _("div", et, [
515
+ _("pre", null, k(e.codePreview), 1)
517
516
  ])
518
517
  ]),
519
518
  _: 1
@@ -531,17 +530,17 @@ function ot(n, t, u, e, o, y) {
531
530
  }, 8, ["rules", "model"])
532
531
  ]),
533
532
  _: 1
534
- })) : x("", !0);
533
+ })) : U("", !0);
535
534
  }
536
- const at = /* @__PURE__ */ H(Xe, [["render", ot], ["__scopeId", "data-v-6ca97625"]]), st = {
535
+ const nt = /* @__PURE__ */ J(Ke, [["render", tt], ["__scopeId", "data-v-335043fc"]]), ot = {
537
536
  components: {
538
- PluginPanel: me,
539
- SvgButton: Z,
540
- BridgeManage: Ke,
541
- BridgeSetting: at
537
+ PluginPanel: ue,
538
+ SvgButton: $,
539
+ BridgeManage: Je,
540
+ BridgeSetting: nt
542
541
  },
543
542
  setup() {
544
- const n = S(V.Util), t = S(null), u = R(() => Ae[n.value]);
543
+ const n = T(V.Util), t = T(null), u = R(() => we[n.value]);
545
544
  return {
546
545
  addResource: (c) => {
547
546
  n.value == t.value.add(c);
@@ -549,9 +548,9 @@ const at = /* @__PURE__ */ H(Xe, [["render", ot], ["__scopeId", "data-v-6ca97625
549
548
  RESOURCE_TYPE: V,
550
549
  activedName: n,
551
550
  openBridgePanel: () => {
552
- Qe();
551
+ We();
553
552
  },
554
- closePanel: P,
553
+ closePanel: D,
555
554
  refreshList: (c) => {
556
555
  c == t.value.refresh(c);
557
556
  },
@@ -560,7 +559,7 @@ const at = /* @__PURE__ */ H(Xe, [["render", ot], ["__scopeId", "data-v-6ca97625
560
559
  };
561
560
  }
562
561
  };
563
- function rt(n, t, u, e, o, y) {
562
+ function at(n, t, u, e, o, y) {
564
563
  const c = m("svg-button"), f = m("bridge-manage"), v = m("bridge-setting"), E = m("plugin-panel");
565
564
  return h(), C(E, {
566
565
  title: "资源管理",
@@ -586,16 +585,16 @@ function rt(n, t, u, e, o, y) {
586
585
  _: 1
587
586
  }, 8, ["onClose"]);
588
587
  }
589
- const lt = /* @__PURE__ */ H(st, [["render", rt], ["__scopeId", "data-v-c14cfd0a"]]), ct = {
588
+ const st = /* @__PURE__ */ J(ot, [["render", at], ["__scopeId", "data-v-c14cfd0a"]]), rt = {
590
589
  id: "engine.plugins.bridge",
591
590
  title: "资源管理",
592
591
  type: "plugins",
593
592
  align: "top",
594
593
  icon: "plugin-icon-sresources"
595
- }, vt = {
596
- ...ct,
597
- entry: lt
594
+ }, yt = {
595
+ ...rt,
596
+ entry: st
598
597
  };
599
598
  export {
600
- vt as default
599
+ yt as default
601
600
  };
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .manage-panel[data-v-f297beff]{height:100%;display:flex;flex-direction:column;position:relative}.manage-panel .manage-panel-search[data-v-f297beff]{padding:0 12px 12px}.manage-panel .add-button[data-v-f297beff]{align-self:flex-end;margin:6px}.manage-panel .list[data-v-f297beff]{flex:1;border-top:1px solid var(--ti-lowcode-tabs-border-color);overflow:auto;padding:12px 0}.manage-panel .list-item[data-v-f297beff]{height:24px;line-height:24px;display:grid;grid-template-columns:16px 1fr auto;column-gap:8px;align-items:center;padding:0 12px;position:relative;color:var(--ti-lowcode-bridge-list-color);cursor:pointer;font-size:12px}.manage-panel .list-item[data-v-f297beff]:hover,.manage-panel .list-item.active[data-v-f297beff]{background:var(--ti-lowcode-bridge-list-bg)}.manage-panel .list-item:hover .setting-icon[data-v-f297beff],.manage-panel .list-item.active .setting-icon[data-v-f297beff]{display:block}.manage-panel .list-item .setting-icon[data-v-f297beff]{display:none;color:var(--ti-lowcode-toolbar-more-hover-color)}.plugin-setting[data-v-6ca97625] .icon-wrap{margin-right:8px}.plugin-setting .resource-form .tip[data-v-6ca97625]{font-size:11px;line-height:18px;margin-top:8px;color:var(--ti-lowcode-datasource-tip-color)}.plugin-setting .resource-form[data-v-6ca97625] .tiny-form-item__label .cdn-tips-icon{margin-left:4px}.plugin-setting .title-wrap[data-v-6ca97625]{font-size:12px;font-weight:700;color:var(--ti-lowcode-data-source-color)}.plugin-setting .title-wrap .help-link[data-v-6ca97625]{display:inline-block;color:var(--ti-lowcode-common-primary-color);font-size:12px;margin-left:16px}.plugin-setting .title-wrap .help-link[data-v-6ca97625]:hover{text-decoration:underline}.plugin-setting .header-wrap[data-v-6ca97625]{display:flex;align-items:center;column-gap:6px}.plugin-setting .header-wrap .tiny-button[data-v-6ca97625]{width:40px;padding:0;min-width:40px;margin-right:2px}.plugin-setting .monaco-editor[data-v-6ca97625]{height:500px;margin-top:8px;border:1px solid var(--ti-lowcode-birdge-editor-border-color)}.plugin-setting .resource-form-footer[data-v-6ca97625]{padding:12px 0 12px 80px}.plugin-setting .resource-form-footer .tiny-svg[data-v-6ca97625]{margin-right:6px}.plugin-setting .resource-form-footer .del[data-v-6ca97625]:hover{background-color:var(--ti-lowcode-delete-button-hover-bg)}.plugin-setting .cdn-label-wrap[data-v-6ca97625]{display:flex;align-items:center}.code-preview[data-v-6ca97625]{font-size:14px;line-height:20px;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-6ca97625]{font-family:Microsoft YaHei}.code-preview>pre[data-v-6ca97625]{margin:0;padding:8px 20px;font-family:Consolas,Courier New,monospace}[data-v-c14cfd0a] .tiny-button{border-radius:4px;height:24px;line-height:24px}
1
+ .manage-panel[data-v-f297beff]{height:100%;display:flex;flex-direction:column;position:relative}.manage-panel .manage-panel-search[data-v-f297beff]{padding:0 12px 12px}.manage-panel .add-button[data-v-f297beff]{align-self:flex-end;margin:6px}.manage-panel .list[data-v-f297beff]{flex:1;border-top:1px solid var(--ti-lowcode-tabs-border-color);overflow:auto;padding:12px 0}.manage-panel .list-item[data-v-f297beff]{height:24px;line-height:24px;display:grid;grid-template-columns:16px 1fr auto;column-gap:8px;align-items:center;padding:0 12px;position:relative;color:var(--ti-lowcode-bridge-list-color);cursor:pointer;font-size:12px}.manage-panel .list-item[data-v-f297beff]:hover,.manage-panel .list-item.active[data-v-f297beff]{background:var(--ti-lowcode-bridge-list-bg)}.manage-panel .list-item:hover .setting-icon[data-v-f297beff],.manage-panel .list-item.active .setting-icon[data-v-f297beff]{display:block}.manage-panel .list-item .setting-icon[data-v-f297beff]{display:none;color:var(--ti-lowcode-toolbar-more-hover-color)}.plugin-setting[data-v-335043fc] .icon-wrap{margin-right:8px}.plugin-setting .resource-form .tip[data-v-335043fc]{font-size:11px;line-height:18px;margin-top:8px;color:var(--ti-lowcode-datasource-tip-color)}.plugin-setting .resource-form[data-v-335043fc] .tiny-form-item__label .cdn-tips-icon{margin-left:4px}.plugin-setting .title-wrap[data-v-335043fc]{font-size:12px;font-weight:700;color:var(--ti-lowcode-data-source-color)}.plugin-setting .title-wrap .help-link[data-v-335043fc]{display:inline-block;color:var(--ti-lowcode-common-primary-color);font-size:12px;margin-left:16px}.plugin-setting .title-wrap .help-link[data-v-335043fc]:hover{text-decoration:underline}.plugin-setting .header-wrap[data-v-335043fc]{display:flex;align-items:center;column-gap:6px}.plugin-setting .header-wrap .tiny-button[data-v-335043fc]{width:40px;padding:0;min-width:40px;margin-right:2px}.plugin-setting .monaco-editor[data-v-335043fc]{height:500px;margin-top:8px;border:1px solid var(--ti-lowcode-birdge-editor-border-color)}.plugin-setting .resource-form-footer[data-v-335043fc]{padding:12px 0 12px 80px}.plugin-setting .resource-form-footer .tiny-svg[data-v-335043fc]{margin-right:6px}.plugin-setting .resource-form-footer .del[data-v-335043fc]:hover{background-color:var(--ti-lowcode-delete-button-hover-bg)}.plugin-setting .cdn-label-wrap[data-v-335043fc]{display:flex;align-items:center}.code-preview[data-v-335043fc]{font-size:14px;line-height:20px;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-335043fc]{font-family:Microsoft YaHei}.code-preview>pre[data-v-335043fc]{margin:0;padding:8px 20px;font-family:Consolas,Courier New,monospace}[data-v-c14cfd0a] .tiny-button{border-radius:4px;height:24px;line-height:24px}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/tiny-engine-plugin-bridge",
3
- "version": "2.0.0-alpha.6",
3
+ "version": "2.0.0-rc.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -25,12 +25,11 @@
25
25
  "license": "MIT",
26
26
  "homepage": "https://opentiny.design/tiny-engine",
27
27
  "dependencies": {
28
- "@opentiny/tiny-engine-common": "2.0.0-alpha.6",
29
- "@opentiny/tiny-engine-http": "2.0.0-alpha.6",
30
- "@opentiny/tiny-engine-meta-register": "2.0.0-alpha.6"
28
+ "@opentiny/tiny-engine-common": "2.0.0-rc.1",
29
+ "@opentiny/tiny-engine-meta-register": "2.0.0-rc.1"
31
30
  },
32
31
  "devDependencies": {
33
- "@opentiny/tiny-engine-vite-plugin-meta-comments": "2.0.0-alpha.6",
32
+ "@opentiny/tiny-engine-vite-plugin-meta-comments": "2.0.0-rc.1",
34
33
  "@vitejs/plugin-vue": "^5.1.2",
35
34
  "@vitejs/plugin-vue-jsx": "^4.0.1",
36
35
  "vite": "^5.4.2"
@@ -40,5 +39,5 @@
40
39
  "@opentiny/vue-icon": "^3.14.0",
41
40
  "vue": "^3.4.15"
42
41
  },
43
- "gitHead": "d283c5ad8392a581b64d51a4464cca68c24105e4"
42
+ "gitHead": "ea0440b4ed95feec9a3964dd9095f47edcb30a0b"
44
43
  }