jodit 4.20.1 → 4.20.3

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 (85) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/es2015/jodit.css +68 -9
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +10 -10
  5. package/es2015/jodit.js +309 -72
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +7 -7
  8. package/es2015/plugins/debug/debug.css +1 -1
  9. package/es2015/plugins/debug/debug.js +1 -1
  10. package/es2015/plugins/debug/debug.min.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  13. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +10 -10
  16. package/es2018/jodit.min.css +1 -1
  17. package/es2018/jodit.min.js +7 -7
  18. package/es2018/plugins/debug/debug.min.js +1 -1
  19. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  20. package/es2021/jodit.css +68 -9
  21. package/es2021/jodit.fat.min.css +1 -1
  22. package/es2021/jodit.fat.min.js +11 -11
  23. package/es2021/jodit.js +302 -72
  24. package/es2021/jodit.min.css +1 -1
  25. package/es2021/jodit.min.js +7 -7
  26. package/es2021/plugins/debug/debug.css +1 -1
  27. package/es2021/plugins/debug/debug.js +1 -1
  28. package/es2021/plugins/debug/debug.min.js +1 -1
  29. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  30. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  31. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  32. package/es2021.en/jodit.css +68 -9
  33. package/es2021.en/jodit.fat.min.css +1 -1
  34. package/es2021.en/jodit.fat.min.js +19 -19
  35. package/es2021.en/jodit.js +302 -72
  36. package/es2021.en/jodit.min.css +1 -1
  37. package/es2021.en/jodit.min.js +19 -19
  38. package/es2021.en/plugins/debug/debug.css +1 -1
  39. package/es2021.en/plugins/debug/debug.js +1 -1
  40. package/es2021.en/plugins/debug/debug.min.js +1 -1
  41. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  42. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  44. package/es5/jodit.css +45 -2
  45. package/es5/jodit.fat.min.css +1 -1
  46. package/es5/jodit.fat.min.js +2 -2
  47. package/es5/jodit.js +358 -74
  48. package/es5/jodit.min.css +3 -3
  49. package/es5/jodit.min.js +2 -2
  50. package/es5/plugins/debug/debug.css +1 -1
  51. package/es5/plugins/debug/debug.js +1 -1
  52. package/es5/plugins/debug/debug.min.js +1 -1
  53. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  54. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  55. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  56. package/es5/polyfills.fat.min.js +1 -1
  57. package/es5/polyfills.js +1 -1
  58. package/es5/polyfills.min.js +1 -1
  59. package/esm/core/constants.js +1 -1
  60. package/esm/modules/file-browser/builders/context-menu.js +6 -2
  61. package/esm/modules/toolbar/button/button.d.ts +10 -0
  62. package/esm/modules/toolbar/button/button.js +17 -2
  63. package/esm/modules/toolbar/button/select/select.d.ts +6 -0
  64. package/esm/modules/toolbar/button/select/select.js +18 -0
  65. package/esm/modules/toolbar/factory.js +3 -1
  66. package/esm/modules/widget/color-picker/color-picker.js +76 -18
  67. package/esm/plugins/anchor/anchor.d.ts +11 -0
  68. package/esm/plugins/anchor/anchor.js +84 -8
  69. package/esm/plugins/backspace/cases/check-not-collapsed.js +1 -1
  70. package/esm/plugins/delete/delete.d.ts +12 -0
  71. package/esm/plugins/delete/delete.js +66 -4
  72. package/esm/plugins/delete/interface.d.ts +4 -2
  73. package/esm/plugins/dtd/after-insert/remove-extra-br.js +7 -1
  74. package/esm/plugins/fullsize/config.js +2 -0
  75. package/esm/plugins/hr/hr.js +0 -1
  76. package/esm/plugins/line-height/config.js +0 -1
  77. package/esm/plugins/placeholder/placeholder.js +3 -1
  78. package/esm/types/toolbar.d.ts +2 -0
  79. package/package.json +1 -1
  80. package/types/modules/toolbar/button/button.d.ts +10 -0
  81. package/types/modules/toolbar/button/select/select.d.ts +6 -0
  82. package/types/plugins/anchor/anchor.d.ts +11 -0
  83. package/types/plugins/delete/delete.d.ts +12 -0
  84. package/types/plugins/delete/interface.d.ts +4 -2
  85. package/types/types/toolbar.d.ts +2 -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.20.1
