markdown-text-editor 0.0.21-beta.2 → 0.0.23-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +165 -79
- package/dist/index.css +76 -175
- package/dist/index.css.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/markdown-text-editor.css +76 -175
- package/dist/markdown-text-editor.css.map +1 -1
- package/dist/markdown-text-editor.js +1 -1
- package/dist/markdown-text-editor.js.map +1 -1
- package/package.json +6 -4
- package/src/plugins/markdown/Toolbar/tools/MarkdownTool.js +1 -0
- package/src/plugins/markdown/Toolbar/tools/PreviewTool.js +9 -3
- package/src/plugins/markdown/editor.js +2 -0
- package/src/plugins/markdown/preview.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markdown-text-editor",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23-beta.3",
|
|
4
4
|
"description": "A powerful, easy-to-use Markdown editor with a real-time preview, syntax highlighting. Ideal for developers, writers, and content creators who need a seamless, interactive writing experience with full Markdown support.",
|
|
5
5
|
"main": "./dist/markdown-text-editor.js",
|
|
6
6
|
"browser": "dist/markdown-text-editor.js",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"url": "https://github.com/nezanuha/markdown-text-editor"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
-
"clean": "
|
|
17
|
+
"clean": "rimraf dist",
|
|
18
18
|
"build": "npm run clean && webpack --mode=production",
|
|
19
19
|
"prepublishOnly": "npm run build",
|
|
20
|
-
"dev": "webpack
|
|
20
|
+
"dev": "webpack serve --mode=development"
|
|
21
21
|
},
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -51,13 +51,15 @@
|
|
|
51
51
|
"autoprefixer": "^10.4.20",
|
|
52
52
|
"babel-loader": "^9.2.1",
|
|
53
53
|
"css-loader": "^7.1.2",
|
|
54
|
+
"html-webpack-plugin": "^5.6.3",
|
|
54
55
|
"mini-css-extract-plugin": "^2.9.1",
|
|
55
56
|
"postcss": "^8.4.47",
|
|
56
57
|
"postcss-loader": "^8.1.1",
|
|
58
|
+
"rimraf": "^6.0.1",
|
|
57
59
|
"style-loader": "^4.0.0",
|
|
58
60
|
"terser-webpack-plugin": "^5.3.11",
|
|
59
61
|
"webpack": "^5.95.0",
|
|
60
62
|
"webpack-cli": "^6.0.1",
|
|
61
|
-
"webpack-dev-server": "^5.
|
|
63
|
+
"webpack-dev-server": "^5.2.0"
|
|
62
64
|
}
|
|
63
65
|
}
|
|
@@ -11,6 +11,7 @@ class MarkdownTool {
|
|
|
11
11
|
createButton(iconHtml) {
|
|
12
12
|
const button = document.createElement('button');
|
|
13
13
|
button.innerHTML = iconHtml; // Pass icon HTML from child classes
|
|
14
|
+
button.type='button';
|
|
14
15
|
button.className = 'markdown-btn p-2 hover:bg-stone-200 dark:hover:bg-stone-600 rounded duration-300';
|
|
15
16
|
button.addEventListener('click', () => this.applySyntax());
|
|
16
17
|
return button;
|
|
@@ -36,6 +36,7 @@ class PreviewTool extends MarkdownTool {
|
|
|
36
36
|
editorDiv.parentNode.classList.toggle('top-0');
|
|
37
37
|
editorDiv.parentNode.classList.toggle('inset-x-0');
|
|
38
38
|
editorDiv.parentNode.classList.toggle('rounded-md');
|
|
39
|
+
editorDiv.parentNode.classList.toggle('z-[999]');
|
|
39
40
|
|
|
40
41
|
previewWrapper.classList.toggle('hidden');
|
|
41
42
|
|
|
@@ -44,16 +45,19 @@ class PreviewTool extends MarkdownTool {
|
|
|
44
45
|
'md:grid',
|
|
45
46
|
'md:grid-cols-2',
|
|
46
47
|
'md:divide-x',
|
|
48
|
+
'rtl:md:divide-x-reverse',
|
|
47
49
|
'md:divide-stone-300',
|
|
48
50
|
'dark:md:divide-stone-700'
|
|
49
51
|
);
|
|
50
52
|
|
|
51
53
|
editorDiv.querySelector(".textarea-wrapper").classList.remove(
|
|
52
|
-
'h-
|
|
54
|
+
'h-[90lvh]',
|
|
53
55
|
'hidden',
|
|
54
56
|
'md:block'
|
|
55
57
|
);
|
|
56
58
|
this.editor.render(); // Re-render content in the preview
|
|
59
|
+
|
|
60
|
+
editorDiv.querySelector(".textarea-wrapper").querySelector("textarea").classList.remove("!h-[90lvh]");
|
|
57
61
|
|
|
58
62
|
document.querySelector("body").classList.remove('overflow-hidden');
|
|
59
63
|
}
|
|
@@ -67,6 +71,7 @@ class PreviewTool extends MarkdownTool {
|
|
|
67
71
|
editorDiv.parentNode.classList.toggle('top-0');
|
|
68
72
|
editorDiv.parentNode.classList.toggle('inset-x-0');
|
|
69
73
|
editorDiv.parentNode.classList.toggle('rounded-md');
|
|
74
|
+
editorDiv.parentNode.classList.toggle('z-[999]');
|
|
70
75
|
|
|
71
76
|
previewWrapper.classList.toggle('hidden');
|
|
72
77
|
// Remove grid layout and divide classes from the editor div
|
|
@@ -74,16 +79,17 @@ class PreviewTool extends MarkdownTool {
|
|
|
74
79
|
'md:grid',
|
|
75
80
|
'md:grid-cols-2',
|
|
76
81
|
'md:divide-x',
|
|
82
|
+
'rtl:md:divide-x-reverse',
|
|
77
83
|
'md:divide-stone-300',
|
|
78
84
|
'dark:md:divide-stone-700'
|
|
79
85
|
);
|
|
80
86
|
|
|
81
87
|
editorDiv.querySelector(".textarea-wrapper").classList.add(
|
|
82
|
-
'h-
|
|
88
|
+
'h-[90lvh]',
|
|
83
89
|
'hidden',
|
|
84
90
|
'md:block'
|
|
85
91
|
);
|
|
86
|
-
|
|
92
|
+
editorDiv.querySelector(".textarea-wrapper").querySelector("textarea").classList.add("!h-[90lvh]");
|
|
87
93
|
|
|
88
94
|
document.querySelector("body").classList.add('overflow-hidden');
|
|
89
95
|
}
|
|
@@ -4,7 +4,7 @@ class Preview {
|
|
|
4
4
|
this.previewContainer = document.createElement('div');
|
|
5
5
|
this.previewContainer.className = 'preview-wrapper bg-white dark:bg-stone-800 p-2 hidden';
|
|
6
6
|
this.previewContent = document.createElement('div');
|
|
7
|
-
this.previewContent.className = 'preview-content prose prose-sm md:prose-base dark:prose-invert p-1.5 overflow-y-auto h-
|
|
7
|
+
this.previewContent.className = 'preview-content prose prose-sm md:prose-base dark:prose-invert p-1.5 overflow-y-auto h-[90lvh] max-w-max';
|
|
8
8
|
this.previewContainer.appendChild(this.previewContent);
|
|
9
9
|
container.appendChild(this.previewContainer);
|
|
10
10
|
}
|