@arcblock/ux 2.13.13 → 2.13.15
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/Address/responsive-did-address.js +3 -1
- package/lib/Config/theme-mode-toggle.js +1 -1
- package/lib/DIDConnect/app-icon.d.ts +8 -0
- package/lib/DIDConnect/app-icon.js +31 -0
- package/lib/DIDConnect/app-info-item.d.ts +7 -0
- package/lib/DIDConnect/app-info-item.js +73 -0
- package/lib/DIDConnect/did-connect-footer.d.ts +4 -0
- package/lib/DIDConnect/did-connect-footer.js +54 -0
- package/lib/DIDConnect/did-connect-logo.d.ts +1 -0
- package/lib/DIDConnect/did-connect-logo.js +11 -0
- package/lib/DIDConnect/index.d.ts +7 -0
- package/lib/DIDConnect/index.js +7 -0
- package/lib/DIDConnect/powered-by.d.ts +3 -0
- package/lib/DIDConnect/powered-by.js +46 -0
- package/lib/DIDConnect/with-container.d.ts +11 -0
- package/lib/DIDConnect/with-container.js +273 -0
- package/lib/DIDConnect/with-ux-theme.d.ts +1 -0
- package/lib/DIDConnect/with-ux-theme.js +23 -0
- package/lib/Datatable/CustomToolbar.js +0 -3
- package/lib/Datatable/index.d.ts +3 -0
- package/lib/Datatable/index.js +36 -20
- package/lib/Dialog/confirm.d.ts +6 -1
- package/lib/Dialog/confirm.js +7 -3
- package/lib/Dialog/use-confirm.js +6 -0
- package/lib/LoadingMask/index.js +1 -1
- package/lib/Locale/util.d.ts +3 -3
- package/lib/Locale/util.js +6 -1
- package/lib/LoginButton/index.d.ts +12 -0
- package/lib/LoginButton/index.js +74 -0
- package/lib/NavMenu/style.js +0 -1
- package/lib/SessionUser/components/un-login.js +42 -31
- package/lib/SharedBridge/index.d.ts +16 -0
- package/lib/SharedBridge/index.js +109 -0
- package/lib/SharedBridge/need-storage-access-api-dialog.d.ts +7 -0
- package/lib/SharedBridge/need-storage-access-api-dialog.js +212 -0
- package/lib/Theme/index.d.ts +2 -2
- package/lib/Theme/index.js +1 -1
- package/lib/Util/iframe.d.ts +5 -0
- package/lib/Util/iframe.js +24 -0
- package/lib/Util/index.d.ts +10 -1
- package/lib/Util/index.js +67 -4
- package/lib/hooks/use-blocklet-logo.d.ts +8 -0
- package/lib/hooks/use-blocklet-logo.js +31 -0
- package/lib/hooks/use-mobile.d.ts +4 -0
- package/lib/hooks/use-mobile.js +7 -0
- package/package.json +7 -6
- package/src/Address/responsive-did-address.tsx +11 -1
- package/src/Config/theme-mode-toggle.tsx +1 -1
- package/src/DIDConnect/app-icon.tsx +36 -0
- package/src/DIDConnect/app-info-item.tsx +82 -0
- package/src/DIDConnect/did-connect-footer.tsx +51 -0
- package/src/DIDConnect/did-connect-logo.tsx +8 -0
- package/src/DIDConnect/index.ts +7 -0
- package/src/DIDConnect/powered-by.tsx +48 -0
- package/src/DIDConnect/with-container.tsx +307 -0
- package/src/DIDConnect/with-ux-theme.tsx +22 -0
- package/src/Datatable/CustomToolbar.jsx +0 -1
- package/src/Datatable/index.jsx +32 -20
- package/src/Dialog/confirm.jsx +31 -23
- package/src/Dialog/use-confirm.jsx +6 -0
- package/src/LoadingMask/index.tsx +1 -1
- package/src/Locale/util.ts +7 -2
- package/src/LoginButton/index.tsx +73 -0
- package/src/NavMenu/style.ts +0 -1
- package/src/SessionUser/components/un-login.tsx +34 -27
- package/src/SharedBridge/index.tsx +123 -0
- package/src/SharedBridge/need-storage-access-api-dialog.tsx +171 -0
- package/src/Theme/index.ts +2 -2
- package/src/Util/iframe.ts +19 -0
- package/src/Util/index.ts +77 -4
- package/src/hooks/use-blocklet-logo.tsx +32 -0
- package/src/hooks/use-mobile.tsx +6 -0
@@ -0,0 +1,32 @@
|
|
1
|
+
import { type Breakpoint } from '@mui/material';
|
2
|
+
import { type ThemeOptions } from '@blocklet/theme';
|
3
|
+
import { useCreation } from 'ahooks';
|
4
|
+
import { useTheme } from '../Theme';
|
5
|
+
import useMobile from './use-mobile';
|
6
|
+
|
7
|
+
export default function useBlockletLogo({
|
8
|
+
key = 'sm',
|
9
|
+
meta = {},
|
10
|
+
theme: themeOverrides = {},
|
11
|
+
square,
|
12
|
+
}: { key?: number | Breakpoint; meta?: any; theme?: ThemeOptions; square?: boolean } = {}) {
|
13
|
+
const isMobileDevice = useMobile({ key });
|
14
|
+
const theme = useTheme();
|
15
|
+
|
16
|
+
const mode = useCreation(() => {
|
17
|
+
return themeOverrides?.palette?.mode || theme.palette.mode;
|
18
|
+
}, [theme, themeOverrides]);
|
19
|
+
|
20
|
+
const finalAppLogo = useCreation(() => {
|
21
|
+
const { appLogo, appLogoDark, appLogoRect, appLogoRectDark } = Object.assign({}, window.blocklet ?? {}, meta);
|
22
|
+
const isDark = mode === 'dark';
|
23
|
+
|
24
|
+
const squareLogo = (isDark ? appLogoDark : appLogo) || appLogo;
|
25
|
+
// 深色模式尽可能优先使用深色图标
|
26
|
+
const rectLogo = (isDark ? appLogoRectDark || appLogoDark : appLogoRect) || appLogoRect;
|
27
|
+
|
28
|
+
return isMobileDevice || square ? squareLogo : rectLogo || squareLogo || '';
|
29
|
+
}, [mode, meta, isMobileDevice, square]);
|
30
|
+
|
31
|
+
return finalAppLogo;
|
32
|
+
}
|