@desynova-digital/components 9.1.35 → 9.1.37

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/_helpers/utils.js CHANGED
@@ -126,10 +126,10 @@ var cleanHtml = exports.cleanHtml = function cleanHtml(htmlStr) {
126
126
  .replace(/\s\s+/g, "").replace(/\t/g, "").replace(/\\"/g, '"').replace(/\n/g, " ");
127
127
  };
128
128
 
129
- /**
130
- *
131
- * @param {*} htmlStr
132
- * @returns
129
+ /**
130
+ *
131
+ * @param {*} htmlStr
132
+ * @returns
133
133
  */
134
134
  var htmlToText = exports.htmlToText = function htmlToText(htmlStr) {
135
135
  var res = htmlStr === null || htmlStr === void 0 ? void 0 : htmlStr.replace(/<\/?[^>]+>/gi, "");
@@ -46,11 +46,11 @@ var CardV2 = function CardV2(props) {
46
46
  return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, type === 'timeline' && /*#__PURE__*/_react["default"].createElement(_timeline["default"], props) || null, /*#__PURE__*/_react["default"].createElement(_thumbnail["default"], props), /*#__PURE__*/_react["default"].createElement(_content["default"], props));
47
47
  }, [props]);
48
48
 
49
- /**
50
- * based on width will render the card
51
- * if width === sm then flex based card
52
- * else normal
53
- * @function
49
+ /**
50
+ * based on width will render the card
51
+ * if width === sm then flex based card
52
+ * else normal
53
+ * @function
54
54
  */
