@module-federation/devtools 0.22.1 → 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.
- package/dist/es/App.css +6 -5
- package/dist/es/App.js +191 -59
- package/dist/es/App.module.js +1 -1
- package/dist/es/App_module.css +38 -36
- package/dist/es/component/DependencyGraph/index.js +10 -11
- package/dist/es/component/DependencyGraph/index_module.css +20 -17
- package/dist/es/component/DependencyGraphItem/index.js +5 -3
- package/dist/es/component/DependencyGraphItem/index_module.css +7 -7
- package/dist/es/component/Form/index.js +24 -31
- package/dist/es/component/Form/index.module.js +1 -1
- package/dist/es/component/Form/index_module.css +22 -25
- package/dist/es/component/LanguageSwitch.js +50 -0
- package/dist/es/component/Layout/index.js +6 -10
- package/dist/es/component/Layout/index_module.css +7 -7
- package/dist/es/component/ModuleInfo/index.js +65 -41
- package/dist/es/component/ModuleInfo/index_module.css +12 -11
- package/dist/es/component/SharedDepsExplorer/FocusResultDisplay.js +5 -3
- package/dist/es/component/SharedDepsExplorer/FocusResultDisplay_module.css +5 -5
- package/dist/es/component/SharedDepsExplorer/index.js +64 -75
- package/dist/es/component/SharedDepsExplorer/index_module.css +12 -2
- package/dist/es/component/ThemeToggle.js +19 -0
- package/dist/es/component/ThemeToggle.module.js +5 -0
- package/dist/es/component/ThemeToggle_module.css +12 -0
- package/dist/es/hooks/useDevtoolsTheme.js +77 -0
- package/dist/es/i18n/index.js +506 -0
- package/dist/lib/App.css +6 -5
- package/dist/lib/App.js +189 -59
- package/dist/lib/App.module.js +1 -1
- package/dist/lib/App_module.css +38 -36
- package/dist/lib/component/DependencyGraph/index.js +10 -11
- package/dist/lib/component/DependencyGraph/index_module.css +20 -17
- package/dist/lib/component/DependencyGraphItem/index.js +5 -3
- package/dist/lib/component/DependencyGraphItem/index_module.css +7 -7
- package/dist/lib/component/Form/index.js +24 -31
- package/dist/lib/component/Form/index.module.js +1 -1
- package/dist/lib/component/Form/index_module.css +22 -25
- package/dist/lib/component/LanguageSwitch.js +80 -0
- package/dist/lib/component/Layout/index.js +6 -10
- package/dist/lib/component/Layout/index_module.css +7 -7
- package/dist/lib/component/ModuleInfo/index.js +65 -41
- package/dist/lib/component/ModuleInfo/index_module.css +12 -11
- package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay.js +5 -3
- package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay_module.css +5 -5
- package/dist/lib/component/SharedDepsExplorer/index.js +64 -75
- package/dist/lib/component/SharedDepsExplorer/index_module.css +12 -2
- package/dist/lib/component/ThemeToggle.js +49 -0
- package/dist/lib/component/ThemeToggle.module.js +25 -0
- package/dist/lib/component/ThemeToggle_module.css +12 -0
- package/dist/lib/hooks/useDevtoolsTheme.js +101 -0
- package/dist/lib/i18n/index.js +540 -0
- package/dist/types/src/component/LanguageSwitch.d.ts +2 -0
- package/dist/types/src/component/ThemeToggle.d.ts +8 -0
- package/dist/types/src/hooks/useDevtoolsTheme.d.ts +2 -0
- package/dist/types/src/i18n/index.d.ts +5 -0
- package/package.json +10 -8
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 16px;
|
|
5
5
|
min-height: 340px;
|
|
6
|
-
color: #1f2937;
|
|
6
|
+
color: var(--color-text-1, #1f2937);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.header_5e584 {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
align-items: flex-start;
|
|
13
13
|
gap: 18px;
|
|
14
14
|
padding: 0 6px 6px;
|
|
15
|
-
border-bottom: 1px solid rgba(96, 165, 250, 0.3);
|
|
15
|
+
border-bottom: 1px solid var(--color-border-2, rgba(96, 165, 250, 0.3));
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
.titleBlock_5e584 {
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
.title_5e584 {
|
|
25
25
|
font-size: 16px;
|
|
26
26
|
font-weight: 600;
|
|
27
|
-
color: #1f2937;
|
|
27
|
+
color: var(--color-text-1, #1f2937);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.subtitle_5e584 {
|
|
31
31
|
font-size: 12px;
|
|
32
|
-
color: #4b5563;
|
|
32
|
+
color: var(--color-text-2, #4b5563);
|
|
33
33
|
max-width: 260px;
|
|
34
34
|
line-height: 1.5;
|
|
35
35
|
}
|
|
@@ -38,21 +38,21 @@
|
|
|
38
38
|
display: flex;
|
|
39
39
|
align-items: center;
|
|
40
40
|
gap: 10px;
|
|
41
|
-
background: rgba(228, 228, 231, 0.5);
|
|
41
|
+
background: var(--color-bg-2, rgba(228, 228, 231, 0.5));
|
|
42
42
|
padding: 4px 12px;
|
|
43
43
|
border-radius: 999px;
|
|
44
|
-
border: 1px solid rgba(96, 165, 250, 0.3);
|
|
44
|
+
border: 1px solid var(--color-border-2, rgba(96, 165, 250, 0.3));
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.metaBadge_5e584 {
|
|
48
48
|
font-size: 16px;
|
|
49
49
|
font-weight: 600;
|
|
50
|
-
color: #1f2937;
|
|
50
|
+
color: var(--color-text-1, #1f2937);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.metaLabel_5e584 {
|
|
54
54
|
font-size: 12px;
|
|
55
|
-
color: #4b5563;
|
|
55
|
+
color: var(--color-text-2, #4b5563);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
.filterBlock_5e584 {
|
|
@@ -65,19 +65,19 @@
|
|
|
65
65
|
flex: 1 1;
|
|
66
66
|
padding: 12px;
|
|
67
67
|
border-radius: 16px;
|
|
68
|
-
border: 1px solid rgba(96, 165, 250, 0.3);
|
|
69
|
-
background: rgba(228, 228, 231, 0.5);
|
|
68
|
+
border: 1px solid var(--color-border-1, rgba(96, 165, 250, 0.3));
|
|
69
|
+
background: var(--color-bg-2, rgba(228, 228, 231, 0.5));
|
|
70
70
|
backdrop-filter: blur(4px);
|
|
71
71
|
}
|
|
72
72
|
.canvas_5e584 .react-flow__handle {
|
|
73
73
|
width: 10px;
|
|
74
74
|
height: 10px;
|
|
75
75
|
border-radius: 50%;
|
|
76
|
-
border: 2px solid rgba(96, 165, 250, 0.3);
|
|
77
|
-
background: rgba(243, 244, 246, 0.9);
|
|
76
|
+
border: 2px solid var(--color-border-1, rgba(96, 165, 250, 0.3));
|
|
77
|
+
background: var(--color-bg-1, rgba(243, 244, 246, 0.9));
|
|
78
78
|
}
|
|
79
79
|
.canvas_5e584 .react-flow__controls-button:hover {
|
|
80
|
-
background: rgba(243, 244, 246, 0.9);
|
|
80
|
+
background: var(--color-bg-1, rgba(243, 244, 246, 0.9));
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
.graph_5e584 {
|
|
@@ -88,10 +88,13 @@
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
.controls_5e584 .react-flow__controls-button {
|
|
91
|
-
background: rgba(243, 244, 246, 0.3);
|
|
92
|
-
border-color: rgba(96, 165, 250, 0.3);
|
|
93
|
-
color: #1f2937;
|
|
91
|
+
background: var(--color-bg-2, rgba(243, 244, 246, 0.3));
|
|
92
|
+
border-color: var(--color-border-1, rgba(96, 165, 250, 0.3));
|
|
93
|
+
color: var(--color-text-1, #1f2937);
|
|
94
94
|
}
|
|
95
95
|
.controls_5e584 .react-flow__controls-button:hover {
|
|
96
|
-
background:
|
|
96
|
+
background: var(--color-bg-1, #ffffff);
|
|
97
|
+
}
|
|
98
|
+
.arco-theme-dark .controls_5e584 .react-flow__controls-button {
|
|
99
|
+
background: var(--color-bg-white);
|
|
97
100
|
}
|
|
@@ -34,11 +34,13 @@ module.exports = __toCommonJS(DependencyGraphItem_exports);
|
|
|
34
34
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
35
|
var import_react = require("react");
|
|
36
36
|
var import_reactflow = require("reactflow");
|
|
37
|
+
var import_react_i18next = require("react-i18next");
|
|
37
38
|
var import_index = __toESM(require("./index.module"));
|
|
38
39
|
var import_style = require("reactflow/dist/style.css");
|
|
39
40
|
const GraphItem = (props) => {
|
|
40
41
|
const [shareds, setShareds] = (0, import_react.useState)([]);
|
|
41
42
|
const [exposes, setExposes] = (0, import_react.useState)([]);
|
|
43
|
+
const { t } = (0, import_react_i18next.useTranslation)();
|
|
42
44
|
let name;
|
|
43
45
|
let version;
|
|
44
46
|
const { info = "", color, remote } = props.data;
|
|
@@ -89,19 +91,19 @@ const GraphItem = (props) => {
|
|
|
89
91
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.group, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.name, children: name }) }),
|
|
90
92
|
version && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.info, children: [
|
|
91
93
|
exposes.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default["expose-container"], children: [
|
|
92
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.type, children: "
|
|
94
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.type, children: t("graphItem.expose") }),
|
|
93
95
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: exposes.map((expose, index) => {
|
|
94
96
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.item, children: expose }, index);
|
|
95
97
|
}) })
|
|
96
98
|
] }) : null,
|
|
97
99
|
shareds.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default["expose-container"], children: [
|
|
98
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.type, children: "
|
|
100
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.type, children: t("graphItem.shared") }),
|
|
99
101
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: shareds.map((shared, index) => {
|
|
100
102
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.item, children: shared }, index);
|
|
101
103
|
}) })
|
|
102
104
|
] }) : null,
|
|
103
105
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.message, children: [
|
|
104
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.type, children: isEntryType ? "
|
|
106
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.type, children: isEntryType ? t("graphItem.entry") : t("graphItem.version") }),
|
|
105
107
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.item, children: version })
|
|
106
108
|
] })
|
|
107
109
|
] })
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
display: flex;
|
|
3
3
|
width: 320px;
|
|
4
4
|
border-radius: 18px;
|
|
5
|
-
border: 1px solid rgba(96, 165, 250, 0.3);
|
|
5
|
+
border: 1px solid var(--color-border-1, rgba(96, 165, 250, 0.3));
|
|
6
6
|
overflow: hidden;
|
|
7
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%), rgba(255, 255, 255, 0.9);
|
|
9
|
-
color: #1f2937;
|
|
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
10
|
backdrop-filter: blur(4px);
|
|
11
11
|
}
|
|
12
12
|
.Wrapper_d8079 .react-flow__handle {
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
font-weight: 600;
|
|
63
63
|
text-transform: uppercase;
|
|
64
64
|
letter-spacing: 0.04em;
|
|
65
|
-
color: #4b5563;
|
|
65
|
+
color: var(--color-text-2, #4b5563);
|
|
66
66
|
}
|
|
67
67
|
.Wrapper_d8079 .item_d8079 {
|
|
68
68
|
display: inline-flex;
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
padding: 4px 8px;
|
|
71
71
|
border-radius: 999px;
|
|
72
72
|
background: rgba(243, 244, 246, 0.6);
|
|
73
|
-
color: #1f2937;
|
|
73
|
+
color: var(--color-text-1, #1f2937);
|
|
74
74
|
font-size: 10px;
|
|
75
75
|
font-weight: 500;
|
|
76
76
|
margin-right: 6px;
|
|
@@ -85,11 +85,11 @@
|
|
|
85
85
|
align-items: center;
|
|
86
86
|
gap: 6px;
|
|
87
87
|
font-size: 11px;
|
|
88
|
-
color: #4b5563;
|
|
88
|
+
color: var(--color-text-2, #4b5563);
|
|
89
89
|
}
|
|
90
90
|
.Wrapper_d8079 .message_d8079 .item_d8079 {
|
|
91
91
|
margin-right: 0;
|
|
92
92
|
padding: 4px 10px;
|
|
93
93
|
background: rgba(243, 244, 246, 0.6);
|
|
94
|
-
color: #1f2937;
|
|
94
|
+
color: var(--color-text-1, #1f2937);
|
|
95
95
|
}
|
|
@@ -54,6 +54,7 @@ module.exports = __toCommonJS(Form_exports);
|
|
|
54
54
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
55
55
|
var import_react = require("react");
|
|
56
56
|
var import_web_react = require("@arco-design/web-react");
|
|
57
|
+
var import_react_i18next = require("react-i18next");
|
|
57
58
|
var import_icon = require("@arco-design/web-react/icon");
|
|
58
59
|
var import_constant = require("../../template/constant");
|
|
59
60
|
var import_utils = require("../../utils");
|
|
@@ -77,6 +78,7 @@ const FormComponent = (props) => {
|
|
|
77
78
|
enableClip,
|
|
78
79
|
onClipChange
|
|
79
80
|
} = props;
|
|
81
|
+
const { t } = (0, import_react_i18next.useTranslation)();
|
|
80
82
|
const federation = window.__FEDERATION__ || {
|
|
81
83
|
moduleInfo: {},
|
|
82
84
|
originModuleInfo: {}
|
|
@@ -84,8 +86,8 @@ const FormComponent = (props) => {
|
|
|
84
86
|
const { moduleInfo } = federation;
|
|
85
87
|
let { producer } = (0, import_utils.separateType)(moduleInfo);
|
|
86
88
|
const filterDupMap = /* @__PURE__ */ new Map();
|
|
87
|
-
producer = producer.filter((
|
|
88
|
-
const [typeOrName, name] =
|
|
89
|
+
producer = producer.filter((tItem) => {
|
|
90
|
+
const [typeOrName, name] = tItem.split(":");
|
|
89
91
|
const marked = filterDupMap.get(name || typeOrName);
|
|
90
92
|
filterDupMap.set(name || typeOrName, true);
|
|
91
93
|
return !marked;
|
|
@@ -142,7 +144,7 @@ const FormComponent = (props) => {
|
|
|
142
144
|
setTimeout(() => {
|
|
143
145
|
setFormStatus(statusSet);
|
|
144
146
|
}, 0);
|
|
145
|
-
return callback("
|
|
147
|
+
return callback(t("form.validation.moduleNameRequired"));
|
|
146
148
|
};
|
|
147
149
|
const validateValue = (value, callback, index) => {
|
|
148
150
|
const status = getCheckStatus(index);
|
|
@@ -168,9 +170,7 @@ const FormComponent = (props) => {
|
|
|
168
170
|
setTimeout(() => {
|
|
169
171
|
setFormStatus(statusSet);
|
|
170
172
|
}, 0);
|
|
171
|
-
return callback(
|
|
172
|
-
"The module information format is incorrect, check the format in the upper left corner"
|
|
173
|
-
);
|
|
173
|
+
return callback(t("form.validation.moduleInfoInvalid"));
|
|
174
174
|
};
|
|
175
175
|
const onAdd = (add) => {
|
|
176
176
|
add(import_constant.defaultDataItem);
|
|
@@ -202,14 +202,8 @@ const FormComponent = (props) => {
|
|
|
202
202
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.sectionHeader, children: [
|
|
203
203
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.heading, children: [
|
|
204
204
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.titleRow, children: [
|
|
205
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
206
|
-
|
|
207
|
-
{
|
|
208
|
-
content: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "Example: Customise the remote module address ending with 「.json」. For instance key: @module-federation/button, value: http://localhost:3000/mf-manifest.json" }),
|
|
209
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.IconInfoCircle, {})
|
|
210
|
-
}
|
|
211
|
-
),
|
|
212
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.title, children: "Proxy Overrides" }),
|
|
205
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Tooltip, { content: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: t("form.tooltip.proxyExample") }), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.IconInfoCircle, {}) }),
|
|
206
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.title, children: t("form.title") }),
|
|
213
207
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
214
208
|
"span",
|
|
215
209
|
{
|
|
@@ -222,7 +216,7 @@ const FormComponent = (props) => {
|
|
|
222
216
|
}
|
|
223
217
|
)
|
|
224
218
|
] }),
|
|
225
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.subtitle, children: "
|
|
219
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.subtitle, children: t("form.subtitle") })
|
|
226
220
|
] }),
|
|
227
221
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.headerActions, children: [
|
|
228
222
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: import_index.default.hmrArea, children: [
|
|
@@ -231,13 +225,13 @@ const FormComponent = (props) => {
|
|
|
231
225
|
import_web_react.Switch,
|
|
232
226
|
{
|
|
233
227
|
checked: enableClip,
|
|
234
|
-
checkedText: "
|
|
235
|
-
uncheckedText: "
|
|
228
|
+
checkedText: t("form.clip.enable"),
|
|
229
|
+
uncheckedText: t("form.clip.disable"),
|
|
236
230
|
onChange: handleSwitchChange,
|
|
237
231
|
className: import_index.default.switch
|
|
238
232
|
}
|
|
239
233
|
),
|
|
240
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Tooltip, { content: "
|
|
234
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Tooltip, { content: t("form.clip.tooltip"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
241
235
|
import_icon.IconQuestionCircle,
|
|
242
236
|
{
|
|
243
237
|
style: { marginLeft: 5, cursor: "pointer" }
|
|
@@ -248,8 +242,8 @@ const FormComponent = (props) => {
|
|
|
248
242
|
import_web_react.Switch,
|
|
249
243
|
{
|
|
250
244
|
checked: enableHMR === "enable",
|
|
251
|
-
checkedText: "
|
|
252
|
-
uncheckedText: "
|
|
245
|
+
checkedText: t("form.hmr.enable"),
|
|
246
|
+
uncheckedText: t("form.hmr.disable"),
|
|
253
247
|
onChange: hmrChange,
|
|
254
248
|
className: import_index.default.switch
|
|
255
249
|
}
|
|
@@ -262,8 +256,7 @@ const FormComponent = (props) => {
|
|
|
262
256
|
shape: "circle",
|
|
263
257
|
className: import_index.default.add,
|
|
264
258
|
onClick: () => onAdd(add),
|
|
265
|
-
"data-set-e2e": "e2eAdd"
|
|
266
|
-
type: "primary"
|
|
259
|
+
"data-set-e2e": "e2eAdd"
|
|
267
260
|
}
|
|
268
261
|
)
|
|
269
262
|
] })
|
|
@@ -306,7 +299,7 @@ const FormComponent = (props) => {
|
|
|
306
299
|
validateKey(value, () => {
|
|
307
300
|
}, index);
|
|
308
301
|
} else {
|
|
309
|
-
cb("
|
|
302
|
+
cb(t("form.validation.moduleNameRequired"));
|
|
310
303
|
validateKey(value, () => {
|
|
311
304
|
}, index);
|
|
312
305
|
}
|
|
@@ -318,12 +311,12 @@ const FormComponent = (props) => {
|
|
|
318
311
|
import_web_react.Select,
|
|
319
312
|
{
|
|
320
313
|
"data-set-e2e": "e2eProxyKey",
|
|
321
|
-
placeholder: "
|
|
314
|
+
placeholder: t("form.fields.moduleName.placeholder"),
|
|
322
315
|
onChange: (key) => onKeyChange(key, index),
|
|
323
316
|
allowClear: true,
|
|
324
317
|
showSearch: true,
|
|
325
318
|
dropdownMenuClassName: import_index.default.dropdown,
|
|
326
|
-
children: formatProducer.map((
|
|
319
|
+
children: formatProducer.map((option) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Option, { value: option.value, children: option.label }, option.value))
|
|
327
320
|
}
|
|
328
321
|
)
|
|
329
322
|
}
|
|
@@ -341,9 +334,7 @@ const FormComponent = (props) => {
|
|
|
341
334
|
validateValue(value, () => {
|
|
342
335
|
}, index);
|
|
343
336
|
} else {
|
|
344
|
-
cb(
|
|
345
|
-
"The module information format is incorrect, check the format in the upper left corner"
|
|
346
|
-
);
|
|
337
|
+
cb(t("form.validation.moduleInfoInvalid"));
|
|
347
338
|
validateValue(value, () => {
|
|
348
339
|
}, index);
|
|
349
340
|
}
|
|
@@ -355,7 +346,9 @@ const FormComponent = (props) => {
|
|
|
355
346
|
import_web_react.Select,
|
|
356
347
|
{
|
|
357
348
|
"data-set-e2e": "e2eProxyValue",
|
|
358
|
-
placeholder:
|
|
349
|
+
placeholder: t(
|
|
350
|
+
"form.fields.customManifest.placeholder"
|
|
351
|
+
),
|
|
359
352
|
allowClear: true,
|
|
360
353
|
showSearch: true,
|
|
361
354
|
allowCreate: true,
|
|
@@ -370,11 +363,11 @@ const FormComponent = (props) => {
|
|
|
370
363
|
}) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.emptyWrapper, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
371
364
|
import_web_react.Empty,
|
|
372
365
|
{
|
|
373
|
-
description: "
|
|
366
|
+
description: t("form.empty.description"),
|
|
374
367
|
className: import_index.default.empty
|
|
375
368
|
}
|
|
376
369
|
) }),
|
|
377
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.footerHint, children: "
|
|
370
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.footerHint, children: t("form.footer.hint") })
|
|
378
371
|
] }) });
|
|
379
372
|
};
|
|
380
373
|
var Form_default = FormComponent;
|
|
@@ -22,4 +22,4 @@ __export(index_module_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(index_module_exports);
|
|
24
24
|
var import_index_module = require("./index_module.css");
|
|
25
|
-
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", "
|
|
25
|
+
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" };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 18px;
|
|
5
|
-
color: #1f2937;
|
|
5
|
+
color: var(--color-text-1, #1f2937);
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.sectionHeader_20b79 {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
justify-content: space-between;
|
|
12
12
|
gap: 18px;
|
|
13
13
|
padding: 12px 16px;
|
|
14
|
-
background: rgba(228, 228, 231, 0.
|
|
14
|
+
background: rgba(228, 228, 231, 0.1);
|
|
15
15
|
border: 1px solid rgba(228, 228, 231, 0.5);
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
gap: 10px;
|
|
29
29
|
font-size: 16px;
|
|
30
30
|
font-weight: 600;
|
|
31
|
-
color: #1f2937;
|
|
31
|
+
color: var(--color-text-1, #1f2937);
|
|
32
32
|
}
|
|
33
33
|
.titleRow_20b79 .arco-icon {
|
|
34
34
|
color: rgba(23, 75, 180, 0.9);
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
|
|
42
42
|
.subtitle_20b79 {
|
|
43
43
|
font-size: 12px;
|
|
44
|
-
color: #4b5563;
|
|
44
|
+
color: var(--color-text-2, #4b5563);
|
|
45
45
|
line-height: 1.5;
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -51,9 +51,6 @@
|
|
|
51
51
|
gap: 12px;
|
|
52
52
|
flex-wrap: wrap;
|
|
53
53
|
}
|
|
54
|
-
.headerActions_20b79 .add_20b79 {
|
|
55
|
-
box-shadow: 0 8px 16px rgba(243, 244, 246, 0.9);
|
|
56
|
-
}
|
|
57
54
|
|
|
58
55
|
.badge_20b79 {
|
|
59
56
|
transform: scale(1.4);
|
|
@@ -62,7 +59,7 @@
|
|
|
62
59
|
|
|
63
60
|
.statusMessage_20b79 {
|
|
64
61
|
font-size: 12px;
|
|
65
|
-
color: #4b5563;
|
|
62
|
+
color: var(--color-text-2, #4b5563);
|
|
66
63
|
max-width: 260px;
|
|
67
64
|
line-height: 1.4;
|
|
68
65
|
}
|
|
@@ -78,16 +75,16 @@
|
|
|
78
75
|
align-items: center;
|
|
79
76
|
gap: 8px;
|
|
80
77
|
font-size: 12px;
|
|
81
|
-
color: #4b5563;
|
|
78
|
+
color: var(--color-text-2, #4b5563);
|
|
82
79
|
}
|
|
83
80
|
|
|
84
81
|
.switch_20b79 .arco-switch {
|
|
85
|
-
background: rgba(243, 244, 246, 0.9);
|
|
82
|
+
background: rgba(243, 244, 246, var(--form-control-alpha, 0.9));
|
|
86
83
|
border-color: rgba(96, 165, 250, 0.35);
|
|
87
|
-
color: #4b5563;
|
|
84
|
+
color: var(--color-text-2, #4b5563);
|
|
88
85
|
}
|
|
89
86
|
.switch_20b79 .arco-switch-checked {
|
|
90
|
-
background: rgba(243, 244, 246, 0.9);
|
|
87
|
+
background: rgba(243, 244, 246, var(--form-control-alpha, 0.9));
|
|
91
88
|
border-color: rgba(96, 165, 250, 0.35);
|
|
92
89
|
}
|
|
93
90
|
|
|
@@ -104,7 +101,7 @@
|
|
|
104
101
|
padding: 18px;
|
|
105
102
|
border-radius: 18px;
|
|
106
103
|
border: 1px solid rgba(228, 228, 231, 0.5);
|
|
107
|
-
background: rgba(255, 255, 255, 0.9);
|
|
104
|
+
background: var(--color-bg-1, rgba(255, 255, 255, 0.9));
|
|
108
105
|
box-shadow: 0 15px 32px rgba(8, 11, 25, 0.45);
|
|
109
106
|
}
|
|
110
107
|
|
|
@@ -120,10 +117,10 @@
|
|
|
120
117
|
.toggle_20b79 .arco-checkbox-icon {
|
|
121
118
|
border-radius: 6px;
|
|
122
119
|
border-color: rgba(228, 228, 231, 0.5);
|
|
123
|
-
background: rgba(243, 244, 246, 0.
|
|
120
|
+
background: rgba(243, 244, 246, var(--form-control-alpha, 0.1));
|
|
124
121
|
}
|
|
125
122
|
.toggle_20b79 .arco-checkbox-checked .arco-checkbox-icon {
|
|
126
|
-
background: rgba(243, 244, 246, 0.
|
|
123
|
+
background: rgba(243, 244, 246, var(--form-control-alpha, 0.1));
|
|
127
124
|
border-color: rgba(228, 228, 231, 0.5);
|
|
128
125
|
}
|
|
129
126
|
|
|
@@ -145,31 +142,31 @@
|
|
|
145
142
|
width: 100%;
|
|
146
143
|
}
|
|
147
144
|
.field_20b79 .arco-select-view {
|
|
148
|
-
background: rgba(243, 244, 246, 0.
|
|
145
|
+
background: rgba(243, 244, 246, var(--form-control-alpha, 0.1));
|
|
149
146
|
border: 1px solid rgba(228, 228, 231, 0.5);
|
|
150
147
|
border-radius: 14px;
|
|
151
|
-
color: #1f2937;
|
|
148
|
+
color: var(--color-text-1, #1f2937);
|
|
152
149
|
min-height: 42px;
|
|
153
150
|
padding: 6px 12px;
|
|
154
151
|
}
|
|
155
152
|
.field_20b79 .arco-select-view-input {
|
|
156
|
-
color: #4b5563;
|
|
153
|
+
color: var(--color-text-2, #4b5563);
|
|
157
154
|
}
|
|
158
155
|
.field_20b79 .arco-select-view-placeholder {
|
|
159
|
-
color: #4b5563;
|
|
156
|
+
color: var(--color-text-2, #4b5563);
|
|
160
157
|
}
|
|
161
158
|
|
|
162
159
|
.dropdown_20b79 {
|
|
163
|
-
background: rgba(255, 255, 255, 0.9);
|
|
160
|
+
background: var(--color-bg-1, rgba(255, 255, 255, 0.9));
|
|
164
161
|
border: 1px solid rgba(228, 228, 231, 0.5);
|
|
165
162
|
box-shadow: 0 16px 30px rgba(8, 11, 25, 0.45);
|
|
166
163
|
}
|
|
167
164
|
.dropdown_20b79 .arco-select-option {
|
|
168
|
-
color: #4b5563;
|
|
165
|
+
color: var(--color-text-2, #4b5563);
|
|
169
166
|
}
|
|
170
167
|
.dropdown_20b79 .arco-select-option:hover,
|
|
171
168
|
.dropdown_20b79 .arco-select-option.arco-select-option-selected {
|
|
172
|
-
background: rgba(243, 244, 246, 0.
|
|
169
|
+
background: rgba(243, 244, 246, var(--form-control-alpha, 0.1));
|
|
173
170
|
}
|
|
174
171
|
|
|
175
172
|
.delete_20b79 {
|
|
@@ -180,18 +177,18 @@
|
|
|
180
177
|
border-radius: 16px;
|
|
181
178
|
border: 1px dashed rgba(228, 228, 231, 0.5);
|
|
182
179
|
padding: 28px 16px;
|
|
183
|
-
background: rgba(255, 255, 255, 0.9);
|
|
180
|
+
background: var(--color-bg-1, rgba(255, 255, 255, 0.9));
|
|
184
181
|
display: flex;
|
|
185
182
|
justify-content: center;
|
|
186
183
|
}
|
|
187
184
|
|
|
188
185
|
.empty_20b79 .arco-empty-description {
|
|
189
|
-
color: #4b5563;
|
|
186
|
+
color: var(--color-text-2, #4b5563);
|
|
190
187
|
}
|
|
191
188
|
|
|
192
189
|
.footerHint_20b79 {
|
|
193
190
|
font-size: 11px;
|
|
194
|
-
color: #4b5563;
|
|
191
|
+
color: var(--color-text-2, #4b5563);
|
|
195
192
|
text-align: right;
|
|
196
193
|
letter-spacing: 0.04em;
|
|
197
194
|
text-transform: uppercase;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var LanguageSwitch_exports = {};
|
|
30
|
+
__export(LanguageSwitch_exports, {
|
|
31
|
+
default: () => LanguageSwitch_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(LanguageSwitch_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_web_react = require("@arco-design/web-react");
|
|
36
|
+
var import_icon = require("@arco-design/web-react/icon");
|
|
37
|
+
var import_react_i18next = require("react-i18next");
|
|
38
|
+
var import_i18n = require("../i18n");
|
|
39
|
+
var import_ThemeToggle = __toESM(require("./ThemeToggle.module"));
|
|
40
|
+
const LANGUAGE_OPTIONS = [
|
|
41
|
+
{ value: "zh-CN", label: "中文" },
|
|
42
|
+
{ value: "en", label: "English" }
|
|
43
|
+
];
|
|
44
|
+
const persistLanguage = (lang) => {
|
|
45
|
+
var _a;
|
|
46
|
+
if (typeof window !== "undefined") {
|
|
47
|
+
try {
|
|
48
|
+
window.localStorage.setItem(import_i18n.LANGUAGE_STORAGE_KEY, lang);
|
|
49
|
+
} catch (e) {
|
|
50
|
+
}
|
|
51
|
+
const { chrome } = window;
|
|
52
|
+
const storage = (_a = chrome == null ? void 0 : chrome.storage) == null ? void 0 : _a.local;
|
|
53
|
+
if (storage && typeof storage.set === "function") {
|
|
54
|
+
try {
|
|
55
|
+
storage.set({ [import_i18n.LANGUAGE_STORAGE_KEY]: lang });
|
|
56
|
+
} catch (e) {
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const LanguageSwitch = () => {
|
|
62
|
+
var _a;
|
|
63
|
+
const { i18n } = (0, import_react_i18next.useTranslation)();
|
|
64
|
+
const current = ((_a = i18n.language) == null ? void 0 : _a.toLowerCase()) || "zh-cn";
|
|
65
|
+
const value = current.startsWith("en") ? "en" : "zh-CN";
|
|
66
|
+
const handleChange = (next) => {
|
|
67
|
+
i18n.changeLanguage(next);
|
|
68
|
+
persistLanguage(next);
|
|
69
|
+
};
|
|
70
|
+
const droplist = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Menu, { onClickMenuItem: handleChange, selectedKeys: [value], children: LANGUAGE_OPTIONS.map((option) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Menu.Item, { children: option.label }, option.value)) });
|
|
71
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Dropdown, { droplist, trigger: "click", position: "br", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
72
|
+
import_web_react.Button,
|
|
73
|
+
{
|
|
74
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.IconLanguage, {}),
|
|
75
|
+
size: "default",
|
|
76
|
+
className: import_ThemeToggle.default.themeToggle
|
|
77
|
+
}
|
|
78
|
+
) });
|
|
79
|
+
};
|
|
80
|
+
var LanguageSwitch_default = LanguageSwitch;
|
|
@@ -72,6 +72,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
72
72
|
var import_react = require("react");
|
|
73
73
|
var import_ahooks = require("ahooks");
|
|
74
74
|
var import_web_react = require("@arco-design/web-react");
|
|
75
|
+
var import_react_i18next = require("react-i18next");
|
|
75
76
|
var import_sdk = require("@module-federation/sdk");
|
|
76
77
|
var import_Form = __toESM(require("../Form"));
|
|
77
78
|
var import_utils = require("../../utils");
|
|
@@ -103,6 +104,7 @@ const Layout = (props) => {
|
|
|
103
104
|
onModuleInfoReset,
|
|
104
105
|
tabId
|
|
105
106
|
} = props;
|
|
107
|
+
const { t } = (0, import_react_i18next.useTranslation)();
|
|
106
108
|
const { producer } = (0, import_utils.separateType)(moduleInfo);
|
|
107
109
|
const producerKey = (0, import_react.useMemo)(() => producer.join("|"), [producer]);
|
|
108
110
|
const [condition, setCondition] = (0, import_react.useState)(import_constant.statusInfo.processing);
|
|
@@ -427,17 +429,11 @@ const Layout = (props) => {
|
|
|
427
429
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.wrapper, children: [
|
|
428
430
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.summaryCard, children: [
|
|
429
431
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.summaryHeader, children: [
|
|
430
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.summaryTitle, children: "
|
|
431
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.summaryHint, children: "
|
|
432
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.summaryTitle, children: t("layout.summary.title") }),
|
|
433
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.summaryHint, children: t("layout.summary.hint") })
|
|
432
434
|
] }),
|
|
433
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
434
|
-
|
|
435
|
-
extraCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: import_index.default.moreChip, children: [
|
|
436
|
-
"+",
|
|
437
|
-
extraCount,
|
|
438
|
-
" more"
|
|
439
|
-
] })
|
|
440
|
-
] })
|
|
435
|
+
previewList.length ? previewList.map((name) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.chip, children: name }, name)) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.chipPlaceholder, children: t("layout.summary.placeholder") }),
|
|
436
|
+
extraCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.moreChip, children: t("layout.summary.more", { count: extraCount }) })
|
|
441
437
|
] }),
|
|
442
438
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", { className: import_index.default.formSection, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
443
439
|
import_web_react.Form,
|