aibox-custom-component-packages 0.0.21 → 0.0.22

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.
Files changed (118) hide show
  1. package/es/AiboxTabs.mjs +71 -0
  2. package/es/ExampleComponent.mjs +35 -0
  3. package/es/SourcePublish.mjs +1 -1
  4. package/es/assets/AiboxTabs.css +1 -0
  5. package/es/assets/BackBar.css +1 -0
  6. package/es/assets/ExampleComponent.css +1 -0
  7. package/es/assets/SourcePublish.css +1 -1
  8. package/es/assets/index.css +1 -0
  9. package/es/assets/index2.css +1 -0
  10. package/es/assets/index3.css +1 -0
  11. package/es/assets/index4.css +1 -0
  12. package/es/chunks/AiboxTable.CF4T_OCu.js +645 -0
  13. package/es/chunks/BackBar.Bc2NIuzk.js +645 -0
  14. package/es/chunks/{SourcePublish.BjY8OTLS.js → SourcePublish.CjzqOFwj.js} +23 -10
  15. package/es/chunks/_plugin-vue_export-helper.CHgC5LLL.js +9 -0
  16. package/es/chunks/config.8htFF04x.js +325 -0
  17. package/es/chunks/config.BU21Gda2.js +49 -0
  18. package/es/chunks/config.DPkdwjwD.js +49 -0
  19. package/es/chunks/config.gNZ_rT87.js +325 -0
  20. package/es/chunks/enums.CfSBDD6u.js +83 -0
  21. package/es/chunks/enums.WrpwbF4w.js +14 -0
  22. package/es/chunks/field-types.CPnMOjle.js +13 -0
  23. package/es/chunks/files.cduUqjHX.js +16 -0
  24. package/es/chunks/i18n.DmqkiK-h.js +444 -0
  25. package/es/chunks/i18n.k9Q_HVMs.js +443 -0
  26. package/es/chunks/index.BDd6hHiU.js +172 -0
  27. package/es/chunks/index.CF_YHLP5.js +257 -0
  28. package/es/chunks/index.DM3o2YX3.js +398 -0
  29. package/es/chunks/index.Dx-mCS4E.js +1298 -0
  30. package/es/chunks/index.bCzIhWFw.js +7 -0
  31. package/es/chunks/index.ml5i7aB5.js +257 -0
  32. package/es/chunks/layout.CygCXa6s.js +26 -0
  33. package/es/chunks/publish.D6friivo.js +50 -0
  34. package/es/chunks/publish.DlD0o09n.js +50 -0
  35. package/es/chunks/request.24c3shPx.js +5 -0
  36. package/es/chunks/usePreview.BHvXwaNi.js +157 -0
  37. package/es/index.mjs +1 -1
  38. package/lib/AiboxTabs.js +1 -0
  39. package/lib/ExampleComponent.js +1 -0
  40. package/lib/SourcePublish.js +1 -1
  41. package/lib/assets/AiboxTabs.css +1 -0
  42. package/lib/assets/BackBar.css +1 -0
  43. package/lib/assets/ExampleComponent.css +1 -0
  44. package/lib/assets/SourcePublish.css +1 -1
  45. package/lib/assets/index.css +1 -0
  46. package/lib/assets/index2.css +1 -0
  47. package/lib/assets/index3.css +1 -0
  48. package/lib/assets/index4.css +1 -0
  49. package/lib/chunks/AiboxTable.CJOPGJtU.js +1 -0
  50. package/lib/chunks/BackBar.CZsNxoX1.js +1 -0
  51. package/lib/chunks/SourcePublish.eOSEULjP.js +1 -0
  52. package/lib/chunks/_plugin-vue_export-helper.BHFhmbuH.js +1 -0
  53. package/lib/chunks/config.1oaIKLGn.js +1 -0
  54. package/lib/chunks/config.B0XKkp1w.js +1 -0
  55. package/lib/chunks/config.BCAuBVxV.js +1 -0
  56. package/lib/chunks/config.BF7MO0O5.js +1 -0
  57. package/lib/chunks/enums.Dmq4PdUc.js +1 -0
  58. package/lib/chunks/enums.DpU2er5r.js +1 -0
  59. package/lib/chunks/field-types.Ch_2yDfg.js +1 -0
  60. package/lib/chunks/files.B3-8UC0v.js +1 -0
  61. package/lib/chunks/i18n.CL5L6nx6.js +1 -0
  62. package/lib/chunks/i18n.DgOp_D7R.js +1 -0
  63. package/lib/chunks/index.4hFddClT.js +6 -0
  64. package/lib/chunks/index.BNivYbtq.js +1 -0
  65. package/lib/chunks/index.B_keI1Aq.js +1 -0
  66. package/lib/chunks/index.Bk-RwmaH.js +1 -0
  67. package/lib/chunks/index.CJFk1R2u.js +59 -0
  68. package/lib/chunks/index.CkihWzK6.js +1 -0
  69. package/lib/chunks/layout.DbBSbLgm.js +1 -0
  70. package/lib/chunks/publish.3TrK3fZf.js +1 -0
  71. package/lib/chunks/publish.Bw1acrSu.js +1 -0
  72. package/lib/chunks/request.D8T4MgGX.js +1 -0
  73. package/lib/chunks/usePreview.BojIDW7Z.js +1 -0
  74. package/lib/index.js +1 -1
  75. package/package.json +3 -3
  76. package/es/chunks/AddOrEditSupplierDialog.BCiXcUBu.js +0 -721
  77. package/es/chunks/AiboxTable.B_Yli5E8.js +0 -635
  78. package/es/chunks/ApplicationTypeTag.BbJwXyVa.js +0 -47
  79. package/es/chunks/AuthSection.CLi8HcIx.js +0 -201
  80. package/es/chunks/AvailableRangePreview.BgeL_bMq.js +0 -194
  81. package/es/chunks/AvailableRangeSetting.CGJxgfPT.js +0 -229
  82. package/es/chunks/CodeView.CWbewuHs.js +0 -148
  83. package/es/chunks/CommonTagsList.CJdBie2N.js +0 -156
  84. package/es/chunks/CreateMcpForm.C0HqvD-g.js +0 -308
  85. package/es/chunks/DocSyncSelect.DlJXL1lq.js +0 -2290
  86. package/es/chunks/FileUploader.BSIhrd9M.js +0 -216
  87. package/es/chunks/McpFormDialog.CDH31D2Q.js +0 -297
  88. package/es/chunks/McpParamsSet.Bx3aRL9j.js +0 -501
  89. package/es/chunks/MdEditor.Bb9S_hso.js +0 -163
  90. package/es/chunks/ParameterTable.CoRz_932.js +0 -2010
  91. package/es/chunks/PublishRecord.C8h1tu3w.js +0 -133
  92. package/es/chunks/SourcePublish.CebmryAz.js +0 -966
  93. package/es/chunks/SourcePublish.Dk7O9GzI.js +0 -968
  94. package/es/chunks/config.CIQoQGOb.js +0 -35
  95. package/es/chunks/config.lm2B-n0s.js +0 -270
  96. package/es/chunks/i18n.CIhVBbR3.js +0 -418
  97. package/lib/chunks/AddOrEditSupplierDialog.XtPxc5yr.js +0 -1
  98. package/lib/chunks/AiboxTable.DFyqwoGc.js +0 -1
  99. package/lib/chunks/ApplicationTypeTag.CZReMt-9.js +0 -1
  100. package/lib/chunks/AuthSection.CP9c-YTW.js +0 -1
  101. package/lib/chunks/AvailableRangePreview.DvREyHNH.js +0 -1
  102. package/lib/chunks/AvailableRangeSetting.DDHTOLJA.js +0 -1
  103. package/lib/chunks/CodeView.DeBxLqyC.js +0 -1
  104. package/lib/chunks/CommonTagsList.QEP4G-Em.js +0 -1
  105. package/lib/chunks/CreateMcpForm.B2o0Ghjg.js +0 -1
  106. package/lib/chunks/DocSyncSelect.1gaXRzps.js +0 -2
  107. package/lib/chunks/FileUploader.6IW_QL-h.js +0 -1
  108. package/lib/chunks/McpFormDialog.FwXnBBd2.js +0 -6
  109. package/lib/chunks/McpParamsSet.BYrxVvDL.js +0 -1
  110. package/lib/chunks/MdEditor.Cp24y4DJ.js +0 -1
  111. package/lib/chunks/ParameterTable.CeufAEXh.js +0 -1
  112. package/lib/chunks/PublishRecord.BVndvj7F.js +0 -5
  113. package/lib/chunks/SourcePublish.Bz8MaRPm.js +0 -1
  114. package/lib/chunks/SourcePublish.I7ORXPok.js +0 -1
  115. package/lib/chunks/SourcePublish.OeB6i-Iu.js +0 -1
  116. package/lib/chunks/config.B9Di8LtU.js +0 -1
  117. package/lib/chunks/config.CZl1kYtI.js +0 -1
  118. package/lib/chunks/i18n.BGe5gOau.js +0 -1
