argous 1.2.201 → 1.2.203

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (409) hide show
  1. package/dist/components/ConfirmModal/ModalProvider.d.ts +1 -1
  2. package/dist/components/DropArea/DropArea.js +2 -7
  3. package/dist/components/Editor/components/Editor.d.ts +4 -4
  4. package/dist/components/Editor/components/Editor.js +3 -3
  5. package/dist/components/Editor/skins/content/dark/content.d.ts +0 -0
  6. package/dist/components/Editor/skins/content/dark/content.js +3 -0
  7. package/dist/components/Editor/skins/content/default/content.d.ts +0 -0
  8. package/dist/components/Editor/skins/content/default/content.js +3 -0
  9. package/dist/components/Editor/skins/content/document/content.d.ts +0 -0
  10. package/dist/components/Editor/skins/content/document/content.js +3 -0
  11. package/dist/components/Editor/skins/content/tinymce-5/content.d.ts +0 -0
  12. package/dist/components/Editor/skins/content/tinymce-5/content.js +3 -0
  13. package/dist/components/Editor/skins/content/tinymce-5-dark/content.d.ts +0 -0
  14. package/dist/components/Editor/skins/content/tinymce-5-dark/content.js +3 -0
  15. package/dist/components/Editor/skins/content/writer/content.d.ts +0 -0
  16. package/dist/components/Editor/skins/content/writer/content.js +3 -0
  17. package/dist/components/Editor/skins/ui/oxide/content.d.ts +0 -0
  18. package/dist/components/Editor/skins/ui/oxide/content.inline.d.ts +0 -0
  19. package/dist/components/Editor/skins/ui/oxide/content.inline.js +3 -0
  20. package/dist/components/Editor/skins/ui/oxide/content.js +3 -0
  21. package/dist/components/Editor/skins/ui/oxide/skin.d.ts +0 -0
  22. package/dist/components/Editor/skins/ui/oxide/skin.js +3 -0
  23. package/dist/components/Editor/skins/ui/oxide/skin.shadowdom.d.ts +0 -0
  24. package/dist/components/Editor/skins/ui/oxide/skin.shadowdom.js +3 -0
  25. package/dist/components/Editor/skins/ui/oxide-dark/content.d.ts +0 -0
  26. package/dist/components/Editor/skins/ui/oxide-dark/content.inline.d.ts +0 -0
  27. package/dist/components/Editor/skins/ui/oxide-dark/content.inline.js +3 -0
  28. package/dist/components/Editor/skins/ui/oxide-dark/content.js +3 -0
  29. package/dist/components/Editor/skins/ui/oxide-dark/skin.d.ts +0 -0
  30. package/dist/components/Editor/skins/ui/oxide-dark/skin.js +3 -0
  31. package/dist/components/Editor/skins/ui/oxide-dark/skin.shadowdom.d.ts +0 -0
  32. package/dist/components/Editor/skins/ui/oxide-dark/skin.shadowdom.js +3 -0
  33. package/dist/components/Editor/skins/ui/tinymce-5/content.d.ts +0 -0
  34. package/dist/components/Editor/skins/ui/tinymce-5/content.inline.d.ts +0 -0
  35. package/dist/components/Editor/skins/ui/tinymce-5/content.inline.js +3 -0
  36. package/dist/components/Editor/skins/ui/tinymce-5/content.js +3 -0
  37. package/dist/components/Editor/skins/ui/tinymce-5/skin.d.ts +0 -0
  38. package/dist/components/Editor/skins/ui/tinymce-5/skin.js +3 -0
  39. package/dist/components/Editor/skins/ui/tinymce-5/skin.shadowdom.d.ts +0 -0
  40. package/dist/components/Editor/skins/ui/tinymce-5/skin.shadowdom.js +3 -0
  41. package/dist/components/Editor/skins/ui/tinymce-5-dark/content.d.ts +0 -0
  42. package/dist/components/Editor/skins/ui/tinymce-5-dark/content.inline.d.ts +0 -0
  43. package/dist/components/Editor/skins/ui/tinymce-5-dark/content.inline.js +3 -0
  44. package/dist/components/Editor/skins/ui/tinymce-5-dark/content.js +3 -0
  45. package/dist/components/Editor/skins/ui/tinymce-5-dark/skin.d.ts +0 -0
  46. package/dist/components/Editor/skins/ui/tinymce-5-dark/skin.js +3 -0
  47. package/dist/components/Editor/skins/ui/tinymce-5-dark/skin.shadowdom.d.ts +0 -0
  48. package/dist/components/Editor/skins/ui/tinymce-5-dark/skin.shadowdom.js +3 -0
  49. package/dist/components/Editor/tinymce/tinymce.d.ts +1722 -1447
  50. package/lib/components/DropArea/DropArea.js +9 -10
  51. package/lib/components/Editor/components/Editor.tsx +8 -8
  52. package/lib/components/Editor/skins/content/dark/content.js +2 -0
  53. package/lib/components/Editor/skins/content/dark/content.min.css +1 -8
  54. package/lib/components/Editor/skins/content/default/content.js +2 -0
  55. package/lib/components/Editor/skins/content/default/content.min.css +0 -7
  56. package/lib/components/Editor/skins/content/document/content.js +2 -0
  57. package/lib/components/Editor/skins/content/document/content.min.css +0 -7
  58. package/lib/components/Editor/skins/content/tinymce-5/content.js +2 -0
  59. package/lib/components/Editor/skins/content/tinymce-5/content.min.css +1 -0
  60. package/lib/components/Editor/skins/content/tinymce-5-dark/content.js +2 -0
  61. package/lib/components/Editor/skins/content/tinymce-5-dark/content.min.css +1 -0
  62. package/lib/components/Editor/skins/content/writer/content.js +2 -0
  63. package/lib/components/Editor/skins/content/writer/content.min.css +0 -7
  64. package/lib/components/Editor/skins/ui/oxide/content.inline.js +2 -0
  65. package/lib/components/Editor/skins/ui/oxide/content.inline.min.css +1 -0
  66. package/lib/components/Editor/skins/ui/oxide/content.js +2 -0
  67. package/lib/components/Editor/skins/ui/oxide/content.min.css +1 -0
  68. package/lib/components/Editor/skins/ui/oxide/skin.js +2 -0
  69. package/lib/components/Editor/skins/ui/oxide/skin.min.css +1 -0
  70. package/lib/components/Editor/skins/ui/oxide/skin.shadowdom.js +2 -0
  71. package/lib/components/Editor/skins/ui/oxide/skin.shadowdom.min.css +1 -0
  72. package/lib/components/Editor/skins/ui/oxide-dark/content.inline.js +2 -0
  73. package/lib/components/Editor/skins/ui/oxide-dark/content.inline.min.css +1 -0
  74. package/lib/components/Editor/skins/ui/oxide-dark/content.js +2 -0
  75. package/lib/components/Editor/skins/ui/oxide-dark/content.min.css +1 -0
  76. package/lib/components/Editor/skins/ui/oxide-dark/skin.js +2 -0
  77. package/lib/components/Editor/skins/ui/oxide-dark/skin.min.css +1 -0
  78. package/lib/components/Editor/skins/ui/oxide-dark/skin.shadowdom.js +2 -0
  79. package/lib/components/Editor/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -0
  80. package/lib/components/Editor/skins/ui/tinymce-5/content.inline.js +2 -0
  81. package/lib/components/Editor/skins/ui/tinymce-5/content.inline.min.css +1 -0
  82. package/lib/components/Editor/skins/ui/tinymce-5/content.js +2 -0
  83. package/lib/components/Editor/skins/ui/tinymce-5/content.min.css +1 -0
  84. package/lib/components/Editor/skins/ui/tinymce-5/skin.js +2 -0
  85. package/lib/components/Editor/skins/ui/tinymce-5/skin.min.css +1 -0
  86. package/lib/components/Editor/skins/ui/tinymce-5/skin.shadowdom.js +2 -0
  87. package/lib/components/Editor/skins/ui/tinymce-5/skin.shadowdom.min.css +1 -0
  88. package/lib/components/Editor/skins/ui/tinymce-5-dark/content.inline.js +2 -0
  89. package/lib/components/Editor/skins/ui/tinymce-5-dark/content.inline.min.css +1 -0
  90. package/lib/components/Editor/skins/ui/tinymce-5-dark/content.js +2 -0
  91. package/lib/components/Editor/skins/ui/tinymce-5-dark/content.min.css +1 -0
  92. package/lib/components/Editor/skins/ui/tinymce-5-dark/skin.js +2 -0
  93. package/lib/components/Editor/skins/ui/tinymce-5-dark/skin.min.css +1 -0
  94. package/lib/components/Editor/skins/ui/tinymce-5-dark/skin.shadowdom.js +2 -0
  95. package/lib/components/Editor/skins/ui/tinymce-5-dark/skin.shadowdom.min.css +1 -0
  96. package/lib/components/Editor/tinymce/README.md +24 -14
  97. package/lib/components/Editor/tinymce/icons/default/icons.js +185 -163
  98. package/lib/components/Editor/tinymce/icons/default/icons.min.js +1 -1
  99. package/lib/components/Editor/tinymce/langs/README.md +1 -1
  100. package/lib/components/Editor/tinymce/license.txt +21 -504
  101. package/lib/components/Editor/tinymce/models/dom/model.js +8040 -0
  102. package/lib/components/Editor/tinymce/models/dom/model.min.js +4 -0
  103. package/lib/components/Editor/tinymce/plugins/accordion/plugin.js +1054 -0
  104. package/lib/components/Editor/tinymce/plugins/accordion/plugin.min.js +4 -0
  105. package/lib/components/Editor/tinymce/plugins/advlist/plugin.js +187 -208
  106. package/lib/components/Editor/tinymce/plugins/advlist/plugin.min.js +2 -7
  107. package/lib/components/Editor/tinymce/plugins/anchor/plugin.js +82 -84
  108. package/lib/components/Editor/tinymce/plugins/anchor/plugin.min.js +2 -7
  109. package/lib/components/Editor/tinymce/plugins/autolink/plugin.js +210 -167
  110. package/lib/components/Editor/tinymce/plugins/autolink/plugin.min.js +2 -7
  111. package/lib/components/Editor/tinymce/plugins/autoresize/plugin.js +118 -97
  112. package/lib/components/Editor/tinymce/plugins/autoresize/plugin.min.js +2 -7
  113. package/lib/components/Editor/tinymce/plugins/autosave/plugin.js +129 -108
  114. package/lib/components/Editor/tinymce/plugins/autosave/plugin.min.js +2 -7
  115. package/lib/components/Editor/tinymce/plugins/charmap/plugin.js +285 -333
  116. package/lib/components/Editor/tinymce/plugins/charmap/plugin.min.js +2 -7
  117. package/lib/components/Editor/tinymce/plugins/code/plugin.js +19 -26
  118. package/lib/components/Editor/tinymce/plugins/code/plugin.min.js +2 -7
  119. package/lib/components/Editor/tinymce/plugins/codesample/plugin.js +2225 -2094
  120. package/lib/components/Editor/tinymce/plugins/codesample/plugin.min.js +2 -7
  121. package/lib/components/Editor/tinymce/plugins/directionality/plugin.js +318 -243
  122. package/lib/components/Editor/tinymce/plugins/directionality/plugin.min.js +2 -7
  123. package/lib/components/Editor/tinymce/plugins/emoticons/js/emojiimages.js +1 -9424
  124. package/lib/components/Editor/tinymce/plugins/emoticons/js/emojiimages.min.js +1 -1
  125. package/lib/components/Editor/tinymce/plugins/emoticons/js/emojis.js +1 -9423
  126. package/lib/components/Editor/tinymce/plugins/emoticons/js/emojis.min.js +1 -1
  127. package/lib/components/Editor/tinymce/plugins/emoticons/plugin.js +406 -416
  128. package/lib/components/Editor/tinymce/plugins/emoticons/plugin.min.js +2 -7
  129. package/lib/components/Editor/tinymce/plugins/fullscreen/plugin.js +821 -604
  130. package/lib/components/Editor/tinymce/plugins/fullscreen/plugin.min.js +2 -7
  131. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ar.js +90 -0
  132. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/bg_BG.js +90 -0
  133. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ca.js +90 -0
  134. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/cs.js +90 -0
  135. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/da.js +90 -0
  136. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/de.js +90 -0
  137. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/el.js +90 -0
  138. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/en.js +90 -0
  139. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/es.js +90 -0
  140. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/eu.js +90 -0
  141. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/fa.js +90 -0
  142. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/fi.js +90 -0
  143. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/fr_FR.js +90 -0
  144. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/he_IL.js +90 -0
  145. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/hi.js +90 -0
  146. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/hr.js +90 -0
  147. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/hu_HU.js +90 -0
  148. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/id.js +90 -0
  149. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/it.js +90 -0
  150. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ja.js +90 -0
  151. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/kk.js +90 -0
  152. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ko_KR.js +90 -0
  153. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ms.js +90 -0
  154. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/nb_NO.js +90 -0
  155. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/nl.js +90 -0
  156. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/pl.js +90 -0
  157. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/pt_BR.js +90 -0
  158. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/pt_PT.js +90 -0
  159. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ro.js +90 -0
  160. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ru.js +90 -0
  161. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/sk.js +90 -0
  162. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/sl_SI.js +90 -0
  163. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/sv_SE.js +90 -0
  164. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/th_TH.js +90 -0
  165. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/tr.js +90 -0
  166. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/uk.js +90 -0
  167. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/vi.js +90 -0
  168. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/zh_CN.js +84 -0
  169. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/zh_TW.js +90 -0
  170. package/lib/components/Editor/tinymce/plugins/help/plugin.js +428 -403
  171. package/lib/components/Editor/tinymce/plugins/help/plugin.min.js +2 -7
  172. package/lib/components/Editor/tinymce/plugins/image/plugin.js +887 -1043
  173. package/lib/components/Editor/tinymce/plugins/image/plugin.min.js +2 -7
  174. package/lib/components/Editor/tinymce/plugins/importcss/plugin.js +163 -162
  175. package/lib/components/Editor/tinymce/plugins/importcss/plugin.min.js +2 -7
  176. package/lib/components/Editor/tinymce/plugins/insertdatetime/plugin.js +101 -91
  177. package/lib/components/Editor/tinymce/plugins/insertdatetime/plugin.min.js +2 -7
  178. package/lib/components/Editor/tinymce/plugins/link/plugin.js +739 -784
  179. package/lib/components/Editor/tinymce/plugins/link/plugin.min.js +2 -7
  180. package/lib/components/Editor/tinymce/plugins/lists/plugin.js +1282 -1396
  181. package/lib/components/Editor/tinymce/plugins/lists/plugin.min.js +2 -7
  182. package/lib/components/Editor/tinymce/plugins/media/plugin.js +641 -806
  183. package/lib/components/Editor/tinymce/plugins/media/plugin.min.js +2 -7
  184. package/lib/components/Editor/tinymce/plugins/nonbreaking/plugin.js +76 -54
  185. package/lib/components/Editor/tinymce/plugins/nonbreaking/plugin.min.js +2 -7
  186. package/lib/components/Editor/tinymce/plugins/pagebreak/plugin.js +58 -46
  187. package/lib/components/Editor/tinymce/plugins/pagebreak/plugin.min.js +2 -7
  188. package/lib/components/Editor/tinymce/plugins/preview/plugin.js +39 -69
  189. package/lib/components/Editor/tinymce/plugins/preview/plugin.min.js +2 -7
  190. package/lib/components/Editor/tinymce/plugins/quickbars/plugin.js +307 -349
  191. package/lib/components/Editor/tinymce/plugins/quickbars/plugin.min.js +2 -7
  192. package/lib/components/Editor/tinymce/plugins/save/plugin.js +50 -51
  193. package/lib/components/Editor/tinymce/plugins/save/plugin.min.js +2 -7
  194. package/lib/components/Editor/tinymce/plugins/searchreplace/plugin.js +517 -587
  195. package/lib/components/Editor/tinymce/plugins/searchreplace/plugin.min.js +2 -7
  196. package/lib/components/Editor/tinymce/plugins/table/plugin.js +2666 -10142
  197. package/lib/components/Editor/tinymce/plugins/table/plugin.min.js +2 -7
  198. package/lib/components/Editor/tinymce/plugins/template/plugin.js +403 -413
  199. package/lib/components/Editor/tinymce/plugins/template/plugin.min.js +2 -7
  200. package/lib/components/Editor/tinymce/plugins/visualblocks/plugin.js +42 -48
  201. package/lib/components/Editor/tinymce/plugins/visualblocks/plugin.min.js +2 -7
  202. package/lib/components/Editor/tinymce/plugins/visualchars/plugin.js +352 -333
  203. package/lib/components/Editor/tinymce/plugins/visualchars/plugin.min.js +2 -7
  204. package/lib/components/Editor/tinymce/plugins/wordcount/plugin.js +184 -195
  205. package/lib/components/Editor/tinymce/plugins/wordcount/plugin.min.js +2 -7
  206. package/lib/components/Editor/tinymce/skins/content/dark/content.css +2 -8
  207. package/lib/components/Editor/tinymce/skins/content/dark/content.js +2 -0
  208. package/lib/components/Editor/tinymce/skins/content/dark/content.js.map +1 -0
  209. package/lib/components/Editor/tinymce/skins/content/dark/content.min.css +2 -8
  210. package/lib/components/Editor/tinymce/skins/content/dark/content.min.css.map +1 -1
  211. package/lib/components/Editor/tinymce/skins/content/default/content.css +0 -6
  212. package/lib/components/Editor/tinymce/skins/content/default/content.js +2 -0
  213. package/lib/components/Editor/tinymce/skins/content/default/content.js.map +1 -0
  214. package/lib/components/Editor/tinymce/skins/content/default/content.min.css +1 -7
  215. package/lib/components/Editor/tinymce/skins/content/default/content.min.css.map +1 -1
  216. package/lib/components/Editor/tinymce/skins/content/document/content.css +0 -6
  217. package/lib/components/Editor/tinymce/skins/content/document/content.js +2 -0
  218. package/lib/components/Editor/tinymce/skins/content/document/content.js.map +1 -0
  219. package/lib/components/Editor/tinymce/skins/content/document/content.min.css +0 -6
  220. package/lib/components/Editor/tinymce/skins/content/document/content.min.css.map +1 -1
  221. package/lib/components/Editor/{skins/content/default → tinymce/skins/content/tinymce-5}/content.css +0 -6
  222. package/lib/components/Editor/tinymce/skins/content/tinymce-5/content.js +2 -0
  223. package/lib/components/Editor/tinymce/skins/content/tinymce-5/content.js.map +1 -0
  224. package/lib/components/Editor/tinymce/skins/content/tinymce-5/content.min.css +2 -0
  225. package/lib/components/Editor/tinymce/skins/content/tinymce-5/content.min.css.map +1 -0
  226. package/lib/components/Editor/{skins/content/dark → tinymce/skins/content/tinymce-5-dark}/content.css +1 -7
  227. package/lib/components/Editor/tinymce/skins/content/tinymce-5-dark/content.js +2 -0
  228. package/lib/components/Editor/tinymce/skins/content/tinymce-5-dark/content.js.map +1 -0
  229. package/lib/components/Editor/tinymce/skins/content/tinymce-5-dark/content.min.css +2 -0
  230. package/lib/components/Editor/tinymce/skins/content/tinymce-5-dark/content.min.css.map +1 -0
  231. package/lib/components/Editor/tinymce/skins/content/writer/content.css +0 -6
  232. package/lib/components/Editor/tinymce/skins/content/writer/content.js +2 -0
  233. package/lib/components/Editor/tinymce/skins/content/writer/content.js.map +1 -0
  234. package/lib/components/Editor/tinymce/skins/content/writer/content.min.css +0 -6
  235. package/lib/components/Editor/tinymce/skins/content/writer/content.min.css.map +1 -1
  236. package/lib/components/Editor/tinymce/skins/ui/oxide/content.css +74 -21
  237. package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.css +74 -21
  238. package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.js +2 -0
  239. package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.js.map +1 -0
  240. package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.min.css +1 -7
  241. package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.min.css.map +1 -1
  242. package/lib/components/Editor/tinymce/skins/ui/oxide/content.js +2 -0
  243. package/lib/components/Editor/tinymce/skins/ui/oxide/content.js.map +1 -0
  244. package/lib/components/Editor/tinymce/skins/ui/oxide/content.min.css +1 -7
  245. package/lib/components/Editor/tinymce/skins/ui/oxide/content.min.css.map +1 -1
  246. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.css +1131 -402
  247. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.js +2 -0
  248. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.js.map +1 -0
  249. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.min.css +1 -7
  250. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.min.css.map +1 -1
  251. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.css +8 -15
  252. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.js +2 -0
  253. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.js.map +1 -0
  254. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.min.css +1 -7
  255. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.min.css.map +1 -1
  256. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.css +72 -20
  257. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.css +74 -21
  258. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.js +2 -0
  259. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.js.map +1 -0
  260. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.min.css +1 -7
  261. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.min.css.map +1 -1
  262. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.js +2 -0
  263. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.js.map +1 -0
  264. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.min.css +1 -7
  265. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.min.css.map +1 -1
  266. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.css +1155 -423
  267. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.js +2 -0
  268. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.js.map +1 -0
  269. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.min.css +1 -7
  270. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.min.css.map +1 -1
  271. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +8 -15
  272. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.js +2 -0
  273. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.js.map +1 -0
  274. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -7
  275. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css.map +1 -1
  276. package/lib/components/Editor/{skins/ui/default → tinymce/skins/ui/tinymce-5}/content.css +75 -22
  277. package/lib/components/Editor/{skins/ui/default → tinymce/skins/ui/tinymce-5}/content.inline.css +75 -22
  278. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.inline.js +2 -0
  279. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.inline.js.map +1 -0
  280. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.inline.min.css +2 -0
  281. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.inline.min.css.map +1 -0
  282. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.js +2 -0
  283. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.js.map +1 -0
  284. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.min.css +2 -0
  285. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.min.css.map +1 -0
  286. package/lib/components/Editor/{skins/ui/default → tinymce/skins/ui/tinymce-5}/skin.css +1261 -438
  287. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.js +2 -0
  288. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.js.map +1 -0
  289. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.min.css +2 -0
  290. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.min.css.map +1 -0
  291. package/lib/components/Editor/{skins/ui/default → tinymce/skins/ui/tinymce-5}/skin.shadowdom.css +8 -15
  292. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.shadowdom.js +2 -0
  293. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.shadowdom.js.map +1 -0
  294. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css +2 -0
  295. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css.map +1 -0
  296. package/lib/components/Editor/{skins/ui/dark → tinymce/skins/ui/tinymce-5-dark}/content.css +73 -21
  297. package/lib/components/Editor/{skins/ui/dark → tinymce/skins/ui/tinymce-5-dark}/content.inline.css +75 -22
  298. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.inline.js +2 -0
  299. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.inline.js.map +1 -0
  300. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +2 -0
  301. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css.map +1 -0
  302. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.js +2 -0
  303. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.js.map +1 -0
  304. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.min.css +2 -0
  305. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.min.css.map +1 -0
  306. package/lib/components/Editor/{skins/ui/dark → tinymce/skins/ui/tinymce-5-dark}/skin.css +1244 -421
  307. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.js +2 -0
  308. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.js.map +1 -0
  309. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.min.css +2 -0
  310. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.min.css.map +1 -0
  311. package/lib/components/Editor/{skins/ui/dark → tinymce/skins/ui/tinymce-5-dark}/skin.shadowdom.css +8 -15
  312. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.js +2 -0
  313. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.js.map +1 -0
  314. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css +2 -0
  315. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css.map +1 -0
  316. package/lib/components/Editor/tinymce/themes/silver/theme.js +23228 -24955
  317. package/lib/components/Editor/tinymce/themes/silver/theme.min.js +2 -7
  318. package/lib/components/Editor/tinymce/tinymce.d.ts +1722 -1447
  319. package/lib/components/Editor/tinymce/tinymce.js +23668 -22018
  320. package/lib/components/Editor/tinymce/tinymce.min.js +2 -30104
  321. package/package.json +1 -1
  322. package/lib/components/Editor/skins/content/dark/content.min.css.map +0 -1
  323. package/lib/components/Editor/skins/content/default/content.min.css.map +0 -1
  324. package/lib/components/Editor/skins/content/document/content.css +0 -72
  325. package/lib/components/Editor/skins/content/document/content.min.css.map +0 -1
  326. package/lib/components/Editor/skins/content/writer/content.css +0 -68
  327. package/lib/components/Editor/skins/content/writer/content.min.css.map +0 -1
  328. package/lib/components/Editor/skins/ui/dark/content.inline.min.css +0 -8
  329. package/lib/components/Editor/skins/ui/dark/content.inline.min.css.map +0 -1
  330. package/lib/components/Editor/skins/ui/dark/content.min.css +0 -8
  331. package/lib/components/Editor/skins/ui/dark/content.min.css.map +0 -1
  332. package/lib/components/Editor/skins/ui/dark/content.mobile.css +0 -29
  333. package/lib/components/Editor/skins/ui/dark/content.mobile.min.css +0 -8
  334. package/lib/components/Editor/skins/ui/dark/content.mobile.min.css.map +0 -1
  335. package/lib/components/Editor/skins/ui/dark/fonts/tinymce-mobile.woff +0 -0
  336. package/lib/components/Editor/skins/ui/dark/skin.min.css +0 -8
  337. package/lib/components/Editor/skins/ui/dark/skin.min.css.map +0 -1
  338. package/lib/components/Editor/skins/ui/dark/skin.mobile.css +0 -673
  339. package/lib/components/Editor/skins/ui/dark/skin.mobile.min.css +0 -8
  340. package/lib/components/Editor/skins/ui/dark/skin.mobile.min.css.map +0 -1
  341. package/lib/components/Editor/skins/ui/dark/skin.shadowdom.min.css +0 -8
  342. package/lib/components/Editor/skins/ui/dark/skin.shadowdom.min.css.map +0 -1
  343. package/lib/components/Editor/skins/ui/default/content.inline.min.css +0 -8
  344. package/lib/components/Editor/skins/ui/default/content.inline.min.css.map +0 -1
  345. package/lib/components/Editor/skins/ui/default/content.min.css +0 -8
  346. package/lib/components/Editor/skins/ui/default/content.min.css.map +0 -1
  347. package/lib/components/Editor/skins/ui/default/content.mobile.css +0 -29
  348. package/lib/components/Editor/skins/ui/default/content.mobile.min.css +0 -8
  349. package/lib/components/Editor/skins/ui/default/content.mobile.min.css.map +0 -1
  350. package/lib/components/Editor/skins/ui/default/fonts/tinymce-mobile.woff +0 -0
  351. package/lib/components/Editor/skins/ui/default/skin.min.css +0 -8
  352. package/lib/components/Editor/skins/ui/default/skin.min.css.map +0 -1
  353. package/lib/components/Editor/skins/ui/default/skin.mobile.css +0 -673
  354. package/lib/components/Editor/skins/ui/default/skin.mobile.min.css +0 -8
  355. package/lib/components/Editor/skins/ui/default/skin.mobile.min.css.map +0 -1
  356. package/lib/components/Editor/skins/ui/default/skin.shadowdom.min.css +0 -8
  357. package/lib/components/Editor/skins/ui/default/skin.shadowdom.min.css.map +0 -1
  358. package/lib/components/Editor/skins/ui/plugin-tinycomments-tinymce4/fonts/tinymce-mobile.woff +0 -0
  359. package/lib/components/Editor/skins/ui/plugin-tinycomments-tinymce4/plugin-tinycomments-tinymce4.css +0 -1641
  360. package/lib/components/Editor/skins/ui/plugin-tinycomments-tinymce4/plugin-tinycomments-tinymce4.min.css +0 -8
  361. package/lib/components/Editor/skins/ui/plugin-tinycomments-tinymce4/plugin-tinycomments-tinymce4.min.css.map +0 -1
  362. package/lib/components/Editor/tinymce/jquery.tinymce.min.js +0 -92
  363. package/lib/components/Editor/tinymce/langs/pt_BR.js +0 -419
  364. package/lib/components/Editor/tinymce/plugins/bbcode/plugin.js +0 -99
  365. package/lib/components/Editor/tinymce/plugins/bbcode/plugin.min.js +0 -9
  366. package/lib/components/Editor/tinymce/plugins/colorpicker/plugin.js +0 -22
  367. package/lib/components/Editor/tinymce/plugins/colorpicker/plugin.min.js +0 -9
  368. package/lib/components/Editor/tinymce/plugins/contextmenu/plugin.js +0 -22
  369. package/lib/components/Editor/tinymce/plugins/contextmenu/plugin.min.js +0 -9
  370. package/lib/components/Editor/tinymce/plugins/fullpage/plugin.js +0 -544
  371. package/lib/components/Editor/tinymce/plugins/fullpage/plugin.min.js +0 -9
  372. package/lib/components/Editor/tinymce/plugins/hr/plugin.js +0 -46
  373. package/lib/components/Editor/tinymce/plugins/hr/plugin.min.js +0 -9
  374. package/lib/components/Editor/tinymce/plugins/imagetools/plugin.js +0 -1354
  375. package/lib/components/Editor/tinymce/plugins/imagetools/plugin.min.js +0 -9
  376. package/lib/components/Editor/tinymce/plugins/legacyoutput/plugin.js +0 -199
  377. package/lib/components/Editor/tinymce/plugins/legacyoutput/plugin.min.js +0 -9
  378. package/lib/components/Editor/tinymce/plugins/noneditable/plugin.js +0 -117
  379. package/lib/components/Editor/tinymce/plugins/noneditable/plugin.min.js +0 -9
  380. package/lib/components/Editor/tinymce/plugins/paste/plugin.js +0 -1764
  381. package/lib/components/Editor/tinymce/plugins/paste/plugin.min.js +0 -9
  382. package/lib/components/Editor/tinymce/plugins/print/plugin.js +0 -53
  383. package/lib/components/Editor/tinymce/plugins/print/plugin.min.js +0 -9
  384. package/lib/components/Editor/tinymce/plugins/spellchecker/plugin.js +0 -731
  385. package/lib/components/Editor/tinymce/plugins/spellchecker/plugin.min.js +0 -9
  386. package/lib/components/Editor/tinymce/plugins/tabfocus/plugin.js +0 -129
  387. package/lib/components/Editor/tinymce/plugins/tabfocus/plugin.min.js +0 -9
  388. package/lib/components/Editor/tinymce/plugins/textcolor/plugin.js +0 -22
  389. package/lib/components/Editor/tinymce/plugins/textcolor/plugin.min.js +0 -9
  390. package/lib/components/Editor/tinymce/plugins/textpattern/plugin.js +0 -1394
  391. package/lib/components/Editor/tinymce/plugins/textpattern/plugin.min.js +0 -9
  392. package/lib/components/Editor/tinymce/plugins/toc/plugin.js +0 -236
  393. package/lib/components/Editor/tinymce/plugins/toc/plugin.min.js +0 -9
  394. package/lib/components/Editor/tinymce/skins/ui/oxide/content.mobile.css +0 -29
  395. package/lib/components/Editor/tinymce/skins/ui/oxide/content.mobile.min.css +0 -8
  396. package/lib/components/Editor/tinymce/skins/ui/oxide/content.mobile.min.css.map +0 -1
  397. package/lib/components/Editor/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
  398. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.mobile.css +0 -673
  399. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.mobile.min.css +0 -8
  400. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.mobile.min.css.map +0 -1
  401. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.mobile.css +0 -29
  402. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.mobile.min.css +0 -8
  403. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.mobile.min.css.map +0 -1
  404. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
  405. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.mobile.css +0 -673
  406. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +0 -8
  407. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.mobile.min.css.map +0 -1
  408. package/lib/components/Editor/tinymce/themes/mobile/theme.js +0 -13587
  409. package/lib/components/Editor/tinymce/themes/mobile/theme.min.js +0 -9
