argous 1.2.132 → 1.2.136

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 (554) hide show
  1. package/dist/api/index.d.ts +1 -0
  2. package/dist/api/index.js +18 -1
  3. package/dist/components/AutoCompleteFavorites/AutoCompleteFavorites.d.ts +21 -0
  4. package/dist/components/AutoCompleteFavorites/AutoCompleteFavorites.js +331 -0
  5. package/dist/components/Compartilhar/Compartilhar.js +1 -1
  6. package/lib/actions/index.ts +57 -0
  7. package/lib/api/WebSocket.js +148 -0
  8. package/lib/api/index.js +402 -0
  9. package/lib/api/ws.js +27 -0
  10. package/lib/components/Alert/Alert.d.ts +8 -0
  11. package/lib/components/Alert/Alert.js +49 -0
  12. package/lib/components/Alert/index.d.ts +2 -0
  13. package/lib/components/Alert/index.js +1 -0
  14. package/lib/components/ArgousAction/ArgousAction.d.ts +8 -0
  15. package/lib/components/ArgousAction/ArgousAction.js +78 -0
  16. package/lib/components/ArgousAction/index.d.ts +2 -0
  17. package/lib/components/ArgousAction/index.js +1 -0
  18. package/lib/components/ArgousAvatar/ArgousAvatar.d.ts +14 -0
  19. package/lib/components/ArgousAvatar/ArgousAvatar.js +79 -0
  20. package/lib/components/ArgousAvatar/index.d.ts +2 -0
  21. package/lib/components/ArgousAvatar/index.js +1 -0
  22. package/lib/components/ArgousComplexPagination/ArgousComplexPagination.d.ts +76 -0
  23. package/lib/components/ArgousComplexPagination/ArgousComplexPagination.js +182 -0
  24. package/lib/components/ArgousComplexPagination/index.d.ts +2 -0
  25. package/lib/components/ArgousComplexPagination/index.js +1 -0
  26. package/lib/components/ArgousComplexTable/ArgousComplexTable.d.ts +131 -0
  27. package/lib/components/ArgousComplexTable/ArgousComplexTable.js +360 -0
  28. package/lib/components/ArgousComplexTable/index.d.ts +2 -0
  29. package/lib/components/ArgousComplexTable/index.js +1 -0
  30. package/lib/components/ArgousComplexTableBody/ArgousComplexTableBody.d.ts +177 -0
  31. package/lib/components/ArgousComplexTableBody/ArgousComplexTableBody.js +162 -0
  32. package/lib/components/ArgousComplexTableBody/index.d.ts +2 -0
  33. package/lib/components/ArgousComplexTableBody/index.js +1 -0
  34. package/lib/components/ArgousComplexTableHead/ArgousComplexTableHead.d.ts +73 -0
  35. package/lib/components/ArgousComplexTableHead/ArgousComplexTableHead.js +98 -0
  36. package/lib/components/ArgousComplexTableHead/index.d.ts +2 -0
  37. package/lib/components/ArgousComplexTableHead/index.js +1 -0
  38. package/lib/components/ArgousComplexTableToolbar/ArgousComplexTableToolBar.d.ts +58 -0
  39. package/lib/components/ArgousComplexTableToolbar/ArgousComplexTableToolBar.js +66 -0
  40. package/lib/components/ArgousComplexTableToolbar/index.d.ts +2 -0
  41. package/lib/components/ArgousComplexTableToolbar/index.js +1 -0
  42. package/lib/components/ArgousInput/ArgousInput.d.ts +8 -0
  43. package/lib/components/ArgousInput/ArgousInput.js +616 -0
  44. package/lib/components/ArgousInput/index.d.ts +2 -0
  45. package/lib/components/ArgousInput/index.js +1 -0
  46. package/lib/components/ArgousPagination/ArgousPagination.d.ts +8 -0
  47. package/lib/components/ArgousPagination/ArgousPagination.js +43 -0
  48. package/lib/components/ArgousPagination/index.d.ts +2 -0
  49. package/lib/components/ArgousPagination/index.js +1 -0
  50. package/lib/components/ArgousProgressBar/ArgousProgressBar.d.ts +22 -0
  51. package/lib/components/ArgousProgressBar/ArgousProgressBar.js +167 -0
  52. package/lib/components/ArgousProgressBar/index.d.ts +2 -0
  53. package/lib/components/ArgousProgressBar/index.js +1 -0
  54. package/lib/components/ArgousSimpleTable/ArgousSimpleTable.d.ts +8 -0
  55. package/lib/components/ArgousSimpleTable/ArgousSimpleTable.js +241 -0
  56. package/lib/components/ArgousSimpleTable/index.d.ts +2 -0
  57. package/lib/components/ArgousSimpleTable/index.js +1 -0
  58. package/lib/components/AutoComplete/AutoComplete.d.ts +8 -0
  59. package/lib/components/AutoComplete/AutoComplete.js +189 -0
  60. package/lib/components/AutoComplete/index.d.ts +2 -0
  61. package/lib/components/AutoComplete/index.js +1 -0
  62. package/lib/components/AutoCompleteFavorites/AutoCompleteFavorites.js +298 -0
  63. package/lib/components/BarChart/BarChart.d.ts +8 -0
  64. package/lib/components/BarChart/BarChart.js +92 -0
  65. package/lib/components/BarChart/index.d.ts +2 -0
  66. package/lib/components/BarChart/index.js +1 -0
  67. package/lib/components/BarraFerramentas/BarraFerramentas.d.ts +21 -0
  68. package/lib/components/BarraFerramentas/BarraFerramentas.js +277 -0
  69. package/lib/components/BarraFerramentas/index.d.ts +2 -0
  70. package/lib/components/BarraFerramentas/index.js +1 -0
  71. package/lib/components/Button/Button.d.ts +8 -0
  72. package/lib/components/Button/Button.js +135 -0
  73. package/lib/components/Button/index.d.ts +2 -0
  74. package/lib/components/Button/index.js +1 -0
  75. package/lib/components/Cabecalho/Cabecalho.d.ts +8 -0
  76. package/lib/components/Cabecalho/Cabecalho.js +245 -0
  77. package/lib/components/Cabecalho/index.d.ts +2 -0
  78. package/lib/components/Cabecalho/index.js +1 -0
  79. package/lib/components/Calendar/Calendar.d.ts +8 -0
  80. package/lib/components/Calendar/Calendar.js +156 -0
  81. package/lib/components/Calendar/index.d.ts +2 -0
  82. package/lib/components/Calendar/index.js +1 -0
  83. package/lib/components/CartaoUsuario/CartaoUsuario.d.ts +9 -0
  84. package/lib/components/CartaoUsuario/CartaoUsuario.js +108 -0
  85. package/lib/components/CartaoUsuario/index.d.ts +2 -0
  86. package/lib/components/CartaoUsuario/index.js +1 -0
  87. package/lib/components/Collapse/Collapse.d.ts +60 -0
  88. package/lib/components/Collapse/Collapse.js +317 -0
  89. package/lib/components/Collapse/index.d.ts +3 -0
  90. package/lib/components/Collapse/index.js +1 -0
  91. package/lib/components/Compartilhar/Compartilhar.d.ts +7 -0
  92. package/lib/components/Compartilhar/Compartilhar.js +314 -0
  93. package/lib/components/Compartilhar/index.d.ts +2 -0
  94. package/lib/components/Compartilhar/index.js +1 -0
  95. package/lib/components/ConfirmModal/BasicModal.tsx +63 -0
  96. package/lib/components/ConfirmModal/ModalProvider.tsx +81 -0
  97. package/lib/components/ConfirmModal/WrapperModal.tsx +33 -0
  98. package/lib/components/ConfirmModal/index.d.ts +20 -0
  99. package/lib/components/ConfirmModal/index.js +8 -0
  100. package/lib/components/DropArea/DropArea.d.ts +21 -0
  101. package/lib/components/DropArea/DropArea.js +90 -0
  102. package/lib/components/DropArea/Html5FileSelector.js +164 -0
  103. package/lib/components/DropArea/index.d.ts +2 -0
  104. package/lib/components/DropArea/index.js +1 -0
  105. package/lib/components/Editor/Events.ts +83 -0
  106. package/lib/components/Editor/ScriptLoader.ts +96 -0
  107. package/lib/components/Editor/TinyMCE.ts +19 -0
  108. package/lib/components/Editor/Utils.ts +95 -0
  109. package/lib/components/Editor/components/Editor.tsx +375 -0
  110. package/lib/components/Editor/components/EditorPropTypes.ts +106 -0
  111. package/lib/components/Editor/index.tsx +11 -0
  112. package/lib/components/Editor/skins/content/dark/content.css +72 -0
  113. package/lib/components/Editor/skins/content/dark/content.min.css +8 -0
  114. package/lib/components/Editor/skins/content/dark/content.min.css.map +1 -0
  115. package/lib/components/Editor/skins/content/default/content.css +67 -0
  116. package/lib/components/Editor/skins/content/default/content.min.css +8 -0
  117. package/lib/components/Editor/skins/content/default/content.min.css.map +1 -0
  118. package/lib/components/Editor/skins/content/document/content.css +72 -0
  119. package/lib/components/Editor/skins/content/document/content.min.css +8 -0
  120. package/lib/components/Editor/skins/content/document/content.min.css.map +1 -0
  121. package/lib/components/Editor/skins/content/writer/content.css +68 -0
  122. package/lib/components/Editor/skins/content/writer/content.min.css +8 -0
  123. package/lib/components/Editor/skins/content/writer/content.min.css.map +1 -0
  124. package/lib/components/Editor/skins/ui/dark/content.css +714 -0
  125. package/lib/components/Editor/skins/ui/dark/content.inline.css +726 -0
  126. package/lib/components/Editor/skins/ui/dark/content.inline.min.css +8 -0
  127. package/lib/components/Editor/skins/ui/dark/content.inline.min.css.map +1 -0
  128. package/lib/components/Editor/skins/ui/dark/content.min.css +8 -0
  129. package/lib/components/Editor/skins/ui/dark/content.min.css.map +1 -0
  130. package/lib/components/Editor/skins/ui/dark/content.mobile.css +29 -0
  131. package/lib/components/Editor/skins/ui/dark/content.mobile.min.css +8 -0
  132. package/lib/components/Editor/skins/ui/dark/content.mobile.min.css.map +1 -0
  133. package/lib/components/Editor/skins/ui/dark/fonts/tinymce-mobile.woff +0 -0
  134. package/lib/components/Editor/skins/ui/dark/skin.css +3034 -0
  135. package/lib/components/Editor/skins/ui/dark/skin.min.css +8 -0
  136. package/lib/components/Editor/skins/ui/dark/skin.min.css.map +1 -0
  137. package/lib/components/Editor/skins/ui/dark/skin.mobile.css +673 -0
  138. package/lib/components/Editor/skins/ui/dark/skin.mobile.min.css +8 -0
  139. package/lib/components/Editor/skins/ui/dark/skin.mobile.min.css.map +1 -0
  140. package/lib/components/Editor/skins/ui/dark/skin.shadowdom.css +37 -0
  141. package/lib/components/Editor/skins/ui/dark/skin.shadowdom.min.css +8 -0
  142. package/lib/components/Editor/skins/ui/dark/skin.shadowdom.min.css.map +1 -0
  143. package/lib/components/Editor/skins/ui/default/content.css +732 -0
  144. package/lib/components/Editor/skins/ui/default/content.inline.css +726 -0
  145. package/lib/components/Editor/skins/ui/default/content.inline.min.css +8 -0
  146. package/lib/components/Editor/skins/ui/default/content.inline.min.css.map +1 -0
  147. package/lib/components/Editor/skins/ui/default/content.min.css +8 -0
  148. package/lib/components/Editor/skins/ui/default/content.min.css.map +1 -0
  149. package/lib/components/Editor/skins/ui/default/content.mobile.css +29 -0
  150. package/lib/components/Editor/skins/ui/default/content.mobile.min.css +8 -0
  151. package/lib/components/Editor/skins/ui/default/content.mobile.min.css.map +1 -0
  152. package/lib/components/Editor/skins/ui/default/fonts/tinymce-mobile.woff +0 -0
  153. package/lib/components/Editor/skins/ui/default/skin.css +3034 -0
  154. package/lib/components/Editor/skins/ui/default/skin.min.css +8 -0
  155. package/lib/components/Editor/skins/ui/default/skin.min.css.map +1 -0
  156. package/lib/components/Editor/skins/ui/default/skin.mobile.css +673 -0
  157. package/lib/components/Editor/skins/ui/default/skin.mobile.min.css +8 -0
  158. package/lib/components/Editor/skins/ui/default/skin.mobile.min.css.map +1 -0
  159. package/lib/components/Editor/skins/ui/default/skin.shadowdom.css +37 -0
  160. package/lib/components/Editor/skins/ui/default/skin.shadowdom.min.css +8 -0
  161. package/lib/components/Editor/skins/ui/default/skin.shadowdom.min.css.map +1 -0
  162. package/lib/components/Editor/skins/ui/plugin-tinycomments-tinymce4/fonts/tinymce-mobile.woff +0 -0
  163. package/lib/components/Editor/skins/ui/plugin-tinycomments-tinymce4/plugin-tinycomments-tinymce4.css +1641 -0
  164. package/lib/components/Editor/skins/ui/plugin-tinycomments-tinymce4/plugin-tinycomments-tinymce4.min.css +8 -0
  165. package/lib/components/Editor/skins/ui/plugin-tinycomments-tinymce4/plugin-tinycomments-tinymce4.min.css.map +1 -0
  166. package/lib/components/Editor/tinymce/README.md +63 -0
  167. package/lib/components/Editor/tinymce/icons/default/icons.js +172 -0
  168. package/lib/components/Editor/tinymce/icons/default/icons.min.js +1 -0
  169. package/lib/components/Editor/tinymce/jquery.tinymce.min.js +92 -0
  170. package/lib/components/Editor/tinymce/langs/README.md +3 -0
  171. package/lib/components/Editor/tinymce/langs/pt_BR.js +419 -0
  172. package/lib/components/Editor/tinymce/license.txt +504 -0
  173. package/lib/components/Editor/tinymce/plugins/advlist/plugin.js +280 -0
  174. package/lib/components/Editor/tinymce/plugins/advlist/plugin.min.js +9 -0
  175. package/lib/components/Editor/tinymce/plugins/anchor/plugin.js +216 -0
  176. package/lib/components/Editor/tinymce/plugins/anchor/plugin.min.js +9 -0
  177. package/lib/components/Editor/tinymce/plugins/autolink/plugin.js +185 -0
  178. package/lib/components/Editor/tinymce/plugins/autolink/plugin.min.js +9 -0
  179. package/lib/components/Editor/tinymce/plugins/autoresize/plugin.js +171 -0
  180. package/lib/components/Editor/tinymce/plugins/autoresize/plugin.min.js +9 -0
  181. package/lib/components/Editor/tinymce/plugins/autosave/plugin.js +212 -0
  182. package/lib/components/Editor/tinymce/plugins/autosave/plugin.min.js +9 -0
  183. package/lib/components/Editor/tinymce/plugins/bbcode/plugin.js +99 -0
  184. package/lib/components/Editor/tinymce/plugins/bbcode/plugin.min.js +9 -0
  185. package/lib/components/Editor/tinymce/plugins/charmap/plugin.js +1706 -0
  186. package/lib/components/Editor/tinymce/plugins/charmap/plugin.min.js +9 -0
  187. package/lib/components/Editor/tinymce/plugins/code/plugin.js +92 -0
  188. package/lib/components/Editor/tinymce/plugins/code/plugin.min.js +9 -0
  189. package/lib/components/Editor/tinymce/plugins/codesample/plugin.js +2332 -0
  190. package/lib/components/Editor/tinymce/plugins/codesample/plugin.min.js +9 -0
  191. package/{dist/components/Editor/tinymce/plugins/textcolor → lib/components/Editor/tinymce/plugins/colorpicker}/plugin.js +8 -5
  192. package/lib/components/Editor/tinymce/plugins/colorpicker/plugin.min.js +9 -0
  193. package/{dist/components/Editor/tinymce/plugins/colorpicker → lib/components/Editor/tinymce/plugins/contextmenu}/plugin.js +8 -5
  194. package/lib/components/Editor/tinymce/plugins/contextmenu/plugin.min.js +9 -0
  195. package/lib/components/Editor/tinymce/plugins/directionality/plugin.js +320 -0
  196. package/lib/components/Editor/tinymce/plugins/directionality/plugin.min.js +9 -0
  197. package/lib/components/Editor/tinymce/plugins/emoticons/js/emojiimages.js +9424 -0
  198. package/lib/components/Editor/tinymce/plugins/emoticons/js/emojiimages.min.js +3 -0
  199. package/lib/components/Editor/tinymce/plugins/emoticons/js/emojis.js +9423 -0
  200. package/lib/components/Editor/tinymce/plugins/emoticons/js/emojis.min.js +2 -0
  201. package/lib/components/Editor/tinymce/plugins/emoticons/plugin.js +605 -0
  202. package/lib/components/Editor/tinymce/plugins/emoticons/plugin.min.js +9 -0
  203. package/lib/components/Editor/tinymce/plugins/fullpage/plugin.js +544 -0
  204. package/lib/components/Editor/tinymce/plugins/fullpage/plugin.min.js +9 -0
  205. package/lib/components/Editor/tinymce/plugins/fullscreen/plugin.js +979 -0
  206. package/lib/components/Editor/tinymce/plugins/fullscreen/plugin.min.js +9 -0
  207. package/lib/components/Editor/tinymce/plugins/help/plugin.js +873 -0
  208. package/lib/components/Editor/tinymce/plugins/help/plugin.min.js +9 -0
  209. package/lib/components/Editor/tinymce/plugins/hr/plugin.js +46 -0
  210. package/lib/components/Editor/tinymce/plugins/hr/plugin.min.js +9 -0
  211. package/lib/components/Editor/tinymce/plugins/image/plugin.js +1661 -0
  212. package/lib/components/Editor/tinymce/plugins/image/plugin.min.js +9 -0
  213. package/lib/components/Editor/tinymce/plugins/imagetools/plugin.js +1354 -0
  214. package/lib/components/Editor/tinymce/plugins/imagetools/plugin.min.js +9 -0
  215. package/lib/components/Editor/tinymce/plugins/importcss/plugin.js +343 -0
  216. package/lib/components/Editor/tinymce/plugins/importcss/plugin.min.js +9 -0
  217. package/lib/components/Editor/tinymce/plugins/insertdatetime/plugin.js +177 -0
  218. package/lib/components/Editor/tinymce/plugins/insertdatetime/plugin.min.js +9 -0
  219. package/lib/components/Editor/tinymce/plugins/legacyoutput/plugin.js +199 -0
  220. package/lib/components/Editor/tinymce/plugins/legacyoutput/plugin.min.js +9 -0
  221. package/lib/components/Editor/tinymce/plugins/link/plugin.js +1287 -0
  222. package/lib/components/Editor/tinymce/plugins/link/plugin.min.js +9 -0
  223. package/lib/components/Editor/tinymce/plugins/lists/plugin.js +2286 -0
  224. package/lib/components/Editor/tinymce/plugins/lists/plugin.min.js +9 -0
  225. package/lib/components/Editor/tinymce/plugins/media/plugin.js +1382 -0
  226. package/lib/components/Editor/tinymce/plugins/media/plugin.min.js +9 -0
  227. package/lib/components/Editor/tinymce/plugins/nonbreaking/plugin.js +101 -0
  228. package/lib/components/Editor/tinymce/plugins/nonbreaking/plugin.min.js +9 -0
  229. package/lib/components/Editor/tinymce/plugins/noneditable/plugin.js +117 -0
  230. package/lib/components/Editor/tinymce/plugins/noneditable/plugin.min.js +9 -0
  231. package/lib/components/Editor/tinymce/plugins/pagebreak/plugin.js +105 -0
  232. package/lib/components/Editor/tinymce/plugins/pagebreak/plugin.min.js +9 -0
  233. package/lib/components/Editor/tinymce/plugins/paste/plugin.js +1764 -0
  234. package/lib/components/Editor/tinymce/plugins/paste/plugin.min.js +9 -0
  235. package/lib/components/Editor/tinymce/plugins/preview/plugin.js +127 -0
  236. package/lib/components/Editor/tinymce/plugins/preview/plugin.min.js +9 -0
  237. package/lib/components/Editor/tinymce/plugins/print/plugin.js +53 -0
  238. package/lib/components/Editor/tinymce/plugins/print/plugin.min.js +9 -0
  239. package/lib/components/Editor/tinymce/plugins/quickbars/plugin.js +489 -0
  240. package/lib/components/Editor/tinymce/plugins/quickbars/plugin.min.js +9 -0
  241. package/lib/components/Editor/tinymce/plugins/save/plugin.js +119 -0
  242. package/lib/components/Editor/tinymce/plugins/save/plugin.min.js +9 -0
  243. package/lib/components/Editor/tinymce/plugins/searchreplace/plugin.js +1163 -0
  244. package/lib/components/Editor/tinymce/plugins/searchreplace/plugin.min.js +9 -0
  245. package/lib/components/Editor/tinymce/plugins/spellchecker/plugin.js +731 -0
  246. package/lib/components/Editor/tinymce/plugins/spellchecker/plugin.min.js +9 -0
  247. package/lib/components/Editor/tinymce/plugins/tabfocus/plugin.js +129 -0
  248. package/lib/components/Editor/tinymce/plugins/tabfocus/plugin.min.js +9 -0
  249. package/lib/components/Editor/tinymce/plugins/table/plugin.js +10938 -0
  250. package/lib/components/Editor/tinymce/plugins/table/plugin.min.js +9 -0
  251. package/lib/components/Editor/tinymce/plugins/template/plugin.js +577 -0
  252. package/lib/components/Editor/tinymce/plugins/template/plugin.min.js +9 -0
  253. package/{dist/components/Editor/tinymce/plugins/contextmenu → lib/components/Editor/tinymce/plugins/textcolor}/plugin.js +8 -5
  254. package/lib/components/Editor/tinymce/plugins/textcolor/plugin.min.js +9 -0
  255. package/lib/components/Editor/tinymce/plugins/textpattern/plugin.js +1394 -0
  256. package/lib/components/Editor/tinymce/plugins/textpattern/plugin.min.js +9 -0
  257. package/lib/components/Editor/tinymce/plugins/toc/plugin.js +236 -0
  258. package/lib/components/Editor/tinymce/plugins/toc/plugin.min.js +9 -0
  259. package/lib/components/Editor/tinymce/plugins/visualblocks/plugin.js +104 -0
  260. package/lib/components/Editor/tinymce/plugins/visualblocks/plugin.min.js +9 -0
  261. package/lib/components/Editor/tinymce/plugins/visualchars/plugin.js +541 -0
  262. package/lib/components/Editor/tinymce/plugins/visualchars/plugin.min.js +9 -0
  263. package/lib/components/Editor/tinymce/plugins/wordcount/plugin.js +416 -0
  264. package/lib/components/Editor/tinymce/plugins/wordcount/plugin.min.js +9 -0
  265. package/lib/components/Editor/tinymce/skins/content/dark/content.css +72 -0
  266. package/lib/components/Editor/tinymce/skins/content/dark/content.min.css +8 -0
  267. package/lib/components/Editor/tinymce/skins/content/dark/content.min.css.map +1 -0
  268. package/lib/components/Editor/tinymce/skins/content/default/content.css +67 -0
  269. package/lib/components/Editor/tinymce/skins/content/default/content.min.css +8 -0
  270. package/lib/components/Editor/tinymce/skins/content/default/content.min.css.map +1 -0
  271. package/lib/components/Editor/tinymce/skins/content/document/content.css +72 -0
  272. package/lib/components/Editor/tinymce/skins/content/document/content.min.css +8 -0
  273. package/lib/components/Editor/tinymce/skins/content/document/content.min.css.map +1 -0
  274. package/lib/components/Editor/tinymce/skins/content/writer/content.css +68 -0
  275. package/lib/components/Editor/tinymce/skins/content/writer/content.min.css +8 -0
  276. package/lib/components/Editor/tinymce/skins/content/writer/content.min.css.map +1 -0
  277. package/lib/components/Editor/tinymce/skins/ui/oxide/content.css +732 -0
  278. package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.css +726 -0
  279. package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.min.css +8 -0
  280. package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.min.css.map +1 -0
  281. package/lib/components/Editor/tinymce/skins/ui/oxide/content.min.css +8 -0
  282. package/lib/components/Editor/tinymce/skins/ui/oxide/content.min.css.map +1 -0
  283. package/lib/components/Editor/tinymce/skins/ui/oxide/content.mobile.css +29 -0
  284. package/lib/components/Editor/tinymce/skins/ui/oxide/content.mobile.min.css +8 -0
  285. package/lib/components/Editor/tinymce/skins/ui/oxide/content.mobile.min.css.map +1 -0
  286. package/lib/components/Editor/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
  287. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.css +3034 -0
  288. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.min.css +8 -0
  289. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.min.css.map +1 -0
  290. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.mobile.css +673 -0
  291. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.mobile.min.css +8 -0
  292. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.mobile.min.css.map +1 -0
  293. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.css +37 -0
  294. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.min.css +8 -0
  295. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.min.css.map +1 -0
  296. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.css +714 -0
  297. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.css +726 -0
  298. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.min.css +8 -0
  299. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.min.css.map +1 -0
  300. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.min.css +8 -0
  301. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.min.css.map +1 -0
  302. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.mobile.css +29 -0
  303. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.mobile.min.css +8 -0
  304. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.mobile.min.css.map +1 -0
  305. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
  306. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.css +3034 -0
  307. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.min.css +8 -0
  308. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.min.css.map +1 -0
  309. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.mobile.css +673 -0
  310. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +8 -0
  311. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.mobile.min.css.map +1 -0
  312. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +37 -0
  313. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +8 -0
  314. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css.map +1 -0
  315. package/lib/components/Editor/tinymce/themes/mobile/theme.js +13587 -0
  316. package/lib/components/Editor/tinymce/themes/mobile/theme.min.js +9 -0
  317. package/lib/components/Editor/tinymce/themes/silver/theme.js +32480 -0
  318. package/lib/components/Editor/tinymce/themes/silver/theme.min.js +9 -0
  319. package/lib/components/Editor/tinymce/tinymce.d.ts +2963 -0
  320. package/lib/components/Editor/tinymce/tinymce.js +30106 -0
  321. package/lib/components/Editor/tinymce/tinymce.min.js +30106 -0
  322. package/lib/components/FilePreparer/FilePreparer.d.ts +26 -0
  323. package/lib/components/FilePreparer/FilePreparer.js +247 -0
  324. package/lib/components/FilePreparer/index.d.ts +2 -0
  325. package/lib/components/FilePreparer/index.js +1 -0
  326. package/lib/components/FileUploader/FileUploader.d.ts +9 -0
  327. package/lib/components/FileUploader/FileUploader.js +318 -0
  328. package/lib/components/FileUploader/index.d.ts +2 -0
  329. package/lib/components/FileUploader/index.js +1 -0
  330. package/lib/components/FormVisualizer/FormVisualizer.d.ts +92 -0
  331. package/lib/components/FormVisualizer/FormVisualizer.js +289 -0
  332. package/lib/components/FormVisualizer/index.d.ts +2 -0
  333. package/lib/components/FormVisualizer/index.js +1 -0
  334. package/lib/components/Highlight/Highlight.d.ts +7 -0
  335. package/lib/components/Highlight/Highlight.js +51 -0
  336. package/lib/components/Highlight/index.d.ts +2 -0
  337. package/lib/components/Highlight/index.js +1 -0
  338. package/lib/components/ImageResize/ImageResize.d.ts +28 -0
  339. package/lib/components/ImageResize/ImageResize.js +479 -0
  340. package/lib/components/ImageResize/index.d.ts +2 -0
  341. package/lib/components/ImageResize/index.js +1 -0
  342. package/lib/components/ImageResizeButton/ImageResizeButton.d.ts +26 -0
  343. package/lib/components/ImageResizeButton/ImageResizeButton.js +65 -0
  344. package/lib/components/ImageResizeButton/index.d.ts +2 -0
  345. package/lib/components/ImageResizeButton/index.js +1 -0
  346. package/lib/components/Input/Input.d.ts +8 -0
  347. package/lib/components/Input/Input.js +353 -0
  348. package/lib/components/Input/index.d.ts +2 -0
  349. package/lib/components/Input/index.js +1 -0
  350. package/lib/components/InputTags/InputTags.d.ts +8 -0
  351. package/lib/components/InputTags/InputTags.js +94 -0
  352. package/lib/components/InputTags/index.d.ts +2 -0
  353. package/lib/components/InputTags/index.js +1 -0
  354. package/lib/components/ListSelect/ListSelect.d.ts +8 -0
  355. package/lib/components/ListSelect/ListSelect.js +94 -0
  356. package/lib/components/ListSelect/index.d.ts +2 -0
  357. package/lib/components/ListSelect/index.js +1 -0
  358. package/lib/components/MaterialButton/MaterialButton.d.ts +13 -0
  359. package/lib/components/MaterialButton/MaterialButton.js +177 -0
  360. package/lib/components/MaterialButton/index.d.ts +2 -0
  361. package/lib/components/MaterialButton/index.js +1 -0
  362. package/lib/components/MenuBar/MenuBar.d.ts +8 -0
  363. package/lib/components/MenuBar/MenuBar.js +139 -0
  364. package/lib/components/MenuBar/index.d.ts +2 -0
  365. package/lib/components/MenuBar/index.js +1 -0
  366. package/lib/components/MonthPicker/MonthPicker.d.ts +8 -0
  367. package/lib/components/MonthPicker/MonthPicker.js +313 -0
  368. package/lib/components/MonthPicker/index.d.ts +2 -0
  369. package/lib/components/MonthPicker/index.js +1 -0
  370. package/lib/components/MultipleSelect/MultipleSelect.d.ts +8 -0
  371. package/lib/components/MultipleSelect/MultipleSelect.js +106 -0
  372. package/lib/components/MultipleSelect/index.d.ts +2 -0
  373. package/lib/components/MultipleSelect/index.js +1 -0
  374. package/lib/components/OtpInput/OtpInput.tsx +244 -0
  375. package/lib/components/OtpInput/index.d.ts +2 -0
  376. package/lib/components/OtpInput/index.js +1 -0
  377. package/lib/components/OutputText/OutputText.d.ts +8 -0
  378. package/lib/components/OutputText/OutputText.js +57 -0
  379. package/lib/components/OutputText/index.d.ts +2 -0
  380. package/lib/components/OutputText/index.js +1 -0
  381. package/lib/components/Pagination/Pagination.d.ts +8 -0
  382. package/lib/components/Pagination/Pagination.js +32 -0
  383. package/lib/components/Pagination/index.d.ts +2 -0
  384. package/lib/components/Pagination/index.js +1 -0
  385. package/lib/components/Programa/Programa.d.ts +31 -0
  386. package/lib/components/Programa/Programa.js +172 -0
  387. package/lib/components/Programa/index.d.ts +2 -0
  388. package/lib/components/Programa/index.js +1 -0
  389. package/lib/components/ProgressBar/ProgressBar.d.ts +8 -0
  390. package/lib/components/ProgressBar/ProgressBar.js +71 -0
  391. package/lib/components/ProgressBar/index.d.ts +2 -0
  392. package/lib/components/ProgressBar/index.js +1 -0
  393. package/lib/components/Select/Select.d.ts +8 -0
  394. package/lib/components/Select/Select.js +117 -0
  395. package/lib/components/Select/index.d.ts +2 -0
  396. package/lib/components/Select/index.js +1 -0
  397. package/lib/components/SimpleTable/SimpleTable.d.ts +13 -0
  398. package/lib/components/SimpleTable/SimpleTable.js +504 -0
  399. package/lib/components/SimpleTable/index.d.ts +2 -0
  400. package/lib/components/SimpleTable/index.js +2 -0
  401. package/lib/components/Stepper/Stepper.d.ts +54 -0
  402. package/lib/components/Stepper/Stepper.js +222 -0
  403. package/lib/components/Stepper/index.d.ts +2 -0
  404. package/lib/components/Stepper/index.js +1 -0
  405. package/lib/components/TablePicker/TablePicker.d.ts +8 -0
  406. package/lib/components/TablePicker/TablePicker.js +238 -0
  407. package/lib/components/TablePicker/index.d.ts +2 -0
  408. package/lib/components/TablePicker/index.js +1 -0
  409. package/lib/components/Tabs/Tabs.d.ts +8 -0
  410. package/lib/components/Tabs/Tabs.js +59 -0
  411. package/lib/components/Tabs/index.d.ts +2 -0
  412. package/lib/components/Tabs/index.js +1 -0
  413. package/lib/components/TextArea/TextArea.d.ts +8 -0
  414. package/lib/components/TextArea/TextArea.js +123 -0
  415. package/lib/components/TextArea/index.d.ts +2 -0
  416. package/lib/components/TextArea/index.js +1 -0
  417. package/lib/components/ThreadLog/ThreadLog.d.ts +8 -0
  418. package/lib/components/ThreadLog/ThreadLog.js +189 -0
  419. package/lib/components/ThreadLog/index.d.ts +2 -0
  420. package/lib/components/ThreadLog/index.js +1 -0
  421. package/lib/components/UtilAutoComplete/UtilAutoComplete.d.ts +93 -0
  422. package/lib/components/UtilAutoComplete/UtilAutoComplete.js +130 -0
  423. package/lib/components/UtilAutoComplete/index.d.ts +2 -0
  424. package/lib/components/UtilAutoComplete/index.js +1 -0
  425. package/lib/components/index.d.ts +148 -0
  426. package/lib/components/index.js +146 -0
  427. package/lib/fieldsRedux/createField.d.ts +8 -0
  428. package/lib/fieldsRedux/createField.js +120 -0
  429. package/lib/fieldsRedux/fieldsRedux.d.ts +71 -0
  430. package/lib/fieldsRedux/fieldsRedux.js +391 -0
  431. package/lib/fieldsRedux/index.d.ts +4 -0
  432. package/lib/fieldsRedux/index.js +5 -0
  433. package/lib/fieldsRedux/passFields.d.ts +5 -0
  434. package/lib/fieldsRedux/passFields.js +76 -0
  435. package/lib/reducers/argous.ts +103 -0
  436. package/lib/reducers/index.ts +6 -0
  437. package/lib/types.d.ts +144 -0
  438. package/lib/utils/api.ts +153 -0
  439. package/lib/utils/config.ts +12 -0
  440. package/lib/utils/date.ts +63 -0
  441. package/lib/utils/index.ts +314 -0
  442. package/lib/utils/rippleEffect.js +211 -0
  443. package/lib/utils/store.ts +11 -0
  444. package/lib/utils/xmlToJson.js +117 -0
  445. package/package.json +1 -1
  446. package/dist/components/ArgousComplexTableBody/dnd/Container.d.ts +0 -55
  447. package/dist/components/ArgousComplexTableBody/dnd/Container.js +0 -173
  448. package/dist/components/ArgousComplexTableBody/dnd/Draggable.d.ts +0 -14
  449. package/dist/components/ArgousComplexTableBody/dnd/Draggable.js +0 -73
  450. package/dist/components/ArgousComplexTableBody/dnd/index.d.ts +0 -2
  451. package/dist/components/ArgousComplexTableBody/dnd/index.js +0 -10
  452. package/dist/components/ConfirmModal/useModal.d.ts +0 -2
  453. package/dist/components/ConfirmModal/useModal.js +0 -9
  454. package/dist/components/DropArea/worker.d.ts +0 -1
  455. package/dist/components/DropArea/worker.js +0 -55
  456. package/dist/components/Editor/tinymce/icons/default/icons.d.ts +0 -0
  457. package/dist/components/Editor/tinymce/icons/default/icons.js +0 -173
  458. package/dist/components/Editor/tinymce/plugins/advlist/plugin.d.ts +0 -0
  459. package/dist/components/Editor/tinymce/plugins/advlist/plugin.js +0 -271
  460. package/dist/components/Editor/tinymce/plugins/anchor/plugin.d.ts +0 -0
  461. package/dist/components/Editor/tinymce/plugins/anchor/plugin.js +0 -207
  462. package/dist/components/Editor/tinymce/plugins/autolink/plugin.d.ts +0 -0
  463. package/dist/components/Editor/tinymce/plugins/autolink/plugin.js +0 -187
  464. package/dist/components/Editor/tinymce/plugins/autoresize/plugin.d.ts +0 -0
  465. package/dist/components/Editor/tinymce/plugins/autoresize/plugin.js +0 -163
  466. package/dist/components/Editor/tinymce/plugins/autosave/plugin.d.ts +0 -0
  467. package/dist/components/Editor/tinymce/plugins/autosave/plugin.js +0 -199
  468. package/dist/components/Editor/tinymce/plugins/bbcode/plugin.d.ts +0 -0
  469. package/dist/components/Editor/tinymce/plugins/bbcode/plugin.js +0 -94
  470. package/dist/components/Editor/tinymce/plugins/charmap/plugin.d.ts +0 -0
  471. package/dist/components/Editor/tinymce/plugins/charmap/plugin.js +0 -1691
  472. package/dist/components/Editor/tinymce/plugins/code/plugin.d.ts +0 -0
  473. package/dist/components/Editor/tinymce/plugins/code/plugin.js +0 -85
  474. package/dist/components/Editor/tinymce/plugins/codesample/plugin.js +0 -2331
  475. package/dist/components/Editor/tinymce/plugins/colorpicker/plugin.d.ts +0 -0
  476. package/dist/components/Editor/tinymce/plugins/contextmenu/plugin.d.ts +0 -0
  477. package/dist/components/Editor/tinymce/plugins/directionality/plugin.d.ts +0 -0
  478. package/dist/components/Editor/tinymce/plugins/directionality/plugin.js +0 -300
  479. package/dist/components/Editor/tinymce/plugins/emoticons/js/emojiimages.d.ts +0 -0
  480. package/dist/components/Editor/tinymce/plugins/emoticons/js/emojiimages.js +0 -9425
  481. package/dist/components/Editor/tinymce/plugins/emoticons/js/emojis.d.ts +0 -0
  482. package/dist/components/Editor/tinymce/plugins/emoticons/js/emojis.js +0 -9424
  483. package/dist/components/Editor/tinymce/plugins/emoticons/plugin.d.ts +0 -0
  484. package/dist/components/Editor/tinymce/plugins/emoticons/plugin.js +0 -585
  485. package/dist/components/Editor/tinymce/plugins/fullpage/plugin.d.ts +0 -0
  486. package/dist/components/Editor/tinymce/plugins/fullpage/plugin.js +0 -539
  487. package/dist/components/Editor/tinymce/plugins/fullscreen/plugin.d.ts +0 -0
  488. package/dist/components/Editor/tinymce/plugins/fullscreen/plugin.js +0 -962
  489. package/dist/components/Editor/tinymce/plugins/help/plugin.d.ts +0 -0
  490. package/dist/components/Editor/tinymce/plugins/help/plugin.js +0 -850
  491. package/dist/components/Editor/tinymce/plugins/hr/plugin.d.ts +0 -0
  492. package/dist/components/Editor/tinymce/plugins/hr/plugin.js +0 -41
  493. package/dist/components/Editor/tinymce/plugins/image/plugin.d.ts +0 -0
  494. package/dist/components/Editor/tinymce/plugins/image/plugin.js +0 -1673
  495. package/dist/components/Editor/tinymce/plugins/imagetools/plugin.d.ts +0 -0
  496. package/dist/components/Editor/tinymce/plugins/imagetools/plugin.js +0 -1335
  497. package/dist/components/Editor/tinymce/plugins/importcss/plugin.d.ts +0 -0
  498. package/dist/components/Editor/tinymce/plugins/importcss/plugin.js +0 -346
  499. package/dist/components/Editor/tinymce/plugins/insertdatetime/plugin.d.ts +0 -0
  500. package/dist/components/Editor/tinymce/plugins/insertdatetime/plugin.js +0 -171
  501. package/dist/components/Editor/tinymce/plugins/legacyoutput/plugin.d.ts +0 -0
  502. package/dist/components/Editor/tinymce/plugins/legacyoutput/plugin.js +0 -193
  503. package/dist/components/Editor/tinymce/plugins/link/plugin.d.ts +0 -0
  504. package/dist/components/Editor/tinymce/plugins/link/plugin.js +0 -1282
  505. package/dist/components/Editor/tinymce/plugins/lists/plugin.d.ts +0 -0
  506. package/dist/components/Editor/tinymce/plugins/lists/plugin.js +0 -2256
  507. package/dist/components/Editor/tinymce/plugins/media/plugin.d.ts +0 -0
  508. package/dist/components/Editor/tinymce/plugins/media/plugin.js +0 -1374
  509. package/dist/components/Editor/tinymce/plugins/nonbreaking/plugin.d.ts +0 -0
  510. package/dist/components/Editor/tinymce/plugins/nonbreaking/plugin.js +0 -93
  511. package/dist/components/Editor/tinymce/plugins/noneditable/plugin.d.ts +0 -0
  512. package/dist/components/Editor/tinymce/plugins/noneditable/plugin.js +0 -114
  513. package/dist/components/Editor/tinymce/plugins/pagebreak/plugin.d.ts +0 -0
  514. package/dist/components/Editor/tinymce/plugins/pagebreak/plugin.js +0 -96
  515. package/dist/components/Editor/tinymce/plugins/paste/plugin.d.ts +0 -0
  516. package/dist/components/Editor/tinymce/plugins/paste/plugin.js +0 -1747
  517. package/dist/components/Editor/tinymce/plugins/preview/plugin.d.ts +0 -0
  518. package/dist/components/Editor/tinymce/plugins/preview/plugin.js +0 -119
  519. package/dist/components/Editor/tinymce/plugins/print/plugin.d.ts +0 -0
  520. package/dist/components/Editor/tinymce/plugins/print/plugin.js +0 -48
  521. package/dist/components/Editor/tinymce/plugins/quickbars/plugin.d.ts +0 -0
  522. package/dist/components/Editor/tinymce/plugins/quickbars/plugin.js +0 -475
  523. package/dist/components/Editor/tinymce/plugins/save/plugin.d.ts +0 -0
  524. package/dist/components/Editor/tinymce/plugins/save/plugin.js +0 -112
  525. package/dist/components/Editor/tinymce/plugins/searchreplace/plugin.d.ts +0 -0
  526. package/dist/components/Editor/tinymce/plugins/searchreplace/plugin.js +0 -1149
  527. package/dist/components/Editor/tinymce/plugins/spellchecker/plugin.d.ts +0 -0
  528. package/dist/components/Editor/tinymce/plugins/spellchecker/plugin.js +0 -723
  529. package/dist/components/Editor/tinymce/plugins/tabfocus/plugin.d.ts +0 -0
  530. package/dist/components/Editor/tinymce/plugins/tabfocus/plugin.js +0 -124
  531. package/dist/components/Editor/tinymce/plugins/table/plugin.d.ts +0 -0
  532. package/dist/components/Editor/tinymce/plugins/table/plugin.js +0 -10853
  533. package/dist/components/Editor/tinymce/plugins/template/plugin.d.ts +0 -0
  534. package/dist/components/Editor/tinymce/plugins/template/plugin.js +0 -561
  535. package/dist/components/Editor/tinymce/plugins/textcolor/plugin.d.ts +0 -0
  536. package/dist/components/Editor/tinymce/plugins/textpattern/plugin.d.ts +0 -0
  537. package/dist/components/Editor/tinymce/plugins/textpattern/plugin.js +0 -1393
  538. package/dist/components/Editor/tinymce/plugins/toc/plugin.d.ts +0 -0
  539. package/dist/components/Editor/tinymce/plugins/toc/plugin.js +0 -227
  540. package/dist/components/Editor/tinymce/plugins/visualblocks/plugin.d.ts +0 -0
  541. package/dist/components/Editor/tinymce/plugins/visualblocks/plugin.js +0 -94
  542. package/dist/components/Editor/tinymce/plugins/visualchars/plugin.d.ts +0 -0
  543. package/dist/components/Editor/tinymce/plugins/visualchars/plugin.js +0 -521
  544. package/dist/components/Editor/tinymce/plugins/wordcount/plugin.d.ts +0 -0
  545. package/dist/components/Editor/tinymce/plugins/wordcount/plugin.js +0 -397
  546. package/dist/components/Editor/tinymce/themes/mobile/theme.js +0 -13348
  547. package/dist/components/Editor/tinymce/themes/silver/theme.js +0 -32028
  548. package/dist/components/Editor/tinymce/tinymce.js +0 -30486
  549. package/dist/components/FilePreparer/worker.d.ts +0 -2
  550. package/dist/components/FilePreparer/worker.js +0 -31
  551. package/dist/convertReacticons.d.ts +0 -1
  552. package/dist/convertReacticons.js +0 -62
  553. package/dist/utils/Fields.d.ts +0 -0
  554. package/dist/utils/Fields.js +0 -1