55
55
  var renderBasedOnWidth = (0, _react.useCallback)(function () {
56
56
  if (width === 'sm') {
@@ -71,9 +71,9 @@ var Content = function Content(props) {
71
71
  tooltipVisibleSection = _useState2[0],
72
72
  setTooltipVisibleSection = _useState2[1];
73
73
 
74
- /**
75
- * toogle tooltip -> true / false
76
- * @function
74
+ /**
75
+ * toogle tooltip -> true / false
76
+ * @function
77
77
  */
78
78
  var handleTooltip = (0, _react.useCallback)(function (tooltipSection, tooltipText) {
79
79
  return function () {
@@ -83,9 +83,9 @@ var Content = function Content(props) {
83
83
  };
84
84
  }, []);
85
85
 
86
- /**
87
- * returns filtered list removing undefined from input array
88
- * @function
86
+ /**
87
+ * returns filtered list removing undefined from input array
88
+ * @function
89
89
  */
90
90
  var getTooltipData = function getTooltipData() {
91
91
  for (var _len = arguments.length, list = new Array(_len), _key = 0; _key < _len; _key++) {
@@ -98,12 +98,12 @@ var Thumbnail = function Thumbnail(props) {
98
98
  }
99
99
  }, [actions && JSON.stringify(actions).length > 0]);
100
100
  (0, _react.useEffect)(function () {
101
- /**
102
- * will return the hex based status passed
103
- * eg. status = In Progress -> will format to "in_progress"
104
- * then it will find its index in CARD_ASSET_STATUS which will
105
- * return hex
106
- * @const
101
+ /**
102
+ * will return the hex based status passed
103
+ * eg. status = In Progress -> will format to "in_progress"
104
+ * then it will find its index in CARD_ASSET_STATUS which will
105
+ * return hex
106
+ * @const
107
107
  */
108
108
  var index = _tokens2.CARD_ASSET_STATUS.findIndex(function (label) {
109
109
  return label.code.includes(card_status || upload_status ? (card_status || upload_status).toLowerCase().split(' ').join('_') : []);
@@ -131,10 +131,10 @@ var Thumbnail = function Thumbnail(props) {
131
131
  }
132
132
  }, [iframeImageBlockRef, hoverPointerRef, iframeImageRef]);
133
133
 
134
- /**
135
- * will decide thumbnail click based on its condition
136
- * eg. if task_type === upload then prevent click
137
- * @function
134
+ /**
135
+ * will decide thumbnail click based on its condition
136
+ * eg. if task_type === upload then prevent click
137
+ * @function
138
138
  */
139
139
  var handleThumbnailClick = (0, _react.useCallback)(function (e) {
140
140
  if (!isClickPrevented) {
@@ -75,11 +75,11 @@ var DraftInputText = function DraftInputText(_ref) {
75
75
  var passwordButton = props.passwordButton;
76
76
  }
77
77
 
78
- /**
79
- *
80
- * @param {string} command string representing the keyboard command being invoked
81
- * @param {object} editorState represents the current state of the editor, including the content, selection, and various editor properties.
82
- * @returns new Editor State with applied styling
78
+ /**
79
+ *
80
+ * @param {string} command string representing the keyboard command being invoked
81
+ * @param {object} editorState represents the current state of the editor, including the content, selection, and various editor properties.
82
+ * @returns new Editor State with applied styling
83
83
  */
84
84
  var handleKeyCommand = function handleKeyCommand(command, editorState) {
85
85
  var newState = _draftJs.RichUtils.handleKeyCommand(editorState, command);
@@ -90,9 +90,9 @@ var DraftInputText = function DraftInputText(_ref) {
90
90
  return 'not-handled';
91
91
  };
92
92
 
93
- /**
94
- *
95
- * @returns Return the length of text in editor in a synchronous way
93
+ /**
94
+ *
95
+ * @returns Return the length of text in editor in a synchronous way
96
96
  */
97
97
  var _getLengthOfSelectedText = function _getLengthOfSelectedText() {
98
98
  var currentSelection = editorState.getSelection();
@@ -127,11 +127,11 @@ var DraftInputText = function DraftInputText(_ref) {
127
127
  return length;
128
128
  };
129
129
 
130
- /**
131
- *
132
- * @param {string} text The text that is pasted in the editor
133
- * @param {string} position tells whether we have to check for inserted text or pasted text
134
- * @returns whether pasting or inserting text is feasible
130
+ /**
131
+ *
132
+ * @param {string} text The text that is pasted in the editor
133
+ * @param {string} position tells whether we have to check for inserted text or pasted text
134
+ * @returns whether pasting or inserting text is feasible
135
135
  */
136
136
  var _handleInput = function _handleInput(text, position) {
137
137
  var currentContent = editorState.getCurrentContent();
@@ -150,27 +150,27 @@ var DraftInputText = function DraftInputText(_ref) {
150
150
  }
151
151
  };
152
152
 
153
- /**
154
- *
155
- * @returns calls the function to check before typing the text does not exceed maximum length
153
+ /**
154
+ *
155
+ * @returns calls the function to check before typing the text does not exceed maximum length
156
156
  */
157
157
  var _handleBeforeInput = function _handleBeforeInput() {
158
158
  return _handleInput('', 'before');
159
159
  };
160
160
 
161
- /**
162
- *
163
- * @param {string} pastedText the text that is copy pasted in our editor
164
- * @returns calls the function to check copying the text does not exceed maximum length
161
+ /**
162
+ *
163
+ * @param {string} pastedText the text that is copy pasted in our editor
164
+ * @returns calls the function to check copying the text does not exceed maximum length
165
165
  */
166
166
  var _handlePastedText = function _handlePastedText(pastedText) {
167
167
  return _handleInput(pastedText, 'after');
168
168
  };
169
169
 
170
- /**
171
- *
172
- * @param {object} newEditorState the newstate of editor when we type any text in our editor
173
- * @returns the new state of editor
170
+ /**
171
+ *
172
+ * @param {object} newEditorState the newstate of editor when we type any text in our editor
173
+ * @returns the new state of editor
174
174
  */
175
175
  var _handleChange = function _handleChange(newEditorState) {
176
176
  var contentState = newEditorState.getCurrentContent();
@@ -182,10 +182,10 @@ var DraftInputText = function DraftInputText(_ref) {
182
182
  }
183
183
  };
184
184
 
185
- /**
186
- *
187
- * @param {string} htmlString the string that is passed to the parent
188
- * @returns removes the default <p> tag of draftjs
185
+ /**
186
+ *
187
+ * @param {string} htmlString the string that is passed to the parent
188
+ * @returns removes the default <p> tag of draftjs
189
189
  */
190
190
  var removeOuterPTag = function removeOuterPTag(htmlString) {
191
191
  var regex = /^<p>(.*?)<\/p>$/;
@@ -198,10 +198,10 @@ var DraftInputText = function DraftInputText(_ref) {
198
198
  });
199
199
  };
200
200
 
201
- /**
202
- *
203
- * @param {string} html the string that is passed to the parent
204
- * @returns removes the symbols of special character like commas and convert them back to character
201
+ /**
202
+ *
203
+ * @param {string} html the string that is passed to the parent
204
+ * @returns removes the symbols of special character like commas and convert them back to character
205
205
  */
206
206
 
207
207
  function decodeHtml(html) {
@@ -210,8 +210,8 @@ var DraftInputText = function DraftInputText(_ref) {
210
210
  return txt.value;
211
211
  }
212
212
 
213
- /**
214
- * this useEffect is used to send value to parent component as soon as editor state gets updated
213
+ /**
214
+ * this useEffect is used to send value to parent component as soon as editor state gets updated
215
215
  */
216
216
  (0, _react.useEffect)(function () {
217
217
  var html = (0, _draftConvert.convertToHTML)(editorState.getCurrentContent());
@@ -227,8 +227,8 @@ var DraftInputText = function DraftInputText(_ref) {
227
227
  }
228
228
  }, [editorState]);
229
229
 
230
- /**
231
- * This useEffect handles our focus condition and also updates state when the props value changes
230
+ /**
231
+ * This useEffect handles our focus condition and also updates state when the props value changes
232
232
  */
233
233
  (0, _react.useEffect)(function () {
234
234
  if (diff && value !== '' && value !== undefined) {
@@ -248,8 +248,8 @@ var DraftInputText = function DraftInputText(_ref) {
248
248
  }
249
249
  }
250
250
  }, [value]);
251
- /**
252
- * This useEffect is used to chnage our value when timeline is changed
251
+ /**
252
+ * This useEffect is used to chnage our value when timeline is changed
253
253
  */
254
254
  (0, _react.useEffect)(function () {
255
255
  if (listScrollTop !== null) {
@@ -263,8 +263,8 @@ var DraftInputText = function DraftInputText(_ref) {
263
263
  }
264
264
  }, [listScrollTop]);
265
265
 
266
- /**
267
- * This useEffect is used to focus on Line1 when a new segment is created
266
+ /**
267
+ * This useEffect is used to focus on Line1 when a new segment is created
268
268
  */
269
269
  (0, _react.useEffect)(function () {
270
270
  if (autoFocus) {