jodit 4.0.0-beta.86 → 4.0.0-beta.88

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 (104) hide show
  1. package/CHANGELOG.md +42 -8
  2. package/README.md +5 -5
  3. package/es2015/jodit.css +1 -1
  4. package/es2015/jodit.fat.min.js +2 -2
  5. package/es2015/jodit.js +46 -43
  6. package/es2015/jodit.min.js +2 -2
  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.css +1 -1
  13. package/es2018/jodit.fat.min.js +2 -2
  14. package/es2018/jodit.js +46 -43
  15. package/es2018/jodit.min.js +2 -2
  16. package/es2018/plugins/debug/debug.js +1 -1
  17. package/es2018/plugins/debug/debug.min.js +1 -1
  18. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  19. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  20. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  21. package/es2021/jodit.css +1 -1
  22. package/es2021/jodit.fat.min.js +2 -2
  23. package/es2021/jodit.js +43 -43
  24. package/es2021/jodit.min.js +2 -2
  25. package/es2021/plugins/debug/debug.js +1 -1
  26. package/es2021/plugins/debug/debug.min.js +1 -1
  27. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  28. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  29. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  30. package/es2021.en/jodit.css +1 -1
  31. package/es2021.en/jodit.fat.min.js +2 -2
  32. package/es2021.en/jodit.js +43 -43
  33. package/es2021.en/jodit.min.js +2 -2
  34. package/es2021.en/plugins/debug/debug.js +1 -1
  35. package/es2021.en/plugins/debug/debug.min.js +1 -1
  36. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  37. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  38. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  39. package/es5/jodit.css +2 -2
  40. package/es5/jodit.fat.min.js +2 -2
  41. package/es5/jodit.js +85 -69
  42. package/es5/jodit.min.css +2 -2
  43. package/es5/jodit.min.js +2 -2
  44. package/es5/plugins/debug/debug.js +1 -1
  45. package/es5/plugins/debug/debug.min.js +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  47. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  48. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  49. package/esm/core/constants.js +1 -1
  50. package/esm/core/selection/interface.d.ts +5 -0
  51. package/esm/core/selection/interface.js +6 -1
  52. package/esm/core/selection/style/commit-style.js +2 -0
  53. package/esm/core/ui/button/button/button.js +2 -1
  54. package/esm/core/ui/button/group/group.js +2 -1
  55. package/esm/core/ui/button/tooltip/tooltip.js +2 -1
  56. package/esm/core/ui/element.js +2 -1
  57. package/esm/core/ui/form/block/block.js +2 -1
  58. package/esm/core/ui/form/form.js +2 -1
  59. package/esm/core/ui/form/inputs/area/area.js +2 -1
  60. package/esm/core/ui/form/inputs/checkbox/checkbox.js +2 -1
  61. package/esm/core/ui/form/inputs/file/file.js +2 -1
  62. package/esm/core/ui/form/inputs/input/input.js +2 -1
  63. package/esm/core/ui/form/inputs/select/select.js +2 -1
  64. package/esm/core/ui/group/group.js +2 -1
  65. package/esm/core/ui/group/list.js +2 -1
  66. package/esm/core/ui/group/separator.js +2 -1
  67. package/esm/core/ui/group/spacer.js +2 -1
  68. package/esm/core/ui/icon.js +4 -1
  69. package/esm/core/view/view.js +2 -1
  70. package/esm/jodit.js +3 -11
  71. package/esm/modules/context-menu/context-menu.js +2 -1
  72. package/esm/modules/dialog/dialog.js +2 -1
  73. package/esm/modules/file-browser/file-browser.js +2 -1
  74. package/esm/modules/image-editor/image-editor.js +2 -1
  75. package/esm/modules/messages/message.js +2 -1
  76. package/esm/modules/messages/messages.js +2 -1
  77. package/esm/modules/status-bar/status-bar.js +2 -1
  78. package/esm/modules/toolbar/button/button.js +2 -1
  79. package/esm/modules/toolbar/button/content.js +2 -1
  80. package/esm/modules/toolbar/button/select/select.js +2 -1
  81. package/esm/modules/toolbar/collection/collection.js +2 -1
  82. package/esm/modules/toolbar/collection/editor-collection.js +2 -1
  83. package/esm/plugins/backspace/interface.d.ts +9 -8
  84. package/esm/plugins/resize-handler/resize-handler.js +2 -1
  85. package/esm/plugins/search/ui/search.js +2 -1
  86. package/esm/plugins/size/size.js +2 -1
  87. package/esm/plugins/speech-recognize/helpers/recognize-manager.js +2 -1
  88. package/esm/plugins/wrap-nodes/wrap-nodes.js +34 -30
  89. package/examples/arabic.lang.html +111 -64
  90. package/examples/assets/app.css +1 -3
  91. package/examples/color-picker.html +122 -72
  92. package/examples/custom-icons.html +204 -157
  93. package/examples/custom-toolbar.html +110 -63
  94. package/examples/example.default.html +4 -3
  95. package/examples/fullsize.html +107 -60
  96. package/examples/index.html +6 -5
  97. package/examples/inline-mode.html +193 -92
  98. package/examples/oneinstance.html +138 -90
  99. package/examples/theme.html +6 -5
  100. package/package.json +1 -1
  101. package/types/core/selection/interface.d.ts +5 -0
  102. package/types/plugins/backspace/interface.d.ts +9 -8
  103. package/examples/assets/prism.css +0 -200
  104. package/examples/assets/prism.js +0 -1254
