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,182 +1,142 @@
1
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)
2
+ * TinyMCE version 6.8.2 (2023-12-11)
8
3
  */
4
+
9
5
  (function () {
10
6
  'use strict';
11
7
 
12
- var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
8
+ var global$6 = tinymce.util.Tools.resolve('tinymce.PluginManager');
13
9
 
14
- var __assign = function () {
15
- __assign = Object.assign || function __assign(t) {
16
- for (var s, i = 1, n = arguments.length; i < n; i++) {
17
- s = arguments[i];
18
- for (var p in s)
19
- if (Object.prototype.hasOwnProperty.call(s, p))
20
- t[p] = s[p];
21
- }
22
- return t;
23
- };
24
- return __assign.apply(this, arguments);
10
+ const hasProto = (v, constructor, predicate) => {
11
+ var _a;
12
+ if (predicate(v, constructor.prototype)) {
13
+ return true;
14
+ } else {
15
+ return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
16
+ }
25
17
  };
26
-
27
- var typeOf = function (x) {
28
- var t = typeof x;
18
+ const typeOf = x => {
19
+ const t = typeof x;
29
20
  if (x === null) {
30
21
  return 'null';
31
- } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
22
+ } else if (t === 'object' && Array.isArray(x)) {
32
23
  return 'array';
33
- } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
24
+ } else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
34
25
  return 'string';
35
26
  } else {
36
27
  return t;
37
28
  }
38
29
  };
39
- var isType = function (type) {
40
- return function (value) {
41
- return typeOf(value) === type;
42
- };
43
- };
44
- var isString = isType('string');
45
- var isObject = isType('object');
46
- var isArray = isType('array');
47
- var isNullable = function (a) {
48
- return a === null || a === undefined;
49
- };
50
- var isNonNullable = function (a) {
51
- return !isNullable(a);
52
- };
30
+ const isType = type => value => typeOf(value) === type;
31
+ const isString = isType('string');
32
+ const isObject = isType('object');
33
+ const isArray = isType('array');
34
+ const isNullable = a => a === null || a === undefined;
35
+ const isNonNullable = a => !isNullable(a);
53
36
 
54
- var noop = function () {
55
- };
56
- var constant = function (value) {
57
- return function () {
58
- return value;
59
- };
60
- };
61
- var never = constant(false);
62
- var always = constant(true);
63
-
64
- var none = function () {
65
- return NONE;
66
- };
67
- var NONE = function () {
68
- var eq = function (o) {
69
- return o.isNone();
70
- };
71
- var call = function (thunk) {
72
- return thunk();
73
- };
74
- var id = function (n) {
75
- return n;
76
- };
77
- var me = {
78
- fold: function (n, _s) {
79
- return n();
80
- },
81
- is: never,
82
- isSome: never,
83
- isNone: always,
84
- getOr: id,
85
- getOrThunk: call,
86
- getOrDie: function (msg) {
87
- throw new Error(msg || 'error: getOrDie called on none.');
88
- },
89
- getOrNull: constant(null),
90
- getOrUndefined: constant(undefined),
91
- or: id,
92
- orThunk: call,
93
- map: none,
94
- each: noop,
95
- bind: none,
96
- exists: never,
97
- forall: always,
98
- filter: none,
99
- equals: eq,
100
- equals_: eq,
101
- toArray: function () {
102
- return [];
103
- },
104
- toString: constant('none()')
105
- };
106
- return me;
107
- }();
108
- var some = function (a) {
109
- var constant_a = constant(a);
110
- var self = function () {
111
- return me;
112
- };
113
- var bind = function (f) {
114
- return f(a);
115
- };
116
- var me = {
117
- fold: function (n, s) {
118
- return s(a);
119
- },
120
- is: function (v) {
121
- return a === v;
122
- },
123
- isSome: always,
124
- isNone: never,
125
- getOr: constant_a,
126
- getOrThunk: constant_a,
127
- getOrDie: constant_a,
128
- getOrNull: constant_a,
129
- getOrUndefined: constant_a,
130
- or: self,
131
- orThunk: self,
132
- map: function (f) {
133
- return some(f(a));
134
- },
135
- each: function (f) {
136
- f(a);
137
- },
138
- bind: bind,
139
- exists: bind,
140
- forall: bind,
141
- filter: function (f) {
142
- return f(a) ? me : NONE;
143
- },
144
- toArray: function () {
145
- return [a];
146
- },
147
- toString: function () {
148
- return 'some(' + a + ')';
149
- },
150
- equals: function (o) {
151
- return o.is(a);
152
- },
153
- equals_: function (o, elementEq) {
154
- return o.fold(never, function (b) {
155
- return elementEq(a, b);
156
- });
37
+ class Optional {
38
+ constructor(tag, value) {
39
+ this.tag = tag;
40
+ this.value = value;
41
+ }
42
+ static some(value) {
43
+ return new Optional(true, value);
44
+ }
45
+ static none() {
46
+ return Optional.singletonNone;
47
+ }
48
+ fold(onNone, onSome) {
49
+ if (this.tag) {
50
+ return onSome(this.value);
51
+ } else {
52
+ return onNone();
157
53
  }
158
- };
159
- return me;
160
- };
161
- var from = function (value) {
162
- return value === null || value === undefined ? NONE : some(value);
163
- };
164
- var Optional = {
165
- some: some,
166
- none: none,
167
- from: from
168
- };
54
+ }
55
+ isSome() {
56
+ return this.tag;
57
+ }
58
+ isNone() {
59
+ return !this.tag;
60
+ }
61
+ map(mapper) {
62
+ if (this.tag) {
63
+ return Optional.some(mapper(this.value));
64
+ } else {
65
+ return Optional.none();
66
+ }
67
+ }
68
+ bind(binder) {
69
+ if (this.tag) {
70
+ return binder(this.value);
71
+ } else {
72
+ return Optional.none();
73
+ }
74
+ }
75
+ exists(predicate) {
76
+ return this.tag && predicate(this.value);
77
+ }
78
+ forall(predicate) {
79
+ return !this.tag || predicate(this.value);
80
+ }
81
+ filter(predicate) {
82
+ if (!this.tag || predicate(this.value)) {
83
+ return this;
84
+ } else {
85
+ return Optional.none();
86
+ }
87
+ }
88
+ getOr(replacement) {
89
+ return this.tag ? this.value : replacement;
90
+ }
91
+ or(replacement) {
92
+ return this.tag ? this : replacement;
93
+ }
94
+ getOrThunk(thunk) {
95
+ return this.tag ? this.value : thunk();
96
+ }
97
+ orThunk(thunk) {
98
+ return this.tag ? this : thunk();
99
+ }
100
+ getOrDie(message) {
101
+ if (!this.tag) {
102
+ throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
103
+ } else {
104
+ return this.value;
105
+ }
106
+ }
107
+ static from(value) {
108
+ return isNonNullable(value) ? Optional.some(value) : Optional.none();
109
+ }
110
+ getOrNull() {
111
+ return this.tag ? this.value : null;
112
+ }
113
+ getOrUndefined() {
114
+ return this.value;
115
+ }
116
+ each(worker) {
117
+ if (this.tag) {
118
+ worker(this.value);
119
+ }
120
+ }
121
+ toArray() {
122
+ return this.tag ? [this.value] : [];
123
+ }
124
+ toString() {
125
+ return this.tag ? `some(${ this.value })` : 'none()';
126
+ }
127
+ }
128
+ Optional.singletonNone = new Optional(false);
169
129
 
170
- var nativePush = Array.prototype.push;
171
- var each = function (xs, f) {
172
- for (var i = 0, len = xs.length; i < len; i++) {
173
- var x = xs[i];
130
+ const nativePush = Array.prototype.push;
131
+ const each$1 = (xs, f) => {
132
+ for (let i = 0, len = xs.length; i < len; i++) {
133
+ const x = xs[i];
174
134
  f(x, i);
175
135
  }
176
136
  };
177
- var flatten = function (xs) {
178
- var r = [];
179
- for (var i = 0, len = xs.length; i < len; ++i) {
137
+ const flatten = xs => {
138
+ const r = [];
139
+ for (let i = 0, len = xs.length; i < len; ++i) {
180
140
  if (!isArray(xs[i])) {
181
141
  throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
182
142
  }
@@ -185,150 +145,138 @@
185
145
  return r;
186
146
  };
187
147
 
188
- var Cell = function (initial) {
189
- var value = initial;
190
- var get = function () {
148
+ const Cell = initial => {
149
+ let value = initial;
150
+ const get = () => {
191
151
  return value;
192
152
  };
193
- var set = function (v) {
153
+ const set = v => {
194
154
  value = v;
195
155
  };
196
156
  return {
197
- get: get,
198
- set: set
157
+ get,
158
+ set
199
159
  };
200
160
  };
201
161
 
202
- var keys = Object.keys;
203
- var hasOwnProperty = Object.hasOwnProperty;
204
- var each$1 = function (obj, f) {
205
- var props = keys(obj);
206
- for (var k = 0, len = props.length; k < len; k++) {
207
- var i = props[k];
208
- var x = obj[i];
162
+ const keys = Object.keys;
163
+ const hasOwnProperty = Object.hasOwnProperty;
164
+ const each = (obj, f) => {
165
+ const props = keys(obj);
166
+ for (let k = 0, len = props.length; k < len; k++) {
167
+ const i = props[k];
168
+ const x = obj[i];
209
169
  f(x, i);
210
170
  }
211
171
  };
212
- var get = function (obj, key) {
172
+ const get$1 = (obj, key) => {
213
173
  return has(obj, key) ? Optional.from(obj[key]) : Optional.none();
214
174
  };
215
- var has = function (obj, key) {
216
- return hasOwnProperty.call(obj, key);
217
- };
175
+ const has = (obj, key) => hasOwnProperty.call(obj, key);
218
176
 
219
- var getScripts = function (editor) {
220
- return editor.getParam('media_scripts');
221
- };
222
- var getAudioTemplateCallback = function (editor) {
223
- return editor.getParam('audio_template_callback');
224
- };
225
- var getVideoTemplateCallback = function (editor) {
226
- return editor.getParam('video_template_callback');
227
- };
228
- var hasLiveEmbeds = function (editor) {
229
- return editor.getParam('media_live_embeds', true);
230
- };
231
- var shouldFilterHtml = function (editor) {
232
- return editor.getParam('media_filter_html', true);
233
- };
234
- var getUrlResolver = function (editor) {
235
- return editor.getParam('media_url_resolver');
236
- };
237
- var hasAltSource = function (editor) {
238
- return editor.getParam('media_alt_source', true);
239
- };
240
- var hasPoster = function (editor) {
241
- return editor.getParam('media_poster', true);
242
- };
243
- var hasDimensions = function (editor) {
244
- return editor.getParam('media_dimensions', true);
177
+ const option = name => editor => editor.options.get(name);
178
+ const register$2 = editor => {
179
+ const registerOption = editor.options.register;
180
+ registerOption('audio_template_callback', { processor: 'function' });
181
+ registerOption('video_template_callback', { processor: 'function' });
182
+ registerOption('iframe_template_callback', { processor: 'function' });
183
+ registerOption('media_live_embeds', {
184
+ processor: 'boolean',
185
+ default: true
186
+ });
187
+ registerOption('media_filter_html', {
188
+ processor: 'boolean',
189
+ default: true
190
+ });
191
+ registerOption('media_url_resolver', { processor: 'function' });
192
+ registerOption('media_alt_source', {
193
+ processor: 'boolean',
194
+ default: true
195
+ });
196
+ registerOption('media_poster', {
197
+ processor: 'boolean',
198
+ default: true
199
+ });
200
+ registerOption('media_dimensions', {
201
+ processor: 'boolean',
202
+ default: true
203
+ });
245
204
  };
205
+ const getAudioTemplateCallback = option('audio_template_callback');
206
+ const getVideoTemplateCallback = option('video_template_callback');
207
+ const getIframeTemplateCallback = option('iframe_template_callback');
208
+ const hasLiveEmbeds = option('media_live_embeds');
209
+ const shouldFilterHtml = option('media_filter_html');
210
+ const getUrlResolver = option('media_url_resolver');
211
+ const hasAltSource = option('media_alt_source');
212
+ const hasPoster = option('media_poster');
213
+ const hasDimensions = option('media_dimensions');
246
214
 
247
- var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
215
+ var global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools');
248
216
 
249
- var global$2 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
217
+ var global$4 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
250
218
 
251
- var global$3 = tinymce.util.Tools.resolve('tinymce.html.SaxParser');
219
+ var global$3 = tinymce.util.Tools.resolve('tinymce.html.DomParser');
252
220
 
253
- var getVideoScriptMatch = function (prefixes, src) {
254
- if (prefixes) {
255
- for (var i = 0; i < prefixes.length; i++) {
256
- if (src.indexOf(prefixes[i].filter) !== -1) {
257
- return prefixes[i];
258
- }
259
- }
260
- }
261
- };
262
-
263
- var DOM = global$2.DOM;
264
- var trimPx = function (value) {
265
- return value.replace(/px$/, '');
266
- };
267
- var getEphoxEmbedData = function (attrs) {
268
- var style = attrs.map.style;
269
- var styles = style ? DOM.parseStyle(style) : {};
221
+ const DOM$1 = global$4.DOM;
222
+ const trimPx = value => value.replace(/px$/, '');
223
+ const getEphoxEmbedData = node => {
224
+ const style = node.attr('style');
225
+ const styles = style ? DOM$1.parseStyle(style) : {};
270
226
  return {
271
227
  type: 'ephox-embed-iri',
272
- source: attrs.map['data-ephox-embed-iri'],
228
+ source: node.attr('data-ephox-embed-iri'),
273
229
  altsource: '',
274
230
  poster: '',
275
- width: get(styles, 'max-width').map(trimPx).getOr(''),
276
- height: get(styles, 'max-height').map(trimPx).getOr('')
231
+ width: get$1(styles, 'max-width').map(trimPx).getOr(''),
232
+ height: get$1(styles, 'max-height').map(trimPx).getOr('')
277
233
  };
278
234
  };
279
- var htmlToData = function (prefixes, html) {
280
- var isEphoxEmbed = Cell(false);
281
- var data = {};
282
- global$3({
235
+ const htmlToData = (html, schema) => {
236
+ let data = {};
237
+ const parser = global$3({
283
238
  validate: false,
284
- allow_conditional_comments: true,
285
- start: function (name, attrs) {
286
- if (isEphoxEmbed.get()) ; else if (has(attrs.map, 'data-ephox-embed-iri')) {
287
- isEphoxEmbed.set(true);
288
- data = getEphoxEmbedData(attrs);
239
+ forced_root_block: false
240
+ }, schema);
241
+ const rootNode = parser.parse(html);
242
+ for (let node = rootNode; node; node = node.walk()) {
243
+ if (node.type === 1) {
244
+ const name = node.name;
245
+ if (node.attr('data-ephox-embed-iri')) {
246
+ data = getEphoxEmbedData(node);
247
+ break;
289
248
  } else {
290
249
  if (!data.source && name === 'param') {
291
- data.source = attrs.map.movie;
250
+ data.source = node.attr('movie');
292
251
  }
293
252
  if (name === 'iframe' || name === 'object' || name === 'embed' || name === 'video' || name === 'audio') {
294
253
  if (!data.type) {
295
254
  data.type = name;
296
255
  }
297
- data = global$1.extend(attrs.map, data);
298
- }
299
- if (name === 'script') {
300
- var videoScript = getVideoScriptMatch(prefixes, attrs.map.src);
301
- if (!videoScript) {
302
- return;
303
- }
304
- data = {
305
- type: 'script',
306
- source: attrs.map.src,
307
- width: String(videoScript.width),
308
- height: String(videoScript.height)
309
- };
256
+ data = global$5.extend(node.attributes.map, data);
310
257
  }
311
258
  if (name === 'source') {
312
259
  if (!data.source) {
313
- data.source = attrs.map.src;
260
+ data.source = node.attr('src');
314
261
  } else if (!data.altsource) {
315
- data.altsource = attrs.map.src;
262
+ data.altsource = node.attr('src');
316
263
  }
317
264
  }
318
265
  if (name === 'img' && !data.poster) {
319
- data.poster = attrs.map.src;
266
+ data.poster = node.attr('src');
320
267
  }
321
268
  }
322
269
  }
323
- }).parse(html);
324
- data.source = data.source || data.src || data.data;
270
+ }
271
+ data.source = data.source || data.src || '';
325
272
  data.altsource = data.altsource || '';
326
273
  data.poster = data.poster || '';
327
274
  return data;
328
275
  };
329
276
 
330
- var guess = function (url) {
331
- var mimes = {
277
+ const guess = url => {
278
+ var _a;
279
+ const mimes = {
332
280
  mp3: 'audio/mpeg',
333
281
  m4a: 'audio/x-m4a',
334
282
  wav: 'audio/wav',
@@ -337,77 +285,50 @@
337
285
  ogg: 'video/ogg',
338
286
  swf: 'application/x-shockwave-flash'
339
287
  };
340
- var fileEnd = url.toLowerCase().split('.').pop();
341
- var mime = mimes[fileEnd];
342
- return mime ? mime : '';
288
+ const fileEnd = (_a = url.toLowerCase().split('.').pop()) !== null && _a !== void 0 ? _a : '';
289
+ return get$1(mimes, fileEnd).getOr('');
343
290
  };
344
291
 
345
- var global$4 = tinymce.util.Tools.resolve('tinymce.html.Schema');
292
+ var global$2 = tinymce.util.Tools.resolve('tinymce.html.Node');
346
293
 
347
- var global$5 = tinymce.util.Tools.resolve('tinymce.html.Writer');
294
+ var global$1 = tinymce.util.Tools.resolve('tinymce.html.Serializer');
348
295
 
349
- var DOM$1 = global$2.DOM;
350
- var addPx = function (value) {
351
- return /^[0-9.]+$/.test(value) ? value + 'px' : value;
352
- };
353
- var setAttributes = function (attrs, updatedAttrs) {
354
- each$1(updatedAttrs, function (val, name) {
355
- var value = '' + val;
356
- if (attrs.map[name]) {
357
- var i = attrs.length;
358
- while (i--) {
359
- var attr = attrs[i];
360
- if (attr.name === name) {
361
- if (value) {
362
- attrs.map[name] = value;
363
- attr.value = value;
364
- } else {
365
- delete attrs.map[name];
366
- attrs.splice(i, 1);
367
- }
368
- }
369
- }
370
- } else if (value) {
371
- attrs.push({
372
- name: name,
373
- value: value
374
- });
375
- attrs.map[name] = value;
376
- }
377
- });
378
- };
379
- var updateEphoxEmbed = function (data, attrs) {
380
- var style = attrs.map.style;
381
- var styleMap = style ? DOM$1.parseStyle(style) : {};
382
- styleMap['max-width'] = addPx(data.width);
383
- styleMap['max-height'] = addPx(data.height);
384
- setAttributes(attrs, { style: DOM$1.serializeStyle(styleMap) });
296
+ const Parser = (schema, settings = {}) => global$3({
297
+ forced_root_block: false,
298
+ validate: false,
299
+ allow_conditional_comments: true,
300
+ ...settings
301
+ }, schema);
302
+
303
+ const DOM = global$4.DOM;
304
+ const addPx = value => /^[0-9.]+$/.test(value) ? value + 'px' : value;
305
+ const updateEphoxEmbed = (data, node) => {
306
+ const style = node.attr('style');
307
+ const styleMap = style ? DOM.parseStyle(style) : {};
308
+ if (isNonNullable(data.width)) {
309
+ styleMap['max-width'] = addPx(data.width);
310
+ }
311
+ if (isNonNullable(data.height)) {
312
+ styleMap['max-height'] = addPx(data.height);
313
+ }
314
+ node.attr('style', DOM.serializeStyle(styleMap));
385
315
  };
386
- var sources = [
316
+ const sources = [
387
317
  'source',
388
318
  'altsource'
389
319
  ];
390
- var updateHtml = function (html, data, updateAll) {
391
- var writer = global$5();
392
- var isEphoxEmbed = Cell(false);
393
- var sourceCount = 0;
394
- var hasImage;
395
- global$3({
396
- validate: false,
397
- allow_conditional_comments: true,
398
- comment: function (text) {
399
- writer.comment(text);
400
- },
401
- cdata: function (text) {
402
- writer.cdata(text);
403
- },
404
- text: function (text, raw) {
405
- writer.text(text, raw);
406
- },
407
- start: function (name, attrs, empty) {
408
- if (isEphoxEmbed.get()) ; else if (has(attrs.map, 'data-ephox-embed-iri')) {
409
- isEphoxEmbed.set(true);
410
- updateEphoxEmbed(data, attrs);
320
+ const updateHtml = (html, data, updateAll, schema) => {
321
+ let numSources = 0;
322
+ let sourceCount = 0;
323
+ const parser = Parser(schema);
324
+ parser.addNodeFilter('source', nodes => numSources = nodes.length);
325
+ const rootNode = parser.parse(html);
326
+ for (let node = rootNode; node; node = node.walk()) {
327
+ if (node.type === 1) {
328
+ const name = node.name;
329
+ if (node.attr('data-ephox-embed-iri')) {
330
+ updateEphoxEmbed(data, node);
331
+ break;
411
332
  } else {
412
333
  switch (name) {
413
334
  case 'video':
@@ -416,85 +337,64 @@
416
337
  case 'img':
417
338
  case 'iframe':
418
339
  if (data.height !== undefined && data.width !== undefined) {
419
- setAttributes(attrs, {
420
- width: data.width,
421
- height: data.height
422
- });
340
+ node.attr('width', data.width);
341
+ node.attr('height', data.height);
423
342
  }
424
343
  break;
425
344
  }
426
345
  if (updateAll) {
427
346
  switch (name) {
428
347
  case 'video':
429
- setAttributes(attrs, {
430
- poster: data.poster,
431
- src: ''
432
- });
433
- if (data.altsource) {
434
- setAttributes(attrs, { src: '' });
348
+ node.attr('poster', data.poster);
349
+ node.attr('src', null);
350
+ for (let index = numSources; index < 2; index++) {
351
+ if (data[sources[index]]) {
352
+ const source = new global$2('source', 1);
353
+ source.attr('src', data[sources[index]]);
354
+ source.attr('type', data[sources[index] + 'mime'] || null);
355
+ node.append(source);
356
+ }
435
357
  }
436
358
  break;
437
359
  case 'iframe':
438
- setAttributes(attrs, { src: data.source });
360
+ node.attr('src', data.source);
361
+ break;
362
+ case 'object':
363
+ const hasImage = node.getAll('img').length > 0;
364
+ if (data.poster && !hasImage) {
365
+ node.attr('src', data.poster);
366
+ const img = new global$2('img', 1);
367
+ img.attr('src', data.poster);
368
+ img.attr('width', data.width);
369
+ img.attr('height', data.height);
370
+ node.append(img);
371
+ }
439
372
  break;
440
373
  case 'source':
441
374
  if (sourceCount < 2) {
442
- setAttributes(attrs, {
443
- src: data[sources[sourceCount]],
444
- type: data[sources[sourceCount] + 'mime']
445
- });
375
+ node.attr('src', data[sources[sourceCount]]);
376
+ node.attr('type', data[sources[sourceCount] + 'mime'] || null);
446
377
  if (!data[sources[sourceCount]]) {
447
- return;
378
+ node.remove();
379
+ continue;
448
380
  }
449
381
  }
450
382
  sourceCount++;
451
383
  break;
452
384
  case 'img':
453
385
  if (!data.poster) {
454
- return;
386
+ node.remove();
455
387
  }
456
- hasImage = true;
457
388
  break;
458
389
  }
459
390
  }
460
391
  }
461
- writer.start(name, attrs, empty);
462
- },
463
- end: function (name) {
464
- if (!isEphoxEmbed.get()) {
465
- if (name === 'video' && updateAll) {
466
- for (var index = 0; index < 2; index++) {
467
- if (data[sources[index]]) {
468
- var attrs = [];
469
- attrs.map = {};
470
- if (sourceCount <= index) {
471
- setAttributes(attrs, {
472
- src: data[sources[index]],
473
- type: data[sources[index] + 'mime']
474
- });
475
- writer.start('source', attrs, true);
476
- }
477
- }
478
- }
479
- }
480
- if (data.poster && name === 'object' && updateAll && !hasImage) {
481
- var imgAttrs = [];
482
- imgAttrs.map = {};
483
- setAttributes(imgAttrs, {
484
- src: data.poster,
485
- width: data.width,
486
- height: data.height
487
- });
488
- writer.start('img', imgAttrs, true);
489
- }
490
- }
491
- writer.end(name);
492
392
  }
493
- }, global$4({})).parse(html);
494
- return writer.getContent();
393
+ }
394
+ return global$1({}, schema).serialize(rootNode);
495
395
  };
496
396
 
497
- var urlPatterns = [
397
+ const urlPatterns = [
498
398
  {
499
399
  regex: /youtu\.be\/([\w\-_\?&=.]+)/i,
500
400
  type: 'iframe',
@@ -519,6 +419,22 @@
519
419
  url: 'www.youtube.com/embed/$1',
520
420
  allowFullscreen: true
521
421
  },
422
+ {
423
+ regex: /vimeo\.com\/([0-9]+)\?h=(\w+)/,
424
+ type: 'iframe',
425
+ w: 425,
426
+ h: 350,
427
+ url: 'player.vimeo.com/video/$1?h=$2&title=0&byline=0&portrait=0&color=8dc7dc',
428
+ allowFullscreen: true
429
+ },
430
+ {
431
+ regex: /vimeo\.com\/(.*)\/([0-9]+)\?h=(\w+)/,
432
+ type: 'iframe',
433
+ w: 425,
434
+ h: 350,
435
+ url: 'player.vimeo.com/video/$2?h=$3&title=0&amp;byline=0',
436
+ allowFullscreen: true
437
+ },
522
438
  {
523
439
  regex: /vimeo\.com\/([0-9]+)/,
524
440
  type: 'iframe',
@@ -560,72 +476,69 @@
560
476
  allowFullscreen: true
561
477
  }
562
478
  ];
563
- var getProtocol = function (url) {
564
- var protocolMatches = url.match(/^(https?:\/\/|www\.)(.+)$/i);
479
+ const getProtocol = url => {
480
+ const protocolMatches = url.match(/^(https?:\/\/|www\.)(.+)$/i);
565
481
  if (protocolMatches && protocolMatches.length > 1) {
566
482
  return protocolMatches[1] === 'www.' ? 'https://' : protocolMatches[1];
567
483
  } else {
568
484
  return 'https://';
569
485
  }
570
486
  };
571
- var getUrl = function (pattern, url) {
572
- var protocol = getProtocol(url);
573
- var match = pattern.regex.exec(url);
574
- var newUrl = protocol + pattern.url;
575
- var _loop_1 = function (i) {
576
- newUrl = newUrl.replace('$' + i, function () {
577
- return match[i] ? match[i] : '';
578
- });
579
- };
580
- for (var i = 0; i < match.length; i++) {
581
- _loop_1(i);
487
+ const getUrl = (pattern, url) => {
488
+ const protocol = getProtocol(url);
489
+ const match = pattern.regex.exec(url);
490
+ let newUrl = protocol + pattern.url;
491
+ if (isNonNullable(match)) {
492
+ for (let i = 0; i < match.length; i++) {
493
+ newUrl = newUrl.replace('$' + i, () => match[i] ? match[i] : '');
494
+ }
582
495
  }
583
496
  return newUrl.replace(/\?$/, '');
584
497
  };
585
- var matchPattern = function (url) {
586
- var patterns = urlPatterns.filter(function (pattern) {
587
- return pattern.regex.test(url);
588
- });
498
+ const matchPattern = url => {
499
+ const patterns = urlPatterns.filter(pattern => pattern.regex.test(url));
589
500
  if (patterns.length > 0) {
590
- return global$1.extend({}, patterns[0], { url: getUrl(patterns[0], url) });
501
+ return global$5.extend({}, patterns[0], { url: getUrl(patterns[0], url) });
591
502
  } else {
592
503
  return null;
593
504
  }
594
505
  };
595
506
 
596
- var getIframeHtml = function (data) {
597
- var allowFullscreen = data.allowfullscreen ? ' allowFullscreen="1"' : '';
598
- return '<iframe src="' + data.source + '" width="' + data.width + '" height="' + data.height + '"' + allowFullscreen + '></iframe>';
507
+ const getIframeHtml = (data, iframeTemplateCallback) => {
508
+ if (iframeTemplateCallback) {
509
+ return iframeTemplateCallback(data);
510
+ } else {
511
+ const allowFullscreen = data.allowfullscreen ? ' allowFullscreen="1"' : '';
512
+ return '<iframe src="' + data.source + '" width="' + data.width + '" height="' + data.height + '"' + allowFullscreen + '></iframe>';
513
+ }
599
514
  };
600
- var getFlashHtml = function (data) {
601
- var html = '<object data="' + data.source + '" width="' + data.width + '" height="' + data.height + '" type="application/x-shockwave-flash">';
515
+ const getFlashHtml = data => {
516
+ let html = '<object data="' + data.source + '" width="' + data.width + '" height="' + data.height + '" type="application/x-shockwave-flash">';
602
517
  if (data.poster) {
603
518
  html += '<img src="' + data.poster + '" width="' + data.width + '" height="' + data.height + '" />';
604
519
  }
605
520
  html += '</object>';
606
521
  return html;
607
522
  };
608
- var getAudioHtml = function (data, audioTemplateCallback) {
523
+ const getAudioHtml = (data, audioTemplateCallback) => {
609
524
  if (audioTemplateCallback) {
610
525
  return audioTemplateCallback(data);
611
526
  } else {
612
527
  return '<audio controls="controls" src="' + data.source + '">' + (data.altsource ? '\n<source src="' + data.altsource + '"' + (data.altsourcemime ? ' type="' + data.altsourcemime + '"' : '') + ' />\n' : '') + '</audio>';
613
528
  }
614
529
  };
615
- var getVideoHtml = function (data, videoTemplateCallback) {
530
+ const getVideoHtml = (data, videoTemplateCallback) => {
616
531
  if (videoTemplateCallback) {
617
532
  return videoTemplateCallback(data);
618
533
  } else {
619
534
  return '<video width="' + data.width + '" height="' + data.height + '"' + (data.poster ? ' poster="' + data.poster + '"' : '') + ' controls="controls">\n' + '<source src="' + data.source + '"' + (data.sourcemime ? ' type="' + data.sourcemime + '"' : '') + ' />\n' + (data.altsource ? '<source src="' + data.altsource + '"' + (data.altsourcemime ? ' type="' + data.altsourcemime + '"' : '') + ' />\n' : '') + '</video>';
620
535
  }
621
536
  };
622
- var getScriptHtml = function (data) {
623
- return '<script src="' + data.source + '"></script>';
624
- };
625
- var dataToHtml = function (editor, dataIn) {
626
- var data = global$1.extend({}, dataIn);
537
+ const dataToHtml = (editor, dataIn) => {
538
+ var _a;
539
+ const data = global$5.extend({}, dataIn);
627
540
  if (!data.source) {
628
- global$1.extend(data, htmlToData(getScripts(editor), data.embed));
541
+ global$5.extend(data, htmlToData((_a = data.embed) !== null && _a !== void 0 ? _a : '', editor.schema));
629
542
  if (!data.source) {
630
543
  return '';
631
544
  }
@@ -641,7 +554,7 @@
641
554
  data.sourcemime = guess(data.source);
642
555
  data.altsourcemime = guess(data.altsource);
643
556
  data.poster = editor.convertURL(data.poster, 'poster');
644
- var pattern = matchPattern(data.source);
557
+ const pattern = matchPattern(data.source);
645
558
  if (pattern) {
646
559
  data.source = pattern.url;
647
560
  data.type = pattern.type;
@@ -650,41 +563,57 @@
650
563
  data.height = data.height || String(pattern.h);
651
564
  }
652
565
  if (data.embed) {
653
- return updateHtml(data.embed, data, true);
566
+ return updateHtml(data.embed, data, true, editor.schema);
654
567
  } else {
655
- var videoScript = getVideoScriptMatch(getScripts(editor), data.source);
656
- if (videoScript) {
657
- data.type = 'script';
658
- data.width = String(videoScript.width);
659
- data.height = String(videoScript.height);
660
- }
661
- var audioTemplateCallback = getAudioTemplateCallback(editor);
662
- var videoTemplateCallback = getVideoTemplateCallback(editor);
568
+ const audioTemplateCallback = getAudioTemplateCallback(editor);
569
+ const videoTemplateCallback = getVideoTemplateCallback(editor);
570
+ const iframeTemplateCallback = getIframeTemplateCallback(editor);
663
571
  data.width = data.width || '300';
664
572
  data.height = data.height || '150';
665
- global$1.each(data, function (value, key) {
573
+ global$5.each(data, (value, key) => {
666
574
  data[key] = editor.dom.encode('' + value);
667
575
  });
668
576
  if (data.type === 'iframe') {
669
- return getIframeHtml(data);
577
+ return getIframeHtml(data, iframeTemplateCallback);
670
578
  } else if (data.sourcemime === 'application/x-shockwave-flash') {
671
579
  return getFlashHtml(data);
672
580
  } else if (data.sourcemime.indexOf('audio') !== -1) {
673
581
  return getAudioHtml(data, audioTemplateCallback);
674
- } else if (data.type === 'script') {
675
- return getScriptHtml(data);
676
582
  } else {
677
583
  return getVideoHtml(data, videoTemplateCallback);
678
584
  }
679
585
  }
680
586
  };
681
587
 
682
- var global$6 = tinymce.util.Tools.resolve('tinymce.util.Promise');
588
+ const isMediaElement = element => element.hasAttribute('data-mce-object') || element.hasAttribute('data-ephox-embed-iri');
589
+ const setup$2 = editor => {
590
+ editor.on('click keyup touchend', () => {
591
+ const selectedNode = editor.selection.getNode();
592
+ if (selectedNode && editor.dom.hasClass(selectedNode, 'mce-preview-object')) {
593
+ if (editor.dom.getAttrib(selectedNode, 'data-mce-selected')) {
594
+ selectedNode.setAttribute('data-mce-selected', '2');
595
+ }
596
+ }
597
+ });
598
+ editor.on('ObjectResized', e => {
599
+ const target = e.target;
600
+ if (target.getAttribute('data-mce-object')) {
601
+ let html = target.getAttribute('data-mce-html');
602
+ if (html) {
603
+ html = unescape(html);
604
+ target.setAttribute('data-mce-html', escape(updateHtml(html, {
605
+ width: String(e.width),
606
+ height: String(e.height)
607
+ }, false, editor.schema)));
608
+ }
609
+ }
610
+ });
611
+ };
683
612
 
684
- var cache = {};
685
- var embedPromise = function (data, dataToHtml, handler) {
686
- return new global$6(function (res, rej) {
687
- var wrappedResolve = function (response) {
613
+ const cache = {};
614
+ const embedPromise = (data, dataToHtml, handler) => {
615
+ return new Promise((res, rej) => {
616
+ const wrappedResolve = response => {
688
617
  if (response.html) {
689
618
  cache[data.source] = response;
690
619
  }
@@ -700,139 +629,113 @@
700
629
  }
701
630
  });
702
631
  };
703
- var defaultPromise = function (data, dataToHtml) {
704
- return new global$6(function (res) {
705
- res({
706
- html: dataToHtml(data),
707
- url: data.source
708
- });
709
- });
710
- };
711
- var loadedData = function (editor) {
712
- return function (data) {
713
- return dataToHtml(editor, data);
714
- };
715
- };
716
- var getEmbedHtml = function (editor, data) {
717
- var embedHandler = getUrlResolver(editor);
632
+ const defaultPromise = (data, dataToHtml) => Promise.resolve({
633
+ html: dataToHtml(data),
634
+ url: data.source
635
+ });
636
+ const loadedData = editor => data => dataToHtml(editor, data);
637
+ const getEmbedHtml = (editor, data) => {
638
+ const embedHandler = getUrlResolver(editor);
718
639
  return embedHandler ? embedPromise(data, loadedData(editor), embedHandler) : defaultPromise(data, loadedData(editor));
719
640
  };
720
- var isCached = function (url) {
721
- return cache.hasOwnProperty(url);
722
- };
641
+ const isCached = url => has(cache, url);
723
642
 
724
- var extractMeta = function (sourceInput, data) {
725
- return get(data, sourceInput).bind(function (mainData) {
726
- return get(mainData, 'meta');
727
- });
728
- };
729
- var getValue = function (data, metaData, sourceInput) {
730
- return function (prop) {
731
- var _a;
732
- var getFromData = function () {
733
- return get(data, prop);
734
- };
735
- var getFromMetaData = function () {
736
- return get(metaData, prop);
737
- };
738
- var getNonEmptyValue = function (c) {
739
- return get(c, 'value').bind(function (v) {
740
- return v.length > 0 ? Optional.some(v) : Optional.none();
741
- });
742
- };
743
- var getFromValueFirst = function () {
744
- return getFromData().bind(function (child) {
745
- return isObject(child) ? getNonEmptyValue(child).orThunk(getFromMetaData) : getFromMetaData().orThunk(function () {
746
- return Optional.from(child);
747
- });
748
- });
749
- };
750
- var getFromMetaFirst = function () {
751
- return getFromMetaData().orThunk(function () {
752
- return getFromData().bind(function (child) {
753
- return isObject(child) ? getNonEmptyValue(child) : Optional.from(child);
754
- });
755
- });
756
- };
757
- return _a = {}, _a[prop] = (prop === sourceInput ? getFromValueFirst() : getFromMetaFirst()).getOr(''), _a;
758
- };
759
- };
760
- var getDimensions = function (data, metaData) {
761
- var dimensions = {};
762
- get(data, 'dimensions').each(function (dims) {
763
- each([
643
+ const extractMeta = (sourceInput, data) => get$1(data, sourceInput).bind(mainData => get$1(mainData, 'meta'));
644
+ const getValue = (data, metaData, sourceInput) => prop => {
645
+ const getFromData = () => get$1(data, prop);
646
+ const getFromMetaData = () => get$1(metaData, prop);
647
+ const getNonEmptyValue = c => get$1(c, 'value').bind(v => v.length > 0 ? Optional.some(v) : Optional.none());
648
+ const getFromValueFirst = () => getFromData().bind(child => isObject(child) ? getNonEmptyValue(child).orThunk(getFromMetaData) : getFromMetaData().orThunk(() => Optional.from(child)));
649
+ const getFromMetaFirst = () => getFromMetaData().orThunk(() => getFromData().bind(child => isObject(child) ? getNonEmptyValue(child) : Optional.from(child)));
650
+ return { [prop]: (prop === sourceInput ? getFromValueFirst() : getFromMetaFirst()).getOr('') };
651
+ };
652
+ const getDimensions = (data, metaData) => {
653
+ const dimensions = {};
654
+ get$1(data, 'dimensions').each(dims => {
655
+ each$1([
764
656
  'width',
765
657
  'height'
766
- ], function (prop) {
767
- get(metaData, prop).orThunk(function () {
768
- return get(dims, prop);
769
- }).each(function (value) {
770
- return dimensions[prop] = value;
771
- });
658
+ ], prop => {
659
+ get$1(metaData, prop).orThunk(() => get$1(dims, prop)).each(value => dimensions[prop] = value);
772
660
  });
773
661
  });
774
662
  return dimensions;
775
663
  };
776
- var unwrap = function (data, sourceInput) {
777
- var metaData = sourceInput ? extractMeta(sourceInput, data).getOr({}) : {};
778
- var get = getValue(data, metaData, sourceInput);
779
- return __assign(__assign(__assign(__assign(__assign({}, get('source')), get('altsource')), get('poster')), get('embed')), getDimensions(data, metaData));
664
+ const unwrap = (data, sourceInput) => {
665
+ const metaData = sourceInput && sourceInput !== 'dimensions' ? extractMeta(sourceInput, data).getOr({}) : {};
666
+ const get = getValue(data, metaData, sourceInput);
667
+ return {
668
+ ...get('source'),
669
+ ...get('altsource'),
670
+ ...get('poster'),
671
+ ...get('embed'),
672
+ ...getDimensions(data, metaData)
673
+ };
780
674
  };
781
- var wrap = function (data) {
782
- var wrapped = __assign(__assign({}, data), {
783
- source: { value: get(data, 'source').getOr('') },
784
- altsource: { value: get(data, 'altsource').getOr('') },
785
- poster: { value: get(data, 'poster').getOr('') }
786
- });
787
- each([
675
+ const wrap = data => {
676
+ const wrapped = {
677
+ ...data,
678
+ source: { value: get$1(data, 'source').getOr('') },
679
+ altsource: { value: get$1(data, 'altsource').getOr('') },
680
+ poster: { value: get$1(data, 'poster').getOr('') }
681
+ };
682
+ each$1([
788
683
  'width',
789
684
  'height'
790
- ], function (prop) {
791
- get(data, prop).each(function (value) {
792
- var dimensions = wrapped.dimensions || {};
685
+ ], prop => {
686
+ get$1(data, prop).each(value => {
687
+ const dimensions = wrapped.dimensions || {};
793
688
  dimensions[prop] = value;
794
689
  wrapped.dimensions = dimensions;
795
690
  });
796
691
  });
797
692
  return wrapped;
798
693
  };
799
- var handleError = function (editor) {
800
- return function (error) {
801
- var errorMessage = error && error.msg ? 'Media embed handler error: ' + error.msg : 'Media embed handler threw unknown error.';
802
- editor.notificationManager.open({
803
- type: 'error',
804
- text: errorMessage
805
- });
806
- };
807
- };
808
- var snippetToData = function (editor, embedSnippet) {
809
- return htmlToData(getScripts(editor), embedSnippet);
810
- };
811
- var isMediaElement = function (element) {
812
- return element.getAttribute('data-mce-object') || element.getAttribute('data-ephox-embed-iri');
813
- };
814
- var getEditorData = function (editor) {
815
- var element = editor.selection.getNode();
816
- var snippet = isMediaElement(element) ? editor.serializer.serialize(element, { selection: true }) : '';
817
- return __assign({ embed: snippet }, htmlToData(getScripts(editor), snippet));
694
+ const handleError = editor => error => {
695
+ const errorMessage = error && error.msg ? 'Media embed handler error: ' + error.msg : 'Media embed handler threw unknown error.';
696
+ editor.notificationManager.open({
697
+ type: 'error',
698
+ text: errorMessage
699
+ });
818
700
  };
819
- var addEmbedHtml = function (api, editor) {
820
- return function (response) {
821
- if (isString(response.url) && response.url.trim().length > 0) {
822
- var html = response.html;
823
- var snippetData = snippetToData(editor, html);
824
- var nuData = __assign(__assign({}, snippetData), {
825
- source: response.url,
826
- embed: html
827
- });
828
- api.setData(wrap(nuData));
701
+ const getEditorData = editor => {
702
+ const element = editor.selection.getNode();
703
+ const snippet = isMediaElement(element) ? editor.serializer.serialize(element, { selection: true }) : '';
704
+ const data = htmlToData(snippet, editor.schema);
705
+ const getDimensionsOfElement = () => {
706
+ if (isEmbedIframe(data.source, data.type)) {
707
+ const rect = editor.dom.getRect(element);
708
+ return {
709
+ width: rect.w.toString().replace(/px$/, ''),
710
+ height: rect.h.toString().replace(/px$/, '')
711
+ };
712
+ } else {
713
+ return {};
829
714
  }
830
715
  };
716
+ const dimensions = getDimensionsOfElement();
717
+ return {
718
+ embed: snippet,
719
+ ...data,
720
+ ...dimensions
721
+ };
831
722
  };
832
- var selectPlaceholder = function (editor, beforeObjects) {
833
- var afterObjects = editor.dom.select('*[data-mce-object]');
834
- for (var i = 0; i < beforeObjects.length; i++) {
835
- for (var y = afterObjects.length - 1; y >= 0; y--) {
723
+ const addEmbedHtml = (api, editor) => response => {
724
+ if (isString(response.url) && response.url.trim().length > 0) {
725
+ const html = response.html;
726
+ const snippetData = htmlToData(html, editor.schema);
727
+ const nuData = {
728
+ ...snippetData,
729
+ source: response.url,
730
+ embed: html
731
+ };
732
+ api.setData(wrap(nuData));
733
+ }
734
+ };
735
+ const selectPlaceholder = (editor, beforeObjects) => {
736
+ const afterObjects = editor.dom.select('*[data-mce-object]');
737
+ for (let i = 0; i < beforeObjects.length; i++) {
738
+ for (let y = afterObjects.length - 1; y >= 0; y--) {
836
739
  if (beforeObjects[i] === afterObjects[y]) {
837
740
  afterObjects.splice(y, 1);
838
741
  }
@@ -840,28 +743,37 @@
840
743
  }
841
744
  editor.selection.select(afterObjects[0]);
842
745
  };
843
- var handleInsert = function (editor, html) {
844
- var beforeObjects = editor.dom.select('*[data-mce-object]');
746
+ const handleInsert = (editor, html) => {
747
+ const beforeObjects = editor.dom.select('*[data-mce-object]');
845
748
  editor.insertContent(html);
846
749
  selectPlaceholder(editor, beforeObjects);
847
750
  editor.nodeChanged();
848
751
  };
849
- var submitForm = function (prevData, newData, editor) {
850
- newData.embed = updateHtml(newData.embed, newData);
752
+ const isEmbedIframe = (url, mediaDataType) => isNonNullable(mediaDataType) && mediaDataType === 'ephox-embed-iri' && isNonNullable(matchPattern(url));
753
+ const shouldInsertAsNewIframe = (prevData, newData) => {
754
+ const hasDimensionsChanged = (prevData, newData) => prevData.width !== newData.width || prevData.height !== newData.height;
755
+ return hasDimensionsChanged(prevData, newData) && isEmbedIframe(newData.source, prevData.type);
756
+ };
757
+ const submitForm = (prevData, newData, editor) => {
758
+ var _a;
759
+ newData.embed = shouldInsertAsNewIframe(prevData, newData) && hasDimensions(editor) ? dataToHtml(editor, {
760
+ ...newData,
761
+ embed: ''
762
+ }) : updateHtml((_a = newData.embed) !== null && _a !== void 0 ? _a : '', newData, false, editor.schema);
851
763
  if (newData.embed && (prevData.source === newData.source || isCached(newData.source))) {
852
764
  handleInsert(editor, newData.embed);
853
765
  } else {
854
- getEmbedHtml(editor, newData).then(function (response) {
766
+ getEmbedHtml(editor, newData).then(response => {
855
767
  handleInsert(editor, response.html);
856
768
  }).catch(handleError(editor));
857
769
  }
858
770
  };
859
- var showDialog = function (editor) {
860
- var editorData = getEditorData(editor);
861
- var currentData = Cell(editorData);
862
- var initialData = wrap(editorData);
863
- var handleSource = function (prevData, api) {
864
- var serviceData = unwrap(api.getData(), 'source');
771
+ const showDialog = editor => {
772
+ const editorData = getEditorData(editor);
773
+ const currentData = Cell(editorData);
774
+ const initialData = wrap(editorData);
775
+ const handleSource = (prevData, api) => {
776
+ const serviceData = unwrap(api.getData(), 'source');
865
777
  if (prevData.source !== serviceData.source) {
866
778
  addEmbedHtml(win, editor)({
867
779
  url: serviceData.source,
@@ -870,29 +782,38 @@
870
782
  getEmbedHtml(editor, serviceData).then(addEmbedHtml(win, editor)).catch(handleError(editor));
871
783
  }
872
784
  };
873
- var handleEmbed = function (api) {
874
- var data = unwrap(api.getData());
875
- var dataFromEmbed = snippetToData(editor, data.embed);
785
+ const handleEmbed = api => {
786
+ var _a;
787
+ const data = unwrap(api.getData());
788
+ const dataFromEmbed = htmlToData((_a = data.embed) !== null && _a !== void 0 ? _a : '', editor.schema);
876
789
  api.setData(wrap(dataFromEmbed));
877
790
  };
878
- var handleUpdate = function (api, sourceInput) {
879
- var data = unwrap(api.getData(), sourceInput);
880
- var embed = dataToHtml(editor, data);
881
- api.setData(wrap(__assign(__assign({}, data), { embed: embed })));
791
+ const handleUpdate = (api, sourceInput, prevData) => {
792
+ const dialogData = unwrap(api.getData(), sourceInput);
793
+ const data = shouldInsertAsNewIframe(prevData, dialogData) && hasDimensions(editor) ? {
794
+ ...dialogData,
795
+ embed: ''
796
+ } : dialogData;
797
+ const embed = dataToHtml(editor, data);
798
+ api.setData(wrap({
799
+ ...data,
800
+ embed
801
+ }));
882
802
  };
883
- var mediaInput = [{
803
+ const mediaInput = [{
884
804
  name: 'source',
885
805
  type: 'urlinput',
886
806
  filetype: 'media',
887
- label: 'Source'
807
+ label: 'Source',
808
+ picker_text: 'Browse files'
888
809
  }];
889
- var sizeInput = !hasDimensions(editor) ? [] : [{
810
+ const sizeInput = !hasDimensions(editor) ? [] : [{
890
811
  type: 'sizeinput',
891
812
  name: 'dimensions',
892
813
  label: 'Constrain proportions',
893
814
  constrain: true
894
815
  }];
895
- var generalTab = {
816
+ const generalTab = {
896
817
  title: 'General',
897
818
  name: 'general',
898
819
  items: flatten([
@@ -900,16 +821,16 @@
900
821
  sizeInput
901
822
  ])
902
823
  };
903
- var embedTextarea = {
824
+ const embedTextarea = {
904
825
  type: 'textarea',
905
826
  name: 'embed',
906
827
  label: 'Paste your embed code below:'
907
828
  };
908
- var embedTab = {
829
+ const embedTab = {
909
830
  title: 'Embed',
910
831
  items: [embedTextarea]
911
832
  };
912
- var advancedFormItems = [];
833
+ const advancedFormItems = [];
913
834
  if (hasAltSource(editor)) {
914
835
  advancedFormItems.push({
915
836
  name: 'altsource',
@@ -926,26 +847,26 @@
926
847
  label: 'Media poster (Image URL)'
927
848
  });
928
849
  }
929
- var advancedTab = {
850
+ const advancedTab = {
930
851
  title: 'Advanced',
931
852
  name: 'advanced',
932
853
  items: advancedFormItems
933
854
  };
934
- var tabs = [
855
+ const tabs = [
935
856
  generalTab,
936
857
  embedTab
937
858
  ];
938
859
  if (advancedFormItems.length > 0) {
939
860
  tabs.push(advancedTab);
940
861
  }
941
- var body = {
862
+ const body = {
942
863
  type: 'tabpanel',
943
- tabs: tabs
864
+ tabs
944
865
  };
945
- var win = editor.windowManager.open({
866
+ const win = editor.windowManager.open({
946
867
  title: 'Insert/Edit Media',
947
868
  size: 'normal',
948
- body: body,
869
+ body,
949
870
  buttons: [
950
871
  {
951
872
  type: 'cancel',
@@ -959,12 +880,12 @@
959
880
  primary: true
960
881
  }
961
882
  ],
962
- onSubmit: function (api) {
963
- var serviceData = unwrap(api.getData());
883
+ onSubmit: api => {
884
+ const serviceData = unwrap(api.getData());
964
885
  submitForm(currentData.get(), serviceData, editor);
965
886
  api.close();
966
887
  },
967
- onChange: function (api, detail) {
888
+ onChange: (api, detail) => {
968
889
  switch (detail.name) {
969
890
  case 'source':
970
891
  handleSource(currentData.get(), api);
@@ -975,96 +896,42 @@
975
896
  case 'dimensions':
976
897
  case 'altsource':
977
898
  case 'poster':
978
- handleUpdate(api, detail.name);
899
+ handleUpdate(api, detail.name, currentData.get());
979
900
  break;
980
901
  }
981
902
  currentData.set(unwrap(api.getData()));
982
903
  },
983
- initialData: initialData
904
+ initialData
984
905
  });
985
906
  };
986
907
 
987
- var get$1 = function (editor) {
988
- var showDialog$1 = function () {
908
+ const get = editor => {
909
+ const showDialog$1 = () => {
989
910
  showDialog(editor);
990
911
  };
991
912
  return { showDialog: showDialog$1 };
992
913
  };
993
914
 
994
- var register = function (editor) {
995
- var showDialog$1 = function () {
915
+ const register$1 = editor => {
916
+ const showDialog$1 = () => {
996
917
  showDialog(editor);
997
918
  };
998
919
  editor.addCommand('mceMedia', showDialog$1);
999
920
  };
1000
921
 
1001
- var global$7 = tinymce.util.Tools.resolve('tinymce.html.Node');
1002
-
1003
- var global$8 = tinymce.util.Tools.resolve('tinymce.Env');
1004
-
1005
- var global$9 = tinymce.util.Tools.resolve('tinymce.html.DomParser');
1006
-
1007
- var sanitize = function (editor, html) {
1008
- if (shouldFilterHtml(editor) === false) {
1009
- return html;
1010
- }
1011
- var writer = global$5();
1012
- var blocked;
1013
- global$3({
1014
- validate: false,
1015
- allow_conditional_comments: false,
1016
- comment: function (text) {
1017
- if (!blocked) {
1018
- writer.comment(text);
1019
- }
1020
- },
1021
- cdata: function (text) {
1022
- if (!blocked) {
1023
- writer.cdata(text);
1024
- }
1025
- },
1026
- text: function (text, raw) {
1027
- if (!blocked) {
1028
- writer.text(text, raw);
1029
- }
1030
- },
1031
- start: function (name, attrs, empty) {
1032
- blocked = true;
1033
- if (name === 'script' || name === 'noscript' || name === 'svg') {
1034
- return;
1035
- }
1036
- for (var i = attrs.length - 1; i >= 0; i--) {
1037
- var attrName = attrs[i].name;
1038
- if (attrName.indexOf('on') === 0) {
1039
- delete attrs.map[attrName];
1040
- attrs.splice(i, 1);
1041
- }
1042
- if (attrName === 'style') {
1043
- attrs[i].value = editor.dom.serializeStyle(editor.dom.parseStyle(attrs[i].value), name);
1044
- }
1045
- }
1046
- writer.start(name, attrs, empty);
1047
- blocked = false;
1048
- },
1049
- end: function (name) {
1050
- if (blocked) {
1051
- return;
1052
- }
1053
- writer.end(name);
1054
- }
1055
- }, global$4({})).parse(html);
1056
- return writer.getContent();
922
+ const checkRange = (str, substr, start) => substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;
923
+ const startsWith = (str, prefix) => {
924
+ return checkRange(str, prefix, 0);
1057
925
  };
1058
926
 
1059
- var isLiveEmbedNode = function (node) {
1060
- var name = node.name;
927
+ var global = tinymce.util.Tools.resolve('tinymce.Env');
928
+
929
+ const isLiveEmbedNode = node => {
930
+ const name = node.name;
1061
931
  return name === 'iframe' || name === 'video' || name === 'audio';
1062
932
  };
1063
- var getDimension = function (node, styles, dimension, defaultValue) {
1064
- if (defaultValue === void 0) {
1065
- defaultValue = null;
1066
- }
1067
- var value = node.attr(dimension);
933
+ const getDimension = (node, styles, dimension, defaultValue = null) => {
934
+ const value = node.attr(dimension);
1068
935
  if (isNonNullable(value)) {
1069
936
  return value;
1070
937
  } else if (!has(styles, dimension)) {
@@ -1073,42 +940,39 @@
1073
940
  return null;
1074
941
  }
1075
942
  };
1076
- var setDimensions = function (node, previewNode, styles) {
1077
- var useDefaults = previewNode.name === 'img' || node.name === 'video';
1078
- var defaultWidth = useDefaults ? '300' : null;
1079
- var fallbackHeight = node.name === 'audio' ? '30' : '150';
1080
- var defaultHeight = useDefaults ? fallbackHeight : null;
943
+ const setDimensions = (node, previewNode, styles) => {
944
+ const useDefaults = previewNode.name === 'img' || node.name === 'video';
945
+ const defaultWidth = useDefaults ? '300' : null;
946
+ const fallbackHeight = node.name === 'audio' ? '30' : '150';
947
+ const defaultHeight = useDefaults ? fallbackHeight : null;
1081
948
  previewNode.attr({
1082
949
  width: getDimension(node, styles, 'width', defaultWidth),
1083
950
  height: getDimension(node, styles, 'height', defaultHeight)
1084
951
  });
1085
952
  };
1086
- var appendNodeContent = function (editor, nodeName, previewNode, html) {
1087
- var newNode = global$9({
1088
- forced_root_block: false,
1089
- validate: false
1090
- }, editor.schema).parse(html, { context: nodeName });
953
+ const appendNodeContent = (editor, nodeName, previewNode, html) => {
954
+ const newNode = Parser(editor.schema).parse(html, { context: nodeName });
1091
955
  while (newNode.firstChild) {
1092
956
  previewNode.append(newNode.firstChild);
1093
957
  }
1094
958
  };
1095
- var createPlaceholderNode = function (editor, node) {
1096
- var name = node.name;
1097
- var placeHolder = new global$7('img', 1);
1098
- placeHolder.shortEnded = true;
959
+ const createPlaceholderNode = (editor, node) => {
960
+ const name = node.name;
961
+ const placeHolder = new global$2('img', 1);
1099
962
  retainAttributesAndInnerHtml(editor, node, placeHolder);
1100
963
  setDimensions(node, placeHolder, {});
1101
964
  placeHolder.attr({
1102
965
  'style': node.attr('style'),
1103
- 'src': global$8.transparentSrc,
966
+ 'src': global.transparentSrc,
1104
967
  'data-mce-object': name,
1105
968
  'class': 'mce-object mce-object-' + name
1106
969
  });
1107
970
  return placeHolder;
1108
971
  };
1109
- var createPreviewNode = function (editor, node) {
1110
- var name = node.name;
1111
- var previewWrapper = new global$7('span', 1);
972
+ const createPreviewNode = (editor, node) => {
973
+ var _a;
974
+ const name = node.name;
975
+ const previewWrapper = new global$2('span', 1);
1112
976
  previewWrapper.attr({
1113
977
  'contentEditable': 'false',
1114
978
  'style': node.attr('style'),
@@ -1116,8 +980,8 @@
1116
980
  'class': 'mce-preview-object mce-object-' + name
1117
981
  });
1118
982
  retainAttributesAndInnerHtml(editor, node, previewWrapper);
1119
- var styles = editor.dom.parseStyle(node.attr('style'));
1120
- var previewNode = new global$7(name, 1);
983
+ const styles = editor.dom.parseStyle((_a = node.attr('style')) !== null && _a !== void 0 ? _a : '');
984
+ const previewNode = new global$2(name, 1);
1121
985
  setDimensions(node, previewNode, styles);
1122
986
  previewNode.attr({
1123
987
  src: node.attr('src'),
@@ -1127,10 +991,11 @@
1127
991
  if (name === 'iframe') {
1128
992
  previewNode.attr({
1129
993
  allowfullscreen: node.attr('allowfullscreen'),
1130
- frameborder: '0'
994
+ frameborder: '0',
995
+ sandbox: node.attr('sandbox')
1131
996
  });
1132
997
  } else {
1133
- var attrs = [
998
+ const attrs = [
1134
999
  'controls',
1135
1000
  'crossorigin',
1136
1001
  'currentTime',
@@ -1139,122 +1004,119 @@
1139
1004
  'poster',
1140
1005
  'preload'
1141
1006
  ];
1142
- each(attrs, function (attrName) {
1007
+ each$1(attrs, attrName => {
1143
1008
  previewNode.attr(attrName, node.attr(attrName));
1144
1009
  });
1145
- var sanitizedHtml = previewWrapper.attr('data-mce-html');
1010
+ const sanitizedHtml = previewWrapper.attr('data-mce-html');
1146
1011
  if (isNonNullable(sanitizedHtml)) {
1147
- appendNodeContent(editor, name, previewNode, sanitizedHtml);
1012
+ appendNodeContent(editor, name, previewNode, unescape(sanitizedHtml));
1148
1013
  }
1149
1014
  }
1150
- var shimNode = new global$7('span', 1);
1015
+ const shimNode = new global$2('span', 1);
1151
1016
  shimNode.attr('class', 'mce-shim');
1152
1017
  previewWrapper.append(previewNode);
1153
1018
  previewWrapper.append(shimNode);
1154
1019
  return previewWrapper;
1155
1020
  };
1156
- var retainAttributesAndInnerHtml = function (editor, sourceNode, targetNode) {
1157
- var attribs = sourceNode.attributes;
1158
- var ai = attribs.length;
1021
+ const retainAttributesAndInnerHtml = (editor, sourceNode, targetNode) => {
1022
+ var _a;
1023
+ const attribs = (_a = sourceNode.attributes) !== null && _a !== void 0 ? _a : [];
1024
+ let ai = attribs.length;
1159
1025
  while (ai--) {
1160
- var attrName = attribs[ai].name;
1161
- var attrValue = attribs[ai].value;
1162
- if (attrName !== 'width' && attrName !== 'height' && attrName !== 'style') {
1026
+ const attrName = attribs[ai].name;
1027
+ let attrValue = attribs[ai].value;
1028
+ if (attrName !== 'width' && attrName !== 'height' && attrName !== 'style' && !startsWith(attrName, 'data-mce-')) {
1163
1029
  if (attrName === 'data' || attrName === 'src') {
1164
1030
  attrValue = editor.convertURL(attrValue, attrName);
1165
1031
  }
1166
1032
  targetNode.attr('data-mce-p-' + attrName, attrValue);
1167
1033
  }
1168
1034
  }
1169
- var innerHtml = sourceNode.firstChild && sourceNode.firstChild.value;
1035
+ const serializer = global$1({ inner: true }, editor.schema);
1036
+ const tempNode = new global$2('div', 1);
1037
+ each$1(sourceNode.children(), child => tempNode.append(child));
1038
+ const innerHtml = serializer.serialize(tempNode);
1170
1039
  if (innerHtml) {
1171
- targetNode.attr('data-mce-html', escape(sanitize(editor, innerHtml)));
1172
- targetNode.firstChild = null;
1040
+ targetNode.attr('data-mce-html', escape(innerHtml));
1041
+ targetNode.empty();
1173
1042
  }
1174
1043
  };
1175
- var isPageEmbedWrapper = function (node) {
1176
- var nodeClass = node.attr('class');
1177
- return nodeClass && /\btiny-pageembed\b/.test(nodeClass);
1044
+ const isPageEmbedWrapper = node => {
1045
+ const nodeClass = node.attr('class');
1046
+ return isString(nodeClass) && /\btiny-pageembed\b/.test(nodeClass);
1178
1047
  };
1179
- var isWithinEmbedWrapper = function (node) {
1180
- while (node = node.parent) {
1181
- if (node.attr('data-ephox-embed-iri') || isPageEmbedWrapper(node)) {
1048
+ const isWithinEmbedWrapper = node => {
1049
+ let tempNode = node;
1050
+ while (tempNode = tempNode.parent) {
1051
+ if (tempNode.attr('data-ephox-embed-iri') || isPageEmbedWrapper(tempNode)) {
1182
1052
  return true;
1183
1053
  }
1184
1054
  }
1185
1055
  return false;
1186
1056
  };
1187
- var placeHolderConverter = function (editor) {
1188
- return function (nodes) {
1189
- var i = nodes.length;
1190
- var node;
1191
- var videoScript;
1192
- while (i--) {
1193
- node = nodes[i];
1194
- if (!node.parent) {
1195
- continue;
1196
- }
1197
- if (node.parent.attr('data-mce-object')) {
1198
- continue;
1199
- }
1200
- if (node.name === 'script') {
1201
- videoScript = getVideoScriptMatch(getScripts(editor), node.attr('src'));
1202
- if (!videoScript) {
1203
- continue;
1204
- }
1205
- }
1206
- if (videoScript) {
1207
- if (videoScript.width) {
1208
- node.attr('width', videoScript.width.toString());
1209
- }
1210
- if (videoScript.height) {
1211
- node.attr('height', videoScript.height.toString());
1212
- }
1057
+ const placeHolderConverter = editor => nodes => {
1058
+ let i = nodes.length;
1059
+ let node;
1060
+ while (i--) {
1061
+ node = nodes[i];
1062
+ if (!node.parent) {
1063
+ continue;
1064
+ }
1065
+ if (node.parent.attr('data-mce-object')) {
1066
+ continue;
1067
+ }
1068
+ if (isLiveEmbedNode(node) && hasLiveEmbeds(editor)) {
1069
+ if (!isWithinEmbedWrapper(node)) {
1070
+ node.replace(createPreviewNode(editor, node));
1213
1071
  }
1214
- if (isLiveEmbedNode(node) && hasLiveEmbeds(editor) && global$8.ceFalse) {
1215
- if (!isWithinEmbedWrapper(node)) {
1216
- node.replace(createPreviewNode(editor, node));
1217
- }
1218
- } else {
1219
- if (!isWithinEmbedWrapper(node)) {
1220
- node.replace(createPlaceholderNode(editor, node));
1221
- }
1072
+ } else {
1073
+ if (!isWithinEmbedWrapper(node)) {
1074
+ node.replace(createPlaceholderNode(editor, node));
1222
1075
  }
1223
1076
  }
1224
- };
1077
+ }
1225
1078
  };
1226
1079
 
1227
- var setup = function (editor) {
1228
- editor.on('preInit', function () {
1229
- var specialElements = editor.schema.getSpecialElements();
1230
- global$1.each('video audio iframe object'.split(' '), function (name) {
1231
- specialElements[name] = new RegExp('</' + name + '[^>]*>', 'gi');
1232
- });
1233
- var boolAttrs = editor.schema.getBoolAttrs();
1234
- global$1.each('webkitallowfullscreen mozallowfullscreen allowfullscreen'.split(' '), function (name) {
1080
+ const parseAndSanitize = (editor, context, html) => {
1081
+ const getEditorOption = editor.options.get;
1082
+ const sanitize = getEditorOption('xss_sanitization');
1083
+ const validate = shouldFilterHtml(editor);
1084
+ return Parser(editor.schema, {
1085
+ sanitize,
1086
+ validate
1087
+ }).parse(html, { context });
1088
+ };
1089
+
1090
+ const setup$1 = editor => {
1091
+ editor.on('PreInit', () => {
1092
+ const {schema, serializer, parser} = editor;
1093
+ const boolAttrs = schema.getBoolAttrs();
1094
+ each$1('webkitallowfullscreen mozallowfullscreen'.split(' '), name => {
1235
1095
  boolAttrs[name] = {};
1236
1096
  });
1237
- editor.parser.addNodeFilter('iframe,video,audio,object,embed,script', placeHolderConverter(editor));
1238
- editor.serializer.addAttributeFilter('data-mce-object', function (nodes, name) {
1239
- var i = nodes.length;
1240
- var node;
1241
- var realElm;
1242
- var ai;
1243
- var attribs;
1244
- var innerHtml;
1245
- var innerNode;
1246
- var realElmName;
1247
- var className;
1097
+ each({ embed: ['wmode'] }, (attrs, name) => {
1098
+ const rule = schema.getElementRule(name);
1099
+ if (rule) {
1100
+ each$1(attrs, attr => {
1101
+ rule.attributes[attr] = {};
1102
+ rule.attributesOrder.push(attr);
1103
+ });
1104
+ }
1105
+ });
1106
+ parser.addNodeFilter('iframe,video,audio,object,embed', placeHolderConverter(editor));
1107
+ serializer.addAttributeFilter('data-mce-object', (nodes, name) => {
1108
+ var _a;
1109
+ let i = nodes.length;
1248
1110
  while (i--) {
1249
- node = nodes[i];
1111
+ const node = nodes[i];
1250
1112
  if (!node.parent) {
1251
1113
  continue;
1252
1114
  }
1253
- realElmName = node.attr(name);
1254
- realElm = new global$7(realElmName, 1);
1255
- if (realElmName !== 'audio' && realElmName !== 'script') {
1256
- className = node.attr('class');
1257
- if (className && className.indexOf('mce-preview-object') !== -1) {
1115
+ const realElmName = node.attr(name);
1116
+ const realElm = new global$2(realElmName, 1);
1117
+ if (realElmName !== 'audio') {
1118
+ const className = node.attr('class');
1119
+ if (className && className.indexOf('mce-preview-object') !== -1 && node.firstChild) {
1258
1120
  realElm.attr({
1259
1121
  width: node.firstChild.attr('width'),
1260
1122
  height: node.firstChild.attr('height')
@@ -1267,116 +1129,89 @@
1267
1129
  }
1268
1130
  }
1269
1131
  realElm.attr({ style: node.attr('style') });
1270
- attribs = node.attributes;
1271
- ai = attribs.length;
1132
+ const attribs = (_a = node.attributes) !== null && _a !== void 0 ? _a : [];
1133
+ let ai = attribs.length;
1272
1134
  while (ai--) {
1273
- var attrName = attribs[ai].name;
1135
+ const attrName = attribs[ai].name;
1274
1136
  if (attrName.indexOf('data-mce-p-') === 0) {
1275
1137
  realElm.attr(attrName.substr(11), attribs[ai].value);
1276
1138
  }
1277
1139
  }
1278
- if (realElmName === 'script') {
1279
- realElm.attr('type', 'text/javascript');
1280
- }
1281
- innerHtml = node.attr('data-mce-html');
1140
+ const innerHtml = node.attr('data-mce-html');
1282
1141
  if (innerHtml) {
1283
- innerNode = new global$7('#text', 3);
1284
- innerNode.raw = true;
1285
- innerNode.value = sanitize(editor, unescape(innerHtml));
1286
- realElm.append(innerNode);
1142
+ const fragment = parseAndSanitize(editor, realElmName, unescape(innerHtml));
1143
+ each$1(fragment.children(), child => realElm.append(child));
1287
1144
  }
1288
1145
  node.replace(realElm);
1289
1146
  }
1290
1147
  });
1291
1148
  });
1292
- editor.on('SetContent', function () {
1293
- editor.$('span.mce-preview-object').each(function (index, elm) {
1294
- var $elm = editor.$(elm);
1295
- if ($elm.find('span.mce-shim').length === 0) {
1296
- $elm.append('<span class="mce-shim"></span>');
1149
+ editor.on('SetContent', () => {
1150
+ const dom = editor.dom;
1151
+ each$1(dom.select('span.mce-preview-object'), elm => {
1152
+ if (dom.select('span.mce-shim', elm).length === 0) {
1153
+ dom.add(elm, 'span', { class: 'mce-shim' });
1297
1154
  }
1298
1155
  });
1299
1156
  });
1300
1157
  };
1301
1158
 
1302
- var setup$1 = function (editor) {
1303
- editor.on('ResolveName', function (e) {
1304
- var name;
1159
+ const setup = editor => {
1160
+ editor.on('ResolveName', e => {
1161
+ let name;
1305
1162
  if (e.target.nodeType === 1 && (name = e.target.getAttribute('data-mce-object'))) {
1306
1163
  e.name = name;
1307
1164
  }
1308
1165
  });
1309
1166
  };
1310
1167
 
1311
- var setup$2 = function (editor) {
1312
- editor.on('click keyup touchend', function () {
1313
- var selectedNode = editor.selection.getNode();
1314
- if (selectedNode && editor.dom.hasClass(selectedNode, 'mce-preview-object')) {
1315
- if (editor.dom.getAttrib(selectedNode, 'data-mce-selected')) {
1316
- selectedNode.setAttribute('data-mce-selected', '2');
1317
- }
1318
- }
1319
- });
1320
- editor.on('ObjectSelected', function (e) {
1321
- var objectType = e.target.getAttribute('data-mce-object');
1322
- if (objectType === 'script') {
1323
- e.preventDefault();
1324
- }
1325
- });
1326
- editor.on('ObjectResized', function (e) {
1327
- var target = e.target;
1328
- var html;
1329
- if (target.getAttribute('data-mce-object')) {
1330
- html = target.getAttribute('data-mce-html');
1331
- if (html) {
1332
- html = unescape(html);
1333
- target.setAttribute('data-mce-html', escape(updateHtml(html, {
1334
- width: String(e.width),
1335
- height: String(e.height)
1336
- })));
1337
- }
1338
- }
1339
- });
1340
- };
1341
-
1342
- var stateSelectorAdapter = function (editor, selector) {
1343
- return function (buttonApi) {
1344
- return editor.selection.selectorChangedWithUnbind(selector.join(','), buttonApi.setActive).unbind;
1168
+ const onSetupEditable = editor => api => {
1169
+ const nodeChanged = () => {
1170
+ api.setEnabled(editor.selection.isEditable());
1171
+ };
1172
+ editor.on('NodeChange', nodeChanged);
1173
+ nodeChanged();
1174
+ return () => {
1175
+ editor.off('NodeChange', nodeChanged);
1345
1176
  };
1346
1177
  };
1347
- var register$1 = function (editor) {
1178
+ const register = editor => {
1179
+ const onAction = () => editor.execCommand('mceMedia');
1348
1180
  editor.ui.registry.addToggleButton('media', {
1349
1181
  tooltip: 'Insert/edit media',
1350
1182
  icon: 'embed',
1351
- onAction: function () {
1352
- editor.execCommand('mceMedia');
1353
- },
1354
- onSetup: stateSelectorAdapter(editor, [
1355
- 'img[data-mce-object]',
1356
- 'span[data-mce-object]',
1357
- 'div[data-ephox-embed-iri]'
1358
- ])
1183
+ onAction,
1184
+ onSetup: buttonApi => {
1185
+ const selection = editor.selection;
1186
+ buttonApi.setActive(isMediaElement(selection.getNode()));
1187
+ const unbindSelectorChanged = selection.selectorChangedWithUnbind('img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]', buttonApi.setActive).unbind;
1188
+ const unbindEditable = onSetupEditable(editor)(buttonApi);
1189
+ return () => {
1190
+ unbindSelectorChanged();
1191
+ unbindEditable();
1192
+ };
1193
+ }
1359
1194
  });
1360
1195
  editor.ui.registry.addMenuItem('media', {
1361
1196
  icon: 'embed',
1362
1197
  text: 'Media...',
1363
- onAction: function () {
1364
- editor.execCommand('mceMedia');
1365
- }
1198
+ onAction,
1199
+ onSetup: onSetupEditable(editor)
1366
1200
  });
1367
1201
  };
1368
1202
 
1369
- function Plugin () {
1370
- global.add('media', function (editor) {
1371
- register(editor);
1203
+ var Plugin = () => {
1204
+ global$6.add('media', editor => {
1205
+ register$2(editor);
1372
1206
  register$1(editor);
1373
- setup$1(editor);
1207
+ register(editor);
1374
1208
  setup(editor);
1209
+ setup$1(editor);
1375
1210
  setup$2(editor);
1376
- return get$1(editor);
1211
+ return get(editor);
1377
1212
  });
1378
- }
1213
+ };
1379
1214
 
1380
1215
  Plugin();
1381
1216
 
1382
- }());
1217
+ })();