@arcblock/ux 3.1.12 → 3.1.14

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.
@@ -2,15 +2,15 @@ import { jsx as e } from "react/jsx-runtime";
2
2
  import { useRef as $, useState as D, useEffect as k } from "react";
3
3
  import { Link as p } from "react-router-dom";
4
4
  import { useMemoizedFn as S, useCreation as G } from "ahooks";
5
- import { Box as h, useTheme as E } from "@mui/material";
5
+ import { Box as w, useTheme as E } from "@mui/material";
6
6
  import B from "./sub-item-group.js";
7
7
  import { Item as T } from "./nav-menu.js";
8
8
  import { styled as I } from "../Theme/index.js";
9
9
  import { useNavMenuContext as F } from "./nav-menu-context.js";
10
- import { translate as K } from "../Locale/util.js";
11
- import { useLocaleContext as L } from "../Locale/context.js";
12
- import M from "./images/nft-studio.svg.js";
13
- import _ from "./images/creator-studio.svg.js";
10
+ import { translate as L } from "../Locale/util.js";
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
14
  import O from "./images/blocklet-launcher.svg.js";
15
15
  import P from "./images/blocklet-store.svg.js";
16
16
  import R from "./images/web3-kit.svg.js";
@@ -218,7 +218,7 @@ const A = 260, Z = {
218
218
  }
219
219
  }
220
220
  }
221
- }, ee = I(h)`
221
+ }, ee = I(w)`
222
222
  padding: 8px;
223
223
  background: ${({ theme: r }) => r.palette.grey[100]};
224
224
  border-radius: 8px;
