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.
- package/CHANGELOG.md +17 -0
- package/es2015/jodit.css +87 -3
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +8 -8
- package/es2015/jodit.js +808 -132
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +16 -16
- package/es2015/plugins/debug/debug.css +1 -1
- package/es2015/plugins/debug/debug.js +1 -1
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +8 -8
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +8 -8
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +87 -3
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +14 -14
- package/es2021/jodit.js +788 -132
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +14 -14
- package/es2021/plugins/debug/debug.css +1 -1
- package/es2021/plugins/debug/debug.js +1 -1
- package/es2021/plugins/debug/debug.min.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021.en/jodit.css +87 -3
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +26 -26
- package/es2021.en/jodit.js +788 -132
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +12 -12
- package/es2021.en/plugins/debug/debug.css +1 -1
- package/es2021.en/plugins/debug/debug.js +1 -1
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/jodit.css +92 -6
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +1073 -192
- package/es5/jodit.min.css +3 -3
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/config.d.ts +65 -2
- package/esm/config.js +29 -2
- package/esm/core/constants.js +1 -1
- package/esm/core/helpers/utils/align.d.ts +11 -5
- package/esm/core/helpers/utils/align.js +28 -8
- package/esm/core/helpers/utils/index.d.ts +1 -0
- package/esm/core/helpers/utils/index.js +1 -0
- package/esm/core/helpers/utils/media-wrapper.d.ts +29 -0
- package/esm/core/helpers/utils/media-wrapper.js +63 -0
- package/esm/core/selection/selection.js +3 -3
- package/esm/modules/toolbar/button/button.d.ts +18 -0
- package/esm/modules/toolbar/button/button.js +75 -5
- package/esm/plugins/dtd/after-insert/remove-extra-br.js +6 -1
- package/esm/plugins/dtd/before-insert/check-block-nesting.js +16 -1
- package/esm/plugins/dtd/config.js +3 -0
- package/esm/plugins/font/config.d.ts +12 -0
- package/esm/plugins/font/config.js +25 -10
- package/esm/plugins/font/font-picker.d.ts +51 -0
- package/esm/plugins/font/font-picker.js +238 -0
- package/esm/plugins/font/font.js +12 -0
- package/esm/plugins/font/google-fonts.d.ts +65 -0
- package/esm/plugins/font/google-fonts.js +143 -0
- package/esm/plugins/image-properties/readers/index.js +2 -1
- package/esm/plugins/image-properties/writers/index.js +2 -2
- package/esm/plugins/inline-popup/config/items/img.js +10 -8
- package/esm/plugins/inline-popup/inline-popup.js +13 -6
- package/esm/plugins/media/config.d.ts +26 -1
- package/esm/plugins/media/config.js +1 -3
- package/esm/plugins/media/media.js +12 -4
- package/esm/plugins/video/config.js +24 -4
- package/esm/types/toolbar.d.ts +2 -0
- package/esm/types/types.d.ts +13 -1
- package/package.json +1 -1
- package/types/config.d.ts +65 -2
- package/types/core/helpers/utils/align.d.ts +11 -5
- package/types/core/helpers/utils/index.d.ts +1 -0
- package/types/core/helpers/utils/media-wrapper.d.ts +29 -0
- package/types/modules/toolbar/button/button.d.ts +18 -0
- package/types/plugins/font/config.d.ts +12 -0
- package/types/plugins/font/font-picker.d.ts +51 -0
- package/types/plugins/font/google-fonts.d.ts +65 -0
- package/types/plugins/media/config.d.ts +26 -1
- package/types/types/toolbar.d.ts +2 -0
- package/types/types/types.d.ts +13 -1
package/es2015/jodit.js
CHANGED
|
@@ -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.
|
|
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
|
*
|
|
@@ -1805,7 +1830,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1805
1830
|
* ```
|
|
1806
1831
|
* @packageDocumentation
|
|
1807
1832
|
* @module constants
|
|
1808
|
-
*/ const APP_VERSION = "4.
|
|
1833
|
+
*/ const APP_VERSION = "4.18.1";
|
|
1809
1834
|
// prettier-ignore
|
|
1810
1835
|
const ES = "es2015";
|
|
1811
1836
|
const IS_ES_MODERN = true;
|
|
@@ -7603,12 +7628,15 @@ function trimChars(value, chars) {
|
|
|
7603
7628
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7604
7629
|
/* harmony export */ alignElement: function() { return /* binding */ alignElement; },
|
|
7605
7630
|
/* harmony export */ clearAlign: function() { return /* binding */ clearAlign; },
|
|
7631
|
+
/* harmony export */ getAlignClasses: function() { return /* binding */ getAlignClasses; },
|
|
7606
7632
|
/* harmony export */ getHAlign: function() { return /* binding */ getHAlign; },
|
|
7607
7633
|
/* harmony export */ hAlignElement: function() { return /* binding */ hAlignElement; }
|
|
7608
7634
|
/* harmony export */ });
|
|
7609
7635
|
/* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27795);
|
|
7610
|
-
/* harmony import */ var
|
|
7611
|
-
/* harmony import */ var
|
|
7636
|
+
/* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17312);
|
|
7637
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7909);
|
|
7638
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80991);
|
|
7639
|
+
/* harmony import */ var jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(83314);
|
|
7612
7640
|
/*!
|
|
7613
7641
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
7614
7642
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -7618,32 +7646,55 @@ function trimChars(value, chars) {
|
|
|
7618
7646
|
*/
|
|
7619
7647
|
|
|
7620
7648
|
|
|
7621
|
-
|
|
7649
|
+
|
|
7650
|
+
|
|
7651
|
+
// The sets of class names an alignment lists, the first being the one to write
|
|
7652
|
+
const classSets = (value)=>((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_1__.isArray)(value) ? value : [
|
|
7653
|
+
value !== null && value !== void 0 ? value : ''
|
|
7654
|
+
]).map((set)=>set.split(/\s+/).filter(Boolean)).filter((set)=>set.length);
|
|
7622
7655
|
/**
|
|
7623
|
-
*
|
|
7624
|
-
*
|
|
7656
|
+
* The class names to align `elm` with: `alignClasses` for its tag, or for the
|
|
7657
|
+
* media in it when it wraps media (a `mediaWrappers` wrapper, `jodit` or
|
|
7658
|
+
* `jodit-media`), falling back to `imageAlignClasses` for an image
|
|
7659
|
+
*/ function getAlignClasses(jodit, elm) {
|
|
7660
|
+
var _ref;
|
|
7661
|
+
var _jodit_o_alignClasses;
|
|
7662
|
+
if (!elm) {
|
|
7663
|
+
return null;
|
|
7664
|
+
}
|
|
7665
|
+
const media = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(elm, new Set([
|
|
7666
|
+
'jodit',
|
|
7667
|
+
'jodit-media'
|
|
7668
|
+
])) ? elm.firstElementChild : (0,jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_4__.getWrappedMedia)(jodit, elm);
|
|
7669
|
+
const tag = (media !== null && media !== void 0 ? media : elm).nodeName.toLowerCase();
|
|
7670
|
+
return (_ref = (_jodit_o_alignClasses = jodit.o.alignClasses) === null || _jodit_o_alignClasses === void 0 ? void 0 : _jodit_o_alignClasses[tag]) !== null && _ref !== void 0 ? _ref : tag === 'img' ? jodit.o.imageAlignClasses : null;
|
|
7671
|
+
}
|
|
7672
|
+
/**
|
|
7673
|
+
* Align image, with `classes` (see `alignClasses`) instead of inline styles
|
|
7674
|
+
* when they are given
|
|
7625
7675
|
*/ function hAlignElement(image, align, classes) {
|
|
7626
7676
|
if (classes) {
|
|
7677
|
+
var _classSets_;
|
|
7627
7678
|
hAlignElement(image, 'normal');
|
|
7628
|
-
Object.values(classes).forEach((value)=>image.classList.remove(...
|
|
7629
|
-
image.classList.add(...
|
|
7679
|
+
Object.values(classes).forEach((value)=>classSets(value).forEach((set)=>image.classList.remove(...set)));
|
|
7680
|
+
image.classList.add(...(_classSets_ = classSets(classes[align || 'normal'])[0]) !== null && _classSets_ !== void 0 ? _classSets_ : []);
|
|
7630
7681
|
[
|
|
7631
7682
|
'class',
|
|
7632
7683
|
'style'
|
|
7633
7684
|
].forEach((name)=>{
|
|
7634
7685
|
var _attr;
|
|
7635
|
-
if (!((_attr = (0,
|
|
7636
|
-
(0,
|
|
7686
|
+
if (!((_attr = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(image, name)) === null || _attr === void 0 ? void 0 : _attr.trim())) {
|
|
7687
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(image, name, null);
|
|
7637
7688
|
}
|
|
7638
7689
|
});
|
|
7639
7690
|
return;
|
|
7640
7691
|
}
|
|
7641
7692
|
if (align && align !== 'normal') {
|
|
7642
7693
|
if (align !== 'center') {
|
|
7643
|
-
(0,
|
|
7644
|
-
(0,
|
|
7694
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(image, 'float', align);
|
|
7695
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.clearCenterAlign)(image);
|
|
7645
7696
|
} else {
|
|
7646
|
-
(0,
|
|
7697
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(image, {
|
|
7647
7698
|
float: '',
|
|
7648
7699
|
display: 'block',
|
|
7649
7700
|
marginLeft: 'auto',
|
|
@@ -7651,13 +7702,13 @@ const classNames = (value)=>(value !== null && value !== void 0 ? value : '').sp
|
|
|
7651
7702
|
});
|
|
7652
7703
|
}
|
|
7653
7704
|
} else {
|
|
7654
|
-
if ((0,
|
|
7705
|
+
if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(image, 'float') && [
|
|
7655
7706
|
'right',
|
|
7656
7707
|
'left'
|
|
7657
|
-
].indexOf((0,
|
|
7658
|
-
(0,
|
|
7708
|
+
].indexOf((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(image, 'float').toString().toLowerCase()) !== -1) {
|
|
7709
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(image, 'float', '');
|
|
7659
7710
|
}
|
|
7660
|
-
;(0,
|
|
7711
|
+
;(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.clearCenterAlign)(image);
|
|
7661
7712
|
}
|
|
7662
7713
|
}
|
|
7663
7714
|
/**
|
|
@@ -7670,17 +7721,16 @@ const classNames = (value)=>(value !== null && value !== void 0 ? value : '').sp
|
|
|
7670
7721
|
'center',
|
|
7671
7722
|
'normal'
|
|
7672
7723
|
]){
|
|
7673
|
-
|
|
7674
|
-
if (names.length && names.every((name)=>elm.classList.contains(name))) {
|
|
7724
|
+
if (classSets(classes[align]).some((set)=>set.every((name)=>elm.classList.contains(name)))) {
|
|
7675
7725
|
return align;
|
|
7676
7726
|
}
|
|
7677
7727
|
}
|
|
7678
7728
|
}
|
|
7679
|
-
const float = (0,
|
|
7729
|
+
const float = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.cssInline)(elm, 'float').toLowerCase();
|
|
7680
7730
|
if (float === 'left' || float === 'right') {
|
|
7681
7731
|
return float;
|
|
7682
7732
|
}
|
|
7683
|
-
if ((0,
|
|
7733
|
+
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') {
|
|
7684
7734
|
return 'center';
|
|
7685
7735
|
}
|
|
7686
7736
|
return 'normal';
|
|
@@ -7690,10 +7740,10 @@ const classNames = (value)=>(value !== null && value !== void 0 ? value : '').sp
|
|
|
7690
7740
|
*/ function clearAlign(node) {
|
|
7691
7741
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.each(node, (elm)=>{
|
|
7692
7742
|
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(elm)) {
|
|
7693
|
-
if ((0,
|
|
7694
|
-
(0,
|
|
7695
|
-
if (!((0,
|
|
7696
|
-
(0,
|
|
7743
|
+
if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.cssInline)(elm, 'textAlign')) {
|
|
7744
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(elm, 'textAlign', '');
|
|
7745
|
+
if (!((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'style') || '').trim().length) {
|
|
7746
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'style', null);
|
|
7697
7747
|
}
|
|
7698
7748
|
}
|
|
7699
7749
|
}
|
|
@@ -7724,7 +7774,7 @@ function alignElement(command, box) {
|
|
|
7724
7774
|
clearAlign(box);
|
|
7725
7775
|
const align = ALIGN_BY_COMMAND.get(command.toLowerCase());
|
|
7726
7776
|
if (align) {
|
|
7727
|
-
(0,
|
|
7777
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(box, 'textAlign', align);
|
|
7728
7778
|
}
|
|
7729
7779
|
}
|
|
7730
7780
|
}
|
|
@@ -8810,13 +8860,13 @@ const getClassName = (obj)=>{
|
|
|
8810
8860
|
"use strict";
|
|
8811
8861
|
__webpack_require__.r(__webpack_exports__);
|
|
8812
8862
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
8813
|
-
/* harmony export */ $$: function() { return /* reexport safe */
|
|
8863
|
+
/* harmony export */ $$: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.$$; },
|
|
8814
8864
|
/* harmony export */ ConfigDeepFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigDeepFlatten; },
|
|
8815
8865
|
/* harmony export */ ConfigFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigFlatten; },
|
|
8816
8866
|
/* harmony export */ ConfigMerge: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigMerge; },
|
|
8817
8867
|
/* harmony export */ ConfigProto: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigProto; },
|
|
8818
8868
|
/* harmony export */ ConnectionError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.ConnectionError; },
|
|
8819
|
-
/* harmony export */ LimitedStack: function() { return /* reexport safe */
|
|
8869
|
+
/* harmony export */ LimitedStack: function() { return /* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_27__.LimitedStack; },
|
|
8820
8870
|
/* harmony export */ OptionsError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.OptionsError; },
|
|
8821
8871
|
/* harmony export */ UNSAFE_PROTO_KEYS: function() { return /* reexport safe */ _is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_18__.UNSAFE_PROTO_KEYS; },
|
|
8822
8872
|
/* harmony export */ abort: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.abort; },
|
|
@@ -8828,58 +8878,63 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8828
8878
|
/* harmony export */ attrRaw: function() { return /* reexport safe */ _attr__WEBPACK_IMPORTED_MODULE_3__.attrRaw; },
|
|
8829
8879
|
/* harmony export */ browser: function() { return /* reexport safe */ _browser__WEBPACK_IMPORTED_MODULE_4__.browser; },
|
|
8830
8880
|
/* harmony export */ buildQuery: function() { return /* reexport safe */ _build_query__WEBPACK_IMPORTED_MODULE_5__.buildQuery; },
|
|
8831
|
-
/* harmony export */ call: function() { return /* reexport safe */
|
|
8832
|
-
/* harmony export */ callPromise: function() { return /* reexport safe */
|
|
8833
|
-
/* harmony export */ callThis: function() { return /* reexport safe */
|
|
8881
|
+
/* harmony export */ call: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.call; },
|
|
8882
|
+
/* harmony export */ callPromise: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.callPromise; },
|
|
8883
|
+
/* harmony export */ callThis: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.callThis; },
|
|
8834
8884
|
/* harmony export */ clearAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.clearAlign; },
|
|
8835
8885
|
/* harmony export */ clearCenterAlign: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.clearCenterAlign; },
|
|
8836
8886
|
/* harmony export */ cns: function() { return /* reexport safe */ _mark_deprecated__WEBPACK_IMPORTED_MODULE_19__.cns; },
|
|
8837
8887
|
/* harmony export */ completeUrl: function() { return /* reexport safe */ _complete_url__WEBPACK_IMPORTED_MODULE_6__.completeUrl; },
|
|
8838
8888
|
/* harmony export */ connection: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.connection; },
|
|
8839
8889
|
/* harmony export */ convertMediaUrlToVideoEmbed: function() { return /* reexport safe */ _convert_media_url_to_video_embed__WEBPACK_IMPORTED_MODULE_8__.convertMediaUrlToVideoEmbed; },
|
|
8890
|
+
/* harmony export */ createMediaWrapper: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.createMediaWrapper; },
|
|
8840
8891
|
/* harmony export */ css: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.css; },
|
|
8841
8892
|
/* harmony export */ cssInline: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.cssInline; },
|
|
8842
|
-
/* harmony export */ cssPath: function() { return /* reexport safe */
|
|
8893
|
+
/* harmony export */ cssPath: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.cssPath; },
|
|
8843
8894
|
/* harmony export */ ctrlKey: function() { return /* reexport safe */ _ctrl_key__WEBPACK_IMPORTED_MODULE_10__.ctrlKey; },
|
|
8844
8895
|
/* harmony export */ dataBind: function() { return /* reexport safe */ _data_bind__WEBPACK_IMPORTED_MODULE_11__.dataBind; },
|
|
8845
8896
|
/* harmony export */ defaultLanguage: function() { return /* reexport safe */ _default_language__WEBPACK_IMPORTED_MODULE_12__.defaultLanguage; },
|
|
8846
8897
|
/* harmony export */ error: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.error; },
|
|
8847
8898
|
/* harmony export */ fastClone: function() { return /* reexport safe */ _extend__WEBPACK_IMPORTED_MODULE_14__.fastClone; },
|
|
8848
8899
|
/* harmony export */ get: function() { return /* reexport safe */ _get__WEBPACK_IMPORTED_MODULE_15__.get; },
|
|
8900
|
+
/* harmony export */ getAlignClasses: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.getAlignClasses; },
|
|
8849
8901
|
/* harmony export */ getClassName: function() { return /* reexport safe */ _get_class_name__WEBPACK_IMPORTED_MODULE_16__.getClassName; },
|
|
8850
|
-
/* harmony export */ getDataTransfer: function() { return /* reexport safe */
|
|
8902
|
+
/* harmony export */ getDataTransfer: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.getDataTransfer; },
|
|
8851
8903
|
/* harmony export */ getHAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.getHAlign; },
|
|
8852
|
-
/* harmony export */
|
|
8853
|
-
/* harmony export */
|
|
8904
|
+
/* harmony export */ getMediaWrapper: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.getMediaWrapper; },
|
|
8905
|
+
/* harmony export */ getPropertyDescriptor: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.getPropertyDescriptor; },
|
|
8906
|
+
/* harmony export */ getWrappedMedia: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.getWrappedMedia; },
|
|
8907
|
+
/* harmony export */ getXPathByElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.getXPathByElement; },
|
|
8854
8908
|
/* harmony export */ hAlignElement: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.hAlignElement; },
|
|
8855
8909
|
/* harmony export */ humanSizeToBytes: function() { return /* reexport safe */ _human_size_to_bytes__WEBPACK_IMPORTED_MODULE_17__.humanSizeToBytes; },
|
|
8856
|
-
/* harmony export */ inView: function() { return /* reexport safe */
|
|
8910
|
+
/* harmony export */ inView: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_24__.inView; },
|
|
8857
8911
|
/* harmony export */ isAtom: function() { return /* reexport safe */ _extend__WEBPACK_IMPORTED_MODULE_14__.isAtom; },
|
|
8858
8912
|
/* harmony export */ isUnsafeProtoKey: function() { return /* reexport safe */ _is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_18__.isUnsafeProtoKey; },
|
|
8859
8913
|
/* harmony export */ keepNames: function() { return /* reexport safe */ _get_class_name__WEBPACK_IMPORTED_MODULE_16__.keepNames; },
|
|
8860
|
-
/* harmony export */ keys: function() { return /* reexport safe */
|
|
8861
|
-
/* harmony export */ loadImage: function() { return /* reexport safe */
|
|
8914
|
+
/* harmony export */ keys: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.keys; },
|
|
8915
|
+
/* harmony export */ loadImage: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.loadImage; },
|
|
8862
8916
|
/* harmony export */ loadNext: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_1__.loadNext; },
|
|
8863
8917
|
/* harmony export */ loadNextStyle: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_1__.loadNextStyle; },
|
|
8864
8918
|
/* harmony export */ markAsAtomic: function() { return /* reexport safe */ _extend__WEBPACK_IMPORTED_MODULE_14__.markAsAtomic; },
|
|
8865
8919
|
/* harmony export */ markDeprecated: function() { return /* reexport safe */ _mark_deprecated__WEBPACK_IMPORTED_MODULE_19__.markDeprecated; },
|
|
8866
|
-
/* harmony export */ markOwner: function() { return /* reexport safe */
|
|
8867
|
-
/* harmony export */ memorizeExec: function() { return /* reexport safe */
|
|
8920
|
+
/* harmony export */ markOwner: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.markOwner; },
|
|
8921
|
+
/* harmony export */ memorizeExec: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.memorizeExec; },
|
|
8868
8922
|
/* harmony export */ options: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.options; },
|
|
8869
|
-
/* harmony export */ parseQuery: function() { return /* reexport safe */
|
|
8870
|
-
/* harmony export */ previewBox: function() { return /* reexport safe */
|
|
8871
|
-
/* harmony export */ refs: function() { return /* reexport safe */
|
|
8872
|
-
/* harmony export */ reset: function() { return /* reexport safe */
|
|
8873
|
-
/* harmony export */ resolveElement: function() { return /* reexport safe */
|
|
8874
|
-
/* harmony export */ scrollIntoViewIfNeeded: function() { return /* reexport safe */
|
|
8875
|
-
/* harmony export */ set: function() { return /* reexport safe */
|
|
8923
|
+
/* harmony export */ parseQuery: function() { return /* reexport safe */ _parse_query__WEBPACK_IMPORTED_MODULE_21__.parseQuery; },
|
|
8924
|
+
/* harmony export */ previewBox: function() { return /* reexport safe */ _print__WEBPACK_IMPORTED_MODULE_22__.previewBox; },
|
|
8925
|
+
/* harmony export */ refs: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.refs; },
|
|
8926
|
+
/* harmony export */ reset: function() { return /* reexport safe */ _reset__WEBPACK_IMPORTED_MODULE_23__.reset; },
|
|
8927
|
+
/* harmony export */ resolveElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.resolveElement; },
|
|
8928
|
+
/* harmony export */ scrollIntoViewIfNeeded: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_24__.scrollIntoViewIfNeeded; },
|
|
8929
|
+
/* harmony export */ set: function() { return /* reexport safe */ _set__WEBPACK_IMPORTED_MODULE_26__.set; },
|
|
8930
|
+
/* harmony export */ wrapMedia: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.wrapMedia; }
|
|
8876
8931
|
/* harmony export */ });
|
|
8877
8932
|
/* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16849);
|
|
8878
8933
|
/* harmony import */ var _append_script__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(47760);
|
|
8879
8934
|
/* harmony import */ var _assert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28712);
|
|
8880
8935
|
/* harmony import */ var _assert__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_assert__WEBPACK_IMPORTED_MODULE_2__);
|
|
8881
8936
|
/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
8882
|
-
/* 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__)
|
|
8937
|
+
/* 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__)
|
|
8883
8938
|
/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
8884
8939
|
/* harmony import */ var _attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7909);
|
|
8885
8940
|
/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26136);
|
|
@@ -8898,14 +8953,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8898
8953
|
/* harmony import */ var _human_size_to_bytes__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(37427);
|
|
8899
8954
|
/* harmony import */ var _is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(78048);
|
|
8900
8955
|
/* harmony import */ var _mark_deprecated__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(49385);
|
|
8901
|
-
/* harmony import */ var
|
|
8902
|
-
/* harmony import */ var
|
|
8903
|
-
/* harmony import */ var
|
|
8904
|
-
/* harmony import */ var
|
|
8905
|
-
/* harmony import */ var
|
|
8906
|
-
/* harmony import */ var
|
|
8907
|
-
/* harmony import */ var
|
|
8908
|
-
/* harmony import */ var
|
|
8956
|
+
/* harmony import */ var _media_wrapper__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(83314);
|
|
8957
|
+
/* harmony import */ var _parse_query__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(36310);
|
|
8958
|
+
/* harmony import */ var _print__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(57075);
|
|
8959
|
+
/* harmony import */ var _reset__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(43379);
|
|
8960
|
+
/* harmony import */ var _scroll_into_view__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(60898);
|
|
8961
|
+
/* harmony import */ var _selector__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(28723);
|
|
8962
|
+
/* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(52144);
|
|
8963
|
+
/* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(42820);
|
|
8964
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(71125);
|
|
8909
8965
|
/*!
|
|
8910
8966
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
8911
8967
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -8940,6 +8996,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8940
8996
|
|
|
8941
8997
|
|
|
8942
8998
|
|
|
8999
|
+
|
|
8943
9000
|
|
|
8944
9001
|
|
|
8945
9002
|
/***/ }),
|
|
@@ -9012,6 +9069,79 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9012
9069
|
/* harmony export */ ]);
|
|
9013
9070
|
|
|
9014
9071
|
|
|
9072
|
+
/***/ }),
|
|
9073
|
+
|
|
9074
|
+
/***/ 83314:
|
|
9075
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
9076
|
+
|
|
9077
|
+
"use strict";
|
|
9078
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9079
|
+
/* harmony export */ createMediaWrapper: function() { return /* binding */ createMediaWrapper; },
|
|
9080
|
+
/* harmony export */ getMediaWrapper: function() { return /* binding */ getMediaWrapper; },
|
|
9081
|
+
/* harmony export */ getWrappedMedia: function() { return /* binding */ getWrappedMedia; },
|
|
9082
|
+
/* harmony export */ wrapMedia: function() { return /* binding */ wrapMedia; }
|
|
9083
|
+
/* harmony export */ });
|
|
9084
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
9085
|
+
/*!
|
|
9086
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
9087
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
9088
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
9089
|
+
*/ /**
|
|
9090
|
+
* @module helpers/utils
|
|
9091
|
+
*/
|
|
9092
|
+
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);
|
|
9093
|
+
/**
|
|
9094
|
+
* The media in `elm` when `elm` is a wrapper media keep in the content (see
|
|
9095
|
+
* `mediaWrappers`): an element of a type `elm` is the wrapper for
|
|
9096
|
+
*/ function getWrappedMedia(jodit, elm) {
|
|
9097
|
+
var _jodit_o_mediaWrappers;
|
|
9098
|
+
for (const [tag, wrapper] of Object.entries((_jodit_o_mediaWrappers = jodit.o.mediaWrappers) !== null && _jodit_o_mediaWrappers !== void 0 ? _jodit_o_mediaWrappers : {})){
|
|
9099
|
+
if (isWrapper(elm, wrapper)) {
|
|
9100
|
+
const media = elm.querySelector(tag);
|
|
9101
|
+
if (media) {
|
|
9102
|
+
return media;
|
|
9103
|
+
}
|
|
9104
|
+
}
|
|
9105
|
+
}
|
|
9106
|
+
return null;
|
|
9107
|
+
}
|
|
9108
|
+
/**
|
|
9109
|
+
* The wrapper media keep in the content (see `mediaWrappers`) that is or
|
|
9110
|
+
* holds `node`
|
|
9111
|
+
*/ function getMediaWrapper(jodit, node) {
|
|
9112
|
+
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(node, (elm)=>Boolean(getWrappedMedia(jodit, elm)), jodit.editor);
|
|
9113
|
+
}
|
|
9114
|
+
/**
|
|
9115
|
+
* An empty wrapper for media of type `tag` to keep in the content (see
|
|
9116
|
+
* `mediaWrappers`), or null when there is none for it
|
|
9117
|
+
*/ function createMediaWrapper(jodit, tag) {
|
|
9118
|
+
var _jodit_o_mediaWrappers;
|
|
9119
|
+
const wrapper = (_jodit_o_mediaWrappers = jodit.o.mediaWrappers) === null || _jodit_o_mediaWrappers === void 0 ? void 0 : _jodit_o_mediaWrappers[tag.toLowerCase()];
|
|
9120
|
+
if (!wrapper) {
|
|
9121
|
+
return null;
|
|
9122
|
+
}
|
|
9123
|
+
return jodit.createInside.element(wrapper.tag, {
|
|
9124
|
+
class: wrapper.className,
|
|
9125
|
+
contenteditable: false,
|
|
9126
|
+
draggable: true
|
|
9127
|
+
});
|
|
9128
|
+
}
|
|
9129
|
+
/**
|
|
9130
|
+
* Puts `element` in the wrapper for its type (see `mediaWrappers`), and
|
|
9131
|
+
* returns the wrapper, or `element` when there is none for it
|
|
9132
|
+
*/ function wrapMedia(jodit, element) {
|
|
9133
|
+
const wrapper = createMediaWrapper(jodit, element.nodeName);
|
|
9134
|
+
if (!wrapper) {
|
|
9135
|
+
return element;
|
|
9136
|
+
}
|
|
9137
|
+
if (element.parentNode) {
|
|
9138
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before(element, wrapper);
|
|
9139
|
+
}
|
|
9140
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(wrapper, element);
|
|
9141
|
+
return wrapper;
|
|
9142
|
+
}
|
|
9143
|
+
|
|
9144
|
+
|
|
9015
9145
|
/***/ }),
|
|
9016
9146
|
|
|
9017
9147
|
/***/ 36310:
|
|
@@ -11595,9 +11725,9 @@ class Selection {
|
|
|
11595
11725
|
if (styles && typeof styles === 'object') {
|
|
11596
11726
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.css)(image, styles);
|
|
11597
11727
|
}
|
|
11598
|
-
const { imageDefaultAlign
|
|
11728
|
+
const { imageDefaultAlign } = this.j.o;
|
|
11599
11729
|
if (imageDefaultAlign && imageDefaultAlign !== 'normal') {
|
|
11600
|
-
(0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_7__.hAlignElement)(image, imageDefaultAlign,
|
|
11730
|
+
(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));
|
|
11601
11731
|
}
|
|
11602
11732
|
const onload = ()=>{
|
|
11603
11733
|
if (image.naturalHeight < image.offsetHeight || image.naturalWidth < image.offsetWidth) {
|
|
@@ -24768,6 +24898,7 @@ const INPUT_TAGS = new Set([
|
|
|
24768
24898
|
'textarea',
|
|
24769
24899
|
'select'
|
|
24770
24900
|
]);
|
|
24901
|
+
const TYPE_AHEAD_TIMEOUT = 1000;
|
|
24771
24902
|
const FOCUSABLE_SELECTOR = [
|
|
24772
24903
|
'button:not([disabled])',
|
|
24773
24904
|
'a[href]',
|
|
@@ -25033,11 +25164,57 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_21__.U
|
|
|
25033
25164
|
items[(index + 1) % items.length].focus();
|
|
25034
25165
|
break;
|
|
25035
25166
|
default:
|
|
25036
|
-
|
|
25167
|
+
if (!this.control.list || !this.__typeAhead(e.key, items, index)) {
|
|
25168
|
+
return;
|
|
25169
|
+
}
|
|
25037
25170
|
}
|
|
25038
25171
|
e.preventDefault();
|
|
25039
25172
|
e.stopPropagation();
|
|
25040
25173
|
}
|
|
25174
|
+
/**
|
|
25175
|
+
* The mouse opens a dropdown without taking the focus out of the editor.
|
|
25176
|
+
* While a dropdown list is open, typing there searches the list, as in an
|
|
25177
|
+
* open `<select>`, instead of writing into the content
|
|
25178
|
+
*/ __onEditorKeyDown(e) {
|
|
25179
|
+
if (!this.openedPopup || !this.control.list || e.altKey || e.ctrlKey || e.metaKey || !this.__typeAhead(e.key, this.__popupFocusables(), -1)) {
|
|
25180
|
+
return;
|
|
25181
|
+
}
|
|
25182
|
+
e.preventDefault();
|
|
25183
|
+
return false;
|
|
25184
|
+
}
|
|
25185
|
+
/**
|
|
25186
|
+
* Typing in a dropdown list focuses the next item whose label starts with
|
|
25187
|
+
* the typed text, whatever their case and accents, and repeating one letter
|
|
25188
|
+
* cycles through the items that start with it, like the WAI-ARIA menu
|
|
25189
|
+
* pattern's type-ahead. The typed text starts again after a pause, or once
|
|
25190
|
+
* the focus has moved on
|
|
25191
|
+
*/ __typeAhead(key, items, index) {
|
|
25192
|
+
const now = Date.now();
|
|
25193
|
+
if (now - this.__typedAt > TYPE_AHEAD_TIMEOUT || items[index] !== this.__typedTo) {
|
|
25194
|
+
this.__typed = '';
|
|
25195
|
+
}
|
|
25196
|
+
if (key.length !== 1 || key === ' ' && !this.__typed) {
|
|
25197
|
+
return false;
|
|
25198
|
+
}
|
|
25199
|
+
this.__typedAt = now;
|
|
25200
|
+
this.__typed += key;
|
|
25201
|
+
this.__typedTo = items[index];
|
|
25202
|
+
const { compare } = new Intl.Collator(undefined, {
|
|
25203
|
+
usage: 'search',
|
|
25204
|
+
sensitivity: 'base'
|
|
25205
|
+
}), 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);
|
|
25206
|
+
for(let i = 0; i < items.length; i += 1){
|
|
25207
|
+
var _ref;
|
|
25208
|
+
var _item_textContent;
|
|
25209
|
+
const item = items[(start + i) % items.length], label = (_ref = (_item_textContent = item.textContent) === null || _item_textContent === void 0 ? void 0 : _item_textContent.trim()) !== null && _ref !== void 0 ? _ref : '';
|
|
25210
|
+
if (compare(label.slice(0, prefix.length), prefix) === 0) {
|
|
25211
|
+
item.focus();
|
|
25212
|
+
this.__typedTo = item;
|
|
25213
|
+
break;
|
|
25214
|
+
}
|
|
25215
|
+
}
|
|
25216
|
+
return true;
|
|
25217
|
+
}
|
|
25041
25218
|
/**
|
|
25042
25219
|
* Visible controls of the opened dropdown that can take the focus
|
|
25043
25220
|
*/ __popupFocusables() {
|
|
@@ -25050,12 +25227,17 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_21__.U
|
|
|
25050
25227
|
/**
|
|
25051
25228
|
* Create an open popup list
|
|
25052
25229
|
*/ __openControlList(control) {
|
|
25053
|
-
var _this_jodit_options_controls;
|
|
25230
|
+
var _this_jodit_options_controls, _ref, _ref1;
|
|
25231
|
+
var _this_toolbar, _control_popup;
|
|
25054
25232
|
const controls = (_this_jodit_options_controls = this.jodit.options.controls) !== null && _this_jodit_options_controls !== void 0 ? _this_jodit_options_controls : {}, getControl = (key)=>(0,jodit_core_ui_helpers_get_control_type__WEBPACK_IMPORTED_MODULE_22__.findControlType)(key, controls);
|
|
25055
25233
|
const list = control.list;
|
|
25056
25234
|
const menu = this.openPopup();
|
|
25057
|
-
const toolbar = (0,_factory__WEBPACK_IMPORTED_MODULE_25__.makeCollection)(this.j);
|
|
25058
25235
|
menu.parentElement = this;
|
|
25236
|
+
const content = (_control_popup = control.popup) === null || _control_popup === void 0 ? void 0 : _control_popup.call(control, this.j, (_ref = (_ref1 = (_this_toolbar = this.toolbar) === null || _this_toolbar === void 0 ? void 0 : _this_toolbar.getTarget(this)) !== null && _ref1 !== void 0 ? _ref1 : this.target) !== null && _ref !== void 0 ? _ref : null, this.__closePopup, this);
|
|
25237
|
+
if (content) {
|
|
25238
|
+
return this.__openMenu(menu, content);
|
|
25239
|
+
}
|
|
25240
|
+
const toolbar = (0,_factory__WEBPACK_IMPORTED_MODULE_25__.makeCollection)(this.j);
|
|
25059
25241
|
toolbar.parentElement = menu;
|
|
25060
25242
|
toolbar.mode = 'vertical';
|
|
25061
25243
|
const isListItem = (key)=>(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_14__.isPlainObject)(key) && 'title' in key && 'value' in key;
|
|
@@ -25102,7 +25284,10 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_21__.U
|
|
|
25102
25284
|
return childControl;
|
|
25103
25285
|
};
|
|
25104
25286
|
toolbar.build((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_11__.isArray)(list) ? list.map(getButton) : (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_20__.keys)(list, false).map((key)=>getButton(key, list[key])), this.target);
|
|
25105
|
-
|
|
25287
|
+
this.__openMenu(menu, toolbar);
|
|
25288
|
+
}
|
|
25289
|
+
__openMenu(menu, content) {
|
|
25290
|
+
menu.setContent(content).open(()=>(0,jodit_core_helpers_size__WEBPACK_IMPORTED_MODULE_16__.position)(this.container), false, this.j.o.allowTabNavigation ? this.container : undefined);
|
|
25106
25291
|
this.state.activated = true;
|
|
25107
25292
|
}
|
|
25108
25293
|
onOutsideClick(e) {
|
|
@@ -25116,7 +25301,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_21__.U
|
|
|
25116
25301
|
openPopup() {
|
|
25117
25302
|
this.__closePopup();
|
|
25118
25303
|
this.openedPopup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_24__.Popup(this.j, false);
|
|
25119
|
-
this.j.e.on(this.ow, 'mousedown touchstart', this.onOutsideClick).on('escape closeAllPopups', this.onOutsideClick).on(this.openedPopup.container, 'keydown', this.__onPopupKeyDown);
|
|
25304
|
+
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);
|
|
25120
25305
|
return this.openedPopup;
|
|
25121
25306
|
}
|
|
25122
25307
|
__closePopup() {
|
|
@@ -25131,7 +25316,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_21__.U
|
|
|
25131
25316
|
// popup while the outer `removeChild` is still running and Chrome
|
|
25132
25317
|
// throws NotFoundError. See #1458
|
|
25133
25318
|
this.openedPopup = null;
|
|
25134
|
-
this.j.e.off(this.ow, 'mousedown touchstart', this.onOutsideClick).off('escape closeAllPopups', this.onOutsideClick);
|
|
25319
|
+
this.j.e.off(this.ow, 'mousedown touchstart', this.onOutsideClick).off('escape closeAllPopups', this.onOutsideClick).off('keydown', this.__onEditorKeyDown);
|
|
25135
25320
|
// The keyboard brought the focus into the dropdown: give it back to
|
|
25136
25321
|
// the button, otherwise it would fall out to the document
|
|
25137
25322
|
const { activeElement } = this.od, hadFocus = activeElement && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.isOrContains(popup.container, activeElement);
|
|
@@ -25189,11 +25374,11 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_21__.U
|
|
|
25189
25374
|
return super.destruct();
|
|
25190
25375
|
}
|
|
25191
25376
|
constructor(jodit, control, target = null){
|
|
25192
|
-
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 = (0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_2__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__._)({}, (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_21__.UIButtonState)()), {
|
|
25377
|
+
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 = (0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_2__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__._)({}, (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_21__.UIButtonState)()), {
|
|
25193
25378
|
theme: 'toolbar',
|
|
25194
25379
|
currentValue: '',
|
|
25195
25380
|
hasTrigger: false
|
|
25196
|
-
}), this.openedPopup = null;
|
|
25381
|
+
}), this.__typed = '', this.__typedAt = 0, this.__typedTo = null, this.openedPopup = null;
|
|
25197
25382
|
const button = this.getElm('button');
|
|
25198
25383
|
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_18__.assert)(button, 'Element button should exists');
|
|
25199
25384
|
this.button = button;
|
|
@@ -25242,6 +25427,9 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_21__.U
|
|
|
25242
25427
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
|
|
25243
25428
|
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
25244
25429
|
], ToolbarButton.prototype, "__onPopupKeyDown", null);
|
|
25430
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
|
|
25431
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
25432
|
+
], ToolbarButton.prototype, "__onEditorKeyDown", null);
|
|
25245
25433
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
|
|
25246
25434
|
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
25247
25435
|
], ToolbarButton.prototype, "onOutsideClick", null);
|
|
@@ -31745,7 +31933,12 @@ const brBoxes = new Set([
|
|
|
31745
31933
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findNotEmptySibling(br, false)) {
|
|
31746
31934
|
return;
|
|
31747
31935
|
}
|
|
31748
|
-
|
|
31936
|
+
// After a block is inserted the caret is already at the end of its
|
|
31937
|
+
// text; moving it before the `<br>` would put it on a line of its own
|
|
31938
|
+
// below the block (#1315)
|
|
31939
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isOrContains(node, jodit.s.range.startContainer)) {
|
|
31940
|
+
jodit.s.setCursorBefore(br);
|
|
31941
|
+
}
|
|
31749
31942
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(br);
|
|
31750
31943
|
}
|
|
31751
31944
|
}
|
|
@@ -31784,13 +31977,22 @@ const brBoxes = new Set([
|
|
|
31784
31977
|
let current = (_ref = (_jodit_s_current = jodit.s.current()) === null || _jodit_s_current === void 0 ? void 0 : _jodit_s_current.parentElement) !== null && _ref !== void 0 ? _ref : null;
|
|
31785
31978
|
while(current && current !== jodit.editor){
|
|
31786
31979
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(current)) {
|
|
31787
|
-
|
|
31980
|
+
// In DIV mode the caret's own empty block is a line, like
|
|
31981
|
+
// `<p><br></p>`, not a container to insert into (#1315)
|
|
31982
|
+
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);
|
|
31983
|
+
if (jodit.o.dtd.blockLimits[current.nodeName.toLowerCase()] && !isEmptyLine) {
|
|
31788
31984
|
break;
|
|
31789
31985
|
}
|
|
31790
31986
|
parent = current;
|
|
31791
31987
|
}
|
|
31792
31988
|
current = current.parentElement;
|
|
31793
31989
|
}
|
|
31990
|
+
// A list that is all of the inserted content adds its items to the
|
|
31991
|
+
// list of the item it goes into, as the browsers' own paste does
|
|
31992
|
+
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)) {
|
|
31993
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.unwrap(node);
|
|
31994
|
+
parent = current;
|
|
31995
|
+
}
|
|
31794
31996
|
if (parent) {
|
|
31795
31997
|
jodit.s.setCursorAfter(parent);
|
|
31796
31998
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(parent)) {
|
|
@@ -31845,10 +32047,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.dtd = {
|
|
|
31845
32047
|
audio: 1,
|
|
31846
32048
|
body: 1,
|
|
31847
32049
|
caption: 1,
|
|
32050
|
+
dd: 1,
|
|
31848
32051
|
details: 1,
|
|
31849
32052
|
dir: 1,
|
|
31850
32053
|
div: 1,
|
|
31851
32054
|
dl: 1,
|
|
32055
|
+
dt: 1,
|
|
31852
32056
|
fieldset: 1,
|
|
31853
32057
|
figcaption: 1,
|
|
31854
32058
|
figure: 1,
|
|
@@ -31856,6 +32060,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.dtd = {
|
|
|
31856
32060
|
form: 1,
|
|
31857
32061
|
header: 1,
|
|
31858
32062
|
hgroup: 1,
|
|
32063
|
+
li: 1,
|
|
31859
32064
|
main: 1,
|
|
31860
32065
|
menu: 1,
|
|
31861
32066
|
nav: 1,
|
|
@@ -32665,14 +32870,16 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('focus', focus);
|
|
|
32665
32870
|
/* harmony import */ var _swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41411);
|
|
32666
32871
|
/* harmony import */ var _swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15366);
|
|
32667
32872
|
/* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(27795);
|
|
32668
|
-
/* harmony import */ var
|
|
32669
|
-
/* harmony import */ var
|
|
32670
|
-
/* harmony import */ var
|
|
32671
|
-
/* harmony import */ var
|
|
32672
|
-
/* harmony import */ var
|
|
32673
|
-
/* harmony import */ var
|
|
32674
|
-
/* harmony import */ var
|
|
32675
|
-
/* harmony import */ var
|
|
32873
|
+
/* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17312);
|
|
32874
|
+
/* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4040);
|
|
32875
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80991);
|
|
32876
|
+
/* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(29434);
|
|
32877
|
+
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5266);
|
|
32878
|
+
/* harmony import */ var _icons_font_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(48842);
|
|
32879
|
+
/* harmony import */ var _icons_font_svg__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_icons_font_svg__WEBPACK_IMPORTED_MODULE_8__);
|
|
32880
|
+
/* harmony import */ var _icons_fontsize_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(25501);
|
|
32881
|
+
/* harmony import */ var _icons_fontsize_svg__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_icons_fontsize_svg__WEBPACK_IMPORTED_MODULE_9__);
|
|
32882
|
+
/* harmony import */ var _font_picker__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(80045);
|
|
32676
32883
|
/*!
|
|
32677
32884
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
32678
32885
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -32688,11 +32895,18 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('focus', focus);
|
|
|
32688
32895
|
|
|
32689
32896
|
|
|
32690
32897
|
|
|
32898
|
+
|
|
32899
|
+
|
|
32691
32900
|
/**
|
|
32692
32901
|
* Default font-size points
|
|
32693
|
-
*/
|
|
32694
|
-
|
|
32695
|
-
|
|
32902
|
+
*/ jodit_config__WEBPACK_IMPORTED_MODULE_7__.Config.prototype.defaultFontSizePoints = 'px';
|
|
32903
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_7__.Config.prototype.font = {
|
|
32904
|
+
googleFonts: {
|
|
32905
|
+
url: ''
|
|
32906
|
+
}
|
|
32907
|
+
};
|
|
32908
|
+
jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_6__.Icon.set('font', (_icons_font_svg__WEBPACK_IMPORTED_MODULE_8___default())).set('fontsize', (_icons_fontsize_svg__WEBPACK_IMPORTED_MODULE_9___default()));
|
|
32909
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_7__.Config.prototype.controls.fontsize = {
|
|
32696
32910
|
command: 'fontsize',
|
|
32697
32911
|
data: {
|
|
32698
32912
|
cssRule: 'font-size',
|
|
@@ -32738,7 +32952,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.fontsize = {
|
|
|
32738
32952
|
}
|
|
32739
32953
|
const control = button.control;
|
|
32740
32954
|
const cssKey = ((_control_data = control.data) === null || _control_data === void 0 ? void 0 : _control_data.cssRule) || 'font-size';
|
|
32741
|
-
const value = (0,
|
|
32955
|
+
const value = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(box, cssKey);
|
|
32742
32956
|
if (cssKey === 'font-size') {
|
|
32743
32957
|
const numValue = parseFloat(value.toString());
|
|
32744
32958
|
if (editor.o.defaultFontSizePoints === 'pt') {
|
|
@@ -32772,11 +32986,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.fontsize = {
|
|
|
32772
32986
|
return keySet.has(normalize(value.toString()));
|
|
32773
32987
|
}
|
|
32774
32988
|
};
|
|
32775
|
-
|
|
32989
|
+
const hadSelection = new WeakSet();
|
|
32990
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_7__.Config.prototype.controls.font = (0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_1__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_0__._)({}, jodit_config__WEBPACK_IMPORTED_MODULE_7__.Config.prototype.controls.fontsize), {
|
|
32776
32991
|
command: 'fontname',
|
|
32777
32992
|
textTemplate: (j, value)=>{
|
|
32778
32993
|
const [first] = value.split(',');
|
|
32779
|
-
return (0,
|
|
32994
|
+
return (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_4__.trimChars)(first, '"\'');
|
|
32780
32995
|
},
|
|
32781
32996
|
list: {
|
|
32782
32997
|
'': 'Default',
|
|
@@ -32798,6 +33013,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.font = (0,_s
|
|
|
32798
33013
|
} catch (unused) {}
|
|
32799
33014
|
return `<span data-style="${key}" style="${isAvailable ? `font-family: ${key}!important;` : ''}">${value}</span>`;
|
|
32800
33015
|
},
|
|
33016
|
+
popup: (editor, current, close, button)=>editor.o.font.googleFonts.url ? new _font_picker__WEBPACK_IMPORTED_MODULE_10__.UIFontPicker(editor, button, close) : false,
|
|
32801
33017
|
data: {
|
|
32802
33018
|
cssRule: 'font-family',
|
|
32803
33019
|
normalize: (v)=>{
|
|
@@ -32806,19 +33022,19 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.font = (0,_s
|
|
|
32806
33022
|
},
|
|
32807
33023
|
// When no font is explicitly set, the computed font-family equals the
|
|
32808
33024
|
// editor's own default (e.g. `-apple-system, …`). Return '' so the
|
|
32809
|
-
// button shows the `Default`
|
|
32810
|
-
// See #1370
|
|
32811
|
-
value: (editor)=>{
|
|
32812
|
-
const current = editor.s.current();
|
|
32813
|
-
|
|
32814
|
-
|
|
32815
|
-
|
|
32816
|
-
|
|
32817
|
-
if (
|
|
33025
|
+
// button shows the list's `Default` entry, when it has one, instead of
|
|
33026
|
+
// that raw stack. See #1370
|
|
33027
|
+
value: (editor, button)=>{
|
|
33028
|
+
const current = editor.s.current(), box = current && jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(current, jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isElement, editor.editor);
|
|
33029
|
+
// Until there is a selection the button shows the editor's own font,
|
|
33030
|
+
// and afterwards the font of the last one
|
|
33031
|
+
if (box) {
|
|
33032
|
+
hadSelection.add(button);
|
|
33033
|
+
} else if (hadSelection.has(button)) {
|
|
32818
33034
|
return;
|
|
32819
33035
|
}
|
|
32820
|
-
const value = (0,
|
|
32821
|
-
if (value === (0,
|
|
33036
|
+
const value = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(box || editor.editor, 'font-family').toString(), { list } = button.control;
|
|
33037
|
+
if (value === (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(editor.editor, 'font-family').toString() && ((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_3__.isArray)(list) ? list.includes('') : '' in (list !== null && list !== void 0 ? list : {}))) {
|
|
32822
33038
|
return '';
|
|
32823
33039
|
}
|
|
32824
33040
|
return value;
|
|
@@ -32827,6 +33043,262 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.font = (0,_s
|
|
|
32827
33043
|
});
|
|
32828
33044
|
|
|
32829
33045
|
|
|
33046
|
+
/***/ }),
|
|
33047
|
+
|
|
33048
|
+
/***/ 80045:
|
|
33049
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
33050
|
+
|
|
33051
|
+
"use strict";
|
|
33052
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
33053
|
+
/* harmony export */ UIFontPicker: function() { return /* binding */ UIFontPicker; }
|
|
33054
|
+
/* harmony export */ });
|
|
33055
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
|
|
33056
|
+
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
|
|
33057
|
+
/* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(91672);
|
|
33058
|
+
/* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(68616);
|
|
33059
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23211);
|
|
33060
|
+
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28077);
|
|
33061
|
+
/* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(17312);
|
|
33062
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7909);
|
|
33063
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
|
|
33064
|
+
/* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(71125);
|
|
33065
|
+
/* harmony import */ var jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(96007);
|
|
33066
|
+
/* harmony import */ var _google_fonts__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(24939);
|
|
33067
|
+
/*!
|
|
33068
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
33069
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
33070
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
33071
|
+
*/ /**
|
|
33072
|
+
* @module plugins/font
|
|
33073
|
+
*/
|
|
33074
|
+
|
|
33075
|
+
|
|
33076
|
+
|
|
33077
|
+
|
|
33078
|
+
|
|
33079
|
+
|
|
33080
|
+
|
|
33081
|
+
|
|
33082
|
+
|
|
33083
|
+
|
|
33084
|
+
|
|
33085
|
+
|
|
33086
|
+
const HEADINGS = [
|
|
33087
|
+
'h1',
|
|
33088
|
+
'h2',
|
|
33089
|
+
'h3',
|
|
33090
|
+
'h4',
|
|
33091
|
+
'h5',
|
|
33092
|
+
'h6'
|
|
33093
|
+
];
|
|
33094
|
+
const GENERIC_FAMILIES = new Set([
|
|
33095
|
+
'serif',
|
|
33096
|
+
'sans-serif',
|
|
33097
|
+
'monospace',
|
|
33098
|
+
'cursive',
|
|
33099
|
+
'fantasy',
|
|
33100
|
+
'system-ui',
|
|
33101
|
+
'ui-serif',
|
|
33102
|
+
'ui-sans-serif',
|
|
33103
|
+
'ui-monospace',
|
|
33104
|
+
'ui-rounded'
|
|
33105
|
+
]);
|
|
33106
|
+
/**
|
|
33107
|
+
* A family that names a font, not a generic family or a vendor keyword such
|
|
33108
|
+
* as `-apple-system`
|
|
33109
|
+
*/ function isFontName(family) {
|
|
33110
|
+
return Boolean(family) && !family.startsWith('-') && !GENERIC_FAMILIES.has(family);
|
|
33111
|
+
}
|
|
33112
|
+
class UIFontPicker extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_10__.UIElement {
|
|
33113
|
+
className() {
|
|
33114
|
+
return 'UIFontPicker';
|
|
33115
|
+
}
|
|
33116
|
+
__render() {
|
|
33117
|
+
var _ref;
|
|
33118
|
+
var _control_value;
|
|
33119
|
+
const { control } = this.__button, { list = {} } = control, listed = (0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_6__.isArray)(list) ? list.map((key)=>({
|
|
33120
|
+
value: key.toString(),
|
|
33121
|
+
title: key.toString()
|
|
33122
|
+
})) : (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_9__.keys)(list, false).map((key)=>({
|
|
33123
|
+
value: key,
|
|
33124
|
+
title: list[key].toString()
|
|
33125
|
+
})), google = Array.from(this.__googleFonts.fonts.values(), (font)=>({
|
|
33126
|
+
value: this.__googleFonts.value(font),
|
|
33127
|
+
title: font.family,
|
|
33128
|
+
font
|
|
33129
|
+
})), byFamily = new Map();
|
|
33130
|
+
[
|
|
33131
|
+
...google,
|
|
33132
|
+
...listed
|
|
33133
|
+
].forEach((entry)=>byFamily.set((0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(entry.value), entry));
|
|
33134
|
+
const theme = new Map(), used = new Map();
|
|
33135
|
+
// The theme's own fonts are listed too, so its body font can be chosen
|
|
33136
|
+
// to take a font off
|
|
33137
|
+
this.__themeFonts().forEach((fontFamily)=>{
|
|
33138
|
+
var _byFamily_get;
|
|
33139
|
+
const family = (0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(fontFamily), title = fontFamily.split(',')[0].replace(/["']/g, '').trim(), entry = (_byFamily_get = byFamily.get(family)) !== null && _byFamily_get !== void 0 ? _byFamily_get : isFontName(family) ? {
|
|
33140
|
+
value: fontFamily,
|
|
33141
|
+
title
|
|
33142
|
+
} : undefined;
|
|
33143
|
+
entry && !theme.has(family) && theme.set(family, entry);
|
|
33144
|
+
});
|
|
33145
|
+
this.__usedFonts().forEach((fontFamily)=>{
|
|
33146
|
+
const family = (0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(fontFamily), entry = byFamily.get(family);
|
|
33147
|
+
entry && !theme.has(family) && used.set(family, entry);
|
|
33148
|
+
});
|
|
33149
|
+
const defaultEntry = listed.find((entry)=>entry.value === ''), current = (0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)((_ref = (_control_value = control.value) === null || _control_value === void 0 ? void 0 : _control_value.call(control, this.j, this.__button)) !== null && _ref !== void 0 ? _ref : '');
|
|
33150
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.detach(this.container);
|
|
33151
|
+
this.__fonts.clear();
|
|
33152
|
+
defaultEntry && this.__append(current, [
|
|
33153
|
+
defaultEntry
|
|
33154
|
+
]);
|
|
33155
|
+
this.__append(current, [
|
|
33156
|
+
...theme.values()
|
|
33157
|
+
], 'Theme fonts');
|
|
33158
|
+
this.__append(current, [
|
|
33159
|
+
...used.values()
|
|
33160
|
+
], 'Used fonts');
|
|
33161
|
+
this.__append(current, listed.filter((entry)=>entry !== defaultEntry), 'System fonts');
|
|
33162
|
+
this.__append(current, google, 'Google Fonts');
|
|
33163
|
+
this.__observeGoogleFonts();
|
|
33164
|
+
}
|
|
33165
|
+
/**
|
|
33166
|
+
* The fonts the editor's styles give text and each heading
|
|
33167
|
+
*/ __themeFonts() {
|
|
33168
|
+
const { editor } = this.j, fonts = [
|
|
33169
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(editor, 'font-family').toString()
|
|
33170
|
+
];
|
|
33171
|
+
HEADINGS.forEach((tag)=>{
|
|
33172
|
+
const heading = this.j.createInside.element(tag, {
|
|
33173
|
+
style: 'display: none'
|
|
33174
|
+
});
|
|
33175
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(editor, heading);
|
|
33176
|
+
fonts.push((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(heading, 'font-family').toString());
|
|
33177
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(heading);
|
|
33178
|
+
});
|
|
33179
|
+
return fonts;
|
|
33180
|
+
}
|
|
33181
|
+
/**
|
|
33182
|
+
* The fonts the content sets
|
|
33183
|
+
*/ __usedFonts() {
|
|
33184
|
+
return Array.from(this.j.editor.querySelectorAll('[style*="font-family"]'), (element)=>element.style.fontFamily);
|
|
33185
|
+
}
|
|
33186
|
+
__append(current, entries, heading) {
|
|
33187
|
+
if (!entries.length) {
|
|
33188
|
+
return;
|
|
33189
|
+
}
|
|
33190
|
+
const { control } = this.__button, group = this.j.c.div(this.getFullElName('group'));
|
|
33191
|
+
if (heading) {
|
|
33192
|
+
const title = this.j.c.div(this.getFullElName('heading'), {
|
|
33193
|
+
id: `${this.getFullElName('heading')}-${(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.uniqueUid)()}`
|
|
33194
|
+
});
|
|
33195
|
+
title.textContent = this.i18n(heading);
|
|
33196
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(group, {
|
|
33197
|
+
role: 'group',
|
|
33198
|
+
'aria-labelledby': title.id
|
|
33199
|
+
});
|
|
33200
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(group, title);
|
|
33201
|
+
}
|
|
33202
|
+
entries.forEach((entry)=>{
|
|
33203
|
+
const item = this.j.c.element('button', {
|
|
33204
|
+
type: 'button',
|
|
33205
|
+
class: this.getFullElName('item'),
|
|
33206
|
+
'data-value': entry.value,
|
|
33207
|
+
'aria-pressed': (0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(entry.value) === current
|
|
33208
|
+
});
|
|
33209
|
+
if (entry.font) {
|
|
33210
|
+
item.textContent = entry.title;
|
|
33211
|
+
this.__fonts.set(item, entry.font);
|
|
33212
|
+
} else {
|
|
33213
|
+
var _ref;
|
|
33214
|
+
var _control_childTemplate;
|
|
33215
|
+
item.innerHTML = (_ref = (_control_childTemplate = control.childTemplate) === null || _control_childTemplate === void 0 ? void 0 : _control_childTemplate.call(control, this.j, entry.value, entry.title, this.__button)) !== null && _ref !== void 0 ? _ref : entry.title;
|
|
33216
|
+
}
|
|
33217
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(group, item);
|
|
33218
|
+
});
|
|
33219
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(this.container, group);
|
|
33220
|
+
}
|
|
33221
|
+
/**
|
|
33222
|
+
* Shows the names of the Google Fonts in view, and those just below it,
|
|
33223
|
+
* in their own fonts. Setting every item's font up front would have the
|
|
33224
|
+
* browser look for each of the library's families among the installed
|
|
33225
|
+
* fonts the first time the list opens
|
|
33226
|
+
*/ __observeGoogleFonts() {
|
|
33227
|
+
this.j.async.requestAnimationFrame(()=>{
|
|
33228
|
+
var _this___observer;
|
|
33229
|
+
(_this___observer = this.__observer) === null || _this___observer === void 0 ? void 0 : _this___observer.disconnect();
|
|
33230
|
+
if (this.isDestructed || !this.__fonts.size) {
|
|
33231
|
+
return;
|
|
33232
|
+
}
|
|
33233
|
+
const observer = new IntersectionObserver((entries)=>{
|
|
33234
|
+
const fonts = [];
|
|
33235
|
+
entries.forEach(({ isIntersecting, target })=>{
|
|
33236
|
+
const font = this.__fonts.get(target);
|
|
33237
|
+
if (isIntersecting && font) {
|
|
33238
|
+
fonts.push(font);
|
|
33239
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(target, {
|
|
33240
|
+
fontFamily: this.__googleFonts.value(font)
|
|
33241
|
+
});
|
|
33242
|
+
observer.unobserve(target);
|
|
33243
|
+
}
|
|
33244
|
+
});
|
|
33245
|
+
this.__googleFonts.preview(fonts);
|
|
33246
|
+
}, {
|
|
33247
|
+
root: this.container.parentElement,
|
|
33248
|
+
rootMargin: '0px 0px 400px 0px'
|
|
33249
|
+
});
|
|
33250
|
+
this.__fonts.forEach((_, item)=>observer.observe(item));
|
|
33251
|
+
this.__observer = observer;
|
|
33252
|
+
});
|
|
33253
|
+
}
|
|
33254
|
+
/**
|
|
33255
|
+
* Keeps the editor's selection, as the toolbar buttons do
|
|
33256
|
+
*/ onMouseDown(e) {
|
|
33257
|
+
e.preventDefault();
|
|
33258
|
+
}
|
|
33259
|
+
onClick(e) {
|
|
33260
|
+
var _attr;
|
|
33261
|
+
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);
|
|
33262
|
+
if (!item) {
|
|
33263
|
+
return;
|
|
33264
|
+
}
|
|
33265
|
+
const value = (_attr = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(item, 'data-value')) !== null && _attr !== void 0 ? _attr : '', font = this.__googleFonts.find(value), // The font the text has anyway is taken off rather than written
|
|
33266
|
+
inherited = (0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(value) === (0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(this.__blockFont());
|
|
33267
|
+
font && !inherited && this.__googleFonts.load(font);
|
|
33268
|
+
this.j.execCommand('fontname', false, inherited ? '' : value);
|
|
33269
|
+
this.__close();
|
|
33270
|
+
}
|
|
33271
|
+
/**
|
|
33272
|
+
* The font the selected text has without a font of its own: its block's
|
|
33273
|
+
*/ __blockFont() {
|
|
33274
|
+
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);
|
|
33275
|
+
return (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(block !== null && block !== void 0 ? block : this.j.editor, 'font-family').toString();
|
|
33276
|
+
}
|
|
33277
|
+
destruct() {
|
|
33278
|
+
var _this___observer;
|
|
33279
|
+
(_this___observer = this.__observer) === null || _this___observer === void 0 ? void 0 : _this___observer.disconnect();
|
|
33280
|
+
super.destruct();
|
|
33281
|
+
}
|
|
33282
|
+
constructor(jodit, __button, __close){
|
|
33283
|
+
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;
|
|
33284
|
+
this.__googleFonts = jodit.getInstance(_google_fonts__WEBPACK_IMPORTED_MODULE_11__.GoogleFonts);
|
|
33285
|
+
this.__render();
|
|
33286
|
+
if (!this.__googleFonts.fonts.size) {
|
|
33287
|
+
this.__googleFonts.ready.then(()=>!this.isDestructed && this.__render());
|
|
33288
|
+
}
|
|
33289
|
+
}
|
|
33290
|
+
}
|
|
33291
|
+
;(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
33292
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_3__.watch)('container:mousedown')
|
|
33293
|
+
], UIFontPicker.prototype, "onMouseDown", null);
|
|
33294
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
33295
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_3__.watch)('container:click')
|
|
33296
|
+
], UIFontPicker.prototype, "onClick", null);
|
|
33297
|
+
UIFontPicker = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
33298
|
+
jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_2__.component
|
|
33299
|
+
], UIFontPicker);
|
|
33300
|
+
|
|
33301
|
+
|
|
32830
33302
|
/***/ }),
|
|
32831
33303
|
|
|
32832
33304
|
/***/ 50294:
|
|
@@ -32837,6 +33309,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.font = (0,_s
|
|
|
32837
33309
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28077);
|
|
32838
33310
|
/* harmony import */ var jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65946);
|
|
32839
33311
|
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7433);
|
|
33312
|
+
/* harmony import */ var _google_fonts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(24939);
|
|
32840
33313
|
/*!
|
|
32841
33314
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
32842
33315
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -32848,6 +33321,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.font = (0,_s
|
|
|
32848
33321
|
*/
|
|
32849
33322
|
|
|
32850
33323
|
|
|
33324
|
+
|
|
32851
33325
|
/**
|
|
32852
33326
|
* Process commands `fontsize` and `fontname`
|
|
32853
33327
|
*/ function font(editor) {
|
|
@@ -32858,6 +33332,18 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.font = (0,_s
|
|
|
32858
33332
|
name: 'fontsize',
|
|
32859
33333
|
group: 'font'
|
|
32860
33334
|
});
|
|
33335
|
+
if (editor.o.font.googleFonts.url) {
|
|
33336
|
+
const googleFonts = editor.getInstance(_google_fonts__WEBPACK_IMPORTED_MODULE_3__.GoogleFonts), loadUsed = editor.async.debounce(()=>googleFonts.loadUsed(), editor.defaultTimeout);
|
|
33337
|
+
googleFonts.ready.then(loadUsed);
|
|
33338
|
+
editor.e.on('afterInit afterSetMode change', loadUsed);
|
|
33339
|
+
}
|
|
33340
|
+
// An iframe's stylesheets can arrive after the toolbar first shows the
|
|
33341
|
+
// editor's font
|
|
33342
|
+
editor.e.on('afterInit', ()=>{
|
|
33343
|
+
editor.iframe && editor.e.on(editor.ed, 'load', ()=>editor.e.fire('updateToolbar'), {
|
|
33344
|
+
capture: true
|
|
33345
|
+
});
|
|
33346
|
+
});
|
|
32861
33347
|
const callback = (command, second, third)=>{
|
|
32862
33348
|
switch(command){
|
|
32863
33349
|
case 'fontsize':
|
|
@@ -32887,6 +33373,162 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.font = (0,_s
|
|
|
32887
33373
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_0__.pluginSystem.add('font', font);
|
|
32888
33374
|
|
|
32889
33375
|
|
|
33376
|
+
/***/ }),
|
|
33377
|
+
|
|
33378
|
+
/***/ 24939:
|
|
33379
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
33380
|
+
|
|
33381
|
+
"use strict";
|
|
33382
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
33383
|
+
/* harmony export */ GoogleFonts: function() { return /* binding */ GoogleFonts; },
|
|
33384
|
+
/* harmony export */ firstFamily: function() { return /* binding */ firstFamily; }
|
|
33385
|
+
/* harmony export */ });
|
|
33386
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
|
|
33387
|
+
/* harmony import */ var jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59609);
|
|
33388
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23211);
|
|
33389
|
+
/* harmony import */ var jodit_core_request_ajax__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17338);
|
|
33390
|
+
/*!
|
|
33391
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
33392
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
33393
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
33394
|
+
*/ /**
|
|
33395
|
+
* @module plugins/font
|
|
33396
|
+
*/
|
|
33397
|
+
|
|
33398
|
+
|
|
33399
|
+
|
|
33400
|
+
const CSS_URL = 'https://fonts.googleapis.com/css2';
|
|
33401
|
+
// `cursive` and `fantasy` stand in badly for a handwriting or display font
|
|
33402
|
+
const GENERIC_FAMILIES = {
|
|
33403
|
+
serif: 'serif',
|
|
33404
|
+
monospace: 'monospace'
|
|
33405
|
+
};
|
|
33406
|
+
const libraries = new Map();
|
|
33407
|
+
/**
|
|
33408
|
+
* The fonts of the library at `url`, fetched once for every editor on the page
|
|
33409
|
+
*/ function library(jodit, url) {
|
|
33410
|
+
let fonts = libraries.get(url);
|
|
33411
|
+
if (!fonts) {
|
|
33412
|
+
const ajax = new jodit_core_request_ajax__WEBPACK_IMPORTED_MODULE_3__.Ajax({
|
|
33413
|
+
url,
|
|
33414
|
+
method: 'GET'
|
|
33415
|
+
}, jodit.o.defaultAjaxOptions);
|
|
33416
|
+
fonts = ajax.send().then((response)=>response.json())// A font without a regular style can't be asked for by its name alone
|
|
33417
|
+
.then(({ items })=>items.filter((font)=>font.variants.includes('regular'))).catch(()=>{
|
|
33418
|
+
libraries.delete(url);
|
|
33419
|
+
return [];
|
|
33420
|
+
}).finally(()=>ajax.destruct());
|
|
33421
|
+
libraries.set(url, fonts);
|
|
33422
|
+
}
|
|
33423
|
+
return fonts;
|
|
33424
|
+
}
|
|
33425
|
+
/**
|
|
33426
|
+
* The first family of a `font-family` value, unquoted and in lower case for
|
|
33427
|
+
* comparing
|
|
33428
|
+
*/ function firstFamily(fontFamily) {
|
|
33429
|
+
return fontFamily.split(',')[0].replace(/["']/g, '').trim().toLowerCase();
|
|
33430
|
+
}
|
|
33431
|
+
/**
|
|
33432
|
+
* Loads fonts from Google Fonts: the whole of each font the content uses into
|
|
33433
|
+
* the editor's document, and just the letters of its name for the font list
|
|
33434
|
+
*/ class GoogleFonts extends jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_1__.ViewComponent {
|
|
33435
|
+
className() {
|
|
33436
|
+
return 'GoogleFonts';
|
|
33437
|
+
}
|
|
33438
|
+
/**
|
|
33439
|
+
* The library's font named first in a `font-family` value
|
|
33440
|
+
*/ find(fontFamily) {
|
|
33441
|
+
return this.fonts.get(firstFamily(fontFamily));
|
|
33442
|
+
}
|
|
33443
|
+
/**
|
|
33444
|
+
* The `font-family` value that applies a font
|
|
33445
|
+
*/ value(font) {
|
|
33446
|
+
var _GENERIC_FAMILIES_font_category;
|
|
33447
|
+
return `'${font.family}', ${(_GENERIC_FAMILIES_font_category = GENERIC_FAMILIES[font.category]) !== null && _GENERIC_FAMILIES_font_category !== void 0 ? _GENERIC_FAMILIES_font_category : 'sans-serif'}`;
|
|
33448
|
+
}
|
|
33449
|
+
/**
|
|
33450
|
+
* Loads the regular, italic, bold and bold italic styles that a font has
|
|
33451
|
+
* into the editor's document
|
|
33452
|
+
*/ load(font) {
|
|
33453
|
+
const loaded = this.__loadedInto(this.j.ed);
|
|
33454
|
+
if (loaded.has(font.family)) {
|
|
33455
|
+
return;
|
|
33456
|
+
}
|
|
33457
|
+
loaded.add(font.family);
|
|
33458
|
+
const styles = [
|
|
33459
|
+
[
|
|
33460
|
+
'regular',
|
|
33461
|
+
'0,400'
|
|
33462
|
+
],
|
|
33463
|
+
[
|
|
33464
|
+
'700',
|
|
33465
|
+
'0,700'
|
|
33466
|
+
],
|
|
33467
|
+
[
|
|
33468
|
+
'italic',
|
|
33469
|
+
'1,400'
|
|
33470
|
+
],
|
|
33471
|
+
[
|
|
33472
|
+
'700italic',
|
|
33473
|
+
'1,700'
|
|
33474
|
+
]
|
|
33475
|
+
].filter(([variant])=>font.variants.includes(variant)).map(([, style])=>style);
|
|
33476
|
+
this.__append(this.j.ed, `family=${this.__family(font)}:ital,wght@${styles.join(';')}`);
|
|
33477
|
+
}
|
|
33478
|
+
/**
|
|
33479
|
+
* Loads every font of the library that the content uses
|
|
33480
|
+
*/ loadUsed() {
|
|
33481
|
+
this.j.editor.querySelectorAll('[style*="font-family"]').forEach((element)=>{
|
|
33482
|
+
const font = this.find(element.style.fontFamily);
|
|
33483
|
+
font && this.load(font);
|
|
33484
|
+
});
|
|
33485
|
+
}
|
|
33486
|
+
/**
|
|
33487
|
+
* Loads into the page just the letters of each font's name, so the font
|
|
33488
|
+
* list can show the name in its font
|
|
33489
|
+
*/ preview(fonts) {
|
|
33490
|
+
const loaded = this.__loadedInto(this.j.od);
|
|
33491
|
+
fonts = fonts.filter((font)=>!this.__previewed.has(font.family) && !loaded.has(font.family));
|
|
33492
|
+
if (!fonts.length) {
|
|
33493
|
+
return;
|
|
33494
|
+
}
|
|
33495
|
+
fonts.forEach((font)=>this.__previewed.add(font.family));
|
|
33496
|
+
const families = fonts.map((font)=>`family=${this.__family(font)}`), letters = new Set(fonts.map((font)=>font.family).join(''));
|
|
33497
|
+
this.__append(this.j.od, `${families.join('&')}&text=${encodeURIComponent([
|
|
33498
|
+
...letters
|
|
33499
|
+
].join(''))}`);
|
|
33500
|
+
}
|
|
33501
|
+
__loadedInto(doc) {
|
|
33502
|
+
var _this___loaded_get;
|
|
33503
|
+
const loaded = (_this___loaded_get = this.__loaded.get(doc)) !== null && _this___loaded_get !== void 0 ? _this___loaded_get : new Set();
|
|
33504
|
+
this.__loaded.set(doc, loaded);
|
|
33505
|
+
return loaded;
|
|
33506
|
+
}
|
|
33507
|
+
__family(font) {
|
|
33508
|
+
return encodeURIComponent(font.family).replace(/%20/g, '+');
|
|
33509
|
+
}
|
|
33510
|
+
__append(doc, query) {
|
|
33511
|
+
const link = doc.createElement('link');
|
|
33512
|
+
link.rel = 'stylesheet';
|
|
33513
|
+
link.href = `${CSS_URL}?${query}&display=swap`;
|
|
33514
|
+
doc.head.appendChild(link);
|
|
33515
|
+
this.__links.push(link);
|
|
33516
|
+
}
|
|
33517
|
+
destruct() {
|
|
33518
|
+
this.__links.forEach((link)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.safeRemove(link));
|
|
33519
|
+
super.destruct();
|
|
33520
|
+
}
|
|
33521
|
+
constructor(jodit){
|
|
33522
|
+
super(jodit), /**
|
|
33523
|
+
* The library by lower-case family, empty until it arrives
|
|
33524
|
+
*/ (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());
|
|
33525
|
+
this.ready = library(jodit, jodit.o.font.googleFonts.url).then((fonts)=>{
|
|
33526
|
+
fonts.forEach((font)=>this.fonts.set(font.family.toLowerCase(), font));
|
|
33527
|
+
});
|
|
33528
|
+
}
|
|
33529
|
+
}
|
|
33530
|
+
|
|
33531
|
+
|
|
32890
33532
|
/***/ }),
|
|
32891
33533
|
|
|
32892
33534
|
/***/ 96863:
|
|
@@ -34157,12 +34799,13 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.pluginSystem.add('imageProperties
|
|
|
34157
34799
|
/* harmony export */ readValuesFromImage: function() { return /* binding */ readValuesFromImage; }
|
|
34158
34800
|
/* harmony export */ });
|
|
34159
34801
|
/* harmony import */ var _swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(49376);
|
|
34160
|
-
/* harmony import */ var
|
|
34161
|
-
/* harmony import */ var
|
|
34162
|
-
/* harmony import */ var
|
|
34163
|
-
/* harmony import */ var
|
|
34164
|
-
/* harmony import */ var
|
|
34165
|
-
/* harmony import */ var
|
|
34802
|
+
/* harmony import */ var jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16849);
|
|
34803
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7909);
|
|
34804
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80991);
|
|
34805
|
+
/* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26633);
|
|
34806
|
+
/* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(79310);
|
|
34807
|
+
/* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(18380);
|
|
34808
|
+
/* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(57339);
|
|
34166
34809
|
/*!
|
|
34167
34810
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
34168
34811
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -34176,33 +34819,34 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.pluginSystem.add('imageProperties
|
|
|
34176
34819
|
|
|
34177
34820
|
|
|
34178
34821
|
|
|
34822
|
+
|
|
34179
34823
|
/**
|
|
34180
34824
|
* Read values from image and set it to state
|
|
34181
34825
|
* @private
|
|
34182
34826
|
*/ function readValuesFromImage(j, state) {
|
|
34183
34827
|
return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function*() {
|
|
34184
34828
|
const { sourceImage: image, values } = state;
|
|
34185
|
-
(0,
|
|
34829
|
+
(0,_align__WEBPACK_IMPORTED_MODULE_4__.readAlign)(image, values, (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_1__.getAlignClasses)(j, image));
|
|
34186
34830
|
// Border radius
|
|
34187
|
-
values.borderRadius = parseInt((0,
|
|
34831
|
+
values.borderRadius = parseInt((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.cssInline)(image, 'border-radius') || '0', 10) || 0;
|
|
34188
34832
|
// Id
|
|
34189
|
-
values.id = (0,
|
|
34833
|
+
values.id = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id') || '';
|
|
34190
34834
|
// Title
|
|
34191
|
-
values.imageTitle = (0,
|
|
34835
|
+
values.imageTitle = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title') || '';
|
|
34192
34836
|
// Alt
|
|
34193
|
-
values.imageAlt = (0,
|
|
34837
|
+
values.imageAlt = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt') || '';
|
|
34194
34838
|
// Style
|
|
34195
|
-
values.style = (0,
|
|
34839
|
+
values.style = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style') || '';
|
|
34196
34840
|
// Classes
|
|
34197
|
-
values.classes = ((0,
|
|
34841
|
+
values.classes = ((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
|
|
34198
34842
|
// Margins
|
|
34199
|
-
(0,
|
|
34843
|
+
(0,_margin__WEBPACK_IMPORTED_MODULE_6__.readMargins)(image, values, state);
|
|
34200
34844
|
// Link
|
|
34201
|
-
(0,
|
|
34845
|
+
(0,_link__WEBPACK_IMPORTED_MODULE_5__.readLink)(state, j, values);
|
|
34202
34846
|
// Src
|
|
34203
|
-
values.imageSrc = (0,
|
|
34847
|
+
values.imageSrc = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '';
|
|
34204
34848
|
// Image size
|
|
34205
|
-
return (0,
|
|
34849
|
+
return (0,_size__WEBPACK_IMPORTED_MODULE_7__.readSizes)(image, values, state);
|
|
34206
34850
|
})();
|
|
34207
34851
|
}
|
|
34208
34852
|
|
|
@@ -35234,7 +35878,7 @@ UIImagePositionTab = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
35234
35878
|
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'id', id || null);
|
|
35235
35879
|
}
|
|
35236
35880
|
if (opt.image.editAlign) {
|
|
35237
|
-
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(image, align,
|
|
35881
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(image, align, (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.getAlignClasses)(j, image));
|
|
35238
35882
|
}
|
|
35239
35883
|
}
|
|
35240
35884
|
|
|
@@ -36067,6 +36711,7 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
|
|
|
36067
36711
|
/* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85932);
|
|
36068
36712
|
/* harmony import */ var jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16849);
|
|
36069
36713
|
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80991);
|
|
36714
|
+
/* harmony import */ var jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(83314);
|
|
36070
36715
|
/*!
|
|
36071
36716
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
36072
36717
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -36077,9 +36722,7 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
|
|
|
36077
36722
|
|
|
36078
36723
|
|
|
36079
36724
|
|
|
36080
|
-
|
|
36081
|
-
// keep inline styles
|
|
36082
|
-
const alignClasses = (editor, elm)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(elm, 'img') ? editor.o.imageAlignClasses : null;
|
|
36725
|
+
|
|
36083
36726
|
// A Normal image sits where the text of its line is aligned (#1531)
|
|
36084
36727
|
const lineAlign = (editor, elm)=>{
|
|
36085
36728
|
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;
|
|
@@ -36100,7 +36743,7 @@ const lineAlign = (editor, elm)=>{
|
|
|
36100
36743
|
return 'left';
|
|
36101
36744
|
}
|
|
36102
36745
|
};
|
|
36103
|
-
const currentAlign = (editor, elm)=>elm ? (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__.getHAlign)(elm,
|
|
36746
|
+
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';
|
|
36104
36747
|
const align = {
|
|
36105
36748
|
name: 'left',
|
|
36106
36749
|
childTemplate: (_, __, value)=>value,
|
|
@@ -36121,23 +36764,25 @@ const align = {
|
|
|
36121
36764
|
return (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__.isString)(value) && currentAlign(editor, button.target) === value.toLowerCase();
|
|
36122
36765
|
},
|
|
36123
36766
|
exec: (editor, elm, { control })=>{
|
|
36124
|
-
|
|
36767
|
+
// A media wrapper kept in the content (`mediaWrappers`) is aligned itself
|
|
36768
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(elm) || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(elm, new Set([
|
|
36125
36769
|
'img',
|
|
36126
36770
|
'jodit',
|
|
36127
36771
|
'jodit-media'
|
|
36128
|
-
]))) {
|
|
36772
|
+
])) && (0,jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_4__.getMediaWrapper)(editor, elm) !== elm) {
|
|
36129
36773
|
return;
|
|
36130
36774
|
}
|
|
36131
36775
|
const command = control.args && (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__.isString)(control.args[0]) ? control.args[0].toLowerCase() : '';
|
|
36132
36776
|
if (!command) {
|
|
36133
36777
|
return false;
|
|
36134
36778
|
}
|
|
36135
|
-
;(0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__.hAlignElement)(elm, command,
|
|
36779
|
+
;(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));
|
|
36136
36780
|
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(elm, new Set([
|
|
36137
36781
|
'jodit',
|
|
36138
36782
|
'jodit-media'
|
|
36139
36783
|
])) && elm.firstElementChild) {
|
|
36140
|
-
|
|
36784
|
+
const media = elm.firstElementChild;
|
|
36785
|
+
(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));
|
|
36141
36786
|
}
|
|
36142
36787
|
editor.synchronizeValues();
|
|
36143
36788
|
editor.e.fire('recalcPositionPopup');
|
|
@@ -36289,9 +36934,11 @@ const align = {
|
|
|
36289
36934
|
return (0,jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_9__.makeCollection)(this.jodit, this.popup);
|
|
36290
36935
|
}
|
|
36291
36936
|
onClick(node) {
|
|
36292
|
-
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);
|
|
36293
|
-
|
|
36294
|
-
|
|
36937
|
+
const elements = this.elmsList, mediaWrapper = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.getMediaWrapper)(this.j, node), target = mediaWrapper !== null && mediaWrapper !== void 0 ? 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);
|
|
36938
|
+
// A media wrapper kept in the content gets the media popup
|
|
36939
|
+
const type = mediaWrapper ? 'jodit-media' : target === null || target === void 0 ? void 0 : target.nodeName.toLowerCase();
|
|
36940
|
+
if (target && type && this.canShowPopupForType(type)) {
|
|
36941
|
+
this.showPopup(()=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.position)(target, this.j), type, target);
|
|
36295
36942
|
return false;
|
|
36296
36943
|
}
|
|
36297
36944
|
}
|
|
@@ -36474,7 +37121,12 @@ const align = {
|
|
|
36474
37121
|
this.removeListenersForElements();
|
|
36475
37122
|
}
|
|
36476
37123
|
_eventsList() {
|
|
36477
|
-
|
|
37124
|
+
var _this_j_o_mediaWrappers;
|
|
37125
|
+
// Clicks on a media wrapper kept in the content (`mediaWrappers`)
|
|
37126
|
+
const wrapperTags = Object.values((_this_j_o_mediaWrappers = this.j.o.mediaWrappers) !== null && _this_j_o_mediaWrappers !== void 0 ? _this_j_o_mediaWrappers : {}).map(({ tag })=>tag.toLowerCase());
|
|
37127
|
+
const el = [
|
|
37128
|
+
...new Set(this.elmsList.concat(wrapperTags))
|
|
37129
|
+
];
|
|
36478
37130
|
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(' ');
|
|
36479
37131
|
}
|
|
36480
37132
|
addListenersForElements() {
|
|
@@ -38016,6 +38668,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaBlocks = [
|
|
|
38016
38668
|
'video',
|
|
38017
38669
|
'audio'
|
|
38018
38670
|
];
|
|
38671
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
|
|
38019
38672
|
|
|
38020
38673
|
|
|
38021
38674
|
/***/ }),
|
|
@@ -38049,11 +38702,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaBlocks = [
|
|
|
38049
38702
|
* Process `video` and `audio`
|
|
38050
38703
|
*/ function media(editor) {
|
|
38051
38704
|
const keyFake = 'jodit_fake_wrapper';
|
|
38052
|
-
const { mediaFakeTag, mediaBlocks, mediaInFakeBlock } = editor.options;
|
|
38705
|
+
const { mediaFakeTag, mediaBlocks, mediaInFakeBlock, mediaWrappers } = editor.options;
|
|
38053
38706
|
const wrap = (element)=>{
|
|
38054
38707
|
if (element.parentNode && (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(element.parentNode, 'data-jodit_iframe_wrapper')) {
|
|
38055
38708
|
element = element.parentNode;
|
|
38056
|
-
} else {
|
|
38709
|
+
} else if (mediaWrappers[element.nodeName.toLowerCase()]) {
|
|
38710
|
+
var _getMediaWrapper;
|
|
38711
|
+
element = (_getMediaWrapper = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.getMediaWrapper)(editor, element)) !== null && _getMediaWrapper !== void 0 ? _getMediaWrapper : (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.wrapMedia)(editor, element);
|
|
38712
|
+
} else if (mediaInFakeBlock) {
|
|
38057
38713
|
const wrapper = editor.createInside.element(mediaFakeTag, {
|
|
38058
38714
|
'data-jodit-temp': 1,
|
|
38059
38715
|
contenteditable: false,
|
|
@@ -38071,12 +38727,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaBlocks = [
|
|
|
38071
38727
|
}
|
|
38072
38728
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(wrapper, element);
|
|
38073
38729
|
element = wrapper;
|
|
38730
|
+
} else {
|
|
38731
|
+
return;
|
|
38074
38732
|
}
|
|
38075
38733
|
editor.e.off(element, 'mousedown.select touchstart.select').on(element, 'mousedown.select touchstart.select', ()=>{
|
|
38076
38734
|
editor.s.setCursorAfter(element);
|
|
38077
38735
|
});
|
|
38078
38736
|
};
|
|
38079
|
-
if (mediaInFakeBlock) {
|
|
38737
|
+
if (mediaInFakeBlock || Object.keys(mediaWrappers).length) {
|
|
38080
38738
|
editor.e.on('afterGetValueFromEditor', (data)=>{
|
|
38081
38739
|
const rxp = new RegExp(`<${mediaFakeTag}[^>]+data-${keyFake}[^>]+>([^]+?)</${mediaFakeTag}>`, 'ig');
|
|
38082
38740
|
if (rxp.test(data.value)) {
|
|
@@ -45802,15 +46460,33 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.pluginSystem.add('toolbarNavigati
|
|
|
45802
46460
|
|
|
45803
46461
|
|
|
45804
46462
|
|
|
46463
|
+
// Media the popup inserts go in their wrapper (see `mediaWrappers`), aligned
|
|
46464
|
+
// with `mediaDefaultAlign`
|
|
46465
|
+
function prepareMedia(jodit, element) {
|
|
46466
|
+
const media = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.wrapMedia)(jodit, element);
|
|
46467
|
+
const { mediaDefaultAlign } = jodit.o;
|
|
46468
|
+
if (mediaDefaultAlign && mediaDefaultAlign !== 'normal') {
|
|
46469
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.hAlignElement)(media, mediaDefaultAlign, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.getAlignClasses)(jodit, media));
|
|
46470
|
+
}
|
|
46471
|
+
return media;
|
|
46472
|
+
}
|
|
45805
46473
|
function insertVideos(data) {
|
|
45806
46474
|
var _data_files;
|
|
45807
46475
|
(_data_files = data.files) === null || _data_files === void 0 ? void 0 : _data_files.forEach((file)=>{
|
|
45808
|
-
this.s.insertNode(this.createInside.element('video', {
|
|
46476
|
+
this.s.insertNode(prepareMedia(this, this.createInside.element('video', {
|
|
45809
46477
|
controls: '',
|
|
45810
46478
|
src: data.baseurl + file
|
|
45811
|
-
}));
|
|
46479
|
+
})));
|
|
45812
46480
|
});
|
|
45813
46481
|
}
|
|
46482
|
+
// Embed code that is one element is prepared as media; other code goes in as
|
|
46483
|
+
// it is
|
|
46484
|
+
function prepareEmbedCode(jodit, code) {
|
|
46485
|
+
const box = jodit.createInside.div();
|
|
46486
|
+
box.innerHTML = code.trim();
|
|
46487
|
+
const element = box.firstElementChild;
|
|
46488
|
+
return element && box.childNodes.length === 1 ? prepareMedia(jodit, element) : code;
|
|
46489
|
+
}
|
|
45814
46490
|
jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.video = {
|
|
45815
46491
|
parseUrlToVideoEmbed: jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed,
|
|
45816
46492
|
defaultWidth: 400,
|
|
@@ -45848,7 +46524,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.video = {
|
|
|
45848
46524
|
])
|
|
45849
46525
|
]), tabs = [], insertCode = (code)=>{
|
|
45850
46526
|
jodit.s.restore();
|
|
45851
|
-
jodit.s.insertHTML(code);
|
|
46527
|
+
jodit.s.insertHTML(prepareEmbedCode(jodit, code));
|
|
45852
46528
|
close();
|
|
45853
46529
|
};
|
|
45854
46530
|
jodit.s.save();
|