4
+ * Version: v4.20.3
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1824,7 +1824,7 @@ __webpack_require__.r(__webpack_exports__);
1824
1824
  * ```
1825
1825
  * @packageDocumentation
1826
1826
  * @module constants
1827
- */ const APP_VERSION = "4.20.1";
1827
+ */ const APP_VERSION = "4.20.3";
1828
1828
  // prettier-ignore
1829
1829
  const ES = "es2021";
1830
1830
  const IS_ES_MODERN = true;
@@ -21511,11 +21511,12 @@ const CLASS_PREVIEW = 'jodit-file-browser-preview', preview_tpl_next = (next = '
21511
21511
  }), temp_content = self.c.div(CLASS_PREVIEW, '<div class="jodit-icon_loader"></div>'), preview_box = self.c.div(CLASS_PREVIEW + '__box'), next = self.c.fromHTML(preview_tpl_next()), prev = self.c.fromHTML(preview_tpl_next('prev', 'left')), addLoadHandler = (src)=>{
21512
21512
  const image = self.c.element('img');
21513
21513
  (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'src', src);
21514
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'alt', ga('data-name'));
21514
21515
  const onload = ()=>{
21515
21516
  if (self.isInDestruct) {
21516
21517
  return;
21517
21518
  }
21518
- self.e.off(image, 'load');
21519
+ self.e.off(image, 'load error');
21519
21520
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.detach(temp_content);
21520
21521
  if (opt.showPreviewNavigation) {
21521
21522
  if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.prevWithClass(item, self.files.getFullElName('item'))) {
@@ -21530,7 +21531,10 @@ const CLASS_PREVIEW = 'jodit-file-browser-preview', preview_tpl_next = (next = '
21530
21531
  preview.setPosition();
21531
21532
  self?.events?.fire('previewOpenedAndLoaded');
21532
21533
  };
21533
- self.e.on(image, 'load', onload);
21534
+ // An image that can't load is shown too,
21535
+ // broken with the file's name, rather
21536
+ // than the loader for good
21537
+ self.e.on(image, 'load error', onload);
21534
21538
  if (image.complete) {
21535
21539
  onload();
21536
21540
  }
@@ -26122,9 +26126,20 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_20__.U
26122
26126
  }
26123
26127
  return Boolean(tc && tc.shouldBeDisabled(this));
26124
26128
  }
26125
- onChangeActivated() {
26126
- ;(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_18__.attr)(this.button, 'aria-pressed', this.state.activated);
26127
- super.onChangeActivated();
26129
+ /**
26130
+ * A button that its control can show as on is a toggle, and says whether
26131
+ * it's pressed
26132
+ */ get isToggle() {
26133
+ const { isActive, tags, css } = this.control;
26134
+ return Boolean(isActive || tags || css);
26135
+ }
26136
+ /**
26137
+ * The pressed look comes from the mod, as any button looks pressed while
26138
+ * its list is open, and the container is a `listitem`, which can't have
26139
+ * `aria-pressed`
26140
+ */ onChangeActivated() {
26141
+ ;(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_18__.attr)(this.button, 'aria-pressed', this.isToggle ? this.state.activated : null);
26142
+ this.setMod('activated', this.state.activated || null);
26128
26143
  }
26129
26144
  onChangeText() {
26130
26145
  if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_11__.isFunction)(this.control.template)) {
@@ -26184,6 +26199,8 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_20__.U
26184
26199
  state.tooltip = (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_11__.isFunction)(ctr.tooltip) ? ctr.tooltip(this.j, ctr, this) : ctr.tooltip;
26185
26200
  }
26186
26201
  state.hasTrigger = Boolean(ctr.list || ctr.popup && ctr.exec);
26202
+ // UIButton's template makes every button a toggle
26203
+ this.onChangeActivated();
26187
26204
  }
26188
26205
  __initIconFromControl() {
26189
26206
  const { control: ctr, state } = this;
@@ -26743,7 +26760,8 @@ ToolbarContent = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
26743
26760
  /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84839);
26744
26761
  /* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(62101);
26745
26762
  /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(85932);
26746
- /* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22533);
26763
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7909);
26764
+ /* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(22533);
26747
26765
  /*!
26748
26766
  * Jodit Editor (https://xdsoft.net/jodit/)
26749
26767
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -26756,10 +26774,15 @@ ToolbarContent = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
26756
26774
 
26757
26775
 
26758
26776
 
26759
- class ToolbarSelect extends _button__WEBPACK_IMPORTED_MODULE_4__.ToolbarButton {
26777
+
26778
+ class ToolbarSelect extends _button__WEBPACK_IMPORTED_MODULE_5__.ToolbarButton {
26760
26779
  className() {
26761
26780
  return 'ToolbarSelect';
26762
26781
  }
26782
+ // It shows its value, rather than being on or off
26783
+ get isToggle() {
26784
+ return false;
26785
+ }
26763
26786
  update() {
26764
26787
  super.update();
26765
26788
  this.state.icon.name = '';
@@ -26774,6 +26797,17 @@ class ToolbarSelect extends _button__WEBPACK_IMPORTED_MODULE_4__.ToolbarButton {
26774
26797
  this.state.text = this.control.textTemplate?.(this.jodit, text) ?? text;
26775
26798
  }
26776
26799
  }
26800
+ /**
26801
+ * The button shows only the value, so its name says which control it
26802
+ * is too: "Font size, 16px"
26803
+ */ updateAriaLabel() {
26804
+ super.updateAriaLabel();
26805
+ const { tooltip } = this.state;
26806
+ const value = this.text.textContent?.trim();
26807
+ if (tooltip && value) {
26808
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(this.button, 'aria-label', `${this.jodit.i18n(tooltip)}, ${value}`);
26809
+ }
26810
+ }
26777
26811
  }
26778
26812
  ToolbarSelect = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__._)([
26779
26813
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.component
@@ -27109,7 +27143,9 @@ ToolbarEditorCollection = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1
27109
27143
  }
27110
27144
  function makeSelect(view, control, target = null) {
27111
27145
  const ToolbarSelect = (0,jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_0__.getComponentClass)('ToolbarSelect');
27112
- return new ToolbarSelect(view, control, target);
27146
+ const select = new ToolbarSelect(view, control, target);
27147
+ select.state.tabIndex = view.o.allowTabNavigation ? 0 : -1;
27148
+ return select;
27113
27149
  }
27114
27150
 
27115
27151
 
@@ -28036,11 +28072,12 @@ class Uploader extends jodit_core_component___WEBPACK_IMPORTED_MODULE_1__.ViewCo
28036
28072
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
28037
28073
 
28038
28074
  "use strict";
28039
- /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27795);
28040
- /* harmony import */ var jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65946);
28041
- /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4099);
28042
- /* harmony import */ var _palette_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(54522);
28043
- /* harmony import */ var _palette_svg__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_palette_svg__WEBPACK_IMPORTED_MODULE_3__);
28075
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
28076
+ /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27795);
28077
+ /* harmony import */ var jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65946);
28078
+ /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4099);
28079
+ /* harmony import */ var _palette_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(54522);
28080
+ /* harmony import */ var _palette_svg__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_palette_svg__WEBPACK_IMPORTED_MODULE_4__);
28044
28081
  /*!
28045
28082
  * Jodit Editor (https://xdsoft.net/jodit/)
28046
28083
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -28054,7 +28091,8 @@ class Uploader extends jodit_core_component___WEBPACK_IMPORTED_MODULE_1__.ViewCo
28054
28091
 
28055
28092
 
28056
28093
 
28057
- jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WEBPACK_IMPORTED_MODULE_3___default()));
28094
+
28095
+ jodit_core_ui__WEBPACK_IMPORTED_MODULE_3__.Icon.set('palette', (_palette_svg__WEBPACK_IMPORTED_MODULE_4___default()));
28058
28096
  /**
28059
28097
  * Build color picker
28060
28098
  *
@@ -28072,29 +28110,53 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
28072
28110
  * });
28073
28111
  * ```
