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