@arcblock/ux 3.2.11 → 3.2.13

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,33 +1,33 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { useRef as G, useState as T, useEffect as S } from "react";
3
- import { Link as p } from "react-router-dom";
4
- import { useMemoizedFn as A, useCreation as $ } from "ahooks";
5
- import { Box as w, useTheme as F } from "@mui/material";
6
- import B from "./sub-item-group.js";
2
+ import { useRef as D, useState as x, useEffect as S } from "react";
3
+ import { Link as G } from "react-router-dom";
4
+ import { useMemoizedFn as k, useCreation as $ } from "ahooks";
5
+ import { Box as g, useTheme as F } from "@mui/material";
6
+ import T from "./sub-item-group.js";
7
7
  import { Item as E } from "./nav-menu.js";
8
- import { styled as C } from "../Theme/index.js";
8
+ import { styled as I } from "../Theme/index.js";
9
9
  import { useNavMenuContext as K } from "./nav-menu-context.js";
10
- import { translate as L } from "../Locale/util.js";
11
- import { useLocaleContext as _ } from "../Locale/context.js";
10
+ import { translate as B } from "../Locale/util.js";
11
+ import { useLocaleContext as L } 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
15
  import R from "./images/blocklet-store.svg.js";
16
- import H from "./images/web3-kit.svg.js";
17
- import z from "./images/blocklet-framework.svg.js";
18
- import U from "./images/abt-network.svg.js";
19
- import j from "./images/blocklet-server.svg.js";
20
- import V from "./images/OCAP.svg.js";
21
- import q from "./images/did.svg.js";
22
- import J from "./images/did-wallet.svg.js";
23
- import Q from "./images/vc.svg.js";
24
- import X from "./images/payment-kit.png";
25
- import Y from "./images/aigne.svg.js";
26
- import Z from "./images/aigne-image-smith.svg.js";
27
- import I from "./images/arcsphere.svg.js";
28
- import ee from "./images/aistro.png";
29
- import { getUTMUrl as ie } from "../withTracker/libs/utm.js";
30
- const v = 260, te = {
16
+ import _ from "./images/web3-kit.svg.js";
17
+ import H from "./images/blocklet-framework.svg.js";
18
+ import z from "./images/abt-network.svg.js";
19
+ import U from "./images/blocklet-server.svg.js";
20
+ import j from "./images/OCAP.svg.js";
21
+ import V from "./images/did.svg.js";
22
+ import q from "./images/did-wallet.svg.js";
23
+ import J from "./images/vc.svg.js";
24
+ import Q from "./images/payment-kit.png";
25
+ import X from "./images/aigne.svg.js";
26
+ import Y from "./images/aigne-image-smith.svg.js";
27
+ import f from "./images/arcsphere.svg.js";
28
+ import Z from "./images/aistro.png";
29
+ import { getUTMUrl as ee } from "../withTracker/libs/utm.js";
30
+ const A = 260, ie = {
31
31
  en: {
32
32
  groups: {
33
33
  applications: "Applications",
@@ -424,7 +424,7 @@ const v = 260, te = {
424
424
  }
425
425
  }
426
426
  }
427
- }, oe = C(w)`
427
+ }, te = I(g)`
428
428
  padding: 8px;
429
429
  background: ${({ theme: o }) => o.palette.grey[100]};
430
430
  border-radius: 8px;
@@ -445,22 +445,22 @@ const v = 260, te = {
445
445
  .MuiGrid-container + .MuiGrid-container {
446
446
  margin-top: 0px;
447
447
  }
448
- `, re = C(w, { shouldForwardProp: (o) => o !== "maxContent" })(
449
- ({ theme: o, maxContent: c }) => ({
448
+ `, oe = I(g, { shouldForwardProp: (o) => o !== "maxContent" })(
449
+ ({ theme: o, maxContent: n }) => ({
450
450
  display: "grid",
451
451
  gap: o.spacing(1),
452
- gridTemplateColumns: `repeat(1, ${c}px)`,
452
+ gridTemplateColumns: `repeat(1, ${n}px)`,
453
453
  [o.breakpoints.up("md")]: {
454
- gridTemplateColumns: `repeat(2, ${c}px)`
454
+ gridTemplateColumns: `repeat(2, ${n}px)`
455
455
  },
456
456
  [o.breakpoints.up("lg")]: {
457
- gridTemplateColumns: `repeat(3, ${c}px)`
457
+ gridTemplateColumns: `repeat(3, ${n}px)`
458
458
  }
459
459
  })
460
460
  );
461
- function y({ color: o = "black", backgroundColor: c = "transparent", children: a }) {
461
+ function v({ color: o = "black", backgroundColor: n = "transparent", children: p }) {
462
462
  return /* @__PURE__ */ e(
463
- w,
463
+ g,
464
464
  {
465
465
  component: "span",
466
466
  sx: {
@@ -468,274 +468,248 @@ function y({ color: o = "black", backgroundColor: c = "transparent", children: a
468
468
  alignItems: "center",
469
469
  justifyContent: "center",
470
470
  color: o,
471
- backgroundColor: c,
471
+ backgroundColor: n,
472
472
  borderRadius: "4px"
473
473
  },
474
- children: a
474
+ children: p
475
475
  }
476
476
  );
477
477
  }
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%" } }) });
478
+ function b({ color: o = "black", backgroundColor: n = "transparent" }) {
479
+ return /* @__PURE__ */ e(v, { color: o, backgroundColor: n, children: /* @__PURE__ */ e(V, { style: { width: "100%" } }) });
480
480
  }
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%" } }) });
481
+ function s({ color: o = "black", backgroundColor: n = "transparent" }) {
482
+ return /* @__PURE__ */ e(v, { color: o, backgroundColor: n, children: /* @__PURE__ */ e(X, { style: { width: "100%", height: "100%" } }) });
483
483
  }
484
- const N = (o) => {
484
+ const re = (o = "") => o.startsWith("http:") || o.startsWith("https:"), ne = (o) => {
485
485
  try {
486
- return new URL(o).origin !== window.location.origin;
486
+ return new URL(o).origin === window.location.origin;
487
487
  } catch {
488
488
  return !1;
489
489
  }
490
490
  };
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 });
491
+ function t({ to: o, children: n, className: p = "", ...l }) {
492
+ if (re(o)) {
493
+ const m = ne(o) ? "_self" : "_blank";
494
+ return /* @__PURE__ */ e("a", { href: ee(o, "header"), target: m, rel: "noreferrer noopener", className: p, ...l, children: n });
495
+ }
496
+ return /* @__PURE__ */ e(G, { to: o, className: p, ...l, children: n });
493
497
  }
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(() => {
496
- if (!l.current) return;
497
- const n = l.current.querySelectorAll(".navmenu-item__content");
498
- let d = v;
499
- n.forEach((b) => {
500
- const g = b.getBoundingClientRect().width + 64;
501
- g > d && (d = g);
502
- }), D(d);
498
+ function Ke({ className: o = "", type: n, ...p }) {
499
+ const { mode: l } = K(), m = F(), { locale: r = "en" } = L() || {}, a = D(null), { palette: h } = m, i = k((c, d = {}) => B(ie, c, r, "en", d)), [C, y] = x(A), u = k(() => {
500
+ if (!a.current) return;
501
+ const c = a.current.querySelectorAll(".navmenu-item__content");
502
+ let d = A;
503
+ c.forEach((N) => {
504
+ const w = N.getBoundingClientRect().width + 64;
505
+ w > d && (d = w);
506
+ }), y(d);
503
507
  });
504
508
  S(() => {
505
509
  u();
506
- }, [k, r, c, u]), S(() => {
507
- if (!l.current) return;
508
- const n = l.current.querySelector(".navmenu-item__content");
509
- if (!n) return;
510
+ }, [m, r, n, u]), S(() => {
511
+ if (!a.current) return;
512
+ const c = a.current.querySelector(".navmenu-item__content");
513
+ if (!c) return;
510
514
  const d = new ResizeObserver(() => {
511
515
  u();
512
516
  });
513
- return d.observe(n), () => {
517
+ return d.observe(c), () => {
514
518
  d.disconnect();
515
519
  };
516
520
  }, [u]);
517
- const x = $(() => {
518
- if (c === "ARCBLOCK")
519
- return [
521
+ const W = $(() => n === "ARCBLOCK" ? [
522
+ {
523
+ type: "Group",
524
+ label: i("groups.applications"),
525
+ children: [
520
526
  {
521
- type: "Group",
522
- label: i("groups.applications"),
523
- children: [
524
- {
525
- label: /* @__PURE__ */ e(t, { to: `https://www.nftstudio.rocks/${r}`, children: "NFT Studio" }),
526
- description: i("products.nftStudio.description"),
527
- icon: /* @__PURE__ */ e(M, {})
528
- },
529
- {
530
- label: /* @__PURE__ */ e(
531
- p,
532
- {
533
- to: `https://www.arcblock.io/content/collections/${r}/creator-studio`,
534
- target: "_blank",
535
- rel: "noreferrer noopener",
536
- children: "Creator Studio"
537
- }
538
- ),
539
- description: i("products.creatorStudio.description"),
540
- icon: /* @__PURE__ */ e(O, {})
541
- },
542
- {
543
- label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/", children: "AIGNE" }),
544
- description: i("products.aigne.description"),
545
- icon: /* @__PURE__ */ e(s, { color: f.mode === "dark" ? "white" : "black" })
546
- },
547
- {
548
- label: /* @__PURE__ */ e(t, { to: `https://www.arcsphere.io/${r}`, children: "ArcSphere" }),
549
- description: i("products.arcsphere.description"),
550
- icon: /* @__PURE__ */ e(I, {})
551
- }
552
- ]
527
+ label: /* @__PURE__ */ e(t, { to: `https://www.nftstudio.rocks/${r}`, children: "NFT Studio" }),
528
+ description: i("products.nftStudio.description"),
529
+ icon: /* @__PURE__ */ e(M, {})
553
530
  },
554
531
  {
555
- type: "Group",
556
- label: i("groups.components"),
557
- children: [
558
- {
559
- label: /* @__PURE__ */ e(t, { to: `https://launcher.arcblock.io/${r}`, children: "Blocklet Launcher" }),
560
- description: i("products.blockletLauncher.description"),
561
- icon: /* @__PURE__ */ e(P, {})
562
- },
563
- {
564
- label: /* @__PURE__ */ e(t, { to: `https://www.blocklet.io/${r}/payment-kit`, children: "Payment Kit" }),
565
- description: i("products.paymentKit.description"),
566
- icon: /* @__PURE__ */ e("img", { src: X, alt: "Payment Kit" })
567
- },
568
- {
569
- label: /* @__PURE__ */ e(t, { to: `https://store.blocklet.dev/?locale=${r}`, children: "Blocklet Store" }),
570
- description: i("products.blockletStore.description"),
571
- icon: /* @__PURE__ */ e(R, {})
572
- },
573
- {
574
- label: /* @__PURE__ */ e(t, { to: `https://www.web3kit.rocks/${r}`, children: "Web3 Kit" }),
575
- description: i("products.web3Kit.description"),
576
- icon: /* @__PURE__ */ e(H, {})
577
- }
578
- ]
532
+ label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${r}/creator-studio`, children: "Creator Studio" }),
533
+ description: i("products.creatorStudio.description"),
534
+ icon: /* @__PURE__ */ e(O, {})
579
535
  },
580
536
  {
581
- type: "Group",
582
- label: i("groups.computeStorage"),
583
- children: [
584
- {
585
- label: /* @__PURE__ */ e(
586
- p,
587
- {
588
- to: `https://www.arcblock.io/content/collections/${r}/blocklet`,
589
- target: "_blank",
590
- rel: "noreferrer noopener",
591
- children: "Blocklet Framework"
592
- }
593
- ),
594
- description: i("products.blockletFramework.description"),
595
- icon: /* @__PURE__ */ e(z, {})
596
- },
597
- {
598
- label: /* @__PURE__ */ e(p, { to: `https://www.didspaces.com/${r}`, target: "_blank", rel: "noreferrer noopener", children: "DID Spaces" }),
599
- description: i("products.didSpaces.description"),
600
- icon: /* @__PURE__ */ e(h, { color: "#876bf4" })
601
- },
602
- {
603
- label: /* @__PURE__ */ e(p, { to: "https://main.abtnetwork.io/", target: "_blank", rel: "noreferrer noopener", children: "ABT Network" }),
604
- description: i("products.abtNetwork.description"),
605
- icon: /* @__PURE__ */ e(U, {})
606
- },
607
- {
608
- label: /* @__PURE__ */ e(t, { to: `https://www.blocklet.io/${r}/blocklet-server`, children: "Blocklet Server" }),
609
- description: i("products.blockletServer.description"),
610
- icon: /* @__PURE__ */ e(j, {})
611
- },
612
- {
613
- label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${r}/ocap`, children: "ОСАР" }),
614
- description: i("products.ocap.description"),
615
- icon: /* @__PURE__ */ e(V, {})
616
- }
617
- ]
537
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/", children: "AIGNE" }),
538
+ description: i("products.aigne.description"),
539
+ icon: /* @__PURE__ */ e(s, { color: h.mode === "dark" ? "white" : "black" })
618
540
  },
619
541
  {
620
- type: "Group",
621
- label: i("groups.identity"),
622
- children: [
623
- {
624
- label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${r}/did`, children: "DID" }),
625
- description: i("products.did.description"),
626
- icon: /* @__PURE__ */ e(h, { color: "#5b96f3" })
627
- },
628
- {
629
- label: /* @__PURE__ */ e(t, { to: `https://www.didwallet.io/${r}`, children: "DID Wallet" }),
630
- description: i("products.didWallet.description"),
631
- icon: /* @__PURE__ */ e(J, {})
632
- },
633
- {
634
- label: /* @__PURE__ */ e(p, { to: `https://www.didnames.io/${r}`, target: "_blank", rel: "noreferrer noopener", children: "DID Names" }),
635
- description: i("products.didNameService.description"),
636
- icon: /* @__PURE__ */ e(h, { color: "#678ab0" })
637
- },
638
- {
639
- label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${r}/verifiable-credential`, children: "VC" }),
640
- description: i("products.vc.description"),
641
- icon: /* @__PURE__ */ e(Q, {})
642
- },
643
- {
644
- label: /* @__PURE__ */ e(t, { to: `https://www.didconnect.io/${r}`, children: "DID Connect" }),
645
- description: i("products.didConnect.description"),
646
- icon: /* @__PURE__ */ e(h, { color: "#5bbec5" })
647
- }
648
- ]
542
+ label: /* @__PURE__ */ e(t, { to: `https://www.arcsphere.io/${r}`, children: "ArcSphere" }),
543
+ description: i("products.arcsphere.description"),
544
+ icon: /* @__PURE__ */ e(f, {})
649
545
  }
650
- ];
651
- if (c === "AIGNE") {
652
- const n = {
653
- onClick: (d) => {
654
- d.preventDefault();
655
- const b = d.currentTarget.href, g = N(b) ? "_blank" : "_self";
656
- window.open(b, g);
546
+ ]
547
+ },
548
+ {
549
+ type: "Group",
550
+ label: i("groups.components"),
551
+ children: [
552
+ {
553
+ label: /* @__PURE__ */ e(t, { to: `https://launcher.arcblock.io/${r}`, children: "Blocklet Launcher" }),
554
+ description: i("products.blockletLauncher.description"),
555
+ icon: /* @__PURE__ */ e(P, {})
556
+ },
557
+ {
558
+ label: /* @__PURE__ */ e(t, { to: `https://www.blocklet.io/${r}/payment-kit`, children: "Payment Kit" }),
559
+ description: i("products.paymentKit.description"),
560
+ icon: /* @__PURE__ */ e("img", { src: Q, alt: "Payment Kit" })
561
+ },
562
+ {
563
+ label: /* @__PURE__ */ e(t, { to: `https://store.blocklet.dev/?locale=${r}`, children: "Blocklet Store" }),
564
+ description: i("products.blockletStore.description"),
565
+ icon: /* @__PURE__ */ e(R, {})
566
+ },
567
+ {
568
+ label: /* @__PURE__ */ e(t, { to: `https://www.web3kit.rocks/${r}`, children: "Web3 Kit" }),
569
+ description: i("products.web3Kit.description"),
570
+ icon: /* @__PURE__ */ e(_, {})
657
571
  }
658
- };
659
- return [
572
+ ]
573
+ },
574
+ {
575
+ type: "Group",
576
+ label: i("groups.computeStorage"),
577
+ children: [
578
+ {
579
+ label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${r}/blocklet`, children: "Blocklet Framework" }),
580
+ description: i("products.blockletFramework.description"),
581
+ icon: /* @__PURE__ */ e(H, {})
582
+ },
583
+ {
584
+ label: /* @__PURE__ */ e(t, { to: `https://www.didspaces.com/${r}`, children: "DID Spaces" }),
585
+ description: i("products.didSpaces.description"),
586
+ icon: /* @__PURE__ */ e(b, { color: "#876bf4" })
587
+ },
588
+ {
589
+ label: /* @__PURE__ */ e(t, { to: "https://main.abtnetwork.io/", children: "ABT Network" }),
590
+ description: i("products.abtNetwork.description"),
591
+ icon: /* @__PURE__ */ e(z, {})
592
+ },
593
+ {
594
+ label: /* @__PURE__ */ e(t, { to: `https://www.blocklet.io/${r}/blocklet-server`, children: "Blocklet Server" }),
595
+ description: i("products.blockletServer.description"),
596
+ icon: /* @__PURE__ */ e(U, {})
597
+ },
598
+ {
599
+ label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${r}/ocap`, children: "ОСАР" }),
600
+ description: i("products.ocap.description"),
601
+ icon: /* @__PURE__ */ e(j, {})
602
+ }
603
+ ]
604
+ },
605
+ {
606
+ type: "Group",
607
+ label: i("groups.identity"),
608
+ children: [
609
+ {
610
+ label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${r}/did`, children: "DID" }),
611
+ description: i("products.did.description"),
612
+ icon: /* @__PURE__ */ e(b, { color: "#5b96f3" })
613
+ },
614
+ {
615
+ label: /* @__PURE__ */ e(t, { to: `https://www.didwallet.io/${r}`, children: "DID Wallet" }),
616
+ description: i("products.didWallet.description"),
617
+ icon: /* @__PURE__ */ e(q, {})
618
+ },
660
619
  {
661
- type: "Group",
662
- label: i("groups.applications"),
663
- children: [
664
- {
665
- label: /* @__PURE__ */ e(t, { to: `https://www.arcsphere.io/${r}`, children: "ArcSphere" }),
666
- description: i("products.arcsphere.description"),
667
- icon: /* @__PURE__ */ e(I, {})
668
- },
669
- {
670
- label: /* @__PURE__ */ e(t, { to: `https://www.aistro.io/${r}`, children: "Aistro" }),
671
- description: i("products.aistro.description"),
672
- icon: /* @__PURE__ */ e("img", { src: ee, alt: "Aistro" })
673
- },
674
- {
675
- label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/code-smith", ...n, children: "AIGNE CodeSmith" }),
676
- description: i("products.aigneCodeSmith.description"),
677
- icon: /* @__PURE__ */ e(s, { color: "#3E5DF7", backgroundColor: "#e9f0ff" })
678
- },
679
- {
680
- label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/doc-smith", ...n, children: "AIGNE DocSmith" }),
681
- description: i("products.aigneDocSmith.description"),
682
- icon: /* @__PURE__ */ e(s, { color: "#02A996", backgroundColor: "#e6f7f5" })
683
- },
684
- {
685
- label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/web-smith", ...n, children: "AIGNE WebSmith" }),
686
- description: i("products.aigneWebSmith.description"),
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, {})
693
- }
694
- ]
620
+ label: /* @__PURE__ */ e(t, { to: `https://www.didnames.io/${r}`, children: "DID Names" }),
621
+ description: i("products.didNameService.description"),
622
+ icon: /* @__PURE__ */ e(b, { color: "#678ab0" })
695
623
  },
696
624
  {
697
- type: "Group",
698
- label: i("groups.frameworkTools"),
699
- children: [
700
- {
701
- label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/cli", ...n, children: "AIGNE CLI" }),
702
- description: i("products.aigneCLI.description"),
703
- icon: /* @__PURE__ */ e(s, { color: "#d05d4e", backgroundColor: "#faeaea" })
704
- },
705
- {
706
- label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/observability", ...n, children: "AIGNE Observability" }),
707
- description: i("products.aigneObservability.description"),
708
- icon: /* @__PURE__ */ e(s, { color: "#6ba456", backgroundColor: "#edfae8" })
709
- },
710
- {
711
- label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/studio", ...n, children: "AIGNE Studio" }),
712
- description: i("products.aigneStudio.description"),
713
- icon: /* @__PURE__ */ e(s, { color: "#676cbf", backgroundColor: "#edeeff" })
714
- },
715
- {
716
- label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/framework", ...n, children: "AIGNE Framework" }),
717
- description: i("products.aigneFramework.description"),
718
- icon: /* @__PURE__ */ e(s, { color: "#5086d0", backgroundColor: "#eef4ff" })
719
- }
720
- ]
625
+ label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${r}/verifiable-credential`, children: "VC" }),
626
+ description: i("products.vc.description"),
627
+ icon: /* @__PURE__ */ e(J, {})
721
628
  },
722
629
  {
723
- type: "Group",
724
- label: i("groups.modelsAdapters"),
725
- children: [
726
- {
727
- label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/hub", ...n, children: "AIGNE Hub" }),
728
- description: i("products.aigneHub.description"),
729
- icon: /* @__PURE__ */ e(s, { color: "#e4930b", backgroundColor: "#fbf4d4" })
730
- }
731
- ]
630
+ label: /* @__PURE__ */ e(t, { to: `https://www.didconnect.io/${r}`, children: "DID Connect" }),
631
+ description: i("products.didConnect.description"),
632
+ icon: /* @__PURE__ */ e(b, { color: "#5bbec5" })
633
+ }
634
+ ]
635
+ }
636
+ ] : n === "AIGNE" ? [
637
+ {
638
+ type: "Group",
639
+ label: i("groups.applications"),
640
+ children: [
641
+ {
642
+ label: /* @__PURE__ */ e(t, { to: `https://www.arcsphere.io/${r}`, children: "ArcSphere" }),
643
+ description: i("products.arcsphere.description"),
644
+ icon: /* @__PURE__ */ e(f, {})
645
+ },
646
+ {
647
+ label: /* @__PURE__ */ e(t, { to: `https://www.aistro.io/${r}`, children: "Aistro" }),
648
+ description: i("products.aistro.description"),
649
+ icon: /* @__PURE__ */ e("img", { src: Z, alt: "Aistro" })
650
+ },
651
+ {
652
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/code-smith", children: "AIGNE CodeSmith" }),
653
+ description: i("products.aigneCodeSmith.description"),
654
+ icon: /* @__PURE__ */ e(s, { color: "#3E5DF7", backgroundColor: "#e9f0ff" })
655
+ },
656
+ {
657
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/doc-smith", children: "AIGNE DocSmith" }),
658
+ description: i("products.aigneDocSmith.description"),
659
+ icon: /* @__PURE__ */ e(s, { color: "#02A996", backgroundColor: "#e6f7f5" })
660
+ },
661
+ {
662
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/web-smith", children: "AIGNE WebSmith" }),
663
+ description: i("products.aigneWebSmith.description"),
664
+ icon: /* @__PURE__ */ e(s, { color: "#7c45eb", backgroundColor: "#f0e9ff" })
665
+ },
666
+ {
667
+ label: /* @__PURE__ */ e(t, { to: "https://imagesmith.aigne.io/", children: "AIGNE ImageSmith" }),
668
+ description: i("products.aigneImageSmith.description"),
669
+ icon: /* @__PURE__ */ e(Y, {})
670
+ }
671
+ ]
672
+ },
673
+ {
674
+ type: "Group",
675
+ label: i("groups.frameworkTools"),
676
+ children: [
677
+ {
678
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/cli", children: "AIGNE CLI" }),
679
+ description: i("products.aigneCLI.description"),
680
+ icon: /* @__PURE__ */ e(s, { color: "#d05d4e", backgroundColor: "#faeaea" })
681
+ },
682
+ {
683
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/observability", children: "AIGNE Observability" }),
684
+ description: i("products.aigneObservability.description"),
685
+ icon: /* @__PURE__ */ e(s, { color: "#6ba456", backgroundColor: "#edfae8" })
686
+ },
687
+ {
688
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/studio", children: "AIGNE Studio" }),
689
+ description: i("products.aigneStudio.description"),
690
+ icon: /* @__PURE__ */ e(s, { color: "#676cbf", backgroundColor: "#edeeff" })
691
+ },
692
+ {
693
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/framework", children: "AIGNE Framework" }),
694
+ description: i("products.aigneFramework.description"),
695
+ icon: /* @__PURE__ */ e(s, { color: "#5086d0", backgroundColor: "#eef4ff" })
696
+ }
697
+ ]
698
+ },
699
+ {
700
+ type: "Group",
701
+ label: i("groups.modelsAdapters"),
702
+ children: [
703
+ {
704
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/hub", children: "AIGNE Hub" }),
705
+ description: i("products.aigneHub.description"),
706
+ icon: /* @__PURE__ */ e(s, { color: "#e4930b", backgroundColor: "#fbf4d4" })
732
707
  }
733
- ];
708
+ ]
734
709
  }
735
- return [];
736
- }, [i, r, f]);
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)) });
710
+ ] : [], [i, r, h]);
711
+ return /* @__PURE__ */ e(te, { ref: a, className: `nav-menu-products is-${l} ${o}`, ...p, children: W.map((c) => /* @__PURE__ */ e(T, { label: c.label, children: /* @__PURE__ */ e(oe, { maxContent: C, children: c.children.map((d) => /* @__PURE__ */ e(E, { variant: "panel", style: { padding: "8px" }, ...d })) }) }, c.label)) });
738
712
  }