28074
28112
  */ const ColorPickerWidget = (editor, callback, coldColor)=>{
28075
- const cn = 'jodit-color-picker', valueHex = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.normalizeColor)(coldColor), form = editor.c.div(cn), iconPalette = editor.o.textIcons ? `<span>${editor.i18n('palette')}</span>` : jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.get('palette'), eachColor = (colors)=>{
28113
+ const cn = 'jodit-color-picker', valueHex = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.normalizeColor)(coldColor), form = editor.c.div(cn), iconPalette = editor.o.textIcons ? `<span>${editor.i18n('palette')}</span>` : jodit_core_ui__WEBPACK_IMPORTED_MODULE_3__.Icon.get('palette'), eachColor = (colors)=>{
28076
28114
  const stack = [];
28077
- if ((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(colors)) {
28115
+ if ((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.isPlainObject)(colors)) {
28078
28116
  Object.keys(colors).forEach((key)=>{
28079
28117
  stack.push(`<div class="${cn}__group ${cn}__group-${key}">`);
28080
28118
  stack.push(eachColor(colors[key]));
28081
28119
  stack.push('</div>');
28082
28120
  });
28083
- } else if ((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.isArray)(colors)) {
28121
+ } else if ((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.isArray)(colors)) {
28084
28122
  colors.forEach((color)=>{
28085
- stack.push(`<span class='${cn}__color-item ${valueHex === color ? cn + '__color-item_active_true' : ''}' title="${color}" style="background-color:${color}" data-color="${color}"></span>`);
28123
+ const active = valueHex === color;
28124
+ stack.push(`<button type="button" class='${cn}__color-item ${active ? cn + '__color-item_active_true' : ''}' title="${color}" aria-pressed="${active}" tabindex="-1" style="background-color:${color}" data-color="${color}"></button>`);
28086
28125
  });
28087
28126
  }
28088
28127
  return stack.join('');
28089
28128
  };
28090
28129
  // The group wrapper lays the colors out in rows, so a flat list needs one
28091
28130
  // too. See #1487
28092
- const groups = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.isArray)(editor.o.colors) ? `<div class="${cn}__group">${eachColor(editor.o.colors)}</div>` : eachColor(editor.o.colors);
28093
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(form, editor.c.fromHTML(`<div class="${cn}__groups">${groups}</div>`));
28094
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(form, editor.c.fromHTML(`<div data-ref="extra" class="${cn}__extra"></div>`));
28095
- const { extra } = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.refs)(form);
28096
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(extra, editor.c.fromHTML(`<div class="${cn}__hex"><input data-ref="hexInput" type="text" spellcheck="false" aria-label="HEX" placeholder="#FF0000" value="${valueHex || ''}"/></div>`));
28097
- const { hexInput } = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.refs)(form);
28131
+ const groups = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.isArray)(editor.o.colors) ? `<div class="${cn}__group">${eachColor(editor.o.colors)}</div>` : eachColor(editor.o.colors);
28132
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(form, editor.c.fromHTML(`<div class="${cn}__groups">${groups}</div>`));
28133
+ const items = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.toArray)(form.querySelectorAll(`.${cn}__color-item`));
28134
+ // Tab stops at one color, the current one or the first, and the arrow
28135
+ // keys move from it
28136
+ const tabStop = items.find((item)=>(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.attr)(item, 'aria-pressed') === 'true') ?? items[0];
28137
+ if (tabStop) {
28138
+ (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.attr)(tabStop, 'tabindex', 0);
28139
+ }
28140
+ // Along a row, or to the nearest color in the row above or below, as the
28141
+ // palette is laid out
28142
+ const nextItem = (item, key)=>{
28143
+ const index = items.indexOf(item);
28144
+ if (key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_LEFT || key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_RIGHT) {
28145
+ const step = key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_LEFT ? -1 : 1;
28146
+ const rtl = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.css)(item, 'direction') === 'rtl';
28147
+ return items[index + (rtl ? -step : step)];
28148
+ }
28149
+ const down = key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN, rows = items.filter((other)=>down ? other.offsetTop > item.offsetTop : other.offsetTop < item.offsetTop);
28150
+ if (!rows.length) {
28151
+ return;
28152
+ }
28153
+ const top = (down ? Math.min : Math.max)(...rows.map((other)=>other.offsetTop)), distance = (other)=>Math.abs(other.offsetLeft - item.offsetLeft);
28154
+ return rows.filter((other)=>other.offsetTop === top).reduce((nearest, other)=>distance(other) < distance(nearest) ? other : nearest);
28155
+ };
28156
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(form, editor.c.fromHTML(`<div data-ref="extra" class="${cn}__extra"></div>`));
28157
+ const { extra } = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.refs)(form);
28158
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(extra, editor.c.fromHTML(`<div class="${cn}__hex"><input data-ref="hexInput" type="text" spellcheck="false" aria-label="HEX" placeholder="#FF0000" value="${valueHex || ''}"/></div>`));
28159
+ const { hexInput } = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.refs)(form);
28098
28160
  // Enter applies the value and closes the popup; removing the focused
