@arcblock/ux 3.1.40 → 3.1.41

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.
@@ -1,11 +1,19 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { IconButton as n } from "@mui/material";
3
- import { Brightness2Outlined as i, LightModeOutlined as l } from "@mui/icons-material";
4
- import { useColorScheme as s } from "../Theme/theme-provider.js";
5
- function f() {
6
- const { mode: r, toggleMode: o, prefer: t } = s();
7
- return o ? t === "system" || window.blocklet?.theme?.prefer === "system" ? /* @__PURE__ */ e(n, { onClick: o, children: r === "light" ? /* @__PURE__ */ e(i, {}) : /* @__PURE__ */ e(l, {}) }) : null : (process.env.NODE_ENV !== "production" && console.warn("Please ensure the component is wrapped with ConfigProvider context"), null);
2
+ import { IconButton as i } from "@mui/material";
3
+ import { Brightness2Outlined as l, LightModeOutlined as s } from "@mui/icons-material";
4
+ import { useThrottleFn as m } from "ahooks";
5
+ import { useColorScheme as u } from "../Theme/theme-provider.js";
6
+ function g() {
7
+ const { mode: t, toggleMode: o, prefer: r } = u(), { run: n } = m(
8
+ () => {
9
+ o();
10
+ },
11
+ {
12
+ wait: 300
13
+ }
14
+ );
15
+ return o ? r === "system" || window.blocklet?.theme?.prefer === "system" ? /* @__PURE__ */ e(i, { onClick: n, children: t === "light" ? /* @__PURE__ */ e(l, {}) : /* @__PURE__ */ e(s, {}) }) : null : (process.env.NODE_ENV !== "production" && console.warn("Please ensure the component is wrapped with ConfigProvider context"), null);
8
16
  }
9
17
  export {
10
- f as default
18
+ g as default
11
19
  };
@@ -6,8 +6,8 @@ import { Box as w, useTheme as G } from "@mui/material";
6
6
  import B from "./sub-item-group.js";
7
7
  import { Item as K } from "./nav-menu.js";
8
8
  import { styled as C } from "../Theme/index.js";
9
- import { useNavMenuContext as L } from "./nav-menu-context.js";
10
- import { translate as E } from "../Locale/util.js";
9
+ import { useNavMenuContext as E } from "./nav-menu-context.js";
10
+ import { translate as L } from "../Locale/util.js";
11
11
  import { useLocaleContext as _ } from "../Locale/context.js";
12
12
  import M from "./images/nft-studio.svg.js";
13
13
  import O from "./images/creator-studio.svg.js";
@@ -479,7 +479,7 @@ function o({ to: t, children: c, className: a = "", ...u }) {
479
479
  return W(t) ? /* @__PURE__ */ e(p, { to: ee(t, "header"), target: "_blank", rel: "noreferrer noopener", className: a, ...u, children: c }) : /* @__PURE__ */ e(p, { to: t, className: a, ...u, children: c });
480
480
  }
481
481
  function Fe({ className: t = "", type: c, ...a }) {
482
- const { mode: u } = L(), k = G(), { locale: r = "en" } = _() || {}, l = T(null), { palette: f } = k, i = A((n, d = {}) => E(ie, n, r, "en", d)), [N, D] = $(v), m = A(() => {
482
+ const { mode: u } = E(), k = G(), { locale: r = "en" } = _() || {}, l = T(null), { palette: f } = k, i = A((n, d = {}) => L(ie, n, r, "en", d)), [N, D] = $(v), m = A(() => {
483
483
  if (!l.current) return;
484
484
  const n = l.current.querySelectorAll(".navmenu-item__content");
485
485
  let d = v;
@@ -661,12 +661,12 @@ function Fe({ className: t = "", type: c, ...a }) {
661
661
  {
662
662
  label: /* @__PURE__ */ e(o, { to: "https://www.aigne.io/code-smith", ...n, children: "AIGNE CodeSmith" }),
663
663
  description: i("products.aigneCodeSmith.description"),
664
- icon: /* @__PURE__ */ e(s, { color: "#56a596", backgroundColor: "#e9fcf6" })
664
+ icon: /* @__PURE__ */ e(s, { color: "#3E5DF7", backgroundColor: "#e9f0ff" })
665
665
  },
666
666
  {
667
667
  label: /* @__PURE__ */ e(o, { to: "https://www.aigne.io/doc-smith", ...n, children: "AIGNE DocSmith" }),
668
668
  description: i("products.aigneDocSmith.description"),
669
- icon: /* @__PURE__ */ e(s, { color: "#e46f38", backgroundColor: "#f7e0d7" })
669
+ icon: /* @__PURE__ */ e(s, { color: "#02A996", backgroundColor: "#e6f7f5" })
670
670
  },
671
671
  {
672
672
  label: /* @__PURE__ */ e(o, { to: "https://www.aigne.io/web-smith", ...n, children: "AIGNE WebSmith" }),
@@ -1,4 +1,4 @@
1
- const e = "3.1.40", s = { "@blocklet/js-sdk": "^1.16.49-beta-20250823-082650-626c1473" }, t = {
1
+ const e = "3.1.41", s = { "@blocklet/js-sdk": "^1.16.49-beta-20250823-082650-626c1473" }, t = {
2
2
  version: e,
3
3
  dependencies: s
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "3.1.40",
3
+ "version": "3.1.41",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -68,16 +68,16 @@
68
68
  "react": "^19.0.0",
69
69
  "react-router-dom": "^6.22.3"
70
70
  },
71
- "gitHead": "5e3ea739c926b972f08cf72e113964ef5a82ddf3",
71
+ "gitHead": "21979ee3abb716f0201960abe9c85d8f0a8f291c",
72
72
  "dependencies": {
73
- "@arcblock/bridge": "3.1.40",
73
+ "@arcblock/bridge": "3.1.41",
74
74
  "@arcblock/did": "^1.21.3",
75
75
  "@arcblock/did-motif": "^1.1.14",
76
- "@arcblock/icons": "3.1.40",
77
- "@arcblock/nft-display": "3.1.40",
78
- "@arcblock/react-hooks": "3.1.40",
76
+ "@arcblock/icons": "3.1.41",
77
+ "@arcblock/nft-display": "3.1.41",
78
+ "@arcblock/react-hooks": "3.1.41",
79
79
  "@blocklet/js-sdk": "^1.16.49-beta-20250823-082650-626c1473",
80
- "@blocklet/theme": "3.1.40",
80
+ "@blocklet/theme": "3.1.41",
81
81
  "@fontsource/roboto": "~5.1.1",
82
82
  "@fontsource/ubuntu-mono": "^5.2.6",
83
83
  "@iconify-icons/logos": "^1.2.36",
@@ -3,10 +3,19 @@ import {
3
3
  LightModeOutlined as LightModeOutlinedIcon,
4
4
  Brightness2Outlined as Brightness2OutlinedIcon,
5
5
  } from '@mui/icons-material';
6
+ import { useThrottleFn } from 'ahooks';
6
7
  import { useColorScheme } from '../Theme/theme-provider';
7
8
 
8
9
  export default function ThemeModeToggle() {
9
10
  const { mode, toggleMode, prefer } = useColorScheme();
11
+ const { run: toggleModeThrottled } = useThrottleFn(
12
+ () => {
13
+ toggleMode();
14
+ },
15
+ {
16
+ wait: 300,
17
+ }
18
+ );
10
19
 
11
20
  if (!toggleMode) {
12
21
  if (process.env.NODE_ENV !== 'production') {
@@ -19,7 +28,7 @@ export default function ThemeModeToggle() {
19
28
  // 跟随系统才显示切换
20
29
  if (prefer === 'system' || window.blocklet?.theme?.prefer === 'system') {
21
30
  return (
22
- <IconButton onClick={toggleMode}>
31
+ <IconButton onClick={toggleModeThrottled}>
23
32
  {mode === 'light' ? <Brightness2OutlinedIcon /> : <LightModeOutlinedIcon />}
24
33
  </IconButton>
25
34
  );
@@ -768,7 +768,7 @@ export default function Products({ className = '', type, ...rest }: ProductsProp
768
768
  </SmartLink>
769
769
  ),
770
770
  description: t('products.aigneCodeSmith.description'),
771
- icon: <AigneIcon color="#56a596" backgroundColor="#e9fcf6" />,
771
+ icon: <AigneIcon color="#3E5DF7" backgroundColor="#e9f0ff" />,
772
772
  },
773
773
  {
774
774
  label: (
@@ -777,7 +777,7 @@ export default function Products({ className = '', type, ...rest }: ProductsProp
777
777
  </SmartLink>
778
778
  ),
779
779
  description: t('products.aigneDocSmith.description'),
780
- icon: <AigneIcon color="#e46f38" backgroundColor="#f7e0d7" />,
780
+ icon: <AigneIcon color="#02A996" backgroundColor="#e6f7f5" />,
781
781
  },
782
782
  {
783
783
  label: (