jodit 4.17.6 → 4.18.0
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 +10 -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 +789 -130
- 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 +769 -130
- 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 +12 -12
- package/es2021.en/jodit.js +769 -130
- 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 +1054 -190
- 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/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.0
|
|
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.0";
|
|
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);
|
|
@@ -32665,14 +32853,16 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('focus', focus);
|
|
|
32665
32853
|
/* harmony import */ var _swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41411);
|
|
32666
32854
|
/* harmony import */ var _swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15366);
|
|
32667
32855
|
/* 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
|
|
32856
|
+
/* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17312);
|
|
32857
|
+
/* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4040);
|
|
32858
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80991);
|
|
32859
|
+
/* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(29434);
|
|
32860
|
+
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5266);
|
|
32861
|
+
/* harmony import */ var _icons_font_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(48842);
|
|
32862
|
+
/* harmony import */ var _icons_font_svg__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_icons_font_svg__WEBPACK_IMPORTED_MODULE_8__);
|
|
32863
|
+
/* harmony import */ var _icons_fontsize_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(25501);
|
|
32864
|
+
/* harmony import */ var _icons_fontsize_svg__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_icons_fontsize_svg__WEBPACK_IMPORTED_MODULE_9__);
|
|
32865
|
+
/* harmony import */ var _font_picker__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(80045);
|
|
32676
32866
|
/*!
|
|
32677
32867
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
32678
32868
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -32688,11 +32878,18 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('focus', focus);
|
|
|
32688
32878
|
|
|
32689
32879
|
|
|
32690
32880
|
|
|
32881
|
+
|
|
32882
|
+
|
|
32691
32883
|
/**
|
|
32692
32884
|
* Default font-size points
|
|
32693
|
-
*/
|
|
32694
|
-
|
|
32695
|
-
|
|
32885
|
+
*/ jodit_config__WEBPACK_IMPORTED_MODULE_7__.Config.prototype.defaultFontSizePoints = 'px';
|
|
32886
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_7__.Config.prototype.font = {
|
|
32887
|
+
googleFonts: {
|
|
32888
|
+
url: ''
|
|
32889
|
+
}
|
|
32890
|
+
};
|
|
32891
|
+
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()));
|
|
32892
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_7__.Config.prototype.controls.fontsize = {
|
|
32696
32893
|
command: 'fontsize',
|
|
32697
32894
|
data: {
|
|
32698
32895
|
cssRule: 'font-size',
|
|
@@ -32738,7 +32935,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.fontsize = {
|
|
|
32738
32935
|
}
|
|
32739
32936
|
const control = button.control;
|
|
32740
32937
|
const cssKey = ((_control_data = control.data) === null || _control_data === void 0 ? void 0 : _control_data.cssRule) || 'font-size';
|
|
32741
|
-
const value = (0,
|
|
32938
|
+
const value = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(box, cssKey);
|
|
32742
32939
|
if (cssKey === 'font-size') {
|
|
32743
32940
|
const numValue = parseFloat(value.toString());
|
|
32744
32941
|
if (editor.o.defaultFontSizePoints === 'pt') {
|
|
@@ -32772,11 +32969,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.fontsize = {
|
|
|
32772
32969
|
return keySet.has(normalize(value.toString()));
|
|
32773
32970
|
}
|
|
32774
32971
|
};
|
|
32775
|
-
|
|
32972
|
+
const hadSelection = new WeakSet();
|
|
32973
|
+
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
32974
|
command: 'fontname',
|
|
32777
32975
|
textTemplate: (j, value)=>{
|
|
32778
32976
|
const [first] = value.split(',');
|
|
32779
|
-
return (0,
|
|
32977
|
+
return (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_4__.trimChars)(first, '"\'');
|
|
32780
32978
|
},
|
|
32781
32979
|
list: {
|
|
32782
32980
|
'': 'Default',
|
|
@@ -32798,6 +32996,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.font = (0,_s
|
|
|
32798
32996
|
} catch (unused) {}
|
|
32799
32997
|
return `<span data-style="${key}" style="${isAvailable ? `font-family: ${key}!important;` : ''}">${value}</span>`;
|
|
32800
32998
|
},
|
|
32999
|
+
popup: (editor, current, close, button)=>editor.o.font.googleFonts.url ? new _font_picker__WEBPACK_IMPORTED_MODULE_10__.UIFontPicker(editor, button, close) : false,
|
|
32801
33000
|
data: {
|
|
32802
33001
|
cssRule: 'font-family',
|
|
32803
33002
|
normalize: (v)=>{
|
|
@@ -32806,19 +33005,19 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.font = (0,_s
|
|
|
32806
33005
|
},
|
|
32807
33006
|
// When no font is explicitly set, the computed font-family equals the
|
|
32808
33007
|
// 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 (
|
|
33008
|
+
// button shows the list's `Default` entry, when it has one, instead of
|
|
33009
|
+
// that raw stack. See #1370
|
|
33010
|
+
value: (editor, button)=>{
|
|
33011
|
+
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);
|
|
33012
|
+
// Until there is a selection the button shows the editor's own font,
|
|
33013
|
+
// and afterwards the font of the last one
|
|
33014
|
+
if (box) {
|
|
33015
|
+
hadSelection.add(button);
|
|
33016
|
+
} else if (hadSelection.has(button)) {
|
|
32818
33017
|
return;
|
|
32819
33018
|
}
|
|
32820
|
-
const value = (0,
|
|
32821
|
-
if (value === (0,
|
|
33019
|
+
const value = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(box || editor.editor, 'font-family').toString(), { list } = button.control;
|
|
33020
|
+
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
33021
|
return '';
|
|
32823
33022
|
}
|
|
32824
33023
|
return value;
|
|
@@ -32827,6 +33026,262 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.font = (0,_s
|
|
|
32827
33026
|
});
|
|
32828
33027
|
|
|
32829
33028
|
|
|
33029
|
+
/***/ }),
|
|
33030
|
+
|
|
33031
|
+
/***/ 80045:
|
|
33032
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
33033
|
+
|
|
33034
|
+
"use strict";
|
|
33035
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
33036
|
+
/* harmony export */ UIFontPicker: function() { return /* binding */ UIFontPicker; }
|
|
33037
|
+
/* harmony export */ });
|
|
33038
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
|
|
33039
|
+
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
|
|
33040
|
+
/* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(91672);
|
|
33041
|
+
/* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(68616);
|
|
33042
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23211);
|
|
33043
|
+
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28077);
|
|
33044
|
+
/* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(17312);
|
|
33045
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7909);
|
|
33046
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
|
|
33047
|
+
/* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(71125);
|
|
33048
|
+
/* harmony import */ var jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(96007);
|
|
33049
|
+
/* harmony import */ var _google_fonts__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(24939);
|
|
33050
|
+
/*!
|
|
33051
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
33052
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
33053
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
33054
|
+
*/ /**
|
|
33055
|
+
* @module plugins/font
|
|
33056
|
+
*/
|
|
33057
|
+
|
|
33058
|
+
|
|
33059
|
+
|
|
33060
|
+
|
|
33061
|
+
|
|
33062
|
+
|
|
33063
|
+
|
|
33064
|
+
|
|
33065
|
+
|
|
33066
|
+
|
|
33067
|
+
|
|
33068
|
+
|
|
33069
|
+
const HEADINGS = [
|
|
33070
|
+
'h1',
|
|
33071
|
+
'h2',
|
|
33072
|
+
'h3',
|
|
33073
|
+
'h4',
|
|
33074
|
+
'h5',
|
|
33075
|
+
'h6'
|
|
33076
|
+
];
|
|
33077
|
+
const GENERIC_FAMILIES = new Set([
|
|
33078
|
+
'serif',
|
|
33079
|
+
'sans-serif',
|
|
33080
|
+
'monospace',
|
|
33081
|
+
'cursive',
|
|
33082
|
+
'fantasy',
|
|
33083
|
+
'system-ui',
|
|
33084
|
+
'ui-serif',
|
|
33085
|
+
'ui-sans-serif',
|
|
33086
|
+
'ui-monospace',
|
|
33087
|
+
'ui-rounded'
|
|
33088
|
+
]);
|
|
33089
|
+
/**
|
|
33090
|
+
* A family that names a font, not a generic family or a vendor keyword such
|
|
33091
|
+
* as `-apple-system`
|
|
33092
|
+
*/ function isFontName(family) {
|
|
33093
|
+
return Boolean(family) && !family.startsWith('-') && !GENERIC_FAMILIES.has(family);
|
|
33094
|
+
}
|
|
33095
|
+
class UIFontPicker extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_10__.UIElement {
|
|
33096
|
+
className() {
|
|
33097
|
+
return 'UIFontPicker';
|
|
33098
|
+
}
|
|
33099
|
+
__render() {
|
|
33100
|
+
var _ref;
|
|
33101
|
+
var _control_value;
|
|
33102
|
+
const { control } = this.__button, { list = {} } = control, listed = (0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_6__.isArray)(list) ? list.map((key)=>({
|
|
33103
|
+
value: key.toString(),
|
|
33104
|
+
title: key.toString()
|
|
33105
|
+
})) : (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_9__.keys)(list, false).map((key)=>({
|
|
33106
|
+
value: key,
|
|
33107
|
+
title: list[key].toString()
|
|
33108
|
+
})), google = Array.from(this.__googleFonts.fonts.values(), (font)=>({
|
|
33109
|
+
value: this.__googleFonts.value(font),
|
|
33110
|
+
title: font.family,
|
|
33111
|
+
font
|
|
33112
|
+
})), byFamily = new Map();
|
|
33113
|
+
[
|
|
33114
|
+
...google,
|
|
33115
|
+
...listed
|
|
33116
|
+
].forEach((entry)=>byFamily.set((0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(entry.value), entry));
|
|
33117
|
+
const theme = new Map(), used = new Map();
|
|
33118
|
+
// The theme's own fonts are listed too, so its body font can be chosen
|
|
33119
|
+
// to take a font off
|
|
33120
|
+
this.__themeFonts().forEach((fontFamily)=>{
|
|
33121
|
+
var _byFamily_get;
|
|
33122
|
+
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) ? {
|
|
33123
|
+
value: fontFamily,
|
|
33124
|
+
title
|
|
33125
|
+
} : undefined;
|
|
33126
|
+
entry && !theme.has(family) && theme.set(family, entry);
|
|
33127
|
+
});
|
|
33128
|
+
this.__usedFonts().forEach((fontFamily)=>{
|
|
33129
|
+
const family = (0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(fontFamily), entry = byFamily.get(family);
|
|
33130
|
+
entry && !theme.has(family) && used.set(family, entry);
|
|
33131
|
+
});
|
|
33132
|
+
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 : '');
|
|
33133
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.detach(this.container);
|
|
33134
|
+
this.__fonts.clear();
|
|
33135
|
+
defaultEntry && this.__append(current, [
|
|
33136
|
+
defaultEntry
|
|
33137
|
+
]);
|
|
33138
|
+
this.__append(current, [
|
|
33139
|
+
...theme.values()
|
|
33140
|
+
], 'Theme fonts');
|
|
33141
|
+
this.__append(current, [
|
|
33142
|
+
...used.values()
|
|
33143
|
+
], 'Used fonts');
|
|
33144
|
+
this.__append(current, listed.filter((entry)=>entry !== defaultEntry), 'System fonts');
|
|
33145
|
+
this.__append(current, google, 'Google Fonts');
|
|
33146
|
+
this.__observeGoogleFonts();
|
|
33147
|
+
}
|
|
33148
|
+
/**
|
|
33149
|
+
* The fonts the editor's styles give text and each heading
|
|
33150
|
+
*/ __themeFonts() {
|
|
33151
|
+
const { editor } = this.j, fonts = [
|
|
33152
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(editor, 'font-family').toString()
|
|
33153
|
+
];
|
|
33154
|
+
HEADINGS.forEach((tag)=>{
|
|
33155
|
+
const heading = this.j.createInside.element(tag, {
|
|
33156
|
+
style: 'display: none'
|
|
33157
|
+
});
|
|
33158
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(editor, heading);
|
|
33159
|
+
fonts.push((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(heading, 'font-family').toString());
|
|
33160
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(heading);
|
|
33161
|
+
});
|
|
33162
|
+
return fonts;
|
|
33163
|
+
}
|
|
33164
|
+
/**
|
|
33165
|
+
* The fonts the content sets
|
|
33166
|
+
*/ __usedFonts() {
|
|
33167
|
+
return Array.from(this.j.editor.querySelectorAll('[style*="font-family"]'), (element)=>element.style.fontFamily);
|
|
33168
|
+
}
|
|
33169
|
+
__append(current, entries, heading) {
|
|
33170
|
+
if (!entries.length) {
|
|
33171
|
+
return;
|
|
33172
|
+
}
|
|
33173
|
+
const { control } = this.__button, group = this.j.c.div(this.getFullElName('group'));
|
|
33174
|
+
if (heading) {
|
|
33175
|
+
const title = this.j.c.div(this.getFullElName('heading'), {
|
|
33176
|
+
id: `${this.getFullElName('heading')}-${(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.uniqueUid)()}`
|
|
33177
|
+
});
|
|
33178
|
+
title.textContent = this.i18n(heading);
|
|
33179
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(group, {
|
|
33180
|
+
role: 'group',
|
|
33181
|
+
'aria-labelledby': title.id
|
|
33182
|
+
});
|
|
33183
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(group, title);
|
|
33184
|
+
}
|
|
33185
|
+
entries.forEach((entry)=>{
|
|
33186
|
+
const item = this.j.c.element('button', {
|
|
33187
|
+
type: 'button',
|
|
33188
|
+
class: this.getFullElName('item'),
|
|
33189
|
+
'data-value': entry.value,
|
|
33190
|
+
'aria-pressed': (0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(entry.value) === current
|
|
33191
|
+
});
|
|
33192
|
+
if (entry.font) {
|
|
33193
|
+
item.textContent = entry.title;
|
|
33194
|
+
this.__fonts.set(item, entry.font);
|
|
33195
|
+
} else {
|
|
33196
|
+
var _ref;
|
|
33197
|
+
var _control_childTemplate;
|
|
33198
|
+
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;
|
|
33199
|
+
}
|
|
33200
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(group, item);
|
|
33201
|
+
});
|
|
33202
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(this.container, group);
|
|
33203
|
+
}
|
|
33204
|
+
/**
|
|
33205
|
+
* Shows the names of the Google Fonts in view, and those just below it,
|
|
33206
|
+
* in their own fonts. Setting every item's font up front would have the
|
|
33207
|
+
* browser look for each of the library's families among the installed
|
|
33208
|
+
* fonts the first time the list opens
|
|
33209
|
+
*/ __observeGoogleFonts() {
|
|
33210
|
+
this.j.async.requestAnimationFrame(()=>{
|
|
33211
|
+
var _this___observer;
|
|
33212
|
+
(_this___observer = this.__observer) === null || _this___observer === void 0 ? void 0 : _this___observer.disconnect();
|
|
33213
|
+
if (this.isDestructed || !this.__fonts.size) {
|
|
33214
|
+
return;
|
|
33215
|
+
}
|
|
33216
|
+
const observer = new IntersectionObserver((entries)=>{
|
|
33217
|
+
const fonts = [];
|
|
33218
|
+
entries.forEach(({ isIntersecting, target })=>{
|
|
33219
|
+
const font = this.__fonts.get(target);
|
|
33220
|
+
if (isIntersecting && font) {
|
|
33221
|
+
fonts.push(font);
|
|
33222
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(target, {
|
|
33223
|
+
fontFamily: this.__googleFonts.value(font)
|
|
33224
|
+
});
|
|
33225
|
+
observer.unobserve(target);
|
|
33226
|
+
}
|
|
33227
|
+
});
|
|
33228
|
+
this.__googleFonts.preview(fonts);
|
|
33229
|
+
}, {
|
|
33230
|
+
root: this.container.parentElement,
|
|
33231
|
+
rootMargin: '0px 0px 400px 0px'
|
|
33232
|
+
});
|
|
33233
|
+
this.__fonts.forEach((_, item)=>observer.observe(item));
|
|
33234
|
+
this.__observer = observer;
|
|
33235
|
+
});
|
|
33236
|
+
}
|
|
33237
|
+
/**
|
|
33238
|
+
* Keeps the editor's selection, as the toolbar buttons do
|
|
33239
|
+
*/ onMouseDown(e) {
|
|
33240
|
+
e.preventDefault();
|
|
33241
|
+
}
|
|
33242
|
+
onClick(e) {
|
|
33243
|
+
var _attr;
|
|
33244
|
+
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);
|
|
33245
|
+
if (!item) {
|
|
33246
|
+
return;
|
|
33247
|
+
}
|
|
33248
|
+
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
|
|
33249
|
+
inherited = (0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(value) === (0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(this.__blockFont());
|
|
33250
|
+
font && !inherited && this.__googleFonts.load(font);
|
|
33251
|
+
this.j.execCommand('fontname', false, inherited ? '' : value);
|
|
33252
|
+
this.__close();
|
|
33253
|
+
}
|
|
33254
|
+
/**
|
|
33255
|
+
* The font the selected text has without a font of its own: its block's
|
|
33256
|
+
*/ __blockFont() {
|
|
33257
|
+
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);
|
|
33258
|
+
return (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(block !== null && block !== void 0 ? block : this.j.editor, 'font-family').toString();
|
|
33259
|
+
}
|
|
33260
|
+
destruct() {
|
|
33261
|
+
var _this___observer;
|
|
33262
|
+
(_this___observer = this.__observer) === null || _this___observer === void 0 ? void 0 : _this___observer.disconnect();
|
|
33263
|
+
super.destruct();
|
|
33264
|
+
}
|
|
33265
|
+
constructor(jodit, __button, __close){
|
|
33266
|
+
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;
|
|
33267
|
+
this.__googleFonts = jodit.getInstance(_google_fonts__WEBPACK_IMPORTED_MODULE_11__.GoogleFonts);
|
|
33268
|
+
this.__render();
|
|
33269
|
+
if (!this.__googleFonts.fonts.size) {
|
|
33270
|
+
this.__googleFonts.ready.then(()=>!this.isDestructed && this.__render());
|
|
33271
|
+
}
|
|
33272
|
+
}
|
|
33273
|
+
}
|
|
33274
|
+
;(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
33275
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_3__.watch)('container:mousedown')
|
|
33276
|
+
], UIFontPicker.prototype, "onMouseDown", null);
|
|
33277
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
33278
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_3__.watch)('container:click')
|
|
33279
|
+
], UIFontPicker.prototype, "onClick", null);
|
|
33280
|
+
UIFontPicker = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
33281
|
+
jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_2__.component
|
|
33282
|
+
], UIFontPicker);
|
|
33283
|
+
|
|
33284
|
+
|
|
32830
33285
|
/***/ }),
|
|
32831
33286
|
|
|
32832
33287
|
/***/ 50294:
|
|
@@ -32837,6 +33292,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.font = (0,_s
|
|
|
32837
33292
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28077);
|
|
32838
33293
|
/* harmony import */ var jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65946);
|
|
32839
33294
|
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7433);
|
|
33295
|
+
/* harmony import */ var _google_fonts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(24939);
|
|
32840
33296
|
/*!
|
|
32841
33297
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
32842
33298
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -32848,6 +33304,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.font = (0,_s
|
|
|
32848
33304
|
*/
|
|
32849
33305
|
|
|
32850
33306
|
|
|
33307
|
+
|
|
32851
33308
|
/**
|
|
32852
33309
|
* Process commands `fontsize` and `fontname`
|
|
32853
33310
|
*/ function font(editor) {
|
|
@@ -32858,6 +33315,18 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.font = (0,_s
|
|
|
32858
33315
|
name: 'fontsize',
|
|
32859
33316
|
group: 'font'
|
|
32860
33317
|
});
|
|
33318
|
+
if (editor.o.font.googleFonts.url) {
|
|
33319
|
+
const googleFonts = editor.getInstance(_google_fonts__WEBPACK_IMPORTED_MODULE_3__.GoogleFonts), loadUsed = editor.async.debounce(()=>googleFonts.loadUsed(), editor.defaultTimeout);
|
|
33320
|
+
googleFonts.ready.then(loadUsed);
|
|
33321
|
+
editor.e.on('afterInit afterSetMode change', loadUsed);
|
|
33322
|
+
}
|
|
33323
|
+
// An iframe's stylesheets can arrive after the toolbar first shows the
|
|
33324
|
+
// editor's font
|
|
33325
|
+
editor.e.on('afterInit', ()=>{
|
|
33326
|
+
editor.iframe && editor.e.on(editor.ed, 'load', ()=>editor.e.fire('updateToolbar'), {
|
|
33327
|
+
capture: true
|
|
33328
|
+
});
|
|
33329
|
+
});
|
|
32861
33330
|
const callback = (command, second, third)=>{
|
|
32862
33331
|
switch(command){
|
|
32863
33332
|
case 'fontsize':
|
|
@@ -32887,6 +33356,162 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.font = (0,_s
|
|
|
32887
33356
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_0__.pluginSystem.add('font', font);
|
|
32888
33357
|
|
|
32889
33358
|
|
|
33359
|
+
/***/ }),
|
|
33360
|
+
|
|
33361
|
+
/***/ 24939:
|
|
33362
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
33363
|
+
|
|
33364
|
+
"use strict";
|
|
33365
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
33366
|
+
/* harmony export */ GoogleFonts: function() { return /* binding */ GoogleFonts; },
|
|
33367
|
+
/* harmony export */ firstFamily: function() { return /* binding */ firstFamily; }
|
|
33368
|
+
/* harmony export */ });
|
|
33369
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
|
|
33370
|
+
/* harmony import */ var jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59609);
|
|
33371
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23211);
|
|
33372
|
+
/* harmony import */ var jodit_core_request_ajax__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17338);
|
|
33373
|
+
/*!
|
|
33374
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
33375
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
33376
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
33377
|
+
*/ /**
|
|
33378
|
+
* @module plugins/font
|
|
33379
|
+
*/
|
|
33380
|
+
|
|
33381
|
+
|
|
33382
|
+
|
|
33383
|
+
const CSS_URL = 'https://fonts.googleapis.com/css2';
|
|
33384
|
+
// `cursive` and `fantasy` stand in badly for a handwriting or display font
|
|
33385
|
+
const GENERIC_FAMILIES = {
|
|
33386
|
+
serif: 'serif',
|
|
33387
|
+
monospace: 'monospace'
|
|
33388
|
+
};
|
|
33389
|
+
const libraries = new Map();
|
|
33390
|
+
/**
|
|
33391
|
+
* The fonts of the library at `url`, fetched once for every editor on the page
|
|
33392
|
+
*/ function library(jodit, url) {
|
|
33393
|
+
let fonts = libraries.get(url);
|
|
33394
|
+
if (!fonts) {
|
|
33395
|
+
const ajax = new jodit_core_request_ajax__WEBPACK_IMPORTED_MODULE_3__.Ajax({
|
|
33396
|
+
url,
|
|
33397
|
+
method: 'GET'
|
|
33398
|
+
}, jodit.o.defaultAjaxOptions);
|
|
33399
|
+
fonts = ajax.send().then((response)=>response.json())// A font without a regular style can't be asked for by its name alone
|
|
33400
|
+
.then(({ items })=>items.filter((font)=>font.variants.includes('regular'))).catch(()=>{
|
|
33401
|
+
libraries.delete(url);
|
|
33402
|
+
return [];
|
|
33403
|
+
}).finally(()=>ajax.destruct());
|
|
33404
|
+
libraries.set(url, fonts);
|
|
33405
|
+
}
|
|
33406
|
+
return fonts;
|
|
33407
|
+
}
|
|
33408
|
+
/**
|
|
33409
|
+
* The first family of a `font-family` value, unquoted and in lower case for
|
|
33410
|
+
* comparing
|
|
33411
|
+
*/ function firstFamily(fontFamily) {
|
|
33412
|
+
return fontFamily.split(',')[0].replace(/["']/g, '').trim().toLowerCase();
|
|
33413
|
+
}
|
|
33414
|
+
/**
|
|
33415
|
+
* Loads fonts from Google Fonts: the whole of each font the content uses into
|
|
33416
|
+
* the editor's document, and just the letters of its name for the font list
|
|
33417
|
+
*/ class GoogleFonts extends jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_1__.ViewComponent {
|
|
33418
|
+
className() {
|
|
33419
|
+
return 'GoogleFonts';
|
|
33420
|
+
}
|
|
33421
|
+
/**
|
|
33422
|
+
* The library's font named first in a `font-family` value
|
|
33423
|
+
*/ find(fontFamily) {
|
|
33424
|
+
return this.fonts.get(firstFamily(fontFamily));
|
|
33425
|
+
}
|
|
33426
|
+
/**
|
|
33427
|
+
* The `font-family` value that applies a font
|
|
33428
|
+
*/ value(font) {
|
|
33429
|
+
var _GENERIC_FAMILIES_font_category;
|
|
33430
|
+
return `'${font.family}', ${(_GENERIC_FAMILIES_font_category = GENERIC_FAMILIES[font.category]) !== null && _GENERIC_FAMILIES_font_category !== void 0 ? _GENERIC_FAMILIES_font_category : 'sans-serif'}`;
|
|
33431
|
+
}
|
|
33432
|
+
/**
|
|
33433
|
+
* Loads the regular, italic, bold and bold italic styles that a font has
|
|
33434
|
+
* into the editor's document
|
|
33435
|
+
*/ load(font) {
|
|
33436
|
+
const loaded = this.__loadedInto(this.j.ed);
|
|
33437
|
+
if (loaded.has(font.family)) {
|
|
33438
|
+
return;
|
|
33439
|
+
}
|
|
33440
|
+
loaded.add(font.family);
|
|
33441
|
+
const styles = [
|
|
33442
|
+
[
|
|
33443
|
+
'regular',
|
|
33444
|
+
'0,400'
|
|
33445
|
+
],
|
|
33446
|
+
[
|
|
33447
|
+
'700',
|
|
33448
|
+
'0,700'
|
|
33449
|
+
],
|
|
33450
|
+
[
|
|
33451
|
+
'italic',
|
|
33452
|
+
'1,400'
|
|
33453
|
+
],
|
|
33454
|
+
[
|
|
33455
|
+
'700italic',
|
|
33456
|
+
'1,700'
|
|
33457
|
+
]
|
|
33458
|
+
].filter(([variant])=>font.variants.includes(variant)).map(([, style])=>style);
|
|
33459
|
+
this.__append(this.j.ed, `family=${this.__family(font)}:ital,wght@${styles.join(';')}`);
|
|
33460
|
+
}
|
|
33461
|
+
/**
|
|
33462
|
+
* Loads every font of the library that the content uses
|
|
33463
|
+
*/ loadUsed() {
|
|
33464
|
+
this.j.editor.querySelectorAll('[style*="font-family"]').forEach((element)=>{
|
|
33465
|
+
const font = this.find(element.style.fontFamily);
|
|
33466
|
+
font && this.load(font);
|
|
33467
|
+
});
|
|
33468
|
+
}
|
|
33469
|
+
/**
|
|
33470
|
+
* Loads into the page just the letters of each font's name, so the font
|
|
33471
|
+
* list can show the name in its font
|
|
33472
|
+
*/ preview(fonts) {
|
|
33473
|
+
const loaded = this.__loadedInto(this.j.od);
|
|
33474
|
+
fonts = fonts.filter((font)=>!this.__previewed.has(font.family) && !loaded.has(font.family));
|
|
33475
|
+
if (!fonts.length) {
|
|
33476
|
+
return;
|
|
33477
|
+
}
|
|
33478
|
+
fonts.forEach((font)=>this.__previewed.add(font.family));
|
|
33479
|
+
const families = fonts.map((font)=>`family=${this.__family(font)}`), letters = new Set(fonts.map((font)=>font.family).join(''));
|
|
33480
|
+
this.__append(this.j.od, `${families.join('&')}&text=${encodeURIComponent([
|
|
33481
|
+
...letters
|
|
33482
|
+
].join(''))}`);
|
|
33483
|
+
}
|
|
33484
|
+
__loadedInto(doc) {
|
|
33485
|
+
var _this___loaded_get;
|
|
33486
|
+
const loaded = (_this___loaded_get = this.__loaded.get(doc)) !== null && _this___loaded_get !== void 0 ? _this___loaded_get : new Set();
|
|
33487
|
+
this.__loaded.set(doc, loaded);
|
|
33488
|
+
return loaded;
|
|
33489
|
+
}
|
|
33490
|
+
__family(font) {
|
|
33491
|
+
return encodeURIComponent(font.family).replace(/%20/g, '+');
|
|
33492
|
+
}
|
|
33493
|
+
__append(doc, query) {
|
|
33494
|
+
const link = doc.createElement('link');
|
|
33495
|
+
link.rel = 'stylesheet';
|
|
33496
|
+
link.href = `${CSS_URL}?${query}&display=swap`;
|
|
33497
|
+
doc.head.appendChild(link);
|
|
33498
|
+
this.__links.push(link);
|
|
33499
|
+
}
|
|
33500
|
+
destruct() {
|
|
33501
|
+
this.__links.forEach((link)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.safeRemove(link));
|
|
33502
|
+
super.destruct();
|
|
33503
|
+
}
|
|
33504
|
+
constructor(jodit){
|
|
33505
|
+
super(jodit), /**
|
|
33506
|
+
* The library by lower-case family, empty until it arrives
|
|
33507
|
+
*/ (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());
|
|
33508
|
+
this.ready = library(jodit, jodit.o.font.googleFonts.url).then((fonts)=>{
|
|
33509
|
+
fonts.forEach((font)=>this.fonts.set(font.family.toLowerCase(), font));
|
|
33510
|
+
});
|
|
33511
|
+
}
|
|
33512
|
+
}
|
|
33513
|
+
|
|
33514
|
+
|
|
32890
33515
|
/***/ }),
|
|
32891
33516
|
|
|
32892
33517
|
/***/ 96863:
|
|
@@ -34157,12 +34782,13 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.pluginSystem.add('imageProperties
|
|
|
34157
34782
|
/* harmony export */ readValuesFromImage: function() { return /* binding */ readValuesFromImage; }
|
|
34158
34783
|
/* harmony export */ });
|
|
34159
34784
|
/* 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
|
|
34785
|
+
/* harmony import */ var jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16849);
|
|
34786
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7909);
|
|
34787
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80991);
|
|
34788
|
+
/* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26633);
|
|
34789
|
+
/* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(79310);
|
|
34790
|
+
/* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(18380);
|
|
34791
|
+
/* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(57339);
|
|
34166
34792
|
/*!
|
|
34167
34793
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
34168
34794
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -34176,33 +34802,34 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.pluginSystem.add('imageProperties
|
|
|
34176
34802
|
|
|
34177
34803
|
|
|
34178
34804
|
|
|
34805
|
+
|
|
34179
34806
|
/**
|
|
34180
34807
|
* Read values from image and set it to state
|
|
34181
34808
|
* @private
|
|
34182
34809
|
*/ function readValuesFromImage(j, state) {
|
|
34183
34810
|
return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function*() {
|
|
34184
34811
|
const { sourceImage: image, values } = state;
|
|
34185
|
-
(0,
|
|
34812
|
+
(0,_align__WEBPACK_IMPORTED_MODULE_4__.readAlign)(image, values, (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_1__.getAlignClasses)(j, image));
|
|
34186
34813
|
// Border radius
|
|
34187
|
-
values.borderRadius = parseInt((0,
|
|
34814
|
+
values.borderRadius = parseInt((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.cssInline)(image, 'border-radius') || '0', 10) || 0;
|
|
34188
34815
|
// Id
|
|
34189
|
-
values.id = (0,
|
|
34816
|
+
values.id = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id') || '';
|
|
34190
34817
|
// Title
|
|
34191
|
-
values.imageTitle = (0,
|
|
34818
|
+
values.imageTitle = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title') || '';
|
|
34192
34819
|
// Alt
|
|
34193
|
-
values.imageAlt = (0,
|
|
34820
|
+
values.imageAlt = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt') || '';
|
|
34194
34821
|
// Style
|
|
34195
|
-
values.style = (0,
|
|
34822
|
+
values.style = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style') || '';
|
|
34196
34823
|
// Classes
|
|
34197
|
-
values.classes = ((0,
|
|
34824
|
+
values.classes = ((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
|
|
34198
34825
|
// Margins
|
|
34199
|
-
(0,
|
|
34826
|
+
(0,_margin__WEBPACK_IMPORTED_MODULE_6__.readMargins)(image, values, state);
|
|
34200
34827
|
// Link
|
|
34201
|
-
(0,
|
|
34828
|
+
(0,_link__WEBPACK_IMPORTED_MODULE_5__.readLink)(state, j, values);
|
|
34202
34829
|
// Src
|
|
34203
|
-
values.imageSrc = (0,
|
|
34830
|
+
values.imageSrc = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '';
|
|
34204
34831
|
// Image size
|
|
34205
|
-
return (0,
|
|
34832
|
+
return (0,_size__WEBPACK_IMPORTED_MODULE_7__.readSizes)(image, values, state);
|
|
34206
34833
|
})();
|
|
34207
34834
|
}
|
|
34208
34835
|
|
|
@@ -35234,7 +35861,7 @@ UIImagePositionTab = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
35234
35861
|
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'id', id || null);
|
|
35235
35862
|
}
|
|
35236
35863
|
if (opt.image.editAlign) {
|
|
35237
|
-
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(image, align,
|
|
35864
|
+
(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
35865
|
}
|
|
35239
35866
|
}
|
|
35240
35867
|
|
|
@@ -36067,6 +36694,7 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
|
|
|
36067
36694
|
/* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85932);
|
|
36068
36695
|
/* harmony import */ var jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16849);
|
|
36069
36696
|
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80991);
|
|
36697
|
+
/* harmony import */ var jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(83314);
|
|
36070
36698
|
/*!
|
|
36071
36699
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
36072
36700
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -36077,9 +36705,7 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
|
|
|
36077
36705
|
|
|
36078
36706
|
|
|
36079
36707
|
|
|
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;
|
|
36708
|
+
|
|
36083
36709
|
// A Normal image sits where the text of its line is aligned (#1531)
|
|
36084
36710
|
const lineAlign = (editor, elm)=>{
|
|
36085
36711
|
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 +36726,7 @@ const lineAlign = (editor, elm)=>{
|
|
|
36100
36726
|
return 'left';
|
|
36101
36727
|
}
|
|
36102
36728
|
};
|
|
36103
|
-
const currentAlign = (editor, elm)=>elm ? (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__.getHAlign)(elm,
|
|
36729
|
+
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
36730
|
const align = {
|
|
36105
36731
|
name: 'left',
|
|
36106
36732
|
childTemplate: (_, __, value)=>value,
|
|
@@ -36121,23 +36747,25 @@ const align = {
|
|
|
36121
36747
|
return (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__.isString)(value) && currentAlign(editor, button.target) === value.toLowerCase();
|
|
36122
36748
|
},
|
|
36123
36749
|
exec: (editor, elm, { control })=>{
|
|
36124
|
-
|
|
36750
|
+
// A media wrapper kept in the content (`mediaWrappers`) is aligned itself
|
|
36751
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(elm) || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(elm, new Set([
|
|
36125
36752
|
'img',
|
|
36126
36753
|
'jodit',
|
|
36127
36754
|
'jodit-media'
|
|
36128
|
-
]))) {
|
|
36755
|
+
])) && (0,jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_4__.getMediaWrapper)(editor, elm) !== elm) {
|
|
36129
36756
|
return;
|
|
36130
36757
|
}
|
|
36131
36758
|
const command = control.args && (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__.isString)(control.args[0]) ? control.args[0].toLowerCase() : '';
|
|
36132
36759
|
if (!command) {
|
|
36133
36760
|
return false;
|
|
36134
36761
|
}
|
|
36135
|
-
;(0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__.hAlignElement)(elm, command,
|
|
36762
|
+
;(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
36763
|
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(elm, new Set([
|
|
36137
36764
|
'jodit',
|
|
36138
36765
|
'jodit-media'
|
|
36139
36766
|
])) && elm.firstElementChild) {
|
|
36140
|
-
|
|
36767
|
+
const media = elm.firstElementChild;
|
|
36768
|
+
(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
36769
|
}
|
|
36142
36770
|
editor.synchronizeValues();
|
|
36143
36771
|
editor.e.fire('recalcPositionPopup');
|
|
@@ -36289,9 +36917,11 @@ const align = {
|
|
|
36289
36917
|
return (0,jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_9__.makeCollection)(this.jodit, this.popup);
|
|
36290
36918
|
}
|
|
36291
36919
|
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
|
-
|
|
36920
|
+
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);
|
|
36921
|
+
// A media wrapper kept in the content gets the media popup
|
|
36922
|
+
const type = mediaWrapper ? 'jodit-media' : target === null || target === void 0 ? void 0 : target.nodeName.toLowerCase();
|
|
36923
|
+
if (target && type && this.canShowPopupForType(type)) {
|
|
36924
|
+
this.showPopup(()=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.position)(target, this.j), type, target);
|
|
36295
36925
|
return false;
|
|
36296
36926
|
}
|
|
36297
36927
|
}
|
|
@@ -36474,7 +37104,12 @@ const align = {
|
|
|
36474
37104
|
this.removeListenersForElements();
|
|
36475
37105
|
}
|
|
36476
37106
|
_eventsList() {
|
|
36477
|
-
|
|
37107
|
+
var _this_j_o_mediaWrappers;
|
|
37108
|
+
// Clicks on a media wrapper kept in the content (`mediaWrappers`)
|
|
37109
|
+
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());
|
|
37110
|
+
const el = [
|
|
37111
|
+
...new Set(this.elmsList.concat(wrapperTags))
|
|
37112
|
+
];
|
|
36478
37113
|
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
37114
|
}
|
|
36480
37115
|
addListenersForElements() {
|
|
@@ -38016,6 +38651,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaBlocks = [
|
|
|
38016
38651
|
'video',
|
|
38017
38652
|
'audio'
|
|
38018
38653
|
];
|
|
38654
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
|
|
38019
38655
|
|
|
38020
38656
|
|
|
38021
38657
|
/***/ }),
|
|
@@ -38049,11 +38685,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaBlocks = [
|
|
|
38049
38685
|
* Process `video` and `audio`
|
|
38050
38686
|
*/ function media(editor) {
|
|
38051
38687
|
const keyFake = 'jodit_fake_wrapper';
|
|
38052
|
-
const { mediaFakeTag, mediaBlocks, mediaInFakeBlock } = editor.options;
|
|
38688
|
+
const { mediaFakeTag, mediaBlocks, mediaInFakeBlock, mediaWrappers } = editor.options;
|
|
38053
38689
|
const wrap = (element)=>{
|
|
38054
38690
|
if (element.parentNode && (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(element.parentNode, 'data-jodit_iframe_wrapper')) {
|
|
38055
38691
|
element = element.parentNode;
|
|
38056
|
-
} else {
|
|
38692
|
+
} else if (mediaWrappers[element.nodeName.toLowerCase()]) {
|
|
38693
|
+
var _getMediaWrapper;
|
|
38694
|
+
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);
|
|
38695
|
+
} else if (mediaInFakeBlock) {
|
|
38057
38696
|
const wrapper = editor.createInside.element(mediaFakeTag, {
|
|
38058
38697
|
'data-jodit-temp': 1,
|
|
38059
38698
|
contenteditable: false,
|
|
@@ -38071,12 +38710,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaBlocks = [
|
|
|
38071
38710
|
}
|
|
38072
38711
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(wrapper, element);
|
|
38073
38712
|
element = wrapper;
|
|
38713
|
+
} else {
|
|
38714
|
+
return;
|
|
38074
38715
|
}
|
|
38075
38716
|
editor.e.off(element, 'mousedown.select touchstart.select').on(element, 'mousedown.select touchstart.select', ()=>{
|
|
38076
38717
|
editor.s.setCursorAfter(element);
|
|
38077
38718
|
});
|
|
38078
38719
|
};
|
|
38079
|
-
if (mediaInFakeBlock) {
|
|
38720
|
+
if (mediaInFakeBlock || Object.keys(mediaWrappers).length) {
|
|
38080
38721
|
editor.e.on('afterGetValueFromEditor', (data)=>{
|
|
38081
38722
|
const rxp = new RegExp(`<${mediaFakeTag}[^>]+data-${keyFake}[^>]+>([^]+?)</${mediaFakeTag}>`, 'ig');
|
|
38082
38723
|
if (rxp.test(data.value)) {
|
|
@@ -45802,15 +46443,33 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.pluginSystem.add('toolbarNavigati
|
|
|
45802
46443
|
|
|
45803
46444
|
|
|
45804
46445
|
|
|
46446
|
+
// Media the popup inserts go in their wrapper (see `mediaWrappers`), aligned
|
|
46447
|
+
// with `mediaDefaultAlign`
|
|
46448
|
+
function prepareMedia(jodit, element) {
|
|
46449
|
+
const media = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.wrapMedia)(jodit, element);
|
|
46450
|
+
const { mediaDefaultAlign } = jodit.o;
|
|
46451
|
+
if (mediaDefaultAlign && mediaDefaultAlign !== 'normal') {
|
|
46452
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.hAlignElement)(media, mediaDefaultAlign, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.getAlignClasses)(jodit, media));
|
|
46453
|
+
}
|
|
46454
|
+
return media;
|
|
46455
|
+
}
|
|
45805
46456
|
function insertVideos(data) {
|
|
45806
46457
|
var _data_files;
|
|
45807
46458
|
(_data_files = data.files) === null || _data_files === void 0 ? void 0 : _data_files.forEach((file)=>{
|
|
45808
|
-
this.s.insertNode(this.createInside.element('video', {
|
|
46459
|
+
this.s.insertNode(prepareMedia(this, this.createInside.element('video', {
|
|
45809
46460
|
controls: '',
|
|
45810
46461
|
src: data.baseurl + file
|
|
45811
|
-
}));
|
|
46462
|
+
})));
|
|
45812
46463
|
});
|
|
45813
46464
|
}
|
|
46465
|
+
// Embed code that is one element is prepared as media; other code goes in as
|
|
46466
|
+
// it is
|
|
46467
|
+
function prepareEmbedCode(jodit, code) {
|
|
46468
|
+
const box = jodit.createInside.div();
|
|
46469
|
+
box.innerHTML = code.trim();
|
|
46470
|
+
const element = box.firstElementChild;
|
|
46471
|
+
return element && box.childNodes.length === 1 ? prepareMedia(jodit, element) : code;
|
|
46472
|
+
}
|
|
45814
46473
|
jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.video = {
|
|
45815
46474
|
parseUrlToVideoEmbed: jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed,
|
|
45816
46475
|
defaultWidth: 400,
|
|
@@ -45848,7 +46507,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.video = {
|
|
|
45848
46507
|
])
|
|
45849
46508
|
]), tabs = [], insertCode = (code)=>{
|
|
45850
46509
|
jodit.s.restore();
|
|
45851
|
-
jodit.s.insertHTML(code);
|
|
46510
|
+
jodit.s.insertHTML(prepareEmbedCode(jodit, code));
|
|
45852
46511
|
close();
|
|
45853
46512
|
};
|
|
45854
46513
|
jodit.s.save();
|