Skip to content

Commit

Permalink
修改pro-layout文件引入后缀
Browse files Browse the repository at this point in the history
  • Loading branch information
xg15472 committed Oct 22, 2024
1 parent 99c2b5a commit d55fd03
Show file tree
Hide file tree
Showing 21 changed files with 53 additions and 47 deletions.
9 changes: 7 additions & 2 deletions packages/demo-antd/src/home/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { createRoot } from 'react-dom/client';
import { bootstrap } from '@hyperse/pro-layout';
import { Demo } from './Demo';
import './index.less';

createRoot(document.getElementById('app')!).render(<Demo />);
// createRoot(document.getElementById('app')!).render(<Demo />);

bootstrap({
layoutMode: 'no-layout',
routeList: [{ path: '/', element: <Demo /> }],
});
3 changes: 2 additions & 1 deletion packages/demo-antd/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"moduleResolution": "node",
"paths": {
"@hyperse/antd": ["../antd/src/index.ts"],
"@hyperse/utils": ["../utils/src/index.ts"]
"@hyperse/utils": ["../utils/src/index.ts"],
"@hyperse/pro-layout": ["../pro-layout/src/index.ts"]
}
},
"exclude": ["node_modules", "**/.*/", "dist", "build", "public"]
Expand Down
14 changes: 7 additions & 7 deletions packages/pro-layout/src/app-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { Fragment } from 'react';
import { Layout } from 'antd';
import { classNames } from '@dimjs/utils';
import { isWindowsEnv } from '@hyperse/utils';
import { AppRoutes } from './app-routes.js';
import useAntdApp from './compts/antd-app/index.js';
import { Header } from './compts/header/index.js';
import { SiderBar } from './compts/sider-bar/index.js';
import { AppRoutes } from './app-routes.jsx';
import useAntdApp from './compts/antd-app/index.jsx';
import { Header } from './compts/header/index.jsx';
import { SiderBar } from './compts/sider-bar/index.jsx';
import { useLayoutCtx } from './context/layout-ctx.js';
import { EventHandling } from './layout/layout-iframe/event-handling/index.js';
import { LayoutIFrame } from './layout/layout-iframe/index.js';
import { LayoutPage } from './layout/layout-page/index.js';
import { EventHandling } from './layout/layout-iframe/event-handling/index.jsx';
import { LayoutIFrame } from './layout/layout-iframe/index.jsx';
import { LayoutPage } from './layout/layout-page/index.jsx';

export const App = () => {
const layoutCtx = useLayoutCtx();
Expand Down
12 changes: 6 additions & 6 deletions packages/pro-layout/src/app-no-layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Fragment } from 'react';
import { type AppRouteProps, AppRoutes } from './app-routes.js';
import useAntdApp from './compts/antd-app/index.js';
import { ContentLayoutCheck } from './compts/content-layout-check/index.js';
import { ErrorHandling } from './compts/error-handling/index.js';
import { IframeTabRoutesTiming } from './compts/routes-timing/iframe-tab-timing.js';
import { LayoutPage } from './layout/layout-page/index.js';
import { type AppRouteProps, AppRoutes } from './app-routes.jsx';
import useAntdApp from './compts/antd-app/index.jsx';
import { ContentLayoutCheck } from './compts/content-layout-check/index.jsx';
import { ErrorHandling } from './compts/error-handling/index.jsx';
import { IframeTabRoutesTiming } from './compts/routes-timing/iframe-tab-timing.jsx';
import { LayoutPage } from './layout/layout-page/index.jsx';
import { type BootstrapOptions } from './types/index.js';

