@bobfrankston/rmfmail 1.0.655 → 1.0.657

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 (280) hide show
  1. package/bin/build-tinymce.js +42 -0
  2. package/bin/mailx.js +54 -23
  3. package/bin/mailx.js.map +1 -1
  4. package/bin/mailx.ts +45 -20
  5. package/client/compose/editor.js +7 -1
  6. package/client/compose/editor.js.map +1 -1
  7. package/client/compose/editor.ts +7 -1
  8. package/client/lib/rmf-tiny.js +21 -3
  9. package/client/lib/tinymce/CHANGELOG.md +3991 -0
  10. package/client/lib/tinymce/README.md +77 -0
  11. package/client/lib/tinymce/bower.json +27 -0
  12. package/client/lib/tinymce/composer.json +52 -0
  13. package/client/lib/tinymce/icons/default/icons.js +270 -0
  14. package/client/lib/tinymce/icons/default/icons.min.js +1 -0
  15. package/client/lib/tinymce/icons/default/index.js +7 -0
  16. package/client/lib/tinymce/license.md +9 -0
  17. package/client/lib/tinymce/models/dom/index.js +7 -0
  18. package/client/lib/tinymce/models/dom/model.js +8994 -0
  19. package/client/lib/tinymce/models/dom/model.min.js +1 -0
  20. package/client/lib/tinymce/notices.txt +21 -0
  21. package/client/lib/tinymce/package.json +32 -0
  22. package/client/lib/tinymce/plugins/accordion/index.js +7 -0
  23. package/client/lib/tinymce/plugins/accordion/plugin.js +1373 -0
  24. package/client/lib/tinymce/plugins/accordion/plugin.min.js +1 -0
  25. package/client/lib/tinymce/plugins/advlist/index.js +7 -0
  26. package/client/lib/tinymce/plugins/advlist/plugin.js +473 -0
  27. package/client/lib/tinymce/plugins/advlist/plugin.min.js +1 -0
  28. package/client/lib/tinymce/plugins/anchor/index.js +7 -0
  29. package/client/lib/tinymce/plugins/anchor/plugin.js +237 -0
  30. package/client/lib/tinymce/plugins/anchor/plugin.min.js +1 -0
  31. package/client/lib/tinymce/plugins/autolink/index.js +7 -0
  32. package/client/lib/tinymce/plugins/autolink/plugin.js +315 -0
  33. package/client/lib/tinymce/plugins/autolink/plugin.min.js +1 -0
  34. package/client/lib/tinymce/plugins/autoresize/index.js +7 -0
  35. package/client/lib/tinymce/plugins/autoresize/plugin.js +221 -0
  36. package/client/lib/tinymce/plugins/autoresize/plugin.min.js +1 -0
  37. package/client/lib/tinymce/plugins/autosave/index.js +7 -0
  38. package/client/lib/tinymce/plugins/autosave/plugin.js +249 -0
  39. package/client/lib/tinymce/plugins/autosave/plugin.min.js +1 -0
  40. package/client/lib/tinymce/plugins/charmap/index.js +7 -0
  41. package/client/lib/tinymce/plugins/charmap/plugin.js +997 -0
  42. package/client/lib/tinymce/plugins/charmap/plugin.min.js +1 -0
  43. package/client/lib/tinymce/plugins/code/index.js +7 -0
  44. package/client/lib/tinymce/plugins/code/plugin.js +98 -0
  45. package/client/lib/tinymce/plugins/code/plugin.min.js +1 -0
  46. package/client/lib/tinymce/plugins/codesample/index.js +7 -0
  47. package/client/lib/tinymce/plugins/codesample/plugin.js +3655 -0
  48. package/client/lib/tinymce/plugins/codesample/plugin.min.js +9 -0
  49. package/client/lib/tinymce/plugins/directionality/index.js +7 -0
  50. package/client/lib/tinymce/plugins/directionality/plugin.js +670 -0
  51. package/client/lib/tinymce/plugins/directionality/plugin.min.js +1 -0
  52. package/client/lib/tinymce/plugins/emoticons/index.js +7 -0
  53. package/client/lib/tinymce/plugins/emoticons/js/emojiimages.js +1 -0
  54. package/client/lib/tinymce/plugins/emoticons/js/emojiimages.min.js +1 -0
  55. package/client/lib/tinymce/plugins/emoticons/js/emojis.js +1 -0
  56. package/client/lib/tinymce/plugins/emoticons/js/emojis.min.js +1 -0
  57. package/client/lib/tinymce/plugins/emoticons/plugin.js +809 -0
  58. package/client/lib/tinymce/plugins/emoticons/plugin.min.js +1 -0
  59. package/client/lib/tinymce/plugins/fullscreen/index.js +7 -0
  60. package/client/lib/tinymce/plugins/fullscreen/plugin.js +1607 -0
  61. package/client/lib/tinymce/plugins/fullscreen/plugin.min.js +1 -0
  62. package/client/lib/tinymce/plugins/help/index.js +7 -0
  63. package/client/lib/tinymce/plugins/help/js/i18n/keynav/ar.js +93 -0
  64. package/client/lib/tinymce/plugins/help/js/i18n/keynav/bg-BG.js +93 -0
  65. package/client/lib/tinymce/plugins/help/js/i18n/keynav/bg_BG.js +93 -0
  66. package/client/lib/tinymce/plugins/help/js/i18n/keynav/ca.js +93 -0
  67. package/client/lib/tinymce/plugins/help/js/i18n/keynav/cs.js +93 -0
  68. package/client/lib/tinymce/plugins/help/js/i18n/keynav/da.js +93 -0
  69. package/client/lib/tinymce/plugins/help/js/i18n/keynav/de.js +93 -0
  70. package/client/lib/tinymce/plugins/help/js/i18n/keynav/el.js +93 -0
  71. package/client/lib/tinymce/plugins/help/js/i18n/keynav/en.js +93 -0
  72. package/client/lib/tinymce/plugins/help/js/i18n/keynav/es.js +93 -0
  73. package/client/lib/tinymce/plugins/help/js/i18n/keynav/eu.js +93 -0
  74. package/client/lib/tinymce/plugins/help/js/i18n/keynav/fa.js +93 -0
  75. package/client/lib/tinymce/plugins/help/js/i18n/keynav/fi.js +93 -0
  76. package/client/lib/tinymce/plugins/help/js/i18n/keynav/fr-FR.js +93 -0
  77. package/client/lib/tinymce/plugins/help/js/i18n/keynav/fr_FR.js +93 -0
  78. package/client/lib/tinymce/plugins/help/js/i18n/keynav/he-IL.js +93 -0
  79. package/client/lib/tinymce/plugins/help/js/i18n/keynav/he_IL.js +93 -0
  80. package/client/lib/tinymce/plugins/help/js/i18n/keynav/hi.js +93 -0
  81. package/client/lib/tinymce/plugins/help/js/i18n/keynav/hr.js +93 -0
  82. package/client/lib/tinymce/plugins/help/js/i18n/keynav/hu-HU.js +93 -0
  83. package/client/lib/tinymce/plugins/help/js/i18n/keynav/hu_HU.js +93 -0
  84. package/client/lib/tinymce/plugins/help/js/i18n/keynav/id.js +93 -0
  85. package/client/lib/tinymce/plugins/help/js/i18n/keynav/it.js +93 -0
  86. package/client/lib/tinymce/plugins/help/js/i18n/keynav/ja.js +93 -0
  87. package/client/lib/tinymce/plugins/help/js/i18n/keynav/kk.js +93 -0
  88. package/client/lib/tinymce/plugins/help/js/i18n/keynav/ko-KR.js +93 -0
  89. package/client/lib/tinymce/plugins/help/js/i18n/keynav/ko_KR.js +93 -0
  90. package/client/lib/tinymce/plugins/help/js/i18n/keynav/ms.js +93 -0
  91. package/client/lib/tinymce/plugins/help/js/i18n/keynav/nb-NO.js +93 -0
  92. package/client/lib/tinymce/plugins/help/js/i18n/keynav/nb_NO.js +93 -0
  93. package/client/lib/tinymce/plugins/help/js/i18n/keynav/nl.js +93 -0
  94. package/client/lib/tinymce/plugins/help/js/i18n/keynav/pl.js +93 -0
  95. package/client/lib/tinymce/plugins/help/js/i18n/keynav/pt-BR.js +93 -0
  96. package/client/lib/tinymce/plugins/help/js/i18n/keynav/pt-PT.js +93 -0
  97. package/client/lib/tinymce/plugins/help/js/i18n/keynav/pt_BR.js +93 -0
  98. package/client/lib/tinymce/plugins/help/js/i18n/keynav/pt_PT.js +93 -0
  99. package/client/lib/tinymce/plugins/help/js/i18n/keynav/ro.js +93 -0
  100. package/client/lib/tinymce/plugins/help/js/i18n/keynav/ru.js +93 -0
  101. package/client/lib/tinymce/plugins/help/js/i18n/keynav/sk.js +93 -0
  102. package/client/lib/tinymce/plugins/help/js/i18n/keynav/sl-SI.js +93 -0
  103. package/client/lib/tinymce/plugins/help/js/i18n/keynav/sl_SI.js +93 -0
  104. package/client/lib/tinymce/plugins/help/js/i18n/keynav/sv-SE.js +93 -0
  105. package/client/lib/tinymce/plugins/help/js/i18n/keynav/sv_SE.js +93 -0
  106. package/client/lib/tinymce/plugins/help/js/i18n/keynav/th-TH.js +93 -0
  107. package/client/lib/tinymce/plugins/help/js/i18n/keynav/th_TH.js +93 -0
  108. package/client/lib/tinymce/plugins/help/js/i18n/keynav/tr.js +93 -0
  109. package/client/lib/tinymce/plugins/help/js/i18n/keynav/uk.js +93 -0
  110. package/client/lib/tinymce/plugins/help/js/i18n/keynav/vi.js +93 -0
  111. package/client/lib/tinymce/plugins/help/js/i18n/keynav/zh-CN.js +87 -0
  112. package/client/lib/tinymce/plugins/help/js/i18n/keynav/zh-TW.js +93 -0
  113. package/client/lib/tinymce/plugins/help/js/i18n/keynav/zh_CN.js +87 -0
  114. package/client/lib/tinymce/plugins/help/js/i18n/keynav/zh_TW.js +93 -0
  115. package/client/lib/tinymce/plugins/help/plugin.js +827 -0
  116. package/client/lib/tinymce/plugins/help/plugin.min.js +1 -0
  117. package/client/lib/tinymce/plugins/image/index.js +7 -0
  118. package/client/lib/tinymce/plugins/image/plugin.js +1692 -0
  119. package/client/lib/tinymce/plugins/image/plugin.min.js +1 -0
  120. package/client/lib/tinymce/plugins/importcss/index.js +7 -0
  121. package/client/lib/tinymce/plugins/importcss/plugin.js +401 -0
  122. package/client/lib/tinymce/plugins/importcss/plugin.min.js +1 -0
  123. package/client/lib/tinymce/plugins/insertdatetime/index.js +7 -0
  124. package/client/lib/tinymce/plugins/insertdatetime/plugin.js +187 -0
  125. package/client/lib/tinymce/plugins/insertdatetime/plugin.min.js +1 -0
  126. package/client/lib/tinymce/plugins/link/index.js +7 -0
  127. package/client/lib/tinymce/plugins/link/plugin.js +1711 -0
  128. package/client/lib/tinymce/plugins/link/plugin.min.js +1 -0
  129. package/client/lib/tinymce/plugins/lists/index.js +7 -0
  130. package/client/lib/tinymce/plugins/lists/plugin.js +602 -0
  131. package/client/lib/tinymce/plugins/lists/plugin.min.js +1 -0
  132. package/client/lib/tinymce/plugins/media/index.js +7 -0
  133. package/client/lib/tinymce/plugins/media/plugin.js +1442 -0
  134. package/client/lib/tinymce/plugins/media/plugin.min.js +1 -0
  135. package/client/lib/tinymce/plugins/nonbreaking/index.js +7 -0
  136. package/client/lib/tinymce/plugins/nonbreaking/plugin.js +128 -0
  137. package/client/lib/tinymce/plugins/nonbreaking/plugin.min.js +1 -0
  138. package/client/lib/tinymce/plugins/pagebreak/index.js +7 -0
  139. package/client/lib/tinymce/plugins/pagebreak/plugin.js +123 -0
  140. package/client/lib/tinymce/plugins/pagebreak/plugin.min.js +1 -0
  141. package/client/lib/tinymce/plugins/preview/index.js +7 -0
  142. package/client/lib/tinymce/plugins/preview/plugin.js +878 -0
  143. package/client/lib/tinymce/plugins/preview/plugin.min.js +1 -0
  144. package/client/lib/tinymce/plugins/quickbars/index.js +7 -0
  145. package/client/lib/tinymce/plugins/quickbars/plugin.js +654 -0
  146. package/client/lib/tinymce/plugins/quickbars/plugin.min.js +1 -0
  147. package/client/lib/tinymce/plugins/save/index.js +7 -0
  148. package/client/lib/tinymce/plugins/save/plugin.js +136 -0
  149. package/client/lib/tinymce/plugins/save/plugin.min.js +1 -0
  150. package/client/lib/tinymce/plugins/searchreplace/index.js +7 -0
  151. package/client/lib/tinymce/plugins/searchreplace/plugin.js +1367 -0
  152. package/client/lib/tinymce/plugins/searchreplace/plugin.min.js +1 -0
  153. package/client/lib/tinymce/plugins/table/index.js +7 -0
  154. package/client/lib/tinymce/plugins/table/plugin.js +4011 -0
  155. package/client/lib/tinymce/plugins/table/plugin.min.js +1 -0
  156. package/client/lib/tinymce/plugins/visualblocks/index.js +7 -0
  157. package/client/lib/tinymce/plugins/visualblocks/plugin.js +106 -0
  158. package/client/lib/tinymce/plugins/visualblocks/plugin.min.js +1 -0
  159. package/client/lib/tinymce/plugins/visualchars/index.js +7 -0
  160. package/client/lib/tinymce/plugins/visualchars/plugin.js +808 -0
  161. package/client/lib/tinymce/plugins/visualchars/plugin.min.js +1 -0
  162. package/client/lib/tinymce/plugins/wordcount/index.js +7 -0
  163. package/client/lib/tinymce/plugins/wordcount/plugin.js +586 -0
  164. package/client/lib/tinymce/plugins/wordcount/plugin.min.js +1 -0
  165. package/client/lib/tinymce/skins/content/dark/content.css +75 -0
  166. package/client/lib/tinymce/skins/content/dark/content.js +10 -0
  167. package/client/lib/tinymce/skins/content/dark/content.min.css +10 -0
  168. package/client/lib/tinymce/skins/content/dark/content.min.ts +3 -0
  169. package/client/lib/tinymce/skins/content/dark/content.ts +3 -0
  170. package/client/lib/tinymce/skins/content/default/content.css +70 -0
  171. package/client/lib/tinymce/skins/content/default/content.js +10 -0
  172. package/client/lib/tinymce/skins/content/default/content.min.css +10 -0
  173. package/client/lib/tinymce/skins/content/default/content.min.ts +3 -0
  174. package/client/lib/tinymce/skins/content/default/content.ts +3 -0
  175. package/client/lib/tinymce/skins/content/document/content.css +75 -0
  176. package/client/lib/tinymce/skins/content/document/content.js +10 -0
  177. package/client/lib/tinymce/skins/content/document/content.min.css +10 -0
  178. package/client/lib/tinymce/skins/content/document/content.min.ts +3 -0
  179. package/client/lib/tinymce/skins/content/document/content.ts +3 -0
  180. package/client/lib/tinymce/skins/content/tinymce-5/content.css +70 -0
  181. package/client/lib/tinymce/skins/content/tinymce-5/content.js +10 -0
  182. package/client/lib/tinymce/skins/content/tinymce-5/content.min.css +10 -0
  183. package/client/lib/tinymce/skins/content/tinymce-5/content.min.ts +3 -0
  184. package/client/lib/tinymce/skins/content/tinymce-5/content.ts +3 -0
  185. package/client/lib/tinymce/skins/content/tinymce-5-dark/content.css +75 -0
  186. package/client/lib/tinymce/skins/content/tinymce-5-dark/content.js +10 -0
  187. package/client/lib/tinymce/skins/content/tinymce-5-dark/content.min.css +10 -0
  188. package/client/lib/tinymce/skins/content/tinymce-5-dark/content.min.ts +3 -0
  189. package/client/lib/tinymce/skins/content/tinymce-5-dark/content.ts +3 -0
  190. package/client/lib/tinymce/skins/content/writer/content.css +71 -0
  191. package/client/lib/tinymce/skins/content/writer/content.js +10 -0
  192. package/client/lib/tinymce/skins/content/writer/content.min.css +10 -0
  193. package/client/lib/tinymce/skins/content/writer/content.min.ts +3 -0
  194. package/client/lib/tinymce/skins/content/writer/content.ts +3 -0
  195. package/client/lib/tinymce/skins/ui/oxide/content.css +1322 -0
  196. package/client/lib/tinymce/skins/ui/oxide/content.inline.css +1316 -0
  197. package/client/lib/tinymce/skins/ui/oxide/content.inline.js +10 -0
  198. package/client/lib/tinymce/skins/ui/oxide/content.inline.min.css +10 -0
  199. package/client/lib/tinymce/skins/ui/oxide/content.inline.min.ts +136 -0
  200. package/client/lib/tinymce/skins/ui/oxide/content.inline.ts +136 -0
  201. package/client/lib/tinymce/skins/ui/oxide/content.js +10 -0
  202. package/client/lib/tinymce/skins/ui/oxide/content.min.css +10 -0
  203. package/client/lib/tinymce/skins/ui/oxide/content.min.ts +136 -0
  204. package/client/lib/tinymce/skins/ui/oxide/content.ts +136 -0
  205. package/client/lib/tinymce/skins/ui/oxide/skin.css +7109 -0
  206. package/client/lib/tinymce/skins/ui/oxide/skin.js +1 -0
  207. package/client/lib/tinymce/skins/ui/oxide/skin.min.css +1 -0
  208. package/client/lib/tinymce/skins/ui/oxide/skin.min.ts +637 -0
  209. package/client/lib/tinymce/skins/ui/oxide/skin.shadowdom.css +30 -0
  210. package/client/lib/tinymce/skins/ui/oxide/skin.shadowdom.js +1 -0
  211. package/client/lib/tinymce/skins/ui/oxide/skin.shadowdom.min.css +1 -0
  212. package/client/lib/tinymce/skins/ui/oxide/skin.shadowdom.min.ts +9 -0
  213. package/client/lib/tinymce/skins/ui/oxide/skin.shadowdom.ts +9 -0
  214. package/client/lib/tinymce/skins/ui/oxide/skin.ts +637 -0
  215. package/client/lib/tinymce/skins/ui/oxide-dark/content.css +1310 -0
  216. package/client/lib/tinymce/skins/ui/oxide-dark/content.inline.css +1316 -0
  217. package/client/lib/tinymce/skins/ui/oxide-dark/content.inline.js +10 -0
  218. package/client/lib/tinymce/skins/ui/oxide-dark/content.inline.min.css +10 -0
  219. package/client/lib/tinymce/skins/ui/oxide-dark/content.inline.min.ts +136 -0
  220. package/client/lib/tinymce/skins/ui/oxide-dark/content.inline.ts +136 -0
  221. package/client/lib/tinymce/skins/ui/oxide-dark/content.js +10 -0
  222. package/client/lib/tinymce/skins/ui/oxide-dark/content.min.css +10 -0
  223. package/client/lib/tinymce/skins/ui/oxide-dark/content.min.ts +136 -0
  224. package/client/lib/tinymce/skins/ui/oxide-dark/content.ts +136 -0
  225. package/client/lib/tinymce/skins/ui/oxide-dark/skin.css +7112 -0
  226. package/client/lib/tinymce/skins/ui/oxide-dark/skin.js +1 -0
  227. package/client/lib/tinymce/skins/ui/oxide-dark/skin.min.css +1 -0
  228. package/client/lib/tinymce/skins/ui/oxide-dark/skin.min.ts +637 -0
  229. package/client/lib/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +30 -0
  230. package/client/lib/tinymce/skins/ui/oxide-dark/skin.shadowdom.js +1 -0
  231. package/client/lib/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -0
  232. package/client/lib/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.ts +9 -0
  233. package/client/lib/tinymce/skins/ui/oxide-dark/skin.shadowdom.ts +9 -0
  234. package/client/lib/tinymce/skins/ui/oxide-dark/skin.ts +637 -0
  235. package/client/lib/tinymce/skins/ui/tinymce-5/content.css +1322 -0
  236. package/client/lib/tinymce/skins/ui/tinymce-5/content.inline.css +1316 -0
  237. package/client/lib/tinymce/skins/ui/tinymce-5/content.inline.js +10 -0
  238. package/client/lib/tinymce/skins/ui/tinymce-5/content.inline.min.css +10 -0
  239. package/client/lib/tinymce/skins/ui/tinymce-5/content.inline.min.ts +136 -0
  240. package/client/lib/tinymce/skins/ui/tinymce-5/content.inline.ts +136 -0
  241. package/client/lib/tinymce/skins/ui/tinymce-5/content.js +10 -0
  242. package/client/lib/tinymce/skins/ui/tinymce-5/content.min.css +10 -0
  243. package/client/lib/tinymce/skins/ui/tinymce-5/content.min.ts +136 -0
  244. package/client/lib/tinymce/skins/ui/tinymce-5/content.ts +136 -0
  245. package/client/lib/tinymce/skins/ui/tinymce-5/skin.css +7228 -0
  246. package/client/lib/tinymce/skins/ui/tinymce-5/skin.js +1 -0
  247. package/client/lib/tinymce/skins/ui/tinymce-5/skin.min.css +1 -0
  248. package/client/lib/tinymce/skins/ui/tinymce-5/skin.min.ts +638 -0
  249. package/client/lib/tinymce/skins/ui/tinymce-5/skin.shadowdom.css +30 -0
  250. package/client/lib/tinymce/skins/ui/tinymce-5/skin.shadowdom.js +1 -0
  251. package/client/lib/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css +1 -0
  252. package/client/lib/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.ts +9 -0
  253. package/client/lib/tinymce/skins/ui/tinymce-5/skin.shadowdom.ts +9 -0
  254. package/client/lib/tinymce/skins/ui/tinymce-5/skin.ts +638 -0
  255. package/client/lib/tinymce/skins/ui/tinymce-5-dark/content.css +1310 -0
  256. package/client/lib/tinymce/skins/ui/tinymce-5-dark/content.inline.css +1316 -0
  257. package/client/lib/tinymce/skins/ui/tinymce-5-dark/content.inline.js +10 -0
  258. package/client/lib/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +10 -0
  259. package/client/lib/tinymce/skins/ui/tinymce-5-dark/content.inline.min.ts +136 -0
  260. package/client/lib/tinymce/skins/ui/tinymce-5-dark/content.inline.ts +136 -0
  261. package/client/lib/tinymce/skins/ui/tinymce-5-dark/content.js +10 -0
  262. package/client/lib/tinymce/skins/ui/tinymce-5-dark/content.min.css +10 -0
  263. package/client/lib/tinymce/skins/ui/tinymce-5-dark/content.min.ts +136 -0
  264. package/client/lib/tinymce/skins/ui/tinymce-5-dark/content.ts +136 -0
  265. package/client/lib/tinymce/skins/ui/tinymce-5-dark/skin.css +7228 -0
  266. package/client/lib/tinymce/skins/ui/tinymce-5-dark/skin.js +1 -0
  267. package/client/lib/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -0
  268. package/client/lib/tinymce/skins/ui/tinymce-5-dark/skin.min.ts +638 -0
  269. package/client/lib/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.css +30 -0
  270. package/client/lib/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.js +1 -0
  271. package/client/lib/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css +1 -0
  272. package/client/lib/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.ts +9 -0
  273. package/client/lib/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.ts +9 -0
  274. package/client/lib/tinymce/skins/ui/tinymce-5-dark/skin.ts +638 -0
  275. package/client/lib/tinymce/themes/silver/index.js +7 -0
  276. package/client/lib/tinymce/themes/silver/theme.js +34829 -0
  277. package/client/lib/tinymce/themes/silver/theme.min.js +1 -0
  278. package/client/lib/tinymce/tinymce.js +41682 -0
  279. package/client/lib/tinymce/tinymce.min.js +10 -0
  280. package/package.json +5 -2
