argous 1.2.202 → 1.2.203

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (407) hide show
  1. package/dist/components/ConfirmModal/ModalProvider.d.ts +1 -1
  2. package/dist/components/Editor/components/Editor.d.ts +4 -4
  3. package/dist/components/Editor/components/Editor.js +3 -3
  4. package/dist/components/Editor/skins/content/dark/content.d.ts +0 -0
  5. package/dist/components/Editor/skins/content/dark/content.js +3 -0
  6. package/dist/components/Editor/skins/content/default/content.d.ts +0 -0
  7. package/dist/components/Editor/skins/content/default/content.js +3 -0
  8. package/dist/components/Editor/skins/content/document/content.d.ts +0 -0
  9. package/dist/components/Editor/skins/content/document/content.js +3 -0
  10. package/dist/components/Editor/skins/content/tinymce-5/content.d.ts +0 -0
  11. package/dist/components/Editor/skins/content/tinymce-5/content.js +3 -0
  12. package/dist/components/Editor/skins/content/tinymce-5-dark/content.d.ts +0 -0
  13. package/dist/components/Editor/skins/content/tinymce-5-dark/content.js +3 -0
  14. package/dist/components/Editor/skins/content/writer/content.d.ts +0 -0
  15. package/dist/components/Editor/skins/content/writer/content.js +3 -0
  16. package/dist/components/Editor/skins/ui/oxide/content.d.ts +0 -0
  17. package/dist/components/Editor/skins/ui/oxide/content.inline.d.ts +0 -0
  18. package/dist/components/Editor/skins/ui/oxide/content.inline.js +3 -0
  19. package/dist/components/Editor/skins/ui/oxide/content.js +3 -0
  20. package/dist/components/Editor/skins/ui/oxide/skin.d.ts +0 -0
  21. package/dist/components/Editor/skins/ui/oxide/skin.js +3 -0
  22. package/dist/components/Editor/skins/ui/oxide/skin.shadowdom.d.ts +0 -0
  23. package/dist/components/Editor/skins/ui/oxide/skin.shadowdom.js +3 -0
  24. package/dist/components/Editor/skins/ui/oxide-dark/content.d.ts +0 -0
  25. package/dist/components/Editor/skins/ui/oxide-dark/content.inline.d.ts +0 -0
  26. package/dist/components/Editor/skins/ui/oxide-dark/content.inline.js +3 -0
  27. package/dist/components/Editor/skins/ui/oxide-dark/content.js +3 -0
  28. package/dist/components/Editor/skins/ui/oxide-dark/skin.d.ts +0 -0
  29. package/dist/components/Editor/skins/ui/oxide-dark/skin.js +3 -0
  30. package/dist/components/Editor/skins/ui/oxide-dark/skin.shadowdom.d.ts +0 -0
  31. package/dist/components/Editor/skins/ui/oxide-dark/skin.shadowdom.js +3 -0
  32. package/dist/components/Editor/skins/ui/tinymce-5/content.d.ts +0 -0
  33. package/dist/components/Editor/skins/ui/tinymce-5/content.inline.d.ts +0 -0
  34. package/dist/components/Editor/skins/ui/tinymce-5/content.inline.js +3 -0
  35. package/dist/components/Editor/skins/ui/tinymce-5/content.js +3 -0
  36. package/dist/components/Editor/skins/ui/tinymce-5/skin.d.ts +0 -0
  37. package/dist/components/Editor/skins/ui/tinymce-5/skin.js +3 -0
  38. package/dist/components/Editor/skins/ui/tinymce-5/skin.shadowdom.d.ts +0 -0
  39. package/dist/components/Editor/skins/ui/tinymce-5/skin.shadowdom.js +3 -0
  40. package/dist/components/Editor/skins/ui/tinymce-5-dark/content.d.ts +0 -0
  41. package/dist/components/Editor/skins/ui/tinymce-5-dark/content.inline.d.ts +0 -0
  42. package/dist/components/Editor/skins/ui/tinymce-5-dark/content.inline.js +3 -0
  43. package/dist/components/Editor/skins/ui/tinymce-5-dark/content.js +3 -0
  44. package/dist/components/Editor/skins/ui/tinymce-5-dark/skin.d.ts +0 -0
  45. package/dist/components/Editor/skins/ui/tinymce-5-dark/skin.js +3 -0
  46. package/dist/components/Editor/skins/ui/tinymce-5-dark/skin.shadowdom.d.ts +0 -0
  47. package/dist/components/Editor/skins/ui/tinymce-5-dark/skin.shadowdom.js +3 -0
  48. package/dist/components/Editor/tinymce/tinymce.d.ts +1722 -1447
  49. package/lib/components/Editor/components/Editor.tsx +8 -8
  50. package/lib/components/Editor/skins/content/dark/content.js +2 -0
  51. package/lib/components/Editor/skins/content/dark/content.min.css +1 -8
  52. package/lib/components/Editor/skins/content/default/content.js +2 -0
  53. package/lib/components/Editor/skins/content/default/content.min.css +0 -7
  54. package/lib/components/Editor/skins/content/document/content.js +2 -0
  55. package/lib/components/Editor/skins/content/document/content.min.css +0 -7
  56. package/lib/components/Editor/skins/content/tinymce-5/content.js +2 -0
  57. package/lib/components/Editor/skins/content/tinymce-5/content.min.css +1 -0
  58. package/lib/components/Editor/skins/content/tinymce-5-dark/content.js +2 -0
  59. package/lib/components/Editor/skins/content/tinymce-5-dark/content.min.css +1 -0
  60. package/lib/components/Editor/skins/content/writer/content.js +2 -0
  61. package/lib/components/Editor/skins/content/writer/content.min.css +0 -7
  62. package/lib/components/Editor/skins/ui/oxide/content.inline.js +2 -0
  63. package/lib/components/Editor/skins/ui/oxide/content.inline.min.css +1 -0
  64. package/lib/components/Editor/skins/ui/oxide/content.js +2 -0
  65. package/lib/components/Editor/skins/ui/oxide/content.min.css +1 -0
  66. package/lib/components/Editor/skins/ui/oxide/skin.js +2 -0
  67. package/lib/components/Editor/skins/ui/oxide/skin.min.css +1 -0
  68. package/lib/components/Editor/skins/ui/oxide/skin.shadowdom.js +2 -0
  69. package/lib/components/Editor/skins/ui/oxide/skin.shadowdom.min.css +1 -0
  70. package/lib/components/Editor/skins/ui/oxide-dark/content.inline.js +2 -0
  71. package/lib/components/Editor/skins/ui/oxide-dark/content.inline.min.css +1 -0
  72. package/lib/components/Editor/skins/ui/oxide-dark/content.js +2 -0
  73. package/lib/components/Editor/skins/ui/oxide-dark/content.min.css +1 -0
  74. package/lib/components/Editor/skins/ui/oxide-dark/skin.js +2 -0
  75. package/lib/components/Editor/skins/ui/oxide-dark/skin.min.css +1 -0
  76. package/lib/components/Editor/skins/ui/oxide-dark/skin.shadowdom.js +2 -0
  77. package/lib/components/Editor/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -0
  78. package/lib/components/Editor/skins/ui/tinymce-5/content.inline.js +2 -0
  79. package/lib/components/Editor/skins/ui/tinymce-5/content.inline.min.css +1 -0
  80. package/lib/components/Editor/skins/ui/tinymce-5/content.js +2 -0
  81. package/lib/components/Editor/skins/ui/tinymce-5/content.min.css +1 -0
  82. package/lib/components/Editor/skins/ui/tinymce-5/skin.js +2 -0
  83. package/lib/components/Editor/skins/ui/tinymce-5/skin.min.css +1 -0
  84. package/lib/components/Editor/skins/ui/tinymce-5/skin.shadowdom.js +2 -0
  85. package/lib/components/Editor/skins/ui/tinymce-5/skin.shadowdom.min.css +1 -0
  86. package/lib/components/Editor/skins/ui/tinymce-5-dark/content.inline.js +2 -0
  87. package/lib/components/Editor/skins/ui/tinymce-5-dark/content.inline.min.css +1 -0
  88. package/lib/components/Editor/skins/ui/tinymce-5-dark/content.js +2 -0
  89. package/lib/components/Editor/skins/ui/tinymce-5-dark/content.min.css +1 -0
  90. package/lib/components/Editor/skins/ui/tinymce-5-dark/skin.js +2 -0
  91. package/lib/components/Editor/skins/ui/tinymce-5-dark/skin.min.css +1 -0
  92. package/lib/components/Editor/skins/ui/tinymce-5-dark/skin.shadowdom.js +2 -0
  93. package/lib/components/Editor/skins/ui/tinymce-5-dark/skin.shadowdom.min.css +1 -0
  94. package/lib/components/Editor/tinymce/README.md +24 -14
  95. package/lib/components/Editor/tinymce/icons/default/icons.js +185 -163
  96. package/lib/components/Editor/tinymce/icons/default/icons.min.js +1 -1
  97. package/lib/components/Editor/tinymce/langs/README.md +1 -1
  98. package/lib/components/Editor/tinymce/license.txt +21 -504
  99. package/lib/components/Editor/tinymce/models/dom/model.js +8040 -0
  100. package/lib/components/Editor/tinymce/models/dom/model.min.js +4 -0
  101. package/lib/components/Editor/tinymce/plugins/accordion/plugin.js +1054 -0
  102. package/lib/components/Editor/tinymce/plugins/accordion/plugin.min.js +4 -0
  103. package/lib/components/Editor/tinymce/plugins/advlist/plugin.js +187 -208
  104. package/lib/components/Editor/tinymce/plugins/advlist/plugin.min.js +2 -7
  105. package/lib/components/Editor/tinymce/plugins/anchor/plugin.js +82 -84
  106. package/lib/components/Editor/tinymce/plugins/anchor/plugin.min.js +2 -7
  107. package/lib/components/Editor/tinymce/plugins/autolink/plugin.js +210 -167
  108. package/lib/components/Editor/tinymce/plugins/autolink/plugin.min.js +2 -7
  109. package/lib/components/Editor/tinymce/plugins/autoresize/plugin.js +118 -97
  110. package/lib/components/Editor/tinymce/plugins/autoresize/plugin.min.js +2 -7
  111. package/lib/components/Editor/tinymce/plugins/autosave/plugin.js +129 -108
  112. package/lib/components/Editor/tinymce/plugins/autosave/plugin.min.js +2 -7
  113. package/lib/components/Editor/tinymce/plugins/charmap/plugin.js +285 -333
  114. package/lib/components/Editor/tinymce/plugins/charmap/plugin.min.js +2 -7
  115. package/lib/components/Editor/tinymce/plugins/code/plugin.js +19 -26
  116. package/lib/components/Editor/tinymce/plugins/code/plugin.min.js +2 -7
  117. package/lib/components/Editor/tinymce/plugins/codesample/plugin.js +2225 -2094
  118. package/lib/components/Editor/tinymce/plugins/codesample/plugin.min.js +2 -7
  119. package/lib/components/Editor/tinymce/plugins/directionality/plugin.js +318 -243
  120. package/lib/components/Editor/tinymce/plugins/directionality/plugin.min.js +2 -7
  121. package/lib/components/Editor/tinymce/plugins/emoticons/js/emojiimages.js +1 -9424
  122. package/lib/components/Editor/tinymce/plugins/emoticons/js/emojiimages.min.js +1 -1
  123. package/lib/components/Editor/tinymce/plugins/emoticons/js/emojis.js +1 -9423
  124. package/lib/components/Editor/tinymce/plugins/emoticons/js/emojis.min.js +1 -1
  125. package/lib/components/Editor/tinymce/plugins/emoticons/plugin.js +406 -416
  126. package/lib/components/Editor/tinymce/plugins/emoticons/plugin.min.js +2 -7
  127. package/lib/components/Editor/tinymce/plugins/fullscreen/plugin.js +821 -604
  128. package/lib/components/Editor/tinymce/plugins/fullscreen/plugin.min.js +2 -7
  129. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ar.js +90 -0
  130. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/bg_BG.js +90 -0
  131. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ca.js +90 -0
  132. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/cs.js +90 -0
  133. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/da.js +90 -0
  134. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/de.js +90 -0
  135. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/el.js +90 -0
  136. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/en.js +90 -0
  137. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/es.js +90 -0
  138. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/eu.js +90 -0
  139. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/fa.js +90 -0
  140. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/fi.js +90 -0
  141. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/fr_FR.js +90 -0
  142. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/he_IL.js +90 -0
  143. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/hi.js +90 -0
  144. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/hr.js +90 -0
  145. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/hu_HU.js +90 -0
  146. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/id.js +90 -0
  147. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/it.js +90 -0
  148. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ja.js +90 -0
  149. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/kk.js +90 -0
  150. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ko_KR.js +90 -0
  151. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ms.js +90 -0
  152. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/nb_NO.js +90 -0
  153. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/nl.js +90 -0
  154. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/pl.js +90 -0
  155. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/pt_BR.js +90 -0
  156. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/pt_PT.js +90 -0
  157. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ro.js +90 -0
  158. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/ru.js +90 -0
  159. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/sk.js +90 -0
  160. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/sl_SI.js +90 -0
  161. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/sv_SE.js +90 -0
  162. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/th_TH.js +90 -0
  163. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/tr.js +90 -0
  164. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/uk.js +90 -0
  165. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/vi.js +90 -0
  166. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/zh_CN.js +84 -0
  167. package/lib/components/Editor/tinymce/plugins/help/js/i18n/keynav/zh_TW.js +90 -0
  168. package/lib/components/Editor/tinymce/plugins/help/plugin.js +428 -403
  169. package/lib/components/Editor/tinymce/plugins/help/plugin.min.js +2 -7
  170. package/lib/components/Editor/tinymce/plugins/image/plugin.js +887 -1043
  171. package/lib/components/Editor/tinymce/plugins/image/plugin.min.js +2 -7
  172. package/lib/components/Editor/tinymce/plugins/importcss/plugin.js +163 -162
  173. package/lib/components/Editor/tinymce/plugins/importcss/plugin.min.js +2 -7
  174. package/lib/components/Editor/tinymce/plugins/insertdatetime/plugin.js +101 -91
  175. package/lib/components/Editor/tinymce/plugins/insertdatetime/plugin.min.js +2 -7
  176. package/lib/components/Editor/tinymce/plugins/link/plugin.js +739 -784
  177. package/lib/components/Editor/tinymce/plugins/link/plugin.min.js +2 -7
  178. package/lib/components/Editor/tinymce/plugins/lists/plugin.js +1282 -1396
  179. package/lib/components/Editor/tinymce/plugins/lists/plugin.min.js +2 -7
  180. package/lib/components/Editor/tinymce/plugins/media/plugin.js +641 -806
  181. package/lib/components/Editor/tinymce/plugins/media/plugin.min.js +2 -7
  182. package/lib/components/Editor/tinymce/plugins/nonbreaking/plugin.js +76 -54
  183. package/lib/components/Editor/tinymce/plugins/nonbreaking/plugin.min.js +2 -7
  184. package/lib/components/Editor/tinymce/plugins/pagebreak/plugin.js +58 -46
  185. package/lib/components/Editor/tinymce/plugins/pagebreak/plugin.min.js +2 -7
  186. package/lib/components/Editor/tinymce/plugins/preview/plugin.js +39 -69
  187. package/lib/components/Editor/tinymce/plugins/preview/plugin.min.js +2 -7
  188. package/lib/components/Editor/tinymce/plugins/quickbars/plugin.js +307 -349
  189. package/lib/components/Editor/tinymce/plugins/quickbars/plugin.min.js +2 -7
  190. package/lib/components/Editor/tinymce/plugins/save/plugin.js +50 -51
  191. package/lib/components/Editor/tinymce/plugins/save/plugin.min.js +2 -7
  192. package/lib/components/Editor/tinymce/plugins/searchreplace/plugin.js +517 -587
  193. package/lib/components/Editor/tinymce/plugins/searchreplace/plugin.min.js +2 -7
  194. package/lib/components/Editor/tinymce/plugins/table/plugin.js +2666 -10142
  195. package/lib/components/Editor/tinymce/plugins/table/plugin.min.js +2 -7
  196. package/lib/components/Editor/tinymce/plugins/template/plugin.js +403 -413
  197. package/lib/components/Editor/tinymce/plugins/template/plugin.min.js +2 -7
  198. package/lib/components/Editor/tinymce/plugins/visualblocks/plugin.js +42 -48
  199. package/lib/components/Editor/tinymce/plugins/visualblocks/plugin.min.js +2 -7
  200. package/lib/components/Editor/tinymce/plugins/visualchars/plugin.js +352 -333
  201. package/lib/components/Editor/tinymce/plugins/visualchars/plugin.min.js +2 -7
  202. package/lib/components/Editor/tinymce/plugins/wordcount/plugin.js +184 -195
  203. package/lib/components/Editor/tinymce/plugins/wordcount/plugin.min.js +2 -7
  204. package/lib/components/Editor/tinymce/skins/content/dark/content.css +2 -8
  205. package/lib/components/Editor/tinymce/skins/content/dark/content.js +2 -0
  206. package/lib/components/Editor/tinymce/skins/content/dark/content.js.map +1 -0
  207. package/lib/components/Editor/tinymce/skins/content/dark/content.min.css +2 -8
  208. package/lib/components/Editor/tinymce/skins/content/dark/content.min.css.map +1 -1
  209. package/lib/components/Editor/tinymce/skins/content/default/content.css +0 -6
  210. package/lib/components/Editor/tinymce/skins/content/default/content.js +2 -0
  211. package/lib/components/Editor/tinymce/skins/content/default/content.js.map +1 -0
  212. package/lib/components/Editor/tinymce/skins/content/default/content.min.css +1 -7
  213. package/lib/components/Editor/tinymce/skins/content/default/content.min.css.map +1 -1
  214. package/lib/components/Editor/tinymce/skins/content/document/content.css +0 -6
  215. package/lib/components/Editor/tinymce/skins/content/document/content.js +2 -0
  216. package/lib/components/Editor/tinymce/skins/content/document/content.js.map +1 -0
  217. package/lib/components/Editor/tinymce/skins/content/document/content.min.css +0 -6
  218. package/lib/components/Editor/tinymce/skins/content/document/content.min.css.map +1 -1
  219. package/lib/components/Editor/{skins/content/default → tinymce/skins/content/tinymce-5}/content.css +0 -6
  220. package/lib/components/Editor/tinymce/skins/content/tinymce-5/content.js +2 -0
  221. package/lib/components/Editor/tinymce/skins/content/tinymce-5/content.js.map +1 -0
  222. package/lib/components/Editor/tinymce/skins/content/tinymce-5/content.min.css +2 -0
  223. package/lib/components/Editor/tinymce/skins/content/tinymce-5/content.min.css.map +1 -0
  224. package/lib/components/Editor/{skins/content/dark → tinymce/skins/content/tinymce-5-dark}/content.css +1 -7
  225. package/lib/components/Editor/tinymce/skins/content/tinymce-5-dark/content.js +2 -0
  226. package/lib/components/Editor/tinymce/skins/content/tinymce-5-dark/content.js.map +1 -0
  227. package/lib/components/Editor/tinymce/skins/content/tinymce-5-dark/content.min.css +2 -0
  228. package/lib/components/Editor/tinymce/skins/content/tinymce-5-dark/content.min.css.map +1 -0
  229. package/lib/components/Editor/tinymce/skins/content/writer/content.css +0 -6
  230. package/lib/components/Editor/tinymce/skins/content/writer/content.js +2 -0
  231. package/lib/components/Editor/tinymce/skins/content/writer/content.js.map +1 -0
  232. package/lib/components/Editor/tinymce/skins/content/writer/content.min.css +0 -6
  233. package/lib/components/Editor/tinymce/skins/content/writer/content.min.css.map +1 -1
  234. package/lib/components/Editor/tinymce/skins/ui/oxide/content.css +74 -21
  235. package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.css +74 -21
  236. package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.js +2 -0
  237. package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.js.map +1 -0
  238. package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.min.css +1 -7
  239. package/lib/components/Editor/tinymce/skins/ui/oxide/content.inline.min.css.map +1 -1
  240. package/lib/components/Editor/tinymce/skins/ui/oxide/content.js +2 -0
  241. package/lib/components/Editor/tinymce/skins/ui/oxide/content.js.map +1 -0
  242. package/lib/components/Editor/tinymce/skins/ui/oxide/content.min.css +1 -7
  243. package/lib/components/Editor/tinymce/skins/ui/oxide/content.min.css.map +1 -1
  244. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.css +1131 -402
  245. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.js +2 -0
  246. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.js.map +1 -0
  247. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.min.css +1 -7
  248. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.min.css.map +1 -1
  249. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.css +8 -15
  250. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.js +2 -0
  251. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.js.map +1 -0
  252. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.min.css +1 -7
  253. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.shadowdom.min.css.map +1 -1
  254. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.css +72 -20
  255. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.css +74 -21
  256. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.js +2 -0
  257. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.js.map +1 -0
  258. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.min.css +1 -7
  259. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.inline.min.css.map +1 -1
  260. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.js +2 -0
  261. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.js.map +1 -0
  262. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.min.css +1 -7
  263. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.min.css.map +1 -1
  264. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.css +1155 -423
  265. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.js +2 -0
  266. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.js.map +1 -0
  267. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.min.css +1 -7
  268. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.min.css.map +1 -1
  269. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +8 -15
  270. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.js +2 -0
  271. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.js.map +1 -0
  272. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -7
  273. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css.map +1 -1
  274. package/lib/components/Editor/{skins/ui/default → tinymce/skins/ui/tinymce-5}/content.css +75 -22
  275. package/lib/components/Editor/{skins/ui/default → tinymce/skins/ui/tinymce-5}/content.inline.css +75 -22
  276. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.inline.js +2 -0
  277. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.inline.js.map +1 -0
  278. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.inline.min.css +2 -0
  279. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.inline.min.css.map +1 -0
  280. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.js +2 -0
  281. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.js.map +1 -0
  282. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.min.css +2 -0
  283. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/content.min.css.map +1 -0
  284. package/lib/components/Editor/{skins/ui/default → tinymce/skins/ui/tinymce-5}/skin.css +1261 -438
  285. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.js +2 -0
  286. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.js.map +1 -0
  287. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.min.css +2 -0
  288. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.min.css.map +1 -0
  289. package/lib/components/Editor/{skins/ui/default → tinymce/skins/ui/tinymce-5}/skin.shadowdom.css +8 -15
  290. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.shadowdom.js +2 -0
  291. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.shadowdom.js.map +1 -0
  292. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css +2 -0
  293. package/lib/components/Editor/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css.map +1 -0
  294. package/lib/components/Editor/{skins/ui/dark → tinymce/skins/ui/tinymce-5-dark}/content.css +73 -21
  295. package/lib/components/Editor/{skins/ui/dark → tinymce/skins/ui/tinymce-5-dark}/content.inline.css +75 -22
  296. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.inline.js +2 -0
  297. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.inline.js.map +1 -0
  298. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +2 -0
  299. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css.map +1 -0
  300. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.js +2 -0
  301. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.js.map +1 -0
  302. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.min.css +2 -0
  303. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/content.min.css.map +1 -0
  304. package/lib/components/Editor/{skins/ui/dark → tinymce/skins/ui/tinymce-5-dark}/skin.css +1244 -421
  305. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.js +2 -0
  306. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.js.map +1 -0
  307. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.min.css +2 -0
  308. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.min.css.map +1 -0
  309. package/lib/components/Editor/{skins/ui/dark → tinymce/skins/ui/tinymce-5-dark}/skin.shadowdom.css +8 -15
  310. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.js +2 -0
  311. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.js.map +1 -0
  312. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css +2 -0
  313. package/lib/components/Editor/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css.map +1 -0
  314. package/lib/components/Editor/tinymce/themes/silver/theme.js +23228 -24955
  315. package/lib/components/Editor/tinymce/themes/silver/theme.min.js +2 -7
  316. package/lib/components/Editor/tinymce/tinymce.d.ts +1722 -1447
  317. package/lib/components/Editor/tinymce/tinymce.js +23668 -22018
  318. package/lib/components/Editor/tinymce/tinymce.min.js +2 -30104
  319. package/package.json +1 -1
  320. package/lib/components/Editor/skins/content/dark/content.min.css.map +0 -1
  321. package/lib/components/Editor/skins/content/default/content.min.css.map +0 -1
  322. package/lib/components/Editor/skins/content/document/content.css +0 -72
  323. package/lib/components/Editor/skins/content/document/content.min.css.map +0 -1
  324. package/lib/components/Editor/skins/content/writer/content.css +0 -68
  325. package/lib/components/Editor/skins/content/writer/content.min.css.map +0 -1
  326. package/lib/components/Editor/skins/ui/dark/content.inline.min.css +0 -8
  327. package/lib/components/Editor/skins/ui/dark/content.inline.min.css.map +0 -1
  328. package/lib/components/Editor/skins/ui/dark/content.min.css +0 -8
  329. package/lib/components/Editor/skins/ui/dark/content.min.css.map +0 -1
  330. package/lib/components/Editor/skins/ui/dark/content.mobile.css +0 -29
  331. package/lib/components/Editor/skins/ui/dark/content.mobile.min.css +0 -8
  332. package/lib/components/Editor/skins/ui/dark/content.mobile.min.css.map +0 -1
  333. package/lib/components/Editor/skins/ui/dark/fonts/tinymce-mobile.woff +0 -0
  334. package/lib/components/Editor/skins/ui/dark/skin.min.css +0 -8
  335. package/lib/components/Editor/skins/ui/dark/skin.min.css.map +0 -1
  336. package/lib/components/Editor/skins/ui/dark/skin.mobile.css +0 -673
  337. package/lib/components/Editor/skins/ui/dark/skin.mobile.min.css +0 -8
  338. package/lib/components/Editor/skins/ui/dark/skin.mobile.min.css.map +0 -1
  339. package/lib/components/Editor/skins/ui/dark/skin.shadowdom.min.css +0 -8
  340. package/lib/components/Editor/skins/ui/dark/skin.shadowdom.min.css.map +0 -1
  341. package/lib/components/Editor/skins/ui/default/content.inline.min.css +0 -8
  342. package/lib/components/Editor/skins/ui/default/content.inline.min.css.map +0 -1
  343. package/lib/components/Editor/skins/ui/default/content.min.css +0 -8
  344. package/lib/components/Editor/skins/ui/default/content.min.css.map +0 -1
  345. package/lib/components/Editor/skins/ui/default/content.mobile.css +0 -29
  346. package/lib/components/Editor/skins/ui/default/content.mobile.min.css +0 -8
  347. package/lib/components/Editor/skins/ui/default/content.mobile.min.css.map +0 -1
  348. package/lib/components/Editor/skins/ui/default/fonts/tinymce-mobile.woff +0 -0
  349. package/lib/components/Editor/skins/ui/default/skin.min.css +0 -8
  350. package/lib/components/Editor/skins/ui/default/skin.min.css.map +0 -1
  351. package/lib/components/Editor/skins/ui/default/skin.mobile.css +0 -673
  352. package/lib/components/Editor/skins/ui/default/skin.mobile.min.css +0 -8
  353. package/lib/components/Editor/skins/ui/default/skin.mobile.min.css.map +0 -1
  354. package/lib/components/Editor/skins/ui/default/skin.shadowdom.min.css +0 -8
  355. package/lib/components/Editor/skins/ui/default/skin.shadowdom.min.css.map +0 -1
  356. package/lib/components/Editor/skins/ui/plugin-tinycomments-tinymce4/fonts/tinymce-mobile.woff +0 -0
  357. package/lib/components/Editor/skins/ui/plugin-tinycomments-tinymce4/plugin-tinycomments-tinymce4.css +0 -1641
  358. package/lib/components/Editor/skins/ui/plugin-tinycomments-tinymce4/plugin-tinycomments-tinymce4.min.css +0 -8
  359. package/lib/components/Editor/skins/ui/plugin-tinycomments-tinymce4/plugin-tinycomments-tinymce4.min.css.map +0 -1
  360. package/lib/components/Editor/tinymce/jquery.tinymce.min.js +0 -92
  361. package/lib/components/Editor/tinymce/langs/pt_BR.js +0 -419
  362. package/lib/components/Editor/tinymce/plugins/bbcode/plugin.js +0 -99
  363. package/lib/components/Editor/tinymce/plugins/bbcode/plugin.min.js +0 -9
  364. package/lib/components/Editor/tinymce/plugins/colorpicker/plugin.js +0 -22
  365. package/lib/components/Editor/tinymce/plugins/colorpicker/plugin.min.js +0 -9
  366. package/lib/components/Editor/tinymce/plugins/contextmenu/plugin.js +0 -22
  367. package/lib/components/Editor/tinymce/plugins/contextmenu/plugin.min.js +0 -9
  368. package/lib/components/Editor/tinymce/plugins/fullpage/plugin.js +0 -544
  369. package/lib/components/Editor/tinymce/plugins/fullpage/plugin.min.js +0 -9
  370. package/lib/components/Editor/tinymce/plugins/hr/plugin.js +0 -46
  371. package/lib/components/Editor/tinymce/plugins/hr/plugin.min.js +0 -9
  372. package/lib/components/Editor/tinymce/plugins/imagetools/plugin.js +0 -1354
  373. package/lib/components/Editor/tinymce/plugins/imagetools/plugin.min.js +0 -9
  374. package/lib/components/Editor/tinymce/plugins/legacyoutput/plugin.js +0 -199
  375. package/lib/components/Editor/tinymce/plugins/legacyoutput/plugin.min.js +0 -9
  376. package/lib/components/Editor/tinymce/plugins/noneditable/plugin.js +0 -117
  377. package/lib/components/Editor/tinymce/plugins/noneditable/plugin.min.js +0 -9
  378. package/lib/components/Editor/tinymce/plugins/paste/plugin.js +0 -1764
  379. package/lib/components/Editor/tinymce/plugins/paste/plugin.min.js +0 -9
  380. package/lib/components/Editor/tinymce/plugins/print/plugin.js +0 -53
  381. package/lib/components/Editor/tinymce/plugins/print/plugin.min.js +0 -9
  382. package/lib/components/Editor/tinymce/plugins/spellchecker/plugin.js +0 -731
  383. package/lib/components/Editor/tinymce/plugins/spellchecker/plugin.min.js +0 -9
  384. package/lib/components/Editor/tinymce/plugins/tabfocus/plugin.js +0 -129
  385. package/lib/components/Editor/tinymce/plugins/tabfocus/plugin.min.js +0 -9
  386. package/lib/components/Editor/tinymce/plugins/textcolor/plugin.js +0 -22
  387. package/lib/components/Editor/tinymce/plugins/textcolor/plugin.min.js +0 -9
  388. package/lib/components/Editor/tinymce/plugins/textpattern/plugin.js +0 -1394
  389. package/lib/components/Editor/tinymce/plugins/textpattern/plugin.min.js +0 -9
  390. package/lib/components/Editor/tinymce/plugins/toc/plugin.js +0 -236
  391. package/lib/components/Editor/tinymce/plugins/toc/plugin.min.js +0 -9
  392. package/lib/components/Editor/tinymce/skins/ui/oxide/content.mobile.css +0 -29
  393. package/lib/components/Editor/tinymce/skins/ui/oxide/content.mobile.min.css +0 -8
  394. package/lib/components/Editor/tinymce/skins/ui/oxide/content.mobile.min.css.map +0 -1
  395. package/lib/components/Editor/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
  396. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.mobile.css +0 -673
  397. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.mobile.min.css +0 -8
  398. package/lib/components/Editor/tinymce/skins/ui/oxide/skin.mobile.min.css.map +0 -1
  399. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.mobile.css +0 -29
  400. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.mobile.min.css +0 -8
  401. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/content.mobile.min.css.map +0 -1
  402. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
  403. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.mobile.css +0 -673
  404. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +0 -8
  405. package/lib/components/Editor/tinymce/skins/ui/oxide-dark/skin.mobile.min.css.map +0 -1
  406. package/lib/components/Editor/tinymce/themes/mobile/theme.js +0 -13587
  407. package/lib/components/Editor/tinymce/themes/mobile/theme.min.js +0 -9