@@ -1,102 +1,125 @@
1
1
  /**
2
- * Copyright (c) Tiny Technologies, Inc. All rights reserved.
3
- * Licensed under the LGPL or a commercial license.
4
- * For LGPL see License.txt in the project root for license information.
5
- * For commercial licenses see https://www.tiny.cloud/
6
- *
7
- * Version: 5.9.0 (TBD)
2
+ * TinyMCE version 6.8.2 (2023-12-11)
8
3
  */
4
+
9
5
  (function () {
10
6
  'use strict';
11
7
 
12
- var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
8
+ var global$3 = tinymce.util.Tools.resolve('tinymce.PluginManager');
13
9
 
14
- var noop = function () {
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
+ }
15
17
  };
16
- var constant = function (value) {
17
- return function () {
18
+ const typeOf = x => {
19
+ const t = typeof x;
20
+ if (x === null) {
21
+ return 'null';
22
+ } else if (t === 'object' && Array.isArray(x)) {
23
+ return 'array';
24
+ } else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
25
+ return 'string';
26
+ } else {
27
+ return t;
28
+ }
29
+ };
30
+ const isType = type => value => typeOf(value) === type;
31
+ const isSimpleType = type => value => typeof value === type;
32
+ const isString = isType('string');
33
+ const isObject = isType('object');
34
+ const isArray = isType('array');
35
+ const isNullable = a => a === null || a === undefined;
36
+ const isNonNullable = a => !isNullable(a);
37
+ const isFunction = isSimpleType('function');
38
+ const isArrayOf = (value, pred) => {
39
+ if (isArray(value)) {
40
+ for (let i = 0, len = value.length; i < len; ++i) {
41
+ if (!pred(value[i])) {
42
+ return false;
43
+ }
44
+ }
45
+ return true;
46
+ }
47
+ return false;
48
+ };
49
+
50
+ const constant = value => {
51
+ return () => {
18
52
  return value;
19
53
  };
20
54
  };
21
- function curry(fn) {
22
- var initialArgs = [];
23
- for (var _i = 1; _i < arguments.length; _i++) {
24
- initialArgs[_i - 1] = arguments[_i];
25
- }
26
- return function () {
27
- var restArgs = [];
28
- for (var _i = 0; _i < arguments.length; _i++) {
29
- restArgs[_i] = arguments[_i];
30
- }
31
- var all = initialArgs.concat(restArgs);
55
+ function curry(fn, ...initialArgs) {
56
+ return (...restArgs) => {
57
+ const all = initialArgs.concat(restArgs);
32
58
  return fn.apply(null, all);
33
59
  };
34
60
  }
35
- var never = constant(false);
36
- var always = constant(true);
61
+ const never = constant(false);
37
62
 
38
- var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
63
+ const escape = text => text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
39
64
 
40
- var global$2 = tinymce.util.Tools.resolve('tinymce.util.XHR');
65
+ var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools');
41
66
 
42
- var getCreationDateClasses = function (editor) {
43
- return editor.getParam('template_cdate_classes', 'cdate');
44
- };
45
- var getModificationDateClasses = function (editor) {
46
- return editor.getParam('template_mdate_classes', 'mdate');
47
- };
48
- var getSelectedContentClasses = function (editor) {
49
- return editor.getParam('template_selected_content_classes', 'selcontent');
50
- };
51
- var getPreviewReplaceValues = function (editor) {
52
- return editor.getParam('template_preview_replace_values');
53
- };
54
- var getContentStyle = function (editor) {
55
- return editor.getParam('content_style', '', 'string');
56
- };
57
- var shouldUseContentCssCors = function (editor) {
58
- return editor.getParam('content_css_cors', false, 'boolean');
59
- };
60
- var getTemplateReplaceValues = function (editor) {
61
- return editor.getParam('template_replace_values');
62
- };
63
- var getTemplates = function (editor) {
64
- return editor.getParam('templates');
65
- };
66
- var getCdateFormat = function (editor) {
67
- return editor.getParam('template_cdate_format', editor.translate('%Y-%m-%d'));
68
- };
69
- var getMdateFormat = function (editor) {
70
- return editor.getParam('template_mdate_format', editor.translate('%Y-%m-%d'));
71
- };
72
- var getBodyClassFromHash = function (editor) {
73
- var bodyClass = editor.getParam('body_class', '', 'hash');
74
- return bodyClass[editor.id] || '';
75
- };
76
- var getBodyClass = function (editor) {
77
- var bodyClass = editor.getParam('body_class', '', 'string');
78
- if (bodyClass.indexOf('=') === -1) {
79
- return bodyClass;
80
- } else {
81
- return getBodyClassFromHash(editor);
82
- }
67
+ const option = name => editor => editor.options.get(name);
68
+ const register$2 = editor => {
69
+ const registerOption = editor.options.register;
70
+ registerOption('template_cdate_classes', {
71
+ processor: 'string',
72
+ default: 'cdate'
73
+ });
74
+ registerOption('template_mdate_classes', {
75
+ processor: 'string',
76
+ default: 'mdate'
77
+ });
78
+ registerOption('template_selected_content_classes', {
79
+ processor: 'string',
80
+ default: 'selcontent'
81
+ });
82
+ registerOption('template_preview_replace_values', { processor: 'object' });
83
+ registerOption('template_replace_values', { processor: 'object' });
84
+ registerOption('templates', {
85
+ processor: value => isString(value) || isArrayOf(value, isObject) || isFunction(value),
86
+ default: []
87
+ });
88
+ registerOption('template_cdate_format', {
89
+ processor: 'string',
90
+ default: editor.translate('%Y-%m-%d')
91
+ });
92
+ registerOption('template_mdate_format', {
93
+ processor: 'string',
94
+ default: editor.translate('%Y-%m-%d')
95
+ });
83
96
  };
97
+ const getCreationDateClasses = option('template_cdate_classes');
98
+ const getModificationDateClasses = option('template_mdate_classes');
99
+ const getSelectedContentClasses = option('template_selected_content_classes');
100
+ const getPreviewReplaceValues = option('template_preview_replace_values');
101
+ const getTemplateReplaceValues = option('template_replace_values');
102
+ const getTemplates = option('templates');
103
+ const getCdateFormat = option('template_cdate_format');
104
+ const getMdateFormat = option('template_mdate_format');
105
+ const getContentStyle = option('content_style');
106
+ const shouldUseContentCssCors = option('content_css_cors');
107
+ const getBodyClass = option('body_class');
84
108
 
85
- var addZeros = function (value, len) {
109
+ const addZeros = (value, len) => {
86
110
  value = '' + value;
87
111
  if (value.length < len) {
88
- for (var i = 0; i < len - value.length; i++) {
112
+ for (let i = 0; i < len - value.length; i++) {
89
113
  value = '0' + value;
90
114
  }
91
115
  }
92
116
  return value;
93
117
  };
94
- var getDateTime = function (editor, fmt, date) {
95
- var daysShort = 'Sun Mon Tue Wed Thu Fri Sat Sun'.split(' ');
96
- var daysLong = 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday'.split(' ');
97
- var monthsShort = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' ');
98
- var monthsLong = 'January February March April May June July August September October November December'.split(' ');
99
- date = date || new Date();
118
+ const getDateTime = (editor, fmt, date = new Date()) => {
119
+ const daysShort = 'Sun Mon Tue Wed Thu Fri Sat Sun'.split(' ');
120
+ const daysLong = 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday'.split(' ');
121
+ const monthsShort = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' ');
122
+ const monthsLong = 'January February March April May June July August September October November December'.split(' ');
100
123
  fmt = fmt.replace('%D', '%m/%d/%Y');
101
124
  fmt = fmt.replace('%r', '%I:%M:%S %p');
102
125
  fmt = fmt.replace('%Y', '' + date.getFullYear());
@@ -116,214 +139,120 @@
116
139
  return fmt;
117
140
  };
118
141
 
119
- var createTemplateList = function (editor, callback) {
120
- return function () {
121
- var templateList = getTemplates(editor);
122
- if (typeof templateList === 'function') {
123
- templateList(callback);
124
- return;
142
+ class Optional {
143
+ constructor(tag, value) {
144
+ this.tag = tag;
145
+ this.value = value;
146
+ }
147
+ static some(value) {
148
+ return new Optional(true, value);
149
+ }
150
+ static none() {
151
+ return Optional.singletonNone;
152
+ }
153
+ fold(onNone, onSome) {
154
+ if (this.tag) {
155
+ return onSome(this.value);
156
+ } else {
157
+ return onNone();
125
158
  }
126
- if (typeof templateList === 'string') {
127
- global$2.send({
128
- url: templateList,
129
- success: function (text) {
130
- callback(JSON.parse(text));
131
- }
132
- });
159
+ }
160
+ isSome() {
161
+ return this.tag;
162
+ }
163
+ isNone() {
164
+ return !this.tag;
165
+ }
166
+ map(mapper) {
167
+ if (this.tag) {
168
+ return Optional.some(mapper(this.value));
133
169
  } else {
134
- callback(templateList);
170
+ return Optional.none();
135
171
  }
136
- };
137
- };
138
- var replaceTemplateValues = function (html, templateValues) {
139
- global$1.each(templateValues, function (v, k) {
140
- if (typeof v === 'function') {
141
- v = v(k);
172
+ }
173
+ bind(binder) {
174
+ if (this.tag) {
175
+ return binder(this.value);
176
+ } else {
177
+ return Optional.none();
142
178
  }
143
- html = html.replace(new RegExp('\\{\\$' + k + '\\}', 'g'), v);
144
- });
145
- return html;
146
- };
147
- var replaceVals = function (editor, e) {
148
- var dom = editor.dom, vl = getTemplateReplaceValues(editor);
149
- global$1.each(dom.select('*', e), function (e) {
150
- global$1.each(vl, function (v, k) {
151
- if (dom.hasClass(e, k)) {
152
- if (typeof vl[k] === 'function') {
153
- vl[k](e);
154
- }
155
- }
156
- });
157
- });
158
- };
159
- var hasClass = function (n, c) {
160
- return new RegExp('\\b' + c + '\\b', 'g').test(n.className);
161
- };
162
- var insertTemplate = function (editor, _ui, html) {
163
- var el;
164
- var dom = editor.dom;
165
- var sel = editor.selection.getContent();
166
- html = replaceTemplateValues(html, getTemplateReplaceValues(editor));
167
- el = dom.create('div', null, html);
168
- var n = dom.select('.mceTmpl', el);
169
- if (n && n.length > 0) {
170
- el = dom.create('div', null);
171
- el.appendChild(n[0].cloneNode(true));
172
179
  }
173
- global$1.each(dom.select('*', el), function (n) {
174
- if (hasClass(n, getCreationDateClasses(editor).replace(/\s+/g, '|'))) {
175
- n.innerHTML = getDateTime(editor, getCdateFormat(editor));
180
+ exists(predicate) {
181
+ return this.tag && predicate(this.value);
182
+ }
183
+ forall(predicate) {
184
+ return !this.tag || predicate(this.value);
185
+ }
186
+ filter(predicate) {
187
+ if (!this.tag || predicate(this.value)) {
188
+ return this;
189
+ } else {
190
+ return Optional.none();
176
191
  }
177
- if (hasClass(n, getModificationDateClasses(editor).replace(/\s+/g, '|'))) {
178
- n.innerHTML = getDateTime(editor, getMdateFormat(editor));
192
+ }
193
+ getOr(replacement) {
194
+ return this.tag ? this.value : replacement;
195
+ }
196
+ or(replacement) {
197
+ return this.tag ? this : replacement;
198
+ }
199
+ getOrThunk(thunk) {
200
+ return this.tag ? this.value : thunk();
201
+ }
202
+ orThunk(thunk) {
203
+ return this.tag ? this : thunk();
204
+ }
205
+ getOrDie(message) {
206
+ if (!this.tag) {
207
+ throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
208
+ } else {
209
+ return this.value;
179
210
  }
180
- if (hasClass(n, getSelectedContentClasses(editor).replace(/\s+/g, '|'))) {
181
- n.innerHTML = sel;
211
+ }
212
+ static from(value) {
213
+ return isNonNullable(value) ? Optional.some(value) : Optional.none();
214
+ }
215
+ getOrNull() {
216
+ return this.tag ? this.value : null;
217
+ }
218
+ getOrUndefined() {
219
+ return this.value;
220
+ }
221
+ each(worker) {
222
+ if (this.tag) {
223
+ worker(this.value);
182
224
  }
183
- });
184
- replaceVals(editor, el);
185
- editor.execCommand('mceInsertContent', false, el.innerHTML);
186
- editor.addVisual();
187
- };
188
-
189
- var register = function (editor) {
190
- editor.addCommand('mceInsertTemplate', curry(insertTemplate, editor));
191
- };
192
-
193
- var setup = function (editor) {
194
- editor.on('PreProcess', function (o) {
195
- var dom = editor.dom, dateFormat = getMdateFormat(editor);
196
- global$1.each(dom.select('div', o.node), function (e) {
197
- if (dom.hasClass(e, 'mceTmpl')) {
198
- global$1.each(dom.select('*', e), function (e) {
199
- if (dom.hasClass(e, getModificationDateClasses(editor).replace(/\s+/g, '|'))) {
200
- e.innerHTML = getDateTime(editor, dateFormat);
201
- }
202
- });
203
- replaceVals(editor, e);
204
- }
205
- });
206
- });
207
- };
225
+ }
226
+ toArray() {
227
+ return this.tag ? [this.value] : [];
228
+ }
229
+ toString() {
230
+ return this.tag ? `some(${ this.value })` : 'none()';
231
+ }
232
+ }
233
+ Optional.singletonNone = new Optional(false);
208
234
 
209
- var none = function () {
210
- return NONE;
211
- };
212
- var NONE = function () {
213
- var eq = function (o) {
214
- return o.isNone();
215
- };
216
- var call = function (thunk) {
217
- return thunk();
218
- };
219
- var id = function (n) {
220
- return n;
221
- };
222
- var me = {
223
- fold: function (n, _s) {
224
- return n();
225
- },
226
- is: never,
227
- isSome: never,
228
- isNone: always,
229
- getOr: id,
230
- getOrThunk: call,
231
- getOrDie: function (msg) {
232
- throw new Error(msg || 'error: getOrDie called on none.');
233
- },
234
- getOrNull: constant(null),
235
- getOrUndefined: constant(undefined),
236
- or: id,
237
- orThunk: call,
238
- map: none,
239
- each: noop,
240
- bind: none,
241
- exists: never,
242
- forall: always,
243
- filter: none,
244
- equals: eq,
245
- equals_: eq,
246
- toArray: function () {
247
- return [];
248
- },
249
- toString: constant('none()')
250
- };
251
- return me;
252
- }();
253
- var some = function (a) {
254
- var constant_a = constant(a);
255
- var self = function () {
256
- return me;
257
- };
258
- var bind = function (f) {
259
- return f(a);
260
- };
261
- var me = {
262
- fold: function (n, s) {
263
- return s(a);
264
- },
265
- is: function (v) {
266
- return a === v;
267
- },
268
- isSome: always,
269
- isNone: never,
270
- getOr: constant_a,
271
- getOrThunk: constant_a,
272
- getOrDie: constant_a,
273
- getOrNull: constant_a,
274
- getOrUndefined: constant_a,
275
- or: self,
276
- orThunk: self,
277
- map: function (f) {
278
- return some(f(a));
279
- },
280
- each: function (f) {
281
- f(a);
282
- },
283
- bind: bind,
284
- exists: bind,
285
- forall: bind,
286
- filter: function (f) {
287
- return f(a) ? me : NONE;
288
- },
289
- toArray: function () {
290
- return [a];
291
- },
292
- toString: function () {
293
- return 'some(' + a + ')';
294
- },
295
- equals: function (o) {
296
- return o.is(a);
297
- },
298
- equals_: function (o, elementEq) {
299
- return o.fold(never, function (b) {
300
- return elementEq(a, b);
301
- });
235
+ const exists = (xs, pred) => {
236
+ for (let i = 0, len = xs.length; i < len; i++) {
237
+ const x = xs[i];
238
+ if (pred(x, i)) {
239
+ return true;
302
240
  }
303
- };
304
- return me;
305
- };
306
- var from = function (value) {
307
- return value === null || value === undefined ? NONE : some(value);
308
- };
309
- var Optional = {
310
- some: some,
311
- none: none,
312
- from: from
241
+ }
242
+ return false;
313
243
  };
314
-
315
- var map = function (xs, f) {
316
- var len = xs.length;
317
- var r = new Array(len);
318
- for (var i = 0; i < len; i++) {
319
- var x = xs[i];
244
+ const map = (xs, f) => {
245
+ const len = xs.length;
246
+ const r = new Array(len);
247
+ for (let i = 0; i < len; i++) {
248
+ const x = xs[i];
320
249
  r[i] = f(x, i);
321
250
  }
322
251
  return r;
323
252
  };
324
- var findUntil = function (xs, pred, until) {
325
- for (var i = 0, len = xs.length; i < len; i++) {
326
- var x = xs[i];
253
+ const findUntil = (xs, pred, until) => {
254
+ for (let i = 0, len = xs.length; i < len; i++) {
255
+ const x = xs[i];
327
256
  if (pred(x, i)) {
328
257
  return Optional.some(x);
329
258
  } else if (until(x, i)) {
@@ -332,70 +261,129 @@
332
261
  }
333
262
  return Optional.none();
334
263
  };
335
- var find = function (xs, pred) {
264
+ const find = (xs, pred) => {
336
265
  return findUntil(xs, pred, never);
337
266
  };
338
267
 
339
- var global$3 = tinymce.util.Tools.resolve('tinymce.Env');
340
-
341
- var global$4 = tinymce.util.Tools.resolve('tinymce.util.Promise');
342
-
343
- var hasOwnProperty = Object.hasOwnProperty;
344
- var get = function (obj, key) {
268
+ const hasOwnProperty = Object.hasOwnProperty;
269
+ const get = (obj, key) => {
345
270
  return has(obj, key) ? Optional.from(obj[key]) : Optional.none();
346
271
  };
347
- var has = function (obj, key) {
348
- return hasOwnProperty.call(obj, key);
349
- };
272
+ const has = (obj, key) => hasOwnProperty.call(obj, key);
273
+
274
+ var global$1 = tinymce.util.Tools.resolve('tinymce.html.Serializer');
350
275
 
351
- var entitiesAttr = {
276
+ const entitiesAttr = {
352
277
  '"': '&quot;',
353
278
  '<': '&lt;',
354
279
  '>': '&gt;',
355
280
  '&': '&amp;',
356
281
  '\'': '&#039;'
357
282
  };
358
- var htmlEscape = function (html) {
359
- return html.replace(/["'<>&]/g, function (match) {
360
- return get(entitiesAttr, match).getOr(match);
283
+ const htmlEscape = html => html.replace(/["'<>&]/g, match => get(entitiesAttr, match).getOr(match));
284
+ const hasAnyClasses = (dom, n, classes) => exists(classes.split(/\s+/), c => dom.hasClass(n, c));
285
+ const parseAndSerialize = (editor, html) => global$1({ validate: true }, editor.schema).serialize(editor.parser.parse(html, { insert: true }));
286
+
287
+ const createTemplateList = (editor, callback) => {
288
+ return () => {
289
+ const templateList = getTemplates(editor);
290
+ if (isFunction(templateList)) {
291
+ templateList(callback);
292
+ } else if (isString(templateList)) {
293
+ fetch(templateList).then(res => {
294
+ if (res.ok) {
295
+ res.json().then(callback);
296
+ }
297
+ });
298
+ } else {
299
+ callback(templateList);
300
+ }
301
+ };
302
+ };
303
+ const replaceTemplateValues = (html, templateValues) => {
304
+ global$2.each(templateValues, (v, k) => {
305
+ if (isFunction(v)) {
306
+ v = v(k);
307
+ }
308
+ html = html.replace(new RegExp('\\{\\$' + escape(k) + '\\}', 'g'), v);
361
309
  });
310
+ return html;
311
+ };
312
+ const replaceVals = (editor, scope) => {
313
+ const dom = editor.dom, vl = getTemplateReplaceValues(editor);
314
+ global$2.each(dom.select('*', scope), e => {
315
+ global$2.each(vl, (v, k) => {
316
+ if (dom.hasClass(e, k)) {
317
+ if (isFunction(v)) {
318
+ v(e);
319
+ }
320
+ }
321
+ });
322
+ });
323
+ };
324
+ const insertTemplate = (editor, _ui, html) => {
325
+ const dom = editor.dom;
326
+ const sel = editor.selection.getContent();
327
+ html = replaceTemplateValues(html, getTemplateReplaceValues(editor));
328
+ let el = dom.create('div', {}, parseAndSerialize(editor, html));
329
+ const n = dom.select('.mceTmpl', el);
330
+ if (n && n.length > 0) {
331
+ el = dom.create('div');
332
+ el.appendChild(n[0].cloneNode(true));
333
+ }
334
+ global$2.each(dom.select('*', el), n => {
335
+ if (hasAnyClasses(dom, n, getCreationDateClasses(editor))) {
336
+ n.innerHTML = getDateTime(editor, getCdateFormat(editor));
337
+ }
338
+ if (hasAnyClasses(dom, n, getModificationDateClasses(editor))) {
339
+ n.innerHTML = getDateTime(editor, getMdateFormat(editor));
340
+ }
341
+ if (hasAnyClasses(dom, n, getSelectedContentClasses(editor))) {
342
+ n.innerHTML = sel;
343
+ }
344
+ });
345
+ replaceVals(editor, el);
346
+ editor.execCommand('mceInsertContent', false, el.innerHTML);
347
+ editor.addVisual();
362
348
  };
363
349
 
364
- var getPreviewContent = function (editor, html) {
350
+ var global = tinymce.util.Tools.resolve('tinymce.Env');
351
+
352
+ const getPreviewContent = (editor, html) => {
353
+ var _a;
354
+ let previewHtml = parseAndSerialize(editor, html);
365
355
  if (html.indexOf('<html>') === -1) {
366
- var contentCssEntries_1 = '';
367
- var contentStyle = getContentStyle(editor);
368
- var cors_1 = shouldUseContentCssCors(editor) ? ' crossorigin="anonymous"' : '';
369
- global$1.each(editor.contentCSS, function (url) {
370
- contentCssEntries_1 += '<link type="text/css" rel="stylesheet" href="' + editor.documentBaseURI.toAbsolute(url) + '"' + cors_1 + '>';
356
+ let contentCssEntries = '';
357
+ const contentStyle = (_a = getContentStyle(editor)) !== null && _a !== void 0 ? _a : '';
358
+ const cors = shouldUseContentCssCors(editor) ? ' crossorigin="anonymous"' : '';
359
+ global$2.each(editor.contentCSS, url => {
360
+ contentCssEntries += '<link type="text/css" rel="stylesheet" href="' + editor.documentBaseURI.toAbsolute(url) + '"' + cors + '>';
371
361
  });
372
362
  if (contentStyle) {
373
- contentCssEntries_1 += '<style type="text/css">' + contentStyle + '</style>';
363
+ contentCssEntries += '<style type="text/css">' + contentStyle + '</style>';
374
364
  }
375
- var bodyClass = getBodyClass(editor);
376
- var encode = editor.dom.encode;
377
- var isMetaKeyPressed = global$3.mac ? 'e.metaKey' : 'e.ctrlKey && !e.altKey';
378
- var preventClicksOnLinksScript = '<script>' + 'document.addEventListener && document.addEventListener("click", function(e) {' + 'for (var elm = e.target; elm; elm = elm.parentNode) {' + 'if (elm.nodeName === "A" && !(' + isMetaKeyPressed + ')) {' + 'e.preventDefault();' + '}' + '}' + '}, false);' + '</script> ';
379
- var directionality = editor.getBody().dir;
380
- var dirAttr = directionality ? ' dir="' + encode(directionality) + '"' : '';
381
- html = '<!DOCTYPE html>' + '<html>' + '<head>' + '<base href="' + encode(editor.documentBaseURI.getURI()) + '">' + contentCssEntries_1 + preventClicksOnLinksScript + '</head>' + '<body class="' + encode(bodyClass) + '"' + dirAttr + '>' + html + '</body>' + '</html>';
365
+ const bodyClass = getBodyClass(editor);
366
+ const encode = editor.dom.encode;
367
+ const isMetaKeyPressed = global.os.isMacOS() || global.os.isiOS() ? 'e.metaKey' : 'e.ctrlKey && !e.altKey';
368
+ const preventClicksOnLinksScript = '<script>' + 'document.addEventListener && document.addEventListener("click", function(e) {' + 'for (var elm = e.target; elm; elm = elm.parentNode) {' + 'if (elm.nodeName === "A" && !(' + isMetaKeyPressed + ')) {' + 'e.preventDefault();' + '}' + '}' + '}, false);' + '</script> ';
369
+ const directionality = editor.getBody().dir;
370
+ const dirAttr = directionality ? ' dir="' + encode(directionality) + '"' : '';
371
+ previewHtml = '<!DOCTYPE html>' + '<html>' + '<head>' + '<base href="' + encode(editor.documentBaseURI.getURI()) + '">' + contentCssEntries + preventClicksOnLinksScript + '</head>' + '<body class="' + encode(bodyClass) + '"' + dirAttr + '>' + previewHtml + '</body>' + '</html>';
382
372
  }
383
- return replaceTemplateValues(html, getPreviewReplaceValues(editor));
373
+ return replaceTemplateValues(previewHtml, getPreviewReplaceValues(editor));
384
374
  };
385
- var open = function (editor, templateList) {
386
- var createTemplates = function () {
375
+ const open = (editor, templateList) => {
376
+ const createTemplates = () => {
387
377
  if (!templateList || templateList.length === 0) {
388
- var message = editor.translate('No templates defined.');
378
+ const message = editor.translate('No templates defined.');
389
379
  editor.notificationManager.open({
390
380
  text: message,
391
381
  type: 'info'
392
382
  });
393
383
  return Optional.none();
394
384
  }
395
- return Optional.from(global$1.map(templateList, function (template, index) {
396
- var isUrlTemplate = function (t) {
397
- return t.url !== undefined;
398
- };
385
+ return Optional.from(global$2.map(templateList, (template, index) => {
386
+ const isUrlTemplate = t => t.url !== undefined;
399
387
  return {
400
388
  selected: index === 0,
401
389
  text: template.title,
@@ -407,121 +395,90 @@
407
395
  };
408
396
  }));
409
397
  };
410
- var createSelectBoxItems = function (templates) {
411
- return map(templates, function (t) {
412
- return {
413
- text: t.text,
414
- value: t.text
415
- };
416
- });
398
+ const createSelectBoxItems = templates => map(templates, t => ({
399
+ text: t.text,
400
+ value: t.text
401
+ }));
402
+ const findTemplate = (templates, templateTitle) => find(templates, t => t.text === templateTitle);
403
+ const loadFailedAlert = api => {
404
+ editor.windowManager.alert('Could not load the specified template.', () => api.focus('template'));
417
405
  };
418
- var findTemplate = function (templates, templateTitle) {
419
- return find(templates, function (t) {
420
- return t.text === templateTitle;
421
- });
422
- };
423
- var loadFailedAlert = function (api) {
424
- editor.windowManager.alert('Could not load the specified template.', function () {
425
- return api.focus('template');
426
- });
427
- };
428
- var getTemplateContent = function (t) {
429
- return new global$4(function (resolve, reject) {
430
- t.value.url.fold(function () {
431
- return resolve(t.value.content.getOr(''));
432
- }, function (url) {
433
- return global$2.send({
434
- url: url,
435
- success: function (html) {
436
- resolve(html);
437
- },
438
- error: function (e) {
439
- reject(e);
440
- }
406
+ const getTemplateContent = t => t.value.url.fold(() => Promise.resolve(t.value.content.getOr('')), url => fetch(url).then(res => res.ok ? res.text() : Promise.reject()));
407
+ const onChange = (templates, updateDialog) => (api, change) => {
408
+ if (change.name === 'template') {
409
+ const newTemplateTitle = api.getData().template;
410
+ findTemplate(templates, newTemplateTitle).each(t => {
411
+ api.block('Loading...');
412
+ getTemplateContent(t).then(previewHtml => {
413
+ updateDialog(api, t, previewHtml);
414
+ }).catch(() => {
415
+ updateDialog(api, t, '');
416
+ api.setEnabled('save', false);
417
+ loadFailedAlert(api);
441
418
  });
442
419
  });
443
- });
444
- };
445
- var onChange = function (templates, updateDialog) {
446
- return function (api, change) {
447
- if (change.name === 'template') {
448
- var newTemplateTitle = api.getData().template;
449
- findTemplate(templates, newTemplateTitle).each(function (t) {
450
- api.block('Loading...');
451
- getTemplateContent(t).then(function (previewHtml) {
452
- updateDialog(api, t, previewHtml);
453
- }).catch(function () {
454
- updateDialog(api, t, '');
455
- api.disable('save');
456
- loadFailedAlert(api);
457
- });
458
- });
459
- }
460
- };
420
+ }
461
421
  };
462
- var onSubmit = function (templates) {
463
- return function (api) {
464
- var data = api.getData();
465
- findTemplate(templates, data.template).each(function (t) {
466
- getTemplateContent(t).then(function (previewHtml) {
467
- insertTemplate(editor, false, previewHtml);
468
- api.close();
469
- }).catch(function () {
470
- api.disable('save');
471
- loadFailedAlert(api);
472
- });
422
+ const onSubmit = templates => api => {
423
+ const data = api.getData();
424
+ findTemplate(templates, data.template).each(t => {
425
+ getTemplateContent(t).then(previewHtml => {
426
+ editor.execCommand('mceInsertTemplate', false, previewHtml);
427
+ api.close();
428
+ }).catch(() => {
429
+ api.setEnabled('save', false);
430
+ loadFailedAlert(api);
473
431
  });
474
- };
432
+ });
475
433
  };
476
- var openDialog = function (templates) {
477
- var selectBoxItems = createSelectBoxItems(templates);
478
- var buildDialogSpec = function (bodyItems, initialData) {
479
- return {
480
- title: 'Insert Template',
481
- size: 'large',
482
- body: {
483
- type: 'panel',
484
- items: bodyItems
434
+ const openDialog = templates => {
435
+ const selectBoxItems = createSelectBoxItems(templates);
436
+ const buildDialogSpec = (bodyItems, initialData) => ({
437
+ title: 'Insert Template',
438
+ size: 'large',
439
+ body: {
440
+ type: 'panel',
441
+ items: bodyItems
442
+ },
443
+ initialData,
444
+ buttons: [
445
+ {
446
+ type: 'cancel',
447
+ name: 'cancel',
448
+ text: 'Cancel'
485
449
  },
486
- initialData: initialData,
487
- buttons: [
488
- {
489
- type: 'cancel',
490
- name: 'cancel',
491
- text: 'Cancel'
492
- },
493
- {
494
- type: 'submit',
495
- name: 'save',
496
- text: 'Save',
497
- primary: true
498
- }
499
- ],
500
- onSubmit: onSubmit(templates),
501
- onChange: onChange(templates, updateDialog)
502
- };
503
- };
504
- var updateDialog = function (dialogApi, template, previewHtml) {
505
- var content = getPreviewContent(editor, previewHtml);
506
- var bodyItems = [
507
450
  {
508
- type: 'selectbox',
451
+ type: 'submit',
452
+ name: 'save',
453
+ text: 'Save',
454
+ primary: true
455
+ }
456
+ ],
457
+ onSubmit: onSubmit(templates),
458
+ onChange: onChange(templates, updateDialog)
459
+ });
460
+ const updateDialog = (dialogApi, template, previewHtml) => {
461
+ const content = getPreviewContent(editor, previewHtml);
462
+ const bodyItems = [
463
+ {
464
+ type: 'listbox',
509
465
  name: 'template',
510
466
  label: 'Templates',
511
467
  items: selectBoxItems
512
468
  },
513
469
  {
514
470
  type: 'htmlpanel',
515
- html: '<p aria-live="polite">' + htmlEscape(template.value.description) + '</p>'
471
+ html: `<p aria-live="polite">${ htmlEscape(template.value.description) }</p>`
516
472
  },
517
473
  {
518
474
  label: 'Preview',
519
475
  type: 'iframe',
520
476
  name: 'preview',
521
- sandboxed: false
477
+ sandboxed: false,
478
+ transparent: false
522
479
  }
523
480
  ];
524
- var initialData = {
481
+ const initialData = {
525
482
  template: template.text,
526
483
  preview: content
527
484
  };
@@ -529,49 +486,82 @@
529
486
  dialogApi.redial(buildDialogSpec(bodyItems, initialData));
530
487
  dialogApi.focus('template');
531
488
  };
532
- var dialogApi = editor.windowManager.open(buildDialogSpec([], {
489
+ const dialogApi = editor.windowManager.open(buildDialogSpec([], {
533
490
  template: '',
534
491
  preview: ''
535
492
  }));
536
493
  dialogApi.block('Loading...');
537
- getTemplateContent(templates[0]).then(function (previewHtml) {
494
+ getTemplateContent(templates[0]).then(previewHtml => {
538
495
  updateDialog(dialogApi, templates[0], previewHtml);
539
- }).catch(function () {
496
+ }).catch(() => {
540
497
  updateDialog(dialogApi, templates[0], '');
541
- dialogApi.disable('save');
498
+ dialogApi.setEnabled('save', false);
542
499
  loadFailedAlert(dialogApi);
543
500
  });
544
501
  };
545
- var optTemplates = createTemplates();
502
+ const optTemplates = createTemplates();
546
503
  optTemplates.each(openDialog);
547
504
  };
548
505
 
549
- var showDialog = function (editor) {
550
- return function (templates) {
551
- open(editor, templates);
506
+ const showDialog = editor => templates => {
507
+ open(editor, templates);
508
+ };
509
+ const register$1 = editor => {
510
+ editor.addCommand('mceInsertTemplate', curry(insertTemplate, editor));
511
+ editor.addCommand('mceTemplate', createTemplateList(editor, showDialog(editor)));
512
+ };
513
+
514
+ const setup = editor => {
515
+ editor.on('PreProcess', o => {
516
+ const dom = editor.dom, dateFormat = getMdateFormat(editor);
517
+ global$2.each(dom.select('div', o.node), e => {
518
+ if (dom.hasClass(e, 'mceTmpl')) {
519
+ global$2.each(dom.select('*', e), e => {
520
+ if (hasAnyClasses(dom, e, getModificationDateClasses(editor))) {
521
+ e.innerHTML = getDateTime(editor, dateFormat);
522
+ }
523
+ });
524
+ replaceVals(editor, e);
525
+ }
526
+ });
527
+ });
528
+ };
529
+
530
+ const onSetupEditable = editor => api => {
531
+ const nodeChanged = () => {
532
+ api.setEnabled(editor.selection.isEditable());
533
+ };
534
+ editor.on('NodeChange', nodeChanged);
535
+ nodeChanged();
536
+ return () => {
537
+ editor.off('NodeChange', nodeChanged);
552
538
  };
553
539
  };
554
- var register$1 = function (editor) {
540
+ const register = editor => {
541
+ const onAction = () => editor.execCommand('mceTemplate');
555
542
  editor.ui.registry.addButton('template', {
556
543
  icon: 'template',
557
544
  tooltip: 'Insert template',
558
- onAction: createTemplateList(editor, showDialog(editor))
545
+ onSetup: onSetupEditable(editor),
546
+ onAction
559
547
  });
560
548
  editor.ui.registry.addMenuItem('template', {
561
549
  icon: 'template',
562
550
  text: 'Insert template...',
563
- onAction: createTemplateList(editor, showDialog(editor))
551
+ onSetup: onSetupEditable(editor),
552
+ onAction
564
553
  });
565
554
  };
566
555
 
567
- function Plugin () {
568
- global.add('template', function (editor) {
569
- register$1(editor);
556
+ var Plugin = () => {
557
+ global$3.add('template', editor => {
558
+ register$2(editor);
570
559
  register(editor);
560
+ register$1(editor);
571
561
  setup(editor);
572
562
  });
573
- }
563
+ };
574
564
 
575
565
  Plugin();
576
566
 
577
- }());
567
+ })();