jodit 3.8.8 → 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 (118) hide show
  1. package/.github/workflows/tests.yml +23 -0
  2. package/.idea/dictionaries/v_chupurnov.xml +1 -0
  3. package/.idea/workspace.xml +295 -286
  4. package/CHANGELOG.MD +110 -24
  5. package/README.md +3 -3
  6. package/build/jodit.css +2 -2
  7. package/build/jodit.es2018.css +1 -1
  8. package/build/jodit.es2018.en.css +1 -1
  9. package/build/jodit.es2018.en.js +329 -210
  10. package/build/jodit.es2018.en.min.js +1 -1
  11. package/build/jodit.es2018.js +329 -210
  12. package/build/jodit.es2018.min.js +1 -1
  13. package/build/jodit.js +1066 -881
  14. package/build/jodit.min.css +1 -1
  15. package/build/jodit.min.js +1 -1
  16. package/package.json +1 -1
  17. package/src/core/async.ts +1 -1
  18. package/src/core/constants.ts +2 -0
  19. package/src/core/dom.ts +113 -99
  20. package/src/core/events/{events-native.ts → event-emitter.ts} +14 -9
  21. package/src/core/events/index.ts +1 -1
  22. package/src/core/global.ts +2 -2
  23. package/src/core/helpers/array/to-array.ts +1 -0
  24. package/src/core/helpers/data-bind.ts +2 -2
  25. package/src/core/helpers/utils/utils.ts +20 -4
  26. package/src/core/request/ajax.ts +212 -0
  27. package/src/core/request/config.ts +37 -0
  28. package/{build-system/minimizer/index.js → src/core/request/index.ts} +2 -1
  29. package/src/core/request/response.ts +39 -0
  30. package/src/core/selection/select.ts +59 -27
  31. package/src/core/selection/style/api/element-has-same-style.ts +13 -0
  32. package/src/core/selection/style/api/get-suit-parent.ts +1 -1
  33. package/src/core/selection/style/api/is-suit-element.ts +24 -4
  34. package/src/core/selection/style/api/unwrap-children.ts +45 -16
  35. package/src/core/selection/style/api/wrap-unwrapped-text.ts +28 -23
  36. package/src/core/selection/style/apply-style.ts +14 -8
  37. package/src/core/traits/elms.ts +1 -0
  38. package/src/core/ui/helpers/get-control-type.ts +3 -1
  39. package/src/core/view/view.ts +3 -3
  40. package/src/modules/context-menu/context-menu.ts +1 -1
  41. package/src/modules/file-browser/README.MD +1 -1
  42. package/src/modules/file-browser/data-provider.ts +22 -42
  43. package/src/modules/file-browser/file-browser.ts +3 -0
  44. package/src/modules/index.ts +1 -1
  45. package/src/modules/table.ts +106 -101
  46. package/src/modules/uploader/uploader.ts +4 -3
  47. package/src/plugins/fix/clean-html.ts +37 -16
  48. package/src/plugins/indent.ts +25 -18
  49. package/src/plugins/size/resize-handler.ts +1 -1
  50. package/src/plugins/size/size.ts +1 -3
  51. package/src/plugins/source/source.ts +1 -1
  52. package/src/plugins/table/select-cells.ts +23 -5
  53. package/src/types/ajax.d.ts +15 -6
  54. package/src/types/async.d.ts +1 -1
  55. package/src/types/events.d.ts +12 -12
  56. package/src/types/view.d.ts +2 -2
  57. package/types/core/async.d.ts +1 -1
  58. package/types/core/constants.d.ts +1 -0
  59. package/types/core/dom.d.ts +25 -19
  60. package/types/core/events/{events-native.d.ts → event-emitter.d.ts} +8 -3
  61. package/types/core/events/index.d.ts +1 -1
  62. package/types/core/global.d.ts +2 -2
  63. package/types/core/helpers/utils/utils.d.ts +12 -4
  64. package/types/core/{ajax.d.ts → request/ajax.d.ts} +4 -14
  65. package/types/core/request/config.d.ts +14 -0
  66. package/{build-system/rules/css.js → types/core/request/index.d.ts} +2 -7
  67. package/types/core/request/response.d.ts +16 -0
  68. package/types/core/selection/style/api/element-has-same-style.d.ts +4 -0
  69. package/types/core/selection/style/api/is-suit-element.d.ts +1 -0
  70. package/types/core/selection/style/api/wrap-unwrapped-text.d.ts +2 -2
  71. package/types/core/view/view.d.ts +2 -2
  72. package/types/modules/file-browser/data-provider.d.ts +1 -1
  73. package/types/modules/index.d.ts +1 -1
  74. package/types/plugins/fix/clean-html.d.ts +4 -0
  75. package/types/plugins/size/resize-handler.d.ts +1 -1
  76. package/types/plugins/source/source.d.ts +1 -1
  77. package/types/types/ajax.d.ts +15 -6
  78. package/types/types/async.d.ts +1 -1
  79. package/types/types/events.d.ts +12 -12
  80. package/types/types/view.d.ts +2 -2
  81. package/.editorconfig +0 -15
  82. package/.eslintignore +0 -3
  83. package/.eslintrc.js +0 -109
  84. package/.prettierrc.json +0 -9
  85. package/.stylelintrc +0 -17
  86. package/app.css +0 -112
  87. package/build-system/index.js +0 -78
  88. package/build-system/loaders/css-variables-prefixes.js +0 -12
  89. package/build-system/loaders/lang-loader.js +0 -57
  90. package/build-system/loaders/style.js +0 -31
  91. package/build-system/loaders/svg-loader.js +0 -21
  92. package/build-system/minimizer/css.js +0 -20
  93. package/build-system/minimizer/js.js +0 -41
  94. package/build-system/plugins/banner.js +0 -15
  95. package/build-system/plugins/define.js +0 -22
  96. package/build-system/plugins/extract-css.js +0 -14
  97. package/build-system/plugins/index.js +0 -31
  98. package/build-system/plugins/post-build.js +0 -52
  99. package/build-system/rules/extra-typescript.js +0 -22
  100. package/build-system/rules/index.js +0 -17
  101. package/build-system/rules/internal-typescript.js +0 -23
  102. package/build-system/rules/langs.js +0 -20
  103. package/build-system/rules/svg.js +0 -19
  104. package/build-system/utils/filename.js +0 -17
  105. package/build-system/utils/post-build.js +0 -28
  106. package/build-system/variables.js +0 -53
  107. package/composer.json +0 -12
  108. package/src/core/ajax.ts +0 -266
  109. package/src/types/core.d.ts +0 -7
  110. package/src/types/core.js +0 -8
  111. package/src/types/core.js.map +0 -1
  112. package/src/types/storage.d.ts +0 -13
  113. package/src/types/storage.js +0 -8
  114. package/src/types/storage.js.map +0 -1
  115. package/types/types/core.js +0 -8
  116. package/types/types/core.js.map +0 -1
  117. package/types/types/storage.js +0 -8
  118. package/types/types/storage.js.map +0 -1
