jodit 4.11.13 → 4.11.15

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 (57) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +5 -5
  4. package/es2015/jodit.js +286 -40
  5. package/es2015/jodit.min.js +5 -5
  6. package/es2015/plugins/debug/debug.css +1 -1
  7. package/es2015/plugins/debug/debug.js +1 -1
  8. package/es2015/plugins/debug/debug.min.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  12. package/es2018/jodit.fat.min.js +7 -7
  13. package/es2018/jodit.min.js +26 -26
  14. package/es2018/plugins/debug/debug.min.js +1 -1
  15. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  16. package/es2021/jodit.css +1 -1
  17. package/es2021/jodit.fat.min.js +12 -8
  18. package/es2021/jodit.js +102 -4
  19. package/es2021/jodit.min.js +25 -21
  20. package/es2021/plugins/debug/debug.css +1 -1
  21. package/es2021/plugins/debug/debug.js +1 -1
  22. package/es2021/plugins/debug/debug.min.js +1 -1
  23. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  24. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  25. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  26. package/es2021.en/jodit.css +1 -1
  27. package/es2021.en/jodit.fat.min.js +10 -6
  28. package/es2021.en/jodit.js +102 -4
  29. package/es2021.en/jodit.min.js +9 -5
  30. package/es2021.en/plugins/debug/debug.css +1 -1
  31. package/es2021.en/plugins/debug/debug.js +1 -1
  32. package/es2021.en/plugins/debug/debug.min.js +1 -1
  33. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  36. package/es5/jodit.css +2 -2
  37. package/es5/jodit.fat.min.js +2 -2
  38. package/es5/jodit.js +403 -47
  39. package/es5/jodit.min.css +2 -2
  40. package/es5/jodit.min.js +2 -2
  41. package/es5/plugins/debug/debug.css +1 -1
  42. package/es5/plugins/debug/debug.js +1 -1
  43. package/es5/plugins/debug/debug.min.js +1 -1
  44. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  47. package/es5/polyfills.fat.min.js +1 -1
  48. package/es5/polyfills.js +1 -1
  49. package/es5/polyfills.min.js +1 -1
  50. package/esm/core/constants.js +1 -1
  51. package/esm/core/request/ajax.d.ts +1 -0
  52. package/esm/core/request/ajax.js +104 -0
  53. package/esm/plugins/image-properties/ui/ui-image-main-tab.js +2 -2
  54. package/esm/types/ajax.d.ts +9 -0
  55. package/package.json +1 -1
  56. package/types/core/request/ajax.d.ts +1 -0
  57. package/types/types/ajax.d.ts +9 -0
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.11.13
4
+ * Version: v4.11.15
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1758,7 +1758,7 @@ __webpack_require__.r(__webpack_exports__);
1758
1758
  * ```
1759
1759
  * @packageDocumentation
1760
1760
  * @module constants
1761
- */ const APP_VERSION = "4.11.13";
1761
+ */ const APP_VERSION = "4.11.15";
1762
1762
  // prettier-ignore
1763
1763
  const ES = "es2021";
1764
1764
  const IS_ES_MODERN = true;
@@ -9632,6 +9632,104 @@ class Ajax {
9632
9632
  }, 0);
9633
9633
  });
9634
9634
  }
9635
+ async *stream() {
9636
+ this.__activated = true;
9637
+ const { xhr, o } = this;
9638
+ const request = this.prepareRequest();
9639
+ let lastIndex = 0;
9640
+ let buffer = '';
9641
+ const queue = [];
9642
+ let waitResolve = null;
9643
+ let done = false;
9644
+ let streamError = null;
9645
+ const notify = ()=>{
9646
+ if (waitResolve) {
9647
+ const r = waitResolve;
9648
+ waitResolve = null;
9649
+ r();
9650
+ }
9651
+ };
9652
+ const processChunk = (final)=>{
9653
+ const text = xhr.responseText;
9654
+ buffer += text.substring(lastIndex);
9655
+ lastIndex = text.length;
9656
+ const events = buffer.split('\n\n');
9657
+ buffer = final ? '' : events.pop() ?? '';
9658
+ for (const event of events){
9659
+ const trimmed = event.trim();
9660
+ if (!trimmed) {
9661
+ continue;
9662
+ }
9663
+ const dataLines = [];
9664
+ for (const line of trimmed.split('\n')){
9665
+ if (line.startsWith('data: ')) {
9666
+ dataLines.push(line.slice(6));
9667
+ } else if (line.startsWith('data:')) {
9668
+ dataLines.push(line.slice(5));
9669
+ }
9670
+ }
9671
+ if (dataLines.length) {
9672
+ queue.push(dataLines.join('\n'));
9673
+ }
9674
+ }
9675
+ notify();
9676
+ };
9677
+ xhr.onprogress = ()=>processChunk(false);
9678
+ xhr.onload = ()=>{
9679
+ processChunk(true);
9680
+ done = true;
9681
+ this.__isFulfilled = true;
9682
+ notify();
9683
+ };
9684
+ xhr.onerror = ()=>{
9685
+ streamError = jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_6__.connection('Connection error');
9686
+ done = true;
9687
+ this.__isFulfilled = true;
9688
+ notify();
9689
+ };
9690
+ xhr.onabort = ()=>{
9691
+ streamError = jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_6__.abort('Abort connection');
9692
+ done = true;
9693
+ this.__isFulfilled = true;
9694
+ notify();
9695
+ };
9696
+ xhr.withCredentials = o.withCredentials ?? false;
9697
+ const { url, data, method } = request;
9698
+ xhr.open(method, url, true);
9699
+ if (o.contentType && xhr.setRequestHeader) {
9700
+ xhr.setRequestHeader('Content-type', o.contentType);
9701
+ }
9702
+ let { headers } = o;
9703
+ if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isFunction)(headers)) {
9704
+ headers = await headers.call(this);
9705
+ }
9706
+ if (headers && xhr.setRequestHeader) {
9707
+ Object.keys(headers).forEach((key)=>{
9708
+ xhr.setRequestHeader(key, headers[key]);
9709
+ });
9710
+ }
9711
+ xhr.send(data ? this.__buildParams(data) : undefined);
9712
+ try {
9713
+ while(true){
9714
+ if (queue.length > 0) {
9715
+ yield queue.shift();
9716
+ } else if (done) {
9717
+ break;
9718
+ } else {
9719
+ await new Promise((r)=>{
9720
+ waitResolve = r;
9721
+ });
9722
+ }
9723
+ }
9724
+ } finally{
9725
+ if (!this.__isFulfilled) {
9726
+ this.abort();
9727
+ }
9728
+ }
9729
+ if (streamError) {
9730
+ throw streamError;
9731
+ }
9732
+ }
9635
9733
  prepareRequest() {
9636
9734
  if (!this.o.url) {
9637
9735
  throw jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_6__.error('Need URL for AJAX request');
@@ -31445,8 +31543,8 @@ class UIImageMainTab extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_
31445
31543
  <div class="jodit-input_group">
31446
31544
  <input class="jodit-input &__imageSrc" type="text"/>
31447
31545
  <div class="jodit-input_group-buttons &__fixImage">
31448
- <a class="jodit-button &__changeImage">*image*</a>
31449
- <a class="jodit-button &__editImage">*crop*</a>
31546
+ <a class="jodit-button &__changeImage" data-ref="changeImage">*image*</a>
31547
+ <a class="jodit-button &__editImage" data-ref="editImage">*crop*</a>
31450
31548
  </div>
31451
31549
  </div>
31452
31550
  </div>