@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.1",
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
  }
@@ -31,7 +31,3 @@
31
31
  transform: rotate(360deg);
32
32
  }
33
33
  }
34
-
35
- .ql-wg-comment-wrapper{
36
- display: inline !important
37
- }
@@ -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.quill.formatText(range, CommentBlot.blotName, { commentId }, "user");
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 };
@@ -1,9 +0,0 @@
1
- const nanoid = require("nanoid");
2
- const alphabet = nanoid.customAlphabet(
3
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
4
- 9
5
- );
6
-
7
- const generateRandomId = () => alphabet();
8
-
9
- export default generateRandomId;