@lets-events/react 12.6.3 → 12.6.4

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @lets-events/react@12.6.3 build
2
+ > @lets-events/react@12.6.4 build
3
3
  > tsup src/index.tsx --format esm,cjs --dts --external react
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -9,11 +9,11 @@
9
9
  CLI Target: es6
10
10
  ESM Build start
11
11
  CJS Build start
12
- ESM dist\index.mjs 389.21 KB
13
- ESM ⚡️ Build success in 204ms
14
- CJS dist\index.js 404.22 KB
15
- CJS ⚡️ Build success in 205ms
12
+ CJS dist\index.js 404.29 KB
13
+ CJS ⚡️ Build success in 200ms
14
+ ESM dist\index.mjs 389.28 KB
15
+ ESM ⚡️ Build success in 201ms
16
16
  DTS Build start
17
- DTS ⚡️ Build success in 4468ms
17
+ DTS ⚡️ Build success in 4558ms
18
18
  DTS dist\index.d.mts 402.87 KB
19
19
  DTS dist\index.d.ts 402.87 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @lets-events/react
2
2
 
3
+ ## 12.6.4
4
+
5
+ ### Patch Changes
6
+
7
+ - fix simple richeditor formats
8
+
3
9
  ## 12.6.3
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -12548,7 +12548,16 @@ var QuillComponent = ({
12548
12548
  matchVisual: false
12549
12549
  }
12550
12550
  };
