Skip to content

Commit 4c00419

Browse files
committed
Fix commands; Fix build; Fix default IconProvider
1 parent b8be100 commit 4c00419

File tree

12 files changed

+679
-11134
lines changed

12 files changed

+679
-11134
lines changed

docs-md/ChangeLogMigrating.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Change log / Migrating
22

3+
## From 6.* to 7.*
4+
5+
Major differences
6+
7+
- No more Draft.js
8+
- No more FontAwesome, even though you can still use it if you want
9+
- No more external dependencies
10+
311
## From 5.* to 6.*
412

513
Major differences

gulpfile.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ gulp.task('copy-index', function () {
3939
});
4040

4141
gulp.task('build-demo', ['copy-index'], function () {
42-
return gulp.src('demo/client.ts')
43-
.pipe(webpackStream(require('./webpack.config.demo.prod.js'), require("webpack")))
44-
.pipe(gulp.dest('docs/'));
42+
return gulp.src('demo/client.ts')
43+
.pipe(webpackStream(require('./webpack.config.demo.prod.js'), require("webpack")))
44+
.pipe(gulp.dest('docs/'))
4545
});
4646

4747
// all

package-lock.json

Lines changed: 607 additions & 479 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-mde",
3-
"version": "6.0.0",
3+
"version": "7.0.0-alpha.2",
44
"description": "React Markdown Editor",
55
"main": "./lib/js/index.js",
66
"types": "./lib/definitions/index.d.ts",
@@ -45,7 +45,7 @@
4545
"@types/showdown": "^1.7.2",
4646
"@types/webpack-dev-middleware": "^2.0.0",
4747
"@types/webpack-hot-middleware": "^2.16.2",
48-
"awesome-typescript-loader": "^5.0.0",
48+
"awesome-typescript-loader": "^5.2.1",
4949
"babel-core": "^6.26.3",
5050
"cross-env": "^5.1.3",
5151
"css-loader": "^0.28.10",
@@ -79,8 +79,8 @@
7979
"ts-jest": "^23.10.5",
8080
"ts-node": "^7.0.0",
8181
"typescript": "^3.0.1",
82-
"webpack": "^4.14.0",
83-
"webpack-cli": "^3.0.8",
82+
"webpack": "^4.29.3",
83+
"webpack-cli": "^3.2.3",
8484
"webpack-dev-middleware": "^3.1.3",
8585
"webpack-hot-middleware": "^2.21.0",
8686
"webpack-stream": "^5.1.1"
@@ -93,7 +93,6 @@
9393
},
9494
"dependencies": {
9595
"classnames": "^2.2.5",
96-
"insert-text-at-cursor": "^0.1.1",
9796
"npm": "^6.1.0"
9897
}
9998
}

readme.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# react-mde
22

3-
A simple yet powerful and extensible Markdown Editor editor for React. React-mde is built on top of [Draft.js](https://draftjs.org/).
4-
5-
> Warning, react-mde is passing through breaking changes. This documentation refers to the new 6.0 version which is
6-
still in alpha. Please check [the change log](https://github.com/andrerpena/react-mde/blob/master/docs-md/ChangeLogMigrating.md),
7-
the [original issue](https://github.com/andrerpena/react-mde/issues/136)
8-
and the [old docs](https://github.com/andrerpena/react-mde/blob/master/docs-md/5.*-readme.md).
3+
A simple yet powerful and extensible Markdown Editor editor for React.
94

105
## Demo
116

src/commands/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,16 @@ const getDefaultCommands: () => CommandGroup[] = () => [
2323

2424
export {
2525
boldCommand,
26+
italicCommand,
27+
strikeThroughCommand,
28+
CommandGroup,
29+
headerCommand,
30+
linkCommand,
31+
quoteCommand,
32+
codeCommand,
33+
imageCommand,
34+
checkedListCommand,
35+
orderedListCommand,
36+
unorderedListCommand,
2637
getDefaultCommands
2738
};

src/components/ReactMde.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
import * as React from "react";
22
import {
3-
Command,
4-
GenerateMarkdownPreview, CommandGroup, GetIcon
3+
Command, CommandGroup,
4+
GenerateMarkdownPreview, GetIcon
55
} from "../types";
66
import {getDefaultCommands} from "../commands";
7-
import {TextArea, MdePreview, MdeToolbar, MdeFontAwesomeIcon} from ".";
7+
import { MdePreview, MdeToolbar, TextArea} from ".";
88
import {extractCommandMap} from "../util/CommandUtils";
99
import {Tab} from "../types/Tab";
1010
import {L18n} from "..";
1111
import {enL18n} from "../l18n/react-mde.en";
1212
import {CommandOrchestrator, TextAreaCommandOrchestrator} from "../commandOrchestrator";
1313
import {classNames} from "../util/ClassNames";
14+
import {SvgIcon} from "../icons/SvgIcon";
1415

1516
export interface ReactMdeProps {
1617
value: string;
@@ -52,7 +53,7 @@ export class ReactMde extends React.Component<ReactMdeProps, ReactMdeState> {
5253

5354
static defaultProps: Partial<ReactMdeProps> = {
5455
commands: getDefaultCommands(),
55-
getIconFromProvider: name => <MdeFontAwesomeIcon icon={name}/>,
56+
getIconFromProvider: name => <SvgIcon icon={name}/>,
5657
emptyPreviewHtml: "<p>&nbsp;</p>",
5758
readOnly: false,
5859
l18n: enL18n,

src/icons/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
export interface IconProviderProps {
22
icon: string;
3-
}
3+
}
4+
5+
export * from "./MdeFontAwesomeIcon";
6+
export * from "./SvgIcon";

src/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
import * as MarkdownUtil from "./util/MarkdownUtil"
2+
import * as commands from "./commands";
23
import { ReactMde, ReactMdeProps } from "./components";
4+
import { IconProviderProps, SvgIcon, MdeFontAwesomeIcon } from "./icons";
35
import { L18n } from "./types/L18n";
46

57

68
export {
79
ReactMdeProps,
810
MarkdownUtil,
9-
L18n
11+
L18n,
12+
SvgIcon,
13+
MdeFontAwesomeIcon,
14+
IconProviderProps,
15+
commands
1016
};
1117

1218
export default ReactMde;

tsconfig.demo.prod.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"compilerOptions": {
3+
"outDir": "ts-build",
4+
"noImplicitAny": false,
5+
"jsx": "react",
6+
"target": "es5",
7+
"module": "commonjs",
8+
"typeRoots": [
9+
"./node_modules/@types"
10+
],
11+
"lib": [
12+
"dom",
13+
"es2015",
14+
"es2015.collection",
15+
"es2016",
16+
"es2016.array.include"
17+
]
18+
},
19+
"include": [
20+
"./src/**/*.ts",
21+
"./src/**/*.tsx",
22+
"./test/**/*.ts",
23+
"./demo/**/*.ts",
24+
"./demo/**/*.tsx"
25+
]
26+
}

0 commit comments

Comments
 (0)