@blocklet/translation-input 2.3.106 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -41,8 +41,10 @@ function TranslationInput({ value, onChange, onCancel, excludes = [], ...rest })
41
41
  size: "small",
42
42
  sx: { width: 1 },
43
43
  onChange: (e) => setInternalValue({ ...internalValue, [code]: e.target.value }),
44
- InputProps: {
45
- startAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "start", sx: { minWidth: 64 }, children: name })
44
+ slotProps: {
45
+ input: {
46
+ startAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "start", sx: { minWidth: 64 }, children: name })
47
+ }
46
48
  }
47
49
  }
48
50
  ) }) }, code);
@@ -69,33 +71,35 @@ function TranslationTextField({ translationInputProps, InputProps, ...rest }) {
69
71
  TextField,
70
72
  {
71
73
  ...rest,
72
- InputProps: {
73
- endAdornment: /* @__PURE__ */ jsxs(InputAdornment, { position: "end", children: [
74
- /* @__PURE__ */ jsx(IconButton, { edge: "end", onClick: handleClick, children: /* @__PURE__ */ jsx(Translate, { sx: { fontSize: 18 } }) }),
75
- /* @__PURE__ */ jsx(
76
- Popover,
77
- {
78
- open: !!anchorEl,
79
- anchorEl,
80
- transformOrigin: {
81
- vertical: "top",
82
- horizontal: "right"
83
- },
84
- anchorOrigin: {
85
- vertical: "bottom",
86
- horizontal: "right"
87
- },
88
- slotProps: {
89
- paper: { sx: { width: anchorEl == null ? void 0 : anchorEl.clientWidth } }
90
- },
91
- elevation: 1,
92
- transitionDuration: 0,
93
- sx: { mt: 0.5 },
94
- children: /* @__PURE__ */ jsx(TranslationInput, { value: translation, onChange: handleChange, onCancel: handleClose })
95
- }
96
- )
97
- ] }),
98
- ...InputProps
74
+ slotProps: {
75
+ input: {
76
+ endAdornment: /* @__PURE__ */ jsxs(InputAdornment, { position: "end", children: [
77
+ /* @__PURE__ */ jsx(IconButton, { edge: "end", onClick: handleClick, children: /* @__PURE__ */ jsx(Translate, { sx: { fontSize: 18 } }) }),
78
+ /* @__PURE__ */ jsx(
79
+ Popover,
80
+ {
81
+ open: !!anchorEl,
82
+ anchorEl,
83
+ transformOrigin: {
84
+ vertical: "top",
85
+ horizontal: "right"
86
+ },
87
+ anchorOrigin: {
88
+ vertical: "bottom",
89
+ horizontal: "right"
90
+ },
91
+ slotProps: {
92
+ paper: { sx: { width: anchorEl?.clientWidth } }
93
+ },
94
+ elevation: 1,
95
+ transitionDuration: 0,
96
+ sx: { mt: 0.5 },
97
+ children: /* @__PURE__ */ jsx(TranslationInput, { value: translation, onChange: handleChange, onCancel: handleClose })
98
+ }
99
+ )
100
+ ] }),
101
+ ...InputProps
102
+ }
99
103
  }
100
104
  }
101
105
  );
@@ -105,7 +109,6 @@ function TranslationTag({
105
109
  value,
106
110
  displayLanguageName
107
111
  }) {
108
- var _a;
109
112
  const { languages } = useLocaleContext();
110
113
  return /* @__PURE__ */ jsxs(
111
114
  Box,
@@ -123,7 +126,7 @@ function TranslationTag({
123
126
  },
124
127
  className: "label-translation-tag",
125
128
  children: [
126
- /* @__PURE__ */ jsx(Box, { sx: { pr: 0.5, borderRight: 1, borderColor: "grey.400" }, children: displayLanguageName ? ((_a = languages.find((x) => x.code === locale)) == null ? void 0 : _a.name) || locale : locale }),
129
+ /* @__PURE__ */ jsx(Box, { sx: { pr: 0.5, borderRight: 1, borderColor: "grey.400" }, children: displayLanguageName ? languages.find((x) => x.code === locale)?.name || locale : locale }),
127
130
  /* @__PURE__ */ jsx(Box, { sx: { pl: 0.5, color: "grey.700", fontWeight: "bold" }, children: value })
128
131
  ]
129
132
  }
package/dist/index.umd.js CHANGED
@@ -39,8 +39,10 @@
39
39
  size: "small",
40
40
  sx: { width: 1 },
41
41
  onChange: (e) => setInternalValue({ ...internalValue, [code]: e.target.value }),
42
- InputProps: {
43
- startAdornment: /* @__PURE__ */ jsxRuntime.jsx(material.InputAdornment, { position: "start", sx: { minWidth: 64 }, children: name })
42
+ slotProps: {
43
+ input: {
44
+ startAdornment: /* @__PURE__ */ jsxRuntime.jsx(material.InputAdornment, { position: "start", sx: { minWidth: 64 }, children: name })
45
+ }
44
46
  }
45
47
  }
46
48
  ) }) }, code);
@@ -67,33 +69,35 @@
67
69
  material.TextField,
