@lets-events/react 12.2.8 → 12.2.9
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/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +6 -0
- package/dist/index.js +4 -8
- package/dist/index.mjs +4 -8
- package/package.json +1 -1
- package/src/components/RichEditor/QuillComponent.tsx +7 -10
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @lets-events/react@12.2.
|
|
3
|
+
> @lets-events/react@12.2.9 build
|
|
4
4
|
> tsup src/index.tsx --format esm,cjs --dts --external react
|
|
5
5
|
|
|
6
6
|
[1G[0K[34mCLI[39m Building entry: src/index.tsx
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
[34mCLI[39m Target: es6
|
|
11
11
|
[34mESM[39m Build start
|
|
12
12
|
[34mCJS[39m Build start
|
|
13
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
15
|
-
[32mESM[39m [1mdist/index.mjs [22m[
|
|
16
|
-
[32mESM[39m ⚡️ Build success in
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m393.79 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 326ms
|
|
15
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m379.85 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 327ms
|
|
17
17
|
DTS Build start
|
|
18
|
-
DTS ⚡️ Build success in
|
|
18
|
+
DTS ⚡️ Build success in 6004ms
|
|
19
19
|
DTS dist/index.d.mts 389.25 KB
|
|
20
20
|
DTS dist/index.d.ts 389.25 KB
|
|
21
21
|
[1G[0K⠙[1G[0K
|
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -12189,12 +12189,6 @@ var QuillComponent = ({
|
|
|
12189
12189
|
const formatHTML = (html) => {
|
|
12190
12190
|
const parser = new DOMParser();
|
|
12191
12191
|
const doc = parser.parseFromString(html, "text/html");
|
|
12192
|
-
doc.querySelectorAll("h1").forEach((h1) => {
|
|
12193
|
-
h1.setAttribute("style", `${h1.getAttribute("style") || ""}line-height: 2em;`);
|
|
12194
|
-
});
|
|
12195
|
-
doc.querySelectorAll("img").forEach((img) => {
|
|
12196
|
-
img.setAttribute("style", `${img.getAttribute("style") || ""}max-width: 100%; height: auto; width: auto;`);
|
|
12197
|
-
});
|
|
12198
12192
|
return doc.body.innerHTML;
|
|
12199
12193
|
};
|
|
12200
12194
|
const modules = simpleVersion ? {
|
|
@@ -12270,7 +12264,9 @@ var QuillComponent = ({
|
|
|
12270
12264
|
const selection = quill.getSelection();
|
|
12271
12265
|
const index = selection ? selection.index : quill.getLength();
|
|
12272
12266
|
quill.insertEmbed(index, "image", uploadedFile.url);
|
|
12273
|
-
quill.
|
|
12267
|
+
quill.insertText(index + 1, "\n");
|
|
12268
|
+
quill.setSelection(index + 2, 0);
|
|
12269
|
+
quill.focus();
|
|
12274
12270
|
onChange == null ? void 0 : onChange(formatHTML(quill.root.innerHTML));
|
|
12275
12271
|
} catch (error) {
|
|
12276
12272
|
console.error("Erro no upload:", error);
|
|
@@ -12280,7 +12276,7 @@ var QuillComponent = ({
|
|
|
12280
12276
|
});
|
|
12281
12277
|
}
|
|
12282
12278
|
}),
|
|
12283
|
-
[disabled, quill, addToast, removeToast, uploadConfig]
|
|
12279
|
+
[disabled, quill, addToast, removeToast, uploadConfig, onChange]
|
|
12284
12280
|
);
|
|
12285
12281
|
(0, import_react20.useEffect)(() => {
|
|
12286
12282
|
if (quill && value) {
|
package/dist/index.mjs
CHANGED
|
@@ -12087,12 +12087,6 @@ var QuillComponent = ({
|
|
|
12087
12087
|
const formatHTML = (html) => {
|
|
12088
12088
|
const parser = new DOMParser();
|
|
12089
12089
|
const doc = parser.parseFromString(html, "text/html");
|
|
12090
|
-
doc.querySelectorAll("h1").forEach((h1) => {
|
|
12091
|
-
h1.setAttribute("style", `${h1.getAttribute("style") || ""}line-height: 2em;`);
|
|
12092
|
-
});
|
|
12093
|
-
doc.querySelectorAll("img").forEach((img) => {
|
|
12094
|
-
img.setAttribute("style", `${img.getAttribute("style") || ""}max-width: 100%; height: auto; width: auto;`);
|
|
12095
|
-
});
|
|
12096
12090
|
return doc.body.innerHTML;
|
|
12097
12091
|
};
|
|
12098
12092
|
const modules = simpleVersion ? {
|
|
@@ -12168,7 +12162,9 @@ var QuillComponent = ({
|
|
|
12168
12162
|
const selection = quill.getSelection();
|
|
12169
12163
|
const index = selection ? selection.index : quill.getLength();
|
|
12170
12164
|
quill.insertEmbed(index, "image", uploadedFile.url);
|
|
12171
|
-
quill.
|
|
12165
|
+
quill.insertText(index + 1, "\n");
|
|
12166
|
+
quill.setSelection(index + 2, 0);
|
|
12167
|
+
quill.focus();
|
|
12172
12168
|
onChange == null ? void 0 : onChange(formatHTML(quill.root.innerHTML));
|
|
12173
12169
|
} catch (error) {
|
|
12174
12170
|
console.error("Erro no upload:", error);
|
|
@@ -12178,7 +12174,7 @@ var QuillComponent = ({
|
|
|
12178
12174
|
});
|
|
12179
12175
|
}
|
|
12180
12176
|
}),
|
|
12181
|
-
[disabled, quill, addToast, removeToast, uploadConfig]
|
|
12177
|
+
[disabled, quill, addToast, removeToast, uploadConfig, onChange]
|
|
12182
12178
|
);
|
|
12183
12179
|
useEffect6(() => {
|
|
12184
12180
|
if (quill && value) {
|
package/package.json
CHANGED
|
@@ -31,14 +31,6 @@ const QuillComponent: React.FC<RichEditorProps> = ({
|
|
|
31
31
|
const parser = new DOMParser();
|
|
32
32
|
const doc = parser.parseFromString(html, "text/html");
|
|
33
33
|
|
|
34
|
-
doc.querySelectorAll("h1").forEach((h1) => {
|
|
35
|
-
h1.setAttribute("style", `${h1.getAttribute("style") || ""}line-height: 2em;`);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
doc.querySelectorAll("img").forEach((img) => {
|
|
39
|
-
img.setAttribute("style", `${img.getAttribute("style") || ""}max-width: 100%; height: auto; width: auto;`);
|
|
40
|
-
});
|
|
41
|
-
|
|
42
34
|
return doc.body.innerHTML;
|
|
43
35
|
};
|
|
44
36
|
const modules = simpleVersion
|
|
@@ -124,7 +116,12 @@ const QuillComponent: React.FC<RichEditorProps> = ({
|
|
|
124
116
|
const selection = quill.getSelection();
|
|
125
117
|
const index = selection ? selection.index : quill.getLength();
|
|
126
118
|
quill.insertEmbed(index, "image", uploadedFile.url);
|
|
127
|
-
|
|
119
|
+
|
|
120
|
+
quill.insertText(index + 1, "\n");
|
|
121
|
+
quill.setSelection(index + 2, 0);
|
|
122
|
+
|
|
123
|
+
quill.focus();
|
|
124
|
+
|
|
128
125
|
onChange?.(formatHTML(quill.root.innerHTML));
|
|
129
126
|
} catch (error) {
|
|
130
127
|
console.error("Erro no upload:", error);
|
|
@@ -135,7 +132,7 @@ const QuillComponent: React.FC<RichEditorProps> = ({
|
|
|
135
132
|
});
|
|
136
133
|
}
|
|
137
134
|
},
|
|
138
|
-
[disabled, quill, addToast, removeToast, uploadConfig]
|
|
135
|
+
[disabled, quill, addToast, removeToast, uploadConfig, onChange]
|
|
139
136
|
);
|
|
140
137
|
|
|
141
138
|
useEffect(() => {
|