@@ -1,148 +0,0 @@
1
- import { m as e } from "./i18n.CIhVBbR3.js";
2
- import { t } from "./_plugin-vue_export-helper.Ct3qlEzt.js";
3
- import { createBlock as n, createCommentVNode as r, createElementBlock as i, createVNode as a, normalizeClass as o, onMounted as s, openBlock as c, ref as l, shallowRef as u, unref as d, watch as f, withCtx as p } from "vue";
4
- import { ElIcon as m, ElMessage as h, ElScrollbar as g } from "element-plus";
5
- import { IconCopy1 as _ } from "color-message-aibox-vue";
6
- import { Codemirror as v } from "vue-codemirror";
7
- import { EditorView as y } from "@codemirror/view";
8
- import { json as b } from "@codemirror/lang-json";
9
- import { oneDark as x } from "@codemirror/theme-one-dark";
10
- import { codeFolding as S } from "@codemirror/language";
11
- import C from "copy-to-clipboard";
12
- import '../assets/CodeView.css';//#region hooks/useCopy.js
13
- var w = () => {
14
- let { t } = e();
15
- return { copyText: (e) => {
16
- C(e) ? h({
17
- message: t("MESSAGE_REMIND.COPY_SUCCESS"),
18
- type: "success"
19
- }) : h({
20
- message: t("COMMON_STORE_LIBRARY.LABEL_COPY_FAIL"),
21
- type: "error"
22
- });
23
- } };
24
- }, T = /* @__PURE__ */ t({
25
- __name: "index",
26
- props: {
27
- code: {
28
- type: String,
29
- default: ""
30
- },
31
- language: {
32
- type: String,
33
- default: "json"
34
- },
35
- customExpandDepth: {
36
- type: Number,
37
- default: Infinity
38
- },
39
- sort: {
40
- type: Boolean,
41
- default: !0
42
- },
43
- noPadding: {
44
- type: Boolean,
45
- default: !1
46
- },
47
- theme: {
48
- type: String,
49
- default: "light"
50
- },
51
- showLength: {
52
- type: Boolean,
53
- default: !1
54
- },
55
- maxHeight: {
56
- type: String,
57
- default: "calc(100% - 125px)"
58
- },
59
- showCopy: {
60
- type: Boolean,
61
- default: !1
62
- },
63
- enableFolding: {
64
- type: Boolean,
65
- default: !1
66
- }
67
- },
68
- setup(e) {
69
- let { copyText: t } = w(), h = e, C = l(""), T = { json: () => b() }, E = () => {
70
- let e = h.language.toLowerCase();
71
- return T[e] ? T[e]() : b();
72
- }, D = u([]), O = (e) => {
73
- let t = e.trim(), n = (e) => {
74
- try {
75
- return JSON.parse(e);
76
- } catch {
77
- return null;
78
- }
79
- }, r = null;
80
- if ((t.startsWith("{") || t.startsWith("[")) && (r = n(t)), r ||= n(`{${t.replace(/,\s*$/, "")}}`), r && typeof r == "object" && !Array.isArray(r)) {
81
- let e = r.role;
82
- if (e) return "role: " + e;
83
- }
84
- return "";
85
- }, k = () => {
86
- let e = [
87
- E(),
88
- y.editable.of(!1),
89
- y.lineWrapping
90
- ];
91
- h.enableFolding && e.push(S({
92
- preparePlaceholder: (e, t) => {
93
- try {
94
- return O(e.doc.sliceString(t.from, t.to));
95
- } catch (e) {
96
- return console.error("Error getting fold preview:", e), "...";
97
- }
98
- },
99
- placeholderDOM: (e, t, n) => {
100
- let r = document.createElement("span");
101
- return r.className = "cm-foldPlaceholder", r.onclick = t, r.style.cursor = "pointer", r.style.color = "#888", r.style.padding = "0 4px", r.style.borderRadius = "3px", r.textContent = n ? `${n}...` : "...", r;
102
- }
103
- })), h.theme === "dark" && e.push(x), D.value = e;
104
- }, A = (e) => {
105
- try {
106
- let t = JSON.parse(e);
107
- if (h.sort && typeof t == "object" && t) {
108
- let e = (t) => Array.isArray(t) ? t.map(e) : typeof t == "object" && t ? Object.keys(t).sort().reduce((n, r) => (n[r] = e(t[r]), n), {}) : t;
109
- return JSON.stringify(e(t), null, 2);
110
- }
111
- return JSON.stringify(t, null, 2);
112
- } catch {
113
- return e;
114
- }
115
- };
116
- return f(() => h.code, (e) => {
117
- h.language === "json" ? C.value = A(e) : C.value = e;
118
- }, { immediate: !0 }), s(() => {
119
- k();
120
- }), (s, l) => (c(), i("div", { class: o(["code-viewer", {
121
- "no-padding": e.noPadding,
122
- dark: e.theme === "dark"
123
- }]) }, [e.showCopy ? (c(), n(d(m), {
124
- key: 0,
125
- onClick: l[0] ||= (n) => d(t)(e.code),
126
- class: "code-viewer__copy",
127
- color: "#96A0AB",
128
- size: "18px"
129
- }, {
130
- default: p(() => [a(d(_))]),
131
- _: 1
132
- })) : r("", !0), a(d(g), { "max-height": e.maxHeight }, {
133
- default: p(() => [a(d(v), {
134
- modelValue: C.value,
135
- "onUpdate:modelValue": l[1] ||= (e) => C.value = e,
136
- style: {
137
- height: "100%",
138
- minHeight: "100px"
139
- },
140
- extensions: D.value,
141
- disabled: !0
142
- }, null, 8, ["modelValue", "extensions"])]),
143
- _: 1
144
- }, 8, ["max-height"])], 2));
145
- }
146
- }, [["__scopeId", "data-v-011cdc70"]]);
147
- //#endregion
148
- export { w as n, T as t };
@@ -1,156 +0,0 @@
1
- import { t as e } from "./withinstall.dLh4K-0g.js";
2
- import { m as t } from "./i18n.CIhVBbR3.js";
3
- import { t as n } from "./_plugin-vue_export-helper.Ct3qlEzt.js";
4
- import { r } from "./config.CIQoQGOb.js";
5
- import { t as i } from "./AvailableRangePreview.BgeL_bMq.js";
6
- import { d as a, f as o, l as s, m as c, p as l, r as u, u as d } from "./config.lm2B-n0s.js";
7
- import { Fragment as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createTextVNode as v, createVNode as y, normalizeStyle as b, openBlock as x, renderList as S, resolveDynamicComponent as C, toDisplayString as w, unref as T, withCtx as E, withModifiers as D } from "vue";
8
- import { ElIcon as O, ElPopover as k, ElTag as A } from "element-plus";
9
- import '../assets/CommonTagsList.css';//#region components/CommonTagsList/StatusTag.vue
10
- var j = { class: "status-tag-content flex items-center" }, M = { class: "status-text fz-12" }, N = /* @__PURE__ */ n({
11
- __name: "StatusTag",
12
- props: {
13
- channelStatus: {
14
- type: [String, Number],
15
- default: null
16
- },
17
- statusText: {
18
- type: String,
19
- default: null
20
- },
21
- showIcon: {
22
- type: Boolean,
23
- default: !1
24
- }
25
- },
26
- setup(e) {
27
- let t = e, n = p(() => o[t.channelStatus]), r = p(() => a[t.channelStatus]), i = p(() => d[t.channelStatus]), c = p(() => s[t.channelStatus]);
28
- return (t, a) => (x(), m(T(A), { type: n.value }, {
29
- default: E(() => [_("div", j, [e.showIcon && i.value ? (x(), m(T(O), {
30
- key: 0,
31
- color: c.value
32
- }, {
33
- default: E(() => [(x(), m(C(i.value)))]),
34
- _: 1
35
- }, 8, ["color"])) : h("", !0), _("span", M, w(e.statusText || r.value), 1)])]),
36
- _: 1
37
- }, 8, ["type"]));
38
- }
39
- }, [["__scopeId", "data-v-1efeeed8"]]), P = { class: "commont-status-box" }, F = {
40
- class: "common-content w-full overflow-y-auto",
41
- style: { "max-height": "200px" }
42
- }, I = {
43
- key: 0,
44
- class: "content-item"
45
- }, L = { class: "content-item-top flex items-center" }, R = { class: "item-bottom-box mg-l-4 pd-t-8 flex flex-wrap" }, z = {
46
- key: 1,
47
- class: "icon-placeholder w-full mg-t-4 mg-b-8 bg-e6e8ea",
48
- style: { height: "1px" }
49
- }, B = {
50
- key: 0,
51
- class: "all-visible-ranges-section mg-t-12"
52
- }, V = { class: "channel-name fz-12 weight-500 mg-b-4 text-1f2329 flex items-center" }, H = {
53
- key: 0,
54
- class: "range-separator w-full mg-t-8 mg-b-8 bg-e6e8ea",
55
- style: { height: "1px" }
56
- }, U = e(/* @__PURE__ */ Object.assign({ name: "CommonTagsList" }, {
57
- __name: "layout",
58
- props: {
59
- publishChannelList: {
60
- type: Array,
61
- default: () => []
62
- },
63
- sourceType: {
64
- type: [String, Number],
65
- default: null
66
- }
67
- },
68
- setup(e) {
69
- let { t: n } = t(), j = e, M = p(() => {
70
- let e = j.publishChannelList || [], t = e.filter((e) => e.channelStatus === r.PUBLISHED).map((e) => ({
71
- ...e,
72
- displayText: c?.[e.channelType]?.name(j.sourceType) || ""
73
- })), n = e.filter((e) => e.channelStatus !== r.PUBLISHED).reduce((e, t) => {
74
- let n = t.channelStatus;
75
- return e[n] || (e[n] = []), e[n].push(t), e;
76
- }, {}), i = Object.entries(n).map(([e, t]) => ({
77
- channelStatus: parseInt(e),
78
- displayText: `${a[parseInt(e)]}(${t.length})`,
79
- isGroup: !0,
80
- channels: t
81
- })).sort((e, t) => t.channelStatus - e.channelStatus);
82
- return [...t, ...i];
83
- }), U = p(() => {
84
- if (!j.publishChannelList?.length) return [];
85
- let e = j.publishChannelList.reduce((e, t) => {
86
- let n = t.channelStatus;
87
- return e[n] || (e[n] = []), e[n].push(t), e;
88
- }, {});
89
- return Object.entries(e).map(([e, t]) => ({
90
- status: parseInt(e),
91
- channels: t
92
- })).sort((e, t) => e.status === r.PUBLISHED ? -1 : t.status === r.PUBLISHED ? 1 : t.status - e.status);
93
- }), W = p(() => {
94
- if (!j.publishChannelList?.length) return [];
95
- let e = n("COMMON_TAGS_LIST.UNKNOWN_CHANNEL");
96
- return j.publishChannelList.filter((e) => !e.visibleScope || e.visibleScope.length === 0 ? !1 : e.channelStatus === r.PUBLISHED).map((t) => ({
97
- channelName: c[t.channelType]?.name(j.sourceType) || e,
98
- channelType: t.channelType,
99
- visibleScope: t.visibleScope,
100
- allVisible: t.allVisible
101
- }));
102
- }), G = (e) => u[l[e]];
103
- return (t, l) => (x(), g("div", P, [(x(!0), g(f, null, S(M.value, (t, r) => (x(), m(T(k), {
104
- key: r,
105
- placement: "bottom",
106
- trigger: "click",
107
- width: "300"
108
- }, {
109
- reference: E(() => [y(N, {
110
- onClick: l[0] ||= D(() => {}, ["stop"]),
111
- "channel-status": t.channelStatus,
112
- "status-text": t.displayText,
113
- "show-icon": !0,
114
- class: "mg-r-4 mg-b-4"
115
- }, null, 8, ["channel-status", "status-text"])]),
116
- default: E(() => [_("div", F, [(x(!0), g(f, null, S(U.value, (t, n) => (x(), g(f, { key: t.status }, [t.channels.length > 0 ? (x(), g("div", I, [_("div", L, [y(T(O), { style: b({ color: T(s)[t.status] }) }, {
117
- default: E(() => [(x(), m(C(T(d)[t.status])))]),
118
- _: 2
119
- }, 1032, ["style"]), _("div", {
120
- class: "content-item-name fz-14 mg-l-4",
121
- style: b({ color: T(s)[t.status] })
122
- }, w(T(a)[t.status]) + "(" + w(t.channels.length) + ") ", 5)]), _("div", R, [(x(!0), g(f, null, S(t.channels, (t) => (x(), g("div", {
123
- class: "b-item-box mg-r-8 radius-4 fz-12 pd-t-4 pd-b-4 pd-l-8 pd-r-8 mg-b-8 text-1f2329 bg-f5f6f7",
124
- key: t.channelType
125
- }, w(T(c)?.[t.channelType]?.name(e.sourceType)), 1))), 128))])])) : h("", !0), n < U.value.length - 1 ? (x(), g("div", z)) : h("", !0)], 64))), 128)), W.value.length > 0 ? (x(), g("div", B, [(x(!0), g(f, null, S(W.value, (e, t) => (x(), g("div", {
126
- key: e.channelType,
127
- class: "channel-visible-range"
128
- }, [
129
- _("div", V, [y(T(O), {
130
- class: "mg-r-2",
131
- size: "14",
132
- color: G(e.channelType)?.iconColor
133
- }, {
134
- default: E(() => [(x(), m(C(G(e.channelType)?.icon)))]),
135
- _: 2
136
- }, 1032, ["color"]), v(" " + w(e.channelName) + " " + w(T(n)("COMMON_TAGS_LIST.AVAILABLE_SCOPE")), 1)]),
137
- y(T(i), {
138
- "all-visible": e.allVisible,
139
- "model-value": e.visibleScope,
140
- "tree-list": [],
141
- readonly: !0
142
- }, null, 8, ["all-visible", "model-value"]),
143
- t < W.value.length - 1 ? (x(), g("div", H)) : h("", !0)
144
- ]))), 128))])) : h("", !0)])]),
145
- _: 2
146
- }, 1024))), 128)), e.publishChannelList?.length ? h("", !0) : (x(), m(T(A), {
147
- key: 0,
148
- type: T(o)[T(r).UNPUBLISHED]
149
- }, {
150
- default: E(() => [v(w(T(a)[T(r).UNPUBLISHED]), 1)]),
151
- _: 1
152
- }, 8, ["type"]))]));
153
- }
154
- }));
155
- //#endregion
156
- export { N as n, U as t };
@@ -1,308 +0,0 @@
1
- import { t as e } from "./withinstall.dLh4K-0g.js";
2
- import { m as t } from "./i18n.CIhVBbR3.js";
3
- import { t as n } from "./usePreview.CMMjOD_o.js";
4
- import { t as r } from "./FilePreview.De4zHsfc.js";
5
- import { t as i } from "./_plugin-vue_export-helper.Ct3qlEzt.js";
6
- import { t as a } from "./FileUploader.BSIhrd9M.js";
7
- import { t as o } from "./RadioGroup.Czc1JtkN.js";
8
- import { t as s } from "./AuthSection.CLi8HcIx.js";
9
- import { t as c } from "./MdEditor.Bb9S_hso.js";
10
- import { createBlock as l, createCommentVNode as u, createElementVNode as d, createTextVNode as f, createVNode as p, openBlock as m, reactive as h, ref as g, toDisplayString as _, unref as v, watch as y, withCtx as b } from "vue";
11
- import { ElForm as x, ElFormItem as S, ElIcon as C, ElInput as w, ElMessage as T, ElTooltip as E } from "element-plus";
12
- import { IconTip as D } from "color-message-aibox-vue";
13
- import '../assets/CreateMcpForm.css';//#region components/CreateMcpForm/config.js
14
- var O = () => {
15
- let { t: e } = t();
16
- return {
17
- rulesObj: {
18
- name: [{
19
- required: !0,
20
- message: e("LIBRARY_CREATEMCPFORM.MCP_NAME_PLACEHOLDER"),
21
- trigger: "blur"
22
- }, {
23
- max: 20,
24
- message: e("LIBRARY_CREATEMCPFORM.MCP_NAME_MAX"),
25
- trigger: "blur"
26
- }],
27
- description: [{
28
- required: !0,
29
- message: e("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION_REQUIRED"),
30
- trigger: "blur"
31
- }, {
32
- max: 200,
33
- message: e("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION_MAX"),
34
- trigger: "blur"
35
- }],
36
- overview: [{
37
- required: !0,
38
- message: e("LIBRARY_CREATEMCPFORM.MCP_OVERVIEW_REQUIRED"),
39
- trigger: "blur"
40
- }],
41
- address: [{
42
- type: "url",
43
- required: !0,
44
- message: e("LIBRARY_CREATEMCPFORM.SERVICE_URL_INVALID"),
45
- trigger: ["blur", "change"]
46
- }],
47
- communicationType: [{
48
- required: !0,
49
- message: e("LIBRARY_CREATEMCPFORM.TRANSFER_METHOD_REQUIRED"),
50
- trigger: "change"
51
- }],
52
- applyLink: [{
53
- type: "url",
54
- message: e("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL_INVALID"),
55
- trigger: ["blur", "change"]
56
- }]
57
- },
58
- communicationTypeOpts: [{
59
- label: "SSE",
60
- value: "SSE"
61
- }, {
62
- label: "Streamable HTTP",
63
- value: "HTTP"
64
- }]
65
- };
66
- }, k = { class: "label-with-icon" }, A = { class: "label-with-icon" }, j = { class: "auth-section-wrapper" }, M = e(/* @__PURE__ */ i({
67
- __name: "CreateMcpForm",
68
- props: { showOverview: {
69
- type: Boolean,
70
- default: !1
71
- } },
72
- setup(e, { expose: i }) {
73
- let M = e, { t: N } = t(), { previewImage: P } = n(), F = g(null), I = g(null), { rulesObj: L, communicationTypeOpts: R } = O(), z = h({
74
- icon: "",
75
- iconUrl: "",
76
- name: "",
77
- description: "",
78
- overview: "",
79
- communicationType: "HTTP",
80
- address: "",
81
- applyLink: ""
82
- }), B = g(R), V = g({ auth: {
83
- authType: "none",
84
- keyType: "custom",
85
- paramLocation: "header",
86
- paramName: "",
87
- paramValue: "",
88
- token: ""
89
- } }), H = g({ ...L }), U = () => {
90
- M.showOverview ? H.value.overview = L.overview : delete H.value.overview;
91
- };
92
- y(() => M.showOverview, () => {
93
- U();
94
- }, { immediate: !0 });
95
- let W = g([]), G = (e) => {
96
- z.iconUrl = e.url, z.icon = e.bnid, W.value = [e];
97
- }, K = () => {
98
- z.iconUrl = "", z.icon = "", W.value = [];
99
- }, q = (e) => {
100
- P(e.url);
101
- };
102
- return i({
103
- validate: async (e) => {
104
- if (!F.value) return !1;
105
- if (U(), I.value?.validateField) {
106
- let t = I.value.validateField();
107
- if (Object.keys(t).length > 0) return t.paramName ? T.error(N("LIBRARY_CREATEMCPFORM.PARAMETER_NAME_REQUIRED")) : t.paramValue || t.token ? T.error(N("LIBRARY_CREATEMCPFORM.INPUT_API_KEY_REQUIRED")) : T.error(N("LIBRARY_CREATEMCPFORM.MCP_AUTH_REQUIRED")), e?.(Error(N("LIBRARY_CREATEMCPFORM.MCP_AUTH_REQUIRED"))), !1;
108
- }
109
- return F.value.validate(e);
110
- },
111
- getFormData: () => ({
112
- name: z.name,
113
- icon: z.icon,
114
- description: z.description,
115
- overview: M.showOverview ? z.overview : "",
116
- address: z.address,
117
- communicationType: z.communicationType,
118
- authType: V.value.auth.authType === "none" ? 0 : 1,
119
- authLocation: V.value.auth.paramLocation === "header" ? 0 : 1,
120
- apiKeyName: V.value.auth.keyType === "bearer" ? "Authorization" : V.value.auth.paramName || "",
121
- apiKeyValue: V.value.auth.keyType === "bearer" ? V.value.auth.token ? `Bearer ${V.value.auth.token}` : "" : V.value.auth.paramValue || "",
122
- applyLink: z.applyLink || "",
123
- headerPrefixType: 1
124
- }),
125
- setFormData: (e) => {
126
- if (!e) return;
127
- Object.assign(z, {
128
- name: e.name || "",
129
- description: e.description || "",
130
- overview: e.overview || "",
131
- icon: e.icon || "",
132
- iconUrl: e.iconUrl || "",
133
- communicationType: e.communicationType || "SSE",
134
- address: e.address || "",
135
- applyLink: e.applyLink || ""
136
- });
137
- let t = e.authType === 1 || e.authType === "1";
138
- if (V.value.auth.authType = t ? "apiKey" : "none", V.value.auth.paramLocation = e.authLocation === 0 || e.authLocation === "0" ? "header" : "query", t) {
139
- let t = !e.apiKeyName || e.apiKeyName === "Authorization";
140
- if (V.value.auth.keyType = t ? "bearer" : "custom", t) {
141
- V.value.auth.paramName = "", V.value.auth.paramValue = "";
142
- let t = e.apiKeyValue || "";
143
- V.value.auth.token = t.startsWith("Bearer ") ? t.substring(7) : t;
144
- } else V.value.auth.paramName = e.apiKeyName || "", V.value.auth.paramValue = e.apiKeyValue || "", V.value.auth.token = "";
145
- } else V.value.auth.keyType = "custom", V.value.auth.paramName = "", V.value.auth.paramValue = "", V.value.auth.token = "";
146
- e.icon && e.icon !== "0" && e.iconUrl && (W.value = [{
147
- bnid: e.icon,
148
- url: e.iconUrl
149
- }]);
150
- }
151
- }), (t, n) => (m(), l(v(x), {
152
- ref_key: "ruleFormRef",
153
- ref: F,
154
- model: z,
155
- rules: H.value,
156
- "label-width": "auto",
157
- "label-position": "top",
158
- class: "scrollable-form"
159
- }, {
160
- default: b(() => [
161
- p(v(S), {
162
- class: "scrollable-form__item",
163
- label: v(N)("LIBRARY_CREATEMCPFORM.MCP_ICON"),
164
- prop: "icon"
165
- }, {
166
- label: b(() => [d("div", k, [d("span", null, _(v(N)("LIBRARY_CREATEMCPFORM.MCP_ICON")), 1), p(v(E), { placement: "top" }, {
167
- content: b(() => [
168
- f(_(v(N)("LIBRARY_CREATEMCPFORM.MCP_ICON_TIP")), 1),
169
- n[7] ||= d("br", null, null, -1),
170
- f(" " + _(v(N)("LIBRARY_CREATEMCPFORM.MCP_ICON_SIZE_TIP")), 1)
171
- ]),
172
- default: b(() => [p(v(C), {
173
- size: "14px",
174
- color: "#999"
175
- }, {
176
- default: b(() => [p(v(D))]),
177
- _: 1
178
- })]),
179
- _: 1
180
- })])]),
181
- default: b(() => [p(v(r), {
182
- fileList: W.value,
183
- previewType: "Card",
184
- isCustom: !0,
185
- onOnRemove: K,
186
- onOnPreview: q
187
- }, {
188
- CardUploader: b(() => [W.value.length === 0 ? (m(), l(v(a), {
189
- key: 0,
190
- "upload-type": "Card",
191
- onOnSuccess: G,
192
- limitSize: 5,
193
- acceptType: ".jpg,.png",
194
- businessType: "mcp",
195
- defaultUploadIcon: "mcp"
196
- })) : u("", !0)]),
197
- _: 1
198
- }, 8, ["fileList"])]),
199
- _: 1
200
- }, 8, ["label"]),
201
- p(v(S), {
202
- class: "scrollable-form__item",
203
- label: v(N)("LIBRARY_CREATEMCPFORM.MCP_NAME"),
204
- prop: "name"
205
- }, {
206
- default: b(() => [p(v(w), {
207
- modelValue: z.name,
208
- "onUpdate:modelValue": n[0] ||= (e) => z.name = e,
209
- placeholder: v(N)("LIBRARY_CREATEMCPFORM.MCP_NAME_REQUIRED"),
210
- maxlength: "20",
211
- "show-word-limit": ""
212
- }, null, 8, ["modelValue", "placeholder"])]),
213
- _: 1
214
- }, 8, ["label"]),
215
- p(v(S), {
216
- class: "scrollable-form__item",
217
- label: v(N)("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION"),
218
- prop: "description"
219
- }, {
220
- default: b(() => [p(v(w), {
221
- modelValue: z.description,
222
- "onUpdate:modelValue": n[1] ||= (e) => z.description = e,
223
- type: "textarea",
224
- rows: 3,
225
- placeholder: v(N)("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION_REQUIRED"),
226
- maxlength: "200",
227
- "show-word-limit": ""
228
- }, null, 8, ["modelValue", "placeholder"])]),
229
- _: 1
230
- }, 8, ["label"]),
231
- e.showOverview ? (m(), l(v(S), {
232
- key: 0,
233
- class: "scrollable-form__item",
234
- label: v(N)("LIBRARY_CREATEMCPFORM.MCP_OVERVIEW"),
235
- prop: "overview"
236
- }, {
237
- default: b(() => [p(v(c), {
238
- modelValue: z.overview,
239
- "onUpdate:modelValue": n[2] ||= (e) => z.overview = e,
240
- height: "300px",
241
- placeholder: v(N)("LIBRARY_CREATEMCPFORM.MCP_OVERVIEW_REQUIRED"),
242
- businessType: "mcp"
243
- }, null, 8, ["modelValue", "placeholder"])]),
244
- _: 1
245
- }, 8, ["label"])) : u("", !0),
246
- p(v(S), {
247
- class: "scrollable-form__item",
248
- label: v(N)("LIBRARY_CREATEMCPFORM.TRANSFER_METHOD"),
249
- prop: "communicationType"
250
- }, {
251
- default: b(() => [p(v(o), {
252
- modelValue: z.communicationType,
253
- "onUpdate:modelValue": n[3] ||= (e) => z.communicationType = e,
254
- options: B.value,
255
- layout: "vertical",
256
- "class-name": "scrollable-form__item-radio"
257
- }, null, 8, ["modelValue", "options"])]),
258
- _: 1
259
- }, 8, ["label"]),
260
- p(v(S), {
261
- class: "scrollable-form__item",
262
- label: v(N)("LIBRARY_CREATEMCPFORM.SERVICE_URL"),
263
- prop: "address"
264
- }, {
265
- default: b(() => [p(v(w), {
266
- modelValue: z.address,
267
- "onUpdate:modelValue": n[4] ||= (e) => z.address = e,
268
- placeholder: v(N)("LIBRARY_CREATEMCPFORM.SERVICE_URL_REQUIRED")
269
- }, null, 8, ["modelValue", "placeholder"])]),
270
- _: 1
271
- }, 8, ["label"]),
272
- V.value.auth.authType === "apiKey" ? (m(), l(v(S), {
273
- key: 1,
274
- class: "scrollable-form__item",
275
- prop: "applyLink"
276
- }, {
277
- label: b(() => [d("div", A, [d("span", null, _(v(N)("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL")), 1), p(v(E), { placement: "top" }, {
278
- content: b(() => [f(_(v(N)("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL_TIP")), 1)]),
279
- default: b(() => [p(v(C), {
280
- size: "14px",
281
- color: "#999"
282
- }, {
283
- default: b(() => [p(v(D))]),
284
- _: 1
285
- })]),
286
- _: 1
287
- })])]),
288
- default: b(() => [p(v(w), {
289
- modelValue: z.applyLink,
290
- "onUpdate:modelValue": n[5] ||= (e) => z.applyLink = e,
291
- placeholder: v(N)("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL_REQUIRED")
292
- }, null, 8, ["modelValue", "placeholder"])]),
293
- _: 1
294
- })) : u("", !0),
295
- d("div", j, [p(v(s), {
296
- ref_key: "authSectionRef",
297
- ref: I,
298
- featData: V.value,
299
- "onUpdate:featData": n[6] ||= (e) => V.value = e,
300
- layout: "vertical"
301
- }, null, 8, ["featData"])])
302
- ]),
303
- _: 1
304
- }, 8, ["model", "rules"]));
305
- }
306
- }, [["__scopeId", "data-v-47c4a3f2"]]));
307
- //#endregion
308
- export { M as t };