jodit 3.19.4 → 3.20.2

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 (217) hide show
  1. package/build/jodit.css +45 -42
  2. package/build/jodit.es2018.css +38 -36
  3. package/build/jodit.es2018.en.css +38 -36
  4. package/build/jodit.es2018.en.js +22562 -25637
  5. package/build/jodit.es2018.en.min.css +1 -1
  6. package/build/jodit.es2018.en.min.js +1 -1
  7. package/build/jodit.es2018.js +23105 -26181
  8. package/build/jodit.es2018.min.css +1 -1
  9. package/build/jodit.es2018.min.js +1 -1
  10. package/build/jodit.js +797 -386
  11. package/build/jodit.min.css +2 -2
  12. package/build/jodit.min.js +1 -1
  13. package/build/plugins/debug/debug.es2018.en.js +97 -0
  14. package/build/plugins/debug/debug.es2018.en.min.js +1 -0
  15. package/build/plugins/debug/debug.es2018.js +97 -0
  16. package/build/plugins/debug/debug.es2018.min.js +1 -0
  17. package/build/plugins/debug/debug.js +96 -0
  18. package/build/plugins/debug/debug.min.js +1 -0
  19. package/build/plugins/speech-recognize/speech-recognize.css +1 -1
  20. package/build/plugins/speech-recognize/speech-recognize.es2018.css +1 -1
  21. package/build/plugins/speech-recognize/speech-recognize.es2018.en.css +1 -1
  22. package/build/plugins/speech-recognize/speech-recognize.es2018.en.js +331 -398
  23. package/build/plugins/speech-recognize/speech-recognize.es2018.en.min.js +1 -1
  24. package/build/plugins/speech-recognize/speech-recognize.es2018.js +331 -398
  25. package/build/plugins/speech-recognize/speech-recognize.es2018.min.js +1 -1
  26. package/build/plugins/speech-recognize/speech-recognize.js +1 -1
  27. package/build/vdom.css +1 -1
  28. package/build/vdom.js +1 -1
  29. package/index.html +2 -2
  30. package/package.json +9 -4
  31. package/src/config.ts +4 -2
  32. package/src/core/constants.ts +7 -7
  33. package/src/core/decorators/derive/README.md +71 -0
  34. package/src/core/decorators/derive/derive.ts +48 -0
  35. package/src/core/decorators/index.ts +1 -0
  36. package/src/core/decorators/spy/spy.ts +5 -0
  37. package/src/core/dom/dom.test.js +0 -1
  38. package/src/core/dom/dom.ts +28 -13
  39. package/src/core/event-emitter/observable.ts +3 -3
  40. package/src/core/helpers/helpers.test.js +0 -170
  41. package/src/core/plugin/plugin-system.ts +20 -0
  42. package/src/core/selection/select.ts +27 -9
  43. package/src/core/selection/style/api/toggle/toggle-ordered-list.ts +5 -1
  44. package/src/core/selection/style/api/wrap-ordered-list.ts +5 -1
  45. package/src/core/selection/style/api/wrap-unwrapped-text.ts +1 -1
  46. package/src/core/selection/style/style.test.js +1 -1
  47. package/src/core/{view/panel.ts → traits/dlgs.ts} +17 -9
  48. package/src/core/traits/elms.ts +4 -8
  49. package/src/core/traits/index.ts +1 -0
  50. package/src/core/traits/mods.ts +17 -10
  51. package/src/core/ui/button/index.ts +1 -0
  52. package/src/{plugins → core/ui/button}/tooltip/README.md +0 -0
  53. package/src/{plugins → core/ui/button}/tooltip/tooltip.less +4 -4
  54. package/src/{plugins → core/ui/button}/tooltip/tooltip.test.js +3 -2
  55. package/src/core/ui/button/tooltip/tooltip.ts +132 -0
  56. package/src/core/ui/element.ts +5 -27
  57. package/src/core/ui/group/group.test.js +44 -0
  58. package/src/core/ui/group/group.ts +4 -4
  59. package/src/core/view/view-with-toolbar.ts +2 -2
  60. package/src/core/view/view.ts +11 -33
  61. package/src/jodit.ts +20 -8
  62. package/src/langs/ar.js +1 -1
  63. package/src/langs/cs_cz.js +1 -1
  64. package/src/langs/de.js +1 -1
  65. package/src/langs/es.js +1 -1
  66. package/src/langs/fa.js +1 -1
  67. package/src/langs/fr.js +1 -1
  68. package/src/langs/he.js +1 -1
  69. package/src/langs/hu.js +1 -1
  70. package/src/langs/i18n.test.js +170 -0
  71. package/src/langs/id.js +1 -1
  72. package/src/langs/it.js +1 -1
  73. package/src/langs/ja.js +1 -1
  74. package/src/langs/ko.js +1 -1
  75. package/src/langs/nl.js +1 -1
  76. package/src/langs/pl.js +1 -1
  77. package/src/langs/pt_br.js +1 -1
  78. package/src/langs/ru.js +1 -1
  79. package/src/langs/tr.js +1 -1
  80. package/src/langs/zh_cn.js +1 -1
  81. package/src/langs/zh_tw.js +1 -1
  82. package/src/modules/dialog/dialog.less +2 -0
  83. package/src/modules/dialog/dialog.ts +27 -50
  84. package/src/modules/file-browser/README.md +10 -10
  85. package/src/modules/file-browser/__image_snapshots__/file-browser-test-screenshot-js-filebrowser-screenshot-testing-open-filebrowser-works-1-snap.png +0 -0
  86. package/src/modules/file-browser/builders/context-menu.ts +1 -1
  87. package/src/modules/file-browser/file-browser.test.js +26 -13
  88. package/src/modules/file-browser/file-browser.test.screenshot.js +23 -0
  89. package/src/modules/file-browser/file-browser.ts +9 -5
  90. package/src/modules/history/snapshot.ts +12 -3
  91. package/src/modules/image-editor/__image_snapshots__/image-editor-test-screenshot-js-image-editor-screenshot-testing-open-image-editor-works-1-snap.png +0 -0
  92. package/src/modules/image-editor/image-editor.test.screenshot.js +25 -0
  93. package/src/modules/image-editor/image-editor.ts +7 -6
  94. package/src/modules/status-bar/status-bar.ts +5 -16
  95. package/src/modules/table/table.test.js +2 -1
  96. package/src/modules/toolbar/collection/collection.ts +6 -1
  97. package/src/modules/uploader/README.md +1 -1
  98. package/src/modules/uploader/config.ts +1 -1
  99. package/src/modules/uploader/uploader.test.js +96 -46
  100. package/src/plugins/about/about.ts +1 -1
  101. package/src/plugins/add-new-line/add-new-line.ts +5 -4
  102. package/src/plugins/backspace/backspace.test.js +33 -39
  103. package/src/plugins/backspace/backspace.ts +10 -4
  104. package/src/plugins/backspace/cases/check-remove-char.ts +36 -14
  105. package/src/plugins/backspace/cases/check-remove-unbreakable-element.ts +8 -0
  106. package/src/plugins/backspace/config.ts +1 -1
  107. package/src/plugins/backspace/interface.d.ts +1 -1
  108. package/src/plugins/clean-html/clean-html.test.js +240 -164
  109. package/src/plugins/clean-html/config.ts +10 -2
  110. package/src/plugins/clean-html/helpers/remove-format/remove-format-for-collapsed-selection.ts +3 -2
  111. package/src/plugins/clean-html/helpers/remove-format/remove-format-for-selection.ts +2 -2
  112. package/src/plugins/clean-html/helpers/visitor/filters/index.ts +1 -0
  113. package/src/plugins/clean-html/helpers/visitor/filters/remove-empty-text-node.ts +35 -0
  114. package/src/plugins/clean-html/helpers/visitor/filters/remove-inv-text-nodes.ts +2 -6
  115. package/src/plugins/clean-html/helpers/visitor/visit-node-walker.ts +5 -0
  116. package/src/plugins/debug/debug.ts +68 -0
  117. package/src/plugins/drag-and-drop/drag-and-drop.ts +0 -1
  118. package/src/plugins/drag-and-drop-element/drag-and-drop-element.test.js +37 -34
  119. package/src/plugins/dtd/README.md +52 -0
  120. package/{types/plugins/tooltip/tooltip.d.ts → src/plugins/dtd/after-insert/index.ts} +5 -4
  121. package/src/plugins/dtd/after-insert/remove-extra-br.ts +39 -0
  122. package/src/plugins/dtd/before-insert/check-block-nesting.ts +40 -0
  123. package/src/plugins/dtd/before-insert/index.ts +12 -0
  124. package/src/plugins/dtd/config.ts +67 -0
  125. package/src/plugins/dtd/dtd.test.js +128 -0
  126. package/src/plugins/dtd/dtd.ts +48 -0
  127. package/src/plugins/enter/enter.test.js +89 -193
  128. package/src/plugins/enter/enter.ts +14 -11
  129. package/src/plugins/enter/helpers/check-br.ts +11 -1
  130. package/src/plugins/enter/helpers/index.ts +1 -0
  131. package/src/plugins/enter/helpers/move-cursor-out-from-specal-tags.ts +32 -0
  132. package/src/plugins/enter/helpers/split-fragment.ts +1 -0
  133. package/src/plugins/fullsize/config.ts +1 -1
  134. package/src/plugins/fullsize/fullsize.test.js +77 -12
  135. package/src/plugins/fullsize/fullsize.ts +12 -1
  136. package/src/plugins/iframe/config.ts +1 -1
  137. package/src/plugins/image-properties/README.md +7 -0
  138. package/src/plugins/image-properties/image-properties.ts +1 -1
  139. package/src/plugins/index.ts +1 -1
  140. package/src/plugins/limit/limit.test.js +27 -0
  141. package/src/plugins/limit/limit.ts +4 -2
  142. package/src/plugins/line-height/line-height.svg +1 -1
  143. package/src/plugins/link/README.md +5 -0
  144. package/src/plugins/link/link.test.js +11 -12
  145. package/src/plugins/link/link.ts +1 -1
  146. package/src/plugins/mobile/mobile.ts +1 -1
  147. package/src/plugins/ordered-list/ordered-list.test.js +3 -14
  148. package/src/plugins/paste/config.ts +0 -7
  149. package/src/plugins/paste/paste.test.js +3 -3
  150. package/src/plugins/paste-storage/paste-storage.ts +1 -1
  151. package/src/plugins/preview/preview.ts +1 -1
  152. package/src/plugins/search/search.ts +1 -1
  153. package/src/plugins/select/config.ts +1 -1
  154. package/src/plugins/spellcheck/config.ts +1 -1
  155. package/src/plugins/symbols/symbols.test.js +5 -4
  156. package/src/plugins/table/config.ts +4 -17
  157. package/src/plugins/table/table.test.js +2 -2
  158. package/src/plugins/wrap-nodes/wrap-nodes.test.js +34 -5
  159. package/src/plugins/wrap-nodes/wrap-nodes.ts +59 -16
  160. package/src/styles/variables.less +1 -1
  161. package/src/types/ajax.d.ts +2 -2
  162. package/src/types/file-browser.d.ts +4 -2
  163. package/src/types/jodit.d.ts +3 -2
  164. package/src/types/plugin.d.ts +1 -0
  165. package/src/types/toolbar.d.ts +12 -6
  166. package/src/types/traits.d.ts +30 -1
  167. package/src/types/types.d.ts +1 -0
  168. package/src/types/view.d.ts +9 -34
  169. package/src/typings.d.ts +1 -0
  170. package/types/config.d.ts +3 -2
  171. package/types/core/constants.d.ts +7 -7
  172. package/types/core/decorators/derive/derive.d.ts +6 -0
  173. package/types/core/decorators/index.d.ts +1 -0
  174. package/types/core/dom/dom.d.ts +5 -4
  175. package/types/core/plugin/plugin-system.d.ts +4 -0
  176. package/types/core/traits/dlgs.d.ts +15 -0
  177. package/types/core/traits/elms.d.ts +2 -4
  178. package/types/core/traits/index.d.ts +1 -0
  179. package/types/core/traits/mods.d.ts +5 -8
  180. package/types/core/ui/button/index.d.ts +1 -0
  181. package/types/core/ui/button/tooltip/tooltip.d.ts +29 -0
  182. package/types/core/ui/element.d.ts +3 -9
  183. package/types/core/ui/group/group.d.ts +2 -2
  184. package/types/core/view/view-with-toolbar.d.ts +2 -2
  185. package/types/core/view/view.d.ts +5 -10
  186. package/types/jodit.d.ts +7 -4
  187. package/types/modules/dialog/dialog.d.ts +8 -10
  188. package/types/modules/file-browser/file-browser.d.ts +5 -2
  189. package/types/modules/history/snapshot.d.ts +3 -2
  190. package/types/modules/image-editor/image-editor.d.ts +4 -4
  191. package/types/modules/status-bar/status-bar.d.ts +3 -4
  192. package/types/modules/toolbar/collection/collection.d.ts +1 -0
  193. package/types/plugins/clean-html/config.d.ts +7 -1
  194. package/types/plugins/clean-html/helpers/visitor/filters/index.d.ts +1 -0
  195. package/types/plugins/clean-html/helpers/visitor/filters/remove-empty-text-node.d.ts +13 -0
  196. package/types/plugins/dtd/after-insert/index.d.ts +10 -0
  197. package/types/plugins/dtd/after-insert/remove-extra-br.d.ts +16 -0
  198. package/types/plugins/dtd/before-insert/check-block-nesting.d.ts +16 -0
  199. package/types/plugins/dtd/before-insert/index.d.ts +10 -0
  200. package/types/plugins/dtd/config.d.ts +27 -0
  201. package/types/plugins/dtd/dtd.d.ts +6 -0
  202. package/types/plugins/enter/helpers/index.d.ts +1 -0
  203. package/types/plugins/enter/helpers/move-cursor-out-from-specal-tags.d.ts +13 -0
  204. package/types/plugins/iframe/config.d.ts +1 -1
  205. package/types/plugins/index.d.ts +1 -1
  206. package/types/plugins/paste/config.d.ts +0 -4
  207. package/types/plugins/spellcheck/config.d.ts +1 -1
  208. package/types/types/ajax.d.ts +2 -2
  209. package/types/types/file-browser.d.ts +4 -2
  210. package/types/types/jodit.d.ts +3 -2
  211. package/types/types/plugin.d.ts +1 -0
  212. package/types/types/toolbar.d.ts +12 -6
  213. package/types/types/traits.d.ts +30 -1
  214. package/types/types/types.d.ts +1 -0
  215. package/types/types/view.d.ts +9 -34
  216. package/src/plugins/tooltip/tooltip.ts +0 -114
  217. package/types/core/view/panel.d.ts +0 -13
