@sapui5/sap.ui.richtexteditor 1.112.2 → 1.114.0

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 (197) hide show
  1. package/package.json +1 -1
  2. package/src/sap/ui/richtexteditor/.library +2 -2
  3. package/src/sap/ui/richtexteditor/RTESplitButton.js +1 -1
  4. package/src/sap/ui/richtexteditor/RichTextEditor.js +5 -1
  5. package/src/sap/ui/richtexteditor/ToolbarWrapper.js +7 -8
  6. package/src/sap/ui/richtexteditor/js/tiny_mce6/icons/default/icons.js +4 -1
  7. package/src/sap/ui/richtexteditor/js/tiny_mce6/icons/default/icons.min.js +1 -1
  8. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/ar.js +1 -1
  9. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/bg_BG.js +1 -1
  10. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/ca.js +1 -1
  11. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/cs.js +1 -1
  12. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/cy.js +0 -6
  13. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/da.js +1 -1
  14. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/de.js +1 -1
  15. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/dv.js +0 -6
  16. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/el.js +1 -1
  17. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/es.js +1 -1
  18. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/es_MX.js +1 -7
  19. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/et.js +0 -6
  20. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/eu.js +7 -0
  21. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/fa.js +7 -0
  22. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/fi.js +1 -1
  23. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/fr_FR.js +1 -1
  24. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/he_IL.js +1 -1
  25. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/hi.js +1 -1
  26. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/hr.js +1 -1
  27. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/hu_HU.js +1 -1
  28. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/id.js +1 -1
  29. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/it.js +1 -1
  30. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/ja.js +1 -1
  31. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/kk.js +1 -1
  32. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/ko_KR.js +1 -1
  33. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/lt.js +1 -7
  34. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/lv.js +0 -6
  35. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/ms.js +1 -1
  36. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/nb_NO.js +1 -1
  37. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/nl.js +1 -1
  38. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/pl.js +1 -1
  39. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/pt_BR.js +7 -0
  40. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/pt_PT.js +1 -1
  41. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/ro.js +1 -1
  42. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/ru.js +1 -1
  43. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/sk.js +1 -1
  44. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/sl_SI.js +1 -1
  45. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/sr.js +0 -6
  46. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/sv_SE.js +1 -1
  47. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/th_TH.js +1 -1
  48. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/tr.js +1 -1
  49. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/uk.js +1 -1
  50. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/vi.js +1 -1
  51. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/zh_CN.js +1 -1
  52. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/zh_TW.js +1 -1
  53. package/src/sap/ui/richtexteditor/js/tiny_mce6/models/dom/model.js +14 -10
  54. package/src/sap/ui/richtexteditor/js/tiny_mce6/models/dom/model.min.js +2 -2
  55. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/CHANGELOG.md +7 -0
  56. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/codemirror.min.css +2 -2
  57. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/codemirror.min.js +1 -1
  58. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/customeditor.js +2 -2
  59. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/customeditor.min.js +2 -2
  60. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/ar.js +10 -0
  61. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/bg_BG.js +10 -0
  62. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/ca.js +10 -0
  63. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/cs.js +10 -0
  64. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/da.js +10 -0
  65. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/de.js +10 -0
  66. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/el.js +10 -0
  67. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/es.js +10 -0
  68. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/eu.js +10 -0
  69. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/fa.js +10 -0
  70. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/fi.js +10 -0
  71. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/fr_FR.js +10 -0
  72. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/he_IL.js +10 -0
  73. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/hi.js +10 -0
  74. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/hr.js +10 -0
  75. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/hu_HU.js +10 -0
  76. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/id.js +10 -0
  77. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/it.js +10 -0
  78. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/ja.js +10 -0
  79. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/kk.js +10 -0
  80. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/ko_KR.js +10 -0
  81. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/ms.js +10 -0
  82. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/nb_NO.js +10 -0
  83. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/nl.js +10 -0
  84. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/pl.js +10 -0
  85. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/pt_BR.js +10 -0
  86. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/pt_PT.js +10 -0
  87. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/ro.js +10 -0
  88. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/ru.js +10 -0
  89. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/sk.js +10 -0
  90. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/sl_SI.js +10 -0
  91. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/sv_SE.js +10 -0
  92. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/th_TH.js +10 -0
  93. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/tr.js +10 -0
  94. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/uk.js +10 -0
  95. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/vi.js +10 -0
  96. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/zh_CN.js +10 -0
  97. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/langs/zh_TW.js +10 -0
  98. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/plugin.js +2 -2
  99. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/plugin.min.js +2 -2
  100. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/readme.txt +1 -1
  101. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/version.txt +1 -1
  102. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advlist/plugin.js +16 -9
  103. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advlist/plugin.min.js +2 -2
  104. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/anchor/plugin.js +7 -6
  105. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/anchor/plugin.min.js +2 -2
  106. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/autolink/plugin.js +131 -107
  107. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/autolink/plugin.min.js +2 -2
  108. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/autoresize/plugin.js +3 -2
  109. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/autoresize/plugin.min.js +2 -2
  110. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/autosave/plugin.js +11 -10
  111. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/autosave/plugin.min.js +2 -2
  112. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/charmap/plugin.js +17 -7
  113. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/charmap/plugin.min.js +2 -2
  114. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/code/plugin.js +1 -1
  115. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/code/plugin.min.js +1 -1
  116. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/codesample/plugin.js +23 -10
  117. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/codesample/plugin.min.js +2 -2
  118. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/directionality/plugin.js +1 -1
  119. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/directionality/plugin.min.js +1 -1
  120. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/emoticons/plugin.js +10 -4
  121. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/emoticons/plugin.min.js +2 -2
  122. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/fullscreen/plugin.js +11 -5
  123. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/fullscreen/plugin.min.js +2 -2
  124. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/plugin.js +107 -24
  125. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/plugin.min.js +2 -2
  126. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/image/plugin.js +50 -37
  127. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/image/plugin.min.js +2 -2
  128. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/importcss/plugin.js +8 -6
  129. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/importcss/plugin.min.js +2 -2
  130. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/insertdatetime/plugin.js +2 -3
  131. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/insertdatetime/plugin.min.js +2 -2
  132. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/link/plugin.js +68 -45
  133. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/link/plugin.min.js +2 -2
  134. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/lists/plugin.js +120 -74
  135. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/lists/plugin.min.js +2 -2
  136. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/media/plugin.js +39 -24
  137. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/media/plugin.min.js +2 -2
  138. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/nonbreaking/plugin.js +1 -1
  139. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/nonbreaking/plugin.min.js +1 -1
  140. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/pagebreak/plugin.js +2 -2
  141. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/pagebreak/plugin.min.js +2 -2
  142. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/CHANGELOG.md +13 -5
  143. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/js/wordimport.js +2850 -1729
  144. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/plugin.js +2 -2
  145. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/plugin.min.js +2 -2
  146. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/readme.txt +1 -1
  147. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/version.txt +1 -1
  148. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/preview/plugin.js +1 -1
  149. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/preview/plugin.min.js +1 -1
  150. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/quickbars/plugin.js +21 -13
  151. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/quickbars/plugin.min.js +2 -2
  152. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/save/plugin.js +1 -1
  153. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/save/plugin.min.js +1 -1
  154. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/searchreplace/plugin.js +13 -13
  155. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/searchreplace/plugin.min.js +2 -2
  156. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/table/plugin.js +42 -37
  157. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/table/plugin.min.js +2 -2
  158. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/template/plugin.js +7 -4
  159. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/template/plugin.min.js +2 -2
  160. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/visualblocks/plugin.js +1 -1
  161. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/visualblocks/plugin.min.js +1 -1
  162. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/visualchars/plugin.js +9 -6
  163. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/visualchars/plugin.min.js +2 -2
  164. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/wordcount/plugin.js +6 -5
  165. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/wordcount/plugin.min.js +2 -2
  166. package/src/sap/ui/richtexteditor/js/tiny_mce6/readme.txt +1 -1
  167. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide/content.css +31 -0
  168. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide/content.inline.css +31 -0
  169. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide/content.inline.min.css +1 -1
  170. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide/content.min.css +1 -1
  171. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide/skin.css +155 -46
  172. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide/skin.min.css +1 -1
  173. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide-dark/content.css +31 -0
  174. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide-dark/content.inline.css +31 -0
  175. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide-dark/content.inline.min.css +1 -1
  176. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide-dark/content.min.css +1 -1
  177. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide-dark/skin.css +149 -40
  178. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide-dark/skin.min.css +1 -1
  179. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5/content.css +31 -0
  180. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5/content.inline.css +31 -0
  181. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5/content.inline.min.css +1 -1
  182. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5/content.min.css +1 -1
  183. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5/skin.css +164 -46
  184. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5/skin.min.css +1 -1
  185. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5-dark/content.css +31 -0
  186. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5-dark/content.inline.css +31 -0
  187. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5-dark/content.inline.min.css +1 -1
  188. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5-dark/content.min.css +1 -1
  189. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5-dark/skin.css +157 -39
  190. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5-dark/skin.min.css +1 -1
  191. package/src/sap/ui/richtexteditor/js/tiny_mce6/themes/silver/theme.js +6039 -3529
  192. package/src/sap/ui/richtexteditor/js/tiny_mce6/themes/silver/theme.min.js +2 -2
  193. package/src/sap/ui/richtexteditor/js/tiny_mce6/tinymce.d.ts +406 -185
  194. package/src/sap/ui/richtexteditor/js/tiny_mce6/tinymce.js +3915 -3078
  195. package/src/sap/ui/richtexteditor/js/tiny_mce6/tinymce.min.js +2 -2
  196. package/src/sap/ui/richtexteditor/js/tiny_mce6/version.txt +1 -1
  197. package/src/sap/ui/richtexteditor/library.js +1 -1
@@ -33,7 +33,7 @@ declare type NormalizedEvent<E, T = any> = E & {
33
33
  readonly isImmediatePropagationStopped: () => boolean;
34
34
  readonly stopImmediatePropagation: () => void;
35
35
  };