12551
- const formats = simpleVersion ? ["bold", "italic", "underline", "list", "link"] : [
12551
+ const formats = simpleVersion ? [
12552
+ "header",
12553
+ "bold",
12554
+ "italic",
12555
+ "underline",
12556
+ "color",
12557
+ "background",
12558
+ "align",
12559
+ "list"
12560
+ ] : [
12552
12561
  "header",
12553
12562
  "bold",
12554
12563
  "italic",
package/dist/index.mjs CHANGED
@@ -12443,7 +12443,16 @@ var QuillComponent = ({
12443
12443
  matchVisual: false
12444
12444
  }
12445
12445
  };
12446
- const formats = simpleVersion ? ["bold", "italic", "underline", "list", "link"] : [
12446
+ const formats = simpleVersion ? [
12447
+ "header",
12448
+ "bold",
12449
+ "italic",
12450
+ "underline",
12451
+ "color",
12452
+ "background",
12453
+ "align",
12454
+ "list"
12455
+ ] : [
12447
12456
  "header",
12448
12457
  "bold",
12449
12458
  "italic",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lets-events/react",
3
- "version": "12.6.3",
3
+ "version": "12.6.4",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -35,59 +35,70 @@ const QuillComponent: React.FC<RichEditorProps> = ({
35
35
  };
36
36
  const modules = simpleVersion
37
37
  ? {
38
- toolbar: [
39
- [{ header: [1, 2, false] }],
40
- ["bold", "italic", "underline"],
41
- [{ color: [] }, { background: [] }],
42
- [{ align: [] }],
43
- [{ list: "ordered" }, { list: "bullet" }],
44
- ],
45
- clipboard: {
46
- matchVisual: false,
47
- },
48
- }
49
- : disableVideo ? {
50
- toolbar: [
51
- [{ header: [1, 2, false] }],
52
- ["bold", "italic", "underline", "strike"],
53
- [{ color: [] }, { background: [] }],
54
- [{ align: [] }],
55
- [{ list: "ordered" }, { list: "bullet" }],
56
- ["link", "image"],
57
- ],
58
- clipboard: {
59
- matchVisual: false,
60
- },
61
- } : {
62
- toolbar: [
63
- [{ header: [1, 2, false] }],
64
- ["bold", "italic", "underline", "strike"],
65
- [{ color: [] }, { background: [] }],
66
- [{ align: [] }],
67
- [{ list: "ordered" }, { list: "bullet" }],
68
- ["link", "image", "video"],
69
- ],
70
- clipboard: {
71
- matchVisual: false,
72
- },
73
- };
38
+ toolbar: [
39
+ [{ header: [1, 2, false] }],
40
+ ["bold", "italic", "underline"],
41
+ [{ color: [] }, { background: [] }],
42
+ [{ align: [] }],
43
+ [{ list: "ordered" }, { list: "bullet" }],
44
+ ],
45
+ clipboard: {
46
+ matchVisual: false,
47
+ },
48
+ }
49
+ : disableVideo
50
+ ? {
51
+ toolbar: [
52
+ [{ header: [1, 2, false] }],
53
+ ["bold", "italic", "underline", "strike"],
54
+ [{ color: [] }, { background: [] }],
55
+ [{ align: [] }],
56
+ [{ list: "ordered" }, { list: "bullet" }],
57
+ ["link", "image"],
58
+ ],
59
+ clipboard: {
60
+ matchVisual: false,
61
+ },
62
+ }
63
+ : {
64
+ toolbar: [
65
+ [{ header: [1, 2, false] }],
66
+ ["bold", "italic", "underline", "strike"],
67
+ [{ color: [] }, { background: [] }],
68
+ [{ align: [] }],
69
+ [{ list: "ordered" }, { list: "bullet" }],
70
+ ["link", "image", "video"],
71
+ ],
72
+ clipboard: {
73
+ matchVisual: false,
74
+ },
75
+ };
74
76
 
75
77
  const formats = simpleVersion
76
- ? ["bold", "italic", "underline", "list", "link"]
78
+ ? [
79
+ "header",
80
+ "bold",
81
+ "italic",
82
+ "underline",
83
+ "color",
84
+ "background",
85
+ "align",
86
+ "list",
87
+ ]
77
88
  : [
78
- "header",
79
- "bold",
80
- "italic",
81
- "underline",
82
- "strike",
83
- "color",
84
- "background",
85
- "align",
86
- "list",
87
- "link",
88
- "image",
89
- "video",
90
- ];
89
+ "header",
90
+ "bold",
91
+ "italic",
92
+ "underline",
93
+ "strike",
94
+ "color",
95
+ "background",
96
+ "align",
97
+ "list",
98
+ "link",
99
+ "image",
100
+ "video",
101
+ ];
91
102
 
92
103
  const { quill, quillRef } = useQuill({
93
104
  theme: "snow",
@@ -134,7 +145,7 @@ const QuillComponent: React.FC<RichEditorProps> = ({
134
145
  });
135
146
  }
136
147
  },
137
- [disabled, quill, addToast, removeToast, uploadConfig, onChange]
148
+ [disabled, quill, addToast, removeToast, uploadConfig, onChange],
138
149
  );
139
150
 
140
151
  useEffect(() => {
@@ -157,15 +168,15 @@ const QuillComponent: React.FC<RichEditorProps> = ({
157
168
  if (quill) {
158
169
  quill.on("text-change", (delta: any, oldDelta: any, source: string) => {
159
170
  if (source === "user") {
160
- const text = quill.getText().trim()
161
- const count = text.length
171
+ const text = quill.getText().trim();
172
+ const count = text.length;
162
173
 
163
174
  if (maxLength !== undefined && count > maxLength) {
164
- quill.deleteText(maxLength, count - maxLength)
165
- return
175
+ quill.deleteText(maxLength, count - maxLength);
176
+ return;
166
177
  }
167
- onChange?.(formatHTML(quill.root.innerHTML))
168
- onCharacterCountChange?.(count)
178
+ onChange?.(formatHTML(quill.root.innerHTML));
179
+ onCharacterCountChange?.(count);
169
180
  }
170
181
  });
171
182
 
@@ -193,7 +204,7 @@ const QuillComponent: React.FC<RichEditorProps> = ({
193
204
  quillRef.current?.parentElement?.querySelector(".ql-toolbar");
194
205
  if (toolbarElement) {
195
206
  const headerSelect = toolbarElement.querySelector(
196
- "select[data-value]"
207
+ "select[data-value]",
197
208
  ) as HTMLSelectElement;
198
209
  if (headerSelect) {
199
210
  const options = headerSelect.querySelectorAll("option");