68
70
  {
69
71
  ...rest,
70
- InputProps: {
71
- endAdornment: /* @__PURE__ */ jsxRuntime.jsxs(material.InputAdornment, { position: "end", children: [
72
- /* @__PURE__ */ jsxRuntime.jsx(material.IconButton, { edge: "end", onClick: handleClick, children: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.Translate, { sx: { fontSize: 18 } }) }),
73
- /* @__PURE__ */ jsxRuntime.jsx(
74
- Popover,
75
- {
76
- open: !!anchorEl,
77
- anchorEl,
78
- transformOrigin: {
79
- vertical: "top",
80
- horizontal: "right"
81
- },
82
- anchorOrigin: {
83
- vertical: "bottom",
84
- horizontal: "right"
85
- },
86
- slotProps: {
87
- paper: { sx: { width: anchorEl == null ? void 0 : anchorEl.clientWidth } }
88
- },
89
- elevation: 1,
90
- transitionDuration: 0,
91
- sx: { mt: 0.5 },
92
- children: /* @__PURE__ */ jsxRuntime.jsx(TranslationInput, { value: translation, onChange: handleChange, onCancel: handleClose })
93
- }
94
- )
95
- ] }),
96
- ...InputProps
72
+ slotProps: {
73
+ input: {
74
+ endAdornment: /* @__PURE__ */ jsxRuntime.jsxs(material.InputAdornment, { position: "end", children: [
75
+ /* @__PURE__ */ jsxRuntime.jsx(material.IconButton, { edge: "end", onClick: handleClick, children: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.Translate, { sx: { fontSize: 18 } }) }),
76
+ /* @__PURE__ */ jsxRuntime.jsx(
77
+ Popover,
78
+ {
79
+ open: !!anchorEl,
80
+ anchorEl,
81
+ transformOrigin: {
82
+ vertical: "top",
83
+ horizontal: "right"
84
+ },
85
+ anchorOrigin: {
86
+ vertical: "bottom",
87
+ horizontal: "right"
88
+ },
89
+ slotProps: {
90
+ paper: { sx: { width: anchorEl?.clientWidth } }
91
+ },
92
+ elevation: 1,
93
+ transitionDuration: 0,
94
+ sx: { mt: 0.5 },
95
+ children: /* @__PURE__ */ jsxRuntime.jsx(TranslationInput, { value: translation, onChange: handleChange, onCancel: handleClose })
96
+ }
97
+ )
98
+ ] }),
99
+ ...InputProps
100
+ }
97
101
  }
98
102
  }
99
103
  );
@@ -103,7 +107,6 @@
103
107
  value,
104
108
  displayLanguageName
105
109
  }) {
106
- var _a;
107
110
  const { languages } = context.useLocaleContext();
108
111
  return /* @__PURE__ */ jsxRuntime.jsxs(
109
112
  material.Box,
@@ -121,7 +124,7 @@
121
124
  },
122
125
  className: "label-translation-tag",
123
126
  children: [
124
- /* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx: { pr: 0.5, borderRight: 1, borderColor: "grey.400" }, children: displayLanguageName ? ((_a = languages.find((x) => x.code === locale)) == null ? void 0 : _a.name) || locale : locale }),
127
+ /* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx: { pr: 0.5, borderRight: 1, borderColor: "grey.400" }, children: displayLanguageName ? languages.find((x) => x.code === locale)?.name || locale : locale }),
125
128
  /* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx: { pl: 0.5, color: "grey.700", fontWeight: "bold" }, children: value })
126
129
  ]
127
130
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/translation-input",
3
- "version": "2.3.106",
3
+ "version": "2.4.1",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -18,12 +18,12 @@
18
18
  "access": "public"
19
19
  },
20
20
  "peerDependencies": {
21
- "@arcblock/did-connect": "^2.10.36",
22
- "@arcblock/ux": "^2.10.46",
23
- "@mui/icons-material": "^5.10.9",
24
- "@mui/material": "^5.10.13",
25
- "react": ">=18.0.0",
26
- "react-dom": ">=18.0.0"
21
+ "@arcblock/did-connect": "^3.0.1",
22
+ "@arcblock/ux": "^3.0.1",
23
+ "@mui/icons-material": "^7.1.2",
24
+ "@mui/material": "^7.1.2",
25
+ "react": "^19.1.0",
26
+ "react-dom": "^19.1.0"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@arcblock/eslint-config-ts": "^0.3.3",
@@ -35,23 +35,23 @@
35
35
  "@storybook/addon-essentials": "^6.5.16",
36
36
  "@storybook/addon-interactions": "^6.5.16",
37
37
  "@storybook/addon-links": "^6.5.16",
38
- "@storybook/builder-vite": "^8.3.5",
38
+ "@storybook/builder-vite": "^9.0.13",
39
39
  "@storybook/react": "^6.5.16",
40
40
  "@storybook/testing-library": "^0.0.13",
41
41
  "@svgr/core": "^6.5.1",
42
42
  "@types/react": "^18.3.9",
43
43
  "@types/react-color": "^3.0.12",
44
44
  "@types/react-dom": "^18.3.0",
45
- "@vitejs/plugin-react": "^4.3.2",
45
+ "@vitejs/plugin-react": "^4.6.0",
46
46
  "babel-loader": "^8.4.1",
47
- "react": "^18.3.1",
48
- "react-dom": "^18.3.1",
47
+ "react": "^19.1.0",
48
+ "react-dom": "^19.1.0",
49
49
  "rollup-plugin-node-externals": "^7.1.3",
50
50
  "typescript": "^4.9.5",
51
51
  "unplugin-icons": "^0.14.15",
52
- "vite": "^5.4.9",
53
- "vite-plugin-dts": "^4.2.4",
54
- "vite-plugin-libcss": "^1.1.1"
52
+ "vite": "^7.0.0",
53
+ "vite-plugin-dts": "^4.5.4",
54
+ "vite-plugin-libcss": "^1.1.2"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "tsc && vite build",