@nocobase/plugin-mobile-client 0.10.0-alpha.5 → 0.11.0-alpha.1
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/client.d.ts +2 -3
- package/client.js +1 -30
- package/lib/client/MobileClientProvider.d.ts +2 -0
- package/lib/client/MobileClientProvider.js +64 -0
- package/lib/client/core/schema/components/container/Container.js +15 -30
- package/lib/client/core/schema/components/header/Header.Designer.js +8 -8
- package/lib/client/core/schema/components/header/Header.js +1 -8
- package/lib/client/core/schema/components/menu/Menu.Item.js +1 -8
- package/lib/client/core/schema/components/menu/Menu.d.ts +1 -1
- package/lib/client/core/schema/components/menu/Menu.js +15 -22
- package/lib/client/core/schema/components/page/Page.js +7 -14
- package/lib/client/core/schema/components/settings/Settings.js +1 -8
- package/lib/client/core/schema/components/tab-bar/TabBar.Item.d.ts +1 -1
- package/lib/client/core/schema/components/tab-bar/TabBar.Item.js +10 -17
- package/lib/client/core/schema/components/tab-bar/TabBar.d.ts +1 -1
- package/lib/client/core/schema/components/tab-bar/TabBar.js +25 -32
- package/lib/client/core/schema/hooks/useSchemaPatch.js +4 -5
- package/lib/client/core/schema/scopes/grid-card.js +4 -4
- package/lib/client/devices/iOS6.js +4 -4
- package/lib/client/devices/index.js +9 -9
- package/lib/client/index.d.ts +11 -2
- package/lib/client/index.js +62 -26
- package/lib/client/router/Application.js +6 -14
- package/lib/client/router/InterfaceRouter.d.ts +1 -5
- package/lib/client/router/InterfaceRouter.js +10 -38
- package/lib/client/router/index.d.ts +0 -1
- package/lib/client/router/index.js +0 -11
- package/lib/server/migrations/20230620203218-mobile-ui-schema-uid.js +1 -1
- package/package.json +26 -10
- package/server.d.ts +2 -3
- package/server.js +1 -30
- package/src/client/MobileClientProvider.tsx +41 -0
- package/src/client/core/schema/components/container/Container.tsx +13 -29
- package/src/client/core/schema/components/header/Header.Designer.tsx +3 -3
- package/src/client/core/schema/components/header/Header.tsx +1 -2
- package/src/client/core/schema/components/menu/Menu.Item.tsx +10 -2
- package/src/client/core/schema/components/menu/Menu.tsx +7 -6
- package/src/client/core/schema/components/page/Page.tsx +3 -4
- package/src/client/core/schema/components/settings/Settings.tsx +1 -2
- package/src/client/core/schema/components/tab-bar/TabBar.Item.tsx +4 -5
- package/src/client/core/schema/components/tab-bar/TabBar.tsx +8 -7
- package/src/client/core/schema/hooks/useSchemaPatch.ts +2 -2
- package/src/client/core/schema/scopes/grid-card.ts +1 -1
- package/src/client/devices/iOS6.tsx +1 -1
- package/src/client/devices/index.tsx +1 -1
- package/src/client/index.tsx +45 -30
- package/src/client/router/Application.tsx +3 -3
- package/src/client/router/InterfaceRouter.tsx +11 -43
- package/src/client/router/index.ts +0 -1
- package/docs/en-US/index.md +0 -7
- package/docs/en-US/installation.md +0 -13
- package/docs/en-US/tabs.json +0 -14
- package/docs/en-US/usage.md +0 -1
- package/docs/zh-CN/index.md +0 -7
- package/docs/zh-CN/installation.md +0 -13
- package/docs/zh-CN/tabs.json +0 -14
- package/docs/zh-CN/usage.md +0 -2
- package/lib/client/router/RouteSwitchProvider.d.ts +0 -2
- package/lib/client/router/RouteSwitchProvider.js +0 -59
- package/src/client/router/RouteSwitchProvider.tsx +0 -31
- package/types.d.ts +0 -0
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { RouteSwitchProvider, useRouteSwitchContext } from '@nocobase/client';
|
|
2
|
-
import React, { useEffect } from 'react';
|
|
3
|
-
import { useLocation, useNavigate } from 'react-router-dom';
|
|
4
|
-
import { isJSBridge } from '../core/bridge';
|
|
5
|
-
import MApplication from './Application';
|
|
6
|
-
|
|
7
|
-
export const RouterSwitchProvider = (props) => {
|
|
8
|
-
const { routes, components } = useRouteSwitchContext();
|
|
9
|
-
// redirect to mobile
|
|
10
|
-
const location = useLocation();
|
|
11
|
-
const navigate = useNavigate();
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
if (isJSBridge()) {
|
|
14
|
-
if (location.pathname.includes('/admin')) {
|
|
15
|
-
navigate('/mobile');
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}, [location.pathname, navigate]);
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<RouteSwitchProvider
|
|
22
|
-
routes={routes}
|
|
23
|
-
components={{
|
|
24
|
-
...components,
|
|
25
|
-
MApplication,
|
|
26
|
-
}}
|
|
27
|
-
>
|
|
28
|
-
{props.children}
|
|
29
|
-
</RouteSwitchProvider>
|
|
30
|
-
);
|
|
31
|
-
};
|
package/types.d.ts
DELETED
|
File without changes
|