@@ -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/jodit/)
4
- * Version: v4.0.0-beta.86
4
+ * Version: v4.0.0-beta.88
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1716,7 +1716,7 @@ __webpack_require__.r(__webpack_exports__);
1716
1716
  * Released under MIT see LICENSE.txt in the project root for license information.
1717
1717
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1718
1718
  */
1719
- const APP_VERSION = "4.0.0-beta.86";
1719
+ const APP_VERSION = "4.0.0-beta.88";
1720
1720
  // prettier-ignore
1721
1721
  const ES = "es2021";
1722
1722
  const IS_ES_MODERN = true;
@@ -12224,6 +12224,8 @@ class CommitStyle {
12224
12224
  });
12225
12225
  this.__applyMap = new WeakMap();
12226
12226
  }
12227
+ jodit.synchronizeValues();
12228
+ jodit.e.fire('afterCommitStyle', this);
12227
12229
  }
12228
12230
  }
12229
12231
 
@@ -15015,7 +15017,10 @@ class Icon {
15015
15017
  let iconElement;
15016
15018
  const { name, iconURL, fill } = icon;
15017
15019
  const clearName = name.replace(/[^a-zA-Z0-9]/g, '_');
15018
- const iconFromEvent = jodit.o.getIcon?.(name, clearName);
15020
+ let iconFromEvent;
15021
+ if (!/<svg/.test(name)) {
15022
+ iconFromEvent = jodit.o.getIcon?.(name, clearName);
15023
+ }
15019
15024
  const cacheKey = `${name}${iconURL}${fill}${iconFromEvent ?? ''}`;
15020
15025
  if (jodit.o.cache && this.__cache.has(cacheKey)) {
15021
15026
  return this.__cache.get(cacheKey)?.cloneNode(true);
@@ -17053,20 +17058,11 @@ let Jodit = Jodit_1 = class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE
17053
17058
  if (this.o.disabled) {
17054
17059
  this.setDisabled(true);
17055
17060
  }
17056
- // if enter plugin not installed
17061
+ // if enter plugin isn't installed
17057
17062
  try {
17058
17063
  this.ed.execCommand('defaultParagraphSeparator', false, this.o.enter.toLowerCase());
17059
17064
  }
17060
17065
  catch { }
17061
- // fix for native resizing
17062
- try {
17063
- this.ed.execCommand('enableObjectResizing', false, 'false');
17064
- }
17065
- catch { }
17066
- try {
17067
- this.ed.execCommand('enableInlineTableEditing', false, 'false');
17068
- }
17069
- catch { }
17070
17066
  });
17071
17067
  }
17072
17068
  /**
@@ -39301,16 +39297,20 @@ class wrapNodes extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_0__/* .Plugin
39301
39297
  /**
39302
39298
  * Found Node which should be wrapped
39303
39299
  */
