jodit 4.17.6 → 4.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/es2015/jodit.css +87 -3
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +8 -8
- package/es2015/jodit.js +808 -132
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +16 -16
- package/es2015/plugins/debug/debug.css +1 -1
- package/es2015/plugins/debug/debug.js +1 -1
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +8 -8
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +8 -8
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +87 -3
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +14 -14
- package/es2021/jodit.js +788 -132
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +14 -14
- package/es2021/plugins/debug/debug.css +1 -1
- package/es2021/plugins/debug/debug.js +1 -1
- package/es2021/plugins/debug/debug.min.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021.en/jodit.css +87 -3
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +26 -26
- package/es2021.en/jodit.js +788 -132
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +12 -12
- package/es2021.en/plugins/debug/debug.css +1 -1
- package/es2021.en/plugins/debug/debug.js +1 -1
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/jodit.css +92 -6
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +1073 -192
- package/es5/jodit.min.css +3 -3
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/config.d.ts +65 -2
- package/esm/config.js +29 -2
- package/esm/core/constants.js +1 -1
- package/esm/core/helpers/utils/align.d.ts +11 -5
- package/esm/core/helpers/utils/align.js +28 -8
- package/esm/core/helpers/utils/index.d.ts +1 -0
- package/esm/core/helpers/utils/index.js +1 -0
- package/esm/core/helpers/utils/media-wrapper.d.ts +29 -0
- package/esm/core/helpers/utils/media-wrapper.js +63 -0
- package/esm/core/selection/selection.js +3 -3
- package/esm/modules/toolbar/button/button.d.ts +18 -0
- package/esm/modules/toolbar/button/button.js +75 -5
- package/esm/plugins/dtd/after-insert/remove-extra-br.js +6 -1
- package/esm/plugins/dtd/before-insert/check-block-nesting.js +16 -1
- package/esm/plugins/dtd/config.js +3 -0
- package/esm/plugins/font/config.d.ts +12 -0
- package/esm/plugins/font/config.js +25 -10
- package/esm/plugins/font/font-picker.d.ts +51 -0
- package/esm/plugins/font/font-picker.js +238 -0
- package/esm/plugins/font/font.js +12 -0
- package/esm/plugins/font/google-fonts.d.ts +65 -0
- package/esm/plugins/font/google-fonts.js +143 -0
- package/esm/plugins/image-properties/readers/index.js +2 -1
- package/esm/plugins/image-properties/writers/index.js +2 -2
- package/esm/plugins/inline-popup/config/items/img.js +10 -8
- package/esm/plugins/inline-popup/inline-popup.js +13 -6
- package/esm/plugins/media/config.d.ts +26 -1
- package/esm/plugins/media/config.js +1 -3
- package/esm/plugins/media/media.js +12 -4
- package/esm/plugins/video/config.js +24 -4
- package/esm/types/toolbar.d.ts +2 -0
- package/esm/types/types.d.ts +13 -1
- package/package.json +1 -1
- package/types/config.d.ts +65 -2
- package/types/core/helpers/utils/align.d.ts +11 -5
- package/types/core/helpers/utils/index.d.ts +1 -0
- package/types/core/helpers/utils/media-wrapper.d.ts +29 -0
- package/types/modules/toolbar/button/button.d.ts +18 -0
- package/types/plugins/font/config.d.ts +12 -0
- package/types/plugins/font/font-picker.d.ts +51 -0
- package/types/plugins/font/google-fonts.d.ts +65 -0
- package/types/plugins/media/config.d.ts +26 -1
- package/types/types/toolbar.d.ts +2 -0
- package/types/types/types.d.ts +13 -1
package/es2021/jodit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
|
|
4
|
-
* Version: v4.
|
|
4
|
+
* Version: v4.18.1
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -735,18 +735,43 @@ let ConfigPrototype = {};
|
|
|
735
735
|
/**
|
|
736
736
|
* Class names to align images with, instead of an inline `float` or
|
|
737
737
|
* `margin`. Aligning an image removes every class listed here and adds the
|
|
738
|
-
* chosen alignment's, which can be several separated by spaces.
|
|
738
|
+
* chosen alignment's, which can be several separated by spaces. An
|
|
739
|
+
* alignment can also list several such sets, to recognise each of them;
|
|
740
|
+
* aligning writes the first. `alignClasses.img` takes its place when set.
|
|
739
741
|
*
|
|
740
742
|
* ```javascript
|
|
741
743
|
* Jodit.make('#editor', {
|
|
742
744
|
* imageAlignClasses: {
|
|
743
745
|
* left: 'align-left',
|
|
744
746
|
* right: 'align-right',
|
|
745
|
-
* center: 'align-center'
|
|
747
|
+
* center: ['align-center', 'centered']
|
|
746
748
|
* }
|
|
747
749
|
* });
|
|
748
750
|
* ```
|
|
749
751
|
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "imageAlignClasses", null);
|
|
752
|
+
/**
|
|
753
|
+
* Class names to align elements with, by tag name, as `imageAlignClasses`
|
|
754
|
+
* does for images: `img`, and `video`, `audio` and `iframe` in the media
|
|
755
|
+
* popup. A media wrapper (see `mediaWrappers`), and Jodit's own `jodit` and
|
|
756
|
+
* `jodit-media` wrappers, are aligned with the classes for the media in
|
|
757
|
+
* them.
|
|
758
|
+
*
|
|
759
|
+
* ```javascript
|
|
760
|
+
* const media = {
|
|
761
|
+
* left: 'media-left',
|
|
762
|
+
* right: 'media-right',
|
|
763
|
+
* center: 'media-center'
|
|
764
|
+
* };
|
|
765
|
+
*
|
|
766
|
+
* Jodit.make('#editor', {
|
|
767
|
+
* alignClasses: { video: media, iframe: media }
|
|
768
|
+
* });
|
|
769
|
+
* ```
|
|
770
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "alignClasses", {});
|
|
771
|
+
/**
|
|
772
|
+
* Alignment given to the media the video popup inserts. `'normal'` leaves
|
|
773
|
+
* them unaligned
|
|
774
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "mediaDefaultAlign", 'normal');
|
|
750
775
|
/**
|
|
751
776
|
* Do not display these buttons that are on the list
|
|
752
777
|
*
|
|
@@ -1799,7 +1824,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1799
1824
|
* ```
|
|
1800
1825
|
* @packageDocumentation
|
|
1801
1826
|
* @module constants
|
|
1802
|
-
*/ const APP_VERSION = "4.
|
|
1827
|
+
*/ const APP_VERSION = "4.18.1";
|
|
1803
1828
|
// prettier-ignore
|
|
1804
1829
|
const ES = "es2021";
|
|
1805
1830
|
const IS_ES_MODERN = true;
|
|
@@ -7576,12 +7601,15 @@ function trimChars(value, chars) {
|
|
|
7576
7601
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7577
7602
|
/* harmony export */ alignElement: function() { return /* binding */ alignElement; },
|
|
7578
7603
|
/* harmony export */ clearAlign: function() { return /* binding */ clearAlign; },
|
|
7604
|
+
/* harmony export */ getAlignClasses: function() { return /* binding */ getAlignClasses; },
|
|
7579
7605
|
/* harmony export */ getHAlign: function() { return /* binding */ getHAlign; },
|
|
7580
7606
|
/* harmony export */ hAlignElement: function() { return /* binding */ hAlignElement; }
|
|
7581
7607
|
/* harmony export */ });
|
|
7582
7608
|
/* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27795);
|
|
7583
|
-
/* harmony import */ var
|
|
7584
|
-
/* harmony import */ var
|
|
7609
|
+
/* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17312);
|
|
7610
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7909);
|
|
7611
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80991);
|
|
7612
|
+
/* harmony import */ var jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(83314);
|
|
7585
7613
|
/*!
|
|
7586
7614
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
7587
7615
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -7591,31 +7619,51 @@ function trimChars(value, chars) {
|
|
|
7591
7619
|
*/
|
|
7592
7620
|
|
|
7593
7621
|
|
|
7594
|
-
|
|
7622
|
+
|
|
7623
|
+
|
|
7624
|
+
// The sets of class names an alignment lists, the first being the one to write
|
|
7625
|
+
const classSets = (value)=>((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_1__.isArray)(value) ? value : [
|
|
7626
|
+
value ?? ''
|
|
7627
|
+
]).map((set)=>set.split(/\s+/).filter(Boolean)).filter((set)=>set.length);
|
|
7628
|
+
/**
|
|
7629
|
+
* The class names to align `elm` with: `alignClasses` for its tag, or for the
|
|
7630
|
+
* media in it when it wraps media (a `mediaWrappers` wrapper, `jodit` or
|
|
7631
|
+
* `jodit-media`), falling back to `imageAlignClasses` for an image
|
|
7632
|
+
*/ function getAlignClasses(jodit, elm) {
|
|
7633
|
+
if (!elm) {
|
|
7634
|
+
return null;
|
|
7635
|
+
}
|
|
7636
|
+
const media = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(elm, new Set([
|
|
7637
|
+
'jodit',
|
|
7638
|
+
'jodit-media'
|
|
7639
|
+
])) ? elm.firstElementChild : (0,jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_4__.getWrappedMedia)(jodit, elm);
|
|
7640
|
+
const tag = (media ?? elm).nodeName.toLowerCase();
|
|
7641
|
+
return jodit.o.alignClasses?.[tag] ?? (tag === 'img' ? jodit.o.imageAlignClasses : null);
|
|
7642
|
+
}
|
|
7595
7643
|
/**
|
|
7596
|
-
* Align image, with `classes` (see `
|
|
7597
|
-
*
|
|
7644
|
+
* Align image, with `classes` (see `alignClasses`) instead of inline styles
|
|
7645
|
+
* when they are given
|
|
7598
7646
|
*/ function hAlignElement(image, align, classes) {
|
|
7599
7647
|
if (classes) {
|
|
7600
7648
|
hAlignElement(image, 'normal');
|
|
7601
|
-
Object.values(classes).forEach((value)=>image.classList.remove(...
|
|
7602
|
-
image.classList.add(...
|
|
7649
|
+
Object.values(classes).forEach((value)=>classSets(value).forEach((set)=>image.classList.remove(...set)));
|
|
7650
|
+
image.classList.add(...classSets(classes[align || 'normal'])[0] ?? []);
|
|
7603
7651
|
[
|
|
7604
7652
|
'class',
|
|
7605
7653
|
'style'
|
|
7606
7654
|
].forEach((name)=>{
|
|
7607
|
-
if (!(0,
|
|
7608
|
-
(0,
|
|
7655
|
+
if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(image, name)?.trim()) {
|
|
7656
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(image, name, null);
|
|
7609
7657
|
}
|
|
7610
7658
|
});
|
|
7611
7659
|
return;
|
|
7612
7660
|
}
|
|
7613
7661
|
if (align && align !== 'normal') {
|
|
7614
7662
|
if (align !== 'center') {
|
|
7615
|
-
(0,
|
|
7616
|
-
(0,
|
|
7663
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(image, 'float', align);
|
|
7664
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.clearCenterAlign)(image);
|
|
7617
7665
|
} else {
|
|
7618
|
-
(0,
|
|
7666
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(image, {
|
|
7619
7667
|
float: '',
|
|
7620
7668
|
display: 'block',
|
|
7621
7669
|
marginLeft: 'auto',
|
|
@@ -7623,13 +7671,13 @@ const classNames = (value)=>(value ?? '').split(/\s+/).filter(Boolean);
|
|
|
7623
7671
|
});
|
|
7624
7672
|
}
|
|
7625
7673
|
} else {
|
|
7626
|
-
if ((0,
|
|
7674
|
+
if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(image, 'float') && [
|
|
7627
7675
|
'right',
|
|
7628
7676
|
'left'
|
|
7629
|
-
].indexOf((0,
|
|
7630
|
-
(0,
|
|
7677
|
+
].indexOf((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(image, 'float').toString().toLowerCase()) !== -1) {
|
|
7678
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(image, 'float', '');
|
|
7631
7679
|
}
|
|
7632
|
-
;(0,
|
|
7680
|
+
;(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.clearCenterAlign)(image);
|
|
7633
7681
|
}
|
|
7634
7682
|
}
|
|
7635
7683
|
/**
|
|
@@ -7642,17 +7690,16 @@ const classNames = (value)=>(value ?? '').split(/\s+/).filter(Boolean);
|
|
|
7642
7690
|
'center',
|
|
7643
7691
|
'normal'
|
|
7644
7692
|
]){
|
|
7645
|
-
|
|
7646
|
-
if (names.length && names.every((name)=>elm.classList.contains(name))) {
|
|
7693
|
+
if (classSets(classes[align]).some((set)=>set.every((name)=>elm.classList.contains(name)))) {
|
|
7647
7694
|
return align;
|
|
7648
7695
|
}
|
|
7649
7696
|
}
|
|
7650
7697
|
}
|
|
7651
|
-
const float = (0,
|
|
7698
|
+
const float = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.cssInline)(elm, 'float').toLowerCase();
|
|
7652
7699
|
if (float === 'left' || float === 'right') {
|
|
7653
7700
|
return float;
|
|
7654
7701
|
}
|
|
7655
|
-
if ((0,
|
|
7702
|
+
if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(elm, 'display') === 'block' && (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.cssInline)(elm, 'margin-left') === 'auto' && (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.cssInline)(elm, 'margin-right') === 'auto') {
|
|
7656
7703
|
return 'center';
|
|
7657
7704
|
}
|
|
7658
7705
|
return 'normal';
|
|
@@ -7662,10 +7709,10 @@ const classNames = (value)=>(value ?? '').split(/\s+/).filter(Boolean);
|
|
|
7662
7709
|
*/ function clearAlign(node) {
|
|
7663
7710
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.each(node, (elm)=>{
|
|
7664
7711
|
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(elm)) {
|
|
7665
|
-
if ((0,
|
|
7666
|
-
(0,
|
|
7667
|
-
if (!((0,
|
|
7668
|
-
(0,
|
|
7712
|
+
if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.cssInline)(elm, 'textAlign')) {
|
|
7713
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(elm, 'textAlign', '');
|
|
7714
|
+
if (!((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'style') || '').trim().length) {
|
|
7715
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'style', null);
|
|
7669
7716
|
}
|
|
7670
7717
|
}
|
|
7671
7718
|
}
|
|
@@ -7696,7 +7743,7 @@ function alignElement(command, box) {
|
|
|
7696
7743
|
clearAlign(box);
|
|
7697
7744
|
const align = ALIGN_BY_COMMAND.get(command.toLowerCase());
|
|
7698
7745
|
if (align) {
|
|
7699
|
-
(0,
|
|
7746
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(box, 'textAlign', align);
|
|
7700
7747
|
}
|
|
7701
7748
|
}
|
|
7702
7749
|
}
|
|
@@ -8781,13 +8828,13 @@ const getClassName = (obj)=>{
|
|
|
8781
8828
|
"use strict";
|
|
8782
8829
|
__webpack_require__.r(__webpack_exports__);
|
|
8783
8830
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
8784
|
-
/* harmony export */ $$: function() { return /* reexport safe */
|
|
8831
|
+
/* harmony export */ $$: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.$$; },
|
|
8785
8832
|
/* harmony export */ ConfigDeepFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigDeepFlatten; },
|
|
8786
8833
|
/* harmony export */ ConfigFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigFlatten; },
|
|
8787
8834
|
/* harmony export */ ConfigMerge: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigMerge; },
|
|
8788
8835
|
/* harmony export */ ConfigProto: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigProto; },
|
|
8789
8836
|
/* harmony export */ ConnectionError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.ConnectionError; },
|
|
8790
|
-
/* harmony export */ LimitedStack: function() { return /* reexport safe */
|
|
8837
|
+
/* harmony export */ LimitedStack: function() { return /* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_27__.LimitedStack; },
|
|
8791
8838
|
/* harmony export */ OptionsError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.OptionsError; },
|
|
8792
8839
|
/* harmony export */ UNSAFE_PROTO_KEYS: function() { return /* reexport safe */ _is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_18__.UNSAFE_PROTO_KEYS; },
|
|
8793
8840
|
/* harmony export */ abort: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.abort; },
|
|
@@ -8799,58 +8846,63 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8799
8846
|
/* harmony export */ attrRaw: function() { return /* reexport safe */ _attr__WEBPACK_IMPORTED_MODULE_3__.attrRaw; },
|
|
8800
8847
|
/* harmony export */ browser: function() { return /* reexport safe */ _browser__WEBPACK_IMPORTED_MODULE_4__.browser; },
|
|
8801
8848
|
/* harmony export */ buildQuery: function() { return /* reexport safe */ _build_query__WEBPACK_IMPORTED_MODULE_5__.buildQuery; },
|
|
8802
|
-
/* harmony export */ call: function() { return /* reexport safe */
|
|
8803
|
-
/* harmony export */ callPromise: function() { return /* reexport safe */
|
|
8804
|
-
/* harmony export */ callThis: function() { return /* reexport safe */
|
|
8849
|
+
/* harmony export */ call: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.call; },
|
|
8850
|
+
/* harmony export */ callPromise: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.callPromise; },
|
|
8851
|
+
/* harmony export */ callThis: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.callThis; },
|
|
8805
8852
|
/* harmony export */ clearAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.clearAlign; },
|
|
8806
8853
|
/* harmony export */ clearCenterAlign: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.clearCenterAlign; },
|
|
8807
8854
|
/* harmony export */ cns: function() { return /* reexport safe */ _mark_deprecated__WEBPACK_IMPORTED_MODULE_19__.cns; },
|
|
8808
8855
|
/* harmony export */ completeUrl: function() { return /* reexport safe */ _complete_url__WEBPACK_IMPORTED_MODULE_6__.completeUrl; },
|
|
8809
8856
|
/* harmony export */ connection: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.connection; },
|
|
8810
8857
|
/* harmony export */ convertMediaUrlToVideoEmbed: function() { return /* reexport safe */ _convert_media_url_to_video_embed__WEBPACK_IMPORTED_MODULE_8__.convertMediaUrlToVideoEmbed; },
|
|
8858
|
+
/* harmony export */ createMediaWrapper: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.createMediaWrapper; },
|
|
8811
8859
|
/* harmony export */ css: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.css; },
|
|
8812
8860
|
/* harmony export */ cssInline: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.cssInline; },
|
|
8813
|
-
/* harmony export */ cssPath: function() { return /* reexport safe */
|
|
8861
|
+
/* harmony export */ cssPath: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.cssPath; },
|
|
8814
8862
|
/* harmony export */ ctrlKey: function() { return /* reexport safe */ _ctrl_key__WEBPACK_IMPORTED_MODULE_10__.ctrlKey; },
|
|
8815
8863
|
/* harmony export */ dataBind: function() { return /* reexport safe */ _data_bind__WEBPACK_IMPORTED_MODULE_11__.dataBind; },
|
|
8816
8864
|
/* harmony export */ defaultLanguage: function() { return /* reexport safe */ _default_language__WEBPACK_IMPORTED_MODULE_12__.defaultLanguage; },
|
|
8817
8865
|
/* harmony export */ error: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.error; },
|
|
8818
8866
|
/* harmony export */ fastClone: function() { return /* reexport safe */ _extend__WEBPACK_IMPORTED_MODULE_14__.fastClone; },
|
|
8819
8867
|
/* harmony export */ get: function() { return /* reexport safe */ _get__WEBPACK_IMPORTED_MODULE_15__.get; },
|
|
8868
|
+
/* harmony export */ getAlignClasses: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.getAlignClasses; },
|
|
8820
8869
|
/* harmony export */ getClassName: function() { return /* reexport safe */ _get_class_name__WEBPACK_IMPORTED_MODULE_16__.getClassName; },
|
|
8821
|
-
/* harmony export */ getDataTransfer: function() { return /* reexport safe */
|
|
8870
|
+
/* harmony export */ getDataTransfer: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.getDataTransfer; },
|
|
8822
8871
|
/* harmony export */ getHAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.getHAlign; },
|
|
8823
|
-
/* harmony export */
|
|
8824
|
-
/* harmony export */
|
|
8872
|
+
/* harmony export */ getMediaWrapper: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.getMediaWrapper; },
|
|
8873
|
+
/* harmony export */ getPropertyDescriptor: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.getPropertyDescriptor; },
|
|
8874
|
+
/* harmony export */ getWrappedMedia: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.getWrappedMedia; },
|
|
8875
|
+
/* harmony export */ getXPathByElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.getXPathByElement; },
|
|
8825
8876
|
/* harmony export */ hAlignElement: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.hAlignElement; },
|
|
8826
8877
|
/* harmony export */ humanSizeToBytes: function() { return /* reexport safe */ _human_size_to_bytes__WEBPACK_IMPORTED_MODULE_17__.humanSizeToBytes; },
|
|
8827
|
-
/* harmony export */ inView: function() { return /* reexport safe */
|
|
8878
|
+
/* harmony export */ inView: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_24__.inView; },
|
|
8828
8879
|
/* harmony export */ isAtom: function() { return /* reexport safe */ _extend__WEBPACK_IMPORTED_MODULE_14__.isAtom; },
|
|
8829
8880
|
/* harmony export */ isUnsafeProtoKey: function() { return /* reexport safe */ _is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_18__.isUnsafeProtoKey; },
|
|
8830
8881
|
/* harmony export */ keepNames: function() { return /* reexport safe */ _get_class_name__WEBPACK_IMPORTED_MODULE_16__.keepNames; },
|
|
8831
|
-
/* harmony export */ keys: function() { return /* reexport safe */
|
|
8832
|
-
/* harmony export */ loadImage: function() { return /* reexport safe */
|
|
8882
|
+
/* harmony export */ keys: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.keys; },
|
|
8883
|
+
/* harmony export */ loadImage: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.loadImage; },
|
|
8833
8884
|
/* harmony export */ loadNext: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_1__.loadNext; },
|
|
8834
8885
|
/* harmony export */ loadNextStyle: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_1__.loadNextStyle; },
|
|
8835
8886
|
/* harmony export */ markAsAtomic: function() { return /* reexport safe */ _extend__WEBPACK_IMPORTED_MODULE_14__.markAsAtomic; },
|
|
8836
8887
|
/* harmony export */ markDeprecated: function() { return /* reexport safe */ _mark_deprecated__WEBPACK_IMPORTED_MODULE_19__.markDeprecated; },
|
|
8837
|
-
/* harmony export */ markOwner: function() { return /* reexport safe */
|
|
8838
|
-
/* harmony export */ memorizeExec: function() { return /* reexport safe */
|
|
8888
|
+
/* harmony export */ markOwner: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.markOwner; },
|
|
8889
|
+
/* harmony export */ memorizeExec: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.memorizeExec; },
|
|
8839
8890
|
/* harmony export */ options: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.options; },
|
|
8840
|
-
/* harmony export */ parseQuery: function() { return /* reexport safe */
|
|
8841
|
-
/* harmony export */ previewBox: function() { return /* reexport safe */
|
|
8842
|
-
/* harmony export */ refs: function() { return /* reexport safe */
|
|
8843
|
-
/* harmony export */ reset: function() { return /* reexport safe */
|
|
8844
|
-
/* harmony export */ resolveElement: function() { return /* reexport safe */
|
|
8845
|
-
/* harmony export */ scrollIntoViewIfNeeded: function() { return /* reexport safe */
|
|
8846
|
-
/* harmony export */ set: function() { return /* reexport safe */
|
|
8891
|
+
/* harmony export */ parseQuery: function() { return /* reexport safe */ _parse_query__WEBPACK_IMPORTED_MODULE_21__.parseQuery; },
|
|
8892
|
+
/* harmony export */ previewBox: function() { return /* reexport safe */ _print__WEBPACK_IMPORTED_MODULE_22__.previewBox; },
|
|
8893
|
+
/* harmony export */ refs: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.refs; },
|
|
8894
|
+
/* harmony export */ reset: function() { return /* reexport safe */ _reset__WEBPACK_IMPORTED_MODULE_23__.reset; },
|
|
8895
|
+
/* harmony export */ resolveElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.resolveElement; },
|
|
8896
|
+
/* harmony export */ scrollIntoViewIfNeeded: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_24__.scrollIntoViewIfNeeded; },
|
|
8897
|
+
/* harmony export */ set: function() { return /* reexport safe */ _set__WEBPACK_IMPORTED_MODULE_26__.set; },
|
|
8898
|
+
/* harmony export */ wrapMedia: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.wrapMedia; }
|
|
8847
8899
|
/* harmony export */ });
|
|
8848
8900
|
/* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16849);
|
|
8849
8901
|
/* harmony import */ var _append_script__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(47760);
|
|
8850
8902
|
/* harmony import */ var _assert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28712);
|
|
8851
8903
|
/* harmony import */ var _assert__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_assert__WEBPACK_IMPORTED_MODULE_2__);
|
|
8852
8904
|
/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
8853
|
-
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _assert__WEBPACK_IMPORTED_MODULE_2__) if(["default","alignElement","clearAlign","getHAlign","hAlignElement","alreadyLoadedList","appendScriptAsync","appendStyleAsync","loadNext","loadNextStyle"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = function(key) { return _assert__WEBPACK_IMPORTED_MODULE_2__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
|
|
8905
|
+
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _assert__WEBPACK_IMPORTED_MODULE_2__) if(["default","alignElement","clearAlign","getAlignClasses","getHAlign","hAlignElement","alreadyLoadedList","appendScriptAsync","appendStyleAsync","loadNext","loadNextStyle"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = function(key) { return _assert__WEBPACK_IMPORTED_MODULE_2__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
|
|
8854
8906
|
/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
8855
8907
|
/* harmony import */ var _attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7909);
|
|
8856
8908
|
/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26136);
|
|
@@ -8869,14 +8921,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8869
8921
|
/* harmony import */ var _human_size_to_bytes__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(37427);
|
|
8870
8922
|
/* harmony import */ var _is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(78048);
|
|
8871
8923
|
/* harmony import */ var _mark_deprecated__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(49385);
|
|
8872
|
-
/* harmony import */ var
|
|
8873
|
-
/* harmony import */ var
|
|
8874
|
-
/* harmony import */ var
|
|
8875
|
-
/* harmony import */ var
|
|
8876
|
-
/* harmony import */ var
|
|
8877
|
-
/* harmony import */ var
|
|
8878
|
-
/* harmony import */ var
|
|
8879
|
-
/* harmony import */ var
|
|
8924
|
+
/* harmony import */ var _media_wrapper__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(83314);
|
|
8925
|
+
/* harmony import */ var _parse_query__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(36310);
|
|
8926
|
+
/* harmony import */ var _print__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(57075);
|
|
8927
|
+
/* harmony import */ var _reset__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(43379);
|
|
8928
|
+
/* harmony import */ var _scroll_into_view__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(60898);
|
|
8929
|
+
/* harmony import */ var _selector__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(28723);
|
|
8930
|
+
/* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(52144);
|
|
8931
|
+
/* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(42820);
|
|
8932
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(71125);
|
|
8880
8933
|
/*!
|
|
8881
8934
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
8882
8935
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -8911,6 +8964,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8911
8964
|
|
|
8912
8965
|
|
|
8913
8966
|
|
|
8967
|
+
|
|
8914
8968
|
|
|
8915
8969
|
|
|
8916
8970
|
/***/ }),
|
|
@@ -8983,6 +9037,77 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8983
9037
|
/* harmony export */ ]);
|
|
8984
9038
|
|
|
8985
9039
|
|
|
9040
|
+
/***/ }),
|
|
9041
|
+
|
|
9042
|
+
/***/ 83314:
|
|
9043
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
9044
|
+
|
|
9045
|
+
"use strict";
|
|
9046
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9047
|
+
/* harmony export */ createMediaWrapper: function() { return /* binding */ createMediaWrapper; },
|
|
9048
|
+
/* harmony export */ getMediaWrapper: function() { return /* binding */ getMediaWrapper; },
|
|
9049
|
+
/* harmony export */ getWrappedMedia: function() { return /* binding */ getWrappedMedia; },
|
|
9050
|
+
/* harmony export */ wrapMedia: function() { return /* binding */ wrapMedia; }
|
|
9051
|
+
/* harmony export */ });
|
|
9052
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
9053
|
+
/*!
|
|
9054
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
9055
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
9056
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
9057
|
+
*/ /**
|
|
9058
|
+
* @module helpers/utils
|
|
9059
|
+
*/
|
|
9060
|
+
const isWrapper = (node, wrapper)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(node) && node.nodeName.toLowerCase() === wrapper.tag.toLowerCase() && node.classList.contains(wrapper.className);
|
|
9061
|
+
/**
|
|
9062
|
+
* The media in `elm` when `elm` is a wrapper media keep in the content (see
|
|
9063
|
+
* `mediaWrappers`): an element of a type `elm` is the wrapper for
|
|
9064
|
+
*/ function getWrappedMedia(jodit, elm) {
|
|
9065
|
+
for (const [tag, wrapper] of Object.entries(jodit.o.mediaWrappers ?? {})){
|
|
9066
|
+
if (isWrapper(elm, wrapper)) {
|
|
9067
|
+
const media = elm.querySelector(tag);
|
|
9068
|
+
if (media) {
|
|
9069
|
+
return media;
|
|
9070
|
+
}
|
|
9071
|
+
}
|
|
9072
|
+
}
|
|
9073
|
+
return null;
|
|
9074
|
+
}
|
|
9075
|
+
/**
|
|
9076
|
+
* The wrapper media keep in the content (see `mediaWrappers`) that is or
|
|
9077
|
+
* holds `node`
|
|
9078
|
+
*/ function getMediaWrapper(jodit, node) {
|
|
9079
|
+
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(node, (elm)=>Boolean(getWrappedMedia(jodit, elm)), jodit.editor);
|
|
9080
|
+
}
|
|
9081
|
+
/**
|
|
9082
|
+
* An empty wrapper for media of type `tag` to keep in the content (see
|
|
9083
|
+
* `mediaWrappers`), or null when there is none for it
|
|
9084
|
+
*/ function createMediaWrapper(jodit, tag) {
|
|
9085
|
+
const wrapper = jodit.o.mediaWrappers?.[tag.toLowerCase()];
|
|
9086
|
+
if (!wrapper) {
|
|
9087
|
+
return null;
|
|
9088
|
+
}
|
|
9089
|
+
return jodit.createInside.element(wrapper.tag, {
|
|
9090
|
+
class: wrapper.className,
|
|
9091
|
+
contenteditable: false,
|
|
9092
|
+
draggable: true
|
|
9093
|
+
});
|
|
9094
|
+
}
|
|
9095
|
+
/**
|
|
9096
|
+
* Puts `element` in the wrapper for its type (see `mediaWrappers`), and
|
|
9097
|
+
* returns the wrapper, or `element` when there is none for it
|
|
9098
|
+
*/ function wrapMedia(jodit, element) {
|
|
9099
|
+
const wrapper = createMediaWrapper(jodit, element.nodeName);
|
|
9100
|
+
if (!wrapper) {
|
|
9101
|
+
return element;
|
|
9102
|
+
}
|
|
9103
|
+
if (element.parentNode) {
|
|
9104
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before(element, wrapper);
|
|
9105
|
+
}
|
|
9106
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(wrapper, element);
|
|
9107
|
+
return wrapper;
|
|
9108
|
+
}
|
|
9109
|
+
|
|
9110
|
+
|
|
8986
9111
|
/***/ }),
|
|
8987
9112
|
|
|
8988
9113
|
/***/ 36310:
|
|
@@ -11522,9 +11647,9 @@ class Selection {
|
|
|
11522
11647
|
if (styles && typeof styles === 'object') {
|
|
11523
11648
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.css)(image, styles);
|
|
11524
11649
|
}
|
|
11525
|
-
const { imageDefaultAlign
|
|
11650
|
+
const { imageDefaultAlign } = this.j.o;
|
|
11526
11651
|
if (imageDefaultAlign && imageDefaultAlign !== 'normal') {
|
|
11527
|
-
(0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_7__.hAlignElement)(image, imageDefaultAlign,
|
|
11652
|
+
(0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_7__.hAlignElement)(image, imageDefaultAlign, (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_7__.getAlignClasses)(this.j, image));
|
|
11528
11653
|
}
|
|
11529
11654
|
const onload = ()=>{
|
|
11530
11655
|
if (image.naturalHeight < image.offsetHeight || image.naturalWidth < image.offsetWidth) {
|
|
@@ -24576,6 +24701,7 @@ const INPUT_TAGS = new Set([
|
|
|
24576
24701
|
'textarea',
|
|
24577
24702
|
'select'
|
|
24578
24703
|
]);
|
|
24704
|
+
const TYPE_AHEAD_TIMEOUT = 1000;
|
|
24579
24705
|
const FOCUSABLE_SELECTOR = [
|
|
24580
24706
|
'button:not([disabled])',
|
|
24581
24707
|
'a[href]',
|
|
@@ -24833,11 +24959,55 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
|
|
|
24833
24959
|
items[(index + 1) % items.length].focus();
|
|
24834
24960
|
break;
|
|
24835
24961
|
default:
|
|
24836
|
-
|
|
24962
|
+
if (!this.control.list || !this.__typeAhead(e.key, items, index)) {
|
|
24963
|
+
return;
|
|
24964
|
+
}
|
|
24837
24965
|
}
|
|
24838
24966
|
e.preventDefault();
|
|
24839
24967
|
e.stopPropagation();
|
|
24840
24968
|
}
|
|
24969
|
+
/**
|
|
24970
|
+
* The mouse opens a dropdown without taking the focus out of the editor.
|
|
24971
|
+
* While a dropdown list is open, typing there searches the list, as in an
|
|
24972
|
+
* open `<select>`, instead of writing into the content
|
|
24973
|
+
*/ __onEditorKeyDown(e) {
|
|
24974
|
+
if (!this.openedPopup || !this.control.list || e.altKey || e.ctrlKey || e.metaKey || !this.__typeAhead(e.key, this.__popupFocusables(), -1)) {
|
|
24975
|
+
return;
|
|
24976
|
+
}
|
|
24977
|
+
e.preventDefault();
|
|
24978
|
+
return false;
|
|
24979
|
+
}
|
|
24980
|
+
/**
|
|
24981
|
+
* Typing in a dropdown list focuses the next item whose label starts with
|
|
24982
|
+
* the typed text, whatever their case and accents, and repeating one letter
|
|
24983
|
+
* cycles through the items that start with it, like the WAI-ARIA menu
|
|
24984
|
+
* pattern's type-ahead. The typed text starts again after a pause, or once
|
|
24985
|
+
* the focus has moved on
|
|
24986
|
+
*/ __typeAhead(key, items, index) {
|
|
24987
|
+
const now = Date.now();
|
|
24988
|
+
if (now - this.__typedAt > TYPE_AHEAD_TIMEOUT || items[index] !== this.__typedTo) {
|
|
24989
|
+
this.__typed = '';
|
|
24990
|
+
}
|
|
24991
|
+
if (key.length !== 1 || key === ' ' && !this.__typed) {
|
|
24992
|
+
return false;
|
|
24993
|
+
}
|
|
24994
|
+
this.__typedAt = now;
|
|
24995
|
+
this.__typed += key;
|
|
24996
|
+
this.__typedTo = items[index];
|
|
24997
|
+
const { compare } = new Intl.Collator(undefined, {
|
|
24998
|
+
usage: 'search',
|
|
24999
|
+
sensitivity: 'base'
|
|
25000
|
+
}), 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);
|
|
25001
|
+
for(let i = 0; i < items.length; i += 1){
|
|
25002
|
+
const item = items[(start + i) % items.length], label = item.textContent?.trim() ?? '';
|
|
25003
|
+
if (compare(label.slice(0, prefix.length), prefix) === 0) {
|
|
25004
|
+
item.focus();
|
|
25005
|
+
this.__typedTo = item;
|
|
25006
|
+
break;
|
|
25007
|
+
}
|
|
25008
|
+
}
|
|
25009
|
+
return true;
|
|
25010
|
+
}
|
|
24841
25011
|
/**
|
|
24842
25012
|
* Visible controls of the opened dropdown that can take the focus
|
|
24843
25013
|
*/ __popupFocusables() {
|
|
@@ -24853,8 +25023,12 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
|
|
|
24853
25023
|
const controls = this.jodit.options.controls ?? {}, getControl = (key)=>(0,jodit_core_ui_helpers_get_control_type__WEBPACK_IMPORTED_MODULE_20__.findControlType)(key, controls);
|
|
24854
25024
|
const list = control.list;
|
|
24855
25025
|
const menu = this.openPopup();
|
|
24856
|
-
const toolbar = (0,_factory__WEBPACK_IMPORTED_MODULE_23__.makeCollection)(this.j);
|
|
24857
25026
|
menu.parentElement = this;
|
|
25027
|
+
const content = control.popup?.(this.j, this.toolbar?.getTarget(this) ?? this.target ?? null, this.__closePopup, this);
|
|
25028
|
+
if (content) {
|
|
25029
|
+
return this.__openMenu(menu, content);
|
|
25030
|
+
}
|
|
25031
|
+
const toolbar = (0,_factory__WEBPACK_IMPORTED_MODULE_23__.makeCollection)(this.j);
|
|
24858
25032
|
toolbar.parentElement = menu;
|
|
24859
25033
|
toolbar.mode = 'vertical';
|
|
24860
25034
|
const isListItem = (key)=>(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_12__.isPlainObject)(key) && 'title' in key && 'value' in key;
|
|
@@ -24902,7 +25076,10 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
|
|
|
24902
25076
|
return childControl;
|
|
24903
25077
|
};
|
|
24904
25078
|
toolbar.build((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_9__.isArray)(list) ? list.map(getButton) : (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_18__.keys)(list, false).map((key)=>getButton(key, list[key])), this.target);
|
|
24905
|
-
|
|
25079
|
+
this.__openMenu(menu, toolbar);
|
|
25080
|
+
}
|
|
25081
|
+
__openMenu(menu, content) {
|
|
25082
|
+
menu.setContent(content).open(()=>(0,jodit_core_helpers_size__WEBPACK_IMPORTED_MODULE_14__.position)(this.container), false, this.j.o.allowTabNavigation ? this.container : undefined);
|
|
24906
25083
|
this.state.activated = true;
|
|
24907
25084
|
}
|
|
24908
25085
|
onOutsideClick(e) {
|
|
@@ -24916,7 +25093,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
|
|
|
24916
25093
|
openPopup() {
|
|
24917
25094
|
this.__closePopup();
|
|
24918
25095
|
this.openedPopup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_22__.Popup(this.j, false);
|
|
24919
|
-
this.j.e.on(this.ow, 'mousedown touchstart', this.onOutsideClick).on('escape closeAllPopups', this.onOutsideClick).on(this.openedPopup.container, 'keydown', this.__onPopupKeyDown);
|
|
25096
|
+
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);
|
|
24920
25097
|
return this.openedPopup;
|
|
24921
25098
|
}
|
|
24922
25099
|
__closePopup() {
|
|
@@ -24931,7 +25108,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
|
|
|
24931
25108
|
// popup while the outer `removeChild` is still running and Chrome
|
|
24932
25109
|
// throws NotFoundError. See #1458
|
|
24933
25110
|
this.openedPopup = null;
|
|
24934
|
-
this.j.e.off(this.ow, 'mousedown touchstart', this.onOutsideClick).off('escape closeAllPopups', this.onOutsideClick);
|
|
25111
|
+
this.j.e.off(this.ow, 'mousedown touchstart', this.onOutsideClick).off('escape closeAllPopups', this.onOutsideClick).off('keydown', this.__onEditorKeyDown);
|
|
24935
25112
|
// The keyboard brought the focus into the dropdown: give it back to
|
|
24936
25113
|
// the button, otherwise it would fall out to the document
|
|
24937
25114
|
const { activeElement } = this.od, hadFocus = activeElement && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isOrContains(popup.container, activeElement);
|
|
@@ -24986,12 +25163,12 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
|
|
|
24986
25163
|
return super.destruct();
|
|
24987
25164
|
}
|
|
24988
25165
|
constructor(jodit, control, target = null){
|
|
24989
|
-
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 = {
|
|
25166
|
+
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 = {
|
|
24990
25167
|
...(0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.UIButtonState)(),
|
|
24991
25168
|
theme: 'toolbar',
|
|
24992
25169
|
currentValue: '',
|
|
24993
25170
|
hasTrigger: false
|
|
24994
|
-
}, this.openedPopup = null;
|
|
25171
|
+
}, this.__typed = '', this.__typedAt = 0, this.__typedTo = null, this.openedPopup = null;
|
|
24995
25172
|
const button = this.getElm('button');
|
|
24996
25173
|
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_16__.assert)(button, 'Element button should exists');
|
|
24997
25174
|
this.button = button;
|
|
@@ -25040,6 +25217,9 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
|
|
|
25040
25217
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
25041
25218
|
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_4__.autobind
|
|
25042
25219
|
], ToolbarButton.prototype, "__onPopupKeyDown", null);
|
|
25220
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
25221
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_4__.autobind
|
|
25222
|
+
], ToolbarButton.prototype, "__onEditorKeyDown", null);
|
|
25043
25223
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
25044
25224
|
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_4__.autobind
|
|
25045
25225
|
], ToolbarButton.prototype, "onOutsideClick", null);
|
|
@@ -31519,7 +31699,12 @@ const brBoxes = new Set([
|
|
|
31519
31699
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findNotEmptySibling(br, false)) {
|
|
31520
31700
|
return;
|
|
31521
31701
|
}
|
|
31522
|
-
|
|
31702
|
+
// After a block is inserted the caret is already at the end of its
|
|
31703
|
+
// text; moving it before the `<br>` would put it on a line of its own
|
|
31704
|
+
// below the block (#1315)
|
|
31705
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isOrContains(node, jodit.s.range.startContainer)) {
|
|
31706
|
+
jodit.s.setCursorBefore(br);
|
|
31707
|
+
}
|
|
31523
31708
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(br);
|
|
31524
31709
|
}
|
|
31525
31710
|
}
|
|
@@ -31556,13 +31741,22 @@ const brBoxes = new Set([
|
|
|
31556
31741
|
let current = jodit.s.current()?.parentElement ?? null;
|
|
31557
31742
|
while(current && current !== jodit.editor){
|
|
31558
31743
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(current)) {
|
|
31559
|
-
|
|
31744
|
+
// In DIV mode the caret's own empty block is a line, like
|
|
31745
|
+
// `<p><br></p>`, not a container to insert into (#1315)
|
|
31746
|
+
const isEmptyLine = !parent && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(current, jodit.o.enter) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(current);
|
|
31747
|
+
if (jodit.o.dtd.blockLimits[current.nodeName.toLowerCase()] && !isEmptyLine) {
|
|
31560
31748
|
break;
|
|
31561
31749
|
}
|
|
31562
31750
|
parent = current;
|
|
31563
31751
|
}
|
|
31564
31752
|
current = current.parentElement;
|
|
31565
31753
|
}
|
|
31754
|
+
// A list that is all of the inserted content adds its items to the
|
|
31755
|
+
// list of the item it goes into, as the browsers' own paste does
|
|
31756
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isLeaf(current) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isList(node) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isFragment(node.parentNode) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findNotEmptySibling(node, false)) {
|
|
31757
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.unwrap(node);
|
|
31758
|
+
parent = current;
|
|
31759
|
+
}
|
|
31566
31760
|
if (parent) {
|
|
31567
31761
|
jodit.s.setCursorAfter(parent);
|
|
31568
31762
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(parent)) {
|
|
@@ -31617,10 +31811,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.dtd = {
|
|
|
31617
31811
|
audio: 1,
|
|
31618
31812
|
body: 1,
|
|
31619
31813
|
caption: 1,
|
|
31814
|
+
dd: 1,
|
|
31620
31815
|
details: 1,
|
|
31621
31816
|
dir: 1,
|
|
31622
31817
|
div: 1,
|
|
31623
31818
|
dl: 1,
|
|
31819
|
+
dt: 1,
|
|
31624
31820
|
fieldset: 1,
|
|
31625
31821
|
figcaption: 1,
|
|
31626
31822
|
figure: 1,
|
|
@@ -31628,6 +31824,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.dtd = {
|
|
|
31628
31824
|
form: 1,
|
|
31629
31825
|
header: 1,
|
|
31630
31826
|
hgroup: 1,
|
|
31827
|
+
li: 1,
|
|
31631
31828
|
main: 1,
|
|
31632
31829
|
menu: 1,
|
|
31633
31830
|
nav: 1,
|
|
@@ -32432,14 +32629,16 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('focus', focus);
|
|
|
32432
32629
|
|
|
32433
32630
|
"use strict";
|
|
32434
32631
|
/* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27795);
|
|
32435
|
-
/* harmony import */ var
|
|
32436
|
-
/* harmony import */ var
|
|
32437
|
-
/* harmony import */ var
|
|
32438
|
-
/* harmony import */ var
|
|
32439
|
-
/* harmony import */ var
|
|
32440
|
-
/* harmony import */ var
|
|
32441
|
-
/* harmony import */ var
|
|
32442
|
-
/* harmony import */ var
|
|
32632
|
+
/* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17312);
|
|
32633
|
+
/* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4040);
|
|
32634
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80991);
|
|
32635
|
+
/* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29434);
|
|
32636
|
+
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5266);
|
|
32637
|
+
/* harmony import */ var _icons_font_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(48842);
|
|
32638
|
+
/* harmony import */ var _icons_font_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_icons_font_svg__WEBPACK_IMPORTED_MODULE_6__);
|
|
32639
|
+
/* harmony import */ var _icons_fontsize_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(25501);
|
|
32640
|
+
/* harmony import */ var _icons_fontsize_svg__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_icons_fontsize_svg__WEBPACK_IMPORTED_MODULE_7__);
|
|
32641
|
+
/* harmony import */ var _font_picker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80045);
|
|
32443
32642
|
/*!
|
|
32444
32643
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
32445
32644
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -32453,11 +32652,18 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('focus', focus);
|
|
|
32453
32652
|
|
|
32454
32653
|
|
|
32455
32654
|
|
|
32655
|
+
|
|
32656
|
+
|
|
32456
32657
|
/**
|
|
32457
32658
|
* Default font-size points
|
|
32458
|
-
*/
|
|
32459
|
-
|
|
32460
|
-
|
|
32659
|
+
*/ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.defaultFontSizePoints = 'px';
|
|
32660
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.font = {
|
|
32661
|
+
googleFonts: {
|
|
32662
|
+
url: ''
|
|
32663
|
+
}
|
|
32664
|
+
};
|
|
32665
|
+
jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__.Icon.set('font', (_icons_font_svg__WEBPACK_IMPORTED_MODULE_6___default())).set('fontsize', (_icons_fontsize_svg__WEBPACK_IMPORTED_MODULE_7___default()));
|
|
32666
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.fontsize = {
|
|
32461
32667
|
command: 'fontsize',
|
|
32462
32668
|
data: {
|
|
32463
32669
|
cssRule: 'font-size',
|
|
@@ -32502,7 +32708,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.fontsize = {
|
|
|
32502
32708
|
}
|
|
32503
32709
|
const control = button.control;
|
|
32504
32710
|
const cssKey = control.data?.cssRule || 'font-size';
|
|
32505
|
-
const value = (0,
|
|
32711
|
+
const value = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(box, cssKey);
|
|
32506
32712
|
if (cssKey === 'font-size') {
|
|
32507
32713
|
const numValue = parseFloat(value.toString());
|
|
32508
32714
|
if (editor.o.defaultFontSizePoints === 'pt') {
|
|
@@ -32532,12 +32738,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.fontsize = {
|
|
|
32532
32738
|
return keySet.has(normalize(value.toString()));
|
|
32533
32739
|
}
|
|
32534
32740
|
};
|
|
32535
|
-
|
|
32536
|
-
|
|
32741
|
+
const hadSelection = new WeakSet();
|
|
32742
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.font = {
|
|
32743
|
+
...jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.fontsize,
|
|
32537
32744
|
command: 'fontname',
|
|
32538
32745
|
textTemplate: (j, value)=>{
|
|
32539
32746
|
const [first] = value.split(',');
|
|
32540
|
-
return (0,
|
|
32747
|
+
return (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__.trimChars)(first, '"\'');
|
|
32541
32748
|
},
|
|
32542
32749
|
list: {
|
|
32543
32750
|
'': 'Default',
|
|
@@ -32559,6 +32766,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.font = {
|
|
|
32559
32766
|
} catch {}
|
|
32560
32767
|
return `<span data-style="${key}" style="${isAvailable ? `font-family: ${key}!important;` : ''}">${value}</span>`;
|
|
32561
32768
|
},
|
|
32769
|
+
popup: (editor, current, close, button)=>editor.o.font.googleFonts.url ? new _font_picker__WEBPACK_IMPORTED_MODULE_8__.UIFontPicker(editor, button, close) : false,
|
|
32562
32770
|
data: {
|
|
32563
32771
|
cssRule: 'font-family',
|
|
32564
32772
|
normalize: (v)=>{
|
|
@@ -32567,19 +32775,19 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.font = {
|
|
|
32567
32775
|
},
|
|
32568
32776
|
// When no font is explicitly set, the computed font-family equals the
|
|
32569
32777
|
// editor's own default (e.g. `-apple-system, …`). Return '' so the
|
|
32570
|
-
// button shows the `Default`
|
|
32571
|
-
// See #1370
|
|
32572
|
-
value: (editor)=>{
|
|
32573
|
-
const current = editor.s.current();
|
|
32574
|
-
|
|
32575
|
-
|
|
32576
|
-
|
|
32577
|
-
|
|
32578
|
-
if (
|
|
32778
|
+
// button shows the list's `Default` entry, when it has one, instead of
|
|
32779
|
+
// that raw stack. See #1370
|
|
32780
|
+
value: (editor, button)=>{
|
|
32781
|
+
const current = editor.s.current(), box = current && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(current, jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isElement, editor.editor);
|
|
32782
|
+
// Until there is a selection the button shows the editor's own font,
|
|
32783
|
+
// and afterwards the font of the last one
|
|
32784
|
+
if (box) {
|
|
32785
|
+
hadSelection.add(button);
|
|
32786
|
+
} else if (hadSelection.has(button)) {
|
|
32579
32787
|
return;
|
|
32580
32788
|
}
|
|
32581
|
-
const value = (0,
|
|
32582
|
-
if (value === (0,
|
|
32789
|
+
const value = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(box || editor.editor, 'font-family').toString(), { list } = button.control;
|
|
32790
|
+
if (value === (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(editor.editor, 'font-family').toString() && ((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_1__.isArray)(list) ? list.includes('') : '' in (list ?? {}))) {
|
|
32583
32791
|
return '';
|
|
32584
32792
|
}
|
|
32585
32793
|
return value;
|
|
@@ -32588,6 +32796,254 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.font = {
|
|
|
32588
32796
|
};
|
|
32589
32797
|
|
|
32590
32798
|
|
|
32799
|
+
/***/ }),
|
|
32800
|
+
|
|
32801
|
+
/***/ 80045:
|
|
32802
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
32803
|
+
|
|
32804
|
+
"use strict";
|
|
32805
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
32806
|
+
/* harmony export */ UIFontPicker: function() { return /* binding */ UIFontPicker; }
|
|
32807
|
+
/* harmony export */ });
|
|
32808
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
|
|
32809
|
+
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
|
|
32810
|
+
/* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(91672);
|
|
32811
|
+
/* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(68616);
|
|
32812
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23211);
|
|
32813
|
+
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28077);
|
|
32814
|
+
/* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(17312);
|
|
32815
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7909);
|
|
32816
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
|
|
32817
|
+
/* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(71125);
|
|
32818
|
+
/* harmony import */ var jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(96007);
|
|
32819
|
+
/* harmony import */ var _google_fonts__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(24939);
|
|
32820
|
+
/*!
|
|
32821
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
32822
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
32823
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
32824
|
+
*/ /**
|
|
32825
|
+
* @module plugins/font
|
|
32826
|
+
*/
|
|
32827
|
+
|
|
32828
|
+
|
|
32829
|
+
|
|
32830
|
+
|
|
32831
|
+
|
|
32832
|
+
|
|
32833
|
+
|
|
32834
|
+
|
|
32835
|
+
|
|
32836
|
+
|
|
32837
|
+
|
|
32838
|
+
|
|
32839
|
+
const HEADINGS = [
|
|
32840
|
+
'h1',
|
|
32841
|
+
'h2',
|
|
32842
|
+
'h3',
|
|
32843
|
+
'h4',
|
|
32844
|
+
'h5',
|
|
32845
|
+
'h6'
|
|
32846
|
+
];
|
|
32847
|
+
const GENERIC_FAMILIES = new Set([
|
|
32848
|
+
'serif',
|
|
32849
|
+
'sans-serif',
|
|
32850
|
+
'monospace',
|
|
32851
|
+
'cursive',
|
|
32852
|
+
'fantasy',
|
|
32853
|
+
'system-ui',
|
|
32854
|
+
'ui-serif',
|
|
32855
|
+
'ui-sans-serif',
|
|
32856
|
+
'ui-monospace',
|
|
32857
|
+
'ui-rounded'
|
|
32858
|
+
]);
|
|
32859
|
+
/**
|
|
32860
|
+
* A family that names a font, not a generic family or a vendor keyword such
|
|
32861
|
+
* as `-apple-system`
|
|
32862
|
+
*/ function isFontName(family) {
|
|
32863
|
+
return Boolean(family) && !family.startsWith('-') && !GENERIC_FAMILIES.has(family);
|
|
32864
|
+
}
|
|
32865
|
+
class UIFontPicker extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_10__.UIElement {
|
|
32866
|
+
className() {
|
|
32867
|
+
return 'UIFontPicker';
|
|
32868
|
+
}
|
|
32869
|
+
__render() {
|
|
32870
|
+
const { control } = this.__button, { list = {} } = control, listed = (0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_6__.isArray)(list) ? list.map((key)=>({
|
|
32871
|
+
value: key.toString(),
|
|
32872
|
+
title: key.toString()
|
|
32873
|
+
})) : (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_9__.keys)(list, false).map((key)=>({
|
|
32874
|
+
value: key,
|
|
32875
|
+
title: list[key].toString()
|
|
32876
|
+
})), google = Array.from(this.__googleFonts.fonts.values(), (font)=>({
|
|
32877
|
+
value: this.__googleFonts.value(font),
|
|
32878
|
+
title: font.family,
|
|
32879
|
+
font
|
|
32880
|
+
})), byFamily = new Map();
|
|
32881
|
+
[
|
|
32882
|
+
...google,
|
|
32883
|
+
...listed
|
|
32884
|
+
].forEach((entry)=>byFamily.set((0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(entry.value), entry));
|
|
32885
|
+
const theme = new Map(), used = new Map();
|
|
32886
|
+
// The theme's own fonts are listed too, so its body font can be chosen
|
|
32887
|
+
// to take a font off
|
|
32888
|
+
this.__themeFonts().forEach((fontFamily)=>{
|
|
32889
|
+
const family = (0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(fontFamily), title = fontFamily.split(',')[0].replace(/["']/g, '').trim(), entry = byFamily.get(family) ?? (isFontName(family) ? {
|
|
32890
|
+
value: fontFamily,
|
|
32891
|
+
title
|
|
32892
|
+
} : undefined);
|
|
32893
|
+
entry && !theme.has(family) && theme.set(family, entry);
|
|
32894
|
+
});
|
|
32895
|
+
this.__usedFonts().forEach((fontFamily)=>{
|
|
32896
|
+
const family = (0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(fontFamily), entry = byFamily.get(family);
|
|
32897
|
+
entry && !theme.has(family) && used.set(family, entry);
|
|
32898
|
+
});
|
|
32899
|
+
const defaultEntry = listed.find((entry)=>entry.value === ''), current = (0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(control.value?.(this.j, this.__button) ?? '');
|
|
32900
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.detach(this.container);
|
|
32901
|
+
this.__fonts.clear();
|
|
32902
|
+
defaultEntry && this.__append(current, [
|
|
32903
|
+
defaultEntry
|
|
32904
|
+
]);
|
|
32905
|
+
this.__append(current, [
|
|
32906
|
+
...theme.values()
|
|
32907
|
+
], 'Theme fonts');
|
|
32908
|
+
this.__append(current, [
|
|
32909
|
+
...used.values()
|
|
32910
|
+
], 'Used fonts');
|
|
32911
|
+
this.__append(current, listed.filter((entry)=>entry !== defaultEntry), 'System fonts');
|
|
32912
|
+
this.__append(current, google, 'Google Fonts');
|
|
32913
|
+
this.__observeGoogleFonts();
|
|
32914
|
+
}
|
|
32915
|
+
/**
|
|
32916
|
+
* The fonts the editor's styles give text and each heading
|
|
32917
|
+
*/ __themeFonts() {
|
|
32918
|
+
const { editor } = this.j, fonts = [
|
|
32919
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(editor, 'font-family').toString()
|
|
32920
|
+
];
|
|
32921
|
+
HEADINGS.forEach((tag)=>{
|
|
32922
|
+
const heading = this.j.createInside.element(tag, {
|
|
32923
|
+
style: 'display: none'
|
|
32924
|
+
});
|
|
32925
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(editor, heading);
|
|
32926
|
+
fonts.push((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(heading, 'font-family').toString());
|
|
32927
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(heading);
|
|
32928
|
+
});
|
|
32929
|
+
return fonts;
|
|
32930
|
+
}
|
|
32931
|
+
/**
|
|
32932
|
+
* The fonts the content sets
|
|
32933
|
+
*/ __usedFonts() {
|
|
32934
|
+
return Array.from(this.j.editor.querySelectorAll('[style*="font-family"]'), (element)=>element.style.fontFamily);
|
|
32935
|
+
}
|
|
32936
|
+
__append(current, entries, heading) {
|
|
32937
|
+
if (!entries.length) {
|
|
32938
|
+
return;
|
|
32939
|
+
}
|
|
32940
|
+
const { control } = this.__button, group = this.j.c.div(this.getFullElName('group'));
|
|
32941
|
+
if (heading) {
|
|
32942
|
+
const title = this.j.c.div(this.getFullElName('heading'), {
|
|
32943
|
+
id: `${this.getFullElName('heading')}-${(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.uniqueUid)()}`
|
|
32944
|
+
});
|
|
32945
|
+
title.textContent = this.i18n(heading);
|
|
32946
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(group, {
|
|
32947
|
+
role: 'group',
|
|
32948
|
+
'aria-labelledby': title.id
|
|
32949
|
+
});
|
|
32950
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(group, title);
|
|
32951
|
+
}
|
|
32952
|
+
entries.forEach((entry)=>{
|
|
32953
|
+
const item = this.j.c.element('button', {
|
|
32954
|
+
type: 'button',
|
|
32955
|
+
class: this.getFullElName('item'),
|
|
32956
|
+
'data-value': entry.value,
|
|
32957
|
+
'aria-pressed': (0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(entry.value) === current
|
|
32958
|
+
});
|
|
32959
|
+
if (entry.font) {
|
|
32960
|
+
item.textContent = entry.title;
|
|
32961
|
+
this.__fonts.set(item, entry.font);
|
|
32962
|
+
} else {
|
|
32963
|
+
item.innerHTML = control.childTemplate?.(this.j, entry.value, entry.title, this.__button) ?? entry.title;
|
|
32964
|
+
}
|
|
32965
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(group, item);
|
|
32966
|
+
});
|
|
32967
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(this.container, group);
|
|
32968
|
+
}
|
|
32969
|
+
/**
|
|
32970
|
+
* Shows the names of the Google Fonts in view, and those just below it,
|
|
32971
|
+
* in their own fonts. Setting every item's font up front would have the
|
|
32972
|
+
* browser look for each of the library's families among the installed
|
|
32973
|
+
* fonts the first time the list opens
|
|
32974
|
+
*/ __observeGoogleFonts() {
|
|
32975
|
+
this.j.async.requestAnimationFrame(()=>{
|
|
32976
|
+
this.__observer?.disconnect();
|
|
32977
|
+
if (this.isDestructed || !this.__fonts.size) {
|
|
32978
|
+
return;
|
|
32979
|
+
}
|
|
32980
|
+
const observer = new IntersectionObserver((entries)=>{
|
|
32981
|
+
const fonts = [];
|
|
32982
|
+
entries.forEach(({ isIntersecting, target })=>{
|
|
32983
|
+
const font = this.__fonts.get(target);
|
|
32984
|
+
if (isIntersecting && font) {
|
|
32985
|
+
fonts.push(font);
|
|
32986
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(target, {
|
|
32987
|
+
fontFamily: this.__googleFonts.value(font)
|
|
32988
|
+
});
|
|
32989
|
+
observer.unobserve(target);
|
|
32990
|
+
}
|
|
32991
|
+
});
|
|
32992
|
+
this.__googleFonts.preview(fonts);
|
|
32993
|
+
}, {
|
|
32994
|
+
root: this.container.parentElement,
|
|
32995
|
+
rootMargin: '0px 0px 400px 0px'
|
|
32996
|
+
});
|
|
32997
|
+
this.__fonts.forEach((_, item)=>observer.observe(item));
|
|
32998
|
+
this.__observer = observer;
|
|
32999
|
+
});
|
|
33000
|
+
}
|
|
33001
|
+
/**
|
|
33002
|
+
* Keeps the editor's selection, as the toolbar buttons do
|
|
33003
|
+
*/ onMouseDown(e) {
|
|
33004
|
+
e.preventDefault();
|
|
33005
|
+
}
|
|
33006
|
+
onClick(e) {
|
|
33007
|
+
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);
|
|
33008
|
+
if (!item) {
|
|
33009
|
+
return;
|
|
33010
|
+
}
|
|
33011
|
+
const value = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(item, 'data-value') ?? '', font = this.__googleFonts.find(value), // The font the text has anyway is taken off rather than written
|
|
33012
|
+
inherited = (0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(value) === (0,_google_fonts__WEBPACK_IMPORTED_MODULE_11__.firstFamily)(this.__blockFont());
|
|
33013
|
+
font && !inherited && this.__googleFonts.load(font);
|
|
33014
|
+
this.j.execCommand('fontname', false, inherited ? '' : value);
|
|
33015
|
+
this.__close();
|
|
33016
|
+
}
|
|
33017
|
+
/**
|
|
33018
|
+
* The font the selected text has without a font of its own: its block's
|
|
33019
|
+
*/ __blockFont() {
|
|
33020
|
+
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);
|
|
33021
|
+
return (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(block ?? this.j.editor, 'font-family').toString();
|
|
33022
|
+
}
|
|
33023
|
+
destruct() {
|
|
33024
|
+
this.__observer?.disconnect();
|
|
33025
|
+
super.destruct();
|
|
33026
|
+
}
|
|
33027
|
+
constructor(jodit, __button, __close){
|
|
33028
|
+
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;
|
|
33029
|
+
this.__googleFonts = jodit.getInstance(_google_fonts__WEBPACK_IMPORTED_MODULE_11__.GoogleFonts);
|
|
33030
|
+
this.__render();
|
|
33031
|
+
if (!this.__googleFonts.fonts.size) {
|
|
33032
|
+
this.__googleFonts.ready.then(()=>!this.isDestructed && this.__render());
|
|
33033
|
+
}
|
|
33034
|
+
}
|
|
33035
|
+
}
|
|
33036
|
+
;(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
33037
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_3__.watch)('container:mousedown')
|
|
33038
|
+
], UIFontPicker.prototype, "onMouseDown", null);
|
|
33039
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
33040
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_3__.watch)('container:click')
|
|
33041
|
+
], UIFontPicker.prototype, "onClick", null);
|
|
33042
|
+
UIFontPicker = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
33043
|
+
jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_2__.component
|
|
33044
|
+
], UIFontPicker);
|
|
33045
|
+
|
|
33046
|
+
|
|
32591
33047
|
/***/ }),
|
|
32592
33048
|
|
|
32593
33049
|
/***/ 50294:
|
|
@@ -32598,6 +33054,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.font = {
|
|
|
32598
33054
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28077);
|
|
32599
33055
|
/* harmony import */ var jodit_core_helpers___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65946);
|
|
32600
33056
|
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7433);
|
|
33057
|
+
/* harmony import */ var _google_fonts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(24939);
|
|
32601
33058
|
/*!
|
|
32602
33059
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
32603
33060
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -32609,6 +33066,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.font = {
|
|
|
32609
33066
|
*/
|
|
32610
33067
|
|
|
32611
33068
|
|
|
33069
|
+
|
|
32612
33070
|
/**
|
|
32613
33071
|
* Process commands `fontsize` and `fontname`
|
|
32614
33072
|
*/ function font(editor) {
|
|
@@ -32619,6 +33077,18 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.font = {
|
|
|
32619
33077
|
name: 'fontsize',
|
|
32620
33078
|
group: 'font'
|
|
32621
33079
|
});
|
|
33080
|
+
if (editor.o.font.googleFonts.url) {
|
|
33081
|
+
const googleFonts = editor.getInstance(_google_fonts__WEBPACK_IMPORTED_MODULE_3__.GoogleFonts), loadUsed = editor.async.debounce(()=>googleFonts.loadUsed(), editor.defaultTimeout);
|
|
33082
|
+
googleFonts.ready.then(loadUsed);
|
|
33083
|
+
editor.e.on('afterInit afterSetMode change', loadUsed);
|
|
33084
|
+
}
|
|
33085
|
+
// An iframe's stylesheets can arrive after the toolbar first shows the
|
|
33086
|
+
// editor's font
|
|
33087
|
+
editor.e.on('afterInit', ()=>{
|
|
33088
|
+
editor.iframe && editor.e.on(editor.ed, 'load', ()=>editor.e.fire('updateToolbar'), {
|
|
33089
|
+
capture: true
|
|
33090
|
+
});
|
|
33091
|
+
});
|
|
32622
33092
|
const callback = (command, second, third)=>{
|
|
32623
33093
|
switch(command){
|
|
32624
33094
|
case 'fontsize':
|
|
@@ -32648,6 +33118,160 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.font = {
|
|
|
32648
33118
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_0__.pluginSystem.add('font', font);
|
|
32649
33119
|
|
|
32650
33120
|
|
|
33121
|
+
/***/ }),
|
|
33122
|
+
|
|
33123
|
+
/***/ 24939:
|
|
33124
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
33125
|
+
|
|
33126
|
+
"use strict";
|
|
33127
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
33128
|
+
/* harmony export */ GoogleFonts: function() { return /* binding */ GoogleFonts; },
|
|
33129
|
+
/* harmony export */ firstFamily: function() { return /* binding */ firstFamily; }
|
|
33130
|
+
/* harmony export */ });
|
|
33131
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
|
|
33132
|
+
/* harmony import */ var jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59609);
|
|
33133
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23211);
|
|
33134
|
+
/* harmony import */ var jodit_core_request_ajax__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17338);
|
|
33135
|
+
/*!
|
|
33136
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
33137
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
33138
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
33139
|
+
*/ /**
|
|
33140
|
+
* @module plugins/font
|
|
33141
|
+
*/
|
|
33142
|
+
|
|
33143
|
+
|
|
33144
|
+
|
|
33145
|
+
const CSS_URL = 'https://fonts.googleapis.com/css2';
|
|
33146
|
+
// `cursive` and `fantasy` stand in badly for a handwriting or display font
|
|
33147
|
+
const GENERIC_FAMILIES = {
|
|
33148
|
+
serif: 'serif',
|
|
33149
|
+
monospace: 'monospace'
|
|
33150
|
+
};
|
|
33151
|
+
const libraries = new Map();
|
|
33152
|
+
/**
|
|
33153
|
+
* The fonts of the library at `url`, fetched once for every editor on the page
|
|
33154
|
+
*/ function library(jodit, url) {
|
|
33155
|
+
let fonts = libraries.get(url);
|
|
33156
|
+
if (!fonts) {
|
|
33157
|
+
const ajax = new jodit_core_request_ajax__WEBPACK_IMPORTED_MODULE_3__.Ajax({
|
|
33158
|
+
url,
|
|
33159
|
+
method: 'GET'
|
|
33160
|
+
}, jodit.o.defaultAjaxOptions);
|
|
33161
|
+
fonts = ajax.send().then((response)=>response.json())// A font without a regular style can't be asked for by its name alone
|
|
33162
|
+
.then(({ items })=>items.filter((font)=>font.variants.includes('regular'))).catch(()=>{
|
|
33163
|
+
libraries.delete(url);
|
|
33164
|
+
return [];
|
|
33165
|
+
}).finally(()=>ajax.destruct());
|
|
33166
|
+
libraries.set(url, fonts);
|
|
33167
|
+
}
|
|
33168
|
+
return fonts;
|
|
33169
|
+
}
|
|
33170
|
+
/**
|
|
33171
|
+
* The first family of a `font-family` value, unquoted and in lower case for
|
|
33172
|
+
* comparing
|
|
33173
|
+
*/ function firstFamily(fontFamily) {
|
|
33174
|
+
return fontFamily.split(',')[0].replace(/["']/g, '').trim().toLowerCase();
|
|
33175
|
+
}
|
|
33176
|
+
/**
|
|
33177
|
+
* Loads fonts from Google Fonts: the whole of each font the content uses into
|
|
33178
|
+
* the editor's document, and just the letters of its name for the font list
|
|
33179
|
+
*/ class GoogleFonts extends jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_1__.ViewComponent {
|
|
33180
|
+
className() {
|
|
33181
|
+
return 'GoogleFonts';
|
|
33182
|
+
}
|
|
33183
|
+
/**
|
|
33184
|
+
* The library's font named first in a `font-family` value
|
|
33185
|
+
*/ find(fontFamily) {
|
|
33186
|
+
return this.fonts.get(firstFamily(fontFamily));
|
|
33187
|
+
}
|
|
33188
|
+
/**
|
|
33189
|
+
* The `font-family` value that applies a font
|
|
33190
|
+
*/ value(font) {
|
|
33191
|
+
return `'${font.family}', ${GENERIC_FAMILIES[font.category] ?? 'sans-serif'}`;
|
|
33192
|
+
}
|
|
33193
|
+
/**
|
|
33194
|
+
* Loads the regular, italic, bold and bold italic styles that a font has
|
|
33195
|
+
* into the editor's document
|
|
33196
|
+
*/ load(font) {
|
|
33197
|
+
const loaded = this.__loadedInto(this.j.ed);
|
|
33198
|
+
if (loaded.has(font.family)) {
|
|
33199
|
+
return;
|
|
33200
|
+
}
|
|
33201
|
+
loaded.add(font.family);
|
|
33202
|
+
const styles = [
|
|
33203
|
+
[
|
|
33204
|
+
'regular',
|
|
33205
|
+
'0,400'
|
|
33206
|
+
],
|
|
33207
|
+
[
|
|
33208
|
+
'700',
|
|
33209
|
+
'0,700'
|
|
33210
|
+
],
|
|
33211
|
+
[
|
|
33212
|
+
'italic',
|
|
33213
|
+
'1,400'
|
|
33214
|
+
],
|
|
33215
|
+
[
|
|
33216
|
+
'700italic',
|
|
33217
|
+
'1,700'
|
|
33218
|
+
]
|
|
33219
|
+
].filter(([variant])=>font.variants.includes(variant)).map(([, style])=>style);
|
|
33220
|
+
this.__append(this.j.ed, `family=${this.__family(font)}:ital,wght@${styles.join(';')}`);
|
|
33221
|
+
}
|
|
33222
|
+
/**
|
|
33223
|
+
* Loads every font of the library that the content uses
|
|
33224
|
+
*/ loadUsed() {
|
|
33225
|
+
this.j.editor.querySelectorAll('[style*="font-family"]').forEach((element)=>{
|
|
33226
|
+
const font = this.find(element.style.fontFamily);
|
|
33227
|
+
font && this.load(font);
|
|
33228
|
+
});
|
|
33229
|
+
}
|
|
33230
|
+
/**
|
|
33231
|
+
* Loads into the page just the letters of each font's name, so the font
|
|
33232
|
+
* list can show the name in its font
|
|
33233
|
+
*/ preview(fonts) {
|
|
33234
|
+
const loaded = this.__loadedInto(this.j.od);
|
|
33235
|
+
fonts = fonts.filter((font)=>!this.__previewed.has(font.family) && !loaded.has(font.family));
|
|
33236
|
+
if (!fonts.length) {
|
|
33237
|
+
return;
|
|
33238
|
+
}
|
|
33239
|
+
fonts.forEach((font)=>this.__previewed.add(font.family));
|
|
33240
|
+
const families = fonts.map((font)=>`family=${this.__family(font)}`), letters = new Set(fonts.map((font)=>font.family).join(''));
|
|
33241
|
+
this.__append(this.j.od, `${families.join('&')}&text=${encodeURIComponent([
|
|
33242
|
+
...letters
|
|
33243
|
+
].join(''))}`);
|
|
33244
|
+
}
|
|
33245
|
+
__loadedInto(doc) {
|
|
33246
|
+
const loaded = this.__loaded.get(doc) ?? new Set();
|
|
33247
|
+
this.__loaded.set(doc, loaded);
|
|
33248
|
+
return loaded;
|
|
33249
|
+
}
|
|
33250
|
+
__family(font) {
|
|
33251
|
+
return encodeURIComponent(font.family).replace(/%20/g, '+');
|
|
33252
|
+
}
|
|
33253
|
+
__append(doc, query) {
|
|
33254
|
+
const link = doc.createElement('link');
|
|
33255
|
+
link.rel = 'stylesheet';
|
|
33256
|
+
link.href = `${CSS_URL}?${query}&display=swap`;
|
|
33257
|
+
doc.head.appendChild(link);
|
|
33258
|
+
this.__links.push(link);
|
|
33259
|
+
}
|
|
33260
|
+
destruct() {
|
|
33261
|
+
this.__links.forEach((link)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.safeRemove(link));
|
|
33262
|
+
super.destruct();
|
|
33263
|
+
}
|
|
33264
|
+
constructor(jodit){
|
|
33265
|
+
super(jodit), /**
|
|
33266
|
+
* The library by lower-case family, empty until it arrives
|
|
33267
|
+
*/ (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());
|
|
33268
|
+
this.ready = library(jodit, jodit.o.font.googleFonts.url).then((fonts)=>{
|
|
33269
|
+
fonts.forEach((font)=>this.fonts.set(font.family.toLowerCase(), font));
|
|
33270
|
+
});
|
|
33271
|
+
}
|
|
33272
|
+
}
|
|
33273
|
+
|
|
33274
|
+
|
|
32651
33275
|
/***/ }),
|
|
32652
33276
|
|
|
32653
33277
|
/***/ 96863:
|
|
@@ -33900,12 +34524,13 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.pluginSystem.add('imageProperties
|
|
|
33900
34524
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
33901
34525
|
/* harmony export */ readValuesFromImage: function() { return /* binding */ readValuesFromImage; }
|
|
33902
34526
|
/* harmony export */ });
|
|
33903
|
-
/* harmony import */ var
|
|
33904
|
-
/* harmony import */ var
|
|
33905
|
-
/* harmony import */ var
|
|
33906
|
-
/* harmony import */ var
|
|
33907
|
-
/* harmony import */ var
|
|
33908
|
-
/* harmony import */ var
|
|
34527
|
+
/* harmony import */ var jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16849);
|
|
34528
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7909);
|
|
34529
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80991);
|
|
34530
|
+
/* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26633);
|
|
34531
|
+
/* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(79310);
|
|
34532
|
+
/* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(18380);
|
|
34533
|
+
/* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(57339);
|
|
33909
34534
|
/*!
|
|
33910
34535
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
33911
34536
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -33918,32 +34543,33 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.pluginSystem.add('imageProperties
|
|
|
33918
34543
|
|
|
33919
34544
|
|
|
33920
34545
|
|
|
34546
|
+
|
|
33921
34547
|
/**
|
|
33922
34548
|
* Read values from image and set it to state
|
|
33923
34549
|
* @private
|
|
33924
34550
|
*/ async function readValuesFromImage(j, state) {
|
|
33925
34551
|
const { sourceImage: image, values } = state;
|
|
33926
|
-
(0,
|
|
34552
|
+
(0,_align__WEBPACK_IMPORTED_MODULE_3__.readAlign)(image, values, (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_0__.getAlignClasses)(j, image));
|
|
33927
34553
|
// Border radius
|
|
33928
|
-
values.borderRadius = parseInt((0,
|
|
34554
|
+
values.borderRadius = parseInt((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.cssInline)(image, 'border-radius') || '0', 10) || 0;
|
|
33929
34555
|
// Id
|
|
33930
|
-
values.id = (0,
|
|
34556
|
+
values.id = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'id') || '';
|
|
33931
34557
|
// Title
|
|
33932
|
-
values.imageTitle = (0,
|
|
34558
|
+
values.imageTitle = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'title') || '';
|
|
33933
34559
|
// Alt
|
|
33934
|
-
values.imageAlt = (0,
|
|
34560
|
+
values.imageAlt = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'alt') || '';
|
|
33935
34561
|
// Style
|
|
33936
|
-
values.style = (0,
|
|
34562
|
+
values.style = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'style') || '';
|
|
33937
34563
|
// Classes
|
|
33938
|
-
values.classes = ((0,
|
|
34564
|
+
values.classes = ((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
|
|
33939
34565
|
// Margins
|
|
33940
|
-
(0,
|
|
34566
|
+
(0,_margin__WEBPACK_IMPORTED_MODULE_5__.readMargins)(image, values, state);
|
|
33941
34567
|
// Link
|
|
33942
|
-
(0,
|
|
34568
|
+
(0,_link__WEBPACK_IMPORTED_MODULE_4__.readLink)(state, j, values);
|
|
33943
34569
|
// Src
|
|
33944
|
-
values.imageSrc = (0,
|
|
34570
|
+
values.imageSrc = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'src') || '';
|
|
33945
34571
|
// Image size
|
|
33946
|
-
return (0,
|
|
34572
|
+
return (0,_size__WEBPACK_IMPORTED_MODULE_6__.readSizes)(image, values, state);
|
|
33947
34573
|
}
|
|
33948
34574
|
|
|
33949
34575
|
|
|
@@ -34964,7 +35590,7 @@ UIImagePositionTab = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
34964
35590
|
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'id', id || null);
|
|
34965
35591
|
}
|
|
34966
35592
|
if (opt.image.editAlign) {
|
|
34967
|
-
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(image, align,
|
|
35593
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(image, align, (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.getAlignClasses)(j, image));
|
|
34968
35594
|
}
|
|
34969
35595
|
}
|
|
34970
35596
|
|
|
@@ -35794,6 +36420,7 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
|
|
|
35794
36420
|
/* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85932);
|
|
35795
36421
|
/* harmony import */ var jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16849);
|
|
35796
36422
|
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80991);
|
|
36423
|
+
/* harmony import */ var jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(83314);
|
|
35797
36424
|
/*!
|
|
35798
36425
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
35799
36426
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -35804,9 +36431,7 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
|
|
|
35804
36431
|
|
|
35805
36432
|
|
|
35806
36433
|
|
|
35807
|
-
|
|
35808
|
-
// keep inline styles
|
|
35809
|
-
const alignClasses = (editor, elm)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(elm, 'img') ? editor.o.imageAlignClasses : null;
|
|
36434
|
+
|
|
35810
36435
|
// A Normal image sits where the text of its line is aligned (#1531)
|
|
35811
36436
|
const lineAlign = (editor, elm)=>{
|
|
35812
36437
|
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;
|
|
@@ -35827,7 +36452,7 @@ const lineAlign = (editor, elm)=>{
|
|
|
35827
36452
|
return 'left';
|
|
35828
36453
|
}
|
|
35829
36454
|
};
|
|
35830
|
-
const currentAlign = (editor, elm)=>elm ? (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__.getHAlign)(elm,
|
|
36455
|
+
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';
|
|
35831
36456
|
const align = {
|
|
35832
36457
|
name: 'left',
|
|
35833
36458
|
childTemplate: (_, __, value)=>value,
|
|
@@ -35847,23 +36472,25 @@ const align = {
|
|
|
35847
36472
|
return (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__.isString)(value) && currentAlign(editor, button.target) === value.toLowerCase();
|
|
35848
36473
|
},
|
|
35849
36474
|
exec: (editor, elm, { control })=>{
|
|
35850
|
-
|
|
36475
|
+
// A media wrapper kept in the content (`mediaWrappers`) is aligned itself
|
|
36476
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(elm) || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(elm, new Set([
|
|
35851
36477
|
'img',
|
|
35852
36478
|
'jodit',
|
|
35853
36479
|
'jodit-media'
|
|
35854
|
-
]))) {
|
|
36480
|
+
])) && (0,jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_4__.getMediaWrapper)(editor, elm) !== elm) {
|
|
35855
36481
|
return;
|
|
35856
36482
|
}
|
|
35857
36483
|
const command = control.args && (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__.isString)(control.args[0]) ? control.args[0].toLowerCase() : '';
|
|
35858
36484
|
if (!command) {
|
|
35859
36485
|
return false;
|
|
35860
36486
|
}
|
|
35861
|
-
;(0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_2__.hAlignElement)(elm, command,
|
|
36487
|
+
;(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));
|
|
35862
36488
|
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(elm, new Set([
|
|
35863
36489
|
'jodit',
|
|
35864
36490
|
'jodit-media'
|
|
35865
36491
|
])) && elm.firstElementChild) {
|
|
35866
|
-
|
|
36492
|
+
const media = elm.firstElementChild;
|
|
36493
|
+
(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));
|
|
35867
36494
|
}
|
|
35868
36495
|
editor.synchronizeValues();
|
|
35869
36496
|
editor.e.fire('recalcPositionPopup');
|
|
@@ -36015,9 +36642,11 @@ const align = {
|
|
|
36015
36642
|
return (0,jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_9__.makeCollection)(this.jodit, this.popup);
|
|
36016
36643
|
}
|
|
36017
36644
|
onClick(node) {
|
|
36018
|
-
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);
|
|
36019
|
-
|
|
36020
|
-
|
|
36645
|
+
const elements = this.elmsList, mediaWrapper = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.getMediaWrapper)(this.j, node), target = mediaWrapper ?? (jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(node, 'img') ? node : jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.closest(node, elements, this.j.editor));
|
|
36646
|
+
// A media wrapper kept in the content gets the media popup
|
|
36647
|
+
const type = mediaWrapper ? 'jodit-media' : target?.nodeName.toLowerCase();
|
|
36648
|
+
if (target && type && this.canShowPopupForType(type)) {
|
|
36649
|
+
this.showPopup(()=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.position)(target, this.j), type, target);
|
|
36021
36650
|
return false;
|
|
36022
36651
|
}
|
|
36023
36652
|
}
|
|
@@ -36200,7 +36829,11 @@ const align = {
|
|
|
36200
36829
|
this.removeListenersForElements();
|
|
36201
36830
|
}
|
|
36202
36831
|
_eventsList() {
|
|
36203
|
-
|
|
36832
|
+
// Clicks on a media wrapper kept in the content (`mediaWrappers`)
|
|
36833
|
+
const wrapperTags = Object.values(this.j.o.mediaWrappers ?? {}).map(({ tag })=>tag.toLowerCase());
|
|
36834
|
+
const el = [
|
|
36835
|
+
...new Set(this.elmsList.concat(wrapperTags))
|
|
36836
|
+
];
|
|
36204
36837
|
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(' ');
|
|
36205
36838
|
}
|
|
36206
36839
|
addListenersForElements() {
|
|
@@ -37738,6 +38371,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaBlocks = [
|
|
|
37738
38371
|
'video',
|
|
37739
38372
|
'audio'
|
|
37740
38373
|
];
|
|
38374
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
|
|
37741
38375
|
|
|
37742
38376
|
|
|
37743
38377
|
/***/ }),
|
|
@@ -37771,11 +38405,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaBlocks = [
|
|
|
37771
38405
|
* Process `video` and `audio`
|
|
37772
38406
|
*/ function media(editor) {
|
|
37773
38407
|
const keyFake = 'jodit_fake_wrapper';
|
|
37774
|
-
const { mediaFakeTag, mediaBlocks, mediaInFakeBlock } = editor.options;
|
|
38408
|
+
const { mediaFakeTag, mediaBlocks, mediaInFakeBlock, mediaWrappers } = editor.options;
|
|
37775
38409
|
const wrap = (element)=>{
|
|
37776
38410
|
if (element.parentNode && (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(element.parentNode, 'data-jodit_iframe_wrapper')) {
|
|
37777
38411
|
element = element.parentNode;
|
|
37778
|
-
} else {
|
|
38412
|
+
} else if (mediaWrappers[element.nodeName.toLowerCase()]) {
|
|
38413
|
+
element = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.getMediaWrapper)(editor, element) ?? (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.wrapMedia)(editor, element);
|
|
38414
|
+
} else if (mediaInFakeBlock) {
|
|
37779
38415
|
const wrapper = editor.createInside.element(mediaFakeTag, {
|
|
37780
38416
|
'data-jodit-temp': 1,
|
|
37781
38417
|
contenteditable: false,
|
|
@@ -37793,12 +38429,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaBlocks = [
|
|
|
37793
38429
|
}
|
|
37794
38430
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(wrapper, element);
|
|
37795
38431
|
element = wrapper;
|
|
38432
|
+
} else {
|
|
38433
|
+
return;
|
|
37796
38434
|
}
|
|
37797
38435
|
editor.e.off(element, 'mousedown.select touchstart.select').on(element, 'mousedown.select touchstart.select', ()=>{
|
|
37798
38436
|
editor.s.setCursorAfter(element);
|
|
37799
38437
|
});
|
|
37800
38438
|
};
|
|
37801
|
-
if (mediaInFakeBlock) {
|
|
38439
|
+
if (mediaInFakeBlock || Object.keys(mediaWrappers).length) {
|
|
37802
38440
|
editor.e.on('afterGetValueFromEditor', (data)=>{
|
|
37803
38441
|
const rxp = new RegExp(`<${mediaFakeTag}[^>]+data-${keyFake}[^>]+>([^]+?)</${mediaFakeTag}>`, 'ig');
|
|
37804
38442
|
if (rxp.test(data.value)) {
|
|
@@ -45454,14 +46092,32 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.pluginSystem.add('toolbarNavigati
|
|
|
45454
46092
|
|
|
45455
46093
|
|
|
45456
46094
|
|
|
46095
|
+
// Media the popup inserts go in their wrapper (see `mediaWrappers`), aligned
|
|
46096
|
+
// with `mediaDefaultAlign`
|
|
46097
|
+
function prepareMedia(jodit, element) {
|
|
46098
|
+
const media = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.wrapMedia)(jodit, element);
|
|
46099
|
+
const { mediaDefaultAlign } = jodit.o;
|
|
46100
|
+
if (mediaDefaultAlign && mediaDefaultAlign !== 'normal') {
|
|
46101
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.hAlignElement)(media, mediaDefaultAlign, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.getAlignClasses)(jodit, media));
|
|
46102
|
+
}
|
|
46103
|
+
return media;
|
|
46104
|
+
}
|
|
45457
46105
|
function insertVideos(data) {
|
|
45458
46106
|
data.files?.forEach((file)=>{
|
|
45459
|
-
this.s.insertNode(this.createInside.element('video', {
|
|
46107
|
+
this.s.insertNode(prepareMedia(this, this.createInside.element('video', {
|
|
45460
46108
|
controls: '',
|
|
45461
46109
|
src: data.baseurl + file
|
|
45462
|
-
}));
|
|
46110
|
+
})));
|
|
45463
46111
|
});
|
|
45464
46112
|
}
|
|
46113
|
+
// Embed code that is one element is prepared as media; other code goes in as
|
|
46114
|
+
// it is
|
|
46115
|
+
function prepareEmbedCode(jodit, code) {
|
|
46116
|
+
const box = jodit.createInside.div();
|
|
46117
|
+
box.innerHTML = code.trim();
|
|
46118
|
+
const element = box.firstElementChild;
|
|
46119
|
+
return element && box.childNodes.length === 1 ? prepareMedia(jodit, element) : code;
|
|
46120
|
+
}
|
|
45465
46121
|
jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.video = {
|
|
45466
46122
|
parseUrlToVideoEmbed: jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed,
|
|
45467
46123
|
defaultWidth: 400,
|
|
@@ -45499,7 +46155,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.video = {
|
|
|
45499
46155
|
])
|
|
45500
46156
|
]), tabs = [], insertCode = (code)=>{
|
|
45501
46157
|
jodit.s.restore();
|
|
45502
|
-
jodit.s.insertHTML(code);
|
|
46158
|
+
jodit.s.insertHTML(prepareEmbedCode(jodit, code));
|
|
45503
46159
|
close();
|
|
45504
46160
|
};
|
|
45505
46161
|
jodit.s.save();
|