@arcblock/ux 3.1.16 → 3.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/DIDConnect/auth-apps/auth-apps-info.js +5 -5
- package/lib/NavMenu/products.js +104 -100
- package/lib/NavMenu/style.js +12 -5
- package/lib/Result/result.js +19 -19
- package/package.json +7 -7
- package/src/DIDConnect/auth-apps/auth-apps-info.tsx +1 -1
- package/src/NavMenu/products.tsx +18 -13
- package/src/NavMenu/style.ts +7 -0
- package/src/Result/result.tsx +3 -3
@@ -1,9 +1,9 @@
|
|
1
1
|
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
2
2
|
import { Box as e, Typography as l } from "@mui/material";
|
3
|
-
import
|
3
|
+
import o from "../../Img/index.js";
|
4
4
|
function m({
|
5
5
|
requestAppInfo: a,
|
6
|
-
currentAppInfo:
|
6
|
+
currentAppInfo: i
|
7
7
|
}) {
|
8
8
|
return /* @__PURE__ */ r(
|
9
9
|
e,
|
@@ -25,7 +25,7 @@ function m({
|
|
25
25
|
justifyContent: "center"
|
26
26
|
},
|
27
27
|
children: [
|
28
|
-
/* @__PURE__ */ t(
|
28
|
+
/* @__PURE__ */ t(o, { src: i.appLogo, alt: "Server", width: 48, height: 48, useProxyFallback: !0 }),
|
29
29
|
/* @__PURE__ */ r(
|
30
30
|
e,
|
31
31
|
{
|
@@ -37,7 +37,7 @@ function m({
|
|
37
37
|
width: 8,
|
38
38
|
height: 8,
|
39
39
|
borderRadius: "50%",
|
40
|
-
bgcolor: "
|
40
|
+
bgcolor: "grey.500",
|
41
41
|
mx: 0.5
|
42
42
|
}
|
43
43
|
},
|
@@ -48,7 +48,7 @@ function m({
|
|
48
48
|
]
|
49
49
|
}
|
50
50
|
),
|
51
|
-
/* @__PURE__ */ t(
|
51
|
+
/* @__PURE__ */ t(o, { src: a.appLogo, alt: a.appName, width: 48, height: 48, useProxyFallback: !0 })
|
52
52
|
]
|
53
53
|
}
|
54
54
|
),
|
package/lib/NavMenu/products.js
CHANGED
@@ -1,31 +1,31 @@
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
2
|
-
import { useRef as
|
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
|
5
|
-
import { Box as
|
6
|
-
import
|
7
|
-
import { Item as
|
8
|
-
import { styled as
|
9
|
-
import { useNavMenuContext as
|
10
|
-
import { translate as
|
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
|
13
|
-
import
|
14
|
-
import
|
15
|
-
import
|
16
|
-
import
|
17
|
-
import
|
18
|
-
import
|
19
|
-
import
|
20
|
-
import
|
21
|
-
import
|
22
|
-
import
|
23
|
-
import
|
24
|
-
import
|
25
|
-
import
|
26
|
-
import
|
27
|
-
import
|
28
|
-
const
|
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
|
-
},
|
221
|
+
}, oe = C(g)`
|
222
222
|
padding: 8px;
|
223
|
-
background: ${({ theme:
|
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
|
-
`,
|
243
|
-
({ theme:
|
242
|
+
`, te = C(g, { shouldForwardProp: (i) => i !== "maxContent" })(
|
243
|
+
({ theme: i, maxContent: c }) => ({
|
244
244
|
display: "grid",
|
245
|
-
gap:
|
245
|
+
gap: i.spacing(1),
|
246
246
|
gridTemplateColumns: `repeat(1, ${c}px)`,
|
247
|
-
[
|
247
|
+
[i.breakpoints.up("md")]: {
|
248
248
|
gridTemplateColumns: `repeat(2, ${c}px)`
|
249
249
|
},
|
250
|
-
[
|
250
|
+
[i.breakpoints.up("lg")]: {
|
251
251
|
gridTemplateColumns: `repeat(3, ${c}px)`
|
252
252
|
}
|
253
253
|
})
|
254
254
|
);
|
255
|
-
function
|
255
|
+
function y({ color: i = "black", backgroundColor: c = "transparent", children: l }) {
|
256
256
|
return /* @__PURE__ */ e(
|
257
|
-
|
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:
|
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
|
273
|
-
return /* @__PURE__ */ e(
|
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:
|
276
|
-
return /* @__PURE__ */ e(
|
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
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
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
|
288
|
-
const { mode: u } =
|
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 =
|
292
|
-
n.forEach((
|
293
|
-
const
|
294
|
-
|
295
|
-
}),
|
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
|
-
|
298
|
+
S(() => {
|
298
299
|
m();
|
299
|
-
}, [
|
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
|
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/${
|
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/${
|
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(
|
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:
|
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/${
|
342
|
+
label: /* @__PURE__ */ e(t, { to: `https://www.arcsphere.io/${r}`, children: "ArcSphere" }),
|
342
343
|
description: o("products.arcsphere.description"),
|
343
|
-
icon: /* @__PURE__ */ e(
|
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/${
|
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(
|
355
|
+
icon: /* @__PURE__ */ e(P, {})
|
355
356
|
},
|
356
357
|
{
|
357
|
-
label: /* @__PURE__ */ e(t, { to: `https://www.blocklet.io/${
|
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:
|
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=${
|
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(
|
365
|
+
icon: /* @__PURE__ */ e(R, {})
|
365
366
|
},
|
366
367
|
{
|
367
|
-
label: /* @__PURE__ */ e(t, { to: `https://www.web3kit.rocks/${
|
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(
|
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/${
|
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(
|
389
|
+
icon: /* @__PURE__ */ e(z, {})
|
389
390
|
},
|
390
391
|
{
|
391
|
-
label: /* @__PURE__ */ e(p, { to: `https://www.didspaces.com/${
|
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(
|
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(
|
399
|
+
icon: /* @__PURE__ */ e(V, {})
|
399
400
|
},
|
400
401
|
{
|
401
|
-
label: /* @__PURE__ */ e(t, { to: `https://www.blocklet.io/${
|
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(
|
404
|
+
icon: /* @__PURE__ */ e(j, {})
|
404
405
|
},
|
405
406
|
{
|
406
|
-
label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${
|
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(
|
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/${
|
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(
|
420
|
+
icon: /* @__PURE__ */ e(w, { color: "#5b96f3" })
|
420
421
|
},
|
421
422
|
{
|
422
|
-
label: /* @__PURE__ */ e(t, { to: `https://www.didwallet.io/${
|
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(
|
425
|
+
icon: /* @__PURE__ */ e(J, {})
|
425
426
|
},
|
426
427
|
{
|
427
|
-
label: /* @__PURE__ */ e(p, { to: `https://www.didnames.io/${
|
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(
|
430
|
+
icon: /* @__PURE__ */ e(w, { color: "#678ab0" })
|
430
431
|
},
|
431
432
|
{
|
432
|
-
label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${
|
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(
|
435
|
+
icon: /* @__PURE__ */ e(Q, {})
|
435
436
|
},
|
436
437
|
{
|
437
|
-
label: /* @__PURE__ */ e(t, { to: `https://www.didconnect.io/${
|
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(
|
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
|
-
|
447
|
-
|
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/${
|
459
|
+
label: /* @__PURE__ */ e(t, { to: `https://www.arcsphere.io/${r}`, children: "ArcSphere" }),
|
456
460
|
description: o("products.arcsphere.description"),
|
457
|
-
icon: /* @__PURE__ */ e(
|
461
|
+
icon: /* @__PURE__ */ e(A, {})
|
458
462
|
},
|
459
463
|
{
|
460
|
-
label: /* @__PURE__ */ e(t, { to: `https://www.aistro.io/${
|
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:
|
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,
|
522
|
-
return /* @__PURE__ */ e(
|
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
|
-
|
529
|
+
De as default
|
526
530
|
};
|
package/lib/NavMenu/style.js
CHANGED
@@ -23,7 +23,7 @@ const o = i("nav", {
|
|
23
23
|
flexDirection: "column",
|
24
24
|
alignItems: "stretch"
|
25
25
|
}
|
26
|
-
})),
|
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(
|
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
|
-
})),
|
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
|
-
|
240
|
+
a as NavMenuItem,
|
234
241
|
r as NavMenuRoot,
|
235
242
|
o as NavMenuStyled,
|
236
243
|
s as NavMenuSub,
|
237
|
-
|
244
|
+
d as NavMenuSubList
|
238
245
|
};
|
package/lib/Result/result.js
CHANGED
@@ -1,36 +1,36 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { Box as
|
3
|
-
import { styled as
|
4
|
-
function
|
5
|
-
return /* @__PURE__ */
|
6
|
-
|
7
|
-
typeof
|
8
|
-
|
1
|
+
import { jsxs as c, jsx as n } from "react/jsx-runtime";
|
2
|
+
import { Box as r } from "@mui/material";
|
3
|
+
import { styled as x } from "../Theme/index.js";
|
4
|
+
function a({ icon: t = null, title: e = "", description: o = "", extra: i = null, ...l }) {
|
5
|
+
return /* @__PURE__ */ c(s, { ...l, children: [
|
6
|
+
t,
|
7
|
+
typeof e == "string" ? /* @__PURE__ */ n(
|
8
|
+
r,
|
9
9
|
{
|
10
10
|
sx: {
|
11
11
|
mt: 3,
|
12
12
|
fontSize: 22,
|
13
13
|
fontWeight: 400,
|
14
|
-
color: "
|
14
|
+
color: "text.primary",
|
15
15
|
textAlign: "center"
|
16
16
|
},
|
17
|
-
children:
|
17
|
+
children: e
|
18
18
|
}
|
19
|
-
) :
|
20
|
-
typeof o == "string" ? /* @__PURE__ */
|
21
|
-
|
19
|
+
) : e,
|
20
|
+
typeof o == "string" ? /* @__PURE__ */ n(
|
21
|
+
r,
|
22
22
|
{
|
23
23
|
sx: {
|
24
24
|
mt: 1,
|
25
25
|
fontSize: 14,
|
26
|
-
color: "
|
26
|
+
color: "text.secondary",
|
27
27
|
textAlign: "center"
|
28
28
|
},
|
29
29
|
children: o
|
30
30
|
}
|
31
31
|
) : o,
|
32
|
-
/* @__PURE__ */
|
33
|
-
|
32
|
+
/* @__PURE__ */ n(
|
33
|
+
r,
|
34
34
|
{
|
35
35
|
sx: {
|
36
36
|
mt: 3
|
@@ -40,7 +40,7 @@ function g({ icon: r = null, title: t = "", description: o = "", extra: i = null
|
|
40
40
|
)
|
41
41
|
] });
|
42
42
|
}
|
43
|
-
const s =
|
43
|
+
const s = x("div")`
|
44
44
|
box-sizing: border-box;
|
45
45
|
display: flex;
|
46
46
|
flex-direction: column;
|
@@ -49,8 +49,8 @@ const s = c("div")`
|
|
49
49
|
height: 100%;
|
50
50
|
padding: 16px;
|
51
51
|
|
52
|
-
background-color: #
|
52
|
+
background-color: ${({ theme: t }) => t.palette?.background?.default || "#F7F8F8"};
|
53
53
|
`;
|
54
54
|
export {
|
55
|
-
|
55
|
+
a as default
|
56
56
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@arcblock/ux",
|
3
|
-
"version": "3.1.
|
3
|
+
"version": "3.1.18",
|
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": "
|
69
|
+
"gitHead": "a145d1dd215444e7b65b8fa08cba2d8db513a94a",
|
70
70
|
"dependencies": {
|
71
|
-
"@arcblock/bridge": "3.1.
|
71
|
+
"@arcblock/bridge": "3.1.18",
|
72
72
|
"@arcblock/did": "^1.21.3",
|
73
73
|
"@arcblock/did-motif": "^1.1.14",
|
74
|
-
"@arcblock/icons": "3.1.
|
75
|
-
"@arcblock/nft-display": "3.1.
|
76
|
-
"@arcblock/react-hooks": "3.1.
|
74
|
+
"@arcblock/icons": "3.1.18",
|
75
|
+
"@arcblock/nft-display": "3.1.18",
|
76
|
+
"@arcblock/react-hooks": "3.1.18",
|
77
77
|
"@blocklet/js-sdk": "^1.16.48",
|
78
|
-
"@blocklet/theme": "3.1.
|
78
|
+
"@blocklet/theme": "3.1.18",
|
79
79
|
"@fontsource/roboto": "~5.1.1",
|
80
80
|
"@fontsource/ubuntu-mono": "^5.2.6",
|
81
81
|
"@iconify-icons/logos": "^1.2.36",
|
package/src/NavMenu/products.tsx
CHANGED
@@ -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
|
-
|
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
|
-
|
548
|
-
|
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 [
|
package/src/NavMenu/style.ts
CHANGED
@@ -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': {
|
package/src/Result/result.tsx
CHANGED
@@ -19,7 +19,7 @@ function Result({ icon = null, title = '', description = '', extra = null, ...re
|
|
19
19
|
mt: 3,
|
20
20
|
fontSize: 22,
|
21
21
|
fontWeight: 400,
|
22
|
-
color: '
|
22
|
+
color: 'text.primary',
|
23
23
|
textAlign: 'center',
|
24
24
|
}}>
|
25
25
|
{title}
|
@@ -32,7 +32,7 @@ function Result({ icon = null, title = '', description = '', extra = null, ...re
|
|
32
32
|
sx={{
|
33
33
|
mt: 1,
|
34
34
|
fontSize: 14,
|
35
|
-
color: '
|
35
|
+
color: 'text.secondary',
|
36
36
|
textAlign: 'center',
|
37
37
|
}}>
|
38
38
|
{description}
|
@@ -59,7 +59,7 @@ const Root = styled('div')`
|
|
59
59
|
height: 100%;
|
60
60
|
padding: 16px;
|
61
61
|
|
62
|
-
background-color: #
|
62
|
+
background-color: ${({ theme }) => theme.palette?.background?.default || '#F7F8F8'};
|
63
63
|
`;
|
64
64
|
|
65
65
|
export default Result;
|