@arcblock/ux 3.1.17 → 3.1.19

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,31 +1,31 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { useRef as $, useState as D, useEffect as k } from "react";
2
+ import { useRef as D, useState as G, useEffect as S } from "react";
3
3
  import { Link as p } from "react-router-dom";
4
- import { useMemoizedFn as S, useCreation as G } from "ahooks";
5
- import { Box as w, useTheme as E } from "@mui/material";
6
- import B from "./sub-item-group.js";
7
- import { Item as T } from "./nav-menu.js";
8
- import { styled as I } from "../Theme/index.js";
9
- import { useNavMenuContext as F } from "./nav-menu-context.js";
10
- import { translate as L } from "../Locale/util.js";
4
+ import { useMemoizedFn as v, useCreation as B } from "ahooks";
5
+ import { Box as g, useTheme as E } from "@mui/material";
6
+ import T from "./sub-item-group.js";
7
+ import { Item as F } from "./nav-menu.js";
8
+ import { styled as C } from "../Theme/index.js";
9
+ import { useNavMenuContext as L } from "./nav-menu-context.js";
10
+ import { translate as _ } from "../Locale/util.js";
11
11
  import { useLocaleContext as K } from "../Locale/context.js";
12
- import _ from "./images/nft-studio.svg.js";
13
- import M from "./images/creator-studio.svg.js";
14
- import O from "./images/blocklet-launcher.svg.js";
15
- import P from "./images/blocklet-store.svg.js";
16
- import R 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 V from "./images/blocklet-server.svg.js";
20
- import j from "./images/OCAP.svg.js";
21
- import q from "./images/did.svg.js";
22
- import U 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 v from "./images/arcsphere.svg.js";
27
- import Y from "./images/aistro.png";
28
- const A = 260, Z = {
12
+ import M from "./images/nft-studio.svg.js";
13
+ import O from "./images/creator-studio.svg.js";
14
+ import P from "./images/blocklet-launcher.svg.js";
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 V from "./images/abt-network.svg.js";
19
+ import j from "./images/blocklet-server.svg.js";
20
+ import q from "./images/OCAP.svg.js";
21
+ import U 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 A from "./images/arcsphere.svg.js";
27
+ import Z from "./images/aistro.png";
28
+ const I = 260, ee = {
29
29
  en: {
30
30
  groups: {
31
31
  applications: "Applications",
@@ -218,9 +218,9 @@ const A = 260, Z = {
218
218
  }
219
219
  }
220
220
  }
221
- }, ee = I(w)`
221
+ }, oe = C(g)`
222
222
  padding: 8px;
223
- background: ${({ theme: r }) => r.palette.grey[100]};
223
+ background: ${({ theme: i }) => i.palette.grey[100]};
224
224
  border-radius: 8px;
225
225
 
226
226
  &.is-inline {
@@ -239,29 +239,29 @@ const A = 260, Z = {
239
239
  .MuiGrid-container + .MuiGrid-container {
240
240
  margin-top: 0px;
241
241
  }
242
- `, oe = I(w, { shouldForwardProp: (r) => r !== "maxContent" })(
243
- ({ theme: r, maxContent: c }) => ({
242
+ `, te = C(g, { shouldForwardProp: (i) => i !== "maxContent" })(
243
+ ({ theme: i, maxContent: c }) => ({
244
244
  display: "grid",
245
- gap: r.spacing(1),
245
+ gap: i.spacing(1),
246
246
  gridTemplateColumns: `repeat(1, ${c}px)`,
247
- [r.breakpoints.up("md")]: {
247
+ [i.breakpoints.up("md")]: {
248
248
  gridTemplateColumns: `repeat(2, ${c}px)`
249
249
  },
250
- [r.breakpoints.up("lg")]: {
250
+ [i.breakpoints.up("lg")]: {
251
251
  gridTemplateColumns: `repeat(3, ${c}px)`
252
252
  }
253
253
  })
254
254
  );
255
- function C({ color: r = "black", backgroundColor: c = "transparent", children: l }) {
255
+ function y({ color: i = "black", backgroundColor: c = "transparent", children: l }) {
256
256
  return /* @__PURE__ */ e(
257
- w,
257
+ g,
258
258
  {
259
259
  component: "span",
260
260
  sx: {
261
261
  display: "inline-flex",
262
262
  alignItems: "center",
263
263
  justifyContent: "center",
264
- color: r,
264
+ color: i,
265
265
  backgroundColor: c,
266
266
  borderRadius: "4px"
267
267
  },
@@ -269,34 +269,35 @@ function C({ color: r = "black", backgroundColor: c = "transparent", children: l
269
269
  }
270
270
  );
271
271
  }
272
- function b({ color: r = "black", backgroundColor: c = "transparent" }) {
273
- return /* @__PURE__ */ e(C, { color: r, backgroundColor: c, children: /* @__PURE__ */ e(q, { style: { width: "100%" } }) });
272
+ function w({ color: i = "black", backgroundColor: c = "transparent" }) {
273
+ return /* @__PURE__ */ e(y, { color: i, backgroundColor: c, children: /* @__PURE__ */ e(U, { style: { width: "100%" } }) });
274
274
  }
275
- function d({ color: r = "black", backgroundColor: c = "transparent" }) {
276
- return /* @__PURE__ */ e(C, { color: r, backgroundColor: c, children: /* @__PURE__ */ e(X, { style: { width: "100%", height: "100%" } }) });
275
+ function d({ color: i = "black", backgroundColor: c = "transparent" }) {
276
+ return /* @__PURE__ */ e(y, { color: i, backgroundColor: c, children: /* @__PURE__ */ e(Y, { style: { width: "100%", height: "100%" } }) });
277
277
  }
278
- function t({ to: r, children: c, className: l = "", ...u }) {
279
- return (() => {
280
- try {
281
- return new URL(r).origin !== window.location.origin;
282
- } catch {
283
- return !1;
284
- }
285
- })() ? /* @__PURE__ */ e(p, { to: r, target: "_blank", rel: "noreferrer noopener", className: l, ...u, children: c }) : /* @__PURE__ */ e(p, { to: r, className: l, ...u, children: c });
278
+ const N = (i) => {
279
+ try {
280
+ return new URL(i).origin !== window.location.origin;
281
+ } catch {
282
+ return !1;
283
+ }
284
+ };
285
+ function t({ to: i, children: c, className: l = "", ...u }) {
286
+ return N(i) ? /* @__PURE__ */ e(p, { to: i, target: "_blank", rel: "noreferrer noopener", className: l, ...u, children: c }) : /* @__PURE__ */ e(p, { to: i, className: l, ...u, children: c });
286
287
  }
287
- function $e({ className: r = "", type: c, ...l }) {
288
- const { mode: u } = F(), h = E(), { locale: i = "en" } = K() || {}, a = $(null), { palette: g } = h, o = S((n, s = {}) => L(Z, n, i, "en", s)), [y, N] = D(A), m = S(() => {
288
+ function De({ className: i = "", type: c, ...l }) {
289
+ const { mode: u } = L(), f = E(), { locale: r = "en" } = K() || {}, a = D(null), { palette: k } = f, o = v((n, s = {}) => _(ee, n, r, "en", s)), [x, W] = G(I), m = v(() => {
289
290
  if (!a.current) return;
290
291
  const n = a.current.querySelectorAll(".navmenu-item__content");
291
- let s = A;
292
- n.forEach((W) => {
293
- const f = W.getBoundingClientRect().width + 64;
294
- f > s && (s = f);
295
- }), N(s);
292
+ let s = I;
293
+ n.forEach((b) => {
294
+ const h = b.getBoundingClientRect().width + 64;
295
+ h > s && (s = h);
296
+ }), W(s);
296
297
  });
297
- k(() => {
298
+ S(() => {
298
299
  m();
299
- }, [h, i, c, m]), k(() => {
300
+ }, [f, r, c, m]), S(() => {
300
301
  if (!a.current) return;
301
302
  const n = a.current.querySelector(".navmenu-item__content");
302
303
  if (!n) return;
@@ -307,7 +308,7 @@ function $e({ className: r = "", type: c, ...l }) {
307
308
  s.disconnect();
308
309
  };
309
310
  }, [m]);
310
- const x = G(() => {
311
+ const $ = B(() => {
311
312
  if (c === "ARCBLOCK")
312
313
  return [
313
314
  {
@@ -315,32 +316,32 @@ function $e({ className: r = "", type: c, ...l }) {
315
316
  label: o("groups.applications"),
316
317
  children: [
317
318
  {
318
- label: /* @__PURE__ */ e(t, { to: `https://www.nftstudio.rocks/${i}`, children: "NFT Studio" }),
319
+ label: /* @__PURE__ */ e(t, { to: `https://www.nftstudio.rocks/${r}`, children: "NFT Studio" }),
319
320
  description: o("products.nftStudio.description"),
320
- icon: /* @__PURE__ */ e(_, {})
321
+ icon: /* @__PURE__ */ e(M, {})
321
322
  },
322
323
  {
323
324
  label: /* @__PURE__ */ e(
324
325
  p,
325
326
  {
326
- to: `https://www.arcblock.io/content/collections/${i}/creator-studio`,
327
+ to: `https://www.arcblock.io/content/collections/${r}/creator-studio`,
327
328
  target: "_blank",
328
329
  rel: "noreferrer noopener",
329
330
  children: "Creator Studio"
330
331
  }
331
332
  ),
332
333
  description: o("products.creatorStudio.description"),
333
- icon: /* @__PURE__ */ e(M, {})
334
+ icon: /* @__PURE__ */ e(O, {})
334
335
  },
335
336
  {
336
337
  label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/", children: "AIGNE" }),
337
338
  description: o("products.aigne.description"),
338
- icon: /* @__PURE__ */ e(d, { color: g.mode === "dark" ? "white" : "black" })
339
+ icon: /* @__PURE__ */ e(d, { color: k.mode === "dark" ? "white" : "black" })
339
340
  },
340
341
  {
341
- label: /* @__PURE__ */ e(t, { to: `https://www.arcsphere.io/${i}`, children: "ArcSphere" }),
342
+ label: /* @__PURE__ */ e(t, { to: `https://www.arcsphere.io/${r}`, children: "ArcSphere" }),
342
343
  description: o("products.arcsphere.description"),
343
- icon: /* @__PURE__ */ e(v, {})
344
+ icon: /* @__PURE__ */ e(A, {})
344
345
  }
345
346
  ]
346
347
  },
@@ -349,24 +350,24 @@ function $e({ className: r = "", type: c, ...l }) {
349
350
  label: o("groups.components"),
350
351
  children: [
351
352
  {
352
- label: /* @__PURE__ */ e(t, { to: `https://launcher.arcblock.io/${i}`, children: "Blocklet Launcher" }),
353
+ label: /* @__PURE__ */ e(t, { to: `https://launcher.arcblock.io/${r}`, children: "Blocklet Launcher" }),
353
354
  description: o("products.blockletLauncher.description"),
354
- icon: /* @__PURE__ */ e(O, {})
355
+ icon: /* @__PURE__ */ e(P, {})
355
356
  },
356
357
  {
357
- label: /* @__PURE__ */ e(t, { to: `https://www.blocklet.io/${i}/payment-kit`, children: "Payment Kit" }),
358
+ label: /* @__PURE__ */ e(t, { to: `https://www.blocklet.io/${r}/payment-kit`, children: "Payment Kit" }),
358
359
  description: o("products.paymentKit.description"),
359
- icon: /* @__PURE__ */ e("img", { src: Q, alt: "Payment Kit" })
360
+ icon: /* @__PURE__ */ e("img", { src: X, alt: "Payment Kit" })
360
361
  },
361
362
  {
362
- label: /* @__PURE__ */ e(t, { to: `https://store.blocklet.dev/?locale=${i}`, children: "Blocklet Store" }),
363
+ label: /* @__PURE__ */ e(t, { to: `https://store.blocklet.dev/?locale=${r}`, children: "Blocklet Store" }),
363
364
  description: o("products.blockletStore.description"),
364
- icon: /* @__PURE__ */ e(P, {})
365
+ icon: /* @__PURE__ */ e(R, {})
365
366
  },
366
367
  {
367
- label: /* @__PURE__ */ e(t, { to: `https://www.web3kit.rocks/${i}`, children: "Web3 Kit" }),
368
+ label: /* @__PURE__ */ e(t, { to: `https://www.web3kit.rocks/${r}`, children: "Web3 Kit" }),
368
369
  description: o("products.web3Kit.description"),
369
- icon: /* @__PURE__ */ e(R, {})
370
+ icon: /* @__PURE__ */ e(H, {})
370
371
  }
371
372
  ]
372
373
  },
@@ -378,34 +379,34 @@ function $e({ className: r = "", type: c, ...l }) {
378
379
  label: /* @__PURE__ */ e(
379
380
  p,
380
381
  {
381
- to: `https://www.arcblock.io/content/collections/${i}/blocklet`,
382
+ to: `https://www.arcblock.io/content/collections/${r}/blocklet`,
382
383
  target: "_blank",
383
384
  rel: "noreferrer noopener",
384
385
  children: "Blocklet Framework"
385
386
  }
386
387
  ),
387
388
  description: o("products.blockletFramework.description"),
388
- icon: /* @__PURE__ */ e(H, {})
389
+ icon: /* @__PURE__ */ e(z, {})
389
390
  },
390
391
  {
391
- label: /* @__PURE__ */ e(p, { to: `https://www.didspaces.com/${i}`, target: "_blank", rel: "noreferrer noopener", children: "DID Spaces" }),
392
+ label: /* @__PURE__ */ e(p, { to: `https://www.didspaces.com/${r}`, target: "_blank", rel: "noreferrer noopener", children: "DID Spaces" }),
392
393
  description: o("products.didSpaces.description"),
393
- icon: /* @__PURE__ */ e(b, { color: "#876bf4" })
394
+ icon: /* @__PURE__ */ e(w, { color: "#876bf4" })
394
395
  },
395
396
  {
396
397
  label: /* @__PURE__ */ e(p, { to: "https://main.abtnetwork.io/", target: "_blank", rel: "noreferrer noopener", children: "ABT Network" }),
397
398
  description: o("products.abtNetwork.description"),
398
- icon: /* @__PURE__ */ e(z, {})
399
+ icon: /* @__PURE__ */ e(V, {})
399
400
  },
400
401
  {
401
- label: /* @__PURE__ */ e(t, { to: `https://www.blocklet.io/${i}/blocklet-server`, children: "Blocklet Server" }),
402
+ label: /* @__PURE__ */ e(t, { to: `https://www.blocklet.io/${r}/blocklet-server`, children: "Blocklet Server" }),
402
403
  description: o("products.blockletServer.description"),
403
- icon: /* @__PURE__ */ e(V, {})
404
+ icon: /* @__PURE__ */ e(j, {})
404
405
  },
405
406
  {
406
- label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${i}/ocap`, children: "ОСАР" }),
407
+ label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${r}/ocap`, children: "ОСАР" }),
407
408
  description: o("products.ocap.description"),
408
- icon: /* @__PURE__ */ e(j, {})
409
+ icon: /* @__PURE__ */ e(q, {})
409
410
  }
410
411
  ]
411
412
  },
@@ -414,37 +415,40 @@ function $e({ className: r = "", type: c, ...l }) {
414
415
  label: o("groups.identity"),
415
416
  children: [
416
417
  {
417
- label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${i}/did`, children: "DID" }),
418
+ label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${r}/did`, children: "DID" }),
418
419
  description: o("products.did.description"),
419
- icon: /* @__PURE__ */ e(b, { color: "#5b96f3" })
420
+ icon: /* @__PURE__ */ e(w, { color: "#5b96f3" })
420
421
  },
421
422
  {
422
- label: /* @__PURE__ */ e(t, { to: `https://www.didwallet.io/${i}`, children: "DID Wallet" }),
423
+ label: /* @__PURE__ */ e(t, { to: `https://www.didwallet.io/${r}`, children: "DID Wallet" }),
423
424
  description: o("products.didWallet.description"),
424
- icon: /* @__PURE__ */ e(U, {})
425
+ icon: /* @__PURE__ */ e(J, {})
425
426
  },
426
427
  {
427
- label: /* @__PURE__ */ e(p, { to: `https://www.didnames.io/${i}`, target: "_blank", rel: "noreferrer noopener", children: "DID Names" }),
428
+ label: /* @__PURE__ */ e(p, { to: `https://www.didnames.io/${r}`, target: "_blank", rel: "noreferrer noopener", children: "DID Names" }),
428
429
  description: o("products.didNameService.description"),
429
- icon: /* @__PURE__ */ e(b, { color: "#678ab0" })
430
+ icon: /* @__PURE__ */ e(w, { color: "#678ab0" })
430
431
  },
431
432
  {
432
- label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${i}/verifiable-credential`, children: "VC" }),
433
+ label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${r}/verifiable-credential`, children: "VC" }),
433
434
  description: o("products.vc.description"),
434
- icon: /* @__PURE__ */ e(J, {})
435
+ icon: /* @__PURE__ */ e(Q, {})
435
436
  },
436
437
  {
437
- label: /* @__PURE__ */ e(t, { to: `https://www.didconnect.io/${i}`, children: "DID Connect" }),
438
+ label: /* @__PURE__ */ e(t, { to: `https://www.didconnect.io/${r}`, children: "DID Connect" }),
438
439
  description: o("products.didConnect.description"),
439
- icon: /* @__PURE__ */ e(b, { color: "#5bbec5" })
440
+ icon: /* @__PURE__ */ e(w, { color: "#5bbec5" })
440
441
  }
441
442
  ]
442
443
  }
443
444
  ];
444
445
  if (c === "AIGNE") {
445
446
  const n = {
446
- target: "_blank",
447
- rel: "noreferrer noopener"
447
+ onClick: (s) => {
448
+ s.preventDefault();
449
+ const b = s.currentTarget.href, h = N(b) ? "_blank" : "_self";
450
+ window.open(b, h);
451
+ }
448
452
  };
449
453
  return [
450
454
  {
@@ -452,14 +456,14 @@ function $e({ className: r = "", type: c, ...l }) {
452
456
  label: o("groups.applications"),
453
457
  children: [
454
458
  {
455
- label: /* @__PURE__ */ e(t, { to: `https://www.arcsphere.io/${i}`, children: "ArcSphere" }),
459
+ label: /* @__PURE__ */ e(t, { to: `https://www.arcsphere.io/${r}`, children: "ArcSphere" }),
456
460
  description: o("products.arcsphere.description"),
457
- icon: /* @__PURE__ */ e(v, {})
461
+ icon: /* @__PURE__ */ e(A, {})
458
462
  },
459
463
  {
460
- label: /* @__PURE__ */ e(t, { to: `https://www.aistro.io/${i}`, children: "Aistro" }),
464
+ label: /* @__PURE__ */ e(t, { to: `https://www.aistro.io/${r}`, children: "Aistro" }),
461
465
  description: o("products.aistro.description"),
462
- icon: /* @__PURE__ */ e("img", { src: Y, alt: "Aistro" })
466
+ icon: /* @__PURE__ */ e("img", { src: Z, alt: "Aistro" })
463
467
  },
464
468
  {
465
469
  label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/code-smith", ...n, children: "AIGNE CodeSmith" }),
@@ -518,9 +522,9 @@ function $e({ className: r = "", type: c, ...l }) {
518
522
  ];
519
523
  }
520
524
  return [];
521
- }, [o, i, g]);
522
- return /* @__PURE__ */ e(ee, { ref: a, className: `nav-menu-products is-${u} ${r}`, ...l, children: x.map((n) => /* @__PURE__ */ e(B, { label: n.label, children: /* @__PURE__ */ e(oe, { maxContent: y, children: n.children.map((s) => /* @__PURE__ */ e(T, { variant: "panel", style: { padding: "8px" }, ...s })) }) }, n.label)) });
525
+ }, [o, r, k]);
526
+ return /* @__PURE__ */ e(oe, { ref: a, className: `nav-menu-products is-${u} ${i}`, ...l, children: $.map((n) => /* @__PURE__ */ e(T, { label: n.label, children: /* @__PURE__ */ e(te, { maxContent: x, children: n.children.map((s) => /* @__PURE__ */ e(F, { variant: "panel", style: { padding: "8px" }, ...s })) }) }, n.label)) });
523
527
  }
524
528
  export {
525
- $e as default
529
+ De as default
526
530
  };
@@ -23,7 +23,7 @@ const o = i("nav", {
23
23
  flexDirection: "column",
24
24
  alignItems: "stretch"
25
25
  }
26
- })), e = i("li", {
26
+ })), a = i("li", {
27
27
  shouldForwardProp: (n) => n !== "$activeTextColor"
28
28
  })(({ $activeTextColor: n, theme: t }) => ({
29
29
  display: "flex",
@@ -146,6 +146,13 @@ const o = i("nav", {
146
146
  },
147
147
  "&.navmenu-item--active": {
148
148
  background: t.palette.action.hover
149
+ },
150
+ // Force clear hover state when not actually hovering
151
+ "&:not(:hover).navmenu-item--active": {
152
+ background: "transparent",
153
+ transition: t.transitions.create("background", {
154
+ duration: t.transitions.duration.standard
155
+ })
149
156
  }
150
157
  },
151
158
  // inline 布局中
@@ -156,7 +163,7 @@ const o = i("nav", {
156
163
  lineHeight: "48px",
157
164
  flexWrap: "wrap"
158
165
  }
159
- })), s = i(e)(({ theme: n }) => ({
166
+ })), s = i(a)(({ theme: n }) => ({
160
167
  ".navmenu-item": {
161
168
  marginLeft: 0,
162
169
  overflow: "hidden"
@@ -220,7 +227,7 @@ const o = i("nav", {
220
227
  height: "48px"
221
228
  }
222
229
  }
223
- })), p = i("ul")(({ theme: n }) => ({
230
+ })), d = i("ul")(({ theme: n }) => ({
224
231
  margin: 0,
225
232
  padding: "16px",
226
233
  borderRadius: "4px",
@@ -230,9 +237,9 @@ const o = i("nav", {
230
237
  }
231
238
  }));
232
239
  export {
233
- e as NavMenuItem,
240
+ a as NavMenuItem,
234
241
  r as NavMenuRoot,
235
242
  o as NavMenuStyled,
236
243
  s as NavMenuSub,
237
- p as NavMenuSubList
244
+ d as NavMenuSubList
238
245
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "3.1.17",
3
+ "version": "3.1.19",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -66,16 +66,16 @@
66
66
  "react": "^19.0.0",
67
67
  "react-router-dom": "^6.22.3"
68
68
  },
69
- "gitHead": "5b5551ce69cf45e2bed8cc06fbb3592020b7618c",
69
+ "gitHead": "49860d0bd0bb548087dcc6f49892fd4a88729d98",
70
70
  "dependencies": {
71
- "@arcblock/bridge": "3.1.17",
71
+ "@arcblock/bridge": "3.1.19",
72
72
  "@arcblock/did": "^1.21.3",
73
73
  "@arcblock/did-motif": "^1.1.14",
74
- "@arcblock/icons": "3.1.17",
75
- "@arcblock/nft-display": "3.1.17",
76
- "@arcblock/react-hooks": "3.1.17",
74
+ "@arcblock/icons": "3.1.19",
75
+ "@arcblock/nft-display": "3.1.19",
76
+ "@arcblock/react-hooks": "3.1.19",
77
77
  "@blocklet/js-sdk": "^1.16.48",
78
- "@blocklet/theme": "3.1.17",
78
+ "@blocklet/theme": "3.1.19",
79
79
  "@fontsource/roboto": "~5.1.1",
80
80
  "@fontsource/ubuntu-mono": "^5.2.6",
81
81
  "@iconify-icons/logos": "^1.2.36",
@@ -301,6 +301,16 @@ function AigneIcon({ color = 'black', backgroundColor = 'transparent' }: { color
301
301
  );
302
302
  }
303
303
 
304
+ const isExternal = (to: string) => {
305
+ try {
306
+ const url = new URL(to);
307
+ return url.origin !== window.location.origin;
308
+ } catch {
309
+ // 如果 to 不是有效的 URL,则认为是内部链接
310
+ return false;
311
+ }
312
+ };
313
+
304
314
  // 智能 Link 组件,根据 URL origin 决定是否在新标签页打开
305
315
  interface SmartLinkProps extends LinkProps {
306
316
  to: string;
@@ -308,17 +318,7 @@ interface SmartLinkProps extends LinkProps {
308
318
  className?: string;
309
319
  }
310
320
  function SmartLink({ to, children, className = '', ...restProps }: SmartLinkProps) {
311
- const isExternal = () => {
312
- try {
313
- const url = new URL(to);
314
- return url.origin !== window.location.origin;
315
- } catch {
316
- // 如果 to 不是有效的 URL,则认为是内部链接
317
- return false;
318
- }
319
- };
320
-
321
- if (isExternal()) {
321
+ if (isExternal(to)) {
322
322
  return (
323
323
  <Link to={to} target="_blank" rel="noreferrer noopener" className={className} {...restProps}>
324
324
  {children}
@@ -544,8 +544,13 @@ export default function Products({ className = '', type, ...rest }: ProductsProp
544
544
  if (type === 'AIGNE') {
545
545
  // aigne 相关页面,不能使用 react dom 自己的 navigate 跳转,因为没有对应的页面数据
546
546
  const aigneLinkBaseProps = {
547
- target: '_blank',
548
- rel: 'noreferrer noopener',
547
+ onClick: (e: React.MouseEvent<HTMLAnchorElement>) => {
548
+ e.preventDefault();
549
+
550
+ const url = e.currentTarget.href;
551
+ const target = isExternal(url) ? '_blank' : '_self';
552
+ window.open(url, target);
553
+ },
549
554
  };
550
555
 
551
556
  return [
@@ -162,6 +162,13 @@ export const NavMenuItem = styled('li', {
162
162
  '&.navmenu-item--active': {
163
163
  background: theme.palette.action.hover,
164
164
  },
165
+ // Force clear hover state when not actually hovering
166
+ '&:not(:hover).navmenu-item--active': {
167
+ background: 'transparent',
168
+ transition: theme.transitions.create('background', {
169
+ duration: theme.transitions.duration.standard,
170
+ }),
171
+ },
165
172
  },
166
173
  // inline 布局中
167
174
  '&.navmenu-item--inline': {