@griddo/ax 12.0.1 → 12.1.0
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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@griddo/ax",
|
|
3
3
|
"description": "Griddo Author Experience",
|
|
4
|
-
"version": "12.0
|
|
4
|
+
"version": "12.1.0",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
7
7
|
"Diego M. Béjar <diego.bejar@secuoyas.com>",
|
|
@@ -219,5 +219,5 @@
|
|
|
219
219
|
"publishConfig": {
|
|
220
220
|
"access": "public"
|
|
221
221
|
},
|
|
222
|
-
"gitHead": "
|
|
222
|
+
"gitHead": "0a824819ca17d1ec795344257f0e9c0943796cce"
|
|
223
223
|
}
|
|
@@ -63,17 +63,20 @@ const Wysiwyg = (props: IWysiwygProps) => {
|
|
|
63
63
|
}, [value]);
|
|
64
64
|
|
|
65
65
|
const handleChange = (model: string) => {
|
|
66
|
+
// Remove Froala's paste marker
|
|
67
|
+
const cleanModel = model.replace(/<br id="isPasted"[^>]*>/g, "");
|
|
68
|
+
|
|
66
69
|
// Ignore if only difference is Froala's automatic empty paragraph
|
|
67
|
-
const cleanCurrent =
|
|
70
|
+
const cleanCurrent = cleanModel.replace(/<p><br><\/p>$/, "").trim();
|
|
68
71
|
const cleanLast = (lastValueRef.current || "").replace(/<p><br><\/p>$/, "").trim();
|
|
69
72
|
|
|
70
73
|
if (cleanCurrent === cleanLast) {
|
|
71
74
|
return;
|
|
72
75
|
}
|
|
73
76
|
|
|
74
|
-
lastValueRef.current =
|
|
75
|
-
onChange(
|
|
76
|
-
const stripedHtml = decodeEntities(
|
|
77
|
+
lastValueRef.current = cleanModel;
|
|
78
|
+
onChange(cleanModel);
|
|
79
|
+
const stripedHtml = decodeEntities(cleanModel);
|
|
77
80
|
setTimeout(() => {
|
|
78
81
|
errorRef.current && handleValidation?.(stripedHtml);
|
|
79
82
|
}, 300);
|
|
@@ -175,6 +178,7 @@ const Wysiwyg = (props: IWysiwygProps) => {
|
|
|
175
178
|
charCounterCount: !inline,
|
|
176
179
|
imageUpload: false,
|
|
177
180
|
multiLine: !inline,
|
|
181
|
+
pastePlain: inline,
|
|
178
182
|
enter: inline ? FroalaEditor.ENTER_BR : FroalaEditor.ENTER_P,
|
|
179
183
|
requestHeaders: {
|
|
180
184
|
Authorization: `bearer ${token}`,
|