2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-09-24 16:40:55 -06:00

Merge f861b998fee97f9b618055ebc08379110ac4dceb into aa0304fdaa85ba2cb80d2541547f842d1428f229

This commit is contained in:
Benedikt Rötsch 2019-04-18 13:27:05 +00:00 committed by GitHub
commit 493667605d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 709 additions and 447 deletions

47
package-lock.json generated
View File

@ -1991,8 +1991,7 @@
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
@ -2013,14 +2012,12 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -2035,20 +2032,17 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -2165,8 +2159,7 @@
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -2178,7 +2171,6 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@ -2193,7 +2185,6 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
@ -2201,14 +2192,12 @@
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.3.5", "version": "2.3.5",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@ -2227,7 +2216,6 @@
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
@ -2308,8 +2296,7 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -2321,7 +2308,6 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@ -2407,8 +2393,7 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
@ -2444,7 +2429,6 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
@ -2464,7 +2448,6 @@
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
@ -2508,14 +2491,12 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.0.3", "version": "3.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
} }
} }
}, },
@ -4157,6 +4138,12 @@
"integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=",
"dev": true "dev": true
}, },
"prettier": {
"version": "1.17.0",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.17.0.tgz",
"integrity": "sha512-sXe5lSt2WQlCbydGETgfm1YBShgOX4HxQkFPvbxkcwgDvGDeqVau8h+12+lmSVlP3rHPz0oavfddSZg/q+Szjw==",
"dev": true
},
"pretty-hrtime": { "pretty-hrtime": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz",

View File

@ -33,6 +33,7 @@
"gulp-header": "^2.0.7", "gulp-header": "^2.0.7",
"gulp-rename": "^1.4.0", "gulp-rename": "^1.4.0",
"gulp-uglify": "^3.0.1", "gulp-uglify": "^3.0.1",
"prettier": "1.17.0",
"typescript": "^3.3.3", "typescript": "^3.3.3",
"vinyl-buffer": "^1.0.0", "vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^2.0.0" "vinyl-source-stream": "^2.0.0"
@ -40,6 +41,12 @@
"repository": "github:Ionaru/easy-markdown-editor", "repository": "github:Ionaru/easy-markdown-editor",
"scripts": { "scripts": {
"prepare": "gulp", "prepare": "gulp",
"test:types": "tsc --project types/tsconfig.json" "test:types": "tsc --project types/tsconfig.json",
"format": "prettier --write 'src/**/*' && eslint --fix"
},
"prettier": {
"trailingComma": "es5",
"tabWidth": 4,
"singleQuote": true
} }
} }

View File

