jodit 3.8.5 → 3.9.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 (276) hide show
  1. package/.github/workflows/tests.yml +23 -0
  2. package/.idea/dictionaries/v_chupurnov.xml +1 -0
  3. package/.idea/workspace.xml +333 -1469
  4. package/CHANGELOG.MD +151 -25
  5. package/README.md +3 -3
  6. package/build/jodit.css +280 -258
  7. package/build/jodit.es2018.css +231 -213
  8. package/build/jodit.es2018.en.css +231 -213
  9. package/build/jodit.es2018.en.js +9981 -9818
  10. package/build/jodit.es2018.en.min.css +1 -1
  11. package/build/jodit.es2018.en.min.js +1 -10
  12. package/build/jodit.es2018.js +14124 -13961
  13. package/build/jodit.es2018.min.css +1 -1
  14. package/build/jodit.es2018.min.js +1 -10
  15. package/build/jodit.js +11285 -11049
  16. package/build/jodit.min.css +2 -2
  17. package/build/jodit.min.js +1 -10
  18. package/package.json +34 -33
  19. package/src/config.ts +8 -14
  20. package/src/core/async.ts +7 -18
  21. package/src/core/component/view-component.ts +0 -1
  22. package/src/core/constants.ts +7 -5
  23. package/src/core/create.ts +8 -27
  24. package/src/core/decorators/debounce.ts +0 -8
  25. package/src/core/decorators/hook.ts +0 -1
  26. package/src/core/decorators/nonenumerable.ts +1 -2
  27. package/src/core/decorators/persistent.ts +0 -3
  28. package/src/core/decorators/spy.ts +0 -1
  29. package/src/core/decorators/wait.ts +0 -1
  30. package/src/core/dom.ts +161 -205
  31. package/src/core/events/{events-native.ts → event-emitter.ts} +66 -35
  32. package/src/core/events/index.ts +1 -1
  33. package/src/core/events/observe-object.ts +0 -2
  34. package/src/core/global.ts +12 -8
  35. package/src/core/helpers/append-script.ts +0 -8
  36. package/src/core/helpers/array/as-array.ts +2 -5
  37. package/src/core/helpers/array/split-array.ts +0 -1
  38. package/src/core/helpers/array/to-array.ts +1 -0
  39. package/src/core/helpers/async/set-timeout.ts +0 -7
  40. package/src/core/helpers/browser.ts +0 -1
  41. package/src/core/helpers/checker/has-browser-color-picker.ts +0 -3
  42. package/src/core/helpers/checker/is-array.ts +0 -1
  43. package/src/core/helpers/checker/is-equal.ts +0 -3
  44. package/src/core/helpers/checker/is-function.ts +0 -2
  45. package/src/core/helpers/checker/is-html-from-word.ts +0 -3
  46. package/src/core/helpers/checker/is-html.ts +0 -1
  47. package/src/core/helpers/checker/is-number.ts +0 -1
  48. package/src/core/helpers/checker/is-numeric.ts +0 -2
  49. package/src/core/helpers/checker/is-plain-object.ts +0 -1
  50. package/src/core/helpers/checker/is-string.ts +0 -1
  51. package/src/core/helpers/checker/is-url.ts +0 -4
  52. package/src/core/helpers/color/color-to-hex.ts +2 -2
  53. package/src/core/helpers/config-proto.ts +0 -3
  54. package/src/core/helpers/convert-media-url-to-video-embed.ts +1 -6
  55. package/src/core/helpers/ctrl-key.ts +1 -3
  56. package/src/core/helpers/data-bind.ts +2 -8
  57. package/src/core/helpers/default-language.ts +0 -3
  58. package/src/core/helpers/each.ts +12 -0
  59. package/src/core/helpers/html/htmlspecialchars.ts +0 -4
  60. package/src/core/helpers/html/nl2br.ts +0 -1
  61. package/src/core/helpers/human-size-to-bytes.ts +1 -4
  62. package/src/core/helpers/normalize/normalize-color.ts +2 -3
  63. package/src/core/helpers/normalize/normalize-key-aliases.ts +0 -2
  64. package/src/core/helpers/normalize/normalize-path.ts +0 -2
  65. package/src/core/helpers/normalize/normalize-size.ts +0 -3
  66. package/src/core/helpers/selector.ts +0 -8
  67. package/src/core/helpers/size/get-content-width.ts +0 -2
  68. package/src/core/helpers/size/offset.ts +1 -7
  69. package/src/core/helpers/size/position.ts +0 -4
  70. package/src/core/helpers/string/camel-case.ts +1 -2
  71. package/src/core/helpers/string/i18n.ts +0 -7
  72. package/src/core/helpers/string/kebab-case.ts +7 -5
  73. package/src/core/helpers/string/stringify.ts +0 -3
  74. package/src/core/helpers/string/trim.ts +0 -2
  75. package/src/core/helpers/string/ucfirst.ts +2 -5
  76. package/src/core/helpers/type.ts +0 -1
  77. package/src/core/helpers/utils/get.ts +0 -2
  78. package/src/core/helpers/utils/mark-deprecated.ts +0 -4
  79. package/src/core/helpers/utils/set.ts +0 -2
  80. package/src/core/helpers/utils/utils.ts +52 -15
  81. package/src/core/plugin-system.ts +0 -31
  82. package/src/core/request/ajax.ts +212 -0
  83. package/src/core/request/config.ts +37 -0
  84. package/{types/types/core.js → src/core/request/index.ts} +3 -3
  85. package/src/core/request/response.ts +39 -0
  86. package/src/core/selection/select.ts +74 -40
  87. package/src/core/selection/style/api/element-has-same-style.ts +13 -0
  88. package/src/core/selection/style/api/get-suit-parent.ts +1 -1
  89. package/src/core/selection/style/api/is-normal-node.ts +1 -2
  90. package/src/core/selection/style/api/is-suit-element.ts +24 -4
  91. package/src/core/selection/style/api/toggle-styles.ts +0 -2
  92. package/src/core/selection/style/api/unwrap-children.ts +45 -16
  93. package/src/core/selection/style/api/wrap-unwrapped-text.ts +28 -23
  94. package/src/core/selection/style/apply-style.ts +19 -9
  95. package/src/core/traits/elms.ts +1 -0
  96. package/src/core/traits/mods.ts +1 -3
  97. package/src/core/ui/button/button/button.less +7 -3
  98. package/src/core/ui/button/button/button.ts +1 -1
  99. package/src/core/ui/button/group/group.less +5 -5
  100. package/src/core/ui/element.ts +0 -4
  101. package/src/core/ui/form/inputs/file/file.less +4 -4
  102. package/src/core/ui/form/validators/input.ts +0 -2
  103. package/src/core/ui/form/validators/select.ts +0 -1
  104. package/src/core/ui/helpers/get-control-type.ts +3 -3
  105. package/src/core/ui/icon.ts +0 -10
  106. package/src/core/ui/list/group.less +1 -1
  107. package/src/core/ui/list/group.ts +1 -6
  108. package/src/core/ui/list/list.ts +0 -3
  109. package/src/core/ui/popup/popup.ts +0 -11
  110. package/src/core/ui/progress-bar/progress-bar.less +8 -8
  111. package/src/core/view/view-with-toolbar.ts +0 -5
  112. package/src/core/view/view.ts +5 -21
  113. package/src/jodit.ts +14 -70
  114. package/src/modules/context-menu/context-menu.ts +4 -7
  115. package/src/modules/dialog/alert.ts +0 -6
  116. package/src/modules/dialog/confirm.ts +1 -1
  117. package/src/modules/dialog/dialog.ts +22 -47
  118. package/src/modules/file-browser/README.MD +1 -1
  119. package/src/modules/file-browser/data-provider.ts +22 -42
  120. package/src/modules/file-browser/file-browser.ts +3 -0
  121. package/src/modules/image-editor/image-editor.less +51 -46
  122. package/src/modules/index.ts +1 -1
  123. package/src/modules/status-bar/status-bar.less +12 -12
  124. package/src/modules/table.ts +122 -106
  125. package/src/modules/toolbar/button/button.less +5 -6
  126. package/src/modules/toolbar/button/button.ts +1 -1
  127. package/src/modules/toolbar/button/content.less +2 -2
  128. package/src/modules/uploader/uploader.ts +4 -3
  129. package/src/modules/widget/color-picker/color-picker.less +7 -6
  130. package/src/modules/widget/tabs/tabs.less +3 -3
  131. package/src/plugins/about/about.less +1 -1
  132. package/src/plugins/add-new-line/add-new-line.less +14 -15
  133. package/src/plugins/add-new-line/add-new-line.ts +1 -1
  134. package/src/plugins/clipboard/paste-storage/paste-storage.less +10 -11
  135. package/src/plugins/fix/clean-html.ts +39 -18
  136. package/src/plugins/fix/wrap-text-nodes.ts +1 -2
  137. package/src/plugins/fullsize/fullsize.less +5 -5
  138. package/src/plugins/image/image-properties/image-properties.less +11 -7
  139. package/src/plugins/image/image-properties/image-properties.ts +11 -8
  140. package/src/plugins/indent.ts +25 -18
  141. package/src/plugins/placeholder/placeholder.less +4 -4
  142. package/src/plugins/resizer/resizer.less +28 -23
  143. package/src/plugins/search/search.less +25 -25
  144. package/src/plugins/size/resize-handler.ts +1 -1
  145. package/src/plugins/size/size.ts +1 -3
  146. package/src/plugins/source/source.less +15 -15
  147. package/src/plugins/source/source.ts +1 -1
  148. package/src/plugins/table/select-cells.ts +23 -5
  149. package/src/plugins/xpath/xpath.less +3 -3
  150. package/src/styles/form.less +19 -14
  151. package/src/styles/modules/button-group.less +2 -2
  152. package/src/styles/modules/icon.less +9 -8
  153. package/src/types/ajax.d.ts +43 -6
  154. package/src/types/async.d.ts +5 -4
  155. package/src/types/events.d.ts +25 -10
  156. package/src/types/view.d.ts +2 -2
  157. package/tsconfig.json +1 -1
  158. package/types/config.d.ts +8 -14
  159. package/types/core/async.d.ts +3 -16
  160. package/types/core/component/view-component.d.ts +0 -1
  161. package/types/core/constants.d.ts +6 -5
  162. package/types/core/create.d.ts +0 -4
  163. package/types/core/decorators/debounce.d.ts +0 -8
  164. package/types/core/decorators/hook.d.ts +0 -1
  165. package/types/core/decorators/nonenumerable.d.ts +1 -2
  166. package/types/core/decorators/persistent.d.ts +0 -3
  167. package/types/core/decorators/wait.d.ts +0 -1
  168. package/types/core/dom.d.ts +47 -128
  169. package/types/core/events/{events-native.d.ts → event-emitter.d.ts} +26 -20
  170. package/types/core/events/index.d.ts +1 -1
  171. package/types/core/events/observe-object.d.ts +0 -2
  172. package/types/core/global.d.ts +2 -6
  173. package/types/core/helpers/append-script.d.ts +0 -8
  174. package/types/core/helpers/array/as-array.d.ts +3 -0
  175. package/types/core/helpers/array/split-array.d.ts +0 -1
  176. package/types/core/helpers/async/set-timeout.d.ts +0 -7
  177. package/types/core/helpers/browser.d.ts +0 -1
  178. package/types/core/helpers/checker/has-browser-color-picker.d.ts +0 -3
  179. package/types/core/helpers/checker/is-array.d.ts +0 -1
  180. package/types/core/helpers/checker/is-equal.d.ts +0 -3
  181. package/types/core/helpers/checker/is-function.d.ts +0 -2
  182. package/types/core/helpers/checker/is-html-from-word.d.ts +0 -3
  183. package/types/core/helpers/checker/is-html.d.ts +0 -1
  184. package/types/core/helpers/checker/is-number.d.ts +0 -1
  185. package/types/core/helpers/checker/is-numeric.d.ts +0 -2
  186. package/types/core/helpers/checker/is-plain-object.d.ts +0 -1
  187. package/types/core/helpers/checker/is-string.d.ts +0 -1
  188. package/types/core/helpers/checker/is-url.d.ts +0 -4
  189. package/types/core/helpers/color/color-to-hex.d.ts +2 -2
  190. package/types/core/helpers/config-proto.d.ts +0 -3
  191. package/types/core/helpers/convert-media-url-to-video-embed.d.ts +1 -6
  192. package/types/core/helpers/ctrl-key.d.ts +1 -3
  193. package/types/core/helpers/data-bind.d.ts +0 -6
  194. package/types/core/helpers/default-language.d.ts +0 -3
  195. package/types/core/helpers/each.d.ts +9 -0
  196. package/types/core/helpers/html/htmlspecialchars.d.ts +0 -4
  197. package/types/core/helpers/html/nl2br.d.ts +0 -1
  198. package/types/core/helpers/human-size-to-bytes.d.ts +1 -4
  199. package/types/core/helpers/normalize/normalize-color.d.ts +2 -3
  200. package/types/core/helpers/normalize/normalize-key-aliases.d.ts +0 -2
  201. package/types/core/helpers/normalize/normalize-path.d.ts +0 -2
  202. package/types/core/helpers/normalize/normalize-size.d.ts +0 -3
  203. package/types/core/helpers/selector.d.ts +0 -8
  204. package/types/core/helpers/size/get-content-width.d.ts +0 -2
  205. package/types/core/helpers/size/offset.d.ts +1 -7
  206. package/types/core/helpers/string/camel-case.d.ts +1 -2
  207. package/types/core/helpers/string/i18n.d.ts +0 -7
  208. package/types/core/helpers/string/kebab-case.d.ts +1 -5
  209. package/types/core/helpers/string/stringify.d.ts +0 -3
  210. package/types/core/helpers/string/trim.d.ts +0 -2
  211. package/types/core/helpers/string/ucfirst.d.ts +1 -4
  212. package/types/core/helpers/type.d.ts +0 -1
  213. package/types/core/helpers/utils/get.d.ts +0 -2
  214. package/types/core/helpers/utils/mark-deprecated.d.ts +0 -4
  215. package/types/core/helpers/utils/set.d.ts +0 -2
  216. package/types/core/helpers/utils/utils.d.ts +15 -18
  217. package/types/core/plugin-system.d.ts +0 -31
  218. package/types/core/request/ajax.d.ts +26 -0
  219. package/types/core/request/config.d.ts +14 -0
  220. package/{src/types/core.js → types/core/request/index.d.ts} +2 -3
  221. package/types/core/request/response.d.ts +16 -0
  222. package/types/core/selection/select.d.ts +8 -9
  223. package/types/core/selection/style/api/element-has-same-style.d.ts +4 -0
  224. package/types/core/selection/style/api/is-suit-element.d.ts +1 -0
  225. package/types/core/selection/style/api/toggle-styles.d.ts +0 -2
  226. package/types/core/selection/style/api/wrap-unwrapped-text.d.ts +2 -2
  227. package/types/core/traits/mods.d.ts +1 -3
  228. package/types/core/ui/element.d.ts +0 -4
  229. package/types/core/ui/form/validators/input.d.ts +0 -2
  230. package/types/core/ui/form/validators/select.d.ts +0 -1
  231. package/types/core/ui/helpers/get-control-type.d.ts +0 -2
  232. package/types/core/ui/icon.d.ts +0 -10
  233. package/types/core/ui/list/group.d.ts +1 -6
  234. package/types/core/ui/list/list.d.ts +0 -3
  235. package/types/core/ui/popup/popup.d.ts +0 -11
  236. package/types/core/view/view-with-toolbar.d.ts +0 -5
  237. package/types/core/view/view.d.ts +4 -20
  238. package/types/jodit.d.ts +2 -46
  239. package/types/modules/context-menu/context-menu.d.ts +3 -6
  240. package/types/modules/dialog/alert.d.ts +0 -6
  241. package/types/modules/dialog/confirm.d.ts +1 -1
  242. package/types/modules/dialog/dialog.d.ts +9 -28
  243. package/types/modules/file-browser/data-provider.d.ts +1 -1
  244. package/types/modules/index.d.ts +1 -1
  245. package/types/modules/table.d.ts +1 -1
  246. package/types/plugins/fix/clean-html.d.ts +4 -0
  247. package/types/plugins/size/resize-handler.d.ts +1 -1
  248. package/types/plugins/source/source.d.ts +1 -1
  249. package/types/types/ajax.d.ts +43 -6
  250. package/types/types/async.d.ts +5 -4
  251. package/types/types/events.d.ts +25 -10
  252. package/types/types/view.d.ts +2 -2
  253. package/.editorconfig +0 -15
  254. package/.eslintignore +0 -3
  255. package/.eslintrc.js +0 -109
  256. package/.prettierrc.json +0 -9
  257. package/.stylelintrc.json +0 -16
  258. package/app.css +0 -112
  259. package/composer.json +0 -12
  260. package/src/core/ajax.ts +0 -296
  261. package/src/types/core.d.ts +0 -7
  262. package/src/types/core.js.map +0 -1
  263. package/src/types/storage.d.ts +0 -13
  264. package/src/types/storage.js +0 -8
  265. package/src/types/storage.js.map +0 -1
  266. package/src/utils/create-entries.js +0 -57
  267. package/src/utils/css-variables-prefixes.js +0 -12
  268. package/src/utils/lang-loader.js +0 -57
  269. package/src/utils/lang-translater.js +0 -142
  270. package/src/utils/plugin-loader.js +0 -14
  271. package/src/utils/post-build.js +0 -28
  272. package/src/utils/svg-loader.js +0 -20
  273. package/types/core/ajax.d.ts +0 -59
  274. package/types/types/core.js.map +0 -1
  275. package/types/types/storage.js +0 -8
  276. package/types/types/storage.js.map +0 -1
@@ -15,7 +15,7 @@ import { Button } from '../../core/ui';
15
15
  * @param callback - callback. The first argument is the value entered
16
16
  * @example
17
17
  * ```javascript
18
- * Jodit.Confirm("Are you shure?", "Confirm Dialog", function (yes) {
18
+ * Jodit.Confirm("Are you sure?", "Confirm Dialog", function (yes) {
19
19
  * if (yes) {
20
20
  * // do something
21
21
  * }
@@ -40,15 +40,6 @@ import { eventEmitter, pluginSystem } from '../../core/global';
40
40
  import { component, autobind, hook } from '../../core/decorators';
41
41
  import { View } from '../../core/view/view';
42
42
 
43
- /**
44
- * @property {object} dialog module settings {@link Dialog|Dialog}
45
- * @property {int} dialog.zIndex=1000 Default Z-index for dialog window. {@link Dialog|Dialog}'s settings
46
- * @property {boolean} dialog.resizable=true This dialog can resize by trigger
47
- * @property {boolean} dialog.draggable=true This dialog can move by header
48
- * @property {boolean} dialog.fullsize=false A dialog window will open in full screen by default
49
- * @property {Buttons} dialog.buttons=['close.dialog', 'fullsize.dialog']
50
- */
51
-
52
43
  declare module '../../config' {
53
44
  interface Config {
54
45
  dialog: IDialogOptions;
@@ -58,7 +49,15 @@ declare module '../../config' {
58
49
  Config.prototype.dialog = {
59
50
  namespace: '',
60
51
  extraButtons: [],
52
+
53
+ /**
54
+ * This dialog can resize by trigger
55
+ */
61
56
  resizable: true,
57
+
58
+ /**
59
+ * This dialog can move by header
60
+ */
62
61
  draggable: true,
63
62
  buttons: ['dialog.close'],
64
63
  removeButtons: []
@@ -201,7 +200,6 @@ export class Dialog extends ViewWithToolbar implements IDialog {
201
200
  if (this.e) {
202
201
  /**
203
202
  * Fired when dialog box is started moving
204
- * @event startMove
205
203
  */
206
204
  this.e.fire(this, 'startMove');
207
205
  }
@@ -239,9 +237,6 @@ export class Dialog extends ViewWithToolbar implements IDialog {
239
237
  if (this.e) {
240
238
  /**
241
239
  * Fired when dialog box is resized
242
- * @event resizeDialog
243
- * @param {int} dx Delta X
244
- * @param {int} dy Delta Y
245
240
  */
246
241
  this.e.fire(
247
242
  this,
@@ -301,7 +296,6 @@ export class Dialog extends ViewWithToolbar implements IDialog {
301
296
  if (this.e) {
302
297
  /**
303
298
  * Fired when dialog box is started resizing
304
- * @event startResize
305
299
  */
306
300
  this.e.fire(this, 'startResize');
307
301
  }
@@ -325,9 +319,6 @@ export class Dialog extends ViewWithToolbar implements IDialog {
325
319
 
326
320
  override OPTIONS!: IDialogOptions;
327
321
 
328
- /**
329
- * @property {HTMLDivElement} dialog
330
- */
331
322
  dialog!: HTMLElement;
332
323
 
333
324
  workplace!: HTMLDivElement;
@@ -340,8 +331,8 @@ export class Dialog extends ViewWithToolbar implements IDialog {
340
331
  /**
341
332
  * Specifies the size of the window
342
333
  *
343
- * @param {number} [w] - The width of the window
344
- * @param {number} [h] - The height of the window
334
+ * @param w - The width of the window
335
+ * @param h - The height of the window
345
336
  */
346
337
  setSize(w?: number | string, h?: number | string): this {
347
338
  if (w == null) {
@@ -374,8 +365,8 @@ export class Dialog extends ViewWithToolbar implements IDialog {
374
365
  * Specifies the position of the upper left corner of the window . If x and y are specified,
375
366
  * the window is centered on the center of the screen
376
367
  *
377
- * @param {Number} [x] - Position px Horizontal
378
- * @param {Number} [y] - Position px Vertical
368
+ * @param x - Position px Horizontal
369
+ * @param y - Position px Vertical
379
370
  */
380
371
  setPosition(x?: number, y?: number): this {
381
372
  const w = this.ow.innerWidth,
@@ -407,7 +398,7 @@ export class Dialog extends ViewWithToolbar implements IDialog {
407
398
  /**
408
399
  * Specifies the dialog box title . It can take a string and an array of objects
409
400
  *
410
- * @param {string|string[]|Element|Element[]} content - A string or an HTML element ,
401
+ * @param content - A string or an HTML element ,
411
402
  * or an array of strings and elements
412
403
  * @example
413
404
  * ```javascript
