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,1354 +0,0 @@
1
- /**
2
- * Copyright (c) Tiny Technologies, Inc. All rights reserved.
3
- * Licensed under the LGPL or a commercial license.
4
- * For LGPL see License.txt in the project root for license information.
5
- * For commercial licenses see https://www.tiny.cloud/
6
- *
7
- * Version: 5.9.0 (TBD)
8
- */
9
- (function () {
10
- 'use strict';
11
-
12
- var Cell = function (initial) {
13
- var value = initial;
14
- var get = function () {
15
- return value;
16
- };
17
- var set = function (v) {
18
- value = v;
19
- };
20
- return {
21
- get: get,
22
- set: set
23
- };
24
- };
25
-
26
- var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
27
-
28
- var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
29
-
30
- var isSimpleType = function (type) {
31
- return function (value) {
32
- return typeof value === type;
33
- };
34
- };
35
- var isNullable = function (a) {
36
- return a === null || a === undefined;
37
- };
38
- var isNonNullable = function (a) {
39
- return !isNullable(a);
40
- };
41
- var isFunction = isSimpleType('function');
42
-
43
- var noop = function () {
44
- };
45
- var constant = function (value) {
46
- return function () {
47
- return value;
48
- };
49
- };
50
- var never = constant(false);
51
- var always = constant(true);
52
-
53
- var none = function () {
54
- return NONE;
55
- };
56
- var NONE = function () {
57
- var eq = function (o) {
58
- return o.isNone();
59
- };
60
- var call = function (thunk) {
61
- return thunk();
62
- };
63
- var id = function (n) {
64
- return n;
65
- };
66
- var me = {
67
- fold: function (n, _s) {
68
- return n();
69
- },
70
- is: never,
71
- isSome: never,
72
- isNone: always,
73
- getOr: id,
74
- getOrThunk: call,
75
- getOrDie: function (msg) {
76
- throw new Error(msg || 'error: getOrDie called on none.');
77
- },
78
- getOrNull: constant(null),
79
- getOrUndefined: constant(undefined),
80
- or: id,
81
- orThunk: call,
82
- map: none,
83
- each: noop,
84
- bind: none,
85
- exists: never,
86
- forall: always,
87
- filter: none,
88
- equals: eq,
89
- equals_: eq,
90
- toArray: function () {
91
- return [];
92
- },
93
- toString: constant('none()')
94
- };
95
- return me;
96
- }();
97
- var some = function (a) {
98
- var constant_a = constant(a);
99
- var self = function () {
100
- return me;
101
- };
102
- var bind = function (f) {
103
- return f(a);
104
- };
105
- var me = {
106
- fold: function (n, s) {
107
- return s(a);
108
- },
109
- is: function (v) {
110
- return a === v;
111
- },
112
- isSome: always,
113
- isNone: never,
114
- getOr: constant_a,
115
- getOrThunk: constant_a,
116
- getOrDie: constant_a,
117
- getOrNull: constant_a,
118
- getOrUndefined: constant_a,
119
- or: self,
120
- orThunk: self,
121
- map: function (f) {
122
- return some(f(a));
123
- },
124
- each: function (f) {
125
- f(a);
126
- },
127
- bind: bind,
128
- exists: bind,
129
- forall: bind,
130
- filter: function (f) {
131
- return f(a) ? me : NONE;
132
- },
133
- toArray: function () {
134
- return [a];
135
- },
136
- toString: function () {
137
- return 'some(' + a + ')';
138
- },
139
- equals: function (o) {
140
- return o.is(a);
141
- },
142
- equals_: function (o, elementEq) {
143
- return o.fold(never, function (b) {
144
- return elementEq(a, b);
145
- });
146
- }
147
- };
148
- return me;
149
- };
150
- var from = function (value) {
151
- return value === null || value === undefined ? NONE : some(value);
152
- };
153
- var Optional = {
154
- some: some,
155
- none: none,
156
- from: from
157
- };
158
-
159
- var create = function (width, height) {
160
- return resize(document.createElement('canvas'), width, height);
161
- };
162
- var clone = function (canvas) {
163
- var tCanvas = create(canvas.width, canvas.height);
164
- var ctx = get2dContext(tCanvas);
165
- ctx.drawImage(canvas, 0, 0);
166
- return tCanvas;
167
- };
168
- var get2dContext = function (canvas) {
169
- return canvas.getContext('2d');
170
- };
171
- var resize = function (canvas, width, height) {
172
- canvas.width = width;
173
- canvas.height = height;
174
- return canvas;
175
- };
176
-
177
- var getWidth = function (image) {
178
- return image.naturalWidth || image.width;
179
- };
180
- var getHeight = function (image) {
181
- return image.naturalHeight || image.height;
182
- };
183
-
184
- var promise = function () {
185
- var Promise = function (fn) {
186
- if (typeof this !== 'object') {
187
- throw new TypeError('Promises must be constructed via new');
188
- }
189
- if (typeof fn !== 'function') {
190
- throw new TypeError('not a function');
191
- }
192
- this._state = null;
193
- this._value = null;
194
- this._deferreds = [];
195
- doResolve(fn, bind(resolve, this), bind(reject, this));
196
- };
197
- var anyWindow = window;
198
- var asap = Promise.immediateFn || typeof anyWindow.setImmediate === 'function' && anyWindow.setImmediate || function (fn) {
199
- return setTimeout(fn, 1);
200
- };
201
- var bind = function (fn, thisArg) {
202
- return function () {
203
- var args = [];
204
- for (var _i = 0; _i < arguments.length; _i++) {
205
- args[_i] = arguments[_i];
206
- }
207
- return fn.apply(thisArg, args);
208
- };
209
- };
210
- var isArray = Array.isArray || function (value) {
211
- return Object.prototype.toString.call(value) === '[object Array]';
212
- };
213
- function handle(deferred) {
214
- var me = this;
215
- if (this._state === null) {
216
- this._deferreds.push(deferred);
217
- return;
218
- }
219
- asap(function () {
220
- var cb = me._state ? deferred.onFulfilled : deferred.onRejected;
221
- if (cb === null) {
222
- (me._state ? deferred.resolve : deferred.reject)(me._value);
223
- return;
224
- }
225
- var ret;
226
- try {
227
- ret = cb(me._value);
228
- } catch (e) {
229
- deferred.reject(e);
230
- return;
231
- }
232
- deferred.resolve(ret);
233
- });
234
- }
235
- function resolve(newValue) {
236
- try {
237
- if (newValue === this) {
238
- throw new TypeError('A promise cannot be resolved with itself.');
239
- }
240
- if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
241
- var then = newValue.then;
242
- if (typeof then === 'function') {
243
- doResolve(bind(then, newValue), bind(resolve, this), bind(reject, this));
244
- return;
245
- }
246
- }
247
- this._state = true;
248
- this._value = newValue;
249
- finale.call(this);
250
- } catch (e) {
251
- reject.call(this, e);
252
- }
253
- }
254
- function reject(newValue) {
255
- this._state = false;
256
- this._value = newValue;
257
- finale.call(this);
258
- }
259
- function finale() {
260
- for (var _i = 0, _a = this._deferreds; _i < _a.length; _i++) {
261
- var deferred = _a[_i];
262
- handle.call(this, deferred);
263
- }
264
- this._deferreds = [];
265
- }
266
- function Handler(onFulfilled, onRejected, resolve, reject) {
267
- this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
268
- this.onRejected = typeof onRejected === 'function' ? onRejected : null;
269
- this.resolve = resolve;
270
- this.reject = reject;
271
- }
272
- var doResolve = function (fn, onFulfilled, onRejected) {
273
- var done = false;
274
- try {
275
- fn(function (value) {
276
- if (done) {
277
- return;
278
- }
279
- done = true;
280
- onFulfilled(value);
281
- }, function (reason) {
282
- if (done) {
283
- return;
284
- }
285
- done = true;
286
- onRejected(reason);
287
- });
288
- } catch (ex) {
289
- if (done) {
290
- return;
291
- }
292
- done = true;
293
- onRejected(ex);
294
- }
295
- };
296
- Promise.prototype.catch = function (onRejected) {
297
- return this.then(null, onRejected);
298
- };
299
- Promise.prototype.then = function (onFulfilled, onRejected) {
300
- var me = this;
301
- return new Promise(function (resolve, reject) {
302
- handle.call(me, new Handler(onFulfilled, onRejected, resolve, reject));
303
- });
304
- };
305
- Promise.all = function () {
306
- var values = [];
307
- for (var _i = 0; _i < arguments.length; _i++) {
308
- values[_i] = arguments[_i];
309
- }
310
- var args = Array.prototype.slice.call(values.length === 1 && isArray(values[0]) ? values[0] : values);
311
- return new Promise(function (resolve, reject) {
312
- if (args.length === 0) {
313
- return resolve([]);
314
- }
315
- var remaining = args.length;
316
- var res = function (i, val) {
317
- try {
318
- if (val && (typeof val === 'object' || typeof val === 'function')) {
319
- var then = val.then;
320
- if (typeof then === 'function') {
321
- then.call(val, function (val) {
322
- res(i, val);
323
- }, reject);
324
- return;
325
- }
326
- }
327
- args[i] = val;
328
- if (--remaining === 0) {
329
- resolve(args);
330
- }
331
- } catch (ex) {
332
- reject(ex);
333
- }
334
- };
335
- for (var i = 0; i < args.length; i++) {
336
- res(i, args[i]);
337
- }
338
- });
339
- };
340
- Promise.resolve = function (value) {
341
- if (value && typeof value === 'object' && value.constructor === Promise) {
342
- return value;
343
- }
344
- return new Promise(function (resolve) {
345
- resolve(value);
346
- });
347
- };
348
- Promise.reject = function (reason) {
349
- return new Promise(function (resolve, reject) {
350
- reject(reason);
351
- });
352
- };
353
- Promise.race = function (values) {
354
- return new Promise(function (resolve, reject) {
355
- for (var _i = 0, values_1 = values; _i < values_1.length; _i++) {
356
- var value = values_1[_i];
357
- value.then(resolve, reject);
358
- }
359
- });
360
- };
361
- return Promise;
362
- };
363
- var Promise = window.Promise ? window.Promise : promise();
364
-
365
- var imageToBlob = function (image) {
366
- var src = image.src;
367
- if (src.indexOf('data:') === 0) {
368
- return dataUriToBlob(src);
369
- }
370
- return anyUriToBlob(src);
371
- };
372
- var blobToImage = function (blob) {
373
- return new Promise(function (resolve, reject) {
374
- var blobUrl = URL.createObjectURL(blob);
375
- var image = new Image();
376
- var removeListeners = function () {
377
- image.removeEventListener('load', loaded);
378
- image.removeEventListener('error', error);
379
- };
380
- var loaded = function () {
381
- removeListeners();
382
- resolve(image);
383
- };
384
- var error = function () {
385
- removeListeners();
386
- reject('Unable to load data of type ' + blob.type + ': ' + blobUrl);
387
- };
388
- image.addEventListener('load', loaded);
389
- image.addEventListener('error', error);
390
- image.src = blobUrl;
391
- if (image.complete) {
392
- setTimeout(loaded, 0);
393
- }
394
- });
395
- };
396
- var anyUriToBlob = function (url) {
397
- return new Promise(function (resolve, reject) {
398
- var xhr = new XMLHttpRequest();
399
- xhr.open('GET', url, true);
400
- xhr.responseType = 'blob';
401
- xhr.onload = function () {
402
- if (this.status === 200) {
403
- resolve(this.response);
404
- }
405
- };
406
- xhr.onerror = function () {
407
- var _this = this;
408
- var corsError = function () {
409
- var obj = new Error('No access to download image');
410
- obj.code = 18;
411
- obj.name = 'SecurityError';
412
- return obj;
413
- };
414
- var genericError = function () {
415
- return new Error('Error ' + _this.status + ' downloading image');
416
- };
417
- reject(this.status === 0 ? corsError() : genericError());
418
- };
419
- xhr.send();
420
- });
421
- };
422
- var dataUriToBlobSync = function (uri) {
423
- var data = uri.split(',');
424
- var matches = /data:([^;]+)/.exec(data[0]);
425
- if (!matches) {
426
- return Optional.none();
427
- }
428
- var mimetype = matches[1];
429
- var base64 = data[1];
430
- var sliceSize = 1024;
431
- var byteCharacters = atob(base64);
432
- var bytesLength = byteCharacters.length;
433
- var slicesCount = Math.ceil(bytesLength / sliceSize);
434
- var byteArrays = new Array(slicesCount);
435
- for (var sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {
436
- var begin = sliceIndex * sliceSize;
437
- var end = Math.min(begin + sliceSize, bytesLength);
438
- var bytes = new Array(end - begin);
439
- for (var offset = begin, i = 0; offset < end; ++i, ++offset) {
440
- bytes[i] = byteCharacters[offset].charCodeAt(0);
441
- }
442
- byteArrays[sliceIndex] = new Uint8Array(bytes);
443
- }
444
- return Optional.some(new Blob(byteArrays, { type: mimetype }));
445
- };
446
- var dataUriToBlob = function (uri) {
447
- return new Promise(function (resolve, reject) {
448
- dataUriToBlobSync(uri).fold(function () {
449
- reject('uri is not base64: ' + uri);
450
- }, resolve);
451
- });
452
- };
453
- var canvasToBlob = function (canvas, type, quality) {
454
- type = type || 'image/png';
455
- if (isFunction(HTMLCanvasElement.prototype.toBlob)) {
456
- return new Promise(function (resolve, reject) {
457
- canvas.toBlob(function (blob) {
458
- if (blob) {
459
- resolve(blob);
460
- } else {
461
- reject();
462
- }
463
- }, type, quality);
464
- });
465
- } else {
466
- return dataUriToBlob(canvas.toDataURL(type, quality));
467
- }
468
- };
469
- var canvasToDataURL = function (canvas, type, quality) {
470
- type = type || 'image/png';
471
- return canvas.toDataURL(type, quality);
472
- };
473
- var blobToCanvas = function (blob) {
474
- return blobToImage(blob).then(function (image) {
475
- revokeImageUrl(image);
476
- var canvas = create(getWidth(image), getHeight(image));
477
- var context = get2dContext(canvas);
478
- context.drawImage(image, 0, 0);
479
- return canvas;
480
- });
481
- };
482
- var blobToDataUri = function (blob) {
483
- return new Promise(function (resolve) {
484
- var reader = new FileReader();
485
- reader.onloadend = function () {
486
- resolve(reader.result);
487
- };
488
- reader.readAsDataURL(blob);
489
- });
490
- };
491
- var revokeImageUrl = function (image) {
492
- URL.revokeObjectURL(image.src);
493
- };
494
-
495
- var blobToImage$1 = function (blob) {
496
- return blobToImage(blob);
497
- };
498
- var imageToBlob$1 = function (image) {
499
- return imageToBlob(image);
500
- };
501
-
502
- var each = function (xs, f) {
503
- for (var i = 0, len = xs.length; i < len; i++) {
504
- var x = xs[i];
505
- f(x, i);
506
- }
507
- };
508
- var foldl = function (xs, f, acc) {
509
- each(xs, function (x) {
510
- acc = f(acc, x);
511
- });
512
- return acc;
513
- };
514
- var findUntil = function (xs, pred, until) {
515
- for (var i = 0, len = xs.length; i < len; i++) {
516
- var x = xs[i];
517
- if (pred(x, i)) {
518
- return Optional.some(x);
519
- } else if (until(x, i)) {
520
- break;
521
- }
522
- }
523
- return Optional.none();
524
- };
525
- var find = function (xs, pred) {
526
- return findUntil(xs, pred, never);
527
- };
528
-
529
- var create$1 = function (getCanvas, blob, uri) {
530
- var initialType = blob.type;
531
- var getType = constant(initialType);
532
- var toBlob = function () {
533
- return Promise.resolve(blob);
534
- };
535
- var toDataURL = constant(uri);
536
- var toBase64 = function () {
537
- return uri.split(',')[1];
538
- };
539
- var toAdjustedBlob = function (type, quality) {
540
- return getCanvas.then(function (canvas) {
541
- return canvasToBlob(canvas, type, quality);
542
- });
543
- };
544
- var toAdjustedDataURL = function (type, quality) {
545
- return getCanvas.then(function (canvas) {
546
- return canvasToDataURL(canvas, type, quality);
547
- });
548
- };
549
- var toAdjustedBase64 = function (type, quality) {
550
- return toAdjustedDataURL(type, quality).then(function (dataurl) {
551
- return dataurl.split(',')[1];
552
- });
553
- };
554
- var toCanvas = function () {
555
- return getCanvas.then(clone);
556
- };
557
- return {
558
- getType: getType,
559
- toBlob: toBlob,
560
- toDataURL: toDataURL,
561
- toBase64: toBase64,
562
- toAdjustedBlob: toAdjustedBlob,
563
- toAdjustedDataURL: toAdjustedDataURL,
564
- toAdjustedBase64: toAdjustedBase64,
565
- toCanvas: toCanvas
566
- };
567
- };
568
- var fromBlob = function (blob) {
569
- return blobToDataUri(blob).then(function (uri) {
570
- return create$1(blobToCanvas(blob), blob, uri);
571
- });
572
- };
573
- var fromCanvas = function (canvas, type) {
574
- return canvasToBlob(canvas, type).then(function (blob) {
575
- return create$1(Promise.resolve(canvas), blob, canvas.toDataURL());
576
- });
577
- };
578
-
579
- var ceilWithPrecision = function (num, precision) {
580
- if (precision === void 0) {
581
- precision = 2;
582
- }
583
- var mul = Math.pow(10, precision);
584
- var upper = Math.round(num * mul);
585
- return Math.ceil(upper / mul);
586
- };
587
- var rotate = function (ir, angle) {
588
- return ir.toCanvas().then(function (canvas) {
589
- return applyRotate(canvas, ir.getType(), angle);
590
- });
591
- };
592
- var applyRotate = function (image, type, angle) {
593
- var degrees = angle < 0 ? 360 + angle : angle;
594
- var rad = degrees * Math.PI / 180;
595
- var width = image.width;
596
- var height = image.height;
597
- var sin = Math.sin(rad);
598
- var cos = Math.cos(rad);
599
- var newWidth = ceilWithPrecision(Math.abs(width * cos) + Math.abs(height * sin));
600
- var newHeight = ceilWithPrecision(Math.abs(width * sin) + Math.abs(height * cos));
601
- var canvas = create(newWidth, newHeight);
602
- var context = get2dContext(canvas);
603
- context.translate(newWidth / 2, newHeight / 2);
604
- context.rotate(rad);
605
- context.drawImage(image, -width / 2, -height / 2);
606
- return fromCanvas(canvas, type);
607
- };
608
- var flip = function (ir, axis) {
609
- return ir.toCanvas().then(function (canvas) {
610
- return applyFlip(canvas, ir.getType(), axis);
611
- });
612
- };
613
- var applyFlip = function (image, type, axis) {
614
- var canvas = create(image.width, image.height);
615
- var context = get2dContext(canvas);
616
- if (axis === 'v') {
617
- context.scale(1, -1);
618
- context.drawImage(image, 0, -canvas.height);
619
- } else {
620
- context.scale(-1, 1);
621
- context.drawImage(image, -canvas.width, 0);
622
- }
623
- return fromCanvas(canvas, type);
624
- };
625
-
626
- var flip$1 = function (ir, axis) {
627
- return flip(ir, axis);
628
- };
629
- var rotate$1 = function (ir, angle) {
630
- return rotate(ir, angle);
631
- };
632
-
633
- var keys = Object.keys;
634
- var each$1 = function (obj, f) {
635
- var props = keys(obj);
636
- for (var k = 0, len = props.length; k < len; k++) {
637
- var i = props[k];
638
- var x = obj[i];
639
- f(x, i);
640
- }
641
- };
642
-
643
- var sendRequest = function (url, headers, withCredentials) {
644
- if (withCredentials === void 0) {
645
- withCredentials = false;
646
- }
647
- return new Promise(function (resolve) {
648
- var xhr = new XMLHttpRequest();
649
- xhr.onreadystatechange = function () {
650
- if (xhr.readyState === 4) {
651
- resolve({
652
- status: xhr.status,
653
- blob: xhr.response
654
- });
655
- }
656
- };
657
- xhr.open('GET', url, true);
658
- xhr.withCredentials = withCredentials;
659
- each$1(headers, function (value, key) {
660
- xhr.setRequestHeader(key, value);
661
- });
662
- xhr.responseType = 'blob';
663
- xhr.send();
664
- });
665
- };
666
- var readBlobText = function (blob) {
667
- return new Promise(function (resolve, reject) {
668
- var reader = new FileReader();
669
- reader.onload = function () {
670
- resolve(reader.result);
671
- };
672
- reader.onerror = function (e) {
673
- reject(e);
674
- };
675
- reader.readAsText(blob);
676
- });
677
- };
678
- var parseJson = function (text) {
679
- try {
680
- return Optional.some(JSON.parse(text));
681
- } catch (ex) {
682
- return Optional.none();
683
- }
684
- };
685
-
686
- var friendlyHttpErrors = [
687
- {
688
- code: 404,
689
- message: 'Could not find Image Proxy'
690
- },
691
- {
692
- code: 403,
693
- message: 'Rejected request'
694
- },
695
- {
696
- code: 0,
697
- message: 'Incorrect Image Proxy URL'
698
- }
699
- ];
700
- var friendlyServiceErrors = [
701
- {
702
- type: 'not_found',
703
- message: 'Failed to load image.'
704
- },
705
- {
706
- type: 'key_missing',
707
- message: 'The request did not include an api key.'
708
- },
709
- {
710
- type: 'key_not_found',
711
- message: 'The provided api key could not be found.'
712
- },
713
- {
714
- type: 'domain_not_trusted',
715
- message: 'The api key is not valid for the request origins.'
716
- }
717
- ];
718
- var traverseJson = function (json, path) {
719
- var value = foldl(path, function (result, key) {
720
- return isNonNullable(result) ? result[key] : undefined;
721
- }, json);
722
- return Optional.from(value);
723
- };
724
- var isServiceErrorCode = function (code, blob) {
725
- return (blob === null || blob === void 0 ? void 0 : blob.type) === 'application/json' && (code === 400 || code === 403 || code === 404 || code === 500);
726
- };
727
- var getHttpErrorMsg = function (status) {
728
- var message = find(friendlyHttpErrors, function (error) {
729
- return status === error.code;
730
- }).fold(constant('Unknown ImageProxy error'), function (error) {
731
- return error.message;
732
- });
733
- return 'ImageProxy HTTP error: ' + message;
734
- };
735
- var handleHttpError = function (status) {
736
- var message = getHttpErrorMsg(status);
737
- return Promise.reject(message);
738
- };
739
- var getServiceErrorMsg = function (type) {
740
- return find(friendlyServiceErrors, function (error) {
741
- return error.type === type;
742
- }).fold(constant('Unknown service error'), function (error) {
743
- return error.message;
744
- });
745
- };
746
- var getServiceError = function (text) {
747
- var serviceError = parseJson(text);
748
- var errorMsg = serviceError.bind(function (err) {
749
- return traverseJson(err, [
750
- 'error',
751
- 'type'
752
- ]).map(getServiceErrorMsg);
753
- }).getOr('Invalid JSON in service error message');
754
- return 'ImageProxy Service error: ' + errorMsg;
755
- };
756
- var handleServiceError = function (blob) {
757
- return readBlobText(blob).then(function (text) {
758
- var serviceError = getServiceError(text);
759
- return Promise.reject(serviceError);
760
- });
761
- };
762
- var handleServiceErrorResponse = function (status, blob) {
763
- return isServiceErrorCode(status, blob) ? handleServiceError(blob) : handleHttpError(status);
764
- };
765
-
766
- var appendApiKey = function (url, apiKey) {
767
- var separator = url.indexOf('?') === -1 ? '?' : '&';
768
- if (/[?&]apiKey=/.test(url)) {
769
- return url;
770
- } else {
771
- return url + separator + 'apiKey=' + encodeURIComponent(apiKey);
772
- }
773
- };
774
- var isError = function (status) {
775
- return status < 200 || status >= 300;
776
- };
777
- var requestServiceBlob = function (url, apiKey) {
778
- var headers = {
779
- 'Content-Type': 'application/json;charset=UTF-8',
780
- 'tiny-api-key': apiKey
781
- };
782
- return sendRequest(appendApiKey(url, apiKey), headers).then(function (result) {
783
- return isError(result.status) ? handleServiceErrorResponse(result.status, result.blob) : Promise.resolve(result.blob);
784
- });
785
- };
786
- var requestBlob = function (url, withCredentials) {
787
- return sendRequest(url, {}, withCredentials).then(function (result) {
788
- return isError(result.status) ? handleHttpError(result.status) : Promise.resolve(result.blob);
789
- });
790
- };
791
- var getUrl = function (url, apiKey, withCredentials) {
792
- if (withCredentials === void 0) {
793
- withCredentials = false;
794
- }
795
- return apiKey ? requestServiceBlob(url, apiKey) : requestBlob(url, withCredentials);
796
- };
797
-
798
- var blobToImageResult = function (blob) {
799
- return fromBlob(blob);
800
- };
801
-
802
- var ELEMENT = 1;
803
-
804
- var fromHtml = function (html, scope) {
805
- var doc = scope || document;
806
- var div = doc.createElement('div');
807
- div.innerHTML = html;
808
- if (!div.hasChildNodes() || div.childNodes.length > 1) {
809
- console.error('HTML does not have a single root node', html);
810
- throw new Error('HTML must have a single root node');
811
- }
812
- return fromDom(div.childNodes[0]);
813
- };
814
- var fromTag = function (tag, scope) {
815
- var doc = scope || document;
816
- var node = doc.createElement(tag);
817
- return fromDom(node);
818
- };
819
- var fromText = function (text, scope) {
820
- var doc = scope || document;
821
- var node = doc.createTextNode(text);
822
- return fromDom(node);
823
- };
824
- var fromDom = function (node) {
825
- if (node === null || node === undefined) {
826
- throw new Error('Node cannot be null or undefined');
827
- }
828
- return { dom: node };
829
- };
830
- var fromPoint = function (docElm, x, y) {
831
- return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom);
832
- };
833
- var SugarElement = {
834
- fromHtml: fromHtml,
835
- fromTag: fromTag,
836
- fromText: fromText,
837
- fromDom: fromDom,
838
- fromPoint: fromPoint
839
- };
840
-
841
- var is = function (element, selector) {
842
- var dom = element.dom;
843
- if (dom.nodeType !== ELEMENT) {
844
- return false;
845
- } else {
846
- var elem = dom;
847
- if (elem.matches !== undefined) {
848
- return elem.matches(selector);
849
- } else if (elem.msMatchesSelector !== undefined) {
850
- return elem.msMatchesSelector(selector);
851
- } else if (elem.webkitMatchesSelector !== undefined) {
852
- return elem.webkitMatchesSelector(selector);
853
- } else if (elem.mozMatchesSelector !== undefined) {
854
- return elem.mozMatchesSelector(selector);
855
- } else {
856
- throw new Error('Browser lacks native selectors');
857
- }
858
- }
859
- };
860
-
861
- var Global = typeof window !== 'undefined' ? window : Function('return this;')();
862
-
863
- var child = function (scope, predicate) {
864
- var pred = function (node) {
865
- return predicate(SugarElement.fromDom(node));
866
- };
867
- var result = find(scope.dom.childNodes, pred);
868
- return result.map(SugarElement.fromDom);
869
- };
870
-
871
- var child$1 = function (scope, selector) {
872
- return child(scope, function (e) {
873
- return is(e, selector);
874
- });
875
- };
876
-
877
- var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay');
878
-
879
- var global$3 = tinymce.util.Tools.resolve('tinymce.util.Promise');
880
-
881
- var global$4 = tinymce.util.Tools.resolve('tinymce.util.URI');
882
-
883
- var getToolbarItems = function (editor) {
884
- return editor.getParam('imagetools_toolbar', 'rotateleft rotateright flipv fliph editimage imageoptions');
885
- };
886
- var getProxyUrl = function (editor) {
887
- return editor.getParam('imagetools_proxy');
888
- };
889
- var getCorsHosts = function (editor) {
890
- return editor.getParam('imagetools_cors_hosts', [], 'string[]');
891
- };
892
- var getCredentialsHosts = function (editor) {
893
- return editor.getParam('imagetools_credentials_hosts', [], 'string[]');
894
- };
895
- var getFetchImage = function (editor) {
896
- return Optional.from(editor.getParam('imagetools_fetch_image', null, 'function'));
897
- };
898
- var getApiKey = function (editor) {
899
- return editor.getParam('api_key', editor.getParam('imagetools_api_key', '', 'string'), 'string');
900
- };
901
- var getUploadTimeout = function (editor) {
902
- return editor.getParam('images_upload_timeout', 30000, 'number');
903
- };
904
- var shouldReuseFilename = function (editor) {
905
- return editor.getParam('images_reuse_filename', false, 'boolean');
906
- };
907
-
908
- var getImageSize = function (img) {
909
- var width, height;
910
- var isPxValue = function (value) {
911
- return /^[0-9\.]+px$/.test(value);
912
- };
913
- width = img.style.width;
914
- height = img.style.height;
915
- if (width || height) {
916
- if (isPxValue(width) && isPxValue(height)) {
917
- return {
918
- w: parseInt(width, 10),
919
- h: parseInt(height, 10)
920
- };
921
- }
922
- return null;
923
- }
924
- width = img.width;
925
- height = img.height;
926
- if (width && height) {
927
- return {
928
- w: parseInt(width, 10),
929
- h: parseInt(height, 10)
930
- };
931
- }
932
- return null;
933
- };
934
- var setImageSize = function (img, size) {
935
- var width, height;
936
- if (size) {
937
- width = img.style.width;
938
- height = img.style.height;
939
- if (width || height) {
940
- img.style.width = size.w + 'px';
941
- img.style.height = size.h + 'px';
942
- img.removeAttribute('data-mce-style');
943
- }
944
- width = img.width;
945
- height = img.height;
946
- if (width || height) {
947
- img.setAttribute('width', String(size.w));
948
- img.setAttribute('height', String(size.h));
949
- }
950
- }
951
- };
952
- var getNaturalImageSize = function (img) {
953
- return {
954
- w: img.naturalWidth,
955
- h: img.naturalHeight
956
- };
957
- };
958
-
959
- var count = 0;
960
- var getFigureImg = function (elem) {
961
- return child$1(SugarElement.fromDom(elem), 'img');
962
- };
963
- var isFigure = function (editor, elem) {
964
- return editor.dom.is(elem, 'figure');
965
- };
966
- var isImage = function (editor, imgNode) {
967
- return editor.dom.is(imgNode, 'img:not([data-mce-object],[data-mce-placeholder])');
968
- };
969
- var getEditableImage = function (editor, node) {
970
- var isEditable = function (imgNode) {
971
- return isImage(editor, imgNode) && (isLocalImage(editor, imgNode) || isCorsImage(editor, imgNode) || isNonNullable(getProxyUrl(editor)));
972
- };
973
- if (isFigure(editor, node)) {
974
- return getFigureImg(node).bind(function (img) {
975
- return isEditable(img.dom) ? Optional.some(img.dom) : Optional.none();
976
- });
977
- } else {
978
- return isEditable(node) ? Optional.some(node) : Optional.none();
979
- }
980
- };
981
- var displayError = function (editor, error) {
982
- editor.notificationManager.open({
983
- text: error,
984
- type: 'error'
985
- });
986
- };
987
- var getSelectedImage = function (editor) {
988
- var elem = editor.selection.getNode();
989
- var figureElm = editor.dom.getParent(elem, 'figure.image');
990
- if (figureElm !== null && isFigure(editor, figureElm)) {
991
- return getFigureImg(figureElm);
992
- } else if (isImage(editor, elem)) {
993
- return Optional.some(SugarElement.fromDom(elem));
994
- } else {
995
- return Optional.none();
996
- }
997
- };
998
- var extractFilename = function (editor, url, group) {
999
- var m = url.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i);
1000
- return isNonNullable(m) ? editor.dom.encode(m[group]) : null;
1001
- };
1002
- var createId = function () {
1003
- return 'imagetools' + count++;
1004
- };
1005
- var isLocalImage = function (editor, img) {
1006
- var url = img.src;
1007
- return url.indexOf('data:') === 0 || url.indexOf('blob:') === 0 || new global$4(url).host === editor.documentBaseURI.host;
1008
- };
1009
- var isCorsImage = function (editor, img) {
1010
- return global$1.inArray(getCorsHosts(editor), new global$4(img.src).host) !== -1;
1011
- };
1012
- var isCorsWithCredentialsImage = function (editor, img) {
1013
- return global$1.inArray(getCredentialsHosts(editor), new global$4(img.src).host) !== -1;
1014
- };
1015
- var defaultFetchImage = function (editor, img) {
1016
- if (isCorsImage(editor, img)) {
1017
- return getUrl(img.src, null, isCorsWithCredentialsImage(editor, img));
1018
- }
1019
- if (!isLocalImage(editor, img)) {
1020
- var proxyUrl = getProxyUrl(editor);
1021
- var src = proxyUrl + (proxyUrl.indexOf('?') === -1 ? '?' : '&') + 'url=' + encodeURIComponent(img.src);
1022
- var apiKey = getApiKey(editor);
1023
- return getUrl(src, apiKey, false);
1024
- }
1025
- return imageToBlob$1(img);
1026
- };
1027
- var imageToBlob$2 = function (editor, img) {
1028
- return getFetchImage(editor).fold(function () {
1029
- return defaultFetchImage(editor, img);
1030
- }, function (customFetchImage) {
1031
- return customFetchImage(img);
1032
- });
1033
- };
1034
- var findBlob = function (editor, img) {
1035
- var blobInfo = editor.editorUpload.blobCache.getByUri(img.src);
1036
- if (blobInfo) {
1037
- return global$3.resolve(blobInfo.blob());
1038
- }
1039
- return imageToBlob$2(editor, img);
1040
- };
1041
- var startTimedUpload = function (editor, imageUploadTimerState) {
1042
- var imageUploadTimer = global$2.setEditorTimeout(editor, function () {
1043
- editor.editorUpload.uploadImagesAuto();
1044
- }, getUploadTimeout(editor));
1045
- imageUploadTimerState.set(imageUploadTimer);
1046
- };
1047
- var cancelTimedUpload = function (imageUploadTimerState) {
1048
- global$2.clearTimeout(imageUploadTimerState.get());
1049
- };
1050
- var updateSelectedImage = function (editor, origBlob, ir, uploadImmediately, imageUploadTimerState, selectedImage, size) {
1051
- return ir.toBlob().then(function (blob) {
1052
- var uri, name, filename, blobInfo;
1053
- var blobCache = editor.editorUpload.blobCache;
1054
- uri = selectedImage.src;
1055
- var useFilename = origBlob.type === blob.type;
1056
- if (shouldReuseFilename(editor)) {
1057
- blobInfo = blobCache.getByUri(uri);
1058
- if (isNonNullable(blobInfo)) {
1059
- uri = blobInfo.uri();
1060
- name = blobInfo.name();
1061
- filename = blobInfo.filename();
1062
- } else {
1063
- name = extractFilename(editor, uri, 2);
1064
- filename = extractFilename(editor, uri, 1);
1065
- }
1066
- }
1067
- blobInfo = blobCache.create({
1068
- id: createId(),
1069
- blob: blob,
1070
- base64: ir.toBase64(),
1071
- uri: uri,
1072
- name: name,
1073
- filename: useFilename ? filename : undefined
1074
- });
1075
- blobCache.add(blobInfo);
1076
- editor.undoManager.transact(function () {
1077
- var imageLoadedHandler = function () {
1078
- editor.$(selectedImage).off('load', imageLoadedHandler);
1079
- editor.nodeChanged();
1080
- if (uploadImmediately) {
1081
- editor.editorUpload.uploadImagesAuto();
1082
- } else {
1083
- cancelTimedUpload(imageUploadTimerState);
1084
- startTimedUpload(editor, imageUploadTimerState);
1085
- }
1086
- };
1087
- editor.$(selectedImage).on('load', imageLoadedHandler);
1088
- if (size) {
1089
- editor.$(selectedImage).attr({
1090
- width: size.w,
1091
- height: size.h
1092
- });
1093
- }
1094
- editor.$(selectedImage).attr({ src: blobInfo.blobUri() }).removeAttr('data-mce-src');
1095
- });
1096
- return blobInfo;
1097
- });
1098
- };
1099
- var selectedImageOperation = function (editor, imageUploadTimerState, fn, size) {
1100
- return function () {
1101
- var imgOpt = getSelectedImage(editor);
1102
- return imgOpt.fold(function () {
1103
- displayError(editor, 'Could not find selected image');
1104
- }, function (img) {
1105
- return editor._scanForImages().then(function () {
1106
- return findBlob(editor, img.dom);
1107
- }).then(function (blob) {
1108
- return blobToImageResult(blob).then(fn).then(function (imageResult) {
1109
- return updateSelectedImage(editor, blob, imageResult, false, imageUploadTimerState, img.dom, size);
1110
- });
1111
- }).catch(function (error) {
1112
- displayError(editor, error);
1113
- });
1114
- });
1115
- };
1116
- };
1117
- var rotate$2 = function (editor, imageUploadTimerState, angle) {
1118
- return function () {
1119
- var imgOpt = getSelectedImage(editor);
1120
- var flippedSize = imgOpt.fold(function () {
1121
- return null;
1122
- }, function (img) {
1123
- var size = getImageSize(img.dom);
1124
- return size ? {
1125
- w: size.h,
1126
- h: size.w
1127
- } : null;
1128
- });
1129
- return selectedImageOperation(editor, imageUploadTimerState, function (imageResult) {
1130
- return rotate$1(imageResult, angle);
1131
- }, flippedSize)();
1132
- };
1133
- };
1134
- var flip$2 = function (editor, imageUploadTimerState, axis) {
1135
- return function () {
1136
- return selectedImageOperation(editor, imageUploadTimerState, function (imageResult) {
1137
- return flip$1(imageResult, axis);
1138
- })();
1139
- };
1140
- };
1141
- var handleDialogBlob = function (editor, imageUploadTimerState, img, originalSize, blob) {
1142
- return blobToImage$1(blob).then(function (newImage) {
1143
- var newSize = getNaturalImageSize(newImage);
1144
- if (originalSize.w !== newSize.w || originalSize.h !== newSize.h) {
1145
- if (getImageSize(img)) {
1146
- setImageSize(img, newSize);
1147
- }
1148
- }
1149
- URL.revokeObjectURL(newImage.src);
1150
- return blob;
1151
- }).then(blobToImageResult).then(function (imageResult) {
1152
- return updateSelectedImage(editor, blob, imageResult, true, imageUploadTimerState, img);
1153
- });
1154
- };
1155
-
1156
- var saveState = 'save-state';
1157
- var disable = 'disable';
1158
- var enable = 'enable';
1159
-
1160
- var createState = function (blob) {
1161
- return {
1162
- blob: blob,
1163
- url: URL.createObjectURL(blob)
1164
- };
1165
- };
1166
- var makeOpen = function (editor, imageUploadTimerState) {
1167
- return function () {
1168
- var getLoadedSpec = function (currentState) {
1169
- return {
1170
- title: 'Edit Image',
1171
- size: 'large',
1172
- body: {
1173
- type: 'panel',
1174
- items: [{
1175
- type: 'imagetools',
1176
- name: 'imagetools',
1177
- label: 'Edit Image',
1178
- currentState: currentState
1179
- }]
1180
- },
1181
- buttons: [
1182
- {
1183
- type: 'cancel',
1184
- name: 'cancel',
1185
- text: 'Cancel'
1186
- },
1187
- {
1188
- type: 'submit',
1189
- name: 'save',
1190
- text: 'Save',
1191
- primary: true,
1192
- disabled: true
1193
- }
1194
- ],
1195
- onSubmit: function (api) {
1196
- var blob = api.getData().imagetools.blob;
1197
- originalImgOpt.each(function (originalImg) {
1198
- originalSizeOpt.each(function (originalSize) {
1199
- handleDialogBlob(editor, imageUploadTimerState, originalImg.dom, originalSize, blob);
1200
- });
1201
- });
1202
- api.close();
1203
- },
1204
- onCancel: noop,
1205
- onAction: function (api, details) {
1206
- switch (details.name) {
1207
- case saveState:
1208
- if (details.value) {
1209
- api.enable('save');
1210
- } else {
1211
- api.disable('save');
1212
- }
1213
- break;
1214
- case disable:
1215
- api.disable('save');
1216
- api.disable('cancel');
1217
- break;
1218
- case enable:
1219
- api.enable('cancel');
1220
- break;
1221
- }
1222
- }
1223
- };
1224
- };
1225
- var originalImgOpt = getSelectedImage(editor);
1226
- var originalSizeOpt = originalImgOpt.map(function (origImg) {
1227
- return getNaturalImageSize(origImg.dom);
1228
- });
1229
- originalImgOpt.each(function (img) {
1230
- getEditableImage(editor, img.dom).each(function (_) {
1231
- findBlob(editor, img.dom).then(function (blob) {
1232
- var state = createState(blob);
1233
- editor.windowManager.open(getLoadedSpec(state));
1234
- });
1235
- });
1236
- });
1237
- };
1238
- };
1239
-
1240
- var register = function (editor, imageUploadTimerState) {
1241
- global$1.each({
1242
- mceImageRotateLeft: rotate$2(editor, imageUploadTimerState, -90),
1243
- mceImageRotateRight: rotate$2(editor, imageUploadTimerState, 90),
1244
- mceImageFlipVertical: flip$2(editor, imageUploadTimerState, 'v'),
1245
- mceImageFlipHorizontal: flip$2(editor, imageUploadTimerState, 'h'),
1246
- mceEditImage: makeOpen(editor, imageUploadTimerState)
1247
- }, function (fn, cmd) {
1248
- editor.addCommand(cmd, fn);
1249
- });
1250
- };
1251
-
1252
- var setup = function (editor, imageUploadTimerState, lastSelectedImageState) {
1253
- editor.on('NodeChange', function (e) {
1254
- var lastSelectedImage = lastSelectedImageState.get();
1255
- var selectedImage = getEditableImage(editor, e.element);
1256
- if (lastSelectedImage && !selectedImage.exists(function (img) {
1257
- return lastSelectedImage.src === img.src;
1258
- })) {
1259
- cancelTimedUpload(imageUploadTimerState);
1260
- editor.editorUpload.uploadImagesAuto();
1261
- lastSelectedImageState.set(null);
1262
- }
1263
- selectedImage.each(lastSelectedImageState.set);
1264
- });
1265
- };
1266
-
1267
- var register$1 = function (editor) {
1268
- var cmd = function (command) {
1269
- return function () {
1270
- return editor.execCommand(command);
1271
- };
1272
- };
1273
- editor.ui.registry.addButton('rotateleft', {
1274
- tooltip: 'Rotate counterclockwise',
1275
- icon: 'rotate-left',
1276
- onAction: cmd('mceImageRotateLeft')
1277
- });
1278
- editor.ui.registry.addButton('rotateright', {
1279
- tooltip: 'Rotate clockwise',
1280
- icon: 'rotate-right',
1281
- onAction: cmd('mceImageRotateRight')
1282
- });
1283
- editor.ui.registry.addButton('flipv', {
1284
- tooltip: 'Flip vertically',
1285
- icon: 'flip-vertically',
1286
- onAction: cmd('mceImageFlipVertical')
1287
- });
1288
- editor.ui.registry.addButton('fliph', {
1289
- tooltip: 'Flip horizontally',
1290
- icon: 'flip-horizontally',
1291
- onAction: cmd('mceImageFlipHorizontal')
1292
- });
1293
- editor.ui.registry.addButton('editimage', {
1294
- tooltip: 'Edit image',
1295
- icon: 'edit-image',
1296
- onAction: cmd('mceEditImage'),
1297
- onSetup: function (buttonApi) {
1298
- var setDisabled = function () {
1299
- var disabled = getSelectedImage(editor).forall(function (element) {
1300
- return getEditableImage(editor, element.dom).isNone();
1301
- });
1302
- buttonApi.setDisabled(disabled);
1303
- };
1304
- editor.on('NodeChange', setDisabled);
1305
- return function () {
1306
- editor.off('NodeChange', setDisabled);
1307
- };
1308
- }
1309
- });
1310
- editor.ui.registry.addButton('imageoptions', {
1311
- tooltip: 'Image options',
1312
- icon: 'image',
1313
- onAction: cmd('mceImage')
1314
- });
1315
- editor.ui.registry.addContextMenu('imagetools', {
1316
- update: function (element) {
1317
- return getEditableImage(editor, element).fold(function () {
1318
- return [];
1319
- }, function (_) {
1320
- return [{
1321
- text: 'Edit image',
1322
- icon: 'edit-image',
1323
- onAction: cmd('mceEditImage')
1324
- }];
1325
- });
1326
- }
1327
- });
1328
- };
1329
-
1330
- var register$2 = function (editor) {
1331
- editor.ui.registry.addContextToolbar('imagetools', {
1332
- items: getToolbarItems(editor),
1333
- predicate: function (elem) {
1334
- return getEditableImage(editor, elem).isSome();
1335
- },
1336
- position: 'node',
1337
- scope: 'node'
1338
- });
1339
- };
1340
-
1341
- function Plugin () {
1342
- global.add('imagetools', function (editor) {
1343
- var imageUploadTimerState = Cell(0);
1344
- var lastSelectedImageState = Cell(null);
1345
- register(editor, imageUploadTimerState);
1346
- register$1(editor);
1347
- register$2(editor);
1348
- setup(editor, imageUploadTimerState, lastSelectedImageState);
1349
- });
1350
- }
1351
-
1352
- Plugin();
1353
-
1354
- }());