@@ -239,22 +239,22 @@ const A = 260, Z = {
239
239
  .MuiGrid-container + .MuiGrid-container {
240
240
  margin-top: 0px;
241
241
  }
242
- `, oe = I(h, { shouldForwardProp: (r) => r !== "maxContent" })(
243
- ({ theme: r, maxContent: n }) => ({
242
+ `, oe = I(w, { shouldForwardProp: (r) => r !== "maxContent" })(
243
+ ({ theme: r, maxContent: c }) => ({
244
244
  display: "grid",
245
245
  gap: r.spacing(1),
246
- gridTemplateColumns: `repeat(1, ${n}px)`,
246
+ gridTemplateColumns: `repeat(1, ${c}px)`,
247
247
  [r.breakpoints.up("md")]: {
248
- gridTemplateColumns: `repeat(2, ${n}px)`
248
+ gridTemplateColumns: `repeat(2, ${c}px)`
249
249
  },
250
250
  [r.breakpoints.up("lg")]: {
251
- gridTemplateColumns: `repeat(3, ${n}px)`
251
+ gridTemplateColumns: `repeat(3, ${c}px)`
252
252
  }
253
253
  })
254
254
  );
255
- function C({ color: r = "black", backgroundColor: n = "transparent", children: l }) {
255
+ function C({ color: r = "black", backgroundColor: c = "transparent", children: l }) {
256
256
  return /* @__PURE__ */ e(
257
- h,
257
+ w,
258
258
  {
259
259
  component: "span",
260
260
  sx: {
@@ -262,253 +262,264 @@ function C({ color: r = "black", backgroundColor: n = "transparent", children: l
262
262
  alignItems: "center",
263
263
  justifyContent: "center",
264
264
  color: r,
265
- backgroundColor: n,
265
+ backgroundColor: c,
266
266
  borderRadius: "4px"
267
267
  },
268
268
  children: l
269
269
  }
270
270
  );
271
271
  }
272
- function m({ color: r = "black", backgroundColor: n = "transparent" }) {
273
- return /* @__PURE__ */ e(C, { color: r, backgroundColor: n, children: /* @__PURE__ */ e(q, { style: { width: "100%" } }) });
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%" } }) });
274
274
  }
275
- function d({ color: r = "black", backgroundColor: n = "transparent" }) {
276
- return /* @__PURE__ */ e(C, { color: r, backgroundColor: n, children: /* @__PURE__ */ e(X, { style: { width: "100%", height: "100%" } }) });
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%" } }) });
277
277
  }
278
- function t({ to: r, children: n, className: l = "" }) {
278
+ function t({ to: r, children: c, className: l = "", ...u }) {
279
279
  return (() => {
280
280
  try {
281
281
  return new URL(r).origin !== window.location.origin;
282
282
  } catch {
283
283
  return !1;
284
284
  }
285
- })() ? /* @__PURE__ */ e(p, { to: r, target: "_blank", rel: "noreferrer noopener", className: l, children: n }) : /* @__PURE__ */ e(p, { to: r, className: l, children: n });
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 });
286
286
  }
287
- function $e({ className: r = "", type: n, ...l }) {
288
- const { mode: w } = F(), b = E(), { locale: i = "en" } = L() || {}, a = $(null), { palette: g } = b, o = S((c, s = {}) => K(Z, c, i, "en", s)), [y, N] = D(A), u = S(() => {
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(() => {
289
289
  if (!a.current) return;
290
- const c = a.current.querySelectorAll(".navmenu-item__content");
290
+ const n = a.current.querySelectorAll(".navmenu-item__content");
291
291
  let s = A;
292
- c.forEach((W) => {
292
+ n.forEach((W) => {
293
293
  const f = W.getBoundingClientRect().width + 64;
294
294
  f > s && (s = f);
295
295
  }), N(s);
296
296
  });
297
297
  k(() => {
298
- u();
299
- }, [b, i, n, u]), k(() => {
298
+ m();
299
+ }, [h, i, c, m]), k(() => {
300
300
  if (!a.current) return;
301
- const c = a.current.querySelector(".navmenu-item__content");
302
- if (!c) return;
301
+ const n = a.current.querySelector(".navmenu-item__content");
302
+ if (!n) return;
303
303
  const s = new ResizeObserver(() => {
304
- u();
304
+ m();
305
305
  });
306
- return s.observe(c), () => {
306
+ return s.observe(n), () => {
307
307
  s.disconnect();
308
308
  };
309
- }, [u]);
310
- const x = G(() => n === "ARCBLOCK" ? [
311
- {
312
- type: "Group",
313
- label: o("groups.applications"),
314
- children: [
315
- {
316
- label: /* @__PURE__ */ e(t, { to: `https://www.nftstudio.rocks/${i}`, children: "NFT Studio" }),
317
- description: o("products.nftStudio.description"),
318
- icon: /* @__PURE__ */ e(M, {})
319
- },
309
+ }, [m]);
310
+ const x = G(() => {
311
+ if (c === "ARCBLOCK")
312
+ return [
320
313
  {
321
- label: /* @__PURE__ */ e(
322
- p,
314
+ type: "Group",
315
+ label: o("groups.applications"),
316
+ children: [
317
+ {
318
+ label: /* @__PURE__ */ e(t, { to: `https://www.nftstudio.rocks/${i}`, children: "NFT Studio" }),
319
+ description: o("products.nftStudio.description"),
320
+ icon: /* @__PURE__ */ e(_, {})
321
+ },
322
+ {
323
+ label: /* @__PURE__ */ e(
324
+ p,
325
+ {
326
+ to: `https://www.arcblock.io/content/collections/${i}/creator-studio`,
327
+ target: "_blank",
328
+ rel: "noreferrer noopener",
329
+ children: "Creator Studio"
330
+ }
331
+ ),
332
+ description: o("products.creatorStudio.description"),
333
+ icon: /* @__PURE__ */ e(M, {})
334
+ },
335
+ {
336
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/", children: "AIGNE" }),
337
+ description: o("products.aigne.description"),
338
+ icon: /* @__PURE__ */ e(d, { color: g.mode === "dark" ? "white" : "black" })
339
+ },
323
340
  {
324
- to: `https://www.arcblock.io/content/collections/${i}/creator-studio`,
325
- target: "_blank",
326
- rel: "noreferrer noopener",
327
- children: "Creator Studio"
341
+ label: /* @__PURE__ */ e(t, { to: `https://www.arcsphere.io/${i}`, children: "ArcSphere" }),
342
+ description: o("products.arcsphere.description"),
343
+ icon: /* @__PURE__ */ e(v, {})
328
344
  }
329
- ),
330
- description: o("products.creatorStudio.description"),
331
- icon: /* @__PURE__ */ e(_, {})
332
- },
333
- {
334
- label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/", children: "AIGNE" }),
335
- description: o("products.aigne.description"),
336
- icon: /* @__PURE__ */ e(d, { color: g.mode === "dark" ? "white" : "black" })
337
- },
338
- {
339
- label: /* @__PURE__ */ e(t, { to: `https://www.arcsphere.io/${i}`, children: "ArcSphere" }),
340
- description: o("products.arcsphere.description"),
341
- icon: /* @__PURE__ */ e(v, {})
342
- }
343
- ]
344
- },
345
- {
346
- type: "Group",
347
- label: o("groups.components"),
348
- children: [
349
- {
350
- label: /* @__PURE__ */ e(t, { to: `https://launcher.arcblock.io/${i}`, children: "Blocklet Launcher" }),
351
- description: o("products.blockletLauncher.description"),
352
- icon: /* @__PURE__ */ e(O, {})
345
+ ]
353
346
  },
354
347
  {
355
- label: /* @__PURE__ */ e(t, { to: `https://www.blocklet.io/${i}/payment-kit`, children: "Payment Kit" }),
356
- description: o("products.paymentKit.description"),
357
- icon: /* @__PURE__ */ e("img", { src: Q, alt: "Payment Kit" })
358
- },
359
- {
360
- label: /* @__PURE__ */ e(t, { to: `https://store.blocklet.dev/?locale=${i}`, children: "Blocklet Store" }),
361
- description: o("products.blockletStore.description"),
362
- icon: /* @__PURE__ */ e(P, {})
363
- },
364
- {
365
- label: /* @__PURE__ */ e(t, { to: `https://www.web3kit.rocks/${i}`, children: "Web3 Kit" }),
366
- description: o("products.web3Kit.description"),
367
- icon: /* @__PURE__ */ e(R, {})
368
- }
369
- ]
370
- },
371
- {
372
- type: "Group",
373
- label: o("groups.computeStorage"),
374
- children: [
375
- {
376
- label: /* @__PURE__ */ e(
377
- p,
348
+ type: "Group",
349
+ label: o("groups.components"),
350
+ children: [
378
351
  {
379
- to: `https://www.arcblock.io/content/collections/${i}/blocklet`,
380
- target: "_blank",
381
- rel: "noreferrer noopener",
382
- children: "Blocklet Framework"
352
+ label: /* @__PURE__ */ e(t, { to: `https://launcher.arcblock.io/${i}`, children: "Blocklet Launcher" }),
353
+ description: o("products.blockletLauncher.description"),
354
+ icon: /* @__PURE__ */ e(O, {})
355
+ },
356
+ {
357
+ label: /* @__PURE__ */ e(t, { to: `https://www.blocklet.io/${i}/payment-kit`, children: "Payment Kit" }),
358
+ description: o("products.paymentKit.description"),
359
+ icon: /* @__PURE__ */ e("img", { src: Q, alt: "Payment Kit" })
360
+ },
361
+ {
362
+ label: /* @__PURE__ */ e(t, { to: `https://store.blocklet.dev/?locale=${i}`, children: "Blocklet Store" }),
363
+ description: o("products.blockletStore.description"),
364
+ icon: /* @__PURE__ */ e(P, {})
365
+ },
366
+ {
367
+ label: /* @__PURE__ */ e(t, { to: `https://www.web3kit.rocks/${i}`, children: "Web3 Kit" }),
368
+ description: o("products.web3Kit.description"),
369
+ icon: /* @__PURE__ */ e(R, {})
383
370
  }
384
- ),
385
- description: o("products.blockletFramework.description"),
386
- icon: /* @__PURE__ */ e(H, {})
387
- },
388
- {
389
- label: /* @__PURE__ */ e(p, { to: `https://www.didspaces.com/${i}`, target: "_blank", rel: "noreferrer noopener", children: "DID Spaces" }),
390
- description: o("products.didSpaces.description"),
391
- icon: /* @__PURE__ */ e(m, { color: "#876bf4" })
392
- },
393
- {
394
- label: /* @__PURE__ */ e(p, { to: "https://main.abtnetwork.io/", target: "_blank", rel: "noreferrer noopener", children: "ABT Network" }),
395
- description: o("products.abtNetwork.description"),
396
- icon: /* @__PURE__ */ e(z, {})
397
- },
398
- {
399
- label: /* @__PURE__ */ e(t, { to: `https://www.blocklet.io/${i}/blocklet-server`, children: "Blocklet Server" }),
400
- description: o("products.blockletServer.description"),
401
- icon: /* @__PURE__ */ e(V, {})
402
- },
403
- {
404
- label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${i}/ocap`, children: "ОСАР" }),
405
- description: o("products.ocap.description"),
406
- icon: /* @__PURE__ */ e(j, {})
407
- }
408
- ]
409
- },
410
- {
411
- type: "Group",
412
- label: o("groups.identity"),
413
- children: [
414
- {
415
- label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${i}/did`, children: "DID" }),
416
- description: o("products.did.description"),
417
- icon: /* @__PURE__ */ e(m, { color: "#5b96f3" })
418
- },
419
- {
420
- label: /* @__PURE__ */ e(t, { to: `https://www.didwallet.io/${i}`, children: "DID Wallet" }),
421
- description: o("products.didWallet.description"),
422
- icon: /* @__PURE__ */ e(U, {})
423
- },
424
- {
425
- label: /* @__PURE__ */ e(p, { to: `https://www.didnames.io/${i}`, target: "_blank", rel: "noreferrer noopener", children: "DID Names" }),
426
- description: o("products.didNameService.description"),
427
- icon: /* @__PURE__ */ e(m, { color: "#678ab0" })
428
- },
429
- {
430
- label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${i}/verifiable-credential`, children: "VC" }),
431
- description: o("products.vc.description"),
432
- icon: /* @__PURE__ */ e(J, {})
371
+ ]
433
372
  },
434
373
  {
435
- label: /* @__PURE__ */ e(t, { to: `https://www.didconnect.io/${i}`, children: "DID Connect" }),
436
- description: o("products.didConnect.description"),
437
- icon: /* @__PURE__ */ e(m, { color: "#5bbec5" })
438
- }
439
- ]
440
- }
441
- ] : n === "AIGNE" ? [
442
- {
443
- type: "Group",
444
- label: o("groups.applications"),
445
- children: [
446
- {
447
- label: /* @__PURE__ */ e(t, { to: `https://www.arcsphere.io/${i}`, children: "ArcSphere" }),
448
- description: o("products.arcsphere.description"),
449
- icon: /* @__PURE__ */ e(v, {})
450
- },
451
- {
452
- label: /* @__PURE__ */ e(t, { to: `https://www.aistro.io/${i}`, children: "Aistro" }),
453
- description: o("products.aistro.description"),
454
- icon: /* @__PURE__ */ e("img", { src: Y, alt: "Aistro" })
455
- },
456
- {
457
- label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/doc-smith", children: "AIGNE CodeSmith" }),
458
- description: o("products.aigneCodeSmith.description"),
459
- icon: /* @__PURE__ */ e(d, { color: "#56a596", backgroundColor: "#e9fcf6" })
460
- },
461
- {
462
- label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/code-smith", children: "AIGNE DocSmith" }),
463
- description: o("products.aigneDocSmith.description"),
464
- icon: /* @__PURE__ */ e(d, { color: "#e46f38", backgroundColor: "#f7e0d7" })
374
+ type: "Group",
375
+ label: o("groups.computeStorage"),
376
+ children: [
377
+ {
378
+ label: /* @__PURE__ */ e(
379
+ p,
380
+ {
381
+ to: `https://www.arcblock.io/content/collections/${i}/blocklet`,
382
+ target: "_blank",
383
+ rel: "noreferrer noopener",
384
+ children: "Blocklet Framework"
385
+ }
386
+ ),
387
+ description: o("products.blockletFramework.description"),
388
+ icon: /* @__PURE__ */ e(H, {})
389
+ },
390
+ {
391
+ label: /* @__PURE__ */ e(p, { to: `https://www.didspaces.com/${i}`, target: "_blank", rel: "noreferrer noopener", children: "DID Spaces" }),
392
+ description: o("products.didSpaces.description"),
393
+ icon: /* @__PURE__ */ e(b, { color: "#876bf4" })
394
+ },
395
+ {
396
+ label: /* @__PURE__ */ e(p, { to: "https://main.abtnetwork.io/", target: "_blank", rel: "noreferrer noopener", children: "ABT Network" }),
397
+ description: o("products.abtNetwork.description"),
398
+ icon: /* @__PURE__ */ e(z, {})
399
+ },
400
+ {
401
+ label: /* @__PURE__ */ e(t, { to: `https://www.blocklet.io/${i}/blocklet-server`, children: "Blocklet Server" }),
402
+ description: o("products.blockletServer.description"),
403
+ icon: /* @__PURE__ */ e(V, {})
404
+ },
405
+ {
406
+ label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${i}/ocap`, children: "ОСАР" }),
407
+ description: o("products.ocap.description"),
408
+ icon: /* @__PURE__ */ e(j, {})
409
+ }
410
+ ]
465
411
  },
466
412
  {
467
- label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/web-smith", children: "AIGNE WebSmith" }),
468
- description: o("products.aigneWebSmith.description"),
469
- icon: /* @__PURE__ */ e(d, { color: "#7c45eb", backgroundColor: "#f0e9ff" })
413
+ type: "Group",
414
+ label: o("groups.identity"),
415
+ children: [
416
+ {
417
+ label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${i}/did`, children: "DID" }),
418
+ description: o("products.did.description"),
419
+ icon: /* @__PURE__ */ e(b, { color: "#5b96f3" })
420
+ },
421
+ {
422
+ label: /* @__PURE__ */ e(t, { to: `https://www.didwallet.io/${i}`, children: "DID Wallet" }),
423
+ description: o("products.didWallet.description"),
424
+ icon: /* @__PURE__ */ e(U, {})
425
+ },
426
+ {
427
+ label: /* @__PURE__ */ e(p, { to: `https://www.didnames.io/${i}`, target: "_blank", rel: "noreferrer noopener", children: "DID Names" }),
428
+ description: o("products.didNameService.description"),
429
+ icon: /* @__PURE__ */ e(b, { color: "#678ab0" })
430
+ },
431
+ {
432
+ label: /* @__PURE__ */ e(t, { to: `https://www.arcblock.io/content/collections/${i}/verifiable-credential`, children: "VC" }),
433
+ description: o("products.vc.description"),
434
+ icon: /* @__PURE__ */ e(J, {})
435
+ },
436
+ {
437
+ label: /* @__PURE__ */ e(t, { to: `https://www.didconnect.io/${i}`, children: "DID Connect" }),
438
+ description: o("products.didConnect.description"),
439
+ icon: /* @__PURE__ */ e(b, { color: "#5bbec5" })
440
+ }
441
+ ]
470
442
  }
471
- ]
472
- },
473
- {
474
- type: "Group",
475
- label: o("groups.frameworkTools"),
476
- children: [
477
- {
478
- label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/cli", children: "AIGNE CLI" }),
479
- description: o("products.aigneCLI.description"),
480
- icon: /* @__PURE__ */ e(d, { color: "#d05d4e", backgroundColor: "#faeaea" })
481
- },
443
+ ];
444
+ if (c === "AIGNE") {
445
+ const n = {
446
+ target: "_blank",
447
+ rel: "noreferrer noopener"
448
+ };
449
+ return [
482
450
  {
483
- label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/observability", children: "AIGNE Observability" }),
484
- description: o("products.aigneObservability.description"),
485
- icon: /* @__PURE__ */ e(d, { color: "#6ba456", backgroundColor: "#edfae8" })
451
+ type: "Group",
452
+ label: o("groups.applications"),
453
+ children: [
454
+ {
455
+ label: /* @__PURE__ */ e(t, { to: `https://www.arcsphere.io/${i}`, children: "ArcSphere" }),
456
+ description: o("products.arcsphere.description"),
457
+ icon: /* @__PURE__ */ e(v, {})
458
+ },
459
+ {
460
+ label: /* @__PURE__ */ e(t, { to: `https://www.aistro.io/${i}`, children: "Aistro" }),
461
+ description: o("products.aistro.description"),
462
+ icon: /* @__PURE__ */ e("img", { src: Y, alt: "Aistro" })
463
+ },
464
+ {
465
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/doc-smith", ...n, children: "AIGNE CodeSmith" }),
466
+ description: o("products.aigneCodeSmith.description"),
467
+ icon: /* @__PURE__ */ e(d, { color: "#56a596", backgroundColor: "#e9fcf6" })
468
+ },
469
+ {
470
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/code-smith", ...n, children: "AIGNE DocSmith" }),
471
+ description: o("products.aigneDocSmith.description"),
472
+ icon: /* @__PURE__ */ e(d, { color: "#e46f38", backgroundColor: "#f7e0d7" })
473
+ },
474
+ {
475
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/web-smith", ...n, children: "AIGNE WebSmith" }),
476
+ description: o("products.aigneWebSmith.description"),
477
+ icon: /* @__PURE__ */ e(d, { color: "#7c45eb", backgroundColor: "#f0e9ff" })
478
+ }
479
+ ]
486
480
  },
487
481
  {
488
- label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/studio", children: "AIGNE Studio" }),
489
- description: o("products.aigneStudio.description"),
490
- icon: /* @__PURE__ */ e(d, { color: "#676cbf", backgroundColor: "#edeeff" })
482
+ type: "Group",
483
+ label: o("groups.frameworkTools"),
484
+ children: [
485
+ {
486
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/cli", ...n, children: "AIGNE CLI" }),
487
+ description: o("products.aigneCLI.description"),
488
+ icon: /* @__PURE__ */ e(d, { color: "#d05d4e", backgroundColor: "#faeaea" })
489
+ },
490
+ {
491
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/observability", ...n, children: "AIGNE Observability" }),
492
+ description: o("products.aigneObservability.description"),
493
+ icon: /* @__PURE__ */ e(d, { color: "#6ba456", backgroundColor: "#edfae8" })
494
+ },
495
+ {
496
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/studio", ...n, children: "AIGNE Studio" }),
497
+ description: o("products.aigneStudio.description"),
498
+ icon: /* @__PURE__ */ e(d, { color: "#676cbf", backgroundColor: "#edeeff" })
499
+ },
500
+ {
501
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/framework", ...n, children: "AIGNE Framework" }),
502
+ description: o("products.aigneFramework.description"),
503
+ icon: /* @__PURE__ */ e(d, { color: "#5086d0", backgroundColor: "#eef4ff" })
504
+ }
505
+ ]
491
506
  },
492
507
  {
493
- label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/framework", children: "AIGNE Framework" }),
494
- description: o("products.aigneFramework.description"),
495
- icon: /* @__PURE__ */ e(d, { color: "#5086d0", backgroundColor: "#eef4ff" })
496
- }
497
- ]
498
- },
499
- {
500
- type: "Group",
501
- label: o("groups.modelsAdapters"),
502
- children: [
503
- {
504
- label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/hub", children: "AIGNE Hub" }),
505
- description: o("products.aigneHub.description"),
506
- icon: /* @__PURE__ */ e(d, { color: "#e4930b", backgroundColor: "#fbf4d4" })
508
+ type: "Group",
509
+ label: o("groups.modelsAdapters"),
510
+ children: [
511
+ {
512
+ label: /* @__PURE__ */ e(t, { to: "https://www.aigne.io/hub", ...n, children: "AIGNE Hub" }),
513
+ description: o("products.aigneHub.description"),
514
+ icon: /* @__PURE__ */ e(d, { color: "#e4930b", backgroundColor: "#fbf4d4" })
515
+ }
516
+ ]
507
517
  }
508
- ]
518
+ ];
509
519
  }
510
- ] : [], [o, i, g]);
511
- return /* @__PURE__ */ e(ee, { ref: a, className: `nav-menu-products is-${w} ${r}`, ...l, children: x.map((c) => /* @__PURE__ */ e(B, { label: c.label, children: /* @__PURE__ */ e(oe, { maxContent: y, children: c.children.map((s) => /* @__PURE__ */ e(T, { variant: "panel", style: { padding: "8px" }, ...s })) }) }, c.label)) });
520
+ 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)) });
512
523
  }
513
524
  export {
514
525
  $e as default
@@ -7,7 +7,7 @@ function s(e = window.blocklet) {
7
7
  return (e?.settings?.federated || {}).config;
8
8
  }
9
9
  function d(e = window.blocklet) {
10
- return i(e).appPid === e.appPid ? !1 : s(e)?.status === "approved";
10
+ return !e || i(e).appPid === e.appPid ? !1 : s(e)?.status === "approved";
11
11
  }
12
12
  function w(e = window.blocklet) {
13
13
  return i(e)?.appPid;
@@ -59,7 +59,7 @@ function g(e) {
59
59
  const p = [], r = c(e), t = u(e), n = d(e);
60
60
  return t && p.push(t), r && r?.appId !== t?.appId && n && p.push(r), p.reverse();
61
61
  }
62
- async function l(e, p = !1) {
62
+ async function m(e, p = !1) {
63
63
  if (!p && a[e])
64
64
  return a[e];
65
65
  try {
@@ -73,7 +73,7 @@ async function l(e, p = !1) {
73
73
  }
74
74
  export {
75
75
  g as getApps,
76
- l as getBlockletData,
76
+ m as getBlockletData,
77
77
  s as getConfig,
78
78
  u as getCurrentApp,
79
79
  c as getFederatedApp,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "3.1.12",
3
+ "version": "3.1.14",
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": "0cb1a641693d3f3c1ac105d8117365f289d9e5c2",
69
+ "gitHead": "8dce20e08f2dc02559df0a0abb27c63ca25e2a73",
70
70
  "dependencies": {
71
- "@arcblock/bridge": "3.1.12",
71
+ "@arcblock/bridge": "3.1.14",
72
72
  "@arcblock/did": "^1.21.3",
73
73
  "@arcblock/did-motif": "^1.1.14",
74
- "@arcblock/icons": "3.1.12",
75
- "@arcblock/nft-display": "3.1.12",
76
- "@arcblock/react-hooks": "3.1.12",
74
+ "@arcblock/icons": "3.1.14",
75
+ "@arcblock/nft-display": "3.1.14",
76
+ "@arcblock/react-hooks": "3.1.14",
77
77
  "@blocklet/js-sdk": "^1.16.48",
78
- "@blocklet/theme": "3.1.12",
78
+ "@blocklet/theme": "3.1.14",
79
79
  "@fontsource/roboto": "~5.1.1",
80
80
  "@fontsource/ubuntu-mono": "^5.2.6",
81
81
  "@iconify-icons/logos": "^1.2.36",
@@ -1,5 +1,5 @@
1
1
  import { useRef, useEffect, useState } from 'react';
2
- import { Link } from 'react-router-dom';
2
+ import { Link, LinkProps } from 'react-router-dom';
3
3
  import { useCreation, useMemoizedFn } from 'ahooks';
4
4
  import { Box, BoxProps, useTheme } from '@mui/material';
5
5
  import SubItemGroup from './sub-item-group';
@@ -302,12 +302,12 @@ function AigneIcon({ color = 'black', backgroundColor = 'transparent' }: { color
302
302
  }
303
303
 
304
304
  // 智能 Link 组件,根据 URL origin 决定是否在新标签页打开
305
- interface SmartLinkProps {
305
+ interface SmartLinkProps extends LinkProps {
306
306
  to: string;
307
307
  children: React.ReactNode;
308
308
  className?: string;
309
309
  }
310
- function SmartLink({ to, children, className = '' }: SmartLinkProps) {
310
+ function SmartLink({ to, children, className = '', ...restProps }: SmartLinkProps) {
311
311
  const isExternal = () => {
312
312
  try {
313
313
  const url = new URL(to);
@@ -320,14 +320,14 @@ function SmartLink({ to, children, className = '' }: SmartLinkProps) {
320
320
 
321
321
  if (isExternal()) {
322
322
  return (
323
- <Link to={to} target="_blank" rel="noreferrer noopener" className={className}>
323
+ <Link to={to} target="_blank" rel="noreferrer noopener" className={className} {...restProps}>
324
324
  {children}
325
325
  </Link>
326
326
  );
327
327
  }
328
328
 
329
329
  return (
330
- <Link to={to} className={className}>
330
+ <Link to={to} className={className} {...restProps}>
331
331
  {children}
332
332
  </Link>
333
333
  );
@@ -542,6 +542,12 @@ export default function Products({ className = '', type, ...rest }: ProductsProp
542
542
  }
543
543
 
544
544
  if (type === 'AIGNE') {
545
+ // aigne 相关页面,不能使用 react dom 自己的 navigate 跳转,因为没有对应的页面数据
546
+ const aigneLinkBaseProps = {
547
+ target: '_blank',
548
+ rel: 'noreferrer noopener',
549
+ };
550
+
545
551
  return [
546
552
  {
547
553
  type: 'Group',
@@ -558,17 +564,29 @@ export default function Products({ className = '', type, ...rest }: ProductsProp
558
564
  icon: <img src={AistroPng} alt="Aistro" />,
559
565
  },
560
566
  {
561
- label: <SmartLink to="https://www.aigne.io/doc-smith">AIGNE CodeSmith</SmartLink>,
567
+ label: (
568
+ <SmartLink to="https://www.aigne.io/doc-smith" {...aigneLinkBaseProps}>
569
+ AIGNE CodeSmith
570
+ </SmartLink>
571
+ ),
562
572
  description: t('products.aigneCodeSmith.description'),
563
573
  icon: <AigneIcon color="#56a596" backgroundColor="#e9fcf6" />,
564
574
  },
565
575
  {
566
- label: <SmartLink to="https://www.aigne.io/code-smith">AIGNE DocSmith</SmartLink>,
576
+ label: (
577
+ <SmartLink to="https://www.aigne.io/code-smith" {...aigneLinkBaseProps}>
578
+ AIGNE DocSmith
579
+ </SmartLink>
580
+ ),
567
581
  description: t('products.aigneDocSmith.description'),
568
582
  icon: <AigneIcon color="#e46f38" backgroundColor="#f7e0d7" />,
569
583
  },
570
584
  {
571
- label: <SmartLink to="https://www.aigne.io/web-smith">AIGNE WebSmith</SmartLink>,
585
+ label: (
586
+ <SmartLink to="https://www.aigne.io/web-smith" {...aigneLinkBaseProps}>
587
+ AIGNE WebSmith
588
+ </SmartLink>
589
+ ),
572
590
  description: t('products.aigneWebSmith.description'),
573
591
  icon: <AigneIcon color="#7c45eb" backgroundColor="#f0e9ff" />,
574
592
  },
@@ -579,22 +597,38 @@ export default function Products({ className = '', type, ...rest }: ProductsProp
579
597
  label: t('groups.frameworkTools'),
580
598
  children: [
581
599
  {
582
- label: <SmartLink to="https://www.aigne.io/cli">AIGNE CLI</SmartLink>,
600
+ label: (
601
+ <SmartLink to="https://www.aigne.io/cli" {...aigneLinkBaseProps}>
602
+ AIGNE CLI
603
+ </SmartLink>
604
+ ),
583
605
  description: t('products.aigneCLI.description'),
584
606
  icon: <AigneIcon color="#d05d4e" backgroundColor="#faeaea" />,
585
607
  },
586
608
  {
587
- label: <SmartLink to="https://www.aigne.io/observability">AIGNE Observability</SmartLink>,
609
+ label: (
610
+ <SmartLink to="https://www.aigne.io/observability" {...aigneLinkBaseProps}>
611
+ AIGNE Observability
612
+ </SmartLink>
613
+ ),
588
614
  description: t('products.aigneObservability.description'),
589
615
  icon: <AigneIcon color="#6ba456" backgroundColor="#edfae8" />,
590
616
  },
591
617
  {
592
- label: <SmartLink to="https://www.aigne.io/studio">AIGNE Studio</SmartLink>,
618
+ label: (
619
+ <SmartLink to="https://www.aigne.io/studio" {...aigneLinkBaseProps}>
620
+ AIGNE Studio
621
+ </SmartLink>
622
+ ),
593
623
  description: t('products.aigneStudio.description'),
594
624
  icon: <AigneIcon color="#676cbf" backgroundColor="#edeeff" />,
595
625
  },
596
626
  {
597
- label: <SmartLink to="https://www.aigne.io/framework">AIGNE Framework</SmartLink>,
627
+ label: (
628
+ <SmartLink to="https://www.aigne.io/framework" {...aigneLinkBaseProps}>
629
+ AIGNE Framework
630
+ </SmartLink>
631
+ ),
598
632
  description: t('products.aigneFramework.description'),
599
633
  icon: <AigneIcon color="#5086d0" backgroundColor="#eef4ff" />,
600
634
  },
@@ -605,7 +639,11 @@ export default function Products({ className = '', type, ...rest }: ProductsProp
605
639
  label: t('groups.modelsAdapters'),
606
640
  children: [
607
641
  {
608
- label: <SmartLink to="https://www.aigne.io/hub">AIGNE Hub</SmartLink>,
642
+ label: (
643
+ <SmartLink to="https://www.aigne.io/hub" {...aigneLinkBaseProps}>
644
+ AIGNE Hub
645
+ </SmartLink>
646
+ ),
609
647
  description: t('products.aigneHub.description'),
610
648
  icon: <AigneIcon color="#e4930b" backgroundColor="#fbf4d4" />,
611
649
  },
@@ -13,6 +13,10 @@ export function getConfig(blocklet = window.blocklet) {
13
13
  }
14
14
 
15
15
  export function getFederatedEnabled(blocklet = window.blocklet) {
16
+ // 适用于 webapp 下
17
+ if (!blocklet) {
18
+ return false;
19
+ }
16
20
  const master = getMaster(blocklet);
17
21
  // 如果当前应用是 master,则代表未开启统一登录
18
22
  if (master.appPid === blocklet.appPid) {