argous 1.2.201 → 1.2.203

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