-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1360151219
committed
Sep 29, 2023
1 parent
3f53b55
commit 0c09d0f
Showing
12 changed files
with
138 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const list = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Editor } from 'pivot-design'; | ||
import React, { useState } from 'react'; | ||
|
||
const App: React.FC = () => { | ||
return ( | ||
<> | ||
<Editor /> | ||
</> | ||
); | ||
}; | ||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import Props from './props.mdx'; | ||
|
||
# Editor | ||
|
||
## 基本用法 | ||
|
||
<CodeBlock id="基本示例"> | ||
<Base /> | ||
</CodeBlock> | ||
|
||
<Props /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Table from '../table.tsx'; | ||
|
||
export const params = []; | ||
|
||
## API 列表 | ||
|
||
<Table name="input" params={params} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
import EditorMdx from '@/components/Editor/index.mdx'; | ||
import CodeBlock from '@/components/_CodeBlock/codeBlock'; | ||
import { list } from '@/components/Editor/.catalog'; | ||
import { renderCatalog } from '@/utils'; | ||
const EditorPage: React.FC = () => { | ||
return ( | ||
<> | ||
<EditorMdx components={{ CodeBlock }} /> | ||
<div className="demo-component-catalogue">{renderCatalog(list)}</div> | ||
</> | ||
); | ||
}; | ||
export default EditorPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './renderCatalog'; | ||
export * from './path'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
export const ComponentPath = [ | ||
{ | ||
path: 'button', | ||
title: 'Button 按钮', | ||
}, | ||
{ | ||
path: 'switch', | ||
title: 'Switch 开关', | ||
}, | ||
{ | ||
path: 'card', | ||
title: 'Card 卡片', | ||
}, | ||
{ | ||
path: 'button', | ||
title: 'Card 卡片', | ||
}, | ||
{ | ||
path: 'draggable', | ||
title: 'Draggable 拖拽列表', | ||
}, | ||
{ | ||
path: 'skeleton', | ||
title: 'Skeleton 骨架屏', | ||
}, | ||
{ | ||
path: 'icon', | ||
title: 'Icon 图标', | ||
}, | ||
{ | ||
path: 'input', | ||
title: 'Input 输入框', | ||
}, | ||
{ | ||
path: 'popover', | ||
title: 'Popover 气泡', | ||
}, | ||
{ | ||
path: 'modal', | ||
title: 'Modal 弹窗', | ||
}, | ||
{ | ||
path: 'transition', | ||
title: 'Transition 元素动画', | ||
}, | ||
{ | ||
path: 'editor', | ||
title: 'Editor 代码编辑器', | ||
}, | ||
] as const; | ||
|
||
export const generateComponentRouter = (mapping: Record<(typeof ComponentPath)[number]['path'], any>) => { | ||
return ComponentPath.map((component) => { | ||
// eslint-disable-next-line no-prototype-builtins | ||
if (mapping.hasOwnProperty(component.path)) { | ||
return { | ||
...component, | ||
element: mapping[component.path], | ||
}; | ||
} | ||
return {}; | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const MonacoEditor = () => { | ||
return <div>123</div>; | ||
}; | ||
|
||
export default MonacoEditor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters