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,1287 @@
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 global$1 = tinymce.util.Tools.resolve('tinymce.util.VK');
15
+
16
+ var typeOf = function (x) {
17
+ var t = typeof x;
18
+ if (x === null) {
19
+ return 'null';
20
+ } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
21
+ return 'array';
22
+ } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
23
+ return 'string';
24
+ } else {
25
+ return t;
26
+ }
27
+ };
28
+ var isType = function (type) {
29
+ return function (value) {
30
+ return typeOf(value) === type;
31
+ };
32
+ };
33
+ var isSimpleType = function (type) {
34
+ return function (value) {
35
+ return typeof value === type;
36
+ };
37
+ };
38
+ var eq = function (t) {
39
+ return function (a) {
40
+ return t === a;
41
+ };
42
+ };
43
+ var isString = isType('string');
44
+ var isArray = isType('array');
45
+ var isNull = eq(null);
46
+ var isBoolean = isSimpleType('boolean');
47
+ var isFunction = isSimpleType('function');
48
+
49
+ var assumeExternalTargets = function (editor) {
50
+ var externalTargets = editor.getParam('link_assume_external_targets', false);
51
+ if (isBoolean(externalTargets) && externalTargets) {
52
+ return 1;
53
+ } else if (isString(externalTargets) && (externalTargets === 'http' || externalTargets === 'https')) {
54
+ return externalTargets;
55
+ }
56
+ return 0;
57
+ };
58
+ var hasContextToolbar = function (editor) {
59
+ return editor.getParam('link_context_toolbar', false, 'boolean');
60
+ };
61
+ var getLinkList = function (editor) {
62
+ return editor.getParam('link_list');
63
+ };
64
+ var getDefaultLinkTarget = function (editor) {
65
+ return editor.getParam('default_link_target');
66
+ };
67
+ var getTargetList = function (editor) {
68
+ return editor.getParam('target_list', true);
69
+ };
70
+ var getRelList = function (editor) {
71
+ return editor.getParam('rel_list', [], 'array');
72
+ };
73
+ var getLinkClassList = function (editor) {
74
+ return editor.getParam('link_class_list', [], 'array');
75
+ };
76
+ var shouldShowLinkTitle = function (editor) {
77
+ return editor.getParam('link_title', true, 'boolean');
78
+ };
79
+ var allowUnsafeLinkTarget = function (editor) {
80
+ return editor.getParam('allow_unsafe_link_target', false, 'boolean');
81
+ };
82
+ var useQuickLink = function (editor) {
83
+ return editor.getParam('link_quicklink', false, 'boolean');
84
+ };
85
+ var getDefaultLinkProtocol = function (editor) {
86
+ return editor.getParam('link_default_protocol', 'http', 'string');
87
+ };
88
+
89
+ var noop = function () {
90
+ };
91
+ var constant = function (value) {
92
+ return function () {
93
+ return value;
94
+ };
95
+ };
96
+ var never = constant(false);
97
+ var always = constant(true);
98
+
99
+ var none = function () {
100
+ return NONE;
101
+ };
102
+ var NONE = function () {
103
+ var eq = function (o) {
104
+ return o.isNone();
105
+ };
106
+ var call = function (thunk) {
107
+ return thunk();
108
+ };
109
+ var id = function (n) {
110
+ return n;
111
+ };
112
+ var me = {
113
+ fold: function (n, _s) {
114
+ return n();
115
+ },
116
+ is: never,
117
+ isSome: never,
118
+ isNone: always,
119
+ getOr: id,
120
+ getOrThunk: call,
121
+ getOrDie: function (msg) {
122
+ throw new Error(msg || 'error: getOrDie called on none.');
123
+ },
124
+ getOrNull: constant(null),
125
+ getOrUndefined: constant(undefined),
126
+ or: id,
127
+ orThunk: call,
128
+ map: none,
129
+ each: noop,
130
+ bind: none,
131
+ exists: never,
132
+ forall: always,
133
+ filter: none,
134
+ equals: eq,
135
+ equals_: eq,
136
+ toArray: function () {
137
+ return [];
138
+ },
139
+ toString: constant('none()')
140
+ };
141
+ return me;
142
+ }();
143
+ var some = function (a) {
144
+ var constant_a = constant(a);
145
+ var self = function () {
146
+ return me;
147
+ };
148
+ var bind = function (f) {
149
+ return f(a);
150
+ };
151
+ var me = {
152
+ fold: function (n, s) {
153
+ return s(a);
154
+ },
155
+ is: function (v) {
156
+ return a === v;
157
+ },
158
+ isSome: always,
159
+ isNone: never,
160
+ getOr: constant_a,
161
+ getOrThunk: constant_a,
162
+ getOrDie: constant_a,
163
+ getOrNull: constant_a,
164
+ getOrUndefined: constant_a,
165
+ or: self,
166
+ orThunk: self,
167
+ map: function (f) {
168
+ return some(f(a));
169
+ },
170
+ each: function (f) {
171
+ f(a);
172
+ },
173
+ bind: bind,
174
+ exists: bind,
175
+ forall: bind,
176
+ filter: function (f) {
177
+ return f(a) ? me : NONE;
178
+ },
179
+ toArray: function () {
180
+ return [a];
181
+ },
182
+ toString: function () {
183
+ return 'some(' + a + ')';
184
+ },
185
+ equals: function (o) {
186
+ return o.is(a);
187
+ },
188
+ equals_: function (o, elementEq) {
189
+ return o.fold(never, function (b) {
190
+ return elementEq(a, b);
191
+ });
192
+ }
193
+ };
194
+ return me;
195
+ };
196
+ var from = function (value) {
197
+ return value === null || value === undefined ? NONE : some(value);
198
+ };
199
+ var Optional = {
200
+ some: some,
201
+ none: none,
202
+ from: from
203
+ };
204
+
205
+ var nativeIndexOf = Array.prototype.indexOf;
206
+ var nativePush = Array.prototype.push;
207
+ var rawIndexOf = function (ts, t) {
208
+ return nativeIndexOf.call(ts, t);
209
+ };
210
+ var contains = function (xs, x) {
211
+ return rawIndexOf(xs, x) > -1;
212
+ };
213
+ var map = function (xs, f) {
214
+ var len = xs.length;
215
+ var r = new Array(len);
216
+ for (var i = 0; i < len; i++) {
217
+ var x = xs[i];
218
+ r[i] = f(x, i);
219
+ }
220
+ return r;
221
+ };
222
+ var each = function (xs, f) {
223
+ for (var i = 0, len = xs.length; i < len; i++) {
224
+ var x = xs[i];
225
+ f(x, i);
226
+ }
227
+ };
228
+ var foldl = function (xs, f, acc) {
229
+ each(xs, function (x) {
230
+ acc = f(acc, x);
231
+ });
232
+ return acc;
233
+ };
234
+ var flatten = function (xs) {
235
+ var r = [];
236
+ for (var i = 0, len = xs.length; i < len; ++i) {
237
+ if (!isArray(xs[i])) {
238
+ throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
239
+ }
240
+ nativePush.apply(r, xs[i]);
241
+ }
242
+ return r;
243
+ };
244
+ var bind = function (xs, f) {
245
+ return flatten(map(xs, f));
246
+ };
247
+ var findMap = function (arr, f) {
248
+ for (var i = 0; i < arr.length; i++) {
249
+ var r = f(arr[i], i);
250
+ if (r.isSome()) {
251
+ return r;
252
+ }
253
+ }
254
+ return Optional.none();
255
+ };
256
+
257
+ var cat = function (arr) {
258
+ var r = [];
259
+ var push = function (x) {
260
+ r.push(x);
261
+ };
262
+ for (var i = 0; i < arr.length; i++) {
263
+ arr[i].each(push);
264
+ }
265
+ return r;
266
+ };
267
+ var someIf = function (b, a) {
268
+ return b ? Optional.some(a) : Optional.none();
269
+ };
270
+
271
+ var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools');
272
+
273
+ var getValue = function (item) {
274
+ return isString(item.value) ? item.value : '';
275
+ };
276
+ var getText = function (item) {
277
+ if (isString(item.text)) {
278
+ return item.text;
279
+ } else if (isString(item.title)) {
280
+ return item.title;
281
+ } else {
282
+ return '';
283
+ }
284
+ };
285
+ var sanitizeList = function (list, extractValue) {
286
+ var out = [];
287
+ global$2.each(list, function (item) {
288
+ var text = getText(item);
289
+ if (item.menu !== undefined) {
290
+ var items = sanitizeList(item.menu, extractValue);
291
+ out.push({
292
+ text: text,
293
+ items: items
294
+ });
295
+ } else {
296
+ var value = extractValue(item);
297
+ out.push({
298
+ text: text,
299
+ value: value
300
+ });
301
+ }
302
+ });
303
+ return out;
304
+ };
305
+ var sanitizeWith = function (extracter) {
306
+ if (extracter === void 0) {
307
+ extracter = getValue;
308
+ }
309
+ return function (list) {
310
+ return Optional.from(list).map(function (list) {
311
+ return sanitizeList(list, extracter);
312
+ });
313
+ };
314
+ };
315
+ var sanitize = function (list) {
316
+ return sanitizeWith(getValue)(list);
317
+ };
318
+ var createUi = function (name, label) {
319
+ return function (items) {
320
+ return {
321
+ name: name,
322
+ type: 'listbox',
323
+ label: label,
324
+ items: items
325
+ };
326
+ };
327
+ };
328
+ var ListOptions = {
329
+ sanitize: sanitize,
330
+ sanitizeWith: sanitizeWith,
331
+ createUi: createUi,
332
+ getValue: getValue
333
+ };
334
+
335
+ var __assign = function () {
336
+ __assign = Object.assign || function __assign(t) {
337
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
338
+ s = arguments[i];
339
+ for (var p in s)
340
+ if (Object.prototype.hasOwnProperty.call(s, p))
341
+ t[p] = s[p];
342
+ }
343
+ return t;
344
+ };
345
+ return __assign.apply(this, arguments);
346
+ };
347
+
348
+ var keys = Object.keys;
349
+ var hasOwnProperty = Object.hasOwnProperty;
350
+ var each$1 = function (obj, f) {
351
+ var props = keys(obj);
352
+ for (var k = 0, len = props.length; k < len; k++) {
353
+ var i = props[k];
354
+ var x = obj[i];
355
+ f(x, i);
356
+ }
357
+ };
358
+ var objAcc = function (r) {
359
+ return function (x, i) {
360
+ r[i] = x;
361
+ };
362
+ };
363
+ var internalFilter = function (obj, pred, onTrue, onFalse) {
364
+ var r = {};
365
+ each$1(obj, function (x, i) {
366
+ (pred(x, i) ? onTrue : onFalse)(x, i);
367
+ });
368
+ return r;
369
+ };
370
+ var filter = function (obj, pred) {
371
+ var t = {};
372
+ internalFilter(obj, pred, objAcc(t), noop);
373
+ return t;
374
+ };
375
+ var has = function (obj, key) {
376
+ return hasOwnProperty.call(obj, key);
377
+ };
378
+ var hasNonNullableKey = function (obj, key) {
379
+ return has(obj, key) && obj[key] !== undefined && obj[key] !== null;
380
+ };
381
+
382
+ var global$3 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker');
383
+
384
+ var isAnchor = function (elm) {
385
+ return elm && elm.nodeName.toLowerCase() === 'a';
386
+ };
387
+ var isLink = function (elm) {
388
+ return isAnchor(elm) && !!getHref(elm);
389
+ };
390
+ var collectNodesInRange = function (rng, predicate) {
391
+ if (rng.collapsed) {
392
+ return [];
393
+ } else {
394
+ var contents = rng.cloneContents();
395
+ var walker = new global$3(contents.firstChild, contents);
396
+ var elements = [];
397
+ var current = contents.firstChild;
398
+ do {
399
+ if (predicate(current)) {
400
+ elements.push(current);
401
+ }
402
+ } while (current = walker.next());
403
+ return elements;
404
+ }
405
+ };
406
+ var hasProtocol = function (url) {
407
+ return /^\w+:/i.test(url);
408
+ };
409
+ var getHref = function (elm) {
410
+ var href = elm.getAttribute('data-mce-href');
411
+ return href ? href : elm.getAttribute('href');
412
+ };
413
+ var applyRelTargetRules = function (rel, isUnsafe) {
414
+ var rules = ['noopener'];
415
+ var rels = rel ? rel.split(/\s+/) : [];
416
+ var toString = function (rels) {
417
+ return global$2.trim(rels.sort().join(' '));
418
+ };
419
+ var addTargetRules = function (rels) {
420
+ rels = removeTargetRules(rels);
421
+ return rels.length > 0 ? rels.concat(rules) : rules;
422
+ };
423
+ var removeTargetRules = function (rels) {
424
+ return rels.filter(function (val) {
425
+ return global$2.inArray(rules, val) === -1;
426
+ });
427
+ };
428
+ var newRels = isUnsafe ? addTargetRules(rels) : removeTargetRules(rels);
429
+ return newRels.length > 0 ? toString(newRels) : '';
430
+ };
431
+ var trimCaretContainers = function (text) {
432
+ return text.replace(/\uFEFF/g, '');
433
+ };
434
+ var getAnchorElement = function (editor, selectedElm) {
435
+ selectedElm = selectedElm || editor.selection.getNode();
436
+ if (isImageFigure(selectedElm)) {
437
+ return editor.dom.select('a[href]', selectedElm)[0];
438
+ } else {
439
+ return editor.dom.getParent(selectedElm, 'a[href]');
440
+ }
441
+ };
442
+ var getAnchorText = function (selection, anchorElm) {
443
+ var text = anchorElm ? anchorElm.innerText || anchorElm.textContent : selection.getContent({ format: 'text' });
444
+ return trimCaretContainers(text);
445
+ };
446
+ var hasLinks = function (elements) {
447
+ return global$2.grep(elements, isLink).length > 0;
448
+ };
449
+ var hasLinksInSelection = function (rng) {
450
+ return collectNodesInRange(rng, isLink).length > 0;
451
+ };
452
+ var isOnlyTextSelected = function (editor) {
453
+ var inlineTextElements = editor.schema.getTextInlineElements();
454
+ var isElement = function (elm) {
455
+ return elm.nodeType === 1 && !isAnchor(elm) && !has(inlineTextElements, elm.nodeName.toLowerCase());
456
+ };
457
+ var elements = collectNodesInRange(editor.selection.getRng(), isElement);
458
+ return elements.length === 0;
459
+ };
460
+ var isImageFigure = function (elm) {
461
+ return elm && elm.nodeName === 'FIGURE' && /\bimage\b/i.test(elm.className);
462
+ };
463
+ var getLinkAttrs = function (data) {
464
+ return foldl([
465
+ 'title',
466
+ 'rel',
467
+ 'class',
468
+ 'target'
469
+ ], function (acc, key) {
470
+ data[key].each(function (value) {
471
+ acc[key] = value.length > 0 ? value : null;
472
+ });
473
+ return acc;
474
+ }, { href: data.href });
475
+ };
476
+ var handleExternalTargets = function (href, assumeExternalTargets) {
477
+ if ((assumeExternalTargets === 'http' || assumeExternalTargets === 'https') && !hasProtocol(href)) {
478
+ return assumeExternalTargets + '://' + href;
479
+ }
480
+ return href;
481
+ };
482
+ var applyLinkOverrides = function (editor, linkAttrs) {
483
+ var newLinkAttrs = __assign({}, linkAttrs);
484
+ if (!(getRelList(editor).length > 0) && allowUnsafeLinkTarget(editor) === false) {
485
+ var newRel = applyRelTargetRules(newLinkAttrs.rel, newLinkAttrs.target === '_blank');
486
+ newLinkAttrs.rel = newRel ? newRel : null;
487
+ }
488
+ if (Optional.from(newLinkAttrs.target).isNone() && getTargetList(editor) === false) {
489
+ newLinkAttrs.target = getDefaultLinkTarget(editor);
490
+ }
491
+ newLinkAttrs.href = handleExternalTargets(newLinkAttrs.href, assumeExternalTargets(editor));
492
+ return newLinkAttrs;
493
+ };
494
+ var updateLink = function (editor, anchorElm, text, linkAttrs) {
495
+ text.each(function (text) {
496
+ if (anchorElm.hasOwnProperty('innerText')) {
497
+ anchorElm.innerText = text;
498
+ } else {
499
+ anchorElm.textContent = text;
500
+ }
501
+ });
502
+ editor.dom.setAttribs(anchorElm, linkAttrs);
503
+ editor.selection.select(anchorElm);
504
+ };
505
+ var createLink = function (editor, selectedElm, text, linkAttrs) {
506
+ if (isImageFigure(selectedElm)) {
507
+ linkImageFigure(editor, selectedElm, linkAttrs);
508
+ } else {
509
+ text.fold(function () {
510
+ editor.execCommand('mceInsertLink', false, linkAttrs);
511
+ }, function (text) {
512
+ editor.insertContent(editor.dom.createHTML('a', linkAttrs, editor.dom.encode(text)));
513
+ });
514
+ }
515
+ };
516
+ var linkDomMutation = function (editor, attachState, data) {
517
+ var selectedElm = editor.selection.getNode();
518
+ var anchorElm = getAnchorElement(editor, selectedElm);
519
+ var linkAttrs = applyLinkOverrides(editor, getLinkAttrs(data));
520
+ editor.undoManager.transact(function () {
521
+ if (data.href === attachState.href) {
522
+ attachState.attach();
523
+ }
524
+ if (anchorElm) {
525
+ editor.focus();
526
+ updateLink(editor, anchorElm, data.text, linkAttrs);
527
+ } else {
528
+ createLink(editor, selectedElm, data.text, linkAttrs);
529
+ }
530
+ });
531
+ };
532
+ var unlinkSelection = function (editor) {
533
+ var dom = editor.dom, selection = editor.selection;
534
+ var bookmark = selection.getBookmark();
535
+ var rng = selection.getRng().cloneRange();
536
+ var startAnchorElm = dom.getParent(rng.startContainer, 'a[href]', editor.getBody());
537
+ var endAnchorElm = dom.getParent(rng.endContainer, 'a[href]', editor.getBody());
538
+ if (startAnchorElm) {
539
+ rng.setStartBefore(startAnchorElm);
540
+ }
541
+ if (endAnchorElm) {
542
+ rng.setEndAfter(endAnchorElm);
543
+ }
544
+ selection.setRng(rng);
545
+ editor.execCommand('unlink');
546
+ selection.moveToBookmark(bookmark);
547
+ };
548
+ var unlinkDomMutation = function (editor) {
549
+ editor.undoManager.transact(function () {
550
+ var node = editor.selection.getNode();
551
+ if (isImageFigure(node)) {
552
+ unlinkImageFigure(editor, node);
553
+ } else {
554
+ unlinkSelection(editor);
555
+ }
556
+ editor.focus();
557
+ });
558
+ };
559
+ var unwrapOptions = function (data) {
560
+ var cls = data.class, href = data.href, rel = data.rel, target = data.target, text = data.text, title = data.title;
561
+ return filter({
562
+ class: cls.getOrNull(),
563
+ href: href,
564
+ rel: rel.getOrNull(),
565
+ target: target.getOrNull(),
566
+ text: text.getOrNull(),
567
+ title: title.getOrNull()
568
+ }, function (v, _k) {
569
+ return isNull(v) === false;
570
+ });
571
+ };
572
+ var link = function (editor, attachState, data) {
573
+ editor.hasPlugin('rtc', true) ? editor.execCommand('createlink', false, unwrapOptions(data)) : linkDomMutation(editor, attachState, data);
574
+ };
575
+ var unlink = function (editor) {
576
+ editor.hasPlugin('rtc', true) ? editor.execCommand('unlink') : unlinkDomMutation(editor);
577
+ };
578
+ var unlinkImageFigure = function (editor, fig) {
579
+ var img = editor.dom.select('img', fig)[0];
580
+ if (img) {
581
+ var a = editor.dom.getParents(img, 'a[href]', fig)[0];
582
+ if (a) {
583
+ a.parentNode.insertBefore(img, a);
584
+ editor.dom.remove(a);
585
+ }
586
+ }
587
+ };
588
+ var linkImageFigure = function (editor, fig, attrs) {
589
+ var img = editor.dom.select('img', fig)[0];
590
+ if (img) {
591
+ var a = editor.dom.create('a', attrs);
592
+ img.parentNode.insertBefore(a, img);
593
+ a.appendChild(img);
594
+ }
595
+ };
596
+
597
+ var isListGroup = function (item) {
598
+ return hasNonNullableKey(item, 'items');
599
+ };
600
+ var findTextByValue = function (value, catalog) {
601
+ return findMap(catalog, function (item) {
602
+ if (isListGroup(item)) {
603
+ return findTextByValue(value, item.items);
604
+ } else {
605
+ return someIf(item.value === value, item);
606
+ }
607
+ });
608
+ };
609
+ var getDelta = function (persistentText, fieldName, catalog, data) {
610
+ var value = data[fieldName];
611
+ var hasPersistentText = persistentText.length > 0;
612
+ return value !== undefined ? findTextByValue(value, catalog).map(function (i) {
613
+ return {
614
+ url: {
615
+ value: i.value,
616
+ meta: {
617
+ text: hasPersistentText ? persistentText : i.text,
618
+ attach: noop
619
+ }
620
+ },
621
+ text: hasPersistentText ? persistentText : i.text
622
+ };
623
+ }) : Optional.none();
624
+ };
625
+ var findCatalog = function (catalogs, fieldName) {
626
+ if (fieldName === 'link') {
627
+ return catalogs.link;
628
+ } else if (fieldName === 'anchor') {
629
+ return catalogs.anchor;
630
+ } else {
631
+ return Optional.none();
632
+ }
633
+ };
634
+ var init = function (initialData, linkCatalog) {
635
+ var persistentData = {
636
+ text: initialData.text,
637
+ title: initialData.title
638
+ };
639
+ var getTitleFromUrlChange = function (url) {
640
+ return someIf(persistentData.title.length <= 0, Optional.from(url.meta.title).getOr(''));
641
+ };
642
+ var getTextFromUrlChange = function (url) {
643
+ return someIf(persistentData.text.length <= 0, Optional.from(url.meta.text).getOr(url.value));
644
+ };
645
+ var onUrlChange = function (data) {
646
+ var text = getTextFromUrlChange(data.url);
647
+ var title = getTitleFromUrlChange(data.url);
648
+ if (text.isSome() || title.isSome()) {
649
+ return Optional.some(__assign(__assign({}, text.map(function (text) {
650
+ return { text: text };
651
+ }).getOr({})), title.map(function (title) {
652
+ return { title: title };
653
+ }).getOr({})));
654
+ } else {
655
+ return Optional.none();
656
+ }
657
+ };
658
+ var onCatalogChange = function (data, change) {
659
+ var catalog = findCatalog(linkCatalog, change.name).getOr([]);
660
+ return getDelta(persistentData.text, change.name, catalog, data);
661
+ };
662
+ var onChange = function (getData, change) {
663
+ var name = change.name;
664
+ if (name === 'url') {
665
+ return onUrlChange(getData());
666
+ } else if (contains([
667
+ 'anchor',
668
+ 'link'
669
+ ], name)) {
670
+ return onCatalogChange(getData(), change);
671
+ } else if (name === 'text' || name === 'title') {
672
+ persistentData[name] = getData()[name];
673
+ return Optional.none();
674
+ } else {
675
+ return Optional.none();
676
+ }
677
+ };
678
+ return { onChange: onChange };
679
+ };
680
+ var DialogChanges = {
681
+ init: init,
682
+ getDelta: getDelta
683
+ };
684
+
685
+ var global$4 = tinymce.util.Tools.resolve('tinymce.util.Delay');
686
+
687
+ var global$5 = tinymce.util.Tools.resolve('tinymce.util.Promise');
688
+
689
+ var delayedConfirm = function (editor, message, callback) {
690
+ var rng = editor.selection.getRng();
691
+ global$4.setEditorTimeout(editor, function () {
692
+ editor.windowManager.confirm(message, function (state) {
693
+ editor.selection.setRng(rng);
694
+ callback(state);
695
+ });
696
+ });
697
+ };
698
+ var tryEmailTransform = function (data) {
699
+ var url = data.href;
700
+ var suggestMailTo = url.indexOf('@') > 0 && url.indexOf('/') === -1 && url.indexOf('mailto:') === -1;
701
+ return suggestMailTo ? Optional.some({
702
+ message: 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?',
703
+ preprocess: function (oldData) {
704
+ return __assign(__assign({}, oldData), { href: 'mailto:' + url });
705
+ }
706
+ }) : Optional.none();
707
+ };
708
+ var tryProtocolTransform = function (assumeExternalTargets, defaultLinkProtocol) {
709
+ return function (data) {
710
+ var url = data.href;
711
+ var suggestProtocol = assumeExternalTargets === 1 && !hasProtocol(url) || assumeExternalTargets === 0 && /^\s*www(\.|\d\.)/i.test(url);
712
+ return suggestProtocol ? Optional.some({
713
+ message: 'The URL you entered seems to be an external link. Do you want to add the required ' + defaultLinkProtocol + ':// prefix?',
714
+ preprocess: function (oldData) {
715
+ return __assign(__assign({}, oldData), { href: defaultLinkProtocol + '://' + url });
716
+ }
717
+ }) : Optional.none();
718
+ };
719
+ };
720
+ var preprocess = function (editor, data) {
721
+ return findMap([
722
+ tryEmailTransform,
723
+ tryProtocolTransform(assumeExternalTargets(editor), getDefaultLinkProtocol(editor))
724
+ ], function (f) {
725
+ return f(data);
726
+ }).fold(function () {
727
+ return global$5.resolve(data);
728
+ }, function (transform) {
729
+ return new global$5(function (callback) {
730
+ delayedConfirm(editor, transform.message, function (state) {
731
+ callback(state ? transform.preprocess(data) : data);
732
+ });
733
+ });
734
+ });
735
+ };
736
+ var DialogConfirms = { preprocess: preprocess };
737
+
738
+ var getAnchors = function (editor) {
739
+ var anchorNodes = editor.dom.select('a:not([href])');
740
+ var anchors = bind(anchorNodes, function (anchor) {
741
+ var id = anchor.name || anchor.id;
742
+ return id ? [{
743
+ text: id,
744
+ value: '#' + id
745
+ }] : [];
746
+ });
747
+ return anchors.length > 0 ? Optional.some([{
748
+ text: 'None',
749
+ value: ''
750
+ }].concat(anchors)) : Optional.none();
751
+ };
752
+ var AnchorListOptions = { getAnchors: getAnchors };
753
+
754
+ var getClasses = function (editor) {
755
+ var list = getLinkClassList(editor);
756
+ if (list.length > 0) {
757
+ return ListOptions.sanitize(list);
758
+ }
759
+ return Optional.none();
760
+ };
761
+ var ClassListOptions = { getClasses: getClasses };
762
+
763
+ var global$6 = tinymce.util.Tools.resolve('tinymce.util.XHR');
764
+
765
+ var parseJson = function (text) {
766
+ try {
767
+ return Optional.some(JSON.parse(text));
768
+ } catch (err) {
769
+ return Optional.none();
770
+ }
771
+ };
772
+ var getLinks = function (editor) {
773
+ var extractor = function (item) {
774
+ return editor.convertURL(item.value || item.url, 'href');
775
+ };
776
+ var linkList = getLinkList(editor);
777
+ return new global$5(function (callback) {
778
+ if (isString(linkList)) {
779
+ global$6.send({
780
+ url: linkList,
781
+ success: function (text) {
782
+ return callback(parseJson(text));
783
+ },
784
+ error: function (_) {
785
+ return callback(Optional.none());
786
+ }
787
+ });
788
+ } else if (isFunction(linkList)) {
789
+ linkList(function (output) {
790
+ return callback(Optional.some(output));
791
+ });
792
+ } else {
793
+ callback(Optional.from(linkList));
794
+ }
795
+ }).then(function (optItems) {
796
+ return optItems.bind(ListOptions.sanitizeWith(extractor)).map(function (items) {
797
+ if (items.length > 0) {
798
+ var noneItem = [{
799
+ text: 'None',
800
+ value: ''
801
+ }];
802
+ return noneItem.concat(items);
803
+ } else {
804
+ return items;
805
+ }
806
+ });
807
+ });
808
+ };
809
+ var LinkListOptions = { getLinks: getLinks };
810
+
811
+ var getRels = function (editor, initialTarget) {
812
+ var list = getRelList(editor);
813
+ if (list.length > 0) {
814
+ var isTargetBlank_1 = initialTarget.is('_blank');
815
+ var enforceSafe = allowUnsafeLinkTarget(editor) === false;
816
+ var safeRelExtractor = function (item) {
817
+ return applyRelTargetRules(ListOptions.getValue(item), isTargetBlank_1);
818
+ };
819
+ var sanitizer = enforceSafe ? ListOptions.sanitizeWith(safeRelExtractor) : ListOptions.sanitize;
820
+ return sanitizer(list);
821
+ }
822
+ return Optional.none();
823
+ };
824
+ var RelOptions = { getRels: getRels };
825
+
826
+ var fallbacks = [
827
+ {
828
+ text: 'Current window',
829
+ value: ''
830
+ },
831
+ {
832
+ text: 'New window',
833
+ value: '_blank'
834
+ }
835
+ ];
836
+ var getTargets = function (editor) {
837
+ var list = getTargetList(editor);
838
+ if (isArray(list)) {
839
+ return ListOptions.sanitize(list).orThunk(function () {
840
+ return Optional.some(fallbacks);
841
+ });
842
+ } else if (list === false) {
843
+ return Optional.none();
844
+ }
845
+ return Optional.some(fallbacks);
846
+ };
847
+ var TargetOptions = { getTargets: getTargets };
848
+
849
+ var nonEmptyAttr = function (dom, elem, name) {
850
+ var val = dom.getAttrib(elem, name);
851
+ return val !== null && val.length > 0 ? Optional.some(val) : Optional.none();
852
+ };
853
+ var extractFromAnchor = function (editor, anchor) {
854
+ var dom = editor.dom;
855
+ var onlyText = isOnlyTextSelected(editor);
856
+ var text = onlyText ? Optional.some(getAnchorText(editor.selection, anchor)) : Optional.none();
857
+ var url = anchor ? Optional.some(dom.getAttrib(anchor, 'href')) : Optional.none();
858
+ var target = anchor ? Optional.from(dom.getAttrib(anchor, 'target')) : Optional.none();
859
+ var rel = nonEmptyAttr(dom, anchor, 'rel');
860
+ var linkClass = nonEmptyAttr(dom, anchor, 'class');
861
+ var title = nonEmptyAttr(dom, anchor, 'title');
862
+ return {
863
+ url: url,
864
+ text: text,
865
+ title: title,
866
+ target: target,
867
+ rel: rel,
868
+ linkClass: linkClass
869
+ };
870
+ };
871
+ var collect = function (editor, linkNode) {
872
+ return LinkListOptions.getLinks(editor).then(function (links) {
873
+ var anchor = extractFromAnchor(editor, linkNode);
874
+ return {
875
+ anchor: anchor,
876
+ catalogs: {
877
+ targets: TargetOptions.getTargets(editor),
878
+ rels: RelOptions.getRels(editor, anchor.target),
879
+ classes: ClassListOptions.getClasses(editor),
880
+ anchor: AnchorListOptions.getAnchors(editor),
881
+ link: links
882
+ },
883
+ optNode: Optional.from(linkNode),
884
+ flags: { titleEnabled: shouldShowLinkTitle(editor) }
885
+ };
886
+ });
887
+ };
888
+ var DialogInfo = { collect: collect };
889
+
890
+ var handleSubmit = function (editor, info) {
891
+ return function (api) {
892
+ var data = api.getData();
893
+ if (!data.url.value) {
894
+ unlink(editor);
895
+ api.close();
896
+ return;
897
+ }
898
+ var getChangedValue = function (key) {
899
+ return Optional.from(data[key]).filter(function (value) {
900
+ return !info.anchor[key].is(value);
901
+ });
902
+ };
903
+ var changedData = {
904
+ href: data.url.value,
905
+ text: getChangedValue('text'),
906
+ target: getChangedValue('target'),
907
+ rel: getChangedValue('rel'),
908
+ class: getChangedValue('linkClass'),
909
+ title: getChangedValue('title')
910
+ };
911
+ var attachState = {
912
+ href: data.url.value,
913
+ attach: data.url.meta !== undefined && data.url.meta.attach ? data.url.meta.attach : noop
914
+ };
915
+ DialogConfirms.preprocess(editor, changedData).then(function (pData) {
916
+ link(editor, attachState, pData);
917
+ });
918
+ api.close();
919
+ };
920
+ };
921
+ var collectData = function (editor) {
922
+ var anchorNode = getAnchorElement(editor);
923
+ return DialogInfo.collect(editor, anchorNode);
924
+ };
925
+ var getInitialData = function (info, defaultTarget) {
926
+ var anchor = info.anchor;
927
+ var url = anchor.url.getOr('');
928
+ return {
929
+ url: {
930
+ value: url,
931
+ meta: { original: { value: url } }
932
+ },
933
+ text: anchor.text.getOr(''),
934
+ title: anchor.title.getOr(''),
935
+ anchor: url,
936
+ link: url,
937
+ rel: anchor.rel.getOr(''),
938
+ target: anchor.target.or(defaultTarget).getOr(''),
939
+ linkClass: anchor.linkClass.getOr('')
940
+ };
941
+ };
942
+ var makeDialog = function (settings, onSubmit, editor) {
943
+ var urlInput = [{
944
+ name: 'url',
945
+ type: 'urlinput',
946
+ filetype: 'file',
947
+ label: 'URL'
948
+ }];
949
+ var displayText = settings.anchor.text.map(function () {
950
+ return {
951
+ name: 'text',
952
+ type: 'input',
953
+ label: 'Text to display'
954
+ };
955
+ }).toArray();
956
+ var titleText = settings.flags.titleEnabled ? [{
957
+ name: 'title',
958
+ type: 'input',
959
+ label: 'Title'
960
+ }] : [];
961
+ var defaultTarget = Optional.from(getDefaultLinkTarget(editor));
962
+ var initialData = getInitialData(settings, defaultTarget);
963
+ var catalogs = settings.catalogs;
964
+ var dialogDelta = DialogChanges.init(initialData, catalogs);
965
+ var body = {
966
+ type: 'panel',
967
+ items: flatten([
968
+ urlInput,
969
+ displayText,
970
+ titleText,
971
+ cat([
972
+ catalogs.anchor.map(ListOptions.createUi('anchor', 'Anchors')),
973
+ catalogs.rels.map(ListOptions.createUi('rel', 'Rel')),
974
+ catalogs.targets.map(ListOptions.createUi('target', 'Open link in...')),
975
+ catalogs.link.map(ListOptions.createUi('link', 'Link list')),
976
+ catalogs.classes.map(ListOptions.createUi('linkClass', 'Class'))
977
+ ])
978
+ ])
979
+ };
980
+ return {
981
+ title: 'Insert/Edit Link',
982
+ size: 'normal',
983
+ body: body,
984
+ buttons: [
985
+ {
986
+ type: 'cancel',
987
+ name: 'cancel',
988
+ text: 'Cancel'
989
+ },
990
+ {
991
+ type: 'submit',
992
+ name: 'save',
993
+ text: 'Save',
994
+ primary: true
995
+ }
996
+ ],
997
+ initialData: initialData,
998
+ onChange: function (api, _a) {
999
+ var name = _a.name;
1000
+ dialogDelta.onChange(api.getData, { name: name }).each(function (newData) {
1001
+ api.setData(newData);
1002
+ });
1003
+ },
1004
+ onSubmit: onSubmit
1005
+ };
1006
+ };
1007
+ var open = function (editor) {
1008
+ var data = collectData(editor);
1009
+ data.then(function (info) {
1010
+ var onSubmit = handleSubmit(editor, info);
1011
+ return makeDialog(info, onSubmit, editor);
1012
+ }).then(function (spec) {
1013
+ editor.windowManager.open(spec);
1014
+ });
1015
+ };
1016
+
1017
+ var appendClickRemove = function (link, evt) {
1018
+ document.body.appendChild(link);
1019
+ link.dispatchEvent(evt);
1020
+ document.body.removeChild(link);
1021
+ };
1022
+ var open$1 = function (url) {
1023
+ var link = document.createElement('a');
1024
+ link.target = '_blank';
1025
+ link.href = url;
1026
+ link.rel = 'noreferrer noopener';
1027
+ var evt = document.createEvent('MouseEvents');
1028
+ evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
1029
+ appendClickRemove(link, evt);
1030
+ };
1031
+
1032
+ var getLink = function (editor, elm) {
1033
+ return editor.dom.getParent(elm, 'a[href]');
1034
+ };
1035
+ var getSelectedLink = function (editor) {
1036
+ return getLink(editor, editor.selection.getStart());
1037
+ };
1038
+ var hasOnlyAltModifier = function (e) {
1039
+ return e.altKey === true && e.shiftKey === false && e.ctrlKey === false && e.metaKey === false;
1040
+ };
1041
+ var gotoLink = function (editor, a) {
1042
+ if (a) {
1043
+ var href = getHref(a);
1044
+ if (/^#/.test(href)) {
1045
+ var targetEl = editor.$(href);
1046
+ if (targetEl.length) {
1047
+ editor.selection.scrollIntoView(targetEl[0], true);
1048
+ }
1049
+ } else {
1050
+ open$1(a.href);
1051
+ }
1052
+ }
1053
+ };
1054
+ var openDialog = function (editor) {
1055
+ return function () {
1056
+ open(editor);
1057
+ };
1058
+ };
1059
+ var gotoSelectedLink = function (editor) {
1060
+ return function () {
1061
+ gotoLink(editor, getSelectedLink(editor));
1062
+ };
1063
+ };
1064
+ var setupGotoLinks = function (editor) {
1065
+ editor.on('click', function (e) {
1066
+ var link = getLink(editor, e.target);
1067
+ if (link && global$1.metaKeyPressed(e)) {
1068
+ e.preventDefault();
1069
+ gotoLink(editor, link);
1070
+ }
1071
+ });
1072
+ editor.on('keydown', function (e) {
1073
+ var link = getSelectedLink(editor);
1074
+ if (link && e.keyCode === 13 && hasOnlyAltModifier(e)) {
1075
+ e.preventDefault();
1076
+ gotoLink(editor, link);
1077
+ }
1078
+ });
1079
+ };
1080
+ var toggleState = function (editor, toggler) {
1081
+ editor.on('NodeChange', toggler);
1082
+ return function () {
1083
+ return editor.off('NodeChange', toggler);
1084
+ };
1085
+ };
1086
+ var toggleActiveState = function (editor) {
1087
+ return function (api) {
1088
+ return toggleState(editor, function () {
1089
+ api.setActive(!editor.mode.isReadOnly() && getAnchorElement(editor, editor.selection.getNode()) !== null);
1090
+ });
1091
+ };
1092
+ };
1093
+ var toggleEnabledState = function (editor) {
1094
+ return function (api) {
1095
+ var updateState = function () {
1096
+ return api.setDisabled(getAnchorElement(editor, editor.selection.getNode()) === null);
1097
+ };
1098
+ updateState();
1099
+ return toggleState(editor, updateState);
1100
+ };
1101
+ };
1102
+ var toggleUnlinkState = function (editor) {
1103
+ return function (api) {
1104
+ var hasLinks$1 = function (parents) {
1105
+ return hasLinks(parents) || hasLinksInSelection(editor.selection.getRng());
1106
+ };
1107
+ var parents = editor.dom.getParents(editor.selection.getStart());
1108
+ api.setDisabled(!hasLinks$1(parents));
1109
+ return toggleState(editor, function (e) {
1110
+ return api.setDisabled(!hasLinks$1(e.parents));
1111
+ });
1112
+ };
1113
+ };
1114
+
1115
+ var register = function (editor) {
1116
+ editor.addCommand('mceLink', function () {
1117
+ if (useQuickLink(editor)) {
1118
+ editor.fire('contexttoolbar-show', { toolbarKey: 'quicklink' });
1119
+ } else {
1120
+ openDialog(editor)();
1121
+ }
1122
+ });
1123
+ };
1124
+
1125
+ var setup = function (editor) {
1126
+ editor.addShortcut('Meta+K', '', function () {
1127
+ editor.execCommand('mceLink');
1128
+ });
1129
+ };
1130
+
1131
+ var setupButtons = function (editor) {
1132
+ editor.ui.registry.addToggleButton('link', {
1133
+ icon: 'link',
1134
+ tooltip: 'Insert/edit link',
1135
+ onAction: openDialog(editor),
1136
+ onSetup: toggleActiveState(editor)
1137
+ });
1138
+ editor.ui.registry.addButton('openlink', {
1139
+ icon: 'new-tab',
1140
+ tooltip: 'Open link',
1141
+ onAction: gotoSelectedLink(editor),
1142
+ onSetup: toggleEnabledState(editor)
1143
+ });
1144
+ editor.ui.registry.addButton('unlink', {
1145
+ icon: 'unlink',
1146
+ tooltip: 'Remove link',
1147
+ onAction: function () {
1148
+ return unlink(editor);
1149
+ },
1150
+ onSetup: toggleUnlinkState(editor)
1151
+ });
1152
+ };
1153
+ var setupMenuItems = function (editor) {
1154
+ editor.ui.registry.addMenuItem('openlink', {
1155
+ text: 'Open link',
1156
+ icon: 'new-tab',
1157
+ onAction: gotoSelectedLink(editor),
1158
+ onSetup: toggleEnabledState(editor)
1159
+ });
1160
+ editor.ui.registry.addMenuItem('link', {
1161
+ icon: 'link',
1162
+ text: 'Link...',
1163
+ shortcut: 'Meta+K',
1164
+ onAction: openDialog(editor)
1165
+ });
1166
+ editor.ui.registry.addMenuItem('unlink', {
1167
+ icon: 'unlink',
1168
+ text: 'Remove link',
1169
+ onAction: function () {
1170
+ return unlink(editor);
1171
+ },
1172
+ onSetup: toggleUnlinkState(editor)
1173
+ });
1174
+ };
1175
+ var setupContextMenu = function (editor) {
1176
+ var inLink = 'link unlink openlink';
1177
+ var noLink = 'link';
1178
+ editor.ui.registry.addContextMenu('link', {
1179
+ update: function (element) {
1180
+ return hasLinks(editor.dom.getParents(element, 'a')) ? inLink : noLink;
1181
+ }
1182
+ });
1183
+ };
1184
+ var setupContextToolbars = function (editor) {
1185
+ var collapseSelectionToEnd = function (editor) {
1186
+ editor.selection.collapse(false);
1187
+ };
1188
+ var onSetupLink = function (buttonApi) {
1189
+ var node = editor.selection.getNode();
1190
+ buttonApi.setDisabled(!getAnchorElement(editor, node));
1191
+ return noop;
1192
+ };
1193
+ editor.ui.registry.addContextForm('quicklink', {
1194
+ launch: {
1195
+ type: 'contextformtogglebutton',
1196
+ icon: 'link',
1197
+ tooltip: 'Link',
1198
+ onSetup: toggleActiveState(editor)
1199
+ },
1200
+ label: 'Link',
1201
+ predicate: function (node) {
1202
+ return !!getAnchorElement(editor, node) && hasContextToolbar(editor);
1203
+ },
1204
+ initValue: function () {
1205
+ var elm = getAnchorElement(editor);
1206
+ return !!elm ? getHref(elm) : '';
1207
+ },
1208
+ commands: [
1209
+ {
1210
+ type: 'contextformtogglebutton',
1211
+ icon: 'link',
1212
+ tooltip: 'Link',
1213
+ primary: true,
1214
+ onSetup: function (buttonApi) {
1215
+ var node = editor.selection.getNode();
1216
+ buttonApi.setActive(!!getAnchorElement(editor, node));
1217
+ return toggleActiveState(editor)(buttonApi);
1218
+ },
1219
+ onAction: function (formApi) {
1220
+ var anchor = getAnchorElement(editor);
1221
+ var value = formApi.getValue();
1222
+ if (!anchor) {
1223
+ var attachState = {
1224
+ href: value,
1225
+ attach: noop
1226
+ };
1227
+ var onlyText = isOnlyTextSelected(editor);
1228
+ var text = onlyText ? Optional.some(getAnchorText(editor.selection, anchor)).filter(function (t) {
1229
+ return t.length > 0;
1230
+ }).or(Optional.from(value)) : Optional.none();
1231
+ link(editor, attachState, {
1232
+ href: value,
1233
+ text: text,
1234
+ title: Optional.none(),
1235
+ rel: Optional.none(),
1236
+ target: Optional.none(),
1237
+ class: Optional.none()
1238
+ });
1239
+ formApi.hide();
1240
+ } else {
1241
+ editor.undoManager.transact(function () {
1242
+ editor.dom.setAttrib(anchor, 'href', value);
1243
+ collapseSelectionToEnd(editor);
1244
+ formApi.hide();
1245
+ });
1246
+ }
1247
+ }
1248
+ },
1249
+ {
1250
+ type: 'contextformbutton',
1251
+ icon: 'unlink',
1252
+ tooltip: 'Remove link',
1253
+ onSetup: onSetupLink,
1254
+ onAction: function (formApi) {
1255
+ unlink(editor);
1256
+ formApi.hide();
1257
+ }
1258
+ },
1259
+ {
1260
+ type: 'contextformbutton',
1261
+ icon: 'new-tab',
1262
+ tooltip: 'Open link',
1263
+ onSetup: onSetupLink,
1264
+ onAction: function (formApi) {
1265
+ gotoSelectedLink(editor)();
1266
+ formApi.hide();
1267
+ }
1268
+ }
1269
+ ]
1270
+ });
1271
+ };
1272
+
1273
+ function Plugin () {
1274
+ global.add('link', function (editor) {
1275
+ setupButtons(editor);
1276
+ setupMenuItems(editor);
1277
+ setupContextMenu(editor);
1278
+ setupContextToolbars(editor);
1279
+ setupGotoLinks(editor);
1280
+ register(editor);
1281
+ setup(editor);
1282
+ });
1283
+ }
1284
+
1285
+ Plugin();
1286
+
1287
+ }());