@abtnode/ux 1.16.29-beta-87e06e1c → 1.16.29-beta-2eaf40bc

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.
@@ -320,6 +320,9 @@ export const StyledBadge = styled(Badge)`
320
320
  }
321
321
  `;
322
322
  export const StyledComponentRow = styled(Box)`
323
+ &:hover {
324
+ background-color: rgba(0, 0, 0, 0.05);
325
+ }
323
326
  .component-header {
324
327
  display: flex;
325
328
  align-items: center;
@@ -1,7 +1,8 @@
1
1
  import Button from '@arcblock/ux/lib/Button';
2
2
  import styled from '@emotion/styled';
3
3
  import PropTypes from 'prop-types';
4
- import React, { Fragment, useMemo, useState } from 'react';
4
+ import trim from 'lodash/trim';
5
+ import React, { Fragment, useCallback, useMemo, useState } from 'react';
5
6
  import AddIcon from '@mui/icons-material/Add';
6
7
  import DiamondIcon from '@mui/icons-material/Diamond';
7
8
  import ExpandLess from '@mui/icons-material/ExpandLess';
@@ -16,13 +17,14 @@ import Tooltip from '@mui/material/Tooltip';
16
17
  import Typography from '@mui/material/Typography';
17
18
  import useTheme from '@mui/material/styles/useTheme';
18
19
  import useMediaQuery from '@mui/material/useMediaQuery';
20
+ import Spinner from '@mui/material/CircularProgress';
19
21
  import { encode as encodeBase32 } from '@abtnode/util/lib/base32';
20
22
  import { isDidDomain } from '@abtnode/util/lib/url-evaluation';
21
23
  import LockIcon from '@arcblock/icons/lib/LockIcon';
22
24
  import Empty from '@arcblock/ux/lib/Empty';
23
25
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
24
26
  import { isAccessible, isInProgress } from '@blocklet/meta/lib/util';
25
- import Spinner from '@mui/material/CircularProgress';
27
+ import { CopyButton } from '@arcblock/ux/lib/ClickToCopy';
26
28
  import { useBlockletContext } from '../../contexts/blocklet';
27
29
  import { useNodeContext } from '../../contexts/node';
28
30
  import DidAddress from '../../did-address';
@@ -278,16 +280,30 @@ function DomainLink({
278
280
  ...rest
279
281
  }) {
280
282
  const {
281
- t
283
+ t,
284
+ locale
282
285
  } = useLocaleContext();
283
286
  const {
284
287
  href,
285
- accessibility
288
+ accessibility,
289
+ value: domainValue
286
290
  } = domain;
291
+ const renderCopyButton = useCallback(() => {
292
+ return /*#__PURE__*/_jsx(CopyButton, {
293
+ content: trim(domainValue),
294
+ locale: locale,
295
+ style: {
296
+ marginLeft: '4px',
297
+ color: '#999',
298
+ fontSize: '0.8em',
299
+ verticalAlign: 'bottom'
300
+ }
301
+ });
302
+ }, [domainValue, locale]);
287
303
  if (!accessibility || accessibility.loading) {
288
304
  return /*#__PURE__*/_jsxs(LinkDiv, {
289
305
  ...rest,
290
- children: [children, /*#__PURE__*/_jsx(Tooltip, {
306
+ children: [children, renderCopyButton(), /*#__PURE__*/_jsx(Tooltip, {
291
307
  title: t('blocklet.router.checkUrlAccessible'),
292
308
  placement: "top-end",
293
309
  children: /*#__PURE__*/_jsx("span", {
@@ -300,25 +316,26 @@ function DomainLink({
300
316
  });
301
317
  }
302
318
  if (!accessibility.accessible) {
303
- return /*#__PURE__*/_jsx(LinkDiv, {
319
+ return /*#__PURE__*/_jsxs(LinkDiv, {
304
320
  ...rest,
305
- children: /*#__PURE__*/_jsx(Tooltip, {
321
+ children: [/*#__PURE__*/_jsx(Tooltip, {
306
322
  title: t('blocklet.router.urlInaccessible'),
307
323
  placement: "top-end",
308
324
  children: /*#__PURE__*/_jsx("span", {
309
325
  children: children
310
326
  })
311
- })
327
+ }), renderCopyButton()]
312
328
  });
313
329
  }
314
- return /*#__PURE__*/_jsx(LinkDiv, {
330
+ return /*#__PURE__*/_jsxs(LinkDiv, {
315
331
  ...rest,
316
- children: /*#__PURE__*/_jsx("a", {
332
+ children: [/*#__PURE__*/_jsx(Box, {
333
+ component: "a",
317
334
  href: href,
318
335
  target: "_blank",
319
336
  rel: "noopener noreferrer",
320
337
  children: children
321
- })
338
+ }), renderCopyButton()]
322
339
  });
323
340
  }
324
341
  DomainLink.propTypes = {
@@ -330,6 +347,9 @@ const LinkDiv = styled.span`
330
347
  & > * {
331
348
  color: #222;
332
349
  font-size: 18px;
350
+ }
351
+
352
+ & > * {
333
353
  word-break: break-all;
334
354
  }
335
355
 
@@ -409,6 +429,7 @@ function InnerAddDomain({
409
429
  onMouseEnter: handlePopoverOpen,
410
430
  onMouseLeave: handlePopoverClose,
411
431
  style: {
432
+ marginTop: '0.2em',
412
433
  cursor: 'pointer',
413
434
  fill: theme.palette.primary.main
414
435
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abtnode/ux",
3
- "version": "1.16.29-beta-87e06e1c",
3
+ "version": "1.16.29-beta-2eaf40bc",
4
4
  "description": "UX components shared across abtnode packages",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -25,24 +25,24 @@
25
25
  "author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
26
26
  "license": "Apache-2.0",
27
27
  "dependencies": {
28
- "@abtnode/auth": "1.16.29-beta-87e06e1c",
29
- "@abtnode/constant": "1.16.29-beta-87e06e1c",
30
- "@abtnode/util": "1.16.29-beta-87e06e1c",
28
+ "@abtnode/auth": "1.16.29-beta-2eaf40bc",
29
+ "@abtnode/constant": "1.16.29-beta-2eaf40bc",
30
+ "@abtnode/util": "1.16.29-beta-2eaf40bc",
31
31
  "@ahooksjs/use-url-state": "^3.5.1",
32
32
  "@arcblock/did": "^1.18.126",
33
- "@arcblock/did-connect": "^2.10.3",
33
+ "@arcblock/did-connect": "^2.10.5",
34
34
  "@arcblock/did-motif": "^1.1.13",
35
- "@arcblock/icons": "^2.10.3",
36
- "@arcblock/nft-display": "2.10.3",
37
- "@arcblock/react-hooks": "^2.10.3",
38
- "@arcblock/terminal": "^2.10.3",
39
- "@arcblock/ux": "^2.10.3",
40
- "@blocklet/constant": "1.16.29-beta-87e06e1c",
41
- "@blocklet/js-sdk": "1.16.29-beta-87e06e1c",
42
- "@blocklet/launcher-layout": "2.3.28",
43
- "@blocklet/list": "^0.13.8",
44
- "@blocklet/meta": "1.16.29-beta-87e06e1c",
45
- "@blocklet/ui-react": "^2.10.3",
35
+ "@arcblock/icons": "^2.10.5",
36
+ "@arcblock/nft-display": "2.10.5",
37
+ "@arcblock/react-hooks": "^2.10.5",
38
+ "@arcblock/terminal": "^2.10.5",
39
+ "@arcblock/ux": "^2.10.5",
40
+ "@blocklet/constant": "1.16.29-beta-2eaf40bc",
41
+ "@blocklet/js-sdk": "1.16.29-beta-2eaf40bc",
42
+ "@blocklet/launcher-layout": "2.3.30",
43
+ "@blocklet/list": "^0.13.9",
44
+ "@blocklet/meta": "1.16.29-beta-2eaf40bc",
45
+ "@blocklet/ui-react": "^2.10.5",
46
46
  "@blocklet/uploader": "0.1.19",
47
47
  "@emotion/react": "^11.10.4",
48
48
  "@emotion/styled": "^11.10.4",
@@ -108,5 +108,5 @@
108
108
  "jest": "^29.7.0",
109
109
  "jest-environment-jsdom": "^29.7.0"
110
110
  },
111
- "gitHead": "e6a32801bc392566448d4df00c2ae68717f39822"
111
+ "gitHead": "d723d07ca8914468fc1b53af23aa53dc343e0a8c"
112
112
  }