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

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 (229) hide show
  1. package/.cli/UnValidatedFiles.html +1 -1
  2. package/.cli/propValidation_report.html +1 -1
  3. package/README.md +28 -0
  4. package/assets/Appearance/dark/mode/Dot_DarkMode.module.css +1 -0
  5. package/assets/Appearance/light/mode/Dot_LightMode.module.css +1 -0
  6. package/assets/Appearance/pureDark/mode/Dot_PureDarkMode.module.css +1 -0
  7. package/es/ActionButton/ActionButton.module.css +192 -192
  8. package/es/AlphabeticList/AlphabeticList.module.css +57 -57
  9. package/es/AttachmentViewer/AttachmentImage.js +68 -32
  10. package/es/AttachmentViewer/AttachmentViewer.js +120 -41
  11. package/es/AttachmentViewer/AttachmentViewer.module.css +364 -352
  12. package/es/AttachmentViewer/__tests__/AttachmentImage.spec.js +63 -13
  13. package/es/AttachmentViewer/__tests__/__snapshots__/AttachmentImage.spec.js.snap +9 -5
  14. package/es/AttachmentViewer/__tests__/__snapshots__/AttachmentViewer.spec.js.snap +16 -117
  15. package/es/AttachmentViewer/props/defaultProps.js +5 -1
  16. package/es/AttachmentViewer/props/propTypes.js +7 -3
  17. package/es/AttachmentViewer/utils.js +49 -0
  18. package/es/ChannelIcon/ChannelIcon.module.css +225 -225
  19. package/es/FormAction/FormAction.module.css +100 -100
  20. package/es/IconButton/IconButton.module.css +22 -22
  21. package/es/Image/Image.js +6 -2
  22. package/es/Image/props/propTypes.js +3 -1
  23. package/es/TagWithIcon/TagWithIcon.module.css +66 -66
  24. package/es/avatar/AvatarIcon/AvatarIcon.module.css +58 -58
  25. package/es/common/dot_boxShadow.module.css +2 -0
  26. package/es/emptystate/CommonEmptyState/CommonEmptyState.module.css +92 -92
  27. package/es/form/fields/TagsMultiSelect/TagsMultiSelect.js +4 -2
  28. package/es/form/fields/TextEditor/TextEditor.js +64 -64
  29. package/es/form/fields/TextEditor/TextEditor.module.css +73 -61
  30. package/es/form/fields/TextEditor/__tests__/__snapshots__/TextEditor.spec.js.snap +1 -1
  31. package/es/form/fields/TextEditor/props/defaultProps.js +4 -1
  32. package/es/form/fields/TextEditor/props/propTypes.js +10 -3
  33. package/es/form/fields/ValidationMessage/ValidationMessage.module.css +27 -27
  34. package/es/layout/SubtabLayout/SubtabLayout.module.css +164 -164
  35. package/es/list/Comment/Comment.module.css +29 -29
  36. package/es/list/DepartmentDropDown/DepartmentDropDown.js +7 -2
  37. package/es/list/DepartmentDropDown/props/defaultProps.js +2 -1
  38. package/es/list/DepartmentDropDown/props/propTypes.js +2 -1
  39. package/es/list/Dot/Dot.module.css +15 -15
  40. package/es/list/ListLayout/ListLayout.module.css +79 -79
  41. package/es/list/Subject/Subject.module.css +34 -34
  42. package/es/list/Thread/Thread.module.css +42 -42
  43. package/es/list/status/StatusListItem/StatusListItem.module.css +35 -5
  44. package/es/utils/editorUtils.js +6 -6
  45. package/es/v1/AttachmentViewer/AttachmentImage.js +44 -23
  46. package/es/v1/AttachmentViewer/AttachmentViewer.js +120 -41
  47. package/es/v1/AttachmentViewer/props/propTypes.js +7 -3
  48. package/es/v1/Image/Image.js +6 -2
  49. package/es/v1/Image/props/propTypes.js +3 -1
  50. package/es/v1/form/fields/TextEditor/TextEditor.js +63 -64
  51. package/es/v1/form/fields/TextEditor/props/defaultProps.js +4 -1
  52. package/es/v1/form/fields/TextEditor/props/propTypes.js +10 -3
  53. package/es/v1/utils/editorUtils.js +6 -6
  54. package/es/version2/GlobalNotification/GlobalNotification.module.css +177 -177
  55. package/es/version2/lookup/AlertHeader/css/AlertHeaderNew.module.css +87 -87
  56. package/es/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.module.css +132 -132
  57. package/lib/ActionButton/ActionButton.module.css +192 -192
  58. package/lib/AlphabeticList/AlphabeticList.module.css +57 -57
  59. package/lib/AttachmentViewer/AttachmentImage.js +74 -36
  60. package/lib/AttachmentViewer/AttachmentViewer.js +151 -70
  61. package/lib/AttachmentViewer/AttachmentViewer.module.css +364 -352
  62. package/lib/AttachmentViewer/__tests__/AttachmentImage.spec.js +64 -13
  63. package/lib/AttachmentViewer/__tests__/__snapshots__/AttachmentImage.spec.js.snap +9 -5
  64. package/lib/AttachmentViewer/__tests__/__snapshots__/AttachmentViewer.spec.js.snap +16 -117
  65. package/lib/AttachmentViewer/props/defaultProps.js +5 -1
  66. package/lib/AttachmentViewer/props/propTypes.js +7 -3
  67. package/lib/AttachmentViewer/utils.js +60 -1
  68. package/lib/ChannelIcon/ChannelIcon.module.css +225 -225
  69. package/lib/FormAction/FormAction.module.css +100 -100
  70. package/lib/IconButton/IconButton.module.css +22 -22
  71. package/lib/Image/Image.js +6 -2
  72. package/lib/Image/props/propTypes.js +3 -1
  73. package/lib/TagWithIcon/TagWithIcon.module.css +66 -66
  74. package/lib/avatar/AvatarIcon/AvatarIcon.module.css +58 -58
  75. package/lib/common/dot_boxShadow.module.css +2 -0
  76. package/lib/emptystate/CommonEmptyState/CommonEmptyState.module.css +92 -92
  77. package/lib/form/fields/TagsMultiSelect/TagsMultiSelect.js +5 -3
  78. package/lib/form/fields/TextEditor/TextEditor.js +74 -74
  79. package/lib/form/fields/TextEditor/TextEditor.module.css +73 -61
  80. package/lib/form/fields/TextEditor/__tests__/__snapshots__/TextEditor.spec.js.snap +1 -1
  81. package/lib/form/fields/TextEditor/props/defaultProps.js +4 -1
  82. package/lib/form/fields/TextEditor/props/propTypes.js +10 -3
  83. package/lib/form/fields/ValidationMessage/ValidationMessage.module.css +27 -27
  84. package/lib/layout/SubtabLayout/SubtabLayout.module.css +164 -164
  85. package/lib/list/Comment/Comment.module.css +29 -29
  86. package/lib/list/DepartmentDropDown/DepartmentDropDown.js +8 -3
  87. package/lib/list/DepartmentDropDown/props/defaultProps.js +2 -1
  88. package/lib/list/DepartmentDropDown/props/propTypes.js +1 -1
  89. package/lib/list/Dot/Dot.module.css +15 -15
  90. package/lib/list/ListLayout/ListLayout.module.css +79 -79
  91. package/lib/list/Subject/Subject.module.css +34 -34
  92. package/lib/list/Thread/Thread.module.css +42 -42
  93. package/lib/list/status/StatusListItem/StatusListItem.module.css +35 -5
  94. package/lib/utils/editorUtils.js +6 -5
  95. package/lib/v1/AttachmentViewer/AttachmentImage.js +52 -24
  96. package/lib/v1/AttachmentViewer/AttachmentViewer.js +151 -70
  97. package/lib/v1/AttachmentViewer/props/propTypes.js +7 -3
  98. package/lib/v1/Image/Image.js +6 -2
  99. package/lib/v1/Image/props/propTypes.js +3 -1
  100. package/lib/v1/form/fields/TextEditor/TextEditor.js +73 -74
  101. package/lib/v1/form/fields/TextEditor/props/defaultProps.js +4 -1
  102. package/lib/v1/form/fields/TextEditor/props/propTypes.js +10 -3
  103. package/lib/v1/utils/editorUtils.js +6 -5
  104. package/lib/version2/GlobalNotification/GlobalNotification.module.css +177 -177
  105. package/lib/version2/lookup/AlertHeader/css/AlertHeaderNew.module.css +87 -87
  106. package/lib/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.module.css +132 -132
  107. package/package.json +3 -3
  108. package/result.json +1 -1
  109. package/unittest/index.html +1 -1
  110. package/es/DotProvider/DotProvider.js +0 -60
  111. package/es/DotProvider/hooks/useDotProvider.js +0 -55
  112. package/es/DotProvider/hooks/useDownloadAssetsAndSetAttr.js +0 -97
  113. package/es/DotProvider/libraryChunks/themes/component/blue/Blue_Dark_Component.js +0 -3
  114. package/es/DotProvider/libraryChunks/themes/component/blue/Blue_Light_Component.js +0 -3
  115. package/es/DotProvider/libraryChunks/themes/component/blue/Blue_PureDark_Component.js +0 -3
  116. package/es/DotProvider/libraryChunks/themes/component/green/Green_Dark_Component.js +0 -3
  117. package/es/DotProvider/libraryChunks/themes/component/green/Green_Light_Component.js +0 -3
  118. package/es/DotProvider/libraryChunks/themes/component/green/Green_PureDark_Component.js +0 -3
  119. package/es/DotProvider/libraryChunks/themes/component/orange/Orange_Dark_Component.js +0 -3
  120. package/es/DotProvider/libraryChunks/themes/component/orange/Orange_Light_Component.js +0 -3
  121. package/es/DotProvider/libraryChunks/themes/component/orange/Orange_PureDark_Component.js +0 -3
  122. package/es/DotProvider/libraryChunks/themes/component/red/Red_Dark_Component.js +0 -3
  123. package/es/DotProvider/libraryChunks/themes/component/red/Red_Light_Component.js +0 -3
  124. package/es/DotProvider/libraryChunks/themes/component/red/Red_PureDark_Component.js +0 -3
  125. package/es/DotProvider/libraryChunks/themes/component/yellow/Yellow_Dark_Component.js +0 -3
  126. package/es/DotProvider/libraryChunks/themes/component/yellow/Yellow_Light_Component.js +0 -3
  127. package/es/DotProvider/libraryChunks/themes/component/yellow/Yellow_PureDark_Component.js +0 -3
  128. package/es/DotProvider/libraryChunks/themes/dot/blue/Blue_Dark_Dot.js +0 -1
  129. package/es/DotProvider/libraryChunks/themes/dot/blue/Blue_Light_Dot.js +0 -1
  130. package/es/DotProvider/libraryChunks/themes/dot/blue/Blue_PureDark_Dot.js +0 -1
  131. package/es/DotProvider/libraryChunks/themes/dot/green/Green_Dark_Dot.js +0 -1
  132. package/es/DotProvider/libraryChunks/themes/dot/green/Green_Light_Dot.js +0 -1
  133. package/es/DotProvider/libraryChunks/themes/dot/green/Green_PureDark_Dot.js +0 -1
  134. package/es/DotProvider/libraryChunks/themes/dot/orange/Orange_Dark_Dot.js +0 -1
  135. package/es/DotProvider/libraryChunks/themes/dot/orange/Orange_Light_Dot.js +0 -1
  136. package/es/DotProvider/libraryChunks/themes/dot/orange/Orange_PureDark_Dot.js +0 -1
  137. package/es/DotProvider/libraryChunks/themes/dot/red/Red_Dark_Dot.js +0 -1
  138. package/es/DotProvider/libraryChunks/themes/dot/red/Red_Light_Dot.js +0 -1
  139. package/es/DotProvider/libraryChunks/themes/dot/red/Red_PureDark_Dot.js +0 -1
  140. package/es/DotProvider/libraryChunks/themes/dot/yellow/Yellow_Dark_Dot.js +0 -1
  141. package/es/DotProvider/libraryChunks/themes/dot/yellow/Yellow_Light_Dot.js +0 -1
  142. package/es/DotProvider/libraryChunks/themes/dot/yellow/Yellow_PureDark_Dot.js +0 -1
  143. package/es/DotProvider/libraryChunks/themes/svg/blue/Blue_Dark_SVG.js +0 -1
  144. package/es/DotProvider/libraryChunks/themes/svg/blue/Blue_Light_SVG.js +0 -1
  145. package/es/DotProvider/libraryChunks/themes/svg/blue/Blue_PureDark_SVG.js +0 -1
  146. package/es/DotProvider/libraryChunks/themes/svg/green/Green_Dark_SVG.js +0 -1
  147. package/es/DotProvider/libraryChunks/themes/svg/green/Green_Light_SVG.js +0 -1
  148. package/es/DotProvider/libraryChunks/themes/svg/green/Green_PureDark_SVG.js +0 -1
  149. package/es/DotProvider/libraryChunks/themes/svg/orange/Orange_Dark_SVG.js +0 -1
  150. package/es/DotProvider/libraryChunks/themes/svg/orange/Orange_Light_SVG.js +0 -1
  151. package/es/DotProvider/libraryChunks/themes/svg/orange/Orange_PureDark_SVG.js +0 -1
  152. package/es/DotProvider/libraryChunks/themes/svg/red/Red_Dark_SVG.js +0 -1
  153. package/es/DotProvider/libraryChunks/themes/svg/red/Red_Light_SVG.js +0 -1
  154. package/es/DotProvider/libraryChunks/themes/svg/red/Red_PureDark_SVG.js +0 -1
  155. package/es/DotProvider/libraryChunks/themes/svg/yellow/Yellow_Dark_SVG.js +0 -1
  156. package/es/DotProvider/libraryChunks/themes/svg/yellow/Yellow_Light_SVG.js +0 -1
  157. package/es/DotProvider/libraryChunks/themes/svg/yellow/Yellow_PureDark_SVG.js +0 -1
  158. package/es/DotProvider/props/defaultProps.js +0 -11
  159. package/es/DotProvider/props/propTypes.js +0 -16
  160. package/es/DotProvider/utils/assetPromiseHandlers/fontSizeAssetPromise.js +0 -4
  161. package/es/DotProvider/utils/assetPromiseHandlers/themeAppearanceAssetPromise.js +0 -28
  162. package/es/DotProvider/utils/assetPromiseHandlers/themeColorAssetPromise.js +0 -29
  163. package/es/DotProvider/utils/assetPromiseHandlers/zoomSizeAssetPromise.js +0 -4
  164. package/es/DotProvider/utils/constants.js +0 -14
  165. package/es/DotProvider/utils/errorValidation.js +0 -17
  166. package/es/DotProvider/utils/getAssetsImportPromises.js +0 -17
  167. package/es/DotProvider/utils/sizeAssetsConfig.js +0 -12
  168. package/es/DotProvider/utils/themeAppearanceAssetsConfig.js +0 -47
  169. package/es/DotProvider/utils/themeColorAssetsConfig.js +0 -221
  170. package/lib/DotProvider/DotProvider.js +0 -88
  171. package/lib/DotProvider/hooks/useDotProvider.js +0 -83
  172. package/lib/DotProvider/hooks/useDownloadAssetsAndSetAttr.js +0 -119
  173. package/lib/DotProvider/libraryChunks/themes/component/blue/Blue_Dark_Component.js +0 -7
  174. package/lib/DotProvider/libraryChunks/themes/component/blue/Blue_Light_Component.js +0 -7
  175. package/lib/DotProvider/libraryChunks/themes/component/blue/Blue_PureDark_Component.js +0 -7
  176. package/lib/DotProvider/libraryChunks/themes/component/green/Green_Dark_Component.js +0 -7
  177. package/lib/DotProvider/libraryChunks/themes/component/green/Green_Light_Component.js +0 -7
  178. package/lib/DotProvider/libraryChunks/themes/component/green/Green_PureDark_Component.js +0 -7
  179. package/lib/DotProvider/libraryChunks/themes/component/orange/Orange_Dark_Component.js +0 -7
  180. package/lib/DotProvider/libraryChunks/themes/component/orange/Orange_Light_Component.js +0 -7
  181. package/lib/DotProvider/libraryChunks/themes/component/orange/Orange_PureDark_Component.js +0 -7
  182. package/lib/DotProvider/libraryChunks/themes/component/red/Red_Dark_Component.js +0 -7
  183. package/lib/DotProvider/libraryChunks/themes/component/red/Red_Light_Component.js +0 -7
  184. package/lib/DotProvider/libraryChunks/themes/component/red/Red_PureDark_Component.js +0 -7
  185. package/lib/DotProvider/libraryChunks/themes/component/yellow/Yellow_Dark_Component.js +0 -7
  186. package/lib/DotProvider/libraryChunks/themes/component/yellow/Yellow_Light_Component.js +0 -7
  187. package/lib/DotProvider/libraryChunks/themes/component/yellow/Yellow_PureDark_Component.js +0 -7
  188. package/lib/DotProvider/libraryChunks/themes/dot/blue/Blue_Dark_Dot.js +0 -3
  189. package/lib/DotProvider/libraryChunks/themes/dot/blue/Blue_Light_Dot.js +0 -3
  190. package/lib/DotProvider/libraryChunks/themes/dot/blue/Blue_PureDark_Dot.js +0 -3
  191. package/lib/DotProvider/libraryChunks/themes/dot/green/Green_Dark_Dot.js +0 -3
  192. package/lib/DotProvider/libraryChunks/themes/dot/green/Green_Light_Dot.js +0 -3
  193. package/lib/DotProvider/libraryChunks/themes/dot/green/Green_PureDark_Dot.js +0 -3
  194. package/lib/DotProvider/libraryChunks/themes/dot/orange/Orange_Dark_Dot.js +0 -3
  195. package/lib/DotProvider/libraryChunks/themes/dot/orange/Orange_Light_Dot.js +0 -3
  196. package/lib/DotProvider/libraryChunks/themes/dot/orange/Orange_PureDark_Dot.js +0 -3
  197. package/lib/DotProvider/libraryChunks/themes/dot/red/Red_Dark_Dot.js +0 -3
  198. package/lib/DotProvider/libraryChunks/themes/dot/red/Red_Light_Dot.js +0 -3
  199. package/lib/DotProvider/libraryChunks/themes/dot/red/Red_PureDark_Dot.js +0 -3
  200. package/lib/DotProvider/libraryChunks/themes/dot/yellow/Yellow_Dark_Dot.js +0 -3
  201. package/lib/DotProvider/libraryChunks/themes/dot/yellow/Yellow_Light_Dot.js +0 -3
  202. package/lib/DotProvider/libraryChunks/themes/dot/yellow/Yellow_PureDark_Dot.js +0 -3
  203. package/lib/DotProvider/libraryChunks/themes/svg/blue/Blue_Dark_SVG.js +0 -3
  204. package/lib/DotProvider/libraryChunks/themes/svg/blue/Blue_Light_SVG.js +0 -3
  205. package/lib/DotProvider/libraryChunks/themes/svg/blue/Blue_PureDark_SVG.js +0 -3
  206. package/lib/DotProvider/libraryChunks/themes/svg/green/Green_Dark_SVG.js +0 -3
  207. package/lib/DotProvider/libraryChunks/themes/svg/green/Green_Light_SVG.js +0 -3
  208. package/lib/DotProvider/libraryChunks/themes/svg/green/Green_PureDark_SVG.js +0 -3
  209. package/lib/DotProvider/libraryChunks/themes/svg/orange/Orange_Dark_SVG.js +0 -3
  210. package/lib/DotProvider/libraryChunks/themes/svg/orange/Orange_Light_SVG.js +0 -3
  211. package/lib/DotProvider/libraryChunks/themes/svg/orange/Orange_PureDark_SVG.js +0 -3
  212. package/lib/DotProvider/libraryChunks/themes/svg/red/Red_Dark_SVG.js +0 -3
  213. package/lib/DotProvider/libraryChunks/themes/svg/red/Red_Light_SVG.js +0 -3
  214. package/lib/DotProvider/libraryChunks/themes/svg/red/Red_PureDark_SVG.js +0 -3
  215. package/lib/DotProvider/libraryChunks/themes/svg/yellow/Yellow_Dark_SVG.js +0 -3
  216. package/lib/DotProvider/libraryChunks/themes/svg/yellow/Yellow_Light_SVG.js +0 -3
  217. package/lib/DotProvider/libraryChunks/themes/svg/yellow/Yellow_PureDark_SVG.js +0 -3
  218. package/lib/DotProvider/props/defaultProps.js +0 -20
  219. package/lib/DotProvider/props/propTypes.js +0 -28
  220. package/lib/DotProvider/utils/assetPromiseHandlers/fontSizeAssetPromise.js +0 -12
  221. package/lib/DotProvider/utils/assetPromiseHandlers/themeAppearanceAssetPromise.js +0 -39
  222. package/lib/DotProvider/utils/assetPromiseHandlers/themeColorAssetPromise.js +0 -40
  223. package/lib/DotProvider/utils/assetPromiseHandlers/zoomSizeAssetPromise.js +0 -12
  224. package/lib/DotProvider/utils/constants.js +0 -34
  225. package/lib/DotProvider/utils/errorValidation.js +0 -25
  226. package/lib/DotProvider/utils/getAssetsImportPromises.js +0 -22
  227. package/lib/DotProvider/utils/sizeAssetsConfig.js +0 -31
  228. package/lib/DotProvider/utils/themeAppearanceAssetsConfig.js +0 -69
  229. package/lib/DotProvider/utils/themeColorAssetsConfig.js +0 -249
@@ -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
  }
@@ -399,7 +398,6 @@ var TextEditor = /*#__PURE__*/function (_Component) {
399
398
  var cont = value;
400
399
 
401
400
  if (typeof editor !== 'undefined') {
402
- // eslint-disable-next-line
403
401
  cont = editor['addFormEditor'] && editor['addFormEditor'].getContent();
404
402
  }
405
403
 
@@ -428,13 +426,14 @@ var TextEditor = /*#__PURE__*/function (_Component) {
428
426
  loadingComponent = _this$props9.loadingComponent,
429
427
  isNightMode = _this$props9.isNightMode,
430
428
  isReadOnly = _this$props9.isReadOnly,
431
- dataSelectorId = _this$props9.dataSelectorId;
429
+ dataSelectorId = _this$props9.dataSelectorId,
430
+ isDisabled = _this$props9.isDisabled;
432
431
  var _this$state = this.state,
433
432
  isEditorLoad = _this$state.isEditorLoad,
434
433
  isEditorShow = _this$state.isEditorShow;
435
434
  var editorDoc = ImgLazyLoad && global.editor && global.editor[id] ? global.editor[id].doc : null;
436
435
  return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
437
- 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(isReadOnly || isDisabled ? _TextEditorModule["default"].disable : '', " ").concat(!isEditorShow ? _TextEditorModule["default"].editorHide : ''),
438
437
  dataId: dataId,
439
438
  "data-isEditor": true,
440
439
  dataSelectorId: dataSelectorId
@@ -444,7 +443,7 @@ var TextEditor = /*#__PURE__*/function (_Component) {
444
443
  dataId: dataId
445
444
  }), editorDoc && ImgLazyLoad ? /*#__PURE__*/_react["default"].createElement(ImgLazyLoad, {
446
445
  node: editorDoc
447
- }) : null, isReadOnly ? /*#__PURE__*/_react["default"].createElement("div", {
446
+ }) : null, isReadOnly || isDisabled ? /*#__PURE__*/_react["default"].createElement("div", {
448
447
  className: _TextEditorModule["default"].readOnlyMask
449
448
  }) : null);
450
449
  }
@@ -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;
@@ -15,8 +15,8 @@ exports.isImageFormat = isImageFormat;
15
15
  exports.loadResource = loadResource;
16
16
  exports.triggerKeyup = triggerKeyup;
17
17
  exports.validateEditorContentOnInsertHtml = validateEditorContentOnInsertHtml;
18
- var ATTACHMENT_FILE_NAME_SIZE_LIMIT = 200; // editorUtils
19
18
 
19
+ // editorUtils
20
20
  function editorContentValidate(editorObj) {
21
21
  var content = editorObj && editorObj.getContent && editorObj.getContent() || '';
22
22
 
@@ -67,13 +67,14 @@ function encodeForHtml(str) {
67
67
  } // attachment
68
68
 
69
69
 
70
- function isFileNameSizeInvalid(fileName) {
71
- return fileName.length > ATTACHMENT_FILE_NAME_SIZE_LIMIT;
70
+ function isFileNameSizeInvalid(fileName, fileNameMaxCharacters) {
71
+ return fileName.length > fileNameMaxCharacters;
72
72
  }
73
73
 
74
- function isImageFormat(fileName) {
74
+ function isImageFormat(fileName, allowedFileExtensions) {
75
75
  var extension = getExtensionFromFileName(fileName);
76
- return /jpeg|jpg|png|gif|bmp|ico/i.test(extension);
76
+ var isValidExtension = allowedFileExtensions.includes(extension);
77
+ return isValidExtension;
77
78
  }
78
79
 
79
80
  function getExtensionFromFileName(fileName) {