markdown-text-editor 0.1.4 → 0.1.5
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/dist/index.css +7 -1
- package/dist/index.css.map +1 -1
- package/dist/markdown-text-editor.css +7 -1
- 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 +5 -4
- package/src/plugins/markdown/Toolbar/MakeTool.js +1 -1
- package/src/plugins/markdown/Toolbar/tools/PreviewTool.js +6 -6
- package/src/plugins/markdown/styles/main.css +21 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markdown-text-editor",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "A simple JavaScript Markdown editor plugin with real-time preview, and easy integration.",
|
|
5
5
|
"main": "./dist/markdown-text-editor.js",
|
|
6
6
|
"browser": "dist/markdown-text-editor.js",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"rich text editor",
|
|
39
39
|
"wysiwyg",
|
|
40
40
|
"markdown formatting",
|
|
41
|
+
"tailwindcss",
|
|
41
42
|
"code editor",
|
|
42
43
|
"editor plugin",
|
|
43
44
|
"text formatting",
|
|
@@ -61,9 +62,9 @@
|
|
|
61
62
|
"devDependencies": {
|
|
62
63
|
"@babel/core": "^7.25.2",
|
|
63
64
|
"@babel/preset-env": "^7.25.4",
|
|
65
|
+
"@tailwindcss/postcss": "^4.0.9",
|
|
64
66
|
"@tailwindcss/typography": "^0.5.15",
|
|
65
|
-
"
|
|
66
|
-
"babel-loader": "^9.2.1",
|
|
67
|
+
"babel-loader": "^10.0.0",
|
|
67
68
|
"css-loader": "^7.1.2",
|
|
68
69
|
"cssnano": "^7.0.6",
|
|
69
70
|
"html-webpack-plugin": "^5.6.3",
|
|
@@ -72,7 +73,7 @@
|
|
|
72
73
|
"postcss-loader": "^8.1.1",
|
|
73
74
|
"rimraf": "^6.0.1",
|
|
74
75
|
"style-loader": "^4.0.0",
|
|
75
|
-
"tailwindcss": "^
|
|
76
|
+
"tailwindcss": "^4.0.9",
|
|
76
77
|
"terser-webpack-plugin": "^5.3.11",
|
|
77
78
|
"webpack": "^5.95.0",
|
|
78
79
|
"webpack-cli": "^6.0.1",
|
|
@@ -13,7 +13,7 @@ class MakeTool {
|
|
|
13
13
|
button.innerHTML = iconHtml; // Pass icon HTML from child classes
|
|
14
14
|
button.type = 'button';
|
|
15
15
|
button.title = this.title;
|
|
16
|
-
button.className = `markdown-btn ${buttonClass}${buttonClass == 'preview-btn' ? ' sticky right-0 bg-stone-100 dark:bg-stone-900 ' : ' ' }p-2 hover:bg-stone-200 dark:hover:bg-stone-600 rounded duration-300 text-stone-900 dark:text-stone-100`;
|
|
16
|
+
button.className = `markdown-btn ${buttonClass}${buttonClass == 'preview-btn' ? ' sticky right-0 bg-stone-100 dark:bg-stone-900 ' : ' ' }p-2 hover:bg-stone-200 dark:hover:bg-stone-600 rounded-sm duration-300 text-stone-900 dark:text-stone-100`;
|
|
17
17
|
button.addEventListener('click', () => this.applySyntax()); // Default to 'both', can change in child
|
|
18
18
|
return button;
|
|
19
19
|
}
|
|
@@ -34,7 +34,7 @@ class PreviewTool extends MakeTool {
|
|
|
34
34
|
editorDiv.parentNode.classList.toggle('top-0');
|
|
35
35
|
editorDiv.parentNode.classList.toggle('inset-x-0');
|
|
36
36
|
editorDiv.parentNode.classList.toggle('rounded-md');
|
|
37
|
-
editorDiv.parentNode.classList.toggle('z-
|
|
37
|
+
editorDiv.parentNode.classList.toggle('z-999');
|
|
38
38
|
|
|
39
39
|
previewWrapper.classList.toggle('hidden');
|
|
40
40
|
|
|
@@ -43,7 +43,7 @@ class PreviewTool extends MakeTool {
|
|
|
43
43
|
'md:grid',
|
|
44
44
|
'md:grid-cols-2',
|
|
45
45
|
'md:divide-x',
|
|
46
|
-
'rtl:
|
|
46
|
+
'md:rtl:divide-x-reverse',
|
|
47
47
|
'md:divide-stone-300',
|
|
48
48
|
'dark:md:divide-stone-700'
|
|
49
49
|
);
|
|
@@ -55,7 +55,7 @@ class PreviewTool extends MakeTool {
|
|
|
55
55
|
);
|
|
56
56
|
this.editor.render(); // Re-render content in the preview
|
|
57
57
|
|
|
58
|
-
editorDiv.querySelector(".textarea-wrapper").querySelector("textarea").classList.remove("
|
|
58
|
+
editorDiv.querySelector(".textarea-wrapper").querySelector("textarea").classList.remove("h-[90lvh]!");
|
|
59
59
|
|
|
60
60
|
document.querySelector("body").classList.remove('overflow-hidden');
|
|
61
61
|
|
|
@@ -75,7 +75,7 @@ class PreviewTool extends MakeTool {
|
|
|
75
75
|
editorDiv.parentNode.classList.toggle('top-0');
|
|
76
76
|
editorDiv.parentNode.classList.toggle('inset-x-0');
|
|
77
77
|
editorDiv.parentNode.classList.toggle('rounded-md');
|
|
78
|
-
editorDiv.parentNode.classList.toggle('z-
|
|
78
|
+
editorDiv.parentNode.classList.toggle('z-999');
|
|
79
79
|
|
|
80
80
|
previewWrapper.classList.toggle('hidden');
|
|
81
81
|
// Remove grid layout and divide classes from the editor div
|
|
@@ -83,7 +83,7 @@ class PreviewTool extends MakeTool {
|
|
|
83
83
|
'md:grid',
|
|
84
84
|
'md:grid-cols-2',
|
|
85
85
|
'md:divide-x',
|
|
86
|
-
'rtl:
|
|
86
|
+
'md:rtl:divide-x-reverse',
|
|
87
87
|
'md:divide-stone-300',
|
|
88
88
|
'dark:md:divide-stone-700'
|
|
89
89
|
);
|
|
@@ -93,7 +93,7 @@ class PreviewTool extends MakeTool {
|
|
|
93
93
|
'hidden',
|
|
94
94
|
'md:block'
|
|
95
95
|
);
|
|
96
|
-
editorDiv.querySelector(".textarea-wrapper").querySelector("textarea").classList.add("
|
|
96
|
+
editorDiv.querySelector(".textarea-wrapper").querySelector("textarea").classList.add("h-[90lvh]!");
|
|
97
97
|
|
|
98
98
|
document.querySelector("body").classList.add('overflow-hidden');
|
|
99
99
|
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
@
|
|
2
|
-
|
|
3
|
-
@
|
|
1
|
+
@import 'tailwindcss';
|
|
2
|
+
|
|
3
|
+
@plugin '@tailwindcss/typography';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
The default border color has changed to `currentColor` in Tailwind CSS v4,
|
|
7
|
+
so we've added these compatibility styles to make sure everything still
|
|
8
|
+
looks the same as it did with Tailwind CSS v3.
|
|
9
|
+
|
|
10
|
+
If we ever want to remove these styles, we need to add an explicit border
|
|
11
|
+
color utility to any element that depends on these defaults.
|
|
12
|
+
*/
|
|
13
|
+
@layer base {
|
|
14
|
+
*,
|
|
15
|
+
::after,
|
|
16
|
+
::before,
|
|
17
|
+
::backdrop,
|
|
18
|
+
::file-selector-button {
|
|
19
|
+
border-color: var(--color-gray-200, currentColor);
|
|
20
|
+
}
|
|
21
|
+
}
|