jodit 4.17.6 → 4.18.1

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 (102) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/es2015/jodit.css +87 -3
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +8 -8
  5. package/es2015/jodit.js +808 -132
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +16 -16
  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 +8 -8
  16. package/es2018/jodit.min.css +1 -1
  17. package/es2018/jodit.min.js +8 -8
  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 +87 -3
  21. package/es2021/jodit.fat.min.css +1 -1
  22. package/es2021/jodit.fat.min.js +14 -14
  23. package/es2021/jodit.js +788 -132
  24. package/es2021/jodit.min.css +1 -1
  25. package/es2021/jodit.min.js +14 -14
  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 +87 -3
  33. package/es2021.en/jodit.fat.min.css +1 -1
  34. package/es2021.en/jodit.fat.min.js +26 -26
  35. package/es2021.en/jodit.js +788 -132
  36. package/es2021.en/jodit.min.css +1 -1
  37. package/es2021.en/jodit.min.js +12 -12
  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 +92 -6
  45. package/es5/jodit.fat.min.css +1 -1
  46. package/es5/jodit.fat.min.js +2 -2
  47. package/es5/jodit.js +1073 -192
  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/config.d.ts +65 -2
  60. package/esm/config.js +29 -2
  61. package/esm/core/constants.js +1 -1
  62. package/esm/core/helpers/utils/align.d.ts +11 -5
  63. package/esm/core/helpers/utils/align.js +28 -8
  64. package/esm/core/helpers/utils/index.d.ts +1 -0
  65. package/esm/core/helpers/utils/index.js +1 -0
  66. package/esm/core/helpers/utils/media-wrapper.d.ts +29 -0
  67. package/esm/core/helpers/utils/media-wrapper.js +63 -0
  68. package/esm/core/selection/selection.js +3 -3
  69. package/esm/modules/toolbar/button/button.d.ts +18 -0
  70. package/esm/modules/toolbar/button/button.js +75 -5
  71. package/esm/plugins/dtd/after-insert/remove-extra-br.js +6 -1
  72. package/esm/plugins/dtd/before-insert/check-block-nesting.js +16 -1
  73. package/esm/plugins/dtd/config.js +3 -0
  74. package/esm/plugins/font/config.d.ts +12 -0
  75. package/esm/plugins/font/config.js +25 -10
  76. package/esm/plugins/font/font-picker.d.ts +51 -0
  77. package/esm/plugins/font/font-picker.js +238 -0
  78. package/esm/plugins/font/font.js +12 -0
  79. package/esm/plugins/font/google-fonts.d.ts +65 -0
  80. package/esm/plugins/font/google-fonts.js +143 -0
  81. package/esm/plugins/image-properties/readers/index.js +2 -1
  82. package/esm/plugins/image-properties/writers/index.js +2 -2
  83. package/esm/plugins/inline-popup/config/items/img.js +10 -8
  84. package/esm/plugins/inline-popup/inline-popup.js +13 -6
  85. package/esm/plugins/media/config.d.ts +26 -1
  86. package/esm/plugins/media/config.js +1 -3
  87. package/esm/plugins/media/media.js +12 -4
  88. package/esm/plugins/video/config.js +24 -4
  89. package/esm/types/toolbar.d.ts +2 -0
  90. package/esm/types/types.d.ts +13 -1
  91. package/package.json +1 -1
  92. package/types/config.d.ts +65 -2
  93. package/types/core/helpers/utils/align.d.ts +11 -5
  94. package/types/core/helpers/utils/index.d.ts +1 -0
  95. package/types/core/helpers/utils/media-wrapper.d.ts +29 -0
  96. package/types/modules/toolbar/button/button.d.ts +18 -0
  97. package/types/plugins/font/config.d.ts +12 -0
  98. package/types/plugins/font/font-picker.d.ts +51 -0
  99. package/types/plugins/font/google-fonts.d.ts +65 -0
  100. package/types/plugins/media/config.d.ts +26 -1
  101. package/types/types/toolbar.d.ts +2 -0
  102. package/types/types/types.d.ts +13 -1
@@ -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.17.6
4
+ * Version: v4.18.1
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -735,18 +735,43 @@ let ConfigPrototype = {};
735
735
  /**
736
736
  * Class names to align images with, instead of an inline `float` or
737
737
  * `margin`. Aligning an image removes every class listed here and adds the
738
- * chosen alignment's, which can be several separated by spaces.
738
+ * chosen alignment's, which can be several separated by spaces. An
739
+ * alignment can also list several such sets, to recognise each of them;
740
+ * aligning writes the first. `alignClasses.img` takes its place when set.
739
741
  *
740
742
  * ```javascript
741
743
  * Jodit.make('#editor', {
742
744
  * imageAlignClasses: {
743
745
  * left: 'align-left',
744
746
  * right: 'align-right',
745
- * center: 'align-center'
747
+ * center: ['align-center', 'centered']
746
748
  * }
747
749
  * });
748
750
  * ```
749
751
  */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "imageAlignClasses", null);
752
+ /**
753
+ * Class names to align elements with, by tag name, as `imageAlignClasses`
754
+ * does for images: `img`, and `video`, `audio` and `iframe` in the media
755
+ * popup. A media wrapper (see `mediaWrappers`), and Jodit's own `jodit` and
756
+ * `jodit-media` wrappers, are aligned with the classes for the media in
757
+ * them.
758
+ *
759
+ * ```javascript
760
+ * const media = {
761
+ * left: 'media-left',
762
+ * right: 'media-right',
763
+ * center: 'media-center'
764
+ * };
765
+ *
766
+ * Jodit.make('#editor', {
767
+ * alignClasses: { video: media, iframe: media }
768
+ * });
769
+ * ```
770
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "alignClasses", {});
771
+ /**
772
+ * Alignment given to the media the video popup inserts. `'normal'` leaves
773
+ * them unaligned
774
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "mediaDefaultAlign", 'normal');
750
775
  /**
751
776
  * Do not display these buttons that are on the list
752
777
  *
@@ -1799,7 +1824,7 @@ __webpack_require__.r(__webpack_exports__);
1799
1824
  * ```
1800
1825
  * @packageDocumentation
1801
1826
  * @module constants
1802
- */ const APP_VERSION = "4.17.6";
1827
+ */ const APP_VERSION = "4.18.1";
1803
1828
  // prettier-ignore
1804
1829
  const ES = "es2021";
1805
1830
  const IS_ES_MODERN = true;
@@ -7576,12 +7601,15 @@ function trimChars(value, chars) {
7576
7601
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7577
7602
  /* harmony export */ alignElement: function() { return /* binding */ alignElement; },
7578
7603
  /* harmony export */ clearAlign: function() { return /* binding */ clearAlign; },
7604
+ /* harmony export */ getAlignClasses: function() { return /* binding */ getAlignClasses; },
7579
7605
  /* harmony export */ getHAlign: function() { return /* binding */ getHAlign; },
7580
7606
  /* harmony export */ hAlignElement: function() { return /* binding */ hAlignElement; }
7581
7607
  /* harmony export */ });
7582
7608
  /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27795);
7583
- /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7909);
7584
- /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80991);
7609
+ /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17312);
7610
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7909);
7611
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80991);
7612
+ /* harmony import */ var jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(83314);
7585
7613
  /*!
7586
7614
  * Jodit Editor (https://xdsoft.net/jodit/)
7587
7615
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -7591,31 +7619,51 @@ function trimChars(value, chars) {
7591
7619
  */
7592
7620
 
7593
7621
 
7594
- const classNames = (value)=>(value ?? '').split(/\s+/).filter(Boolean);
7622
+
7623
+
7624
+ // The sets of class names an alignment lists, the first being the one to write
7625
+ const classSets = (value)=>((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_1__.isArray)(value) ? value : [
7626
+ value ?? ''
7627
+ ]).map((set)=>set.split(/\s+/).filter(Boolean)).filter((set)=>set.length);
7628
+ /**
7629
+ * The class names to align `elm` with: `alignClasses` for its tag, or for the
7630
+ * media in it when it wraps media (a `mediaWrappers` wrapper, `jodit` or
7631
+ * `jodit-media`), falling back to `imageAlignClasses` for an image
7632
+ */ function getAlignClasses(jodit, elm) {
7633
+ if (!elm) {
7634
+ return null;
7635
+ }
7636
+ const media = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(elm, new Set([
7637
+ 'jodit',
7638
+ 'jodit-media'
7639
+ ])) ? elm.firstElementChild : (0,jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_4__.getWrappedMedia)(jodit, elm);
7640
+ const tag = (media ?? elm).nodeName.toLowerCase();
7641
+ return jodit.o.alignClasses?.[tag] ?? (tag === 'img' ? jodit.o.imageAlignClasses : null);
7642
+ }
7595
7643
  /**
7596
- * Align image, with `classes` (see `imageAlignClasses`) instead of inline
7597
- * styles when they are given
7644
+ * Align image, with `classes` (see `alignClasses`) instead of inline styles
7645
+ * when they are given
7598
7646
  */ function hAlignElement(image, align, classes) {
7599
7647
  if (classes) {
7600
7648
  hAlignElement(image, 'normal');
7601
- Object.values(classes).forEach((value)=>image.classList.remove(...classNames(value)));
7602
- image.classList.add(...classNames(classes[align || 'normal']));
7649
+ Object.values(classes).forEach((value)=>classSets(value).forEach((set)=>image.classList.remove(...set)));
7650
+ image.classList.add(...classSets(classes[align || 'normal'])[0] ?? []);
7603
7651
  [
7604
7652
  'class',
7605
7653
  'style'
7606
7654
  ].forEach((name)=>{
7607
- if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, name)?.trim()) {
7608
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, name, null);
7655
+ if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(image, name)?.trim()) {
7656
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(image, name, null);
7609
7657
  }
7610
7658
  });
