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