package/src/langs/it.js CHANGED
@@ -19,7 +19,7 @@ module.exports = {
19
19
  'Copyright © XDSoft.net - Chupurnov Valeriy. Alle Rechte vorbehalten.',
20
20
  Anchor: 'Ancora',
21
21
  'Open in new tab': 'Apri in una nuova scheda',
22
- 'Open editor in fullsize': "Apri l'editor a schermo intero",
22
+ 'Open in fullsize': "Apri l'editor a schermo intero",
23
23
  'Clear Formatting': 'Formato chiaro',
24
24
  'Fill color or set the text color': 'Riempi colore o lettera',
25
25
  Redo: 'Ripristina',
package/src/langs/ja.js CHANGED
@@ -18,7 +18,7 @@ module.exports = {
18
18
  'Copyright © XDSoft.net - Chupurnov Valeriy. All rights reserved.',
19
19
  Anchor: 'Anchor',
20
20
  'Open in new tab': '新しいタブで開く',
21
- 'Open editor in fullsize': 'エディターのサイズ(フル/ノーマル)',
21
+ 'Open in fullsize': 'エディターのサイズ(フル/ノーマル)',
22
22
  'Clear Formatting': '書式をクリア',
23
23
  'Fill color or set the text color': 'テキストの色',
24
24
  Redo: 'やり直し',
package/src/langs/ko.js CHANGED
@@ -17,7 +17,7 @@ module.exports = {
17
17
  '© XDSoft.net - Chupurnov Valeriy. 에게 저작권과 모든 권리가 있습니다.',
18
18
  Anchor: 'Anchor',
19
19
  'Open in new tab': '새 탭에서 열기',
20
- 'Open editor in fullsize': '전체 크기로 보기',
20
+ 'Open in fullsize': '전체 크기로 보기',
21
21
  'Clear Formatting': '서식 지우기',
22
22
  'Fill color or set the text color': '글씨 색상',
23
23
  Redo: '재실행',
package/src/langs/nl.js CHANGED
@@ -20,7 +20,7 @@ module.exports = {
20
20
  'Copyright © XDSoft.net - Chupurnov Valeriy. Alle rechten voorbehouden.',
21
21
  Anchor: 'Anker',
22
22
  'Open in new tab': 'Open in nieuwe tab',
23
- 'Open editor in fullsize': 'Editor in volledig scherm openen',
23
+ 'Open in fullsize': 'Editor in volledig scherm openen',
24
24
  'Clear Formatting': 'Opmaak verwijderen',
25
25
  'Fill color or set the text color': 'Vulkleur of tekstkleur aanpassen',
26
26
  Redo: 'Opnieuw',
package/src/langs/pl.js CHANGED
@@ -19,7 +19,7 @@ module.exports = {
19
19
  'Copyright © XDSoft.net - Chupurnov Valeriy. Wszystkie prawa zastrzeżone.',
20
20
  Anchor: 'Kotwica',
21
21
  'Open in new tab': 'Otwórz w nowej zakładce',
22
- 'Open editor in fullsize': 'Otwórz edytor w pełnym rozmiarze',
22
+ 'Open in fullsize': 'Otwórz edytor w pełnym rozmiarze',
23
23
  'Clear Formatting': 'Wyczyść formatowanie',
24
24
  'Fill color or set the text color':
25
25
  'Kolor wypełnienia lub ustaw kolor tekstu',
@@ -18,7 +18,7 @@ module.exports = {
18
18
  'Copyright © XDSoft.net - Chupurnov Valeriy. Todos os direitos reservados.',
19
19
  Anchor: 'Link',
20
20
  'Open in new tab': 'Abrir em nova aba',
21
- 'Open editor in fullsize': 'Abrir editor em tela cheia',
21
+ 'Open in fullsize': 'Abrir editor em tela cheia',
22
22
  'Clear Formatting': 'Limpar formatação',
23
23
  'Fill color or set the text color': 'Cor de preenchimento ou cor do texto',
24
24
  Redo: 'Refazer',
package/src/langs/ru.js CHANGED
@@ -18,7 +18,7 @@ module.exports = {
18
18
  'Авторские права © XDSoft.net - Чупурнов Валерий. Все права защищены.',
19
19
  Anchor: 'Анкор',
20
20
  'Open in new tab': 'Открывать ссылку в новой вкладке',
21
- 'Open editor in fullsize': 'Открыть редактор в полном размере',
21
+ 'Open in fullsize': 'Открыть редактор в полном размере',
22
22
  'Clear Formatting': 'Очистить форматирование',
23
23
  'Fill color or set the text color': 'Цвет заливки или цвет текста',
24
24
  Redo: 'Повтор',
package/src/langs/tr.js CHANGED
@@ -18,7 +18,7 @@ module.exports = {
18
18
  'Copyright © XDSoft.net - Chupurnov Valeriy. Tüm hakları saklıdır.',
19
19
  Anchor: 'Bağlantı',
20
20
  'Open in new tab': 'Yeni sekmede aç',
21
- 'Open editor in fullsize': 'Editörü tam ekranda aç',
21
+ 'Open in fullsize': 'Editörü tam ekranda aç',
22
22
  'Clear Formatting': 'Stili temizle',
23
23
  'Fill color or set the text color': 'Renk doldur veya yazı rengi seç',
24
24
  Redo: 'Yinele',
@@ -19,7 +19,7 @@ module.exports = {
19
19
  'Copyright © XDSoft.net - Chupurnov Valeriy. 版权所有',
20
20
  Anchor: 'Anchor',
21
21
  'Open in new tab': '在新窗口打开',
22
- 'Open editor in fullsize': '全屏编辑',
22
+ 'Open in fullsize': '全屏编辑',
23
23
  'Clear Formatting': '清除样式',
24
24
  'Fill color or set the text color': '颜色',
25
25
  Redo: '重做',
@@ -18,7 +18,7 @@ module.exports = {
18
18
  'Copyright © XDSoft.net - Chupurnov Valeriy. All rights reserved.',
19
19
  Anchor: 'Anchor',
20
20
  'Open in new tab': '在新窗口打開',
21
- 'Open editor in fullsize': '全屏編輯',
21
+ 'Open in fullsize': '全屏編輯',
22
22
  'Clear Formatting': '清除樣式',
23
23
  'Fill color or set the text color': '顏色',
24
24
  Redo: '重做',
@@ -107,6 +107,8 @@
107
107
  top: auto !important;
108
108
  left: auto !important;
109
109
  width: 100% !important;
110
+ box-shadow: none;
111
+ border: 1px solid var(--color-border)
110
112
  }
111
113
 
112
114
  &_theme_dark,
@@ -73,11 +73,10 @@ Config.prototype.controls.dialog = {
73
73
  close: {
74
74
  icon: 'cancel',
75
75
  exec: dialog => {
76
- (dialog as Dialog).close();
77
- (dialog as Dialog).toggleFullSizeBox(false);
76
+ dialog.close();
78
77
  }
79
78
  }
80
- } as IDictionary<IControlType>;
79
+ } as IDictionary<IControlType<IDialog>>;
81
80
 
82
81
  /**
83
82
  * Module to generate dialog windows
@@ -89,7 +88,7 @@ export class Dialog extends ViewWithToolbar implements IDialog {
89
88
  return 'Dialog';
90
89
  }
91
90
 
92
- private resizer!: HTMLElement;
91
+ private readonly resizer!: HTMLElement;
93
92
  override toolbar!: IToolbarCollection;
94
93
 
95
94
  private offsetX?: number;
@@ -103,8 +102,6 @@ export class Dialog extends ViewWithToolbar implements IDialog {
103
102
 
104
103
  private moved: boolean = false;
105
104
 
106
- private iSetMaximization: boolean = false;
107
-
108
105
  private resizable: boolean = false;
109
106
  private draggable: boolean = false;
110
107
  private startX: number = 0;
@@ -328,14 +325,14 @@ export class Dialog extends ViewWithToolbar implements IDialog {
328
325
 
329
326
  override OPTIONS!: IDialogOptions;
330
327
 
331
- dialog!: HTMLElement;
328
+ readonly dialog!: HTMLElement;
332
329
 
333
330
  workplace!: HTMLDivElement;
334
331
 
335
- private dialogbox_header!: HTMLElement;
336
- private dialogbox_content!: HTMLElement;
337
- private dialogbox_footer!: HTMLElement;
338
- private dialogbox_toolbar!: HTMLElement;
332
+ private readonly dialogbox_header!: HTMLElement;
333
+ private readonly dialogbox_content!: HTMLElement;
334
+ private readonly dialogbox_footer!: HTMLElement;
335
+ private readonly dialogbox_toolbar!: HTMLElement;
339
336
 
340
337
  /**
341
338
  * Specifies the size of the window
@@ -512,28 +509,14 @@ export class Dialog extends ViewWithToolbar implements IDialog {
512
509
  /**
513
510
  * Expands the dialog on full browser window
514
511
  */
515
- maximization(condition?: boolean): boolean {
516
- if (isVoid(condition)) {
517
- condition = !this.getMod('fullsize');
512
+ override toggleFullSize(isFullSize?: boolean): void {
513
+ if (isVoid(isFullSize)) {
514
+ isFullSize = !this.getMod('fullsize');
518
515
  }
519
516
 
520
- this.setMod('fullsize', condition);
521
-
522
- this.toggleFullSizeBox(condition);
523
- this.iSetMaximization = condition;
517
+ this.setMod('fullsize', isFullSize);
524
518
 
525
- return condition;
526
- }
527
-
528
- toggleFullSizeBox(condition: boolean): void {
529
- [this.destination, this.destination.parentNode].forEach(box => {
530
- box &&
531
- (box as HTMLElement).classList &&
532
- (box as HTMLElement).classList.toggle(
533
- 'jodit_fullsize-box_true',
534
- condition
535
- );
536
- });
519
+ super.toggleFullSize(isFullSize);
537
520
  }
538
521
 
539
522
  open(destroyAfterClose: boolean): this;
@@ -551,7 +534,7 @@ export class Dialog extends ViewWithToolbar implements IDialog {
551
534
  * It opens a dialog box to center it, and causes the two event.
552
535
  *
553
536
  * @param contentOrClose - specifies the contents of the dialog box.
554
- * Can be false or undefined. see `{@link Dialog~setContent|setContent}`
537
+ * Can be false or undefined. see [[Dialog.setContent]]
555
538
  * @param title - specifies the title of the dialog box, @see setHeader
556
539
  * @param destroyAfterClose - true - After closing the window , the destructor will be called.
557
540
  * @param modal - true window will be opened in modal mode
@@ -604,7 +587,7 @@ export class Dialog extends ViewWithToolbar implements IDialog {
604
587
  this.setMaxZIndex();
605
588
 
606
589
  if (this.o.fullsize) {
607
- this.maximization(true);
590
+ this.toggleFullSize(true);
608
591
  }
609
592
 
610
593
  /**
@@ -653,7 +636,7 @@ export class Dialog extends ViewWithToolbar implements IDialog {
653
636
  * ```
654
637
  */
655
638
  @autobind
656
- close(e?: MouseEvent): this {
639
+ close(): this {
657
640
  if (
658
641
  this.isDestructed ||
659
642
  !this.isOpened ||
@@ -662,15 +645,10 @@ export class Dialog extends ViewWithToolbar implements IDialog {
662
645
  return this;
663
646
  }
664
647
 
665
- if (e) {
666
- e.stopImmediatePropagation();
667
- e.preventDefault();
668
- }
669
-
670
648
  /**
671
649
  * Called up to close the window
672
650
  */
673
- if (this.e && this.e.fire('beforeClose', this) === false) {
651
+ if (this.e.fire('beforeClose', this) === false) {
674
652
  return this;
675
653
  }
676
654
 
@@ -678,9 +656,8 @@ export class Dialog extends ViewWithToolbar implements IDialog {
678
656
 
679
657
  this.isOpened = false;
680
658
 
681
- this.e.fire('toggleFullSize', false);
682
- if (this.iSetMaximization) {
683
- this.maximization(false);
659
+ if (this.isFullSize) {
660
+ this.toggleFullSize(false);
684
661
  }
685
662
 
686
663
  Dom.safeRemove(this.container);
@@ -694,8 +671,8 @@ export class Dialog extends ViewWithToolbar implements IDialog {
694
671
  /**
695
672
  * It called after the window is closed
696
673
  */
697
- this.e?.fire(this, 'afterClose');
698
- this.e?.fire(this.ow, 'joditCloseDialog');
674
+ this.e.fire(this, 'afterClose');
675
+ this.e.fire(this.ow, 'joditCloseDialog');
699
676
 
700
677
  return this;
701
678
  }
@@ -769,12 +746,12 @@ export class Dialog extends ViewWithToolbar implements IDialog {
769
746
  'header-toolbar element does not exist'
770
747
  );
771
748
 
772
- self.dialog = dialog;
773
- self.resizer = resizer;
774
- self.dialogbox_header = dialogbox_header;
775
- self.dialogbox_content = dialogbox_content;
776
- self.dialogbox_footer = dialogbox_footer;
777
- self.dialogbox_toolbar = dialogbox_toolbar;
749
+ this.dialog = dialog;
750
+ this.resizer = resizer;
751
+ this.dialogbox_header = dialogbox_header;
752
+ this.dialogbox_content = dialogbox_content;
753
+ this.dialogbox_footer = dialogbox_footer;
754
+ this.dialogbox_toolbar = dialogbox_toolbar;
778
755
 
779
756
  css(self.dialog, {
780
757
  maxWidth: self.options.maxWidth,
@@ -124,7 +124,7 @@ Jodit.make('#editor', {
124
124
  - filebrowser.showFileName=true Show filename in thumbs
125
125
  - filebrowser.showFileSize=true Show filesize in thumbs
126
126
  - filebrowser.showFileChangeTime=true Show the last modification time in thumbs
127
- - filebrowser.editImage=true use {@link ImageEditor|Image editor module} - crop and resize image
127
+ - filebrowser.editImage=true use [[ImageEditor]] - crop and resize image
128
128
  - filebrowser.preview=true Show preview button in context menu
129
129
  - filebrowser.showPreviewNavigation=true Show navigation buttons in preview
130
130
  - filebrowser.showSelectButtonInPreview=true Show select button in preview
@@ -208,30 +208,30 @@ const response = {
208
208
  send along with requests using the `XMLHttpRequest` transport. The header `X-Requested-With: XMLHttpRequest`
209
209
  is always added, but its default `XMLHttpRequest` value can be changed here.
210
210
  @property {object} `filebrowser.resize` Settings for AJAX connections to the server to resize
211
- image. By default, the uses {@link Jodit.defaultOptions.filebrowser.ajax|filebrowser.ajax} with argument
211
+ image. By default, the uses [[Config.filebrowser.ajax]] with argument
212
212
  action=create
213
213
  - filebrowser.crop Settings for AJAX connections to the server to crop image.
214
- By default, the uses {@link Jodit.defaultOptions.filebrowser.ajax|filebrowser.ajax} with argument
214
+ By default, the uses [[Config.filebrowser.ajax]] with argument
215
215
  action=create
216
216
  - filebrowser.c Settings for AJAX connections to the server to create
217
- the category . By default, the uses {@link Jodit.defaultOptions.filebrowser.ajax|filebrowser.ajax}
217
+ the category . By default, the uses [[Config.filebrowser.ajax]]
218
218
  with argument `action=create`
219
219
  - filebrowser.move Settings for AJAX connections to the server for the moving
220
- image or category . By default uses {@link Jodit.defaultOptions.filebrowser.ajax|filebrowser.ajax}
220
+ image or category . By default uses [[Config.filebrowser.ajax]]
221
221
  with argument `action=move`
222
222
  - filebrowser.remove Settings for AJAX connections to the server toWYSIWYG
223
- delete the image or category . By default uses {@link Jodit.defaultOptions.filebrowser.ajax|filebrowser.ajax}
223
+ delete the image or category . By default uses [[Config.filebrowser.ajax]]
224
224
  with argument `action=remove`
225
225
  @property {object} filebrowser.folder Settings for AJAX connections to the server toWYSIWYG
226
226
  download the list of categories .
227
- By default uses {@link Jodit.defaultOptions.filebrowser.ajax|filebrowser.ajax}
227
+ By default uses [[Config.filebrowser.ajax]]
228
228
  with argument `action=folder`
229
229
  - filebrowser.items Settings for AJAX connections to the server to download
230
230
  the image list in the specified category . By default uses
231
- {@link Jodit.defaultOptions.filebrowser.ajax|filebrowser.ajax} with argument action=items
232
- - filebrowser.uploader=null Settings Module {@link Uploader|Uploader}
231
+ [[Config.filebrowser.ajax]] with argument action=items
232
+ - filebrowser.uploader=null Settings Module [[Uploader]]
233
233
  for fast uploading images in category via Drag&Drop file in the file browser. The default settings of
234
- the module {@link Uploader|Uploader}
234
+ the module [[Uploader]]
235
235
 
236
236
  Example:
237
237
 
@@ -116,7 +116,7 @@ export default (self: IFileBrowser): ((e: DragEvent) => boolean | void) => {
116
116
  icon: 'eye',
117
117
  title: 'Preview',
118
118
  exec: (): void => {
119
- const preview = self.dialog({
119
+ const preview = self.dlg({
120
120
  buttons: ['fullsize', 'dialog.close']
121
121
  }),
122
122
  temp_content = self.c.div(
@@ -727,6 +727,9 @@ describe('Jodit FileBrowser Tests', function () {
727
727
  }
728
728
  });
729
729
 
730
+ editor.value = '<p>test|</p>';
731
+ setCursorToChar(editor);
732
+
730
733
  const filebrowser = editor.filebrowser;
731
734
 
732
735
  filebrowser
@@ -746,11 +749,11 @@ describe('Jodit FileBrowser Tests', function () {
746
749
  );
747
750
 
748
751
  simulateEvent('dragover', window, function (data) {
749
- data.clientX = 50;
750
- data.clientY = 20 + offset(editor.editor).top;
752
+ fillXY(data, editor);
751
753
  });
752
754
 
753
755
  simulateEvent('drop', editor.editor, function (data) {
756
+ fillXY(data, editor);
754
757
  Object.defineProperty(data, 'dataTransfer', {
755
758
  value: {
756
759
  files: []
@@ -761,7 +764,7 @@ describe('Jodit FileBrowser Tests', function () {
761
764
  simulateEvent('change', window);
762
765
  editor.async.requestIdleCallback(() => {
763
766
  expect(editor.value).equals(
764
- '<p><img src="https://xdsoft.net/jodit/files/images.jpg"></p>'
767
+ '<p>test<img src="https://xdsoft.net/jodit/files/images.jpg"></p>'
765
768
  );
766
769
 
767
770
  simulateEvent('drop', window);
@@ -786,6 +789,8 @@ describe('Jodit FileBrowser Tests', function () {
786
789
  }
787
790
  }
788
791
  });
792
+ editor.value = '<p>test|</p>';
793
+ setCursorToChar(editor);
789
794
 
790
795
  const filebrowser = editor.filebrowser;
791
796
 
@@ -806,11 +811,11 @@ describe('Jodit FileBrowser Tests', function () {
806
811
  );
807
812
 
808
813
  simulateEvent('dragover', window, function (data) {
809
- data.clientX = 50;
810
- data.clientY = 20 + offset(editor.editor).top;
814
+ fillXY(data, editor);
811
815
  });
812
816
 
813
817
  simulateEvent('drop', editor.editor, function (data) {
818
+ fillXY(data, editor);
814
819
  Object.defineProperty(data, 'dataTransfer', {
815
820
  value: {
816
821
  files: []
@@ -819,7 +824,7 @@ describe('Jodit FileBrowser Tests', function () {
819
824
  });
820
825
 
821
826
  expect(editor.value).equals(
822
- '<p><a href="https://xdsoft.net/jodit/files/test.txt">https://xdsoft.net/jodit/files/test.txt</a></p>'
827
+ '<p>test<a href="https://xdsoft.net/jodit/files/test.txt">https://xdsoft.net/jodit/files/test.txt</a></p>'
823
828
  );
824
829
  simulateEvent('drop', window);
825
830
 
@@ -958,16 +963,22 @@ describe('Jodit FileBrowser Tests', function () {
958
963
  }
959
964
  });
960
965
 
961
- editor.value = '';
966
+ editor.value = '<p>test|</p>';
967
+ setCursorToChar(editor);
962
968
 
963
969
  editor.events.on('filesWereUploaded', function () {
964
- expect(sortAttributes(editor.value)).equals(
965
- '<p><img src="https://xdsoft.net/jodit/files/test.png" style="width:300px"></p>'
966
- );
967
- done();
970
+ try {
971
+ expect(sortAttributes(editor.value)).equals(
972
+ '<p>test<img src="https://xdsoft.net/jodit/files/test.png" style="width:300px"></p>'
973
+ );
974
+ done();
975
+ } catch (e) {
976
+ done(e);
977
+ }
968
978
  });
969
979
 
970
980
  simulateEvent('drop', editor.editor, function (data) {
981
+ fillXY(data, editor);
971
982
  Object.defineProperty(data, 'dataTransfer', {
972
983
  value: {
973
984
  files: [{ name: 'test.png', type: 'image/png' }]
@@ -990,16 +1001,18 @@ describe('Jodit FileBrowser Tests', function () {
990
1001
  }
991
1002
  });
992
1003
 
993
- editor.value = '';
1004
+ editor.value = '<p>test|</p>';
1005
+ setCursorToChar(editor);
994
1006
 
995
1007
  editor.events.on('filesWereUploaded', function () {
996
1008
  expect(editor.value).equals(
997
- '<p><a href="https://xdsoft.net/jodit/files/test.txt">https://xdsoft.net/jodit/files/test.txt</a></p>'
1009
+ '<p>test<a href="https://xdsoft.net/jodit/files/test.txt">https://xdsoft.net/jodit/files/test.txt</a></p>'
998
1010
  );
999
1011
  done();
1000
1012
  });
1001
1013
 
1002
1014
  simulateEvent('drop', editor.editor, function (data) {
1015
+ fillXY(data, editor);
1003
1016
  Object.defineProperty(data, 'dataTransfer', {
1004
1017
  value: {
1005
1018
  files: [
@@ -0,0 +1,23 @@
1
+ /*!
2
+ * Jodit Editor (https://xdsoft.net/jodit/)
3
+ * Released under MIT see LICENSE.txt in the project root for license information.
4
+ * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
+ */
6
+
7
+ require('../../../test/bootstrap.screenshot.js');
8
+ const expect = require('expect');
9
+
10
+ describe('Filebrowser screenshot testing', () => {
11
+ describe('Open filebrowser', () => {
12
+ it('works', async function () {
13
+ await page.evaluate(() => {
14
+ return editor.filebrowser.open();
15
+ });
16
+
17
+ await page.waitForSelector('[data-jodit-filebrowser-item="true"]');
18
+ const dialog = await page.$('[role="dialog"] .jodit-dialog__panel');
19
+ const screenshot = await dialog.screenshot();
20
+ expect(screenshot).toMatchImageSnapshot(this);
21
+ }).timeout(10000);
22
+ });
23
+ });
@@ -40,23 +40,27 @@ import {
40
40
  trim,
41
41
  isAbort
42
42
  } from 'jodit/core/helpers';
43
- import { Panel } from 'jodit/core/view/panel';
44
43
  import { Dom } from 'jodit/core/dom';
45
44
  import { makeDataProvider } from './factories';
46
45
  import { stateListeners } from './listeners/state-listeners';
47
46
  import { nativeListeners } from './listeners/native-listeners';
48
47
  import { selfListeners } from './listeners/self-listeners';
49
48
  import { DEFAULT_SOURCE_NAME } from './data-provider';
50
- import { autobind } from 'jodit/core/decorators';
49
+ import { autobind, derive } from 'jodit/core/decorators';
51
50
  import { FileBrowserFiles, FileBrowserTree } from './ui';
52
51
  import { observable } from 'jodit/core/event-emitter';
53
52
  import { loadTree } from './fetch/load-tree';
54
53
  import { loadItems } from './fetch/load-items';
55
54
  import { STATUSES } from 'jodit/core/component';
55
+ import { Dlgs } from 'jodit/core/traits';
56
+ import { ViewWithToolbar } from 'jodit/core/view/view-with-toolbar';
56
57
 
57
58
  import './config';
58
59
 
59
- export class FileBrowser extends Panel implements IFileBrowser {
60
+ export interface FileBrowser extends Dlgs {}
61
+
62
+ @derive(Dlgs)
63
+ export class FileBrowser extends ViewWithToolbar implements IFileBrowser, Dlgs {
60
64
  /** @override */
61
65
  className(): string {
62
66
  return 'Filebrowser';
@@ -310,7 +314,7 @@ export class FileBrowser extends Panel implements IFileBrowser {
310
314
 
311
315
  self.dataProvider = makeDataProvider(self, self.options);
312
316
 
313
- self._dialog = this.dialog({
317
+ self._dialog = this.dlg({
314
318
  minWidth: Math.min(700, screen.width),
315
319
  minHeight: 300,
316
320
  buttons: this.o.headerButtons ?? ['fullsize', 'dialog.close']
@@ -402,7 +406,7 @@ export class FileBrowser extends Panel implements IFileBrowser {
402
406
 
403
407
  private proxyDialogEvents(self: FileBrowser): void {
404
408
  ['afterClose', 'beforeOpen'].forEach(proxyEvent => {
405
- self._dialog.events.on(self.dialog, proxyEvent, () => {
409
+ self._dialog.events.on(self.dlg, proxyEvent, () => {
406
410
  this.e.fire(proxyEvent);
407
411
  });
408
412
  });
@@ -132,7 +132,9 @@ export class Snapshot extends ViewComponent<IJodit> implements ISnapshot {
132
132
  }
133
133
  };
134
134
 
135
- snapshot.html = this.j.getNativeEditorValue();
135
+ snapshot.html = this.removeJoditSelection(
136
+ this.j.getNativeEditorValue()
137
+ );
136
138
 
137
139
  const sel = this.j.s.sel;
138
140
 
@@ -175,7 +177,7 @@ export class Snapshot extends ViewComponent<IJodit> implements ISnapshot {
175
177
  /**
176
178
  * Restores the state of the editor of the snapshot. Rebounding is not only html but selected text
177
179
  *
178
- * @param snapshot - snapshot of editor resulting from the `{@link Snapshot~make|make}`
180
+ * @param snapshot - snapshot of editor resulting from the `[[Snapshot.make]]` method
179
181
  * @see make
180
182
  */
181
183
  restore(snapshot: SnapshotType): void {
@@ -209,7 +211,7 @@ export class Snapshot extends ViewComponent<IJodit> implements ISnapshot {
209
211
  /**
210
212
  * Restore selection from snapshot
211
213
  *
212
- * @param snapshot - snapshot of editor resulting from the `{@link Snapshot~make|make}`
214
+ * @param snapshot - snapshot of editor resulting from the [[Snapshot.make]] method
213
215
  * @see make
214
216
  */
215
217
  restoreOnlySelection(snapshot: SnapshotType): void {
@@ -244,4 +246,11 @@ export class Snapshot extends ViewComponent<IJodit> implements ISnapshot {
244
246
  this.isBlocked = false;
245
247
  super.destruct();
246
248
  }
249
+
250
+ private removeJoditSelection(nativeEditorValue: string): string {
251
+ return nativeEditorValue.replace(
252
+ /<span[^>]*jodit-selection_marker[^>]*><\/span>/g,
253
+ ''
254
+ );
255
+ }
247
256
  }
@@ -0,0 +1,25 @@
1
+ /*!
2
+ * Jodit Editor (https://xdsoft.net/jodit/)
3
+ * Released under MIT see LICENSE.txt in the project root for license information.
4
+ * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
+ */
6
+
7
+ require('../../../test/bootstrap.screenshot.js');
8
+ const expect = require('expect');
9
+
10
+ describe('Image editor screenshot testing', () => {
11
+ describe('Open image editor', () => {
12
+ it('works', async function () {
13
+ await page.evaluate(() => {
14
+ return editor
15
+ .getInstance('ImageEditor')
16
+ .open('https://xdsoft.net/jodit/files/artio.jpg');
17
+ });
18
+
19
+ await page.waitForSelector('[role="dialog"] .jodit-dialog__panel');
20
+ const dialog = await page.$('[role="dialog"] .jodit-dialog__panel');
21
+ const screenshot = await dialog.screenshot();
22
+ expect(screenshot).toMatchImageSnapshot(this);
23
+ }).timeout(10000);
24
+ });
25
+ });
@@ -20,8 +20,9 @@ import type {
20
20
  IUIButton,
21
21
  IDictionary,
22
22
  IFileBrowserDataProvider,
23
- IPanel,
24
- IDialog
23
+ IDialog,
24
+ IViewWithToolbar,
25
+ IDlgs
25
26
  } from 'jodit/types';
26
27
  import { Config } from 'jodit/config';
27
28
  import { ViewComponent } from 'jodit/core/component';
@@ -68,7 +69,7 @@ const TABS = {
68
69
  *
69
70
  */
70
71
  @component
71
- export class ImageEditor extends ViewComponent<IPanel> {
72
+ export class ImageEditor extends ViewComponent<IViewWithToolbar & IDlgs> {
72
73
  /** @override */
73
74
  override className(): string {
74
75
  return 'ImageEditor';
@@ -719,7 +720,7 @@ export class ImageEditor extends ViewComponent<IPanel> {
719
720
  });
720
721
  }
721
722
 
722
- constructor(editor: IPanel) {
723
+ constructor(editor: IViewWithToolbar & IDlgs) {
723
724
  super(editor);
724
725
 
725
726
  this.options =
@@ -759,7 +760,7 @@ export class ImageEditor extends ViewComponent<IPanel> {
759
760
  `.${jie}__croper`
760
761
  ) as HTMLElement;
761
762
 
762
- this._dialog = this.j.dialog({
763
+ this._dialog = this.j.dlg({
763
764
  buttons: ['fullsize', 'dialog.close']
764
765
  });
765
766
 
@@ -803,7 +804,7 @@ export class ImageEditor extends ViewComponent<IPanel> {
803
804
  * Open Image Editor
804
805
  */
805
806
  export function openImageEditor(
806
- this: IPanel & { dataProvider: IFileBrowserDataProvider },
807
+ this: IViewWithToolbar & { dataProvider: IFileBrowserDataProvider },
807
808
  href: string,
808
809
  name: string,
809
810
  path: string,