@ -32,7 +32,7 @@
} }
.CodeMirror-placeholder { .CodeMirror-placeholder {
opacity: .5; opacity: 0.5;
} }
.CodeMirror-focused .CodeMirror-selected { .CodeMirror-focused .CodeMirror-selected {
@ -62,11 +62,11 @@
} }
.editor-toolbar:before { .editor-toolbar:before {
margin-bottom: 8px margin-bottom: 8px;
} }
.editor-toolbar:after { .editor-toolbar:after {
margin-top: 8px margin-top: 8px;
} }
.editor-toolbar.fullscreen { .editor-toolbar.fullscreen {
@ -90,12 +90,38 @@
.editor-toolbar.fullscreen::before { .editor-toolbar.fullscreen::before {
width: 20px; width: 20px;
height: 50px; height: 50px;
background: -moz-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%); background: -moz-linear-gradient(
background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 1)), color-stop(100%, rgba(255, 255, 255, 0))); left,
background: -webkit-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%); rgba(255, 255, 255, 1) 0%,
background: -o-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%); rgba(255, 255, 255, 0) 100%
background: -ms-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%); );
background: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%); background: -webkit-gradient(
linear,
left top,
right top,
color-stop(0%, rgba(255, 255, 255, 1)),
color-stop(100%, rgba(255, 255, 255, 0))
);
background: -webkit-linear-gradient(
left,
rgba(255, 255, 255, 1) 0%,
rgba(255, 255, 255, 0) 100%
);
background: -o-linear-gradient(
left,
rgba(255, 255, 255, 1) 0%,
rgba(255, 255, 255, 0) 100%
);
background: -ms-linear-gradient(
left,
rgba(255, 255, 255, 1) 0%,
rgba(255, 255, 255, 0) 100%
);
background: linear-gradient(
to right,
rgba(255, 255, 255, 1) 0%,
rgba(255, 255, 255, 0) 100%
);
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
@ -106,12 +132,38 @@
.editor-toolbar.fullscreen::after { .editor-toolbar.fullscreen::after {
width: 20px; width: 20px;
height: 50px; height: 50px;
background: -moz-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%); background: -moz-linear-gradient(
background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 0)), color-stop(100%, rgba(255, 255, 255, 1))); left,
background: -webkit-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%); rgba(255, 255, 255, 0) 0%,
background: -o-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%); rgba(255, 255, 255, 1) 100%
background: -ms-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%); );
background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%); background: -webkit-gradient(
linear,
left top,
right top,
color-stop(0%, rgba(255, 255, 255, 0)),
color-stop(100%, rgba(255, 255, 255, 1))
);
background: -webkit-linear-gradient(
left,
rgba(255, 255, 255, 0) 0%,
rgba(255, 255, 255, 1) 100%
);
background: -o-linear-gradient(
left,
rgba(255, 255, 255, 0) 0%,
rgba(255, 255, 255, 1) 100%
);
background: -ms-linear-gradient(
left,
rgba(255, 255, 255, 0) 0%,
rgba(255, 255, 255, 1) 100%
);
background: linear-gradient(
to right,
rgba(255, 255, 255, 0) 0%,
rgba(255, 255, 255, 1) 100%
);
position: fixed; position: fixed;
top: 0; top: 0;
right: 0; right: 0;
@ -150,7 +202,7 @@
} }
.editor-toolbar button:after { .editor-toolbar button:after {
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
font-size: 65%; font-size: 65%;
vertical-align: text-bottom; vertical-align: text-bottom;
position: relative; position: relative;
@ -158,27 +210,27 @@
} }
.editor-toolbar button.heading-1:after { .editor-toolbar button.heading-1:after {
content: "1"; content: '1';
} }
.editor-toolbar button.heading-2:after { .editor-toolbar button.heading-2:after {
content: "2"; content: '2';
} }
.editor-toolbar button.heading-3:after { .editor-toolbar button.heading-3:after {
content: "3"; content: '3';
} }
.editor-toolbar button.heading-bigger:after { .editor-toolbar button.heading-bigger:after {
content: "▲"; content: '▲';
} }
.editor-toolbar button.heading-smaller:after { .editor-toolbar button.heading-smaller:after {
content: "▼"; content: '▼';
} }
.editor-toolbar.disabled-for-preview button:not(.no-disable) { .editor-toolbar.disabled-for-preview button:not(.no-disable) {
opacity: .6; opacity: 0.6;
pointer-events: none; pointer-events: none;
} }
@ -202,15 +254,15 @@
} }
.editor-statusbar .lines:before { .editor-statusbar .lines:before {
content: 'lines: ' content: 'lines: ';
} }
.editor-statusbar .words:before { .editor-statusbar .words:before {
content: 'words: ' content: 'words: ';
} }
.editor-statusbar .characters:before { .editor-statusbar .characters:before {
content: 'characters: ' content: 'characters: ';
} }
.editor-preview { .editor-preview {
@ -244,16 +296,16 @@
} }
.editor-preview-active-side { .editor-preview-active-side {
display: block display: block;
} }
.editor-preview-active { .editor-preview-active {
display: block display: block;
} }
.editor-preview > p, .editor-preview > p,
.editor-preview-side > p { .editor-preview-side > p {
margin-top: 0 margin-top: 0;
} }
.editor-preview pre, .editor-preview pre,
@ -303,7 +355,7 @@
} }
.cm-s-easymde .cm-comment { .cm-s-easymde .cm-comment {
background: rgba(0, 0, 0, .05); background: rgba(0, 0, 0, 0.05);
border-radius: 2px; border-radius: 2px;
} }

View File

@ -3,7 +3,7 @@
var CodeMirror = require('codemirror'); var CodeMirror = require('codemirror');
CodeMirror.commands.tabAndIndentMarkdownList = function (cm) { CodeMirror.commands.tabAndIndentMarkdownList = function(cm) {
var ranges = cm.listSelections(); var ranges = cm.listSelections();
var pos = ranges[0].head; var pos = ranges[0].head;
var eolState = cm.getStateAfter(pos.line); var eolState = cm.getStateAfter(pos.line);
@ -16,14 +16,13 @@ CodeMirror.commands.tabAndIndentMarkdownList = function (cm) {
if (cm.options.indentWithTabs) { if (cm.options.indentWithTabs) {
cm.execCommand('insertTab'); cm.execCommand('insertTab');
} } else {
else {
var spaces = Array(cm.options.tabSize + 1).join(' '); var spaces = Array(cm.options.tabSize + 1).join(' ');
cm.replaceSelection(spaces); cm.replaceSelection(spaces);
} }
}; };
CodeMirror.commands.shiftTabAndUnindentMarkdownList = function (cm) { CodeMirror.commands.shiftTabAndUnindentMarkdownList = function(cm) {
var ranges = cm.listSelections(); var ranges = cm.listSelections();
var pos = ranges[0].head; var pos = ranges[0].head;
var eolState = cm.getStateAfter(pos.line); var eolState = cm.getStateAfter(pos.line);
@ -36,8 +35,7 @@ CodeMirror.commands.shiftTabAndUnindentMarkdownList = function (cm) {
if (cm.options.indentWithTabs) { if (cm.options.indentWithTabs) {
cm.execCommand('insertTab'); cm.execCommand('insertTab');
} } else {
else {
var spaces = Array(cm.options.tabSize + 1).join(' '); var spaces = Array(cm.options.tabSize + 1).join(' ');
cm.replaceSelection(spaces); cm.replaceSelection(spaces);
} }

File diff suppressed because it is too large Load Diff