7611
7659
  return;
7612
7660
  }
7613
7661
  if (align && align !== 'normal') {
7614
7662
  if (align !== 'center') {
7615
- (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'float', align);
7616
- (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.clearCenterAlign)(image);
7663
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(image, 'float', align);
7664
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.clearCenterAlign)(image);
7617
7665
  } else {
7618
- (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(image, {
7666
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(image, {
7619
7667
  float: '',
7620
7668
  display: 'block',
7621
7669
  marginLeft: 'auto',
@@ -7623,13 +7671,13 @@ const classNames = (value)=>(value ?? '').split(/\s+/).filter(Boolean);
7623
7671
  });
7624
7672
  }
7625
7673
  } else {
7626
- if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'float') && [
7674
+ if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(image, 'float') && [
7627
7675
  'right',
7628
7676
  'left'
7629
- ].indexOf((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'float').toString().toLowerCase()) !== -1) {
7630
- (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'float', '');
7677
+ ].indexOf((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(image, 'float').toString().toLowerCase()) !== -1) {
7678
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(image, 'float', '');
7631
7679
  }
7632
- ;(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.clearCenterAlign)(image);
7680
+ ;(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.clearCenterAlign)(image);
7633
7681
  }
7634
7682
  }
7635
7683
  /**
@@ -7642,17 +7690,16 @@ const classNames = (value)=>(value ?? '').split(/\s+/).filter(Boolean);
7642
7690
  'center',
7643
7691
  'normal'
7644
7692
  ]){
7645
- const names = classNames(classes[align]);
7646
- if (names.length && names.every((name)=>elm.classList.contains(name))) {
7693
+ if (classSets(classes[align]).some((set)=>set.every((name)=>elm.classList.contains(name)))) {
7647
7694
  return align;
7648
7695
  }
7649
7696
  }
7650
7697
  }
7651
- const float = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.cssInline)(elm, 'float').toLowerCase();
7698
+ const float = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.cssInline)(elm, 'float').toLowerCase();
7652
7699
  if (float === 'left' || float === 'right') {
7653
7700
  return float;
7654
7701
  }
7655
- if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display') === 'block' && (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.cssInline)(elm, 'margin-left') === 'auto' && (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.cssInline)(elm, 'margin-right') === 'auto') {
7702
+ if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(elm, 'display') === 'block' && (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.cssInline)(elm, 'margin-left') === 'auto' && (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.cssInline)(elm, 'margin-right') === 'auto') {
7656
7703
  return 'center';
7657
7704
  }
7658
7705
  return 'normal';
@@ -7662,10 +7709,10 @@ const classNames = (value)=>(value ?? '').split(/\s+/).filter(Boolean);
7662
7709
  */ function clearAlign(node) {
7663
7710
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.each(node, (elm)=>{
7664
7711
  if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(elm)) {
7665
- if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.cssInline)(elm, 'textAlign')) {
7666
- (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'textAlign', '');
7667
- if (!((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(elm, 'style') || '').trim().length) {
7668
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(elm, 'style', null);
7712
+ if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.cssInline)(elm, 'textAlign')) {
7713
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(elm, 'textAlign', '');
7714
+ if (!((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'style') || '').trim().length) {
7715
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'style', null);
7669
7716
  }
7670
7717
  }
7671
7718
  }
@@ -7696,7 +7743,7 @@ function alignElement(command, box) {
7696
7743
  clearAlign(box);
7697
7744
  const align = ALIGN_BY_COMMAND.get(command.toLowerCase());
7698
7745
  if (align) {
7699
- (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(box, 'textAlign', align);
7746
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(box, 'textAlign', align);
7700
7747
  }
7701
7748
  }
7702
7749
  }
@@ -8781,13 +8828,13 @@ const getClassName = (obj)=>{
8781
8828
  "use strict";
8782
8829
  __webpack_require__.r(__webpack_exports__);
8783
8830
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8784
- /* harmony export */ $$: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_24__.$$; },
8831
+ /* harmony export */ $$: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.$$; },
8785
8832
  /* harmony export */ ConfigDeepFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigDeepFlatten; },
8786
8833
  /* harmony export */ ConfigFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigFlatten; },
8787
8834
  /* harmony export */ ConfigMerge: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigMerge; },
8788
8835
  /* harmony export */ ConfigProto: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigProto; },
8789
8836
  /* harmony export */ ConnectionError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.ConnectionError; },
8790
- /* harmony export */ LimitedStack: function() { return /* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_26__.LimitedStack; },
8837
+ /* harmony export */ LimitedStack: function() { return /* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_27__.LimitedStack; },
8791
8838
  /* harmony export */ OptionsError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.OptionsError; },
8792
8839
  /* harmony export */ UNSAFE_PROTO_KEYS: function() { return /* reexport safe */ _is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_18__.UNSAFE_PROTO_KEYS; },
8793
8840
  /* harmony export */ abort: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.abort; },
@@ -8799,58 +8846,63 @@ __webpack_require__.r(__webpack_exports__);
8799
8846
  /* harmony export */ attrRaw: function() { return /* reexport safe */ _attr__WEBPACK_IMPORTED_MODULE_3__.attrRaw; },
8800
8847
  /* harmony export */ browser: function() { return /* reexport safe */ _browser__WEBPACK_IMPORTED_MODULE_4__.browser; },
8801
8848
  /* harmony export */ buildQuery: function() { return /* reexport safe */ _build_query__WEBPACK_IMPORTED_MODULE_5__.buildQuery; },
8802
- /* harmony export */ call: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_27__.call; },
8803
- /* harmony export */ callPromise: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_27__.callPromise; },
8804
- /* harmony export */ callThis: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_27__.callThis; },
8849
+ /* harmony export */ call: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.call; },
8850
+ /* harmony export */ callPromise: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.callPromise; },
8851
+ /* harmony export */ callThis: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.callThis; },
8805
8852
  /* harmony export */ clearAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.clearAlign; },
8806
8853
  /* harmony export */ clearCenterAlign: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.clearCenterAlign; },
8807
8854
  /* harmony export */ cns: function() { return /* reexport safe */ _mark_deprecated__WEBPACK_IMPORTED_MODULE_19__.cns; },
8808
8855
  /* harmony export */ completeUrl: function() { return /* reexport safe */ _complete_url__WEBPACK_IMPORTED_MODULE_6__.completeUrl; },
8809
8856
  /* harmony export */ connection: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.connection; },
8810
8857
  /* harmony export */ convertMediaUrlToVideoEmbed: function() { return /* reexport safe */ _convert_media_url_to_video_embed__WEBPACK_IMPORTED_MODULE_8__.convertMediaUrlToVideoEmbed; },
8858
+ /* harmony export */ createMediaWrapper: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.createMediaWrapper; },
8811
8859
  /* harmony export */ css: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.css; },
8812
8860
  /* harmony export */ cssInline: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.cssInline; },
8813
- /* harmony export */ cssPath: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_24__.cssPath; },
8861
+ /* harmony export */ cssPath: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.cssPath; },
8814
8862
  /* harmony export */ ctrlKey: function() { return /* reexport safe */ _ctrl_key__WEBPACK_IMPORTED_MODULE_10__.ctrlKey; },
8815
8863
  /* harmony export */ dataBind: function() { return /* reexport safe */ _data_bind__WEBPACK_IMPORTED_MODULE_11__.dataBind; },
8816
8864
  /* harmony export */ defaultLanguage: function() { return /* reexport safe */ _default_language__WEBPACK_IMPORTED_MODULE_12__.defaultLanguage; },
8817
8865
  /* harmony export */ error: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.error; },
8818
8866
  /* harmony export */ fastClone: function() { return /* reexport safe */ _extend__WEBPACK_IMPORTED_MODULE_14__.fastClone; },
8819
8867
  /* harmony export */ get: function() { return /* reexport safe */ _get__WEBPACK_IMPORTED_MODULE_15__.get; },
8868
+ /* harmony export */ getAlignClasses: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.getAlignClasses; },
8820
8869
  /* harmony export */ getClassName: function() { return /* reexport safe */ _get_class_name__WEBPACK_IMPORTED_MODULE_16__.getClassName; },
8821
- /* harmony export */ getDataTransfer: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_27__.getDataTransfer; },
8870
+ /* harmony export */ getDataTransfer: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.getDataTransfer; },
8822
8871
  /* harmony export */ getHAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.getHAlign; },
8823
- /* harmony export */ getPropertyDescriptor: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_27__.getPropertyDescriptor; },
8824
- /* harmony export */ getXPathByElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_24__.getXPathByElement; },
8872
+ /* harmony export */ getMediaWrapper: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.getMediaWrapper; },
8873
+ /* harmony export */ getPropertyDescriptor: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.getPropertyDescriptor; },
8874
+ /* harmony export */ getWrappedMedia: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.getWrappedMedia; },
8875
+ /* harmony export */ getXPathByElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.getXPathByElement; },
8825
8876
  /* harmony export */ hAlignElement: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.hAlignElement; },
8826
8877
  /* harmony export */ humanSizeToBytes: function() { return /* reexport safe */ _human_size_to_bytes__WEBPACK_IMPORTED_MODULE_17__.humanSizeToBytes; },
8827
- /* harmony export */ inView: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_23__.inView; },
8878
+ /* harmony export */ inView: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_24__.inView; },
8828
8879
  /* harmony export */ isAtom: function() { return /* reexport safe */ _extend__WEBPACK_IMPORTED_MODULE_14__.isAtom; },
8829
8880
  /* harmony export */ isUnsafeProtoKey: function() { return /* reexport safe */ _is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_18__.isUnsafeProtoKey; },
