@novaprose/tinymce-compat 0.7.0 → 0.8.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 (240) hide show
  1. package/README.md +1 -1
  2. package/THIRD_PARTY_NOTICES.md +2 -0
  3. package/dist/ai-XVSDIIQI.js +127 -0
  4. package/dist/ai-XVSDIIQI.js.map +1 -0
  5. package/dist/dialog-3UZZZW6Y.js +300 -0
  6. package/dist/dialog-3UZZZW6Y.js.map +1 -0
  7. package/dist/index.cjs +1325 -409
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.cts +92 -45
  10. package/dist/index.d.ts +92 -45
  11. package/dist/index.js +821 -366
  12. package/dist/index.js.map +1 -1
  13. package/dist/novaprose.css +320 -544
  14. package/dist/tinymce-chunks/a11ychecker-fe78c552.js +2 -0
  15. package/dist/tinymce-chunks/a11ychecker-fe78c552.js.map +7 -0
  16. package/dist/tinymce-chunks/accordion-ui-4272c63b.js +2 -0
  17. package/dist/tinymce-chunks/accordion-ui-4272c63b.js.map +7 -0
  18. package/dist/tinymce-chunks/advcode-840793ca.js +2 -0
  19. package/dist/tinymce-chunks/advcode-840793ca.js.map +7 -0
  20. package/dist/tinymce-chunks/advcode-editor-37bc0a02.js +26 -0
  21. package/dist/tinymce-chunks/advcode-editor-37bc0a02.js.map +7 -0
  22. package/dist/tinymce-chunks/advlist-67b98670.js +2 -0
  23. package/dist/tinymce-chunks/{advlist-7a360f16.js.map → advlist-67b98670.js.map} +2 -2
  24. package/dist/tinymce-chunks/advtable-ui-db2e667d.js +2 -0
  25. package/dist/tinymce-chunks/advtable-ui-db2e667d.js.map +7 -0
  26. package/dist/tinymce-chunks/ai-e0658729.js +6 -0
  27. package/dist/tinymce-chunks/ai-e0658729.js.map +7 -0
  28. package/dist/tinymce-chunks/ai2-ddf912a7.js +34 -0
  29. package/dist/tinymce-chunks/ai2-ddf912a7.js.map +7 -0
  30. package/dist/tinymce-chunks/anchor-ui-da0966bb.js +2 -0
  31. package/dist/tinymce-chunks/anchor-ui-da0966bb.js.map +7 -0
  32. package/dist/tinymce-chunks/autocorrect-907e1296.js +3 -0
  33. package/dist/tinymce-chunks/autocorrect-907e1296.js.map +7 -0
  34. package/dist/tinymce-chunks/autolink-897e8650.js +2 -0
  35. package/dist/tinymce-chunks/{autolink-7e2e7be2.js.map → autolink-897e8650.js.map} +2 -2
  36. package/dist/tinymce-chunks/autoresize-f8a4a52a.js +2 -0
  37. package/dist/tinymce-chunks/autoresize-f8a4a52a.js.map +7 -0
  38. package/dist/tinymce-chunks/autosave-60381295.js +2 -0
  39. package/dist/tinymce-chunks/autosave-60381295.js.map +7 -0
  40. package/dist/tinymce-chunks/bash-f3f8783a.js +2 -0
  41. package/dist/tinymce-chunks/bash-f3f8783a.js.map +7 -0
  42. package/dist/tinymce-chunks/c-8e3b278b.js +2 -0
  43. package/dist/tinymce-chunks/c-8e3b278b.js.map +7 -0
  44. package/dist/tinymce-chunks/casechange-8ad6a2c3.js +6 -0
  45. package/dist/tinymce-chunks/casechange-8ad6a2c3.js.map +7 -0
  46. package/dist/tinymce-chunks/charmap-5deb524c.js +2 -0
  47. package/dist/tinymce-chunks/charmap-5deb524c.js.map +7 -0
  48. package/dist/tinymce-chunks/checklist-5a0c95d3.js +2 -0
  49. package/dist/tinymce-chunks/checklist-5a0c95d3.js.map +7 -0
  50. package/dist/tinymce-chunks/codesample-b91dcd91.js +4 -0
  51. package/dist/tinymce-chunks/codesample-b91dcd91.js.map +7 -0
  52. package/dist/tinymce-chunks/comments-panel-152e9cbe.js +2 -0
  53. package/dist/tinymce-chunks/comments-panel-152e9cbe.js.map +7 -0
  54. package/dist/tinymce-chunks/core-f5b3fd3e.js +4 -0
  55. package/dist/tinymce-chunks/core-f5b3fd3e.js.map +7 -0
  56. package/dist/tinymce-chunks/cpp-525b2c81.js +2 -0
  57. package/dist/tinymce-chunks/cpp-525b2c81.js.map +7 -0
  58. package/dist/tinymce-chunks/csharp-b95db858.js +2 -0
  59. package/dist/tinymce-chunks/csharp-b95db858.js.map +7 -0
  60. package/dist/tinymce-chunks/css-bb736f0c.js +2 -0
  61. package/dist/tinymce-chunks/css-bb736f0c.js.map +7 -0
  62. package/dist/tinymce-chunks/de-eb649701.js +2 -0
  63. package/dist/tinymce-chunks/de-eb649701.js.map +7 -0
  64. package/dist/tinymce-chunks/dialog-126a0355.js +2 -0
  65. package/dist/tinymce-chunks/dialog-126a0355.js.map +7 -0
  66. package/dist/tinymce-chunks/diff-02578ed2.js +2 -0
  67. package/dist/tinymce-chunks/diff-02578ed2.js.map +7 -0
  68. package/dist/tinymce-chunks/directionality-185b3810.js +2 -0
  69. package/dist/tinymce-chunks/{directionality-60dba768.js.map → directionality-185b3810.js.map} +2 -2
  70. package/dist/tinymce-chunks/dockerfile-ff44475c.js +2 -0
  71. package/dist/tinymce-chunks/dockerfile-ff44475c.js.map +7 -0
  72. package/dist/tinymce-chunks/draghandle-a1d99987.js +4 -0
  73. package/dist/tinymce-chunks/draghandle-a1d99987.js.map +7 -0
  74. package/dist/tinymce-chunks/editimage-36199bc6.js +2 -0
  75. package/dist/tinymce-chunks/editimage-36199bc6.js.map +7 -0
  76. package/dist/tinymce-chunks/email-1926dd8a.js +62 -0
  77. package/dist/tinymce-chunks/email-1926dd8a.js.map +7 -0
  78. package/dist/tinymce-chunks/email2-e9c49586.js +2 -0
  79. package/dist/tinymce-chunks/email2-e9c49586.js.map +7 -0
  80. package/dist/tinymce-chunks/emoticons-a5ab437d.js +2 -0
  81. package/dist/tinymce-chunks/emoticons-a5ab437d.js.map +7 -0
  82. package/dist/tinymce-chunks/es-b9c95169.js +2 -0
  83. package/dist/tinymce-chunks/es-b9c95169.js.map +7 -0
  84. package/dist/tinymce-chunks/exportpdf-0c6647bc.js +2 -0
  85. package/dist/tinymce-chunks/exportpdf-0c6647bc.js.map +7 -0
  86. package/dist/tinymce-chunks/exportword-8a03f24d.js +2 -0
  87. package/dist/tinymce-chunks/exportword-8a03f24d.js.map +7 -0
  88. package/dist/tinymce-chunks/footnotes-ui-3f167c2c.js +2 -0
  89. package/dist/tinymce-chunks/footnotes-ui-3f167c2c.js.map +7 -0
  90. package/dist/tinymce-chunks/form-dialog-9eb62199.js +2 -0
  91. package/dist/tinymce-chunks/form-dialog-9eb62199.js.map +7 -0
  92. package/dist/tinymce-chunks/formatpainter-cbeeffa7.js +2 -0
  93. package/dist/tinymce-chunks/formatpainter-cbeeffa7.js.map +7 -0
  94. package/dist/tinymce-chunks/fr-724ffe36.js +2 -0
  95. package/dist/tinymce-chunks/fr-724ffe36.js.map +7 -0
  96. package/dist/tinymce-chunks/fullpagehtml-ui-9dd804af.js +2 -0
  97. package/dist/tinymce-chunks/fullpagehtml-ui-9dd804af.js.map +7 -0
  98. package/dist/tinymce-chunks/go-14612282.js +2 -0
  99. package/dist/tinymce-chunks/go-14612282.js.map +7 -0
  100. package/dist/tinymce-chunks/graphql-032121b4.js +2 -0
  101. package/dist/tinymce-chunks/graphql-032121b4.js.map +7 -0
  102. package/dist/tinymce-chunks/history-diff-a0db052c.js +2 -0
  103. package/dist/tinymce-chunks/history-diff-a0db052c.js.map +7 -0
  104. package/dist/tinymce-chunks/importcss-28610ab5.js +3 -0
  105. package/dist/tinymce-chunks/importcss-28610ab5.js.map +7 -0
  106. package/dist/tinymce-chunks/importword-ec0b2213.js +2 -0
  107. package/dist/tinymce-chunks/importword-ec0b2213.js.map +7 -0
  108. package/dist/tinymce-chunks/index-330c7726.js +5 -0
  109. package/dist/tinymce-chunks/index-330c7726.js.map +7 -0
  110. package/dist/tinymce-chunks/index2-610900bb.js +2 -0
  111. package/dist/tinymce-chunks/index2-610900bb.js.map +7 -0
  112. package/dist/tinymce-chunks/insertdatetime-a48ee6e0.js +2 -0
  113. package/dist/tinymce-chunks/{insertdatetime-e0dbcf63.js.map → insertdatetime-a48ee6e0.js.map} +2 -2
  114. package/dist/tinymce-chunks/it-f4816bbc.js +2 -0
  115. package/dist/tinymce-chunks/it-f4816bbc.js.map +7 -0
  116. package/dist/tinymce-chunks/java-e051279c.js +2 -0
  117. package/dist/tinymce-chunks/java-e051279c.js.map +7 -0
  118. package/dist/tinymce-chunks/javascript-d7a6fb3d.js +2 -0
  119. package/dist/tinymce-chunks/javascript-d7a6fb3d.js.map +7 -0
  120. package/dist/tinymce-chunks/json-08c0b631.js +2 -0
  121. package/dist/tinymce-chunks/json-08c0b631.js.map +7 -0
  122. package/dist/tinymce-chunks/kotlin-b34d5ff2.js +3 -0
  123. package/dist/tinymce-chunks/kotlin-b34d5ff2.js.map +7 -0
  124. package/dist/tinymce-chunks/linkchecker-820845fd.js +2 -0
  125. package/dist/tinymce-chunks/linkchecker-820845fd.js.map +7 -0
  126. package/dist/tinymce-chunks/lua-9b0ae20a.js +2 -0
  127. package/dist/tinymce-chunks/lua-9b0ae20a.js.map +7 -0
  128. package/dist/tinymce-chunks/markdown-5698ebec.js +34 -0
  129. package/dist/tinymce-chunks/markdown-5698ebec.js.map +7 -0
  130. package/dist/tinymce-chunks/markdown2-943bcf90.js +2 -0
  131. package/dist/tinymce-chunks/markdown2-943bcf90.js.map +7 -0
  132. package/dist/tinymce-chunks/math-ui-1b57f7eb.js +2 -0
  133. package/dist/tinymce-chunks/math-ui-1b57f7eb.js.map +7 -0
  134. package/dist/tinymce-chunks/media-ui-de819f11.js +2 -0
  135. package/dist/tinymce-chunks/media-ui-de819f11.js.map +7 -0
  136. package/dist/tinymce-chunks/mediaembed-ui-7be11324.js +2 -0
  137. package/dist/tinymce-chunks/mediaembed-ui-7be11324.js.map +7 -0
  138. package/dist/tinymce-chunks/mentions-ui-b1bb2d15.js +2 -0
  139. package/dist/tinymce-chunks/mentions-ui-b1bb2d15.js.map +7 -0
  140. package/dist/tinymce-chunks/mergetags-ui-f5bdd1f9.js +2 -0
  141. package/dist/tinymce-chunks/mergetags-ui-f5bdd1f9.js.map +7 -0
  142. package/dist/tinymce-chunks/nonbreaking-f15226ad.js +2 -0
  143. package/dist/tinymce-chunks/{nonbreaking-49bdb0d2.js.map → nonbreaking-f15226ad.js.map} +2 -2
  144. package/dist/tinymce-chunks/pagebreak-ui-7476f5c2.js +2 -0
  145. package/dist/tinymce-chunks/pagebreak-ui-7476f5c2.js.map +7 -0
  146. package/dist/tinymce-chunks/pageembed-ui-da39f1ee.js +2 -0
  147. package/dist/tinymce-chunks/pageembed-ui-da39f1ee.js.map +7 -0
  148. package/dist/tinymce-chunks/pagelayout-ui-01757669.js +2 -0
  149. package/dist/tinymce-chunks/pagelayout-ui-01757669.js.map +7 -0
  150. package/dist/tinymce-chunks/paste-office-d6821891.js +3 -0
  151. package/dist/tinymce-chunks/paste-office-d6821891.js.map +7 -0
  152. package/dist/tinymce-chunks/permanentpen-fc96f445.js +2 -0
  153. package/dist/tinymce-chunks/permanentpen-fc96f445.js.map +7 -0
  154. package/dist/tinymce-chunks/php-6b723470.js +3 -0
  155. package/dist/tinymce-chunks/php-6b723470.js.map +7 -0
  156. package/dist/tinymce-chunks/powershell-e6c3fdb8.js +2 -0
  157. package/dist/tinymce-chunks/powershell-e6c3fdb8.js.map +7 -0
  158. package/dist/tinymce-chunks/print-86762549.js +27 -0
  159. package/dist/tinymce-chunks/print-86762549.js.map +7 -0
  160. package/dist/tinymce-chunks/pt-BR-abebbb34.js +2 -0
  161. package/dist/tinymce-chunks/pt-BR-abebbb34.js.map +7 -0
  162. package/dist/tinymce-chunks/python-a20cacce.js +2 -0
  163. package/dist/tinymce-chunks/python-a20cacce.js.map +7 -0
  164. package/dist/tinymce-chunks/quickbars-35c87c0e.js +2 -0
  165. package/dist/tinymce-chunks/{quickbars-d937e10a.js.map → quickbars-35c87c0e.js.map} +3 -3
  166. package/dist/tinymce-chunks/revisionhistory-741dfb24.js +2 -0
  167. package/dist/tinymce-chunks/revisionhistory-741dfb24.js.map +7 -0
  168. package/dist/tinymce-chunks/ru-f1d19f4f.js +2 -0
  169. package/dist/tinymce-chunks/ru-f1d19f4f.js.map +7 -0
  170. package/dist/tinymce-chunks/ruby-93c325c7.js +2 -0
  171. package/dist/tinymce-chunks/ruby-93c325c7.js.map +7 -0
  172. package/dist/tinymce-chunks/rust-d80fbab5.js +2 -0
  173. package/dist/tinymce-chunks/rust-d80fbab5.js.map +7 -0
  174. package/dist/tinymce-chunks/save-a65e56cd.js +2 -0
  175. package/dist/tinymce-chunks/save-a65e56cd.js.map +7 -0
  176. package/dist/tinymce-chunks/scss-7cffeb15.js +2 -0
  177. package/dist/tinymce-chunks/scss-7cffeb15.js.map +7 -0
  178. package/dist/tinymce-chunks/search-bar-3ea04183.js +3 -0
  179. package/dist/tinymce-chunks/search-bar-3ea04183.js.map +7 -0
  180. package/dist/tinymce-chunks/spellchecker-91509fc1.js +6 -0
  181. package/dist/tinymce-chunks/spellchecker-91509fc1.js.map +7 -0
  182. package/dist/tinymce-chunks/sql-eeac1a81.js +2 -0
  183. package/dist/tinymce-chunks/sql-eeac1a81.js.map +7 -0
  184. package/dist/tinymce-chunks/suggestions-panel-c29362cf.js +2 -0
  185. package/dist/tinymce-chunks/suggestions-panel-c29362cf.js.map +7 -0
  186. package/dist/tinymce-chunks/suggestions-ui-c5f6bad4.js +2 -0
  187. package/dist/tinymce-chunks/suggestions-ui-c5f6bad4.js.map +7 -0
  188. package/dist/tinymce-chunks/swift-2b081f3e.js +2 -0
  189. package/dist/tinymce-chunks/swift-2b081f3e.js.map +7 -0
  190. package/dist/tinymce-chunks/table-4d43f60d.js +2 -0
  191. package/dist/tinymce-chunks/table-4d43f60d.js.map +7 -0
  192. package/dist/tinymce-chunks/table-dialogs-0445847c.js +2 -0
  193. package/dist/tinymce-chunks/table-dialogs-0445847c.js.map +7 -0
  194. package/dist/tinymce-chunks/tableofcontents-ui-01a9af06.js +2 -0
  195. package/dist/tinymce-chunks/tableofcontents-ui-01a9af06.js.map +7 -0
  196. package/dist/tinymce-chunks/temml-d637f801.js +97 -0
  197. package/dist/tinymce-chunks/temml-d637f801.js.map +7 -0
  198. package/dist/tinymce-chunks/template-b522c8ed.js +2 -0
  199. package/dist/tinymce-chunks/template-b522c8ed.js.map +7 -0
  200. package/dist/tinymce-chunks/typescript-fa085d66.js +2 -0
  201. package/dist/tinymce-chunks/typescript-fa085d66.js.map +7 -0
  202. package/dist/tinymce-chunks/typography-469ce11a.js +3 -0
  203. package/dist/tinymce-chunks/typography-469ce11a.js.map +7 -0
  204. package/dist/tinymce-chunks/visualblocks-8b7cba25.js +2 -0
  205. package/dist/tinymce-chunks/{visualblocks-58c88e5d.js.map → visualblocks-8b7cba25.js.map} +2 -2
  206. package/dist/tinymce-chunks/visualchars-7cda4c00.js +2 -0
  207. package/dist/tinymce-chunks/visualchars-7cda4c00.js.map +7 -0
  208. package/dist/tinymce-chunks/xml-77617a8f.js +2 -0
  209. package/dist/tinymce-chunks/xml-77617a8f.js.map +7 -0
  210. package/dist/tinymce-chunks/yaml-5bb3ad37.js +2 -0
  211. package/dist/tinymce-chunks/yaml-5bb3ad37.js.map +7 -0
  212. package/dist/tinymce.global.js +34 -27
  213. package/dist/tinymce.global.js.map +4 -4
  214. package/dist/tinymce.licenses.txt +1094 -0
  215. package/package.json +2 -2
  216. package/dist/tinymce-chunks/advlist-7a360f16.js +0 -2
  217. package/dist/tinymce-chunks/autolink-7e2e7be2.js +0 -2
  218. package/dist/tinymce-chunks/autoresize-d6c9537b.js +0 -2
  219. package/dist/tinymce-chunks/autoresize-d6c9537b.js.map +0 -7
  220. package/dist/tinymce-chunks/autosave-4fd46720.js +0 -2
  221. package/dist/tinymce-chunks/autosave-4fd46720.js.map +0 -7
  222. package/dist/tinymce-chunks/charmap-4b14307a.js +0 -2
  223. package/dist/tinymce-chunks/charmap-4b14307a.js.map +0 -7
  224. package/dist/tinymce-chunks/comments-panel-37cba890.js +0 -2
  225. package/dist/tinymce-chunks/comments-panel-37cba890.js.map +0 -7
  226. package/dist/tinymce-chunks/directionality-60dba768.js +0 -2
  227. package/dist/tinymce-chunks/emoticons-7e6da0b6.js +0 -2
  228. package/dist/tinymce-chunks/emoticons-7e6da0b6.js.map +0 -7
  229. package/dist/tinymce-chunks/form-dialog-9cde0ef7.js +0 -2
  230. package/dist/tinymce-chunks/form-dialog-9cde0ef7.js.map +0 -7
  231. package/dist/tinymce-chunks/insertdatetime-e0dbcf63.js +0 -2
  232. package/dist/tinymce-chunks/nonbreaking-49bdb0d2.js +0 -2
  233. package/dist/tinymce-chunks/paste-office-a38659d6.js +0 -3
  234. package/dist/tinymce-chunks/paste-office-a38659d6.js.map +0 -7
  235. package/dist/tinymce-chunks/quickbars-d937e10a.js +0 -2
  236. package/dist/tinymce-chunks/revisionhistory-d6306426.js +0 -2
  237. package/dist/tinymce-chunks/revisionhistory-d6306426.js.map +0 -7
  238. package/dist/tinymce-chunks/table-80284f6f.js +0 -2
  239. package/dist/tinymce-chunks/table-80284f6f.js.map +0 -7
  240. package/dist/tinymce-chunks/visualblocks-58c88e5d.js +0 -2
