@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.
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- > @lets-events/react@12.2.8 build
3
+ > @lets-events/react@12.2.9 build
4
4
  > tsup src/index.tsx --format esm,cjs --dts --external react
5
5
 
6
6
  CLI Building entry: src/index.tsx
@@ -10,12 +10,12 @@
10
10
  CLI Target: es6
11
11
  ESM Build start
12
12
  CJS Build start
13
- CJS dist/index.js 394.03 KB
14
- CJS ⚡️ Build success in 600ms
15
- ESM dist/index.mjs 380.08 KB
16
- ESM ⚡️ Build success in 602ms
13
+ CJS dist/index.js 393.79 KB
14
+ CJS ⚡️ Build success in 326ms
15
+ ESM dist/index.mjs 379.85 KB
16
+ ESM ⚡️ Build success in 327ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 9746ms
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
  ⠙
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @lets-events/react
2
2
 
3
+ ## 12.2.9
4
+
5
+ ### Patch Changes
6
+
7
+ - RichEditor stylization
8
+
3
9
  ## 12.2.8
4
10
 
5
11
  ### Patch Changes
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.setSelection(index + 1, 0);
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.setSelection(index + 1, 0);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lets-events/react",
3
- "version": "12.2.8",
3
+ "version": "12.2.9",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -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
- quill.setSelection(index + 1, 0);
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(() => {