@arcblock/ux 2.13.60 → 2.13.61

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.
@@ -8,7 +8,7 @@ export type CurrentAppInfo = {
8
8
  appName: string;
9
9
  appUrl: string;
10
10
  };
11
- export default function AuthApps({ requestAppInfo, currentAppInfo, }: {
11
+ export default function AuthAppsInfo({ requestAppInfo, currentAppInfo, }: {
12
12
  requestAppInfo: RequestAppInfo;
13
13
  currentAppInfo: CurrentAppInfo;
14
14
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, Typography } from '@mui/material';
3
3
  import Img from '../../Img';
4
- export default function AuthApps({
4
+ export default function AuthAppsInfo({
5
5
  requestAppInfo,
6
6
  currentAppInfo
7
7
  }) {
@@ -1,9 +1,10 @@
1
+ import { BoxProps } from '@mui/material';
1
2
  import type { UserPublicInfo } from '@blocklet/js-sdk';
2
3
  import { type RequestAppInfo, type CurrentAppInfo } from './auth-apps-info';
3
4
  /**
4
5
  * @example app/connect-to-did-space?appPid=zNKp8tdZUanWKnvhwZWvF2hKRutwM9ykLaY8&appDid=zNKp8tdZUanWKnvhwZWvF2hKRutwM9ykLaY8&appName=233&appDescription=456&appUrl=https://bbqaw5mgxc6fnihrwqcejcxvukkdgkk4anwxwk5msvm.did.abtnet.io/zh
5
6
  */
6
- export default function AuthApps({ session, requestAppInfo, currentAppInfo, children, userInfo, hideSwitchConnect, hideAuthorize, hideCancel, notThisText, authorizeText, connectText, cancelText, useAnotherText, onConnect, onAuthorize, onSwitchConnect, onCancel, }: {
7
+ export default function AuthApps({ session, requestAppInfo, currentAppInfo, children, userInfo, hideSwitchConnect, hideAuthorize, hideCancel, notThisText, authorizeText, connectText, cancelText, useAnotherText, slotProps, onConnect, onAuthorize, onSwitchConnect, onCancel, }: {
7
8
  session: any;
8
9
  requestAppInfo: RequestAppInfo;
9
10
  currentAppInfo: CurrentAppInfo;
@@ -17,6 +18,11 @@ export default function AuthApps({ session, requestAppInfo, currentAppInfo, chil
17
18
  connectText?: string;
18
19
  cancelText?: string;
19
20
  useAnotherText?: string;
21
+ slotProps?: {
22
+ root?: BoxProps;
23
+ didConnectContainer?: object;
24
+ contentContainer?: BoxProps;
25
+ };
20
26
  onConnect?: (done: () => void) => void;
21
27
  onAuthorize?: (done: () => void) => void;
22
28
  onSwitchConnect?: (done: () => void) => void;
@@ -10,6 +10,7 @@ import { translate } from '../../Locale/util';
10
10
  import { useLocaleContext } from '../../Locale/context';
11
11
  import UserCard from '../../UserCard';
12
12
  import { CardType, InfoType } from '../../UserCard/types';
13
+ import { mergeSx } from '../../Util/style';
13
14
  const translations = {
14
15
  en: {
15
16
  notThis: 'Not this?',
@@ -44,6 +45,7 @@ export default function AuthApps({
44
45
  connectText,
45
46
  cancelText,
46
47
  useAnotherText,
48
+ slotProps,
47
49
  onConnect = noop,
48
50
  onAuthorize = noop,
49
51
  onSwitchConnect = noop,
@@ -84,14 +86,17 @@ export default function AuthApps({
84
86
  did: window.blocklet?.appPid,
85
87
  standalone: true,
86
88
  children: /*#__PURE__*/_jsx(Box, {
87
- sx: {
89
+ ...slotProps?.root,
90
+ sx: mergeSx({
88
91
  width: 420,
89
92
  maxWidth: '100%'
90
- },
93
+ }, slotProps?.root?.sx),
91
94
  children: /*#__PURE__*/_jsx(DIDConnectContainer, {
92
95
  hideCloseButton: true,
96
+ ...slotProps?.didConnectContainer,
93
97
  children: /*#__PURE__*/_jsxs(Box, {
94
- sx: {
98
+ ...slotProps?.contentContainer,
99
+ sx: mergeSx({
95
100
  display: 'flex',
96
101
  flexDirection: 'column',
97
102
  gap: 1.5,
@@ -105,7 +110,7 @@ export default function AuthApps({
105
110
  xl: 4
106
111
  },
107
112
  bgcolor: 'background.paper'
108
- },
113
+ }, slotProps?.contentContainer?.sx),
109
114
  children: [/*#__PURE__*/_jsx(AuthAppsInfo, {
110
115
  requestAppInfo: requestAppInfo,
111
116
  currentAppInfo: currentAppInfo
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "2.13.60",
3
+ "version": "2.13.61",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -71,14 +71,14 @@
71
71
  "react": ">=18.2.0",
72
72
  "react-router-dom": ">=6.22.3"
73
73
  },
74
- "gitHead": "76eb26b12d8ccc1190e5fce847372babca7515c5",
74
+ "gitHead": "af211a24eb0d7f0b24a3e15b8d7acff49edd7494",
75
75
  "dependencies": {
76
76
  "@arcblock/did-motif": "^1.1.13",
77
- "@arcblock/icons": "^2.13.60",
78
- "@arcblock/nft-display": "^2.13.60",
79
- "@arcblock/react-hooks": "^2.13.60",
77
+ "@arcblock/icons": "^2.13.61",
78
+ "@arcblock/nft-display": "^2.13.61",
79
+ "@arcblock/react-hooks": "^2.13.61",
80
80
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
81
- "@blocklet/theme": "^2.13.60",
81
+ "@blocklet/theme": "^2.13.61",
82
82
  "@fontsource/roboto": "~5.1.1",
83
83
  "@fontsource/ubuntu-mono": "^5.0.18",
84
84
  "@iconify-icons/logos": "^1.2.36",
@@ -13,7 +13,7 @@ export type CurrentAppInfo = {
13
13
  appUrl: string;
14
14
  };
15
15
 
16
- export default function AuthApps({
16
+ export default function AuthAppsInfo({
17
17
  requestAppInfo,
18
18
  currentAppInfo,
19
19
  }: {
@@ -1,4 +1,4 @@
1
- import { Box, Button, CircularProgress, Link, Stack, Typography } from '@mui/material';
1
+ import { Box, BoxProps, Button, CircularProgress, Link, Stack, SxProps, Typography } from '@mui/material';
2
2
  import { useMemoizedFn, useReactive } from 'ahooks';
3
3
  import noop from 'lodash/noop';
4
4
  import type { UserPublicInfo } from '@blocklet/js-sdk';
@@ -11,6 +11,7 @@ import { translate } from '../../Locale/util';
11
11
  import { useLocaleContext } from '../../Locale/context';
12
12
  import UserCard from '../../UserCard';
13
13
  import { CardType, InfoType } from '../../UserCard/types';
14
+ import { mergeSx } from '../../Util/style';
14
15
 
15
16
  const translations = {
16
17
  en: {
@@ -49,6 +50,8 @@ export default function AuthApps({
49
50
  cancelText,
50
51
  useAnotherText,
51
52
 
53
+ slotProps,
54
+
52
55
  onConnect = noop,
53
56
  onAuthorize = noop,
54
57
  onSwitchConnect = noop,
@@ -70,6 +73,12 @@ export default function AuthApps({
70
73
  cancelText?: string;
71
74
  useAnotherText?: string;
72
75
 
76
+ slotProps?: {
77
+ root?: BoxProps;
78
+ didConnectContainer?: object;
79
+ contentContainer?: BoxProps;
80
+ };
81
+
73
82
  onConnect?: (done: () => void) => void;
74
83
  onAuthorize?: (done: () => void) => void;
75
84
  onSwitchConnect?: (done: () => void) => void;
@@ -114,27 +123,35 @@ export default function AuthApps({
114
123
  return (
115
124
  <LandingPage did={window.blocklet?.appPid} standalone>
116
125
  <Box
117
- sx={{
118
- width: 420,
119
- maxWidth: '100%',
120
- }}>
121
- <DIDConnectContainer hideCloseButton>
126
+ {...slotProps?.root}
127
+ sx={mergeSx(
128
+ {
129
+ width: 420,
130
+ maxWidth: '100%',
131
+ },
132
+ slotProps?.root?.sx as SxProps
133
+ )}>
134
+ <DIDConnectContainer hideCloseButton {...slotProps?.didConnectContainer}>
122
135
  <Box
123
- sx={{
124
- display: 'flex',
125
- flexDirection: 'column',
126
- gap: 1.5,
127
- p: {
128
- xs: 2,
129
- lg: 3,
130
- xl: 4,
131
- },
132
- pt: {
133
- xs: 3,
134
- xl: 4,
136
+ {...slotProps?.contentContainer}
137
+ sx={mergeSx(
138
+ {
139
+ display: 'flex',
140
+ flexDirection: 'column',
141
+ gap: 1.5,
142
+ p: {
143
+ xs: 2,
144
+ lg: 3,
145
+ xl: 4,
146
+ },
147
+ pt: {
148
+ xs: 3,
149
+ xl: 4,
150
+ },
151
+ bgcolor: 'background.paper',
135
152
  },
136
- bgcolor: 'background.paper',
137
- }}>
153
+ slotProps?.contentContainer?.sx as SxProps
154
+ )}>
138
155
  <AuthAppsInfo requestAppInfo={requestAppInfo} currentAppInfo={currentAppInfo} />
139
156
 
140
157
  {user ? (