package/dist/index.d.cts CHANGED
@@ -1,10 +1,10 @@
1
1
  import * as _novaprose_core from '@novaprose/core';
2
- import { Editor, EditorOptions } from '@novaprose/core';
2
+ import { Editor, SelectionBookmark, EditorOptions } from '@novaprose/core';
3
3
 
4
4
  /**
5
- * editor.windowManager.open(spec) — диалог по описанию (как в документации TinyMCE): панель или
6
- * вкладки, поля, кнопки, initialData, onSubmit/onChange/onAction/onCancel/onClose и объект api.
7
- * Строится на диалоге NovaProse (фокус, Esc, мобильный «лист»); все подписи — textContent.
5
+ * editor.windowManager.open(spec) — a dialog from a description (as in the TinyMCE documentation):
6
+ * a panel or tabs, fields, buttons, initialData, onSubmit/onChange/onAction/onCancel/onClose and the
7
+ * api object. Built on the NovaProse dialog (focus, Esc, the mobile sheet); every label is textContent.
8
8
  */
9
9
  type Data = Record<string, unknown>;
10
10
  interface DialogItem {
@@ -80,9 +80,9 @@ interface DialogApi {
80
80
  }
81
81
 
82
82
  /**
83
- * Обёртка над редактором NovaProse с API редактора TinyMCE (по публичной документации): методы,
84
- * события и реестр кнопок, которыми пользуются существующие интеграции. Всё делается через публичный
85
- * API `Editor` — ProseMirror напрямую не трогаем (кроме вставки HTML через view.pasteHTML).
83
+ * A NovaProse editor with the TinyMCE editor API (from its public documentation): the methods,
84
+ * events and control registry that existing integrations use. Everything goes through the public
85
+ * `Editor` API — ProseMirror is never touched directly (except inserting HTML via view.pasteHTML).
86
86
  */
87
87
  type Handler = (event: Record<string, unknown>) => unknown;
88
88
  type ButtonSpec = {
@@ -103,6 +103,11 @@ declare class CompatEditor {
103
103
  readonly core: Editor;
104
104
  readonly targetElm: HTMLElement;
105
105
  readonly settings: Record<string, unknown>;
106
+ /**
107
+ * The plugins by their TinyMCE names (`editor.plugins.lists`): the listed ones that work here, and
108
+ * what your own plugins return. inlinecss has `getContent()`: the content with its styles inline.
109
+ */
110
+ readonly plugins: Record<string, Record<string, unknown>>;
106
111
  initialized: boolean;
107
112
  removed: boolean;
108
113
  private readonly handlers;
@@ -111,12 +116,14 @@ declare class CompatEditor {
111
116
  constructor(core: Editor, target: HTMLElement, id: string, settings: Record<string, unknown>);
112
117
  getContent(args?: {
113
118
  format?: string;
119
+ prettify?: boolean;
120
+ fullpagehtml?: boolean;
114
121
  }): string;
115
122
  setContent(content: string, args?: Record<string, unknown>): string;
116
123
  /**
117
- * Вставить HTML на место выделения. Блоки (<p>, списки, таблицы) — отдельными блоками (абзац
118
- * разрезается), строчное содержимое — в текущую строку. Разбор — схемой редактора: те же проверки
119
- * ссылок и разметки, что при загрузке содержимого.
124
+ * Insert HTML in place of the selection. Blocks (<p>, lists, tables) go in as separate blocks (the
125
+ * paragraph is split), inline content into the current line. Parsed by the editor's schema: the
126
+ * same link and markup checks as when content is loaded.
120
127
  */
121
128
  insertContent(content: string): void;
122
129
  resetContent(content?: string): void;
@@ -126,9 +133,21 @@ declare class CompatEditor {
126
133
  getContentAreaContainer(): HTMLElement;
127
134
  getDoc(): Document;
128
135
  getWin(): Window;
129
- /** Значение команды: ToggleSidebar — имя открытой боковой панели. */
136
+ /** The value of a command: for ToggleSidebar and ToggleView, the name of the open one. */
130
137
  queryCommandValue(command: string): string;
131
138
  execCommand(command: string, _ui?: boolean, value?: unknown): boolean;
139
+ /**
140
+ * InsertAccordion / RemoveAccordion — like the accordion button (inside one, remove the frame;
141
+ * otherwise insert); ToggleAccordion / ToggleAllAccordions — value true expands, false collapses,
142
+ * no value toggles. Collapsing is a view, not an edit: it doesn't go into the undo history.
143
+ */
144
+ private spellcheckCommand;
145
+ private accordionCommand;
146
+ /**
147
+ * A command of casechange, formatpainter or permanentpen: like its menu item or button.
148
+ * mceToggleStickyFormatPainter turns the painter on to stay (a double click on the button), or off.
149
+ */
150
+ private pluginCommand;
132
151
  queryCommandState(command: string): boolean;
133
152
  queryCommandSupported(command: string): boolean;
134
153
  private readonly commands;
@@ -137,16 +156,16 @@ declare class CompatEditor {
137
156
  off(names?: string, handler?: Handler): this;
138
157
  once(names: string, handler: Handler): this;
139
158
  fire(name: string, event?: Record<string, unknown>): Record<string, unknown>;
140
- /** DOM-событие текста (keydown, click…) — обработчикам передаётся само событие браузера. */
159
+ /** A DOM event of the text (keydown, click…): handlers get the browser's event itself. */
141
160
  fireNative(name: string, event: Event): void;
142
- /** Иконка для кнопок по имени (tinymce.IconManager / editor.ui.registry.addIcon). */
161
+ /** An icon for buttons by name (tinymce.IconManager / editor.ui.registry.addIcon). */
143
162
  static registerIcon(name: string, svg: string): void;
144
- /** Новое имя fire в последних версиях API. */
163
+ /** The newer name of fire in recent versions of the API. */
145
164
  dispatch(name: string, event?: Record<string, unknown>): Record<string, unknown>;
146
165
  hasEventListeners(name: string): boolean;
147
166
  isDirty(): boolean;
148
167
  setDirty(state: boolean): void;
149
- /** Записать содержимое в исходный <textarea> (как при отправке формы). */
168
+ /** Write the content into the original <textarea> (as on form submit). */
150
169
  save(): string;
151
170
  focus(): void;
152
171
  hasFocus(): boolean;
@@ -162,7 +181,7 @@ declare class CompatEditor {
162
181
  register: () => void;
163
182
  };
164
183
  readonly mode: {
165
- get: () => "readonly" | "design";
184
+ get: () => "design" | "readonly";
166
185
  set: (mode: string) => void;
167
186
  isReadOnly: () => boolean;
168
187
  };
@@ -176,20 +195,29 @@ declare class CompatEditor {
176
195
  transact: (callback: () => void) => null;
177
196
  ignore: (callback: () => void) => void;
178
197
  };
198
+ /** TinyMCE's editor.selection, on top of the core's editor.selection. */
179
199
  readonly selection: {
180
200
  getContent: (args?: {
181
201
  format?: string;
182
202
  }) => string;
183
203
  setContent: (content: string) => void;
184
- getNode: () => Element | null;
185
- getStart: () => Element | null;
186
- getEnd: () => Element | null;
204
+ getNode: () => HTMLElement;
205
+ getStart: () => HTMLElement;
206
+ getEnd: () => HTMLElement;
187
207
  isCollapsed: () => boolean;
188
208
  collapse: (toStart?: boolean) => void;
189
- /** Курсор в узел DOM редактора (по умолчанию — в начало). */
209
+ /** Put the cursor in a DOM node of the editor (at its start by default). */
190
210
  setCursorLocation: (node?: Node, offset?: number) => void;
191
- /** Выделить элемент: content = true — только его содержимое. */
211
+ /** Select an element: content = true — only its content. */
192
212
  select: (node: Node, content?: boolean) => void;
213
+ /** The selection as a DOM Range. */
214
+ getRng: () => Range | null;
215
+ /** Select a DOM Range of the editing area. */
216
+ setRng: (range: Range) => void;
217
+ /** Remember the selection; moveToBookmark() puts it back, wherever later changes moved it. */
218
+ getBookmark: () => SelectionBookmark;
219
+ moveToBookmark: (bookmark: SelectionBookmark) => boolean;
220
+ scrollIntoView: () => void;
193
221
  };
194
222
  readonly notificationManager: {
195
223
  open: (args: {
@@ -204,7 +232,7 @@ declare class CompatEditor {
204
232
  confirm: (message: string, callback?: (state: boolean) => void) => void;
205
233
  open: (spec: DialogSpec) => DialogApi;
206
234
  };
207
- /** editor.ui.registry — кнопки и пункты меню в формате TinyMCE поверх реестра NovaProse. */
235
+ /** editor.ui.registry — buttons and menu items in TinyMCE format on top of the NovaProse registry. */
208
236
  readonly ui: {
209
237
  registry: {
210
238
  addIcon: (name: string, svg: string) => void;
@@ -217,8 +245,8 @@ declare class CompatEditor {
217
245
  }) => void;
218
246
  addMenuItem: (name: string, spec: MenuItemSpec) => void;
219
247
  /**
220
- * Контекстная панель: predicate(node) получает элемент под курсором, items — кнопки тулбара.
221
- * position: 'node' (над элементом) или 'selection'/'line' (у выделения).
248
+ * A context toolbar: predicate(node) gets the element at the cursor, items are toolbar buttons.
249
+ * position: 'node' (above the element) or 'selection'/'line' (at the selection).
222
250
  */
223
251
  addContextToolbar: (name: string, spec: {
224
252
  predicate: (node: Element) => boolean;
@@ -227,8 +255,8 @@ declare class CompatEditor {
227
255
  label?: string;
228
256
  }) => void;
229
257
  /**
230
- * Боковая панель: onSetup(api) рисует содержимое в api.element() (один раз), onShow/onHide —
231
- * при показе. Кнопка-переключатель с именем панели — для toolbar; ToggleSidebar — командой.
258
+ * A sidebar: onSetup(api) draws the content into api.element() (once), onShow/onHide run when it
259
+ * is shown or hidden. A toggle button named after the sidebar is for the toolbar; ToggleSidebar is the command.
232
260
  */
233
261
  addSidebar: (name: string, spec: {
234
262
  tooltip?: string;
@@ -243,15 +271,33 @@ declare class CompatEditor {
243
271
  element(): HTMLElement;
244
272
  }) => void;
245
273
  }) => void;
274
+ /**
275
+ * A view in place of the editor: buttons at its top, onShow/onHide get api.getContainer(), where it
276
+ * draws; ToggleView is the command.
277
+ */
278
+ addView: (name: string, spec: {
279
+ buttons?: {
280
+ type?: string;
281
+ text?: string;
282
+ buttonType?: string;
283
+ onAction?: () => void;
284
+ }[];
285
+ onShow?: (api: {
286
+ getContainer(): HTMLElement;
287
+ }) => void;
288
+ onHide?: (api: {
289
+ getContainer(): HTMLElement;
290
+ }) => void;
291
+ }) => void;
246
292
  addContextForm: () => void;
247
293
  getAll: () => {};
248
294
  };
249
295
  };
250
296
  private addButton;
251
297
  /**
252
- * editor.dom — то, что имеет смысл поверх модели документа: поиск и чтение. Менять DOM текста
253
- * напрямую нельзя (редактор перерисует его из модели) — для правок есть setContent/insertContent/
254
- * formatter; такие вызовы пишут предупреждение.
298
+ * editor.dom — what makes sense on top of a document model: finding and reading. The text's DOM
299
+ * can't be changed directly (the editor redraws it from the model); use setContent, insertContent
300
+ * or formatter for edits — such calls log a warning.
255
301
  */
256
302
  readonly dom: {
257
303
  select: (selector: string, scope?: Element) => Element[];
@@ -265,7 +311,7 @@ declare class CompatEditor {
265
311
  getRoot: () => HTMLElement;
266
312
  encode: (text: string) => string;
267
313
  decode: (html: string) => string;
268
- /** Новый (не вставленный) элемент: атрибуты — через setAttribute, содержимое — текстом. */
314
+ /** A new (not inserted) element: attributes via setAttribute, the content as text. */
269
315
  create: (tag: string, attrs?: Record<string, string>, text?: string) => HTMLElement;
270
316
  uniqueId: (prefix?: string) => string;
271
317
  setAttrib: () => void;
@@ -275,8 +321,8 @@ declare class CompatEditor {
275
321
  remove: () => void;
276
322
  };
277
323
  /**
278
- * editor.formatter — встроенные форматы TinyMCE: apply/remove/toggle/match.
279
- * Свои форматы (register) пока не поддержаны.
324
+ * editor.formatter — the built-in TinyMCE formats: apply/remove/toggle/match. Your own formats
325
+ * (register) are not supported yet.
280
326
  */
281
327
  readonly formatter: {
282
328
  apply: (name: string, vars?: {
@@ -294,15 +340,15 @@ declare class CompatEditor {
294
340
  };
295
341
  private blockMatches;
296
342
  private applyFormat;
297
- /** Убрать редактор и вернуть исходный элемент (как editor.remove()). */
343
+ /** Remove the editor and restore the original element (like editor.remove()). */
298
344
  remove(): void;
299
345
  destroy(): void;
300
346
  }
301
347
 
302
348
  /**
303
- * Перевод конфигурации `tinymce.init({...})` в опции NovaProse. Имена опций и их смысл — из публичной
304
- * документации TinyMCE (описание поведения); незнакомые опции не ломают инициализацию, а
305
- * перечисляются в предупреждении, чтобы при переходе было видно, что ещё не поддержано.
349
+ * Translates a `tinymce.init({...})` configuration into NovaProse options. Option names and their
350
+ * meaning come from TinyMCE's public documentation (a description of behavior); unknown options
351
+ * don't break initialization but are listed in a warning, so it's clear what isn't supported yet.
306
352
  */
307
353
  type TinyConfig = Record<string, unknown> & {
308
354
  selector?: string;
@@ -316,30 +362,30 @@ type TinyConfig = Record<string, unknown> & {
316
362
  };
317
363
  interface MappedOptions {
318
364
  options: Omit<EditorOptions, 'element'>;
319
- /** Опции, которые NovaProse пока не понимает (для предупреждения). */
365
+ /** Options NovaProse doesn't understand yet (for the warning). */
320
366
  unknown: string[];
321
- /** Плагины, которых нет ни в ядре, ни в каталоге. */
367
+ /** Plugins found neither in the core nor in the catalog. */
322
368
  missingPlugins: string[];
323
369
  }
324
370
  declare function mapOptions(config: TinyConfig): MappedOptions;
325
371
 
326
372
  /**
327
- * Слой совместимости с API `tinymce` для перехода на NovaProse без переписывания интеграции:
373
+ * A compatibility layer with the `tinymce` API, to move to NovaProse without rewriting the integration:
328
374
  *
329
375
  * ```js
330
376
  * import { tinymce } from '@novaprose/tinymce-compat';
331
377
  * tinymce.init({ selector: 'textarea', plugins: 'lists link image', toolbar: 'undo redo | bold italic' });
332
378
  * ```
333
379
  *
334
- * Или тегом <script> (CDN-сборка задаёт window.tinymce и подключает стили сама).
335
- * Поведение — по публичной документации TinyMCE; код TinyMCE не используется.
380
+ * Or with a <script> tag (the CDN build sets window.tinymce and adds the styles itself).
381
+ * The behavior follows TinyMCE's public documentation; no TinyMCE code is used.
336
382
  */
337
383
  type PluginFn = (editor: CompatEditor, url: string) => unknown;
338
384
  interface TinyMCECompat {
339
- /** Версия API, под которую написана совместимость (некоторые интеграции проверяют её). */
385
+ /** The API version this compatibility targets (some integrations check it). */
340
386
  readonly majorVersion: string;
341
387
  readonly minorVersion: string;
342
- /** Признак: это NovaProse. */
388
+ /** A flag: this is NovaProse. */
343
389
  readonly novaprose: true;
344
390
  readonly activeEditor: CompatEditor | null;
345
391
  readonly editors: CompatEditor[];
@@ -367,7 +413,8 @@ interface TinyMCECompat {
367
413
  };
368
414
  }
369
415
  declare function createTinymce(): TinyMCECompat;
370
- /** Общий объект `tinymce` для модулей (CDN-сборка кладёт его в window.tinymce). */
416
+ /** The shared `tinymce` object for modules (the CDN build puts it into window.tinymce). */
371
417
  declare const tinymce: TinyMCECompat;
372
418
 
373
- export { CompatEditor, type TinyConfig, type TinyMCECompat, createTinymce, mapOptions, tinymce };
419
+ export { CompatEditor, createTinymce, mapOptions, tinymce };
420
+ export type { TinyConfig, TinyMCECompat };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import * as _novaprose_core from '@novaprose/core';
2
- import { Editor, EditorOptions } from '@novaprose/core';
2
+ import { Editor, SelectionBookmark, EditorOptions } from '@novaprose/core';
3
3
 
4
4
  /**
5
- * editor.windowManager.open(spec) — диалог по описанию (как в документации TinyMCE): панель или
6
- * вкладки, поля, кнопки, initialData, onSubmit/onChange/onAction/onCancel/onClose и объект api.
7
- * Строится на диалоге NovaProse (фокус, Esc, мобильный «лист»); все подписи — textContent.
5
+ * editor.windowManager.open(spec) — a dialog from a description (as in the TinyMCE documentation):
6
+ * a panel or tabs, fields, buttons, initialData, onSubmit/onChange/onAction/onCancel/onClose and the
7
+ * api object. Built on the NovaProse dialog (focus, Esc, the mobile sheet); every label is textContent.
8
8
  */
9
9
  type Data = Record<string, unknown>;
10
10
  interface DialogItem {
@@ -80,9 +80,9 @@ interface DialogApi {
80
80
  }
81
81
 
82
82
  /**
83
- * Обёртка над редактором NovaProse с API редактора TinyMCE (по публичной документации): методы,
84
- * события и реестр кнопок, которыми пользуются существующие интеграции. Всё делается через публичный
85
- * API `Editor` — ProseMirror напрямую не трогаем (кроме вставки HTML через view.pasteHTML).
83
+ * A NovaProse editor with the TinyMCE editor API (from its public documentation): the methods,
84
+ * events and control registry that existing integrations use. Everything goes through the public
85
+ * `Editor` API — ProseMirror is never touched directly (except inserting HTML via view.pasteHTML).
86
86
  */
87
87
  type Handler = (event: Record<string, unknown>) => unknown;
88
88
  type ButtonSpec = {
@@ -103,6 +103,11 @@ declare class CompatEditor {
103
103
  readonly core: Editor;
104
104
  readonly targetElm: HTMLElement;
105
105
  readonly settings: Record<string, unknown>;
106
+ /**
107
+ * The plugins by their TinyMCE names (`editor.plugins.lists`): the listed ones that work here, and
108
+ * what your own plugins return. inlinecss has `getContent()`: the content with its styles inline.
109
+ */
110
+ readonly plugins: Record<string, Record<string, unknown>>;
106
111
  initialized: boolean;
107
112
  removed: boolean;
108
113
  private readonly handlers;
@@ -111,12 +116,14 @@ declare class CompatEditor {
111
116
  constructor(core: Editor, target: HTMLElement, id: string, settings: Record<string, unknown>);
112
117
  getContent(args?: {
113
118
  format?: string;
119
+ prettify?: boolean;
120
+ fullpagehtml?: boolean;
114
121
  }): string;
115
122
  setContent(content: string, args?: Record<string, unknown>): string;
116
123
  /**
117
- * Вставить HTML на место выделения. Блоки (<p>, списки, таблицы) — отдельными блоками (абзац
118
- * разрезается), строчное содержимое — в текущую строку. Разбор — схемой редактора: те же проверки
119
- * ссылок и разметки, что при загрузке содержимого.
124
+ * Insert HTML in place of the selection. Blocks (<p>, lists, tables) go in as separate blocks (the
125
+ * paragraph is split), inline content into the current line. Parsed by the editor's schema: the
126
+ * same link and markup checks as when content is loaded.
120
127
  */
121
128
  insertContent(content: string): void;
122
129
  resetContent(content?: string): void;
@@ -126,9 +133,21 @@ declare class CompatEditor {
126
133
  getContentAreaContainer(): HTMLElement;
127
134
  getDoc(): Document;
128
135
  getWin(): Window;
129
- /** Значение команды: ToggleSidebar — имя открытой боковой панели. */
136
+ /** The value of a command: for ToggleSidebar and ToggleView, the name of the open one. */
130
137
  queryCommandValue(command: string): string;
131
138
  execCommand(command: string, _ui?: boolean, value?: unknown): boolean;
139
+ /**
140
+ * InsertAccordion / RemoveAccordion — like the accordion button (inside one, remove the frame;
141
+ * otherwise insert); ToggleAccordion / ToggleAllAccordions — value true expands, false collapses,
142
+ * no value toggles. Collapsing is a view, not an edit: it doesn't go into the undo history.
143
+ */
144
+ private spellcheckCommand;
145
+ private accordionCommand;
146
+ /**
147
+ * A command of casechange, formatpainter or permanentpen: like its menu item or button.
148
+ * mceToggleStickyFormatPainter turns the painter on to stay (a double click on the button), or off.
149
+ */
150
+ private pluginCommand;
132
151
  queryCommandState(command: string): boolean;
133
152
  queryCommandSupported(command: string): boolean;
134
153
  private readonly commands;
@@ -137,16 +156,16 @@ declare class CompatEditor {
137
156
  off(names?: string, handler?: Handler): this;
138
157
  once(names: string, handler: Handler): this;
139
158
  fire(name: string, event?: Record<string, unknown>): Record<string, unknown>;
140
- /** DOM-событие текста (keydown, click…) — обработчикам передаётся само событие браузера. */
159
+ /** A DOM event of the text (keydown, click…): handlers get the browser's event itself. */
141
160
  fireNative(name: string, event: Event): void;
142
- /** Иконка для кнопок по имени (tinymce.IconManager / editor.ui.registry.addIcon). */
161
+ /** An icon for buttons by name (tinymce.IconManager / editor.ui.registry.addIcon). */
143
162
  static registerIcon(name: string, svg: string): void;
144
- /** Новое имя fire в последних версиях API. */
163
+ /** The newer name of fire in recent versions of the API. */
145
164
  dispatch(name: string, event?: Record<string, unknown>): Record<string, unknown>;
146
165
  hasEventListeners(name: string): boolean;
147
166
  isDirty(): boolean;
148
167
  setDirty(state: boolean): void;
149
- /** Записать содержимое в исходный <textarea> (как при отправке формы). */
168
+ /** Write the content into the original <textarea> (as on form submit). */
150
169
  save(): string;
151
170
  focus(): void;
152
171
  hasFocus(): boolean;
@@ -162,7 +181,7 @@ declare class CompatEditor {
162
181
  register: () => void;
163
182
  };
164
183
  readonly mode: {
165
- get: () => "readonly" | "design";
184
+ get: () => "design" | "readonly";
166
185
  set: (mode: string) => void;
167
186
  isReadOnly: () => boolean;
168
187
  };
@@ -176,20 +195,29 @@ declare class CompatEditor {
176
195
  transact: (callback: () => void) => null;
177
196
  ignore: (callback: () => void) => void;
178
197
  };
198
+ /** TinyMCE's editor.selection, on top of the core's editor.selection. */
179
199
  readonly selection: {
180
200
  getContent: (args?: {
181
201
  format?: string;
182
202
  }) => string;
183
203
  setContent: (content: string) => void;
184
- getNode: () => Element | null;
185
- getStart: () => Element | null;
186
- getEnd: () => Element | null;
204
+ getNode: () => HTMLElement;
205
+ getStart: () => HTMLElement;
206
+ getEnd: () => HTMLElement;
187
207
  isCollapsed: () => boolean;
188
208
  collapse: (toStart?: boolean) => void;
189
- /** Курсор в узел DOM редактора (по умолчанию — в начало). */
209
+ /** Put the cursor in a DOM node of the editor (at its start by default). */
190
210
  setCursorLocation: (node?: Node, offset?: number) => void;
191
- /** Выделить элемент: content = true — только его содержимое. */
211
+ /** Select an element: content = true — only its content. */
192
212
  select: (node: Node, content?: boolean) => void;
213
+ /** The selection as a DOM Range. */
214
+ getRng: () => Range | null;
215
+ /** Select a DOM Range of the editing area. */
216
+ setRng: (range: Range) => void;
217
+ /** Remember the selection; moveToBookmark() puts it back, wherever later changes moved it. */
218
+ getBookmark: () => SelectionBookmark;
219
+ moveToBookmark: (bookmark: SelectionBookmark) => boolean;
220
+ scrollIntoView: () => void;
193
221
  };
194
222
  readonly notificationManager: {
195
223
  open: (args: {
@@ -204,7 +232,7 @@ declare class CompatEditor {
204
232
  confirm: (message: string, callback?: (state: boolean) => void) => void;
205
233
  open: (spec: DialogSpec) => DialogApi;
206
234
  };
207
- /** editor.ui.registry — кнопки и пункты меню в формате TinyMCE поверх реестра NovaProse. */
235
+ /** editor.ui.registry — buttons and menu items in TinyMCE format on top of the NovaProse registry. */
208
236
  readonly ui: {
209
237
  registry: {
210
238
  addIcon: (name: string, svg: string) => void;
@@ -217,8 +245,8 @@ declare class CompatEditor {
217
245
  }) => void;
218
246
  addMenuItem: (name: string, spec: MenuItemSpec) => void;
219
247
  /**
220
- * Контекстная панель: predicate(node) получает элемент под курсором, items — кнопки тулбара.
221
- * position: 'node' (над элементом) или 'selection'/'line' (у выделения).
248
+ * A context toolbar: predicate(node) gets the element at the cursor, items are toolbar buttons.
249
+ * position: 'node' (above the element) or 'selection'/'line' (at the selection).
222
250
  */
223
251
  addContextToolbar: (name: string, spec: {
224
252
  predicate: (node: Element) => boolean;
@@ -227,8 +255,8 @@ declare class CompatEditor {
227
255
  label?: string;
228
256
  }) => void;
229
257
  /**
230
- * Боковая панель: onSetup(api) рисует содержимое в api.element() (один раз), onShow/onHide —
231
- * при показе. Кнопка-переключатель с именем панели — для toolbar; ToggleSidebar — командой.
258
+ * A sidebar: onSetup(api) draws the content into api.element() (once), onShow/onHide run when it
259
+ * is shown or hidden. A toggle button named after the sidebar is for the toolbar; ToggleSidebar is the command.
232
260
  */
233
261
  addSidebar: (name: string, spec: {
234
262
  tooltip?: string;
@@ -243,15 +271,33 @@ declare class CompatEditor {
243
271
  element(): HTMLElement;
244
272
  }) => void;
245
273
  }) => void;
274
+ /**
275
+ * A view in place of the editor: buttons at its top, onShow/onHide get api.getContainer(), where it
276
+ * draws; ToggleView is the command.
277
+ */
278
+ addView: (name: string, spec: {
279
+ buttons?: {
280
+ type?: string;
281
+ text?: string;
282
+ buttonType?: string;
283
+ onAction?: () => void;
284
+ }[];
285
+ onShow?: (api: {
286
+ getContainer(): HTMLElement;
287
+ }) => void;
288
+ onHide?: (api: {
289
+ getContainer(): HTMLElement;
290
+ }) => void;
291
+ }) => void;
246
292
  addContextForm: () => void;
247
293
  getAll: () => {};
248
294
  };
249
295
  };
250
296
  private addButton;
251
297
  /**
252
- * editor.dom — то, что имеет смысл поверх модели документа: поиск и чтение. Менять DOM текста
253
- * напрямую нельзя (редактор перерисует его из модели) — для правок есть setContent/insertContent/
254
- * formatter; такие вызовы пишут предупреждение.
298
+ * editor.dom — what makes sense on top of a document model: finding and reading. The text's DOM
299
+ * can't be changed directly (the editor redraws it from the model); use setContent, insertContent
300
+ * or formatter for edits — such calls log a warning.
255
301
  */
256
302
  readonly dom: {
257
303
  select: (selector: string, scope?: Element) => Element[];
@@ -265,7 +311,7 @@ declare class CompatEditor {
265
311
  getRoot: () => HTMLElement;
266
312
  encode: (text: string) => string;
267
313
  decode: (html: string) => string;
268
- /** Новый (не вставленный) элемент: атрибуты — через setAttribute, содержимое — текстом. */
314
+ /** A new (not inserted) element: attributes via setAttribute, the content as text. */
269
315
  create: (tag: string, attrs?: Record<string, string>, text?: string) => HTMLElement;
270
316
  uniqueId: (prefix?: string) => string;
271
317
  setAttrib: () => void;
@@ -275,8 +321,8 @@ declare class CompatEditor {
275
321
  remove: () => void;
276
322
  };
277
323
  /**
278
- * editor.formatter — встроенные форматы TinyMCE: apply/remove/toggle/match.
279
- * Свои форматы (register) пока не поддержаны.
324
+ * editor.formatter — the built-in TinyMCE formats: apply/remove/toggle/match. Your own formats
325
+ * (register) are not supported yet.
280
326
  */
281
327
  readonly formatter: {
282
328
  apply: (name: string, vars?: {
@@ -294,15 +340,15 @@ declare class CompatEditor {
294
340
  };
295
341
  private blockMatches;
296
342
  private applyFormat;
297
- /** Убрать редактор и вернуть исходный элемент (как editor.remove()). */
343
+ /** Remove the editor and restore the original element (like editor.remove()). */
298
344
  remove(): void;
299
345
  destroy(): void;
300
346
  }
301
347
 
302
348
  /**
303
- * Перевод конфигурации `tinymce.init({...})` в опции NovaProse. Имена опций и их смысл — из публичной
304
- * документации TinyMCE (описание поведения); незнакомые опции не ломают инициализацию, а
305
- * перечисляются в предупреждении, чтобы при переходе было видно, что ещё не поддержано.
349
+ * Translates a `tinymce.init({...})` configuration into NovaProse options. Option names and their
350
+ * meaning come from TinyMCE's public documentation (a description of behavior); unknown options
351
+ * don't break initialization but are listed in a warning, so it's clear what isn't supported yet.
306
352
  */
307
353
  type TinyConfig = Record<string, unknown> & {
308
354
  selector?: string;
@@ -316,30 +362,30 @@ type TinyConfig = Record<string, unknown> & {
316
362
  };
317
363
  interface MappedOptions {
318
364
  options: Omit<EditorOptions, 'element'>;
319
- /** Опции, которые NovaProse пока не понимает (для предупреждения). */
365
+ /** Options NovaProse doesn't understand yet (for the warning). */
320
366
  unknown: string[];
321
- /** Плагины, которых нет ни в ядре, ни в каталоге. */
367
+ /** Plugins found neither in the core nor in the catalog. */
322
368
  missingPlugins: string[];
323
369
  }
324
370
  declare function mapOptions(config: TinyConfig): MappedOptions;
325
371
 
326
372
  /**
327
- * Слой совместимости с API `tinymce` для перехода на NovaProse без переписывания интеграции:
373
+ * A compatibility layer with the `tinymce` API, to move to NovaProse without rewriting the integration:
328
374
  *
329
375
  * ```js
330
376
  * import { tinymce } from '@novaprose/tinymce-compat';
331
377
  * tinymce.init({ selector: 'textarea', plugins: 'lists link image', toolbar: 'undo redo | bold italic' });
332
378
  * ```
333
379
  *
334
- * Или тегом <script> (CDN-сборка задаёт window.tinymce и подключает стили сама).
335
- * Поведение — по публичной документации TinyMCE; код TinyMCE не используется.
380
+ * Or with a <script> tag (the CDN build sets window.tinymce and adds the styles itself).
381
+ * The behavior follows TinyMCE's public documentation; no TinyMCE code is used.
336
382
  */
337
383
  type PluginFn = (editor: CompatEditor, url: string) => unknown;
338
384
  interface TinyMCECompat {
339
- /** Версия API, под которую написана совместимость (некоторые интеграции проверяют её). */
385
+ /** The API version this compatibility targets (some integrations check it). */
340
386
  readonly majorVersion: string;
341
387
  readonly minorVersion: string;
342
- /** Признак: это NovaProse. */
388
+ /** A flag: this is NovaProse. */
343
389
  readonly novaprose: true;
344
390
  readonly activeEditor: CompatEditor | null;
345
391
  readonly editors: CompatEditor[];
@@ -367,7 +413,8 @@ interface TinyMCECompat {
367
413
  };
368
414
  }
369
415
  declare function createTinymce(): TinyMCECompat;
370
- /** Общий объект `tinymce` для модулей (CDN-сборка кладёт его в window.tinymce). */
416
+ /** The shared `tinymce` object for modules (the CDN build puts it into window.tinymce). */
371
417
  declare const tinymce: TinyMCECompat;
372
418
 
373
- export { CompatEditor, type TinyConfig, type TinyMCECompat, createTinymce, mapOptions, tinymce };
419
+ export { CompatEditor, createTinymce, mapOptions, tinymce };
420
+ export type { TinyConfig, TinyMCECompat };