@@ -0,0 +1 @@
1
+ !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=Object.getPrototypeOf,a=(e,t,a)=>!!a(e,t.prototype)||e.constructor?.name===t.name,i=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&a(e,String,(e,t)=>t.isPrototypeOf(e))?"string":t})(t)===e,s=e=>t=>typeof t===e,r=i("string"),o=i("object"),n=e=>((e,i)=>o(e)&&a(e,i,(e,a)=>t(e)===a))(e,Object),l=i("array"),c=e=>null===e;const m=s("boolean"),d=e=>!(e=>null==e)(e),g=s("function"),p=s("number"),u=()=>{};class h{tag;value;static singletonNone=new h(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new h(!0,e)}static none(){return h.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?h.some(e(this.value)):h.none()}bind(e){return this.tag?e(this.value):h.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:h.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return d(e)?h.some(e):h.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Array.prototype.slice;const b=Array.prototype.push,y=e=>{const t=[];for(let a=0,i=e.length;a<i;++a){if(!l(e[a]))throw new Error("Arr.flatten item "+a+" was not an array, input: "+e);b.apply(t,e[a])}return t};g(Array.from)&&Array.from;const v=Object.keys,f=Object.hasOwnProperty,A=(e,t)=>f.call(e,t),w=(D=(e,t)=>n(e)&&n(t)?w(e,t):t,(...e)=>{if(0===e.length)throw new Error("Can't merge zero objects");const t={};for(let a=0;a<e.length;a++){const i=e[a];for(const e in i)A(i,e)&&(t[e]=D(t[e],i[e]))}return t});var D;const _=e=>e.length>0,C=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},I=C,S=(e,t,a)=>{((e,t,a)=>{if(!(r(a)||m(a)||p(a)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",a,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,a+"")})(e.dom,t,a)};var U=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),x=tinymce.util.Tools.resolve("tinymce.util.URI");const N=e=>t=>t.options.get(e),E=N("image_dimensions"),T=N("image_advtab"),L=N("image_uploadtab"),O=N("image_prepend_url"),j=N("image_class_list"),M=N("image_description"),R=N("image_title"),k=N("image_caption"),P=N("image_list"),z=N("a11y_advanced_options"),B=N("automatic_uploads"),F=(e,t)=>Math.max(parseInt(e,10),parseInt(t,10)),H=e=>(e&&(e=e.replace(/px$/,"")),e),G=e=>(e.length>0&&/^[0-9]+$/.test(e)&&(e+="px"),e),W=e=>"IMG"===e.nodeName&&(e.hasAttribute("data-mce-object")||e.hasAttribute("data-mce-placeholder")),$=(e,t)=>{const a=e.options.get;return x.isDomSafe(t,"img",{allow_html_data_urls:a("allow_html_data_urls"),allow_script_urls:a("allow_script_urls"),allow_svg_data_urls:a("allow_svg_data_urls")})},V=U.DOM,K=e=>e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?H(e.style.marginLeft):"",Z=e=>e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?H(e.style.marginTop):"",q=e=>e.style.borderWidth?H(e.style.borderWidth):"",J=(e,t)=>e.hasAttribute(t)?e.getAttribute(t)??"":"",Q=e=>null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName,X=(e,t,a)=>{""===a||null===a?e.removeAttribute(t):e.setAttribute(t,a)},Y=(e,t)=>{const a=e.getAttribute("style"),i=t(null!==a?a:"");i.length>0?(e.setAttribute("style",i),e.setAttribute("data-mce-style",i)):e.removeAttribute("style")},ee=(e,t)=>(e,a,i)=>{const s=e.style;s[a]?(s[a]=G(i),Y(e,t)):X(e,a,i)},te=(e,t)=>e.style[t]?H(e.style[t]):J(e,t),ae=(e,t)=>{const a=G(t);e.style.marginLeft=a,e.style.marginRight=a},ie=(e,t)=>{const a=G(t);e.style.marginTop=a,e.style.marginBottom=a},se=(e,t)=>{const a=G(t);e.style.borderWidth=a},re=(e,t)=>{e.style.borderStyle=t},oe=e=>e.style.borderStyle??"",ne=e=>d(e)&&"FIGURE"===e.nodeName,le=e=>{const t=V.getAttrib(e,"alt"),a=V.getAttrib(e,"role");return e.hasAttribute("alt")&&0===t.length||"presentation"===a||"none"===a},ce=e=>le(e)?"":J(e,"alt"),me=(e,t)=>{const a=document.createElement("img");return X(a,"style",t.style),(K(a)||""!==t.hspace)&&ae(a,t.hspace),(Z(a)||""!==t.vspace)&&ie(a,t.vspace),(q(a)||""!==t.border)&&se(a,t.border),(oe(a)||""!==t.borderStyle)&&re(a,t.borderStyle),e(a.getAttribute("style")??"")},de=(e,t)=>({src:J(t,"src"),alt:ce(t),title:J(t,"title"),width:te(t,"width"),height:te(t,"height"),class:J(t,"class"),style:e(J(t,"style")),caption:Q(t),hspace:K(t),vspace:Z(t),border:q(t),borderStyle:oe(t),isDecorative:le(t)}),ge=(e,t,a,i,s)=>{a[i]!==t[i]&&s(e,i,String(a[i]))},pe=(e,t,a)=>{if(a){V.setAttrib(e,"role","presentation");const t=I(e);S(t,"alt","")}else{if(c(t)){I(e).dom.removeAttribute("alt")}else{const a=I(e);S(a,"alt",t)}"presentation"===V.getAttrib(e,"role")&&V.setAttrib(e,"role","")}},ue=(e,t)=>(a,i,s)=>{e(a,s),Y(a,t)},he=(e,t,a)=>{const i=de(e,a);ge(a,i,t,"caption",(e,t,a)=>(e=>{Q(e)?(e=>{const t=e.parentNode;d(t)&&(V.insertAfter(e,t),V.remove(t))})(e):(e=>{const t=V.create("figure",{class:"image"});V.insertAfter(t,e),t.appendChild(e),t.appendChild(V.create("figcaption",{contentEditable:"true"},"Caption")),t.contentEditable="false"})(e)})(e)),ge(a,i,t,"src",X),ge(a,i,t,"title",X),ge(a,i,t,"width",ee(0,e)),ge(a,i,t,"height",ee(0,e)),ge(a,i,t,"class",X),ge(a,i,t,"style",ue((e,t)=>X(e,"style",t),e)),ge(a,i,t,"hspace",ue(ae,e)),ge(a,i,t,"vspace",ue(ie,e)),ge(a,i,t,"border",ue(se,e)),ge(a,i,t,"borderStyle",ue(re,e)),((e,t,a)=>{a.alt===t.alt&&a.isDecorative===t.isDecorative||pe(e,a.alt,a.isDecorative)})(a,i,t)},be=(e,t)=>{const a=(e=>{if(e.margin){const t=String(e.margin).split(" ");switch(t.length){case 1:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[0],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[0];break;case 2:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[1];break;case 3:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[1];break;case 4:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[3]}delete e.margin}return e})(e.dom.styles.parse(t)),i=e.dom.styles.parse(e.dom.styles.serialize(a));return e.dom.styles.serialize(i)},ye=e=>{const t=e.selection.getNode(),a=e.dom.getParent(t,"figure.image");return a?e.dom.select("img",a)[0]:t&&("IMG"!==t.nodeName||W(t))?null:t},ve=(e,t)=>{const a=e.dom,i=(t=>{const a={};var i;return((e,t,a,i)=>{((e,t)=>{const a=v(e);for(let i=0,s=a.length;i<s;i++){const s=a[i];t(e[s],s)}})(e,(e,s)=>{(t(e,s)?a:i)(e,s)})})(t,(t,a)=>!e.schema.isValidChild(a,"figure"),(i=a,(e,t)=>{i[t]=e}),u),a})(e.schema.getTextBlockElements()),s=a.getParent(t.parentNode,e=>{return t=i,a=e.nodeName,A(t,a)&&void 0!==t[a]&&null!==t[a];var t,a},e.getBody());return s?a.split(s,t)??t:t},fe=(e,t)=>{const a=((t,a)=>{const i=document.createElement("img");if(he(t=>be(e,t),{...a,caption:!1},i),pe(i,a.alt,a.isDecorative),a.caption){const e=V.create("figure",{class:"image"});return e.appendChild(i),e.appendChild(V.create("figcaption",{contentEditable:"true"},"Caption")),e.contentEditable="false",e}return i})(0,t);e.dom.setAttrib(a,"data-mce-id","__mcenew"),e.focus(),e.insertContent(a.outerHTML);const i=e.dom.select('*[data-mce-id="__mcenew"]')[0];if(e.dom.setAttrib(i,"data-mce-id",null),ne(i)){const t=ve(e,i);e.selection.select(t)}else e.selection.select(i)},Ae=(e,t)=>{const a=ye(e);if(a){const i={...de(t=>be(e,t),a),...t},s=((e,t)=>{const a=t.src;return{...t,src:$(e,a)?a:""}})(e,i);i.src?((e,t)=>{const a=ye(e);if(a)if(he(t=>be(e,t),t,a),((e,t)=>{e.dom.setAttrib(t,"src",t.getAttribute("src"))})(e,a),ne(a.parentNode)){e.dom.setStyle(a,"float","");const t=a.parentNode;ve(e,t),e.selection.select(a.parentNode)}else e.selection.select(a),((e,t,a)=>{const i=()=>{a.onload=a.onerror=null,e.selection&&(e.selection.select(a),e.nodeChanged())};a.onload=()=>{t.width||t.height||!E(e)||e.dom.setAttribs(a,{width:String(a.clientWidth),height:String(a.clientHeight)}),i()},a.onerror=i})(e,t,a)})(e,s):((e,t)=>{if(t){const a=e.dom.is(t.parentNode,"figure.image")?t.parentNode:t;e.dom.remove(a),e.focus(),e.nodeChanged(),e.dom.isEmpty(e.getBody())&&(e.setContent(""),e.selection.setCursorLocation())}})(e,a)}else t.src&&fe(e,{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1,...t})};var we=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),De=tinymce.util.Tools.resolve("tinymce.util.Tools");const _e=e=>r(e.value)?e.value:"",Ce=(e,t)=>{const a=[];return De.each(e,e=>{const i=(e=>r(e.text)?e.text:r(e.title)?e.title:"")(e);if(void 0!==e.menu){const s=Ce(e.menu,t);a.push({text:i,items:s})}else{const s=t(e);a.push({text:i,value:s})}}),a},Ie=(e=_e)=>t=>t?h.from(t).map(t=>Ce(t,e)):h.none(),Se=(e,t)=>((e,t)=>{for(let a=0;a<e.length;a++){const i=t(e[a]);if(i.isSome())return i}return h.none()})(e,e=>(e=>A(e,"items"))(e)?Se(e.items,t):e.value===t?h.some(e):h.none()),Ue=Ie,xe=(e,t)=>e.bind(e=>Se(e,t)),Ne=e=>{const t=Ue(t=>e.convertURL(t.value||t.url||"","src")),a=new Promise(a=>{((e,t)=>{const a=P(e);r(a)?fetch(a).then(e=>{e.ok&&e.json().then(t)}):g(a)?a(t):t(a)})(e,e=>{a(t(e).map(e=>y([[{text:"None",value:""}],e])))})}),i=(t,a)=>{e.windowManager.alert(t,a)},s=(D=j(e),Ie(_e)(D)),o=T(e),n=L(e),l=(e=>_(e.options.get("images_upload_url")))(e),c=(e=>d(e.options.get("images_upload_handler")))(e),m=(e=>{const t=ye(e);return t?de(t=>be(e,t),t):{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}})(e),p=M(e),u=R(e),b=E(e),v=k(e),f=z(e),A=B(e),w=h.some(O(e)).filter(e=>r(e)&&e.length>0);var D;return a.then(e=>({alertErr:i,image:m,imageList:e,classList:s,hasAdvTab:o,hasUploadTab:n,hasUploadUrl:l,hasUploadHandler:c,hasDescription:p,hasImageTitle:u,hasDimensions:b,hasImageCaption:v,prependURL:w,hasAccessibilityOptions:f,automaticUploads:A}))},Ee=e=>{const t=e.imageList.map(e=>({name:"images",type:"listbox",label:"Image list",items:e})),a={name:"alt",type:"input",label:"Alternative description",enabled:!(e.hasAccessibilityOptions&&e.image.isDecorative)},i=e.classList.map(e=>({name:"classes",type:"listbox",label:"Class",items:e}));return y([[{name:"src",type:"urlinput",filetype:"image",label:"Source",picker_text:"Browse files"}],t.toArray(),e.hasAccessibilityOptions&&e.hasDescription?[{type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]}]:[],e.hasDescription?[a]:[],e.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],e.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[{...(s=e.classList.isSome()&&e.hasImageCaption,s?{type:"grid",columns:2}:{type:"panel"}),items:y([i.toArray(),e.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])}]]);var s},Te=e=>({title:"General",name:"general",items:Ee(e)}),Le=Ee,Oe=e=>({src:{value:e.src,meta:{}},images:e.src,alt:e.alt,title:e.title,dimensions:{width:e.width,height:e.height},classes:e.class,caption:e.caption,style:e.style,vspace:e.vspace,border:e.border,hspace:e.hspace,borderstyle:e.borderStyle,fileinput:[],isDecorative:e.isDecorative}),je=(e,t)=>({src:e.src.value,alt:null!==e.alt&&0!==e.alt.length||!t?e.alt:null,title:e.title,width:e.dimensions.width,height:e.dimensions.height,class:e.classes,style:e.style,caption:e.caption,hspace:e.hspace,vspace:e.vspace,border:e.border,borderStyle:e.borderstyle,isDecorative:e.isDecorative}),Me=(e,t,a,i)=>{((e,t)=>{const a=t.getData();((e,t)=>/^(?:[a-zA-Z]+:)?\/\//.test(t)?h.none():e.prependURL.bind(e=>t.substring(0,e.length)!==e?h.some(e+t):h.none()))(e,a.src.value).each(e=>{t.setData({src:{value:e,meta:a.src.meta}})})})(t,i),((e,t)=>{const a=t.getData(),i=a.src.meta;if(void 0!==i){const s=w({},a);((e,t,a)=>{e.hasDescription&&r(a.alt)&&(t.alt=a.alt),e.hasAccessibilityOptions&&(t.isDecorative=a.isDecorative||t.isDecorative||!1),e.hasImageTitle&&r(a.title)&&(t.title=a.title),e.hasDimensions&&(r(a.width)&&(t.dimensions.width=a.width),r(a.height)&&(t.dimensions.height=a.height)),r(a.class)&&xe(e.classList,a.class).each(e=>{t.classes=e.value}),e.hasImageCaption&&m(a.caption)&&(t.caption=a.caption),e.hasAdvTab&&(r(a.style)&&(t.style=a.style),r(a.vspace)&&(t.vspace=a.vspace),r(a.border)&&(t.border=a.border),r(a.hspace)&&(t.hspace=a.hspace),r(a.borderstyle)&&(t.borderstyle=a.borderstyle))})(e,s,i),t.setData(s)}})(t,i),((e,t,a,i)=>{const s=i.getData(),r=s.src.value,o=s.src.meta||{};o.width||o.height||!t.hasDimensions||(_(r)?e.imageSize(r).then(e=>{a.open&&i.setData({dimensions:e})}).catch(e=>console.error(e)):i.setData({dimensions:{width:"",height:""}}))})(e,t,a,i),((e,t,a)=>{const i=a.getData(),s=xe(e.imageList,i.src.value);t.prevImage=s,a.setData({images:s.map(e=>e.value).getOr("")})})(t,a,i)},Re=(e,t,a,i)=>{const s=i.getData();var r;i.block("Uploading image"),(r=s.fileinput,(e=>0<e.length?h.some(e[0]):h.none())(r)).fold(()=>{i.unblock()},s=>{const r=URL.createObjectURL(s),o=()=>{i.unblock(),URL.revokeObjectURL(r)},n=s=>{i.setData({src:{value:s,meta:{}}}),i.showTab("general"),Me(e,t,a,i),i.focus("src")};var l;(l=s,new Promise((e,t)=>{const a=new FileReader;a.onload=()=>{e(a.result)},a.onerror=()=>{t(a.error?.message)},a.readAsDataURL(l)})).then(a=>{const l=e.createBlobCache(s,r,a);t.automaticUploads?e.uploadImage(l).then(e=>{n(e.url),o()}).catch(e=>{o(),t.alertErr(e,()=>{i.focus("fileinput")})}):(e.addToBlobCache(l),n(l.blobUri()),i.unblock())})})},ke=(e,t,a)=>(i,s)=>{"src"===s.name?Me(e,t,a,i):"images"===s.name?((e,t,a,i)=>{const s=i.getData(),r=xe(t.imageList,s.images);r.each(e=>{const t=""===s.alt||a.prevImage.map(e=>e.text===s.alt).getOr(!1);t?""===e.value?i.setData({src:e,alt:a.prevAlt}):i.setData({src:e,alt:e.text}):i.setData({src:e})}),a.prevImage=r,Me(e,t,a,i)})(e,t,a,i):"alt"===s.name?a.prevAlt=i.getData().alt:"fileinput"===s.name?Re(e,t,a,i):"isDecorative"===s.name&&i.setEnabled("alt",!i.getData().isDecorative)},Pe=e=>()=>{e.open=!1},ze=e=>{return e.hasAdvTab||e.hasUploadUrl||e.hasUploadHandler?{type:"tabpanel",tabs:y([[Te(e)],e.hasAdvTab?[{title:"Advanced",name:"advanced",items:[{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"listbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]}]:[],e.hasUploadTab&&(e.hasUploadUrl||e.hasUploadHandler)?[(t=()=>new Promise(t=>e.alertErr("Selected images do not have allowed extensions",t)),{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput",onInvalidFiles:t}]})]:[]])}:{type:"panel",items:Le(e)};var t},Be=(e,t,a)=>i=>{const s=w(Oe(t.image),i.getData()),r={...s,style:me(a.normalizeCss,je(s,!1))};e.execCommand("mceUpdateImage",!1,je(r,t.hasAccessibilityOptions)),e.editorUpload.uploadImagesAuto(),i.close()},Fe=e=>t=>$(e,t)?(e=>new Promise(t=>{const a=document.createElement("img"),i=e=>{a.parentNode&&a.parentNode.removeChild(a),t(e)};a.addEventListener("load",()=>{const e={width:F(a.width,a.clientWidth),height:F(a.height,a.clientHeight)};i(Promise.resolve(e))}),a.addEventListener("error",()=>{i(Promise.reject(`Failed to get image dimensions for: ${e}`))});const s=a.style;s.visibility="hidden",s.position="fixed",s.bottom=s.left="0px",s.width=s.height="auto",document.body.appendChild(a),a.src=e}))(e.documentBaseURI.toAbsolute(t)).then(e=>({width:String(e.width),height:String(e.height)})):Promise.resolve({width:"",height:""}),He=e=>(t,a,i)=>e.editorUpload.blobCache.create({blob:t,blobUri:a,name:t.name?.replace(/\.[^\.]+$/,""),filename:t.name,base64:i.split(",")[1]}),Ge=e=>t=>{e.editorUpload.blobCache.add(t)},We=e=>t=>be(e,t),$e=e=>t=>e.dom.parseStyle(t),Ve=e=>(t,a)=>e.dom.serializeStyle(t,a),Ke=e=>t=>we(e).upload([t],!1).then(e=>0===e.length?Promise.reject("Failed to upload image"):!1===e[0].status?Promise.reject(e[0].error?.message):e[0]),Ze=e=>{const t={imageSize:Fe(e),addToBlobCache:Ge(e),createBlobCache:He(e),normalizeCss:We(e),parseStyle:$e(e),serializeStyle:Ve(e),uploadImage:Ke(e)};return{open:()=>{Ne(e).then(a=>{const i=(e=>({prevImage:xe(e.imageList,e.image.src),prevAlt:e.image.alt,open:!0}))(a);return{title:"Insert/Edit Image",size:"normal",body:ze(a),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Oe(a.image),onSubmit:Be(e,a,t),onChange:ke(t,a,i),onClose:Pe(i)}}).then(e.windowManager.open)}}},qe=e=>{const t=e.attr("class");return d(t)&&/\bimage\b/.test(t)},Je=e=>t=>{let a=t.length;const i=t=>{t.attr("contenteditable",e?"true":null)};for(;a--;){const s=t[a];qe(s)&&(s.attr("contenteditable",e?"false":null),De.each(s.getAll("figcaption"),i))}},Qe=e=>t=>{const a=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",a),a(),()=>{e.off("NodeChange",a)}};e.add("image",e=>{(e=>{const t=e.options.register;t("image_dimensions",{processor:"boolean",default:!0}),t("image_advtab",{processor:"boolean",default:!1}),t("image_uploadtab",{processor:"boolean",default:!0}),t("image_prepend_url",{processor:"string",default:""}),t("image_class_list",{processor:"object[]"}),t("image_description",{processor:"boolean",default:!0}),t("image_title",{processor:"boolean",default:!1}),t("image_caption",{processor:"boolean",default:!1}),t("image_list",{processor:e=>{const t=!1===e||r(e)||((e,t)=>{if(l(e)){for(let a=0,i=e.length;a<i;++a)if(!t(e[a]))return!1;return!0}return!1})(e,o)||g(e);return t?{value:e,valid:t}:{valid:!1,message:"Must be false, a string, an array or a function."}},default:!1})})(e),(e=>{e.on("PreInit",()=>{e.parser.addNodeFilter("figure",Je(!0)),e.serializer.addNodeFilter("figure",Je(!1))})})(e),(e=>{e.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:Ze(e).open,onSetup:t=>{t.setActive(d(ye(e)));const a=e.selection.selectorChangedWithUnbind("img:not([data-mce-object]):not([data-mce-placeholder]),figure.image",t.setActive).unbind,i=Qe(e)(t);return()=>{a(),i()}}}),e.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:Ze(e).open,onSetup:Qe(e)}),e.ui.registry.addContextMenu("image",{update:t=>e.selection.isEditable()&&(ne(t)||"IMG"===t.nodeName&&!W(t))?["image"]:[]})})(e),(e=>{e.addCommand("mceImage",Ze(e).open),e.addCommand("mceUpdateImage",(t,a)=>{e.undoManager.transact(()=>Ae(e,a))})})(e)})}();
@@ -0,0 +1,7 @@
1
+ // Exports the "importcss" plugin for usage with module loaders
2
+ // Usage:
3
+ // CommonJS:
4
+ // require('tinymce/plugins/importcss')
5
+ // ES2015:
6
+ // import 'tinymce/plugins/importcss'
7
+ require('./plugin.js');
@@ -0,0 +1,401 @@
1
+ /**
2
+ * TinyMCE version 8.5.0 (2026-04-29)
3
+ */
4
+
5
+ (function () {
6
+ 'use strict';
7
+
8
+ var global$4 = tinymce.util.Tools.resolve('tinymce.PluginManager');
9
+
10
+ /* eslint-disable @typescript-eslint/no-wrapper-object-types */
11
+ const hasProto = (v, constructor, predicate) => {
12
+ if (predicate(v, constructor.prototype)) {
13
+ return true;
14
+ }
15
+ else {
16
+ // String-based fallback time
17
+ return v.constructor?.name === constructor.name;
18
+ }
19
+ };
20
+ const typeOf = (x) => {
21
+ const t = typeof x;
22
+ if (x === null) {
23
+ return 'null';
24
+ }
25
+ else if (t === 'object' && Array.isArray(x)) {
26
+ return 'array';
27
+ }
28
+ else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
29
+ return 'string';
30
+ }
31
+ else {
32
+ return t;
33
+ }
34
+ };
35
+ const isType = (type) => (value) => typeOf(value) === type;
36
+ const isSimpleType = (type) => (value) => typeof value === type;
37
+ const isString = isType('string');
38
+ const isObject = isType('object');
39
+ const isArray = isType('array');
40
+ const isFunction = isSimpleType('function');
41
+
42
+ const nativeSlice = Array.prototype.slice;
43
+ const nativePush = Array.prototype.push;
44
+ const map = (xs, f) => {
45
+ // pre-allocating array size when it's guaranteed to be known
46
+ // http://jsperf.com/push-allocated-vs-dynamic/22
47
+ const len = xs.length;
48
+ const r = new Array(len);
49
+ for (let i = 0; i < len; i++) {
50
+ const x = xs[i];
51
+ r[i] = f(x, i);
52
+ }
53
+ return r;
54
+ };
55
+ const flatten = (xs) => {
56
+ // Note, this is possible because push supports multiple arguments:
57
+ // http://jsperf.com/concat-push/6
58
+ // Note that in the past, concat() would silently work (very slowly) for array-like objects.
59
+ // With this change it will throw an error.
60
+ const r = [];
61
+ for (let i = 0, len = xs.length; i < len; ++i) {
62
+ // Ensure that each value is an array itself
63
+ if (!isArray(xs[i])) {
64
+ throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
65
+ }
66
+ nativePush.apply(r, xs[i]);
67
+ }
68
+ return r;
69
+ };
70
+ const bind = (xs, f) => flatten(map(xs, f));
71
+ isFunction(Array.from) ? Array.from : (x) => nativeSlice.call(x);
72
+
73
+ var global$3 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
74
+
75
+ var global$2 = tinymce.util.Tools.resolve('tinymce.EditorManager');
76
+
77
+ var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
78
+
79
+ var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
80
+
81
+ const option = (name) => (editor) => editor.options.get(name);
82
+ const register = (editor) => {
83
+ const registerOption = editor.options.register;
84
+ const filterProcessor = (value) => isString(value) || isFunction(value) || isObject(value);
85
+ registerOption('importcss_merge_classes', {
86
+ processor: 'boolean',
87
+ default: true
88
+ });
89
+ registerOption('importcss_exclusive', {
90
+ processor: 'boolean',
91
+ default: true
92
+ });
93
+ registerOption('importcss_selector_converter', {
94
+ processor: 'function'
95
+ });
96
+ registerOption('importcss_selector_filter', {
97
+ processor: filterProcessor
98
+ });
99
+ registerOption('importcss_file_filter', {
100
+ processor: filterProcessor
101
+ });
102
+ registerOption('importcss_groups', {
103
+ processor: 'object[]'
104
+ });
105
+ registerOption('importcss_append', {
106
+ processor: 'boolean',
107
+ default: false
108
+ });
109
+ };
110
+ const shouldMergeClasses = option('importcss_merge_classes');
111
+ const shouldImportExclusive = option('importcss_exclusive');
112
+ const getSelectorConverter = option('importcss_selector_converter');
113
+ const getSelectorFilter = option('importcss_selector_filter');
114
+ const getCssGroups = option('importcss_groups');
115
+ const shouldAppend = option('importcss_append');
116
+ const getFileFilter = option('importcss_file_filter');
117
+ const getSkin = option('skin');
118
+ const getSkinUrl = option('skin_url');
119
+
120
+ const generate = () => {
121
+ const ungroupedOrder = [];
122
+ const groupOrder = [];
123
+ const groups = {};
124
+ const addItemToGroup = (groupTitle, itemInfo) => {
125
+ if (groups[groupTitle]) {
126
+ groups[groupTitle].push(itemInfo);
127
+ }
128
+ else {
129
+ groupOrder.push(groupTitle);
130
+ groups[groupTitle] = [itemInfo];
131
+ }
132
+ };
133
+ const addItem = (itemInfo) => {
134
+ ungroupedOrder.push(itemInfo);
135
+ };
136
+ const toFormats = () => {
137
+ const groupItems = bind(groupOrder, (g) => {
138
+ const items = groups[g];
139
+ return items.length === 0 ? [] : [{
140
+ title: g,
141
+ items
142
+ }];
143
+ });
144
+ return groupItems.concat(ungroupedOrder);
145
+ };
146
+ return {
147
+ addItemToGroup,
148
+ addItem,
149
+ toFormats
150
+ };
151
+ };
152
+
153
+ const internalEditorStyle = /^\.(?:ephox|tiny-pageembed|mce)(?:[.-]+\w+)+$/;
154
+ const removeCacheSuffix = (url) => {
155
+ const cacheSuffix = global$1.cacheSuffix;
156
+ if (isString(url)) {
157
+ url = url.replace('?' + cacheSuffix, '').replace('&' + cacheSuffix, '');
158
+ }
159
+ return url;
160
+ };
161
+ const isSkinContentCss = (editor, href) => {
162
+ const skin = getSkin(editor);
163
+ if (skin) {
164
+ const skinUrlBase = getSkinUrl(editor);
165
+ const skinUrl = skinUrlBase ? editor.documentBaseURI.toAbsolute(skinUrlBase) : global$2.baseURL + '/skins/ui/' + skin;
166
+ const contentSkinUrlPart = global$2.baseURL + '/skins/content/';
167
+ const suffix = editor.editorManager.suffix;
168
+ return href === skinUrl + '/content' + (editor.inline ? '.inline' : '') + `${suffix}.css` || href.indexOf(contentSkinUrlPart) !== -1;
169
+ }
170
+ return false;
171
+ };
172
+ const compileFilter = (filter) => {
173
+ if (isString(filter)) {
174
+ return (value) => {
175
+ return value.indexOf(filter) !== -1;
176
+ };
177
+ }
178
+ else if (filter instanceof RegExp) {
179
+ return (value) => {
180
+ return filter.test(value);
181
+ };
182
+ }
183
+ return filter;
184
+ };
185
+ const isCssImportRule = (rule) => rule.styleSheet;
186
+ const isCssPageRule = (rule) => rule.selectorText;
187
+ const getSelectors = (editor, doc, fileFilter) => {
188
+ const selectors = [];
189
+ const contentCSSUrls = {};
190
+ const append = (styleSheet, imported) => {
191
+ let href = styleSheet.href;
192
+ let rules;
193
+ href = removeCacheSuffix(href);
194
+ if (!href || fileFilter && !fileFilter(href, imported) || isSkinContentCss(editor, href)) {
195
+ return;
196
+ }
197
+ // TODO: Is this still need as TypeScript/MDN says imports doesn't exist?
198
+ global.each(styleSheet.imports, (styleSheet) => {
199
+ append(styleSheet, true);
200
+ });
201
+ try {
202
+ rules = styleSheet.cssRules || styleSheet.rules;
203
+ }
204
+ catch {
205
+ // Firefox fails on rules to remote domain for example:
206
+ // @import url(//fonts.googleapis.com/css?family=Pathway+Gothic+One);
207
+ }
208
+ global.each(rules, (cssRule) => {
209
+ if (isCssImportRule(cssRule) && cssRule.styleSheet) {
210
+ append(cssRule.styleSheet, true);
211
+ }
212
+ else if (isCssPageRule(cssRule)) {
213
+ global.each(cssRule.selectorText.split(','), (selector) => {
214
+ selectors.push(global.trim(selector));
215
+ });
216
+ }
217
+ });
218
+ };
219
+ global.each(editor.contentCSS, (url) => {
220
+ contentCSSUrls[url] = true;
221
+ });
222
+ if (!fileFilter) {
223
+ fileFilter = (href, imported) => {
224
+ return imported || contentCSSUrls[href];
225
+ };
226
+ }
227
+ try {
228
+ global.each(doc.styleSheets, (styleSheet) => {
229
+ append(styleSheet);
230
+ });
231
+ }
232
+ catch {
233
+ // Ignore
234
+ }
235
+ return selectors;
236
+ };
237
+ const defaultConvertSelectorToFormat = (editor, selectorText) => {
238
+ let format = {};
239
+ // Parse simple element.class1, .class1
240
+ const selector = /^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(selectorText);
241
+ if (!selector) {
242
+ return;
243
+ }
244
+ const elementName = selector[1];
245
+ const classes = selector[2].substr(1).split('.').join(' ');
246
+ const inlineSelectorElements = global.makeMap('a,img');
247
+ // element.class - Produce block formats
248
+ if (selector[1]) {
249
+ format = {
250
+ title: selectorText
251
+ };
252
+ if (editor.schema.getTextBlockElements()[elementName]) {
253
+ // Text block format ex: h1.class1
254
+ format.block = elementName;
255
+ }
256
+ else if (editor.schema.getBlockElements()[elementName] || inlineSelectorElements[elementName.toLowerCase()]) {
257
+ // Block elements such as table.class and special inline elements such as a.class or img.class
258
+ format.selector = elementName;
259
+ }
260
+ else {
261
+ // Inline format strong.class1
262
+ format.inline = elementName;
263
+ }
264
+ }
265
+ else if (selector[2]) {
266
+ // .class - Produce inline span with classes
267
+ format = {
268
+ inline: 'span',
269
+ title: selectorText.substr(1),
270
+ classes
271
+ };
272
+ }
273
+ // Append to or override class attribute
274
+ if (shouldMergeClasses(editor)) {
275
+ format.classes = classes;
276
+ }
277
+ else {
278
+ format.attributes = { class: classes };
279
+ }
280
+ return format;
281
+ };
282
+ const getGroupsBySelector = (groups, selector) => {
283
+ return global.grep(groups, (group) => {
284
+ return !group.filter || group.filter(selector);
285
+ });
286
+ };
287
+ const compileUserDefinedGroups = (groups) => {
288
+ return global.map(groups, (group) => {
289
+ return global.extend({}, group, {
290
+ original: group,
291
+ selectors: {},
292
+ filter: compileFilter(group.filter)
293
+ });
294
+ });
295
+ };
296
+ const isExclusiveMode = (editor, group) => {
297
+ // Exclusive mode can only be disabled when there are groups allowing the same style to be present in multiple groups
298
+ return group === null || shouldImportExclusive(editor);
299
+ };
300
+ const isUniqueSelector = (editor, selector, group, globallyUniqueSelectors) => {
301
+ return !(isExclusiveMode(editor, group) ? selector in globallyUniqueSelectors : selector in group.selectors);
302
+ };
303
+ const markUniqueSelector = (editor, selector, group, globallyUniqueSelectors) => {
304
+ if (isExclusiveMode(editor, group)) {
305
+ globallyUniqueSelectors[selector] = true;
306
+ }
307
+ else {
308
+ group.selectors[selector] = true;
309
+ }
310
+ };
311
+ const convertSelectorToFormat = (editor, plugin, selector, group) => {
312
+ let selectorConverter;
313
+ const converter = getSelectorConverter(editor);
314
+ if (group && group.selector_converter) {
315
+ selectorConverter = group.selector_converter;
316
+ }
317
+ else if (converter) {
318
+ selectorConverter = converter;
319
+ }
320
+ else {
321
+ selectorConverter = () => {
322
+ return defaultConvertSelectorToFormat(editor, selector);
323
+ };
324
+ }
325
+ return selectorConverter.call(plugin, selector, group);
326
+ };
327
+ const setup = (editor) => {
328
+ editor.on('init', () => {
329
+ const model = generate();
330
+ const globallyUniqueSelectors = {};
331
+ const selectorFilter = compileFilter(getSelectorFilter(editor));
332
+ const groups = compileUserDefinedGroups(getCssGroups(editor));
333
+ const processSelector = (selector, group) => {
334
+ if (isUniqueSelector(editor, selector, group, globallyUniqueSelectors)) {
335
+ markUniqueSelector(editor, selector, group, globallyUniqueSelectors);
336
+ const format = convertSelectorToFormat(editor, editor.plugins.importcss, selector, group);
337
+ if (format) {
338
+ const formatName = format.name || global$3.DOM.uniqueId();
339
+ editor.formatter.register(formatName, format);
340
+ return {
341
+ title: format.title,
342
+ format: formatName
343
+ };
344
+ }
345
+ }
346
+ return null;
347
+ };
348
+ global.each(getSelectors(editor, editor.getDoc(), compileFilter(getFileFilter(editor))), (selector) => {
349
+ if (!internalEditorStyle.test(selector)) {
350
+ if (!selectorFilter || selectorFilter(selector)) {
351
+ const selectorGroups = getGroupsBySelector(groups, selector);
352
+ if (selectorGroups.length > 0) {
353
+ global.each(selectorGroups, (group) => {
354
+ const menuItem = processSelector(selector, group);
355
+ if (menuItem) {
356
+ model.addItemToGroup(group.title, menuItem);
357
+ }
358
+ });
359
+ }
360
+ else {
361
+ const menuItem = processSelector(selector, null);
362
+ if (menuItem) {
363
+ model.addItem(menuItem);
364
+ }
365
+ }
366
+ }
367
+ }
368
+ });
369
+ const items = model.toFormats();
370
+ editor.dispatch('addStyleModifications', {
371
+ items,
372
+ replace: !shouldAppend(editor)
373
+ });
374
+ });
375
+ };
376
+
377
+ const get = (editor) => {
378
+ const convertSelectorToFormat = (selectorText) => {
379
+ return defaultConvertSelectorToFormat(editor, selectorText);
380
+ };
381
+ return {
382
+ convertSelectorToFormat
383
+ };
384
+ };
385
+
386
+ var Plugin = () => {
387
+ global$4.add('importcss', (editor) => {
388
+ register(editor);
389
+ setup(editor);
390
+ return get(editor);
391
+ });
392
+ };
393
+
394
+ Plugin();
395
+ /** *****
396
+ * DO NOT EXPORT ANYTHING
397
+ *
398
+ * IF YOU DO ROLLUP WILL LEAVE A GLOBAL ON THE PAGE
399
+ *******/
400
+
401
+ })();
@@ -0,0 +1 @@
1
+ !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(s=r=e,(o=String).prototype.isPrototypeOf(s)||r.constructor?.name===o.name)?"string":t;var s,r,o})(t)===e,s=t("string"),r=t("object"),o=t("array"),n=e=>"function"==typeof e;Array.prototype.slice;const c=Array.prototype.push;n(Array.from)&&Array.from;var i=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),l=tinymce.util.Tools.resolve("tinymce.EditorManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),p=tinymce.util.Tools.resolve("tinymce.util.Tools");const u=e=>t=>t.options.get(e),m=u("importcss_merge_classes"),f=u("importcss_exclusive"),y=u("importcss_selector_converter"),h=u("importcss_selector_filter"),d=u("importcss_groups"),g=u("importcss_append"),_=u("importcss_file_filter"),v=u("skin"),b=u("skin_url"),x=/^\.(?:ephox|tiny-pageembed|mce)(?:[.-]+\w+)+$/,T=e=>s(e)?t=>-1!==t.indexOf(e):e instanceof RegExp?t=>e.test(t):e,S=(e,t)=>{let s={};const r=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(t);if(!r)return;const o=r[1],n=r[2].substr(1).split(".").join(" "),c=p.makeMap("a,img");return r[1]?(s={title:t},e.schema.getTextBlockElements()[o]?s.block=o:e.schema.getBlockElements()[o]||c[o.toLowerCase()]?s.selector=o:s.inline=o):r[2]&&(s={inline:"span",title:t.substr(1),classes:n}),m(e)?s.classes=n:s.attributes={class:n},s},A=(e,t)=>null===t||f(e),k=e=>{e.on("init",()=>{const t=(()=>{const e=[],t=[],s={};return{addItemToGroup:(e,r)=>{s[e]?s[e].push(r):(t.push(e),s[e]=[r])},addItem:t=>{e.push(t)},toFormats:()=>{return(r=t,n=e=>{const t=s[e];return 0===t.length?[]:[{title:e,items:t}]},(e=>{const t=[];for(let s=0,r=e.length;s<r;++s){if(!o(e[s]))throw new Error("Arr.flatten item "+s+" was not an array, input: "+e);c.apply(t,e[s])}return t})(((e,t)=>{const s=e.length,r=new Array(s);for(let o=0;o<s;o++){const s=e[o];r[o]=t(s,o)}return r})(r,n))).concat(e);var r,n}}})(),r={},n=T(h(e)),u=(e=>p.map(e,e=>p.extend({},e,{original:e,selectors:{},filter:T(e.filter)})))(d(e)),m=(t,s)=>{if(((e,t,s,r)=>!(A(e,s)?t in r:t in s.selectors))(e,t,s,r)){((e,t,s,r)=>{A(e,s)?r[t]=!0:s.selectors[t]=!0})(e,t,s,r);const o=((e,t,s,r)=>{let o;const n=y(e);return o=r&&r.selector_converter?r.selector_converter:n||(()=>S(e,s)),o.call(t,s,r)})(e,e.plugins.importcss,t,s);if(o){const t=o.name||i.DOM.uniqueId();return e.formatter.register(t,o),{title:o.title,format:t}}}return null};p.each(((e,t,r)=>{const o=[],n={},c=(t,n)=>{let i,u=t.href;if(u=(e=>{const t=a.cacheSuffix;return s(e)&&(e=e.replace("?"+t,"").replace("&"+t,"")),e})(u),u&&(!r||r(u,n))&&!((e,t)=>{const s=v(e);if(s){const r=b(e),o=r?e.documentBaseURI.toAbsolute(r):l.baseURL+"/skins/ui/"+s,n=l.baseURL+"/skins/content/",c=e.editorManager.suffix;return t===o+"/content"+(e.inline?".inline":"")+`${c}.css`||-1!==t.indexOf(n)}return!1})(e,u)){p.each(t.imports,e=>{c(e,!0)});try{i=t.cssRules||t.rules}catch{}p.each(i,e=>{e.styleSheet&&e.styleSheet?c(e.styleSheet,!0):e.selectorText&&p.each(e.selectorText.split(","),e=>{o.push(p.trim(e))})})}};p.each(e.contentCSS,e=>{n[e]=!0}),r||(r=(e,t)=>t||n[e]);try{p.each(t.styleSheets,e=>{c(e)})}catch{}return o})(e,e.getDoc(),T(_(e))),e=>{if(!x.test(e)&&(!n||n(e))){const s=((e,t)=>p.grep(e,e=>!e.filter||e.filter(t)))(u,e);if(s.length>0)p.each(s,s=>{const r=m(e,s);r&&t.addItemToGroup(s.title,r)});else{const s=m(e,null);s&&t.addItem(s)}}});const f=t.toFormats();e.dispatch("addStyleModifications",{items:f,replace:!g(e)})})};e.add("importcss",e=>((e=>{const t=e.options.register,o=e=>s(e)||n(e)||r(e);t("importcss_merge_classes",{processor:"boolean",default:!0}),t("importcss_exclusive",{processor:"boolean",default:!0}),t("importcss_selector_converter",{processor:"function"}),t("importcss_selector_filter",{processor:o}),t("importcss_file_filter",{processor:o}),t("importcss_groups",{processor:"object[]"}),t("importcss_append",{processor:"boolean",default:!1})})(e),k(e),(e=>({convertSelectorToFormat:t=>S(e,t)}))(e)))}();
@@ -0,0 +1,7 @@
1
+ // Exports the "insertdatetime" plugin for usage with module loaders
2
+ // Usage:
3
+ // CommonJS:
4
+ // require('tinymce/plugins/insertdatetime')
5
+ // ES2015:
6
+ // import 'tinymce/plugins/insertdatetime'
7
+ require('./plugin.js');
@@ -0,0 +1,187 @@
1
+ /**
2
+ * TinyMCE version 8.5.0 (2026-04-29)
3
+ */
4
+
5
+ (function () {
6
+ 'use strict';
7
+
8
+ var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
9
+
10
+ const option = (name) => (editor) => editor.options.get(name);
11
+ const register$2 = (editor) => {
12
+ const registerOption = editor.options.register;
13
+ registerOption('insertdatetime_dateformat', {
14
+ processor: 'string',
15
+ default: editor.translate('%Y-%m-%d')
16
+ });
17
+ registerOption('insertdatetime_timeformat', {
18
+ processor: 'string',
19
+ default: editor.translate('%H:%M:%S')
20
+ });
21
+ registerOption('insertdatetime_formats', {
22
+ processor: 'string[]',
23
+ default: ['%H:%M:%S', '%Y-%m-%d', '%I:%M:%S %p', '%D']
24
+ });
25
+ registerOption('insertdatetime_element', {
26
+ processor: 'boolean',
27
+ default: false
28
+ });
29
+ };
30
+ const getDateFormat = option('insertdatetime_dateformat');
31
+ const getTimeFormat = option('insertdatetime_timeformat');
32
+ const getFormats = option('insertdatetime_formats');
33
+ const shouldInsertTimeElement = option('insertdatetime_element');
34
+ const getDefaultDateTime = (editor) => {
35
+ const formats = getFormats(editor);
36
+ return formats.length > 0 ? formats[0] : getTimeFormat(editor);
37
+ };
38
+
39
+ const daysShort = 'Sun Mon Tue Wed Thu Fri Sat Sun'.split(' ');
40
+ const daysLong = 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday'.split(' ');
41
+ const monthsShort = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' ');
42
+ const monthsLong = 'January February March April May June July August September October November December'.split(' ');
43
+ const addZeros = (value, len) => {
44
+ value = '' + value;
45
+ if (value.length < len) {
46
+ for (let i = 0; i < (len - value.length); i++) {
47
+ value = '0' + value;
48
+ }
49
+ }
50
+ return value;
51
+ };
52
+ const getDateTime = (editor, fmt, date = new Date()) => {
53
+ fmt = fmt.replace('%D', '%m/%d/%Y');
54
+ fmt = fmt.replace('%r', '%I:%M:%S %p');
55
+ fmt = fmt.replace('%Y', '' + date.getFullYear());
56
+ fmt = fmt.replace('%y', '' + date.getYear());
57
+ fmt = fmt.replace('%m', addZeros(date.getMonth() + 1, 2));
58
+ fmt = fmt.replace('%d', addZeros(date.getDate(), 2));
59
+ fmt = fmt.replace('%H', '' + addZeros(date.getHours(), 2));
60
+ fmt = fmt.replace('%M', '' + addZeros(date.getMinutes(), 2));
61
+ fmt = fmt.replace('%S', '' + addZeros(date.getSeconds(), 2));
62
+ fmt = fmt.replace('%I', '' + ((date.getHours() + 11) % 12 + 1));
63
+ fmt = fmt.replace('%p', '' + (date.getHours() < 12 ? 'AM' : 'PM'));
64
+ fmt = fmt.replace('%B', '' + editor.translate(monthsLong[date.getMonth()]));
65
+ fmt = fmt.replace('%b', '' + editor.translate(monthsShort[date.getMonth()]));
66
+ fmt = fmt.replace('%A', '' + editor.translate(daysLong[date.getDay()]));
67
+ fmt = fmt.replace('%a', '' + editor.translate(daysShort[date.getDay()]));
68
+ fmt = fmt.replace('%%', '%');
69
+ return fmt;
70
+ };
71
+ const updateElement = (editor, timeElm, computerTime, userTime) => {
72
+ const newTimeElm = editor.dom.create('time', { datetime: computerTime }, userTime);
73
+ editor.dom.replace(newTimeElm, timeElm);
74
+ editor.selection.select(newTimeElm, true);
75
+ editor.selection.collapse(false);
76
+ };
77
+ const insertDateTime = (editor, format) => {
78
+ if (shouldInsertTimeElement(editor) && editor.selection.isEditable()) {
79
+ const userTime = getDateTime(editor, format);
80
+ let computerTime;
81
+ if (/%[HMSIp]/.test(format)) {
82
+ computerTime = getDateTime(editor, '%Y-%m-%dT%H:%M');
83
+ }
84
+ else {
85
+ computerTime = getDateTime(editor, '%Y-%m-%d');
86
+ }
87
+ const timeElm = editor.dom.getParent(editor.selection.getStart(), 'time');
88
+ if (timeElm) {
89
+ updateElement(editor, timeElm, computerTime, userTime);
90
+ }
91
+ else {
92
+ editor.insertContent('<time datetime="' + computerTime + '">' + userTime + '</time>');
93
+ }
94
+ }
95
+ else {
96
+ editor.insertContent(getDateTime(editor, format));
97
+ }
98
+ };
99
+
100
+ const register$1 = (editor) => {
101
+ editor.addCommand('mceInsertDate', (_ui, value) => {
102
+ insertDateTime(editor, value ?? getDateFormat(editor));
103
+ });
104
+ editor.addCommand('mceInsertTime', (_ui, value) => {
105
+ insertDateTime(editor, value ?? getTimeFormat(editor));
106
+ });
107
+ };
108
+
109
+ const Cell = (initial) => {
110
+ let value = initial;
111
+ const get = () => {
112
+ return value;
113
+ };
114
+ const set = (v) => {
115
+ value = v;
116
+ };
117
+ return {
118
+ get,
119
+ set
120
+ };
121
+ };
122
+
123
+ var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
124
+
125
+ const onSetupEditable = (editor) => (api) => {
126
+ const nodeChanged = () => {
127
+ api.setEnabled(editor.selection.isEditable());
128
+ };
129
+ editor.on('NodeChange', nodeChanged);
130
+ nodeChanged();
131
+ return () => {
132
+ editor.off('NodeChange', nodeChanged);
133
+ };
134
+ };
135
+ const register = (editor) => {
136
+ const formats = getFormats(editor);
137
+ const defaultFormat = Cell(getDefaultDateTime(editor));
138
+ const insertDateTime = (format) => editor.execCommand('mceInsertDate', false, format);
139
+ editor.ui.registry.addSplitButton('insertdatetime', {
140
+ icon: 'insert-time',
141
+ tooltip: 'Insert date/time',
142
+ chevronTooltip: 'Insert date/time menu',
143
+ select: (value) => value === defaultFormat.get(),
144
+ fetch: (done) => {
145
+ done(global.map(formats, (format) => ({ type: 'choiceitem', text: getDateTime(editor, format), value: format })));
146
+ },
147
+ onAction: (_api) => {
148
+ insertDateTime(defaultFormat.get());
149
+ },
150
+ onItemAction: (_api, value) => {
151
+ defaultFormat.set(value);
152
+ insertDateTime(value);
153
+ },
154
+ onSetup: onSetupEditable(editor)
155
+ });
156
+ const makeMenuItemHandler = (format) => () => {
157
+ defaultFormat.set(format);
158
+ insertDateTime(format);
159
+ };
160
+ editor.ui.registry.addNestedMenuItem('insertdatetime', {
161
+ icon: 'insert-time',
162
+ text: 'Date/time',
163
+ getSubmenuItems: () => global.map(formats, (format) => ({
164
+ type: 'menuitem',
165
+ text: getDateTime(editor, format),
166
+ onAction: makeMenuItemHandler(format)
167
+ })),
168
+ onSetup: onSetupEditable(editor)
169
+ });
170
+ };
171
+
172
+ var Plugin = () => {
173
+ global$1.add('insertdatetime', (editor) => {
174
+ register$2(editor);
175
+ register$1(editor);
176
+ register(editor);
177
+ });
178
+ };
179
+
180
+ Plugin();
181
+ /** *****
182
+ * DO NOT EXPORT ANYTHING
183
+ *
184
+ * IF YOU DO ROLLUP WILL LEAVE A GLOBAL ON THE PAGE
185
+ *******/
186
+
187
+ })();