@desynova-digital/components 9.0.10 → 9.0.12
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.
|
@@ -73,7 +73,7 @@ var DraftInputText = function DraftInputText(_ref) {
|
|
|
73
73
|
diff = _useState4[0],
|
|
74
74
|
setDiff = _useState4[1];
|
|
75
75
|
|
|
76
|
-
var _useState5 = (0, _react.useState)(
|
|
76
|
+
var _useState5 = (0, _react.useState)(false),
|
|
77
77
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
78
78
|
focus = _useState6[0],
|
|
79
79
|
setFocus = _useState6[1];
|
|
@@ -243,6 +243,19 @@ var DraftInputText = function DraftInputText(_ref) {
|
|
|
243
243
|
return match === '<em>' ? '<i>' : '</i>';
|
|
244
244
|
});
|
|
245
245
|
};
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
*
|
|
249
|
+
* @param {string} html the string that is passed to the parent
|
|
250
|
+
* @returns removes the symbols of special character like commas and convert them back to character
|
|
251
|
+
*/
|
|
252
|
+
|
|
253
|
+
function decodeHtml(html) {
|
|
254
|
+
var txt = document.createElement('textarea');
|
|
255
|
+
txt.innerHTML = html;
|
|
256
|
+
return txt.value;
|
|
257
|
+
}
|
|
258
|
+
|
|
246
259
|
/**
|
|
247
260
|
* this useEffect is used to send value to parent component as soon as editor state gets updated
|
|
248
261
|
*/
|
|
@@ -250,6 +263,7 @@ var DraftInputText = function DraftInputText(_ref) {
|
|
|
250
263
|
var html = (0, _draftConvert.convertToHTML)(editorState.getCurrentContent());
|
|
251
264
|
html = removeOuterPTag(html);
|
|
252
265
|
html = changeEmToI(html);
|
|
266
|
+
html = decodeHtml(html);
|
|
253
267
|
var obj = {
|
|
254
268
|
size: contentLength,
|
|
255
269
|
html: html
|
|
@@ -266,9 +280,12 @@ var DraftInputText = function DraftInputText(_ref) {
|
|
|
266
280
|
if (diff && value !== '' && value !== undefined) {
|
|
267
281
|
props.simpleEdit = true;
|
|
268
282
|
setDiff(false);
|
|
269
|
-
setFocus(true);
|
|
270
283
|
var dummy = (0, _draftConvert.convertFromHTML)(value);
|
|
271
284
|
var newState = _draftJs.EditorState.createWithContent(dummy);
|
|
285
|
+
|
|
286
|
+
if (focus) {
|
|
287
|
+
isFocused = true;
|
|
288
|
+
}
|
|
272
289
|
if (isFocused) {
|
|
273
290
|
setEditorState(function () {
|
|
274
291
|
return _draftJs.EditorState.moveFocusToEnd(newState);
|
|
@@ -278,7 +295,6 @@ var DraftInputText = function DraftInputText(_ref) {
|
|
|
278
295
|
}
|
|
279
296
|
}
|
|
280
297
|
}, [value]);
|
|
281
|
-
|
|
282
298
|
/**
|
|
283
299
|
* This useEffect is used to chnage our value when timeline is changed
|
|
284
300
|
*/
|
|
@@ -297,7 +313,6 @@ var DraftInputText = function DraftInputText(_ref) {
|
|
|
297
313
|
/**
|
|
298
314
|
* This useEffect is used to focus on Line1 when a new segment is created
|
|
299
315
|
*/
|
|
300
|
-
|
|
301
316
|
(0, _react.useEffect)(function () {
|
|
302
317
|
if (autoFocus) {
|
|
303
318
|
editorRef.current.focus();
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@desynova-digital/components",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.12",
|
|
4
4
|
"description": "Components for Desynova Digital",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "desynova-digital",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": "desynova-digital",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@desynova-digital/tokens": "9.0.
|
|
10
|
+
"@desynova-digital/tokens": "9.0.12",
|
|
11
11
|
"prop-types": "^15.7.2",
|
|
12
12
|
"styled-components": "^4.3.2"
|
|
13
13
|
},
|