39304
- this.isSuitableStart = (n) => (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isText(n) && (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_5__/* .isString */ .H)(n.nodeValue) && /[^\s]/.test(n.nodeValue)) ||
39305
- (this.isNotClosed(n) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isTemporary(n));
39300
+ this.isSuitableStart = (n) => (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isText(n) &&
39301
+ (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_5__/* .isString */ .H)(n.nodeValue) &&
39302
+ (/[^\s]/.test(n.nodeValue) ||
39303
+ (n.parentNode?.firstChild === n &&
39304
+ this.isSuitable(n.nextSibling)))) ||
39305
+ (this.isNotWrapped(n) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isTemporary(n));
39306
39306
  /**
39307
- * Node should add in block element
39307
+ * Node should add in a block element
39308
39308
  */
39309
- this.isSuitable = (n) => jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isText(n) || this.isNotClosed(n);
39309
+ this.isSuitable = (n) => jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isText(n) || this.isNotWrapped(n);
39310
39310
  /**
39311
- * Some element which need append in block
39311
+ * Some element which needs to append in block
39312
39312
  */
39313
- this.isNotClosed = (n) => jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isElement(n) &&
39313
+ this.isNotWrapped = (n) => jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isElement(n) &&
39314
39314
  !(jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isBlock(n) || jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isTag(n, this.j.o.wrapNodes.exclude));
39315
39315
  }
39316
39316
  /** @override **/
@@ -39322,7 +39322,7 @@ class wrapNodes extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_0__/* .Plugin
39322
39322
  .on('drop.wtn focus.wtn keydown.wtn mousedown.wtn afterInit.wtn', this.preprocessInput, {
39323
39323
  top: true
39324
39324
  })
39325
- .on('afterInit.wtn postProcessSetEditorValue.wtn', this.postProcessSetEditorValue);
39325
+ .on('afterInit.wtn postProcessSetEditorValue.wtn afterCommitStyle.wtn', this.postProcessSetEditorValue);
39326
39326
  }
39327
39327
  /** @override **/
39328
39328
  beforeDestruct(jodit) {
@@ -39338,7 +39338,7 @@ class wrapNodes extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_0__/* .Plugin
39338
39338
  }
39339
39339
  let child = jodit.editor.firstChild, isChanged = false;
39340
39340
  while (child) {
39341
- child = this.checkAloneListLeaf(child, jodit);
39341
+ child = checkAloneListLeaf(child, jodit);
39342
39342
  if (this.isSuitableStart(child)) {
39343
39343
  if (!isChanged) {
39344
39344
  jodit.s.save();
@@ -39363,28 +39363,6 @@ class wrapNodes extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_0__/* .Plugin
39363
39363
  }
39364
39364
  }
39365
39365
  }
39366
- checkAloneListLeaf(child, jodit) {
39367
- let result = child;
39368
- let next = child;
39369
- do {
39370
- if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isElement(next) &&
39371
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isLeaf(next) &&
39372
- !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isList(next.parentElement)) {
39373
- const nextChild = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.findNotEmptySibling(next, false);
39374
- if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isTag(result, 'ul')) {
39375
- result.appendChild(next);
39376
- }
39377
- else {
39378
- result = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.wrap(next, 'ul', jodit.createInside);
39379
- }
39380
- next = nextChild;
39381
- }
39382
- else {
39383
- break;
39384
- }
39385
- } while (next);
39386
- return result;
39387
- }
39388
39366
  /**
39389
39367
  * Process input without parent box
39390
39368
  */
@@ -39409,6 +39387,28 @@ class wrapNodes extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_0__/* .Plugin
39409
39387
  (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .gn)([
39410
39388
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
39411
39389
  ], wrapNodes.prototype, "preprocessInput", null);
39390
+ function checkAloneListLeaf(child, jodit) {
39391
+ let result = child;
39392
+ let next = child;
39393
+ do {
39394
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isElement(next) &&
39395
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isLeaf(next) &&
39396
+ !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isList(next.parentElement)) {
39397
+ const nextChild = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.findNotEmptySibling(next, false);
39398
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isTag(result, 'ul')) {
39399
+ result.appendChild(next);
39400
+ }
39401
+ else {
39402
+ result = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.wrap(next, 'ul', jodit.createInside);
39403
+ }
39404
+ next = nextChild;
39405
+ }
39406
+ else {
39407
+ break;
39408
+ }
39409
+ } while (next);
39410
+ return result;
39411
+ }
39412
39412
  jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .pluginSystem */ .pw.add('wrapNodes', wrapNodes);
39413
39413
 
39414
39414