-
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.
Merge pull request #66 from hocgin/v4.0.39
V4.0.39
- Loading branch information
Showing
30 changed files
with
337 additions
and
272 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
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,6 +1,6 @@ | ||
{ | ||
"name": "@hocgin/ui", | ||
"version": "4.0.38", | ||
"version": "4.0.39", | ||
"sideEffects": [ | ||
".less", | ||
".css" | ||
|
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,6 +1,6 @@ | ||
--- | ||
# @formatter:off | ||
title: Archive - 存档 | ||
title: Archive - 存档(弃) | ||
order: 1000 | ||
nav: | ||
title: 高级组件 | ||
|
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,15 +1,24 @@ | ||
.link { | ||
display: inline-block; | ||
padding: 0 4px; | ||
padding: 2px; | ||
border-radius: 2px; | ||
background: #c1a3a31f; | ||
border: 1px dashed #ebedf1; | ||
margin: 1px; | ||
box-sizing: border-box; | ||
white-space: nowrap; | ||
text-overflow: ellipsis; | ||
overflow: hidden; | ||
word-break: break-all; | ||
width: 10em; | ||
|
||
&:hover { | ||
opacity: 0.8; | ||
cursor: pointer; | ||
font-weight: 350; | ||
font-weight: 300; | ||
} | ||
} | ||
|
||
.linkText { | ||
padding-left: 2px; | ||
} |
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,59 +1,41 @@ | ||
import React from 'react'; | ||
import React, { useState } from 'react'; | ||
import classnames from 'classnames'; | ||
import { MenuOutlined, CloseOutlined } from '@ant-design/icons'; | ||
import styles from './index.less'; | ||
|
||
interface LogoProps { | ||
const Index: React.FC<{ | ||
menus?: any[]; | ||
className?: string | undefined; | ||
} | ||
|
||
interface LogoState { | ||
isOpenMenu?: boolean; | ||
} | ||
|
||
class Index extends React.Component<LogoProps, LogoState> { | ||
static defaultProps = { | ||
menus: [], | ||
}; | ||
state = { | ||
isOpenMenu: false, | ||
}; | ||
|
||
render() { | ||
let { isOpenMenu } = this.state; | ||
let { menus, className } = this.props; | ||
return ( | ||
<header className={classnames(styles.topHeader, className)}> | ||
<a href="http://www.hocgin.top/" className={styles.logo}> | ||
HOCGIN | ||
<span className={styles.suffix}> | ||
<span className={styles.dot}>.</span>top | ||
</span> | ||
</a> | ||
<div | ||
className={classnames(styles.toggle, { [styles.active]: isOpenMenu })} | ||
onClick={this.onClickToggle} | ||
> | ||
{isOpenMenu ? <CloseOutlined /> : <MenuOutlined />} | ||
</div> | ||
<ul | ||
className={classnames(styles.navigation, { | ||
[styles.active]: isOpenMenu, | ||
})} | ||
> | ||
{(menus || []).map(({ href, title }, index) => ( | ||
<li key={index}> | ||
<a href={href}>{title}</a> | ||
</li> | ||
))} | ||
</ul> | ||
</header> | ||
); | ||
} | ||
|
||
onClickToggle = () => | ||
this.setState(({ isOpenMenu }) => ({ isOpenMenu: !isOpenMenu })); | ||
} | ||
}> = ({ className, menus = [] }, ref) => { | ||
let [isOpenMenu, setIsOpenMenu] = useState(false); | ||
return ( | ||
<header className={classnames(styles.topHeader, className)}> | ||
<a href="http://www.hocgin.top/" className={styles.logo}> | ||
<span>HOCGIN</span> | ||
<span className={styles.suffix}> | ||
<span className={styles.dot}>.</span> | ||
<span>top</span> | ||
</span> | ||
</a> | ||
<div | ||
className={classnames(styles.toggle, { [styles.active]: isOpenMenu })} | ||
onClick={() => setIsOpenMenu(!isOpenMenu)} | ||
> | ||
{isOpenMenu ? <CloseOutlined /> : <MenuOutlined />} | ||
</div> | ||
<ul | ||
className={classnames(styles.navigation, { | ||
[styles.active]: isOpenMenu, | ||
})} | ||
> | ||
{(menus || []).map(({ href, title }, index) => ( | ||
<li key={index}> | ||
<a href={href}>{title}</a> | ||
</li> | ||
))} | ||
</ul> | ||
</header> | ||
); | ||
}; | ||
|
||
export default Index; |
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,32 +1,23 @@ | ||
import React, { Component } from 'react'; | ||
import React from 'react'; | ||
import styles from './index.less'; | ||
|
||
interface EditorProps { | ||
value: string; | ||
height?: number; | ||
onChange?: (value?: string) => void; | ||
} | ||
|
||
class Index extends Component<EditorProps, {}> { | ||
static defaultProps = {}; | ||
|
||
constructor(props: any, context: any) { | ||
super(props, context); | ||
const MDEditor: React.FC<any> = ({ ...rest }: any) => { | ||
try { | ||
let Uiw = require('@uiw/react-md-editor')?.default; | ||
console.log(Uiw); | ||
return <Uiw {...rest} />; | ||
} catch (e) { | ||
return <div>需要安装 @uiw/react-md-editor</div>; | ||
} | ||
}; | ||
|
||
render() { | ||
let { children, value, height, onChange } = this.props; | ||
|
||
let result = <span>需要安装 @uiw/react-md-editor</span>; | ||
try { | ||
let MDEditor = require('@uiw/react-md-editor'); | ||
result = <MDEditor value={value} height={height} onChange={onChange} />; | ||
} catch (e) { | ||
console.warn('需要安装 @uiw/react-md-editor', e); | ||
} | ||
|
||
return <>{result}</>; | ||
} | ||
} | ||
const Index: React.FC<{ | ||
value: string; | ||
height?: number; | ||
onChange?: (value?: string) => void; | ||
}> = ({ children, value, height, onChange }, ref) => { | ||
return <><MDEditor value={value} height={height} onChange={onChange} /></>; | ||
}; | ||
|
||
export default Index; |
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,38 +1,21 @@ | ||
import React, { Component } from 'react'; | ||
import styles from './index.less'; | ||
|
||
interface EditorProps { | ||
children?: string; | ||
} | ||
|
||
interface EditorState { | ||
} | ||
|
||
class Index extends Component<EditorProps, EditorState> { | ||
static defaultProps = { | ||
children: '', | ||
}; | ||
|
||
constructor(props: any, context: any) { | ||
super(props, context); | ||
const Markdown: React.FC<any> = ({ ...rest }: any) => { | ||
try { | ||
let Uiw = require('@uiw/react-md-editor')?.default; | ||
console.log(Uiw); | ||
return <Uiw.Markdown {...rest} />; | ||
} catch (e) { | ||
return <div>需要安装 @uiw/react-md-editor</div>; | ||
} | ||
}; | ||
|
||
render() { | ||
let { children } = this.props; | ||
let result = <span>需要安装 @uiw/react-md-editor</span>; | ||
try { | ||
let MDEditor = require('@uiw/react-md-editor'); | ||
result = <MDEditor.Markdown source={children} />; | ||
} catch (e) { | ||
console.warn('需要安装 @uiw/react-md-editor', e); | ||
} | ||
|
||
return ( | ||
<div className={styles.markdownPreview}> | ||
{result} | ||
</div> | ||
); | ||
} | ||
} | ||
const Index: React.FC<{ | ||
children?: string; | ||
}> = ({ children }, ref) => { | ||
return <><Markdown source={children} /></>; | ||
}; | ||
|
||
export default Index; |
This file was deleted.
Oops, something went wrong.
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,5 +1,5 @@ | ||
.view { | ||
display: flex; | ||
display: flex!important; | ||
|
||
.input { | ||
flex: 1 1; | ||
|
Oops, something went wrong.
a064675
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: