listpage_cli 0.0.243 → 0.0.244

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "listpage_cli",
3
- "version": "0.0.243",
3
+ "version": "0.0.244",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "listpage_cli": "bin/cli.js"
@@ -23,7 +23,7 @@
23
23
  "class-transformer": "^0.5.1",
24
24
  "class-validator": "~0.14.2",
25
25
  "rxjs": "^7.8.1",
26
- "listpage-next-nest": "~0.0.243"
26
+ "listpage-next-nest": "~0.0.244"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@nestjs/schematics": "^11.0.0",
@@ -12,7 +12,7 @@
12
12
  "dependencies": {
13
13
  "react": "^19.2.0",
14
14
  "react-dom": "^19.2.0",
15
- "listpage-next": "~0.0.243",
15
+ "listpage-next": "~0.0.244",
16
16
  "react-router-dom": ">=6.0.0",
17
17
  "@ant-design/v5-patch-for-react-19": "~1.0.3",
18
18
  "ahooks": "^3.9.5",
@@ -0,0 +1,17 @@
1
+ import { App } from 'listpage-next/features/ReactApp';
2
+ import { menus } from './router/menus';
3
+
4
+ import './App.css';
5
+
6
+ export default () => {
7
+ return (
8
+ <App
9
+ basename="/__APP_NAME__"
10
+ icon={<span>Logo</span>}
11
+ title="Next Page"
12
+ menus={menus}
13
+ hasAuth={() => true}
14
+ loginElement={<div>登录页</div>}
15
+ />
16
+ );
17
+ };
File without changes
@@ -1,21 +1,14 @@
1
- import { MenuItem, detectActiveMenu } from 'listpage-next';
2
- import { basename } from '.';
1
+ import { MenuItem } from 'listpage-next';
3
2
 
4
3
  export const menus: MenuItem[] = [
5
4
  {
6
5
  key: 'menu1',
7
6
  label: '菜单一',
7
+ element: <div>菜单一的内容</div>
8
8
  },
9
9
  {
10
10
  key: 'menu2',
11
11
  label: '菜单二',
12
+ element: <div>菜单二的内容</div>
12
13
  },
13
- ];
14
-
15
- export const getDefaultMenu = () => {
16
- let pathname = window.location.pathname;
17
- if (pathname.startsWith(`/${basename}`)) {
18
- pathname = pathname.slice(basename.length + 2);
19
- }
20
- return detectActiveMenu(pathname, menus);
21
- };
14
+ ];
@@ -9,7 +9,7 @@
9
9
  "publish": "ts-node src/publish.ts"
10
10
  },
11
11
  "dependencies": {
12
- "listpage-next-deploy": "0.0.243"
12
+ "listpage-next-deploy": "0.0.244"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@types/node": "^20.0.0",
@@ -1,9 +0,0 @@
1
- import { RouterProvider } from 'react-router-dom';
2
- import { router } from './router';
3
- import './App.css';
4
-
5
- const App = () => {
6
- return <RouterProvider router={router} />;
7
- };
8
-
9
- export default App;
@@ -1,3 +0,0 @@
1
- export const Home = () => {
2
- return <>Home</>;
3
- };
@@ -1,28 +0,0 @@
1
- import { Menu, PageLayout } from 'listpage-next';
2
- import React, { useMemo } from 'react';
3
- import { Outlet, useNavigate } from 'react-router-dom';
4
- import { OpenAIOutlined } from '@ant-design/icons';
5
-
6
- import { getDefaultMenu, menus } from './menus';
7
-
8
- export const Layout: React.FC = () => {
9
- const navigate = useNavigate();
10
- const defaultActiveKey = useMemo(getDefaultMenu, [location.pathname]);
11
-
12
- return (
13
- <PageLayout
14
- logo={{
15
- icon: <OpenAIOutlined />,
16
- title: 'AI中心',
17
- }}
18
- sider={
19
- <Menu
20
- items={menus}
21
- defaultActiveKey={defaultActiveKey}
22
- onSelect={(path) => navigate(path)}
23
- />
24
- }
25
- content={<Outlet />}
26
- />
27
- );
28
- };
@@ -1,14 +0,0 @@
1
- import { createBrowserRouter } from 'react-router-dom';
2
- import { Layout } from './Layout';
3
-
4
- export const basename = '__APP_NAME__';
5
-
6
- export const router = createBrowserRouter([
7
- {
8
- path: '/',
9
- element: <Layout />,
10
- children: [],
11
- },
12
- ], {
13
- basename,
14
- });