@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
@@ -25,7 +25,8 @@ export default class TextEditor extends Component {
25
25
  isResourceLoaded: false,
26
26
  isEditorShow: false
27
27
  };
28
- let methods = ['editorCallback', 'handleUpload', 'handleChange', 'focusCallback', 'handleInlineUpload', 'handleDropUpload', 'blurCallback', 'handleGetContent', 'initializeEditor', 'clearEditorData', 'plainTextSwitchCallback', 'onWindowClick', 'toggleEditor'];
28
+ let methods = ['editorCallback', 'handleUpload', 'handleChange', 'focusCallback', 'handleInlineUpload', // 'handleDropUpload',
29
+ 'blurCallback', 'handleGetContent', 'initializeEditor', 'clearEditorData', 'plainTextSwitchCallback', 'onWindowClick', 'toggleEditor'];
29
30
  bind.apply(this, methods);
30
31
  }
31
32
 
@@ -53,12 +54,13 @@ export default class TextEditor extends Component {
53
54
  editorMode = '',
54
55
  editorOptions = {},
55
56
  needEditorFocus = true,
56
- handleDropUpload,
57
+ // handleDropUpload,
57
58
  fontFamily,
58
59
  fontSize,
59
60
  initCallback,
60
61
  handleAlertMessage,
61
- needInlineAttachment
62
+ needInlineAttachment,
63
+ customInitOption
62
64
  } = this.props;
63
65
 
64
66
  if (id && global.ZohoDeskEditor) {
@@ -67,7 +69,7 @@ export default class TextEditor extends Component {
67
69
  content: fixEncoding(value),
68
70
  callback: this.editorCallback,
69
71
  imageuploadcallback: this.handleInlineUpload,
70
- handleInlineDropImage: handleDropUpload ? this.handleDropUpload : undefined,
72
+ // handleInlineDropImage: handleDropUpload ? this.handleDropUpload : undefined,
71
73
  contentChanged: this.handleChange,
72
74
  focusCallback: this.focusCallback,
73
75
  lineHeight: 'Normal',
@@ -90,13 +92,17 @@ export default class TextEditor extends Component {
90
92
  htmlVersion: '<!Doctype html>'
91
93
  };
92
94
 
93
- if (!ZohoDeskEditor_Init.init) {
94
- global.editorInitialize && global.editorInitialize();
95
+ if (!customInitOption) {
96
+ if (!ZohoDeskEditor_Init.init) {
97
+ global.editorInitialize && global.editorInitialize();
98
+ }
99
+
100
+ ZohoDeskEditor_Init.init(editorMode, fontFamily, initCallback, fontSize);
95
101
  }
96
102
 
97
103
  defaultObj = Object.assign(defaultObj, editorOptions);
98
- ZohoDeskEditor_Init.init(editorMode, fontFamily, initCallback, fontSize);
99
- ZohoDeskEditor.create && ZohoDeskEditor.create(defaultObj);
104
+ const globalEditor = global.ZohoDeskEditor;
105
+ globalEditor && typeof globalEditor.create == 'function' && globalEditor.create(defaultObj, customInitOption);
100
106
  }
101
107
  }
102
108
 
@@ -121,7 +127,7 @@ export default class TextEditor extends Component {
121
127
  getRef && getRef(null);
122
128
  }
123
129
 
124
- componentWillReceiveProps(np) {
130
+ UNSAFE_componentWillReceiveProps(np) {
125
131
  let {
126
132
  changeEditorContent
127
133
  } = this.props;
@@ -203,7 +209,8 @@ export default class TextEditor extends Component {
203
209
  let {
204
210
  editorCallback,
205
211
  getRef,
206
- isCustomScroll
212
+ isCustomScroll,
213
+ customCSS
207
214
  } = this.props;
208
215
  this.setState({
209
216
  isEditorLoad: true,
@@ -218,18 +225,6 @@ export default class TextEditor extends Component {
218
225
  global.editor[id] = editorObj;
219
226
  }
220
227
 
221
- const css = 'pre {white-space: pre-wrap}',
222
- head = editorObj.doc.head || editorObj.doc.getElementsByTagName('head')[0],
223
- style = document.createElement('style');
224
- style.type = 'text/css';
225
-
226
- if (style.styleSheet) {
227
- style.styleSheet.cssText = css;
228
- } else {
229
- style.appendChild(editorObj.doc.createTextNode(css));
230
- }
231
-
232
- head.appendChild(style);
233
228
  editorCallback && editorCallback(editorObj);
234
229
  const iframe = selectn('iframe.contentDocument.body', editorObj) || null;
235
230
  const iframeHead = selectn('iframe.contentDocument.head', editorObj) || null;
@@ -245,9 +240,12 @@ export default class TextEditor extends Component {
245
240
  iframe.classList.add('scroll');
246
241
  }
247
242
 
248
- let customFonts = document.createElement('style');
249
- 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')}`;
250
- iframeHead.appendChild(customFonts);
243
+ let customStyleTag = document.createElement('style');
244
+ customStyleTag.type = 'text/css';
245
+ const customizedCSS = `pre {white-space: pre-wrap} ${customCSS}`;
246
+ const 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')}`;
247
+ customStyleTag.textContent = `${customizedCSS} ${fontCSS}`;
248
+ iframeHead.appendChild(customStyleTag);
251
249
  }
252
250
  }
253
251
 
@@ -255,13 +253,26 @@ export default class TextEditor extends Component {
255
253
  let {
256
254
  id,
257
255
  setInlineAttachmentInProgress: progress,
258
- i18nKeys
256
+ i18nKeys,
257
+ inlineImageProps
259
258
  } = this.props;
260
-
261
- if (!isFileNameSizeInvalid(file.name)) {
259
+ const {
260
+ fileUploadError,
261
+ fileNotSupported,
262
+ fileSizeLimitExceed,
263
+ fileEmptyError,
264
+ fileNameLimitExceed
265
+ } = i18nKeys;
266
+ const {
267
+ allowedFileExtensions = ["jpeg", "jpg", "png", "gif", "bmp", "ico"],
268
+ fileNameMaxCharacters = 200,
269
+ fileSizeMaxBytes = 3 * 1024 * 1024
270
+ } = inlineImageProps;
271
+
272
+ if (!isFileNameSizeInvalid(file.name, fileNameMaxCharacters)) {
262
273
  if (file.size != 0) {
263
- if (file.size <= 3 * 1024 * 1024) {
264
- if (isImageFormat(file.name)) {
274
+ if (file.size <= fileSizeMaxBytes) {
275
+ if (isImageFormat(file.name, allowedFileExtensions)) {
265
276
  progress && progress(true);
266
277
  this.handleUpload(file).then(res => {
267
278
  successCallback(res);
@@ -271,37 +282,33 @@ export default class TextEditor extends Component {
271
282
  triggerKeyup(editorObj.doc);
272
283
  }
273
284
  }, () => {
274
- failureCallback(i18nKeys.fileUploadError);
285
+ failureCallback(fileUploadError);
275
286
  });
276
287
  } else {
277
- failureCallback(i18nKeys.fileNotSupported);
288
+ failureCallback(fileNotSupported);
278
289
  }
279
290
  } else {
280
- failureCallback(i18nKeys.fileSizeLimitExceed);
291
+ failureCallback(fileSizeLimitExceed);
281
292
  }
282
293
  } else {
283
- failureCallback(i18nKeys.fileEmptyError);
294
+ failureCallback(fileEmptyError);
284
295
  }
285
296
  } else {
286
- failureCallback(i18nKeys.fileNameLimitExceed);
297
+ failureCallback(fileNameLimitExceed);
287
298
  }
288
- }
299
+ } // handleDropUpload(file, successCallback, failureCallback) {
300
+ // let e = { target: { files: [file] } };
301
+ // let { handleDropUpload } = this.props;
302
+ // handleDropUpload(e).then(
303
+ // (res) => {
304
+ // successCallback(res);
305
+ // },
306
+ // () => {
307
+ // failureCallback();
308
+ // }
309
+ // );
310
+ // }
289
311
 
290
- handleDropUpload(file, successCallback, failureCallback) {
291
- let e = {
292
- target: {
293
- files: [file]
294
- }
295
- };
296
- let {
297
- handleDropUpload
298
- } = this.props;
299
- handleDropUpload(e).then(res => {
300
- successCallback(res);
301
- }, () => {
302
- failureCallback();
303
- });
304
- }
305
312
 
306
313
  blurCallback() {
307
314
  let {
@@ -327,15 +334,7 @@ export default class TextEditor extends Component {
327
334
  formData.append(getCSRFCookieName(), getCSRFCookie());
328
335
  }
329
336
 
330
- return onUpload(formData, file).then(res => {
331
- if (editorMode === 'TicketReply') {
332
- return `${res.data}&from=r`;
333
- }
334
-
335
- return res.data;
336
- }, err => {
337
- throw err;
338
- });
337
+ return onUpload(formData, file);
339
338
  } catch (err) {
340
339
  return Promise.reject();
341
340
  }
@@ -355,7 +354,6 @@ export default class TextEditor extends Component {
355
354
  let cont = value;
356
355
 
357
356
  if (typeof editor !== 'undefined') {
358
- // eslint-disable-next-line
359
357
  cont = editor['addFormEditor'] && editor['addFormEditor'].getContent();
360
358
  }
361
359
 
@@ -384,7 +382,8 @@ export default class TextEditor extends Component {
384
382
  loadingComponent,
385
383
  isNightMode,
386
384
  isReadOnly,
387
- dataSelectorId
385
+ dataSelectorId,
386
+ isDisabled
388
387
  } = this.props;
389
388
  let {
390
389
  isEditorLoad,
@@ -393,7 +392,7 @@ export default class TextEditor extends Component {
393
392
  let editorDoc = ImgLazyLoad && global.editor && global.editor[id] ? global.editor[id].doc : null;
394
393
  return /*#__PURE__*/React.createElement(Container, {
395
394
  className: `${styles.textEditor} ${styles[type]} ${styles[border]}
396
- ${isNightMode ? styles.night : styles.light} ${isReadOnly ? styles.readOnly : ''} ${!isEditorShow ? styles.editorHide : ''}`,
395
+ ${isNightMode ? styles.night : styles.light} ${isReadOnly ? styles.readOnly : ''} ${isReadOnly || isDisabled ? styles.disable : ''} ${!isEditorShow ? styles.editorHide : ''}`,
397
396
  dataId: dataId,
398
397
  "data-isEditor": true,
399
398
  dataSelectorId: dataSelectorId
@@ -403,7 +402,7 @@ export default class TextEditor extends Component {
403
402
  dataId: dataId
404
403
  }), editorDoc && ImgLazyLoad ? /*#__PURE__*/React.createElement(ImgLazyLoad, {
405
404
  node: editorDoc
406
- }) : null, isReadOnly ? /*#__PURE__*/React.createElement("div", {
405
+ }) : null, isReadOnly || isDisabled ? /*#__PURE__*/React.createElement("div", {
407
406
  className: styles.readOnlyMask
408
407
  }) : null);
409
408
  }
@@ -9,5 +9,8 @@ export const defaultProps = {
9
9
  needInlineAttachment: false,
10
10
  isNightMode: false,
11
11
  isReadOnly: false,
12
- dataSelectorId: 'textEditor'
12
+ dataSelectorId: 'textEditor',
13
+ customCSS: '',
14
+ isDisabled: false,
15
+ inlineImageProps: {}
13
16
  };
@@ -12,7 +12,6 @@ export const propTypes = {
12
12
  fontSize: PropTypes.string,
13
13
  getRef: PropTypes.func,
14
14
  handleAlertMessage: PropTypes.func,
15
- handleDropUpload: PropTypes.func,
16
15
  i18nKeys: PropTypes.shape({
17
16
  fileUploadError: PropTypes.string,
18
17
  fileNotSupported: PropTypes.string,
@@ -21,7 +20,7 @@ export const propTypes = {
21
20
  fileSizeLimitExceed: PropTypes.string
22
21
  }),
23
22
  id: PropTypes.string,
24
- initCallback: PropTypes.func.isRequired,
23
+ initCallback: PropTypes.func,
25
24
  isCustomScroll: PropTypes.bool,
26
25
  loadingComponent: PropTypes.node,
27
26
  mode: PropTypes.string,
@@ -42,5 +41,13 @@ export const propTypes = {
42
41
  getCSRFCookie: PropTypes.string,
43
42
  isEditorDefaultOpen: PropTypes.bool,
44
43
  toggleEdit: PropTypes.func,
45
- dataSelectorId: PropTypes.string
44
+ dataSelectorId: PropTypes.string,
45
+ customInitOption: PropTypes.object,
46
+ customCSS: PropTypes.string,
47
+ isDisabled: PropTypes.bool,
48
+ inlineImageProps: PropTypes.shape({
49
+ allowedFileExtensions: PropTypes.array,
50
+ fileNameMaxCharacters: PropTypes.number,
51
+ fileSizeMaxBytes: PropTypes.number
52
+ })
46
53
  };
@@ -1,5 +1,4 @@
1
- const ATTACHMENT_FILE_NAME_SIZE_LIMIT = 200; // editorUtils
2
-
1
+ // editorUtils
3
2
  export function editorContentValidate(editorObj) {
4
3
  let content = editorObj && editorObj.getContent && editorObj.getContent() || '';
5
4
 
@@ -48,12 +47,13 @@ export function encodeForHtml(str) {
48
47
  return str;
49
48
  } // attachment
50
49
 
51
- export function isFileNameSizeInvalid(fileName) {
52
- return fileName.length > ATTACHMENT_FILE_NAME_SIZE_LIMIT;
50
+ export function isFileNameSizeInvalid(fileName, fileNameMaxCharacters) {
51
+ return fileName.length > fileNameMaxCharacters;
53
52
  }
54
- export function isImageFormat(fileName) {
53
+ export function isImageFormat(fileName, allowedFileExtensions) {
55
54
  let extension = getExtensionFromFileName(fileName);
56
- return /jpeg|jpg|png|gif|bmp|ico/i.test(extension);
55
+ const isValidExtension = allowedFileExtensions.includes(extension);
56
+ return isValidExtension;
57
57
  }
58
58
  export function getExtensionFromFileName(fileName) {
59
59
  if (fileName && fileName.indexOf('.') != -1) {
@@ -1,178 +1,178 @@
1
- .varClass {
2
- /* globalnotfication default variables */
3
- --commonalert_border_color: var(--zdt_commonalert_default_border);
4
- --globalnotification_bg_color: var(--zdt_globalnotification_default_bg);
5
- --globalnotification_text_color: var(--zdt_globalnotification_default_text);
6
- }
7
-
8
- .message {
9
- composes: varClass;
10
- position: absolute;
11
- top: 0 ;
12
- z-index: 1000;
13
- width: var(--zd_size420) ;
14
- text-align: center;
15
- margin: auto ;
16
- }
17
-
18
- [dir=ltr] .message {
19
- left: 0 ;
20
- right: 0 ;
21
- }
22
-
23
- [dir=rtl] .message {
24
- right: 0 ;
25
- left: 0 ;
26
- }
27
-
28
- .stackShadowOne::after,
29
- .stackShadowTwo::before {
30
- content: '';
31
- position: absolute;
32
- height: var(--zd_size20) ;
33
- }
34
-
35
- .stackShadowOne::after, .stackShadowTwo::before {
36
- background-color: var(--globalnotification_bg_color);
37
- border-radius: 0 0 6px 6px;
38
- box-shadow: var(--zd_bs_globalnotification_container);
39
- }
40
-
41
- [dir=ltr] .stackShadowOne::after, [dir=ltr] .stackShadowTwo::before {
42
- left: 50% ;
43
- right: 50% ;
44
- transform: translate(-50%);
45
- animation: behindInfo 0.8s forwards;
46
- }
47
-
48
- [dir=rtl] .stackShadowOne::after, [dir=rtl] .stackShadowTwo::before {
49
- right: 50% ;
50
- left: 50% ;
51
- transform: translate(50%);
52
- animation: behindInfo 0.8s forwards;
53
- }
54
-
55
- .stackShadowTwo::before {
56
- width: 90% ;
57
- bottom: calc( var(--zd_size10) * -1 ) ;
58
- }
59
-
60
- .stackShadowOne::after {
61
- width: 95% ;
62
- bottom: calc( var(--zd_size5) * -1 ) ;
63
- }
64
-
65
- @keyframes behindInfo {
66
-
67
- 0%,
68
- 40% {
69
- opacity: 0;
70
- }
71
-
72
- 100% {
73
- opacity: 1;
74
- }
75
- }
76
-
77
- .container {
78
- position: relative;
79
- pointer-events: initial;
80
- color: var(--globalnotification_text_color);
81
- z-index: 1;
82
- composes: wbreak from '~@zohodesk/components/lib/common/common.module.css';
83
- width: 100% ;
84
- box-shadow: var(--zd_bs_globalnotification_container);
85
- border-radius: 0 0 var(--zd_size10) var(--zd_size10);
86
- background-color: var(--globalnotification_bg_color);
87
- border-style: solid;
88
- border-color: var(--commonalert_border_color);
89
- border-width: 2px 1px 1px 1px;
90
- }
91
-
92
- [dir=ltr] .container {
93
- padding: var(--zd_size18) var(--zd_size70) var(--zd_size19) var(--zd_size75) ;
94
- }
95
-
96
- [dir=rtl] .container {
97
- padding: var(--zd_size18) var(--zd_size75) var(--zd_size19) var(--zd_size70) ;
98
- }
99
-
100
- .icon {
101
- width: var(--zd_size44) ;
102
- height: var(--zd_size44) ;
103
- position: absolute;
104
- top: 0 ;
105
- bottom: 0 ;
106
- margin: auto 0 ;
107
- }
108
-
109
- [dir=ltr] .icon {
110
- left: var(--zd_size18) ;
111
- }
112
-
113
- [dir=rtl] .icon {
114
- right: var(--zd_size18) ;
115
- }
116
-
117
- .success {
118
- --commonalert_border_color: var(--zdt_commonalert_success_border);
119
- --globalnotification_bg_color: var(--zdt_globalnotification_success_bg);
120
- --globalnotification_text_color: var(--zdt_globalnotification_success_text);
121
- }
122
-
123
- .info {
124
- --commonalert_border_color: var(--zdt_commonalert_info_border);
125
- --globalnotification_bg_color: var(--zdt_globalnotification_info_bg);
126
- --globalnotification_text_color: var(--zdt_globalnotification_info_text);
127
- }
128
-
129
- .danger {
130
- --commonalert_border_color: var(--zdt_commonalert_danger_border);
131
- --globalnotification_bg_color: var(--zdt_globalnotification_danger_bg);
132
- --globalnotification_text_color: var(--zdt_globalnotification_danger_text);
133
- }
134
-
135
- .error {
136
- --commonalert_border_color: var(--zdt_commonalert_error_border);
137
- --globalnotification_bg_color: var(--zdt_globalnotification_error_bg);
138
- --globalnotification_text_color: var(--zdt_globalnotification_error_text);
139
- }
140
-
141
- .warning {
142
- --commonalert_border_color: var(--zdt_commonalert_warning_border);
143
- --globalnotification_bg_color: var(--zdt_globalnotification_warning_bg);
144
- --globalnotification_text_color: var(--zdt_globalnotification_warning_text);
145
- }
146
-
147
- .text {
148
- font-size: var(--zd_font_size14) ;
149
- font-family: var(--zd_semibold);
150
- composes: ftsmooth from '~@zohodesk/components/lib/common/common.module.css';
151
- line-height: 1.4286;
152
- overflow: hidden;
153
- }
154
-
155
- [dir=ltr] .text {
156
- text-align: left;
157
- }
158
-
159
- [dir=rtl] .text {
160
- text-align: right;
161
- }
162
-
163
- .close {
164
- position: absolute;
165
- top: 0 ;
166
- bottom: 0 ;
167
- height: var(--zd_size25) ;
168
- }
169
-
170
- [dir=ltr] .close {
171
- right: var(--zd_size12) ;
172
- margin: auto 0 auto var(--zd_size25) ;
173
- }
174
-
175
- [dir=rtl] .close {
176
- left: var(--zd_size12) ;
177
- margin: auto var(--zd_size25) auto 0 ;
1
+ .varClass {
2
+ /* globalnotfication default variables */
3
+ --commonalert_border_color: var(--zdt_commonalert_default_border);
4
+ --globalnotification_bg_color: var(--zdt_globalnotification_default_bg);
5
+ --globalnotification_text_color: var(--zdt_globalnotification_default_text);
6
+ }
7
+
8
+ .message {
9
+ composes: varClass;
10
+ position: absolute;
11
+ top: 0 ;
12
+ z-index: 1000;
13
+ width: var(--zd_size420) ;
14
+ text-align: center;
15
+ margin: auto ;
16
+ }
17
+
18
+ [dir=ltr] .message {
19
+ left: 0 ;
20
+ right: 0 ;
21
+ }
22
+
23
+ [dir=rtl] .message {
24
+ right: 0 ;
25
+ left: 0 ;
26
+ }
27
+
28
+ .stackShadowOne::after,
29
+ .stackShadowTwo::before {
30
+ content: '';
31
+ position: absolute;
32
+ height: var(--zd_size20) ;
33
+ }
34
+
35
+ .stackShadowOne::after, .stackShadowTwo::before {
36
+ background-color: var(--globalnotification_bg_color);
37
+ border-radius: 0 0 6px 6px;
38
+ box-shadow: var(--zd_bs_globalnotification_container);
39
+ }
40
+
41
+ [dir=ltr] .stackShadowOne::after, [dir=ltr] .stackShadowTwo::before {
42
+ left: 50% ;
43
+ right: 50% ;
44
+ transform: translate(-50%);
45
+ animation: behindInfo 0.8s forwards;
46
+ }
47
+
48
+ [dir=rtl] .stackShadowOne::after, [dir=rtl] .stackShadowTwo::before {
49
+ right: 50% ;
50
+ left: 50% ;
51
+ transform: translate(50%);
52
+ animation: behindInfo 0.8s forwards;
53
+ }
54
+
55
+ .stackShadowTwo::before {
56
+ width: 90% ;
57
+ bottom: calc( var(--zd_size10) * -1 ) ;
58
+ }
59
+
60
+ .stackShadowOne::after {
61
+ width: 95% ;
62
+ bottom: calc( var(--zd_size5) * -1 ) ;
63
+ }
64
+
65
+ @keyframes behindInfo {
66
+
67
+ 0%,
68
+ 40% {
69
+ opacity: 0;
70
+ }
71
+
72
+ 100% {
73
+ opacity: 1;
74
+ }
75
+ }
76
+
77
+ .container {
78
+ position: relative;
79
+ pointer-events: initial;
80
+ color: var(--globalnotification_text_color);
81
+ z-index: 1;
82
+ composes: wbreak from '~@zohodesk/components/lib/common/common.module.css';
83
+ width: 100% ;
84
+ box-shadow: var(--zd_bs_globalnotification_container);
85
+ border-radius: 0 0 var(--zd_size10) var(--zd_size10);
86
+ background-color: var(--globalnotification_bg_color);
87
+ border-style: solid;
88
+ border-color: var(--commonalert_border_color);
89
+ border-width: 2px 1px 1px 1px;
90
+ }
91
+
92
+ [dir=ltr] .container {
93
+ padding: var(--zd_size18) var(--zd_size70) var(--zd_size19) var(--zd_size75) ;
94
+ }
95
+
96
+ [dir=rtl] .container {
97
+ padding: var(--zd_size18) var(--zd_size75) var(--zd_size19) var(--zd_size70) ;
98
+ }
99
+
100
+ .icon {
101
+ width: var(--zd_size44) ;
102
+ height: var(--zd_size44) ;
103
+ position: absolute;
104
+ top: 0 ;
105
+ bottom: 0 ;
106
+ margin: auto 0 ;
107
+ }
108
+
109
+ [dir=ltr] .icon {
110
+ left: var(--zd_size18) ;
111
+ }
112
+
113
+ [dir=rtl] .icon {
114
+ right: var(--zd_size18) ;
115
+ }
116
+
117
+ .success {
118
+ --commonalert_border_color: var(--zdt_commonalert_success_border);
119
+ --globalnotification_bg_color: var(--zdt_globalnotification_success_bg);
120
+ --globalnotification_text_color: var(--zdt_globalnotification_success_text);
121
+ }
122
+
123
+ .info {
124
+ --commonalert_border_color: var(--zdt_commonalert_info_border);
125
+ --globalnotification_bg_color: var(--zdt_globalnotification_info_bg);
126
+ --globalnotification_text_color: var(--zdt_globalnotification_info_text);
127
+ }
128
+
129
+ .danger {
130
+ --commonalert_border_color: var(--zdt_commonalert_danger_border);
131
+ --globalnotification_bg_color: var(--zdt_globalnotification_danger_bg);
132
+ --globalnotification_text_color: var(--zdt_globalnotification_danger_text);
133
+ }
134
+
135
+ .error {
136
+ --commonalert_border_color: var(--zdt_commonalert_error_border);
137
+ --globalnotification_bg_color: var(--zdt_globalnotification_error_bg);
138
+ --globalnotification_text_color: var(--zdt_globalnotification_error_text);
139
+ }
140
+
141
+ .warning {
142
+ --commonalert_border_color: var(--zdt_commonalert_warning_border);
143
+ --globalnotification_bg_color: var(--zdt_globalnotification_warning_bg);
144
+ --globalnotification_text_color: var(--zdt_globalnotification_warning_text);
145
+ }
146
+
147
+ .text {
148
+ font-size: var(--zd_font_size14) ;
149
+ font-family: var(--zd_semibold);
150
+ composes: ftsmooth from '~@zohodesk/components/lib/common/common.module.css';
151
+ line-height: 1.4286;
152
+ overflow: hidden;
153
+ }
154
+
155
+ [dir=ltr] .text {
156
+ text-align: left;
157
+ }
158
+
159
+ [dir=rtl] .text {
160
+ text-align: right;
161
+ }
162
+
163
+ .close {
164
+ position: absolute;
165
+ top: 0 ;
166
+ bottom: 0 ;
167
+ height: var(--zd_size25) ;
168
+ }
169
+
170
+ [dir=ltr] .close {
171
+ right: var(--zd_size12) ;
172
+ margin: auto 0 auto var(--zd_size25) ;
173
+ }
174
+
175
+ [dir=rtl] .close {
176
+ left: var(--zd_size12) ;
177
+ margin: auto var(--zd_size25) auto 0 ;
178
178
  }