36
- declare type MappedEvent<T, K extends string> = K extends keyof T ? T[K] : any;
36
+ declare type MappedEvent<T extends {}, K extends string> = K extends keyof T ? T[K] : any;
37
37
  interface NativeEventMap {
38
38
  'beforepaste': Event;
39
39
  'blur': FocusEvent;
@@ -82,21 +82,21 @@ interface EventDispatcherSettings {
82
82
  toggleEvent?: (name: string, state: boolean) => void | boolean;
83
83
  beforeFire?: <T>(args: EditorEvent<T>) => void;
84
84
  }
85
- interface EventDispatcherConstructor<T extends NativeEventMap> {
85
+ interface EventDispatcherConstructor<T extends {}> {
86
86
  readonly prototype: EventDispatcher<T>;
87
87
  new (settings?: EventDispatcherSettings): EventDispatcher<T>;
88
88
  isNative: (name: string) => boolean;
89
89
  }
90
- declare class EventDispatcher<T> {
90
+ declare class EventDispatcher<T extends {}> {
91
91
  static isNative(name: string): boolean;
92
92
  private readonly settings;
93
93
  private readonly scope;
94
94
  private readonly toggleEvent;
95
95
  private bindings;
96
- constructor(settings?: Record<string, any>);
96
+ constructor(settings?: EventDispatcherSettings);
97
97
  fire<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U): EditorEvent<U>;
98
98
  dispatch<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U): EditorEvent<U>;
99
- on<K extends string>(name: K, callback: false | ((event: EditorEvent<MappedEvent<T, K>>) => void), prepend?: boolean, extra?: {}): this;
99
+ on<K extends string>(name: K, callback: false | ((event: EditorEvent<MappedEvent<T, K>>) => void | boolean), prepend?: boolean, extra?: {}): this;
100
100
  off<K extends string>(name?: K, callback?: (event: EditorEvent<MappedEvent<T, K>>) => void): this;
101
101
  once<K extends string>(name: K, callback: (event: EditorEvent<MappedEvent<T, K>>) => void, prepend?: boolean): this;
102
102
  has(name: string): boolean;
@@ -105,31 +105,55 @@ declare const enum UndoLevelType {
105
105
  Fragmented = "fragmented",
106
106
  Complete = "complete"
107
107
  }
108
- interface UndoLevel {
108
+ interface BaseUndoLevel {
109
109
  type: UndoLevelType;
110
+ bookmark: Bookmark | null;
111
+ beforeBookmark: Bookmark | null;
112
+ }
113
+ interface FragmentedUndoLevel extends BaseUndoLevel {
114
+ type: UndoLevelType.Fragmented;
110
115
  fragments: string[];
116
+ content: '';
117
+ }
118
+ interface CompleteUndoLevel extends BaseUndoLevel {
119
+ type: UndoLevelType.Complete;
120
+ fragments: null;
111
121
  content: string;
112
- bookmark: Bookmark;
113
- beforeBookmark: Bookmark;
114
122
  }
123
+ declare type NewUndoLevel = CompleteUndoLevel | FragmentedUndoLevel;
124
+ declare type UndoLevel = NewUndoLevel & {
125
+ bookmark: Bookmark;
126
+ };
115
127
  interface UndoManager {
116
128
  data: UndoLevel[];
117
129
  typing: boolean;
118
- add: (level?: UndoLevel, event?: EditorEvent<any>) => UndoLevel;
130
+ add: (level?: Partial<UndoLevel>, event?: EditorEvent<any>) => UndoLevel | null;
119
131
  dispatchChange: () => void;
120
132
  beforeChange: () => void;
121
- undo: () => UndoLevel;
122
- redo: () => UndoLevel;
133
+ undo: () => UndoLevel | undefined;
134
+ redo: () => UndoLevel | undefined;
123
135
  clear: () => void;
124
136
  reset: () => void;
125
137
  hasUndo: () => boolean;
126
138
  hasRedo: () => boolean;
127
- transact: (callback: () => void) => UndoLevel;
139
+ transact: (callback: () => void) => UndoLevel | null;
128
140
  ignore: (callback: () => void) => void;
129
141
  extra: (callback1: () => void, callback2: () => void) => void;
130
142
  }
131
143
  declare type SchemaType = 'html4' | 'html5' | 'html5-strict';
132
- interface SchemaSettings {
144
+ interface ElementSettings {
145
+ block_elements?: string;
146
+ boolean_attributes?: string;
147
+ move_caret_before_on_enter_elements?: string;
148
+ non_empty_elements?: string;
149
+ self_closing_elements?: string;
150
+ text_block_elements?: string;
151
+ text_inline_elements?: string;
152
+ void_elements?: string;
153
+ whitespace_elements?: string;
154
+ transparent_elements?: string;
155
+ }
156
+ interface SchemaSettings extends ElementSettings {
133
157
  custom_elements?: string;
134
158
  extended_valid_elements?: string;
135
159
  invalid_elements?: string;
@@ -152,12 +176,8 @@ interface DefaultAttribute {
152
176
  name: string;
153
177
  value: string;
154
178
  }
155
- interface AttributePattern {
156
- defaultValue?: string;
157
- forcedValue?: string;
179
+ interface AttributePattern extends Attribute {
158
180
  pattern: RegExp;
159
- required?: boolean;
160
- validValues?: Record<string, {}>;
161
181
  }
162
182
  interface ElementRule {
163
183
  attributes: Record<string, Attribute>;
@@ -199,6 +219,7 @@ interface Schema {
199
219
  getNonEmptyElements: () => SchemaMap;
200
220
  getMoveCaretBeforeOnEnterElements: () => SchemaMap;
201
221
  getWhitespaceElements: () => SchemaMap;
222
+ getTransparentElements: () => SchemaMap;
202
223
  getSpecialElements: () => SchemaRegExpMap;
203
224
  isValidChild: (name: string, child: string) => boolean;
204
225
  isValid: (name: string, attr?: string) => boolean;
@@ -225,16 +246,16 @@ declare class AstNode {
225
246
  type: number;
226
247
  attributes?: Attributes$1;
227
248
  value?: string;
228
- parent?: AstNode;
229
- firstChild?: AstNode;
230
- lastChild?: AstNode;
231
- next?: AstNode;
232
- prev?: AstNode;
249
+ parent?: AstNode | null;
250
+ firstChild?: AstNode | null;
251
+ lastChild?: AstNode | null;
252
+ next?: AstNode | null;
253
+ prev?: AstNode | null;
233
254
  raw?: boolean;
234
255
  constructor(name: string, type: number);
235
256
  replace(node: AstNode): AstNode;
236
- attr(name: string, value: string | null): AstNode | undefined;
237
- attr(name: Record<string, string | null>): AstNode | undefined;
257
+ attr(name: string, value: string | null | undefined): AstNode | undefined;
258
+ attr(name: Record<string, string | null | undefined> | undefined): AstNode | undefined;
238
259
  attr(name: string): string | undefined;
239
260
  clone(): AstNode;
240
261
  wrap(wrapper: AstNode): AstNode;
@@ -246,7 +267,7 @@ declare class AstNode {
246
267
  children(): AstNode[];
247
268
  empty(): AstNode;
248
269
  isEmpty(elements: SchemaMap, whitespace?: SchemaMap, predicate?: (node: AstNode) => boolean): boolean;
249
- walk(prev?: boolean): AstNode;
270
+ walk(prev?: boolean): AstNode | null | undefined;
250
271
  }
251
272
  declare type Content = string | AstNode;
252
273
  declare type ContentFormat = 'raw' | 'text' | 'html' | 'tree';
@@ -266,6 +287,9 @@ interface SetContentArgs {
266
287
  no_events?: boolean;
267
288
  no_selection?: boolean;
268
289
  paste?: boolean;
290
+ load?: boolean;
291
+ initial?: boolean;
292
+ [key: string]: any;
269
293
  }
270
294
  interface GetSelectionContentArgs extends GetContentArgs {
271
295
  selection?: boolean;
@@ -314,12 +338,12 @@ declare class NodeChange {
314
338
  private readonly editor;
315
339
  private lastPath;
316
340
  constructor(editor: Editor);
317
- nodeChanged(args?: any): void;
341
+ nodeChanged(args?: Record<string, any>): void;
318
342
  private isSameElementPath;
319
343
  }
320
344
  interface SelectionOverrides {
321
- showCaret: (direction: number, node: Element, before: boolean, scrollIntoView?: boolean) => Range | null;
322
- showBlockCaretContainer: (blockCaretContainer: Element) => void;
345
+ showCaret: (direction: number, node: HTMLElement, before: boolean, scrollIntoView?: boolean) => Range | null;
346
+ showBlockCaretContainer: (blockCaretContainer: HTMLElement) => void;
323
347
  hideFakeCaret: () => void;
324
348
  destroy: () => void;
325
349
  }
@@ -365,7 +389,7 @@ interface Rect {
365
389
  fromClientRect: (clientRect: DOMRect) => GeomRect;
366
390
  }
367
391
  interface NotificationManagerImpl {
368
- open: (spec: NotificationSpec, closeCallback?: () => void) => NotificationApi;
392
+ open: (spec: NotificationSpec, closeCallback: () => void) => NotificationApi;
369
393
  close: <T extends NotificationApi>(notification: T) => void;
370
394
  getArgs: <T extends NotificationApi>(notification: T) => NotificationSpec;
371
395
  }
@@ -440,6 +464,12 @@ interface BlockCmdPattern extends BlockBasePattern {
440
464
  }
441
465
  declare type BlockPattern = BlockFormatPattern | BlockCmdPattern;
442
466
  declare type Pattern = InlinePattern | BlockPattern;
467
+ interface DynamicPatternContext {
468
+ readonly text: string;
469
+ readonly block: Element;
470
+ }
471
+ declare type DynamicPatternsLookup = (ctx: DynamicPatternContext) => Pattern[];
472
+ declare type RawDynamicPatternsLookup = (ctx: DynamicPatternContext) => RawPattern[];
443
473
  interface AlertBannerSpec {
444
474
  type: 'alertbanner';
445
475
  level: 'info' | 'warn' | 'error' | 'success';
@@ -479,6 +509,7 @@ interface CollectionItem {
479
509
  }
480
510
  interface ColorInputSpec extends FormComponentWithLabelSpec {
481
511
  type: 'colorinput';
512
+ storageKey?: string;
482
513
  }
483
514
  interface ColorPickerSpec extends FormComponentWithLabelSpec {
484
515
  type: 'colorpicker';
@@ -672,12 +703,12 @@ interface DialogTabChangeDetails {
672
703
  newTabName: string;
673
704
  oldTabName: string;
674
705
  }
675
- declare type DialogActionHandler<T> = (api: DialogInstanceApi<T>, details: DialogActionDetails) => void;
676
- declare type DialogChangeHandler<T> = (api: DialogInstanceApi<T>, details: DialogChangeDetails<T>) => void;
677
- declare type DialogSubmitHandler<T> = (api: DialogInstanceApi<T>) => void;
706
+ declare type DialogActionHandler<T extends DialogData> = (api: DialogInstanceApi<T>, details: DialogActionDetails) => void;
707
+ declare type DialogChangeHandler<T extends DialogData> = (api: DialogInstanceApi<T>, details: DialogChangeDetails<T>) => void;
708
+ declare type DialogSubmitHandler<T extends DialogData> = (api: DialogInstanceApi<T>) => void;
678
709
  declare type DialogCloseHandler = () => void;
679
- declare type DialogCancelHandler<T> = (api: DialogInstanceApi<T>) => void;
680
- declare type DialogTabChangeHandler<T> = (api: DialogInstanceApi<T>, details: DialogTabChangeDetails) => void;
710
+ declare type DialogCancelHandler<T extends DialogData> = (api: DialogInstanceApi<T>) => void;
711
+ declare type DialogTabChangeHandler<T extends DialogData> = (api: DialogInstanceApi<T>, details: DialogTabChangeDetails) => void;
681
712
  declare type DialogSize = 'normal' | 'medium' | 'large';
682
713
  interface DialogSpec<T extends DialogData> {
683
714
  title: string;
@@ -772,7 +803,8 @@ interface AutocompleterItemSpec {
772
803
  declare type AutocompleterContents = SeparatorItemSpec | AutocompleterItemSpec | CardMenuItemSpec;
773
804
  interface AutocompleterSpec {
774
805
  type?: 'autocompleter';
775
- ch: string;
806
+ ch?: string;
807
+ trigger?: string;
776
808
  minChars?: number;
777
809
  columns?: ColumnTypes$1;
778
810
  matches?: (rng: Range, text: string, pattern: string) => boolean;
@@ -904,7 +936,8 @@ interface ColorSwatchMenuItemSpec extends BaseFancyMenuItemSpec<'colorswatch'> {
904
936
  fancytype: 'colorswatch';
905
937
  initData?: {
906
938
  allowCustomColors?: boolean;
907
- colors: ChoiceMenuItemSpec[];
939
+ colors?: ChoiceMenuItemSpec[];
940
+ storageKey?: string;
908
941
  };
909
942
  }
910
943
  declare type FancyMenuItemSpec = InsertTableMenuItemSpec | ColorSwatchMenuItemSpec;
@@ -950,11 +983,11 @@ type PublicDialog_d_CustomEditorInit = CustomEditorInit;
950
983
  type PublicDialog_d_CustomEditorInitFn = CustomEditorInitFn;
951
984
  type PublicDialog_d_DialogData = DialogData;
952
985
  type PublicDialog_d_DialogSize = DialogSize;
953
- type PublicDialog_d_DialogSpec<_0> = DialogSpec<_0>;
954
- type PublicDialog_d_DialogInstanceApi<_0> = DialogInstanceApi<_0>;
986
+ type PublicDialog_d_DialogSpec<T extends DialogData> = DialogSpec<T>;
987
+ type PublicDialog_d_DialogInstanceApi<T extends DialogData> = DialogInstanceApi<T>;
955
988
  type PublicDialog_d_DialogFooterButtonSpec = DialogFooterButtonSpec;
956
989
  type PublicDialog_d_DialogActionDetails = DialogActionDetails;
957
- type PublicDialog_d_DialogChangeDetails<_0> = DialogChangeDetails<_0>;
990
+ type PublicDialog_d_DialogChangeDetails<T> = DialogChangeDetails<T>;
958
991
  type PublicDialog_d_DialogTabChangeDetails = DialogTabChangeDetails;
959
992
  type PublicDialog_d_DropZoneSpec = DropZoneSpec;
960
993
  type PublicDialog_d_GridSpec = GridSpec;
@@ -1057,11 +1090,17 @@ interface GroupToolbarButtonSpec extends BaseToolbarButtonSpec<GroupToolbarButto
1057
1090
  }
1058
1091
  declare type MenuButtonItemTypes = NestedMenuItemContents;
1059
1092
  declare type SuccessCallback$1 = (menu: string | MenuButtonItemTypes[]) => void;
1093
+ interface MenuButtonFetchContext {
1094
+ pattern: string;
1095
+ }
1060
1096
  interface BaseMenuButtonSpec {
1061
1097
  text?: string;
1062
1098
  tooltip?: string;
1063
1099
  icon?: string;
1064
- fetch: (success: SuccessCallback$1) => void;
1100
+ search?: boolean | {
1101
+ placeholder?: string;
1102
+ };
1103
+ fetch: (success: SuccessCallback$1, fetchContext: MenuButtonFetchContext) => void;
1065
1104
  onSetup?: (api: BaseMenuButtonInstanceApi) => (api: BaseMenuButtonInstanceApi) => void;
1066
1105
  }
1067
1106
  interface BaseMenuButtonInstanceApi {
@@ -1114,6 +1153,26 @@ type PublicToolbar_d_GroupToolbarButtonInstanceApi = GroupToolbarButtonInstanceA
1114
1153
  declare namespace PublicToolbar_d {
1115
1154
  export { PublicToolbar_d_ToolbarButtonSpec as ToolbarButtonSpec, PublicToolbar_d_ToolbarButtonInstanceApi as ToolbarButtonInstanceApi, PublicToolbar_d_ToolbarSplitButtonSpec as ToolbarSplitButtonSpec, PublicToolbar_d_ToolbarSplitButtonInstanceApi as ToolbarSplitButtonInstanceApi, PublicToolbar_d_ToolbarMenuButtonSpec as ToolbarMenuButtonSpec, PublicToolbar_d_ToolbarMenuButtonInstanceApi as ToolbarMenuButtonInstanceApi, PublicToolbar_d_ToolbarToggleButtonSpec as ToolbarToggleButtonSpec, PublicToolbar_d_ToolbarToggleButtonInstanceApi as ToolbarToggleButtonInstanceApi, PublicToolbar_d_GroupToolbarButtonSpec as GroupToolbarButtonSpec, PublicToolbar_d_GroupToolbarButtonInstanceApi as GroupToolbarButtonInstanceApi, };
1116
1155
  }
1156
+ interface ViewNormalButtonSpec {
1157
+ type: 'button';
1158
+ text: string;
1159
+ buttonType?: 'primary' | 'secondary';
1160
+ onAction: () => void;
1161
+ }
1162
+ declare type ViewButtonSpec = ViewNormalButtonSpec;
1163
+ interface ViewInstanceApi {
1164
+ getContainer: () => HTMLElement;
1165
+ }
1166
+ interface ViewSpec {
1167
+ buttons?: ViewButtonSpec[];
1168
+ onShow: (api: ViewInstanceApi) => void;
1169
+ onHide: (api: ViewInstanceApi) => void;
1170
+ }
1171
+ type PublicView_d_ViewSpec = ViewSpec;
1172
+ type PublicView_d_ViewInstanceApi = ViewInstanceApi;
1173
+ declare namespace PublicView_d {
1174
+ export { PublicView_d_ViewSpec as ViewSpec, PublicView_d_ViewInstanceApi as ViewInstanceApi, };
1175
+ }
1117
1176
  interface Registry$1 {
1118
1177
  addButton: (name: string, spec: ToolbarButtonSpec) => void;
1119
1178
  addGroupToolbarButton: (name: string, spec: GroupToolbarButtonSpec) => void;
@@ -1129,6 +1188,7 @@ interface Registry$1 {
1129
1188
  addIcon: (name: string, svgData: string) => void;
1130
1189
  addAutocompleter: (name: string, spec: AutocompleterSpec) => void;
1131
1190
  addSidebar: (name: string, spec: SidebarSpec) => void;
1191
+ addView: (name: string, spec: ViewSpec) => void;
1132
1192
  getAll: () => {
1133
1193
  buttons: Record<string, ToolbarButtonSpec | GroupToolbarButtonSpec | ToolbarMenuButtonSpec | ToolbarSplitButtonSpec | ToolbarToggleButtonSpec>;
1134
1194
  menuItems: Record<string, MenuItemSpec | NestedMenuItemSpec | ToggleMenuItemSpec>;
@@ -1137,6 +1197,7 @@ interface Registry$1 {
1137
1197
  contextToolbars: Record<string, ContextToolbarSpec | ContextFormSpec>;
1138
1198
  icons: Record<string, string>;
1139
1199
  sidebars: Record<string, SidebarSpec>;
1200
+ views: Record<string, ViewSpec>;
1140
1201
  };
1141
1202
  }
1142
1203
  interface AutocompleteLookupData {
@@ -1159,7 +1220,7 @@ declare type ApplyFormat = BlockFormat | InlineFormat | SelectorFormat;
1159
1220
  declare type RemoveFormat = RemoveBlockFormat | RemoveInlineFormat | RemoveSelectorFormat;
1160
1221
  declare type Format = ApplyFormat | RemoveFormat;
1161
1222
  declare type Formats = Record<string, Format | Format[]>;
1162
- declare type FormatAttrOrStyleValue = string | ((vars?: FormatVars) => string);
1223
+ declare type FormatAttrOrStyleValue = string | ((vars?: FormatVars) => string | null);
1163
1224
  declare type FormatVars = Record<string, string | null>;
1164
1225
  interface BaseFormat<T> {
1165
1226
  ceFalseOverride?: boolean;
@@ -1170,7 +1231,7 @@ interface BaseFormat<T> {
1170
1231
  links?: boolean;
1171
1232
  mixed?: boolean;
1172
1233
  block_expand?: boolean;
1173
- onmatch?: (node: Node, fmt: T, itemName: string) => boolean;
1234
+ onmatch?: (node: Element, fmt: T, itemName: string) => boolean;
1174
1235
  remove?: 'none' | 'empty' | 'all';
1175
1236
  remove_similar?: boolean;
1176
1237
  split?: boolean;
@@ -1194,7 +1255,7 @@ interface CommonFormat<T> extends BaseFormat<T> {
1194
1255
  styles?: Record<string, FormatAttrOrStyleValue>;
1195
1256
  toggle?: boolean;
1196
1257
  preview?: string | false;
1197
- onformat?: (elm: Node, fmt: T, vars?: FormatVars, node?: Node | RangeLikeObject) => void;
1258
+ onformat?: (elm: Element, fmt: T, vars?: FormatVars, node?: Node | RangeLikeObject | null) => void;
1198
1259
  clear_child_styles?: boolean;
1199
1260
  merge_siblings?: boolean;
1200
1261
  merge_with_parents?: boolean;
@@ -1273,6 +1334,7 @@ interface StyleSheetLoader {
1273
1334
  unload: (url: string) => void;
1274
1335
  unloadAll: (urls: string[]) => void;
1275
1336
  _setReferrerPolicy: (referrerPolicy: ReferrerPolicy) => void;
1337
+ _setContentCssCors: (contentCssCors: boolean) => void;
1276
1338
  }
1277
1339
  declare type Registry = Registry$1;
1278
1340
  interface EditorUiApi {
@@ -1289,22 +1351,22 @@ type Ui_d_Registry = Registry;
1289
1351
  type Ui_d_EditorUiApi = EditorUiApi;
1290
1352
  type Ui_d_EditorUi = EditorUi;
1291
1353
  declare namespace Ui_d {
1292
- export { Ui_d_Registry as Registry, PublicDialog_d as Dialog, PublicInlineContent_d as InlineContent, PublicMenu_d as Menu, PublicSidebar_d as Sidebar, PublicToolbar_d as Toolbar, Ui_d_EditorUiApi as EditorUiApi, Ui_d_EditorUi as EditorUi, };
1354
+ export { Ui_d_Registry as Registry, PublicDialog_d as Dialog, PublicInlineContent_d as InlineContent, PublicMenu_d as Menu, PublicView_d as View, PublicSidebar_d as Sidebar, PublicToolbar_d as Toolbar, Ui_d_EditorUiApi as EditorUiApi, Ui_d_EditorUi as EditorUi, };
1293
1355
  }
1294
1356
  interface WindowParams {
1295
1357
  readonly inline?: 'cursor' | 'toolbar';
1296
1358
  readonly ariaAttrs?: boolean;
1297
1359
  }
1298
- declare type InstanceApi<T> = UrlDialogInstanceApi | DialogInstanceApi<T>;
1360
+ declare type InstanceApi<T extends DialogData> = UrlDialogInstanceApi | DialogInstanceApi<T>;
1299
1361
  interface WindowManagerImpl {
1300
- open: <T>(config: DialogSpec<T>, params: WindowParams, closeWindow: (dialog: DialogInstanceApi<T>) => void) => DialogInstanceApi<T>;
1362
+ open: <T extends DialogData>(config: DialogSpec<T>, params: WindowParams | undefined, closeWindow: (dialog: DialogInstanceApi<T>) => void) => DialogInstanceApi<T>;
1301
1363
  openUrl: (config: UrlDialogSpec, closeWindow: (dialog: UrlDialogInstanceApi) => void) => UrlDialogInstanceApi;
1302
1364
  alert: (message: string, callback: () => void) => void;
1303
1365
  confirm: (message: string, callback: (state: boolean) => void) => void;
1304
1366
  close: (dialog: InstanceApi<any>) => void;
1305
1367
  }
1306
1368
  interface WindowManager {
1307
- open: <T>(config: DialogSpec<T>, params?: WindowParams) => DialogInstanceApi<T>;
1369
+ open: <T extends DialogData>(config: DialogSpec<T>, params?: WindowParams) => DialogInstanceApi<T>;
1308
1370
  openUrl: (config: UrlDialogSpec) => UrlDialogInstanceApi;
1309
1371
  alert: (message: string, callback?: () => void, scope?: any) => void;
1310
1372
  confirm: (message: string, callback?: (state: boolean) => void, scope?: any) => void;
@@ -1312,7 +1374,7 @@ interface WindowManager {
1312
1374
  }
1313
1375
  interface ExecCommandEvent {
1314
1376
  command: string;
1315
- ui?: boolean;
1377
+ ui: boolean;
1316
1378
  value?: any;
1317
1379
  }
1318
1380
  interface BeforeGetContentEvent extends GetContentArgs {
@@ -1328,6 +1390,9 @@ interface BeforeSetContentEvent extends SetContentArgs {
1328
1390
  interface SetContentEvent extends BeforeSetContentEvent {
1329
1391
  content: string;
1330
1392
  }
1393
+ interface SaveContentEvent extends GetContentEvent {
1394
+ save: boolean;
1395
+ }
1331
1396
  interface NewBlockEvent {
1332
1397
  newBlock: Element;
1333
1398
  }
@@ -1340,7 +1405,7 @@ interface NodeChangeEvent {
1340
1405
  interface FormatEvent {
1341
1406
  format: string;
1342
1407
  vars?: FormatVars;
1343
- node?: Node | RangeLikeObject;
1408
+ node?: Node | RangeLikeObject | null;
1344
1409
  }
1345
1410
  interface ObjectResizeEvent {
1346
1411
  target: HTMLElement;
@@ -1354,11 +1419,11 @@ interface ObjectSelectedEvent {
1354
1419
  }
1355
1420
  interface ScrollIntoViewEvent {
1356
1421
  elm: HTMLElement;
1357
- alignToTop: boolean;
1422
+ alignToTop: boolean | undefined;
1358
1423
  }
1359
1424
  interface SetSelectionRangeEvent {
1360
1425
  range: Range;
1361
- forward: boolean;
1426
+ forward: boolean | undefined;
1362
1427
  }
1363
1428
  interface ShowCaretEvent {
1364
1429
  target: Node;
@@ -1368,10 +1433,12 @@ interface ShowCaretEvent {
1368
1433
  interface SwitchModeEvent {
1369
1434
  mode: string;
1370
1435
  }
1371
- interface AddUndoEvent {
1436
+ interface ChangeEvent {
1372
1437
  level: UndoLevel;
1373
- lastLevel: UndoLevel;
1374
- originalEvent: Event;
1438
+ lastLevel: UndoLevel | undefined;
1439
+ }
1440
+ interface AddUndoEvent extends ChangeEvent {
1441
+ originalEvent: Event | undefined;
1375
1442
  }
1376
1443
  interface UndoRedoEvent {
1377
1444
  level: UndoLevel;
@@ -1422,18 +1489,24 @@ interface TableEventData {
1422
1489
  interface TableModifiedEvent extends TableEventData {
1423
1490
  readonly table: HTMLTableElement;
1424
1491
  }
1492
+ interface BeforeOpenNotificationEvent {
1493
+ notification: NotificationSpec;
1494
+ }
1495
+ interface OpenNotificationEvent {
1496
+ notification: NotificationApi;
1497
+ }
1425
1498
  interface EditorEventMap extends Omit<NativeEventMap, 'blur' | 'focus'> {
1426
1499
  'activate': {
1427
- relatedTarget: Editor;
1500
+ relatedTarget: Editor | null;
1428
1501
  };
1429
1502
  'deactivate': {
1430
1503
  relatedTarget: Editor;
1431
1504
  };
1432
1505
  'focus': {
1433
- blurredEditor: Editor;
1506
+ blurredEditor: Editor | null;
1434
1507
  };
1435
1508
  'blur': {
1436
- focusedEditor: Editor;
1509
+ focusedEditor: Editor | null;
1437
1510
  };
1438
1511
  'resize': UIEvent;
1439
1512
  'scroll': UIEvent;
@@ -1445,7 +1518,7 @@ interface EditorEventMap extends Omit<NativeEventMap, 'blur' | 'focus'> {
1445
1518
  'ObjectResized': ObjectResizeEvent;
1446
1519
  'ObjectResizeStart': ObjectResizeEvent;
1447
1520
  'SwitchMode': SwitchModeEvent;
1448
- 'ScrollWindow': UIEvent;
1521
+ 'ScrollWindow': Event;
1449
1522
  'ResizeWindow': UIEvent;
1450
1523
  'SkinLoaded': {};
1451
1524
  'SkinLoadError': LoadErrorEvent;
@@ -1472,7 +1545,12 @@ interface EditorEventMap extends Omit<NativeEventMap, 'blur' | 'focus'> {
1472
1545
  'GetContent': GetContentEvent;
1473
1546
  'BeforeSetContent': BeforeSetContentEvent;
1474
1547
  'SetContent': SetContentEvent;
1475
- 'LoadContent': {};
1548
+ 'SaveContent': SaveContentEvent;
1549
+ 'RawSaveContent': SaveContentEvent;
1550
+ 'LoadContent': {
1551
+ load: boolean;
1552
+ element: HTMLElement;
1553
+ };
1476
1554
  'PreviewFormats': {};
1477
1555
  'AfterPreviewFormats': {};
1478
1556
  'ScriptsLoaded': {};
@@ -1485,6 +1563,7 @@ interface EditorEventMap extends Omit<NativeEventMap, 'blur' | 'focus'> {
1485
1563
  'Undo': UndoRedoEvent;
1486
1564
  'BeforeAddUndo': AddUndoEvent;
1487
1565
  'AddUndo': AddUndoEvent;
1566
+ 'change': ChangeEvent;
1488
1567
  'CloseWindow': WindowEvent<any>;
1489
1568
  'OpenWindow': WindowEvent<any>;
1490
1569
  'ProgressState': ProgressStateEvent;
@@ -1504,6 +1583,12 @@ interface EditorEventMap extends Omit<NativeEventMap, 'blur' | 'focus'> {
1504
1583
  'TableModified': TableModifiedEvent;
1505
1584
  'NewRow': NewTableRowEvent;
1506
1585
  'NewCell': NewTableCellEvent;
1586
+ 'SetAttrib': SetAttribEvent;
1587
+ 'hide': {};
1588
+ 'show': {};
1589
+ 'dirty': {};
1590
+ 'BeforeOpenNotification': BeforeOpenNotificationEvent;
1591
+ 'OpenNotification': OpenNotificationEvent;
1507
1592
  }
1508
1593
  interface EditorManagerEventMap {
1509
1594
  'AddEditor': {
@@ -1521,6 +1606,7 @@ type EventTypes_d_BeforeGetContentEvent = BeforeGetContentEvent;
1521
1606
  type EventTypes_d_GetContentEvent = GetContentEvent;
1522
1607
  type EventTypes_d_BeforeSetContentEvent = BeforeSetContentEvent;
1523
1608
  type EventTypes_d_SetContentEvent = SetContentEvent;
1609
+ type EventTypes_d_SaveContentEvent = SaveContentEvent;
1524
1610
  type EventTypes_d_NewBlockEvent = NewBlockEvent;
1525
1611
  type EventTypes_d_NodeChangeEvent = NodeChangeEvent;
1526
1612
  type EventTypes_d_FormatEvent = FormatEvent;
@@ -1530,9 +1616,10 @@ type EventTypes_d_ScrollIntoViewEvent = ScrollIntoViewEvent;
1530
1616
  type EventTypes_d_SetSelectionRangeEvent = SetSelectionRangeEvent;
1531
1617
  type EventTypes_d_ShowCaretEvent = ShowCaretEvent;
1532
1618
  type EventTypes_d_SwitchModeEvent = SwitchModeEvent;
1619
+ type EventTypes_d_ChangeEvent = ChangeEvent;
1533
1620
  type EventTypes_d_AddUndoEvent = AddUndoEvent;
1534
1621
  type EventTypes_d_UndoRedoEvent = UndoRedoEvent;
1535
- type EventTypes_d_WindowEvent<_0> = WindowEvent<_0>;
1622
+ type EventTypes_d_WindowEvent<T extends DialogData> = WindowEvent<T>;
1536
1623
  type EventTypes_d_ProgressStateEvent = ProgressStateEvent;
1537
1624
  type EventTypes_d_AfterProgressStateEvent = AfterProgressStateEvent;
1538
1625
  type EventTypes_d_PlaceholderToggleEvent = PlaceholderToggleEvent;
@@ -1546,10 +1633,12 @@ type EventTypes_d_NewTableRowEvent = NewTableRowEvent;
1546
1633
  type EventTypes_d_NewTableCellEvent = NewTableCellEvent;
1547
1634
  type EventTypes_d_TableEventData = TableEventData;
1548
1635
  type EventTypes_d_TableModifiedEvent = TableModifiedEvent;
1636
+ type EventTypes_d_BeforeOpenNotificationEvent = BeforeOpenNotificationEvent;
1637
+ type EventTypes_d_OpenNotificationEvent = OpenNotificationEvent;
1549
1638
  type EventTypes_d_EditorEventMap = EditorEventMap;
1550
1639
  type EventTypes_d_EditorManagerEventMap = EditorManagerEventMap;
1551
1640
  declare namespace EventTypes_d {
1552
- export { EventTypes_d_ExecCommandEvent as ExecCommandEvent, EventTypes_d_BeforeGetContentEvent as BeforeGetContentEvent, EventTypes_d_GetContentEvent as GetContentEvent, EventTypes_d_BeforeSetContentEvent as BeforeSetContentEvent, EventTypes_d_SetContentEvent as SetContentEvent, EventTypes_d_NewBlockEvent as NewBlockEvent, EventTypes_d_NodeChangeEvent as NodeChangeEvent, EventTypes_d_FormatEvent as FormatEvent, EventTypes_d_ObjectResizeEvent as ObjectResizeEvent, EventTypes_d_ObjectSelectedEvent as ObjectSelectedEvent, EventTypes_d_ScrollIntoViewEvent as ScrollIntoViewEvent, EventTypes_d_SetSelectionRangeEvent as SetSelectionRangeEvent, EventTypes_d_ShowCaretEvent as ShowCaretEvent, EventTypes_d_SwitchModeEvent as SwitchModeEvent, EventTypes_d_AddUndoEvent as AddUndoEvent, EventTypes_d_UndoRedoEvent as UndoRedoEvent, EventTypes_d_WindowEvent as WindowEvent, EventTypes_d_ProgressStateEvent as ProgressStateEvent, EventTypes_d_AfterProgressStateEvent as AfterProgressStateEvent, EventTypes_d_PlaceholderToggleEvent as PlaceholderToggleEvent, EventTypes_d_LoadErrorEvent as LoadErrorEvent, EventTypes_d_PreProcessEvent as PreProcessEvent, EventTypes_d_PostProcessEvent as PostProcessEvent, EventTypes_d_PastePlainTextToggleEvent as PastePlainTextToggleEvent, EventTypes_d_PastePreProcessEvent as PastePreProcessEvent, EventTypes_d_PastePostProcessEvent as PastePostProcessEvent, EventTypes_d_NewTableRowEvent as NewTableRowEvent, EventTypes_d_NewTableCellEvent as NewTableCellEvent, EventTypes_d_TableEventData as TableEventData, EventTypes_d_TableModifiedEvent as TableModifiedEvent, EventTypes_d_EditorEventMap as EditorEventMap, EventTypes_d_EditorManagerEventMap as EditorManagerEventMap, };
1641
+ export { EventTypes_d_ExecCommandEvent as ExecCommandEvent, EventTypes_d_BeforeGetContentEvent as BeforeGetContentEvent, EventTypes_d_GetContentEvent as GetContentEvent, EventTypes_d_BeforeSetContentEvent as BeforeSetContentEvent, EventTypes_d_SetContentEvent as SetContentEvent, EventTypes_d_SaveContentEvent as SaveContentEvent, EventTypes_d_NewBlockEvent as NewBlockEvent, EventTypes_d_NodeChangeEvent as NodeChangeEvent, EventTypes_d_FormatEvent as FormatEvent, EventTypes_d_ObjectResizeEvent as ObjectResizeEvent, EventTypes_d_ObjectSelectedEvent as ObjectSelectedEvent, EventTypes_d_ScrollIntoViewEvent as ScrollIntoViewEvent, EventTypes_d_SetSelectionRangeEvent as SetSelectionRangeEvent, EventTypes_d_ShowCaretEvent as ShowCaretEvent, EventTypes_d_SwitchModeEvent as SwitchModeEvent, EventTypes_d_ChangeEvent as ChangeEvent, EventTypes_d_AddUndoEvent as AddUndoEvent, EventTypes_d_UndoRedoEvent as UndoRedoEvent, EventTypes_d_WindowEvent as WindowEvent, EventTypes_d_ProgressStateEvent as ProgressStateEvent, EventTypes_d_AfterProgressStateEvent as AfterProgressStateEvent, EventTypes_d_PlaceholderToggleEvent as PlaceholderToggleEvent, EventTypes_d_LoadErrorEvent as LoadErrorEvent, EventTypes_d_PreProcessEvent as PreProcessEvent, EventTypes_d_PostProcessEvent as PostProcessEvent, EventTypes_d_PastePlainTextToggleEvent as PastePlainTextToggleEvent, EventTypes_d_PastePreProcessEvent as PastePreProcessEvent, EventTypes_d_PastePostProcessEvent as PastePostProcessEvent, EventTypes_d_NewTableRowEvent as NewTableRowEvent, EventTypes_d_NewTableCellEvent as NewTableCellEvent, EventTypes_d_TableEventData as TableEventData, EventTypes_d_TableModifiedEvent as TableModifiedEvent, EventTypes_d_BeforeOpenNotificationEvent as BeforeOpenNotificationEvent, EventTypes_d_OpenNotificationEvent as OpenNotificationEvent, EventTypes_d_EditorEventMap as EditorEventMap, EventTypes_d_EditorManagerEventMap as EditorManagerEventMap, };
1553
1642
  }
1554
1643
  type Format_d_Formats = Formats;
1555
1644
  type Format_d_Format = Format;
@@ -1603,7 +1692,7 @@ declare type ThemeInitFunc = (editor: Editor, elm: HTMLElement) => {
1603
1692
  api?: EditorUiApi;
1604
1693
  };
1605
1694
  declare type SetupCallback = (editor: Editor) => void;
1606
- declare type FilePickerCallback = (callback: Function, value: any, meta: Record<string, any>) => void;
1695
+ declare type FilePickerCallback = (callback: (value: string, meta?: Record<string, any>) => void, value: string, meta: Record<string, any>) => void;
1607
1696
  declare type FilePickerValidationStatus = 'valid' | 'unknown' | 'invalid' | 'none';
1608
1697
  declare type FilePickerValidationCallback = (info: {
1609
1698
  type: string;
@@ -1614,13 +1703,14 @@ declare type FilePickerValidationCallback = (info: {
1614
1703
  }) => void) => void;
1615
1704
  declare type PastePreProcessFn = (editor: Editor, args: PastePreProcessEvent) => void;
1616
1705
  declare type PastePostProcessFn = (editor: Editor, args: PastePostProcessEvent) => void;
1617
- declare type URLConverter = (url: string, name: string, elm?: HTMLElement) => string;
1618
- declare type URLConverterCallback = (url: string, node: Node, on_save: boolean, name: string) => string;
1706
+ declare type URLConverter = (url: string, name: string, elm?: string | Element) => string;
1707
+ declare type URLConverterCallback = (url: string, node: Node | string | undefined, on_save: boolean, name: string) => string;
1619
1708
  interface ToolbarGroup {
1620
1709
  name?: string;
1621
1710
  items: string[];
1622
1711
  }
1623
1712
  declare type ToolbarMode = 'floating' | 'sliding' | 'scrolling' | 'wrap';
1713
+ declare type ToolbarLocation = 'top' | 'bottom' | 'auto';
1624
1714
  interface BaseEditorOptions {
1625
1715
  a11y_advanced_options?: boolean;
1626
1716
  add_form_submit_trigger?: boolean;
@@ -1646,7 +1736,13 @@ interface BaseEditorOptions {
1646
1736
  branding?: boolean;
1647
1737
  cache_suffix?: string;
1648
1738
  color_cols?: number;
1739
+ color_cols_foreground?: number;
1740
+ color_cols_background?: number;
1649
1741
  color_map?: string[];
1742
+ color_map_foreground?: string[];
1743
+ color_map_background?: string[];
1744
+ color_default_foreground?: string;
1745
+ color_default_background?: string;
1650
1746
  content_css?: boolean | string | string[];
1651
1747
  content_css_cors?: boolean;
1652
1748
  content_security_policy?: string;
@@ -1664,6 +1760,7 @@ interface BaseEditorOptions {
1664
1760
  directionality?: 'ltr' | 'rtl';
1665
1761
  doctype?: string;
1666
1762
  document_base_url?: string;
1763
+ draggable_modal?: boolean;
1667
1764
  editable_class?: string;
1668
1765
  element_format?: 'xhtml' | 'html';
1669
1766
  elementpath?: boolean;
@@ -1688,6 +1785,7 @@ interface BaseEditorOptions {
1688
1785
  forced_root_block?: string;
1689
1786
  forced_root_block_attrs?: Record<string, string>;
1690
1787
  formats?: Formats;
1788
+ format_noneditable_selector?: string;
1691
1789
  height?: number | string;
1692
1790
  hidden_input?: boolean;
1693
1791
  icons?: string;
@@ -1748,6 +1846,7 @@ interface BaseEditorOptions {
1748
1846
  placeholder?: string;
1749
1847
  preserve_cdata?: boolean;
1750
1848
  preview_styles?: false | string;
1849
+ promotion?: boolean;
1751
1850
  protect?: RegExp[];
1752
1851
  readonly?: boolean;
1753
1852
  referrer_policy?: ReferrerPolicy;
@@ -1774,6 +1873,7 @@ interface BaseEditorOptions {
1774
1873
  table_tab_navigation?: boolean;
1775
1874
  target?: HTMLElement;
1776
1875
  text_patterns?: RawPattern[] | false;
1876
+ text_patterns_lookup?: RawDynamicPatternsLookup;
1777
1877
  theme?: string | ThemeInitFunc | false;
1778
1878
  theme_url?: string;
1779
1879
  toolbar?: boolean | string | string[] | Array<ToolbarGroup>;
@@ -1786,6 +1886,8 @@ interface BaseEditorOptions {
1786
1886
  toolbar7?: string;
1787
1887
  toolbar8?: string;
1788
1888
  toolbar9?: string;
1889
+ toolbar_groups?: Record<string, GroupToolbarButtonSpec>;
1890
+ toolbar_location?: ToolbarLocation;
1789
1891
  toolbar_mode?: ToolbarMode;
1790
1892
  toolbar_sticky?: boolean;
1791
1893
  toolbar_sticky_offset?: number;
@@ -1819,15 +1921,78 @@ interface NormalizedEditorOptions extends BaseEditorOptions {
1819
1921
  plugins: string[];
1820
1922
  }
1821
1923
  interface EditorOptions extends NormalizedEditorOptions {
1924
+ a11y_advanced_options: boolean;
1925
+ allow_unsafe_link_target: boolean;
1926
+ anchor_bottom: string;
1927
+ anchor_top: string;
1928
+ automatic_uploads: boolean;
1929
+ block_formats: string;
1930
+ body_class: string;
1931
+ body_id: string;
1932
+ br_newline_selector: string;
1933
+ color_map: string[];
1934
+ color_cols: number;
1935
+ color_cols_foreground: number;
1936
+ color_cols_background: number;
1937
+ color_default_background: string;
1938
+ color_default_foreground: string;
1822
1939
  content_css: string[];
1823
1940
  contextmenu: string[];
1941
+ custom_colors: boolean;
1942
+ document_base_url: string;
1943
+ draggable_modal: boolean;
1944
+ editable_class: string;
1824
1945
  font_css: string[];
1946
+ font_family_formats: string;
1947
+ font_size_classes: string;
1948
+ font_size_formats: string;
1949
+ font_size_legacy_values: string;
1950
+ font_size_style_values: string;
1825
1951
  forced_root_block: string;
1826
1952
  forced_root_block_attrs: Record<string, string>;
1953
+ format_noneditable_selector: string;
1954
+ height: number | string;
1955
+ iframe_attrs: Record<string, string>;
1956
+ images_file_types: string;
1957
+ images_upload_base_path: string;
1958
+ images_upload_credentials: boolean;
1959
+ images_upload_url: string;
1960
+ indent_use_margin: boolean;
1961
+ indentation: string;
1962
+ inline: boolean;
1963
+ inline_boundaries_selector: string;
1964
+ language: string;
1965
+ language_load: boolean;
1966
+ language_url: string;
1967
+ line_height_formats: string;
1968
+ menu: Record<string, {
1969
+ title: string;
1970
+ items: string;
1971
+ }>;
1972
+ menubar: boolean | string;
1973
+ model: string;
1974
+ no_newline_selector: string;
1975
+ noneditable_class: string;
1827
1976
  noneditable_regexp: RegExp[];
1828
- object_resizing?: string;
1829
- preview_styles?: string;
1830
- text_patterns?: Pattern[];
1977
+ object_resizing: string;
1978
+ paste_as_text: boolean;
1979
+ preview_styles: string;
1980
+ promotion: boolean;
1981
+ readonly: boolean;
1982
+ removed_menuitems: string;
1983
+ toolbar: boolean | string | string[] | Array<ToolbarGroup>;
1984
+ toolbar_groups: Record<string, GroupToolbarButtonSpec>;
1985
+ toolbar_location: ToolbarLocation;
1986
+ toolbar_mode: ToolbarMode;
1987
+ toolbar_persist: boolean;
1988
+ toolbar_sticky: boolean;
1989
+ toolbar_sticky_offset: number;
1990
+ text_patterns: Pattern[];
1991
+ text_patterns_lookup: DynamicPatternsLookup;
1992
+ visual: boolean;
1993
+ visual_anchor_class: string;
1994
+ visual_table_class: string;
1995
+ width: number | string;
1831
1996
  }
1832
1997
  declare type StyleMap = Record<string, string | number>;
1833
1998
  interface StylesSettings {
@@ -1837,13 +2002,22 @@ interface StylesSettings {
1837
2002
  url_converter_scope?: any;
1838
2003
  }
1839
2004
  interface Styles {
1840
- parse: (css: string) => Record<string, string>;
2005
+ parse: (css: string | undefined) => Record<string, string>;
1841
2006
  serialize: (styles: StyleMap, elementName?: string) => string;
1842
2007
  }
1843
- declare type EventUtilsCallback<T> = (event: EventUtilsEvent<T>) => void;
2008
+ declare type EventUtilsCallback<T> = (event: EventUtilsEvent<T>) => void | boolean;
1844
2009
  declare type EventUtilsEvent<T> = NormalizedEvent<T> & {
1845
2010
  metaKey: boolean;
1846
2011
  };
2012
+ interface Callback$1<T> {
2013
+ func: EventUtilsCallback<T>;
2014
+ scope: any;
2015
+ }
2016
+ interface CallbackList<T> extends Array<Callback$1<T>> {
2017
+ fakeName: string | false;
2018
+ capture: boolean;
2019
+ nativeHandler: EventListener;
2020
+ }
1847
2021
  interface EventUtilsConstructor {
1848
2022
  readonly prototype: EventUtils;
1849
2023
  new (): EventUtils;
@@ -1852,11 +2026,9 @@ interface EventUtilsConstructor {
1852
2026
  declare class EventUtils {
1853
2027
  static Event: EventUtils;
1854
2028
  domLoaded: boolean;
1855
- events: Record<string, any>;
2029
+ events: Record<number, Record<string, CallbackList<any>>>;
1856
2030
  private readonly expando;
1857
2031
  private hasFocusIn;
1858
- private hasMouseEnterLeave;
1859
- private mouseEnterLeave;
1860
2032
  private count;
1861
2033
  constructor();
1862
2034
  bind<K extends keyof HTMLElementEventMap>(target: any, name: K, callback: EventUtilsCallback<HTMLElementEventMap[K]>, scope?: any): EventUtilsCallback<HTMLElementEventMap[K]>;
@@ -1868,9 +2040,14 @@ declare class EventUtils {
1868
2040
  dispatch(target: any, name: string, args?: {}): this;
1869
2041
  clean(target: any): this;
1870
2042
  destroy(): void;
1871
- cancel<T = any>(e: EventUtilsEvent<T>): boolean;
2043
+ cancel<T>(e: EventUtilsEvent<T>): boolean;
1872
2044
  private executeHandlers;
1873
2045
  }
2046
+ interface SetAttribEvent {
2047
+ attrElm: HTMLElement;
2048
+ attrName: string;
2049
+ attrValue: string | boolean | number | null;
2050
+ }
1874
2051
  interface DOMUtilsSettings {
1875
2052
  schema: Schema;
1876
2053
  url_converter: URLConverter;
@@ -1878,14 +2055,14 @@ interface DOMUtilsSettings {
1878
2055
  ownEvents: boolean;
1879
2056
  keep_values: boolean;
1880
2057
  update_styles: boolean;
1881
- root_element: HTMLElement;
1882
- collect: Function;
1883
- onSetAttrib: Function;
2058
+ root_element: HTMLElement | null;
2059
+ collect: boolean;
2060
+ onSetAttrib: (event: SetAttribEvent) => void;
1884
2061
  contentCssCors: boolean;
1885
2062
  referrerPolicy: ReferrerPolicy;
1886
2063
  }
1887
2064
  declare type Target = Node | Window;
1888
- declare type RunArguments<T extends Node = Node> = string | T | Array<string | T>;
2065
+ declare type RunArguments<T extends Node = Node> = string | T | Array<string | T> | null;
1889
2066
  declare type BoundEvent = [
1890
2067
  Target,
1891
2068
  string,
@@ -1893,7 +2070,7 @@ declare type BoundEvent = [
1893
2070
  any
1894
2071
  ];
1895
2072
  declare type Callback<K extends string> = EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>;
1896
- declare type RunResult<T, R> = T extends Array<any> ? false | R[] : false | R;
2073
+ declare type RunResult<T, R> = T extends Array<any> ? R[] : false | R;
1897
2074
  interface DOMUtils {
1898
2075
  doc: Document;
1899
2076
  settings: Partial<DOMUtilsSettings>;
@@ -1906,8 +2083,11 @@ interface DOMUtils {
1906
2083
  styles: Styles;
1907
2084
  schema: Schema;
1908
2085
  events: EventUtils;
1909
- root: Node;
1910
- isBlock: (node: string | Node) => boolean;
2086
+ root: Node | null;
2087
+ isBlock: {
2088
+ (node: Node | null): node is HTMLElement;
2089
+ (node: string): boolean;
2090
+ };
1911
2091
  clone: (node: Node, deep: boolean) => Node;
1912
2092
  getRoot: () => HTMLElement;
1913
2093
  getViewPort: (argWin?: Window) => GeomRect;
@@ -1917,39 +2097,52 @@ interface DOMUtils {
1917
2097
  h: number;
1918
2098
  };
1919
2099
  getParent: {
1920
- <K extends keyof HTMLElementTagNameMap>(node: string | Node, selector: K, root?: Node): HTMLElementTagNameMap[K] | null;
1921
- <T extends HTMLElement>(node: string | Node, selector: (node: HTMLElement) => node is T, root?: Node): T | null;
1922
- <T extends Element = Element>(node: string | Node, selector?: string | ((node: HTMLElement) => boolean | void), root?: Node): T | null;
2100
+ <K extends keyof HTMLElementTagNameMap>(node: string | Node | null, selector: K, root?: Node): HTMLElementTagNameMap[K] | null;
2101
+ <T extends Element>(node: string | Node | null, selector: string | ((node: Node) => node is T), root?: Node): T | null;
2102
+ (node: string | Node | null, selector?: string | ((node: Node) => boolean | void), root?: Node): Node | null;
1923
2103
  };
1924
2104
  getParents: {
1925
- <K extends keyof HTMLElementTagNameMap>(elm: string | Node, selector: K, root?: Node, collect?: boolean): Array<HTMLElementTagNameMap[K]>;
1926
- <T extends HTMLElement>(node: string | Node, selector: (node: HTMLElement) => node is T, root?: Node): T[];
1927
- <T extends Element = Element>(elm: string | Node, selector?: string | ((node: HTMLElement) => boolean | void), root?: Node, collect?: boolean): T[];
2105
+ <K extends keyof HTMLElementTagNameMap>(elm: string | HTMLElementTagNameMap[K] | null, selector: K, root?: Node, collect?: boolean): Array<HTMLElementTagNameMap[K]>;
2106
+ <T extends Element>(node: string | Node | null, selector: string | ((node: Node) => node is T), root?: Node, collect?: boolean): T[];
2107
+ (elm: string | Node | null, selector?: string | ((node: Node) => boolean | void), root?: Node, collect?: boolean): Node[];
2108
+ };
2109
+ get: {
2110
+ <T extends Node>(elm: T): T;
2111
+ (elm: string): HTMLElement | null;
1928
2112
  };
1929
- get: (elm: string | Node) => HTMLElement | null;
1930
- getNext: (node: Node, selector: string | ((node: Node) => boolean)) => Node | null;
1931
- getPrev: (node: Node, selector: string | ((node: Node) => boolean)) => Node | null;
2113
+ getNext: (node: Node | null, selector: string | ((node: Node) => boolean)) => Node | null;
2114
+ getPrev: (node: Node | null, selector: string | ((node: Node) => boolean)) => Node | null;
1932
2115
  select: {
1933
2116
  <K extends keyof HTMLElementTagNameMap>(selector: K, scope?: string | Node): Array<HTMLElementTagNameMap[K]>;
1934
2117
  <T extends HTMLElement = HTMLElement>(selector: string, scope?: string | Node): T[];
1935
2118
  };
1936
- is: (elm: Node | Node[], selector: string) => boolean;
1937
- add: (parentElm: RunArguments, name: string | Node, attrs?: Record<string, string | boolean | number>, html?: string | Node, create?: boolean) => HTMLElement;
2119
+ is: {
2120
+ <T extends Element>(elm: Node | Node[] | null, selector: string): elm is T;
2121
+ (elm: Node | Node[] | null, selector: string): boolean;
2122
+ };
2123
+ add: (parentElm: RunArguments, name: string | Element, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null, create?: boolean) => HTMLElement;
1938
2124
  create: {
1939
- <K extends keyof HTMLElementTagNameMap>(name: K, attrs?: Record<string, string | boolean | number>, html?: string | Node): HTMLElementTagNameMap[K];
1940
- (name: string, attrs?: Record<string, string | boolean | number>, html?: string | Node): HTMLElement;
2125
+ <K extends keyof HTMLElementTagNameMap>(name: K, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null): HTMLElementTagNameMap[K];
2126
+ (name: string, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null): HTMLElement;
1941
2127
  };
1942
- createHTML: (name: string, attrs?: Record<string, string>, html?: string) => string;
2128
+ createHTML: (name: string, attrs?: Record<string, string | null>, html?: string) => string;
1943
2129
  createFragment: (html?: string) => DocumentFragment;
1944
- remove: <T extends Node>(node: string | T | T[], keepChildren?: boolean) => RunResult<typeof node, T>;
1945
- setStyle: (elm: string | Node | Node[], name: string, value: string | number | null) => void;
1946
- getStyle: (elm: string | Node, name: string, computed?: boolean) => string | undefined;
1947
- setStyles: (elm: string | Node | Node[], stylesArg: StyleMap) => void;
2130
+ remove: {
2131
+ <T extends Node>(node: T | T[], keepChildren?: boolean): typeof node extends Array<any> ? T[] : T;
2132
+ <T extends Node>(node: string, keepChildren?: boolean): T | false;
2133
+ };
2134
+ getStyle: {
2135
+ (elm: Element, name: string, computed: true): string;
2136
+ (elm: string | Element | null, name: string, computed?: boolean): string | undefined;
2137
+ };
2138
+ setStyle: (elm: string | Element | Element[], name: string, value: string | number | null) => void;
2139
+ setStyles: (elm: string | Element | Element[], stylesArg: StyleMap) => void;
1948
2140
  removeAllAttribs: (e: RunArguments<Element>) => void;
1949
- setAttrib: (elm: string | Node | Node[], name: string, value: string | boolean | number | null) => void;
1950
- setAttribs: (elm: string | Node | Node[], attrs: Record<string, string | boolean | number | null>) => void;
1951
- getAttrib: (elm: string | Node, name: string, defaultVal?: string) => string;
1952
- getPos: (elm: string | Node, rootElm?: Node) => {
2141
+ setAttrib: (elm: RunArguments<Element>, name: string, value: string | boolean | number | null) => void;
2142
+ setAttribs: (elm: RunArguments<Element>, attrs: Record<string, string | boolean | number | null>) => void;
2143
+ getAttrib: (elm: string | Element | null, name: string, defaultVal?: string) => string;
2144
+ getAttribs: (elm: string | Element) => NamedNodeMap | Attr[];
2145
+ getPos: (elm: string | Element, rootElm?: Node) => {
1953
2146
  x: number;
1954
2147
  y: number;
1955
2148
  };
@@ -1957,15 +2150,15 @@ interface DOMUtils {
1957
2150
  serializeStyle: (stylesArg: StyleMap, name?: string) => string;
1958
2151
  addStyle: (cssText: string) => void;
1959
2152
  loadCSS: (url: string) => void;
1960
- addClass: (elm: string | Node | Node[], cls: string) => void;
1961
- removeClass: (elm: string | Node | Node[], cls: string) => void;
1962
- hasClass: (elm: string | Node, cls: string) => boolean;
1963
- toggleClass: (elm: string | Node | Node[], cls: string, state?: boolean) => void;
2153
+ hasClass: (elm: string | Element, cls: string) => boolean;
2154
+ addClass: (elm: RunArguments<Element>, cls: string) => void;
2155
+ removeClass: (elm: RunArguments<Element>, cls: string) => void;
2156
+ toggleClass: (elm: RunArguments<Element>, cls: string, state?: boolean) => void;
1964
2157
  show: (elm: string | Node | Node[]) => void;
1965
2158
  hide: (elm: string | Node | Node[]) => void;
1966
2159
  isHidden: (elm: string | Node) => boolean;
1967
2160
  uniqueId: (prefix?: string) => string;
1968
- setHTML: (elm: string | Node | Node[], html: string) => void;
2161
+ setHTML: (elm: RunArguments<Element>, html: string) => void;
1969
2162
  getOuterHTML: (elm: string | Node) => string;
1970
2163
  setOuterHTML: (elm: string | Node | Node[], html: string) => void;
1971
2164
  decode: (text: string) => string;
@@ -1982,16 +2175,15 @@ interface DOMUtils {
1982
2175
  <K extends keyof HTMLElementTagNameMap>(elm: Element, name: K): HTMLElementTagNameMap[K];
1983
2176
  (elm: Element, name: string): Element;
1984
2177
  };
1985
- findCommonAncestor: (a: Node, b: Node) => Node;
2178
+ findCommonAncestor: (a: Node, b: Node) => Node | null;
1986
2179
  run<R, T extends Node>(this: DOMUtils, elm: T | T[], func: (node: T) => R, scope?: any): typeof elm extends Array<any> ? R[] : R;
1987
2180
  run<R, T extends Node>(this: DOMUtils, elm: RunArguments<T>, func: (node: T) => R, scope?: any): RunResult<typeof elm, R>;
1988
- getAttribs: (elm: string | Node) => NamedNodeMap | Attr[];
1989
2181
  isEmpty: (node: Node, elements?: Record<string, any>) => boolean;
1990
2182
  createRng: () => Range;
1991
2183
  nodeIndex: (node: Node, normalized?: boolean) => number;
1992
2184
  split: {
1993
- <T extends Node>(parentElm: Node, splitElm: Node, replacementElm: T): T;
1994
- <T extends Node>(parentElm: Node, splitElm: T): T;
2185
+ <T extends Node>(parentElm: Node, splitElm: Node, replacementElm: T): T | undefined;
2186
+ <T extends Node>(parentElm: Node, splitElm: T): T | undefined;
1995
2187
  };
1996
2188
  bind: {
1997
2189
  <K extends string>(target: Target, name: K, func: Callback<K>, scope?: any): Callback<K>;
@@ -2018,12 +2210,12 @@ interface ClientRect {
2018
2210
  height: number;
2019
2211
  }
2020
2212
  interface BookmarkManager {
2021
- getBookmark: (type: number, normalized?: boolean) => Bookmark;
2213
+ getBookmark: (type?: number, normalized?: boolean) => Bookmark;
2022
2214
  moveToBookmark: (bookmark: Bookmark) => void;
2023
2215
  }
2024
2216
  interface ControlSelection {
2025
2217
  isResizable: (elm: Element) => boolean;
2026
- showResizeRect: (elm: Element) => void;
2218
+ showResizeRect: (elm: HTMLElement) => void;
2027
2219
  hideResizeRect: () => void;
2028
2220
  updateResizeRect: (evt: EditorEvent<any>) => void;
2029
2221
  destroy: () => void;
@@ -2048,7 +2240,7 @@ interface Writer {
2048
2240
  getContent: () => string;
2049
2241
  pi: (name: string, text?: string) => void;
2050
2242
  reset: () => void;
2051
- start: (name: string, attrs?: Attributes, empty?: boolean) => void;
2243
+ start: (name: string, attrs?: Attributes | null, empty?: boolean) => void;
2052
2244
  text: (text: string, raw?: boolean) => void;
2053
2245
  }
2054
2246
  interface HtmlSerializerSettings extends WriterSettings {
@@ -2108,7 +2300,7 @@ interface EditorSelection {
2108
2300
  isCollapsed: () => boolean;
2109
2301
  isForward: () => boolean;
2110
2302
  setNode: (elm: Element) => Element;
2111
- getNode: () => Element;
2303
+ getNode: () => HTMLElement;
2112
2304
  getSel: () => Selection | null;
2113
2305
  setRng: (rng: Range, forward?: boolean) => void;
2114
2306
  getRng: () => Range;
@@ -2119,23 +2311,26 @@ interface EditorSelection {
2119
2311
  selectorChanged: (selector: string, callback: (active: boolean, args: {
2120
2312
  node: Node;
2121
2313
  selector: String;
2122
- parents: Element[];
2314
+ parents: Node[];
2123
2315
  }) => void) => EditorSelection;
2124
2316
  selectorChangedWithUnbind: (selector: string, callback: (active: boolean, args: {
2125
2317
  node: Node;
2126
2318
  selector: String;
2127
- parents: Element[];
2319
+ parents: Node[];
2128
2320
  }) => void) => {
2129
2321
  unbind: () => void;
2130
2322
  };
2131
- getScrollContainer: () => HTMLElement;
2323
+ getScrollContainer: () => HTMLElement | undefined;
2132
2324
  scrollIntoView: (elm?: HTMLElement, alignToTop?: boolean) => void;
2133
2325
  placeCaretAt: (clientX: number, clientY: number) => void;
2134
2326
  getBoundingClientRect: () => ClientRect | DOMRect;
2135
2327
  destroy: () => void;
2328
+ expand: (options?: {
2329
+ type: 'word';
2330
+ }) => void;
2136
2331
  }
2137
- declare type EditorCommandCallback = (ui: boolean, value: any) => void;
2138
- declare type EditorCommandsCallback = (command: string, ui: boolean, value: any) => void;
2332
+ declare type EditorCommandCallback<S> = (this: S, ui: boolean, value: any) => void;
2333
+ declare type EditorCommandsCallback = (command: string, ui: boolean, value?: any) => void;
2139
2334
  interface Commands {
2140
2335
  state: Record<string, (command: string) => boolean>;
2141
2336
  exec: Record<string, EditorCommandsCallback>;
@@ -2157,10 +2352,13 @@ declare class EditorCommands {
2157
2352
  queryCommandValue(command: string): string;
2158
2353
  addCommands<K extends keyof Commands>(commandList: Commands[K], type: K): void;
2159
2354
  addCommands(commandList: Record<string, EditorCommandsCallback>): void;
2160
- addCommand(command: string, callback: EditorCommandCallback, scope?: any): void;
2355
+ addCommand<S>(command: string, callback: EditorCommandCallback<S>, scope: S): void;
2356
+ addCommand(command: string, callback: EditorCommandCallback<Editor>): void;
2161
2357
  queryCommandSupported(command: string): boolean;
2162
- addQueryStateHandler(command: string, callback: () => boolean, scope?: any): void;
2163
- addQueryValueHandler(command: string, callback: () => string, scope?: any): void;
2358
+ addQueryStateHandler<S>(command: string, callback: (this: S) => boolean, scope: S): void;
2359
+ addQueryStateHandler(command: string, callback: (this: Editor) => boolean): void;
2360
+ addQueryValueHandler<S>(command: string, callback: (this: S) => string, scope: S): void;
2361
+ addQueryValueHandler(command: string, callback: (this: Editor) => string): void;
2164
2362
  }
2165
2363
  interface RawString {
2166
2364
  raw: string;
@@ -2170,7 +2368,7 @@ declare type TokenisedString = [
2170
2368
  string,
2171
2369
  ...Primitive[]
2172
2370
  ];
2173
- declare type Untranslated = Primitive | TokenisedString | RawString;
2371
+ declare type Untranslated = Primitive | TokenisedString | RawString | null | undefined;
2174
2372
  declare type TranslatedString = string;
2175
2373
  interface I18n {
2176
2374
  getData: () => Record<string, Record<string, string>>;
@@ -2181,7 +2379,7 @@ interface I18n {
2181
2379
  isRtl: () => boolean;
2182
2380
  hasCode: (code: string) => boolean;
2183
2381
  }
2184
- interface Observable<T> {
2382
+ interface Observable<T extends {}> {
2185
2383
  fire<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U, bubble?: boolean): EditorEvent<U>;
2186
2384
  dispatch<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U, bubble?: boolean): EditorEvent<U>;
2187
2385
  on<K extends string>(name: K, callback: (event: EditorEvent<MappedEvent<T, K>>) => void, prepend?: boolean): EventDispatcher<T>;
@@ -2213,7 +2411,7 @@ interface SafeUriOptions {
2213
2411
  }
2214
2412
  declare class URI {
2215
2413
  static parseDataUri(uri: string): {
2216
- type: string;
2414
+ type: string | undefined;
2217
2415
  data: string;
2218
2416
  };
2219
2417
  static isDomSafe(uri: string, context?: string, options?: SafeUriOptions): boolean;
@@ -2224,19 +2422,19 @@ declare class URI {
2224
2422
  pathname?: string;
2225
2423
  }): string;
2226
2424
  source: string;
2227
- protocol: string;
2228
- authority: string;
2229
- userInfo: string;
2230
- user: string;
2231
- password: string;
2232
- host: string;
2233
- port: string;
2234
- relative: string;
2425
+ protocol: string | undefined;
2426
+ authority: string | undefined;
2427
+ userInfo: string | undefined;
2428
+ user: string | undefined;
2429
+ password: string | undefined;
2430
+ host: string | undefined;
2431
+ port: string | undefined;
2432
+ relative: string | undefined;
2235
2433
  path: string;
2236
2434
  directory: string;
2237
- file: string;
2238
- query: string;
2239
- anchor: string;
2435
+ file: string | undefined;
2436
+ query: string | undefined;
2437
+ anchor: string | undefined;
2240
2438
  settings: URISettings;
2241
2439
  constructor(url: string, settings?: URISettings);
2242
2440
  setPath(path: string): void;
@@ -2252,8 +2450,8 @@ interface EditorManager extends Observable<EditorManagerEventMap> {
2252
2450
  majorVersion: string;
2253
2451
  minorVersion: string;
2254
2452
  releaseDate: string;
2255
- activeEditor: Editor;
2256
- focusedEditor: Editor;
2453
+ activeEditor: Editor | null;
2454
+ focusedEditor: Editor | null;
2257
2455
  baseURI: URI;
2258
2456
  baseURL: string;
2259
2457
  documentBaseURL: string;
@@ -2264,11 +2462,12 @@ interface EditorManager extends Observable<EditorManagerEventMap> {
2264
2462
  createEditor(this: EditorManager, id: string, options: RawEditorOptions): Editor;
2265
2463
  execCommand(this: EditorManager, cmd: string, ui: boolean, value: any): boolean;
2266
2464
  get(this: EditorManager): Editor[];
2267
- get(this: EditorManager, id: number | string): Editor;
2465
+ get(this: EditorManager, id: number | string): Editor | null;
2268
2466
  init(this: EditorManager, options: RawEditorOptions): Promise<Editor[]>;
2269
2467
  overrideDefaults(this: EditorManager, defaultOptions: Partial<RawEditorOptions>): void;
2270
2468
  remove(this: EditorManager): void;
2271
- remove(this: EditorManager, selector: string | Editor): Editor | void;
2469
+ remove(this: EditorManager, selector: string): void;
2470
+ remove(this: EditorManager, editor: Editor): Editor | null;
2272
2471
  setActive(this: EditorManager, editor: Editor): void;
2273
2472
  setup(this: EditorManager): void;
2274
2473
  translate: (text: Untranslated) => TranslatedString;
@@ -2277,7 +2476,7 @@ interface EditorManager extends Observable<EditorManagerEventMap> {
2277
2476
  }
2278
2477
  interface EditorObservable extends Observable<EditorEventMap> {
2279
2478
  bindPendingEventDelegates(this: Editor): void;
2280
- toggleNativeEvent(this: Editor, name: string, state: boolean): any;
2479
+ toggleNativeEvent(this: Editor, name: string, state: boolean): void;
2281
2480
  unbindAllNativeEvents(this: Editor): void;
2282
2481
  }
2283
2482
  interface ProcessorSuccess<T> {
@@ -2328,7 +2527,7 @@ interface Options {
2328
2527
  };
2329
2528
  isRegistered: (name: string) => boolean;
2330
2529
  get: {
2331
- <K extends keyof EditorOptions>(name: K): EditorOptions[K] | undefined;
2530
+ <K extends keyof EditorOptions>(name: K): EditorOptions[K];
2332
2531
  <T>(name: string): T | undefined;
2333
2532
  };
2334
2533
  set: <K extends string, T>(name: K, value: K extends keyof NormalizedEditorOptions ? NormalizedEditorOptions[K] : T) => boolean;
@@ -2353,7 +2552,7 @@ interface EditorUpload {
2353
2552
  declare type FormatChangeCallback = (state: boolean, data: {
2354
2553
  node: Node;
2355
2554
  format: string;
2356
- parents: any;
2555
+ parents: Element[];
2357
2556
  }) => void;
2358
2557
  interface FormatRegistry {
2359
2558
  get: {
@@ -2365,18 +2564,18 @@ interface FormatRegistry {
2365
2564
  unregister: (name: string) => Formats;
2366
2565
  }
2367
2566
  interface Formatter extends FormatRegistry {
2368
- apply: (name: string, vars?: FormatVars, node?: Node | RangeLikeObject) => void;
2567
+ apply: (name: string, vars?: FormatVars, node?: Node | RangeLikeObject | null) => void;
2369
2568
  remove: (name: string, vars?: FormatVars, node?: Node | Range, similar?: boolean) => void;
2370
2569
  toggle: (name: string, vars?: FormatVars, node?: Node) => void;
2371
2570
  match: (name: string, vars?: FormatVars, node?: Node, similar?: boolean) => boolean;
2372
2571
  closest: (names: string[]) => string | null;
2373
2572
  matchAll: (names: string[], vars?: FormatVars) => string[];
2374
- matchNode: (node: Node, name: string, vars?: FormatVars, similar?: boolean) => Format | undefined;
2573
+ matchNode: (node: Node | null, name: string, vars?: FormatVars, similar?: boolean) => Format | undefined;
2375
2574
  canApply: (name: string) => boolean;
2376
2575
  formatChanged: (names: string, callback: FormatChangeCallback, similar?: boolean, vars?: FormatVars) => {
2377
2576
  unbind: () => void;
2378
2577
  };
2379
- getCssText: (format: string | Format) => string;
2578
+ getCssText: (format: string | ApplyFormat) => string;
2380
2579
  }
2381
2580
  interface EditorMode {
2382
2581
  isReadOnly: () => boolean;
@@ -2419,7 +2618,7 @@ declare class Shortcuts {
2419
2618
  private readonly shortcuts;
2420
2619
  private pendingPatterns;
2421
2620
  constructor(editor: Editor);
2422
- add(pattern: string, desc: string, cmdFunc: CommandFunc, scope?: any): boolean;
2621
+ add(pattern: string, desc: string | null, cmdFunc: CommandFunc, scope?: any): boolean;
2423
2622
  remove(pattern: string): boolean;
2424
2623
  private normalizeCommandFunc;
2425
2624
  private createShortcut;
@@ -2428,17 +2627,18 @@ declare class Shortcuts {
2428
2627
  private matchShortcut;
2429
2628
  private executeShortcutAction;
2430
2629
  }
2630
+ interface RenderResult {
2631
+ iframeContainer?: HTMLElement;
2632
+ editorContainer: HTMLElement;
2633
+ api?: Partial<EditorUiApi>;
2634
+ }
2431
2635
  interface Theme {
2432
2636
  ui?: any;
2433
2637
  inline?: any;
2434
2638
  execCommand?: (command: string, ui?: boolean, value?: any) => boolean;
2435
2639
  destroy?: () => void;
2436
2640
  init?: (editor: Editor, url: string) => void;
2437
- renderUI?: () => {
2438
- iframeContainer?: HTMLIFrameElement;
2439
- editorContainer: HTMLElement;
2440
- api?: Partial<EditorUiApi>;
2441
- };
2641
+ renderUI?: () => RenderResult;
2442
2642
  getNotificationManagerImpl?: () => NotificationManagerImpl;
2443
2643
  getWindowManagerImpl?: () => WindowManagerImpl;
2444
2644
  }
@@ -2464,34 +2664,34 @@ declare class Editor implements EditorObservable {
2464
2664
  editorCommands: EditorCommands;
2465
2665
  suffix: string;
2466
2666
  editorManager: EditorManager;
2667
+ hidden: boolean;
2467
2668
  inline: boolean;
2669
+ hasVisual: boolean;
2468
2670
  isNotDirty: boolean;
2469
2671
  annotator: Annotator;
2470
- bodyElement: HTMLElement;
2672
+ bodyElement: HTMLElement | undefined;
2471
2673
  bookmark: any;
2472
2674
  composing: boolean;
2473
2675
  container: HTMLElement;
2474
2676
  contentAreaContainer: HTMLElement;
2475
2677
  contentDocument: Document;
2476
2678
  contentWindow: Window;
2477
- delegates: Record<string, (event: any) => void>;
2679
+ delegates: Record<string, EventUtilsCallback<any>> | undefined;
2478
2680
  destroyed: boolean;
2479
2681
  dom: DOMUtils;
2480
2682
  editorContainer: HTMLElement;
2481
2683
  editorUpload: EditorUpload;
2482
- eventRoot?: Element;
2684
+ eventRoot: Element | undefined;
2483
2685
  formatter: Formatter;
2484
- formElement: HTMLElement;
2485
- formEventDelegate: (e: Event) => void;
2686
+ formElement: HTMLElement | undefined;
2687
+ formEventDelegate: ((e: Event) => void) | undefined;
2486
2688
  hasHiddenInput: boolean;
2487
- hasVisual: boolean;
2488
- hidden: boolean;
2489
2689
  iframeElement: HTMLIFrameElement | null;
2490
- iframeHTML: string;
2690
+ iframeHTML: string | undefined;
2491
2691
  initialized: boolean;
2492
2692
  notificationManager: NotificationManager;
2493
2693
  orgDisplay: string;
2494
- orgVisibility: string;
2694
+ orgVisibility: string | undefined;
2495
2695
  parser: DomParser;
2496
2696
  quirks: Quirks;
2497
2697
  readonly: boolean;
@@ -2505,8 +2705,8 @@ declare class Editor implements EditorObservable {
2505
2705
  model: Model;
2506
2706
  undoManager: UndoManager;
2507
2707
  windowManager: WindowManager;
2508
- _beforeUnload: () => void;
2509
- _eventDispatcher: EventDispatcher<NativeEventMap>;
2708
+ _beforeUnload: (() => void) | undefined;
2709
+ _eventDispatcher: EventDispatcher<NativeEventMap> | undefined;
2510
2710
  _nodeChangeDispatcher: NodeChange;
2511
2711
  _pendingNativeEvents: string[];
2512
2712
  _selectionOverrides: SelectionOverrides;
@@ -2530,9 +2730,12 @@ declare class Editor implements EditorObservable {
2530
2730
  getParam<T>(name: string, defaultVal: T, type?: BuiltInOptionType): T;
2531
2731
  hasPlugin(name: string, loaded?: boolean): boolean;
2532
2732
  nodeChanged(args?: any): void;
2533
- addCommand(name: string, callback: EditorCommandCallback, scope?: object): void;
2534
- addQueryStateHandler(name: string, callback: () => boolean, scope?: any): void;
2535
- addQueryValueHandler(name: string, callback: () => string, scope?: any): void;
2733
+ addCommand<S>(name: string, callback: EditorCommandCallback<S>, scope: S): void;
2734
+ addCommand(name: string, callback: EditorCommandCallback<Editor>): void;
2735
+ addQueryStateHandler<S>(name: string, callback: (this: S) => boolean, scope?: S): void;
2736
+ addQueryStateHandler(name: string, callback: (this: Editor) => boolean): void;
2737
+ addQueryValueHandler<S>(name: string, callback: (this: S) => string, scope: S): void;
2738
+ addQueryValueHandler(name: string, callback: (this: Editor) => string): void;
2536
2739
  addShortcut(pattern: string, desc: string, cmdFunc: string | [
2537
2740
  string,
2538
2741
  boolean,
@@ -2546,8 +2749,8 @@ declare class Editor implements EditorObservable {
2546
2749
  hide(): void;
2547
2750
  isHidden(): boolean;
2548
2751
  setProgressState(state: boolean, time?: number): void;
2549
- load(args?: any): string;
2550
- save(args?: any): string;
2752
+ load(args?: Partial<SetContentArgs>): string;
2753
+ save(args?: Partial<GetContentArgs>): string;
2551
2754
  setContent(content: string, args?: Partial<SetContentArgs>): string;
2552
2755
  setContent(content: AstNode, args?: Partial<SetContentArgs>): AstNode;
2553
2756
  setContent(content: Content, args?: Partial<SetContentArgs>): Content;
@@ -2565,7 +2768,7 @@ declare class Editor implements EditorObservable {
2565
2768
  getWin(): Window;
2566
2769
  getDoc(): Document;
2567
2770
  getBody(): HTMLElement;
2568
- convertURL(url: string, name: string, elm?: any): string;
2771
+ convertURL(url: string, name: string, elm?: string | Element): string;
2569
2772
  addVisual(elm?: HTMLElement): void;
2570
2773
  remove(): void;
2571
2774
  destroy(automatic?: boolean): void;
@@ -2585,8 +2788,8 @@ interface AddOnManager<T> {
2585
2788
  lookup: Record<string, {
2586
2789
  instance: AddOnConstructor<T>;
2587
2790
  }>;
2588
- get: (name: string) => AddOnConstructor<T>;
2589
- requireLangPack: (name: string, languages: string) => void;
2791
+ get: (name: string) => AddOnConstructor<T> | undefined;
2792
+ requireLangPack: (name: string, languages?: string) => void;
2590
2793
  add: (id: string, addOn: AddOnConstructor<T>) => AddOnConstructor<T>;
2591
2794
  remove: (name: string) => void;
2592
2795
  createUrl: (baseUrl: UrlObject, dep: string | UrlObject) => UrlObject;
@@ -2597,6 +2800,9 @@ interface RangeUtils {
2597
2800
  walk: (rng: Range, callback: (nodes: Node[]) => void) => void;
2598
2801
  split: (rng: Range) => RangeLikeObject;
2599
2802
  normalize: (rng: Range) => boolean;
2803
+ expand: (rng: Range, options?: {
2804
+ type: 'word';
2805
+ }) => Range;
2600
2806
  }
2601
2807
  interface ScriptLoaderSettings {
2602
2808
  referrerPolicy?: ReferrerPolicy;
@@ -2642,10 +2848,10 @@ declare class DomTreeWalker {
2642
2848
  private readonly rootNode;
2643
2849
  private node;
2644
2850
  constructor(startNode: Node, rootNode: Node);
2645
- current(): Node | undefined;
2646
- next(shallow?: boolean): Node | undefined;
2647
- prev(shallow?: boolean): Node | undefined;
2648
- prev2(shallow?: boolean): Node | undefined;
2851
+ current(): Node | null | undefined;
2852
+ next(shallow?: boolean): Node | null | undefined;
2853
+ prev(shallow?: boolean): Node | null | undefined;
2854
+ prev2(shallow?: boolean): Node | null | undefined;
2649
2855
  private findSibling;
2650
2856
  private findPreviousNode;
2651
2857
  }
@@ -2714,7 +2920,7 @@ interface Entities {
2714
2920
  encodeAllRaw: (text: string) => string;
2715
2921
  encodeNumeric: (text: string, attr?: boolean) => string;
2716
2922
  encodeNamed: (text: string, attr?: boolean, entities?: EntitiesMap) => string;
2717
- getEncodeFunc: (name: string, entities?: EntitiesMap | string) => (text: string, attr?: boolean) => string;
2923
+ getEncodeFunc: (name: string, entities?: string) => (text: string, attr?: boolean) => string;
2718
2924
  decode: (text: string) => string;
2719
2925
  }
2720
2926
  interface IconPack {
@@ -2730,6 +2936,20 @@ interface Resource {
2730
2936
  add: (id: string, data: any) => void;
2731
2937
  unload: (id: string) => void;
2732
2938
  }
2939
+ type TextPatterns_d_Pattern = Pattern;
2940
+ type TextPatterns_d_RawPattern = RawPattern;
2941
+ type TextPatterns_d_DynamicPatternsLookup = DynamicPatternsLookup;
2942
+ type TextPatterns_d_RawDynamicPatternsLookup = RawDynamicPatternsLookup;
2943
+ type TextPatterns_d_DynamicPatternContext = DynamicPatternContext;
2944
+ type TextPatterns_d_BlockCmdPattern = BlockCmdPattern;
2945
+ type TextPatterns_d_BlockPattern = BlockPattern;
2946
+ type TextPatterns_d_BlockFormatPattern = BlockFormatPattern;
2947
+ type TextPatterns_d_InlineCmdPattern = InlineCmdPattern;
2948
+ type TextPatterns_d_InlinePattern = InlinePattern;
2949
+ type TextPatterns_d_InlineFormatPattern = InlineFormatPattern;
2950
+ declare namespace TextPatterns_d {
2951
+ export { TextPatterns_d_Pattern as Pattern, TextPatterns_d_RawPattern as RawPattern, TextPatterns_d_DynamicPatternsLookup as DynamicPatternsLookup, TextPatterns_d_RawDynamicPatternsLookup as RawDynamicPatternsLookup, TextPatterns_d_DynamicPatternContext as DynamicPatternContext, TextPatterns_d_BlockCmdPattern as BlockCmdPattern, TextPatterns_d_BlockPattern as BlockPattern, TextPatterns_d_BlockFormatPattern as BlockFormatPattern, TextPatterns_d_InlineCmdPattern as InlineCmdPattern, TextPatterns_d_InlinePattern as InlinePattern, TextPatterns_d_InlineFormatPattern as InlineFormatPattern, };
2952
+ }
2733
2953
  interface Delay {
2734
2954
  setEditorInterval: (editor: Editor, callback: () => void, time?: number) => number;
2735
2955
  setEditorTimeout: (editor: Editor, callback: () => void, time?: number) => number;
@@ -2738,12 +2958,13 @@ declare type UploadResult = UploadResult$2;
2738
2958
  interface ImageUploader {
2739
2959
  upload: (blobInfos: BlobInfo[], showNotification?: boolean) => Promise<UploadResult[]>;
2740
2960
  }
2741
- declare type ArrayCallback$1<T, R> = (x: T, i: number, xs: ReadonlyArray<T>) => R;
2742
- declare type ObjCallback$1<T, R> = (value: T, key: string, obj: Record<string, T>) => R;
2961
+ declare type ArrayCallback$1<T, R> = (this: any, x: T, i: number, xs: ArrayLike<T>) => R;
2962
+ declare type ObjCallback$1<T, R> = (this: any, value: T, key: string, obj: Record<string, T>) => R;
2743
2963
  declare type ArrayCallback<T, R> = ArrayCallback$1<T, R>;
2744
2964
  declare type ObjCallback<T, R> = ObjCallback$1<T, R>;
2965
+ declare type WalkCallback<T> = (this: any, o: T, i: string, n: keyof T | undefined) => boolean | void;
2745
2966
  interface Tools {
2746
- is: (obj: any, type: string) => boolean;
2967
+ is: (obj: any, type?: string) => boolean;
2747
2968
  isArray: <T>(arr: any) => arr is Array<T>;
2748
2969
  inArray: <T>(arr: ArrayLike<T>, value: T) => number;
2749
2970
  grep: {
@@ -2753,7 +2974,7 @@ interface Tools {
2753
2974
  trim: (str: string | null | undefined) => string;
2754
2975
  toArray: <T>(obj: ArrayLike<T>) => T[];
2755
2976
  hasOwn: (obj: any, name: string) => boolean;
2756
- makeMap: <T>(items: ArrayLike<T> | string, delim?: string | RegExp, map?: Record<string, T | string>) => Record<string, T | string>;
2977
+ makeMap: (items: ArrayLike<string> | string | undefined, delim?: string | RegExp, map?: Record<string, {}>) => Record<string, {}>;
2757
2978
  each: {
2758
2979
  <T>(arr: ArrayLike<T> | null | undefined, cb: ArrayCallback<T, void | boolean>, scope?: any): boolean;
2759
2980
  <T>(obj: Record<string, T> | null | undefined, cb: ObjCallback<T, void | boolean>, scope?: any): boolean;
@@ -2763,9 +2984,9 @@ interface Tools {
2763
2984
  <T, R>(obj: Record<string, T> | null | undefined, cb: ObjCallback<T, R>): R[];
2764
2985
  };
2765
2986
  extend: (obj: Object, ext: Object, ...objs: Object[]) => any;
2766
- walk: <T = any>(obj: T, f: Function, n?: keyof T, scope?: any) => void;
2987
+ walk: <T extends Record<string, any>>(obj: T, f: WalkCallback<T>, n?: keyof T, scope?: any) => void;
2767
2988
  resolve: (path: string, o?: Object) => any;
2768
- explode: (s: string, d?: string | RegExp) => string[];
2989
+ explode: (s: string | string[], d?: string | RegExp) => string[];
2769
2990
  _addCacheSuffix: (url: string) => string;
2770
2991
  }
2771
2992
  interface KeyboardLikeEvent {
@@ -2892,4 +3113,4 @@ interface TinyMCE extends EditorManager {
2892
3113
  _addCacheSuffix: Tools['_addCacheSuffix'];
2893
3114
  }
2894
3115
  declare const tinymce: TinyMCE;
2895
- export { AddOnManager, Annotator, AstNode, Bookmark, BookmarkManager, ControlSelection, DOMUtils, Delay, DomParser, DomParserSettings, DomSerializer, DomSerializerSettings, DomTreeWalker, Editor, EditorCommands, EditorEvent, EditorManager, EditorModeApi, EditorObservable, EditorOptions, EditorSelection, Entities, Env, EventDispatcher, EventUtils, EventTypes_d as Events, FakeClipboard, FocusManager, Format_d as Formats, Formatter, GeomRect, HtmlSerializer, HtmlSerializerSettings, I18n, IconManager, Model, ModelManager, NotificationApi, NotificationManager, NotificationSpec, Observable, Plugin, PluginManager, RangeUtils, RawEditorOptions, Rect, Resource, Schema, SchemaSettings, ScriptLoader, Shortcuts, StyleSheetLoader, Styles, TextSeeker, Theme, ThemeManager, TinyMCE, Tools, URI, Ui_d as Ui, UndoManager, VK, WindowManager, Writer, WriterSettings, tinymce as default };
3116
+ export { AddOnManager, Annotator, AstNode, Bookmark, BookmarkManager, ControlSelection, DOMUtils, Delay, DomParser, DomParserSettings, DomSerializer, DomSerializerSettings, DomTreeWalker, Editor, EditorCommands, EditorEvent, EditorManager, EditorModeApi, EditorObservable, EditorOptions, EditorSelection, Entities, Env, EventDispatcher, EventUtils, EventTypes_d as Events, FakeClipboard, FocusManager, Format_d as Formats, Formatter, GeomRect, HtmlSerializer, HtmlSerializerSettings, I18n, IconManager, Model, ModelManager, NotificationApi, NotificationManager, NotificationSpec, Observable, Plugin, PluginManager, RangeUtils, RawEditorOptions, Rect, Resource, Schema, SchemaSettings, ScriptLoader, Shortcuts, StyleSheetLoader, Styles, TextPatterns_d as TextPatterns, TextSeeker, Theme, ThemeManager, TinyMCE, Tools, URI, Ui_d as Ui, UndoManager, VK, WindowManager, Writer, WriterSettings, tinymce as default };