8830
8881
  /* harmony export */ keepNames: function() { return /* reexport safe */ _get_class_name__WEBPACK_IMPORTED_MODULE_16__.keepNames; },
8831
- /* harmony export */ keys: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_27__.keys; },
8832
- /* harmony export */ loadImage: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_27__.loadImage; },
8882
+ /* harmony export */ keys: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.keys; },
8883
+ /* harmony export */ loadImage: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.loadImage; },
8833
8884
  /* harmony export */ loadNext: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_1__.loadNext; },
8834
8885
  /* harmony export */ loadNextStyle: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_1__.loadNextStyle; },
8835
8886
  /* harmony export */ markAsAtomic: function() { return /* reexport safe */ _extend__WEBPACK_IMPORTED_MODULE_14__.markAsAtomic; },
8836
8887
  /* harmony export */ markDeprecated: function() { return /* reexport safe */ _mark_deprecated__WEBPACK_IMPORTED_MODULE_19__.markDeprecated; },
8837
- /* harmony export */ markOwner: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_27__.markOwner; },
8838
- /* harmony export */ memorizeExec: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_27__.memorizeExec; },
8888
+ /* harmony export */ markOwner: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.markOwner; },
8889
+ /* harmony export */ memorizeExec: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.memorizeExec; },
8839
8890
  /* harmony export */ options: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.options; },
8840
- /* harmony export */ parseQuery: function() { return /* reexport safe */ _parse_query__WEBPACK_IMPORTED_MODULE_20__.parseQuery; },
8841
- /* harmony export */ previewBox: function() { return /* reexport safe */ _print__WEBPACK_IMPORTED_MODULE_21__.previewBox; },
8842
- /* harmony export */ refs: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_24__.refs; },
8843
- /* harmony export */ reset: function() { return /* reexport safe */ _reset__WEBPACK_IMPORTED_MODULE_22__.reset; },
8844
- /* harmony export */ resolveElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_24__.resolveElement; },
8845
- /* harmony export */ scrollIntoViewIfNeeded: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_23__.scrollIntoViewIfNeeded; },
8846
- /* harmony export */ set: function() { return /* reexport safe */ _set__WEBPACK_IMPORTED_MODULE_25__.set; }
8891
+ /* harmony export */ parseQuery: function() { return /* reexport safe */ _parse_query__WEBPACK_IMPORTED_MODULE_21__.parseQuery; },
8892
+ /* harmony export */ previewBox: function() { return /* reexport safe */ _print__WEBPACK_IMPORTED_MODULE_22__.previewBox; },
8893
+ /* harmony export */ refs: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.refs; },
8894
+ /* harmony export */ reset: function() { return /* reexport safe */ _reset__WEBPACK_IMPORTED_MODULE_23__.reset; },
8895
+ /* harmony export */ resolveElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.resolveElement; },
8896
+ /* harmony export */ scrollIntoViewIfNeeded: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_24__.scrollIntoViewIfNeeded; },
8897
+ /* harmony export */ set: function() { return /* reexport safe */ _set__WEBPACK_IMPORTED_MODULE_26__.set; },
8898
+ /* harmony export */ wrapMedia: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.wrapMedia; }
8847
8899
  /* harmony export */ });
8848
8900
  /* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16849);
8849
8901
  /* harmony import */ var _append_script__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(47760);
8850
8902
  /* harmony import */ var _assert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28712);
8851
8903
  /* harmony import */ var _assert__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_assert__WEBPACK_IMPORTED_MODULE_2__);
8852
8904
  /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
8853
- /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _assert__WEBPACK_IMPORTED_MODULE_2__) if(["default","alignElement","clearAlign","getHAlign","hAlignElement","alreadyLoadedList","appendScriptAsync","appendStyleAsync","loadNext","loadNextStyle"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = function(key) { return _assert__WEBPACK_IMPORTED_MODULE_2__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
8905
+ /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _assert__WEBPACK_IMPORTED_MODULE_2__) if(["default","alignElement","clearAlign","getAlignClasses","getHAlign","hAlignElement","alreadyLoadedList","appendScriptAsync","appendStyleAsync","loadNext","loadNextStyle"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = function(key) { return _assert__WEBPACK_IMPORTED_MODULE_2__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
8854
8906
  /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
8855
8907
  /* harmony import */ var _attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7909);
8856
8908
  /* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26136);
@@ -8869,14 +8921,15 @@ __webpack_require__.r(__webpack_exports__);
8869
8921
  /* harmony import */ var _human_size_to_bytes__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(37427);
8870
8922
  /* harmony import */ var _is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(78048);
8871
8923
  /* harmony import */ var _mark_deprecated__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(49385);
8872
- /* harmony import */ var _parse_query__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(36310);
8873
- /* harmony import */ var _print__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57075);
8874
- /* harmony import */ var _reset__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(43379);
8875
- /* harmony import */ var _scroll_into_view__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(60898);
8876
- /* harmony import */ var _selector__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(28723);
8877
- /* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(52144);
8878
- /* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(42820);
8879
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(71125);
8924
+ /* harmony import */ var _media_wrapper__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(83314);
8925
+ /* harmony import */ var _parse_query__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(36310);
8926
+ /* harmony import */ var _print__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(57075);
8927
+ /* harmony import */ var _reset__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(43379);
8928
+ /* harmony import */ var _scroll_into_view__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(60898);
8929
+ /* harmony import */ var _selector__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(28723);
8930
+ /* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(52144);
8931
+ /* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(42820);
8932
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(71125);
8880
8933
  /*!
8881
8934
  * Jodit Editor (https://xdsoft.net/jodit/)
8882
8935
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -8911,6 +8964,7 @@ __webpack_require__.r(__webpack_exports__);
8911
8964
 
8912
8965
 
8913
8966
 
8967
+
8914
8968
 
8915
8969
 
8916
8970
  /***/ }),
@@ -8983,6 +9037,77 @@ __webpack_require__.r(__webpack_exports__);
8983
9037
  /* harmony export */ ]);
8984
9038
 
8985
9039
 
9040
+ /***/ }),
9041
+
9042
+ /***/ 83314:
9043
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
9044
+
9045
+ "use strict";
9046
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9047
+ /* harmony export */ createMediaWrapper: function() { return /* binding */ createMediaWrapper; },
9048
+ /* harmony export */ getMediaWrapper: function() { return /* binding */ getMediaWrapper; },
9049
+ /* harmony export */ getWrappedMedia: function() { return /* binding */ getWrappedMedia; },
9050
+ /* harmony export */ wrapMedia: function() { return /* binding */ wrapMedia; }
9051
+ /* harmony export */ });
9052
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
9053
+ /*!
9054
+ * Jodit Editor (https://xdsoft.net/jodit/)
9055
+ * Released under MIT see LICENSE.txt in the project root for license information.
9056
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
9057
+ */ /**
9058
+ * @module helpers/utils
9059
+ */
9060
+ const isWrapper = (node, wrapper)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(node) && node.nodeName.toLowerCase() === wrapper.tag.toLowerCase() && node.classList.contains(wrapper.className);
9061
+ /**
9062
+ * The media in `elm` when `elm` is a wrapper media keep in the content (see
9063
+ * `mediaWrappers`): an element of a type `elm` is the wrapper for
9064
+ */ function getWrappedMedia(jodit, elm) {
9065
+ for (const [tag, wrapper] of Object.entries(jodit.o.mediaWrappers ?? {})){
9066
+ if (isWrapper(elm, wrapper)) {
9067
+ const media = elm.querySelector(tag);
9068
+ if (media) {
9069
+ return media;
9070
+ }
9071
+ }
9072
+ }
9073
+ return null;
9074
+ }
9075
+ /**
9076
+ * The wrapper media keep in the content (see `mediaWrappers`) that is or
9077
+ * holds `node`
9078
+ */ function getMediaWrapper(jodit, node) {
9079
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(node, (elm)=>Boolean(getWrappedMedia(jodit, elm)), jodit.editor);
9080
+ }
9081
+ /**
9082
+ * An empty wrapper for media of type `tag` to keep in the content (see
9083
+ * `mediaWrappers`), or null when there is none for it
9084
+ */ function createMediaWrapper(jodit, tag) {
9085
+ const wrapper = jodit.o.mediaWrappers?.[tag.toLowerCase()];
9086
+ if (!wrapper) {
9087
+ return null;
9088
+ }
9089
+ return jodit.createInside.element(wrapper.tag, {
9090
+ class: wrapper.className,
9091
+ contenteditable: false,
9092
+ draggable: true
9093
+ });
9094
+ }
9095
+ /**
9096
+ * Puts `element` in the wrapper for its type (see `mediaWrappers`), and
9097
+ * returns the wrapper, or `element` when there is none for it
9098
+ */ function wrapMedia(jodit, element) {
9099
+ const wrapper = createMediaWrapper(jodit, element.nodeName);
9100
+ if (!wrapper) {
9101
+ return element;
9102
+ }
9103
+ if (element.parentNode) {
9104
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before(element, wrapper);
9105
+ }
9106
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(wrapper, element);
9107
+ return wrapper;
9108
+ }
9109
+
9110
+
8986
9111
  /***/ }),
8987
9112
 
8988
9113
  /***/ 36310:
@@ -11522,9 +11647,9 @@ class Selection {
11522
11647
  if (styles && typeof styles === 'object') {
11523
11648
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.css)(image, styles);
11524
11649
  }
11525
- const { imageDefaultAlign, imageAlignClasses } = this.j.o;
11650
+ const { imageDefaultAlign } = this.j.o;
11526
11651
  if (imageDefaultAlign && imageDefaultAlign !== 'normal') {
11527
- (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_7__.hAlignElement)(image, imageDefaultAlign, imageAlignClasses);
11652
+ (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_7__.hAlignElement)(image, imageDefaultAlign, (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_7__.getAlignClasses)(this.j, image));
11528
11653
  }
11529
11654
  const onload = ()=>{
11530
11655
  if (image.naturalHeight < image.offsetHeight || image.naturalWidth < image.offsetWidth) {
@@ -24552,6 +24677,7 @@ const INPUT_TAGS = new Set([
24552
24677
  'textarea',
24553
24678
  'select'
24554
24679
  ]);
24680
+ const TYPE_AHEAD_TIMEOUT = 1000;
24555
24681
  const FOCUSABLE_SELECTOR = [
24556
24682
  'button:not([disabled])',
24557
24683
  'a[href]',
@@ -24809,11 +24935,55 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
24809
24935
  items[(index + 1) % items.length].focus();
24810
24936
  break;
24811
24937
  default:
24812
- return;
24938
+ if (!this.control.list || !this.__typeAhead(e.key, items, index)) {
24939
+ return;
24940
+ }
24813
24941
  }
24814
24942
  e.preventDefault();
24815
24943
  e.stopPropagation();
24816
24944
  }
24945
+ /**
24946
+ * The mouse opens a dropdown without taking the focus out of the editor.
24947
+ * While a dropdown list is open, typing there searches the list, as in an
24948
+ * open `<select>`, instead of writing into the content
24949
+ */ __onEditorKeyDown(e) {
24950
+ if (!this.openedPopup || !this.control.list || e.altKey || e.ctrlKey || e.metaKey || !this.__typeAhead(e.key, this.__popupFocusables(), -1)) {
24951
+ return;
24952
+ }
24953
+ e.preventDefault();
24954
+ return false;
24955
+ }
24956
+ /**
24957
+ * Typing in a dropdown list focuses the next item whose label starts with
24958
+ * the typed text, whatever their case and accents, and repeating one letter
24959
+ * cycles through the items that start with it, like the WAI-ARIA menu
24960
+ * pattern's type-ahead. The typed text starts again after a pause, or once
24961
+ * the focus has moved on
24962
+ */ __typeAhead(key, items, index) {
24963
+ const now = Date.now();
24964
+ if (now - this.__typedAt > TYPE_AHEAD_TIMEOUT || items[index] !== this.__typedTo) {
24965
+ this.__typed = '';
24966
+ }
24967
+ if (key.length !== 1 || key === ' ' && !this.__typed) {
24968
+ return false;
24969
+ }
24970
+ this.__typedAt = now;
24971
+ this.__typed += key;
24972
+ this.__typedTo = items[index];
24973
+ const { compare } = new Intl.Collator(undefined, {
24974
+ usage: 'search',
24975
+ sensitivity: 'base'
24976
+ }), typed = this.__typed, cycle = Array.from(typed).every((char)=>compare(char, typed[0]) === 0), prefix = cycle ? typed[0] : typed, start = cycle ? index + 1 : Math.max(index, 0);
24977
+ for(let i = 0; i < items.length; i += 1){
24978
+ const item = items[(start + i) % items.length], label = item.textContent?.trim() ?? '';
24979
+ if (compare(label.slice(0, prefix.length), prefix) === 0) {
24980
+ item.focus();
24981
+ this.__typedTo = item;
24982
+ break;
24983
+ }
24984
+ }
24985
+ return true;
24986
+ }
24817
24987
  /**
24818
24988
  * Visible controls of the opened dropdown that can take the focus
24819
24989
  */ __popupFocusables() {
@@ -24829,8 +24999,12 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
24829
24999
  const controls = this.jodit.options.controls ?? {}, getControl = (key)=>(0,jodit_core_ui_helpers_get_control_type__WEBPACK_IMPORTED_MODULE_20__.findControlType)(key, controls);
24830
25000
  const list = control.list;
24831
25001
  const menu = this.openPopup();
24832
- const toolbar = (0,_factory__WEBPACK_IMPORTED_MODULE_23__.makeCollection)(this.j);
24833
25002
  menu.parentElement = this;
25003
+ const content = control.popup?.(this.j, this.toolbar?.getTarget(this) ?? this.target ?? null, this.__closePopup, this);
25004
+ if (content) {
25005
+ return this.__openMenu(menu, content);
25006
+ }
25007
+ const toolbar = (0,_factory__WEBPACK_IMPORTED_MODULE_23__.makeCollection)(this.j);
24834
25008
  toolbar.parentElement = menu;
24835
25009
  toolbar.mode = 'vertical';
24836
25010
  const isListItem = (key)=>(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_12__.isPlainObject)(key) && 'title' in key && 'value' in key;
@@ -24878,7 +25052,10 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
24878
25052
  return childControl;
24879
25053
  };
24880
25054
  toolbar.build((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_9__.isArray)(list) ? list.map(getButton) : (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_18__.keys)(list, false).map((key)=>getButton(key, list[key])), this.target);
24881
- menu.setContent(toolbar).open(()=>(0,jodit_core_helpers_size__WEBPACK_IMPORTED_MODULE_14__.position)(this.container), false, this.j.o.allowTabNavigation ? this.container : undefined);
25055
+ this.__openMenu(menu, toolbar);
25056
+ }
25057
+ __openMenu(menu, content) {
25058
+ menu.setContent(content).open(()=>(0,jodit_core_helpers_size__WEBPACK_IMPORTED_MODULE_14__.position)(this.container), false, this.j.o.allowTabNavigation ? this.container : undefined);
24882
25059
  this.state.activated = true;
24883
25060
  }
24884
25061
  onOutsideClick(e) {
@@ -24892,7 +25069,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
24892
25069
  openPopup() {
24893
25070
  this.__closePopup();
24894
25071
  this.openedPopup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_22__.Popup(this.j, false);
24895
- this.j.e.on(this.ow, 'mousedown touchstart', this.onOutsideClick).on('escape closeAllPopups', this.onOutsideClick).on(this.openedPopup.container, 'keydown', this.__onPopupKeyDown);
25072
+ this.j.e.on(this.ow, 'mousedown touchstart', this.onOutsideClick).on('escape closeAllPopups', this.onOutsideClick).on('keydown', this.__onEditorKeyDown).on(this.openedPopup.container, 'keydown', this.__onPopupKeyDown);
24896
25073
  return this.openedPopup;
24897
25074
  }
24898
25075
  __closePopup() {
@@ -24907,7 +25084,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
24907
25084
  // popup while the outer `removeChild` is still running and Chrome
24908
25085
  // throws NotFoundError. See #1458
24909
25086
  this.openedPopup = null;
24910
- this.j.e.off(this.ow, 'mousedown touchstart', this.onOutsideClick).off('escape closeAllPopups', this.onOutsideClick);
25087
+ this.j.e.off(this.ow, 'mousedown touchstart', this.onOutsideClick).off('escape closeAllPopups', this.onOutsideClick).off('keydown', this.__onEditorKeyDown);
24911
25088
  // The keyboard brought the focus into the dropdown: give it back to
24912
25089
  // the button, otherwise it would fall out to the document
24913
25090
  const { activeElement } = this.od, hadFocus = activeElement && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isOrContains(popup.container, activeElement);
@@ -24962,12 +25139,12 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
24962
25139
  return super.destruct();
24963
25140
  }
24964
25141
  constructor(jodit, control, target = null){
24965
- super(jodit), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "control", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "target", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "state", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "trigger", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "openedPopup", void 0), this.control = control, this.target = target, this.state = {
25142
+ super(jodit), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "control", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "target", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "state", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "trigger", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__typed", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__typedAt", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__typedTo", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "openedPopup", void 0), this.control = control, this.target = target, this.state = {
24966
25143
  ...(0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.UIButtonState)(),
24967
25144
  theme: 'toolbar',
24968
25145
  currentValue: '',
24969
25146
  hasTrigger: false
24970
- }, this.openedPopup = null;
25147
+ }, this.__typed = '', this.__typedAt = 0, this.__typedTo = null, this.openedPopup = null;
24971
25148
  const button = this.getElm('button');
24972
25149
  (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_16__.assert)(button, 'Element button should exists');
24973
25150
  this.button = button;
@@ -25016,6 +25193,9 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
25016
25193
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
25017
25194
  jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_4__.autobind
25018
25195
  ], ToolbarButton.prototype, "__onPopupKeyDown", null);
25196
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
25197
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_4__.autobind
25198
+ ], ToolbarButton.prototype, "__onEditorKeyDown", null);
25019
25199
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
25020
25200
  jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_4__.autobind
25021
25201
  ], ToolbarButton.prototype, "onOutsideClick", null);
@@ -31132,7 +31312,12 @@ const brBoxes = new Set([
31132
31312
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findNotEmptySibling(br, false)) {
31133
31313
  return;
31134
31314
  }
31135
- jodit.s.setCursorBefore(br);
31315
+ // After a block is inserted the caret is already at the end of its
31316
+ // text; moving it before the `<br>` would put it on a line of its own
31317
+ // below the block (#1315)
31318
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isOrContains(node, jodit.s.range.startContainer)) {
31319
+ jodit.s.setCursorBefore(br);
31320
+ }
31136
31321
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(br);
31137
31322
  }
31138
31323
  }
@@ -31169,13 +31354,22 @@ const brBoxes = new Set([
31169
31354
  let current = jodit.s.current()?.parentElement ?? null;
31170
31355
  while(current && current !== jodit.editor){
31171
31356
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(current)) {
31172
- if (jodit.o.dtd.blockLimits[current.nodeName.toLowerCase()]) {
31357
+ // In DIV mode the caret's own empty block is a line, like
31358
+ // `<p><br></p>`, not a container to insert into (#1315)
31359
+ const isEmptyLine = !parent && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(current, jodit.o.enter) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(current);
31360
+ if (jodit.o.dtd.blockLimits[current.nodeName.toLowerCase()] && !isEmptyLine) {
31173
31361
  break;
31174
31362
  }
31175
31363
  parent = current;
31176
31364
  }
31177
31365
  current = current.parentElement;
31178
31366
  }
31367
+ // A list that is all of the inserted content adds its items to the
31368
+ // list of the item it goes into, as the browsers' own paste does
31369
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isLeaf(current) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isList(node) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isFragment(node.parentNode) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findNotEmptySibling(node, false)) {
31370
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.unwrap(node);
31371
+ parent = current;
31372
+ }
31179
31373
  if (parent) {
31180
31374
  jodit.s.setCursorAfter(parent);
31181
31375
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(parent)) {
@@ -31230,10 +31424,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.dtd = {
31230
31424
  audio: 1,
31231
31425
  body: 1,
31232
31426
  caption: 1,
31427
+ dd: 1,
31233
31428
  details: 1,
31234
31429
  dir: 1,
31235
31430
  div: 1,
31236
31431
  dl: 1,
31432
+ dt: 1,
31237
31433
  fieldset: 1,
31238
31434
  figcaption: 1,
31239
31435
  figure: 1,
@@ -31241,6 +31437,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.dtd = {
31241
31437
  form: 1,
31242
31438
  header: 1,
31243
31439
  hgroup: 1,
31440
+ li: 1,
31244
31441
  main: 1,
31245
31442
  menu: 1,
31246
31443
  nav: 1,
@@ -32045,14 +32242,16 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('focus', focus);
32045
32242
 
32046
32243
  "use strict";
32047
32244
  /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27795);
32048
- /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4040);
32049
- /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80991);
32050
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29434);
32051
- /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5266);
32052
- /* harmony import */ var _icons_font_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(48842);
32053
- /* harmony import */ var _icons_font_svg__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_icons_font_svg__WEBPACK_IMPORTED_MODULE_5__);
32054
- /* harmony import */ var _icons_fontsize_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(25501);
32055
- /* harmony import */ var _icons_fontsize_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_icons_fontsize_svg__WEBPACK_IMPORTED_MODULE_6__);
32245
+ /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17312);
32246
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4040);
32247
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80991);
32248
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29434);
32249
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5266);
32250
+ /* harmony import */ var _icons_font_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(48842);
32251
+ /* harmony import */ var _icons_font_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_icons_font_svg__WEBPACK_IMPORTED_MODULE_6__);
32252
+ /* harmony import */ var _icons_fontsize_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(25501);
32253
+ /* harmony import */ var _icons_fontsize_svg__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_icons_fontsize_svg__WEBPACK_IMPORTED_MODULE_7__);
32254
+ /* harmony import */ var _font_picker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80045);
32056
32255
  /*!
32057
32256
  * Jodit Editor (https://xdsoft.net/jodit/)
32058
32257
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -32066,11 +32265,18 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('focus', focus);
32066
32265
 
32067
32266
 
32068
32267
 
32268
+
32269
+
32069
32270
  /**
32070
32271
  * Default font-size points
32071
- */ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.defaultFontSizePoints = 'px';
32072
- jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__.Icon.set('font', (_icons_font_svg__WEBPACK_IMPORTED_MODULE_5___default())).set('fontsize', (_icons_fontsize_svg__WEBPACK_IMPORTED_MODULE_6___default()));
32073
- jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.fontsize = {
32272
+ */ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.defaultFontSizePoints = 'px';
32273
+ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.font = {
32274
+ googleFonts: {
32275
+ url: ''
32276
+ }
32277
+ };
32278
+ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__.Icon.set('font', (_icons_font_svg__WEBPACK_IMPORTED_MODULE_6___default())).set('fontsize', (_icons_fontsize_svg__WEBPACK_IMPORTED_MODULE_7___default()));
32279
+ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.fontsize = {
32074
32280
  command: 'fontsize',
32075
32281
  data: {
32076
32282
  cssRule: 'font-size',
@@ -32115,7 +32321,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.fontsize = {
32115
32321
  }
32116
32322
  const control = button.control;
32117
32323
  const cssKey = control.data?.cssRule || 'font-size';
32118
- const value = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(box, cssKey);
32324
+ const value = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(box, cssKey);
32119
32325
  if (cssKey === 'font-size') {
32120
32326
  const numValue = parseFloat(value.toString());
32121
32327
  if (editor.o.defaultFontSizePoints === 'pt') {
@@ -32145,12 +32351,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.fontsize = {
32145
32351
  return keySet.has(normalize(value.toString()));
32146
32352
  }
32147
32353
  };
32148
- jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.font = {
32149
- ...jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.fontsize,
32354
+ const hadSelection = new WeakSet();
32355
+ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.font = {
32356
+ ...jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.fontsize,
32150
32357
  command: 'fontname',
32151
32358
  textTemplate: (j, value)=>{
32152
32359
  const [first] = value.split(',');
32153
- return (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_1__.trimChars)(first, '"\'');
32360
+ return (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__.trimChars)(first, '"\'');
32154
32361
  },
32155
32362
  list: {
32156
32363
  '': 'Default',
@@ -32172,6 +32379,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.font = {
32172
32379
  } catch {}
32173
32380
  return `<span data-style="${key}" style="${isAvailable ? `font-family: ${key}!important;` : ''}">${value}</span>`;
32174
32381
  },
32382
+ popup: (editor, current, close, button)=>editor.o.font.googleFonts.url ? new _font_picker__WEBPACK_IMPORTED_MODULE_8__.UIFontPicker(editor, button, close) : false,
32175
32383
  data: {
32176
32384
  cssRule: 'font-family',
32177
32385
  normalize: (v)=>{
@@ -32180,19 +32388,19 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.font = {
32180
32388
  },
32181
32389
  // When no font is explicitly set, the computed font-family equals the
32182
32390
  // editor's own default (e.g. `-apple-system, …`). Return '' so the
32183
- // button shows the `Default` list entry instead of that raw stack.
32184
- // See #1370
32185
- value: (editor)=>{
32186
- const current = editor.s.current();
32187
- if (!current) {
32188
- return;
32189
- }
32190
- const box = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(current, jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isElement, editor.editor);
32191
- if (!box) {
32391
+ // button shows the list's `Default` entry, when it has one, instead of
32392
+ // that raw stack. See #1370
32393
+ value: (editor, button)=>{
32394
+ const current = editor.s.current(), box = current && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(current, jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isElement, editor.editor);
32395
+ // Until there is a selection the button shows the editor's own font,
32396
+ // and afterwards the font of the last one
32397
+ if (box) {
32398
+ hadSelection.add(button);
32399
+ } else if (hadSelection.has(button)) {
32192
32400
  return;
32193
32401
  }
32194
- const value = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(box, 'font-family').toString();
32195
- if (value === (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(editor.editor, 'font-family').toString()) {
32402
+ const value = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(box || editor.editor, 'font-family').toString(), { list } = button.control;
32403
+ if (value === (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(editor.editor, 'font-family').toString() && ((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_1__.isArray)(list) ? list.includes('') : '' in (list ?? {}))) {
32196
32404
  return '';
32197
32405
  }
32198
32406
  return value;
@@ -32201,6 +32409,254 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.font = {
32201
32409
  };
32202
32410
 
32203
32411
 
32412
+ /***/ }),
32413
+
32414
+ /***/ 80045:
32415
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32416
+
32417
+ "use strict";
32418
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32419
+ /* harmony export */ UIFontPicker: function() { return /* binding */ UIFontPicker; }
32420
+ /* harmony export */ });
32421
+ /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
32422
+ /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
32423
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(91672);
32424
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(68616);
32425
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23211);
32426
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28077);
32427
+ /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(17312);
32428
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7909);
32429
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
32430
+ /* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(71125);
32431
+ /* harmony import */ var jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(96007);
32432
+ /* harmony import */ var _google_fonts__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(24939);
32433
+ /*!
32434
+ * Jodit Editor (https://xdsoft.net/jodit/)
32435
+ * Released under MIT see LICENSE.txt in the project root for license information.
32436
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
32437
+ */ /**
32438
+ * @module plugins/font
32439
+ */
32440
+
32441
+
32442
+
32443
+
32444
+
32445
+
32446
+
32447
+
32448
+
32449
+
32450
+
32451
+
32452
+ const HEADINGS = [
32453
+ 'h1',
32454
+ 'h2',
32455
+ 'h3',
32456
+ 'h4',
32457
+ 'h5',
32458
+ 'h6'
32459
+ ];
32460
+ const GENERIC_FAMILIES = new Set([
32461
+ 'serif',
32462
+ 'sans-serif',
32463
+ 'monospace',
32464
+ 'cursive',
32465
+ 'fantasy',
32466
+ 'system-ui',
32467
+ 'ui-serif',
32468
+ 'ui-sans-serif',
32469
+ 'ui-monospace',
32470
+ 'ui-rounded'
32471
+ ]);
32472
+ /**
32473
+ * A family that names a font, not a generic family or a vendor keyword such
32474
+ * as `-apple-system`
32475
+ */ function isFontName(family) {
32476
+ return Boolean(family) && !family.startsWith('-') && !GENERIC_FAMILIES.has(family);
32477
+ }
32478
+ class UIFontPicker extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_10__.UIElement {
32479
+ className() {
32480
+ return 'UIFontPicker';
32481
+ }
32482
+ __render() {
32483
+ const { control } = this.__button, { list = {} } = control, listed = (0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_6__.isArray)(list) ? list.map((key)=>({
32484
+ value: key.toString(),
32485
+ title: key.toString()
32486
+ })) : (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_9__.keys)(list, false).map((key)=>({
32487
+ value: key,
32488
+ title: list[key].toString()
32489
+ })), google = Array.from(this.__googleFonts.fonts.values(), (font)=>({
32490
+ value: this.__googleFonts.value(font),
32491
+ title: font.family,
32492
+ font
32493
+ })), byFamily = new Map();
32494
+ [
32495
+ ...google,
32496
+ ...listed
32497
+ ].forEach((entry)=>byFamily.set((0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(entry.value), entry));
32498
+ const theme = new Map(), used = new Map();
32499
+ // The theme's own fonts are listed too, so its body font can be chosen
32500
+ // to take a font off
32501
+ this.__themeFonts().forEach((fontFamily)=>{
32502
+ const family = (0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(fontFamily), title = fontFamily.split(',')[0].replace(/["']/g, '').trim(), entry = byFamily.get(family) ?? (isFontName(family) ? {
32503
+ value: fontFamily,
32504
+ title
32505
+ } : undefined);
32506
+ entry && !theme.has(family) && theme.set(family, entry);
32507
+ });
32508
+ this.__usedFonts().forEach((fontFamily)=>{
32509
+ const family = (0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(fontFamily), entry = byFamily.get(family);
32510
+ entry && !theme.has(family) && used.set(family, entry);
32511
+ });
32512
+ const defaultEntry = listed.find((entry)=>entry.value === ''), current = (0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(control.value?.(this.j, this.__button) ?? '');
32513
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.detach(this.container);
32514
+ this.__fonts.clear();
32515
+ defaultEntry && this.__append(current, [
32516
+ defaultEntry
32517
+ ]);
32518
+ this.__append(current, [
32519
+ ...theme.values()
32520
+ ], 'Theme fonts');
32521
+ this.__append(current, [
32522
+ ...used.values()
32523
+ ], 'Used fonts');
32524
+ this.__append(current, listed.filter((entry)=>entry !== defaultEntry), 'System fonts');
32525
+ this.__append(current, google, 'Google Fonts');
32526
+ this.__observeGoogleFonts();
32527
+ }
32528
+ /**
32529
+ * The fonts the editor's styles give text and each heading
32530
+ */ __themeFonts() {
32531
+ const { editor } = this.j, fonts = [
32532
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(editor, 'font-family').toString()
32533
+ ];
32534
+ HEADINGS.forEach((tag)=>{
32535
+ const heading = this.j.createInside.element(tag, {
32536
+ style: 'display: none'
32537
+ });
32538
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(editor, heading);
32539
+ fonts.push((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(heading, 'font-family').toString());
32540
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(heading);
32541
+ });
32542
+ return fonts;
32543
+ }
32544
+ /**
32545
+ * The fonts the content sets
32546
+ */ __usedFonts() {
32547
+ return Array.from(this.j.editor.querySelectorAll('[style*="font-family"]'), (element)=>element.style.fontFamily);
32548
+ }
32549
+ __append(current, entries, heading) {
32550
+ if (!entries.length) {
32551
+ return;
32552
+ }
32553
+ const { control } = this.__button, group = this.j.c.div(this.getFullElName('group'));
32554
+ if (heading) {
32555
+ const title = this.j.c.div(this.getFullElName('heading'), {
32556
+ id: `${this.getFullElName('heading')}-${(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.uniqueUid)()}`
32557
+ });
32558
+ title.textContent = this.i18n(heading);
32559
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(group, {
32560
+ role: 'group',
32561
+ 'aria-labelledby': title.id
32562
+ });
32563
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(group, title);
32564
+ }
32565
+ entries.forEach((entry)=>{
32566
+ const item = this.j.c.element('button', {
32567
+ type: 'button',
32568
+ class: this.getFullElName('item'),
32569
+ 'data-value': entry.value,
32570
+ 'aria-pressed': (0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(entry.value) === current
32571
+ });
32572
+ if (entry.font) {
32573
+ item.textContent = entry.title;
32574
+ this.__fonts.set(item, entry.font);
32575
+ } else {
32576
+ item.innerHTML = control.childTemplate?.(this.j, entry.value, entry.title, this.__button) ?? entry.title;
32577
+ }
32578
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(group, item);
32579
+ });
32580
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(this.container, group);
32581
+ }
32582
+ /**
32583
+ * Shows the names of the Google Fonts in view, and those just below it,
32584
+ * in their own fonts. Setting every item's font up front would have the
32585
+ * browser look for each of the library's families among the installed
32586
+ * fonts the first time the list opens
32587
+ */ __observeGoogleFonts() {
32588
+ this.j.async.requestAnimationFrame(()=>{
32589
+ this.__observer?.disconnect();
32590
+ if (this.isDestructed || !this.__fonts.size) {
32591
+ return;
32592
+ }
32593
+ const observer = new IntersectionObserver((entries)=>{
32594
+ const fonts = [];
32595
+ entries.forEach(({ isIntersecting, target })=>{
32596
+ const font = this.__fonts.get(target);
32597
+ if (isIntersecting && font) {
32598
+ fonts.push(font);
32599
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(target, {
32600
+ fontFamily: this.__googleFonts.value(font)
32601
+ });
32602
+ observer.unobserve(target);
32603
+ }
32604
+ });
32605
+ this.__googleFonts.preview(fonts);
32606
+ }, {
32607
+ root: this.container.parentElement,
32608
+ rootMargin: '0px 0px 400px 0px'
32609
+ });
32610
+ this.__fonts.forEach((_, item)=>observer.observe(item));
32611
+ this.__observer = observer;
32612
+ });
32613
+ }
32614
+ /**
32615
+ * Keeps the editor's selection, as the toolbar buttons do
32616
+ */ onMouseDown(e) {
32617
+ e.preventDefault();
32618
+ }
32619
+ onClick(e) {
32620
+ const item = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.up(e.target, (node)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isHTMLElement(node) && node.hasAttribute('data-value'), this.container);
32621
+ if (!item) {
32622
+ return;
32623
+ }
32624
+ const value = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(item, 'data-value') ?? '', font = this.__googleFonts.find(value), // The font the text has anyway is taken off rather than written
32625
+ inherited = (0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(value) === (0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(this.__blockFont());
32626
+ font && !inherited && this.__googleFonts.load(font);
32627
+ this.j.execCommand('fontname', false, inherited ? '' : value);
32628
+ this.__close();
32629
+ }
32630
+ /**
32631
+ * The font the selected text has without a font of its own: its block's
32632
+ */ __blockFont() {
32633
+ const block = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.up(this.j.s.current(), jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isBlock, this.j.editor);
32634
+ return (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(block ?? this.j.editor, 'font-family').toString();
32635
+ }
32636
+ destruct() {
32637
+ this.__observer?.disconnect();
32638
+ super.destruct();
32639
+ }
32640
+ constructor(jodit, __button, __close){
32641
+ super(jodit), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__button", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__close", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__googleFonts", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__fonts", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__observer", void 0), this.__button = __button, this.__close = __close, this.__fonts = new Map(), this.__observer = null;
32642
+ this.__googleFonts = jodit.getInstance(_google_fonts__WEBPACK_IMPORTED_MODULE_11__.GoogleFonts);
32643
+ this.__render();
32644
+ if (!this.__googleFonts.fonts.size) {
32645
+ this.__googleFonts.ready.then(()=>!this.isDestructed && this.__render());
32646
+ }
32647
+ }
32648
+ }
32649
+ ;(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
32650
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_3__.watch)('container:mousedown')
32651
+ ], UIFontPicker.prototype, "onMouseDown", null);
32652
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
32653
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_3__.watch)('container:click')
32654
+ ], UIFontPicker.prototype, "onClick", null);
32655
+ UIFontPicker = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
32656
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_2__.component
32657
+ ], UIFontPicker);
32658
+
32659
+
32204
32660
  /***/ }),
32205
32661
 
32206
32662
  /***/ 50294:
@@ -32211,6 +32667,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.font = {
32211
32667
  /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28077);
32212
32668
  /* harmony import */ var jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65946);
32213
32669
  /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7433);
32670
+ /* harmony import */ var _google_fonts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(24939);
32214
32671
  /*!
32215
32672
  * Jodit Editor (https://xdsoft.net/jodit/)
32216
32673
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -32222,6 +32679,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.font = {
32222
32679
  */
32223
32680
 
32224
32681
 
32682
+
32225
32683
  /**
32226
32684
  * Process commands `fontsize` and `fontname`
32227
32685
  */ function font(editor) {
@@ -32232,6 +32690,18 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.font = {
32232
32690
  name: 'fontsize',
32233
32691
  group: 'font'
32234
32692
  });
32693
+ if (editor.o.font.googleFonts.url) {
32694
+ const googleFonts = editor.getInstance(_google_fonts__WEBPACK_IMPORTED_MODULE_3__.GoogleFonts), loadUsed = editor.async.debounce(()=>googleFonts.loadUsed(), editor.defaultTimeout);
32695
+ googleFonts.ready.then(loadUsed);
32696
+ editor.e.on('afterInit afterSetMode change', loadUsed);
32697
+ }
32698
+ // An iframe's stylesheets can arrive after the toolbar first shows the
32699
+ // editor's font
32700
+ editor.e.on('afterInit', ()=>{
32701
+ editor.iframe && editor.e.on(editor.ed, 'load', ()=>editor.e.fire('updateToolbar'), {
32702
+ capture: true
32703
+ });
32704
+ });
32235
32705
  const callback = (command, second, third)=>{
32236
32706
  switch(command){
32237
32707
  case 'fontsize':
@@ -32261,6 +32731,160 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.font = {
32261
32731
  jodit_core_global__WEBPACK_IMPORTED_MODULE_0__.pluginSystem.add('font', font);
32262
32732
 
32263
32733
 
32734
+ /***/ }),
32735
+
32736
+ /***/ 24939:
32737
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32738
+
32739
+ "use strict";
32740
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32741
+ /* harmony export */ GoogleFonts: function() { return /* binding */ GoogleFonts; },
32742
+ /* harmony export */ firstFamily: function() { return /* binding */ firstFamily; }
32743
+ /* harmony export */ });
32744
+ /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
32745
+ /* harmony import */ var jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59609);
32746
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23211);
32747
+ /* harmony import */ var jodit_core_request_ajax__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17338);
32748
+ /*!
32749
+ * Jodit Editor (https://xdsoft.net/jodit/)
32750
+ * Released under MIT see LICENSE.txt in the project root for license information.
32751
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
32752
+ */ /**
32753
+ * @module plugins/font
32754
+ */
32755
+
32756
+
32757
+
32758
+ const CSS_URL = 'https://fonts.googleapis.com/css2';
32759
+ // `cursive` and `fantasy` stand in badly for a handwriting or display font
32760
+ const GENERIC_FAMILIES = {
32761
+ serif: 'serif',
32762
+ monospace: 'monospace'
32763
+ };
32764
+ const libraries = new Map();
32765
+ /**
32766
+ * The fonts of the library at `url`, fetched once for every editor on the page
32767
+ */ function library(jodit, url) {
32768
+ let fonts = libraries.get(url);
32769
+ if (!fonts) {
32770
+ const ajax = new jodit_core_request_ajax__WEBPACK_IMPORTED_MODULE_3__.Ajax({
32771
+ url,
32772
+ method: 'GET'
32773
+ }, jodit.o.defaultAjaxOptions);
32774
+ fonts = ajax.send().then((response)=>response.json())// A font without a regular style can't be asked for by its name alone
32775
+ .then(({ items })=>items.filter((font)=>font.variants.includes('regular'))).catch(()=>{
32776
+ libraries.delete(url);
32777
+ return [];
32778
+ }).finally(()=>ajax.destruct());
32779
+ libraries.set(url, fonts);
32780
+ }
32781
+ return fonts;
32782
+ }
32783
+ /**
32784
+ * The first family of a `font-family` value, unquoted and in lower case for
32785
+ * comparing
32786
+ */ function firstFamily(fontFamily) {
32787
+ return fontFamily.split(',')[0].replace(/["']/g, '').trim().toLowerCase();
32788
+ }
32789
+ /**
32790
+ * Loads fonts from Google Fonts: the whole of each font the content uses into
32791
+ * the editor's document, and just the letters of its name for the font list
32792
+ */ class GoogleFonts extends jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_1__.ViewComponent {
32793
+ className() {
32794
+ return 'GoogleFonts';
32795
+ }
32796
+ /**
32797
+ * The library's font named first in a `font-family` value
32798
+ */ find(fontFamily) {
32799
+ return this.fonts.get(firstFamily(fontFamily));
32800
+ }
32801
+ /**
32802
+ * The `font-family` value that applies a font
32803
+ */ value(font) {
32804
+ return `'${font.family}', ${GENERIC_FAMILIES[font.category] ?? 'sans-serif'}`;
32805
+ }
32806
+ /**
32807
+ * Loads the regular, italic, bold and bold italic styles that a font has
32808
+ * into the editor's document
32809
+ */ load(font) {
32810
+ const loaded = this.__loadedInto(this.j.ed);
32811
+ if (loaded.has(font.family)) {
32812
+ return;
32813
+ }
32814
+ loaded.add(font.family);
32815
+ const styles = [
32816
+ [
32817
+ 'regular',
32818
+ '0,400'
32819
+ ],
32820
+ [
32821
+ '700',
32822
+ '0,700'
32823
+ ],
32824
+ [
32825
+ 'italic',
32826
+ '1,400'
32827
+ ],
32828
+ [
32829
+ '700italic',
32830
+ '1,700'
32831
+ ]
32832
+ ].filter(([variant])=>font.variants.includes(variant)).map(([, style])=>style);
32833
+ this.__append(this.j.ed, `family=${this.__family(font)}:ital,wght@${styles.join(';')}`);
32834
+ }
32835
+ /**
32836
+ * Loads every font of the library that the content uses
32837
+ */ loadUsed() {
32838
+ this.j.editor.querySelectorAll('[style*="font-family"]').forEach((element)=>{
32839
+ const font = this.find(element.style.fontFamily);
32840
+ font && this.load(font);
32841
+ });
32842
+ }
32843
+ /**
32844
+ * Loads into the page just the letters of each font's name, so the font
32845
+ * list can show the name in its font
32846
+ */ preview(fonts) {
32847
+ const loaded = this.__loadedInto(this.j.od);
32848
+ fonts = fonts.filter((font)=>!this.__previewed.has(font.family) && !loaded.has(font.family));
32849
+ if (!fonts.length) {
32850
+ return;
32851
+ }
32852
+ fonts.forEach((font)=>this.__previewed.add(font.family));
32853
+ const families = fonts.map((font)=>`family=${this.__family(font)}`), letters = new Set(fonts.map((font)=>font.family).join(''));
32854
+ this.__append(this.j.od, `${families.join('&')}&text=${encodeURIComponent([
32855
+ ...letters
32856
+ ].join(''))}`);
32857
+ }
32858
+ __loadedInto(doc) {
32859
+ const loaded = this.__loaded.get(doc) ?? new Set();
32860
+ this.__loaded.set(doc, loaded);
32861
+ return loaded;
32862
+ }
32863
+ __family(font) {
32864
+ return encodeURIComponent(font.family).replace(/%20/g, '+');
32865
+ }
32866
+ __append(doc, query) {
32867
+ const link = doc.createElement('link');
32868
+ link.rel = 'stylesheet';
32869
+ link.href = `${CSS_URL}?${query}&display=swap`;
32870
+ doc.head.appendChild(link);
32871
+ this.__links.push(link);
32872
+ }
32873
+ destruct() {
32874
+ this.__links.forEach((link)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.safeRemove(link));
32875
+ super.destruct();
32876
+ }
32877
+ constructor(jodit){
32878
+ super(jodit), /**
32879
+ * The library by lower-case family, empty until it arrives
32880
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "fonts", new Map()), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "ready", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__links", []), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__loaded", new WeakMap()), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__previewed", new Set());
32881
+ this.ready = library(jodit, jodit.o.font.googleFonts.url).then((fonts)=>{
32882
+ fonts.forEach((font)=>this.fonts.set(font.family.toLowerCase(), font));
32883
+ });
32884
+ }
32885
+ }
32886
+
32887
+
32264
32888
  /***/ }),
32265
32889
 
32266
32890
  /***/ 96863:
@@ -33513,12 +34137,13 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.pluginSystem.add('imageProperties
33513
34137
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33514
34138
  /* harmony export */ readValuesFromImage: function() { return /* binding */ readValuesFromImage; }
33515
34139
  /* harmony export */ });
33516
- /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7909);
33517
- /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80991);
33518
- /* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26633);
33519
- /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(79310);
33520
- /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(18380);
33521
- /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(57339);
34140
+ /* harmony import */ var jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16849);
34141
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7909);
34142
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80991);
34143
+ /* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26633);
34144
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(79310);
34145
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(18380);
34146
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(57339);
33522
34147
  /*!
33523
34148
  * Jodit Editor (https://xdsoft.net/jodit/)
33524
34149
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -33531,32 +34156,33 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.pluginSystem.add('imageProperties
33531
34156
 
33532
34157
 
33533
34158
 
34159
+
33534
34160
  /**
33535
34161
  * Read values from image and set it to state
33536
34162
  * @private
33537
34163
  */ async function readValuesFromImage(j, state) {
33538
34164
  const { sourceImage: image, values } = state;
33539
- (0,_align__WEBPACK_IMPORTED_MODULE_2__.readAlign)(image, values, j.o.imageAlignClasses);
34165
+ (0,_align__WEBPACK_IMPORTED_MODULE_3__.readAlign)(image, values, (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_0__.getAlignClasses)(j, image));
33540
34166
  // Border radius
33541
- values.borderRadius = parseInt((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__.cssInline)(image, 'border-radius') || '0', 10) || 0;
34167
+ values.borderRadius = parseInt((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.cssInline)(image, 'border-radius') || '0', 10) || 0;
33542
34168
  // Id
33543
- values.id = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__.attr)(image, 'id') || '';
34169
+ values.id = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'id') || '';
33544
34170
  // Title
33545
- values.imageTitle = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__.attr)(image, 'title') || '';
34171
+ values.imageTitle = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'title') || '';
33546
34172
  // Alt
33547
- values.imageAlt = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__.attr)(image, 'alt') || '';
34173
+ values.imageAlt = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'alt') || '';
33548
34174
  // Style
33549
- values.style = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__.attr)(image, 'style') || '';
34175
+ values.style = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'style') || '';
33550
34176
  // Classes
33551
- values.classes = ((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__.attr)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
34177
+ values.classes = ((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
33552
34178
  // Margins
33553
- (0,_margin__WEBPACK_IMPORTED_MODULE_4__.readMargins)(image, values, state);
34179
+ (0,_margin__WEBPACK_IMPORTED_MODULE_5__.readMargins)(image, values, state);
33554
34180
  // Link
33555
- (0,_link__WEBPACK_IMPORTED_MODULE_3__.readLink)(state, j, values);
34181
+ (0,_link__WEBPACK_IMPORTED_MODULE_4__.readLink)(state, j, values);
33556
34182
  // Src
33557
- values.imageSrc = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__.attr)(image, 'src') || '';
34183
+ values.imageSrc = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'src') || '';
33558
34184
  // Image size
33559
- return (0,_size__WEBPACK_IMPORTED_MODULE_5__.readSizes)(image, values, state);
34185
+ return (0,_size__WEBPACK_IMPORTED_MODULE_6__.readSizes)(image, values, state);
33560
34186
  }
33561
34187
 
33562
34188
 
@@ -34577,7 +35203,7 @@ UIImagePositionTab = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
34577
35203
  (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'id', id || null);
34578
35204
  }
34579
35205
  if (opt.image.editAlign) {
34580
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(image, align, j.o.imageAlignClasses);
35206
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(image, align, (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.getAlignClasses)(j, image));
34581
35207
  }
34582
35208
  }
34583
35209
 
@@ -35407,6 +36033,7 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
35407
36033
  /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85932);
35408
36034
  /* harmony import */ var jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16849);
35409
36035
  /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80991);
36036
+ /* harmony import */ var jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(83314);
35410
36037
  /*!
35411
36038
  * Jodit Editor (https://xdsoft.net/jodit/)
35412
36039
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -35417,9 +36044,7 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
35417
36044
 
35418
36045
 
35419
36046
 
35420
- // Images align with `imageAlignClasses`; the wrappers of iframes and media
35421
- // keep inline styles
35422
- const alignClasses = (editor, elm)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(elm, 'img') ? editor.o.imageAlignClasses : null;
36047
+
35423
36048
  // A Normal image sits where the text of its line is aligned (#1531)
35424
36049
  const lineAlign = (editor, elm)=>{
35425
36050
  const block = elm && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(elm, jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock, editor.editor) || editor.editor;
@@ -35440,7 +36065,7 @@ const lineAlign = (editor, elm)=>{
35440
36065
  return 'left';
35441
36066
  }
35442
36067
  };
35443
- const currentAlign = (editor, elm)=>elm ? (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__.getHAlign)(elm, alignClasses(editor, elm)) : 'normal';
36068
+ const currentAlign = (editor, elm)=>elm ? (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__.getHAlign)(elm, (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__.getAlignClasses)(editor, elm)) : 'normal';
35444
36069
  const align = {
35445
36070
  name: 'left',
35446
36071
  childTemplate: (_, __, value)=>value,
@@ -35460,23 +36085,25 @@ const align = {
35460
36085
  return (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__.isString)(value) && currentAlign(editor, button.target) === value.toLowerCase();
35461
36086
  },
35462
36087
  exec: (editor, elm, { control })=>{
35463
- if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(elm, new Set([
36088
+ // A media wrapper kept in the content (`mediaWrappers`) is aligned itself
36089
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(elm) || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(elm, new Set([
35464
36090
  'img',
35465
36091
  'jodit',
35466
36092
  'jodit-media'
35467
- ]))) {
36093
+ ])) && (0,jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_4__.getMediaWrapper)(editor, elm) !== elm) {
35468
36094
  return;
35469
36095
  }
35470
36096
  const command = control.args && (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__.isString)(control.args[0]) ? control.args[0].toLowerCase() : '';
35471
36097
  if (!command) {
35472
36098
  return false;
35473
36099
  }
35474
- ;(0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__.hAlignElement)(elm, command, alignClasses(editor, elm));
36100
+ ;(0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__.hAlignElement)(elm, command, (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__.getAlignClasses)(editor, elm));
35475
36101
  if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(elm, new Set([
35476
36102
  'jodit',
35477
36103
  'jodit-media'
35478
36104
  ])) && elm.firstElementChild) {
35479
- (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__.hAlignElement)(elm.firstElementChild, command);
36105
+ const media = elm.firstElementChild;
36106
+ (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__.hAlignElement)(media, command, (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__.getAlignClasses)(editor, media));
35480
36107
  }
35481
36108
  editor.synchronizeValues();
35482
36109
  editor.e.fire('recalcPositionPopup');
@@ -35628,9 +36255,11 @@ const align = {
35628
36255
  return (0,jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_9__.makeCollection)(this.jodit, this.popup);
35629
36256
  }
35630
36257
  onClick(node) {
35631
- const elements = this.elmsList, target = jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(node, 'img') ? node : jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.closest(node, elements, this.j.editor);
35632
- if (target && this.canShowPopupForType(target.nodeName.toLowerCase())) {
35633
- this.showPopup(()=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.position)(target, this.j), target.nodeName.toLowerCase(), target);
36258
+ const elements = this.elmsList, mediaWrapper = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.getMediaWrapper)(this.j, node), target = mediaWrapper ?? (jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(node, 'img') ? node : jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.closest(node, elements, this.j.editor));
36259
+ // A media wrapper kept in the content gets the media popup
36260
+ const type = mediaWrapper ? 'jodit-media' : target?.nodeName.toLowerCase();
36261
+ if (target && type && this.canShowPopupForType(type)) {
36262
+ this.showPopup(()=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.position)(target, this.j), type, target);
35634
36263
  return false;
35635
36264
  }
35636
36265
  }
@@ -35813,7 +36442,11 @@ const align = {
35813
36442
  this.removeListenersForElements();
35814
36443
  }
35815
36444
  _eventsList() {
35816
- const el = this.elmsList;
36445
+ // Clicks on a media wrapper kept in the content (`mediaWrappers`)
36446
+ const wrapperTags = Object.values(this.j.o.mediaWrappers ?? {}).map(({ tag })=>tag.toLowerCase());
36447
+ const el = [
36448
+ ...new Set(this.elmsList.concat(wrapperTags))
36449
+ ];
35817
36450
  return el.map((e)=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.camelCase)(`click_${e}`)).concat(el.map((e)=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.camelCase)(`touchstart_${e}`))).join(' ');
35818
36451
  }
35819
36452
  addListenersForElements() {
@@ -36985,6 +37618,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaBlocks = [
36985
37618
  'video',
36986
37619
  'audio'
36987
37620
  ];
37621
+ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
36988
37622
 
36989
37623
 
36990
37624
  /***/ }),
