@zohodesk/dot 1.0.0-temp-198.3.3 → 1.0.0-temp-199

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.
Files changed (120) hide show
  1. package/.cli/propValidation_report.html +1 -1
  2. package/README.md +39 -0
  3. package/assets/Appearance/dark/mode/Dot_DarkMode.module.css +1 -0
  4. package/assets/Appearance/light/mode/Dot_LightMode.module.css +1 -0
  5. package/assets/Appearance/pureDark/mode/Dot_PureDarkMode.module.css +1 -0
  6. package/es/ActionButton/ActionButton.module.css +192 -192
  7. package/es/AlphabeticList/AlphabeticList.module.css +57 -57
  8. package/es/AttachmentViewer/AttachmentImage.js +68 -32
  9. package/es/AttachmentViewer/AttachmentViewer.js +120 -41
  10. package/es/AttachmentViewer/AttachmentViewer.module.css +364 -352
  11. package/es/AttachmentViewer/__tests__/AttachmentImage.spec.js +63 -13
  12. package/es/AttachmentViewer/__tests__/__snapshots__/AttachmentImage.spec.js.snap +9 -5
  13. package/es/AttachmentViewer/__tests__/__snapshots__/AttachmentViewer.spec.js.snap +16 -117
  14. package/es/AttachmentViewer/props/defaultProps.js +5 -1
  15. package/es/AttachmentViewer/props/propTypes.js +7 -3
  16. package/es/AttachmentViewer/utils.js +49 -0
  17. package/es/ChannelIcon/ChannelIcon.module.css +225 -225
  18. package/es/FormAction/FormAction.module.css +100 -100
  19. package/es/IconButton/IconButton.module.css +22 -22
  20. package/es/Image/Image.js +6 -2
  21. package/es/Image/props/propTypes.js +3 -1
  22. package/es/TagWithIcon/TagWithIcon.module.css +66 -66
  23. package/es/avatar/AvatarIcon/AvatarIcon.module.css +58 -58
  24. package/es/emptystate/CommonEmptyState/CommonEmptyState.module.css +92 -92
  25. package/es/form/fields/CurrencyField/CurrencyField.js +2 -1
  26. package/es/form/fields/TextEditor/TextEditor.js +64 -64
  27. package/es/form/fields/TextEditor/TextEditor.module.css +73 -61
  28. package/es/form/fields/TextEditor/__tests__/__snapshots__/TextEditor.spec.js.snap +1 -1
  29. package/es/form/fields/TextEditor/props/defaultProps.js +4 -1
  30. package/es/form/fields/TextEditor/props/propTypes.js +10 -3
  31. package/es/form/fields/ValidationMessage/ValidationMessage.module.css +27 -27
  32. package/es/layout/SubtabLayout/SubtabLayout.module.css +164 -164
  33. package/es/list/Comment/Comment.module.css +29 -29
  34. package/es/list/Dot/Dot.module.css +15 -15
  35. package/es/list/ListLayout/ListLayout.module.css +79 -79
  36. package/es/list/Subject/Subject.module.css +34 -34
  37. package/es/list/Thread/Thread.module.css +42 -42
  38. package/es/list/status/StatusDropdown/StatusDropdown.js +8 -2
  39. package/es/list/status/StatusDropdown/__tests__/StatusDropdown.spec.js +16 -0
  40. package/es/list/status/StatusDropdown/__tests__/__snapshots__/StatusDropdown.spec.js.snap +14 -0
  41. package/es/list/status/StatusDropdown/props/propTypes.js +2 -0
  42. package/es/lookup/header/Search/LookupSearch.module.css +26 -26
  43. package/es/lookup/header/Search/Search.js +55 -38
  44. package/es/lookup/header/Search/props/defaultProps.js +2 -1
  45. package/es/lookup/header/Search/props/propTypes.js +5 -1
  46. package/es/utils/editorUtils.js +6 -6
  47. package/es/v1/AttachmentViewer/AttachmentImage.js +44 -23
  48. package/es/v1/AttachmentViewer/AttachmentViewer.js +120 -41
  49. package/es/v1/AttachmentViewer/props/propTypes.js +7 -3
  50. package/es/v1/Image/Image.js +6 -2
  51. package/es/v1/Image/props/propTypes.js +3 -1
  52. package/es/v1/form/fields/CurrencyField/CurrencyField.js +2 -1
  53. package/es/v1/form/fields/TextEditor/TextEditor.js +63 -64
  54. package/es/v1/form/fields/TextEditor/props/defaultProps.js +4 -1
  55. package/es/v1/form/fields/TextEditor/props/propTypes.js +10 -3
  56. package/es/v1/list/status/StatusDropdown/StatusDropdown.js +8 -2
  57. package/es/v1/list/status/StatusDropdown/props/propTypes.js +2 -0
  58. package/es/v1/utils/editorUtils.js +6 -6
  59. package/es/version2/GlobalNotification/GlobalNotification.module.css +177 -177
  60. package/es/version2/lookup/AlertHeader/css/AlertHeaderNew.module.css +87 -87
  61. package/es/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.module.css +132 -132
  62. package/lib/ActionButton/ActionButton.module.css +192 -192
  63. package/lib/AlphabeticList/AlphabeticList.module.css +57 -57
  64. package/lib/AttachmentViewer/AttachmentImage.js +74 -36
  65. package/lib/AttachmentViewer/AttachmentViewer.js +151 -70
  66. package/lib/AttachmentViewer/AttachmentViewer.module.css +364 -352
  67. package/lib/AttachmentViewer/__tests__/AttachmentImage.spec.js +64 -13
  68. package/lib/AttachmentViewer/__tests__/__snapshots__/AttachmentImage.spec.js.snap +9 -5
  69. package/lib/AttachmentViewer/__tests__/__snapshots__/AttachmentViewer.spec.js.snap +16 -117
  70. package/lib/AttachmentViewer/props/defaultProps.js +5 -1
  71. package/lib/AttachmentViewer/props/propTypes.js +7 -3
  72. package/lib/AttachmentViewer/utils.js +60 -1
  73. package/lib/ChannelIcon/ChannelIcon.module.css +225 -225
  74. package/lib/FormAction/FormAction.module.css +100 -100
  75. package/lib/IconButton/IconButton.module.css +22 -22
  76. package/lib/Image/Image.js +6 -2
  77. package/lib/Image/props/propTypes.js +3 -1
  78. package/lib/TagWithIcon/TagWithIcon.module.css +66 -66
  79. package/lib/avatar/AvatarIcon/AvatarIcon.module.css +58 -58
  80. package/lib/emptystate/CommonEmptyState/CommonEmptyState.module.css +92 -92
  81. package/lib/form/fields/CurrencyField/CurrencyField.js +2 -1
  82. package/lib/form/fields/TextEditor/TextEditor.js +74 -74
  83. package/lib/form/fields/TextEditor/TextEditor.module.css +73 -61
  84. package/lib/form/fields/TextEditor/__tests__/__snapshots__/TextEditor.spec.js.snap +1 -1
  85. package/lib/form/fields/TextEditor/props/defaultProps.js +4 -1
  86. package/lib/form/fields/TextEditor/props/propTypes.js +10 -3
  87. package/lib/form/fields/ValidationMessage/ValidationMessage.module.css +27 -27
  88. package/lib/layout/SubtabLayout/SubtabLayout.module.css +164 -164
  89. package/lib/list/Comment/Comment.module.css +29 -29
  90. package/lib/list/Dot/Dot.module.css +15 -15
  91. package/lib/list/ListLayout/ListLayout.module.css +79 -79
  92. package/lib/list/Subject/Subject.module.css +34 -34
  93. package/lib/list/Thread/Thread.module.css +42 -42
  94. package/lib/list/status/StatusDropdown/StatusDropdown.js +8 -2
  95. package/lib/list/status/StatusDropdown/__tests__/StatusDropdown.spec.js +14 -0
  96. package/lib/list/status/StatusDropdown/__tests__/__snapshots__/StatusDropdown.spec.js.snap +14 -0
  97. package/lib/list/status/StatusDropdown/props/propTypes.js +1 -1
  98. package/lib/lookup/header/Search/LookupSearch.module.css +26 -26
  99. package/lib/lookup/header/Search/Search.js +73 -64
  100. package/lib/lookup/header/Search/props/defaultProps.js +2 -1
  101. package/lib/lookup/header/Search/props/propTypes.js +9 -3
  102. package/lib/utils/editorUtils.js +6 -5
  103. package/lib/v1/AttachmentViewer/AttachmentImage.js +52 -24
  104. package/lib/v1/AttachmentViewer/AttachmentViewer.js +151 -70
  105. package/lib/v1/AttachmentViewer/props/propTypes.js +7 -3
  106. package/lib/v1/Image/Image.js +6 -2
  107. package/lib/v1/Image/props/propTypes.js +3 -1
  108. package/lib/v1/form/fields/CurrencyField/CurrencyField.js +2 -1
  109. package/lib/v1/form/fields/TextEditor/TextEditor.js +73 -74
  110. package/lib/v1/form/fields/TextEditor/props/defaultProps.js +4 -1
  111. package/lib/v1/form/fields/TextEditor/props/propTypes.js +10 -3
  112. package/lib/v1/list/status/StatusDropdown/StatusDropdown.js +8 -2
  113. package/lib/v1/list/status/StatusDropdown/props/propTypes.js +1 -1
  114. package/lib/v1/utils/editorUtils.js +6 -5
  115. package/lib/version2/GlobalNotification/GlobalNotification.module.css +177 -177
  116. package/lib/version2/lookup/AlertHeader/css/AlertHeaderNew.module.css +87 -87
  117. package/lib/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.module.css +132 -132
  118. package/package.json +6 -6
  119. package/result.json +1 -1
  120. package/unittest/index.html +6 -2