export type AppProps = AppRouteProps & {
Expand Down
6 changes: 3 additions & 3 deletions packages/pro-layout/src/app-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import {
treeToArray,
valueIsEqual,
} from '@hyperse/utils';
import { App } from './app-layout.js';
import { ErrorHandling } from './compts/error-handling/index.js';
import { NormalRoutesTiming } from './compts/routes-timing/normal-timing.js';
import { App } from './app-layout.jsx';
import { ErrorHandling } from './compts/error-handling/index.jsx';
import { NormalRoutesTiming } from './compts/routes-timing/normal-timing.jsx';
import { LayoutProvider } from './context/layout-ctx.js';
import {
type IframeTabItem,
Expand Down
2 changes: 1 addition & 1 deletion packages/pro-layout/src/app-routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from '@hyperse/utils';
import { NotFound } from './compts/404/index.js';
import { Bread } from './compts/bread/index.js';
import { Loader } from './compts/loader/loader.js';
import { Loader } from './compts/loader/loader.jsx';
import {
type BootstrapOptions,
BreadConfigItem,
Expand Down
10 changes: 5 additions & 5 deletions packages/pro-layout/src/bootstrap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import {
toArray,
urlJoin,
} from '@hyperse/utils';
import { AntdAppWrapper } from './antd-app.js';
import { AppNoLayout } from './app-no-layout.js';
import { AppProvider } from './app-provider.js';
import { AntdAppWrapper } from './antd-app.jsx';
import { AppNoLayout } from './app-no-layout.jsx';
import { AppProvider } from './app-provider.jsx';
import { ErrorBoundary, ErrorFallback } from './compts/error-boundary/index.js';
import { Container } from './container.js';
import { Container } from './container.jsx';
import { BootstrapCtx } from './context/layout-ctx.js';
import { IframeMainRegister } from './iframe-register.js';
import { IframeMainRegister } from './iframe-register.jsx';
import { proLayoutModels } from './model/layout-model.js';
import {
type BreadConfigItem,
Expand Down
2 changes: 1 addition & 1 deletion packages/pro-layout/src/compts/404/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './not-found.js';
export * from './not-found.jsx';
2 changes: 1 addition & 1 deletion packages/pro-layout/src/compts/bread/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './bread.js';
export * from './bread.jsx';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ReactElement } from 'react';
import { BootstrapOptions } from '../../types/layout.js';
import { IframeTabMode } from './iframe-tab-mode.js';
import { NoLayoutMode } from './no-layout-mode.js';
import { NoLayoutMode } from './no-layout-mode.jsx';

type ContentLayoutCheckProps = {
layoutMode?: BootstrapOptions['layoutMode'];
Expand Down
4 changes: 2 additions & 2 deletions packages/pro-layout/src/compts/error-boundary/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './error-boundary.js';
export * from './error-fallback.js';
export * from './error-boundary.jsx';
export * from './error-fallback.jsx';
6 changes: 3 additions & 3 deletions packages/pro-layout/src/compts/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import {
guessIframeMainLink,
guessNormalItemLink,
} from '../../utils/utils.js';
import { Shrink } from '../shrink/index.js';
import { HeaderAccount } from './account/index.js';
import { HeaderBrand } from './brand/index.js';
import { Shrink } from '../shrink/index.jsx';
import { HeaderAccount } from './account/index.jsx';
import { HeaderBrand } from './brand/index.jsx';
import './style.less';

const HeaderBarIcon = (props: {
Expand Down
2 changes: 1 addition & 1 deletion packages/pro-layout/src/compts/loader/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './loader.js';
export * from './loader.jsx';
4 changes: 2 additions & 2 deletions packages/pro-layout/src/compts/page/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './page.js';
export * from './page-wrapper.js';
export * from './page.jsx';
export * from './page-wrapper.jsx';
2 changes: 1 addition & 1 deletion packages/pro-layout/src/compts/page/page-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { dialogLoading, fbaHooks } from '@hyperse/antd';
import { TAny, TPlainObject } from '@hyperse/utils';
import { hooks } from '@wove/react';
import { PageWrapperCtxProvider, usePageWrapperCtx } from './ctx.js';
import { Page, PageProps } from './page.js';
import { Page, PageProps } from './page.jsx';

type PageContentProps = Omit<PageWrapperProps, 'serviceConfig'> & {
respData?: TAny;
Expand Down
2 changes: 1 addition & 1 deletion packages/pro-layout/src/compts/page/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { isUndefined } from '@dimjs/lang';
import { classNames } from '@dimjs/utils';
import { isWindowsEnv } from '@hyperse/utils';
import { hooks } from '@wove/react';
import { Loader } from '../loader/loader.js';
import { Loader } from '../loader/loader.jsx';
import './style.less';

export interface PageProps {
Expand Down
4 changes: 2 additions & 2 deletions packages/pro-layout/src/compts/sider-bar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import {
import { hooks } from '@wove/react';
import { useLayoutCtx } from '../../context/layout-ctx.js';
import { type TMenuItem } from '../../types/menu.js';
import { HeaderBrand } from '../header/brand/index.js';
import { Shrink } from '../shrink/index.js';
import { HeaderBrand } from '../header/brand/index.jsx';
import { Shrink } from '../shrink/index.jsx';
import './style.less';

const { Sider } = Layout;
Expand Down
2 changes: 1 addition & 1 deletion packages/pro-layout/src/entry.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createRoot } from 'react-dom/client';
import { Bootstrap } from './bootstrap.js';
import { Bootstrap } from './bootstrap.jsx';
import { type BootstrapOptions } from './types/layout.js';

/**
Expand Down
8 changes: 4 additions & 4 deletions packages/pro-layout/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import './style.less';
export * from './compts/antd-app/index.js';
export * from './compts/antd-app/index.jsx';
export * from './compts/bread/index.js';
export * from './compts/history-back-button/index.js';
export * from './compts/history-back-button/index.jsx';
export * from './compts/page/index.js';
export * from './entry.js';
export * from './entry.jsx';
export * from './hooks/use-refresh-iframe-tab.js';
export * from './layout/layout-iframe/use-iframe.js';
export * from './layout/layout-page/index.js';
export * from './layout/layout-page/index.jsx';
export * from './model/layout-model.js';
export * from './types/index.js';
4 changes: 2 additions & 2 deletions packages/pro-layout/src/layout/layout-iframe/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import {
valueIsEqual,
} from '@hyperse/utils';
import { hooks } from '@wove/react';
import { Loader } from '../../compts/loader/loader.js';
import { Loader } from '../../compts/loader/loader.jsx';
import { useLayoutCtx } from '../../context/layout-ctx.js';
import { IframePage } from './iframe-page.js';
import { IframePage } from './iframe-page.jsx';
import './style.less';
/**
* 此处如果存在面包屑/tabbar路由菜单, 需要处理layout/flex布局问题
Expand Down

0 comments on commit d55fd03

Please sign in to comment.