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,1747 +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 hasProPlugin = function (editor) {
27
- if (editor.hasPlugin('powerpaste', true)) {
28
- if (typeof window.console !== 'undefined' && window.console.log) {
29
- window.console.log('PowerPaste is incompatible with Paste plugin! Remove \'paste\' from the \'plugins\' option.');
30
- }
31
- return true;
32
- }
33
- else {
34
- return false;
35
- }
36
- };
37
- var get = function (clipboard, quirks) {
38
- return {
39
- clipboard: clipboard,
40
- quirks: quirks
41
- };
42
- };
43
- var isSimpleType = function (type) {
44
- return function (value) {
45
- return typeof value === type;
46
- };
47
- };
48
- var isNullable = function (a) {
49
- return a === null || a === undefined;
50
- };
51
- var isNonNullable = function (a) {
52
- return !isNullable(a);
53
- };
54
- var isFunction = isSimpleType('function');
55
- var noop = function () {
56
- };
57
- var constant = function (value) {
58
- return function () {
59
- return value;
60
- };
61
- };
62
- var never = constant(false);
63
- var always = constant(true);
64
- var none = function () {
65
- return NONE;
66
- };
67
- var NONE = function () {
68
- var eq = function (o) {
69
- return o.isNone();
70
- };
71
- var call = function (thunk) {
72
- return thunk();
73
- };
74
- var id = function (n) {
75
- return n;
76
- };
77
- var me = {
78
- fold: function (n, _s) {
79
- return n();
80
- },
81
- is: never,
82
- isSome: never,
83
- isNone: always,
84
- getOr: id,
85
- getOrThunk: call,
86
- getOrDie: function (msg) {
87
- throw new Error(msg || 'error: getOrDie called on none.');
88
- },
89
- getOrNull: constant(null),
90
- getOrUndefined: constant(undefined),
91
- or: id,
92
- orThunk: call,
93
- map: none,
94
- each: noop,
95
- bind: none,
96
- exists: never,
97
- forall: always,
98
- filter: none,
99
- equals: eq,
100
- equals_: eq,
101
- toArray: function () {
102
- return [];
103
- },
104
- toString: constant('none()')
105
- };
106
- return me;
107
- }();
108
- var some = function (a) {
109
- var constant_a = constant(a);
110
- var self = function () {
111
- return me;
112
- };
113
- var bind = function (f) {
114
- return f(a);
115
- };
116
- var me = {
117
- fold: function (n, s) {
118
- return s(a);
119
- },
120
- is: function (v) {
121
- return a === v;
122
- },
123
- isSome: always,
124
- isNone: never,
125
- getOr: constant_a,
126
- getOrThunk: constant_a,
127
- getOrDie: constant_a,
128
- getOrNull: constant_a,
129
- getOrUndefined: constant_a,
130
- or: self,
131
- orThunk: self,
132
- map: function (f) {
133
- return some(f(a));
134
- },
135
- each: function (f) {
136
- f(a);
137
- },
138
- bind: bind,
139
- exists: bind,
140
- forall: bind,
141
- filter: function (f) {
142
- return f(a) ? me : NONE;
143
- },
144
- toArray: function () {
145
- return [a];
146
- },
147
- toString: function () {
148
- return 'some(' + a + ')';
149
- },
150
- equals: function (o) {
151
- return o.is(a);
152
- },
153
- equals_: function (o, elementEq) {
154
- return o.fold(never, function (b) {
155
- return elementEq(a, b);
156
- });
157
- }
158
- };
159
- return me;
160
- };
161
- var from = function (value) {
162
- return value === null || value === undefined ? NONE : some(value);
163
- };
164
- var Optional = {
165
- some: some,
166
- none: none,
167
- from: from
168
- };
169
- var nativeSlice = Array.prototype.slice;
170
- var exists = function (xs, pred) {
171
- for (var i = 0, len = xs.length; i < len; i++) {
172
- var x = xs[i];
173
- if (pred(x, i)) {
174
- return true;
175
- }
176
- }
177
- return false;
178
- };
179
- var map = function (xs, f) {
180
- var len = xs.length;
181
- var r = new Array(len);
182
- for (var i = 0; i < len; i++) {
183
- var x = xs[i];
184
- r[i] = f(x, i);
185
- }
186
- return r;
187
- };
188
- var each = function (xs, f) {
189
- for (var i = 0, len = xs.length; i < len; i++) {
190
- var x = xs[i];
191
- f(x, i);
192
- }
193
- };
194
- var filter = function (xs, pred) {
195
- var r = [];
196
- for (var i = 0, len = xs.length; i < len; i++) {
197
- var x = xs[i];
198
- if (pred(x, i)) {
199
- r.push(x);
200
- }
201
- }
202
- return r;
203
- };
204
- var foldl = function (xs, f, acc) {
205
- each(xs, function (x) {
206
- acc = f(acc, x);
207
- });
208
- return acc;
209
- };
210
- var from$1 = isFunction(Array.from) ? Array.from : function (x) {
211
- return nativeSlice.call(x);
212
- };
213
- var value = function () {
214
- var subject = Cell(Optional.none());
215
- var clear = function () {
216
- return subject.set(Optional.none());
217
- };
218
- var set = function (s) {
219
- return subject.set(Optional.some(s));
220
- };
221
- var isSet = function () {
222
- return subject.get().isSome();
223
- };
224
- var on = function (f) {
225
- return subject.get().each(f);
226
- };
227
- return {
228
- clear: clear,
229
- set: set,
230
- isSet: isSet,
231
- on: on
232
- };
233
- };
234
- var checkRange = function (str, substr, start) {
235
- return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;
236
- };
237
- var startsWith = function (str, prefix) {
238
- return checkRange(str, prefix, 0);
239
- };
240
- var endsWith = function (str, suffix) {
241
- return checkRange(str, suffix, str.length - suffix.length);
242
- };
243
- var repeat = function (s, count) {
244
- return count <= 0 ? '' : new Array(count + 1).join(s);
245
- };
246
- var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
247
- var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay');
248
- var global$3 = tinymce.util.Tools.resolve('tinymce.util.Promise');
249
- var global$4 = tinymce.util.Tools.resolve('tinymce.util.VK');
250
- var firePastePreProcess = function (editor, html, internal, isWordHtml) {
251
- return editor.fire('PastePreProcess', {
252
- content: html,
253
- internal: internal,
254
- wordContent: isWordHtml
255
- });
256
- };
257
- var firePastePostProcess = function (editor, node, internal, isWordHtml) {
258
- return editor.fire('PastePostProcess', {
259
- node: node,
260
- internal: internal,
261
- wordContent: isWordHtml
262
- });
263
- };
264
- var firePastePlainTextToggle = function (editor, state) {
265
- return editor.fire('PastePlainTextToggle', { state: state });
266
- };
267
- var firePaste = function (editor, ieFake) {
268
- return editor.fire('paste', { ieFake: ieFake });
269
- };
270
- var global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools');
271
- var shouldBlockDrop = function (editor) {
272
- return editor.getParam('paste_block_drop', false);
273
- };
274
- var shouldPasteDataImages = function (editor) {
275
- return editor.getParam('paste_data_images', false);
276
- };
277
- var shouldFilterDrop = function (editor) {
278
- return editor.getParam('paste_filter_drop', true);
279
- };
280
- var getPreProcess = function (editor) {
281
- return editor.getParam('paste_preprocess');
282
- };
283
- var getPostProcess = function (editor) {
284
- return editor.getParam('paste_postprocess');
285
- };
286
- var getWebkitStyles = function (editor) {
287
- return editor.getParam('paste_webkit_styles');
288
- };
289
- var shouldRemoveWebKitStyles = function (editor) {
290
- return editor.getParam('paste_remove_styles_if_webkit', true);
291
- };
292
- var shouldMergeFormats = function (editor) {
293
- return editor.getParam('paste_merge_formats', true);
294
- };
295
- var isSmartPasteEnabled = function (editor) {
296
- return editor.getParam('smart_paste', true);
297
- };
298
- var isPasteAsTextEnabled = function (editor) {
299
- return editor.getParam('paste_as_text', false);
300
- };
301
- var getRetainStyleProps = function (editor) {
302
- return editor.getParam('paste_retain_style_properties');
303
- };
304
- var getWordValidElements = function (editor) {
305
- var defaultValidElements = '-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,' + '-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,' + 'td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody';
306
- return editor.getParam('paste_word_valid_elements', defaultValidElements);
307
- };
308
- var shouldConvertWordFakeLists = function (editor) {
309
- return editor.getParam('paste_convert_word_fake_lists', true);
310
- };
311
- var shouldUseDefaultFilters = function (editor) {
312
- return editor.getParam('paste_enable_default_filters', true);
313
- };
314
- var getValidate = function (editor) {
315
- return editor.getParam('validate');
316
- };
317
- var getAllowHtmlDataUrls = function (editor) {
318
- return editor.getParam('allow_html_data_urls', false, 'boolean');
319
- };
320
- var getPasteDataImages = function (editor) {
321
- return editor.getParam('paste_data_images', false, 'boolean');
322
- };
323
- var getImagesDataImgFilter = function (editor) {
324
- return editor.getParam('images_dataimg_filter');
325
- };
326
- var getImagesReuseFilename = function (editor) {
327
- return editor.getParam('images_reuse_filename');
328
- };
329
- var getForcedRootBlock = function (editor) {
330
- return editor.getParam('forced_root_block');
331
- };
332
- var getForcedRootBlockAttrs = function (editor) {
333
- return editor.getParam('forced_root_block_attrs');
334
- };
335
- var getTabSpaces = function (editor) {
336
- return editor.getParam('paste_tab_spaces', 4, 'number');
337
- };
338
- var getAllowedImageFileTypes = function (editor) {
339
- var defaultImageFileTypes = 'jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp';
340
- return global$5.explode(editor.getParam('images_file_types', defaultImageFileTypes, 'string'));
341
- };
342
- var internalMimeType = 'x-tinymce/html';
343
- var internalMark = '<!-- ' + internalMimeType + ' -->';
344
- var mark = function (html) {
345
- return internalMark + html;
346
- };
347
- var unmark = function (html) {
348
- return html.replace(internalMark, '');
349
- };
350
- var isMarked = function (html) {
351
- return html.indexOf(internalMark) !== -1;
352
- };
353
- var internalHtmlMime = function () {
354
- return internalMimeType;
355
- };
356
- var global$6 = tinymce.util.Tools.resolve('tinymce.html.Entities');
357
- var isPlainText = function (text) {
358
- return !/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(text);
359
- };
360
- var toBRs = function (text) {
361
- return text.replace(/\r?\n/g, '<br>');
362
- };
363
- var openContainer = function (rootTag, rootAttrs) {
364
- var key;
365
- var attrs = [];
366
- var tag = '<' + rootTag;
367
- if (typeof rootAttrs === 'object') {
368
- for (key in rootAttrs) {
369
- if (rootAttrs.hasOwnProperty(key)) {
370
- attrs.push(key + '="' + global$6.encodeAllRaw(rootAttrs[key]) + '"');
371
- }
372
- }
373
- if (attrs.length) {
374
- tag += ' ' + attrs.join(' ');
375
- }
376
- }
377
- return tag + '>';
378
- };
379
- var toBlockElements = function (text, rootTag, rootAttrs) {
380
- var blocks = text.split(/\n\n/);
381
- var tagOpen = openContainer(rootTag, rootAttrs);
382
- var tagClose = '</' + rootTag + '>';
383
- var paragraphs = global$5.map(blocks, function (p) {
384
- return p.split(/\n/).join('<br />');
385
- });
386
- var stitch = function (p) {
387
- return tagOpen + p + tagClose;
388
- };
389
- return paragraphs.length === 1 ? paragraphs[0] : global$5.map(paragraphs, stitch).join('');
390
- };
391
- var convert = function (text, rootTag, rootAttrs) {
392
- return rootTag ? toBlockElements(text, rootTag === true ? 'p' : rootTag, rootAttrs) : toBRs(text);
393
- };
394
- var global$7 = tinymce.util.Tools.resolve('tinymce.html.DomParser');
395
- var global$8 = tinymce.util.Tools.resolve('tinymce.html.Serializer');
396
- var nbsp = '\xA0';
397
- var global$9 = tinymce.util.Tools.resolve('tinymce.html.Node');
398
- var global$a = tinymce.util.Tools.resolve('tinymce.html.Schema');
399
- var filter$1 = function (content, items) {
400
- global$5.each(items, function (v) {
401
- if (v.constructor === RegExp) {
402
- content = content.replace(v, '');
403
- }
404
- else {
405
- content = content.replace(v[0], v[1]);
406
- }
407
- });
408
- return content;
409
- };
410
- var innerText = function (html) {
411
- var schema = global$a();
412
- var domParser = global$7({}, schema);
413
- var text = '';
414
- var shortEndedElements = schema.getShortEndedElements();
415
- var ignoreElements = global$5.makeMap('script noscript style textarea video audio iframe object', ' ');
416
- var blockElements = schema.getBlockElements();
417
- var walk = function (node) {
418
- var name = node.name, currentNode = node;
419
- if (name === 'br') {
420
- text += '\n';
421
- return;
422
- }
423
- if (name === 'wbr') {
424
- return;
425
- }
426
- if (shortEndedElements[name]) {
427
- text += ' ';
428
- }
429
- if (ignoreElements[name]) {
430
- text += ' ';
431
- return;
432
- }
433
- if (node.type === 3) {
434
- text += node.value;
435
- }
436
- if (!node.shortEnded) {
437
- if (node = node.firstChild) {
438
- do {
439
- walk(node);
440
- } while (node = node.next);
441
- }
442
- }
443
- if (blockElements[name] && currentNode.next) {
444
- text += '\n';
445
- if (name === 'p') {
446
- text += '\n';
447
- }
448
- }
449
- };
450
- html = filter$1(html, [/<!\[[^\]]+\]>/g]);
451
- walk(domParser.parse(html));
452
- return text;
453
- };
454
- var trimHtml = function (html) {
455
- var trimSpaces = function (all, s1, s2) {
456
- if (!s1 && !s2) {
457
- return ' ';
458
- }
459
- return nbsp;
460
- };
461
- html = filter$1(html, [
462
- /^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/ig,
463
- /<!--StartFragment-->|<!--EndFragment-->/g,
464
- [
465
- /( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,
466
- trimSpaces
467
- ],
468
- /<br class="Apple-interchange-newline">/g,
469
- /<br>$/i
470
- ]);
471
- return html;
472
- };
473
- var createIdGenerator = function (prefix) {
474
- var count = 0;
475
- return function () {
476
- return prefix + count++;
477
- };
478
- };
479
- var getImageMimeType = function (ext) {
480
- var lowerExt = ext.toLowerCase();
481
- var mimeOverrides = {
482
- jpg: 'jpeg',
483
- jpe: 'jpeg',
484
- jfi: 'jpeg',
485
- jif: 'jpeg',
486
- jfif: 'jpeg',
487
- pjpeg: 'jpeg',
488
- pjp: 'jpeg',
489
- svg: 'svg+xml'
490
- };
491
- return global$5.hasOwn(mimeOverrides, lowerExt) ? 'image/' + mimeOverrides[lowerExt] : 'image/' + lowerExt;
492
- };
493
- var isWordContent = function (content) {
494
- return /<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument/i.test(content) || /class="OutlineElement/.test(content) || /id="?docs\-internal\-guid\-/.test(content);
495
- };
496
- var isNumericList = function (text) {
497
- var found;
498
- var patterns = [
499
- /^[IVXLMCD]+\.[ \u00a0]/,
500
- /^[ivxlmcd]+\.[ \u00a0]/,
501
- /^[a-z]{1,2}[\.\)][ \u00a0]/,
502
- /^[A-Z]{1,2}[\.\)][ \u00a0]/,
503
- /^[0-9]+\.[ \u00a0]/,
504
- /^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,
505
- /^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/
506
- ];
507
- text = text.replace(/^[\u00a0 ]+/, '');
508
- global$5.each(patterns, function (pattern) {
509
- if (pattern.test(text)) {
510
- found = true;
511
- return false;
512
- }
513
- });
514
- return found;
515
- };
516
- var isBulletList = function (text) {
517
- return /^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(text);
518
- };
519
- var convertFakeListsToProperLists = function (node) {
520
- var currentListNode, prevListNode, lastLevel = 1;
521
- var getText = function (node) {
522
- var txt = '';
523
- if (node.type === 3) {
524
- return node.value;
525
- }
526
- if (node = node.firstChild) {
527
- do {
528
- txt += getText(node);
529
- } while (node = node.next);
530
- }
531
- return txt;
532
- };
533
- var trimListStart = function (node, regExp) {
534
- if (node.type === 3) {
535
- if (regExp.test(node.value)) {
536
- node.value = node.value.replace(regExp, '');
537
- return false;
538
- }
539
- }
540
- if (node = node.firstChild) {
541
- do {
542
- if (!trimListStart(node, regExp)) {
543
- return false;
544
- }
545
- } while (node = node.next);
546
- }
547
- return true;
548
- };
549
- var removeIgnoredNodes = function (node) {
550
- if (node._listIgnore) {
551
- node.remove();
552
- return;
553
- }
554
- if (node = node.firstChild) {
555
- do {
556
- removeIgnoredNodes(node);
557
- } while (node = node.next);
558
- }
559
- };
560
- var convertParagraphToLi = function (paragraphNode, listName, start) {
561
- var level = paragraphNode._listLevel || lastLevel;
562
- if (level !== lastLevel) {
563
- if (level < lastLevel) {
564
- if (currentListNode) {
565
- currentListNode = currentListNode.parent.parent;
566
- }
567
- }
568
- else {
569
- prevListNode = currentListNode;
570
- currentListNode = null;
571
- }
572
- }
573
- if (!currentListNode || currentListNode.name !== listName) {
574
- prevListNode = prevListNode || currentListNode;
575
- currentListNode = new global$9(listName, 1);
576
- if (start > 1) {
577
- currentListNode.attr('start', '' + start);
578
- }
579
- paragraphNode.wrap(currentListNode);
580
- }
581
- else {
582
- currentListNode.append(paragraphNode);
583
- }
584
- paragraphNode.name = 'li';
585
- if (level > lastLevel && prevListNode) {
586
- prevListNode.lastChild.append(currentListNode);
587
- }
588
- lastLevel = level;
589
- removeIgnoredNodes(paragraphNode);
590
- trimListStart(paragraphNode, /^\u00a0+/);
591
- trimListStart(paragraphNode, /^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/);
592
- trimListStart(paragraphNode, /^\u00a0+/);
593
- };
594
- var elements = [];
595
- var child = node.firstChild;
596
- while (typeof child !== 'undefined' && child !== null) {
597
- elements.push(child);
598
- child = child.walk();
599
- if (child !== null) {
600
- while (typeof child !== 'undefined' && child.parent !== node) {
601
- child = child.walk();
602
- }
603
- }
604
- }
605
- for (var i = 0; i < elements.length; i++) {
606
- node = elements[i];
607
- if (node.name === 'p' && node.firstChild) {
608
- var nodeText = getText(node);
609
- if (isBulletList(nodeText)) {
610
- convertParagraphToLi(node, 'ul');
611
- continue;
612
- }
613
- if (isNumericList(nodeText)) {
614
- var matches = /([0-9]+)\./.exec(nodeText);
615
- var start = 1;
616
- if (matches) {
617
- start = parseInt(matches[1], 10);
618
- }
619
- convertParagraphToLi(node, 'ol', start);
620
- continue;
621
- }
622
- if (node._listLevel) {
623
- convertParagraphToLi(node, 'ul', 1);
624
- continue;
625
- }
626
- currentListNode = null;
627
- }
628
- else {
629
- prevListNode = currentListNode;
630
- currentListNode = null;
631
- }
632
- }
633
- };
634
- var filterStyles = function (editor, validStyles, node, styleValue) {
635
- var outputStyles = {}, matches;
636
- var styles = editor.dom.parseStyle(styleValue);
637
- global$5.each(styles, function (value, name) {
638
- switch (name) {
639
- case 'mso-list':
640
- matches = /\w+ \w+([0-9]+)/i.exec(styleValue);
641
- if (matches) {
642
- node._listLevel = parseInt(matches[1], 10);
643
- }
644
- if (/Ignore/i.test(value) && node.firstChild) {
645
- node._listIgnore = true;
646
- node.firstChild._listIgnore = true;
647
- }
648
- break;
649
- case 'horiz-align':
650
- name = 'text-align';
651
- break;
652
- case 'vert-align':
653
- name = 'vertical-align';
654
- break;
655
- case 'font-color':
656
- case 'mso-foreground':
657
- name = 'color';
658
- break;
659
- case 'mso-background':
660
- case 'mso-highlight':
661
- name = 'background';
662
- break;
663
- case 'font-weight':
664
- case 'font-style':
665
- if (value !== 'normal') {
666
- outputStyles[name] = value;
667
- }
668
- return;
669
- case 'mso-element':
670
- if (/^(comment|comment-list)$/i.test(value)) {
671
- node.remove();
672
- return;
673
- }
674
- break;
675
- }
676
- if (name.indexOf('mso-comment') === 0) {
677
- node.remove();
678
- return;
679
- }
680
- if (name.indexOf('mso-') === 0) {
681
- return;
682
- }
683
- if (getRetainStyleProps(editor) === 'all' || validStyles && validStyles[name]) {
684
- outputStyles[name] = value;
685
- }
686
- });
687
- if (/(bold)/i.test(outputStyles['font-weight'])) {
688
- delete outputStyles['font-weight'];
689
- node.wrap(new global$9('b', 1));
690
- }
691
- if (/(italic)/i.test(outputStyles['font-style'])) {
692
- delete outputStyles['font-style'];
693
- node.wrap(new global$9('i', 1));
694
- }
695
- outputStyles = editor.dom.serializeStyle(outputStyles, node.name);
696
- if (outputStyles) {
697
- return outputStyles;
698
- }
699
- return null;
700
- };
701
- var filterWordContent = function (editor, content) {
702
- var validStyles;
703
- var retainStyleProperties = getRetainStyleProps(editor);
704
- if (retainStyleProperties) {
705
- validStyles = global$5.makeMap(retainStyleProperties.split(/[, ]/));
706
- }
707
- content = filter$1(content, [
708
- /<br class="?Apple-interchange-newline"?>/gi,
709
- /<b[^>]+id="?docs-internal-[^>]*>/gi,
710
- /<!--[\s\S]+?-->/gi,
711
- /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,
712
- [
713
- /<(\/?)s>/gi,
714
- '<$1strike>'
715
- ],
716
- [
717
- /&nbsp;/gi,
718
- nbsp
719
- ],
720
- [
721
- /<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,
722
- function (str, spaces) {
723
- return spaces.length > 0 ? spaces.replace(/./, ' ').slice(Math.floor(spaces.length / 2)).split('').join(nbsp) : '';
724
- }
725
- ]
726
- ]);
727
- var validElements = getWordValidElements(editor);
728
- var schema = global$a({
729
- valid_elements: validElements,
730
- valid_children: '-li[p]'
731
- });
732
- global$5.each(schema.elements, function (rule) {
733
- if (!rule.attributes.class) {
734
- rule.attributes.class = {};
735
- rule.attributesOrder.push('class');
736
- }
737
- if (!rule.attributes.style) {
738
- rule.attributes.style = {};
739
- rule.attributesOrder.push('style');
740
- }
741
- });
742
- var domParser = global$7({}, schema);
743
- domParser.addAttributeFilter('style', function (nodes) {
744
- var i = nodes.length, node;
745
- while (i--) {
746
- node = nodes[i];
747
- node.attr('style', filterStyles(editor, validStyles, node, node.attr('style')));
748
- if (node.name === 'span' && node.parent && !node.attributes.length) {
749
- node.unwrap();
750
- }
751
- }
752
- });
753
- domParser.addAttributeFilter('class', function (nodes) {
754
- var i = nodes.length, node, className;
755
- while (i--) {
756
- node = nodes[i];
757
- className = node.attr('class');
758
- if (/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(className)) {
759
- node.remove();
760
- }
761
- node.attr('class', null);
762
- }
763
- });
764
- domParser.addNodeFilter('del', function (nodes) {
765
- var i = nodes.length;
766
- while (i--) {
767
- nodes[i].remove();
768
- }
769
- });
770
- domParser.addNodeFilter('a', function (nodes) {
771
- var i = nodes.length, node, href, name;
772
- while (i--) {
773
- node = nodes[i];
774
- href = node.attr('href');
775
- name = node.attr('name');
776
- if (href && href.indexOf('#_msocom_') !== -1) {
777
- node.remove();
778
- continue;
779
- }
780
- if (href && href.indexOf('file://') === 0) {
781
- href = href.split('#')[1];
782
- if (href) {
783
- href = '#' + href;
784
- }
785
- }
786
- if (!href && !name) {
787
- node.unwrap();
788
- }
789
- else {
790
- if (name && !/^_?(?:toc|edn|ftn)/i.test(name)) {
791
- node.unwrap();
792
- continue;
793
- }
794
- node.attr({
795
- href: href,
796
- name: name
797
- });
798
- }
799
- }
800
- });
801
- var rootNode = domParser.parse(content);
802
- if (shouldConvertWordFakeLists(editor)) {
803
- convertFakeListsToProperLists(rootNode);
804
- }
805
- content = global$8({ validate: getValidate(editor) }, schema).serialize(rootNode);
806
- return content;
807
- };
808
- var preProcess = function (editor, content) {
809
- return shouldUseDefaultFilters(editor) ? filterWordContent(editor, content) : content;
810
- };
811
- var preProcess$1 = function (editor, html) {
812
- var parser = global$7({}, editor.schema);
813
- parser.addNodeFilter('meta', function (nodes) {
814
- global$5.each(nodes, function (node) {
815
- node.remove();
816
- });
817
- });
818
- var fragment = parser.parse(html, {
819
- forced_root_block: false,
820
- isRootContent: true
821
- });
822
- return global$8({ validate: getValidate(editor) }, editor.schema).serialize(fragment);
823
- };
824
- var processResult = function (content, cancelled) {
825
- return {
826
- content: content,
827
- cancelled: cancelled
828
- };
829
- };
830
- var postProcessFilter = function (editor, html, internal, isWordHtml) {
831
- var tempBody = editor.dom.create('div', { style: 'display:none' }, html);
832
- var postProcessArgs = firePastePostProcess(editor, tempBody, internal, isWordHtml);
833
- return processResult(postProcessArgs.node.innerHTML, postProcessArgs.isDefaultPrevented());
834
- };
835
- var filterContent = function (editor, content, internal, isWordHtml) {
836
- var preProcessArgs = firePastePreProcess(editor, content, internal, isWordHtml);
837
- var filteredContent = preProcess$1(editor, preProcessArgs.content);
838
- if (editor.hasEventListeners('PastePostProcess') && !preProcessArgs.isDefaultPrevented()) {
839
- return postProcessFilter(editor, filteredContent, internal, isWordHtml);
840
- }
841
- else {
842
- return processResult(filteredContent, preProcessArgs.isDefaultPrevented());
843
- }
844
- };
845
- var process = function (editor, html, internal) {
846
- var isWordHtml = isWordContent(html);
847
- var content = isWordHtml ? preProcess(editor, html) : html;
848
- return filterContent(editor, content, internal, isWordHtml);
849
- };
850
- var pasteHtml = function (editor, html) {
851
- editor.insertContent(html, {
852
- merge: shouldMergeFormats(editor),
853
- paste: true
854
- });
855
- return true;
856
- };
857
- var isAbsoluteUrl = function (url) {
858
- return /^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(url);
859
- };
860
- var isImageUrl = function (editor, url) {
861
- return isAbsoluteUrl(url) && exists(getAllowedImageFileTypes(editor), function (type) {
862
- return endsWith(url.toLowerCase(), '.' + type.toLowerCase());
863
- });
864
- };
865
- var createImage = function (editor, url, pasteHtmlFn) {
866
- editor.undoManager.extra(function () {
867
- pasteHtmlFn(editor, url);
868
- }, function () {
869
- editor.insertContent('<img src="' + url + '">');
870
- });
871
- return true;
872
- };
873
- var createLink = function (editor, url, pasteHtmlFn) {
874
- editor.undoManager.extra(function () {
875
- pasteHtmlFn(editor, url);
876
- }, function () {
877
- editor.execCommand('mceInsertLink', false, url);
878
- });
879
- return true;
880
- };
881
- var linkSelection = function (editor, html, pasteHtmlFn) {
882
- return editor.selection.isCollapsed() === false && isAbsoluteUrl(html) ? createLink(editor, html, pasteHtmlFn) : false;
883
- };
884
- var insertImage = function (editor, html, pasteHtmlFn) {
885
- return isImageUrl(editor, html) ? createImage(editor, html, pasteHtmlFn) : false;
886
- };
887
- var smartInsertContent = function (editor, html) {
888
- global$5.each([
889
- linkSelection,
890
- insertImage,
891
- pasteHtml
892
- ], function (action) {
893
- return action(editor, html, pasteHtml) !== true;
894
- });
895
- };
896
- var insertContent = function (editor, html, pasteAsText) {
897
- if (pasteAsText || isSmartPasteEnabled(editor) === false) {
898
- pasteHtml(editor, html);
899
- }
900
- else {
901
- smartInsertContent(editor, html);
902
- }
903
- };
904
- var isCollapsibleWhitespace = function (c) {
905
- return ' \f\t\x0B'.indexOf(c) !== -1;
906
- };
907
- var isNewLineChar = function (c) {
908
- return c === '\n' || c === '\r';
909
- };
910
- var isNewline = function (text, idx) {
911
- return idx < text.length && idx >= 0 ? isNewLineChar(text[idx]) : false;
912
- };
913
- var normalizeWhitespace = function (editor, text) {
914
- var tabSpace = repeat(' ', getTabSpaces(editor));
915
- var normalizedText = text.replace(/\t/g, tabSpace);
916
- var result = foldl(normalizedText, function (acc, c) {
917
- if (isCollapsibleWhitespace(c) || c === nbsp) {
918
- if (acc.pcIsSpace || acc.str === '' || acc.str.length === normalizedText.length - 1 || isNewline(normalizedText, acc.str.length + 1)) {
919
- return {
920
- pcIsSpace: false,
921
- str: acc.str + nbsp
922
- };
923
- }
924
- else {
925
- return {
926
- pcIsSpace: true,
927
- str: acc.str + ' '
928
- };
929
- }
930
- }
931
- else {
932
- return {
933
- pcIsSpace: isNewLineChar(c),
934
- str: acc.str + c
935
- };
936
- }
937
- }, {
938
- pcIsSpace: false,
939
- str: ''
940
- });
941
- return result.str;
942
- };
943
- var doPaste = function (editor, content, internal, pasteAsText) {
944
- var args = process(editor, content, internal);
945
- if (args.cancelled === false) {
946
- insertContent(editor, args.content, pasteAsText);
947
- }
948
- };
949
- var pasteHtml$1 = function (editor, html, internalFlag) {
950
- var internal = internalFlag ? internalFlag : isMarked(html);
951
- doPaste(editor, unmark(html), internal, false);
952
- };
953
- var pasteText = function (editor, text) {
954
- var encodedText = editor.dom.encode(text).replace(/\r\n/g, '\n');
955
- var normalizedText = normalizeWhitespace(editor, encodedText);
956
- var html = convert(normalizedText, getForcedRootBlock(editor), getForcedRootBlockAttrs(editor));
957
- doPaste(editor, html, false, true);
958
- };
959
- var getDataTransferItems = function (dataTransfer) {
960
- var items = {};
961
- var mceInternalUrlPrefix = 'data:text/mce-internal,';
962
- if (dataTransfer) {
963
- if (dataTransfer.getData) {
964
- var legacyText = dataTransfer.getData('Text');
965
- if (legacyText && legacyText.length > 0) {
966
- if (legacyText.indexOf(mceInternalUrlPrefix) === -1) {
967
- items['text/plain'] = legacyText;
968
- }
969
- }
970
- }
971
- if (dataTransfer.types) {
972
- for (var i = 0; i < dataTransfer.types.length; i++) {
973
- var contentType = dataTransfer.types[i];
974
- try {
975
- items[contentType] = dataTransfer.getData(contentType);
976
- }
977
- catch (ex) {
978
- items[contentType] = '';
979
- }
980
- }
981
- }
982
- }
983
- return items;
984
- };
985
- var getClipboardContent = function (editor, clipboardEvent) {
986
- return getDataTransferItems(clipboardEvent.clipboardData || editor.getDoc().dataTransfer);
987
- };
988
- var hasContentType = function (clipboardContent, mimeType) {
989
- return mimeType in clipboardContent && clipboardContent[mimeType].length > 0;
990
- };
991
- var hasHtmlOrText = function (content) {
992
- return hasContentType(content, 'text/html') || hasContentType(content, 'text/plain');
993
- };
994
- var parseDataUri = function (uri) {
995
- var matches = /data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(uri);
996
- if (matches) {
997
- return {
998
- type: matches[1],
999
- data: decodeURIComponent(matches[2])
1000
- };
1001
- }
1002
- else {
1003
- return {
1004
- type: null,
1005
- data: null
1006
- };
1007
- }
1008
- };
1009
- var isValidDataUriImage = function (editor, imgElm) {
1010
- var filter = getImagesDataImgFilter(editor);
1011
- return filter ? filter(imgElm) : true;
1012
- };
1013
- var extractFilename = function (editor, str) {
1014
- var m = str.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);
1015
- return isNonNullable(m) ? editor.dom.encode(m[1]) : null;
1016
- };
1017
- var uniqueId = createIdGenerator('mceclip');
1018
- var pasteImage = function (editor, imageItem) {
1019
- var _a = parseDataUri(imageItem.uri), base64 = _a.data, type = _a.type;
1020
- var id = uniqueId();
1021
- var file = imageItem.blob;
1022
- var img = new Image();
1023
- img.src = imageItem.uri;
1024
- if (isValidDataUriImage(editor, img)) {
1025
- var blobCache = editor.editorUpload.blobCache;
1026
- var blobInfo = void 0;
1027
- var existingBlobInfo = blobCache.getByData(base64, type);
1028
- if (!existingBlobInfo) {
1029
- var useFileName = getImagesReuseFilename(editor) && isNonNullable(file.name);
1030
- var name_1 = useFileName ? extractFilename(editor, file.name) : id;
1031
- var filename = useFileName ? file.name : undefined;
1032
- blobInfo = blobCache.create(id, file, base64, name_1, filename);
1033
- blobCache.add(blobInfo);
1034
- }
1035
- else {
1036
- blobInfo = existingBlobInfo;
1037
- }
1038
- pasteHtml$1(editor, '<img src="' + blobInfo.blobUri() + '">', false);
1039
- }
1040
- else {
1041
- pasteHtml$1(editor, '<img src="' + imageItem.uri + '">', false);
1042
- }
1043
- };
1044
- var isClipboardEvent = function (event) {
1045
- return event.type === 'paste';
1046
- };
1047
- var isDataTransferItem = function (item) {
1048
- return isNonNullable(item.getAsFile);
1049
- };
1050
- var readFilesAsDataUris = function (items) {
1051
- return global$3.all(map(items, function (item) {
1052
- return new global$3(function (resolve) {
1053
- var blob = isDataTransferItem(item) ? item.getAsFile() : item;
1054
- var reader = new window.FileReader();
1055
- reader.onload = function () {
1056
- resolve({
1057
- blob: blob,
1058
- uri: reader.result
1059
- });
1060
- };
1061
- reader.readAsDataURL(blob);
1062
- });
1063
- }));
1064
- };
1065
- var isImage = function (editor) {
1066
- var allowedExtensions = getAllowedImageFileTypes(editor);
1067
- return function (file) {
1068
- return startsWith(file.type, 'image/') && exists(allowedExtensions, function (extension) {
1069
- return getImageMimeType(extension) === file.type;
1070
- });
1071
- };
1072
- };
1073
- var getImagesFromDataTransfer = function (editor, dataTransfer) {
1074
- var items = dataTransfer.items ? map(from$1(dataTransfer.items), function (item) {
1075
- return item.getAsFile();
1076
- }) : [];
1077
- var files = dataTransfer.files ? from$1(dataTransfer.files) : [];
1078
- return filter(items.length > 0 ? items : files, isImage(editor));
1079
- };
1080
- var pasteImageData = function (editor, e, rng) {
1081
- var dataTransfer = isClipboardEvent(e) ? e.clipboardData : e.dataTransfer;
1082
- if (getPasteDataImages(editor) && dataTransfer) {
1083
- var images = getImagesFromDataTransfer(editor, dataTransfer);
1084
- if (images.length > 0) {
1085
- e.preventDefault();
1086
- readFilesAsDataUris(images).then(function (fileResults) {
1087
- if (rng) {
1088
- editor.selection.setRng(rng);
1089
- }
1090
- each(fileResults, function (result) {
1091
- pasteImage(editor, result);
1092
- });
1093
- });
1094
- return true;
1095
- }
1096
- }
1097
- return false;
1098
- };
1099
- var isBrokenAndroidClipboardEvent = function (e) {
1100
- var clipboardData = e.clipboardData;
1101
- return navigator.userAgent.indexOf('Android') !== -1 && clipboardData && clipboardData.items && clipboardData.items.length === 0;
1102
- };
1103
- var isKeyboardPasteEvent = function (e) {
1104
- return global$4.metaKeyPressed(e) && e.keyCode === 86 || e.shiftKey && e.keyCode === 45;
1105
- };
1106
- var registerEventHandlers = function (editor, pasteBin, pasteFormat) {
1107
- var keyboardPasteEvent = value();
1108
- var keyboardPastePressed = value();
1109
- var keyboardPastePlainTextState;
1110
- editor.on('keyup', keyboardPastePressed.clear);
1111
- editor.on('keydown', function (e) {
1112
- var removePasteBinOnKeyUp = function (e) {
1113
- if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) {
1114
- pasteBin.remove();
1115
- }
1116
- };
1117
- if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) {
1118
- keyboardPastePlainTextState = e.shiftKey && e.keyCode === 86;
1119
- if (keyboardPastePlainTextState && global$1.webkit && navigator.userAgent.indexOf('Version/') !== -1) {
1120
- return;
1121
- }
1122
- e.stopImmediatePropagation();
1123
- keyboardPasteEvent.set(e);
1124
- keyboardPastePressed.set(true);
1125
- if (global$1.ie && keyboardPastePlainTextState) {
1126
- e.preventDefault();
1127
- firePaste(editor, true);
1128
- return;
1129
- }
1130
- pasteBin.remove();
1131
- pasteBin.create();
1132
- editor.once('keyup', removePasteBinOnKeyUp);
1133
- editor.once('paste', function () {
1134
- editor.off('keyup', removePasteBinOnKeyUp);
1135
- });
1136
- }
1137
- });
1138
- var insertClipboardContent = function (editor, clipboardContent, isKeyBoardPaste, plainTextMode, internal) {
1139
- var content;
1140
- if (hasContentType(clipboardContent, 'text/html')) {
1141
- content = clipboardContent['text/html'];
1142
- }
1143
- else {
1144
- content = pasteBin.getHtml();
1145
- internal = internal ? internal : isMarked(content);
1146
- if (pasteBin.isDefaultContent(content)) {
1147
- plainTextMode = true;
1148
- }
1149
- }
1150
- content = trimHtml(content);
1151
- pasteBin.remove();
1152
- var isPlainTextHtml = internal === false && isPlainText(content);
1153
- var isImage = isImageUrl(editor, content);
1154
- if (!content.length || isPlainTextHtml && !isImage) {
1155
- plainTextMode = true;
1156
- }
1157
- if (plainTextMode || isImage) {
1158
- if (hasContentType(clipboardContent, 'text/plain') && isPlainTextHtml) {
1159
- content = clipboardContent['text/plain'];
1160
- }
1161
- else {
1162
- content = innerText(content);
1163
- }
1164
- }
1165
- if (pasteBin.isDefaultContent(content)) {
1166
- if (!isKeyBoardPaste) {
1167
- editor.windowManager.alert('Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.');
1168
- }
1169
- return;
1170
- }
1171
- if (plainTextMode) {
1172
- pasteText(editor, content);
1173
- }
1174
- else {
1175
- pasteHtml$1(editor, content, internal);
1176
- }
1177
- };
1178
- var getLastRng = function () {
1179
- return pasteBin.getLastRng() || editor.selection.getRng();
1180
- };
1181
- editor.on('paste', function (e) {
1182
- var isKeyboardPaste = keyboardPasteEvent.isSet() || keyboardPastePressed.isSet();
1183
- if (isKeyboardPaste) {
1184
- keyboardPasteEvent.clear();
1185
- }
1186
- var clipboardContent = getClipboardContent(editor, e);
1187
- var plainTextMode = pasteFormat.get() === 'text' || keyboardPastePlainTextState;
1188
- var internal = hasContentType(clipboardContent, internalHtmlMime());
1189
- keyboardPastePlainTextState = false;
1190
- if (e.isDefaultPrevented() || isBrokenAndroidClipboardEvent(e)) {
1191
- pasteBin.remove();
1192
- return;
1193
- }
1194
- if (!hasHtmlOrText(clipboardContent) && pasteImageData(editor, e, getLastRng())) {
1195
- pasteBin.remove();
1196
- return;
1197
- }
1198
- if (!isKeyboardPaste) {
1199
- e.preventDefault();
1200
- }
1201
- if (global$1.ie && (!isKeyboardPaste || e.ieFake) && !hasContentType(clipboardContent, 'text/html')) {
1202
- pasteBin.create();
1203
- editor.dom.bind(pasteBin.getEl(), 'paste', function (e) {
1204
- e.stopPropagation();
1205
- });
1206
- editor.getDoc().execCommand('Paste', false, null);
1207
- clipboardContent['text/html'] = pasteBin.getHtml();
1208
- }
1209
- if (hasContentType(clipboardContent, 'text/html')) {
1210
- e.preventDefault();
1211
- if (!internal) {
1212
- internal = isMarked(clipboardContent['text/html']);
1213
- }
1214
- insertClipboardContent(editor, clipboardContent, isKeyboardPaste, plainTextMode, internal);
1215
- }
1216
- else {
1217
- global$2.setEditorTimeout(editor, function () {
1218
- insertClipboardContent(editor, clipboardContent, isKeyboardPaste, plainTextMode, internal);
1219
- }, 0);
1220
- }
1221
- });
1222
- };
1223
- var registerEventsAndFilters = function (editor, pasteBin, pasteFormat) {
1224
- registerEventHandlers(editor, pasteBin, pasteFormat);
1225
- var src;
1226
- editor.parser.addNodeFilter('img', function (nodes, name, args) {
1227
- var isPasteInsert = function (args) {
1228
- return args.data && args.data.paste === true;
1229
- };
1230
- var remove = function (node) {
1231
- if (!node.attr('data-mce-object') && src !== global$1.transparentSrc) {
1232
- node.remove();
1233
- }
1234
- };
1235
- var isWebKitFakeUrl = function (src) {
1236
- return src.indexOf('webkit-fake-url') === 0;
1237
- };
1238
- var isDataUri = function (src) {
1239
- return src.indexOf('data:') === 0;
1240
- };
1241
- if (!getPasteDataImages(editor) && isPasteInsert(args)) {
1242
- var i = nodes.length;
1243
- while (i--) {
1244
- src = nodes[i].attr('src');
1245
- if (!src) {
1246
- continue;
1247
- }
1248
- if (isWebKitFakeUrl(src)) {
1249
- remove(nodes[i]);
1250
- }
1251
- else if (!getAllowHtmlDataUrls(editor) && isDataUri(src)) {
1252
- remove(nodes[i]);
1253
- }
1254
- }
1255
- }
1256
- });
1257
- };
1258
- var getPasteBinParent = function (editor) {
1259
- return global$1.ie && editor.inline ? document.body : editor.getBody();
1260
- };
1261
- var isExternalPasteBin = function (editor) {
1262
- return getPasteBinParent(editor) !== editor.getBody();
1263
- };
1264
- var delegatePasteEvents = function (editor, pasteBinElm, pasteBinDefaultContent) {
1265
- if (isExternalPasteBin(editor)) {
1266
- editor.dom.bind(pasteBinElm, 'paste keyup', function (_e) {
1267
- if (!isDefault(editor, pasteBinDefaultContent)) {
1268
- editor.fire('paste');
1269
- }
1270
- });
1271
- }
1272
- };
1273
- var create = function (editor, lastRngCell, pasteBinDefaultContent) {
1274
- var dom = editor.dom, body = editor.getBody();
1275
- lastRngCell.set(editor.selection.getRng());
1276
- var pasteBinElm = editor.dom.add(getPasteBinParent(editor), 'div', {
1277
- 'id': 'mcepastebin',
1278
- 'class': 'mce-pastebin',
1279
- 'contentEditable': true,
1280
- 'data-mce-bogus': 'all',
1281
- 'style': 'position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0'
1282
- }, pasteBinDefaultContent);
1283
- if (global$1.ie || global$1.gecko) {
1284
- dom.setStyle(pasteBinElm, 'left', dom.getStyle(body, 'direction', true) === 'rtl' ? 65535 : -65535);
1285
- }
1286
- dom.bind(pasteBinElm, 'beforedeactivate focusin focusout', function (e) {
1287
- e.stopPropagation();
1288
- });
1289
- delegatePasteEvents(editor, pasteBinElm, pasteBinDefaultContent);
1290
- pasteBinElm.focus();
1291
- editor.selection.select(pasteBinElm, true);
1292
- };
1293
- var remove = function (editor, lastRngCell) {
1294
- if (getEl(editor)) {
1295
- var pasteBinClone = void 0;
1296
- var lastRng = lastRngCell.get();
1297
- while (pasteBinClone = editor.dom.get('mcepastebin')) {
1298
- editor.dom.remove(pasteBinClone);
1299
- editor.dom.unbind(pasteBinClone);
1300
- }
1301
- if (lastRng) {
1302
- editor.selection.setRng(lastRng);
1303
- }
1304
- }
1305
- lastRngCell.set(null);
1306
- };
1307
- var getEl = function (editor) {
1308
- return editor.dom.get('mcepastebin');
1309
- };
1310
- var getHtml = function (editor) {
1311
- var copyAndRemove = function (toElm, fromElm) {
1312
- toElm.appendChild(fromElm);
1313
- editor.dom.remove(fromElm, true);
1314
- };
1315
- var pasteBinClones = global$5.grep(getPasteBinParent(editor).childNodes, function (elm) {
1316
- return elm.id === 'mcepastebin';
1317
- });
1318
- var pasteBinElm = pasteBinClones.shift();
1319
- global$5.each(pasteBinClones, function (pasteBinClone) {
1320
- copyAndRemove(pasteBinElm, pasteBinClone);
1321
- });
1322
- var dirtyWrappers = editor.dom.select('div[id=mcepastebin]', pasteBinElm);
1323
- for (var i = dirtyWrappers.length - 1; i >= 0; i--) {
1324
- var cleanWrapper = editor.dom.create('div');
1325
- pasteBinElm.insertBefore(cleanWrapper, dirtyWrappers[i]);
1326
- copyAndRemove(cleanWrapper, dirtyWrappers[i]);
1327
- }
1328
- return pasteBinElm ? pasteBinElm.innerHTML : '';
1329
- };
1330
- var getLastRng = function (lastRng) {
1331
- return lastRng.get();
1332
- };
1333
- var isDefaultContent = function (pasteBinDefaultContent, content) {
1334
- return content === pasteBinDefaultContent;
1335
- };
1336
- var isPasteBin = function (elm) {
1337
- return elm && elm.id === 'mcepastebin';
1338
- };
1339
- var isDefault = function (editor, pasteBinDefaultContent) {
1340
- var pasteBinElm = getEl(editor);
1341
- return isPasteBin(pasteBinElm) && isDefaultContent(pasteBinDefaultContent, pasteBinElm.innerHTML);
1342
- };
1343
- var PasteBin = function (editor) {
1344
- var lastRng = Cell(null);
1345
- var pasteBinDefaultContent = '%MCEPASTEBIN%';
1346
- return {
1347
- create: function () {
1348
- return create(editor, lastRng, pasteBinDefaultContent);
1349
- },
1350
- remove: function () {
1351
- return remove(editor, lastRng);
1352
- },
1353
- getEl: function () {
1354
- return getEl(editor);
1355
- },
1356
- getHtml: function () {
1357
- return getHtml(editor);
1358
- },
1359
- getLastRng: function () {
1360
- return getLastRng(lastRng);
1361
- },
1362
- isDefault: function () {
1363
- return isDefault(editor, pasteBinDefaultContent);
1364
- },
1365
- isDefaultContent: function (content) {
1366
- return isDefaultContent(pasteBinDefaultContent, content);
1367
- }
1368
- };
1369
- };
1370
- var Clipboard = function (editor, pasteFormat) {
1371
- var pasteBin = PasteBin(editor);
1372
- editor.on('PreInit', function () {
1373
- return registerEventsAndFilters(editor, pasteBin, pasteFormat);
1374
- });
1375
- return {
1376
- pasteFormat: pasteFormat,
1377
- pasteHtml: function (html, internalFlag) {
1378
- return pasteHtml$1(editor, html, internalFlag);
1379
- },
1380
- pasteText: function (text) {
1381
- return pasteText(editor, text);
1382
- },
1383
- pasteImageData: function (e, rng) {
1384
- return pasteImageData(editor, e, rng);
1385
- },
1386
- getDataTransferItems: getDataTransferItems,
1387
- hasHtmlOrText: hasHtmlOrText,
1388
- hasContentType: hasContentType
1389
- };
1390
- };
1391
- var togglePlainTextPaste = function (editor, clipboard) {
1392
- if (clipboard.pasteFormat.get() === 'text') {
1393
- clipboard.pasteFormat.set('html');
1394
- firePastePlainTextToggle(editor, false);
1395
- }
1396
- else {
1397
- clipboard.pasteFormat.set('text');
1398
- firePastePlainTextToggle(editor, true);
1399
- }
1400
- editor.focus();
1401
- };
1402
- var register = function (editor, clipboard) {
1403
- editor.addCommand('mceTogglePlainTextPaste', function () {
1404
- togglePlainTextPaste(editor, clipboard);
1405
- });
1406
- editor.addCommand('mceInsertClipboardContent', function (ui, value) {
1407
- if (value.content) {
1408
- clipboard.pasteHtml(value.content, value.internal);
1409
- }
1410
- if (value.text) {
1411
- clipboard.pasteText(value.text);
1412
- }
1413
- });
1414
- };
1415
- var hasWorkingClipboardApi = function (clipboardData) {
1416
- return global$1.iOS === false && typeof (clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.setData) === 'function';
1417
- };
1418
- var setHtml5Clipboard = function (clipboardData, html, text) {
1419
- if (hasWorkingClipboardApi(clipboardData)) {
1420
- try {
1421
- clipboardData.clearData();
1422
- clipboardData.setData('text/html', html);
1423
- clipboardData.setData('text/plain', text);
1424
- clipboardData.setData(internalHtmlMime(), html);
1425
- return true;
1426
- }
1427
- catch (e) {
1428
- return false;
1429
- }
1430
- }
1431
- else {
1432
- return false;
1433
- }
1434
- };
1435
- var setClipboardData = function (evt, data, fallback, done) {
1436
- if (setHtml5Clipboard(evt.clipboardData, data.html, data.text)) {
1437
- evt.preventDefault();
1438
- done();
1439
- }
1440
- else {
1441
- fallback(data.html, done);
1442
- }
1443
- };
1444
- var fallback = function (editor) {
1445
- return function (html, done) {
1446
- var markedHtml = mark(html);
1447
- var outer = editor.dom.create('div', {
1448
- 'contenteditable': 'false',
1449
- 'data-mce-bogus': 'all'
1450
- });
1451
- var inner = editor.dom.create('div', { contenteditable: 'true' }, markedHtml);
1452
- editor.dom.setStyles(outer, {
1453
- position: 'fixed',
1454
- top: '0',
1455
- left: '-3000px',
1456
- width: '1000px',
1457
- overflow: 'hidden'
1458
- });
1459
- outer.appendChild(inner);
1460
- editor.dom.add(editor.getBody(), outer);
1461
- var range = editor.selection.getRng();
1462
- inner.focus();
1463
- var offscreenRange = editor.dom.createRng();
1464
- offscreenRange.selectNodeContents(inner);
1465
- editor.selection.setRng(offscreenRange);
1466
- global$2.setTimeout(function () {
1467
- editor.selection.setRng(range);
1468
- outer.parentNode.removeChild(outer);
1469
- done();
1470
- }, 0);
1471
- };
1472
- };
1473
- var getData = function (editor) {
1474
- return {
1475
- html: editor.selection.getContent({ contextual: true }),
1476
- text: editor.selection.getContent({ format: 'text' })
1477
- };
1478
- };
1479
- var isTableSelection = function (editor) {
1480
- return !!editor.dom.getParent(editor.selection.getStart(), 'td[data-mce-selected],th[data-mce-selected]', editor.getBody());
1481
- };
1482
- var hasSelectedContent = function (editor) {
1483
- return !editor.selection.isCollapsed() || isTableSelection(editor);
1484
- };
1485
- var cut = function (editor) {
1486
- return function (evt) {
1487
- if (hasSelectedContent(editor)) {
1488
- setClipboardData(evt, getData(editor), fallback(editor), function () {
1489
- if (global$1.browser.isChrome() || global$1.browser.isFirefox()) {
1490
- var rng_1 = editor.selection.getRng();
1491
- global$2.setEditorTimeout(editor, function () {
1492
- editor.selection.setRng(rng_1);
1493
- editor.execCommand('Delete');
1494
- }, 0);
1495
- }
1496
- else {
1497
- editor.execCommand('Delete');
1498
- }
1499
- });
1500
- }
1501
- };
1502
- };
1503
- var copy = function (editor) {
1504
- return function (evt) {
1505
- if (hasSelectedContent(editor)) {
1506
- setClipboardData(evt, getData(editor), fallback(editor), noop);
1507
- }
1508
- };
1509
- };
1510
- var register$1 = function (editor) {
1511
- editor.on('cut', cut(editor));
1512
- editor.on('copy', copy(editor));
1513
- };
1514
- var global$b = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils');
1515
- var getCaretRangeFromEvent = function (editor, e) {
1516
- return global$b.getCaretRangeFromPoint(e.clientX, e.clientY, editor.getDoc());
1517
- };
1518
- var isPlainTextFileUrl = function (content) {
1519
- var plainTextContent = content['text/plain'];
1520
- return plainTextContent ? plainTextContent.indexOf('file://') === 0 : false;
1521
- };
1522
- var setFocusedRange = function (editor, rng) {
1523
- editor.focus();
1524
- editor.selection.setRng(rng);
1525
- };
1526
- var setup = function (editor, clipboard, draggingInternallyState) {
1527
- if (shouldBlockDrop(editor)) {
1528
- editor.on('dragend dragover draggesture dragdrop drop drag', function (e) {
1529
- e.preventDefault();
1530
- e.stopPropagation();
1531
- });
1532
- }
1533
- if (!shouldPasteDataImages(editor)) {
1534
- editor.on('drop', function (e) {
1535
- var dataTransfer = e.dataTransfer;
1536
- if (dataTransfer && dataTransfer.files && dataTransfer.files.length > 0) {
1537
- e.preventDefault();
1538
- }
1539
- });
1540
- }
1541
- editor.on('drop', function (e) {
1542
- var rng = getCaretRangeFromEvent(editor, e);
1543
- if (e.isDefaultPrevented() || draggingInternallyState.get()) {
1544
- return;
1545
- }
1546
- var dropContent = clipboard.getDataTransferItems(e.dataTransfer);
1547
- var internal = clipboard.hasContentType(dropContent, internalHtmlMime());
1548
- if ((!clipboard.hasHtmlOrText(dropContent) || isPlainTextFileUrl(dropContent)) && clipboard.pasteImageData(e, rng)) {
1549
- return;
1550
- }
1551
- if (rng && shouldFilterDrop(editor)) {
1552
- var content_1 = dropContent['mce-internal'] || dropContent['text/html'] || dropContent['text/plain'];
1553
- if (content_1) {
1554
- e.preventDefault();
1555
- global$2.setEditorTimeout(editor, function () {
1556
- editor.undoManager.transact(function () {
1557
- if (dropContent['mce-internal']) {
1558
- editor.execCommand('Delete');
1559
- }
1560
- setFocusedRange(editor, rng);
1561
- content_1 = trimHtml(content_1);
1562
- if (!dropContent['text/html']) {
1563
- clipboard.pasteText(content_1);
1564
- }
1565
- else {
1566
- clipboard.pasteHtml(content_1, internal);
1567
- }
1568
- });
1569
- });
1570
- }
1571
- }
1572
- });
1573
- editor.on('dragstart', function (_e) {
1574
- draggingInternallyState.set(true);
1575
- });
1576
- editor.on('dragover dragend', function (e) {
1577
- if (shouldPasteDataImages(editor) && draggingInternallyState.get() === false) {
1578
- e.preventDefault();
1579
- setFocusedRange(editor, getCaretRangeFromEvent(editor, e));
1580
- }
1581
- if (e.type === 'dragend') {
1582
- draggingInternallyState.set(false);
1583
- }
1584
- });
1585
- };
1586
- var setup$1 = function (editor) {
1587
- var plugin = editor.plugins.paste;
1588
- var preProcess = getPreProcess(editor);
1589
- if (preProcess) {
1590
- editor.on('PastePreProcess', function (e) {
1591
- preProcess.call(plugin, plugin, e);
1592
- });
1593
- }
1594
- var postProcess = getPostProcess(editor);
1595
- if (postProcess) {
1596
- editor.on('PastePostProcess', function (e) {
1597
- postProcess.call(plugin, plugin, e);
1598
- });
1599
- }
1600
- };
1601
- var addPreProcessFilter = function (editor, filterFunc) {
1602
- editor.on('PastePreProcess', function (e) {
1603
- e.content = filterFunc(editor, e.content, e.internal, e.wordContent);
1604
- });
1605
- };
1606
- var addPostProcessFilter = function (editor, filterFunc) {
1607
- editor.on('PastePostProcess', function (e) {
1608
- filterFunc(editor, e.node);
1609
- });
1610
- };
1611
- var removeExplorerBrElementsAfterBlocks = function (editor, html) {
1612
- if (!isWordContent(html)) {
1613
- return html;
1614
- }
1615
- var blockElements = [];
1616
- global$5.each(editor.schema.getBlockElements(), function (block, blockName) {
1617
- blockElements.push(blockName);
1618
- });
1619
- var explorerBlocksRegExp = new RegExp('(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?(' + blockElements.join('|') + ')[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*', 'g');
1620
- html = filter$1(html, [[
1621
- explorerBlocksRegExp,
1622
- '$1'
1623
- ]]);
1624
- html = filter$1(html, [
1625
- [
1626
- /<br><br>/g,
1627
- '<BR><BR>'
1628
- ],
1629
- [
1630
- /<br>/g,
1631
- ' '
1632
- ],
1633
- [
1634
- /<BR><BR>/g,
1635
- '<br>'
1636
- ]
1637
- ]);
1638
- return html;
1639
- };
1640
- var removeWebKitStyles = function (editor, content, internal, isWordHtml) {
1641
- if (isWordHtml || internal) {
1642
- return content;
1643
- }
1644
- var webKitStylesSetting = getWebkitStyles(editor);
1645
- var webKitStyles;
1646
- if (shouldRemoveWebKitStyles(editor) === false || webKitStylesSetting === 'all') {
1647
- return content;
1648
- }
1649
- if (webKitStylesSetting) {
1650
- webKitStyles = webKitStylesSetting.split(/[, ]/);
1651
- }
1652
- if (webKitStyles) {
1653
- var dom_1 = editor.dom, node_1 = editor.selection.getNode();
1654
- content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, function (all, before, value, after) {
1655
- var inputStyles = dom_1.parseStyle(dom_1.decode(value));
1656
- var outputStyles = {};
1657
- if (webKitStyles === 'none') {
1658
- return before + after;
1659
- }
1660
- for (var i = 0; i < webKitStyles.length; i++) {
1661
- var inputValue = inputStyles[webKitStyles[i]], currentValue = dom_1.getStyle(node_1, webKitStyles[i], true);
1662
- if (/color/.test(webKitStyles[i])) {
1663
- inputValue = dom_1.toHex(inputValue);
1664
- currentValue = dom_1.toHex(currentValue);
1665
- }
1666
- if (currentValue !== inputValue) {
1667
- outputStyles[webKitStyles[i]] = inputValue;
1668
- }
1669
- }
1670
- outputStyles = dom_1.serializeStyle(outputStyles, 'span');
1671
- if (outputStyles) {
1672
- return before + ' style="' + outputStyles + '"' + after;
1673
- }
1674
- return before + after;
1675
- });
1676
- }
1677
- else {
1678
- content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, '$1$3');
1679
- }
1680
- content = content.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi, function (all, before, value, after) {
1681
- return before + ' style="' + value + '"' + after;
1682
- });
1683
- return content;
1684
- };
1685
- var removeUnderlineAndFontInAnchor = function (editor, root) {
1686
- editor.$('a', root).find('font,u').each(function (i, node) {
1687
- editor.dom.remove(node, true);
1688
- });
1689
- };
1690
- var setup$2 = function (editor) {
1691
- if (global$1.webkit) {
1692
- addPreProcessFilter(editor, removeWebKitStyles);
1693
- }
1694
- if (global$1.ie) {
1695
- addPreProcessFilter(editor, removeExplorerBrElementsAfterBlocks);
1696
- addPostProcessFilter(editor, removeUnderlineAndFontInAnchor);
1697
- }
1698
- };
1699
- var makeSetupHandler = function (editor, clipboard) {
1700
- return function (api) {
1701
- api.setActive(clipboard.pasteFormat.get() === 'text');
1702
- var pastePlainTextToggleHandler = function (e) {
1703
- return api.setActive(e.state);
1704
- };
1705
- editor.on('PastePlainTextToggle', pastePlainTextToggleHandler);
1706
- return function () {
1707
- return editor.off('PastePlainTextToggle', pastePlainTextToggleHandler);
1708
- };
1709
- };
1710
- };
1711
- var register$2 = function (editor, clipboard) {
1712
- editor.ui.registry.addToggleButton('pastetext', {
1713
- active: false,
1714
- icon: 'paste-text',
1715
- tooltip: 'Paste as text',
1716
- onAction: function () {
1717
- return editor.execCommand('mceTogglePlainTextPaste');
1718
- },
1719
- onSetup: makeSetupHandler(editor, clipboard)
1720
- });
1721
- editor.ui.registry.addToggleMenuItem('pastetext', {
1722
- text: 'Paste as text',
1723
- icon: 'paste-text',
1724
- onAction: function () {
1725
- return editor.execCommand('mceTogglePlainTextPaste');
1726
- },
1727
- onSetup: makeSetupHandler(editor, clipboard)
1728
- });
1729
- };
1730
- function Plugin() {
1731
- global.add('paste', function (editor) {
1732
- if (hasProPlugin(editor) === false) {
1733
- var draggingInternallyState = Cell(false);
1734
- var pasteFormat = Cell(isPasteAsTextEnabled(editor) ? 'text' : 'html');
1735
- var clipboard = Clipboard(editor, pasteFormat);
1736
- var quirks = setup$2(editor);
1737
- register$2(editor, clipboard);
1738
- register(editor, clipboard);
1739
- setup$1(editor);
1740
- register$1(editor);
1741
- setup(editor, clipboard, draggingInternallyState);
1742
- return get(clipboard, quirks);
1743
- }
1744
- });
1745
- }
1746
- Plugin();
1747
- }());