package/CHANGELOG.MD CHANGED
@@ -9,6 +9,92 @@
9
9
  > - :house: [Internal]
10
10
  > - :nail_care: [Polish]
11
11
 
12
+ ## 3.9.1
13
+
14
+ #### :boom: Breaking Change
15
+
16
+ - Removed `Travis.CI` 👋👋👋
17
+ - `EventsNative` module - renamed to `EventEmitter`
18
+
19
+ ```js
20
+ const editor = Jodit.make('#editor');
21
+
22
+ console.log(editor.e instanceof Jodit.modules.EventEmitter); // true
23
+ console.log(editor.events instanceof Jodit.modules.EventEmitter); // true
24
+ console.log(editor.events instanceof Jodit.modules.EventsNative); // true, deprecated
25
+ ```
26
+
27
+ - BOOM: Move Ajax class into `request` folder.
28
+
29
+ ```js
30
+ import { Ajax } from 'jodit/src/core/request';
31
+ ```
32
+
33
+ - Changed the signature of the send method in the Ajax API and is closer to the fetch () API
34
+
35
+ ```js
36
+ const editor = Jodit.make('#editor');
37
+
38
+ // Before
39
+ await new Ajax(editor, {
40
+ url: 'index.php'
41
+ }).send(); // {success: true, data: ...}
42
+
43
+ // Now
44
+ await new Ajax(editor, {
45
+ url: 'index.php'
46
+ })
47
+ .send()˚
48
+ .then(resp => resp.json()); // {success: true, data: ...}
49
+ ```
50
+
51
+ - In `.npmignore` added:
52
+ - build-system/
53
+ - test.html
54
+ - .eslintrc.js
55
+ - .eslintignore
56
+ - .editorconfig
57
+ - .gitignore
58
+ - .prettierrc.json
59
+ - .stylelintrc
60
+ - app.css
61
+ - composer.json
62
+
63
+ #### :rocket: New Feature
64
+
65
+ In `Dom` module added `nextGen` and `eachGen` methods. These methods return generators:
66
+
67
+ ```js
68
+ const editor = Jodit.make('#editor');
69
+ editor.value = '<ul><li><img>1</li><li>2</li><li>3</li></ul>';
70
+
71
+ const gen = Dom.nextGen(editor.editor.querySelector('img'), editor.editor);
72
+ let next = gen.next();
73
+
74
+ while (!next.done) {
75
+ console.log(next.value); // 1, LI, 2, LI, 3
76
+ next = gen.next();
77
+ }
78
+
79
+ const gen2 = Dom.eachGen(editor.editor);
80
+ let next2 = gen2.next();
81
+
82
+ while (!next2.done) {
83
+ console.log(next2.value); // UL, LI, 1, LI, 2, LI, 3
84
+ next2 = gen2.next();
85
+ }
86
+ ```
87
+
88
+ #### :bug: Bug Fix
89
+
90
+ - [Indent doesn't work in table cell #729](https://github.com/xdan/jodit/issues/729)
91
+ - [cleanHTML replaceOldTags doesn't seem to do anything #728](https://github.com/xdan/jodit/issues/728)
92
+ - [Fixed Resize column table #712](https://github.com/xdan/jodit/issues/712)
93
+ - [Font and font size settings are not applied to all text if part of it has been changed earlier #706](https://github.com/xdan/jodit/issues/706)
94
+ - [Delete multi rows and colums #690](https://github.com/xdan/jodit/issues/690)
95
+ - [When {"enter": "BR"} option is enabled, adding a heading to the text causes it to become wrapped by a "h\*" tag #547](https://github.com/xdan/jodit/issues/547)
96
+ - [Issue with clear format on <p> tags #680](https://github.com/xdan/jodit/issues/680)
97
+
12
98
  ## 3.8.5
13
99
 
14
100
  #### :house: Internal
@@ -17,19 +103,19 @@
17
103
 
18
104
  #### :bug: Bug Fix
19
105
 
20
- - [When I merged some cells by dragging it to change its width. #737](https://github.com/xdan/jodit/issues/737)
21
- - [Color dropdown looks broken #736](https://github.com/xdan/jodit/issues/736)
22
- - [all popups and dialogs are outside shadow dom #731](https://github.com/xdan/jodit/issues/731)
23
- - [shadow dom browser support #730](https://github.com/xdan/jodit/issues/730)
24
- - [fix removal of attributes width and height when editing images](https://github.com/xdan/jodit/pull/733)
25
- - Fixed work in IE11
26
- - [toolbar menus are almost not visible on IE11 #458](https://github.com/xdan/jodit/issues/458)
106
+ - [When I merged some cells by dragging it to change its width. #737](https://github.com/xdan/jodit/issues/737)
107
+ - [Color dropdown looks broken #736](https://github.com/xdan/jodit/issues/736)
108
+ - [all popups and dialogs are outside shadow dom #731](https://github.com/xdan/jodit/issues/731)
109
+ - [shadow dom browser support #730](https://github.com/xdan/jodit/issues/730)
110
+ - [fix removal of attributes width and height when editing images](https://github.com/xdan/jodit/pull/733)
111
+ - Fixed work in IE11
112
+ - [toolbar menus are almost not visible on IE11 #458](https://github.com/xdan/jodit/issues/458)
27
113
 
28
114
  ## 3.8.4
29
115
 
30
116
  #### :rocket: New Feature
31
117
 
32
- - В eventEmmiter добавлены методы:
118
+ - В eventEmitter добавлены методы:
33
119
  - `mute(event?: string)` Doesn't start any handler;
34
120
  - `isMuted(event?: string)` No handlers are triggered for the event
35
121
  - `unmute(event?: string)` Returns event handling
@@ -121,7 +207,7 @@ Dom.isNode(editor.ed.body); // true
121
207
 
122
208
  #### :rocket: New Feature
123
209
 
124
- - Added `KeyArrowOutside`, allowing to go outside of an inline element if there is no other element after that.
210
+ - Added `KeyArrowOutside`, allowing to go outside an inline element if there is no other element after that.
125
211
  - Dictionary of variable values in css, a complete list can be found here https://github.com/xdan/jodit/blob/master/src/styles/variables.less#L25
126
212
  ```js
127
213
  const editor = Jodit.make('#editor', {
@@ -276,7 +362,7 @@ editor.s.restore();
276
362
  #### :bug: Bug Fix
277
363
 
278
364
  - ['allowResizeX' option does not work without 'height' option #668](https://github.com/xdan/jodit/issues/668)
279
- - [Pasting link with an colon (:) crashes the browser/makes it unresponsive #667](https://github.com/xdan/jodit/issues/667)
365
+ - [Pasting link with a colon (:) crashes the browser/makes it unresponsive #667](https://github.com/xdan/jodit/issues/667)
280
366
  - [Inserting images/videos scrolls user to top of text area #644](https://github.com/xdan/jodit/issues/644)
281
367
  - [Change event is fired twice after inserting a link #636](https://github.com/xdan/jodit/issues/636)
282
368
  - [iPhone is out of text selection #632](https://github.com/xdan/jodit/issues/632)
@@ -590,7 +676,7 @@ console.log(item.options); // {some: false}
590
676
  - [Backspace in beginning of a _styled_ line does not affect the line positioning #567](https://github.com/xdan/jodit/issues/567)
591
677
  - [Table cell elements are always left-aligned #550](https://github.com/xdan/jodit/issues/550)
592
678
  - [editor.destruct throws error #543](https://github.com/xdan/jodit/issues/543)
593
- - [How i can get Iframe without parent element <jodit>...</jodit> #540](https://github.com/xdan/jodit/issues/540)
679
+ - [How I can get Iframe without parent element <jodit>...</jodit> #540](https://github.com/xdan/jodit/issues/540)
594
680
  - [Layout bug and drag&drop image loading #536](https://github.com/xdan/jodit/issues/536)
595
681
  - [Popups are not showing at all on Legacy Edge #531](https://github.com/xdan/jodit/issues/531)
596
682
  - Fixed a bug when the search bar was shown in the scrolling editor, the editor was scrolled up. And the search box was not in sticky mode.
@@ -623,11 +709,11 @@ Related with https://github.com/xdan/jodit/issues/574. In some cases need to lim
623
709
  - @property {number} link.selectSizeClassName=3 The size of the select (to use with modeClassName="select")
624
710
  - @property {IUIOption[]} link.selectOptionsClassName=[] The list of the option for the select (to use with modeClassName="select")
625
711
  - ex: [
626
- - { value: "", text: "" },
627
- - { value: "val1", text: "text1" },
628
- - { value: "val2", text: "text2" },
629
- - { value: "val3", text: "text3" }
630
- - ]
712
+ - { value: "", text: "" },
713
+ - { value: "val1", text: "text1" },
714
+ - { value: "val2", text: "text2" },
715
+ - { value: "val3", text: "text3" }
716
+ - ]
631
717
  PR: https://github.com/xdan/jodit/pull/577 Thanks @s-renier-taonix-fr
632
718
 
633
719
  ##### New option `statusbar: boolean = true`
@@ -765,7 +851,7 @@ const editor = Jodit.make({
765
851
  ## 3.4.27
766
852
 
767
853
  - https://github.com/xdan/jodit/issues/514
768
- Run command insertUnorderedList & insertOrderedList should replace all headings (h1, h2, etc) to ul>li
854
+ Run command insertUnorderedList & insertOrderedList should replace all headings (h1, h2, etc.) to ul>li
769
855
 
770
856
  ## 3.4.26
771
857
 
@@ -997,7 +1083,7 @@ editor.events.on(
997
1083
  );
998
1084
  ```
999
1085
 
1000
- Now, you should use event.target
1086
+ Now, you should use `event.target`
1001
1087
 
1002
1088
  ```js
1003
1089
  editor.events.on(document.querySelector('div'), 'click', function (e) {
@@ -1153,7 +1239,7 @@ console.log(Jodit.modules.Helpers.position(editor.editor.querySelector('p')));
1153
1239
 
1154
1240
  ### BugFix
1155
1241
 
1156
- - Fixed a lots bugs inside `link` plugin
1242
+ - Fixed a lots of bugs inside `link` plugin
1157
1243
  [#331](https://github.com/xdan/jodit/issues/331)
1158
1244
  [#334](https://github.com/xdan/jodit/issues/334)
1159
1245
  [#334](https://github.com/xdan/jodit/issues/334)
@@ -1358,7 +1444,7 @@ Jodit.plugins.remove('insertText');
1358
1444
 
1359
1445
  ### `extraPlugins` options
1360
1446
 
1361
- Inside plugin you can use several fields:
1447
+ Inside plugin, you can use several fields:
1362
1448
 
1363
1449
  ```js
1364
1450
  // emoji.js
@@ -1527,7 +1613,7 @@ First step for Mobile-friendly [sizeLG,sizeMD,sizeSM](http://xdsoft.net/jodit/do
1527
1613
  - buttons The list of buttons that appear in the editor's toolbar on large places (≥ options.sizeLG).
1528
1614
  - buttonsMD The list of buttons that appear in the editor's toolbar on medium places (≥ options.sizeMD).
1529
1615
  - buttonsSM The list of buttons that appear in the editor's toolbar on small places (≥ options.sizeSM).
1530
- - buttonsXS The list of buttons that appear in the editor's toolbar on extra small places (< options.sizeSM).
1616
+ - buttonsXS The list of buttons that appear in the editor's toolbar on tiny places (< options.sizeSM).
1531
1617
 
1532
1618
  ```javascript
1533
1619
  var editor = new Jodit('#some-editor', {
@@ -1878,7 +1964,7 @@ Added edit button in Image Properties Dialog
1878
1964
 
1879
1965
  ### 2.5.1
1880
1966
 
1881
- - Dom module was rewrited and was fixed afew bugs
1967
+ - Dom module was rewritten and was fixed afew bugs
1882
1968
  - In [OEM and Pro](http://xdsoft.net/jodit/#download) added [Image Editor module](http://xdsoft.net/jodit/doc/module-ImageEditor.html) resize and crop image. You can try [here](http://xdsoft.net/jodit/)
1883
1969
  ![Crop Image](http://xdsoft.net/jodit/stuf/crop.jpg)
1884
1970
  ![Resize Image](http://xdsoft.net/jodit/stuf/resize.jpg)
@@ -2239,7 +2325,7 @@ Fixed bug in Uploader module when `http://sitename.net/jodit///files/fg.jpg` was
2239
2325
  ### 2.3.18
2240
2326
 
2241
2327
  Added `afterInsertImage` event - triggered after image was inserted [selection.insertImage](http://xdsoft.net/jodit/doc/module-Selection.html#-insertImage__anchor).
2242
- This method can executed from [Filebrowser](http://xdsoft.net/jodit/doc/module-Filebrowser.html) or [Uploader](http://xdsoft.net/jodit/doc/module-Uploader.html)
2328
+ This method can execute from [Filebrowser](http://xdsoft.net/jodit/doc/module-Filebrowser.html) or [Uploader](http://xdsoft.net/jodit/doc/module-Uploader.html)
2243
2329
 
2244
2330
  ```javascript
2245
2331
  var editor = new Jodit('#redactor');
@@ -2335,7 +2421,7 @@ Fixed bug in filebrowser
2335
2421
 
2336
2422
  ### 1.2.0
2337
2423
 
2338
- Fixed bug when [selection.insertHTML](http://xdsoft.net/jodit/doc/module-Selection.html#-inner-insertHTML__anchor) dosn't work without focus
2424
+ Fixed bug when [selection.insertHTML](http://xdsoft.net/jodit/doc/module-Selection.html#-inner-insertHTML__anchor) doesn't work without focus
2339
2425
 
2340
2426
  ### 1.1.0
2341
2427
 
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  # Jodit Editor 3
4
4
  An excellent WYSIWYG editor written in pure TypeScript without the use of additional libraries. Its file editor and image editor.
5
5
 
6
- [![Build Status](https://travis-ci.org/xdan/jodit.svg?branch=master)](https://travis-ci.org/xdan/jodit)
6
+ [![Build Status](https://github.com/xdan/jodit/workflows/Run%20tests/badge.svg)](https://github.com/xdan/jodit/actions/workflows/tests.yml)
7
7
  [![npm version](https://badge.fury.io/js/jodit.svg)](https://badge.fury.io/js/jodit)
8
8
  [![npm](https://img.shields.io/npm/dm/jodit.svg)](https://www.npmjs.com/package/jodit)
9
9
  [![Gitter](https://badges.gitter.im/xdan/jodit.svg)](https://gitter.im/xdan/jodit?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
@@ -45,8 +45,8 @@ ES2018 Version (if your users use only modern browsers)
45
45
 
46
46
  ### CDN
47
47
  ```html
48
- <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jodit/3.6.1/jodit.min.css"/>
49
- <script src="//cdnjs.cloudflare.com/ajax/libs/jodit/3.6.1/jodit.min.js"></script>
48
+ <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jodit/3.9.1/jodit.min.css"/>
49
+ <script src="//cdnjs.cloudflare.com/ajax/libs/jodit/3.9.1/jodit.min.js"></script>
50
50
  ```
51
51
 
52
52
  ### USAGE
package/build/jodit.css CHANGED
@@ -1,14 +1,14 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
4
- * Version: v3.8.8
4
+ * Version: v3.9.2
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
8
8
  /*!
9
9
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
10
10
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
11
- * Version: v3.8.8
11
+ * Version: v3.9.2
12
12
  * Url: https://xdsoft.net/jodit/
13
13
  * License(s): MIT
14
14
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
4
- * Version: v3.8.8
4
+ * Version: v3.9.2
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
4
- * Version: v3.8.8
4
+ * Version: v3.9.2
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */