@module-federation/devtools 0.22.0 → 0.23.0

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 (116) hide show
  1. package/dist/es/App.css +13 -0
  2. package/dist/es/App.js +461 -21
  3. package/dist/es/App.module.js +1 -1
  4. package/dist/es/App_module.css +293 -5
  5. package/dist/es/component/DependencyGraph/index.js +204 -0
  6. package/dist/es/component/DependencyGraph/index.module.js +5 -0
  7. package/dist/es/component/DependencyGraph/index_module.css +100 -0
  8. package/dist/es/component/{GraphItem → DependencyGraphItem}/index.js +20 -9
  9. package/dist/es/component/DependencyGraphItem/index.module.js +5 -0
  10. package/dist/es/component/DependencyGraphItem/index_module.css +95 -0
  11. package/dist/es/component/Form/index.js +192 -117
  12. package/dist/es/component/Form/index.module.js +1 -1
  13. package/dist/es/component/Form/index_module.css +176 -25
  14. package/dist/es/component/LanguageSwitch.js +50 -0
  15. package/dist/es/component/Layout/index.js +296 -49
  16. package/dist/es/component/Layout/index.module.js +1 -1
  17. package/dist/es/component/Layout/index_module.css +52 -32
  18. package/dist/es/component/ModuleInfo/index.js +313 -0
  19. package/dist/es/component/ModuleInfo/index.module.js +5 -0
  20. package/dist/es/component/ModuleInfo/index_module.css +184 -0
  21. package/dist/es/component/SharedDepsExplorer/FocusResultDisplay.js +35 -0
  22. package/dist/es/component/SharedDepsExplorer/FocusResultDisplay.module.js +5 -0
  23. package/dist/es/component/SharedDepsExplorer/FocusResultDisplay_module.css +45 -0
  24. package/dist/es/component/SharedDepsExplorer/index.js +495 -0
  25. package/dist/es/component/SharedDepsExplorer/index.module.js +5 -0
  26. package/dist/es/component/SharedDepsExplorer/index_module.css +467 -0
  27. package/dist/es/component/SharedDepsExplorer/share-utils.js +206 -0
  28. package/dist/es/component/ThemeToggle.js +19 -0
  29. package/dist/es/component/ThemeToggle.module.js +5 -0
  30. package/dist/es/component/ThemeToggle_module.css +12 -0
  31. package/dist/es/hooks/useDevtoolsTheme.js +77 -0
  32. package/dist/es/i18n/index.js +506 -0
  33. package/dist/es/template/constant.js +3 -19
  34. package/dist/es/utils/chrome/index.js +91 -38
  35. package/dist/es/utils/chrome/messages.js +6 -0
  36. package/dist/es/utils/chrome/override-remote.js +42 -0
  37. package/dist/es/utils/chrome/post-message-listener.js +2 -1
  38. package/dist/es/utils/chrome/post-message-start.js +10 -2
  39. package/dist/es/utils/chrome/storage.js +6 -1
  40. package/dist/es/utils/sdk/graph.js +25 -4
  41. package/dist/es/utils/sdk/index.js +9 -0
  42. package/dist/es/worker/index.js +168 -1
  43. package/dist/lib/App.css +13 -0
  44. package/dist/lib/App.js +451 -18
  45. package/dist/lib/App.module.js +1 -1
  46. package/dist/lib/App_module.css +293 -5
  47. package/dist/lib/component/DependencyGraph/index.js +226 -0
  48. package/dist/lib/component/{GraphItem → DependencyGraph}/index.module.js +1 -1
  49. package/dist/lib/component/DependencyGraph/index_module.css +100 -0
  50. package/dist/lib/component/{GraphItem → DependencyGraphItem}/index.js +23 -12
  51. package/dist/lib/component/{Graph → DependencyGraphItem}/index.module.js +1 -1
  52. package/dist/lib/component/DependencyGraphItem/index_module.css +95 -0
  53. package/dist/lib/component/Form/index.js +189 -115
  54. package/dist/lib/component/Form/index.module.js +1 -1
  55. package/dist/lib/component/Form/index_module.css +176 -25
  56. package/dist/lib/component/LanguageSwitch.js +80 -0
  57. package/dist/lib/component/Layout/index.js +290 -47
  58. package/dist/lib/component/Layout/index.module.js +1 -1
  59. package/dist/lib/component/Layout/index_module.css +52 -32
  60. package/dist/lib/component/ModuleInfo/index.js +343 -0
  61. package/dist/lib/component/ModuleInfo/index.module.js +25 -0
  62. package/dist/lib/component/ModuleInfo/index_module.css +184 -0
  63. package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay.js +65 -0
  64. package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay.module.js +25 -0
  65. package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay_module.css +45 -0
  66. package/dist/lib/component/SharedDepsExplorer/index.js +502 -0
  67. package/dist/lib/component/SharedDepsExplorer/index.module.js +25 -0
  68. package/dist/lib/component/SharedDepsExplorer/index_module.css +467 -0
  69. package/dist/lib/component/SharedDepsExplorer/share-utils.js +237 -0
  70. package/dist/lib/component/ThemeToggle.js +49 -0
  71. package/dist/lib/component/ThemeToggle.module.js +25 -0
  72. package/dist/lib/component/ThemeToggle_module.css +12 -0
  73. package/dist/lib/hooks/useDevtoolsTheme.js +101 -0
  74. package/dist/lib/i18n/index.js +540 -0
  75. package/dist/lib/template/constant.js +4 -17
  76. package/dist/lib/utils/chrome/index.js +94 -38
  77. package/dist/lib/utils/chrome/messages.js +31 -0
  78. package/dist/lib/utils/chrome/override-remote.js +65 -0
  79. package/dist/lib/utils/chrome/post-message-listener.js +2 -1
  80. package/dist/lib/utils/chrome/post-message-start.js +10 -2
  81. package/dist/lib/utils/chrome/storage.js +5 -0
  82. package/dist/lib/utils/sdk/graph.js +25 -4
  83. package/dist/lib/utils/sdk/index.js +10 -0
  84. package/dist/lib/worker/index.js +156 -1
  85. package/dist/types/src/App.d.ts +2 -1
  86. package/dist/types/src/component/{Graph → DependencyGraph}/index.d.ts +0 -1
  87. package/dist/types/src/component/{GraphItem → DependencyGraphItem}/index.d.ts +0 -1
  88. package/dist/types/src/component/Form/index.d.ts +2 -0
  89. package/dist/types/src/component/LanguageSwitch.d.ts +2 -0
  90. package/dist/types/src/component/Layout/index.d.ts +0 -1
  91. package/dist/types/src/component/ModuleInfo/index.d.ts +8 -0
  92. package/dist/types/src/component/SharedDepsExplorer/FocusResultDisplay.d.ts +15 -0
  93. package/dist/types/src/component/SharedDepsExplorer/index.d.ts +6 -0
  94. package/dist/types/src/component/SharedDepsExplorer/share-utils.d.ts +44 -0
  95. package/dist/types/src/component/ThemeToggle.d.ts +8 -0
  96. package/dist/types/src/hooks/useDevtoolsTheme.d.ts +2 -0
  97. package/dist/types/src/i18n/index.d.ts +5 -0
  98. package/dist/types/src/init.d.ts +0 -1
  99. package/dist/types/src/template/constant.d.ts +2 -5
  100. package/dist/types/src/utils/chrome/index.d.ts +5 -3
  101. package/dist/types/src/utils/chrome/messages.d.ts +2 -0
  102. package/dist/types/src/utils/chrome/override-remote.d.ts +1 -0
  103. package/dist/types/src/utils/chrome/storage.d.ts +5 -4
  104. package/dist/types/src/utils/sdk/graph.d.ts +2 -1
  105. package/dist/types/src/utils/sdk/index.d.ts +1 -0
  106. package/dist/types/src/utils/types/common.d.ts +4 -0
  107. package/dist/types/src/worker/index.d.ts +1 -0
  108. package/package.json +18 -14
  109. package/dist/es/component/Graph/index.js +0 -127
  110. package/dist/es/component/Graph/index.module.js +0 -5
  111. package/dist/es/component/Graph/index_module.css +0 -12
  112. package/dist/es/component/GraphItem/index.module.js +0 -5
  113. package/dist/es/component/GraphItem/index_module.css +0 -61
  114. package/dist/lib/component/Graph/index.js +0 -149
  115. package/dist/lib/component/Graph/index_module.css +0 -12
  116. package/dist/lib/component/GraphItem/index_module.css +0 -61
@@ -0,0 +1,95 @@
1
+ .Wrapper_d8079 {
2
+ display: flex;
3
+ width: 320px;
4
+ border-radius: 18px;
5
+ border: 1px solid var(--color-border-1, rgba(96, 165, 250, 0.3));
6
+ overflow: hidden;
7
+ box-shadow: 0 18px 32px rgba(8, 11, 25, 0.35);
8
+ background: linear-gradient(140deg, var(--mf-accent, rgba(243, 244, 246, 0.9)) 0%, rgba(229, 231, 235, 0.7) 45%, rgba(255, 255, 255, 0.95) 100%), var(--color-bg-2, rgba(255, 255, 255, 0.9));
9
+ color: var(--color-text-1, #1f2937);
10
+ backdrop-filter: blur(4px);
11
+ }
12
+ .Wrapper_d8079 .react-flow__handle {
13
+ width: 10px;
14
+ height: 10px;
15
+ border-radius: 50%;
16
+ border: 2px solid rgba(96, 165, 250, 0.3);
17
+ background: rgba(243, 244, 246, 0.9);
18
+ box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.2);
19
+ }
20
+ .Wrapper_d8079 .container_d8079 {
21
+ display: flex;
22
+ flex-direction: column;
23
+ width: 100%;
24
+ padding-bottom: 8px;
25
+ }
26
+ .Wrapper_d8079 .group_d8079 {
27
+ display: flex;
28
+ align-items: center;
29
+ justify-content: center;
30
+ padding: 12px;
31
+ background: var(--mf-accent, rgba(243, 244, 246, 0.9));
32
+ }
33
+ .Wrapper_d8079 .name_d8079 {
34
+ font-size: 15px;
35
+ font-weight: 600;
36
+ letter-spacing: 0.02em;
37
+ color: white;
38
+ }
39
+ .Wrapper_d8079 .info_d8079 {
40
+ display: flex;
41
+ flex-direction: column;
42
+ gap: 10px;
43
+ margin: 0 12px;
44
+ padding: 12px;
45
+ border-radius: 14px;
46
+ background: rgba(243, 244, 246, 0.4);
47
+ border: 1px solid rgba(96, 165, 250, 0.3);
48
+ font-size: 11px;
49
+ }
50
+ .Wrapper_d8079 .expose-container_d8079 {
51
+ display: flex;
52
+ flex-direction: column;
53
+ gap: 6px;
54
+ }
55
+ .Wrapper_d8079 .expose-container_d8079 div {
56
+ display: flex;
57
+ flex-wrap: wrap;
58
+ gap: 6px;
59
+ }
60
+ .Wrapper_d8079 .type_d8079 {
61
+ font-size: 12px;
62
+ font-weight: 600;
63
+ text-transform: uppercase;
64
+ letter-spacing: 0.04em;
65
+ color: var(--color-text-2, #4b5563);
66
+ }
67
+ .Wrapper_d8079 .item_d8079 {
68
+ display: inline-flex;
69
+ align-items: center;
70
+ padding: 4px 8px;
71
+ border-radius: 999px;
72
+ background: rgba(243, 244, 246, 0.6);
73
+ color: var(--color-text-1, #1f2937);
74
+ font-size: 10px;
75
+ font-weight: 500;
76
+ margin-right: 6px;
77
+ max-width: 100%;
78
+ white-space: nowrap;
79
+ text-overflow: ellipsis;
80
+ overflow: hidden;
81
+ box-shadow: 0 4px 10px rgba(8, 11, 25, 0.45);
82
+ }
83
+ .Wrapper_d8079 .message_d8079 {
84
+ display: flex;
85
+ align-items: center;
86
+ gap: 6px;
87
+ font-size: 11px;
88
+ color: var(--color-text-2, #4b5563);
89
+ }
90
+ .Wrapper_d8079 .message_d8079 .item_d8079 {
91
+ margin-right: 0;
92
+ padding: 4px 10px;
93
+ background: rgba(243, 244, 246, 0.6);
94
+ color: var(--color-text-1, #1f2937);
95
+ }
@@ -18,9 +18,8 @@ var __async = (__this, __arguments, generator) => {
18
18
  step((generator = generator.apply(__this, __arguments)).next());
19
19
  });
20
20
  };
21
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
21
+ import { jsx, jsxs } from "react/jsx-runtime";
22
22
  import { useEffect } from "react";
23
- import { flushSync } from "react-dom";
24
23
  import {
25
24
  Checkbox,
26
25
  Button,
@@ -31,10 +30,12 @@ import {
31
30
  Select,
32
31
  Switch
33
32
  } from "@arco-design/web-react";
33
+ import { useTranslation } from "react-i18next";
34
34
  import {
35
35
  IconDelete,
36
36
  IconPlus,
37
- IconInfoCircle
37
+ IconInfoCircle,
38
+ IconQuestionCircle
38
39
  } from "@arco-design/web-react/icon";
39
40
  import { defaultDataItem, proxyFormField } from "../../template/constant";
40
41
  import {
@@ -60,13 +61,20 @@ const FormComponent = (props) => {
60
61
  versionList,
61
62
  setVersionList,
62
63
  getVersion,
63
- customValueValidate
64
+ customValueValidate,
65
+ enableClip,
66
+ onClipChange
64
67
  } = props;
65
- const { moduleInfo } = window.__FEDERATION__;
68
+ const { t } = useTranslation();
69
+ const federation = window.__FEDERATION__ || {
70
+ moduleInfo: {},
71
+ originModuleInfo: {}
72
+ };
73
+ const { moduleInfo } = federation;
66
74
  let { producer } = separateType(moduleInfo);
67
75
  const filterDupMap = /* @__PURE__ */ new Map();
68
- producer = producer.filter((t) => {
69
- const [typeOrName, name] = t.split(":");
76
+ producer = producer.filter((tItem) => {
77
+ const [typeOrName, name] = tItem.split(":");
70
78
  const marked = filterDupMap.get(name || typeOrName);
71
79
  filterDupMap.set(name || typeOrName, true);
72
80
  return !marked;
@@ -113,12 +121,17 @@ const FormComponent = (props) => {
113
121
  }
114
122
  if (key) {
115
123
  statusSet[index].keyStatus = true;
116
- flushSync(() => setFormStatus(statusSet));
117
- return callback();
124
+ setTimeout(() => {
125
+ setFormStatus(statusSet);
126
+ callback();
127
+ }, 0);
128
+ return;
118
129
  }
119
130
  statusSet[index].keyStatus = false;
120
- flushSync(() => setFormStatus(statusSet));
121
- return callback("Module name can not be empty");
131
+ setTimeout(() => {
132
+ setFormStatus(statusSet);
133
+ }, 0);
134
+ return callback(t("form.validation.moduleNameRequired"));
122
135
  };
123
136
  const validateValue = (value, callback, index) => {
124
137
  const status = getCheckStatus(index);
@@ -134,14 +147,17 @@ const FormComponent = (props) => {
134
147
  }
135
148
  if (validateCustom(value) || validateSemver(value) || validatePort(value) || (customValueValidate == null ? void 0 : customValueValidate(value))) {
136
149
  statusSet[index].valueStatus = true;
137
- flushSync(() => setFormStatus(statusSet));
138
- return callback();
150
+ setTimeout(() => {
151
+ setFormStatus(statusSet);
152
+ callback();
153
+ }, 0);
154
+ return;
139
155
  }
140
156
  statusSet[index].valueStatus = false;
141
- flushSync(() => setFormStatus(statusSet));
142
- return callback(
143
- "The module information format is incorrect, check the format in the upper left corner"
144
- );
157
+ setTimeout(() => {
158
+ setFormStatus(statusSet);
159
+ }, 0);
160
+ return callback(t("form.validation.moduleInfoInvalid"));
145
161
  };
146
162
  const onAdd = (add) => {
147
163
  add(defaultDataItem);
@@ -158,6 +174,9 @@ const FormComponent = (props) => {
158
174
  const hmrChange = (on) => {
159
175
  onHMRChange(on);
160
176
  };
177
+ const handleSwitchChange = (on) => {
178
+ onClipChange(on);
179
+ };
161
180
  const onKeyChange = (key, index) => __async(void 0, null, function* () {
162
181
  const version = yield getVersion == null ? void 0 : getVersion(key);
163
182
  if (version) {
@@ -166,120 +185,176 @@ const FormComponent = (props) => {
166
185
  setVersionList == null ? void 0 : setVersionList(list);
167
186
  }
168
187
  });
169
- return /* @__PURE__ */ jsx(FormList, { field: proxyFormField, children: (fields, { add, remove }) => /* @__PURE__ */ jsxs("div", { children: [
170
- /* @__PURE__ */ jsxs("div", { className: styles.header, children: [
171
- /* @__PURE__ */ jsx(
172
- Tooltip,
173
- {
174
- content: /* @__PURE__ */ jsx("div", { children: "Example: Customize the remote module address, which should end with 「.json」, for example key: @module-federation/button, value: http://localhost:3000/mf-manifest.json" }),
175
- children: /* @__PURE__ */ jsx(IconInfoCircle, {})
176
- }
177
- ),
178
- /* @__PURE__ */ jsx("div", { className: styles.title, children: "Module Proxy" }),
179
- /* @__PURE__ */ jsx(
180
- Button,
181
- {
182
- icon: /* @__PURE__ */ jsx(IconPlus, {}),
183
- shape: "circle",
184
- className: styles.add,
185
- onClick: () => onAdd(add),
186
- "data-set-e2e": "e2eAdd"
187
- }
188
- ),
189
- /* @__PURE__ */ jsxs("div", { className: styles.status, children: [
190
- /* @__PURE__ */ jsx(Badge, { color: condition.color, className: styles.badge }),
191
- /* @__PURE__ */ jsx("span", { className: styles.message, children: condition.message }),
192
- /* @__PURE__ */ jsxs("span", { className: styles.headerSlot, children: [
188
+ return /* @__PURE__ */ jsx(FormList, { field: proxyFormField, children: (fields, { add, remove }) => /* @__PURE__ */ jsxs("div", { className: styles.wrapper, children: [
189
+ /* @__PURE__ */ jsxs("div", { className: styles.sectionHeader, children: [
190
+ /* @__PURE__ */ jsxs("div", { className: styles.heading, children: [
191
+ /* @__PURE__ */ jsxs("div", { className: styles.titleRow, children: [
192
+ /* @__PURE__ */ jsx(Tooltip, { content: /* @__PURE__ */ jsx("div", { children: t("form.tooltip.proxyExample") }), children: /* @__PURE__ */ jsx(IconInfoCircle, {}) }),
193
+ /* @__PURE__ */ jsx("span", { className: styles.title, children: t("form.title") }),
194
+ /* @__PURE__ */ jsxs(
195
+ "span",
196
+ {
197
+ className: styles.statusMessage,
198
+ style: { marginLeft: 8 },
199
+ children: [
200
+ /* @__PURE__ */ jsx(Badge, { color: condition.color, className: styles.badge }),
201
+ condition.message
202
+ ]
203
+ }
204
+ )
205
+ ] }),
206
+ /* @__PURE__ */ jsx("span", { className: styles.subtitle, children: t("form.subtitle") })
207
+ ] }),
208
+ /* @__PURE__ */ jsxs("div", { className: styles.headerActions, children: [
209
+ /* @__PURE__ */ jsxs("span", { className: styles.hmrArea, children: [
193
210
  props.headerSlot,
211
+ /* @__PURE__ */ jsx(
212
+ Switch,
213
+ {
214
+ checked: enableClip,
215
+ checkedText: t("form.clip.enable"),
216
+ uncheckedText: t("form.clip.disable"),
217
+ onChange: handleSwitchChange,
218
+ className: styles.switch
219
+ }
220
+ ),
221
+ /* @__PURE__ */ jsx(Tooltip, { content: t("form.clip.tooltip"), children: /* @__PURE__ */ jsx(
222
+ IconQuestionCircle,
223
+ {
224
+ style: { marginLeft: 5, cursor: "pointer" }
225
+ }
226
+ ) }),
227
+ /* @__PURE__ */ jsx("div", { className: styles.divider }),
194
228
  /* @__PURE__ */ jsx(
195
229
  Switch,
196
230
  {
197
231
  checked: enableHMR === "enable",
198
- checkedText: "Enable HMR",
199
- uncheckedText: "Disable HMR",
232
+ checkedText: t("form.hmr.enable"),
233
+ uncheckedText: t("form.hmr.disable"),
200
234
  onChange: hmrChange,
201
235
  className: styles.switch
202
236
  }
203
237
  )
204
- ] })
238
+ ] }),
239
+ /* @__PURE__ */ jsx(
240
+ Button,
241
+ {
242
+ icon: /* @__PURE__ */ jsx(IconPlus, {}),
243
+ shape: "circle",
244
+ className: styles.add,
245
+ onClick: () => onAdd(add),
246
+ "data-set-e2e": "e2eAdd"
247
+ }
248
+ )
205
249
  ] })
206
250
  ] }),
207
- fields.length ? /* @__PURE__ */ jsx(Fragment, { children: fields.map((item, index) => {
251
+ fields.length ? /* @__PURE__ */ jsx("div", { className: styles.rules, children: fields.map((item, index) => {
208
252
  var _a, _b;
209
- return /* @__PURE__ */ jsxs(
210
- "div",
211
- {
212
- className: styles.container,
213
- "data-set-e2e": "e2eProxyItem",
214
- children: [
215
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
216
- FormItem,
217
- {
218
- field: `${item.field}.checked`,
219
- triggerPropName: "checked",
220
- children: /* @__PURE__ */ jsx(Checkbox, { className: styles.checkBox })
221
- }
222
- ) }),
223
- /* @__PURE__ */ jsx("div", { className: styles.input, children: /* @__PURE__ */ jsx(
224
- FormItem,
225
- {
226
- field: `${item.field}.key`,
227
- rules: [
228
- {
229
- validator: (value, cb) => validateKey(value, cb, index)
230
- }
231
- ],
232
- children: /* @__PURE__ */ jsx(
233
- Select,
234
- {
235
- "data-set-e2e": "e2eProxyKey",
236
- placeholder: "Module Name",
237
- onChange: (key) => onKeyChange(key, index),
238
- allowClear: true,
239
- showSearch: true,
240
- children: formatProducer.map((item2) => /* @__PURE__ */ jsx(Option, { value: item2.value, children: item2.label }, item2.value))
241
- }
242
- )
243
- }
244
- ) }),
245
- /* @__PURE__ */ jsx("div", { className: styles.input, children: /* @__PURE__ */ jsx(
246
- FormItem,
247
- {
248
- field: `${item.field}.value`,
249
- rules: [
250
- {
251
- validator: (value, cb) => validateValue(value, cb, index)
253
+ return /* @__PURE__ */ jsxs("div", { className: styles.ruleCard, children: [
254
+ /* @__PURE__ */ jsxs("div", { className: styles.ruleHeader, children: [
255
+ /* @__PURE__ */ jsx(
256
+ FormItem,
257
+ {
258
+ field: `${item.field}.checked`,
259
+ triggerPropName: "checked",
260
+ children: /* @__PURE__ */ jsx(Checkbox, { className: styles.toggle })
261
+ }
262
+ ),
263
+ /* @__PURE__ */ jsx(
264
+ Button,
265
+ {
266
+ icon: /* @__PURE__ */ jsx(IconDelete, {}),
267
+ shape: "circle",
268
+ status: "danger",
269
+ className: styles.delete,
270
+ "data-set-e2e": "e2eDelete",
271
+ onClick: () => onRemove(remove, index)
272
+ }
273
+ )
274
+ ] }),
275
+ /* @__PURE__ */ jsxs("div", { className: styles.inputs, "data-set-e2e": "e2eProxyItem", children: [
276
+ /* @__PURE__ */ jsx(
277
+ FormItem,
278
+ {
279
+ field: `${item.field}.key`,
280
+ rules: [
281
+ {
282
+ validator: (value, cb) => {
283
+ const isValid = Boolean(value);
284
+ if (isValid) {
285
+ cb();
286
+ validateKey(value, () => {
287
+ }, index);
288
+ } else {
289
+ cb(t("form.validation.moduleNameRequired"));
290
+ validateKey(value, () => {
291
+ }, index);
292
+ }
252
293
  }
253
- ],
254
- children: /* @__PURE__ */ jsx(
255
- Select,
256
- {
257
- "data-set-e2e": "e2eProxyValue",
258
- placeholder: "Custom Manifest URL",
259
- allowClear: true,
260
- showSearch: true,
261
- allowCreate: true,
262
- children: (_b = (_a = versionList || []) == null ? void 0 : _a[index]) == null ? void 0 : _b.map((version) => /* @__PURE__ */ jsx(Option, { value: version, children: version }, version))
294
+ }
295
+ ],
296
+ className: styles.field,
297
+ children: /* @__PURE__ */ jsx(
298
+ Select,
299
+ {
300
+ "data-set-e2e": "e2eProxyKey",
301
+ placeholder: t("form.fields.moduleName.placeholder"),
302
+ onChange: (key) => onKeyChange(key, index),
303
+ allowClear: true,
304
+ showSearch: true,
305
+ dropdownMenuClassName: styles.dropdown,
306
+ children: formatProducer.map((option) => /* @__PURE__ */ jsx(Option, { value: option.value, children: option.label }, option.value))
307
+ }
308
+ )
309
+ }
310
+ ),
311
+ /* @__PURE__ */ jsx(
312
+ FormItem,
313
+ {
314
+ field: `${item.field}.value`,
315
+ rules: [
316
+ {
317
+ validator: (value, cb) => {
318
+ const isValid = validateCustom(value) || validateSemver(value) || validatePort(value) || (customValueValidate == null ? void 0 : customValueValidate(value));
319
+ if (isValid) {
320
+ cb();
321
+ validateValue(value, () => {
322
+ }, index);
323
+ } else {
324
+ cb(t("form.validation.moduleInfoInvalid"));
325
+ validateValue(value, () => {
326
+ }, index);
327
+ }
263
328
  }
264
- )
265
- }
266
- ) }),
267
- /* @__PURE__ */ jsx(
268
- Button,
269
- {
270
- icon: /* @__PURE__ */ jsx(IconDelete, {}),
271
- shape: "circle",
272
- status: "danger",
273
- className: styles.delete,
274
- "data-set-e2e": "e2eDelete",
275
- onClick: () => onRemove(remove, index)
276
- }
277
- )
278
- ]
279
- },
280
- item.field
281
- );
282
- }) }) : /* @__PURE__ */ jsx(Empty, {})
329
+ }
330
+ ],
331
+ className: styles.field,
332
+ children: /* @__PURE__ */ jsx(
333
+ Select,
334
+ {
335
+ "data-set-e2e": "e2eProxyValue",
336
+ placeholder: t(
337
+ "form.fields.customManifest.placeholder"
338
+ ),
339
+ allowClear: true,
340
+ showSearch: true,
341
+ allowCreate: true,
342
+ dropdownMenuClassName: styles.dropdown,
343
+ children: (_b = (_a = versionList || []) == null ? void 0 : _a[index]) == null ? void 0 : _b.map((version) => /* @__PURE__ */ jsx(Option, { value: version, children: version }, version))
344
+ }
345
+ )
346
+ }
347
+ )
348
+ ] })
349
+ ] }, item.field);
350
+ }) }) : /* @__PURE__ */ jsx("div", { className: styles.emptyWrapper, children: /* @__PURE__ */ jsx(
351
+ Empty,
352
+ {
353
+ description: t("form.empty.description"),
354
+ className: styles.empty
355
+ }
356
+ ) }),
357
+ /* @__PURE__ */ jsx("div", { className: styles.footerHint, children: t("form.footer.hint") })
283
358
  ] }) });
284
359
  };
285
360
  var Form_default = FormComponent;
@@ -1,5 +1,5 @@
1
1
  import "./index_module.css";
2
- var index_module_default = { "container": "container_20b79", "checkBox": "checkBox_20b79", "input": "input_20b79", "delete": "delete_20b79", "header": "header_20b79", "add": "add_20b79", "title": "title_20b79", "status": "status_20b79", "message": "message_20b79", "switch": "switch_20b79", "headerSlot": "headerSlot_20b79", "badge": "badge_20b79" };
2
+ var index_module_default = { "wrapper": "wrapper_20b79", "sectionHeader": "sectionHeader_20b79", "heading": "heading_20b79", "titleRow": "titleRow_20b79", "title": "title_20b79", "subtitle": "subtitle_20b79", "headerActions": "headerActions_20b79", "badge": "badge_20b79", "statusMessage": "statusMessage_20b79", "divider": "divider_20b79", "hmrArea": "hmrArea_20b79", "switch": "switch_20b79", "rules": "rules_20b79", "ruleCard": "ruleCard_20b79", "ruleHeader": "ruleHeader_20b79", "toggle": "toggle_20b79", "inputs": "inputs_20b79", "field": "field_20b79", "dropdown": "dropdown_20b79", "delete": "delete_20b79", "emptyWrapper": "emptyWrapper_20b79", "empty": "empty_20b79", "footerHint": "footerHint_20b79" };
3
3
  export {
4
4
  index_module_default as default
5
5
  };