Merge branch 'master' of github.com:ant-design/ant-design

This commit is contained in:
afc163 2016-06-06 11:36:27 +08:00
commit 87e0a574c0
10 changed files with 69 additions and 24 deletions

View File

@ -9,6 +9,12 @@ timeline: true
---
## 1.3.1
`2016-06-06`
- 修复 `Message` `Notification` 找不到的问题。 [#1968](https://github.com/ant-design/ant-design/issues/1968)
## 1.3.0
`2016-06-02`

View File

@ -366,6 +366,13 @@
}
}
&-dark&-vertical &-item-selected {
> a,
> a:hover {
color: @primary-color;
}
}
&-dark &-item-active,
&-dark &-submenu-active,
&-dark &-submenu-title:hover {

5
index.d.ts vendored
View File

@ -746,6 +746,10 @@ export class Row extends React.Component<RowProps, {}> {
// Col
interface ColProps {
span?:number,
lg?: number,
md?:number,
sm?:number,
xs?:number,
order?:number,
offset?:string,
push?:string,
@ -833,6 +837,7 @@ export class MenuItemGroup extends React.Component<MenuItemGroupProps, {}> {
}
interface MenuProps {
id?: string,
/** 主题颜色*/
theme?:'light' | 'dark',
/** 菜单类型 enum: `vertical` `horizontal` `inline`*/

View File

@ -14,7 +14,12 @@ req.keys().forEach((mod) => {
const v = req(mod);
const match = mod.match(/^\.\/([^_][\w-]+)\/index\.jsx?$/);
if (match && match[1]) {
exports[camelCase(match[1])] = v;
if (match[1] === 'message' || match[1] === 'notification') {
// message & notification should not be capitalized
exports[match[1]] = v;
} else {
exports[camelCase(match[1])] = v;
}
}
});

View File

@ -1,6 +1,6 @@
{
"name": "antd",
"version": "1.3.0",
"version": "1.3.1",
"title": "Ant Design",
"description": "一个 UI 设计语言",
"homepage": "http://ant.design/",
@ -126,7 +126,7 @@
"clean": "antd-tools run clean",
"start": "bisheng start -c ./site/bisheng.config.js",
"site": "bisheng build -c ./site/bisheng.config.js",
"pre-deploy": "cp CNAME _site",
"pre-deploy": "mkdir -p _site && cp CNAME _site",
"deploy": "tnpm run clean && tnpm i && tnpm run just-deploy",
"just-deploy": "tnpm run pre-deploy && bisheng gh-pages -c ./site/bisheng.config.js",
"lint": "npm run srclint && npm run demolint && npm run lesshint",

View File

@ -25,7 +25,7 @@ module.exports = {
'/docs/practice/:children': contentTmpl,
'/docs/pattern/:children': contentTmpl,
'/docs/react/:children': contentTmpl,
'/CHANGELOG': contentTmpl,
'/changelog': contentTmpl,
'/components/:children': contentTmpl,
'/docs/spec/:children': contentTmpl,
'/docs/resource/:children': contentTmpl,

View File

@ -62,7 +62,7 @@ export default class Article extends React.Component {
)
}
{
!content.toc ? null :
!(content.toc && meta.toc) ? null :
<section className="toc">{props.utils.toReactComponent(content.toc)}</section>
}
{

View File

@ -40,7 +40,7 @@ export default class MainContent extends React.Component {
<span className="chinese" key="chinese">{item.subtitle || item.chinese}</span>,
];
const disabled = item.disabled;
const url = item.filename.replace(/(\/index)?((\.zh-CN)|(\.en-US))?\.md$/i, '');
const url = item.filename.replace(/(\/index)?((\.zh-CN)|(\.en-US))?\.md$/i, '').toLowerCase();
const child = !item.link ?
<Link to={url} disabled={disabled}>
{text}
@ -85,11 +85,11 @@ export default class MainContent extends React.Component {
const props = this.props;
let moduleData;
if (/(docs\/react\/)|(components\/)|(CHANGELOG)/i.test(props.location.pathname)) {
if (/(docs\/react\/)|(components\/)|(changelog)/i.test(props.location.pathname)) {
moduleData = {
...props.data.docs.react,
...props.data.components,
CHANGELOG: props.data.CHANGELOG,
changelog: props.data.CHANGELOG,
};
} else {
moduleData = props.utils.get(props.data, props.location.pathname.split('/').slice(0, 2));
@ -153,7 +153,9 @@ export default class MainContent extends React.Component {
const locale = this.context.intl.locale;
const moduleData = this.getModuleData();
const pageData = props.pageData.index || props.pageData;
const pageData = /changelog/i.test(props.location.pathname) ?
props.data.CHANGELOG :
(props.pageData.index || props.pageData);
const localizedPageData = pageData[locale] || pageData;
return (
<div className="main-wrapper">

View File

@ -9,6 +9,13 @@ import Page3 from './Page3';
import Page4 from './Page4';
export default class Home extends React.Component {
componentWillMount() {
if (location.hash) {
const pathname = location.hash.replace(/^#/, '').replace('?scrollTo=', '#');
location.href = pathname;
}
}
// To store style which is only for Home and has conflicts with others.
getStyle() {
return `

View File

@ -22,10 +22,6 @@ if (!location.port) {
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-72788897-1', 'auto');
ga('send', 'pageview');
appHistory.listen((loc) => {
ga('send', 'pageview', loc.pathname + loc.search);
});
/* eslint-enable */
}
@ -58,14 +54,31 @@ const isZhCN = (typeof localStorage !== 'undefined' && localStorage.getItem('loc
const appLocale = isZhCN ? cnLocale : enLocale;
addLocaleData(appLocale.data);
export default (props) => {
return (
<IntlProvider locale={appLocale.locale} messages={appLocale.messages}>
<div className="page-wrapper">
<Header {...props} />
{props.children}
<Footer />
</div>
</IntlProvider>
);
};
let gaListenerSetted = false;
export default class Layout extends React.Component {
static contextTypes = {
router: React.PropTypes.object.isRequired,
}
componentDidMount() {
if (typeof ga !== 'undefined' && !gaListenerSetted) {
this.context.router.listen((loc) => {
window.ga('send', 'pageview', loc.pathname + loc.search);
});
gaListenerSetted = true;
}
}
render() {
const props = this.props;
return (
<IntlProvider locale={appLocale.locale} messages={appLocale.messages}>
<div className="page-wrapper">
<Header {...props} />
{props.children}
<Footer />
</div>
</IntlProvider>
);
}
}