28099
28161
  // input then makes Chrome fire `change` on it, which would apply the
28100
28162
  // same color a second time and toggle it off again. See #1459
@@ -28109,8 +28171,8 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
28109
28171
  if (!isHex && !isRgb) {
28110
28172
  return;
28111
28173
  }
28112
- const color = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.normalizeColor)(isHex && !raw.startsWith('#') ? '#' + raw : raw);
28113
- if (color && (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.isFunction)(callback)) {
28174
+ const color = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.normalizeColor)(isHex && !raw.startsWith('#') ? '#' + raw : raw);
28175
+ if (color && (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.isFunction)(callback)) {
28114
28176
  appliedHexValue = raw;
28115
28177
  callback(color);
28116
28178
  }
@@ -28125,40 +28187,74 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
28125
28187
  e.stopPropagation();
28126
28188
  applyHexInput();
28127
28189
  });
28128
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(extra, editor.c.fromHTML(`<span class="${cn}__remove" data-color="" title="${editor.i18n('Remove')}">${editor.o.textIcons ? editor.i18n('Remove') : jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.get('eraser')}</span>`));
28129
- if (editor.o.showBrowserColorPicker && (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.hasBrowserColorPicker)()) {
28130
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(extra, editor.c.fromHTML(`<div class="${cn}__native">${iconPalette}<input type="color" value="#ffffff"/></div>`));
28190
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(extra, editor.c.fromHTML(`<button type="button" class="${cn}__remove" data-color="" title="${editor.i18n('Remove')}">${editor.o.textIcons ? editor.i18n('Remove') : jodit_core_ui__WEBPACK_IMPORTED_MODULE_3__.Icon.get('eraser')}</button>`));
28191
+ if (editor.o.showBrowserColorPicker && (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.hasBrowserColorPicker)()) {
28192
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(extra, editor.c.fromHTML(`<div class="${cn}__native">${iconPalette}<input type="color" value="#ffffff"/></div>`));
28131
28193
  editor.e.on(form, 'change', (e)=>{
28132
28194
  e.stopPropagation();
28133
28195
  const target = e.target;
28134
- if (!target || !target.tagName || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(target, 'input') || target.type !== 'color') {
28196
+ if (!target || !target.tagName || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(target, 'input') || target.type !== 'color') {
28135
28197
  return;
28136
28198
  }
28137
28199
  const color = target.value || '';
28138
- if ((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.isFunction)(callback)) {
28200
+ if ((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.isFunction)(callback)) {
28139
28201
  callback(color);
28140
28202
  }
28141
28203
  e.preventDefault();
28142
28204
  });
28143
28205
  }
28206
+ // The color of a swatch, or '' for Remove, from an event on it or its icon
28207
+ const colorOf = (node)=>{
28208
+ const button = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(node, (elm)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isHTMLElement(elm) && (elm.classList.contains(cn + '__color-item') || elm.classList.contains(cn + '__remove')), form);
28209
+ return button ? (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.attr)(button, '-color') || '' : undefined;
28210
+ };
28211
+ const apply = (color)=>{
28212
+ if (callback && (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.isFunction)(callback)) {
28213
+ callback(color);
28214
+ }
28215
+ };
28216
+ // A pointer applies the color on `mousedown`, which keeps the selection.
28217
+ // The keyboard and screen readers press the button, which sends only
28218
+ // `click`, so a click after the pointer's `mousedown` is skipped
28219
+ let pointerPressed = false;
28144
28220
  editor.e.on(form, 'mousedown touchend', (e)=>{
28145
28221
  // let the hex/native inputs receive focus and clicks
28146
- if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(e.target, 'input')) {
28222
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(e.target, 'input')) {
28147
28223
  e.stopPropagation();
28148
28224
  return;
28149
28225
  }
28150
28226
  e.stopPropagation();
28151
28227
  e.preventDefault();
28152
- let target = e.target;
28153
- if ((!target || !target.tagName || jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(target, 'svg') || jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(target, 'path')) && target.parentNode) {
28154
- target = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(target.parentNode, 'span', editor.editor);
28228
+ const color = colorOf(e.target);
28229
+ if (color !== undefined) {
28230
+ pointerPressed = e.type === 'mousedown';
28231
+ apply(color);
28155
28232
  }
28156
- if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(target, 'span') || !target.classList.contains(cn + '__color-item') && !target.classList.contains(cn + '__remove')) {
28233
+ });
28234
+ editor.e.on(form, 'click', (e)=>{
28235
+ const color = colorOf(e.target);
28236
+ if (color !== undefined && !pointerPressed) {
28237
+ apply(color);
28238
+ }
28239
+ pointerPressed = false;
28240
+ }).on(form, 'keydown', (e)=>{
28241
+ pointerPressed = false;
28242
+ const item = e.target;
28243
+ if (!items.includes(item) || ![
28244
+ jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_LEFT,
28245
+ jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_RIGHT,
28246
+ jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP,
28247
+ jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN
28248
+ ].includes(e.key)) {
28157
28249
  return;
28158
28250
  }
28159
- const color = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.attr)(target, '-color') || '';
28160
- if (callback && (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__.isFunction)(callback)) {
28161
- callback(color);
28251
+ // The toolbar's dropdown would walk every color one by one
28252
+ e.preventDefault();
28253
+ e.stopPropagation();
28254
+ nextItem(item, e.key)?.focus();
28255
+ }).on(form, 'focusin', (e)=>{
28256
+ if (items.includes(e.target)) {
28257
+ items.forEach((item)=>(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.attr)(item, 'tabindex', item === e.target ? 0 : -1));
28162
28258
  }
28163
28259
  });
28164
28260
  editor.e.fire('afterGenerateColorPicker', form, extra, callback, valueHex);
@@ -29321,7 +29417,8 @@ UiAiAssistant = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
29321
29417
  /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(91206);
29322
29418
  /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(59400);
29323
29419
  /* harmony import */ var jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(5658);
29324
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(95085);
29420
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(29434);
29421
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(95085);
29325
29422
  /*!
29326
29423
  * Jodit Editor (https://xdsoft.net/jodit/)
29327
29424
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -29341,14 +29438,21 @@ UiAiAssistant = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
29341
29438
 
29342
29439
 
29343
29440
 
29344
- const ICON = "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e88e5' stroke-width='2.5' stroke-linejoin='round'%3E%3Cpath d='M6 3h12v18l-6-4-6 4z'/%3E%3C/svg%3E\")";
29345
- const MARKER = [
29346
- 'id',
29347
- 'name'
29348
- ].map((key)=>`.jodit-wysiwyg a[${key}]:not([href]):empty::before`).join(',');
29441
+
29442
+ /**
29443
+ * The editing area of an editor with the plugin, when it shares its document
29444
+ * with the page and so with any other editor on it
29445
+ */ const WITH_ANCHORS = 'jodit-wysiwyg_anchors';
29349
29446
  /**
29350
- * Each anchor's marker, in the editing area only
29351
- */ const MARKER_STYLE = `${MARKER}{display:inline-block;width:.75em;height:1em;margin:0 .1em;vertical-align:-.15em;background:${ICON} center/contain no-repeat;cursor:pointer;content:''}`;
29447
+ * Each anchor's marker, in the editing areas `scope` picks out
29448
+ */ function markerStyle(scope) {
29449
+ const marker = [
29450
+ 'id',
29451
+ 'name'
29452
+ ].map((key)=>`.jodit-wysiwyg${scope} a[${key}]:not([href]):empty::before`).join(',');
29453
+ const icon = `url("data:image/svg+xml,${encodeURIComponent(jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__.Icon.get('anchor'))}") center/contain no-repeat`;
29454
+ return `${marker}{display:inline-block;width:.75em;height:1em;margin:0 .1em;vertical-align:-.15em;background-color:var(--jd-color-icon,#4c4c4c);-webkit-mask:${icon};mask:${icon};cursor:pointer;content:''}`;
29455
+ }
29352
29456
  /**
29353
29457
  * The attribute `markAnchor` gives an anchor: an empty `<a>` with no `href`
29354
29458
  */ const MARK = ' contenteditable="false"';
@@ -29357,8 +29461,14 @@ const MARKER = [
29357
29461
  * `#name`, and renames and removes them
29358
29462
  */ class anchor extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin {
29359
29463
  /** @override */ afterInit(jodit) {
29464
+ // An iframe's document is the editor's alone, and its body is part of
29465
+ // the value with `editHTMLDocumentMode`, so it gets no class
29466
+ const shared = jodit.ed === jodit.od;
29467
+ if (shared) {
29468
+ jodit.editor.classList.add(WITH_ANCHORS);
29469
+ }
29360
29470
  // It goes in the editing document, so iframe mode has it whatever `iframeStyle` holds
29361
- (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.getContainer)(jodit, 'anchor', 'style', true).textContent = MARKER_STYLE;
29471
+ ;(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.getContainer)(jodit, 'anchor', 'style', true).textContent = markerStyle(shared ? '.' + WITH_ANCHORS : '');
29362
29472
  jodit.e.on('generateAnchorForm.anchor', this.__generateForm).on('clickA touchstartA', this.__onClickA, {
29363
29473
  top: true
29364
29474
  });
@@ -29390,6 +29500,24 @@ const MARKER = [
29390
29500
  */ onAfterGetValueFromEditor(data) {
29391
29501
  data.value = unmarkAnchors(data.value);
29392
29502
  }
29503
+ /**
29504
+ * A pasted or dropped copy of an anchor the document already has gets the
29505
+ * next free name, as `fees-2`, and the links that came with it follow it
29506
+ */ onBeforePasteInsert(html) {
29507
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isElement(html) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isFragment(html)) {
29508
+ this.__renameCopies(html);
29509
+ return;
29510
+ }
29511
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.isString)(html) || !/<a\s/i.test(html)) {
29512
+ return;
29513
+ }
29514
+ // Inert, so nothing in it loads
29515
+ const template = this.j.createInside.element('template');
29516
+ template.innerHTML = html;
29517
+ if (this.__renameCopies(template.content)) {
29518
+ return template.innerHTML;
29519
+ }
29520
+ }
29393
29521
  /**
29394
29522
  * The form that names a new anchor, or renames or removes `target`
29395
29523
  */ __generateForm(target, close) {
@@ -29529,8 +29657,51 @@ const MARKER = [
29529
29657
  }
29530
29658
  });
29531
29659
  }
29660
+ /**
29661
+ * Gives each anchor in `root` whose name the document already has the
29662
+ * next free one, avoiding the names in `root` too, and points the links
29663
+ * in `root` to it at the new name. Whether any was renamed
29664
+ */ __renameCopies(root) {
29665
+ const inRoot = new Set((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.toArray)(root.querySelectorAll('[id], a[name]')).map((elm)=>elm.id || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(elm, 'name')));
29666
+ const renamed = new Map();
29667
+ const anchors = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.isAnchor)(root) ? [
29668
+ root
29669
+ ] : (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getAnchors)(root);
29670
+ anchors.forEach((anchor)=>{
29671
+ const name = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getAnchorName)(anchor);
29672
+ if (!this.__isTaken(name, null)) {
29673
+ return;
29674
+ }
29675
+ let copy = name;
29676
+ for(let n = 2; inRoot.has(copy) || this.__isTaken(copy, null); n += 1){
29677
+ copy = `${name}-${n}`;
29678
+ }
29679
+ [
29680
+ 'id',
29681
+ 'name'
29682
+ ].forEach((key)=>{
29683
+ if (anchor.hasAttribute(key)) {
29684
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(anchor, key, copy);
29685
+ }
29686
+ });
29687
+ inRoot.add(copy);
29688
+ renamed.set(name, copy);
29689
+ });
29690
+ if (!renamed.size) {
29691
+ return false;
29692
+ }
29693
+ ;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.toArray)(root.querySelectorAll('a[href]')).forEach((link)=>{
29694
+ const href = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(link, 'href') ?? '';
29695
+ const copy = href[0] === '#' && renamed.get(href.slice(1));
29696
+ if (copy) {
29697
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(link, 'href', '#' + copy);
29698
+ }
29699
+ });
29700
+ return true;
29701
+ }
29532
29702
  /** @override */ beforeDestruct(jodit) {
29533
29703
  this.__dropForm();
29704
+ jodit.editor.classList.remove(WITH_ANCHORS);
29534
29705
  jodit.e.off('generateAnchorForm.anchor', this.__generateForm).off('clickA touchstartA', this.__onClickA);
29535
29706
  }
29536
29707
  constructor(...args){
@@ -29560,6 +29731,9 @@ const MARKER = [
29560
29731
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
29561
29732
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':afterGetValueFromEditor')
29562
29733
  ], anchor.prototype, "onAfterGetValueFromEditor", null);
29734
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
29735
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':beforePasteInsert')
29736
+ ], anchor.prototype, "onBeforePasteInsert", null);
29563
29737
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
29564
29738
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
29565
29739
  ], anchor.prototype, "__generateForm", null);
@@ -30293,7 +30467,7 @@ function moveContentAndRemoveEmpty(jodit, mainClosestBox, sibling, backspace) {
30293
30467
  * @private
30294
30468
  */ function checkNotCollapsed(jodit) {
30295
30469
  if (!jodit.s.isCollapsed()) {
30296
- jodit.execCommand('Delete');
30470
+ jodit.execCommand('delete', false, true);
30297
30471
  return true;
30298
30472
  }
30299
30473
  return false;
@@ -33409,6 +33583,13 @@ const KEEPS_SPACES = new Set([
33409
33583
  'pre-wrap',
33410
33584
  'break-spaces'
33411
33585
  ]);
33586
+ /**
33587
+ * Formatting that the next letter keeps once all of the text in it is
33588
+ * deleted with a key: a formatting tag, or a span with styles of its own.
33589
+ * Not a link, which new text isn't added to, or a wrapper such as a video's
33590
+ */ function keepsFormat(node) {
33591
+ return jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isHTMLElement(node) && !node.hasAttribute('contenteditable') && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isTemporary(node) && (/^(STRONG|B|EM|I|U|S|SUB|SUP)$/.test(node.nodeName) || jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(node, 'span') && node.hasAttribute('style'));
33592
+ }
33412
33593
  /**
33413
33594
  * A plain space beside this neighbor isn't shown: there is none, or it's a
33414
33595
  * line break, a block or text starting (or ending) with a plain space
@@ -33456,7 +33637,7 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugi
33456
33637
  jodit.s.removeNode(node);
33457
33638
  }
33458
33639
  }
33459
- __onDeleteCommand() {
33640
+ __onDeleteCommand(command, showUI, keepFormat) {
33460
33641
  const { jodit } = this;
33461
33642
  if (jodit.s.isCollapsed()) {
33462
33643
  return;
@@ -33464,6 +33645,7 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugi
33464
33645
  jodit.s.expandSelection();
33465
33646
  const range = jodit.s.range;
33466
33647
  this.__moveEdgesIntoCells(range);
33648
+ const format = keepFormat === true ? this.__formatTakenWhole(range) : [];
33467
33649
  const caret = this.__clearSelectedCells(range);
33468
33650
  if (caret && range.collapsed) {
33469
33651
  jodit.s.selectRange(caret);
@@ -33479,8 +33661,12 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugi
33479
33661
  this.__keepSpacesVisibleBesideTable(fake);
33480
33662
  range.setStartBefore(fake);
33481
33663
  range.collapse(true);
33482
- this.__moveCursorInEditableSibling(jodit, leftSibling, fake, range);
33483
- this.__addBrInEmptyBlock(fake, range);
33664
+ if (format.length && !caret) {
33665
+ this.__keepFormat(format, fake, range);
33666
+ } else {
33667
+ this.__moveCursorInEditableSibling(jodit, leftSibling, fake, range);
33668
+ this.__addBrInEmptyBlock(fake, range);
33669
+ }
33484
33670
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.safeRemove(fake);
33485
33671
  jodit.s.selectRange(caret ?? range);
33486
33672
  return false;
@@ -33501,6 +33687,45 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugi
33501
33687
  range.setEnd(last, last.childNodes.length);
33502
33688
  }
33503
33689
  }
33690
+ /**
33691
+ * The formatting elements the deletion takes whole from its start,
33692
+ * outermost first: `<strong>` and `<em>` for all of the text in
33693
+ * `<strong><em>cd</em></strong>`
33694
+ */ __formatTakenWhole(range) {
33695
+ const format = [];
33696
+ const whole = this.jodit.s.createRange();
33697
+ const { startContainer, startOffset } = range;
33698
+ let node = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(startContainer) ? null : startContainer.childNodes[startOffset];
33699
+ // Through a block taken whole, as a line holding only the word is
33700
+ while(jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isHTMLElement(node)){
33701
+ whole.selectNode(node);
33702
+ if (range.compareBoundaryPoints(Range.END_TO_END, whole) < 0) {
33703
+ break;
33704
+ }
33705
+ if (keepsFormat(node)) {
33706
+ format.push(node);
33707
+ } else if (format.length || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isBlock(node)) {
33708
+ break;
33709
+ }
33710
+ node = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.toArray)(node.childNodes).find((child)=>!jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(child) || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.trimInv)(child.nodeValue ?? ''));
33711
+ }
33712
+ return format;
33713
+ }
33714
+ /**
33715
+ * As the browsers do, the next letter typed keeps the formatting that was
33716
+ * deleted whole: empty copies go where it was, round an invisible space,
33717
+ * as Bold does at a collapsed caret, and the caret goes inside (#1784)
33718
+ */ __keepFormat(format, fake, range) {
33719
+ const copies = format.map((element)=>element.cloneNode(false));
33720
+ for(let i = 1; i < copies.length; i += 1){
33721
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.append(copies[i - 1], copies[i]);
33722
+ }
33723
+ const text = this.jodit.createInside.text(jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.INVISIBLE_SPACE);
33724
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.append(copies[copies.length - 1], text);
33725
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.before(fake, copies[0]);
33726
+ range.setStartAfter(text);
33727
+ range.collapse(true);
33728
+ }
33504
33729
  /**
33505
33730
  * A selection that starts or ends in a table cell clears the selected part
33506
33731
  * of each cell it covers and keeps the cells, as the browsers do.
@@ -34243,7 +34468,13 @@ const brBoxes = new Set([
34243
34468
  // text; moving it before the `<br>` would put it on a line of its own
34244
34469
  // below the block (#1315)
34245
34470
  if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isOrContains(node, jodit.s.range.startContainer)) {
34246
- jodit.s.setCursorBefore(br);
34471
+ // Not with setCursorBefore: the text node it adds for the caret
34472
+ // stays after the inserted element once the `<br>` has gone, and
34473
+ // Right or End then take the caret into it, out of the element
34474
+ const range = jodit.s.createRange();
34475
+ range.setStartBefore(br);
34476
+ range.collapse(true);
34477
+ jodit.s.selectRange(range);
34247
34478
  }
34248
34479
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(br);
34249
34480
  }
@@ -36218,6 +36449,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.fullsize = {
36218
36449
  exec: (editor)=>{
36219
36450
  editor.toggleFullSize();
36220
36451
  },
36452
+ // Makes it a toggle. `update` sets the state, which holds while the editor doesn't have the focus
36453
+ isActive: (editor)=>editor.isFullSize,
36221
36454
  update (editor, button) {
36222
36455
  const mode = editor.isFullSize ? 'shrink' : 'fullsize';
36223
36456
  button.state.activated = editor.isFullSize;
@@ -36587,9 +36820,6 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('hotkeys', hotke
36587
36820
  jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_2__.Icon.set('hr', (_hr_svg__WEBPACK_IMPORTED_MODULE_4___default()));
36588
36821
  jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.controls.hr = {
36589
36822
  command: 'insertHorizontalRule',
36590
- tags: [
36591
- 'hr'
36592
- ],
36593
36823
  tooltip: 'Insert Horizontal Line'
36594
36824
  };
36595
36825
  function hr(editor) {
@@ -41213,9 +41443,6 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.defaultLineHeight = n
41213
41443
  jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_1__.Icon.set('line-height', (_line_height_svg__WEBPACK_IMPORTED_MODULE_3___default()));
41214
41444
  jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.lineHeight = {
41215
41445
  command: 'applyLineHeight',
41216
- tags: [
41217
- 'ol'
41218
- ],
41219
41446
  tooltip: 'Line height',
41220
41447
  list: [
41221
41448
  1,
@@ -43833,10 +44060,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.useInputsPlaceholder
43833
44060
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23211);
43834
44061
  /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28077);
43835
44062
  /* harmony import */ var jodit_core_helpers_checker_is_marker__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(23175);
43836
- /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7909);
43837
- /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
43838
- /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(18855);
43839
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(8257);
44063
+ /* harmony import */ var jodit_core_helpers_utils_anchor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(85371);
44064
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7909);
44065
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(80991);
44066
+ /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(18855);
44067
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(8257);
43840
44068
  /*!
43841
44069
  * Jodit Editor (https://xdsoft.net/jodit/)
43842
44070
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -43858,6 +44086,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.useInputsPlaceholder
43858
44086
 
43859
44087
 
43860
44088
 
44089
+
43861
44090
  /**
43862
44091
  * Check if root node is empty
43863
44092
  * @private
@@ -43882,18 +44111,19 @@ function isBlank(root) {
43882
44111
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isText(first) && !next) {
43883
44112
  return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isEmptyTextNode(first);
43884
44113
  }
43885
- return !next && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.each(first, (elm)=>!(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isLeaf(elm) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isList(elm)) && (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isEmpty(elm) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(elm, 'br')));
44114
+ // An anchor has no text, but it's content, shown as a marker
44115
+ return !next && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.each(first, (elm)=>!(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isLeaf(elm) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isList(elm) || (0,jodit_core_helpers_utils_anchor__WEBPACK_IMPORTED_MODULE_7__.isAnchor)(elm)) && (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isEmpty(elm) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(elm, 'br')));
43886
44116
  }
43887
44117
  /**
43888
44118
  * Show placeholder inside empty editor
43889
- */ class placeholder extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_9__.Plugin {
44119
+ */ class placeholder extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_10__.Plugin {
43890
44120
  afterInit(editor) {
43891
44121
  if (!editor.o.showPlaceholder) {
43892
44122
  return;
43893
44123
  }
43894
44124
  this.placeholderElm = editor.c.fromHTML(`<span data-ref="placeholder" style="display: none;" class="jodit-placeholder">${editor.i18n(editor.o.placeholder)}</span>`);
43895
44125
  if (editor.o.direction === 'rtl') {
43896
- (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.placeholderElm, {
44126
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_9__.css)(this.placeholderElm, {
43897
44127
  right: 0,
43898
44128
  direction: 'rtl'
43899
44129
  });
@@ -43922,19 +44152,19 @@ function isBlank(root) {
43922
44152
  const style2 = editor.ew.getComputedStyle(firstChild);
43923
44153
  marginTop = parseInt(style2.getPropertyValue('margin-top'), 10);
43924
44154
  marginLeft = parseInt(style2.getPropertyValue('margin-left'), 10);
43925
- (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.placeholderElm, {
44155
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_9__.css)(this.placeholderElm, {
43926
44156
  fontFamily: style2.getPropertyValue('font-family'),
43927
44157
  fontSize: parseInt(style2.getPropertyValue('font-size'), 10),
43928
44158
  lineHeight: style2.getPropertyValue('line-height')
43929
44159
  });
43930
44160
  } else {
43931
- (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.placeholderElm, {
44161
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_9__.css)(this.placeholderElm, {
43932
44162
  fontFamily: style.getPropertyValue('font-family'),
43933
44163
  fontSize: parseInt(style.getPropertyValue('font-size'), 10),
43934
44164
  lineHeight: style.getPropertyValue('line-height')
43935
44165
  });
43936
44166
  }
43937
- ;(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.placeholderElm, {
44167
+ ;(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_9__.css)(this.placeholderElm, {
43938
44168
  display: 'block',
43939
44169
  textAlign: style.getPropertyValue('text-align'),
43940
44170
  paddingTop: parseInt(styleEditor.paddingTop, 10) + 'px',
@@ -43972,7 +44202,7 @@ function isBlank(root) {
43972
44202
  }), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "addEvents", ()=>{
43973
44203
  const editor = this.j;
43974
44204
  if (editor.o.useInputsPlaceholder && editor.element.hasAttribute('placeholder')) {
43975
- this.placeholderElm.innerHTML = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(editor.element, 'placeholder') || '';
44205
+ this.placeholderElm.innerHTML = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_8__.attr)(editor.element, 'placeholder') || '';
43976
44206
  }
43977
44207
  editor.e.fire('placeholder', this.placeholderElm.innerHTML);
43978
44208
  editor.e.off('.placeholder').on('changePlace.placeholder', this.addNativeListeners).on('change.placeholder focus.placeholder keyup.placeholder mouseup.placeholder keydown.placeholder ' + 'mousedown.placeholder afterSetMode.placeholder changePlace.placeholder ' + 'internalChange.placeholder afterCommand.placeholder resize.placeholder', this.toggle).on(window, 'load', this.toggle);