@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
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
3
|
import { Handle, Position } from "reactflow";
|
|
4
|
+
import { useTranslation } from "react-i18next";
|
|
4
5
|
import styles from "./index.module";
|
|
5
6
|
import "reactflow/dist/style.css";
|
|
6
7
|
const GraphItem = (props) => {
|
|
7
8
|
const [shareds, setShareds] = useState([]);
|
|
8
9
|
const [exposes, setExposes] = useState([]);
|
|
10
|
+
const { t } = useTranslation();
|
|
9
11
|
let name;
|
|
10
12
|
let version;
|
|
11
13
|
const { info = "", color, remote } = props.data;
|
|
@@ -56,19 +58,19 @@ const GraphItem = (props) => {
|
|
|
56
58
|
/* @__PURE__ */ jsx("div", { className: styles.group, children: /* @__PURE__ */ jsx("div", { className: styles.name, children: name }) }),
|
|
57
59
|
version && /* @__PURE__ */ jsxs("div", { className: styles.info, children: [
|
|
58
60
|
exposes.length > 0 ? /* @__PURE__ */ jsxs("div", { className: styles["expose-container"], children: [
|
|
59
|
-
/* @__PURE__ */ jsx("span", { className: styles.type, children: "
|
|
61
|
+
/* @__PURE__ */ jsx("span", { className: styles.type, children: t("graphItem.expose") }),
|
|
60
62
|
/* @__PURE__ */ jsx("div", { children: exposes.map((expose, index) => {
|
|
61
63
|
return /* @__PURE__ */ jsx("span", { className: styles.item, children: expose }, index);
|
|
62
64
|
}) })
|
|
63
65
|
] }) : null,
|
|
64
66
|
shareds.length > 0 ? /* @__PURE__ */ jsxs("div", { className: styles["expose-container"], children: [
|
|
65
|
-
/* @__PURE__ */ jsx("span", { className: styles.type, children: "
|
|
67
|
+
/* @__PURE__ */ jsx("span", { className: styles.type, children: t("graphItem.shared") }),
|
|
66
68
|
/* @__PURE__ */ jsx("div", { children: shareds.map((shared, index) => {
|
|
67
69
|
return /* @__PURE__ */ jsx("span", { className: styles.item, children: shared }, index);
|
|
68
70
|
}) })
|
|
69
71
|
] }) : null,
|
|
70
72
|
/* @__PURE__ */ jsxs("div", { className: styles.message, children: [
|
|
71
|
-
/* @__PURE__ */ jsx("span", { className: styles.type, children: isEntryType ? "
|
|
73
|
+
/* @__PURE__ */ jsx("span", { className: styles.type, children: isEntryType ? t("graphItem.entry") : t("graphItem.version") }),
|
|
72
74
|
/* @__PURE__ */ jsx("span", { className: styles.item, children: version })
|
|
73
75
|
] })
|
|
74
76
|
] })
|
|
@@ -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
|
}
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
Select,
|
|
31
31
|
Switch
|
|
32
32
|
} from "@arco-design/web-react";
|
|
33
|
+
import { useTranslation } from "react-i18next";
|
|
33
34
|
import {
|
|
34
35
|
IconDelete,
|
|
35
36
|
IconPlus,
|
|
@@ -64,6 +65,7 @@ const FormComponent = (props) => {
|
|
|
64
65
|
enableClip,
|
|
65
66
|
onClipChange
|
|
66
67
|
} = props;
|
|
68
|
+
const { t } = useTranslation();
|
|
67
69
|
const federation = window.__FEDERATION__ || {
|
|
68
70
|
moduleInfo: {},
|
|
69
71
|
originModuleInfo: {}
|
|
@@ -71,8 +73,8 @@ const FormComponent = (props) => {
|
|
|
71
73
|
const { moduleInfo } = federation;
|
|
72
74
|
let { producer } = separateType(moduleInfo);
|
|
73
75
|
const filterDupMap = /* @__PURE__ */ new Map();
|
|
74
|
-
producer = producer.filter((
|
|
75
|
-
const [typeOrName, name] =
|
|
76
|
+
producer = producer.filter((tItem) => {
|
|
77
|
+
const [typeOrName, name] = tItem.split(":");
|
|
76
78
|
const marked = filterDupMap.get(name || typeOrName);
|
|
77
79
|
filterDupMap.set(name || typeOrName, true);
|
|
78
80
|
return !marked;
|
|
@@ -129,7 +131,7 @@ const FormComponent = (props) => {
|
|
|
129
131
|
setTimeout(() => {
|
|
130
132
|
setFormStatus(statusSet);
|
|
131
133
|
}, 0);
|
|
132
|
-
return callback("
|
|
134
|
+
return callback(t("form.validation.moduleNameRequired"));
|
|
133
135
|
};
|
|
134
136
|
const validateValue = (value, callback, index) => {
|
|
135
137
|
const status = getCheckStatus(index);
|
|
@@ -155,9 +157,7 @@ const FormComponent = (props) => {
|
|
|
155
157
|
setTimeout(() => {
|
|
156
158
|
setFormStatus(statusSet);
|
|
157
159
|
}, 0);
|
|
158
|
-
return callback(
|
|
159
|
-
"The module information format is incorrect, check the format in the upper left corner"
|
|
160
|
-
);
|
|
160
|
+
return callback(t("form.validation.moduleInfoInvalid"));
|
|
161
161
|
};
|
|
162
162
|
const onAdd = (add) => {
|
|
163
163
|
add(defaultDataItem);
|
|
@@ -189,14 +189,8 @@ const FormComponent = (props) => {
|
|
|
189
189
|
/* @__PURE__ */ jsxs("div", { className: styles.sectionHeader, children: [
|
|
190
190
|
/* @__PURE__ */ jsxs("div", { className: styles.heading, children: [
|
|
191
191
|
/* @__PURE__ */ jsxs("div", { className: styles.titleRow, children: [
|
|
192
|
-
/* @__PURE__ */ jsx(
|
|
193
|
-
|
|
194
|
-
{
|
|
195
|
-
content: /* @__PURE__ */ 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" }),
|
|
196
|
-
children: /* @__PURE__ */ jsx(IconInfoCircle, {})
|
|
197
|
-
}
|
|
198
|
-
),
|
|
199
|
-
/* @__PURE__ */ jsx("span", { className: styles.title, children: "Proxy Overrides" }),
|
|
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") }),
|
|
200
194
|
/* @__PURE__ */ jsxs(
|
|
201
195
|
"span",
|
|
202
196
|
{
|
|
@@ -209,7 +203,7 @@ const FormComponent = (props) => {
|
|
|
209
203
|
}
|
|
210
204
|
)
|
|
211
205
|
] }),
|
|
212
|
-
/* @__PURE__ */ jsx("span", { className: styles.subtitle, children: "
|
|
206
|
+
/* @__PURE__ */ jsx("span", { className: styles.subtitle, children: t("form.subtitle") })
|
|
213
207
|
] }),
|
|
214
208
|
/* @__PURE__ */ jsxs("div", { className: styles.headerActions, children: [
|
|
215
209
|
/* @__PURE__ */ jsxs("span", { className: styles.hmrArea, children: [
|
|
@@ -218,13 +212,13 @@ const FormComponent = (props) => {
|
|
|
218
212
|
Switch,
|
|
219
213
|
{
|
|
220
214
|
checked: enableClip,
|
|
221
|
-
checkedText: "
|
|
222
|
-
uncheckedText: "
|
|
215
|
+
checkedText: t("form.clip.enable"),
|
|
216
|
+
uncheckedText: t("form.clip.disable"),
|
|
223
217
|
onChange: handleSwitchChange,
|
|
224
218
|
className: styles.switch
|
|
225
219
|
}
|
|
226
220
|
),
|
|
227
|
-
/* @__PURE__ */ jsx(Tooltip, { content: "
|
|
221
|
+
/* @__PURE__ */ jsx(Tooltip, { content: t("form.clip.tooltip"), children: /* @__PURE__ */ jsx(
|
|
228
222
|
IconQuestionCircle,
|
|
229
223
|
{
|
|
230
224
|
style: { marginLeft: 5, cursor: "pointer" }
|
|
@@ -235,8 +229,8 @@ const FormComponent = (props) => {
|
|
|
235
229
|
Switch,
|
|
236
230
|
{
|
|
237
231
|
checked: enableHMR === "enable",
|
|
238
|
-
checkedText: "
|
|
239
|
-
uncheckedText: "
|
|
232
|
+
checkedText: t("form.hmr.enable"),
|
|
233
|
+
uncheckedText: t("form.hmr.disable"),
|
|
240
234
|
onChange: hmrChange,
|
|
241
235
|
className: styles.switch
|
|
242
236
|
}
|
|
@@ -249,8 +243,7 @@ const FormComponent = (props) => {
|
|
|
249
243
|
shape: "circle",
|
|
250
244
|
className: styles.add,
|
|
251
245
|
onClick: () => onAdd(add),
|
|
252
|
-
"data-set-e2e": "e2eAdd"
|
|
253
|
-
type: "primary"
|
|
246
|
+
"data-set-e2e": "e2eAdd"
|
|
254
247
|
}
|
|
255
248
|
)
|
|
256
249
|
] })
|
|
@@ -293,7 +286,7 @@ const FormComponent = (props) => {
|
|
|
293
286
|
validateKey(value, () => {
|
|
294
287
|
}, index);
|
|
295
288
|
} else {
|
|
296
|
-
cb("
|
|
289
|
+
cb(t("form.validation.moduleNameRequired"));
|
|
297
290
|
validateKey(value, () => {
|
|
298
291
|
}, index);
|
|
299
292
|
}
|
|
@@ -305,12 +298,12 @@ const FormComponent = (props) => {
|
|
|
305
298
|
Select,
|
|
306
299
|
{
|
|
307
300
|
"data-set-e2e": "e2eProxyKey",
|
|
308
|
-
placeholder: "
|
|
301
|
+
placeholder: t("form.fields.moduleName.placeholder"),
|
|
309
302
|
onChange: (key) => onKeyChange(key, index),
|
|
310
303
|
allowClear: true,
|
|
311
304
|
showSearch: true,
|
|
312
305
|
dropdownMenuClassName: styles.dropdown,
|
|
313
|
-
children: formatProducer.map((
|
|
306
|
+
children: formatProducer.map((option) => /* @__PURE__ */ jsx(Option, { value: option.value, children: option.label }, option.value))
|
|
314
307
|
}
|
|
315
308
|
)
|
|
316
309
|
}
|
|
@@ -328,9 +321,7 @@ const FormComponent = (props) => {
|
|
|
328
321
|
validateValue(value, () => {
|
|
329
322
|
}, index);
|
|
330
323
|
} else {
|
|
331
|
-
cb(
|
|
332
|
-
"The module information format is incorrect, check the format in the upper left corner"
|
|
333
|
-
);
|
|
324
|
+
cb(t("form.validation.moduleInfoInvalid"));
|
|
334
325
|
validateValue(value, () => {
|
|
335
326
|
}, index);
|
|
336
327
|
}
|
|
@@ -342,7 +333,9 @@ const FormComponent = (props) => {
|
|
|
342
333
|
Select,
|
|
343
334
|
{
|
|
344
335
|
"data-set-e2e": "e2eProxyValue",
|
|
345
|
-
placeholder:
|
|
336
|
+
placeholder: t(
|
|
337
|
+
"form.fields.customManifest.placeholder"
|
|
338
|
+
),
|
|
346
339
|
allowClear: true,
|
|
347
340
|
showSearch: true,
|
|
348
341
|
allowCreate: true,
|
|
@@ -357,11 +350,11 @@ const FormComponent = (props) => {
|
|
|
357
350
|
}) }) : /* @__PURE__ */ jsx("div", { className: styles.emptyWrapper, children: /* @__PURE__ */ jsx(
|
|
358
351
|
Empty,
|
|
359
352
|
{
|
|
360
|
-
description: "
|
|
353
|
+
description: t("form.empty.description"),
|
|
361
354
|
className: styles.empty
|
|
362
355
|
}
|
|
363
356
|
) }),
|
|
364
|
-
/* @__PURE__ */ jsx("div", { className: styles.footerHint, children: "
|
|
357
|
+
/* @__PURE__ */ jsx("div", { className: styles.footerHint, children: t("form.footer.hint") })
|
|
365
358
|
] }) });
|
|
366
359
|
};
|
|
367
360
|
var Form_default = FormComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./index_module.css";
|
|
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", "
|
|
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
|
};
|
|
@@ -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,50 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Dropdown, Menu } from "@arco-design/web-react";
|
|
3
|
+
import { IconLanguage } from "@arco-design/web-react/icon";
|
|
4
|
+
import { useTranslation } from "react-i18next";
|
|
5
|
+
import { LANGUAGE_STORAGE_KEY } from "../i18n";
|
|
6
|
+
import styles from "./ThemeToggle.module";
|
|
7
|
+
const LANGUAGE_OPTIONS = [
|
|
8
|
+
{ value: "zh-CN", label: "中文" },
|
|
9
|
+
{ value: "en", label: "English" }
|
|
10
|
+
];
|
|
11
|
+
const persistLanguage = (lang) => {
|
|
12
|
+
var _a;
|
|
13
|
+
if (typeof window !== "undefined") {
|
|
14
|
+
try {
|
|
15
|
+
window.localStorage.setItem(LANGUAGE_STORAGE_KEY, lang);
|
|
16
|
+
} catch (e) {
|
|
17
|
+
}
|
|
18
|
+
const { chrome } = window;
|
|
19
|
+
const storage = (_a = chrome == null ? void 0 : chrome.storage) == null ? void 0 : _a.local;
|
|
20
|
+
if (storage && typeof storage.set === "function") {
|
|
21
|
+
try {
|
|
22
|
+
storage.set({ [LANGUAGE_STORAGE_KEY]: lang });
|
|
23
|
+
} catch (e) {
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const LanguageSwitch = () => {
|
|
29
|
+
var _a;
|
|
30
|
+
const { i18n } = useTranslation();
|
|
31
|
+
const current = ((_a = i18n.language) == null ? void 0 : _a.toLowerCase()) || "zh-cn";
|
|
32
|
+
const value = current.startsWith("en") ? "en" : "zh-CN";
|
|
33
|
+
const handleChange = (next) => {
|
|
34
|
+
i18n.changeLanguage(next);
|
|
35
|
+
persistLanguage(next);
|
|
36
|
+
};
|
|
37
|
+
const droplist = /* @__PURE__ */ jsx(Menu, { onClickMenuItem: handleChange, selectedKeys: [value], children: LANGUAGE_OPTIONS.map((option) => /* @__PURE__ */ jsx(Menu.Item, { children: option.label }, option.value)) });
|
|
38
|
+
return /* @__PURE__ */ jsx(Dropdown, { droplist, trigger: "click", position: "br", children: /* @__PURE__ */ jsx(
|
|
39
|
+
Button,
|
|
40
|
+
{
|
|
41
|
+
icon: /* @__PURE__ */ jsx(IconLanguage, {}),
|
|
42
|
+
size: "default",
|
|
43
|
+
className: styles.themeToggle
|
|
44
|
+
}
|
|
45
|
+
) });
|
|
46
|
+
};
|
|
47
|
+
var LanguageSwitch_default = LanguageSwitch;
|
|
48
|
+
export {
|
|
49
|
+
LanguageSwitch_default as default
|
|
50
|
+
};
|
|
@@ -41,6 +41,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
41
41
|
import { useEffect, useMemo, useState, useRef } from "react";
|
|
42
42
|
import { useDebounceFn, useUpdateEffect } from "ahooks";
|
|
43
43
|
import { Form } from "@arco-design/web-react";
|
|
44
|
+
import { useTranslation } from "react-i18next";
|
|
44
45
|
import {
|
|
45
46
|
MODULE_DEVTOOL_IDENTIFIER
|
|
46
47
|
} from "@module-federation/sdk";
|
|
@@ -98,6 +99,7 @@ const Layout = (props) => {
|
|
|
98
99
|
onModuleInfoReset,
|
|
99
100
|
tabId
|
|
100
101
|
} = props;
|
|
102
|
+
const { t } = useTranslation();
|
|
101
103
|
const { producer } = separateType(moduleInfo);
|
|
102
104
|
const producerKey = useMemo(() => producer.join("|"), [producer]);
|
|
103
105
|
const [condition, setCondition] = useState(statusInfo.processing);
|
|
@@ -422,17 +424,11 @@ const Layout = (props) => {
|
|
|
422
424
|
return /* @__PURE__ */ jsxs("div", { className: styles.wrapper, children: [
|
|
423
425
|
/* @__PURE__ */ jsxs("div", { className: styles.summaryCard, children: [
|
|
424
426
|
/* @__PURE__ */ jsxs("div", { className: styles.summaryHeader, children: [
|
|
425
|
-
/* @__PURE__ */ jsx("span", { className: styles.summaryTitle, children: "
|
|
426
|
-
/* @__PURE__ */ jsx("span", { className: styles.summaryHint, children: "
|
|
427
|
+
/* @__PURE__ */ jsx("span", { className: styles.summaryTitle, children: t("layout.summary.title") }),
|
|
428
|
+
/* @__PURE__ */ jsx("span", { className: styles.summaryHint, children: t("layout.summary.hint") })
|
|
427
429
|
] }),
|
|
428
|
-
/* @__PURE__ */
|
|
429
|
-
|
|
430
|
-
extraCount > 0 && /* @__PURE__ */ jsxs("span", { className: styles.moreChip, children: [
|
|
431
|
-
"+",
|
|
432
|
-
extraCount,
|
|
433
|
-
" more"
|
|
434
|
-
] })
|
|
435
|
-
] })
|
|
430
|
+
previewList.length ? previewList.map((name) => /* @__PURE__ */ jsx("span", { className: styles.chip, children: name }, name)) : /* @__PURE__ */ jsx("span", { className: styles.chipPlaceholder, children: t("layout.summary.placeholder") }),
|
|
431
|
+
extraCount > 0 && /* @__PURE__ */ jsx("span", { className: styles.moreChip, children: t("layout.summary.more", { count: extraCount }) })
|
|
436
432
|
] }),
|
|
437
433
|
/* @__PURE__ */ jsx("section", { className: styles.formSection, children: /* @__PURE__ */ jsx(
|
|
438
434
|
Form,
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
.summaryTitle_084ab {
|
|
24
24
|
font-size: 16px;
|
|
25
25
|
font-weight: 600;
|
|
26
|
-
color: #1f2937;
|
|
26
|
+
color: var(--color-text-1, #1f2937);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.summaryHint_084ab {
|
|
30
30
|
font-size: 12px;
|
|
31
|
-
color: #4b5563;
|
|
31
|
+
color: var(--color-text-2, #4b5563);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.chipGroup_084ab {
|
|
@@ -44,16 +44,16 @@
|
|
|
44
44
|
padding: 6px 10px;
|
|
45
45
|
border-radius: 12px;
|
|
46
46
|
border: 1px solid rgba(228, 228, 231, 0.5);
|
|
47
|
-
background: rgba(255, 255, 255, 0.9);
|
|
47
|
+
background: var(--color-bg-1, rgba(255, 255, 255, 0.9));
|
|
48
48
|
font-size: 12px;
|
|
49
|
-
color: #1f2937;
|
|
49
|
+
color: var(--color-text-1, #1f2937);
|
|
50
50
|
letter-spacing: 0.02em;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.chipPlaceholder_084ab {
|
|
54
54
|
border-style: dashed;
|
|
55
|
-
color: #4b5563;
|
|
56
|
-
background: rgba(255, 255, 255, 0.9);
|
|
55
|
+
color: var(--color-text-2, #4b5563);
|
|
56
|
+
background: var(--color-bg-1, rgba(255, 255, 255, 0.9));
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
.moreChip_084ab {
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
.formSection_084ab {
|
|
65
65
|
padding: 22px 24px;
|
|
66
66
|
border: 1px solid rgba(228, 228, 231, 0.5);
|
|
67
|
-
background: rgba(255, 255, 255, 0.9);
|
|
67
|
+
background: var(--color-bg-1, rgba(255, 255, 255, 0.9));
|
|
68
68
|
}
|