@@ -37018,11 +37652,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaBlocks = [
37018
37652
  * Process `video` and `audio`
37019
37653
  */ function media(editor) {
37020
37654
  const keyFake = 'jodit_fake_wrapper';
37021
- const { mediaFakeTag, mediaBlocks, mediaInFakeBlock } = editor.options;
37655
+ const { mediaFakeTag, mediaBlocks, mediaInFakeBlock, mediaWrappers } = editor.options;
37022
37656
  const wrap = (element)=>{
37023
37657
  if (element.parentNode && (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(element.parentNode, 'data-jodit_iframe_wrapper')) {
37024
37658
  element = element.parentNode;
37025
- } else {
37659
+ } else if (mediaWrappers[element.nodeName.toLowerCase()]) {
37660
+ element = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.getMediaWrapper)(editor, element) ?? (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.wrapMedia)(editor, element);
37661
+ } else if (mediaInFakeBlock) {
37026
37662
  const wrapper = editor.createInside.element(mediaFakeTag, {
37027
37663
  'data-jodit-temp': 1,
37028
37664
  contenteditable: false,
@@ -37040,12 +37676,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaBlocks = [
37040
37676
  }
37041
37677
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(wrapper, element);
37042
37678
  element = wrapper;
37679
+ } else {
37680
+ return;
37043
37681
  }
37044
37682
  editor.e.off(element, 'mousedown.select touchstart.select').on(element, 'mousedown.select touchstart.select', ()=>{
37045
37683
  editor.s.setCursorAfter(element);
37046
37684
  });
37047
37685
  };
37048
- if (mediaInFakeBlock) {
37686
+ if (mediaInFakeBlock || Object.keys(mediaWrappers).length) {
37049
37687
  editor.e.on('afterGetValueFromEditor', (data)=>{
37050
37688
  const rxp = new RegExp(`<${mediaFakeTag}[^>]+data-${keyFake}[^>]+>([^]+?)</${mediaFakeTag}>`, 'ig');
37051
37689
  if (rxp.test(data.value)) {
@@ -43969,14 +44607,32 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.pluginSystem.add('toolbarNavigati
43969
44607
 
43970
44608
 
43971
44609
 
44610
+ // Media the popup inserts go in their wrapper (see `mediaWrappers`), aligned
44611
+ // with `mediaDefaultAlign`
44612
+ function prepareMedia(jodit, element) {
44613
+ const media = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.wrapMedia)(jodit, element);
44614
+ const { mediaDefaultAlign } = jodit.o;
44615
+ if (mediaDefaultAlign && mediaDefaultAlign !== 'normal') {
44616
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.hAlignElement)(media, mediaDefaultAlign, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.getAlignClasses)(jodit, media));
44617
+ }
44618
+ return media;
44619
+ }
43972
44620
  function insertVideos(data) {
43973
44621
  data.files?.forEach((file)=>{
43974
- this.s.insertNode(this.createInside.element('video', {
44622
+ this.s.insertNode(prepareMedia(this, this.createInside.element('video', {
43975
44623
  controls: '',
43976
44624
  src: data.baseurl + file
43977
- }));
44625
+ })));
43978
44626
  });
43979
44627
  }
44628
+ // Embed code that is one element is prepared as media; other code goes in as
44629
+ // it is
44630
+ function prepareEmbedCode(jodit, code) {
44631
+ const box = jodit.createInside.div();
44632
+ box.innerHTML = code.trim();
44633
+ const element = box.firstElementChild;
44634
+ return element && box.childNodes.length === 1 ? prepareMedia(jodit, element) : code;
44635
+ }
43980
44636
  jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.video = {
43981
44637
  parseUrlToVideoEmbed: jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed,
43982
44638
  defaultWidth: 400,
@@ -44014,7 +44670,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.video = {
44014
44670
  ])
44015
44671
  ]), tabs = [], insertCode = (code)=>{
44016
44672
  jodit.s.restore();
44017
- jodit.s.insertHTML(code);
44673
+ jodit.s.insertHTML(prepareEmbedCode(jodit, code));
44018
44674
  close();
44019
44675
  };
44020
44676
  jodit.s.save();