argous 1.2.202 → 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 (407) hide show
  1. package/dist/components/ConfirmModal/ModalProvider.d.ts +1 -1
  2. package/dist/components/Editor/components/Editor.d.ts +4 -4
  3. package/dist/components/Editor/components/Editor.js +3 -3
  4. package/dist/components/Editor/skins/content/dark/content.d.ts +0 -0
  5. package/dist/components/Editor/skins/content/dark/content.js +3 -0
  6. package/dist/components/Editor/skins/content/default/content.d.ts +0 -0
  7. package/dist/components/Editor/skins/content/default/content.js +3 -0
  8. package/dist/components/Editor/skins/content/document/content.d.ts +0 -0
  9. package/dist/components/Editor/skins/content/document/content.js +3 -0
  10. package/dist/components/Editor/skins/content/tinymce-5/content.d.ts +0 -0
  11. package/dist/components/Editor/skins/content/tinymce-5/content.js +3 -0
  12. package/dist/components/Editor/skins/content/tinymce-5-dark/content.d.ts +0 -0
  13. package/dist/components/Editor/skins/content/tinymce-5-dark/content.js +3 -0
  14. package/dist/components/Editor/skins/content/writer/content.d.ts +0 -0
  15. package/dist/components/Editor/skins/content/writer/content.js +3 -0
  16. package/dist/components/Editor/skins/ui/oxide/content.d.ts +0 -0
  17. package/dist/components/Editor/skins/ui/oxide/content.inline.d.ts +0 -0
  18. package/dist/components/Editor/skins/ui/oxide/content.inline.js +3 -0
  19. package/dist/components/Editor/skins/ui/oxide/content.js +3 -0
  20. package/dist/components/Editor/skins/ui/oxide/skin.d.ts +0 -0
  21. package/dist/components/Editor/skins/ui/oxide/skin.js +3 -0
  22. package/dist/components/Editor/skins/ui/oxide/skin.shadowdom.d.ts +0 -0
  23. package/dist/components/Editor/skins/ui/oxide/skin.shadowdom.js +3 -0
  24. package/dist/components/Editor/skins/ui/oxide-dark/content.d.ts +0 -0
  25. package/dist/components/Editor/skins/ui/oxide-dark/content.inline.d.ts +0 -0
  26. package/dist/components/Editor/skins/ui/oxide-dark/content.inline.js +3 -0
  27. package/dist/components/Editor/skins/ui/oxide-dark/content.js +3 -0
  28. package/dist/components/Editor/skins/ui/oxide-dark/skin.d.ts +0 -0
  29. package/dist/components/Editor/skins/ui/oxide-dark/skin.js +3 -0
  30. package/dist/components/Editor/skins/ui/oxide-dark/skin.shadowdom.d.ts +0 -0
  31. package/dist/components/Editor/skins/ui/oxide-dark/skin.shadowdom.js +3 -0
  32. package/dist/components/Editor/skins/ui/tinymce-5/content.d.ts +0 -0
  33. package/dist/components/Editor/skins/ui/tinymce-5/content.inline.d.ts +0 -0
  34. package/dist/components/Editor/skins/ui/tinymce-5/content.inline.js +3 -0
  35. package/dist/components/Editor/skins/ui/tinymce-5/content.js +3 -0
  36. package/dist/components/Editor/skins/ui/tinymce-5/skin.d.ts +0 -0
  37. package/dist/components/Editor/skins/ui/tinymce-5/skin.js +3 -0
  38. package/dist/components/Editor/skins/ui/tinymce-5/skin.shadowdom.d.ts +0 -0
  39. package/dist/components/Editor/skins/ui/tinymce-5/skin.shadowdom.js +3 -0
  40. package/dist/components/Editor/skins/ui/tinymce-5-dark/content.d.ts +0 -0
  41. package/dist/components/Editor/skins/ui/tinymce-5-dark/content.inline.d.ts +0 -0
  42. package/dist/components/Editor/skins/ui/tinymce-5-dark/content.inline.js +3 -0
  43. package/dist/components/Editor/skins/ui/tinymce-5-dark/content.js +3 -0
  44. package/dist/components/Editor/skins/ui/tinymce-5-dark/skin.d.ts +0 -0
  45. package/dist/components/Editor/skins/ui/tinymce-5-dark/skin.js +3 -0
  46. package/dist/components/Editor/skins/ui/tinymce-5-dark/skin.shadowdom.d.ts +0 -0
  47. package/dist/components/Editor/skins/ui/tinymce-5-dark/skin.shadowdom.js +3 -0
  48. package/dist/components/Editor/tinymce/tinymce.d.ts +1722 -1447
  49. package/lib/components/Editor/components/Editor.tsx +8 -8
  50. package/lib/components/Editor/skins/content/dark/content.js +2 -0
  51. package/lib/components/Editor/skins/content/dark/content.min.css +1 -8
  52. package/lib/components/Editor/skins/content/default/content.js +2 -0
  53. package/lib/components/Editor/skins/content/default/content.min.css +0 -7
  54. package/lib/components/Editor/skins/content/document/content.js +2 -0
  55. package/lib/components/Editor/skins/content/document/content.min.css +0 -7
  56. package/lib/components/Editor/skins/content/tinymce-5/content.js +2 -0
  57. package/lib/components/Editor/skins/content/tinymce-5/content.min.css +1 -0
  58. package/lib/components/Editor/skins/content/tinymce-5-dark/content.js +2 -0
  59. package/lib/components/Editor/skins/content/tinymce-5-dark/content.min.css +1 -0
  60. package/lib/components/Editor/skins/content/writer/content.js +2 -0
  61. package/lib/components/Editor/skins/content/writer/content.min.css +0 -7
  62. package/lib/components/Editor/skins/ui/oxide/content.inline.js +2 -0
  63. package/lib/components/Editor/skins/ui/oxide/content.inline.min.css +1 -0
  64. package/lib/components/Editor/skins/ui/oxide/content.js +2 -0
  65. package/lib/components/Editor/skins/ui/oxide/content.min.css +1 -0
  66. package/lib/components/Editor/skins/ui/oxide/skin.js +2 -0
  67. package/lib/components/Editor/skins/ui/oxide/skin.min.css +1 -0
  68. package/lib/components/Editor/skins/ui/oxide/skin.shadowdom.js +2 -0
  69. package/lib/components/Editor/skins/ui/oxide/skin.shadowdom.min.css +1 -0
  70. package/lib/components/Editor/skins/ui/oxide-dark/content.inline.js +2 -0
  71. package/lib/components/Editor/skins/ui/oxide-dark/content.inline.min.css +1 -0
  72. package/lib/components/Editor/skins/ui/oxide-dark/content.js +2 -0
  73. package/lib/components/Editor/skins/ui/oxide-dark/content.min.css +1 -0
  74. package/lib/components/Editor/skins/ui/oxide-dark/skin.js +2 -0
  75. package/lib/components/Editor/skins/ui/oxide-dark/skin.min.css +1 -0
  76. package/lib/components/Editor/skins/ui/oxide-dark/skin.shadowdom.js +2 -0
  77. package/lib/components/Editor/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -0
  78. package/lib/components/Editor/skins/ui/tinymce-5/content.inline.js +2 -0
  79. package/lib/components/Editor/skins/ui/tinymce-5/content.inline.min.css +1 -0
  80. package/lib/components/Editor/skins/ui/tinymce-5/content.js +2 -0
  81. package/lib/components/Editor/skins/ui/tinymce-5/content.min.css +1 -0
  82. package/lib/components/Editor/skins/ui/tinymce-5/skin.js +2 -0
  83. package/lib/components/Editor/skins/ui/tinymce-5/skin.min.css +1 -0
  84. package/lib/components/Editor/skins/ui/tinymce-5/skin.shadowdom.js +2 -0
  85. package/lib/components/Editor/skins/ui/tinymce-5/skin.shadowdom.min.css +1 -0
  86. package/lib/components/Editor/skins/ui/tinymce-5-dark/content.inline.js +2 -0
  87. package/lib/components/Editor/skins/ui/tinymce-5-dark/content.inline.min.css +1 -0
  88. package/lib/components/Editor/skins/ui/tinymce-5-dark/content.js +2 -0
  89. package/lib/components/Editor/skins/ui/tinymce-5-dark/content.min.css +1 -0
  90. package/lib/components/Editor/skins/ui/tinymce-5-dark/skin.js +2 -0
  91. package/lib/components/Editor/skins/ui/tinymce-5-dark/skin.min.css +1 -0
  92. package/lib/components/Editor/skins/ui/tinymce-5-dark/skin.shadowdom.js +2 -0
  93. package/lib/components/Editor/skins/ui/tinymce-5-dark/skin.shadowdom.min.css +1 -0
  94. package/lib/components/Editor/tinymce/README.md +24 -14
  95. package/lib/components/Editor/tinymce/icons/default/icons.js +185 -163
  96. package/lib/components/Editor/tinymce/icons/default/icons.min.js +1 -1
  97. package/lib/components/Editor/tinymce/langs/README.md +1 -1
  98. package/lib/components/Editor/tinymce/license.txt +21 -504
  99. package/lib/components/Editor/tinymce/models/dom/model.js +8040 -0
  100. package/lib/components/Editor/tinymce/models/dom/model.min.js +4 -0
  101. package/lib/components/Editor/tinymce/plugins/accordion/plugin.js +1054 -0
  102. package/lib/components/Editor/tinymce/plugins/accordion/plugin.min.js +4 -0
  103. package/lib/components/Editor/tinymce/plugins/advlist/plugin.js +187 -208
  104. package/lib/components/Editor/tinymce/plugins/advlist/plugin.min.js +2 -7
  105. package/lib/components/Editor/tinymce/plugins/anchor/plugin.js +82 -84
  106. package/lib/components/Editor/tinymce/plugins/anchor/plugin.min.js +2 -7
  107. package/lib/components/Editor/tinymce/plugins/autolink/plugin.js +210 -167
  108. package/lib/components/Editor/tinymce/plugins/autolink/plugin.min.js +2 -7
  109. package/lib/components/Editor/tinymce/plugins/autoresize/plugin.js +118 -97
  110. package/lib/components/Editor/tinymce/plugins/autoresize/plugin.min.js +2 -7
  111. package/lib/components/Editor/tinymce/plugins/autosave/plugin.js +129 -108
  112. package/lib/components/Editor/tinymce/plugins/autosave/plugin.min.js +2 -7
  113. package/lib/components/Editor/tinymce/plugins/charmap/plugin.js +285 -333
  114. package/lib/components/Editor/tinymce/plugins/charmap/plugin.min.js +2 -7
  115. package/lib/components/Editor/tinymce/plugins/code/plugin.js +19 -26
  116. package/lib/components/Editor/tinymce/plugins/code/plugin.min.js +2 -7
  117. package/lib/components/Editor/tinymce/plugins/codesample/plugin.js +2225 -2094
  118. package/lib/components/Editor/tinymce/plugins/codesample/plugin.min.js +2 -7
  119. package/lib/components/Editor/tinymce/plugins/directionality/plugin.js +318 -243
  120. package/lib/components/Editor/tinymce/plugins/directionality/plugin.min.js +2 -7
  121. package/lib/components/Editor/tinymce/plugins/emoticons/js/emojiimages.js +1 -9424
  122. package/lib/components/Editor/tinymce/plugins/emoticons/js/emojiimages.min.js +1 -1
  123. package/lib/components/Editor/tinymce/plugins/emoticons/js/emojis.js +1 -9423
  124. package/lib/components/Editor/tinymce/plugins/emoticons/js/emojis.min.js +1 -1
  125. package/lib/components/Editor/tinymce/plugins/emoticons/plugin.js +406 -416
  126. package/lib/components/Editor/tinymce/plugins/emoticons/plugin.min.js +2 -7
  127. package/lib/components/Editor/tinymce/plugins/fullscreen/plugin.js +821 -604
  128. package/lib/components/Editor/tinymce/plugins/fullscreen/plugin.min.js +2 -7
  129. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ar.js +90 -0
  130. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/bg_BG.js +90 -0
  131. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ca.js +90 -0
  132. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/cs.js +90 -0
  133. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/da.js +90 -0
  134. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/de.js +90 -0
  135. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/el.js +90 -0
  136. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/en.js +90 -0
  137. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/es.js +90 -0
  138. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/eu.js +90 -0
  139. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/fa.js +90 -0
  140. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/fi.js +90 -0
  141. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/fr_FR.js +90 -0
  142. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/he_IL.js +90 -0
  143. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/hi.js +90 -0
  144. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/hr.js +90 -0
  145. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/hu_HU.js +90 -0
  146. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/id.js +90 -0
  147. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/it.js +90 -0
  148. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ja.js +90 -0
  149. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/kk.js +90 -0
  150. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ko_KR.js +90 -0
  151. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ms.js +90 -0
  152. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/nb_NO.js +90 -0
  153. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/nl.js +90 -0
  154. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/pl.js +90 -0
  155. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/pt_BR.js +90 -0
  156. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/pt_PT.js +90 -0
  157. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ro.js +90 -0
  158. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ru.js +90 -0
  159. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/sk.js +90 -0
  160. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/sl_SI.js +90 -0
  161. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/sv_SE.js +90 -0
  162. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/th_TH.js +90 -0
  163. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/tr.js +90 -0
  164. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/uk.js +90 -0
  165. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/vi.js +90 -0
  166. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/zh_CN.js +84 -0
  167. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/zh_TW.js +90 -0
  168. package/lib/components/Editor/tinymce/plugins/help/plugin.js +428 -403
  169. package/lib/components/Editor/tinymce/plugins/help/plugin.min.js +2 -7
  170. package/lib/components/Editor/tinymce/plugins/image/plugin.js +887 -1043
  171. package/lib/components/Editor/tinymce/plugins/image/plugin.min.js +2 -7
  172. package/lib/components/Editor/tinymce/plugins/importcss/plugin.js +163 -162
  173. package/lib/components/Editor/tinymce/plugins/importcss/plugin.min.js +2 -7
  174. package/lib/components/Editor/tinymce/plugins/insertdatetime/plugin.js +101 -91
  175. package/lib/components/Editor/tinymce/plugins/insertdatetime/plugin.min.js +2 -7
  176. package/lib/components/Editor/tinymce/plugins/link/plugin.js +739 -784
  177. package/lib/components/Editor/tinymce/plugins/link/plugin.min.js +2 -7
  178. package/lib/components/Editor/tinymce/plugins/lists/plugin.js +1282 -1396
  179. package/lib/components/Editor/tinymce/plugins/lists/plugin.min.js +2 -7
  180. package/lib/components/Editor/tinymce/plugins/media/plugin.js +641 -806
  181. package/lib/components/Editor/tinymce/plugins/media/plugin.min.js +2 -7
  182. package/lib/components/Editor/tinymce/plugins/nonbreaking/plugin.js +76 -54
  183. package/lib/components/Editor/tinymce/plugins/nonbreaking/plugin.min.js +2 -7
  184. package/lib/components/Editor/tinymce/plugins/pagebreak/plugin.js +58 -46
  185. package/lib/components/Editor/tinymce/plugins/pagebreak/plugin.min.js +2 -7
  186. package/lib/components/Editor/tinymce/plugins/preview/plugin.js +39 -69
  187. package/lib/components/Editor/tinymce/plugins/preview/plugin.min.js +2 -7
  188. package/lib/components/Editor/tinymce/plugins/quickbars/plugin.js +307 -349
  189. package/lib/components/Editor/tinymce/plugins/quickbars/plugin.min.js +2 -7
  190. package/lib/components/Editor/tinymce/plugins/save/plugin.js +50 -51
  191. package/lib/components/Editor/tinymce/plugins/save/plugin.min.js +2 -7
  192. package/lib/components/Editor/tinymce/plugins/searchreplace/plugin.js +517 -587
  193. package/lib/components/Editor/tinymce/plugins/searchreplace/plugin.min.js +2 -7
  194. package/lib/components/Editor/tinymce/plugins/table/plugin.js +2666 -10142
  195. package/lib/components/Editor/tinymce/plugins/table/plugin.min.js +2 -7
  196. package/lib/components/Editor/tinymce/plugins/template/plugin.js +403 -413
  197. package/lib/components/Editor/tinymce/plugins/template/plugin.min.js +2 -7
  198. package/lib/components/Editor/tinymce/plugins/visualblocks/plugin.js +42 -48
  199. package/lib/components/Editor/tinymce/plugins/visualblocks/plugin.min.js +2 -7
  200. package/lib/components/Editor/tinymce/plugins/visualchars/plugin.js +352 -333
  201. package/lib/components/Editor/tinymce/plugins/visualchars/plugin.min.js +2 -7
  202. package/lib/components/Editor/tinymce/plugins/wordcount/plugin.js +184 -195
  203. package/lib/components/Editor/tinymce/plugins/wordcount/plugin.min.js +2 -7
  204. package/lib/components/Editor/tinymce/skins/content/dark/content.css +2 -8
  205. package/lib/components/Editor/tinymce/skins/content/dark/content.js +2 -0
  206. package/lib/components/Editor/tinymce/skins/content/dark/content.js.map +1 -0
  207. package/lib/components/Editor/tinymce/skins/content/dark/content.min.css +2 -8
  208. package/lib/components/Editor/tinymce/skins/content/dark/content.min.css.map +1 -1
  209. package/lib/components/Editor/tinymce/skins/content/default/content.css +0 -6
  210. package/lib/components/Editor/tinymce/skins/content/default/content.js +2 -0
  211. package/lib/components/Editor/tinymce/skins/content/default/content.js.map +1 -0
  212. package/lib/components/Editor/tinymce/skins/content/default/content.min.css +1 -7
  213. package/lib/components/Editor/tinymce/skins/content/default/content.min.css.map +1 -1
  214. package/lib/components/Editor/tinymce/skins/content/document/content.css +0 -6
  215. package/lib/components/Editor/tinymce/skins/content/document/content.js +2 -0
  216. package/lib/components/Editor/tinymce/skins/content/document/content.js.map +1 -0
  217. package/lib/components/Editor/tinymce/skins/content/document/content.min.css +0 -6
  218. package/lib/components/Editor/tinymce/skins/content/document/content.min.css.map +1 -1
  219. package/lib/components/Editor/{skins/content/default → tinymce/skins/content/tinymce-5}/content.css +0 -6
  220. package/lib/components/Editor/tinymce/skins/content/tinymce-5/content.js +2 -0
  221. package/lib/components/Editor/tinymce/skins/content/tinymce-5/content.js.map +1 -0
  222. package/lib/components/Editor/tinymce/skins/content/tinymce-5/content.min.css +2 -0
  223. package/lib/components/Editor/tinymce/skins/content/tinymce-5/content.min.css.map +1 -0
  224. package/lib/components/Editor/{skins/content/dark → tinymce/skins/content/tinymce-5-dark}/content.css +1 -7
  225. package/lib/components/Editor/tinymce/skins/content/tinymce-5-dark/content.js +2 -0
  226. package/lib/components/Editor/tinymce/skins/content/tinymce-5-dark/content.js.map +1 -0
  227. package/lib/components/Editor/tinymce/skins/content/tinymce-5-dark/content.min.css +2 -0
  228. package/lib/components/Editor/tinymce/skins/content/tinymce-5-dark/content.min.css.map +1 -0
  229. package/lib/components/Editor/tinymce/skins/content/writer/content.css +0 -6
  230. package/lib/components/Editor/tinymce/skins/content/writer/content.js +2 -0
  231. package/lib/components/Editor/tinymce/skins/content/writer/content.js.map +1 -0
  232. package/lib/components/Editor/tinymce/skins/content/writer/content.min.css +0 -6
  233. package/lib/components/Editor/tinymce/skins/content/writer/content.min.css.map +1 -1
  234. package/lib/components/Editor/tinymce/skins/ui/oxide/content.css +74 -21
  235. package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.css +74 -21
  236. package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.js +2 -0
  237. package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.js.map +1 -0
  238. package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.min.css +1 -7
  239. package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.min.css.map +1 -1
  240. package/lib/components/Editor/tinymce/skins/ui/oxide/content.js +2 -0
  241. package/lib/components/Editor/tinymce/skins/ui/oxide/content.js.map +1 -0
  242. package/lib/components/Editor/tinymce/skins/ui/oxide/content.min.css +1 -7
  243. package/lib/components/Editor/tinymce/skins/ui/oxide/content.min.css.map +1 -1
  244. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.css +1131 -402
  245. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.js +2 -0
  246. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.js.map +1 -0
  247. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.min.css +1 -7
  248. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.min.css.map +1 -1
  249. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.css +8 -15
  250. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.js +2 -0
  251. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.js.map +1 -0
  252. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.min.css +1 -7
  253. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.min.css.map +1 -1
  254. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.css +72 -20
  255. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.css +74 -21
  256. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.js +2 -0
  257. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.js.map +1 -0
  258. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.min.css +1 -7
  259. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.min.css.map +1 -1
  260. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.js +2 -0
  261. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.js.map +1 -0
  262. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.min.css +1 -7
  263. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.min.css.map +1 -1
  264. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.css +1155 -423
  265. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.js +2 -0
  266. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.js.map +1 -0
  267. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.min.css +1 -7
  268. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.min.css.map +1 -1
  269. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +8 -15
  270. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.js +2 -0
  271. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.js.map +1 -0
  272. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -7
  273. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css.map +1 -1
  274. package/lib/components/Editor/{skins/ui/default → tinymce/skins/ui/tinymce-5}/content.css +75 -22
  275. package/lib/components/Editor/{skins/ui/default → tinymce/skins/ui/tinymce-5}/content.inline.css +75 -22
  276. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.inline.js +2 -0
  277. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.inline.js.map +1 -0
  278. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.inline.min.css +2 -0
  279. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.inline.min.css.map +1 -0
  280. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.js +2 -0
  281. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.js.map +1 -0
  282. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.min.css +2 -0
  283. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.min.css.map +1 -0
  284. package/lib/components/Editor/{skins/ui/default → tinymce/skins/ui/tinymce-5}/skin.css +1261 -438
  285. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.js +2 -0
  286. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.js.map +1 -0
  287. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.min.css +2 -0
  288. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.min.css.map +1 -0
  289. package/lib/components/Editor/{skins/ui/default → tinymce/skins/ui/tinymce-5}/skin.shadowdom.css +8 -15
  290. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.shadowdom.js +2 -0
  291. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.shadowdom.js.map +1 -0
  292. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css +2 -0
  293. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css.map +1 -0
  294. package/lib/components/Editor/{skins/ui/dark → tinymce/skins/ui/tinymce-5-dark}/content.css +73 -21
  295. package/lib/components/Editor/{skins/ui/dark → tinymce/skins/ui/tinymce-5-dark}/content.inline.css +75 -22
  296. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.inline.js +2 -0
  297. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.inline.js.map +1 -0
  298. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +2 -0
  299. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css.map +1 -0
  300. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.js +2 -0
  301. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.js.map +1 -0
  302. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.min.css +2 -0
  303. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.min.css.map +1 -0
  304. package/lib/components/Editor/{skins/ui/dark → tinymce/skins/ui/tinymce-5-dark}/skin.css +1244 -421
  305. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.js +2 -0
  306. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.js.map +1 -0
  307. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.min.css +2 -0
  308. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.min.css.map +1 -0
  309. package/lib/components/Editor/{skins/ui/dark → tinymce/skins/ui/tinymce-5-dark}/skin.shadowdom.css +8 -15
  310. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.js +2 -0
  311. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.js.map +1 -0
  312. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css +2 -0
  313. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css.map +1 -0
  314. package/lib/components/Editor/tinymce/themes/silver/theme.js +23228 -24955
  315. package/lib/components/Editor/tinymce/themes/silver/theme.min.js +2 -7
  316. package/lib/components/Editor/tinymce/tinymce.d.ts +1722 -1447
  317. package/lib/components/Editor/tinymce/tinymce.js +23668 -22018
  318. package/lib/components/Editor/tinymce/tinymce.min.js +2 -30104
  319. package/package.json +1 -1
  320. package/lib/components/Editor/skins/content/dark/content.min.css.map +0 -1
  321. package/lib/components/Editor/skins/content/default/content.min.css.map +0 -1
  322. package/lib/components/Editor/skins/content/document/content.css +0 -72
  323. package/lib/components/Editor/skins/content/document/content.min.css.map +0 -1
  324. package/lib/components/Editor/skins/content/writer/content.css +0 -68
  325. package/lib/components/Editor/skins/content/writer/content.min.css.map +0 -1
  326. package/lib/components/Editor/skins/ui/dark/content.inline.min.css +0 -8
  327. package/lib/components/Editor/skins/ui/dark/content.inline.min.css.map +0 -1
  328. package/lib/components/Editor/skins/ui/dark/content.min.css +0 -8
  329. package/lib/components/Editor/skins/ui/dark/content.min.css.map +0 -1
  330. package/lib/components/Editor/skins/ui/dark/content.mobile.css +0 -29
  331. package/lib/components/Editor/skins/ui/dark/content.mobile.min.css +0 -8
  332. package/lib/components/Editor/skins/ui/dark/content.mobile.min.css.map +0 -1
  333. package/lib/components/Editor/skins/ui/dark/fonts/tinymce-mobile.woff +0 -0
  334. package/lib/components/Editor/skins/ui/dark/skin.min.css +0 -8
  335. package/lib/components/Editor/skins/ui/dark/skin.min.css.map +0 -1
  336. package/lib/components/Editor/skins/ui/dark/skin.mobile.css +0 -673
  337. package/lib/components/Editor/skins/ui/dark/skin.mobile.min.css +0 -8
  338. package/lib/components/Editor/skins/ui/dark/skin.mobile.min.css.map +0 -1
  339. package/lib/components/Editor/skins/ui/dark/skin.shadowdom.min.css +0 -8
  340. package/lib/components/Editor/skins/ui/dark/skin.shadowdom.min.css.map +0 -1
  341. package/lib/components/Editor/skins/ui/default/content.inline.min.css +0 -8
  342. package/lib/components/Editor/skins/ui/default/content.inline.min.css.map +0 -1
  343. package/lib/components/Editor/skins/ui/default/content.min.css +0 -8
  344. package/lib/components/Editor/skins/ui/default/content.min.css.map +0 -1
  345. package/lib/components/Editor/skins/ui/default/content.mobile.css +0 -29
  346. package/lib/components/Editor/skins/ui/default/content.mobile.min.css +0 -8
  347. package/lib/components/Editor/skins/ui/default/content.mobile.min.css.map +0 -1
  348. package/lib/components/Editor/skins/ui/default/fonts/tinymce-mobile.woff +0 -0
  349. package/lib/components/Editor/skins/ui/default/skin.min.css +0 -8
  350. package/lib/components/Editor/skins/ui/default/skin.min.css.map +0 -1
  351. package/lib/components/Editor/skins/ui/default/skin.mobile.css +0 -673
  352. package/lib/components/Editor/skins/ui/default/skin.mobile.min.css +0 -8
  353. package/lib/components/Editor/skins/ui/default/skin.mobile.min.css.map +0 -1
  354. package/lib/components/Editor/skins/ui/default/skin.shadowdom.min.css +0 -8
  355. package/lib/components/Editor/skins/ui/default/skin.shadowdom.min.css.map +0 -1
  356. package/lib/components/Editor/skins/ui/plugin-tinycomments-tinymce4/fonts/tinymce-mobile.woff +0 -0
  357. package/lib/components/Editor/skins/ui/plugin-tinycomments-tinymce4/plugin-tinycomments-tinymce4.css +0 -1641
  358. package/lib/components/Editor/skins/ui/plugin-tinycomments-tinymce4/plugin-tinycomments-tinymce4.min.css +0 -8
  359. package/lib/components/Editor/skins/ui/plugin-tinycomments-tinymce4/plugin-tinycomments-tinymce4.min.css.map +0 -1
  360. package/lib/components/Editor/tinymce/jquery.tinymce.min.js +0 -92
  361. package/lib/components/Editor/tinymce/langs/pt_BR.js +0 -419
  362. package/lib/components/Editor/tinymce/plugins/bbcode/plugin.js +0 -99
  363. package/lib/components/Editor/tinymce/plugins/bbcode/plugin.min.js +0 -9
  364. package/lib/components/Editor/tinymce/plugins/colorpicker/plugin.js +0 -22
  365. package/lib/components/Editor/tinymce/plugins/colorpicker/plugin.min.js +0 -9
  366. package/lib/components/Editor/tinymce/plugins/contextmenu/plugin.js +0 -22
  367. package/lib/components/Editor/tinymce/plugins/contextmenu/plugin.min.js +0 -9
  368. package/lib/components/Editor/tinymce/plugins/fullpage/plugin.js +0 -544
  369. package/lib/components/Editor/tinymce/plugins/fullpage/plugin.min.js +0 -9
  370. package/lib/components/Editor/tinymce/plugins/hr/plugin.js +0 -46
  371. package/lib/components/Editor/tinymce/plugins/hr/plugin.min.js +0 -9
  372. package/lib/components/Editor/tinymce/plugins/imagetools/plugin.js +0 -1354
  373. package/lib/components/Editor/tinymce/plugins/imagetools/plugin.min.js +0 -9
  374. package/lib/components/Editor/tinymce/plugins/legacyoutput/plugin.js +0 -199
  375. package/lib/components/Editor/tinymce/plugins/legacyoutput/plugin.min.js +0 -9
  376. package/lib/components/Editor/tinymce/plugins/noneditable/plugin.js +0 -117
  377. package/lib/components/Editor/tinymce/plugins/noneditable/plugin.min.js +0 -9
  378. package/lib/components/Editor/tinymce/plugins/paste/plugin.js +0 -1764
  379. package/lib/components/Editor/tinymce/plugins/paste/plugin.min.js +0 -9
  380. package/lib/components/Editor/tinymce/plugins/print/plugin.js +0 -53
  381. package/lib/components/Editor/tinymce/plugins/print/plugin.min.js +0 -9
  382. package/lib/components/Editor/tinymce/plugins/spellchecker/plugin.js +0 -731
  383. package/lib/components/Editor/tinymce/plugins/spellchecker/plugin.min.js +0 -9
  384. package/lib/components/Editor/tinymce/plugins/tabfocus/plugin.js +0 -129
  385. package/lib/components/Editor/tinymce/plugins/tabfocus/plugin.min.js +0 -9
  386. package/lib/components/Editor/tinymce/plugins/textcolor/plugin.js +0 -22
  387. package/lib/components/Editor/tinymce/plugins/textcolor/plugin.min.js +0 -9
  388. package/lib/components/Editor/tinymce/plugins/textpattern/plugin.js +0 -1394
  389. package/lib/components/Editor/tinymce/plugins/textpattern/plugin.min.js +0 -9
  390. package/lib/components/Editor/tinymce/plugins/toc/plugin.js +0 -236
  391. package/lib/components/Editor/tinymce/plugins/toc/plugin.min.js +0 -9
  392. package/lib/components/Editor/tinymce/skins/ui/oxide/content.mobile.css +0 -29
  393. package/lib/components/Editor/tinymce/skins/ui/oxide/content.mobile.min.css +0 -8
  394. package/lib/components/Editor/tinymce/skins/ui/oxide/content.mobile.min.css.map +0 -1
  395. package/lib/components/Editor/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
  396. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.mobile.css +0 -673
  397. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.mobile.min.css +0 -8
  398. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.mobile.min.css.map +0 -1
  399. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.mobile.css +0 -29
  400. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.mobile.min.css +0 -8
  401. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.mobile.min.css.map +0 -1
  402. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
  403. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.mobile.css +0 -673
  404. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +0 -8
  405. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.mobile.min.css.map +0 -1
  406. package/lib/components/Editor/tinymce/themes/mobile/theme.js +0 -13587
  407. package/lib/components/Editor/tinymce/themes/mobile/theme.min.js +0 -9
@@ -1,239 +1,187 @@
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');
13
-
14
- var global$1 = tinymce.util.Tools.resolve('tinymce.util.VK');
8
+ var global$5 = tinymce.util.Tools.resolve('tinymce.PluginManager');
15
9
 
16
- var typeOf = function (x) {
17
- var t = typeof x;
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
+ }
17
+ };
18
+ const typeOf = x => {
19
+ const t = typeof x;
18
20
  if (x === null) {
19
21
  return 'null';
20
- } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
22
+ } else if (t === 'object' && Array.isArray(x)) {
21
23
  return 'array';
22
- } 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))) {
23
25
  return 'string';
24
26
  } else {
25
27
  return t;
26
28
  }
27
29
  };
28
- var isType = function (type) {
29
- return function (value) {
30
- return typeOf(value) === type;
31
- };
32
- };
33
- var isSimpleType = function (type) {
34
- return function (value) {
35
- return typeof value === type;
36
- };
37
- };
38
- var eq = function (t) {
39
- return function (a) {
40
- return t === a;
41
- };
42
- };
43
- var isString = isType('string');
44
- var isArray = isType('array');
45
- var isNull = eq(null);
46
- var isBoolean = isSimpleType('boolean');
47
- var isFunction = isSimpleType('function');
48
-
49
- var assumeExternalTargets = function (editor) {
50
- var externalTargets = editor.getParam('link_assume_external_targets', false);
51
- if (isBoolean(externalTargets) && externalTargets) {
52
- return 1;
53
- } else if (isString(externalTargets) && (externalTargets === 'http' || externalTargets === 'https')) {
54
- return externalTargets;
30
+ const isType = type => value => typeOf(value) === type;
31
+ const isSimpleType = type => value => typeof value === type;
32
+ const eq = t => a => t === a;
33
+ const isString = isType('string');
34
+ const isObject = isType('object');
35
+ const isArray = isType('array');
36
+ const isNull = eq(null);
37
+ const isBoolean = isSimpleType('boolean');
38
+ const isNullable = a => a === null || a === undefined;
39
+ const isNonNullable = a => !isNullable(a);
40
+ const isFunction = isSimpleType('function');
41
+ const isArrayOf = (value, pred) => {
42
+ if (isArray(value)) {
43
+ for (let i = 0, len = value.length; i < len; ++i) {
44
+ if (!pred(value[i])) {
45
+ return false;
46
+ }
47
+ }
48
+ return true;
55
49
  }
56
- return 0;
57
- };
58
- var hasContextToolbar = function (editor) {
59
- return editor.getParam('link_context_toolbar', false, 'boolean');
60
- };
61
- var getLinkList = function (editor) {
62
- return editor.getParam('link_list');
63
- };
64
- var getDefaultLinkTarget = function (editor) {
65
- return editor.getParam('default_link_target');
66
- };
67
- var getTargetList = function (editor) {
68
- return editor.getParam('target_list', true);
69
- };
70
- var getRelList = function (editor) {
71
- return editor.getParam('rel_list', [], 'array');
72
- };
73
- var getLinkClassList = function (editor) {
74
- return editor.getParam('link_class_list', [], 'array');
75
- };
76
- var shouldShowLinkTitle = function (editor) {
77
- return editor.getParam('link_title', true, 'boolean');
78
- };
79
- var allowUnsafeLinkTarget = function (editor) {
80
- return editor.getParam('allow_unsafe_link_target', false, 'boolean');
81
- };
82
- var useQuickLink = function (editor) {
83
- return editor.getParam('link_quicklink', false, 'boolean');
84
- };
85
- var getDefaultLinkProtocol = function (editor) {
86
- return editor.getParam('link_default_protocol', 'http', 'string');
50
+ return false;
87
51
  };
88
52
 
89
- var noop = function () {
53
+ const noop = () => {
90
54
  };
91
- var constant = function (value) {
92
- return function () {
55
+ const constant = value => {
56
+ return () => {
93
57
  return value;
94
58
  };
95
59
  };
96
- var never = constant(false);
97
- var always = constant(true);
98
-
99
- var none = function () {
100
- return NONE;
60
+ const tripleEquals = (a, b) => {
61
+ return a === b;
101
62
  };
102
- var NONE = function () {
103
- var eq = function (o) {
104
- return o.isNone();
105
- };
106
- var call = function (thunk) {
107
- return thunk();
108
- };
109
- var id = function (n) {
110
- return n;
111
- };
112
- var me = {
113
- fold: function (n, _s) {
114
- return n();
115
- },
116
- is: never,
117
- isSome: never,
118
- isNone: always,
119
- getOr: id,
120
- getOrThunk: call,
121
- getOrDie: function (msg) {
122
- throw new Error(msg || 'error: getOrDie called on none.');
123
- },
124
- getOrNull: constant(null),
125
- getOrUndefined: constant(undefined),
126
- or: id,
127
- orThunk: call,
128
- map: none,
129
- each: noop,
130
- bind: none,
131
- exists: never,
132
- forall: always,
133
- filter: none,
134
- equals: eq,
135
- equals_: eq,
136
- toArray: function () {
137
- return [];
138
- },
139
- toString: constant('none()')
140
- };
141
- return me;
142
- }();
143
- var some = function (a) {
144
- var constant_a = constant(a);
145
- var self = function () {
146
- return me;
147
- };
148
- var bind = function (f) {
149
- return f(a);
150
- };
151
- var me = {
152
- fold: function (n, s) {
153
- return s(a);
154
- },
155
- is: function (v) {
156
- return a === v;
157
- },
158
- isSome: always,
159
- isNone: never,
160
- getOr: constant_a,
161
- getOrThunk: constant_a,
162
- getOrDie: constant_a,
163
- getOrNull: constant_a,
164
- getOrUndefined: constant_a,
165
- or: self,
166
- orThunk: self,
167
- map: function (f) {
168
- return some(f(a));
169
- },
170
- each: function (f) {
171
- f(a);
172
- },
173
- bind: bind,
174
- exists: bind,
175
- forall: bind,
176
- filter: function (f) {
177
- return f(a) ? me : NONE;
178
- },
179
- toArray: function () {
180
- return [a];
181
- },
182
- toString: function () {
183
- return 'some(' + a + ')';
184
- },
185
- equals: function (o) {
186
- return o.is(a);
187
- },
188
- equals_: function (o, elementEq) {
189
- return o.fold(never, function (b) {
190
- return elementEq(a, b);
191
- });
63
+
64
+ class Optional {
65
+ constructor(tag, value) {
66
+ this.tag = tag;
67
+ this.value = value;
68
+ }
69
+ static some(value) {
70
+ return new Optional(true, value);
71
+ }
72
+ static none() {
73
+ return Optional.singletonNone;
74
+ }
75
+ fold(onNone, onSome) {
76
+ if (this.tag) {
77
+ return onSome(this.value);
78
+ } else {
79
+ return onNone();
192
80
  }
193
- };
194
- return me;
195
- };
196
- var from = function (value) {
197
- return value === null || value === undefined ? NONE : some(value);
198
- };
199
- var Optional = {
200
- some: some,
201
- none: none,
202
- from: from
203
- };
81
+ }
82
+ isSome() {
83
+ return this.tag;
84
+ }
85
+ isNone() {
86
+ return !this.tag;
87
+ }
88
+ map(mapper) {
89
+ if (this.tag) {
90
+ return Optional.some(mapper(this.value));
91
+ } else {
92
+ return Optional.none();
93
+ }
94
+ }
95
+ bind(binder) {
96
+ if (this.tag) {
97
+ return binder(this.value);
98
+ } else {
99
+ return Optional.none();
100
+ }
101
+ }
102
+ exists(predicate) {
103
+ return this.tag && predicate(this.value);
104
+ }
105
+ forall(predicate) {
106
+ return !this.tag || predicate(this.value);
107
+ }
108
+ filter(predicate) {
109
+ if (!this.tag || predicate(this.value)) {
110
+ return this;
111
+ } else {
112
+ return Optional.none();
113
+ }
114
+ }
115
+ getOr(replacement) {
116
+ return this.tag ? this.value : replacement;
117
+ }
118
+ or(replacement) {
119
+ return this.tag ? this : replacement;
120
+ }
121
+ getOrThunk(thunk) {
122
+ return this.tag ? this.value : thunk();
123
+ }
124
+ orThunk(thunk) {
125
+ return this.tag ? this : thunk();
126
+ }
127
+ getOrDie(message) {
128
+ if (!this.tag) {
129
+ throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
130
+ } else {
131
+ return this.value;
132
+ }
133
+ }
134
+ static from(value) {
135
+ return isNonNullable(value) ? Optional.some(value) : Optional.none();
136
+ }
137
+ getOrNull() {
138
+ return this.tag ? this.value : null;
139
+ }
140
+ getOrUndefined() {
141
+ return this.value;
142
+ }
143
+ each(worker) {
144
+ if (this.tag) {
145
+ worker(this.value);
146
+ }
147
+ }
148
+ toArray() {
149
+ return this.tag ? [this.value] : [];
150
+ }
151
+ toString() {
152
+ return this.tag ? `some(${ this.value })` : 'none()';
153
+ }
154
+ }
155
+ Optional.singletonNone = new Optional(false);
204
156
 
205
- var nativeIndexOf = Array.prototype.indexOf;
206
- var nativePush = Array.prototype.push;
207
- var rawIndexOf = function (ts, t) {
208
- return nativeIndexOf.call(ts, t);
209
- };
210
- var contains = function (xs, x) {
211
- return rawIndexOf(xs, x) > -1;
212
- };
213
- var map = function (xs, f) {
214
- var len = xs.length;
215
- var r = new Array(len);
216
- for (var i = 0; i < len; i++) {
217
- var x = xs[i];
157
+ const nativeIndexOf = Array.prototype.indexOf;
158
+ const nativePush = Array.prototype.push;
159
+ const rawIndexOf = (ts, t) => nativeIndexOf.call(ts, t);
160
+ const contains = (xs, x) => rawIndexOf(xs, x) > -1;
161
+ const map = (xs, f) => {
162
+ const len = xs.length;
163
+ const r = new Array(len);
164
+ for (let i = 0; i < len; i++) {
165
+ const x = xs[i];
218
166
  r[i] = f(x, i);
219
167
  }
220
168
  return r;
221
169
  };
222
- var each = function (xs, f) {
223
- for (var i = 0, len = xs.length; i < len; i++) {
224
- var x = xs[i];
170
+ const each$1 = (xs, f) => {
171
+ for (let i = 0, len = xs.length; i < len; i++) {
172
+ const x = xs[i];
225
173
  f(x, i);
226
174
  }
227
175
  };
228
- var foldl = function (xs, f, acc) {
229
- each(xs, function (x) {
230
- acc = f(acc, x);
176
+ const foldl = (xs, f, acc) => {
177
+ each$1(xs, (x, i) => {
178
+ acc = f(acc, x, i);
231
179
  });
232
180
  return acc;
233
181
  };
234
- var flatten = function (xs) {
235
- var r = [];
236
- for (var i = 0, len = xs.length; i < len; ++i) {
182
+ const flatten = xs => {
183
+ const r = [];
184
+ for (let i = 0, len = xs.length; i < len; ++i) {
237
185
  if (!isArray(xs[i])) {
238
186
  throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
239
187
  }
@@ -241,12 +189,10 @@
241
189
  }
242
190
  return r;
243
191
  };
244
- var bind = function (xs, f) {
245
- return flatten(map(xs, f));
246
- };
247
- var findMap = function (arr, f) {
248
- for (var i = 0; i < arr.length; i++) {
249
- var r = f(arr[i], i);
192
+ const bind = (xs, f) => flatten(map(xs, f));
193
+ const findMap = (arr, f) => {
194
+ for (let i = 0; i < arr.length; i++) {
195
+ const r = f(arr[i], i);
250
196
  if (r.isSome()) {
251
197
  return r;
252
198
  }
@@ -254,26 +200,102 @@
254
200
  return Optional.none();
255
201
  };
256
202
 
257
- var cat = function (arr) {
258
- var r = [];
259
- var push = function (x) {
203
+ const is = (lhs, rhs, comparator = tripleEquals) => lhs.exists(left => comparator(left, rhs));
204
+ const cat = arr => {
205
+ const r = [];
206
+ const push = x => {
260
207
  r.push(x);
261
208
  };
262
- for (var i = 0; i < arr.length; i++) {
209
+ for (let i = 0; i < arr.length; i++) {
263
210
  arr[i].each(push);
264
211
  }
265
212
  return r;
266
213
  };
267
- var someIf = function (b, a) {
268
- return b ? Optional.some(a) : Optional.none();
214
+ const someIf = (b, a) => b ? Optional.some(a) : Optional.none();
215
+
216
+ const option = name => editor => editor.options.get(name);
217
+ const register$1 = editor => {
218
+ const registerOption = editor.options.register;
219
+ registerOption('link_assume_external_targets', {
220
+ processor: value => {
221
+ const valid = isString(value) || isBoolean(value);
222
+ if (valid) {
223
+ if (value === true) {
224
+ return {
225
+ value: 1,
226
+ valid
227
+ };
228
+ } else if (value === 'http' || value === 'https') {
229
+ return {
230
+ value,
231
+ valid
232
+ };
233
+ } else {
234
+ return {
235
+ value: 0,
236
+ valid
237
+ };
238
+ }
239
+ } else {
240
+ return {
241
+ valid: false,
242
+ message: 'Must be a string or a boolean.'
243
+ };
244
+ }
245
+ },
246
+ default: false
247
+ });
248
+ registerOption('link_context_toolbar', {
249
+ processor: 'boolean',
250
+ default: false
251
+ });
252
+ registerOption('link_list', { processor: value => isString(value) || isFunction(value) || isArrayOf(value, isObject) });
253
+ registerOption('link_default_target', { processor: 'string' });
254
+ registerOption('link_default_protocol', {
255
+ processor: 'string',
256
+ default: 'https'
257
+ });
258
+ registerOption('link_target_list', {
259
+ processor: value => isBoolean(value) || isArrayOf(value, isObject),
260
+ default: true
261
+ });
262
+ registerOption('link_rel_list', {
263
+ processor: 'object[]',
264
+ default: []
265
+ });
266
+ registerOption('link_class_list', {
267
+ processor: 'object[]',
268
+ default: []
269
+ });
270
+ registerOption('link_title', {
271
+ processor: 'boolean',
272
+ default: true
273
+ });
274
+ registerOption('allow_unsafe_link_target', {
275
+ processor: 'boolean',
276
+ default: false
277
+ });
278
+ registerOption('link_quicklink', {
279
+ processor: 'boolean',
280
+ default: false
281
+ });
269
282
  };
283
+ const assumeExternalTargets = option('link_assume_external_targets');
284
+ const hasContextToolbar = option('link_context_toolbar');
285
+ const getLinkList = option('link_list');
286
+ const getDefaultLinkTarget = option('link_default_target');
287
+ const getDefaultLinkProtocol = option('link_default_protocol');
288
+ const getTargetList = option('link_target_list');
289
+ const getRelList = option('link_rel_list');
290
+ const getLinkClassList = option('link_class_list');
291
+ const shouldShowLinkTitle = option('link_title');
292
+ const allowUnsafeLinkTarget = option('allow_unsafe_link_target');
293
+ const useQuickLink = option('link_quicklink');
270
294
 
271
- var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools');
295
+ var global$4 = tinymce.util.Tools.resolve('tinymce.util.Tools');
272
296
 
273
- var getValue = function (item) {
274
- return isString(item.value) ? item.value : '';
275
- };
276
- var getText = function (item) {
297
+ const getValue = item => isString(item.value) ? item.value : '';
298
+ const getText = item => {
277
299
  if (isString(item.text)) {
278
300
  return item.text;
279
301
  } else if (isString(item.title)) {
@@ -282,119 +304,82 @@
282
304
  return '';
283
305
  }
284
306
  };
285
- var sanitizeList = function (list, extractValue) {
286
- var out = [];
287
- global$2.each(list, function (item) {
288
- var text = getText(item);
307
+ const sanitizeList = (list, extractValue) => {
308
+ const out = [];
309
+ global$4.each(list, item => {
310
+ const text = getText(item);
289
311
  if (item.menu !== undefined) {
290
- var items = sanitizeList(item.menu, extractValue);
312
+ const items = sanitizeList(item.menu, extractValue);
291
313
  out.push({
292
- text: text,
293
- items: items
314
+ text,
315
+ items
294
316
  });
295
317
  } else {
296
- var value = extractValue(item);
318
+ const value = extractValue(item);
297
319
  out.push({
298
- text: text,
299
- value: value
320
+ text,
321
+ value
300
322
  });
301
323
  }
302
324
  });
303
325
  return out;
304
326
  };
305
- var sanitizeWith = function (extracter) {
306
- if (extracter === void 0) {
307
- extracter = getValue;
308
- }
309
- return function (list) {
310
- return Optional.from(list).map(function (list) {
311
- return sanitizeList(list, extracter);
312
- });
313
- };
314
- };
315
- var sanitize = function (list) {
316
- return sanitizeWith(getValue)(list);
317
- };
318
- var createUi = function (name, label) {
319
- return function (items) {
320
- return {
321
- name: name,
322
- type: 'listbox',
323
- label: label,
324
- items: items
325
- };
326
- };
327
- };
328
- var ListOptions = {
329
- sanitize: sanitize,
330
- sanitizeWith: sanitizeWith,
331
- createUi: createUi,
332
- getValue: getValue
333
- };
334
-
335
- var __assign = function () {
336
- __assign = Object.assign || function __assign(t) {
337
- for (var s, i = 1, n = arguments.length; i < n; i++) {
338
- s = arguments[i];
339
- for (var p in s)
340
- if (Object.prototype.hasOwnProperty.call(s, p))
341
- t[p] = s[p];
342
- }
343
- return t;
344
- };
345
- return __assign.apply(this, arguments);
327
+ const sanitizeWith = (extracter = getValue) => list => Optional.from(list).map(list => sanitizeList(list, extracter));
328
+ const sanitize = list => sanitizeWith(getValue)(list);
329
+ const createUi = (name, label) => items => ({
330
+ name,
331
+ type: 'listbox',
332
+ label,
333
+ items
334
+ });
335
+ const ListOptions = {
336
+ sanitize,
337
+ sanitizeWith,
338
+ createUi,
339
+ getValue
346
340
  };
347
341
 
348
- var keys = Object.keys;
349
- var hasOwnProperty = Object.hasOwnProperty;
350
- var each$1 = function (obj, f) {
351
- var props = keys(obj);
352
- for (var k = 0, len = props.length; k < len; k++) {
353
- var i = props[k];
354
- var x = obj[i];
342
+ const keys = Object.keys;
343
+ const hasOwnProperty = Object.hasOwnProperty;
344
+ const each = (obj, f) => {
345
+ const props = keys(obj);
346
+ for (let k = 0, len = props.length; k < len; k++) {
347
+ const i = props[k];
348
+ const x = obj[i];
355
349
  f(x, i);
356
350
  }
357
351
  };
358
- var objAcc = function (r) {
359
- return function (x, i) {
360
- r[i] = x;
361
- };
352
+ const objAcc = r => (x, i) => {
353
+ r[i] = x;
362
354
  };
363
- var internalFilter = function (obj, pred, onTrue, onFalse) {
364
- var r = {};
365
- each$1(obj, function (x, i) {
355
+ const internalFilter = (obj, pred, onTrue, onFalse) => {
356
+ each(obj, (x, i) => {
366
357
  (pred(x, i) ? onTrue : onFalse)(x, i);
367
358
  });
368
- return r;
369
359
  };
370
- var filter = function (obj, pred) {
371
- var t = {};
360
+ const filter = (obj, pred) => {
361
+ const t = {};
372
362
  internalFilter(obj, pred, objAcc(t), noop);
373
363
  return t;
374
364
  };
375
- var has = function (obj, key) {
376
- return hasOwnProperty.call(obj, key);
377
- };
378
- var hasNonNullableKey = function (obj, key) {
379
- return has(obj, key) && obj[key] !== undefined && obj[key] !== null;
380
- };
365
+ const has = (obj, key) => hasOwnProperty.call(obj, key);
366
+ const hasNonNullableKey = (obj, key) => has(obj, key) && obj[key] !== undefined && obj[key] !== null;
381
367
 
382
368
  var global$3 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker');
383
369
 
384
- var isAnchor = function (elm) {
385
- return elm && elm.nodeName.toLowerCase() === 'a';
386
- };
387
- var isLink = function (elm) {
388
- return isAnchor(elm) && !!getHref(elm);
389
- };
390
- var collectNodesInRange = function (rng, predicate) {
370
+ var global$2 = tinymce.util.Tools.resolve('tinymce.util.URI');
371
+
372
+ const isAnchor = elm => isNonNullable(elm) && elm.nodeName.toLowerCase() === 'a';
373
+ const isLink = elm => isAnchor(elm) && !!getHref(elm);
374
+ const collectNodesInRange = (rng, predicate) => {
391
375
  if (rng.collapsed) {
392
376
  return [];
393
377
  } else {
394
- var contents = rng.cloneContents();
395
- var walker = new global$3(contents.firstChild, contents);
396
- var elements = [];
397
- var current = contents.firstChild;
378
+ const contents = rng.cloneContents();
379
+ const firstChild = contents.firstChild;
380
+ const walker = new global$3(firstChild, contents);
381
+ const elements = [];
382
+ let current = firstChild;
398
383
  do {
399
384
  if (predicate(current)) {
400
385
  elements.push(current);
@@ -403,86 +388,81 @@
403
388
  return elements;
404
389
  }
405
390
  };
406
- var hasProtocol = function (url) {
407
- return /^\w+:/i.test(url);
408
- };
409
- var getHref = function (elm) {
410
- var href = elm.getAttribute('data-mce-href');
411
- return href ? href : elm.getAttribute('href');
391
+ const hasProtocol = url => /^\w+:/i.test(url);
392
+ const getHref = elm => {
393
+ var _a, _b;
394
+ return (_b = (_a = elm.getAttribute('data-mce-href')) !== null && _a !== void 0 ? _a : elm.getAttribute('href')) !== null && _b !== void 0 ? _b : '';
412
395
  };
413
- var applyRelTargetRules = function (rel, isUnsafe) {
414
- var rules = ['noopener'];
415
- var rels = rel ? rel.split(/\s+/) : [];
416
- var toString = function (rels) {
417
- return global$2.trim(rels.sort().join(' '));
418
- };
419
- var addTargetRules = function (rels) {
396
+ const applyRelTargetRules = (rel, isUnsafe) => {
397
+ const rules = ['noopener'];
398
+ const rels = rel ? rel.split(/\s+/) : [];
399
+ const toString = rels => global$4.trim(rels.sort().join(' '));
400
+ const addTargetRules = rels => {
420
401
  rels = removeTargetRules(rels);
421
402
  return rels.length > 0 ? rels.concat(rules) : rules;
422
403
  };
423
- var removeTargetRules = function (rels) {
424
- return rels.filter(function (val) {
425
- return global$2.inArray(rules, val) === -1;
426
- });
427
- };
428
- var newRels = isUnsafe ? addTargetRules(rels) : removeTargetRules(rels);
404
+ const removeTargetRules = rels => rels.filter(val => global$4.inArray(rules, val) === -1);
405
+ const newRels = isUnsafe ? addTargetRules(rels) : removeTargetRules(rels);
429
406
  return newRels.length > 0 ? toString(newRels) : '';
430
407
  };
431
- var trimCaretContainers = function (text) {
432
- return text.replace(/\uFEFF/g, '');
433
- };
434
- var getAnchorElement = function (editor, selectedElm) {
435
- selectedElm = selectedElm || editor.selection.getNode();
408
+ const trimCaretContainers = text => text.replace(/\uFEFF/g, '');
409
+ const getAnchorElement = (editor, selectedElm) => {
410
+ selectedElm = selectedElm || getLinksInSelection(editor.selection.getRng())[0] || editor.selection.getNode();
436
411
  if (isImageFigure(selectedElm)) {
437
- return editor.dom.select('a[href]', selectedElm)[0];
412
+ return Optional.from(editor.dom.select('a[href]', selectedElm)[0]);
438
413
  } else {
439
- return editor.dom.getParent(selectedElm, 'a[href]');
414
+ return Optional.from(editor.dom.getParent(selectedElm, 'a[href]'));
440
415
  }
441
416
  };
442
- var getAnchorText = function (selection, anchorElm) {
443
- var text = anchorElm ? anchorElm.innerText || anchorElm.textContent : selection.getContent({ format: 'text' });
417
+ const isInAnchor = (editor, selectedElm) => getAnchorElement(editor, selectedElm).isSome();
418
+ const getAnchorText = (selection, anchorElm) => {
419
+ const text = anchorElm.fold(() => selection.getContent({ format: 'text' }), anchorElm => anchorElm.innerText || anchorElm.textContent || '');
444
420
  return trimCaretContainers(text);
445
421
  };
446
- var hasLinks = function (elements) {
447
- return global$2.grep(elements, isLink).length > 0;
448
- };
449
- var hasLinksInSelection = function (rng) {
450
- return collectNodesInRange(rng, isLink).length > 0;
451
- };
452
- var isOnlyTextSelected = function (editor) {
453
- var inlineTextElements = editor.schema.getTextInlineElements();
454
- var isElement = function (elm) {
455
- return elm.nodeType === 1 && !isAnchor(elm) && !has(inlineTextElements, elm.nodeName.toLowerCase());
456
- };
457
- var elements = collectNodesInRange(editor.selection.getRng(), isElement);
458
- return elements.length === 0;
459
- };
460
- var isImageFigure = function (elm) {
461
- return elm && elm.nodeName === 'FIGURE' && /\bimage\b/i.test(elm.className);
422
+ const getLinksInSelection = rng => collectNodesInRange(rng, isLink);
423
+ const getLinks$1 = elements => global$4.grep(elements, isLink);
424
+ const hasLinks = elements => getLinks$1(elements).length > 0;
425
+ const hasLinksInSelection = rng => getLinksInSelection(rng).length > 0;
426
+ const isOnlyTextSelected = editor => {
427
+ const inlineTextElements = editor.schema.getTextInlineElements();
428
+ const isElement = elm => elm.nodeType === 1 && !isAnchor(elm) && !has(inlineTextElements, elm.nodeName.toLowerCase());
429
+ const isInBlockAnchor = getAnchorElement(editor).exists(anchor => anchor.hasAttribute('data-mce-block'));
430
+ if (isInBlockAnchor) {
431
+ return false;
432
+ }
433
+ const rng = editor.selection.getRng();
434
+ if (!rng.collapsed) {
435
+ const elements = collectNodesInRange(rng, isElement);
436
+ return elements.length === 0;
437
+ } else {
438
+ return true;
439
+ }
462
440
  };
463
- var getLinkAttrs = function (data) {
464
- return foldl([
441
+ const isImageFigure = elm => isNonNullable(elm) && elm.nodeName === 'FIGURE' && /\bimage\b/i.test(elm.className);
442
+ const getLinkAttrs = data => {
443
+ const attrs = [
465
444
  'title',
466
445
  'rel',
467
446
  'class',
468
447
  'target'
469
- ], function (acc, key) {
470
- data[key].each(function (value) {
448
+ ];
449
+ return foldl(attrs, (acc, key) => {
450
+ data[key].each(value => {
471
451
  acc[key] = value.length > 0 ? value : null;
472
452
  });
473
453
  return acc;
474
454
  }, { href: data.href });
475
455
  };
476
- var handleExternalTargets = function (href, assumeExternalTargets) {
456
+ const handleExternalTargets = (href, assumeExternalTargets) => {
477
457
  if ((assumeExternalTargets === 'http' || assumeExternalTargets === 'https') && !hasProtocol(href)) {
478
458
  return assumeExternalTargets + '://' + href;
479
459
  }
480
460
  return href;
481
461
  };
482
- var applyLinkOverrides = function (editor, linkAttrs) {
483
- var newLinkAttrs = __assign({}, linkAttrs);
484
- if (!(getRelList(editor).length > 0) && allowUnsafeLinkTarget(editor) === false) {
485
- var newRel = applyRelTargetRules(newLinkAttrs.rel, newLinkAttrs.target === '_blank');
462
+ const applyLinkOverrides = (editor, linkAttrs) => {
463
+ const newLinkAttrs = { ...linkAttrs };
464
+ if (getRelList(editor).length === 0 && !allowUnsafeLinkTarget(editor)) {
465
+ const newRel = applyRelTargetRules(newLinkAttrs.rel, newLinkAttrs.target === '_blank');
486
466
  newLinkAttrs.rel = newRel ? newRel : null;
487
467
  }
488
468
  if (Optional.from(newLinkAttrs.target).isNone() && getTargetList(editor) === false) {
@@ -491,9 +471,9 @@
491
471
  newLinkAttrs.href = handleExternalTargets(newLinkAttrs.href, assumeExternalTargets(editor));
492
472
  return newLinkAttrs;
493
473
  };
494
- var updateLink = function (editor, anchorElm, text, linkAttrs) {
495
- text.each(function (text) {
496
- if (anchorElm.hasOwnProperty('innerText')) {
474
+ const updateLink = (editor, anchorElm, text, linkAttrs) => {
475
+ text.each(text => {
476
+ if (has(anchorElm, 'innerText')) {
497
477
  anchorElm.innerText = text;
498
478
  } else {
499
479
  anchorElm.textContent = text;
@@ -502,39 +482,40 @@
502
482
  editor.dom.setAttribs(anchorElm, linkAttrs);
503
483
  editor.selection.select(anchorElm);
504
484
  };
505
- var createLink = function (editor, selectedElm, text, linkAttrs) {
485
+ const createLink = (editor, selectedElm, text, linkAttrs) => {
486
+ const dom = editor.dom;
506
487
  if (isImageFigure(selectedElm)) {
507
- linkImageFigure(editor, selectedElm, linkAttrs);
488
+ linkImageFigure(dom, selectedElm, linkAttrs);
508
489
  } else {
509
- text.fold(function () {
490
+ text.fold(() => {
510
491
  editor.execCommand('mceInsertLink', false, linkAttrs);
511
- }, function (text) {
512
- editor.insertContent(editor.dom.createHTML('a', linkAttrs, editor.dom.encode(text)));
492
+ }, text => {
493
+ editor.insertContent(dom.createHTML('a', linkAttrs, dom.encode(text)));
513
494
  });
514
495
  }
515
496
  };
516
- var linkDomMutation = function (editor, attachState, data) {
517
- var selectedElm = editor.selection.getNode();
518
- var anchorElm = getAnchorElement(editor, selectedElm);
519
- var linkAttrs = applyLinkOverrides(editor, getLinkAttrs(data));
520
- editor.undoManager.transact(function () {
497
+ const linkDomMutation = (editor, attachState, data) => {
498
+ const selectedElm = editor.selection.getNode();
499
+ const anchorElm = getAnchorElement(editor, selectedElm);
500
+ const linkAttrs = applyLinkOverrides(editor, getLinkAttrs(data));
501
+ editor.undoManager.transact(() => {
521
502
  if (data.href === attachState.href) {
522
503
  attachState.attach();
523
504
  }
524
- if (anchorElm) {
525
- editor.focus();
526
- updateLink(editor, anchorElm, data.text, linkAttrs);
527
- } else {
505
+ anchorElm.fold(() => {
528
506
  createLink(editor, selectedElm, data.text, linkAttrs);
529
- }
507
+ }, elm => {
508
+ editor.focus();
509
+ updateLink(editor, elm, data.text, linkAttrs);
510
+ });
530
511
  });
531
512
  };
532
- var unlinkSelection = function (editor) {
533
- var dom = editor.dom, selection = editor.selection;
534
- var bookmark = selection.getBookmark();
535
- var rng = selection.getRng().cloneRange();
536
- var startAnchorElm = dom.getParent(rng.startContainer, 'a[href]', editor.getBody());
537
- var endAnchorElm = dom.getParent(rng.endContainer, 'a[href]', editor.getBody());
513
+ const unlinkSelection = editor => {
514
+ const dom = editor.dom, selection = editor.selection;
515
+ const bookmark = selection.getBookmark();
516
+ const rng = selection.getRng().cloneRange();
517
+ const startAnchorElm = dom.getParent(rng.startContainer, 'a[href]', editor.getBody());
518
+ const endAnchorElm = dom.getParent(rng.endContainer, 'a[href]', editor.getBody());
538
519
  if (startAnchorElm) {
539
520
  rng.setStartBefore(startAnchorElm);
540
521
  }
@@ -545,9 +526,9 @@
545
526
  editor.execCommand('unlink');
546
527
  selection.moveToBookmark(bookmark);
547
528
  };
548
- var unlinkDomMutation = function (editor) {
549
- editor.undoManager.transact(function () {
550
- var node = editor.selection.getNode();
529
+ const unlinkDomMutation = editor => {
530
+ editor.undoManager.transact(() => {
531
+ const node = editor.selection.getNode();
551
532
  if (isImageFigure(node)) {
552
533
  unlinkImageFigure(editor, node);
553
534
  } else {
@@ -556,73 +537,88 @@
556
537
  editor.focus();
557
538
  });
558
539
  };
559
- var unwrapOptions = function (data) {
560
- var cls = data.class, href = data.href, rel = data.rel, target = data.target, text = data.text, title = data.title;
540
+ const unwrapOptions = data => {
541
+ const {
542
+ class: cls,
543
+ href,
544
+ rel,
545
+ target,
546
+ text,
547
+ title
548
+ } = data;
561
549
  return filter({
562
550
  class: cls.getOrNull(),
563
- href: href,
551
+ href,
564
552
  rel: rel.getOrNull(),
565
553
  target: target.getOrNull(),
566
554
  text: text.getOrNull(),
567
555
  title: title.getOrNull()
568
- }, function (v, _k) {
569
- return isNull(v) === false;
570
- });
556
+ }, (v, _k) => isNull(v) === false);
557
+ };
558
+ const sanitizeData = (editor, data) => {
559
+ const getOption = editor.options.get;
560
+ const uriOptions = {
561
+ allow_html_data_urls: getOption('allow_html_data_urls'),
562
+ allow_script_urls: getOption('allow_script_urls'),
563
+ allow_svg_data_urls: getOption('allow_svg_data_urls')
564
+ };
565
+ const href = data.href;
566
+ return {
567
+ ...data,
568
+ href: global$2.isDomSafe(href, 'a', uriOptions) ? href : ''
569
+ };
571
570
  };
572
- var link = function (editor, attachState, data) {
573
- editor.hasPlugin('rtc', true) ? editor.execCommand('createlink', false, unwrapOptions(data)) : linkDomMutation(editor, attachState, data);
571
+ const link = (editor, attachState, data) => {
572
+ const sanitizedData = sanitizeData(editor, data);
573
+ editor.hasPlugin('rtc', true) ? editor.execCommand('createlink', false, unwrapOptions(sanitizedData)) : linkDomMutation(editor, attachState, sanitizedData);
574
574
  };
575
- var unlink = function (editor) {
575
+ const unlink = editor => {
576
576
  editor.hasPlugin('rtc', true) ? editor.execCommand('unlink') : unlinkDomMutation(editor);
577
577
  };
578
- var unlinkImageFigure = function (editor, fig) {
579
- var img = editor.dom.select('img', fig)[0];
578
+ const unlinkImageFigure = (editor, fig) => {
579
+ var _a;
580
+ const img = editor.dom.select('img', fig)[0];
580
581
  if (img) {
581
- var a = editor.dom.getParents(img, 'a[href]', fig)[0];
582
+ const a = editor.dom.getParents(img, 'a[href]', fig)[0];
582
583
  if (a) {
583
- a.parentNode.insertBefore(img, a);
584
+ (_a = a.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(img, a);
584
585
  editor.dom.remove(a);
585
586
  }
586
587
  }
587
588
  };
588
- var linkImageFigure = function (editor, fig, attrs) {
589
- var img = editor.dom.select('img', fig)[0];
589
+ const linkImageFigure = (dom, fig, attrs) => {
590
+ var _a;
591
+ const img = dom.select('img', fig)[0];
590
592
  if (img) {
591
- var a = editor.dom.create('a', attrs);
592
- img.parentNode.insertBefore(a, img);
593
+ const a = dom.create('a', attrs);
594
+ (_a = img.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(a, img);
593
595
  a.appendChild(img);
594
596
  }
595
597
  };
596
598
 
597
- var isListGroup = function (item) {
598
- return hasNonNullableKey(item, 'items');
599
- };
600
- var findTextByValue = function (value, catalog) {
601
- return findMap(catalog, function (item) {
602
- if (isListGroup(item)) {
603
- return findTextByValue(value, item.items);
604
- } else {
605
- return someIf(item.value === value, item);
606
- }
607
- });
608
- };
609
- var getDelta = function (persistentText, fieldName, catalog, data) {
610
- var value = data[fieldName];
611
- var hasPersistentText = persistentText.length > 0;
612
- return value !== undefined ? findTextByValue(value, catalog).map(function (i) {
613
- return {
614
- url: {
615
- value: i.value,
616
- meta: {
617
- text: hasPersistentText ? persistentText : i.text,
618
- attach: noop
619
- }
620
- },
621
- text: hasPersistentText ? persistentText : i.text
622
- };
623
- }) : Optional.none();
599
+ const isListGroup = item => hasNonNullableKey(item, 'items');
600
+ const findTextByValue = (value, catalog) => findMap(catalog, item => {
601
+ if (isListGroup(item)) {
602
+ return findTextByValue(value, item.items);
603
+ } else {
604
+ return someIf(item.value === value, item);
605
+ }
606
+ });
607
+ const getDelta = (persistentText, fieldName, catalog, data) => {
608
+ const value = data[fieldName];
609
+ const hasPersistentText = persistentText.length > 0;
610
+ return value !== undefined ? findTextByValue(value, catalog).map(i => ({
611
+ url: {
612
+ value: i.value,
613
+ meta: {
614
+ text: hasPersistentText ? persistentText : i.text,
615
+ attach: noop
616
+ }
617
+ },
618
+ text: hasPersistentText ? persistentText : i.text
619
+ })) : Optional.none();
624
620
  };
625
- var findCatalog = function (catalogs, fieldName) {
621
+ const findCatalog = (catalogs, fieldName) => {
626
622
  if (fieldName === 'link') {
627
623
  return catalogs.link;
628
624
  } else if (fieldName === 'anchor') {
@@ -631,43 +627,44 @@
631
627
  return Optional.none();
632
628
  }
633
629
  };
634
- var init = function (initialData, linkCatalog) {
635
- var persistentData = {
630
+ const init = (initialData, linkCatalog) => {
631
+ const persistentData = {
636
632
  text: initialData.text,
637
633
  title: initialData.title
638
634
  };
639
- var getTitleFromUrlChange = function (url) {
640
- return someIf(persistentData.title.length <= 0, Optional.from(url.meta.title).getOr(''));
635
+ const getTitleFromUrlChange = url => {
636
+ var _a;
637
+ return someIf(persistentData.title.length <= 0, Optional.from((_a = url.meta) === null || _a === void 0 ? void 0 : _a.title).getOr(''));
641
638
  };
642
- var getTextFromUrlChange = function (url) {
643
- return someIf(persistentData.text.length <= 0, Optional.from(url.meta.text).getOr(url.value));
639
+ const getTextFromUrlChange = url => {
640
+ var _a;
641
+ return someIf(persistentData.text.length <= 0, Optional.from((_a = url.meta) === null || _a === void 0 ? void 0 : _a.text).getOr(url.value));
644
642
  };
645
- var onUrlChange = function (data) {
646
- var text = getTextFromUrlChange(data.url);
647
- var title = getTitleFromUrlChange(data.url);
643
+ const onUrlChange = data => {
644
+ const text = getTextFromUrlChange(data.url);
645
+ const title = getTitleFromUrlChange(data.url);
648
646
  if (text.isSome() || title.isSome()) {
649
- return Optional.some(__assign(__assign({}, text.map(function (text) {
650
- return { text: text };
651
- }).getOr({})), title.map(function (title) {
652
- return { title: title };
653
- }).getOr({})));
647
+ return Optional.some({
648
+ ...text.map(text => ({ text })).getOr({}),
649
+ ...title.map(title => ({ title })).getOr({})
650
+ });
654
651
  } else {
655
652
  return Optional.none();
656
653
  }
657
654
  };
658
- var onCatalogChange = function (data, change) {
659
- var catalog = findCatalog(linkCatalog, change.name).getOr([]);
660
- return getDelta(persistentData.text, change.name, catalog, data);
655
+ const onCatalogChange = (data, change) => {
656
+ const catalog = findCatalog(linkCatalog, change).getOr([]);
657
+ return getDelta(persistentData.text, change, catalog, data);
661
658
  };
662
- var onChange = function (getData, change) {
663
- var name = change.name;
659
+ const onChange = (getData, change) => {
660
+ const name = change.name;
664
661
  if (name === 'url') {
665
662
  return onUrlChange(getData());
666
663
  } else if (contains([
667
664
  'anchor',
668
665
  'link'
669
666
  ], name)) {
670
- return onCatalogChange(getData(), change);
667
+ return onCatalogChange(getData(), name);
671
668
  } else if (name === 'text' || name === 'title') {
672
669
  persistentData[name] = getData()[name];
673
670
  return Optional.none();
@@ -675,70 +672,60 @@
675
672
  return Optional.none();
676
673
  }
677
674
  };
678
- return { onChange: onChange };
675
+ return { onChange };
679
676
  };
680
- var DialogChanges = {
681
- init: init,
682
- getDelta: getDelta
677
+ const DialogChanges = {
678
+ init,
679
+ getDelta
683
680
  };
684
681
 
685
- var global$4 = tinymce.util.Tools.resolve('tinymce.util.Delay');
686
-
687
- var global$5 = tinymce.util.Tools.resolve('tinymce.util.Promise');
682
+ var global$1 = tinymce.util.Tools.resolve('tinymce.util.Delay');
688
683
 
689
- var delayedConfirm = function (editor, message, callback) {
690
- var rng = editor.selection.getRng();
691
- global$4.setEditorTimeout(editor, function () {
692
- editor.windowManager.confirm(message, function (state) {
684
+ const delayedConfirm = (editor, message, callback) => {
685
+ const rng = editor.selection.getRng();
686
+ global$1.setEditorTimeout(editor, () => {
687
+ editor.windowManager.confirm(message, state => {
693
688
  editor.selection.setRng(rng);
694
689
  callback(state);
695
690
  });
696
691
  });
697
692
  };
698
- var tryEmailTransform = function (data) {
699
- var url = data.href;
700
- var suggestMailTo = url.indexOf('@') > 0 && url.indexOf('/') === -1 && url.indexOf('mailto:') === -1;
693
+ const tryEmailTransform = data => {
694
+ const url = data.href;
695
+ const suggestMailTo = url.indexOf('@') > 0 && url.indexOf('/') === -1 && url.indexOf('mailto:') === -1;
701
696
  return suggestMailTo ? Optional.some({
702
697
  message: 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?',
703
- preprocess: function (oldData) {
704
- return __assign(__assign({}, oldData), { href: 'mailto:' + url });
705
- }
698
+ preprocess: oldData => ({
699
+ ...oldData,
700
+ href: 'mailto:' + url
701
+ })
706
702
  }) : Optional.none();
707
703
  };
708
- var tryProtocolTransform = function (assumeExternalTargets, defaultLinkProtocol) {
709
- return function (data) {
710
- var url = data.href;
711
- var suggestProtocol = assumeExternalTargets === 1 && !hasProtocol(url) || assumeExternalTargets === 0 && /^\s*www(\.|\d\.)/i.test(url);
712
- return suggestProtocol ? Optional.some({
713
- message: 'The URL you entered seems to be an external link. Do you want to add the required ' + defaultLinkProtocol + ':// prefix?',
714
- preprocess: function (oldData) {
715
- return __assign(__assign({}, oldData), { href: defaultLinkProtocol + '://' + url });
716
- }
717
- }) : Optional.none();
718
- };
704
+ const tryProtocolTransform = (assumeExternalTargets, defaultLinkProtocol) => data => {
705
+ const url = data.href;
706
+ const suggestProtocol = assumeExternalTargets === 1 && !hasProtocol(url) || assumeExternalTargets === 0 && /^\s*www(\.|\d\.)/i.test(url);
707
+ return suggestProtocol ? Optional.some({
708
+ message: `The URL you entered seems to be an external link. Do you want to add the required ${ defaultLinkProtocol }:// prefix?`,
709
+ preprocess: oldData => ({
710
+ ...oldData,
711
+ href: defaultLinkProtocol + '://' + url
712
+ })
713
+ }) : Optional.none();
719
714
  };
720
- var preprocess = function (editor, data) {
721
- return findMap([
722
- tryEmailTransform,
723
- tryProtocolTransform(assumeExternalTargets(editor), getDefaultLinkProtocol(editor))
724
- ], function (f) {
725
- return f(data);
726
- }).fold(function () {
727
- return global$5.resolve(data);
728
- }, function (transform) {
729
- return new global$5(function (callback) {
730
- delayedConfirm(editor, transform.message, function (state) {
731
- callback(state ? transform.preprocess(data) : data);
732
- });
733
- });
715
+ const preprocess = (editor, data) => findMap([
716
+ tryEmailTransform,
717
+ tryProtocolTransform(assumeExternalTargets(editor), getDefaultLinkProtocol(editor))
718
+ ], f => f(data)).fold(() => Promise.resolve(data), transform => new Promise(callback => {
719
+ delayedConfirm(editor, transform.message, state => {
720
+ callback(state ? transform.preprocess(data) : data);
734
721
  });
735
- };
736
- var DialogConfirms = { preprocess: preprocess };
722
+ }));
723
+ const DialogConfirms = { preprocess };
737
724
 
738
- var getAnchors = function (editor) {
739
- var anchorNodes = editor.dom.select('a:not([href])');
740
- var anchors = bind(anchorNodes, function (anchor) {
741
- var id = anchor.name || anchor.id;
725
+ const getAnchors = editor => {
726
+ const anchorNodes = editor.dom.select('a:not([href])');
727
+ const anchors = bind(anchorNodes, anchor => {
728
+ const id = anchor.name || anchor.id;
742
729
  return id ? [{
743
730
  text: id,
744
731
  value: '#' + id
@@ -749,81 +736,63 @@
749
736
  value: ''
750
737
  }].concat(anchors)) : Optional.none();
751
738
  };
752
- var AnchorListOptions = { getAnchors: getAnchors };
739
+ const AnchorListOptions = { getAnchors };
753
740
 
754
- var getClasses = function (editor) {
755
- var list = getLinkClassList(editor);
741
+ const getClasses = editor => {
742
+ const list = getLinkClassList(editor);
756
743
  if (list.length > 0) {
757
744
  return ListOptions.sanitize(list);
758
745
  }
759
746
  return Optional.none();
760
747
  };
761
- var ClassListOptions = { getClasses: getClasses };
762
-
763
- var global$6 = tinymce.util.Tools.resolve('tinymce.util.XHR');
748
+ const ClassListOptions = { getClasses };
764
749
 
765
- var parseJson = function (text) {
750
+ const parseJson = text => {
766
751
  try {
767
752
  return Optional.some(JSON.parse(text));
768
753
  } catch (err) {
769
754
  return Optional.none();
770
755
  }
771
756
  };
772
- var getLinks = function (editor) {
773
- var extractor = function (item) {
774
- return editor.convertURL(item.value || item.url, 'href');
775
- };
776
- var linkList = getLinkList(editor);
777
- return new global$5(function (callback) {
757
+ const getLinks = editor => {
758
+ const extractor = item => editor.convertURL(item.value || item.url || '', 'href');
759
+ const linkList = getLinkList(editor);
760
+ return new Promise(resolve => {
778
761
  if (isString(linkList)) {
779
- global$6.send({
780
- url: linkList,
781
- success: function (text) {
782
- return callback(parseJson(text));
783
- },
784
- error: function (_) {
785
- return callback(Optional.none());
786
- }
787
- });
762
+ fetch(linkList).then(res => res.ok ? res.text().then(parseJson) : Promise.reject()).then(resolve, () => resolve(Optional.none()));
788
763
  } else if (isFunction(linkList)) {
789
- linkList(function (output) {
790
- return callback(Optional.some(output));
791
- });
764
+ linkList(output => resolve(Optional.some(output)));
792
765
  } else {
793
- callback(Optional.from(linkList));
766
+ resolve(Optional.from(linkList));
794
767
  }
795
- }).then(function (optItems) {
796
- return optItems.bind(ListOptions.sanitizeWith(extractor)).map(function (items) {
797
- if (items.length > 0) {
798
- var noneItem = [{
799
- text: 'None',
800
- value: ''
801
- }];
802
- return noneItem.concat(items);
803
- } else {
804
- return items;
805
- }
806
- });
807
- });
768
+ }).then(optItems => optItems.bind(ListOptions.sanitizeWith(extractor)).map(items => {
769
+ if (items.length > 0) {
770
+ const noneItem = [{
771
+ text: 'None',
772
+ value: ''
773
+ }];
774
+ return noneItem.concat(items);
775
+ } else {
776
+ return items;
777
+ }
778
+ }));
808
779
  };
809
- var LinkListOptions = { getLinks: getLinks };
780
+ const LinkListOptions = { getLinks };
810
781
 
811
- var getRels = function (editor, initialTarget) {
812
- var list = getRelList(editor);
782
+ const getRels = (editor, initialTarget) => {
783
+ const list = getRelList(editor);
813
784
  if (list.length > 0) {
814
- var isTargetBlank_1 = initialTarget.is('_blank');
815
- var enforceSafe = allowUnsafeLinkTarget(editor) === false;
816
- var safeRelExtractor = function (item) {
817
- return applyRelTargetRules(ListOptions.getValue(item), isTargetBlank_1);
818
- };
819
- var sanitizer = enforceSafe ? ListOptions.sanitizeWith(safeRelExtractor) : ListOptions.sanitize;
785
+ const isTargetBlank = is(initialTarget, '_blank');
786
+ const enforceSafe = allowUnsafeLinkTarget(editor) === false;
787
+ const safeRelExtractor = item => applyRelTargetRules(ListOptions.getValue(item), isTargetBlank);
788
+ const sanitizer = enforceSafe ? ListOptions.sanitizeWith(safeRelExtractor) : ListOptions.sanitize;
820
789
  return sanitizer(list);
821
790
  }
822
791
  return Optional.none();
823
792
  };
824
- var RelOptions = { getRels: getRels };
793
+ const RelOptions = { getRels };
825
794
 
826
- var fallbacks = [
795
+ const fallbacks = [
827
796
  {
828
797
  text: 'Current window',
829
798
  value: ''
@@ -833,98 +802,88 @@
833
802
  value: '_blank'
834
803
  }
835
804
  ];
836
- var getTargets = function (editor) {
837
- var list = getTargetList(editor);
805
+ const getTargets = editor => {
806
+ const list = getTargetList(editor);
838
807
  if (isArray(list)) {
839
- return ListOptions.sanitize(list).orThunk(function () {
840
- return Optional.some(fallbacks);
841
- });
808
+ return ListOptions.sanitize(list).orThunk(() => Optional.some(fallbacks));
842
809
  } else if (list === false) {
843
810
  return Optional.none();
844
811
  }
845
812
  return Optional.some(fallbacks);
846
813
  };
847
- var TargetOptions = { getTargets: getTargets };
814
+ const TargetOptions = { getTargets };
848
815
 
849
- var nonEmptyAttr = function (dom, elem, name) {
850
- var val = dom.getAttrib(elem, name);
816
+ const nonEmptyAttr = (dom, elem, name) => {
817
+ const val = dom.getAttrib(elem, name);
851
818
  return val !== null && val.length > 0 ? Optional.some(val) : Optional.none();
852
819
  };
853
- var extractFromAnchor = function (editor, anchor) {
854
- var dom = editor.dom;
855
- var onlyText = isOnlyTextSelected(editor);
856
- var text = onlyText ? Optional.some(getAnchorText(editor.selection, anchor)) : Optional.none();
857
- var url = anchor ? Optional.some(dom.getAttrib(anchor, 'href')) : Optional.none();
858
- var target = anchor ? Optional.from(dom.getAttrib(anchor, 'target')) : Optional.none();
859
- var rel = nonEmptyAttr(dom, anchor, 'rel');
860
- var linkClass = nonEmptyAttr(dom, anchor, 'class');
861
- var title = nonEmptyAttr(dom, anchor, 'title');
820
+ const extractFromAnchor = (editor, anchor) => {
821
+ const dom = editor.dom;
822
+ const onlyText = isOnlyTextSelected(editor);
823
+ const text = onlyText ? Optional.some(getAnchorText(editor.selection, anchor)) : Optional.none();
824
+ const url = anchor.bind(anchorElm => Optional.from(dom.getAttrib(anchorElm, 'href')));
825
+ const target = anchor.bind(anchorElm => Optional.from(dom.getAttrib(anchorElm, 'target')));
826
+ const rel = anchor.bind(anchorElm => nonEmptyAttr(dom, anchorElm, 'rel'));
827
+ const linkClass = anchor.bind(anchorElm => nonEmptyAttr(dom, anchorElm, 'class'));
828
+ const title = anchor.bind(anchorElm => nonEmptyAttr(dom, anchorElm, 'title'));
862
829
  return {
863
- url: url,
864
- text: text,
865
- title: title,
866
- target: target,
867
- rel: rel,
868
- linkClass: linkClass
830
+ url,
831
+ text,
832
+ title,
833
+ target,
834
+ rel,
835
+ linkClass
869
836
  };
870
837
  };
871
- var collect = function (editor, linkNode) {
872
- return LinkListOptions.getLinks(editor).then(function (links) {
873
- var anchor = extractFromAnchor(editor, linkNode);
874
- return {
875
- anchor: anchor,
876
- catalogs: {
877
- targets: TargetOptions.getTargets(editor),
878
- rels: RelOptions.getRels(editor, anchor.target),
879
- classes: ClassListOptions.getClasses(editor),
880
- anchor: AnchorListOptions.getAnchors(editor),
881
- link: links
882
- },
883
- optNode: Optional.from(linkNode),
884
- flags: { titleEnabled: shouldShowLinkTitle(editor) }
885
- };
886
- });
887
- };
888
- var DialogInfo = { collect: collect };
838
+ const collect = (editor, linkNode) => LinkListOptions.getLinks(editor).then(links => {
839
+ const anchor = extractFromAnchor(editor, linkNode);
840
+ return {
841
+ anchor,
842
+ catalogs: {
843
+ targets: TargetOptions.getTargets(editor),
844
+ rels: RelOptions.getRels(editor, anchor.target),
845
+ classes: ClassListOptions.getClasses(editor),
846
+ anchor: AnchorListOptions.getAnchors(editor),
847
+ link: links
848
+ },
849
+ optNode: linkNode,
850
+ flags: { titleEnabled: shouldShowLinkTitle(editor) }
851
+ };
852
+ });
853
+ const DialogInfo = { collect };
889
854
 
890
- var handleSubmit = function (editor, info) {
891
- return function (api) {
892
- var data = api.getData();
893
- if (!data.url.value) {
894
- unlink(editor);
895
- api.close();
896
- return;
897
- }
898
- var getChangedValue = function (key) {
899
- return Optional.from(data[key]).filter(function (value) {
900
- return !info.anchor[key].is(value);
901
- });
902
- };
903
- var changedData = {
904
- href: data.url.value,
905
- text: getChangedValue('text'),
906
- target: getChangedValue('target'),
907
- rel: getChangedValue('rel'),
908
- class: getChangedValue('linkClass'),
909
- title: getChangedValue('title')
910
- };
911
- var attachState = {
912
- href: data.url.value,
913
- attach: data.url.meta !== undefined && data.url.meta.attach ? data.url.meta.attach : noop
914
- };
915
- DialogConfirms.preprocess(editor, changedData).then(function (pData) {
916
- link(editor, attachState, pData);
917
- });
855
+ const handleSubmit = (editor, info) => api => {
856
+ const data = api.getData();
857
+ if (!data.url.value) {
858
+ unlink(editor);
918
859
  api.close();
860
+ return;
861
+ }
862
+ const getChangedValue = key => Optional.from(data[key]).filter(value => !is(info.anchor[key], value));
863
+ const changedData = {
864
+ href: data.url.value,
865
+ text: getChangedValue('text'),
866
+ target: getChangedValue('target'),
867
+ rel: getChangedValue('rel'),
868
+ class: getChangedValue('linkClass'),
869
+ title: getChangedValue('title')
870
+ };
871
+ const attachState = {
872
+ href: data.url.value,
873
+ attach: data.url.meta !== undefined && data.url.meta.attach ? data.url.meta.attach : noop
919
874
  };
875
+ DialogConfirms.preprocess(editor, changedData).then(pData => {
876
+ link(editor, attachState, pData);
877
+ });
878
+ api.close();
920
879
  };
921
- var collectData = function (editor) {
922
- var anchorNode = getAnchorElement(editor);
880
+ const collectData = editor => {
881
+ const anchorNode = getAnchorElement(editor);
923
882
  return DialogInfo.collect(editor, anchorNode);
924
883
  };
925
- var getInitialData = function (info, defaultTarget) {
926
- var anchor = info.anchor;
927
- var url = anchor.url.getOr('');
884
+ const getInitialData = (info, defaultTarget) => {
885
+ const anchor = info.anchor;
886
+ const url = anchor.url.getOr('');
928
887
  return {
929
888
  url: {
930
889
  value: url,
@@ -939,30 +898,29 @@
939
898
  linkClass: anchor.linkClass.getOr('')
940
899
  };
941
900
  };
942
- var makeDialog = function (settings, onSubmit, editor) {
943
- var urlInput = [{
901
+ const makeDialog = (settings, onSubmit, editor) => {
902
+ const urlInput = [{
944
903
  name: 'url',
945
904
  type: 'urlinput',
946
905
  filetype: 'file',
947
- label: 'URL'
906
+ label: 'URL',
907
+ picker_text: 'Browse links'
948
908
  }];
949
- var displayText = settings.anchor.text.map(function () {
950
- return {
951
- name: 'text',
952
- type: 'input',
953
- label: 'Text to display'
954
- };
955
- }).toArray();
956
- var titleText = settings.flags.titleEnabled ? [{
909
+ const displayText = settings.anchor.text.map(() => ({
910
+ name: 'text',
911
+ type: 'input',
912
+ label: 'Text to display'
913
+ })).toArray();
914
+ const titleText = settings.flags.titleEnabled ? [{
957
915
  name: 'title',
958
916
  type: 'input',
959
917
  label: 'Title'
960
918
  }] : [];
961
- var defaultTarget = Optional.from(getDefaultLinkTarget(editor));
962
- var initialData = getInitialData(settings, defaultTarget);
963
- var catalogs = settings.catalogs;
964
- var dialogDelta = DialogChanges.init(initialData, catalogs);
965
- var body = {
919
+ const defaultTarget = Optional.from(getDefaultLinkTarget(editor));
920
+ const initialData = getInitialData(settings, defaultTarget);
921
+ const catalogs = settings.catalogs;
922
+ const dialogDelta = DialogChanges.init(initialData, catalogs);
923
+ const body = {
966
924
  type: 'panel',
967
925
  items: flatten([
968
926
  urlInput,
@@ -980,7 +938,7 @@
980
938
  return {
981
939
  title: 'Insert/Edit Link',
982
940
  size: 'normal',
983
- body: body,
941
+ body,
984
942
  buttons: [
985
943
  {
986
944
  type: 'cancel',
@@ -994,216 +952,223 @@
994
952
  primary: true
995
953
  }
996
954
  ],
997
- initialData: initialData,
998
- onChange: function (api, _a) {
999
- var name = _a.name;
1000
- dialogDelta.onChange(api.getData, { name: name }).each(function (newData) {
955
+ initialData,
956
+ onChange: (api, {name}) => {
957
+ dialogDelta.onChange(api.getData, { name }).each(newData => {
1001
958
  api.setData(newData);
1002
959
  });
1003
960
  },
1004
- onSubmit: onSubmit
961
+ onSubmit
1005
962
  };
1006
963
  };
1007
- var open = function (editor) {
1008
- var data = collectData(editor);
1009
- data.then(function (info) {
1010
- var onSubmit = handleSubmit(editor, info);
964
+ const open$1 = editor => {
965
+ const data = collectData(editor);
966
+ data.then(info => {
967
+ const onSubmit = handleSubmit(editor, info);
1011
968
  return makeDialog(info, onSubmit, editor);
1012
- }).then(function (spec) {
969
+ }).then(spec => {
1013
970
  editor.windowManager.open(spec);
1014
971
  });
1015
972
  };
1016
973
 
1017
- var appendClickRemove = function (link, evt) {
974
+ const register = editor => {
975
+ editor.addCommand('mceLink', (_ui, value) => {
976
+ if ((value === null || value === void 0 ? void 0 : value.dialog) === true || !useQuickLink(editor)) {
977
+ open$1(editor);
978
+ } else {
979
+ editor.dispatch('contexttoolbar-show', { toolbarKey: 'quicklink' });
980
+ }
981
+ });
982
+ };
983
+
984
+ var global = tinymce.util.Tools.resolve('tinymce.util.VK');
985
+
986
+ const appendClickRemove = (link, evt) => {
1018
987
  document.body.appendChild(link);
1019
988
  link.dispatchEvent(evt);
1020
989
  document.body.removeChild(link);
1021
990
  };
1022
- var open$1 = function (url) {
1023
- var link = document.createElement('a');
991
+ const open = url => {
992
+ const link = document.createElement('a');
1024
993
  link.target = '_blank';
1025
994
  link.href = url;
1026
995
  link.rel = 'noreferrer noopener';
1027
- var evt = document.createEvent('MouseEvents');
996
+ const evt = document.createEvent('MouseEvents');
1028
997
  evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
1029
998
  appendClickRemove(link, evt);
1030
999
  };
1031
1000
 
1032
- var getLink = function (editor, elm) {
1033
- return editor.dom.getParent(elm, 'a[href]');
1034
- };
1035
- var getSelectedLink = function (editor) {
1036
- return getLink(editor, editor.selection.getStart());
1037
- };
1038
- var hasOnlyAltModifier = function (e) {
1001
+ const getLink = (editor, elm) => editor.dom.getParent(elm, 'a[href]');
1002
+ const getSelectedLink = editor => getLink(editor, editor.selection.getStart());
1003
+ const hasOnlyAltModifier = e => {
1039
1004
  return e.altKey === true && e.shiftKey === false && e.ctrlKey === false && e.metaKey === false;
1040
1005
  };
1041
- var gotoLink = function (editor, a) {
1006
+ const gotoLink = (editor, a) => {
1042
1007
  if (a) {
1043
- var href = getHref(a);
1008
+ const href = getHref(a);
1044
1009
  if (/^#/.test(href)) {
1045
- var targetEl = editor.$(href);
1010
+ const targetEl = editor.dom.select(href);
1046
1011
  if (targetEl.length) {
1047
1012
  editor.selection.scrollIntoView(targetEl[0], true);
1048
1013
  }
1049
1014
  } else {
1050
- open$1(a.href);
1015
+ open(a.href);
1051
1016
  }
1052
1017
  }
1053
1018
  };
1054
- var openDialog = function (editor) {
1055
- return function () {
1056
- open(editor);
1057
- };
1019
+ const openDialog = editor => () => {
1020
+ editor.execCommand('mceLink', false, { dialog: true });
1058
1021
  };
1059
- var gotoSelectedLink = function (editor) {
1060
- return function () {
1061
- gotoLink(editor, getSelectedLink(editor));
1062
- };
1022
+ const gotoSelectedLink = editor => () => {
1023
+ gotoLink(editor, getSelectedLink(editor));
1063
1024
  };
1064
- var setupGotoLinks = function (editor) {
1065
- editor.on('click', function (e) {
1066
- var link = getLink(editor, e.target);
1067
- if (link && global$1.metaKeyPressed(e)) {
1025
+ const setupGotoLinks = editor => {
1026
+ editor.on('click', e => {
1027
+ const link = getLink(editor, e.target);
1028
+ if (link && global.metaKeyPressed(e)) {
1068
1029
  e.preventDefault();
1069
1030
  gotoLink(editor, link);
1070
1031
  }
1071
1032
  });
1072
- editor.on('keydown', function (e) {
1073
- var link = getSelectedLink(editor);
1074
- if (link && e.keyCode === 13 && hasOnlyAltModifier(e)) {
1075
- e.preventDefault();
1076
- gotoLink(editor, link);
1033
+ editor.on('keydown', e => {
1034
+ if (!e.isDefaultPrevented() && e.keyCode === 13 && hasOnlyAltModifier(e)) {
1035
+ const link = getSelectedLink(editor);
1036
+ if (link) {
1037
+ e.preventDefault();
1038
+ gotoLink(editor, link);
1039
+ }
1077
1040
  }
1078
1041
  });
1079
1042
  };
1080
- var toggleState = function (editor, toggler) {
1043
+ const toggleState = (editor, toggler) => {
1081
1044
  editor.on('NodeChange', toggler);
1082
- return function () {
1083
- return editor.off('NodeChange', toggler);
1084
- };
1045
+ return () => editor.off('NodeChange', toggler);
1085
1046
  };
1086
- var toggleActiveState = function (editor) {
1087
- return function (api) {
1088
- return toggleState(editor, function () {
1089
- api.setActive(!editor.mode.isReadOnly() && getAnchorElement(editor, editor.selection.getNode()) !== null);
1090
- });
1047
+ const toggleLinkState = editor => api => {
1048
+ const updateState = () => {
1049
+ api.setActive(!editor.mode.isReadOnly() && isInAnchor(editor, editor.selection.getNode()));
1050
+ api.setEnabled(editor.selection.isEditable());
1091
1051
  };
1052
+ updateState();
1053
+ return toggleState(editor, updateState);
1092
1054
  };
1093
- var toggleEnabledState = function (editor) {
1094
- return function (api) {
1095
- var updateState = function () {
1096
- return api.setDisabled(getAnchorElement(editor, editor.selection.getNode()) === null);
1097
- };
1098
- updateState();
1099
- return toggleState(editor, updateState);
1055
+ const toggleLinkMenuState = editor => api => {
1056
+ const updateState = () => {
1057
+ api.setEnabled(editor.selection.isEditable());
1100
1058
  };
1101
- };
1102
- var toggleUnlinkState = function (editor) {
1103
- return function (api) {
1104
- var hasLinks$1 = function (parents) {
1105
- return hasLinks(parents) || hasLinksInSelection(editor.selection.getRng());
1106
- };
1107
- var parents = editor.dom.getParents(editor.selection.getStart());
1108
- api.setDisabled(!hasLinks$1(parents));
1109
- return toggleState(editor, function (e) {
1110
- return api.setDisabled(!hasLinks$1(e.parents));
1111
- });
1059
+ updateState();
1060
+ return toggleState(editor, updateState);
1061
+ };
1062
+ const hasExactlyOneLinkInSelection = editor => {
1063
+ const links = editor.selection.isCollapsed() ? getLinks$1(editor.dom.getParents(editor.selection.getStart())) : getLinksInSelection(editor.selection.getRng());
1064
+ return links.length === 1;
1065
+ };
1066
+ const toggleGotoLinkState = editor => api => {
1067
+ const updateState = () => api.setEnabled(hasExactlyOneLinkInSelection(editor));
1068
+ updateState();
1069
+ return toggleState(editor, updateState);
1070
+ };
1071
+ const toggleUnlinkState = editor => api => {
1072
+ const hasLinks$1 = parents => hasLinks(parents) || hasLinksInSelection(editor.selection.getRng());
1073
+ const parents = editor.dom.getParents(editor.selection.getStart());
1074
+ const updateEnabled = parents => {
1075
+ api.setEnabled(hasLinks$1(parents) && editor.selection.isEditable());
1112
1076
  };
1077
+ updateEnabled(parents);
1078
+ return toggleState(editor, e => updateEnabled(e.parents));
1113
1079
  };
1114
1080
 
1115
- var register = function (editor) {
1116
- editor.addCommand('mceLink', function () {
1117
- if (useQuickLink(editor)) {
1118
- editor.fire('contexttoolbar-show', { toolbarKey: 'quicklink' });
1119
- } else {
1120
- openDialog(editor)();
1121
- }
1122
- });
1123
- };
1124
-
1125
- var setup = function (editor) {
1126
- editor.addShortcut('Meta+K', '', function () {
1081
+ const setup = editor => {
1082
+ editor.addShortcut('Meta+K', '', () => {
1127
1083
  editor.execCommand('mceLink');
1128
1084
  });
1129
1085
  };
1130
1086
 
1131
- var setupButtons = function (editor) {
1087
+ const setupButtons = editor => {
1132
1088
  editor.ui.registry.addToggleButton('link', {
1133
1089
  icon: 'link',
1134
1090
  tooltip: 'Insert/edit link',
1135
1091
  onAction: openDialog(editor),
1136
- onSetup: toggleActiveState(editor)
1092
+ onSetup: toggleLinkState(editor)
1137
1093
  });
1138
1094
  editor.ui.registry.addButton('openlink', {
1139
1095
  icon: 'new-tab',
1140
1096
  tooltip: 'Open link',
1141
1097
  onAction: gotoSelectedLink(editor),
1142
- onSetup: toggleEnabledState(editor)
1098
+ onSetup: toggleGotoLinkState(editor)
1143
1099
  });
1144
1100
  editor.ui.registry.addButton('unlink', {
1145
1101
  icon: 'unlink',
1146
1102
  tooltip: 'Remove link',
1147
- onAction: function () {
1148
- return unlink(editor);
1149
- },
1103
+ onAction: () => unlink(editor),
1150
1104
  onSetup: toggleUnlinkState(editor)
1151
1105
  });
1152
1106
  };
1153
- var setupMenuItems = function (editor) {
1107
+ const setupMenuItems = editor => {
1154
1108
  editor.ui.registry.addMenuItem('openlink', {
1155
1109
  text: 'Open link',
1156
1110
  icon: 'new-tab',
1157
1111
  onAction: gotoSelectedLink(editor),
1158
- onSetup: toggleEnabledState(editor)
1112
+ onSetup: toggleGotoLinkState(editor)
1159
1113
  });
1160
1114
  editor.ui.registry.addMenuItem('link', {
1161
1115
  icon: 'link',
1162
1116
  text: 'Link...',
1163
1117
  shortcut: 'Meta+K',
1118
+ onSetup: toggleLinkMenuState(editor),
1164
1119
  onAction: openDialog(editor)
1165
1120
  });
1166
1121
  editor.ui.registry.addMenuItem('unlink', {
1167
1122
  icon: 'unlink',
1168
1123
  text: 'Remove link',
1169
- onAction: function () {
1170
- return unlink(editor);
1171
- },
1124
+ onAction: () => unlink(editor),
1172
1125
  onSetup: toggleUnlinkState(editor)
1173
1126
  });
1174
1127
  };
1175
- var setupContextMenu = function (editor) {
1176
- var inLink = 'link unlink openlink';
1177
- var noLink = 'link';
1128
+ const setupContextMenu = editor => {
1129
+ const inLink = 'link unlink openlink';
1130
+ const noLink = 'link';
1178
1131
  editor.ui.registry.addContextMenu('link', {
1179
- update: function (element) {
1132
+ update: element => {
1133
+ const isEditable = editor.dom.isEditable(element);
1134
+ if (!isEditable) {
1135
+ return '';
1136
+ }
1180
1137
  return hasLinks(editor.dom.getParents(element, 'a')) ? inLink : noLink;
1181
1138
  }
1182
1139
  });
1183
1140
  };
1184
- var setupContextToolbars = function (editor) {
1185
- var collapseSelectionToEnd = function (editor) {
1141
+ const setupContextToolbars = editor => {
1142
+ const collapseSelectionToEnd = editor => {
1186
1143
  editor.selection.collapse(false);
1187
1144
  };
1188
- var onSetupLink = function (buttonApi) {
1189
- var node = editor.selection.getNode();
1190
- buttonApi.setDisabled(!getAnchorElement(editor, node));
1145
+ const onSetupLink = buttonApi => {
1146
+ const node = editor.selection.getNode();
1147
+ buttonApi.setEnabled(isInAnchor(editor, node));
1191
1148
  return noop;
1192
1149
  };
1150
+ const getLinkText = value => {
1151
+ const anchor = getAnchorElement(editor);
1152
+ const onlyText = isOnlyTextSelected(editor);
1153
+ if (anchor.isNone() && onlyText) {
1154
+ const text = getAnchorText(editor.selection, anchor);
1155
+ return someIf(text.length === 0, value);
1156
+ } else {
1157
+ return Optional.none();
1158
+ }
1159
+ };
1193
1160
  editor.ui.registry.addContextForm('quicklink', {
1194
1161
  launch: {
1195
1162
  type: 'contextformtogglebutton',
1196
1163
  icon: 'link',
1197
1164
  tooltip: 'Link',
1198
- onSetup: toggleActiveState(editor)
1165
+ onSetup: toggleLinkState(editor)
1199
1166
  },
1200
1167
  label: 'Link',
1201
- predicate: function (node) {
1202
- return !!getAnchorElement(editor, node) && hasContextToolbar(editor);
1203
- },
1204
- initValue: function () {
1205
- var elm = getAnchorElement(editor);
1206
- return !!elm ? getHref(elm) : '';
1168
+ predicate: node => hasContextToolbar(editor) && isInAnchor(editor, node),
1169
+ initValue: () => {
1170
+ const elm = getAnchorElement(editor);
1171
+ return elm.fold(constant(''), getHref);
1207
1172
  },
1208
1173
  commands: [
1209
1174
  {
@@ -1211,39 +1176,28 @@
1211
1176
  icon: 'link',
1212
1177
  tooltip: 'Link',
1213
1178
  primary: true,
1214
- onSetup: function (buttonApi) {
1215
- var node = editor.selection.getNode();
1216
- buttonApi.setActive(!!getAnchorElement(editor, node));
1217
- return toggleActiveState(editor)(buttonApi);
1179
+ onSetup: buttonApi => {
1180
+ const node = editor.selection.getNode();
1181
+ buttonApi.setActive(isInAnchor(editor, node));
1182
+ return toggleLinkState(editor)(buttonApi);
1218
1183
  },
1219
- onAction: function (formApi) {
1220
- var anchor = getAnchorElement(editor);
1221
- var value = formApi.getValue();
1222
- if (!anchor) {
1223
- var attachState = {
1224
- href: value,
1225
- attach: noop
1226
- };
1227
- var onlyText = isOnlyTextSelected(editor);
1228
- var text = onlyText ? Optional.some(getAnchorText(editor.selection, anchor)).filter(function (t) {
1229
- return t.length > 0;
1230
- }).or(Optional.from(value)) : Optional.none();
1231
- link(editor, attachState, {
1232
- href: value,
1233
- text: text,
1234
- title: Optional.none(),
1235
- rel: Optional.none(),
1236
- target: Optional.none(),
1237
- class: Optional.none()
1238
- });
1239
- formApi.hide();
1240
- } else {
1241
- editor.undoManager.transact(function () {
1242
- editor.dom.setAttrib(anchor, 'href', value);
1243
- collapseSelectionToEnd(editor);
1244
- formApi.hide();
1245
- });
1246
- }
1184
+ onAction: formApi => {
1185
+ const value = formApi.getValue();
1186
+ const text = getLinkText(value);
1187
+ const attachState = {
1188
+ href: value,
1189
+ attach: noop
1190
+ };
1191
+ link(editor, attachState, {
1192
+ href: value,
1193
+ text,
1194
+ title: Optional.none(),
1195
+ rel: Optional.none(),
1196
+ target: Optional.none(),
1197
+ class: Optional.none()
1198
+ });
1199
+ collapseSelectionToEnd(editor);
1200
+ formApi.hide();
1247
1201
  }
1248
1202
  },
1249
1203
  {
@@ -1251,7 +1205,7 @@
1251
1205
  icon: 'unlink',
1252
1206
  tooltip: 'Remove link',
1253
1207
  onSetup: onSetupLink,
1254
- onAction: function (formApi) {
1208
+ onAction: formApi => {
1255
1209
  unlink(editor);
1256
1210
  formApi.hide();
1257
1211
  }
@@ -1261,7 +1215,7 @@
1261
1215
  icon: 'new-tab',
1262
1216
  tooltip: 'Open link',
1263
1217
  onSetup: onSetupLink,
1264
- onAction: function (formApi) {
1218
+ onAction: formApi => {
1265
1219
  gotoSelectedLink(editor)();
1266
1220
  formApi.hide();
1267
1221
  }
@@ -1270,8 +1224,9 @@
1270
1224
  });
1271
1225
  };
1272
1226
 
1273
- function Plugin () {
1274
- global.add('link', function (editor) {
1227
+ var Plugin = () => {
1228
+ global$5.add('link', editor => {
1229
+ register$1(editor);
1275
1230
  setupButtons(editor);
1276
1231
  setupMenuItems(editor);
1277
1232
  setupContextMenu(editor);
@@ -1280,8 +1235,8 @@
1280
1235
  register(editor);
1281
1236
  setup(editor);
1282
1237
  });
1283
- }
1238
+ };
1284
1239
 
1285
1240
  Plugin();
1286
1241
 
1287
- }());
1242
+ })();