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,1149 +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 Cell = function (initial) {
13
- var value = initial;
14
- var get = function () {
15
- return value;
16
- };
17
- var set = function (v) {
18
- value = v;
19
- };
20
- return {
21
- get: get,
22
- set: set
23
- };
24
- };
25
- var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
26
- var __assign = function () {
27
- __assign = Object.assign || function __assign(t) {
28
- for (var s, i = 1, n = arguments.length; i < n; i++) {
29
- s = arguments[i];
30
- for (var p in s)
31
- if (Object.prototype.hasOwnProperty.call(s, p))
32
- t[p] = s[p];
33
- }
34
- return t;
35
- };
36
- return __assign.apply(this, arguments);
37
- };
38
- var typeOf = function (x) {
39
- var t = typeof x;
40
- if (x === null) {
41
- return 'null';
42
- }
43
- else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
44
- return 'array';
45
- }
46
- else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
47
- return 'string';
48
- }
49
- else {
50
- return t;
51
- }
52
- };
53
- var isType = function (type) {
54
- return function (value) {
55
- return typeOf(value) === type;
56
- };
57
- };
58
- var isSimpleType = function (type) {
59
- return function (value) {
60
- return typeof value === type;
61
- };
62
- };
63
- var isString = isType('string');
64
- var isArray = isType('array');
65
- var isBoolean = isSimpleType('boolean');
66
- var isNumber = isSimpleType('number');
67
- var noop = function () {
68
- };
69
- var constant = function (value) {
70
- return function () {
71
- return value;
72
- };
73
- };
74
- var never = constant(false);
75
- var always = constant(true);
76
- var punctuationStr = '[!-#%-*,-\\/:;?@\\[-\\]_{}\xA1\xAB\xB7\xBB\xBF;\xB7\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1361-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u3008\u3009\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30\u2E31\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uff3f\uFF5B\uFF5D\uFF5F-\uFF65]';
77
- var punctuation = constant(punctuationStr);
78
- var none = function () {
79
- return NONE;
80
- };
81
- var NONE = function () {
82
- var eq = function (o) {
83
- return o.isNone();
84
- };
85
- var call = function (thunk) {
86
- return thunk();
87
- };
88
- var id = function (n) {
89
- return n;
90
- };
91
- var me = {
92
- fold: function (n, _s) {
93
- return n();
94
- },
95
- is: never,
96
- isSome: never,
97
- isNone: always,
98
- getOr: id,
99
- getOrThunk: call,
100
- getOrDie: function (msg) {
101
- throw new Error(msg || 'error: getOrDie called on none.');
102
- },
103
- getOrNull: constant(null),
104
- getOrUndefined: constant(undefined),
105
- or: id,
106
- orThunk: call,
107
- map: none,
108
- each: noop,
109
- bind: none,
110
- exists: never,
111
- forall: always,
112
- filter: none,
113
- equals: eq,
114
- equals_: eq,
115
- toArray: function () {
116
- return [];
117
- },
118
- toString: constant('none()')
119
- };
120
- return me;
121
- }();
122
- var some = function (a) {
123
- var constant_a = constant(a);
124
- var self = function () {
125
- return me;
126
- };
127
- var bind = function (f) {
128
- return f(a);
129
- };
130
- var me = {
131
- fold: function (n, s) {
132
- return s(a);
133
- },
134
- is: function (v) {
135
- return a === v;
136
- },
137
- isSome: always,
138
- isNone: never,
139
- getOr: constant_a,
140
- getOrThunk: constant_a,
141
- getOrDie: constant_a,
142
- getOrNull: constant_a,
143
- getOrUndefined: constant_a,
144
- or: self,
145
- orThunk: self,
146
- map: function (f) {
147
- return some(f(a));
148
- },
149
- each: function (f) {
150
- f(a);
151
- },
152
- bind: bind,
153
- exists: bind,
154
- forall: bind,
155
- filter: function (f) {
156
- return f(a) ? me : NONE;
157
- },
158
- toArray: function () {
159
- return [a];
160
- },
161
- toString: function () {
162
- return 'some(' + a + ')';
163
- },
164
- equals: function (o) {
165
- return o.is(a);
166
- },
167
- equals_: function (o, elementEq) {
168
- return o.fold(never, function (b) {
169
- return elementEq(a, b);
170
- });
171
- }
172
- };
173
- return me;
174
- };
175
- var from = function (value) {
176
- return value === null || value === undefined ? NONE : some(value);
177
- };
178
- var Optional = {
179
- some: some,
180
- none: none,
181
- from: from
182
- };
183
- var punctuation$1 = punctuation;
184
- var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
185
- var nativeSlice = Array.prototype.slice;
186
- var nativePush = Array.prototype.push;
187
- var map = function (xs, f) {
188
- var len = xs.length;
189
- var r = new Array(len);
190
- for (var i = 0; i < len; i++) {
191
- var x = xs[i];
192
- r[i] = f(x, i);
193
- }
194
- return r;
195
- };
196
- var each = function (xs, f) {
197
- for (var i = 0, len = xs.length; i < len; i++) {
198
- var x = xs[i];
199
- f(x, i);
200
- }
201
- };
202
- var eachr = function (xs, f) {
203
- for (var i = xs.length - 1; i >= 0; i--) {
204
- var x = xs[i];
205
- f(x, i);
206
- }
207
- };
208
- var groupBy = function (xs, f) {
209
- if (xs.length === 0) {
210
- return [];
211
- }
212
- else {
213
- var wasType = f(xs[0]);
214
- var r = [];
215
- var group = [];
216
- for (var i = 0, len = xs.length; i < len; i++) {
217
- var x = xs[i];
218
- var type = f(x);
219
- if (type !== wasType) {
220
- r.push(group);
221
- group = [];
222
- }
223
- wasType = type;
224
- group.push(x);
225
- }
226
- if (group.length !== 0) {
227
- r.push(group);
228
- }
229
- return r;
230
- }
231
- };
232
- var foldl = function (xs, f, acc) {
233
- each(xs, function (x) {
234
- acc = f(acc, x);
235
- });
236
- return acc;
237
- };
238
- var flatten = function (xs) {
239
- var r = [];
240
- for (var i = 0, len = xs.length; i < len; ++i) {
241
- if (!isArray(xs[i])) {
242
- throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
243
- }
244
- nativePush.apply(r, xs[i]);
245
- }
246
- return r;
247
- };
248
- var bind = function (xs, f) {
249
- return flatten(map(xs, f));
250
- };
251
- var sort = function (xs, comparator) {
252
- var copy = nativeSlice.call(xs, 0);
253
- copy.sort(comparator);
254
- return copy;
255
- };
256
- var hasOwnProperty = Object.hasOwnProperty;
257
- var has = function (obj, key) {
258
- return hasOwnProperty.call(obj, key);
259
- };
260
- var Global = typeof window !== 'undefined' ? window : Function('return this;')();
261
- var DOCUMENT = 9;
262
- var DOCUMENT_FRAGMENT = 11;
263
- var ELEMENT = 1;
264
- var TEXT = 3;
265
- var type = function (element) {
266
- return element.dom.nodeType;
267
- };
268
- var isType$1 = function (t) {
269
- return function (element) {
270
- return type(element) === t;
271
- };
272
- };
273
- var isText = isType$1(TEXT);
274
- var rawSet = function (dom, key, value) {
275
- if (isString(value) || isBoolean(value) || isNumber(value)) {
276
- dom.setAttribute(key, value + '');
277
- }
278
- else {
279
- console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom);
280
- throw new Error('Attribute value was not simple');
281
- }
282
- };
283
- var set = function (element, key, value) {
284
- rawSet(element.dom, key, value);
285
- };
286
- var compareDocumentPosition = function (a, b, match) {
287
- return (a.compareDocumentPosition(b) & match) !== 0;
288
- };
289
- var documentPositionPreceding = function (a, b) {
290
- return compareDocumentPosition(a, b, Node.DOCUMENT_POSITION_PRECEDING);
291
- };
292
- var fromHtml = function (html, scope) {
293
- var doc = scope || document;
294
- var div = doc.createElement('div');
295
- div.innerHTML = html;
296
- if (!div.hasChildNodes() || div.childNodes.length > 1) {
297
- console.error('HTML does not have a single root node', html);
298
- throw new Error('HTML must have a single root node');
299
- }
300
- return fromDom(div.childNodes[0]);
301
- };
302
- var fromTag = function (tag, scope) {
303
- var doc = scope || document;
304
- var node = doc.createElement(tag);
305
- return fromDom(node);
306
- };
307
- var fromText = function (text, scope) {
308
- var doc = scope || document;
309
- var node = doc.createTextNode(text);
310
- return fromDom(node);
311
- };
312
- var fromDom = function (node) {
313
- if (node === null || node === undefined) {
314
- throw new Error('Node cannot be null or undefined');
315
- }
316
- return { dom: node };
317
- };
318
- var fromPoint = function (docElm, x, y) {
319
- return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom);
320
- };
321
- var SugarElement = {
322
- fromHtml: fromHtml,
323
- fromTag: fromTag,
324
- fromText: fromText,
325
- fromDom: fromDom,
326
- fromPoint: fromPoint
327
- };
328
- var bypassSelector = function (dom) {
329
- return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0;
330
- };
331
- var all = function (selector, scope) {
332
- var base = scope === undefined ? document : scope.dom;
333
- return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), SugarElement.fromDom);
334
- };
335
- var parent = function (element) {
336
- return Optional.from(element.dom.parentNode).map(SugarElement.fromDom);
337
- };
338
- var children = function (element) {
339
- return map(element.dom.childNodes, SugarElement.fromDom);
340
- };
341
- var spot = function (element, offset) {
342
- return {
343
- element: element,
344
- offset: offset
345
- };
346
- };
347
- var leaf = function (element, offset) {
348
- var cs = children(element);
349
- return cs.length > 0 && offset < cs.length ? spot(cs[offset], 0) : spot(element, offset);
350
- };
351
- var before = function (marker, element) {
352
- var parent$1 = parent(marker);
353
- parent$1.each(function (v) {
354
- v.dom.insertBefore(element.dom, marker.dom);
355
- });
356
- };
357
- var append = function (parent, element) {
358
- parent.dom.appendChild(element.dom);
359
- };
360
- var wrap = function (element, wrapper) {
361
- before(element, wrapper);
362
- append(wrapper, element);
363
- };
364
- var NodeValue = function (is, name) {
365
- var get = function (element) {
366
- if (!is(element)) {
367
- throw new Error('Can only get ' + name + ' value of a ' + name + ' node');
368
- }
369
- return getOption(element).getOr('');
370
- };
371
- var getOption = function (element) {
372
- return is(element) ? Optional.from(element.dom.nodeValue) : Optional.none();
373
- };
374
- var set = function (element, value) {
375
- if (!is(element)) {
376
- throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node');
377
- }
378
- element.dom.nodeValue = value;
379
- };
380
- return {
381
- get: get,
382
- getOption: getOption,
383
- set: set
384
- };
385
- };
386
- var api = NodeValue(isText, 'text');
387
- var get = function (element) {
388
- return api.get(element);
389
- };
390
- var descendants = function (scope, selector) {
391
- return all(selector, scope);
392
- };
393
- var global$2 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker');
394
- var isSimpleBoundary = function (dom, node) {
395
- return dom.isBlock(node) || has(dom.schema.getShortEndedElements(), node.nodeName);
396
- };
397
- var isContentEditableFalse = function (dom, node) {
398
- return dom.getContentEditable(node) === 'false';
399
- };
400
- var isContentEditableTrueInCef = function (dom, node) {
401
- return dom.getContentEditable(node) === 'true' && dom.getContentEditableParent(node.parentNode) === 'false';
402
- };
403
- var isHidden = function (dom, node) {
404
- return !dom.isBlock(node) && has(dom.schema.getWhiteSpaceElements(), node.nodeName);
405
- };
406
- var isBoundary = function (dom, node) {
407
- return isSimpleBoundary(dom, node) || isContentEditableFalse(dom, node) || isHidden(dom, node) || isContentEditableTrueInCef(dom, node);
408
- };
409
- var isText$1 = function (node) {
410
- return node.nodeType === 3;
411
- };
412
- var nuSection = function () {
413
- return {
414
- sOffset: 0,
415
- fOffset: 0,
416
- elements: []
417
- };
418
- };
419
- var toLeaf = function (node, offset) {
420
- return leaf(SugarElement.fromDom(node), offset);
421
- };
422
- var walk = function (dom, walkerFn, startNode, callbacks, endNode, skipStart) {
423
- if (skipStart === void 0) {
424
- skipStart = true;
425
- }
426
- var next = skipStart ? walkerFn(false) : startNode;
427
- while (next) {
428
- var isCefNode = isContentEditableFalse(dom, next);
429
- if (isCefNode || isHidden(dom, next)) {
430
- var stopWalking = isCefNode ? callbacks.cef(next) : callbacks.boundary(next);
431
- if (stopWalking) {
432
- break;
433
- }
434
- else {
435
- next = walkerFn(true);
436
- continue;
437
- }
438
- }
439
- else if (isSimpleBoundary(dom, next)) {
440
- if (callbacks.boundary(next)) {
441
- break;
442
- }
443
- }
444
- else if (isText$1(next)) {
445
- callbacks.text(next);
446
- }
447
- if (next === endNode) {
448
- break;
449
- }
450
- else {
451
- next = walkerFn(false);
452
- }
453
- }
454
- };
455
- var collectTextToBoundary = function (dom, section, node, rootNode, forwards) {
456
- if (isBoundary(dom, node)) {
457
- return;
458
- }
459
- var rootBlock = dom.getParent(rootNode, dom.isBlock);
460
- var walker = new global$2(node, rootBlock);
461
- var walkerFn = forwards ? walker.next.bind(walker) : walker.prev.bind(walker);
462
- walk(dom, walkerFn, node, {
463
- boundary: always,
464
- cef: always,
465
- text: function (next) {
466
- if (forwards) {
467
- section.fOffset += next.length;
468
- }
469
- else {
470
- section.sOffset += next.length;
471
- }
472
- section.elements.push(SugarElement.fromDom(next));
473
- }
474
- });
475
- };
476
- var collect = function (dom, rootNode, startNode, endNode, callbacks, skipStart) {
477
- if (skipStart === void 0) {
478
- skipStart = true;
479
- }
480
- var walker = new global$2(startNode, rootNode);
481
- var sections = [];
482
- var current = nuSection();
483
- collectTextToBoundary(dom, current, startNode, rootNode, false);
484
- var finishSection = function () {
485
- if (current.elements.length > 0) {
486
- sections.push(current);
487
- current = nuSection();
488
- }
489
- return false;
490
- };
491
- walk(dom, walker.next.bind(walker), startNode, {
492
- boundary: finishSection,
493
- cef: function (node) {
494
- finishSection();
495
- if (callbacks) {
496
- sections.push.apply(sections, callbacks.cef(node));
497
- }
498
- return false;
499
- },
500
- text: function (next) {
501
- current.elements.push(SugarElement.fromDom(next));
502
- if (callbacks) {
503
- callbacks.text(next, current);
504
- }
505
- }
506
- }, endNode, skipStart);
507
- if (endNode) {
508
- collectTextToBoundary(dom, current, endNode, rootNode, true);
509
- }
510
- finishSection();
511
- return sections;
512
- };
513
- var collectRangeSections = function (dom, rng) {
514
- var start = toLeaf(rng.startContainer, rng.startOffset);
515
- var startNode = start.element.dom;
516
- var end = toLeaf(rng.endContainer, rng.endOffset);
517
- var endNode = end.element.dom;
518
- return collect(dom, rng.commonAncestorContainer, startNode, endNode, {
519
- text: function (node, section) {
520
- if (node === endNode) {
521
- section.fOffset += node.length - end.offset;
522
- }
523
- else if (node === startNode) {
524
- section.sOffset += start.offset;
525
- }
526
- },
527
- cef: function (node) {
528
- var sections = bind(descendants(SugarElement.fromDom(node), '*[contenteditable=true]'), function (e) {
529
- var ceTrueNode = e.dom;
530
- return collect(dom, ceTrueNode, ceTrueNode);
531
- });
532
- return sort(sections, function (a, b) {
533
- return documentPositionPreceding(a.elements[0].dom, b.elements[0].dom) ? 1 : -1;
534
- });
535
- }
536
- }, false);
537
- };
538
- var fromRng = function (dom, rng) {
539
- return rng.collapsed ? [] : collectRangeSections(dom, rng);
540
- };
541
- var fromNode = function (dom, node) {
542
- var rng = dom.createRng();
543
- rng.selectNode(node);
544
- return fromRng(dom, rng);
545
- };
546
- var fromNodes = function (dom, nodes) {
547
- return bind(nodes, function (node) {
548
- return fromNode(dom, node);
549
- });
550
- };
551
- var find = function (text, pattern, start, finish) {
552
- if (start === void 0) {
553
- start = 0;
554
- }
555
- if (finish === void 0) {
556
- finish = text.length;
557
- }
558
- var regex = pattern.regex;
559
- regex.lastIndex = start;
560
- var results = [];
561
- var match;
562
- while (match = regex.exec(text)) {
563
- var matchedText = match[pattern.matchIndex];
564
- var matchStart = match.index + match[0].indexOf(matchedText);
565
- var matchFinish = matchStart + matchedText.length;
566
- if (matchFinish > finish) {
567
- break;
568
- }
569
- results.push({
570
- start: matchStart,
571
- finish: matchFinish
572
- });
573
- regex.lastIndex = matchFinish;
574
- }
575
- return results;
576
- };
577
- var extract = function (elements, matches) {
578
- var nodePositions = foldl(elements, function (acc, element) {
579
- var content = get(element);
580
- var start = acc.last;
581
- var finish = start + content.length;
582
- var positions = bind(matches, function (match, matchIdx) {
583
- if (match.start < finish && match.finish > start) {
584
- return [{
585
- element: element,
586
- start: Math.max(start, match.start) - start,
587
- finish: Math.min(finish, match.finish) - start,
588
- matchId: matchIdx
589
- }];
590
- }
591
- else {
592
- return [];
593
- }
594
- });
595
- return {
596
- results: acc.results.concat(positions),
597
- last: finish
598
- };
599
- }, {
600
- results: [],
601
- last: 0
602
- }).results;
603
- return groupBy(nodePositions, function (position) {
604
- return position.matchId;
605
- });
606
- };
607
- var find$1 = function (pattern, sections) {
608
- return bind(sections, function (section) {
609
- var elements = section.elements;
610
- var content = map(elements, get).join('');
611
- var positions = find(content, pattern, section.sOffset, content.length - section.fOffset);
612
- return extract(elements, positions);
613
- });
614
- };
615
- var mark = function (matches, replacementNode) {
616
- eachr(matches, function (match, idx) {
617
- eachr(match, function (pos) {
618
- var wrapper = SugarElement.fromDom(replacementNode.cloneNode(false));
619
- set(wrapper, 'data-mce-index', idx);
620
- var textNode = pos.element.dom;
621
- if (textNode.length === pos.finish && pos.start === 0) {
622
- wrap(pos.element, wrapper);
623
- }
624
- else {
625
- if (textNode.length !== pos.finish) {
626
- textNode.splitText(pos.finish);
627
- }
628
- var matchNode = textNode.splitText(pos.start);
629
- wrap(SugarElement.fromDom(matchNode), wrapper);
630
- }
631
- });
632
- });
633
- };
634
- var findAndMark = function (dom, pattern, node, replacementNode) {
635
- var textSections = fromNode(dom, node);
636
- var matches = find$1(pattern, textSections);
637
- mark(matches, replacementNode);
638
- return matches.length;
639
- };
640
- var findAndMarkInSelection = function (dom, pattern, selection, replacementNode) {
641
- var bookmark = selection.getBookmark();
642
- var nodes = dom.select('td[data-mce-selected],th[data-mce-selected]');
643
- var textSections = nodes.length > 0 ? fromNodes(dom, nodes) : fromRng(dom, selection.getRng());
644
- var matches = find$1(pattern, textSections);
645
- mark(matches, replacementNode);
646
- selection.moveToBookmark(bookmark);
647
- return matches.length;
648
- };
649
- var getElmIndex = function (elm) {
650
- var value = elm.getAttribute('data-mce-index');
651
- if (typeof value === 'number') {
652
- return '' + value;
653
- }
654
- return value;
655
- };
656
- var markAllMatches = function (editor, currentSearchState, pattern, inSelection) {
657
- var marker = editor.dom.create('span', { 'data-mce-bogus': 1 });
658
- marker.className = 'mce-match-marker';
659
- var node = editor.getBody();
660
- done(editor, currentSearchState, false);
661
- if (inSelection) {
662
- return findAndMarkInSelection(editor.dom, pattern, editor.selection, marker);
663
- }
664
- else {
665
- return findAndMark(editor.dom, pattern, node, marker);
666
- }
667
- };
668
- var unwrap = function (node) {
669
- var parentNode = node.parentNode;
670
- if (node.firstChild) {
671
- parentNode.insertBefore(node.firstChild, node);
672
- }
673
- node.parentNode.removeChild(node);
674
- };
675
- var findSpansByIndex = function (editor, index) {
676
- var spans = [];
677
- var nodes = global$1.toArray(editor.getBody().getElementsByTagName('span'));
678
- if (nodes.length) {
679
- for (var i = 0; i < nodes.length; i++) {
680
- var nodeIndex = getElmIndex(nodes[i]);
681
- if (nodeIndex === null || !nodeIndex.length) {
682
- continue;
683
- }
684
- if (nodeIndex === index.toString()) {
685
- spans.push(nodes[i]);
686
- }
687
- }
688
- }
689
- return spans;
690
- };
691
- var moveSelection = function (editor, currentSearchState, forward) {
692
- var searchState = currentSearchState.get();
693
- var testIndex = searchState.index;
694
- var dom = editor.dom;
695
- forward = forward !== false;
696
- if (forward) {
697
- if (testIndex + 1 === searchState.count) {
698
- testIndex = 0;
699
- }
700
- else {
701
- testIndex++;
702
- }
703
- }
704
- else {
705
- if (testIndex - 1 === -1) {
706
- testIndex = searchState.count - 1;
707
- }
708
- else {
709
- testIndex--;
710
- }
711
- }
712
- dom.removeClass(findSpansByIndex(editor, searchState.index), 'mce-match-marker-selected');
713
- var spans = findSpansByIndex(editor, testIndex);
714
- if (spans.length) {
715
- dom.addClass(findSpansByIndex(editor, testIndex), 'mce-match-marker-selected');
716
- editor.selection.scrollIntoView(spans[0]);
717
- return testIndex;
718
- }
719
- return -1;
720
- };
721
- var removeNode = function (dom, node) {
722
- var parent = node.parentNode;
723
- dom.remove(node);
724
- if (dom.isEmpty(parent)) {
725
- dom.remove(parent);
726
- }
727
- };
728
- var escapeSearchText = function (text, wholeWord) {
729
- var escapedText = text.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&').replace(/\s/g, '[^\\S\\r\\n\\uFEFF]');
730
- var wordRegex = '(' + escapedText + ')';
731
- return wholeWord ? '(?:^|\\s|' + punctuation$1() + ')' + wordRegex + ('(?=$|\\s|' + punctuation$1() + ')') : wordRegex;
732
- };
733
- var find$2 = function (editor, currentSearchState, text, matchCase, wholeWord, inSelection) {
734
- var escapedText = escapeSearchText(text, wholeWord);
735
- var pattern = {
736
- regex: new RegExp(escapedText, matchCase ? 'g' : 'gi'),
737
- matchIndex: 1
738
- };
739
- var count = markAllMatches(editor, currentSearchState, pattern, inSelection);
740
- if (count) {
741
- var newIndex = moveSelection(editor, currentSearchState, true);
742
- currentSearchState.set({
743
- index: newIndex,
744
- count: count,
745
- text: text,
746
- matchCase: matchCase,
747
- wholeWord: wholeWord,
748
- inSelection: inSelection
749
- });
750
- }
751
- return count;
752
- };
753
- var next = function (editor, currentSearchState) {
754
- var index = moveSelection(editor, currentSearchState, true);
755
- currentSearchState.set(__assign(__assign({}, currentSearchState.get()), { index: index }));
756
- };
757
- var prev = function (editor, currentSearchState) {
758
- var index = moveSelection(editor, currentSearchState, false);
759
- currentSearchState.set(__assign(__assign({}, currentSearchState.get()), { index: index }));
760
- };
761
- var isMatchSpan = function (node) {
762
- var matchIndex = getElmIndex(node);
763
- return matchIndex !== null && matchIndex.length > 0;
764
- };
765
- var replace = function (editor, currentSearchState, text, forward, all) {
766
- var searchState = currentSearchState.get();
767
- var currentIndex = searchState.index;
768
- var currentMatchIndex, nextIndex = currentIndex;
769
- forward = forward !== false;
770
- var node = editor.getBody();
771
- var nodes = global$1.grep(global$1.toArray(node.getElementsByTagName('span')), isMatchSpan);
772
- for (var i = 0; i < nodes.length; i++) {
773
- var nodeIndex = getElmIndex(nodes[i]);
774
- var matchIndex = currentMatchIndex = parseInt(nodeIndex, 10);
775
- if (all || matchIndex === searchState.index) {
776
- if (text.length) {
777
- nodes[i].firstChild.nodeValue = text;
778
- unwrap(nodes[i]);
779
- }
780
- else {
781
- removeNode(editor.dom, nodes[i]);
782
- }
783
- while (nodes[++i]) {
784
- matchIndex = parseInt(getElmIndex(nodes[i]), 10);
785
- if (matchIndex === currentMatchIndex) {
786
- removeNode(editor.dom, nodes[i]);
787
- }
788
- else {
789
- i--;
790
- break;
791
- }
792
- }
793
- if (forward) {
794
- nextIndex--;
795
- }
796
- }
797
- else if (currentMatchIndex > currentIndex) {
798
- nodes[i].setAttribute('data-mce-index', String(currentMatchIndex - 1));
799
- }
800
- }
801
- currentSearchState.set(__assign(__assign({}, searchState), {
802
- count: all ? 0 : searchState.count - 1,
803
- index: nextIndex
804
- }));
805
- if (forward) {
806
- next(editor, currentSearchState);
807
- }
808
- else {
809
- prev(editor, currentSearchState);
810
- }
811
- return !all && currentSearchState.get().count > 0;
812
- };
813
- var done = function (editor, currentSearchState, keepEditorSelection) {
814
- var i, startContainer, endContainer;
815
- var searchState = currentSearchState.get();
816
- var nodes = global$1.toArray(editor.getBody().getElementsByTagName('span'));
817
- for (i = 0; i < nodes.length; i++) {
818
- var nodeIndex = getElmIndex(nodes[i]);
819
- if (nodeIndex !== null && nodeIndex.length) {
820
- if (nodeIndex === searchState.index.toString()) {
821
- if (!startContainer) {
822
- startContainer = nodes[i].firstChild;
823
- }
824
- endContainer = nodes[i].firstChild;
825
- }
826
- unwrap(nodes[i]);
827
- }
828
- }
829
- currentSearchState.set(__assign(__assign({}, searchState), {
830
- index: -1,
831
- count: 0,
832
- text: ''
833
- }));
834
- if (startContainer && endContainer) {
835
- var rng = editor.dom.createRng();
836
- rng.setStart(startContainer, 0);
837
- rng.setEnd(endContainer, endContainer.data.length);
838
- if (keepEditorSelection !== false) {
839
- editor.selection.setRng(rng);
840
- }
841
- return rng;
842
- }
843
- };
844
- var hasNext = function (editor, currentSearchState) {
845
- return currentSearchState.get().count > 1;
846
- };
847
- var hasPrev = function (editor, currentSearchState) {
848
- return currentSearchState.get().count > 1;
849
- };
850
- var get$1 = function (editor, currentState) {
851
- var done$1 = function (keepEditorSelection) {
852
- return done(editor, currentState, keepEditorSelection);
853
- };
854
- var find = function (text, matchCase, wholeWord, inSelection) {
855
- if (inSelection === void 0) {
856
- inSelection = false;
857
- }
858
- return find$2(editor, currentState, text, matchCase, wholeWord, inSelection);
859
- };
860
- var next$1 = function () {
861
- return next(editor, currentState);
862
- };
863
- var prev$1 = function () {
864
- return prev(editor, currentState);
865
- };
866
- var replace$1 = function (text, forward, all) {
867
- return replace(editor, currentState, text, forward, all);
868
- };
869
- return {
870
- done: done$1,
871
- find: find,
872
- next: next$1,
873
- prev: prev$1,
874
- replace: replace$1
875
- };
876
- };
877
- var value = function () {
878
- var subject = Cell(Optional.none());
879
- var clear = function () {
880
- return subject.set(Optional.none());
881
- };
882
- var set = function (s) {
883
- return subject.set(Optional.some(s));
884
- };
885
- var isSet = function () {
886
- return subject.get().isSome();
887
- };
888
- var on = function (f) {
889
- return subject.get().each(f);
890
- };
891
- return {
892
- clear: clear,
893
- set: set,
894
- isSet: isSet,
895
- on: on
896
- };
897
- };
898
- var global$3 = tinymce.util.Tools.resolve('tinymce.Env');
899
- var open = function (editor, currentSearchState) {
900
- var dialogApi = value();
901
- editor.undoManager.add();
902
- var selectedText = global$1.trim(editor.selection.getContent({ format: 'text' }));
903
- var updateButtonStates = function (api) {
904
- var updateNext = hasNext(editor, currentSearchState) ? api.enable : api.disable;
905
- updateNext('next');
906
- var updatePrev = hasPrev(editor, currentSearchState) ? api.enable : api.disable;
907
- updatePrev('prev');
908
- };
909
- var updateSearchState = function (api) {
910
- var data = api.getData();
911
- var current = currentSearchState.get();
912
- currentSearchState.set(__assign(__assign({}, current), {
913
- matchCase: data.matchcase,
914
- wholeWord: data.wholewords,
915
- inSelection: data.inselection
916
- }));
917
- };
918
- var disableAll = function (api, disable) {
919
- var buttons = [
920
- 'replace',
921
- 'replaceall',
922
- 'prev',
923
- 'next'
924
- ];
925
- var toggle = disable ? api.disable : api.enable;
926
- each(buttons, toggle);
927
- };
928
- var notFoundAlert = function (api) {
929
- editor.windowManager.alert('Could not find the specified string.', function () {
930
- api.focus('findtext');
931
- });
932
- };
933
- var focusButtonIfRequired = function (api, name) {
934
- if (global$3.browser.isSafari() && global$3.deviceType.isTouch() && (name === 'find' || name === 'replace' || name === 'replaceall')) {
935
- api.focus(name);
936
- }
937
- };
938
- var reset = function (api) {
939
- done(editor, currentSearchState, false);
940
- disableAll(api, true);
941
- updateButtonStates(api);
942
- };
943
- var doFind = function (api) {
944
- var data = api.getData();
945
- var last = currentSearchState.get();
946
- if (!data.findtext.length) {
947
- reset(api);
948
- return;
949
- }
950
- if (last.text === data.findtext && last.matchCase === data.matchcase && last.wholeWord === data.wholewords) {
951
- next(editor, currentSearchState);
952
- }
953
- else {
954
- var count = find$2(editor, currentSearchState, data.findtext, data.matchcase, data.wholewords, data.inselection);
955
- if (count <= 0) {
956
- notFoundAlert(api);
957
- }
958
- disableAll(api, count === 0);
959
- }
960
- updateButtonStates(api);
961
- };
962
- var initialState = currentSearchState.get();
963
- var initialData = {
964
- findtext: selectedText,
965
- replacetext: '',
966
- wholewords: initialState.wholeWord,
967
- matchcase: initialState.matchCase,
968
- inselection: initialState.inSelection
969
- };
970
- var spec = {
971
- title: 'Find and Replace',
972
- size: 'normal',
973
- body: {
974
- type: 'panel',
975
- items: [
976
- {
977
- type: 'bar',
978
- items: [
979
- {
980
- type: 'input',
981
- name: 'findtext',
982
- placeholder: 'Find',
983
- maximized: true,
984
- inputMode: 'search'
985
- },
986
- {
987
- type: 'button',
988
- name: 'prev',
989
- text: 'Previous',
990
- icon: 'action-prev',
991
- disabled: true,
992
- borderless: true
993
- },
994
- {
995
- type: 'button',
996
- name: 'next',
997
- text: 'Next',
998
- icon: 'action-next',
999
- disabled: true,
1000
- borderless: true
1001
- }
1002
- ]
1003
- },
1004
- {
1005
- type: 'input',
1006
- name: 'replacetext',
1007
- placeholder: 'Replace with',
1008
- inputMode: 'search'
1009
- }
1010
- ]
1011
- },
1012
- buttons: [
1013
- {
1014
- type: 'menu',
1015
- name: 'options',
1016
- icon: 'preferences',
1017
- tooltip: 'Preferences',
1018
- align: 'start',
1019
- items: [
1020
- {
1021
- type: 'togglemenuitem',
1022
- name: 'matchcase',
1023
- text: 'Match case'
1024
- },
1025
- {
1026
- type: 'togglemenuitem',
1027
- name: 'wholewords',
1028
- text: 'Find whole words only'
1029
- },
1030
- {
1031
- type: 'togglemenuitem',
1032
- name: 'inselection',
1033
- text: 'Find in selection'
1034
- }
1035
- ]
1036
- },
1037
- {
1038
- type: 'custom',
1039
- name: 'find',
1040
- text: 'Find',
1041
- primary: true
1042
- },
1043
- {
1044
- type: 'custom',
1045
- name: 'replace',
1046
- text: 'Replace',
1047
- disabled: true
1048
- },
1049
- {
1050
- type: 'custom',
1051
- name: 'replaceall',
1052
- text: 'Replace all',
1053
- disabled: true
1054
- }
1055
- ],
1056
- initialData: initialData,
1057
- onChange: function (api, details) {
1058
- if (details.name === 'findtext' && currentSearchState.get().count > 0) {
1059
- reset(api);
1060
- }
1061
- },
1062
- onAction: function (api, details) {
1063
- var data = api.getData();
1064
- switch (details.name) {
1065
- case 'find':
1066
- doFind(api);
1067
- break;
1068
- case 'replace':
1069
- if (!replace(editor, currentSearchState, data.replacetext)) {
1070
- reset(api);
1071
- }
1072
- else {
1073
- updateButtonStates(api);
1074
- }
1075
- break;
1076
- case 'replaceall':
1077
- replace(editor, currentSearchState, data.replacetext, true, true);
1078
- reset(api);
1079
- break;
1080
- case 'prev':
1081
- prev(editor, currentSearchState);
1082
- updateButtonStates(api);
1083
- break;
1084
- case 'next':
1085
- next(editor, currentSearchState);
1086
- updateButtonStates(api);
1087
- break;
1088
- case 'matchcase':
1089
- case 'wholewords':
1090
- case 'inselection':
1091
- updateSearchState(api);
1092
- reset(api);
1093
- break;
1094
- }
1095
- focusButtonIfRequired(api, details.name);
1096
- },
1097
- onSubmit: function (api) {
1098
- doFind(api);
1099
- focusButtonIfRequired(api, 'find');
1100
- },
1101
- onClose: function () {
1102
- editor.focus();
1103
- done(editor, currentSearchState);
1104
- editor.undoManager.add();
1105
- }
1106
- };
1107
- dialogApi.set(editor.windowManager.open(spec, { inline: 'toolbar' }));
1108
- };
1109
- var register = function (editor, currentSearchState) {
1110
- editor.addCommand('SearchReplace', function () {
1111
- open(editor, currentSearchState);
1112
- });
1113
- };
1114
- var showDialog = function (editor, currentSearchState) {
1115
- return function () {
1116
- open(editor, currentSearchState);
1117
- };
1118
- };
1119
- var register$1 = function (editor, currentSearchState) {
1120
- editor.ui.registry.addMenuItem('searchreplace', {
1121
- text: 'Find and replace...',
1122
- shortcut: 'Meta+F',
1123
- onAction: showDialog(editor, currentSearchState),
1124
- icon: 'search'
1125
- });
1126
- editor.ui.registry.addButton('searchreplace', {
1127
- tooltip: 'Find and replace',
1128
- onAction: showDialog(editor, currentSearchState),
1129
- icon: 'search'
1130
- });
1131
- editor.shortcuts.add('Meta+F', '', showDialog(editor, currentSearchState));
1132
- };
1133
- function Plugin() {
1134
- global.add('searchreplace', function (editor) {
1135
- var currentSearchState = Cell({
1136
- index: -1,
1137
- count: 0,
1138
- text: '',
1139
- matchCase: false,
1140
- wholeWord: false,
1141
- inSelection: false
1142
- });
1143
- register(editor, currentSearchState);
1144
- register$1(editor, currentSearchState);
1145
- return get$1(editor, currentSearchState);
1146
- });
1147
- }
1148
- Plugin();
1149
- }());