@writergate/quill-image-uploader-nextjs 0.2.1 → 0.2.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@writergate/quill-image-uploader-nextjs",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/enlear/quill-image-uploader-nextjs.git"
|
|
@@ -58,8 +58,5 @@
|
|
|
58
58
|
"bugs": {
|
|
59
59
|
"url": "https://github.com/enlear/quill-image-uploader-nextjs/issues"
|
|
60
60
|
},
|
|
61
|
-
"homepage": "https://github.com/enlear/quill-image-uploader-nextjs#readme"
|
|
62
|
-
"dependencies": {
|
|
63
|
-
"nanoid": "^4.0.2"
|
|
64
|
-
}
|
|
61
|
+
"homepage": "https://github.com/enlear/quill-image-uploader-nextjs#readme"
|
|
65
62
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import LoadingImage from "./blots/image.js";
|
|
2
2
|
import CommentBlot from "./blots/comment.js";
|
|
3
|
-
import GenerateRandomId from "./utils/nano-id.js";
|
|
4
3
|
|
|
5
4
|
class ImageUploader {
|
|
6
5
|
constructor(quill, options) {
|
|
@@ -46,14 +45,12 @@ class ImageUploader {
|
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
addComment() {
|
|
49
|
-
const commentId = GenerateRandomId();
|
|
50
48
|
let range = this.quill.getSelection();
|
|
51
49
|
if (range && range.length > 0 && this.options.newComment) {
|
|
52
50
|
this.quill.history.userOnly = true;
|
|
53
51
|
range.top = this.quill.getBounds(range.index, range.length).top;
|
|
54
52
|
const selectedText = this.quill.getText(range.index, range.length);
|
|
55
|
-
this.
|
|
56
|
-
this.options.newComment(range, selectedText, commentId);
|
|
53
|
+
this.options.newComment(range, selectedText);
|
|
57
54
|
}
|
|
58
55
|
this.quill.theme.tooltip.hide();
|
|
59
56
|
this.quill.history.userOnly = true;
|
|
@@ -80,7 +77,6 @@ class ImageUploader {
|
|
|
80
77
|
|
|
81
78
|
clean() {
|
|
82
79
|
const range = this.quill.getSelection(true);
|
|
83
|
-
const formats = this.quill.getFormat(range);
|
|
84
80
|
// running it twise to remove colors
|
|
85
81
|
this.quill.removeFormat(range.index, range.length, "user");
|
|
86
82
|
this.quill.removeFormat(range.index, range.length, "user");
|
|
@@ -236,5 +232,5 @@ class ImageUploader {
|
|
|
236
232
|
}
|
|
237
233
|
|
|
238
234
|
window.ImageUploader = ImageUploader;
|
|
235
|
+
export const commentBlotName = CommentBlot.blotName;
|
|
239
236
|
export default ImageUploader;
|
|
240
|
-
export { CommentBlot, LoadingImage };
|