Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] ✨ feat: 到出最基本的不包裹特殊 Token 的布局 #181

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions src/Layout/demos/base.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { BaseEditorLayout, Button, Input } from '@ant-design/pro-editor';
import { Space } from 'antd';
import { DefaultLayoutProps } from './_defaultProps';

export default () => {
return (
<BaseEditorLayout
style={{
maxWidth: '100%',
height: '600px',
}}
header={{
...DefaultLayoutProps.header,
children: (
<Input
addonBefore="Options"
placeholder="Search For Some Little Options"
style={{ width: 250 }}
/>
),
extra: (
<Space>
<Button type="primary">Save</Button>
<Button type="dashed">Export</Button>
</Space>
),
}}
footer={{
...DefaultLayoutProps.footer,
}}
leftPannel={{
children: <div>Left Pannel</div>,
}}
/>
);
};
2 changes: 1 addition & 1 deletion src/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ const BasicLayout = (props: LayoutProps) => {

const WrapperLayout: React.FC<LayoutProps> = withProvider(BasicLayout);

export { WrapperLayout as Layout };
export { BasicLayout as BaseEditorLayout, WrapperLayout as Layout };
2 changes: 2 additions & 0 deletions src/Layout/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ EditorLayout 是我们专门为了编辑器场景制作的编辑器布局组件

<code src="./demos/basic.tsx" title="基础用法"></code>

<code src="./demos/base.tsx" title="纯净样式"></code>

<code src="./demos/single.tsx" title="只需要面板" description="你可以通过设置 `header` 和 `footer` 为 `false` 来隐藏头和尾的配置"></code>

<code src="./demos/noLeftPannel.tsx" title="关闭 panel" description="当然你也可以对某个 `pannel` 设置 false 来关闭其内容"></code>
Expand Down
4 changes: 3 additions & 1 deletion src/Layout/style.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { createStyles } from '../theme';

export const useStyle = createStyles(({ css, token, cx, prefixCls }, { themeType }) => {
const EDITOR_PREFIX = `${prefixCls}-${token?.editorPrefix}`;
const EDITOR_PREFIX = `${prefixCls}-${token?.editorPrefix || 'editor'}`;
const prefix = `${EDITOR_PREFIX}-layout`;

console.log(' .${EDITOR_PREFIX}-draggable-panel', ` .${EDITOR_PREFIX}-draggable-panel`);

const typeStylish = css`
background-color: ${themeType === 'block'
? token.colorFillTertiary
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type { FreeCanvasProps } from './FreeCanvas';
export * from './Highlight';
export * from './IconPicker';
export * from './InteractContainer';
export { Layout as EditorLayout } from './Layout';
export { BaseEditorLayout, Layout as EditorLayout } from './Layout';
export { default as Markdown, type MarkdownProps } from './Markdown';
export * from './ProBuilder';
export * from './ProEditor';
Expand Down
Loading