@@ -27,8 +27,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
27
27
 
28
28
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
29
 
30
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
31
-
32
30
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
33
31
 
34
32
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -70,7 +68,8 @@ var TextEditor = /*#__PURE__*/function (_Component) {
70
68
  isResourceLoaded: false,
71
69
  isEditorShow: false
72
70
  };
73
- var methods = ['editorCallback', 'handleUpload', 'handleChange', 'focusCallback', 'handleInlineUpload', 'handleDropUpload', 'blurCallback', 'handleGetContent', 'initializeEditor', 'clearEditorData', 'plainTextSwitchCallback', 'onWindowClick', 'toggleEditor'];
71
+ var methods = ['editorCallback', 'handleUpload', 'handleChange', 'focusCallback', 'handleInlineUpload', // 'handleDropUpload',
72
+ 'blurCallback', 'handleGetContent', 'initializeEditor', 'clearEditorData', 'plainTextSwitchCallback', 'onWindowClick', 'toggleEditor'];
74
73
 
75
74
  _editorUtils.bind.apply(_assertThisInitialized(_this), methods);
76
75
 
@@ -109,22 +108,20 @@ var TextEditor = /*#__PURE__*/function (_Component) {
109
108
  editorOptions = _this$props$editorOpt === void 0 ? {} : _this$props$editorOpt,
110
109
  _this$props$needEdito = _this$props.needEditorFocus,
111
110
  needEditorFocus = _this$props$needEdito === void 0 ? true : _this$props$needEdito,
112
- handleDropUpload = _this$props.handleDropUpload,
113
111
  fontFamily = _this$props.fontFamily,
114
112
  fontSize = _this$props.fontSize,
115
113
  initCallback = _this$props.initCallback,
116
114
  handleAlertMessage = _this$props.handleAlertMessage,
117
- needInlineAttachment = _this$props.needInlineAttachment;
115
+ needInlineAttachment = _this$props.needInlineAttachment,
116
+ customInitOption = _this$props.customInitOption;
118
117
 
119
118
  if (id && global.ZohoDeskEditor) {
120
- var _defaultObj;
121
-
122
- var defaultObj = (_defaultObj = {
119
+ var defaultObj = {
123
120
  id: id,
124
121
  content: (0, _editorUtils.fixEncoding)(value),
125
122
  callback: this.editorCallback,
126
123
  imageuploadcallback: this.handleInlineUpload,
127
- handleInlineDropImage: handleDropUpload ? this.handleDropUpload : undefined,
124
+ // handleInlineDropImage: handleDropUpload ? this.handleDropUpload : undefined,
128
125
  contentChanged: this.handleChange,
129
126
  focusCallback: this.focusCallback,
130
127
  lineHeight: 'Normal',
@@ -137,18 +134,27 @@ var TextEditor = /*#__PURE__*/function (_Component) {
137
134
  mode: mode,
138
135
  handleAlertMessage: handleAlertMessage,
139
136
  plainTextSwitchCallback: this.plainTextSwitchCallback,
140
- imgAspect: true
141
- }, _defineProperty(_defaultObj, "handleInlineDropImage", needInlineAttachment ? this.handleInlineUpload : null), _defineProperty(_defaultObj, "needInlineAttachHandling", needInlineAttachment), _defineProperty(_defaultObj, "hookOnInsertHTML", _editorUtils.validateEditorContentOnInsertHtml), _defineProperty(_defaultObj, "needCustomPaste", function needCustomPaste(event, editorObj) {
142
- return true; // By default reply editor needs customPaste, so returning true.
143
- }), _defineProperty(_defaultObj, "htmlVersion", '<!Doctype html>'), _defaultObj);
137
+ imgAspect: true,
138
+ handleInlineDropImage: needInlineAttachment ? this.handleInlineUpload : null,
139
+ needInlineAttachHandling: needInlineAttachment,
140
+ hookOnInsertHTML: _editorUtils.validateEditorContentOnInsertHtml,
141
+ needCustomPaste: function needCustomPaste(event, editorObj) {
142
+ return true; // By default reply editor needs customPaste, so returning true.
143
+ },
144
+ htmlVersion: '<!Doctype html>'
145
+ };
146
+
147
+ if (!customInitOption) {
148
+ if (!ZohoDeskEditor_Init.init) {
149
+ global.editorInitialize && global.editorInitialize();
150
+ }
144
151
 
145
- if (!ZohoDeskEditor_Init.init) {
146
- global.editorInitialize && global.editorInitialize();
152
+ ZohoDeskEditor_Init.init(editorMode, fontFamily, initCallback, fontSize);
147
153
  }
148
154
 
149
155
  defaultObj = Object.assign(defaultObj, editorOptions);
150
- ZohoDeskEditor_Init.init(editorMode, fontFamily, initCallback, fontSize);
151
- ZohoDeskEditor.create && ZohoDeskEditor.create(defaultObj);
156
+ var globalEditor = global.ZohoDeskEditor;
157
+ globalEditor && typeof globalEditor.create == 'function' && globalEditor.create(defaultObj, customInitOption);
152
158
  }
153
159
  }
154
160
  }, {
@@ -172,8 +178,8 @@ var TextEditor = /*#__PURE__*/function (_Component) {
172
178
  getRef && getRef(null);
173
179
  }
174
180
  }, {
175
- key: "componentWillReceiveProps",
176
- value: function componentWillReceiveProps(np) {
181
+ key: "UNSAFE_componentWillReceiveProps",
182
+ value: function UNSAFE_componentWillReceiveProps(np) {
177
183
  var changeEditorContent = this.props.changeEditorContent;
178
184
  var id = np.id;
179
185
  var editorObj = global.editor ? global.editor[id] ? global.editor[id] : {} : {};
@@ -251,7 +257,8 @@ var TextEditor = /*#__PURE__*/function (_Component) {
251
257
  var _this$props5 = this.props,
252
258
  editorCallback = _this$props5.editorCallback,
253
259
  getRef = _this$props5.getRef,
254
- isCustomScroll = _this$props5.isCustomScroll;
260
+ isCustomScroll = _this$props5.isCustomScroll,
261
+ customCSS = _this$props5.customCSS;
255
262
  this.setState({
256
263
  isEditorLoad: true,
257
264
  isEditorShow: true
@@ -263,18 +270,6 @@ var TextEditor = /*#__PURE__*/function (_Component) {
263
270
  global.editor[id] = editorObj;
264
271
  }
265
272
 
266
- var css = 'pre {white-space: pre-wrap}',
267
- head = editorObj.doc.head || editorObj.doc.getElementsByTagName('head')[0],
268
- style = document.createElement('style');
269
- style.type = 'text/css';
270
-
271
- if (style.styleSheet) {
272
- style.styleSheet.cssText = css;
273
- } else {
274
- style.appendChild(editorObj.doc.createTextNode(css));
275
- }
276
-
277
- head.appendChild(style);
278
273
  editorCallback && editorCallback(editorObj);
279
274
  var iframe = (0, _selectn["default"])('iframe.contentDocument.body', editorObj) || null;
280
275
  var iframeHead = (0, _selectn["default"])('iframe.contentDocument.head', editorObj) || null;
@@ -292,9 +287,12 @@ var TextEditor = /*#__PURE__*/function (_Component) {
292
287
  iframe.classList.add('scroll');
293
288
  }
294
289
 
295
- var customFonts = document.createElement('style');
296
- customFonts.innerText = "@font-face {font-family: 'ZohoPuviRegular';src: url('https://static.zohocdn.com/zohofonts/zohopuvi/4.0/Zoho_Puvi_Regular.woff2') format('woff2');font-style: normal;font-weight: normal;text-rendering: optimizeLegibility;font-display: swap}@font-face {font-family: Regular;src: url('https://static.zohocdn.com/webfonts/lato2regular/font.woff2') format('woff2');font-weight: 400;font-style: normal;font-display: swap}@font-face {font-family: 'RobotoRegular';font-weight: 400;font-style: normal;font-display: swa;src: url('https://static.zohocdn.com/webfonts/robotoregular/font.woff2')}";
297
- iframeHead.appendChild(customFonts);
290
+ var customStyleTag = document.createElement('style');
291
+ customStyleTag.type = 'text/css';
292
+ var customizedCSS = "pre {white-space: pre-wrap} ".concat(customCSS);
293
+ var fontCSS = "@font-face {font-family: 'ZohoPuviRegular';src: url('https://static.zohocdn.com/zohofonts/zohopuvi/4.0/Zoho_Puvi_Regular.woff2') format('woff2');font-style: normal;font-weight: normal;text-rendering: optimizeLegibility;font-display: swap}@font-face {font-family: Regular;src: url('https://static.zohocdn.com/webfonts/lato2regular/font.woff2') format('woff2');font-weight: 400;font-style: normal;font-display: swap}@font-face {font-family: 'RobotoRegular';font-weight: 400;font-style: normal;font-display: swa;src: url('https://static.zohocdn.com/webfonts/robotoregular/font.woff2')}";
294
+ customStyleTag.textContent = "".concat(customizedCSS, " ").concat(fontCSS);
295
+ iframeHead.appendChild(customStyleTag);
298
296
  }
299
297
  }
300
298
  }, {
@@ -303,12 +301,24 @@ var TextEditor = /*#__PURE__*/function (_Component) {
303
301
  var _this$props6 = this.props,
304
302
  id = _this$props6.id,
305
303
  progress = _this$props6.setInlineAttachmentInProgress,
306
- i18nKeys = _this$props6.i18nKeys;
307
-
308
- if (!(0, _editorUtils.isFileNameSizeInvalid)(file.name)) {
304
+ i18nKeys = _this$props6.i18nKeys,
305
+ inlineImageProps = _this$props6.inlineImageProps;
306
+ var fileUploadError = i18nKeys.fileUploadError,
307
+ fileNotSupported = i18nKeys.fileNotSupported,
308
+ fileSizeLimitExceed = i18nKeys.fileSizeLimitExceed,
309
+ fileEmptyError = i18nKeys.fileEmptyError,
310
+ fileNameLimitExceed = i18nKeys.fileNameLimitExceed;
311
+ var _inlineImageProps$all = inlineImageProps.allowedFileExtensions,
312
+ allowedFileExtensions = _inlineImageProps$all === void 0 ? ["jpeg", "jpg", "png", "gif", "bmp", "ico"] : _inlineImageProps$all,
313
+ _inlineImageProps$fil = inlineImageProps.fileNameMaxCharacters,
314
+ fileNameMaxCharacters = _inlineImageProps$fil === void 0 ? 200 : _inlineImageProps$fil,
315
+ _inlineImageProps$fil2 = inlineImageProps.fileSizeMaxBytes,
316
+ fileSizeMaxBytes = _inlineImageProps$fil2 === void 0 ? 3 * 1024 * 1024 : _inlineImageProps$fil2;
317
+
318
+ if (!(0, _editorUtils.isFileNameSizeInvalid)(file.name, fileNameMaxCharacters)) {
309
319
  if (file.size != 0) {
310
- if (file.size <= 3 * 1024 * 1024) {
311
- if ((0, _editorUtils.isImageFormat)(file.name)) {
320
+ if (file.size <= fileSizeMaxBytes) {
321
+ if ((0, _editorUtils.isImageFormat)(file.name, allowedFileExtensions)) {
312
322
  progress && progress(true);
313
323
  this.handleUpload(file).then(function (res) {
314
324
  successCallback(res);
@@ -318,36 +328,33 @@ var TextEditor = /*#__PURE__*/function (_Component) {
318
328
  (0, _editorUtils.triggerKeyup)(editorObj.doc);
319
329
  }
320
330
  }, function () {
321
- failureCallback(i18nKeys.fileUploadError);
331
+ failureCallback(fileUploadError);
322
332
  });
323
333
  } else {
324
- failureCallback(i18nKeys.fileNotSupported);
334
+ failureCallback(fileNotSupported);
325
335
  }
326
336
  } else {
327
- failureCallback(i18nKeys.fileSizeLimitExceed);
337
+ failureCallback(fileSizeLimitExceed);
328
338
  }
329
339
  } else {
330
- failureCallback(i18nKeys.fileEmptyError);
340
+ failureCallback(fileEmptyError);
331
341
  }
332
342
  } else {
333
- failureCallback(i18nKeys.fileNameLimitExceed);
343
+ failureCallback(fileNameLimitExceed);
334
344
  }
335
- }
336
- }, {
337
- key: "handleDropUpload",
338
- value: function handleDropUpload(file, successCallback, failureCallback) {
339
- var e = {
340
- target: {
341
- files: [file]
342
- }
343
- };
344
- var handleDropUpload = this.props.handleDropUpload;
345
- handleDropUpload(e).then(function (res) {
346
- successCallback(res);
347
- }, function () {
348
- failureCallback();
349
- });
350
- }
345
+ } // handleDropUpload(file, successCallback, failureCallback) {
346
+ // let e = { target: { files: [file] } };
347
+ // let { handleDropUpload } = this.props;
348
+ // handleDropUpload(e).then(
349
+ // (res) => {
350
+ // successCallback(res);
351
+ // },
352
+ // () => {
353
+ // failureCallback();
354
+ // }
355
+ // );
356
+ // }
357
+
351
358
  }, {
352
359
  key: "blurCallback",
353
360
  value: function blurCallback() {
@@ -372,15 +379,7 @@ var TextEditor = /*#__PURE__*/function (_Component) {
372
379
  formData.append(getCSRFCookieName(), getCSRFCookie());
373
380
  }
374
381
 
375
- return onUpload(formData, file).then(function (res) {
376
- if (editorMode === 'TicketReply') {
377
- return "".concat(res.data, "&from=r");
378
- }
379
-
380
- return res.data;
381
- }, function (err) {
382
- throw err;
383
- });
382
+ return onUpload(formData, file);
384
383
  } catch (err) {
385
384
  return Promise.reject();
386
385
  }
@@ -427,13 +426,14 @@ var TextEditor = /*#__PURE__*/function (_Component) {
427
426
  loadingComponent = _this$props9.loadingComponent,
428
427
  isNightMode = _this$props9.isNightMode,
429
428
  isReadOnly = _this$props9.isReadOnly,
430
- dataSelectorId = _this$props9.dataSelectorId;
429
+ dataSelectorId = _this$props9.dataSelectorId,
430
+ isDisabled = _this$props9.isDisabled;
431
431
  var _this$state = this.state,
432
432
  isEditorLoad = _this$state.isEditorLoad,
433
433
  isEditorShow = _this$state.isEditorShow;
434
434
  var editorDoc = ImgLazyLoad && global.editor && global.editor[id] ? global.editor[id].doc : null;
435
435
  return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
436
- className: "".concat(_TextEditorModule["default"].textEditor, " ").concat(_TextEditorModule["default"][type], " ").concat(_TextEditorModule["default"][border], "\n ").concat(isNightMode ? _TextEditorModule["default"].night : _TextEditorModule["default"].light, " ").concat(isReadOnly ? _TextEditorModule["default"].readOnly : '', " ").concat(!isEditorShow ? _TextEditorModule["default"].editorHide : ''),
436
+ className: "".concat(_TextEditorModule["default"].textEditor, " ").concat(_TextEditorModule["default"][type], " ").concat(_TextEditorModule["default"][border], "\n ").concat(isNightMode ? _TextEditorModule["default"].night : _TextEditorModule["default"].light, " ").concat(isReadOnly ? _TextEditorModule["default"].readOnly : '', " ").concat(isDisabled ? _TextEditorModule["default"].disable : '', " ").concat(!isEditorShow ? _TextEditorModule["default"].editorHide : ''),
437
437
  dataId: dataId,
438
438
  "data-isEditor": true,
439
439
  dataSelectorId: dataSelectorId
@@ -443,8 +443,8 @@ var TextEditor = /*#__PURE__*/function (_Component) {
443
443
  dataId: dataId
444
444
  }), editorDoc && ImgLazyLoad ? /*#__PURE__*/_react["default"].createElement(ImgLazyLoad, {
445
445
  node: editorDoc
446
- }) : null, isReadOnly ? /*#__PURE__*/_react["default"].createElement("div", {
447
- "class": _TextEditorModule["default"].readOnlyMask
446
+ }) : null, isReadOnly || isDisabled ? /*#__PURE__*/_react["default"].createElement("div", {
447
+ className: _TextEditorModule["default"].readOnlyMask
448
448
  }) : null);
449
449
  }
450
450
  }]);
@@ -77,20 +77,20 @@
77
77
  background-color: transparent;
78
78
  }
79
79
 
80
- .small :global .KB_Editor_menus .KB_Editor_MultiTools > li:hover,
81
- .small :global .KB_Editor_menus .KB_Editor_MultiTools > li.KB_Editor_sel,
82
- .medium :global .KB_Editor_menus .KB_Editor_MultiTools > li:hover,
83
- .medium :global .KB_Editor_menus .KB_Editor_MultiTools > li.KB_Editor_sel,
84
- .large :global .KB_Editor_menus .KB_Editor_MultiTools > li:hover,
85
- .large :global .KB_Editor_menus .KB_Editor_MultiTools > li.KB_Editor_sel,
86
- .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools > li:hover,
87
- .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools > li.KB_Editor_sel,
88
- .default :global .KB_Editor_menus .KB_Editor_MultiTools > li:hover,
89
- .default :global .KB_Editor_menus .KB_Editor_MultiTools > li.KB_Editor_sel {
80
+ .small :global .KB_Editor_menus .KB_Editor_MultiTools>li:hover,
81
+ .small :global .KB_Editor_menus .KB_Editor_MultiTools>li.KB_Editor_sel,
82
+ .medium :global .KB_Editor_menus .KB_Editor_MultiTools>li:hover,
83
+ .medium :global .KB_Editor_menus .KB_Editor_MultiTools>li.KB_Editor_sel,
84
+ .large :global .KB_Editor_menus .KB_Editor_MultiTools>li:hover,
85
+ .large :global .KB_Editor_menus .KB_Editor_MultiTools>li.KB_Editor_sel,
86
+ .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools>li:hover,
87
+ .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools>li.KB_Editor_sel,
88
+ .default :global .KB_Editor_menus .KB_Editor_MultiTools>li:hover,
89
+ .default :global .KB_Editor_menus .KB_Editor_MultiTools>li.KB_Editor_sel {
90
90
  color: var(--zdt_texteditor_default_text);
91
91
  }
92
92
 
93
- .small :global .KB_Editor_menus .KB_Editor_MultiTools > li:hover, .small :global .KB_Editor_menus .KB_Editor_MultiTools > li.KB_Editor_sel, .medium :global .KB_Editor_menus .KB_Editor_MultiTools > li:hover, .medium :global .KB_Editor_menus .KB_Editor_MultiTools > li.KB_Editor_sel, .large :global .KB_Editor_menus .KB_Editor_MultiTools > li:hover, .large :global .KB_Editor_menus .KB_Editor_MultiTools > li.KB_Editor_sel, .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools > li:hover, .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools > li.KB_Editor_sel, .default :global .KB_Editor_menus .KB_Editor_MultiTools > li:hover, .default :global .KB_Editor_menus .KB_Editor_MultiTools > li.KB_Editor_sel {
93
+ .small :global .KB_Editor_menus .KB_Editor_MultiTools>li:hover, .small :global .KB_Editor_menus .KB_Editor_MultiTools>li.KB_Editor_sel, .medium :global .KB_Editor_menus .KB_Editor_MultiTools>li:hover, .medium :global .KB_Editor_menus .KB_Editor_MultiTools>li.KB_Editor_sel, .large :global .KB_Editor_menus .KB_Editor_MultiTools>li:hover, .large :global .KB_Editor_menus .KB_Editor_MultiTools>li.KB_Editor_sel, .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools>li:hover, .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools>li.KB_Editor_sel, .default :global .KB_Editor_menus .KB_Editor_MultiTools>li:hover, .default :global .KB_Editor_menus .KB_Editor_MultiTools>li.KB_Editor_sel {
94
94
  background-color: var(--zdt_texteditor_menu_li_bg);
95
95
  }
96
96
 
@@ -101,10 +101,10 @@
101
101
  /* large type editor - ticket add form editor */
102
102
  .large :global .KB_Editor,
103
103
  .large :global .KB_Editor_menus .KB_Editor_MultiTools,
104
- .large :global .KB_Editor_menus .KB_Editor_MultiTools > li,
104
+ .large :global .KB_Editor_menus .KB_Editor_MultiTools>li,
105
105
  .default :global .KB_Editor,
106
106
  .default :global .KB_Editor_menus .KB_Editor_MultiTools,
107
- .default :global .KB_Editor_menus .KB_Editor_MultiTools > li {
107
+ .default :global .KB_Editor_menus .KB_Editor_MultiTools>li {
108
108
  display: -webkit-box;
109
109
  display: -ms-flexbox;
110
110
  display: flex;
@@ -160,24 +160,24 @@
160
160
  min-height: inherit ;
161
161
  }
162
162
 
163
- .large :global .KB_Editor_menus .KB_Editor_MultiTools > li,
164
- .default :global .KB_Editor_menus .KB_Editor_MultiTools > li {
163
+ .large :global .KB_Editor_menus .KB_Editor_MultiTools>li,
164
+ .default :global .KB_Editor_menus .KB_Editor_MultiTools>li {
165
165
  height: unset;
166
166
  -webkit-box-align: center;
167
167
  -ms-flex-align: center;
168
168
  align-items: center;
169
169
  }
170
170
 
171
- .large :global .KB_Editor_menus .KB_Editor_MultiTools > li, .default :global .KB_Editor_menus .KB_Editor_MultiTools > li {
171
+ .large :global .KB_Editor_menus .KB_Editor_MultiTools>li, .default :global .KB_Editor_menus .KB_Editor_MultiTools>li {
172
172
  padding: 0 ;
173
173
  float: unset;
174
174
  }
175
175
 
176
- [dir=ltr] .large :global .KB_Editor_menus .KB_Editor_MultiTools > li, [dir=ltr] .default :global .KB_Editor_menus .KB_Editor_MultiTools > li {
176
+ [dir=ltr] .large :global .KB_Editor_menus .KB_Editor_MultiTools>li, [dir=ltr] .default :global .KB_Editor_menus .KB_Editor_MultiTools>li {
177
177
  margin-right: 0 ;
178
178
  }
179
179
 
180
- [dir=rtl] .large :global .KB_Editor_menus .KB_Editor_MultiTools > li, [dir=rtl] .default :global .KB_Editor_menus .KB_Editor_MultiTools > li {
180
+ [dir=rtl] .large :global .KB_Editor_menus .KB_Editor_MultiTools>li, [dir=rtl] .default :global .KB_Editor_menus .KB_Editor_MultiTools>li {
181
181
  margin-left: 0 ;
182
182
  }
183
183
 
@@ -190,14 +190,14 @@
190
190
  float: unset !important;
191
191
  }
192
192
 
193
- .large :global .KB_Editor_menus > ul > li > span > svg,
194
- .default :global .KB_Editor_menus > ul > li > span > svg {
193
+ .large :global .KB_Editor_menus>ul>li>span>svg,
194
+ .default :global .KB_Editor_menus>ul>li>span>svg {
195
195
  width: var(--zd_size28) ;
196
196
  height: var(--zd_size28) ;
197
197
  }
198
198
 
199
- .large :global .KB_Editor_menus > ul > li > span.KB_Editor_Bdr_div > svg,
200
- .default :global .KB_Editor_menus > ul > li > span.KB_Editor_Bdr_div > svg {
199
+ .large :global .KB_Editor_menus>ul>li>span.KB_Editor_Bdr_div>svg,
200
+ .default :global .KB_Editor_menus>ul>li>span.KB_Editor_Bdr_div>svg {
201
201
  width: var(--zd_size8) ;
202
202
  height: var(--zd_size8) ;
203
203
  }
@@ -241,18 +241,18 @@
241
241
  left: 0 ;
242
242
  }
243
243
 
244
- [dir=ltr] .large :global .KB_Editor_menus .KB_Editor_MultiTools > li, [dir=ltr] .default :global .KB_Editor_menus .KB_Editor_MultiTools > li {
244
+ [dir=ltr] .large :global .KB_Editor_menus .KB_Editor_MultiTools>li, [dir=ltr] .default :global .KB_Editor_menus .KB_Editor_MultiTools>li {
245
245
  margin-right: var(--zd_size2) ;
246
246
  }
247
247
 
248
- [dir=rtl] .large :global .KB_Editor_menus .KB_Editor_MultiTools > li, [dir=rtl] .default :global .KB_Editor_menus .KB_Editor_MultiTools > li {
248
+ [dir=rtl] .large :global .KB_Editor_menus .KB_Editor_MultiTools>li, [dir=rtl] .default :global .KB_Editor_menus .KB_Editor_MultiTools>li {
249
249
  margin-left: var(--zd_size2) ;
250
250
  }
251
251
 
252
252
  /* xlarge type editor - reply area, blue print cases - full height hover style */
253
253
  .xlarge :global .KB_Editor,
254
254
  .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools,
255
- .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools > li {
255
+ .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools>li {
256
256
  display: -webkit-box;
257
257
  display: -ms-flexbox;
258
258
  display: flex;
@@ -293,7 +293,7 @@
293
293
  min-height: inherit ;
294
294
  }
295
295
 
296
- .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools > li {
296
+ .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools>li {
297
297
  height: unset;
298
298
  -webkit-box-align: center;
299
299
  -ms-flex-align: center;
@@ -302,11 +302,11 @@
302
302
  float: unset;
303
303
  }
304
304
 
305
- [dir=ltr] .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools > li {
305
+ [dir=ltr] .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools>li {
306
306
  margin-right: 0 ;
307
307
  }
308
308
 
309
- [dir=rtl] .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools > li {
309
+ [dir=rtl] .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools>li {
310
310
  margin-left: 0 ;
311
311
  }
312
312
 
@@ -324,12 +324,12 @@
324
324
  padding: var(--zd_size6) ;
325
325
  }
326
326
 
327
- .xlarge :global .KB_Editor_menus > ul > li > span > svg {
327
+ .xlarge :global .KB_Editor_menus>ul>li>span>svg {
328
328
  width: var(--zd_size22) ;
329
329
  height: var(--zd_size22) ;
330
330
  }
331
331
 
332
- .xlarge :global .KB_Editor_menus > ul > li > span.KB_Editor_Bdr_div > svg {
332
+ .xlarge :global .KB_Editor_menus>ul>li>span.KB_Editor_Bdr_div>svg {
333
333
  width: var(--zd_size8) ;
334
334
  height: var(--zd_size8) ;
335
335
  }
@@ -354,13 +354,13 @@
354
354
  left: 0 ;
355
355
  }
356
356
 
357
- .xlarge :global .KB_Editor_menus > ul > li > span.SnippetIcon svg {
357
+ .xlarge :global .KB_Editor_menus>ul>li>span.SnippetIcon svg {
358
358
  width: var(--zd_size17) ;
359
359
  height: var(--zd_size21) ;
360
360
  padding: 0 var(--zd_size7) ;
361
361
  }
362
362
 
363
- .xlarge :global .KB_Editor_menus > ul > li > span.TemplateIcon svg {
363
+ .xlarge :global .KB_Editor_menus>ul>li>span.TemplateIcon svg {
364
364
  width: var(--zd_size16) ;
365
365
  height: var(--zd_size16) ;
366
366
  padding: 0 var(--zd_size9) ;
@@ -393,31 +393,16 @@
393
393
  padding: 0 var(--zd_size7) ;
394
394
  }
395
395
 
396
- .xlarge :global .KB_Editor_MultiTools li .Kbeditor_more_icon > svg {
396
+ .xlarge :global .KB_Editor_MultiTools li .Kbeditor_more_icon>svg {
397
397
  width: var(--zd_size12) ;
398
398
  height: var(--zd_size12) ;
399
399
  }
400
400
 
401
- .xlarge
402
- :global
403
- .KB_Editor_menus
404
- > ul
405
- > li
406
- > span:not(.KB_Editor_Bdr_div):not(.KBEditortools-Block-down-arrow):not(.Kbeditor_more_icon):not(.SnippetIcon):not(
407
- .TemplateIcon
408
- ):not(.KB_Editor_Richtext):not(.KB_Editor_PlainText) {
401
+ .xlarge :global .KB_Editor_menus>ul>li>span:not(.KB_Editor_Bdr_div):not(.KBEditortools-Block-down-arrow):not(.Kbeditor_more_icon):not(.SnippetIcon):not(.TemplateIcon):not(.KB_Editor_Richtext):not(.KB_Editor_PlainText) {
409
402
  height: var(--zd_size21) ;
410
403
  }
411
404
 
412
- .xlarge
413
- :global
414
- .KB_Editor_menus
415
- > ul
416
- > li
417
- > span:not(.KB_Editor_Bdr_div):not(.KBEditortools-Block-down-arrow):not(.Kbeditor_more_icon):not(.SnippetIcon):not(
418
- .TemplateIcon
419
- )
420
- > svg {
405
+ .xlarge :global .KB_Editor_menus>ul>li>span:not(.KB_Editor_Bdr_div):not(.KBEditortools-Block-down-arrow):not(.Kbeditor_more_icon):not(.SnippetIcon):not(.TemplateIcon)>svg {
421
406
  width: var(--zd_size21) ;
422
407
  height: var(--zd_size21) ;
423
408
  padding: 0 var(--zd_size4) ;
@@ -442,7 +427,7 @@
442
427
  /* medium type editor - snippet, bug tracker cases */
443
428
  .medium :global .KB_Editor,
444
429
  .medium :global .KB_Editor_menus .KB_Editor_MultiTools,
445
- .medium :global .KB_Editor_menus .KB_Editor_MultiTools > li {
430
+ .medium :global .KB_Editor_menus .KB_Editor_MultiTools>li {
446
431
  display: -webkit-box;
447
432
  display: -ms-flexbox;
448
433
  display: flex;
@@ -483,7 +468,7 @@
483
468
  min-height: inherit ;
484
469
  }
485
470
 
486
- .medium :global .KB_Editor_menus .KB_Editor_MultiTools > li {
471
+ .medium :global .KB_Editor_menus .KB_Editor_MultiTools>li {
487
472
  height: unset;
488
473
  -webkit-box-align: center;
489
474
  -ms-flex-align: center;
@@ -496,21 +481,21 @@
496
481
  line-height: 0;
497
482
  }
498
483
 
499
- .medium :global .KB_Editor_menus > ul > li > span > svg {
484
+ .medium :global .KB_Editor_menus>ul>li>span>svg {
500
485
  width: var(--zd_size22) ;
501
486
  height: var(--zd_size22) ;
502
487
  }
503
488
 
504
- .medium :global .KB_Editor_menus > ul > li > span.KB_Editor_Bdr_div > svg {
489
+ .medium :global .KB_Editor_menus>ul>li>span.KB_Editor_Bdr_div>svg {
505
490
  width: var(--zd_size8) ;
506
491
  height: var(--zd_size8) ;
507
492
  }
508
493
 
509
- [dir=ltr] .medium :global .KB_Editor_menus > ul > li > span.KB_Editor_Bdr_div > svg {
494
+ [dir=ltr] .medium :global .KB_Editor_menus>ul>li>span.KB_Editor_Bdr_div>svg {
510
495
  padding: 0 0 0 var(--zd_size2) ;
511
496
  }
512
497
 
513
- [dir=rtl] .medium :global .KB_Editor_menus > ul > li > span.KB_Editor_Bdr_div > svg {
498
+ [dir=rtl] .medium :global .KB_Editor_menus>ul>li>span.KB_Editor_Bdr_div>svg {
514
499
  padding: 0 var(--zd_size2) 0 0 ;
515
500
  }
516
501
 
@@ -547,7 +532,7 @@
547
532
  padding: 0 var(--zd_size3) ;
548
533
  }
549
534
 
550
- .medium :global .KB_Editor_MultiTools li .Kbeditor_more_icon > svg {
535
+ .medium :global .KB_Editor_MultiTools li .Kbeditor_more_icon>svg {
551
536
  width: var(--zd_size12) ;
552
537
  height: var(--zd_size12) ;
553
538
  }
@@ -627,13 +612,13 @@
627
612
  line-height: 0;
628
613
  }
629
614
 
630
- .small :global .KB_Editor_menus > ul > li > span > svg,
631
- .mini :global .KB_Editor_menus > ul > li > span > svg {
615
+ .small :global .KB_Editor_menus>ul>li>span>svg,
616
+ .mini :global .KB_Editor_menus>ul>li>span>svg {
632
617
  width: var(--zd_size25) ;
633
618
  height: var(--zd_size25) ;
634
619
  }
635
620
 
636
- .small :global .KB_Editor_menus > ul > li > span > svg, .mini :global .KB_Editor_menus > ul > li > span > svg {
621
+ .small :global .KB_Editor_menus>ul>li>span>svg, .mini :global .KB_Editor_menus>ul>li>span>svg {
637
622
  padding: 0 var(--zd_size6) ;
638
623
  }
639
624
 
@@ -745,8 +730,12 @@
745
730
  order: 100;
746
731
  }
747
732
 
733
+ .disable,
748
734
  .readOnly {
749
735
  position: relative;
736
+ }
737
+
738
+ .disable, .readOnly {
750
739
  cursor: not-allowed;
751
740
  }
752
741
 
@@ -770,6 +759,29 @@
770
759
  display: none !important;
771
760
  }
772
761
 
762
+ .disable :global .KB_Editor_menus {
763
+ position: relative;
764
+ }
765
+
766
+ .disable :global .KB_Editor_menus::after {
767
+ content: '';
768
+ position: absolute;
769
+ top: 0 ;
770
+ bottom: 0 ;
771
+ z-index: 1;
772
+ cursor: not-allowed;
773
+ }
774
+
775
+ [dir=ltr] .disable :global .KB_Editor_menus::after {
776
+ left: 0 ;
777
+ right: 0 ;
778
+ }
779
+
780
+ [dir=rtl] .disable :global .KB_Editor_menus::after {
781
+ right: 0 ;
782
+ left: 0 ;
783
+ }
784
+
773
785
  .editorHide :global .KB_Editor {
774
786
  position: absolute !important;
775
787
  top: 0 ;
@@ -784,4 +796,4 @@
784
796
 
785
797
  [dir=rtl] .editorHide :global .KB_Editor {
786
798
  right: 0 ;
787
- }
799
+ }
@@ -4,7 +4,7 @@ exports[`TextEditor rendering the defult props 1`] = `
4
4
  <DocumentFragment>
5
5
  <div
6
6
  class="textEditor large borderTop
7
- light editorHide flex cover coldir"
7
+ light editorHide flex cover coldir"
8
8
  data-id="containerComponent"
9
9
  data-iseditor="true"
10
10
  data-selector-id="textEditor"
@@ -15,6 +15,9 @@ var defaultProps = {
15
15
  needInlineAttachment: false,
16
16
  isNightMode: false,
17
17
  isReadOnly: false,
18
- dataSelectorId: 'textEditor'
18
+ dataSelectorId: 'textEditor',
19
+ customCSS: '',
20
+ isDisabled: false,
21
+ inlineImageProps: {}
19
22
  };
20
23
  exports.defaultProps = defaultProps;
@@ -22,7 +22,6 @@ var propTypes = {
22
22
  fontSize: _propTypes["default"].string,
23
23
  getRef: _propTypes["default"].func,
24
24
  handleAlertMessage: _propTypes["default"].func,
25
- handleDropUpload: _propTypes["default"].func,
26
25
  i18nKeys: _propTypes["default"].shape({
27
26
  fileUploadError: _propTypes["default"].string,
28
27
  fileNotSupported: _propTypes["default"].string,
@@ -31,7 +30,7 @@ var propTypes = {
31
30
  fileSizeLimitExceed: _propTypes["default"].string
32
31
  }),
33
32
  id: _propTypes["default"].string,
34
- initCallback: _propTypes["default"].func.isRequired,
33
+ initCallback: _propTypes["default"].func,
35
34
  isCustomScroll: _propTypes["default"].bool,
36
35
  loadingComponent: _propTypes["default"].node,
37
36
  mode: _propTypes["default"].string,
@@ -52,6 +51,14 @@ var propTypes = {
52
51
  getCSRFCookie: _propTypes["default"].string,
53
52
  isEditorDefaultOpen: _propTypes["default"].bool,
54
53
  toggleEdit: _propTypes["default"].func,
55
- dataSelectorId: _propTypes["default"].string
54
+ dataSelectorId: _propTypes["default"].string,
55
+ customInitOption: _propTypes["default"].object,
56
+ customCSS: _propTypes["default"].string,
57
+ isDisabled: _propTypes["default"].bool,
58
+ inlineImageProps: _propTypes["default"].shape({
59
+ allowedFileExtensions: _propTypes["default"].array,
60
+ fileNameMaxCharacters: _propTypes["default"].number,
61
+ fileSizeMaxBytes: _propTypes["default"].number
62
+ })
56
63
  };
57
64
  exports.propTypes = propTypes;