Skip to content

Commit

Permalink
use babel-plugin-impurt load antd
Browse files Browse the repository at this point in the history
  • Loading branch information
jljsj33 committed Jan 4, 2017
1 parent 4eafce4 commit 1914882
Show file tree
Hide file tree
Showing 46 changed files with 65 additions and 143 deletions.
6 changes: 4 additions & 2 deletions bisheng.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const path = require('path');
module.exports = {
source: [
'./language',
Expand All @@ -25,9 +24,12 @@ module.exports = {
'bisheng-plugin-toc?maxDepth=2',
'bisheng-plugin-react?lang=__react',
'bisheng-plugin-antd',
//'./src/bisheng-plugin-antm',
],
webpackConfig(config) {
config.babel.plugins.push(['import', {
libraryName: 'antd',
style: true,
}]);
config.resolve.alias = {
'react-router': 'react-router/umd/ReactRouter',
};
Expand Down
2 changes: 1 addition & 1 deletion components/animate/demo/appear.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: 开始的进场

```jsx
import Animate from 'rc-animate';
import Button from 'antd/lib/button';
import { Button } from 'antd';
class Test extends React.Component{
constructor() {
super(...arguments);
Expand Down
2 changes: 1 addition & 1 deletion components/animate/demo/remove.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: 删除子级

```jsx
import Animate from 'rc-animate';
import Button from 'antd/lib/button';
import { Button } from 'antd';
class Test extends React.Component{
constructor() {
super(...arguments);
Expand Down
2 changes: 1 addition & 1 deletion components/animate/demo/simple.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: 简单的例子

```jsx
import Animate from 'rc-animate';
import Button from 'antd/lib/button';
import { Button } from 'antd';
const Div = (props) => {
const childrenProps = { ...props };
delete childrenProps.show;
Expand Down
2 changes: 1 addition & 1 deletion exhibition/demo/detail-switch.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ image: https://zos.alipayobjects.com/rmsportal/cvLbMZkjkNvqbVF.png
import BannerAnim from 'rc-banner-anim';
import QueueAnim from 'rc-queue-anim';
import { TweenOneGroup } from 'rc-tween-one';
import Icon from 'antd/lib/icon';
import { Icon } from 'antd';

const Element = BannerAnim.Element;

Expand Down
2 changes: 1 addition & 1 deletion exhibition/demo/list-sort.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ image: https://zos.alipayobjects.com/rmsportal/BgYxbsXLrUfkkRT.png
ListSort 组件地址: [地址](https://github.com/ant-design/ant-motion/blob/master/src/edit/template/components/ListSort.jsx)

```jsx
import Icon from 'antd/lib/icon';
import { Icon } from 'antd';
import ListSort from '../../src/edit/template/components/ListSort';

const dataArray = [
Expand Down
7 changes: 1 addition & 6 deletions exhibition/demo/logo-gather-anim.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@ image: https://zos.alipayobjects.com/rmsportal/YsRZqQwpiAVgWrX.png
```jsx
import TweenOne, { TweenOneGroup } from 'rc-tween-one';
import ticker from 'rc-tween-one/lib/ticker';
import Input from 'antd/lib/input';
import Button from 'antd/lib/button';
import InputNumber from 'antd/lib/input-number';
import Radio from 'antd/lib/radio';
import 'antd/lib/input-number/style/index.less';
import 'antd/lib/radio/style/index.less';
import { Input, Button, InputNumber, Radio } from 'antd';

const RadioGroup = Radio.Group;

Expand Down
2 changes: 1 addition & 1 deletion exhibition/demo/pic-details-anim.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ image: https://zos.alipayobjects.com/rmsportal/RJoNICBzRCkOsMv.png
```jsx
import QueueAnim from 'rc-queue-anim';
import TweenOne, { TweenOneGroup } from 'rc-tween-one';
import Icon from 'antd/lib/icon';
import { Icon } from 'antd';

const textData = {
content: 'Taiwan called motorcycle, motor bike [1] or a motorcycle,' +
Expand Down
6 changes: 1 addition & 5 deletions exhibition/demo/table-enter-leave.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@ image: https://zos.alipayobjects.com/rmsportal/wJDizWNyyxVhULT.png
此效果为设计语言里的对象增加与对象删除的实现。[查看视频演示](/language/interact)

```jsx
import Table from 'antd/lib/table';
import { Table, Button } from 'antd';
import QueueAnim from 'rc-queue-anim';
import { TweenOneGroup } from 'rc-tween-one';
import Button from 'antd/lib/button';
import 'antd/lib/table/style/index.less';
import 'antd/lib/spin/style/index.less';
import 'antd/lib/pagination/style/index.less';

class TableEnterLeave extends React.Component {
static propTypes = {
Expand Down
2 changes: 1 addition & 1 deletion exhibition/js/detail-swich.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import BannerAnim from 'rc-banner-anim';
import QueueAnim from 'rc-queue-anim';
import { TweenOneGroup } from 'rc-tween-one';
import Icon from 'antd/lib/icon';
import { Icon } from 'antd';
import './detail-swich.css';

const Element = BannerAnim.Element;
Expand Down
2 changes: 1 addition & 1 deletion exhibition/js/list-sort.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Icon from 'antd/lib/icon';
import { Icon } from 'antd';
import ListSort from '../../src/edit/template/components/ListSort';
import './list-sort.css';

Expand Down
7 changes: 1 addition & 6 deletions exhibition/js/logo-gather-anim.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom';
import TweenOne, { TweenOneGroup } from 'rc-tween-one';
import ticker from 'rc-tween-one/lib/ticker';
import Input from 'antd/lib/input';
import Button from 'antd/lib/button';
import InputNumber from 'antd/lib/input-number';
import Radio from 'antd/lib/radio';
import 'antd/lib/input-number/style/index.less';
import 'antd/lib/radio/style/index.less';
import { Input, Button, InputNumber, Radio } from 'antd';
import './logo-gather-anim.css';

const RadioGroup = Radio.Group;
Expand Down
2 changes: 1 addition & 1 deletion exhibition/js/pic-details-anim.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import QueueAnim from 'rc-queue-anim';
import TweenOne, { TweenOneGroup } from 'rc-tween-one';
import Icon from 'antd/lib/icon';
import { Icon } from 'antd';
import './pic-details-anim.css';

const textData = {
Expand Down
6 changes: 1 addition & 5 deletions exhibition/js/table-enter-leave.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import React from 'react';
import Table from 'antd/lib/table';
import { Table, Button } from 'antd';
import QueueAnim from 'rc-queue-anim';
import { TweenOneGroup } from 'rc-tween-one';
import Button from 'antd/lib/button';
import 'antd/lib/table/style/index.less';
import 'antd/lib/spin/style/index.less';
import 'antd/lib/pagination/style/index.less';
import './table-enter-leave.css';

export default class TableEnterLeave extends React.Component {
Expand Down
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ant-motion",
"version": "1.4.0",
"dependencies": {
"antd": "~2.5.0",
"antd": "~2.6.0",
"autoresponsive-react": "1.1.x",
"deepcopy": "^0.6.3",
"file-saver": "^1.3.2",
Expand All @@ -27,16 +27,15 @@
"tween-functions": "^1.2.0"
},
"devDependencies": {
"bluebird": "^3.4.0",
"pre-commit": "1.x",
"babel-eslint": "^7.1.1",
"babel-plugin-antd": "~0.5.1",
"prismjs": "^1.5.1",
"babel-plugin-import": "^1.1.0",
"bisheng": "^0.13.0",
"bisheng-plugin-antd": "~0.3.0",
"bisheng-plugin-description": "^0.1.1",
"bisheng-plugin-react": "^0.2.0",
"bisheng-plugin-toc": "^0.3.0",
"bluebird": "^3.4.0",
"dora-plugin-upload": "^0.3.1",
"eslint": "^3.8.0",
"eslint-config-airbnb": "latest",
Expand All @@ -45,7 +44,9 @@
"eslint-plugin-jsx-a11y": "^2.0.1",
"eslint-plugin-markdown": "*",
"eslint-plugin-react": "^6.1.2",
"eslint-tinker": "^0.4.0"
"eslint-tinker": "^0.4.0",
"pre-commit": "1.x",
"prismjs": "^1.5.1"
},
"pre-commit": [
"lint"
Expand All @@ -60,5 +61,6 @@
"demolint": "RUN_ENV=DEMO eslint components/*/demo/*.md --ext '.md'",
"eslint-fix": "eslint --fix ./src ./exhibition --ext '.js,.jsx'",
"test": "echo \"Error: no test specified\" && exit 1"
}
},
"theme": "./theme.js"
}
14 changes: 0 additions & 14 deletions src/edit/static/ant-d.less

This file was deleted.

1 change: 0 additions & 1 deletion src/edit/static/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ import './list-view.less';
import './other-view.less';
import './preview.less';
import './edit-state.less';
import './ant-d.less';

3 changes: 1 addition & 2 deletions src/edit/template/components/ContentController.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { PropTypes } from 'react';
import Tabs from 'antd/lib/tabs';
import Tooltip from 'antd/lib/tooltip';
import { Tabs, Tooltip } from 'antd';
import ListView from './ListView';
import EditView from './EditView';
import OtherView from './OtherView';
Expand Down
7 changes: 1 addition & 6 deletions src/edit/template/components/EditView.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import React, { PropTypes } from 'react';
import ReactDOM from 'react-dom';
import Icon from 'antd/lib/icon';
import Tooltip from 'antd/lib/tooltip';
import Button from 'antd/lib/button';
import Input from 'antd/lib/input';
import InputNumber from 'antd/lib/input-number';
import Select from 'antd/lib/select';
import { Icon, Tooltip, Button, Input, InputNumber, Select } from 'antd';
import { TweenOneGroup } from 'rc-tween-one';
import SketchPicker from 'react-color';
import deepCopy from 'deepcopy';
Expand Down
6 changes: 1 addition & 5 deletions src/edit/template/components/ListView.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import React, { PropTypes } from 'react';
import Icon from 'antd/lib/icon';
import Modal from 'antd/lib/modal';
import Alert from 'antd/lib/alert';
import Checkbox from 'antd/lib/checkbox';
import InputNumber from 'antd/lib/input-number';
import { Icon, Modal, Alert, Checkbox, InputNumber } from 'antd';
import { TweenOneGroup } from 'rc-tween-one';
import ListSort from './ListSort';
import webData from './../template.config';
Expand Down
6 changes: 1 addition & 5 deletions src/edit/template/components/NavController.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import React, { PropTypes } from 'react';
import Button from 'antd/lib/button';
import Icon from 'antd/lib/icon';
import Modal from 'antd/lib/modal';
// import Tooltip from 'antd/lib/tooltip';
import message from 'antd/lib/message';
import { Button, Icon, Modal, message } from 'antd';
import CopyToClipboard from 'react-copy-to-clipboard';
import saveJsZip from './saveJsZip';

Expand Down
2 changes: 1 addition & 1 deletion src/edit/template/components/OtherView.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { PropTypes } from 'react';
import Checkbox from 'antd/lib/checkbox';
import { Checkbox } from 'antd';
import webData from './../template.config';

export default class OtherView extends React.Component {
Expand Down
6 changes: 0 additions & 6 deletions src/templates/static/ant-d.less

This file was deleted.

1 change: 0 additions & 1 deletion src/templates/static/common.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import 'ant-d';
@import '../../theme/static/global';

html, body {
Expand Down
2 changes: 1 addition & 1 deletion src/templates/static/custom.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@import "~antd/lib/style/themes/default.less";
@primary-color: #019BF0;

@link-color : #019BF0;
@link-hover-color : tint(@link-color, 20%);
Expand All @@ -24,6 +23,7 @@
@template-text-color: #CCC;
@template-text-title-color: #BCBCBC;
@template-text-color-light: #FFF;
@template-footer-text-color: #666;

@animate-duration: .45s;

Expand Down
2 changes: 0 additions & 2 deletions src/templates/static/lessToString.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ let point = require('!raw!./point.less');

point = point.replace('../../../static/custom.less', './custom.less');

const antD = require('!raw!./ant-d.less');
const global = require('!raw!../../theme/static/global.less');
let common = require('!raw!./common.less');

Expand All @@ -12,7 +11,6 @@ const custom = require('!raw!./custom.less');
const content = require('!raw!./content.less');

export default {
'ant-d': antD,
global,
common,
custom,
Expand Down
3 changes: 1 addition & 2 deletions src/templates/template/element/Content0/index.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React, { PropTypes } from 'react';
import Button from 'antd/lib/button';
import { Button, Icon } from 'antd';
import QueueAnim from 'rc-queue-anim';
import TweenOne from 'rc-tween-one';
import Icon from 'antd/lib/icon';
import OverPack from 'rc-scroll-anim/lib/ScrollOverPack';
import './index.less';

Expand Down
3 changes: 1 addition & 2 deletions src/templates/template/element/Content0/index.text
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React, { PropTypes } from 'react';
import Button from 'antd/lib/button';
import { Button, Icon } from 'antd';
import QueueAnim from 'rc-queue-anim';
import TweenOne from 'rc-tween-one';
import Icon from 'antd/lib/icon';
import OverPack from 'rc-scroll-anim/lib/ScrollOverPack';

class Content extends React.Component {
Expand Down
3 changes: 1 addition & 2 deletions src/templates/template/element/Content1/index.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React, { PropTypes } from 'react';
import Button from 'antd/lib/button';
import { Button, Icon } from 'antd';
import QueueAnim from 'rc-queue-anim';
import TweenOne from 'rc-tween-one';
import BannerAnim, { Element } from 'rc-banner-anim';
import Icon from 'antd/lib/icon';
import 'rc-banner-anim/assets/index.css';
import OverPack from 'rc-scroll-anim/lib/ScrollOverPack';
import './index.less';
Expand Down
3 changes: 1 addition & 2 deletions src/templates/template/element/Content1/index.text
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React, { PropTypes } from 'react';
import Button from 'antd/lib/button';
import { Button, Icon } from 'antd';
import QueueAnim from 'rc-queue-anim';
import TweenOne from 'rc-tween-one';
import BannerAnim, { Element } from 'rc-banner-anim';
import Icon from 'antd/lib/icon';
import 'rc-banner-anim/assets/index.css';
import OverPack from 'rc-scroll-anim/lib/ScrollOverPack';

Expand Down
3 changes: 1 addition & 2 deletions src/templates/template/element/Content8/index.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import TweenOne from 'rc-tween-one';
import OverPack from 'rc-scroll-anim/lib/ScrollOverPack';
import Tabs from 'antd/lib/tabs';
import 'antd/lib/tabs/style';
import { Tabs } from 'antd';
import '../../../static/content.less';
import './index.less';

Expand Down
3 changes: 1 addition & 2 deletions src/templates/template/element/Content8/index.text
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import TweenOne from 'rc-tween-one';
import OverPack from 'rc-scroll-anim/lib/ScrollOverPack';
import Tabs from 'antd/lib/tabs';
import 'antd/lib/tabs/style';
import { Tabs } from 'antd';

const TabPane = Tabs.TabPane;

Expand Down
1 change: 1 addition & 0 deletions src/templates/template/element/Footer0/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
background-color: @template-bg-color;
text-align: center;
height: 80px;
color: @template-footer-text-color;
span{
display: inline-block;
line-height: 60px;
Expand Down
1 change: 1 addition & 0 deletions src/templates/template/element/Footer1/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
height: 400px;
overflow: hidden;
position: relative;
color: @template-footer-text-color;
& > ul {
width: 95%;
max-width: 1200px;
Expand Down
2 changes: 1 addition & 1 deletion src/templates/template/element/Nav0/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { PropTypes } from 'react';
import TweenOne from 'rc-tween-one';
import Menu from 'antd/lib/menu';
import { Menu } from 'antd';
import './index.less';

const Item = Menu.Item;
Expand Down
Loading

0 comments on commit 1914882

Please sign in to comment.