@@ -0,0 +1,1661 @@
1
+ /**
2
+ * Copyright (c) Tiny Technologies, Inc. All rights reserved.
3
+ * Licensed under the LGPL or a commercial license.
4
+ * For LGPL see License.txt in the project root for license information.
5
+ * For commercial licenses see https://www.tiny.cloud/
6
+ *
7
+ * Version: 5.9.0 (TBD)
8
+ */
9
+ (function () {
10
+ 'use strict';
11
+
12
+ var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
13
+
14
+ var __assign = function () {
15
+ __assign = Object.assign || function __assign(t) {
16
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
17
+ s = arguments[i];
18
+ for (var p in s)
19
+ if (Object.prototype.hasOwnProperty.call(s, p))
20
+ t[p] = s[p];
21
+ }
22
+ return t;
23
+ };
24
+ return __assign.apply(this, arguments);
25
+ };
26
+
27
+ var typeOf = function (x) {
28
+ var t = typeof x;
29
+ if (x === null) {
30
+ return 'null';
31
+ } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
32
+ return 'array';
33
+ } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
34
+ return 'string';
35
+ } else {
36
+ return t;
37
+ }
38
+ };
39
+ var isType = function (type) {
40
+ return function (value) {
41
+ return typeOf(value) === type;
42
+ };
43
+ };
44
+ var isSimpleType = function (type) {
45
+ return function (value) {
46
+ return typeof value === type;
47
+ };
48
+ };
49
+ var eq = function (t) {
50
+ return function (a) {
51
+ return t === a;
52
+ };
53
+ };
54
+ var isString = isType('string');
55
+ var isObject = isType('object');
56
+ var isArray = isType('array');
57
+ var isNull = eq(null);
58
+ var isBoolean = isSimpleType('boolean');
59
+ var isNullable = function (a) {
60
+ return a === null || a === undefined;
61
+ };
62
+ var isNonNullable = function (a) {
63
+ return !isNullable(a);
64
+ };
65
+ var isNumber = isSimpleType('number');
66
+
67
+ var noop = function () {
68
+ };
69
+ var constant = function (value) {
70
+ return function () {
71
+ return value;
72
+ };
73
+ };
74
+ var never = constant(false);
75
+ var always = constant(true);
76
+
77
+ var none = function () {
78
+ return NONE;
79
+ };
80
+ var NONE = function () {
81
+ var eq = function (o) {
82
+ return o.isNone();
83
+ };
84
+ var call = function (thunk) {
85
+ return thunk();
86
+ };
87
+ var id = function (n) {
88
+ return n;
89
+ };
90
+ var me = {
91
+ fold: function (n, _s) {
92
+ return n();
93
+ },
94
+ is: never,
95
+ isSome: never,
96
+ isNone: always,
97
+ getOr: id,
98
+ getOrThunk: call,
99
+ getOrDie: function (msg) {
100
+ throw new Error(msg || 'error: getOrDie called on none.');
101
+ },
102
+ getOrNull: constant(null),
103
+ getOrUndefined: constant(undefined),
104
+ or: id,
105
+ orThunk: call,
106
+ map: none,
107
+ each: noop,
108
+ bind: none,
109
+ exists: never,
110
+ forall: always,
111
+ filter: none,
112
+ equals: eq,
113
+ equals_: eq,
114
+ toArray: function () {
115
+ return [];
116
+ },
117
+ toString: constant('none()')
118
+ };
119
+ return me;
120
+ }();
121
+ var some = function (a) {
122
+ var constant_a = constant(a);
123
+ var self = function () {
124
+ return me;
125
+ };
126
+ var bind = function (f) {
127
+ return f(a);
128
+ };
129
+ var me = {
130
+ fold: function (n, s) {
131
+ return s(a);
132
+ },
133
+ is: function (v) {
134
+ return a === v;
135
+ },
136
+ isSome: always,
137
+ isNone: never,
138
+ getOr: constant_a,
139
+ getOrThunk: constant_a,
140
+ getOrDie: constant_a,
141
+ getOrNull: constant_a,
142
+ getOrUndefined: constant_a,
143
+ or: self,
144
+ orThunk: self,
145
+ map: function (f) {
146
+ return some(f(a));
147
+ },
148
+ each: function (f) {
149
+ f(a);
150
+ },
151
+ bind: bind,
152
+ exists: bind,
153
+ forall: bind,
154
+ filter: function (f) {
155
+ return f(a) ? me : NONE;
156
+ },
157
+ toArray: function () {
158
+ return [a];
159
+ },
160
+ toString: function () {
161
+ return 'some(' + a + ')';
162
+ },
163
+ equals: function (o) {
164
+ return o.is(a);
165
+ },
166
+ equals_: function (o, elementEq) {
167
+ return o.fold(never, function (b) {
168
+ return elementEq(a, b);
169
+ });
170
+ }
171
+ };
172
+ return me;
173
+ };
174
+ var from = function (value) {
175
+ return value === null || value === undefined ? NONE : some(value);
176
+ };
177
+ var Optional = {
178
+ some: some,
179
+ none: none,
180
+ from: from
181
+ };
182
+
183
+ var keys = Object.keys;
184
+ var hasOwnProperty = Object.hasOwnProperty;
185
+ var each = function (obj, f) {
186
+ var props = keys(obj);
187
+ for (var k = 0, len = props.length; k < len; k++) {
188
+ var i = props[k];
189
+ var x = obj[i];
190
+ f(x, i);
191
+ }
192
+ };
193
+ var objAcc = function (r) {
194
+ return function (x, i) {
195
+ r[i] = x;
196
+ };
197
+ };
198
+ var internalFilter = function (obj, pred, onTrue, onFalse) {
199
+ var r = {};
200
+ each(obj, function (x, i) {
201
+ (pred(x, i) ? onTrue : onFalse)(x, i);
202
+ });
203
+ return r;
204
+ };
205
+ var filter = function (obj, pred) {
206
+ var t = {};
207
+ internalFilter(obj, pred, objAcc(t), noop);
208
+ return t;
209
+ };
210
+ var has = function (obj, key) {
211
+ return hasOwnProperty.call(obj, key);
212
+ };
213
+ var hasNonNullableKey = function (obj, key) {
214
+ return has(obj, key) && obj[key] !== undefined && obj[key] !== null;
215
+ };
216
+
217
+ var nativePush = Array.prototype.push;
218
+ var flatten = function (xs) {
219
+ var r = [];
220
+ for (var i = 0, len = xs.length; i < len; ++i) {
221
+ if (!isArray(xs[i])) {
222
+ throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
223
+ }
224
+ nativePush.apply(r, xs[i]);
225
+ }
226
+ return r;
227
+ };
228
+ var get = function (xs, i) {
229
+ return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none();
230
+ };
231
+ var head = function (xs) {
232
+ return get(xs, 0);
233
+ };
234
+ var findMap = function (arr, f) {
235
+ for (var i = 0; i < arr.length; i++) {
236
+ var r = f(arr[i], i);
237
+ if (r.isSome()) {
238
+ return r;
239
+ }
240
+ }
241
+ return Optional.none();
242
+ };
243
+
244
+ var Global = typeof window !== 'undefined' ? window : Function('return this;')();
245
+
246
+ var rawSet = function (dom, key, value) {
247
+ if (isString(value) || isBoolean(value) || isNumber(value)) {
248
+ dom.setAttribute(key, value + '');
249
+ } else {
250
+ console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom);
251
+ throw new Error('Attribute value was not simple');
252
+ }
253
+ };
254
+ var set = function (element, key, value) {
255
+ rawSet(element.dom, key, value);
256
+ };
257
+ var remove = function (element, key) {
258
+ element.dom.removeAttribute(key);
259
+ };
260
+
261
+ var fromHtml = function (html, scope) {
262
+ var doc = scope || document;
263
+ var div = doc.createElement('div');
264
+ div.innerHTML = html;
265
+ if (!div.hasChildNodes() || div.childNodes.length > 1) {
266
+ console.error('HTML does not have a single root node', html);
267
+ throw new Error('HTML must have a single root node');
268
+ }
269
+ return fromDom(div.childNodes[0]);
270
+ };
271
+ var fromTag = function (tag, scope) {
272
+ var doc = scope || document;
273
+ var node = doc.createElement(tag);
274
+ return fromDom(node);
275
+ };
276
+ var fromText = function (text, scope) {
277
+ var doc = scope || document;
278
+ var node = doc.createTextNode(text);
279
+ return fromDom(node);
280
+ };
281
+ var fromDom = function (node) {
282
+ if (node === null || node === undefined) {
283
+ throw new Error('Node cannot be null or undefined');
284
+ }
285
+ return { dom: node };
286
+ };
287
+ var fromPoint = function (docElm, x, y) {
288
+ return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom);
289
+ };
290
+ var SugarElement = {
291
+ fromHtml: fromHtml,
292
+ fromTag: fromTag,
293
+ fromText: fromText,
294
+ fromDom: fromDom,
295
+ fromPoint: fromPoint
296
+ };
297
+
298
+ var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
299
+
300
+ var global$2 = tinymce.util.Tools.resolve('tinymce.util.Promise');
301
+
302
+ var global$3 = tinymce.util.Tools.resolve('tinymce.util.XHR');
303
+
304
+ var hasDimensions = function (editor) {
305
+ return editor.getParam('image_dimensions', true, 'boolean');
306
+ };
307
+ var hasAdvTab = function (editor) {
308
+ return editor.getParam('image_advtab', false, 'boolean');
309
+ };
310
+ var hasUploadTab = function (editor) {
311
+ return editor.getParam('image_uploadtab', true, 'boolean');
312
+ };
313
+ var getPrependUrl = function (editor) {
314
+ return editor.getParam('image_prepend_url', '', 'string');
315
+ };
316
+ var getClassList = function (editor) {
317
+ return editor.getParam('image_class_list');
318
+ };
319
+ var hasDescription = function (editor) {
320
+ return editor.getParam('image_description', true, 'boolean');
321
+ };
322
+ var hasImageTitle = function (editor) {
323
+ return editor.getParam('image_title', false, 'boolean');
324
+ };
325
+ var hasImageCaption = function (editor) {
326
+ return editor.getParam('image_caption', false, 'boolean');
327
+ };
328
+ var getImageList = function (editor) {
329
+ return editor.getParam('image_list', false);
330
+ };
331
+ var hasUploadUrl = function (editor) {
332
+ return isNonNullable(editor.getParam('images_upload_url'));
333
+ };
334
+ var hasUploadHandler = function (editor) {
335
+ return isNonNullable(editor.getParam('images_upload_handler'));
336
+ };
337
+ var showAccessibilityOptions = function (editor) {
338
+ return editor.getParam('a11y_advanced_options', false, 'boolean');
339
+ };
340
+ var isAutomaticUploadsEnabled = function (editor) {
341
+ return editor.getParam('automatic_uploads', true, 'boolean');
342
+ };
343
+
344
+ var parseIntAndGetMax = function (val1, val2) {
345
+ return Math.max(parseInt(val1, 10), parseInt(val2, 10));
346
+ };
347
+ var getImageSize = function (url) {
348
+ return new global$2(function (callback) {
349
+ var img = document.createElement('img');
350
+ var done = function (dimensions) {
351
+ if (img.parentNode) {
352
+ img.parentNode.removeChild(img);
353
+ }
354
+ callback(dimensions);
355
+ };
356
+ img.onload = function () {
357
+ var width = parseIntAndGetMax(img.width, img.clientWidth);
358
+ var height = parseIntAndGetMax(img.height, img.clientHeight);
359
+ var dimensions = {
360
+ width: width,
361
+ height: height
362
+ };
363
+ done(global$2.resolve(dimensions));
364
+ };
365
+ img.onerror = function () {
366
+ done(global$2.reject('Failed to get image dimensions for: ' + url));
367
+ };
368
+ var style = img.style;
369
+ style.visibility = 'hidden';
370
+ style.position = 'fixed';
371
+ style.bottom = style.left = '0px';
372
+ style.width = style.height = 'auto';
373
+ document.body.appendChild(img);
374
+ img.src = url;
375
+ });
376
+ };
377
+ var removePixelSuffix = function (value) {
378
+ if (value) {
379
+ value = value.replace(/px$/, '');
380
+ }
381
+ return value;
382
+ };
383
+ var addPixelSuffix = function (value) {
384
+ if (value.length > 0 && /^[0-9]+$/.test(value)) {
385
+ value += 'px';
386
+ }
387
+ return value;
388
+ };
389
+ var mergeMargins = function (css) {
390
+ if (css.margin) {
391
+ var splitMargin = String(css.margin).split(' ');
392
+ switch (splitMargin.length) {
393
+ case 1:
394
+ css['margin-top'] = css['margin-top'] || splitMargin[0];
395
+ css['margin-right'] = css['margin-right'] || splitMargin[0];
396
+ css['margin-bottom'] = css['margin-bottom'] || splitMargin[0];
397
+ css['margin-left'] = css['margin-left'] || splitMargin[0];
398
+ break;
399
+ case 2:
400
+ css['margin-top'] = css['margin-top'] || splitMargin[0];
401
+ css['margin-right'] = css['margin-right'] || splitMargin[1];
402
+ css['margin-bottom'] = css['margin-bottom'] || splitMargin[0];
403
+ css['margin-left'] = css['margin-left'] || splitMargin[1];
404
+ break;
405
+ case 3:
406
+ css['margin-top'] = css['margin-top'] || splitMargin[0];
407
+ css['margin-right'] = css['margin-right'] || splitMargin[1];
408
+ css['margin-bottom'] = css['margin-bottom'] || splitMargin[2];
409
+ css['margin-left'] = css['margin-left'] || splitMargin[1];
410
+ break;
411
+ case 4:
412
+ css['margin-top'] = css['margin-top'] || splitMargin[0];
413
+ css['margin-right'] = css['margin-right'] || splitMargin[1];
414
+ css['margin-bottom'] = css['margin-bottom'] || splitMargin[2];
415
+ css['margin-left'] = css['margin-left'] || splitMargin[3];
416
+ }
417
+ delete css.margin;
418
+ }
419
+ return css;
420
+ };
421
+ var createImageList = function (editor, callback) {
422
+ var imageList = getImageList(editor);
423
+ if (typeof imageList === 'string') {
424
+ global$3.send({
425
+ url: imageList,
426
+ success: function (text) {
427
+ callback(JSON.parse(text));
428
+ }
429
+ });
430
+ } else if (typeof imageList === 'function') {
431
+ imageList(callback);
432
+ } else {
433
+ callback(imageList);
434
+ }
435
+ };
436
+ var waitLoadImage = function (editor, data, imgElm) {
437
+ var selectImage = function () {
438
+ imgElm.onload = imgElm.onerror = null;
439
+ if (editor.selection) {
440
+ editor.selection.select(imgElm);
441
+ editor.nodeChanged();
442
+ }
443
+ };
444
+ imgElm.onload = function () {
445
+ if (!data.width && !data.height && hasDimensions(editor)) {
446
+ editor.dom.setAttribs(imgElm, {
447
+ width: String(imgElm.clientWidth),
448
+ height: String(imgElm.clientHeight)
449
+ });
450
+ }
451
+ selectImage();
452
+ };
453
+ imgElm.onerror = selectImage;
454
+ };
455
+ var blobToDataUri = function (blob) {
456
+ return new global$2(function (resolve, reject) {
457
+ var reader = new FileReader();
458
+ reader.onload = function () {
459
+ resolve(reader.result);
460
+ };
461
+ reader.onerror = function () {
462
+ reject(reader.error.message);
463
+ };
464
+ reader.readAsDataURL(blob);
465
+ });
466
+ };
467
+ var isPlaceholderImage = function (imgElm) {
468
+ return imgElm.nodeName === 'IMG' && (imgElm.hasAttribute('data-mce-object') || imgElm.hasAttribute('data-mce-placeholder'));
469
+ };
470
+
471
+ var DOM = global$1.DOM;
472
+ var getHspace = function (image) {
473
+ if (image.style.marginLeft && image.style.marginRight && image.style.marginLeft === image.style.marginRight) {
474
+ return removePixelSuffix(image.style.marginLeft);
475
+ } else {
476
+ return '';
477
+ }
478
+ };
479
+ var getVspace = function (image) {
480
+ if (image.style.marginTop && image.style.marginBottom && image.style.marginTop === image.style.marginBottom) {
481
+ return removePixelSuffix(image.style.marginTop);
482
+ } else {
483
+ return '';
484
+ }
485
+ };
486
+ var getBorder = function (image) {
487
+ if (image.style.borderWidth) {
488
+ return removePixelSuffix(image.style.borderWidth);
489
+ } else {
490
+ return '';
491
+ }
492
+ };
493
+ var getAttrib = function (image, name) {
494
+ if (image.hasAttribute(name)) {
495
+ return image.getAttribute(name);
496
+ } else {
497
+ return '';
498
+ }
499
+ };
500
+ var getStyle = function (image, name) {
501
+ return image.style[name] ? image.style[name] : '';
502
+ };
503
+ var hasCaption = function (image) {
504
+ return image.parentNode !== null && image.parentNode.nodeName === 'FIGURE';
505
+ };
506
+ var updateAttrib = function (image, name, value) {
507
+ if (value === '') {
508
+ image.removeAttribute(name);
509
+ } else {
510
+ image.setAttribute(name, value);
511
+ }
512
+ };
513
+ var wrapInFigure = function (image) {
514
+ var figureElm = DOM.create('figure', { class: 'image' });
515
+ DOM.insertAfter(figureElm, image);
516
+ figureElm.appendChild(image);
517
+ figureElm.appendChild(DOM.create('figcaption', { contentEditable: 'true' }, 'Caption'));
518
+ figureElm.contentEditable = 'false';
519
+ };
520
+ var removeFigure = function (image) {
521
+ var figureElm = image.parentNode;
522
+ DOM.insertAfter(image, figureElm);
523
+ DOM.remove(figureElm);
524
+ };
525
+ var toggleCaption = function (image) {
526
+ if (hasCaption(image)) {
527
+ removeFigure(image);
528
+ } else {
529
+ wrapInFigure(image);
530
+ }
531
+ };
532
+ var normalizeStyle = function (image, normalizeCss) {
533
+ var attrValue = image.getAttribute('style');
534
+ var value = normalizeCss(attrValue !== null ? attrValue : '');
535
+ if (value.length > 0) {
536
+ image.setAttribute('style', value);
537
+ image.setAttribute('data-mce-style', value);
538
+ } else {
539
+ image.removeAttribute('style');
540
+ }
541
+ };
542
+ var setSize = function (name, normalizeCss) {
543
+ return function (image, name, value) {
544
+ if (image.style[name]) {
545
+ image.style[name] = addPixelSuffix(value);
546
+ normalizeStyle(image, normalizeCss);
547
+ } else {
548
+ updateAttrib(image, name, value);
549
+ }
550
+ };
551
+ };
552
+ var getSize = function (image, name) {
553
+ if (image.style[name]) {
554
+ return removePixelSuffix(image.style[name]);
555
+ } else {
556
+ return getAttrib(image, name);
557
+ }
558
+ };
559
+ var setHspace = function (image, value) {
560
+ var pxValue = addPixelSuffix(value);
561
+ image.style.marginLeft = pxValue;
562
+ image.style.marginRight = pxValue;
563
+ };
564
+ var setVspace = function (image, value) {
565
+ var pxValue = addPixelSuffix(value);
566
+ image.style.marginTop = pxValue;
567
+ image.style.marginBottom = pxValue;
568
+ };
569
+ var setBorder = function (image, value) {
570
+ var pxValue = addPixelSuffix(value);
571
+ image.style.borderWidth = pxValue;
572
+ };
573
+ var setBorderStyle = function (image, value) {
574
+ image.style.borderStyle = value;
575
+ };
576
+ var getBorderStyle = function (image) {
577
+ return getStyle(image, 'borderStyle');
578
+ };
579
+ var isFigure = function (elm) {
580
+ return elm.nodeName === 'FIGURE';
581
+ };
582
+ var isImage = function (elm) {
583
+ return elm.nodeName === 'IMG';
584
+ };
585
+ var getIsDecorative = function (image) {
586
+ return DOM.getAttrib(image, 'alt').length === 0 && DOM.getAttrib(image, 'role') === 'presentation';
587
+ };
588
+ var getAlt = function (image) {
589
+ if (getIsDecorative(image)) {
590
+ return '';
591
+ } else {
592
+ return getAttrib(image, 'alt');
593
+ }
594
+ };
595
+ var defaultData = function () {
596
+ return {
597
+ src: '',
598
+ alt: '',
599
+ title: '',
600
+ width: '',
601
+ height: '',
602
+ class: '',
603
+ style: '',
604
+ caption: false,
605
+ hspace: '',
606
+ vspace: '',
607
+ border: '',
608
+ borderStyle: '',
609
+ isDecorative: false
610
+ };
611
+ };
612
+ var getStyleValue = function (normalizeCss, data) {
613
+ var image = document.createElement('img');
614
+ updateAttrib(image, 'style', data.style);
615
+ if (getHspace(image) || data.hspace !== '') {
616
+ setHspace(image, data.hspace);
617
+ }
618
+ if (getVspace(image) || data.vspace !== '') {
619
+ setVspace(image, data.vspace);
620
+ }
621
+ if (getBorder(image) || data.border !== '') {
622
+ setBorder(image, data.border);
623
+ }
624
+ if (getBorderStyle(image) || data.borderStyle !== '') {
625
+ setBorderStyle(image, data.borderStyle);
626
+ }
627
+ return normalizeCss(image.getAttribute('style'));
628
+ };
629
+ var create = function (normalizeCss, data) {
630
+ var image = document.createElement('img');
631
+ write(normalizeCss, __assign(__assign({}, data), { caption: false }), image);
632
+ setAlt(image, data.alt, data.isDecorative);
633
+ if (data.caption) {
634
+ var figure = DOM.create('figure', { class: 'image' });
635
+ figure.appendChild(image);
636
+ figure.appendChild(DOM.create('figcaption', { contentEditable: 'true' }, 'Caption'));
637
+ figure.contentEditable = 'false';
638
+ return figure;
639
+ } else {
640
+ return image;
641
+ }
642
+ };
643
+ var read = function (normalizeCss, image) {
644
+ return {
645
+ src: getAttrib(image, 'src'),
646
+ alt: getAlt(image),
647
+ title: getAttrib(image, 'title'),
648
+ width: getSize(image, 'width'),
649
+ height: getSize(image, 'height'),
650
+ class: getAttrib(image, 'class'),
651
+ style: normalizeCss(getAttrib(image, 'style')),
652
+ caption: hasCaption(image),
653
+ hspace: getHspace(image),
654
+ vspace: getVspace(image),
655
+ border: getBorder(image),
656
+ borderStyle: getStyle(image, 'borderStyle'),
657
+ isDecorative: getIsDecorative(image)
658
+ };
659
+ };
660
+ var updateProp = function (image, oldData, newData, name, set) {
661
+ if (newData[name] !== oldData[name]) {
662
+ set(image, name, newData[name]);
663
+ }
664
+ };
665
+ var setAlt = function (image, alt, isDecorative) {
666
+ if (isDecorative) {
667
+ DOM.setAttrib(image, 'role', 'presentation');
668
+ var sugarImage = SugarElement.fromDom(image);
669
+ set(sugarImage, 'alt', '');
670
+ } else {
671
+ if (isNull(alt)) {
672
+ var sugarImage = SugarElement.fromDom(image);
673
+ remove(sugarImage, 'alt');
674
+ } else {
675
+ var sugarImage = SugarElement.fromDom(image);
676
+ set(sugarImage, 'alt', alt);
677
+ }
678
+ if (DOM.getAttrib(image, 'role') === 'presentation') {
679
+ DOM.setAttrib(image, 'role', '');
680
+ }
681
+ }
682
+ };
683
+ var updateAlt = function (image, oldData, newData) {
684
+ if (newData.alt !== oldData.alt || newData.isDecorative !== oldData.isDecorative) {
685
+ setAlt(image, newData.alt, newData.isDecorative);
686
+ }
687
+ };
688
+ var normalized = function (set, normalizeCss) {
689
+ return function (image, name, value) {
690
+ set(image, value);
691
+ normalizeStyle(image, normalizeCss);
692
+ };
693
+ };
694
+ var write = function (normalizeCss, newData, image) {
695
+ var oldData = read(normalizeCss, image);
696
+ updateProp(image, oldData, newData, 'caption', function (image, _name, _value) {
697
+ return toggleCaption(image);
698
+ });
699
+ updateProp(image, oldData, newData, 'src', updateAttrib);
700
+ updateProp(image, oldData, newData, 'title', updateAttrib);
701
+ updateProp(image, oldData, newData, 'width', setSize('width', normalizeCss));
702
+ updateProp(image, oldData, newData, 'height', setSize('height', normalizeCss));
703
+ updateProp(image, oldData, newData, 'class', updateAttrib);
704
+ updateProp(image, oldData, newData, 'style', normalized(function (image, value) {
705
+ return updateAttrib(image, 'style', value);
706
+ }, normalizeCss));
707
+ updateProp(image, oldData, newData, 'hspace', normalized(setHspace, normalizeCss));
708
+ updateProp(image, oldData, newData, 'vspace', normalized(setVspace, normalizeCss));
709
+ updateProp(image, oldData, newData, 'border', normalized(setBorder, normalizeCss));
710
+ updateProp(image, oldData, newData, 'borderStyle', normalized(setBorderStyle, normalizeCss));
711
+ updateAlt(image, oldData, newData);
712
+ };
713
+
714
+ var normalizeCss = function (editor, cssText) {
715
+ var css = editor.dom.styles.parse(cssText);
716
+ var mergedCss = mergeMargins(css);
717
+ var compressed = editor.dom.styles.parse(editor.dom.styles.serialize(mergedCss));
718
+ return editor.dom.styles.serialize(compressed);
719
+ };
720
+ var getSelectedImage = function (editor) {
721
+ var imgElm = editor.selection.getNode();
722
+ var figureElm = editor.dom.getParent(imgElm, 'figure.image');
723
+ if (figureElm) {
724
+ return editor.dom.select('img', figureElm)[0];
725
+ }
726
+ if (imgElm && (imgElm.nodeName !== 'IMG' || isPlaceholderImage(imgElm))) {
727
+ return null;
728
+ }
729
+ return imgElm;
730
+ };
731
+ var splitTextBlock = function (editor, figure) {
732
+ var dom = editor.dom;
733
+ var textBlockElements = filter(editor.schema.getTextBlockElements(), function (_, parentElm) {
734
+ return !editor.schema.isValidChild(parentElm, 'figure');
735
+ });
736
+ var textBlock = dom.getParent(figure.parentNode, function (node) {
737
+ return hasNonNullableKey(textBlockElements, node.nodeName);
738
+ }, editor.getBody());
739
+ if (textBlock) {
740
+ return dom.split(textBlock, figure);
741
+ } else {
742
+ return figure;
743
+ }
744
+ };
745
+ var readImageDataFromSelection = function (editor) {
746
+ var image = getSelectedImage(editor);
747
+ return image ? read(function (css) {
748
+ return normalizeCss(editor, css);
749
+ }, image) : defaultData();
750
+ };
751
+ var insertImageAtCaret = function (editor, data) {
752
+ var elm = create(function (css) {
753
+ return normalizeCss(editor, css);
754
+ }, data);
755
+ editor.dom.setAttrib(elm, 'data-mce-id', '__mcenew');
756
+ editor.focus();
757
+ editor.selection.setContent(elm.outerHTML);
758
+ var insertedElm = editor.dom.select('*[data-mce-id="__mcenew"]')[0];
759
+ editor.dom.setAttrib(insertedElm, 'data-mce-id', null);
760
+ if (isFigure(insertedElm)) {
761
+ var figure = splitTextBlock(editor, insertedElm);
762
+ editor.selection.select(figure);
763
+ } else {
764
+ editor.selection.select(insertedElm);
765
+ }
766
+ };
767
+ var syncSrcAttr = function (editor, image) {
768
+ editor.dom.setAttrib(image, 'src', image.getAttribute('src'));
769
+ };
770
+ var deleteImage = function (editor, image) {
771
+ if (image) {
772
+ var elm = editor.dom.is(image.parentNode, 'figure.image') ? image.parentNode : image;
773
+ editor.dom.remove(elm);
774
+ editor.focus();
775
+ editor.nodeChanged();
776
+ if (editor.dom.isEmpty(editor.getBody())) {
777
+ editor.setContent('');
778
+ editor.selection.setCursorLocation();
779
+ }
780
+ }
781
+ };
782
+ var writeImageDataToSelection = function (editor, data) {
783
+ var image = getSelectedImage(editor);
784
+ write(function (css) {
785
+ return normalizeCss(editor, css);
786
+ }, data, image);
787
+ syncSrcAttr(editor, image);
788
+ if (isFigure(image.parentNode)) {
789
+ var figure = image.parentNode;
790
+ splitTextBlock(editor, figure);
791
+ editor.selection.select(image.parentNode);
792
+ } else {
793
+ editor.selection.select(image);
794
+ waitLoadImage(editor, data, image);
795
+ }
796
+ };
797
+ var insertOrUpdateImage = function (editor, partialData) {
798
+ var image = getSelectedImage(editor);
799
+ if (image) {
800
+ var selectedImageData = read(function (css) {
801
+ return normalizeCss(editor, css);
802
+ }, image);
803
+ var data = __assign(__assign({}, selectedImageData), partialData);
804
+ if (data.src) {
805
+ writeImageDataToSelection(editor, data);
806
+ } else {
807
+ deleteImage(editor, image);
808
+ }
809
+ } else if (partialData.src) {
810
+ insertImageAtCaret(editor, __assign(__assign({}, defaultData()), partialData));
811
+ }
812
+ };
813
+
814
+ var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
815
+ var deep = function (old, nu) {
816
+ var bothObjects = isObject(old) && isObject(nu);
817
+ return bothObjects ? deepMerge(old, nu) : nu;
818
+ };
819
+ var baseMerge = function (merger) {
820
+ return function () {
821
+ var objects = [];
822
+ for (var _i = 0; _i < arguments.length; _i++) {
823
+ objects[_i] = arguments[_i];
824
+ }
825
+ if (objects.length === 0) {
826
+ throw new Error('Can\'t merge zero objects');
827
+ }
828
+ var ret = {};
829
+ for (var j = 0; j < objects.length; j++) {
830
+ var curObject = objects[j];
831
+ for (var key in curObject) {
832
+ if (hasOwnProperty$1.call(curObject, key)) {
833
+ ret[key] = merger(ret[key], curObject[key]);
834
+ }
835
+ }
836
+ }
837
+ return ret;
838
+ };
839
+ };
840
+ var deepMerge = baseMerge(deep);
841
+
842
+ var isNotEmpty = function (s) {
843
+ return s.length > 0;
844
+ };
845
+
846
+ var global$4 = tinymce.util.Tools.resolve('tinymce.util.ImageUploader');
847
+
848
+ var global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools');
849
+
850
+ var getValue = function (item) {
851
+ return isString(item.value) ? item.value : '';
852
+ };
853
+ var getText = function (item) {
854
+ if (isString(item.text)) {
855
+ return item.text;
856
+ } else if (isString(item.title)) {
857
+ return item.title;
858
+ } else {
859
+ return '';
860
+ }
861
+ };
862
+ var sanitizeList = function (list, extractValue) {
863
+ var out = [];
864
+ global$5.each(list, function (item) {
865
+ var text = getText(item);
866
+ if (item.menu !== undefined) {
867
+ var items = sanitizeList(item.menu, extractValue);
868
+ out.push({
869
+ text: text,
870
+ items: items
871
+ });
872
+ } else {
873
+ var value = extractValue(item);
874
+ out.push({
875
+ text: text,
876
+ value: value
877
+ });
878
+ }
879
+ });
880
+ return out;
881
+ };
882
+ var sanitizer = function (extracter) {
883
+ if (extracter === void 0) {
884
+ extracter = getValue;
885
+ }
886
+ return function (list) {
887
+ if (list) {
888
+ return Optional.from(list).map(function (list) {
889
+ return sanitizeList(list, extracter);
890
+ });
891
+ } else {
892
+ return Optional.none();
893
+ }
894
+ };
895
+ };
896
+ var sanitize = function (list) {
897
+ return sanitizer(getValue)(list);
898
+ };
899
+ var isGroup = function (item) {
900
+ return Object.prototype.hasOwnProperty.call(item, 'items');
901
+ };
902
+ var findEntryDelegate = function (list, value) {
903
+ return findMap(list, function (item) {
904
+ if (isGroup(item)) {
905
+ return findEntryDelegate(item.items, value);
906
+ } else if (item.value === value) {
907
+ return Optional.some(item);
908
+ } else {
909
+ return Optional.none();
910
+ }
911
+ });
912
+ };
913
+ var findEntry = function (optList, value) {
914
+ return optList.bind(function (list) {
915
+ return findEntryDelegate(list, value);
916
+ });
917
+ };
918
+ var ListUtils = {
919
+ sanitizer: sanitizer,
920
+ sanitize: sanitize,
921
+ findEntry: findEntry
922
+ };
923
+
924
+ var makeTab = function (_info) {
925
+ return {
926
+ title: 'Advanced',
927
+ name: 'advanced',
928
+ items: [
929
+ {
930
+ type: 'input',
931
+ label: 'Style',
932
+ name: 'style'
933
+ },
934
+ {
935
+ type: 'grid',
936
+ columns: 2,
937
+ items: [
938
+ {
939
+ type: 'input',
940
+ label: 'Vertical space',
941
+ name: 'vspace',
942
+ inputMode: 'numeric'
943
+ },
944
+ {
945
+ type: 'input',
946
+ label: 'Horizontal space',
947
+ name: 'hspace',
948
+ inputMode: 'numeric'
949
+ },
950
+ {
951
+ type: 'input',
952
+ label: 'Border width',
953
+ name: 'border',
954
+ inputMode: 'numeric'
955
+ },
956
+ {
957
+ type: 'listbox',
958
+ name: 'borderstyle',
959
+ label: 'Border style',
960
+ items: [
961
+ {
962
+ text: 'Select...',
963
+ value: ''
964
+ },
965
+ {
966
+ text: 'Solid',
967
+ value: 'solid'
968
+ },
969
+ {
970
+ text: 'Dotted',
971
+ value: 'dotted'
972
+ },
973
+ {
974
+ text: 'Dashed',
975
+ value: 'dashed'
976
+ },
977
+ {
978
+ text: 'Double',
979
+ value: 'double'
980
+ },
981
+ {
982
+ text: 'Groove',
983
+ value: 'groove'
984
+ },
985
+ {
986
+ text: 'Ridge',
987
+ value: 'ridge'
988
+ },
989
+ {
990
+ text: 'Inset',
991
+ value: 'inset'
992
+ },
993
+ {
994
+ text: 'Outset',
995
+ value: 'outset'
996
+ },
997
+ {
998
+ text: 'None',
999
+ value: 'none'
1000
+ },
1001
+ {
1002
+ text: 'Hidden',
1003
+ value: 'hidden'
1004
+ }
1005
+ ]
1006
+ }
1007
+ ]
1008
+ }
1009
+ ]
1010
+ };
1011
+ };
1012
+ var AdvTab = { makeTab: makeTab };
1013
+
1014
+ var collect = function (editor) {
1015
+ var urlListSanitizer = ListUtils.sanitizer(function (item) {
1016
+ return editor.convertURL(item.value || item.url, 'src');
1017
+ });
1018
+ var futureImageList = new global$2(function (completer) {
1019
+ createImageList(editor, function (imageList) {
1020
+ completer(urlListSanitizer(imageList).map(function (items) {
1021
+ return flatten([
1022
+ [{
1023
+ text: 'None',
1024
+ value: ''
1025
+ }],
1026
+ items
1027
+ ]);
1028
+ }));
1029
+ });
1030
+ });
1031
+ var classList = ListUtils.sanitize(getClassList(editor));
1032
+ var hasAdvTab$1 = hasAdvTab(editor);
1033
+ var hasUploadTab$1 = hasUploadTab(editor);
1034
+ var hasUploadUrl$1 = hasUploadUrl(editor);
1035
+ var hasUploadHandler$1 = hasUploadHandler(editor);
1036
+ var image = readImageDataFromSelection(editor);
1037
+ var hasDescription$1 = hasDescription(editor);
1038
+ var hasImageTitle$1 = hasImageTitle(editor);
1039
+ var hasDimensions$1 = hasDimensions(editor);
1040
+ var hasImageCaption$1 = hasImageCaption(editor);
1041
+ var hasAccessibilityOptions = showAccessibilityOptions(editor);
1042
+ var automaticUploads = isAutomaticUploadsEnabled(editor);
1043
+ var prependURL = Optional.some(getPrependUrl(editor)).filter(function (preUrl) {
1044
+ return isString(preUrl) && preUrl.length > 0;
1045
+ });
1046
+ return futureImageList.then(function (imageList) {
1047
+ return {
1048
+ image: image,
1049
+ imageList: imageList,
1050
+ classList: classList,
1051
+ hasAdvTab: hasAdvTab$1,
1052
+ hasUploadTab: hasUploadTab$1,
1053
+ hasUploadUrl: hasUploadUrl$1,
1054
+ hasUploadHandler: hasUploadHandler$1,
1055
+ hasDescription: hasDescription$1,
1056
+ hasImageTitle: hasImageTitle$1,
1057
+ hasDimensions: hasDimensions$1,
1058
+ hasImageCaption: hasImageCaption$1,
1059
+ prependURL: prependURL,
1060
+ hasAccessibilityOptions: hasAccessibilityOptions,
1061
+ automaticUploads: automaticUploads
1062
+ };
1063
+ });
1064
+ };
1065
+
1066
+ var makeItems = function (info) {
1067
+ var imageUrl = {
1068
+ name: 'src',
1069
+ type: 'urlinput',
1070
+ filetype: 'image',
1071
+ label: 'Source'
1072
+ };
1073
+ var imageList = info.imageList.map(function (items) {
1074
+ return {
1075
+ name: 'images',
1076
+ type: 'listbox',
1077
+ label: 'Image list',
1078
+ items: items
1079
+ };
1080
+ });
1081
+ var imageDescription = {
1082
+ name: 'alt',
1083
+ type: 'input',
1084
+ label: 'Alternative description',
1085
+ disabled: info.hasAccessibilityOptions && info.image.isDecorative
1086
+ };
1087
+ var imageTitle = {
1088
+ name: 'title',
1089
+ type: 'input',
1090
+ label: 'Image title'
1091
+ };
1092
+ var imageDimensions = {
1093
+ name: 'dimensions',
1094
+ type: 'sizeinput'
1095
+ };
1096
+ var isDecorative = {
1097
+ type: 'label',
1098
+ label: 'Accessibility',
1099
+ items: [{
1100
+ name: 'isDecorative',
1101
+ type: 'checkbox',
1102
+ label: 'Image is decorative'
1103
+ }]
1104
+ };
1105
+ var classList = info.classList.map(function (items) {
1106
+ return {
1107
+ name: 'classes',
1108
+ type: 'listbox',
1109
+ label: 'Class',
1110
+ items: items
1111
+ };
1112
+ });
1113
+ var caption = {
1114
+ type: 'label',
1115
+ label: 'Caption',
1116
+ items: [{
1117
+ type: 'checkbox',
1118
+ name: 'caption',
1119
+ label: 'Show caption'
1120
+ }]
1121
+ };
1122
+ var getDialogContainerType = function (useColumns) {
1123
+ return useColumns ? {
1124
+ type: 'grid',
1125
+ columns: 2
1126
+ } : { type: 'panel' };
1127
+ };
1128
+ return flatten([
1129
+ [imageUrl],
1130
+ imageList.toArray(),
1131
+ info.hasAccessibilityOptions && info.hasDescription ? [isDecorative] : [],
1132
+ info.hasDescription ? [imageDescription] : [],
1133
+ info.hasImageTitle ? [imageTitle] : [],
1134
+ info.hasDimensions ? [imageDimensions] : [],
1135
+ [__assign(__assign({}, getDialogContainerType(info.classList.isSome() && info.hasImageCaption)), {
1136
+ items: flatten([
1137
+ classList.toArray(),
1138
+ info.hasImageCaption ? [caption] : []
1139
+ ])
1140
+ })]
1141
+ ]);
1142
+ };
1143
+ var makeTab$1 = function (info) {
1144
+ return {
1145
+ title: 'General',
1146
+ name: 'general',
1147
+ items: makeItems(info)
1148
+ };
1149
+ };
1150
+ var MainTab = {
1151
+ makeTab: makeTab$1,
1152
+ makeItems: makeItems
1153
+ };
1154
+
1155
+ var makeTab$2 = function (_info) {
1156
+ var items = [{
1157
+ type: 'dropzone',
1158
+ name: 'fileinput'
1159
+ }];
1160
+ return {
1161
+ title: 'Upload',
1162
+ name: 'upload',
1163
+ items: items
1164
+ };
1165
+ };
1166
+ var UploadTab = { makeTab: makeTab$2 };
1167
+
1168
+ var createState = function (info) {
1169
+ return {
1170
+ prevImage: ListUtils.findEntry(info.imageList, info.image.src),
1171
+ prevAlt: info.image.alt,
1172
+ open: true
1173
+ };
1174
+ };
1175
+ var fromImageData = function (image) {
1176
+ return {
1177
+ src: {
1178
+ value: image.src,
1179
+ meta: {}
1180
+ },
1181
+ images: image.src,
1182
+ alt: image.alt,
1183
+ title: image.title,
1184
+ dimensions: {
1185
+ width: image.width,
1186
+ height: image.height
1187
+ },
1188
+ classes: image.class,
1189
+ caption: image.caption,
1190
+ style: image.style,
1191
+ vspace: image.vspace,
1192
+ border: image.border,
1193
+ hspace: image.hspace,
1194
+ borderstyle: image.borderStyle,
1195
+ fileinput: [],
1196
+ isDecorative: image.isDecorative
1197
+ };
1198
+ };
1199
+ var toImageData = function (data, removeEmptyAlt) {
1200
+ return {
1201
+ src: data.src.value,
1202
+ alt: data.alt.length === 0 && removeEmptyAlt ? null : data.alt,
1203
+ title: data.title,
1204
+ width: data.dimensions.width,
1205
+ height: data.dimensions.height,
1206
+ class: data.classes,
1207
+ style: data.style,
1208
+ caption: data.caption,
1209
+ hspace: data.hspace,
1210
+ vspace: data.vspace,
1211
+ border: data.border,
1212
+ borderStyle: data.borderstyle,
1213
+ isDecorative: data.isDecorative
1214
+ };
1215
+ };
1216
+ var addPrependUrl2 = function (info, srcURL) {
1217
+ if (!/^(?:[a-zA-Z]+:)?\/\//.test(srcURL)) {
1218
+ return info.prependURL.bind(function (prependUrl) {
1219
+ if (srcURL.substring(0, prependUrl.length) !== prependUrl) {
1220
+ return Optional.some(prependUrl + srcURL);
1221
+ }
1222
+ return Optional.none();
1223
+ });
1224
+ }
1225
+ return Optional.none();
1226
+ };
1227
+ var addPrependUrl = function (info, api) {
1228
+ var data = api.getData();
1229
+ addPrependUrl2(info, data.src.value).each(function (srcURL) {
1230
+ api.setData({
1231
+ src: {
1232
+ value: srcURL,
1233
+ meta: data.src.meta
1234
+ }
1235
+ });
1236
+ });
1237
+ };
1238
+ var formFillFromMeta2 = function (info, data, meta) {
1239
+ if (info.hasDescription && isString(meta.alt)) {
1240
+ data.alt = meta.alt;
1241
+ }
1242
+ if (info.hasAccessibilityOptions) {
1243
+ data.isDecorative = meta.isDecorative || data.isDecorative || false;
1244
+ }
1245
+ if (info.hasImageTitle && isString(meta.title)) {
1246
+ data.title = meta.title;
1247
+ }
1248
+ if (info.hasDimensions) {
1249
+ if (isString(meta.width)) {
1250
+ data.dimensions.width = meta.width;
1251
+ }
1252
+ if (isString(meta.height)) {
1253
+ data.dimensions.height = meta.height;
1254
+ }
1255
+ }
1256
+ if (isString(meta.class)) {
1257
+ ListUtils.findEntry(info.classList, meta.class).each(function (entry) {
1258
+ data.classes = entry.value;
1259
+ });
1260
+ }
1261
+ if (info.hasImageCaption) {
1262
+ if (isBoolean(meta.caption)) {
1263
+ data.caption = meta.caption;
1264
+ }
1265
+ }
1266
+ if (info.hasAdvTab) {
1267
+ if (isString(meta.style)) {
1268
+ data.style = meta.style;
1269
+ }
1270
+ if (isString(meta.vspace)) {
1271
+ data.vspace = meta.vspace;
1272
+ }
1273
+ if (isString(meta.border)) {
1274
+ data.border = meta.border;
1275
+ }
1276
+ if (isString(meta.hspace)) {
1277
+ data.hspace = meta.hspace;
1278
+ }
1279
+ if (isString(meta.borderstyle)) {
1280
+ data.borderstyle = meta.borderstyle;
1281
+ }
1282
+ }
1283
+ };
1284
+ var formFillFromMeta = function (info, api) {
1285
+ var data = api.getData();
1286
+ var meta = data.src.meta;
1287
+ if (meta !== undefined) {
1288
+ var newData = deepMerge({}, data);
1289
+ formFillFromMeta2(info, newData, meta);
1290
+ api.setData(newData);
1291
+ }
1292
+ };
1293
+ var calculateImageSize = function (helpers, info, state, api) {
1294
+ var data = api.getData();
1295
+ var url = data.src.value;
1296
+ var meta = data.src.meta || {};
1297
+ if (!meta.width && !meta.height && info.hasDimensions) {
1298
+ if (isNotEmpty(url)) {
1299
+ helpers.imageSize(url).then(function (size) {
1300
+ if (state.open) {
1301
+ api.setData({ dimensions: size });
1302
+ }
1303
+ }).catch(function (e) {
1304
+ return console.error(e);
1305
+ });
1306
+ } else {
1307
+ api.setData({
1308
+ dimensions: {
1309
+ width: '',
1310
+ height: ''
1311
+ }
1312
+ });
1313
+ }
1314
+ }
1315
+ };
1316
+ var updateImagesDropdown = function (info, state, api) {
1317
+ var data = api.getData();
1318
+ var image = ListUtils.findEntry(info.imageList, data.src.value);
1319
+ state.prevImage = image;
1320
+ api.setData({
1321
+ images: image.map(function (entry) {
1322
+ return entry.value;
1323
+ }).getOr('')
1324
+ });
1325
+ };
1326
+ var changeSrc = function (helpers, info, state, api) {
1327
+ addPrependUrl(info, api);
1328
+ formFillFromMeta(info, api);
1329
+ calculateImageSize(helpers, info, state, api);
1330
+ updateImagesDropdown(info, state, api);
1331
+ };
1332
+ var changeImages = function (helpers, info, state, api) {
1333
+ var data = api.getData();
1334
+ var image = ListUtils.findEntry(info.imageList, data.images);
1335
+ image.each(function (img) {
1336
+ var updateAlt = data.alt === '' || state.prevImage.map(function (image) {
1337
+ return image.text === data.alt;
1338
+ }).getOr(false);
1339
+ if (updateAlt) {
1340
+ if (img.value === '') {
1341
+ api.setData({
1342
+ src: img,
1343
+ alt: state.prevAlt
1344
+ });
1345
+ } else {
1346
+ api.setData({
1347
+ src: img,
1348
+ alt: img.text
1349
+ });
1350
+ }
1351
+ } else {
1352
+ api.setData({ src: img });
1353
+ }
1354
+ });
1355
+ state.prevImage = image;
1356
+ changeSrc(helpers, info, state, api);
1357
+ };
1358
+ var calcVSpace = function (css) {
1359
+ var matchingTopBottom = css['margin-top'] && css['margin-bottom'] && css['margin-top'] === css['margin-bottom'];
1360
+ return matchingTopBottom ? removePixelSuffix(String(css['margin-top'])) : '';
1361
+ };
1362
+ var calcHSpace = function (css) {
1363
+ var matchingLeftRight = css['margin-right'] && css['margin-left'] && css['margin-right'] === css['margin-left'];
1364
+ return matchingLeftRight ? removePixelSuffix(String(css['margin-right'])) : '';
1365
+ };
1366
+ var calcBorderWidth = function (css) {
1367
+ return css['border-width'] ? removePixelSuffix(String(css['border-width'])) : '';
1368
+ };
1369
+ var calcBorderStyle = function (css) {
1370
+ return css['border-style'] ? String(css['border-style']) : '';
1371
+ };
1372
+ var calcStyle = function (parseStyle, serializeStyle, css) {
1373
+ return serializeStyle(parseStyle(serializeStyle(css)));
1374
+ };
1375
+ var changeStyle2 = function (parseStyle, serializeStyle, data) {
1376
+ var css = mergeMargins(parseStyle(data.style));
1377
+ var dataCopy = deepMerge({}, data);
1378
+ dataCopy.vspace = calcVSpace(css);
1379
+ dataCopy.hspace = calcHSpace(css);
1380
+ dataCopy.border = calcBorderWidth(css);
1381
+ dataCopy.borderstyle = calcBorderStyle(css);
1382
+ dataCopy.style = calcStyle(parseStyle, serializeStyle, css);
1383
+ return dataCopy;
1384
+ };
1385
+ var changeStyle = function (helpers, api) {
1386
+ var data = api.getData();
1387
+ var newData = changeStyle2(helpers.parseStyle, helpers.serializeStyle, data);
1388
+ api.setData(newData);
1389
+ };
1390
+ var changeAStyle = function (helpers, info, api) {
1391
+ var data = deepMerge(fromImageData(info.image), api.getData());
1392
+ var style = getStyleValue(helpers.normalizeCss, toImageData(data, false));
1393
+ api.setData({ style: style });
1394
+ };
1395
+ var changeFileInput = function (helpers, info, state, api) {
1396
+ var data = api.getData();
1397
+ api.block('Uploading image');
1398
+ head(data.fileinput).fold(function () {
1399
+ api.unblock();
1400
+ }, function (file) {
1401
+ var blobUri = URL.createObjectURL(file);
1402
+ var finalize = function () {
1403
+ api.unblock();
1404
+ URL.revokeObjectURL(blobUri);
1405
+ };
1406
+ var updateSrcAndSwitchTab = function (url) {
1407
+ api.setData({
1408
+ src: {
1409
+ value: url,
1410
+ meta: {}
1411
+ }
1412
+ });
1413
+ api.showTab('general');
1414
+ changeSrc(helpers, info, state, api);
1415
+ };
1416
+ blobToDataUri(file).then(function (dataUrl) {
1417
+ var blobInfo = helpers.createBlobCache(file, blobUri, dataUrl);
1418
+ if (info.automaticUploads) {
1419
+ helpers.uploadImage(blobInfo).then(function (result) {
1420
+ updateSrcAndSwitchTab(result.url);
1421
+ finalize();
1422
+ }).catch(function (err) {
1423
+ finalize();
1424
+ helpers.alertErr(err);
1425
+ });
1426
+ } else {
1427
+ helpers.addToBlobCache(blobInfo);
1428
+ updateSrcAndSwitchTab(blobInfo.blobUri());
1429
+ api.unblock();
1430
+ }
1431
+ });
1432
+ });
1433
+ };
1434
+ var changeHandler = function (helpers, info, state) {
1435
+ return function (api, evt) {
1436
+ if (evt.name === 'src') {
1437
+ changeSrc(helpers, info, state, api);
1438
+ } else if (evt.name === 'images') {
1439
+ changeImages(helpers, info, state, api);
1440
+ } else if (evt.name === 'alt') {
1441
+ state.prevAlt = api.getData().alt;
1442
+ } else if (evt.name === 'style') {
1443
+ changeStyle(helpers, api);
1444
+ } else if (evt.name === 'vspace' || evt.name === 'hspace' || evt.name === 'border' || evt.name === 'borderstyle') {
1445
+ changeAStyle(helpers, info, api);
1446
+ } else if (evt.name === 'fileinput') {
1447
+ changeFileInput(helpers, info, state, api);
1448
+ } else if (evt.name === 'isDecorative') {
1449
+ if (api.getData().isDecorative) {
1450
+ api.disable('alt');
1451
+ } else {
1452
+ api.enable('alt');
1453
+ }
1454
+ }
1455
+ };
1456
+ };
1457
+ var closeHandler = function (state) {
1458
+ return function () {
1459
+ state.open = false;
1460
+ };
1461
+ };
1462
+ var makeDialogBody = function (info) {
1463
+ if (info.hasAdvTab || info.hasUploadUrl || info.hasUploadHandler) {
1464
+ var tabPanel = {
1465
+ type: 'tabpanel',
1466
+ tabs: flatten([
1467
+ [MainTab.makeTab(info)],
1468
+ info.hasAdvTab ? [AdvTab.makeTab(info)] : [],
1469
+ info.hasUploadTab && (info.hasUploadUrl || info.hasUploadHandler) ? [UploadTab.makeTab(info)] : []
1470
+ ])
1471
+ };
1472
+ return tabPanel;
1473
+ } else {
1474
+ var panel = {
1475
+ type: 'panel',
1476
+ items: MainTab.makeItems(info)
1477
+ };
1478
+ return panel;
1479
+ }
1480
+ };
1481
+ var makeDialog = function (helpers) {
1482
+ return function (info) {
1483
+ var state = createState(info);
1484
+ return {
1485
+ title: 'Insert/Edit Image',
1486
+ size: 'normal',
1487
+ body: makeDialogBody(info),
1488
+ buttons: [
1489
+ {
1490
+ type: 'cancel',
1491
+ name: 'cancel',
1492
+ text: 'Cancel'
1493
+ },
1494
+ {
1495
+ type: 'submit',
1496
+ name: 'save',
1497
+ text: 'Save',
1498
+ primary: true
1499
+ }
1500
+ ],
1501
+ initialData: fromImageData(info.image),
1502
+ onSubmit: helpers.onSubmit(info),
1503
+ onChange: changeHandler(helpers, info, state),
1504
+ onClose: closeHandler(state)
1505
+ };
1506
+ };
1507
+ };
1508
+ var submitHandler = function (editor) {
1509
+ return function (info) {
1510
+ return function (api) {
1511
+ var data = deepMerge(fromImageData(info.image), api.getData());
1512
+ editor.execCommand('mceUpdateImage', false, toImageData(data, info.hasAccessibilityOptions));
1513
+ editor.editorUpload.uploadImagesAuto();
1514
+ api.close();
1515
+ };
1516
+ };
1517
+ };
1518
+ var imageSize = function (editor) {
1519
+ return function (url) {
1520
+ return getImageSize(editor.documentBaseURI.toAbsolute(url)).then(function (dimensions) {
1521
+ return {
1522
+ width: String(dimensions.width),
1523
+ height: String(dimensions.height)
1524
+ };
1525
+ });
1526
+ };
1527
+ };
1528
+ var createBlobCache = function (editor) {
1529
+ return function (file, blobUri, dataUrl) {
1530
+ return editor.editorUpload.blobCache.create({
1531
+ blob: file,
1532
+ blobUri: blobUri,
1533
+ name: file.name ? file.name.replace(/\.[^\.]+$/, '') : null,
1534
+ filename: file.name,
1535
+ base64: dataUrl.split(',')[1]
1536
+ });
1537
+ };
1538
+ };
1539
+ var addToBlobCache = function (editor) {
1540
+ return function (blobInfo) {
1541
+ editor.editorUpload.blobCache.add(blobInfo);
1542
+ };
1543
+ };
1544
+ var alertErr = function (editor) {
1545
+ return function (message) {
1546
+ editor.windowManager.alert(message);
1547
+ };
1548
+ };
1549
+ var normalizeCss$1 = function (editor) {
1550
+ return function (cssText) {
1551
+ return normalizeCss(editor, cssText);
1552
+ };
1553
+ };
1554
+ var parseStyle = function (editor) {
1555
+ return function (cssText) {
1556
+ return editor.dom.parseStyle(cssText);
1557
+ };
1558
+ };
1559
+ var serializeStyle = function (editor) {
1560
+ return function (stylesArg, name) {
1561
+ return editor.dom.serializeStyle(stylesArg, name);
1562
+ };
1563
+ };
1564
+ var uploadImage = function (editor) {
1565
+ return function (blobInfo) {
1566
+ return global$4(editor).upload([blobInfo], false).then(function (results) {
1567
+ if (results.length === 0) {
1568
+ return global$2.reject('Failed to upload image');
1569
+ } else if (results[0].status === false) {
1570
+ return global$2.reject(results[0].error.message);
1571
+ } else {
1572
+ return results[0];
1573
+ }
1574
+ });
1575
+ };
1576
+ };
1577
+ var Dialog = function (editor) {
1578
+ var helpers = {
1579
+ onSubmit: submitHandler(editor),
1580
+ imageSize: imageSize(editor),
1581
+ addToBlobCache: addToBlobCache(editor),
1582
+ createBlobCache: createBlobCache(editor),
1583
+ alertErr: alertErr(editor),
1584
+ normalizeCss: normalizeCss$1(editor),
1585
+ parseStyle: parseStyle(editor),
1586
+ serializeStyle: serializeStyle(editor),
1587
+ uploadImage: uploadImage(editor)
1588
+ };
1589
+ var open = function () {
1590
+ collect(editor).then(makeDialog(helpers)).then(editor.windowManager.open);
1591
+ };
1592
+ return { open: open };
1593
+ };
1594
+
1595
+ var register = function (editor) {
1596
+ editor.addCommand('mceImage', Dialog(editor).open);
1597
+ editor.addCommand('mceUpdateImage', function (_ui, data) {
1598
+ editor.undoManager.transact(function () {
1599
+ return insertOrUpdateImage(editor, data);
1600
+ });
1601
+ });
1602
+ };
1603
+
1604
+ var hasImageClass = function (node) {
1605
+ var className = node.attr('class');
1606
+ return className && /\bimage\b/.test(className);
1607
+ };
1608
+ var toggleContentEditableState = function (state) {
1609
+ return function (nodes) {
1610
+ var i = nodes.length;
1611
+ var toggleContentEditable = function (node) {
1612
+ node.attr('contenteditable', state ? 'true' : null);
1613
+ };
1614
+ while (i--) {
1615
+ var node = nodes[i];
1616
+ if (hasImageClass(node)) {
1617
+ node.attr('contenteditable', state ? 'false' : null);
1618
+ global$5.each(node.getAll('figcaption'), toggleContentEditable);
1619
+ }
1620
+ }
1621
+ };
1622
+ };
1623
+ var setup = function (editor) {
1624
+ editor.on('PreInit', function () {
1625
+ editor.parser.addNodeFilter('figure', toggleContentEditableState(true));
1626
+ editor.serializer.addNodeFilter('figure', toggleContentEditableState(false));
1627
+ });
1628
+ };
1629
+
1630
+ var register$1 = function (editor) {
1631
+ editor.ui.registry.addToggleButton('image', {
1632
+ icon: 'image',
1633
+ tooltip: 'Insert/edit image',
1634
+ onAction: Dialog(editor).open,
1635
+ onSetup: function (buttonApi) {
1636
+ return editor.selection.selectorChangedWithUnbind('img:not([data-mce-object],[data-mce-placeholder]),figure.image', buttonApi.setActive).unbind;
1637
+ }
1638
+ });
1639
+ editor.ui.registry.addMenuItem('image', {
1640
+ icon: 'image',
1641
+ text: 'Image...',
1642
+ onAction: Dialog(editor).open
1643
+ });
1644
+ editor.ui.registry.addContextMenu('image', {
1645
+ update: function (element) {
1646
+ return isFigure(element) || isImage(element) && !isPlaceholderImage(element) ? ['image'] : [];
1647
+ }
1648
+ });
1649
+ };
1650
+
1651
+ function Plugin () {
1652
+ global.add('image', function (editor) {
1653
+ setup(editor);
1654
+ register$1(editor);
1655
+ register(editor);
1656
+ });
1657
+ }
1658
+
1659
+ Plugin();
1660
+
1661
+ }());