@@ -425,7 +416,7 @@ export class Dialog extends ViewWithToolbar implements IDialog {
425
416
  /**
426
417
  * It specifies the contents of the dialog box. It can take a string and an array of objects
427
418
  *
428
- * @param {string|string[]|Element|Element[]} content A string or an HTML element ,
419
+ * @param content - A string or an HTML element ,
429
420
  * or an array of strings and elements
430
421
  * @example
431
422
  * ```javascript
@@ -443,7 +434,7 @@ export class Dialog extends ViewWithToolbar implements IDialog {
443
434
  /**
444
435
  * Sets the bottom of the dialog. It can take a string and an array of objects
445
436
  *
446
- * @param {string|string[]|Element|Element[]} content - A string or an HTML element ,
437
+ * @param content - A string or an HTML element ,
447
438
  * or an array of strings and elements
448
439
  * @example
449
440
  * ```javascript
@@ -474,8 +465,6 @@ export class Dialog extends ViewWithToolbar implements IDialog {
474
465
 
475
466
  /**
476
467
  * Get dialog instance with maximum z-index displaying it on top of all the dialog boxes
477
- *
478
- * @return {Dialog}
479
468
  */
480
469
  getMaxZIndexDialog(): IDialog {
481
470
  let maxZi: number = 0,
@@ -513,9 +502,6 @@ export class Dialog extends ViewWithToolbar implements IDialog {
513
502
 
514
503
  /**
515
504
  * Expands the dialog on full browser window
516
- *
517
- * @param {boolean} condition true - fullsize
518
- * @return {boolean} true - fullsize
519
505
  */
520
506
  maximization(condition?: boolean): boolean {
521
507
  if (isVoid(condition)) {
@@ -555,14 +541,11 @@ export class Dialog extends ViewWithToolbar implements IDialog {
555
541
  /**
556
542
  * It opens a dialog box to center it, and causes the two event.
557
543
  *
558
- * @param {string|string[]|Element|Element[]} [content] specifies the contents of the dialog box.
559
- * Can be false или undefined. see {@link Dialog~setContent|setContent}
560
- * @param {string|string[]|Element|Element[]} [title] specifies the title of the dialog box, @see setHeader
561
- * @param {boolean} [destroyAfterClose] true - After closing the window , the destructor will be called.
562
- * see {@link Dialog~destruct|destruct}
563
- * @param {boolean} [modal] - true window will be opened in modal mode
564
- * @fires {@link event:beforeOpen} id returns 'false' then the window will not open
565
- * @fires {@link event:afterOpen}
544
+ * @param contentOrClose - specifies the contents of the dialog box.
545
+ * Can be false или undefined. see `{@link Dialog~setContent|setContent}`
546
+ * @param title - specifies the title of the dialog box, @see setHeader
547
+ * @param destroyAfterClose - true - After closing the window , the destructor will be called.
548
+ * @param modal - true window will be opened in modal mode
566
549
  */
567
550
  open(
568
551
  contentOrClose?: Content | boolean,
@@ -574,8 +557,6 @@ export class Dialog extends ViewWithToolbar implements IDialog {
574
557
 
575
558
  /**
576
559
  * Called before the opening of the dialog box
577
- *
578
- * @event beforeOpen
579
560
  */
580
561
  if (this.e.fire(this, 'beforeOpen') === false) {
581
562
  return this;
@@ -619,7 +600,6 @@ export class Dialog extends ViewWithToolbar implements IDialog {
619
600
 
620
601
  /**
621
602
  * Called after the opening of the dialog box
622
- * @event afterOpen
623
603
  */
624
604
  this.e.fire('afterOpen', this);
625
605
 
@@ -630,7 +610,6 @@ export class Dialog extends ViewWithToolbar implements IDialog {
630
610
 
631
611
  /**
632
612
  * Set modal mode
633
- * @param modal
634
613
  */
635
614
  setModal(modal: undefined | boolean): this {
636
615
  this.isModal = Boolean(modal);
@@ -644,12 +623,10 @@ export class Dialog extends ViewWithToolbar implements IDialog {
644
623
  */
645
624
  isOpened: boolean = false;
646
625
 
647
- /**
648
- * Closes the dialog box , if you want to call the method {@link Dialog~destruct|destruct}
626
+ /****
627
+ * Closes the dialog box , if you want to call the method `destruct`
649
628
  *
650
629
  * @see destroy
651
- * @fires beforeClose
652
- * @fires afterClose
653
630
  * @example
654
631
  * ```javascript
655
632
  * //You can close dialog two ways
@@ -683,8 +660,6 @@ export class Dialog extends ViewWithToolbar implements IDialog {
683
660
 
684
661
  /**
685
662
  * Called up to close the window
686
- *
687
- * @event beforeClose
688
663
  */
689
664
  if (this.e) {
690
665
  this.e.fire('beforeClose', this);
@@ -97,7 +97,7 @@ Jodit.make('#editor', {
97
97
  - filebrowser.ajax.headers={} An object of additional header key/value pairs toWYSIWYG
98
98
  send along with requests using the `XMLHttpRequest` transport. The header `X-Requested-With: XMLHttpRequest`
99
99
  is always added, but its default `XMLHttpRequest` value can be changed here.
100
- @property {object} filebrowser.resize Settings for AJAX connections toWYSIWYG the server toWYSIWYG resize
100
+ @property {object} `filebrowser.resize` Settings for AJAX connections toWYSIWYG the server toWYSIWYG resize
101
101
  image. By default, the uses {@link Jodit.defaultOptions.filebrowser.ajax|filebrowser.ajax} with argument
102
102
  action=create
103
103
  - filebrowser.crop Settings for AJAX connections toWYSIWYG the server toWYSIWYG crop image.
@@ -29,7 +29,7 @@ import {
29
29
  normalizeRelativePath,
30
30
  set
31
31
  } from '../../core/helpers';
32
- import { Ajax } from '../../core/ajax';
32
+ import { Ajax } from '../../core/request';
33
33
  import { autobind } from '../../core/decorators';
34
34
  import { FileBrowserItem } from './builders/item';
35
35
 
@@ -66,12 +66,10 @@ export default class DataProvider implements IFileBrowserDataProvider {
66
66
  return this.options;
67
67
  }
68
68
 
69
- private ajaxInstances: Map<string, IAjax> = new Map();
69
+ private ajaxInstances: Map<string, IAjax<IFileBrowserAnswer>> = new Map();
70
70
 
71
- protected get<T = IFileBrowserAnswer>(
72
- name: keyof IFileBrowserOptions,
73
- success?: (resp: IFileBrowserAnswer) => void,
74
- error?: (error: Error) => void
71
+ protected get<T extends IFileBrowserAnswer = IFileBrowserAnswer>(
72
+ name: keyof IFileBrowserOptions
75
73
  ): Promise<T> {
76
74
  const ai = this.ajaxInstances;
77
75
 
@@ -98,33 +96,27 @@ export default class DataProvider implements IFileBrowserDataProvider {
98
96
  opts.data = opts.prepareData.call(this, opts.data as IDictionary);
99
97
  }
100
98
 
101
- const ajax = new Ajax(this.parent, opts);
102
-
103
- let promise = ajax.send();
104
-
99
+ const ajax = new Ajax<T>(this.parent, opts);
105
100
  ai.set(name, ajax);
106
101
 
107
- promise = promise.then(resp => {
108
- if (!this.isSuccess(resp)) {
109
- throw new Error(this.getMessage(resp));
110
- }
111
-
112
- return resp;
113
- });
114
-
115
- if (success) {
116
- promise = promise.then(success);
117
- }
118
-
119
- if (error) {
120
- promise = promise.catch(error);
121
- }
102
+ const promise = ajax.send();
122
103
 
123
- return promise.finally(() => {
104
+ promise.finally(() => {
124
105
  ajax.destruct();
125
106
  ai.delete(name);
107
+
126
108
  this.progressHandler(100);
127
109
  });
110
+
111
+ return promise
112
+ .then(resp => resp.json())
113
+ .then(resp => {
114
+ if (resp && !this.isSuccess(resp)) {
115
+ throw new Error(this.getMessage(resp));
116
+ }
117
+
118
+ return resp;
119
+ });
128
120
  }
129
121
 
130
122
  private progressHandler = (ignore: number): void => {};
@@ -297,7 +289,7 @@ export default class DataProvider implements IFileBrowserDataProvider {
297
289
  getPathByUrl(url: string): Promise<any> {
298
290
  set('options.getLocalFileByUrl.data.url', url, this);
299
291
 
300
- return this.get('getLocalFileByUrl', resp => {
292
+ return this.get('getLocalFileByUrl').then(resp => {
301
293
  if (this.isSuccess(resp)) {
302
294
  return resp.data;
303
295
  }
@@ -396,10 +388,6 @@ export default class DataProvider implements IFileBrowserDataProvider {
396
388
  resp = fr.process.call(this, resp);
397
389
  }
398
390
 
399
- if (!this.isSuccess(resp)) {
400
- throw error(this.getMessage(resp));
401
- }
402
-
403
391
  return this.getMessage(resp);
404
392
  });
405
393
  }
@@ -457,10 +445,6 @@ export default class DataProvider implements IFileBrowserDataProvider {
457
445
  resp = fr.process.call(self, resp);
458
446
  }
459
447
 
460
- if (!this.isSuccess(resp)) {
461
- throw error(this.getMessage(resp));
462
- }
463
-
464
448
  return this.getMessage(resp);
465
449
  });
466
450
  }
@@ -496,7 +480,7 @@ export default class DataProvider implements IFileBrowserDataProvider {
496
480
  name: string,
497
481
  newname: string | void,
498
482
  box: ImageBox | void
499
- ): Promise<boolean> {
483
+ ): Promise<true> {
500
484
  if (!this.o[type]) {
501
485
  this.o[type] = {
502
486
  data: {}
@@ -522,12 +506,8 @@ export default class DataProvider implements IFileBrowserDataProvider {
522
506
  query.data.name = name;
523
507
  query.data.source = source;
524
508
 
525
- return this.get(type).then(resp => {
526
- if (this.isSuccess(resp)) {
527
- return true;
528
- }
529
-
530
- throw error(this.getMessage(resp));
509
+ return this.get(type).then(() => {
510
+ return true;
531
511
  });
532
512
  }
533
513
 
@@ -102,8 +102,11 @@ export class FileBrowser extends ViewWithToolbar implements IFileBrowser {
102
102
  }
103
103
 
104
104
  this.tree.classList.add('jodit-filebrowser_active');
105
+
105
106
  Dom.detach(this.tree);
107
+
106
108
  this.tree.appendChild(this.loader.cloneNode(true));
109
+
107
110
  const items = this.loadItems();
108
111
 
109
112
  if (this.o.showFoldersPanel) {
@@ -14,6 +14,8 @@
14
14
  }
15
15
 
16
16
  .jodit-image-editor {
17
+ overflow: hidden;
18
+
17
19
  width: 100%;
18
20
  height: 100%;
19
21
 
@@ -32,7 +34,6 @@
32
34
  }
33
35
 
34
36
  padding: var(--padding-default);
35
- overflow: hidden;
36
37
 
37
38
  * {
38
39
  box-sizing: border-box;
@@ -40,22 +41,22 @@
40
41
 
41
42
  .jodit-image-editor__slider {
42
43
  &-title {
43
- text-shadow: rgb(243, 243, 243) 0 1px 0;
44
- color: rgb(51, 51, 51);
44
+ padding: 0.8em 1em;
45
45
  border-bottom: 1px solid rgba(158, 158, 158, 0.31);
46
46
  background-color: #f9f9f9;
47
- padding: 0.8em 1em;
48
- text-overflow: ellipsis;
49
- white-space: nowrap;
47
+ color: rgb(51, 51, 51);
50
48
  cursor: pointer;
51
- user-select: none;
52
49
  font-weight: bold;
53
50
  line-height: 1em;
51
+ text-overflow: ellipsis;
52
+ text-shadow: rgb(243, 243, 243) 0 1px 0;
53
+ user-select: none;
54
+ white-space: nowrap;
54
55
 
55
56
  svg {
56
- margin-right: var(--padding-default);
57
- width: 16px;
58
57
  display: inline-block;
58
+ width: 16px;
59
+ margin-right: var(--padding-default);
59
60
  vertical-align: middle;
60
61
  }
61
62
  }
@@ -80,7 +81,13 @@
80
81
  }
81
82
 
82
83
  &__area {
84
+ position: relative;
85
+ display: none;
86
+ overflow: hidden;
87
+
83
88
  width: 100%;
89
+ height: 100%;
90
+
84
91
  background-color: #eee;
85
92
  background-image: linear-gradient(
86
93
  45deg,
@@ -98,59 +105,57 @@
98
105
  var(--color-border) 75%,
99
106
  var(--color-border)
100
107
  );
101
- background-size: 30px 30px;
102
108
  background-position: 0 0, 15px 15px;
103
- height: 100%;
104
- overflow: hidden;
109
+ background-size: 30px 30px;
105
110
  user-select: none;
106
- position: relative;
107
- display: none;
108
111
 
109
112
  &.jodit-image-editor_active {
110
113
  display: block;
111
114
  }
112
115
 
113
116
  .jodit-image-editor__box {
114
- overflow: hidden;
115
117
  position: relative;
116
118
  z-index: 1;
117
- pointer-events: none;
119
+ overflow: hidden;
118
120
  height: 100%;
121
+ pointer-events: none;
119
122
 
120
123
  img {
121
- user-select: none;
122
124
  max-width: 100%;
123
125
  max-height: 100%;
126
+ user-select: none;
124
127
  }
125
128
  }
126
129
 
127
130
  .jodit-image-editor__croper,
128
131
  .jodit-image-editor__resizer {
132
+ position: absolute;
129
133
  z-index: 2;
134
+ top: var(--padding-default);
135
+ left: 20px;
130
136
  width: 100px;
131
137
  height: 100px;
132
- position: absolute;
133
- box-shadow: 0 0 11px #000;
134
138
  border: 1px solid #fff;
135
139
  background-repeat: no-repeat;
136
- top: var(--padding-default);
137
- left: 20px;
140
+ box-shadow: 0 0 11px #000;
138
141
  pointer-events: none;
139
142
 
140
143
  i.jodit_bottomright {
141
144
  position: absolute;
145
+ z-index: 4;
146
+ right: calc(var(--padding-default) * -1);
147
+ bottom: calc(var(--padding-default) * -1);
148
+
142
149
  display: inline-block;
150
+ width: 20px;
151
+ height: 20px;
152
+
143
153
  border: 1px solid
144
154
  var(--image_editor_resizer_target_border_color);
145
- z-index: 4;
146
155
  background-color: var(--image_editor_resizer_target_bg_color);
147
- cursor: se-resize;
148
156
  border-radius: 50%;
149
- height: 20px;
150
- width: 20px;
151
- right: calc(var(--padding-default) * -1);
152
- bottom: calc(var(--padding-default) * -1);
153
157
  box-shadow: 0 0 11px #000;
158
+ cursor: se-resize;
154
159
  pointer-events: all;
155
160
 
156
161
  &:active {
@@ -161,64 +166,64 @@
161
166
  }
162
167
 
163
168
  &__area.jodit-image-editor__area_crop {
169
+ position: relative;
164
170
  height: 100%;
165
171
  background: #eee;
166
- text-align: center;
167
172
  line-height: 100%;
168
- position: relative;
173
+ text-align: center;
169
174
 
170
175
  .jodit-image-editor__box {
171
- height: 100%;
172
176
  overflow: visible;
177
+ height: 100%;
178
+ line-height: 100%;
173
179
  pointer-events: all;
174
180
 
175
181
  img {
176
- max-width: 100%;
177
- max-height: 100%;
178
182
  width: 100%;
183
+ max-width: 100%;
179
184
  height: 100%;
185
+ max-height: 100%;
180
186
  }
181
187
 
182
188
  text-align: left;
183
- line-height: 100%;
184
189
 
185
190
  &::after {
186
- content: '';
187
191
  position: absolute;
192
+ z-index: 1;
188
193
  top: 0;
189
- left: 0;
190
- bottom: 0;
191
194
  right: 0;
195
+ bottom: 0;
196
+ left: 0;
192
197
  margin: auto;
193
198
  background: rgba(255, 255, 255, 0.3);
194
- z-index: 1;
199
+ content: '';
195
200
  }
196
201
 
197
202
  .jodit-image-editor__croper {
198
- pointer-events: all;
199
203
  cursor: move;
204
+ pointer-events: all;
200
205
 
201
206
  i.jodit-image-editor__sizes {
202
- font-size: 12px;
203
- white-space: pre;
204
207
  position: absolute;
205
208
  bottom: -30px;
206
209
  left: 100%;
207
- text-align: center;
208
- color: rgb(255, 255, 255);
209
- text-shadow: none;
210
+ display: block;
211
+ padding: 9px 6px;
210
212
  background: rgba(0, 0, 0, 0.2);
211
213
  border-radius: 0.4em;
212
- padding: 9px 6px;
213
- display: block;
214
+ color: rgb(255, 255, 255);
215
+ font-size: 12px;
216
+ text-align: center;
217
+ text-shadow: none;
218
+ white-space: pre;
214
219
  }
215
220
  }
216
221
  }
217
222
 
218
223
  &.jodit-image-editor_active {
219
224
  display: flex;
220
- justify-content: center;
221
225
  align-items: center;
226
+ justify-content: center;
222
227
  }
223
228
  }
224
229
  }
@@ -6,7 +6,7 @@
6
6
 
7
7
  export * from '../core/events';
8
8
  export { Async } from '../core/async';
9
- export { Ajax } from '../core/ajax';
9
+ export * from '../core/request';
10
10
  export { Component, ViewComponent, STATUSES } from '../core/component';
11
11
  export { ContextMenu } from './context-menu/context-menu';
12
12
  export { Alert, Confirm, Prompt, Dialog } from './dialog/';
@@ -8,19 +8,19 @@
8
8
  @import (reference) '../../styles/mixins';
9
9
 
10
10
  .jodit-status-bar {
11
- font-size: var(--font-size-small);
12
11
  display: flex;
13
- justify-content: flex-start;
12
+ overflow: hidden;
14
13
  align-items: center;
15
- background-color: var(--color-panel);
14
+ justify-content: flex-start;
16
15
  padding: 0 calc(var(--padding-default) / 2);
17
- overflow: hidden;
16
+ background-color: var(--color-panel);
18
17
  border-radius: 0 0 var(--border-radius-default) var(--border-radius-default);
18
+ font-size: var(--font-size-small);
19
19
 
20
20
  &::before {
21
- content: '';
22
21
  flex: auto;
23
22
  order: 1;
23
+ content: '';
24
24
  }
25
25
 
26
26
  .jodit-status-bar__item {
@@ -31,25 +31,25 @@
31
31
  font-size: var(--font-size-small);
32
32
  }
33
33
 
34
- line-height: 1.57142857em;
35
- margin: 0 var(--padding-default) 0 0;
36
- padding: 0;
37
34
  order: 0;
35
+ padding: 0;
36
+ margin: 0 var(--padding-default) 0 0;
37
+ line-height: 1.57142857em;
38
38
 
39
39
  &.jodit-status-bar__item-right {
40
- margin: 0 0 0 var(--padding-default);
41
40
  order: 2;
41
+ margin: 0 0 0 var(--padding-default);
42
42
  }
43
43
 
44
44
  a {
45
- text-decoration: none;
46
- cursor: default;
47
45
  border-radius: 3px;
46
+ cursor: default;
47
+ text-decoration: none;
48
48
 
49
49
  &:hover {
50
50
  background-color: var(--color-background-gray);
51
- text-decoration: none;
52
51
  color: var(--color-text);
52
+ text-decoration: none;
53
53
  }
54
54
  }
55
55
  }