@arcblock/ux 3.1.48 → 3.1.50

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.
@@ -15,6 +15,7 @@ export declare function useConfig(): {
15
15
  changeMode: (mode: import('@mui/material').PaletteMode) => void;
16
16
  prefer?: import('../Theme').Prefer;
17
17
  locale: import('../type').Locale;
18
+ defaultLocale: import('../type').Locale;
18
19
  changeLocale: (locale: import('../type').Locale) => void;
19
20
  t: (key: string, data?: Record<string, any>) => string;
20
21
  languages: {
@@ -1,6 +1,7 @@
1
1
  import { UserPublicInfo } from '@blocklet/js-sdk';
2
2
  declare function SwitchRole({ user, switchPassport, }: {
3
3
  user: UserPublicInfo & {
4
+ role: string;
4
5
  passports: {
5
6
  name: string;
6
7
  title: string;
@@ -19,6 +19,7 @@ export interface LocaleProviderProps {
19
19
  }
20
20
  export interface LocaleContextType {
21
21
  locale: Locale;
22
+ defaultLocale: Locale;
22
23
  changeLocale: (locale: Locale) => void;
23
24
  t: (key: string, data?: Record<string, any>) => string;
24
25
  languages: {
@@ -1,80 +1,80 @@
1
- import { jsx as y } from "react/jsx-runtime";
2
- import { createContext as x, use as k, useState as h, useRef as A, useEffect as R, useCallback as b } from "react";
3
- import j from "lodash/get";
4
- import i from "js-cookie";
5
- import S from "./browser-lang.js";
6
- import { translate as U } from "./util.js";
7
- import { getCookieOptions as D, resolveRootDomain as E } from "../Util/index.js";
8
- const l = "nf_lang", F = (e, o = window.location.href) => {
1
+ import { jsx as x } from "react/jsx-runtime";
2
+ import { createContext as k, use as A, useState as h, useRef as R, useEffect as b, useCallback as j } from "react";
3
+ import S from "lodash/get";
4
+ import l from "js-cookie";
5
+ import U from "./browser-lang.js";
6
+ import { translate as D } from "./util.js";
7
+ import { getCookieOptions as E, resolveRootDomain as F } from "../Util/index.js";
8
+ const i = "nf_lang", O = (e, o = window.location.href) => {
9
9
  const t = new URL(o).searchParams.get("locale");
10
10
  return e.find((c) => c.code === t) ? t : null;
11
- }, O = (e, o = window.location.href) => {
11
+ }, z = (e, o = window.location.href) => {
12
12
  const t = new URL(o);
13
13
  t.searchParams.has("locale") && (t.searchParams.set("locale", e), window.history.replaceState({}, "", t.href));
14
- }, d = (e = []) => {
14
+ }, g = (e = []) => {
15
15
  const o = {
16
16
  languages: e.map((t) => t.code),
17
17
  // 取 languages 首个元素的 code 值, 如果不存在则取 'en'
18
18
  fallback: e?.[0]?.code || "en"
19
19
  };
20
- return F(e) || i.get(l) || S(o);
21
- }, z = (e) => {
22
- const o = D();
20
+ return O(e) || l.get(i) || U(o);
21
+ }, N = (e) => {
22
+ const o = E();
23
23
  if (!o.domain) {
24
- const t = E();
25
- t && i.remove(l, { path: o.path || "/", domain: t });
24
+ const t = F();
25
+ t && l.remove(i, { path: o.path || "/", domain: t });
26
26
  }
27
- i.set(l, e, o), O(e);
28
- }, N = (e) => {
29
- const o = j(window, "blocklet.languages");
27
+ l.set(i, e, o), z(e);
28
+ }, _ = (e) => {
29
+ const o = S(window, "blocklet.languages");
30
30
  return Array.isArray(o) && o.length ? o : Array.isArray(e) && e.length ? e : [
31
31
  { code: "en", name: "English" },
32
32
  { code: "zh", name: "简体中文" }
33
33
  ];
34
- }, g = x(null), { Provider: _, Consumer: M } = g;
35
- function Q({
34
+ }, p = k(null), { Provider: q, Consumer: Q } = p;
35
+ function T({
36
36
  children: e,
37
37
  locale: o = void 0,
38
- fallbackLocale: t = void 0,
38
+ fallbackLocale: t = "en",
39
39
  translations: c,
40
- onLoadingTranslation: p = void 0,
41
- languages: L = [],
42
- ...P
40
+ onLoadingTranslation: L = void 0,
41
+ languages: P = [],
42
+ ...C
43
43
  }) {
44
- const s = N(L);
45
- let [n, v] = h(o || d(s));
46
- const m = A(t || ""), [, C] = h(0), u = (r) => {
47
- v(r), z(r);
44
+ const s = _(P);
45
+ let [n, v] = h(o || g(s));
46
+ const m = s?.[0]?.code ?? t, u = R(m), [, w] = h(0), f = (r) => {
47
+ v(r), N(r);
48
48
  };
49
- if (R(() => {
50
- const r = o || d(s);
51
- r !== n && u(r);
49
+ if (b(() => {
50
+ const r = o || g(s);
51
+ r !== n && f(r);
52
52
  }, [o]), n && c[n] && typeof c[n] == "function") {
53
53
  const r = n;
54
54
  try {
55
55
  Promise.resolve(c[r]()).then((a) => {
56
- a && typeof a == "object" && (c[r] = a, C((f) => f > 999 ? 0 : f + 1));
56
+ a && typeof a == "object" && (c[r] = a, w((d) => d > 999 ? 0 : d + 1));
57
57
  });
58
58
  } catch (a) {
59
59
  console.error(a);
60
60
  }
61
- p?.(r, s), n = m.current;
61
+ L?.(r, s), n = u.current;
62
62
  } else
63
- m.current = n;
64
- const w = b(
65
- (r, a) => U(c, r, n, t, a),
63
+ u.current = n;
64
+ const y = j(
65
+ (r, a) => D(c, r, n, t, a),
66
66
  [c, n, t]
67
67
  );
68
- return /* @__PURE__ */ y(_, { value: { locale: n, changeLocale: u, t: w, languages: s, ...P }, children: e });
68
+ return /* @__PURE__ */ x(q, { value: { locale: n, changeLocale: f, t: y, languages: s, defaultLocale: m, ...C }, children: e });
69
69
  }
70
- function T() {
71
- return k(g);
70
+ function V() {
71
+ return A(p);
72
72
  }
73
73
  export {
74
- M as LocaleConsumer,
75
- g as LocaleContext,
76
- Q as LocaleProvider,
77
- d as getLocale,
78
- z as setLocale,
79
- T as useLocaleContext
74
+ Q as LocaleConsumer,
75
+ p as LocaleContext,
76
+ T as LocaleProvider,
77
+ g as getLocale,
78
+ N as setLocale,
79
+ V as useLocaleContext
80
80
  };
@@ -0,0 +1,42 @@
1
+ import * as t from "react";
2
+ const e = (o) => /* @__PURE__ */ t.createElement("svg", { viewBox: "0 0 902 902", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...o }, /* @__PURE__ */ t.createElement("rect", { width: 902, height: 902, rx: 212, fill: "url(#paint0_linear_3783_1258)", style: {} }), /* @__PURE__ */ t.createElement("rect", { x: 166, y: 247, width: 569, height: 409, rx: 80, stroke: "white", style: {
3
+ stroke: "white",
4
+ strokeOpacity: 1
5
+ }, strokeWidth: 40 }), /* @__PURE__ */ t.createElement("ellipse", { cx: 371, cy: 452, rx: 37, ry: 65, fill: "white", style: {
6
+ fill: "white",
7
+ fillOpacity: 1
8
+ } }), /* @__PURE__ */ t.createElement("ellipse", { cx: 531, cy: 452, rx: 37, ry: 65, fill: "white", style: {
9
+ fill: "white",
10
+ fillOpacity: 1
11
+ } }), /* @__PURE__ */ t.createElement("defs", null, /* @__PURE__ */ t.createElement("linearGradient", { id: "paint0_linear_3783_1258", x1: 84, y1: 78.5, x2: 811.5, y2: 850.5, gradientUnits: "userSpaceOnUse" }, /* @__PURE__ */ t.createElement("stop", { stopColor: "#AAF4EF", style: {
12
+ stopColor: "#AAF4EF",
13
+ stopColor: "color(display-p3 0.6667 0.9569 0.9373)",
14
+ stopOpacity: 1
15
+ } }), /* @__PURE__ */ t.createElement("stop", { offset: 0.180804, stopColor: "#C7F37F", style: {
16
+ stopColor: "#C7F37F",
17
+ stopColor: "color(display-p3 0.7798 0.9512 0.4996)",
18
+ stopOpacity: 1
19
+ } }), /* @__PURE__ */ t.createElement("stop", { offset: 0.361299, stopColor: "#FFD071", style: {
20
+ stopColor: "#FFD071",
21
+ stopColor: "color(display-p3 1.0000 0.8141 0.4422)",
22
+ stopOpacity: 1
23
+ } }), /* @__PURE__ */ t.createElement("stop", { offset: 0.546216, stopColor: "#FF9898", style: {
24
+ stopColor: "#FF9898",
25
+ stopColor: "color(display-p3 1.0000 0.5960 0.5960)",
26
+ stopOpacity: 1
27
+ } }), /* @__PURE__ */ t.createElement("stop", { offset: 0.72214, stopColor: "#FF89E0", style: {
28
+ stopColor: "#FF89E0",
29
+ stopColor: "color(display-p3 1.0000 0.5360 0.8769)",
30
+ stopOpacity: 1
31
+ } }), /* @__PURE__ */ t.createElement("stop", { offset: 0.898804, stopColor: "#B695FE", style: {
32
+ stopColor: "#B695FE",
33
+ stopColor: "color(display-p3 0.7137 0.5843 0.9961)",
34
+ stopOpacity: 1
35
+ } }), /* @__PURE__ */ t.createElement("stop", { offset: 1, stopColor: "#7C8EED", style: {
36
+ stopColor: "#7C8EED",
37
+ stopColor: "color(display-p3 0.4863 0.5569 0.9294)",
38
+ stopOpacity: 1
39
+ } }))));
40
+ export {
41
+ e as default
42
+ };
@@ -1,19 +1,19 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { useRef as T, useState as $, useEffect as S } from "react";
2
+ import { useRef as G, useState as T, useEffect as S } from "react";
3
3
  import { Link as p } from "react-router-dom";
4
- import { useMemoizedFn as A, useCreation as F } from "ahooks";
5
- import { Box as w, useTheme as G } from "@mui/material";
4
+ import { useMemoizedFn as A, useCreation as $ } from "ahooks";
5
+ import { Box as w, useTheme as F } from "@mui/material";
6
6
  import B from "./sub-item-group.js";
7
- import { Item as K } from "./nav-menu.js";
7
+ import { Item as E } from "./nav-menu.js";
8
8
  import { styled as C } from "../Theme/index.js";
9
- import { useNavMenuContext as E } from "./nav-menu-context.js";
9
+ import { useNavMenuContext as K } from "./nav-menu-context.js";
10
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";
14
14
  import P from "./images/blocklet-launcher.svg.js";
15
- import H from "./images/blocklet-store.svg.js";
16
- import R from "./images/web3-kit.svg.js";
15
+ import R from "./images/blocklet-store.svg.js";
16
+ import H from "./images/web3-kit.svg.js";
17
17
  import z from "./images/blocklet-framework.svg.js";
18
18
  import U from "./images/abt-network.svg.js";
19
19
  import j from "./images/blocklet-server.svg.js";
@@ -23,10 +23,11 @@ import J from "./images/did-wallet.svg.js";
23
23
  import Q from "./images/vc.svg.js";
24
24
  import X from "./images/payment-kit.png";
25
25
  import Y from "./images/aigne.svg.js";
26
+ import Z from "./images/aigne-image-smith.svg.js";
26
27
  import I from "./images/arcsphere.svg.js";
27
- import Z from "./images/aistro.png";
28
- import { getUTMUrl as ee } from "../withTracker/libs/utm.js";
29
- const v = 260, ie = {
28
+ import ee from "./images/aistro.png";
29
+ import { getUTMUrl as ie } from "../withTracker/libs/utm.js";
30
+ const v = 260, te = {
30
31
  en: {
31
32
  groups: {
32
33
  applications: "Applications",
@@ -106,6 +107,9 @@ const v = 260, ie = {
106
107
  aigneWebSmith: {
107
108
  description: "Build and deploy AI-powered web apps"
108
109
  },
110
+ aigneImageSmith: {
111
+ description: "Generate and Refine Images with AI"
112
+ },
109
113
  aigneCLI: {
110
114
  description: "Develop agents from the command line"
111
115
  },
@@ -202,6 +206,9 @@ const v = 260, ie = {
202
206
  aigneWebSmith: {
203
207
  description: "构建并部署 AI 驱动的 Web 应用"
204
208
  },
209
+ aigneImageSmith: {
210
+ description: "使用 AI 生成和优化图像"
211
+ },
205
212
  aigneCLI: {
206
213
  description: "通过命令行开发 Agent"
207
214
  },
@@ -298,6 +305,9 @@ const v = 260, ie = {
298
305
  aigneWebSmith: {
299
306
  description: "構建並部署 AI 驅動的 Web 應用"
300
307
  },
308
+ aigneImageSmith: {
309
+ description: "使用 AI 生成和優化圖像"
310
+ },
301
311
  aigneCLI: {
302
312
  description: "透過命令列開發 Agent"
303
313
  },
@@ -394,6 +404,9 @@ const v = 260, ie = {
394
404
  aigneWebSmith: {
395
405
  description: "AI駆動Webアプリの構築とデプロイ"
396
406
  },
407
+ aigneImageSmith: {
408
+ description: "AIで画像を生成・最適化"
409
+ },
397
410
  aigneCLI: {
398
411
  description: "コマンドラインからエージェントを開発"
399
412
  },
@@ -413,7 +426,7 @@ const v = 260, ie = {
413
426
  }
414
427
  }, oe = C(w)`
415
428
  padding: 8px;
416
- background: ${({ theme: t }) => t.palette.grey[100]};
429
+ background: ${({ theme: o }) => o.palette.grey[100]};
417
430
  border-radius: 8px;
418
431
 
419
432
  &.is-inline {
@@ -432,20 +445,20 @@ const v = 260, ie = {
432
445
  .MuiGrid-container + .MuiGrid-container {
433
446
  margin-top: 0px;
434
447
  }
435
- `, te = C(w, { shouldForwardProp: (t) => t !== "maxContent" })(
436
- ({ theme: t, maxContent: c }) => ({
448
+ `, re = C(w, { shouldForwardProp: (o) => o !== "maxContent" })(
449
+ ({ theme: o, maxContent: c }) => ({
437
450
  display: "grid",
438
- gap: t.spacing(1),
451
+ gap: o.spacing(1),
439
452
  gridTemplateColumns: `repeat(1, ${c}px)`,
440
- [t.breakpoints.up("md")]: {
453
+ [o.breakpoints.up("md")]: {
441
454
  gridTemplateColumns: `repeat(2, ${c}px)`
442
455
  },
443
- [t.breakpoints.up("lg")]: {
456
+ [o.breakpoints.up("lg")]: {
444
457
  gridTemplateColumns: `repeat(3, ${c}px)`
445
458
  }
446
459
  })
447
460
  );
448
- function y({ color: t = "black", backgroundColor: c = "transparent", children: a }) {
461
+ function y({ color: o = "black", backgroundColor: c = "transparent", children: a }) {
449
462
  return /* @__PURE__ */ e(
450
463
  w,
451
464
  {
@@ -454,7 +467,7 @@ function y({ color: t = "black", backgroundColor: c = "transparent", children: a
454
467
  display: "inline-flex",
455
468
  alignItems: "center",
456
469
  justifyContent: "center",
457
- color: t,
470
+ color: o,
458
471
  backgroundColor: c,
459
472
  borderRadius: "4px"
460
473
  },
@@ -462,24 +475,24 @@ function y({ color: t = "black", backgroundColor: c = "transparent", children: a
462
475
  }
463
476
  );
464
477
  }
465
- function h({ color: t = "black", backgroundColor: c = "transparent" }) {
466
- return /* @__PURE__ */ e(y, { color: t, backgroundColor: c, children: /* @__PURE__ */ e(q, { style: { width: "100%" } }) });
478
+ function h({ color: o = "black", backgroundColor: c = "transparent" }) {
479
+ return /* @__PURE__ */ e(y, { color: o, backgroundColor: c, children: /* @__PURE__ */ e(q, { style: { width: "100%" } }) });
467
480
  }
468
- function s({ color: t = "black", backgroundColor: c = "transparent" }) {
469
- return /* @__PURE__ */ e(y, { color: t, backgroundColor: c, children: /* @__PURE__ */ e(Y, { style: { width: "100%", height: "100%" } }) });
481
+ function s({ color: o = "black", backgroundColor: c = "transparent" }) {
482
+ return /* @__PURE__ */ e(y, { color: o, backgroundColor: c, children: /* @__PURE__ */ e(Y, { style: { width: "100%", height: "100%" } }) });
470
483
  }
471
- const W = (t) => {
484
+ const N = (o) => {
472
485
  try {
473
- return new URL(t).origin !== window.location.origin;
486
+ return new URL(o).origin !== window.location.origin;
474
487
  } catch {
475
488
  return !1;
476
489
  }
477
490
  };
478
- function o({ to: t, children: c, className: a = "", ...u }) {
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 });
491
+ function t({ to: o, children: c, className: a = "", ...m }) {
492
+ return N(o) ? /* @__PURE__ */ e(p, { to: ie(o, "header"), target: "_blank", rel: "noreferrer noopener", className: a, ...m, children: c }) : /* @__PURE__ */ e(p, { to: o, className: a, ...m, children: c });
480
493
  }
481
- function Fe({ className: t = "", type: c, ...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(() => {
494
+ function Be({ className: o = "", type: c, ...a }) {
495
+ const { mode: m } = K(), k = F(), { locale: r = "en" } = _() || {}, l = G(null), { palette: f } = k, i = A((n, d = {}) => L(te, n, r, "en", d)), [W, D] = T(v), u = A(() => {
483
496
  if (!l.current) return;
484
497
  const n = l.current.querySelectorAll(".navmenu-item__content");
485
498
  let d = v;
@@ -489,19 +502,19 @@ function Fe({ className: t = "", type: c, ...a }) {
489
502
  }), D(d);
490
503
  });
491
504
  S(() => {
492
- m();
493
- }, [k, r, c, m]), S(() => {
505
+ u();
506
+ }, [k, r, c, u]), S(() => {
494
507
  if (!l.current) return;
495
508
  const n = l.current.querySelector(".navmenu-item__content");
496
509
  if (!n) return;
497
510
  const d = new ResizeObserver(() => {
498
- m();
511
+ u();
499
512
  });
500
513
  return d.observe(n), () => {
501
514
  d.disconnect();
502
515
  };
503
- }, [m]);
504
- const x = F(() => {
516
+ }, [u]);
517
+ const x = $(() => {
505
518
  if (c === "ARCBLOCK")
506
519
  return [
507
520
  {
@@ -509,7 +522,7 @@ function Fe({ className: t = "", type: c, ...a }) {
509
522
  label: i("groups.applications"),
510
523
  children: [
511
524
  {
512
- label: /* @__PURE__ */ e(o, { to: `https://www.nftstudio.rocks/${r}`, children: "NFT Studio" }),
525
+ label: /* @__PURE__ */ e(t, { to: `https://www.nftstudio.rocks/${r}`, children: "NFT Studio" }),
513
526
  description: i("products.nftStudio.description"),
514
527
  icon: /* @__PURE__ */ e(M, {})
515
528
  },
@@ -527,12 +540,12 @@ function Fe({ className: t = "", type: c, ...a }) {
527
540
  icon: /* @__PURE__ */ e(O, {})
528
541
  },
529
542
  {
530
- label: /* @__PURE__ */ e(o, { to: "https://www.aigne.io/", children: "AIGNE" }),
543
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/", children: "AIGNE" }),
531
544
  description: i("products.aigne.description"),
532
545
  icon: /* @__PURE__ */ e(s, { color: f.mode === "dark" ? "white" : "black" })
533
546
  },
534
547
  {
535
- label: /* @__PURE__ */ e(o, { to: `https://www.arcsphere.io/${r}`, children: "ArcSphere" }),
548
+ label: /* @__PURE__ */ e(t, { to: `https://www.arcsphere.io/${r}`, children: "ArcSphere" }),
536
549
  description: i("products.arcsphere.description"),
537
550
  icon: /* @__PURE__ */ e(I, {})
538
551
  }
@@ -543,24 +556,24 @@ function Fe({ className: t = "", type: c, ...a }) {
543
556
  label: i("groups.components"),
544
557
  children: [
545
558
  {
546
- label: /* @__PURE__ */ e(o, { to: `https://launcher.arcblock.io/${r}`, children: "Blocklet Launcher" }),
559
+ label: /* @__PURE__ */ e(t, { to: `https://launcher.arcblock.io/${r}`, children: "Blocklet Launcher" }),
547
560
  description: i("products.blockletLauncher.description"),
548
561
  icon: /* @__PURE__ */ e(P, {})
549
562
  },
550
563
  {
551
- label: /* @__PURE__ */ e(o, { to: `https://www.blocklet.io/${r}/payment-kit`, children: "Payment Kit" }),
564
+ label: /* @__PURE__ */ e(t, { to: `https://www.blocklet.io/${r}/payment-kit`, children: "Payment Kit" }),
552
565
  description: i("products.paymentKit.description"),
553
566
  icon: /* @__PURE__ */ e("img", { src: X, alt: "Payment Kit" })
554
567
  },
555
568
  {
556
- label: /* @__PURE__ */ e(o, { to: `https://store.blocklet.dev/?locale=${r}`, children: "Blocklet Store" }),
569
+ label: /* @__PURE__ */ e(t, { to: `https://store.blocklet.dev/?locale=${r}`, children: "Blocklet Store" }),
557
570
  description: i("products.blockletStore.description"),
558
- icon: /* @__PURE__ */ e(H, {})
571
+ icon: /* @__PURE__ */ e(R, {})
559
572
  },
560
573
  {
561
- label: /* @__PURE__ */ e(o, { to: `https://www.web3kit.rocks/${r}`, children: "Web3 Kit" }),
574
+ label: /* @__PURE__ */ e(t, { to: `https://www.web3kit.rocks/${r}`, children: "Web3 Kit" }),
562
575
  description: i("products.web3Kit.description"),
563
- icon: /* @__PURE__ */ e(R, {})
576
+ icon: /* @__PURE__ */ e(H, {})
564
577
  }
565
578
  ]
566
579
  },
@@ -592,12 +605,12 @@ function Fe({ className: t = "", type: c, ...a }) {
592
605
  icon: /* @__PURE__ */ e(U, {})
593
606
  },
594
607
  {
595
- label: /* @__PURE__ */ e(o, { to: `https://www.blocklet.io/${r}/blocklet-server`, children: "Blocklet Server" }),
608
+ label: /* @__PURE__ */ e(t, { to: `https://www.blocklet.io/${r}/blocklet-server`, children: "Blocklet Server" }),
596
609
  description: i("products.blockletServer.description"),
597
610
  icon: /* @__PURE__ */ e(j, {})
598
611
  },
599
612
  {
600
- label: /* @__PURE__ */ e(o, { to: `https://www.arcblock.io/content/collections/${r}/ocap`, children: "ОСАР" }),
613
+ label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${r}/ocap`, children: "ОСАР" }),
601
614
  description: i("products.ocap.description"),
602
615
  icon: /* @__PURE__ */ e(V, {})
603
616
  }
@@ -608,12 +621,12 @@ function Fe({ className: t = "", type: c, ...a }) {
608
621
  label: i("groups.identity"),
609
622
  children: [
610
623
  {
611
- label: /* @__PURE__ */ e(o, { to: `https://www.arcblock.io/content/collections/${r}/did`, children: "DID" }),
624
+ label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${r}/did`, children: "DID" }),
612
625
  description: i("products.did.description"),
613
626
  icon: /* @__PURE__ */ e(h, { color: "#5b96f3" })
614
627
  },
615
628
  {
616
- label: /* @__PURE__ */ e(o, { to: `https://www.didwallet.io/${r}`, children: "DID Wallet" }),
629
+ label: /* @__PURE__ */ e(t, { to: `https://www.didwallet.io/${r}`, children: "DID Wallet" }),
617
630
  description: i("products.didWallet.description"),
618
631
  icon: /* @__PURE__ */ e(J, {})
619
632
  },
@@ -623,12 +636,12 @@ function Fe({ className: t = "", type: c, ...a }) {
623
636
  icon: /* @__PURE__ */ e(h, { color: "#678ab0" })
624
637
  },
625
638
  {
626
- label: /* @__PURE__ */ e(o, { to: `https://www.arcblock.io/content/collections/${r}/verifiable-credential`, children: "VC" }),
639
+ label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${r}/verifiable-credential`, children: "VC" }),
627
640
  description: i("products.vc.description"),
628
641
  icon: /* @__PURE__ */ e(Q, {})
629
642
  },
630
643
  {
631
- label: /* @__PURE__ */ e(o, { to: `https://www.didconnect.io/${r}`, children: "DID Connect" }),
644
+ label: /* @__PURE__ */ e(t, { to: `https://www.didconnect.io/${r}`, children: "DID Connect" }),
632
645
  description: i("products.didConnect.description"),
633
646
  icon: /* @__PURE__ */ e(h, { color: "#5bbec5" })
634
647
  }
@@ -639,7 +652,7 @@ function Fe({ className: t = "", type: c, ...a }) {
639
652
  const n = {
640
653
  onClick: (d) => {
641
654
  d.preventDefault();
642
- const b = d.currentTarget.href, g = W(b) ? "_blank" : "_self";
655
+ const b = d.currentTarget.href, g = N(b) ? "_blank" : "_self";
643
656
  window.open(b, g);
644
657
  }
645
658
  };
@@ -649,29 +662,34 @@ function Fe({ className: t = "", type: c, ...a }) {
649
662
  label: i("groups.applications"),
650
663
  children: [
651
664
  {
652
- label: /* @__PURE__ */ e(o, { to: `https://www.arcsphere.io/${r}`, children: "ArcSphere" }),
665
+ label: /* @__PURE__ */ e(t, { to: `https://www.arcsphere.io/${r}`, children: "ArcSphere" }),
653
666
  description: i("products.arcsphere.description"),
654
667
  icon: /* @__PURE__ */ e(I, {})
655
668
  },
656
669
  {
657
- label: /* @__PURE__ */ e(o, { to: `https://www.aistro.io/${r}`, children: "Aistro" }),
670
+ label: /* @__PURE__ */ e(t, { to: `https://www.aistro.io/${r}`, children: "Aistro" }),
658
671
  description: i("products.aistro.description"),
659
- icon: /* @__PURE__ */ e("img", { src: Z, alt: "Aistro" })
672
+ icon: /* @__PURE__ */ e("img", { src: ee, alt: "Aistro" })
660
673
  },
661
674
  {
662
- label: /* @__PURE__ */ e(o, { to: "https://www.aigne.io/code-smith", ...n, children: "AIGNE CodeSmith" }),
675
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/code-smith", ...n, children: "AIGNE CodeSmith" }),
663
676
  description: i("products.aigneCodeSmith.description"),
664
677
  icon: /* @__PURE__ */ e(s, { color: "#3E5DF7", backgroundColor: "#e9f0ff" })
665
678
  },
666
679
  {
667
- label: /* @__PURE__ */ e(o, { to: "https://www.aigne.io/doc-smith", ...n, children: "AIGNE DocSmith" }),
680
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/doc-smith", ...n, children: "AIGNE DocSmith" }),
668
681
  description: i("products.aigneDocSmith.description"),
669
682
  icon: /* @__PURE__ */ e(s, { color: "#02A996", backgroundColor: "#e6f7f5" })
670
683
  },
671
684
  {
672
- label: /* @__PURE__ */ e(o, { to: "https://www.aigne.io/web-smith", ...n, children: "AIGNE WebSmith" }),
685
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/web-smith", ...n, children: "AIGNE WebSmith" }),
673
686
  description: i("products.aigneWebSmith.description"),
674
687
  icon: /* @__PURE__ */ e(s, { color: "#7c45eb", backgroundColor: "#f0e9ff" })
688
+ },
689
+ {
690
+ label: /* @__PURE__ */ e(t, { to: "https://imagesmith.aigne.io/", children: "AIGNE ImageSmith" }),
691
+ description: i("products.aigneImageSmith.description"),
692
+ icon: /* @__PURE__ */ e(Z, {})
675
693
  }
676
694
  ]
677
695
  },
@@ -680,22 +698,22 @@ function Fe({ className: t = "", type: c, ...a }) {
680
698
  label: i("groups.frameworkTools"),
681
699
  children: [
682
700
  {
683
- label: /* @__PURE__ */ e(o, { to: "https://www.aigne.io/cli", ...n, children: "AIGNE CLI" }),
701
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/cli", ...n, children: "AIGNE CLI" }),
684
702
  description: i("products.aigneCLI.description"),
685
703
  icon: /* @__PURE__ */ e(s, { color: "#d05d4e", backgroundColor: "#faeaea" })
686
704
  },
687
705
  {
688
- label: /* @__PURE__ */ e(o, { to: "https://www.aigne.io/observability", ...n, children: "AIGNE Observability" }),
706
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/observability", ...n, children: "AIGNE Observability" }),
689
707
  description: i("products.aigneObservability.description"),
690
708
  icon: /* @__PURE__ */ e(s, { color: "#6ba456", backgroundColor: "#edfae8" })
691
709
  },
692
710
  {
693
- label: /* @__PURE__ */ e(o, { to: "https://www.aigne.io/studio", ...n, children: "AIGNE Studio" }),
711
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/studio", ...n, children: "AIGNE Studio" }),
694
712
  description: i("products.aigneStudio.description"),
695
713
  icon: /* @__PURE__ */ e(s, { color: "#676cbf", backgroundColor: "#edeeff" })
696
714
  },
697
715
  {
698
- label: /* @__PURE__ */ e(o, { to: "https://www.aigne.io/framework", ...n, children: "AIGNE Framework" }),
716
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/framework", ...n, children: "AIGNE Framework" }),
699
717
  description: i("products.aigneFramework.description"),
700
718
  icon: /* @__PURE__ */ e(s, { color: "#5086d0", backgroundColor: "#eef4ff" })
701
719
  }
@@ -706,7 +724,7 @@ function Fe({ className: t = "", type: c, ...a }) {
706
724
  label: i("groups.modelsAdapters"),
707
725
  children: [
708
726
  {
709
- label: /* @__PURE__ */ e(o, { to: "https://www.aigne.io/hub", ...n, children: "AIGNE Hub" }),
727
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/hub", ...n, children: "AIGNE Hub" }),
710
728
  description: i("products.aigneHub.description"),
711
729
  icon: /* @__PURE__ */ e(s, { color: "#e4930b", backgroundColor: "#fbf4d4" })
712
730
  }
@@ -716,8 +734,8 @@ function Fe({ className: t = "", type: c, ...a }) {
716
734
  }
717
735
  return [];
718
736
  }, [i, r, f]);
719
- return /* @__PURE__ */ e(oe, { ref: l, className: `nav-menu-products is-${u} ${t}`, ...a, children: x.map((n) => /* @__PURE__ */ e(B, { label: n.label, children: /* @__PURE__ */ e(te, { maxContent: N, children: n.children.map((d) => /* @__PURE__ */ e(K, { variant: "panel", style: { padding: "8px" }, ...d })) }) }, n.label)) });
737
+ return /* @__PURE__ */ e(oe, { ref: l, className: `nav-menu-products is-${m} ${o}`, ...a, children: x.map((n) => /* @__PURE__ */ e(B, { label: n.label, children: /* @__PURE__ */ e(re, { maxContent: W, children: n.children.map((d) => /* @__PURE__ */ e(E, { variant: "panel", style: { padding: "8px" }, ...d })) }) }, n.label)) });
720
738
  }
721
739
  export {
722
- Fe as default
740
+ Be as default
723
741
  };
@@ -1,4 +1,4 @@
1
- const e = "3.1.48", s = { "@blocklet/js-sdk": "1.16.52" }, n = {
1
+ const e = "3.1.50", s = { "@blocklet/js-sdk": "1.16.52" }, n = {
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.48",
3
+ "version": "3.1.50",
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": "49a6dabae8a06667e517c6811f5f7939ff907ce1",
71
+ "gitHead": "6840e9cab92d5ba54c9435924007c49f3e860c92",
72
72
  "dependencies": {
73
- "@arcblock/bridge": "3.1.48",
73
+ "@arcblock/bridge": "3.1.50",
74
74
  "@arcblock/did": "^1.25.6",
75
75
  "@arcblock/did-motif": "^1.1.14",
76
- "@arcblock/icons": "3.1.48",
77
- "@arcblock/nft-display": "3.1.48",
78
- "@arcblock/react-hooks": "3.1.48",
76
+ "@arcblock/icons": "3.1.50",
77
+ "@arcblock/nft-display": "3.1.50",
78
+ "@arcblock/react-hooks": "3.1.50",
79
79
  "@blocklet/js-sdk": "1.16.52",
80
- "@blocklet/theme": "3.1.48",
80
+ "@blocklet/theme": "3.1.50",
81
81
  "@fontsource/roboto": "~5.1.1",
82
82
  "@fontsource/ubuntu-mono": "^5.2.6",
83
83
  "@iconify-icons/logos": "^1.2.36",
@@ -9,7 +9,7 @@ function SwitchRole({
9
9
  user,
10
10
  switchPassport,
11
11
  }: {
12
- user: UserPublicInfo & { passports: { name: string; title: string; role: string }[] };
12
+ user: UserPublicInfo & { role: string; passports: { name: string; title: string; role: string }[] };
13
13
  switchPassport: () => void;
14
14
  }) {
15
15
  const currentRole = useCreation(
@@ -83,6 +83,7 @@ export interface LocaleProviderProps {
83
83
 
84
84
  export interface LocaleContextType {
85
85
  locale: Locale;
86
+ defaultLocale: Locale;
86
87
  changeLocale: (locale: Locale) => void;
87
88
  t: (key: string, data?: Record<string, any>) => string;
88
89
  languages: { code: string; name: string }[];
@@ -95,7 +96,7 @@ const { Provider, Consumer } = LocaleContext;
95
96
  function LocaleProvider({
96
97
  children,
97
98
  locale = undefined,
98
- fallbackLocale = undefined,
99
+ fallbackLocale = 'en',
99
100
  translations,
100
101
  onLoadingTranslation = undefined,
101
102
  languages = [],
@@ -104,7 +105,8 @@ function LocaleProvider({
104
105
  const langs = getLanguages(languages);
105
106
  // eslint-disable-next-line prefer-const
106
107
  let [currentLocale, setCurrentLocale] = useState<Locale>(locale || getLocale(langs));
107
- const lastCurrentLocale = useRef<string>(fallbackLocale || '');
108
+ const defaultLocale = langs?.[0]?.code ?? fallbackLocale;
109
+ const lastCurrentLocale = useRef<string>(defaultLocale);
108
110
  const [, setForceUpdate] = useState(0);
109
111
 
110
112
  const changeLocale = (newLocale: Locale) => {
@@ -145,7 +147,11 @@ function LocaleProvider({
145
147
  [translations, currentLocale, fallbackLocale]
146
148
  );
147
149
 
148
- return <Provider value={{ locale: currentLocale, changeLocale, t, languages: langs, ...rest }}>{children}</Provider>;
150
+ return (
151
+ <Provider value={{ locale: currentLocale, changeLocale, t, languages: langs, defaultLocale, ...rest }}>
152
+ {children}
153
+ </Provider>
154
+ );
149
155
  }
150
156
 
151
157
  function useLocaleContext() {
@@ -0,0 +1,26 @@
1
+ <svg viewBox="0 0 902 902" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="902" height="902" rx="212" fill="url(#paint0_linear_3783_1258)" style=""></rect>
3
+ <rect x="166" y="247" width="569" height="409" rx="80" stroke="white" style="stroke:white;stroke-opacity:1;"
4
+ stroke-width="40"></rect>
5
+ <ellipse cx="371" cy="452" rx="37" ry="65" fill="white" style="fill:white;fill-opacity:1;"></ellipse>
6
+ <ellipse cx="531" cy="452" rx="37" ry="65" fill="white" style="fill:white;fill-opacity:1;"></ellipse>
7
+ <defs>
8
+ <linearGradient id="paint0_linear_3783_1258" x1="84" y1="78.5" x2="811.5" y2="850.5"
9
+ gradientUnits="userSpaceOnUse">
10
+ <stop stop-color="#AAF4EF"
11
+ style="stop-color:#AAF4EF;stop-color:color(display-p3 0.6667 0.9569 0.9373);stop-opacity:1;"></stop>
12
+ <stop offset="0.180804" stop-color="#C7F37F"
13
+ style="stop-color:#C7F37F;stop-color:color(display-p3 0.7798 0.9512 0.4996);stop-opacity:1;"></stop>
14
+ <stop offset="0.361299" stop-color="#FFD071"
15
+ style="stop-color:#FFD071;stop-color:color(display-p3 1.0000 0.8141 0.4422);stop-opacity:1;"></stop>
16
+ <stop offset="0.546216" stop-color="#FF9898"
17
+ style="stop-color:#FF9898;stop-color:color(display-p3 1.0000 0.5960 0.5960);stop-opacity:1;"></stop>
18
+ <stop offset="0.72214" stop-color="#FF89E0"
19
+ style="stop-color:#FF89E0;stop-color:color(display-p3 1.0000 0.5360 0.8769);stop-opacity:1;"></stop>
20
+ <stop offset="0.898804" stop-color="#B695FE"
21
+ style="stop-color:#B695FE;stop-color:color(display-p3 0.7137 0.5843 0.9961);stop-opacity:1;"></stop>
22
+ <stop offset="1" stop-color="#7C8EED"
23
+ style="stop-color:#7C8EED;stop-color:color(display-p3 0.4863 0.5569 0.9294);stop-opacity:1;"></stop>
24
+ </linearGradient>
25
+ </defs>
26
+ </svg>
@@ -24,6 +24,7 @@ import VCSvg from './images/vc.svg?react';
24
24
  import PaymentKitPng from './images/payment-kit.png';
25
25
  // AIGNE Icons
26
26
  import AigneSvg from './images/aigne.svg?react';
27
+ import AigneImageSmithSvg from './images/aigne-image-smith.svg?react';
27
28
  import ArcSphereSvg from './images/arcsphere.svg?react';
28
29
  import AistroPng from './images/aistro.png';
29
30
  import { getUTMUrl } from '../withTracker/libs/utm';
@@ -110,6 +111,9 @@ const translations = {
110
111
  aigneWebSmith: {
111
112
  description: 'Build and deploy AI-powered web apps',
112
113
  },
114
+ aigneImageSmith: {
115
+ description: 'Generate and Refine Images with AI',
116
+ },
113
117
  aigneCLI: {
114
118
  description: 'Develop agents from the command line',
115
119
  },
@@ -206,6 +210,9 @@ const translations = {
206
210
  aigneWebSmith: {
207
211
  description: '构建并部署 AI 驱动的 Web 应用',
208
212
  },
213
+ aigneImageSmith: {
214
+ description: '使用 AI 生成和优化图像',
215
+ },
209
216
  aigneCLI: {
210
217
  description: '通过命令行开发 Agent',
211
218
  },
@@ -302,6 +309,9 @@ const translations = {
302
309
  aigneWebSmith: {
303
310
  description: '構建並部署 AI 驅動的 Web 應用',
304
311
  },
312
+ aigneImageSmith: {
313
+ description: '使用 AI 生成和優化圖像',
314
+ },
305
315
  aigneCLI: {
306
316
  description: '透過命令列開發 Agent',
307
317
  },
@@ -398,6 +408,9 @@ const translations = {
398
408
  aigneWebSmith: {
399
409
  description: 'AI駆動Webアプリの構築とデプロイ',
400
410
  },
411
+ aigneImageSmith: {
412
+ description: 'AIで画像を生成・最適化',
413
+ },
401
414
  aigneCLI: {
402
415
  description: 'コマンドラインからエージェントを開発',
403
416
  },
@@ -788,6 +801,11 @@ export default function Products({ className = '', type, ...rest }: ProductsProp
788
801
  description: t('products.aigneWebSmith.description'),
789
802
  icon: <AigneIcon color="#7c45eb" backgroundColor="#f0e9ff" />,
790
803
  },
804
+ {
805
+ label: <SmartLink to="https://imagesmith.aigne.io/">AIGNE ImageSmith</SmartLink>,
806
+ description: t('products.aigneImageSmith.description'),
807
+ icon: <AigneImageSmithSvg />,
808
+ },
791
809
  ],
792
810
  },
793
811
  {