@@ -1,1394 +0,0 @@
1
- /**
2
- * Copyright (c) Tiny Technologies, Inc. All rights reserved.
3
- * Licensed under the LGPL or a commercial license.
4
- * For LGPL see License.txt in the project root for license information.
5
- * For commercial licenses see https://www.tiny.cloud/
6
- *
7
- * Version: 5.9.0 (TBD)
8
- */
9
- (function () {
10
- 'use strict';
11
-
12
- var Cell = function (initial) {
13
- var value = initial;
14
- var get = function () {
15
- return value;
16
- };
17
- var set = function (v) {
18
- value = v;
19
- };
20
- return {
21
- get: get,
22
- set: set
23
- };
24
- };
25
-
26
- var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
27
-
28
- var __assign = function () {
29
- __assign = Object.assign || function __assign(t) {
30
- for (var s, i = 1, n = arguments.length; i < n; i++) {
31
- s = arguments[i];
32
- for (var p in s)
33
- if (Object.prototype.hasOwnProperty.call(s, p))
34
- t[p] = s[p];
35
- }
36
- return t;
37
- };
38
- return __assign.apply(this, arguments);
39
- };
40
- function __spreadArrays() {
41
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
42
- s += arguments[i].length;
43
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
44
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
45
- r[k] = a[j];
46
- return r;
47
- }
48
-
49
- var typeOf = function (x) {
50
- var t = typeof x;
51
- if (x === null) {
52
- return 'null';
53
- } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
54
- return 'array';
55
- } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
56
- return 'string';
57
- } else {
58
- return t;
59
- }
60
- };
61
- var isType = function (type) {
62
- return function (value) {
63
- return typeOf(value) === type;
64
- };
65
- };
66
- var isString = isType('string');
67
- var isObject = isType('object');
68
- var isArray = isType('array');
69
-
70
- var noop = function () {
71
- };
72
- var constant = function (value) {
73
- return function () {
74
- return value;
75
- };
76
- };
77
- var identity = function (x) {
78
- return x;
79
- };
80
- var die = function (msg) {
81
- return function () {
82
- throw new Error(msg);
83
- };
84
- };
85
- var never = constant(false);
86
- var always = constant(true);
87
-
88
- var none = function () {
89
- return NONE;
90
- };
91
- var NONE = function () {
92
- var eq = function (o) {
93
- return o.isNone();
94
- };
95
- var call = function (thunk) {
96
- return thunk();
97
- };
98
- var id = function (n) {
99
- return n;
100
- };
101
- var me = {
102
- fold: function (n, _s) {
103
- return n();
104
- },
105
- is: never,
106
- isSome: never,
107
- isNone: always,
108
- getOr: id,
109
- getOrThunk: call,
110
- getOrDie: function (msg) {
111
- throw new Error(msg || 'error: getOrDie called on none.');
112
- },
113
- getOrNull: constant(null),
114
- getOrUndefined: constant(undefined),
115
- or: id,
116
- orThunk: call,
117
- map: none,
118
- each: noop,
119
- bind: none,
120
- exists: never,
121
- forall: always,
122
- filter: none,
123
- equals: eq,
124
- equals_: eq,
125
- toArray: function () {
126
- return [];
127
- },
128
- toString: constant('none()')
129
- };
130
- return me;
131
- }();
132
- var some = function (a) {
133
- var constant_a = constant(a);
134
- var self = function () {
135
- return me;
136
- };
137
- var bind = function (f) {
138
- return f(a);
139
- };
140
- var me = {
141
- fold: function (n, s) {
142
- return s(a);
143
- },
144
- is: function (v) {
145
- return a === v;
146
- },
147
- isSome: always,
148
- isNone: never,
149
- getOr: constant_a,
150
- getOrThunk: constant_a,
151
- getOrDie: constant_a,
152
- getOrNull: constant_a,
153
- getOrUndefined: constant_a,
154
- or: self,
155
- orThunk: self,
156
- map: function (f) {
157
- return some(f(a));
158
- },
159
- each: function (f) {
160
- f(a);
161
- },
162
- bind: bind,
163
- exists: bind,
164
- forall: bind,
165
- filter: function (f) {
166
- return f(a) ? me : NONE;
167
- },
168
- toArray: function () {
169
- return [a];
170
- },
171
- toString: function () {
172
- return 'some(' + a + ')';
173
- },
174
- equals: function (o) {
175
- return o.is(a);
176
- },
177
- equals_: function (o, elementEq) {
178
- return o.fold(never, function (b) {
179
- return elementEq(a, b);
180
- });
181
- }
182
- };
183
- return me;
184
- };
185
- var from = function (value) {
186
- return value === null || value === undefined ? NONE : some(value);
187
- };
188
- var Optional = {
189
- some: some,
190
- none: none,
191
- from: from
192
- };
193
-
194
- var nativeSlice = Array.prototype.slice;
195
- var nativeIndexOf = Array.prototype.indexOf;
196
- var rawIndexOf = function (ts, t) {
197
- return nativeIndexOf.call(ts, t);
198
- };
199
- var contains = function (xs, x) {
200
- return rawIndexOf(xs, x) > -1;
201
- };
202
- var map = function (xs, f) {
203
- var len = xs.length;
204
- var r = new Array(len);
205
- for (var i = 0; i < len; i++) {
206
- var x = xs[i];
207
- r[i] = f(x, i);
208
- }
209
- return r;
210
- };
211
- var each = function (xs, f) {
212
- for (var i = 0, len = xs.length; i < len; i++) {
213
- var x = xs[i];
214
- f(x, i);
215
- }
216
- };
217
- var eachr = function (xs, f) {
218
- for (var i = xs.length - 1; i >= 0; i--) {
219
- var x = xs[i];
220
- f(x, i);
221
- }
222
- };
223
- var filter = function (xs, pred) {
224
- var r = [];
225
- for (var i = 0, len = xs.length; i < len; i++) {
226
- var x = xs[i];
227
- if (pred(x, i)) {
228
- r.push(x);
229
- }
230
- }
231
- return r;
232
- };
233
- var foldr = function (xs, f, acc) {
234
- eachr(xs, function (x) {
235
- acc = f(acc, x);
236
- });
237
- return acc;
238
- };
239
- var foldl = function (xs, f, acc) {
240
- each(xs, function (x) {
241
- acc = f(acc, x);
242
- });
243
- return acc;
244
- };
245
- var findUntil = function (xs, pred, until) {
246
- for (var i = 0, len = xs.length; i < len; i++) {
247
- var x = xs[i];
248
- if (pred(x, i)) {
249
- return Optional.some(x);
250
- } else if (until(x, i)) {
251
- break;
252
- }
253
- }
254
- return Optional.none();
255
- };
256
- var find = function (xs, pred) {
257
- return findUntil(xs, pred, never);
258
- };
259
- var forall = function (xs, pred) {
260
- for (var i = 0, len = xs.length; i < len; ++i) {
261
- var x = xs[i];
262
- if (pred(x, i) !== true) {
263
- return false;
264
- }
265
- }
266
- return true;
267
- };
268
- var sort = function (xs, comparator) {
269
- var copy = nativeSlice.call(xs, 0);
270
- copy.sort(comparator);
271
- return copy;
272
- };
273
- var get = function (xs, i) {
274
- return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none();
275
- };
276
- var head = function (xs) {
277
- return get(xs, 0);
278
- };
279
-
280
- var keys = Object.keys;
281
- var hasOwnProperty = Object.hasOwnProperty;
282
- var has = function (obj, key) {
283
- return hasOwnProperty.call(obj, key);
284
- };
285
-
286
- var generate = function (cases) {
287
- if (!isArray(cases)) {
288
- throw new Error('cases must be an array');
289
- }
290
- if (cases.length === 0) {
291
- throw new Error('there must be at least one case');
292
- }
293
- var constructors = [];
294
- var adt = {};
295
- each(cases, function (acase, count) {
296
- var keys$1 = keys(acase);
297
- if (keys$1.length !== 1) {
298
- throw new Error('one and only one name per case');
299
- }
300
- var key = keys$1[0];
301
- var value = acase[key];
302
- if (adt[key] !== undefined) {
303
- throw new Error('duplicate key detected:' + key);
304
- } else if (key === 'cata') {
305
- throw new Error('cannot have a case named cata (sorry)');
306
- } else if (!isArray(value)) {
307
- throw new Error('case arguments must be an array');
308
- }
309
- constructors.push(key);
310
- adt[key] = function () {
311
- var args = [];
312
- for (var _i = 0; _i < arguments.length; _i++) {
313
- args[_i] = arguments[_i];
314
- }
315
- var argLength = args.length;
316
- if (argLength !== value.length) {
317
- throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength);
318
- }
319
- var match = function (branches) {
320
- var branchKeys = keys(branches);
321
- if (constructors.length !== branchKeys.length) {
322
- throw new Error('Wrong number of arguments to match. Expected: ' + constructors.join(',') + '\nActual: ' + branchKeys.join(','));
323
- }
324
- var allReqd = forall(constructors, function (reqKey) {
325
- return contains(branchKeys, reqKey);
326
- });
327
- if (!allReqd) {
328
- throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\nRequired: ' + constructors.join(', '));
329
- }
330
- return branches[key].apply(null, args);
331
- };
332
- return {
333
- fold: function () {
334
- var foldArgs = [];
335
- for (var _i = 0; _i < arguments.length; _i++) {
336
- foldArgs[_i] = arguments[_i];
337
- }
338
- if (foldArgs.length !== cases.length) {
339
- throw new Error('Wrong number of arguments to fold. Expected ' + cases.length + ', got ' + foldArgs.length);
340
- }
341
- var target = foldArgs[count];
342
- return target.apply(null, args);
343
- },
344
- match: match,
345
- log: function (label) {
346
- console.log(label, {
347
- constructors: constructors,
348
- constructor: key,
349
- params: args
350
- });
351
- }
352
- };
353
- };
354
- });
355
- return adt;
356
- };
357
- var Adt = { generate: generate };
358
-
359
- var comparison = Adt.generate([
360
- {
361
- bothErrors: [
362
- 'error1',
363
- 'error2'
364
- ]
365
- },
366
- {
367
- firstError: [
368
- 'error1',
369
- 'value2'
370
- ]
371
- },
372
- {
373
- secondError: [
374
- 'value1',
375
- 'error2'
376
- ]
377
- },
378
- {
379
- bothValues: [
380
- 'value1',
381
- 'value2'
382
- ]
383
- }
384
- ]);
385
- var partition = function (results) {
386
- var errors = [];
387
- var values = [];
388
- each(results, function (result) {
389
- result.fold(function (err) {
390
- errors.push(err);
391
- }, function (value) {
392
- values.push(value);
393
- });
394
- });
395
- return {
396
- errors: errors,
397
- values: values
398
- };
399
- };
400
-
401
- var value = function (o) {
402
- var is = function (v) {
403
- return o === v;
404
- };
405
- var or = function (_opt) {
406
- return value(o);
407
- };
408
- var orThunk = function (_f) {
409
- return value(o);
410
- };
411
- var map = function (f) {
412
- return value(f(o));
413
- };
414
- var mapError = function (_f) {
415
- return value(o);
416
- };
417
- var each = function (f) {
418
- f(o);
419
- };
420
- var bind = function (f) {
421
- return f(o);
422
- };
423
- var fold = function (_, onValue) {
424
- return onValue(o);
425
- };
426
- var exists = function (f) {
427
- return f(o);
428
- };
429
- var forall = function (f) {
430
- return f(o);
431
- };
432
- var toOptional = function () {
433
- return Optional.some(o);
434
- };
435
- return {
436
- is: is,
437
- isValue: always,
438
- isError: never,
439
- getOr: constant(o),
440
- getOrThunk: constant(o),
441
- getOrDie: constant(o),
442
- or: or,
443
- orThunk: orThunk,
444
- fold: fold,
445
- map: map,
446
- mapError: mapError,
447
- each: each,
448
- bind: bind,
449
- exists: exists,
450
- forall: forall,
451
- toOptional: toOptional
452
- };
453
- };
454
- var error = function (message) {
455
- var getOrThunk = function (f) {
456
- return f();
457
- };
458
- var getOrDie = function () {
459
- return die(String(message))();
460
- };
461
- var or = function (opt) {
462
- return opt;
463
- };
464
- var orThunk = function (f) {
465
- return f();
466
- };
467
- var map = function (_f) {
468
- return error(message);
469
- };
470
- var mapError = function (f) {
471
- return error(f(message));
472
- };
473
- var bind = function (_f) {
474
- return error(message);
475
- };
476
- var fold = function (onError, _) {
477
- return onError(message);
478
- };
479
- return {
480
- is: never,
481
- isValue: never,
482
- isError: always,
483
- getOr: identity,
484
- getOrThunk: getOrThunk,
485
- getOrDie: getOrDie,
486
- or: or,
487
- orThunk: orThunk,
488
- fold: fold,
489
- map: map,
490
- mapError: mapError,
491
- each: noop,
492
- bind: bind,
493
- exists: never,
494
- forall: always,
495
- toOptional: Optional.none
496
- };
497
- };
498
- var fromOption = function (opt, err) {
499
- return opt.fold(function () {
500
- return error(err);
501
- }, value);
502
- };
503
- var Result = {
504
- value: value,
505
- error: error,
506
- fromOption: fromOption
507
- };
508
-
509
- var isInlinePattern = function (pattern) {
510
- return pattern.type === 'inline-command' || pattern.type === 'inline-format';
511
- };
512
- var isBlockPattern = function (pattern) {
513
- return pattern.type === 'block-command' || pattern.type === 'block-format';
514
- };
515
- var sortPatterns = function (patterns) {
516
- return sort(patterns, function (a, b) {
517
- if (a.start.length === b.start.length) {
518
- return 0;
519
- }
520
- return a.start.length > b.start.length ? -1 : 1;
521
- });
522
- };
523
- var normalizePattern = function (pattern) {
524
- var err = function (message) {
525
- return Result.error({
526
- message: message,
527
- pattern: pattern
528
- });
529
- };
530
- var formatOrCmd = function (name, onFormat, onCommand) {
531
- if (pattern.format !== undefined) {
532
- var formats = void 0;
533
- if (isArray(pattern.format)) {
534
- if (!forall(pattern.format, isString)) {
535
- return err(name + ' pattern has non-string items in the `format` array');
536
- }
537
- formats = pattern.format;
538
- } else if (isString(pattern.format)) {
539
- formats = [pattern.format];
540
- } else {
541
- return err(name + ' pattern has non-string `format` parameter');
542
- }
543
- return Result.value(onFormat(formats));
544
- } else if (pattern.cmd !== undefined) {
545
- if (!isString(pattern.cmd)) {
546
- return err(name + ' pattern has non-string `cmd` parameter');
547
- }
548
- return Result.value(onCommand(pattern.cmd, pattern.value));
549
- } else {
550
- return err(name + ' pattern is missing both `format` and `cmd` parameters');
551
- }
552
- };
553
- if (!isObject(pattern)) {
554
- return err('Raw pattern is not an object');
555
- }
556
- if (!isString(pattern.start)) {
557
- return err('Raw pattern is missing `start` parameter');
558
- }
559
- if (pattern.end !== undefined) {
560
- if (!isString(pattern.end)) {
561
- return err('Inline pattern has non-string `end` parameter');
562
- }
563
- if (pattern.start.length === 0 && pattern.end.length === 0) {
564
- return err('Inline pattern has empty `start` and `end` parameters');
565
- }
566
- var start_1 = pattern.start;
567
- var end_1 = pattern.end;
568
- if (end_1.length === 0) {
569
- end_1 = start_1;
570
- start_1 = '';
571
- }
572
- return formatOrCmd('Inline', function (format) {
573
- return {
574
- type: 'inline-format',
575
- start: start_1,
576
- end: end_1,
577
- format: format
578
- };
579
- }, function (cmd, value) {
580
- return {
581
- type: 'inline-command',
582
- start: start_1,
583
- end: end_1,
584
- cmd: cmd,
585
- value: value
586
- };
587
- });
588
- } else if (pattern.replacement !== undefined) {
589
- if (!isString(pattern.replacement)) {
590
- return err('Replacement pattern has non-string `replacement` parameter');
591
- }
592
- if (pattern.start.length === 0) {
593
- return err('Replacement pattern has empty `start` parameter');
594
- }
595
- return Result.value({
596
- type: 'inline-command',
597
- start: '',
598
- end: pattern.start,
599
- cmd: 'mceInsertContent',
600
- value: pattern.replacement
601
- });
602
- } else {
603
- if (pattern.start.length === 0) {
604
- return err('Block pattern has empty `start` parameter');
605
- }
606
- return formatOrCmd('Block', function (formats) {
607
- return {
608
- type: 'block-format',
609
- start: pattern.start,
610
- format: formats[0]
611
- };
612
- }, function (command, commandValue) {
613
- return {
614
- type: 'block-command',
615
- start: pattern.start,
616
- cmd: command,
617
- value: commandValue
618
- };
619
- });
620
- }
621
- };
622
- var denormalizePattern = function (pattern) {
623
- if (pattern.type === 'block-command') {
624
- return {
625
- start: pattern.start,
626
- cmd: pattern.cmd,
627
- value: pattern.value
628
- };
629
- } else if (pattern.type === 'block-format') {
630
- return {
631
- start: pattern.start,
632
- format: pattern.format
633
- };
634
- } else if (pattern.type === 'inline-command') {
635
- if (pattern.cmd === 'mceInsertContent' && pattern.start === '') {
636
- return {
637
- start: pattern.end,
638
- replacement: pattern.value
639
- };
640
- } else {
641
- return {
642
- start: pattern.start,
643
- end: pattern.end,
644
- cmd: pattern.cmd,
645
- value: pattern.value
646
- };
647
- }
648
- } else if (pattern.type === 'inline-format') {
649
- return {
650
- start: pattern.start,
651
- end: pattern.end,
652
- format: pattern.format.length === 1 ? pattern.format[0] : pattern.format
653
- };
654
- }
655
- };
656
- var createPatternSet = function (patterns) {
657
- return {
658
- inlinePatterns: filter(patterns, isInlinePattern),
659
- blockPatterns: sortPatterns(filter(patterns, isBlockPattern))
660
- };
661
- };
662
-
663
- var get$1 = function (patternsState) {
664
- var setPatterns = function (newPatterns) {
665
- var normalized = partition(map(newPatterns, normalizePattern));
666
- if (normalized.errors.length > 0) {
667
- var firstError = normalized.errors[0];
668
- throw new Error(firstError.message + ':\n' + JSON.stringify(firstError.pattern, null, 2));
669
- }
670
- patternsState.set(createPatternSet(normalized.values));
671
- };
672
- var getPatterns = function () {
673
- return __spreadArrays(map(patternsState.get().inlinePatterns, denormalizePattern), map(patternsState.get().blockPatterns, denormalizePattern));
674
- };
675
- return {
676
- setPatterns: setPatterns,
677
- getPatterns: getPatterns
678
- };
679
- };
680
-
681
- var Global = typeof window !== 'undefined' ? window : Function('return this;')();
682
-
683
- var error$1 = function () {
684
- var args = [];
685
- for (var _i = 0; _i < arguments.length; _i++) {
686
- args[_i] = arguments[_i];
687
- }
688
- var console = Global.console;
689
- if (console) {
690
- if (console.error) {
691
- console.error.apply(console, args);
692
- } else {
693
- console.log.apply(console, args);
694
- }
695
- }
696
- };
697
- var defaultPatterns = [
698
- {
699
- start: '*',
700
- end: '*',
701
- format: 'italic'
702
- },
703
- {
704
- start: '**',
705
- end: '**',
706
- format: 'bold'
707
- },
708
- {
709
- start: '#',
710
- format: 'h1'
711
- },
712
- {
713
- start: '##',
714
- format: 'h2'
715
- },
716
- {
717
- start: '###',
718
- format: 'h3'
719
- },
720
- {
721
- start: '####',
722
- format: 'h4'
723
- },
724
- {
725
- start: '#####',
726
- format: 'h5'
727
- },
728
- {
729
- start: '######',
730
- format: 'h6'
731
- },
732
- {
733
- start: '1. ',
734
- cmd: 'InsertOrderedList'
735
- },
736
- {
737
- start: '* ',
738
- cmd: 'InsertUnorderedList'
739
- },
740
- {
741
- start: '- ',
742
- cmd: 'InsertUnorderedList'
743
- }
744
- ];
745
- var getPatternSet = function (editor) {
746
- var patterns = editor.getParam('textpattern_patterns', defaultPatterns, 'array');
747
- if (!isArray(patterns)) {
748
- error$1('The setting textpattern_patterns should be an array');
749
- return {
750
- inlinePatterns: [],
751
- blockPatterns: []
752
- };
753
- }
754
- var normalized = partition(map(patterns, normalizePattern));
755
- each(normalized.errors, function (err) {
756
- return error$1(err.message, err.pattern);
757
- });
758
- return createPatternSet(normalized.values);
759
- };
760
- var getForcedRootBlock = function (editor) {
761
- var block = editor.getParam('forced_root_block', 'p');
762
- if (block === false) {
763
- return '';
764
- } else if (block === true) {
765
- return 'p';
766
- } else {
767
- return block;
768
- }
769
- };
770
-
771
- var global$1 = tinymce.util.Tools.resolve('tinymce.util.Delay');
772
-
773
- var global$2 = tinymce.util.Tools.resolve('tinymce.util.VK');
774
-
775
- var zeroWidth = '\uFEFF';
776
- var nbsp = '\xA0';
777
-
778
- var global$3 = tinymce.util.Tools.resolve('tinymce.util.Tools');
779
-
780
- var global$4 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
781
-
782
- var global$5 = tinymce.util.Tools.resolve('tinymce.dom.TextSeeker');
783
-
784
- var point = function (container, offset) {
785
- return {
786
- container: container,
787
- offset: offset
788
- };
789
- };
790
-
791
- var isText = function (node) {
792
- return node.nodeType === Node.TEXT_NODE;
793
- };
794
- var cleanEmptyNodes = function (dom, node, isRoot) {
795
- if (node && dom.isEmpty(node) && !isRoot(node)) {
796
- var parent_1 = node.parentNode;
797
- dom.remove(node);
798
- cleanEmptyNodes(dom, parent_1, isRoot);
799
- }
800
- };
801
- var deleteRng = function (dom, rng, isRoot, clean) {
802
- if (clean === void 0) {
803
- clean = true;
804
- }
805
- var startParent = rng.startContainer.parentNode;
806
- var endParent = rng.endContainer.parentNode;
807
- rng.deleteContents();
808
- if (clean && !isRoot(rng.startContainer)) {
809
- if (isText(rng.startContainer) && rng.startContainer.data.length === 0) {
810
- dom.remove(rng.startContainer);
811
- }
812
- if (isText(rng.endContainer) && rng.endContainer.data.length === 0) {
813
- dom.remove(rng.endContainer);
814
- }
815
- cleanEmptyNodes(dom, startParent, isRoot);
816
- if (startParent !== endParent) {
817
- cleanEmptyNodes(dom, endParent, isRoot);
818
- }
819
- }
820
- };
821
- var isBlockFormatName = function (name, formatter) {
822
- var formatSet = formatter.get(name);
823
- return isArray(formatSet) && head(formatSet).exists(function (format) {
824
- return has(format, 'block');
825
- });
826
- };
827
- var isReplacementPattern = function (pattern) {
828
- return pattern.start.length === 0;
829
- };
830
- var getParentBlock = function (editor, rng) {
831
- var parentBlockOpt = Optional.from(editor.dom.getParent(rng.startContainer, editor.dom.isBlock));
832
- if (getForcedRootBlock(editor) === '') {
833
- return parentBlockOpt.orThunk(function () {
834
- return Optional.some(editor.getBody());
835
- });
836
- } else {
837
- return parentBlockOpt;
838
- }
839
- };
840
-
841
- var DOM = global$4.DOM;
842
- var alwaysNext = function (startNode) {
843
- return function (node) {
844
- return startNode === node ? -1 : 0;
845
- };
846
- };
847
- var isBoundary = function (dom) {
848
- return function (node) {
849
- return dom.isBlock(node) || contains([
850
- 'BR',
851
- 'IMG',
852
- 'HR',
853
- 'INPUT'
854
- ], node.nodeName) || dom.getContentEditable(node) === 'false';
855
- };
856
- };
857
- var textBefore = function (node, offset, rootNode) {
858
- if (isText(node) && offset >= 0) {
859
- return Optional.some(point(node, offset));
860
- } else {
861
- var textSeeker = global$5(DOM);
862
- return Optional.from(textSeeker.backwards(node, offset, alwaysNext(node), rootNode)).map(function (prev) {
863
- return point(prev.container, prev.container.data.length);
864
- });
865
- }
866
- };
867
- var textAfter = function (node, offset, rootNode) {
868
- if (isText(node) && offset >= node.length) {
869
- return Optional.some(point(node, offset));
870
- } else {
871
- var textSeeker = global$5(DOM);
872
- return Optional.from(textSeeker.forwards(node, offset, alwaysNext(node), rootNode)).map(function (prev) {
873
- return point(prev.container, 0);
874
- });
875
- }
876
- };
877
- var scanLeft = function (node, offset, rootNode) {
878
- if (!isText(node)) {
879
- return Optional.none();
880
- }
881
- var text = node.textContent;
882
- if (offset >= 0 && offset <= text.length) {
883
- return Optional.some(point(node, offset));
884
- } else {
885
- var textSeeker = global$5(DOM);
886
- return Optional.from(textSeeker.backwards(node, offset, alwaysNext(node), rootNode)).bind(function (prev) {
887
- var prevText = prev.container.data;
888
- return scanLeft(prev.container, offset + prevText.length, rootNode);
889
- });
890
- }
891
- };
892
- var scanRight = function (node, offset, rootNode) {
893
- if (!isText(node)) {
894
- return Optional.none();
895
- }
896
- var text = node.textContent;
897
- if (offset <= text.length) {
898
- return Optional.some(point(node, offset));
899
- } else {
900
- var textSeeker = global$5(DOM);
901
- return Optional.from(textSeeker.forwards(node, offset, alwaysNext(node), rootNode)).bind(function (next) {
902
- return scanRight(next.container, offset - text.length, rootNode);
903
- });
904
- }
905
- };
906
- var repeatLeft = function (dom, node, offset, process, rootNode) {
907
- var search = global$5(dom, isBoundary(dom));
908
- return Optional.from(search.backwards(node, offset, process, rootNode));
909
- };
910
-
911
- var generatePath = function (root, node, offset) {
912
- if (isText(node) && (offset < 0 || offset > node.data.length)) {
913
- return [];
914
- }
915
- var p = [offset];
916
- var current = node;
917
- while (current !== root && current.parentNode) {
918
- var parent_1 = current.parentNode;
919
- for (var i = 0; i < parent_1.childNodes.length; i++) {
920
- if (parent_1.childNodes[i] === current) {
921
- p.push(i);
922
- break;
923
- }
924
- }
925
- current = parent_1;
926
- }
927
- return current === root ? p.reverse() : [];
928
- };
929
- var generatePathRange = function (root, startNode, startOffset, endNode, endOffset) {
930
- var start = generatePath(root, startNode, startOffset);
931
- var end = generatePath(root, endNode, endOffset);
932
- return {
933
- start: start,
934
- end: end
935
- };
936
- };
937
- var resolvePath = function (root, path) {
938
- var nodePath = path.slice();
939
- var offset = nodePath.pop();
940
- var resolvedNode = foldl(nodePath, function (optNode, index) {
941
- return optNode.bind(function (node) {
942
- return Optional.from(node.childNodes[index]);
943
- });
944
- }, Optional.some(root));
945
- return resolvedNode.bind(function (node) {
946
- if (isText(node) && (offset < 0 || offset > node.data.length)) {
947
- return Optional.none();
948
- } else {
949
- return Optional.some({
950
- node: node,
951
- offset: offset
952
- });
953
- }
954
- });
955
- };
956
- var resolvePathRange = function (root, range) {
957
- return resolvePath(root, range.start).bind(function (_a) {
958
- var startNode = _a.node, startOffset = _a.offset;
959
- return resolvePath(root, range.end).map(function (_a) {
960
- var endNode = _a.node, endOffset = _a.offset;
961
- var rng = document.createRange();
962
- rng.setStart(startNode, startOffset);
963
- rng.setEnd(endNode, endOffset);
964
- return rng;
965
- });
966
- });
967
- };
968
- var generatePathRangeFromRange = function (root, range) {
969
- return generatePathRange(root, range.startContainer, range.startOffset, range.endContainer, range.endOffset);
970
- };
971
-
972
- var stripPattern = function (dom, block, pattern) {
973
- var firstTextNode = textAfter(block, 0, block);
974
- firstTextNode.each(function (spot) {
975
- var node = spot.container;
976
- scanRight(node, pattern.start.length, block).each(function (end) {
977
- var rng = dom.createRng();
978
- rng.setStart(node, 0);
979
- rng.setEnd(end.container, end.offset);
980
- deleteRng(dom, rng, function (e) {
981
- return e === block;
982
- });
983
- });
984
- });
985
- };
986
- var applyPattern = function (editor, match) {
987
- var dom = editor.dom;
988
- var pattern = match.pattern;
989
- var rng = resolvePathRange(dom.getRoot(), match.range).getOrDie('Unable to resolve path range');
990
- getParentBlock(editor, rng).each(function (block) {
991
- if (pattern.type === 'block-format') {
992
- if (isBlockFormatName(pattern.format, editor.formatter)) {
993
- editor.undoManager.transact(function () {
994
- stripPattern(editor.dom, block, pattern);
995
- editor.formatter.apply(pattern.format);
996
- });
997
- }
998
- } else if (pattern.type === 'block-command') {
999
- editor.undoManager.transact(function () {
1000
- stripPattern(editor.dom, block, pattern);
1001
- editor.execCommand(pattern.cmd, false, pattern.value);
1002
- });
1003
- }
1004
- });
1005
- return true;
1006
- };
1007
- var findPattern = function (patterns, text) {
1008
- var nuText = text.replace(nbsp, ' ');
1009
- return find(patterns, function (pattern) {
1010
- return text.indexOf(pattern.start) === 0 || nuText.indexOf(pattern.start) === 0;
1011
- });
1012
- };
1013
- var findPatterns = function (editor, patterns) {
1014
- var dom = editor.dom;
1015
- var rng = editor.selection.getRng();
1016
- return getParentBlock(editor, rng).filter(function (block) {
1017
- var forcedRootBlock = getForcedRootBlock(editor);
1018
- var matchesForcedRootBlock = forcedRootBlock === '' && dom.is(block, 'body') || dom.is(block, forcedRootBlock);
1019
- return block !== null && matchesForcedRootBlock;
1020
- }).bind(function (block) {
1021
- var blockText = block.textContent;
1022
- var matchedPattern = findPattern(patterns, blockText);
1023
- return matchedPattern.map(function (pattern) {
1024
- if (global$3.trim(blockText).length === pattern.start.length) {
1025
- return [];
1026
- }
1027
- return [{
1028
- pattern: pattern,
1029
- range: generatePathRange(dom.getRoot(), block, 0, block, 0)
1030
- }];
1031
- });
1032
- }).getOr([]);
1033
- };
1034
- var applyMatches = function (editor, matches) {
1035
- if (matches.length === 0) {
1036
- return;
1037
- }
1038
- var bookmark = editor.selection.getBookmark();
1039
- each(matches, function (match) {
1040
- return applyPattern(editor, match);
1041
- });
1042
- editor.selection.moveToBookmark(bookmark);
1043
- };
1044
-
1045
- var unique = 0;
1046
- var generate$1 = function (prefix) {
1047
- var date = new Date();
1048
- var time = date.getTime();
1049
- var random = Math.floor(Math.random() * 1000000000);
1050
- unique++;
1051
- return prefix + '_' + random + unique + String(time);
1052
- };
1053
-
1054
- var checkRange = function (str, substr, start) {
1055
- return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;
1056
- };
1057
- var endsWith = function (str, suffix) {
1058
- return checkRange(str, suffix, str.length - suffix.length);
1059
- };
1060
-
1061
- var newMarker = function (dom, id) {
1062
- return dom.create('span', {
1063
- 'data-mce-type': 'bookmark',
1064
- id: id
1065
- });
1066
- };
1067
- var rangeFromMarker = function (dom, marker) {
1068
- var rng = dom.createRng();
1069
- rng.setStartAfter(marker.start);
1070
- rng.setEndBefore(marker.end);
1071
- return rng;
1072
- };
1073
- var createMarker = function (dom, markerPrefix, pathRange) {
1074
- var rng = resolvePathRange(dom.getRoot(), pathRange).getOrDie('Unable to resolve path range');
1075
- var startNode = rng.startContainer;
1076
- var endNode = rng.endContainer;
1077
- var textEnd = rng.endOffset === 0 ? endNode : endNode.splitText(rng.endOffset);
1078
- var textStart = rng.startOffset === 0 ? startNode : startNode.splitText(rng.startOffset);
1079
- return {
1080
- prefix: markerPrefix,
1081
- end: textEnd.parentNode.insertBefore(newMarker(dom, markerPrefix + '-end'), textEnd),
1082
- start: textStart.parentNode.insertBefore(newMarker(dom, markerPrefix + '-start'), textStart)
1083
- };
1084
- };
1085
- var removeMarker = function (dom, marker, isRoot) {
1086
- cleanEmptyNodes(dom, dom.get(marker.prefix + '-end'), isRoot);
1087
- cleanEmptyNodes(dom, dom.get(marker.prefix + '-start'), isRoot);
1088
- };
1089
-
1090
- var matchesPattern = function (dom, block, patternContent) {
1091
- return function (element, offset) {
1092
- var text = element.data;
1093
- var searchText = text.substring(0, offset);
1094
- var startEndIndex = searchText.lastIndexOf(patternContent.charAt(patternContent.length - 1));
1095
- var startIndex = searchText.lastIndexOf(patternContent);
1096
- if (startIndex !== -1) {
1097
- return startIndex + patternContent.length;
1098
- } else if (startEndIndex !== -1) {
1099
- return startEndIndex + 1;
1100
- } else {
1101
- return -1;
1102
- }
1103
- };
1104
- };
1105
- var findPatternStartFromSpot = function (dom, pattern, block, spot) {
1106
- var startPattern = pattern.start;
1107
- var startSpot = repeatLeft(dom, spot.container, spot.offset, matchesPattern(dom, block, startPattern), block);
1108
- return startSpot.bind(function (spot) {
1109
- if (spot.offset >= startPattern.length) {
1110
- var rng = dom.createRng();
1111
- rng.setStart(spot.container, spot.offset - startPattern.length);
1112
- rng.setEnd(spot.container, spot.offset);
1113
- return Optional.some(rng);
1114
- } else {
1115
- var offset = spot.offset - startPattern.length;
1116
- return scanLeft(spot.container, offset, block).map(function (nextSpot) {
1117
- var rng = dom.createRng();
1118
- rng.setStart(nextSpot.container, nextSpot.offset);
1119
- rng.setEnd(spot.container, spot.offset);
1120
- return rng;
1121
- }).filter(function (rng) {
1122
- return rng.toString() === startPattern;
1123
- }).orThunk(function () {
1124
- return findPatternStartFromSpot(dom, pattern, block, point(spot.container, 0));
1125
- });
1126
- }
1127
- });
1128
- };
1129
- var findPatternStart = function (dom, pattern, node, offset, block, requireGap) {
1130
- if (requireGap === void 0) {
1131
- requireGap = false;
1132
- }
1133
- if (pattern.start.length === 0 && !requireGap) {
1134
- var rng = dom.createRng();
1135
- rng.setStart(node, offset);
1136
- rng.setEnd(node, offset);
1137
- return Optional.some(rng);
1138
- }
1139
- return textBefore(node, offset, block).bind(function (spot) {
1140
- var start = findPatternStartFromSpot(dom, pattern, block, spot);
1141
- return start.bind(function (startRange) {
1142
- if (requireGap) {
1143
- if (startRange.endContainer === spot.container && startRange.endOffset === spot.offset) {
1144
- return Optional.none();
1145
- } else if (spot.offset === 0 && startRange.endContainer.textContent.length === startRange.endOffset) {
1146
- return Optional.none();
1147
- }
1148
- }
1149
- return Optional.some(startRange);
1150
- });
1151
- });
1152
- };
1153
- var findPattern$1 = function (editor, block, details) {
1154
- var dom = editor.dom;
1155
- var root = dom.getRoot();
1156
- var pattern = details.pattern;
1157
- var endNode = details.position.container;
1158
- var endOffset = details.position.offset;
1159
- return scanLeft(endNode, endOffset - details.pattern.end.length, block).bind(function (spot) {
1160
- var endPathRng = generatePathRange(root, spot.container, spot.offset, endNode, endOffset);
1161
- if (isReplacementPattern(pattern)) {
1162
- return Optional.some({
1163
- matches: [{
1164
- pattern: pattern,
1165
- startRng: endPathRng,
1166
- endRng: endPathRng
1167
- }],
1168
- position: spot
1169
- });
1170
- } else {
1171
- var resultsOpt = findPatternsRec(editor, details.remainingPatterns, spot.container, spot.offset, block);
1172
- var results_1 = resultsOpt.getOr({
1173
- matches: [],
1174
- position: spot
1175
- });
1176
- var pos = results_1.position;
1177
- var start = findPatternStart(dom, pattern, pos.container, pos.offset, block, resultsOpt.isNone());
1178
- return start.map(function (startRng) {
1179
- var startPathRng = generatePathRangeFromRange(root, startRng);
1180
- return {
1181
- matches: results_1.matches.concat([{
1182
- pattern: pattern,
1183
- startRng: startPathRng,
1184
- endRng: endPathRng
1185
- }]),
1186
- position: point(startRng.startContainer, startRng.startOffset)
1187
- };
1188
- });
1189
- }
1190
- });
1191
- };
1192
- var findPatternsRec = function (editor, patterns, node, offset, block) {
1193
- var dom = editor.dom;
1194
- return textBefore(node, offset, dom.getRoot()).bind(function (endSpot) {
1195
- var rng = dom.createRng();
1196
- rng.setStart(block, 0);
1197
- rng.setEnd(node, offset);
1198
- var text = rng.toString();
1199
- for (var i = 0; i < patterns.length; i++) {
1200
- var pattern = patterns[i];
1201
- if (!endsWith(text, pattern.end)) {
1202
- continue;
1203
- }
1204
- var patternsWithoutCurrent = patterns.slice();
1205
- patternsWithoutCurrent.splice(i, 1);
1206
- var result = findPattern$1(editor, block, {
1207
- pattern: pattern,
1208
- remainingPatterns: patternsWithoutCurrent,
1209
- position: endSpot
1210
- });
1211
- if (result.isSome()) {
1212
- return result;
1213
- }
1214
- }
1215
- return Optional.none();
1216
- });
1217
- };
1218
- var applyPattern$1 = function (editor, pattern, patternRange) {
1219
- editor.selection.setRng(patternRange);
1220
- if (pattern.type === 'inline-format') {
1221
- each(pattern.format, function (format) {
1222
- editor.formatter.apply(format);
1223
- });
1224
- } else {
1225
- editor.execCommand(pattern.cmd, false, pattern.value);
1226
- }
1227
- };
1228
- var applyReplacementPattern = function (editor, pattern, marker, isRoot) {
1229
- var markerRange = rangeFromMarker(editor.dom, marker);
1230
- deleteRng(editor.dom, markerRange, isRoot);
1231
- applyPattern$1(editor, pattern, markerRange);
1232
- };
1233
- var applyPatternWithContent = function (editor, pattern, startMarker, endMarker, isRoot) {
1234
- var dom = editor.dom;
1235
- var markerEndRange = rangeFromMarker(dom, endMarker);
1236
- var markerStartRange = rangeFromMarker(dom, startMarker);
1237
- deleteRng(dom, markerStartRange, isRoot);
1238
- deleteRng(dom, markerEndRange, isRoot);
1239
- var patternMarker = {
1240
- prefix: startMarker.prefix,
1241
- start: startMarker.end,
1242
- end: endMarker.start
1243
- };
1244
- var patternRange = rangeFromMarker(dom, patternMarker);
1245
- applyPattern$1(editor, pattern, patternRange);
1246
- };
1247
- var addMarkers = function (dom, matches) {
1248
- var markerPrefix = generate$1('mce_textpattern');
1249
- var matchesWithEnds = foldr(matches, function (acc, match) {
1250
- var endMarker = createMarker(dom, markerPrefix + ('_end' + acc.length), match.endRng);
1251
- return acc.concat([__assign(__assign({}, match), { endMarker: endMarker })]);
1252
- }, []);
1253
- return foldr(matchesWithEnds, function (acc, match) {
1254
- var idx = matchesWithEnds.length - acc.length - 1;
1255
- var startMarker = isReplacementPattern(match.pattern) ? match.endMarker : createMarker(dom, markerPrefix + ('_start' + idx), match.startRng);
1256
- return acc.concat([__assign(__assign({}, match), { startMarker: startMarker })]);
1257
- }, []);
1258
- };
1259
- var findPatterns$1 = function (editor, patterns, space) {
1260
- var rng = editor.selection.getRng();
1261
- if (rng.collapsed === false) {
1262
- return [];
1263
- }
1264
- return getParentBlock(editor, rng).bind(function (block) {
1265
- var offset = rng.startOffset - (space ? 1 : 0);
1266
- return findPatternsRec(editor, patterns, rng.startContainer, offset, block);
1267
- }).fold(function () {
1268
- return [];
1269
- }, function (result) {
1270
- return result.matches;
1271
- });
1272
- };
1273
- var applyMatches$1 = function (editor, matches) {
1274
- if (matches.length === 0) {
1275
- return;
1276
- }
1277
- var dom = editor.dom;
1278
- var bookmark = editor.selection.getBookmark();
1279
- var matchesWithMarkers = addMarkers(dom, matches);
1280
- each(matchesWithMarkers, function (match) {
1281
- var block = dom.getParent(match.startMarker.start, dom.isBlock);
1282
- var isRoot = function (node) {
1283
- return node === block;
1284
- };
1285
- if (isReplacementPattern(match.pattern)) {
1286
- applyReplacementPattern(editor, match.pattern, match.endMarker, isRoot);
1287
- } else {
1288
- applyPatternWithContent(editor, match.pattern, match.startMarker, match.endMarker, isRoot);
1289
- }
1290
- removeMarker(dom, match.endMarker, isRoot);
1291
- removeMarker(dom, match.startMarker, isRoot);
1292
- });
1293
- editor.selection.moveToBookmark(bookmark);
1294
- };
1295
-
1296
- var handleEnter = function (editor, patternSet) {
1297
- if (!editor.selection.isCollapsed()) {
1298
- return false;
1299
- }
1300
- var inlineMatches = findPatterns$1(editor, patternSet.inlinePatterns, false);
1301
- var blockMatches = findPatterns(editor, patternSet.blockPatterns);
1302
- if (blockMatches.length > 0 || inlineMatches.length > 0) {
1303
- editor.undoManager.add();
1304
- editor.undoManager.extra(function () {
1305
- editor.execCommand('mceInsertNewLine');
1306
- }, function () {
1307
- editor.insertContent(zeroWidth);
1308
- applyMatches$1(editor, inlineMatches);
1309
- applyMatches(editor, blockMatches);
1310
- var range = editor.selection.getRng();
1311
- var spot = textBefore(range.startContainer, range.startOffset, editor.dom.getRoot());
1312
- editor.execCommand('mceInsertNewLine');
1313
- spot.each(function (s) {
1314
- var node = s.container;
1315
- if (node.data.charAt(s.offset - 1) === zeroWidth) {
1316
- node.deleteData(s.offset - 1, 1);
1317
- cleanEmptyNodes(editor.dom, node.parentNode, function (e) {
1318
- return e === editor.dom.getRoot();
1319
- });
1320
- }
1321
- });
1322
- });
1323
- return true;
1324
- }
1325
- return false;
1326
- };
1327
- var handleInlineKey = function (editor, patternSet) {
1328
- var inlineMatches = findPatterns$1(editor, patternSet.inlinePatterns, true);
1329
- if (inlineMatches.length > 0) {
1330
- editor.undoManager.transact(function () {
1331
- applyMatches$1(editor, inlineMatches);
1332
- });
1333
- }
1334
- };
1335
- var checkKeyEvent = function (codes, event, predicate) {
1336
- for (var i = 0; i < codes.length; i++) {
1337
- if (predicate(codes[i], event)) {
1338
- return true;
1339
- }
1340
- }
1341
- };
1342
- var checkKeyCode = function (codes, event) {
1343
- return checkKeyEvent(codes, event, function (code, event) {
1344
- return code === event.keyCode && global$2.modifierPressed(event) === false;
1345
- });
1346
- };
1347
- var checkCharCode = function (chars, event) {
1348
- return checkKeyEvent(chars, event, function (chr, event) {
1349
- return chr.charCodeAt(0) === event.charCode;
1350
- });
1351
- };
1352
-
1353
- var setup = function (editor, patternsState) {
1354
- var charCodes = [
1355
- ',',
1356
- '.',
1357
- ';',
1358
- ':',
1359
- '!',
1360
- '?'
1361
- ];
1362
- var keyCodes = [32];
1363
- editor.on('keydown', function (e) {
1364
- if (e.keyCode === 13 && !global$2.modifierPressed(e)) {
1365
- if (handleEnter(editor, patternsState.get())) {
1366
- e.preventDefault();
1367
- }
1368
- }
1369
- }, true);
1370
- editor.on('keyup', function (e) {
1371
- if (checkKeyCode(keyCodes, e)) {
1372
- handleInlineKey(editor, patternsState.get());
1373
- }
1374
- });
1375
- editor.on('keypress', function (e) {
1376
- if (checkCharCode(charCodes, e)) {
1377
- global$1.setEditorTimeout(editor, function () {
1378
- handleInlineKey(editor, patternsState.get());
1379
- });
1380
- }
1381
- });
1382
- };
1383
-
1384
- function Plugin () {
1385
- global.add('textpattern', function (editor) {
1386
- var patternsState = Cell(getPatternSet(editor));
1387
- setup(editor, patternsState);
1388
- return get$1(patternsState);
1389
- });
1390
- }
1391
-
1392
- Plugin();
1393
-
1394
- }());