739
713
  export {
740
- Be as default
714
+ Ke as default
741
715
  };
@@ -1,4 +1,4 @@
1
- const e = "3.2.11", s = { "@blocklet/js-sdk": "1.17.2" }, n = {
1
+ const e = "3.2.13", s = { "@blocklet/js-sdk": "1.17.4" }, 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.2.11",
3
+ "version": "3.2.13",
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": "dec9054be54c799898978686b5d030ed74cae431",
71
+ "gitHead": "2d0b666c40b2ba155594522f69dc122a658cb41a",
72
72
  "dependencies": {
73
- "@arcblock/bridge": "3.2.11",
74
- "@arcblock/did": "^1.27.6",
73
+ "@arcblock/bridge": "3.2.13",
74
+ "@arcblock/did": "^1.27.14",
75
75
  "@arcblock/did-motif": "^1.1.14",
76
- "@arcblock/icons": "3.2.11",
77
- "@arcblock/nft-display": "3.2.11",
78
- "@arcblock/react-hooks": "3.2.11",
79
- "@blocklet/js-sdk": "1.17.2",
80
- "@blocklet/theme": "3.2.11",
76
+ "@arcblock/icons": "3.2.13",
77
+ "@arcblock/nft-display": "3.2.13",
78
+ "@arcblock/react-hooks": "3.2.13",
79
+ "@blocklet/js-sdk": "1.17.4",
80
+ "@blocklet/theme": "3.2.13",
81
81
  "@fontsource/roboto": "~5.1.1",
82
82
  "@fontsource/ubuntu-mono": "^5.2.6",
83
83
  "@iconify-icons/logos": "^1.2.36",
@@ -85,7 +85,7 @@
85
85
  "@iconify-icons/mdi": "^1.2.48",
86
86
  "@iconify-icons/tabler": "^1.2.95",
87
87
  "@iconify/react": "^5.2.1",
88
- "@ocap/mcrypto": "^1.27.6",
88
+ "@ocap/mcrypto": "^1.27.14",
89
89
  "@solana/qr-code-styling": "^1.6.0",
90
90
  "@types/dompurify": "^3.2.0",
91
91
  "@types/mui-datatables": "^4.3.12",
@@ -507,12 +507,15 @@ function AigneIcon({ color = 'black', backgroundColor = 'transparent' }: { color
507
507
  );
508
508
  }
509
509
 
510
- const isExternal = (to: string) => {
510
+ const isExternal = (to: string = '') => {
511
+ return to.startsWith('http:') || to.startsWith('https:');
512
+ };
513
+
514
+ const isSameOrigin = (to: string) => {
511
515
  try {
512
516
  const url = new URL(to);
513
- return url.origin !== window.location.origin;
517
+ return url.origin === window.location.origin;
514
518
  } catch {
515
- // 如果 to 不是有效的 URL,则认为是内部链接
516
519
  return false;
517
520
  }
518
521
  };
@@ -525,10 +528,11 @@ interface SmartLinkProps extends LinkProps {
525
528
  }
526
529
  function SmartLink({ to, children, className = '', ...restProps }: SmartLinkProps) {
527
530
  if (isExternal(to)) {
531
+ const target = isSameOrigin(to) ? '_self' : '_blank';
528
532
  return (
529
- <Link to={getUTMUrl(to, 'header')} target="_blank" rel="noreferrer noopener" className={className} {...restProps}>
533
+ <a href={getUTMUrl(to, 'header')} target={target} rel="noreferrer noopener" className={className} {...restProps}>
530
534
  {children}
531
- </Link>
535
+ </a>
532
536
  );
533
537
  }
534
538
 
@@ -611,12 +615,9 @@ export default function Products({ className = '', type, ...rest }: ProductsProp
611
615
  },
612
616
  {
613
617
  label: (
614
- <Link
615
- to={`https://www.arcblock.io/content/collections/${locale}/creator-studio`}
616
- target="_blank"
617
- rel="noreferrer noopener">
618
+ <SmartLink to={`https://www.arcblock.io/content/collections/${locale}/creator-studio`}>
618
619
  Creator Studio
619
- </Link>
620
+ </SmartLink>
620
621
  ),
621
622
  description: t('products.creatorStudio.description'),
622
623
  icon: <CreatorStudioSvg />,
@@ -665,31 +666,20 @@ export default function Products({ className = '', type, ...rest }: ProductsProp
665
666
  children: [
666
667
  {
667
668
  label: (
668
- <Link
669
- to={`https://www.arcblock.io/content/collections/${locale}/blocklet`}
670
- target="_blank"
671
- rel="noreferrer noopener">
669
+ <SmartLink to={`https://www.arcblock.io/content/collections/${locale}/blocklet`}>
672
670
  Blocklet Framework
673
- </Link>
671
+ </SmartLink>
674
672
  ),
675
673
  description: t('products.blockletFramework.description'),
676
674
  icon: <BlockletFrameworkSvg />,
677
675
  },
678
676
  {
679
- label: (
680
- <Link to={`https://www.didspaces.com/${locale}`} target="_blank" rel="noreferrer noopener">
681
- DID Spaces
682
- </Link>
683
- ),
677
+ label: <SmartLink to={`https://www.didspaces.com/${locale}`}>DID Spaces</SmartLink>,
684
678
  description: t('products.didSpaces.description'),
685
679
  icon: <DIDIcon color="#876bf4" />,
686
680
  },
687
681
  {
688
- label: (
689
- <Link to="https://main.abtnetwork.io/" target="_blank" rel="noreferrer noopener">
690
- ABT Network
691
- </Link>
692
- ),
682
+ label: <SmartLink to="https://main.abtnetwork.io/">ABT Network</SmartLink>,
693
683
  description: t('products.abtNetwork.description'),
694
684
  icon: <AbtNetworkSvg />,
695
685
  },
@@ -720,11 +710,7 @@ export default function Products({ className = '', type, ...rest }: ProductsProp
720
710
  icon: <DidWalletSvg />,
721
711
  },
722
712
  {
723
- label: (
724
- <Link to={`https://www.didnames.io/${locale}`} target="_blank" rel="noreferrer noopener">
725
- DID Names
726
- </Link>
727
- ),
713
+ label: <SmartLink to={`https://www.didnames.io/${locale}`}>DID Names</SmartLink>,
728
714
  description: t('products.didNameService.description'),
729
715
  icon: <DIDIcon color="#678ab0" />,
730
716
  },
@@ -748,17 +734,6 @@ export default function Products({ className = '', type, ...rest }: ProductsProp
748
734
  }
749
735
 
750
736
  if (type === 'AIGNE') {
751
- // aigne 相关页面,不能使用 react dom 自己的 navigate 跳转,因为没有对应的页面数据
752
- const aigneLinkBaseProps = {
753
- onClick: (e: React.MouseEvent<HTMLAnchorElement>) => {
754
- e.preventDefault();
755
-
756
- const url = e.currentTarget.href;
757
- const target = isExternal(url) ? '_blank' : '_self';
758
- window.open(url, target);
759
- },
760
- };
761
-
762
737
  return [
763
738
  {
764
739
  type: 'Group',
@@ -775,29 +750,17 @@ export default function Products({ className = '', type, ...rest }: ProductsProp
775
750
  icon: <img src={AistroPng} alt="Aistro" />,
776
751
  },
777
752
  {
778
- label: (
779
- <SmartLink to="https://www.aigne.io/code-smith" {...aigneLinkBaseProps}>
780
- AIGNE CodeSmith
781
- </SmartLink>
782
- ),
753
+ label: <SmartLink to="https://www.aigne.io/code-smith">AIGNE CodeSmith</SmartLink>,
783
754
  description: t('products.aigneCodeSmith.description'),
784
755
  icon: <AigneIcon color="#3E5DF7" backgroundColor="#e9f0ff" />,
785
756
  },
786
757
  {
787
- label: (
788
- <SmartLink to="https://www.aigne.io/doc-smith" {...aigneLinkBaseProps}>
789
- AIGNE DocSmith
790
- </SmartLink>
791
- ),
758
+ label: <SmartLink to="https://www.aigne.io/doc-smith">AIGNE DocSmith</SmartLink>,
792
759
  description: t('products.aigneDocSmith.description'),
793
760
  icon: <AigneIcon color="#02A996" backgroundColor="#e6f7f5" />,
794
761
  },
795
762
  {
796
- label: (
797
- <SmartLink to="https://www.aigne.io/web-smith" {...aigneLinkBaseProps}>
798
- AIGNE WebSmith
799
- </SmartLink>
800
- ),
763
+ label: <SmartLink to="https://www.aigne.io/web-smith">AIGNE WebSmith</SmartLink>,
801
764
  description: t('products.aigneWebSmith.description'),
802
765
  icon: <AigneIcon color="#7c45eb" backgroundColor="#f0e9ff" />,
803
766
  },
@@ -813,38 +776,22 @@ export default function Products({ className = '', type, ...rest }: ProductsProp
813
776
  label: t('groups.frameworkTools'),
814
777
  children: [
815
778
  {
816
- label: (
817
- <SmartLink to="https://www.aigne.io/cli" {...aigneLinkBaseProps}>
818
- AIGNE CLI
819
- </SmartLink>
820
- ),
779
+ label: <SmartLink to="https://www.aigne.io/cli">AIGNE CLI</SmartLink>,
821
780
  description: t('products.aigneCLI.description'),
822
781
  icon: <AigneIcon color="#d05d4e" backgroundColor="#faeaea" />,
823
782
  },
824
783
  {
825
- label: (
826
- <SmartLink to="https://www.aigne.io/observability" {...aigneLinkBaseProps}>
827
- AIGNE Observability
828
- </SmartLink>
829
- ),
784
+ label: <SmartLink to="https://www.aigne.io/observability">AIGNE Observability</SmartLink>,
830
785
  description: t('products.aigneObservability.description'),
831
786
  icon: <AigneIcon color="#6ba456" backgroundColor="#edfae8" />,
832
787
  },
833
788
  {
834
- label: (
835
- <SmartLink to="https://www.aigne.io/studio" {...aigneLinkBaseProps}>
836
- AIGNE Studio
837
- </SmartLink>
838
- ),
789
+ label: <SmartLink to="https://www.aigne.io/studio">AIGNE Studio</SmartLink>,
839
790
  description: t('products.aigneStudio.description'),
840
791
  icon: <AigneIcon color="#676cbf" backgroundColor="#edeeff" />,
841
792
  },
842
793
  {
843
- label: (
844
- <SmartLink to="https://www.aigne.io/framework" {...aigneLinkBaseProps}>
845
- AIGNE Framework
846
- </SmartLink>
847
- ),
794
+ label: <SmartLink to="https://www.aigne.io/framework">AIGNE Framework</SmartLink>,
848
795
  description: t('products.aigneFramework.description'),
849
796
  icon: <AigneIcon color="#5086d0" backgroundColor="#eef4ff" />,
850
797
  },
@@ -855,11 +802,7 @@ export default function Products({ className = '', type, ...rest }: ProductsProp
855
802
  label: t('groups.modelsAdapters'),
856
803
  children: [
857
804
  {
858
- label: (
859
- <SmartLink to="https://www.aigne.io/hub" {...aigneLinkBaseProps}>
860
- AIGNE Hub
861
- </SmartLink>
862
- ),
805
+ label: <SmartLink to="https://www.aigne.io/hub">AIGNE Hub</SmartLink>,
863
806
  description: t('products.aigneHub.description'),
864
807
  icon: <AigneIcon color="#e4930b" backgroundColor="#fbf4d4" />,
865
808
  },