@adminforth/rich-editor 1.2.0 → 1.2.2
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 +7 -0
- package/build.log +2 -2
- package/custom/quillEditor.vue +80 -4
- package/dist/custom/quillEditor.vue +80 -4
- package/package.json +2 -1
package/README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# AdminForth RichEditor Plugin
|
|
2
|
+
|
|
3
|
+
<img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT" /> <img src="https://woodpecker.devforth.io/api/badges/3848/status.svg" alt="Build Status" /> <a href="https://www.npmjs.com/package/@adminforth/rich-editor"> <img src="https://img.shields.io/npm/dt/@adminforth/rich-editor" alt="npm downloads" /></a> <a href="https://www.npmjs.com/package/@adminforth/rich-editor"><img src="https://img.shields.io/npm/v/@adminforth/rich-editor" alt="npm version" /></a> <a href="https://www.npmjs.com/package/@adminforth/rich-editor">
|
|
4
|
+
|
|
5
|
+
Allows to add a rich text editor to your AdminForth text columns.
|
|
6
|
+
|
|
7
|
+
## For ussage, see [AdminForth RichEditor Documentation](https://adminforth.dev/docs/tutorial/Plugins/RichEditor/)
|
package/build.log
CHANGED
|
@@ -10,5 +10,5 @@ custom/package.json
|
|
|
10
10
|
custom/quillEditor.vue
|
|
11
11
|
custom/tsconfig.json
|
|
12
12
|
|
|
13
|
-
sent
|
|
14
|
-
total size is
|
|
13
|
+
sent 20,973 bytes received 115 bytes 42,176.00 bytes/sec
|
|
14
|
+
total size is 20,550 speedup is 0.97
|
package/custom/quillEditor.vue
CHANGED
|
@@ -27,7 +27,6 @@ import AsyncQueue from './async-queue';
|
|
|
27
27
|
import Quill from "quill";
|
|
28
28
|
import "quill/dist/quill.snow.css";
|
|
29
29
|
|
|
30
|
-
|
|
31
30
|
function dbg(title: string,...args: any[]) {
|
|
32
31
|
// return; // comment for debug
|
|
33
32
|
console.log(title, ...args.map(a =>JSON.stringify(a, null, 1)));
|
|
@@ -292,7 +291,16 @@ onMounted(() => {
|
|
|
292
291
|
async function emitTextUpdate() {
|
|
293
292
|
const editorHtml = quill.root.innerHTML;
|
|
294
293
|
// remove completion from html
|
|
295
|
-
|
|
294
|
+
let html = editorHtml.replace(/<span[^>]*completer[^>]*>.*?<\/span>/g, '');
|
|
295
|
+
|
|
296
|
+
// remove all style attributes
|
|
297
|
+
const parser = new DOMParser();
|
|
298
|
+
const doc = parser.parseFromString(html, 'text/html');
|
|
299
|
+
const elements = doc.querySelectorAll('*');
|
|
300
|
+
elements.forEach((el) => {
|
|
301
|
+
el.removeAttribute('style');
|
|
302
|
+
});
|
|
303
|
+
html = doc.body.innerHTML;
|
|
296
304
|
|
|
297
305
|
if (lastText === html) {
|
|
298
306
|
return;
|
|
@@ -527,8 +535,76 @@ function removeCompletionOnBlur() {
|
|
|
527
535
|
font-style: italic;
|
|
528
536
|
}
|
|
529
537
|
|
|
530
|
-
|
|
531
|
-
|
|
538
|
+
// basic typography
|
|
539
|
+
.ql-editor {
|
|
540
|
+
line-height: 1.5;
|
|
541
|
+
|
|
542
|
+
/* Headings */
|
|
543
|
+
h1, h2, h3, h4, h5, h6 {
|
|
544
|
+
margin-top: 0.5rem;
|
|
545
|
+
margin-bottom: 0.25rem;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
/* Paragraphs */
|
|
549
|
+
p {
|
|
550
|
+
margin-bottom: 0.4rem;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/* Lists */
|
|
554
|
+
ul, ol {
|
|
555
|
+
margin-top: 0.4rem;
|
|
556
|
+
margin-bottom: 0.4rem;
|
|
557
|
+
padding-left: 1rem;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
/* List items */
|
|
561
|
+
li {
|
|
562
|
+
margin-bottom: 0.2rem;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
/* Horizontal rule */
|
|
566
|
+
hr {
|
|
567
|
+
margin: 0.8rem 0;
|
|
568
|
+
border: none;
|
|
569
|
+
border-top: 1px solid #ddd;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
/* Blockquotes */
|
|
573
|
+
blockquote {
|
|
574
|
+
margin: 0.8rem 0;
|
|
575
|
+
padding-left: 0.8rem;
|
|
576
|
+
border-left: 2px solid #ccc;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
/* Preformatted text */
|
|
580
|
+
pre {
|
|
581
|
+
margin: 0.8rem 0;
|
|
582
|
+
padding: 0.4rem;
|
|
583
|
+
background: #f8f9fa;
|
|
584
|
+
border-radius: 3px;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
/* Tables */
|
|
588
|
+
table {
|
|
589
|
+
margin: 0.8rem 0;
|
|
590
|
+
border-collapse: collapse;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
th, td {
|
|
594
|
+
padding: 0.3rem;
|
|
595
|
+
border: 1px solid #ddd;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
thead th {
|
|
599
|
+
border-bottom: 1.5px solid #aaa;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
/* Images */
|
|
603
|
+
img {
|
|
604
|
+
margin: 0.4rem 0;
|
|
605
|
+
max-width: 100%;
|
|
606
|
+
height: auto;
|
|
607
|
+
}
|
|
532
608
|
}
|
|
533
609
|
|
|
534
610
|
.ql-snow .ql-stroke {
|
|
@@ -27,7 +27,6 @@ import AsyncQueue from './async-queue';
|
|
|
27
27
|
import Quill from "quill";
|
|
28
28
|
import "quill/dist/quill.snow.css";
|
|
29
29
|
|
|
30
|
-
|
|
31
30
|
function dbg(title: string,...args: any[]) {
|
|
32
31
|
// return; // comment for debug
|
|
33
32
|
console.log(title, ...args.map(a =>JSON.stringify(a, null, 1)));
|
|
@@ -292,7 +291,16 @@ onMounted(() => {
|
|
|
292
291
|
async function emitTextUpdate() {
|
|
293
292
|
const editorHtml = quill.root.innerHTML;
|
|
294
293
|
// remove completion from html
|
|
295
|
-
|
|
294
|
+
let html = editorHtml.replace(/<span[^>]*completer[^>]*>.*?<\/span>/g, '');
|
|
295
|
+
|
|
296
|
+
// remove all style attributes
|
|
297
|
+
const parser = new DOMParser();
|
|
298
|
+
const doc = parser.parseFromString(html, 'text/html');
|
|
299
|
+
const elements = doc.querySelectorAll('*');
|
|
300
|
+
elements.forEach((el) => {
|
|
301
|
+
el.removeAttribute('style');
|
|
302
|
+
});
|
|
303
|
+
html = doc.body.innerHTML;
|
|
296
304
|
|
|
297
305
|
if (lastText === html) {
|
|
298
306
|
return;
|
|
@@ -527,8 +535,76 @@ function removeCompletionOnBlur() {
|
|
|
527
535
|
font-style: italic;
|
|
528
536
|
}
|
|
529
537
|
|
|
530
|
-
|
|
531
|
-
|
|
538
|
+
// basic typography
|
|
539
|
+
.ql-editor {
|
|
540
|
+
line-height: 1.5;
|
|
541
|
+
|
|
542
|
+
/* Headings */
|
|
543
|
+
h1, h2, h3, h4, h5, h6 {
|
|
544
|
+
margin-top: 0.5rem;
|
|
545
|
+
margin-bottom: 0.25rem;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
/* Paragraphs */
|
|
549
|
+
p {
|
|
550
|
+
margin-bottom: 0.4rem;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/* Lists */
|
|
554
|
+
ul, ol {
|
|
555
|
+
margin-top: 0.4rem;
|
|
556
|
+
margin-bottom: 0.4rem;
|
|
557
|
+
padding-left: 1rem;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
/* List items */
|
|
561
|
+
li {
|
|
562
|
+
margin-bottom: 0.2rem;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
/* Horizontal rule */
|
|
566
|
+
hr {
|
|
567
|
+
margin: 0.8rem 0;
|
|
568
|
+
border: none;
|
|
569
|
+
border-top: 1px solid #ddd;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
/* Blockquotes */
|
|
573
|
+
blockquote {
|
|
574
|
+
margin: 0.8rem 0;
|
|
575
|
+
padding-left: 0.8rem;
|
|
576
|
+
border-left: 2px solid #ccc;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
/* Preformatted text */
|
|
580
|
+
pre {
|
|
581
|
+
margin: 0.8rem 0;
|
|
582
|
+
padding: 0.4rem;
|
|
583
|
+
background: #f8f9fa;
|
|
584
|
+
border-radius: 3px;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
/* Tables */
|
|
588
|
+
table {
|
|
589
|
+
margin: 0.8rem 0;
|
|
590
|
+
border-collapse: collapse;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
th, td {
|
|
594
|
+
padding: 0.3rem;
|
|
595
|
+
border: 1px solid #ddd;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
thead th {
|
|
599
|
+
border-bottom: 1.5px solid #aaa;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
/* Images */
|
|
603
|
+
img {
|
|
604
|
+
margin: 0.4rem 0;
|
|
605
|
+
max-width: 100%;
|
|
606
|
+
height: auto;
|
|
607
|
+
}
|
|
532
608
|
}
|
|
533
609
|
|
|
534
610
|
.ql-snow .ql-stroke {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adminforth/rich-editor",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "Rich editor plugin for adminforth",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"prepare": "npm link adminforth",
|
|
10
10
|
"build": "tsc && rsync -av --exclude 'node_modules' custom dist/"
|
|
11
11
|
},
|
|
12
|
+
"homepage": "https://adminforth.dev/docs/tutorial/Plugins/RichEditor/",
|
|
12
13
|
"repository": {
|
|
13
14
|
"type": "git",
|
|
14
15
|
"url": "https://github.com/devforth/adminforth-rich-editor.git"
|