jodit 4.18.3 → 4.18.6
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 +52 -0
- package/es2015/jodit.css +72 -34
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +35 -10
- package/es2015/jodit.js +1967 -327
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +41 -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 +35 -10
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +35 -10
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +72 -34
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +42 -17
- package/es2021/jodit.js +1949 -323
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +42 -17
- 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 +72 -34
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +42 -17
- package/es2021.en/jodit.js +1923 -297
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +51 -26
- 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 +85 -38
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +2225 -379
- 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 +28 -26
- package/esm/config.js +19 -21
- package/esm/core/constants.js +1 -1
- package/esm/core/helpers/html/apply-styles.js +3 -0
- package/esm/core/helpers/html/clean-from-word.js +3 -0
- package/esm/core/helpers/html/strip-tags.js +24 -6
- package/esm/core/helpers/html/word-lists.d.ts +29 -0
- package/esm/core/helpers/html/word-lists.js +158 -0
- package/esm/core/helpers/utils/align.d.ts +1 -1
- package/esm/core/helpers/utils/align.js +2 -3
- package/esm/core/selection/helpers/index.d.ts +1 -0
- package/esm/core/selection/helpers/index.js +1 -0
- package/esm/core/selection/helpers/is-moved.d.ts +15 -0
- package/esm/core/selection/helpers/is-moved.js +22 -0
- package/esm/core/selection/style/api/list/toggle-ordered-list.js +40 -3
- package/esm/core/selection/style/transactions.js +5 -2
- package/esm/jodit.js +14 -4
- package/esm/langs/ar.d.ts +10 -0
- package/esm/langs/ar.js +11 -1
- package/esm/langs/az.d.ts +10 -0
- package/esm/langs/az.js +11 -1
- package/esm/langs/cs_cz.d.ts +10 -0
- package/esm/langs/cs_cz.js +12 -1
- package/esm/langs/de.d.ts +10 -0
- package/esm/langs/de.js +11 -1
- package/esm/langs/es.d.ts +10 -0
- package/esm/langs/es.js +11 -1
- package/esm/langs/fa.d.ts +10 -0
- package/esm/langs/fa.js +11 -1
- package/esm/langs/fi.d.ts +10 -0
- package/esm/langs/fi.js +11 -1
- package/esm/langs/fr.d.ts +10 -0
- package/esm/langs/fr.js +11 -1
- package/esm/langs/he.d.ts +10 -0
- package/esm/langs/he.js +11 -1
- package/esm/langs/hu.d.ts +10 -0
- package/esm/langs/hu.js +11 -1
- package/esm/langs/id.d.ts +10 -0
- package/esm/langs/id.js +11 -1
- package/esm/langs/it.d.ts +10 -0
- package/esm/langs/it.js +11 -1
- package/esm/langs/ja.d.ts +10 -0
- package/esm/langs/ja.js +11 -1
- package/esm/langs/ko.d.ts +10 -0
- package/esm/langs/ko.js +11 -1
- package/esm/langs/mn.d.ts +10 -0
- package/esm/langs/mn.js +11 -1
- package/esm/langs/nl.d.ts +10 -0
- package/esm/langs/nl.js +11 -1
- package/esm/langs/no.d.ts +10 -0
- package/esm/langs/no.js +11 -1
- package/esm/langs/pl.d.ts +10 -0
- package/esm/langs/pl.js +11 -1
- package/esm/langs/pt_br.d.ts +10 -0
- package/esm/langs/pt_br.js +11 -1
- package/esm/langs/ru.d.ts +10 -0
- package/esm/langs/ru.js +11 -1
- package/esm/langs/sk.d.ts +10 -0
- package/esm/langs/sk.js +11 -1
- package/esm/langs/sv.d.ts +10 -0
- package/esm/langs/sv.js +11 -1
- package/esm/langs/tr.d.ts +10 -0
- package/esm/langs/tr.js +11 -1
- package/esm/langs/ua.d.ts +10 -0
- package/esm/langs/ua.js +11 -1
- package/esm/langs/zh_cn.d.ts +10 -0
- package/esm/langs/zh_cn.js +11 -1
- package/esm/langs/zh_tw.d.ts +10 -0
- package/esm/langs/zh_tw.js +11 -1
- package/esm/modules/dialog/dialog.d.ts +7 -0
- package/esm/modules/dialog/dialog.js +24 -6
- package/esm/modules/table/table.d.ts +6 -0
- package/esm/modules/table/table.js +18 -26
- package/esm/plugins/all.d.ts +1 -0
- package/esm/plugins/all.js +1 -0
- package/esm/plugins/backspace/cases/check-join-neighbors.js +90 -3
- package/esm/plugins/clean-html/clean-html.d.ts +8 -0
- package/esm/plugins/clean-html/clean-html.js +21 -1
- package/esm/plugins/clean-html/helpers/index.d.ts +1 -0
- package/esm/plugins/clean-html/helpers/index.js +1 -0
- package/esm/plugins/clean-html/helpers/remove-placeholder-br.d.ts +16 -0
- package/esm/plugins/clean-html/helpers/remove-placeholder-br.js +51 -0
- package/esm/plugins/delete/delete.d.ts +11 -1
- package/esm/plugins/delete/delete.js +92 -16
- package/esm/plugins/focus/focus.js +12 -1
- package/esm/plugins/iframe/config.d.ts +3 -0
- package/esm/plugins/iframe/config.js +0 -27
- package/esm/plugins/iframe/iframe.js +8 -1
- package/esm/plugins/image-processor/image-processor.d.ts +4 -1
- package/esm/plugins/image-processor/image-processor.js +15 -4
- package/esm/plugins/image-properties/readers/align.d.ts +2 -2
- package/esm/plugins/index.d.ts +1 -0
- package/esm/plugins/inline-popup/config/items/iframe.d.ts +9 -1
- package/esm/plugins/inline-popup/config/items/iframe.js +15 -0
- package/esm/plugins/inline-popup/inline-popup.d.ts +19 -0
- package/esm/plugins/inline-popup/inline-popup.js +70 -1
- package/esm/plugins/media/media.js +16 -7
- package/esm/plugins/ordered-list/config.js +13 -2
- package/esm/plugins/ordered-list/start-dialog.d.ts +19 -0
- package/esm/plugins/ordered-list/start-dialog.js +58 -0
- package/esm/plugins/placeholder/placeholder.js +7 -1
- package/esm/plugins/resizer/config.d.ts +5 -3
- package/esm/plugins/resizer/config.js +8 -2
- package/esm/plugins/resizer/resizer.d.ts +20 -0
- package/esm/plugins/resizer/resizer.js +140 -17
- package/esm/plugins/select-cells/select-cells.d.ts +23 -0
- package/esm/plugins/select-cells/select-cells.js +75 -1
- package/esm/plugins/table-keyboard-navigation/table-keyboard-navigation.js +3 -2
- package/esm/plugins/video/config.d.ts +6 -0
- package/esm/plugins/video/config.js +77 -65
- package/esm/plugins/video-properties/interface.d.ts +31 -0
- package/esm/plugins/video-properties/interface.js +6 -0
- package/esm/plugins/video-properties/readers.d.ts +26 -0
- package/esm/plugins/video-properties/readers.js +65 -0
- package/esm/plugins/video-properties/replace.d.ts +15 -0
- package/esm/plugins/video-properties/replace.js +97 -0
- package/esm/plugins/video-properties/ui/ui-video-form.d.ts +41 -0
- package/esm/plugins/video-properties/ui/ui-video-form.js +228 -0
- package/esm/plugins/video-properties/video-properties.d.ts +37 -0
- package/esm/plugins/video-properties/video-properties.js +175 -0
- package/esm/plugins/video-properties/writers.d.ts +15 -0
- package/esm/plugins/video-properties/writers.js +73 -0
- package/esm/types/types.d.ts +1 -1
- package/package.json +1 -1
- package/types/config.d.ts +28 -26
- package/types/core/helpers/html/word-lists.d.ts +29 -0
- package/types/core/helpers/utils/align.d.ts +1 -1
- package/types/core/selection/helpers/index.d.ts +1 -0
- package/types/core/selection/helpers/is-moved.d.ts +15 -0
- package/types/langs/ar.d.ts +10 -0
- package/types/langs/az.d.ts +10 -0
- package/types/langs/cs_cz.d.ts +10 -0
- package/types/langs/de.d.ts +10 -0
- package/types/langs/es.d.ts +10 -0
- package/types/langs/fa.d.ts +10 -0
- package/types/langs/fi.d.ts +10 -0
- package/types/langs/fr.d.ts +10 -0
- package/types/langs/he.d.ts +10 -0
- package/types/langs/hu.d.ts +10 -0
- package/types/langs/id.d.ts +10 -0
- package/types/langs/it.d.ts +10 -0
- package/types/langs/ja.d.ts +10 -0
- package/types/langs/ko.d.ts +10 -0
- package/types/langs/mn.d.ts +10 -0
- package/types/langs/nl.d.ts +10 -0
- package/types/langs/no.d.ts +10 -0
- package/types/langs/pl.d.ts +10 -0
- package/types/langs/pt_br.d.ts +10 -0
- package/types/langs/ru.d.ts +10 -0
- package/types/langs/sk.d.ts +10 -0
- package/types/langs/sv.d.ts +10 -0
- package/types/langs/tr.d.ts +10 -0
- package/types/langs/ua.d.ts +10 -0
- package/types/langs/zh_cn.d.ts +10 -0
- package/types/langs/zh_tw.d.ts +10 -0
- package/types/modules/dialog/dialog.d.ts +7 -0
- package/types/modules/table/table.d.ts +6 -0
- package/types/plugins/clean-html/clean-html.d.ts +8 -0
- package/types/plugins/clean-html/helpers/index.d.ts +1 -0
- package/types/plugins/clean-html/helpers/remove-placeholder-br.d.ts +16 -0
- package/types/plugins/delete/delete.d.ts +11 -1
- package/types/plugins/iframe/config.d.ts +3 -0
- package/types/plugins/image-processor/image-processor.d.ts +4 -1
- package/types/plugins/image-properties/readers/align.d.ts +2 -2
- package/types/plugins/index.d.ts +1 -0
- package/types/plugins/inline-popup/config/items/iframe.d.ts +9 -1
- package/types/plugins/inline-popup/inline-popup.d.ts +19 -0
- package/types/plugins/ordered-list/start-dialog.d.ts +19 -0
- package/types/plugins/resizer/config.d.ts +5 -3
- package/types/plugins/resizer/resizer.d.ts +20 -0
- package/types/plugins/select-cells/select-cells.d.ts +23 -0
- package/types/plugins/video/config.d.ts +6 -0
- package/types/plugins/video-properties/interface.d.ts +31 -0
- package/types/plugins/video-properties/readers.d.ts +26 -0
- package/types/plugins/video-properties/replace.d.ts +15 -0
- package/types/plugins/video-properties/ui/ui-video-form.d.ts +41 -0
- package/types/plugins/video-properties/video-properties.d.ts +37 -0
- package/types/plugins/video-properties/writers.d.ts +15 -0
- package/types/types/types.d.ts +1 -1
package/es2021.en/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.18.
|
|
4
|
+
* Version: v4.18.6
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -733,28 +733,18 @@ let ConfigPrototype = {};
|
|
|
733
733
|
* them unaligned
|
|
734
734
|
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "imageDefaultAlign", 'normal');
|
|
735
735
|
/**
|
|
736
|
-
*
|
|
737
|
-
* `
|
|
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.
|
|
741
|
-
*
|
|
742
|
-
* ```javascript
|
|
743
|
-
* Jodit.make('#editor', {
|
|
744
|
-
* imageAlignClasses: {
|
|
745
|
-
* left: 'align-left',
|
|
746
|
-
* right: 'align-right',
|
|
747
|
-
* center: ['align-center', 'centered']
|
|
748
|
-
* }
|
|
749
|
-
* });
|
|
750
|
-
* ```
|
|
736
|
+
* @deprecated Use `alignClasses.img`, which takes the same value. When
|
|
737
|
+
* `alignClasses.img` isn't set, the editor copies this into it.
|
|
751
738
|
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "imageAlignClasses", null);
|
|
752
739
|
/**
|
|
753
|
-
* Class names to align elements with, by tag name,
|
|
754
|
-
*
|
|
755
|
-
* popup.
|
|
756
|
-
*
|
|
757
|
-
*
|
|
740
|
+
* Class names to align elements with, by tag name, instead of an inline
|
|
741
|
+
* `float` or `margin`: `img`, and `video`, `audio` and `iframe` in the
|
|
742
|
+
* media popup. Aligning an element removes every class listed for its tag
|
|
743
|
+
* and adds the chosen alignment's, which can be several separated by
|
|
744
|
+
* spaces. An alignment can also list several such sets, to recognise each
|
|
745
|
+
* of them; aligning writes the first. A media wrapper (see
|
|
746
|
+
* `mediaWrappers`), and Jodit's own `jodit` and `jodit-media` wrappers,
|
|
747
|
+
* are aligned with the classes for the media in them.
|
|
758
748
|
*
|
|
759
749
|
* ```javascript
|
|
760
750
|
* const media = {
|
|
@@ -764,7 +754,15 @@ let ConfigPrototype = {};
|
|
|
764
754
|
* };
|
|
765
755
|
*
|
|
766
756
|
* Jodit.make('#editor', {
|
|
767
|
-
* alignClasses: {
|
|
757
|
+
* alignClasses: {
|
|
758
|
+
* img: {
|
|
759
|
+
* left: 'align-left',
|
|
760
|
+
* right: 'align-right',
|
|
761
|
+
* center: ['align-center', 'centered']
|
|
762
|
+
* },
|
|
763
|
+
* video: media,
|
|
764
|
+
* iframe: media
|
|
765
|
+
* }
|
|
768
766
|
* });
|
|
769
767
|
* ```
|
|
770
768
|
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "alignClasses", {});
|
|
@@ -1824,7 +1822,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1824
1822
|
* ```
|
|
1825
1823
|
* @packageDocumentation
|
|
1826
1824
|
* @module constants
|
|
1827
|
-
*/ const APP_VERSION = "4.18.
|
|
1825
|
+
*/ const APP_VERSION = "4.18.6";
|
|
1828
1826
|
// prettier-ignore
|
|
1829
1827
|
const ES = "es2021";
|
|
1830
1828
|
const IS_ES_MODERN = true;
|
|
@@ -5857,10 +5855,11 @@ const isLicense = (license)=>(0,_is_string__WEBPACK_IMPORTED_MODULE_0__.isString
|
|
|
5857
5855
|
/* harmony export */ });
|
|
5858
5856
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
5859
5857
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
5860
|
-
/* harmony import */ var
|
|
5861
|
-
/* harmony import */ var
|
|
5862
|
-
/* harmony import */ var
|
|
5863
|
-
/* harmony import */ var
|
|
5858
|
+
/* harmony import */ var jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(75480);
|
|
5859
|
+
/* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4040);
|
|
5860
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7909);
|
|
5861
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80991);
|
|
5862
|
+
/* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(28723);
|
|
5864
5863
|
/*!
|
|
5865
5864
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
5866
5865
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -5873,6 +5872,7 @@ const isLicense = (license)=>(0,_is_string__WEBPACK_IMPORTED_MODULE_0__.isString
|
|
|
5873
5872
|
|
|
5874
5873
|
|
|
5875
5874
|
|
|
5875
|
+
|
|
5876
5876
|
function normalizeCSS(s) {
|
|
5877
5877
|
return s.replace(/mso-[a-z-]+:[\s]*[^;]+;/gi, '').replace(/mso-[a-z-]+:[\s]*[^";']+$/gi, '').replace(/border[a-z-]*:[\s]*[^;]+;/gi, '').replace(/([0-9.]+)(pt|cm)/gi, (match, units, metrics)=>{
|
|
5878
5878
|
switch(metrics.toLowerCase()){
|
|
@@ -5906,7 +5906,7 @@ function normalizeCSS(s) {
|
|
|
5906
5906
|
html = html.substring(0, closeIndex + '</html>'.length);
|
|
5907
5907
|
}
|
|
5908
5908
|
const iframe = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.createElement('iframe');
|
|
5909
|
-
(0,
|
|
5909
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(iframe, 'display', 'none');
|
|
5910
5910
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.body, iframe);
|
|
5911
5911
|
let convertedString = '', collection;
|
|
5912
5912
|
try {
|
|
@@ -5915,13 +5915,14 @@ function normalizeCSS(s) {
|
|
|
5915
5915
|
iframeDoc.open();
|
|
5916
5916
|
iframeDoc.write(html);
|
|
5917
5917
|
iframeDoc.close();
|
|
5918
|
+
const listItems = (0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_2__.readWordListItems)(iframeDoc.body);
|
|
5918
5919
|
// Word marks its auto-generated list markers (the literal
|
|
5919
5920
|
// bullet/number, e.g. `1.` or `·`) with `mso-list:Ignore`.
|
|
5920
5921
|
// They are display-only and must not be imported, otherwise
|
|
5921
5922
|
// the marker text leaks into the content. Drop them before any
|
|
5922
5923
|
// style normalization strips the `mso-list` hint. See #948
|
|
5923
5924
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(iframeDoc.body, (node)=>{
|
|
5924
|
-
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node) && /mso-list:\s*ignore/i.test((0,
|
|
5925
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node) && /mso-list:\s*ignore/i.test((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(node, 'style') || '')) {
|
|
5925
5926
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(node);
|
|
5926
5927
|
}
|
|
5927
5928
|
});
|
|
@@ -5932,7 +5933,7 @@ function normalizeCSS(s) {
|
|
|
5932
5933
|
if (rules[idx].selectorText === '') {
|
|
5933
5934
|
continue;
|
|
5934
5935
|
}
|
|
5935
|
-
collection = (0,
|
|
5936
|
+
collection = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_6__.$$)(rules[idx].selectorText, iframeDoc.body);
|
|
5936
5937
|
// `style.cssText` on purpose: the CSSOM parses the text,
|
|
5937
5938
|
// drops invalid declarations and re-serializes it. The raw
|
|
5938
5939
|
// `style` attribute would keep Word-only junk verbatim
|
|
@@ -5946,18 +5947,19 @@ function normalizeCSS(s) {
|
|
|
5946
5947
|
throw e;
|
|
5947
5948
|
}
|
|
5948
5949
|
}
|
|
5950
|
+
;(0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_2__.wrapWordListItems)(listItems);
|
|
5949
5951
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(iframeDoc.body, (node)=>{
|
|
5950
5952
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node)) {
|
|
5951
|
-
const cssText = (0,
|
|
5953
|
+
const cssText = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(node, 'style');
|
|
5952
5954
|
if (cssText) {
|
|
5953
5955
|
node.style.cssText = normalizeCSS(cssText);
|
|
5954
5956
|
}
|
|
5955
|
-
if (!(0,
|
|
5956
|
-
(0,
|
|
5957
|
+
if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(node, 'style')) {
|
|
5958
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(node, 'style', null);
|
|
5957
5959
|
}
|
|
5958
5960
|
}
|
|
5959
5961
|
});
|
|
5960
|
-
convertedString = iframeDoc.firstChild ? (0,
|
|
5962
|
+
convertedString = iframeDoc.firstChild ? (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_3__.trim)(iframeDoc.body.innerHTML) : '';
|
|
5961
5963
|
}
|
|
5962
5964
|
} catch {} finally{
|
|
5963
5965
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(iframe);
|
|
@@ -5965,7 +5967,7 @@ function normalizeCSS(s) {
|
|
|
5965
5967
|
if (convertedString) {
|
|
5966
5968
|
html = convertedString;
|
|
5967
5969
|
}
|
|
5968
|
-
return (0,
|
|
5970
|
+
return (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_3__.trim)(html.replace(/<(\/)?(html|colgroup|col|o:p)[^>]*>/g, '').replace(/<!--[^>]*>/g, ''));
|
|
5969
5971
|
}
|
|
5970
5972
|
|
|
5971
5973
|
|
|
@@ -5981,8 +5983,9 @@ function normalizeCSS(s) {
|
|
|
5981
5983
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
5982
5984
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
5983
5985
|
/* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88475);
|
|
5984
|
-
/* harmony import */ var
|
|
5985
|
-
/* harmony import */ var
|
|
5986
|
+
/* harmony import */ var jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(75480);
|
|
5987
|
+
/* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4040);
|
|
5988
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7909);
|
|
5986
5989
|
/*!
|
|
5987
5990
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
5988
5991
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -5994,6 +5997,7 @@ function normalizeCSS(s) {
|
|
|
5994
5997
|
|
|
5995
5998
|
|
|
5996
5999
|
|
|
6000
|
+
|
|
5997
6001
|
/**
|
|
5998
6002
|
* The method automatically cleans up content from Microsoft Word and other HTML sources to ensure clean, compliant
|
|
5999
6003
|
* content that matches the look and feel of the site.
|
|
@@ -6007,6 +6011,7 @@ function normalizeCSS(s) {
|
|
|
6007
6011
|
const div = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.createElement('div');
|
|
6008
6012
|
div.innerHTML = html;
|
|
6009
6013
|
const marks = [];
|
|
6014
|
+
const listItems = (0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_3__.readWordListItems)(div);
|
|
6010
6015
|
if (div.firstChild) {
|
|
6011
6016
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(div, (node)=>{
|
|
6012
6017
|
if (!node) {
|
|
@@ -6031,7 +6036,7 @@ function normalizeCSS(s) {
|
|
|
6031
6036
|
// with `mso-list:Ignore`. They are display-only
|
|
6032
6037
|
// and must not be imported, otherwise the marker
|
|
6033
6038
|
// text leaks into the content. See #948
|
|
6034
|
-
if (/mso-list:\s*ignore/i.test((0,
|
|
6039
|
+
if (/mso-list:\s*ignore/i.test((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attr)(node, 'style') || '')) {
|
|
6035
6040
|
marks.push(node);
|
|
6036
6041
|
break;
|
|
6037
6042
|
}
|
|
@@ -6045,7 +6050,7 @@ function normalizeCSS(s) {
|
|
|
6045
6050
|
// `attrRaw`: SVG keeps camelCase names
|
|
6046
6051
|
// (`viewBox`), `attr()` would kebab-case
|
|
6047
6052
|
// them and silently skip the removal
|
|
6048
|
-
(0,
|
|
6053
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attrRaw)(node, attribute.name, null);
|
|
6049
6054
|
}
|
|
6050
6055
|
});
|
|
6051
6056
|
}
|
|
@@ -6058,12 +6063,13 @@ function normalizeCSS(s) {
|
|
|
6058
6063
|
});
|
|
6059
6064
|
}
|
|
6060
6065
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove.apply(null, marks);
|
|
6066
|
+
(0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_3__.wrapWordListItems)(listItems);
|
|
6061
6067
|
convertedString = div.innerHTML;
|
|
6062
6068
|
} catch (e) {}
|
|
6063
6069
|
if (convertedString) {
|
|
6064
6070
|
html = convertedString;
|
|
6065
6071
|
}
|
|
6066
|
-
html = html.split(/(\n)/).filter(
|
|
6072
|
+
html = html.split(/(\n)/).filter(jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_4__.trim).join('\n');
|
|
6067
6073
|
return html.replace(/<(\/)?(html|colgroup|col|o:p)[^>]*>/g, '').replace(/<!--[^>]*>/g, '');
|
|
6068
6074
|
}
|
|
6069
6075
|
|
|
@@ -6406,7 +6412,14 @@ const NEW_LINE_TAGS = new Set([
|
|
|
6406
6412
|
'h4',
|
|
6407
6413
|
'h5',
|
|
6408
6414
|
'h6',
|
|
6409
|
-
'hr'
|
|
6415
|
+
'hr',
|
|
6416
|
+
'ul',
|
|
6417
|
+
'ol',
|
|
6418
|
+
'li'
|
|
6419
|
+
]);
|
|
6420
|
+
const LIST_TAGS = new Set([
|
|
6421
|
+
'ul',
|
|
6422
|
+
'ol'
|
|
6410
6423
|
]);
|
|
6411
6424
|
const INVISIBLE_TAGS = new Set([
|
|
6412
6425
|
'script',
|
|
@@ -6432,6 +6445,16 @@ const ALONE_TAGS = new Set([
|
|
|
6432
6445
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.each(tmp, (node)=>{
|
|
6433
6446
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isElement(node) && all.push(node);
|
|
6434
6447
|
});
|
|
6448
|
+
// By default blocks are joined with a single space (single-line
|
|
6449
|
+
// plain text). When `blockBr` is set, separate them with a line
|
|
6450
|
+
// break instead, so paragraph structure survives — e.g. the
|
|
6451
|
+
// "Insert only Text" paste option. See #1232
|
|
6452
|
+
const separators = new Set();
|
|
6453
|
+
const separator = ()=>{
|
|
6454
|
+
const text = doc.createTextNode(blockBr ? '%%%jodit-single-br%%%' : ' ');
|
|
6455
|
+
separators.add(text);
|
|
6456
|
+
return text;
|
|
6457
|
+
};
|
|
6435
6458
|
all.forEach((p)=>{
|
|
6436
6459
|
const pr = p.parentNode;
|
|
6437
6460
|
if (!pr) {
|
|
@@ -6451,16 +6474,17 @@ const ALONE_TAGS = new Set([
|
|
|
6451
6474
|
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(p, NEW_LINE_TAGS)) {
|
|
6452
6475
|
return;
|
|
6453
6476
|
}
|
|
6477
|
+
const pv = p.previousSibling;
|
|
6478
|
+
// A nested list starts on a new line after its item's own text
|
|
6479
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(p, LIST_TAGS) && pv && !separators.has(pv) && !(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isText(pv) && /\s$/.test(pv.nodeValue || ''))) {
|
|
6480
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before(p, separator());
|
|
6481
|
+
}
|
|
6454
6482
|
const nx = p.nextSibling;
|
|
6455
6483
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isText(nx) && /^\s/.test(nx.nodeValue || '')) {
|
|
6456
6484
|
return;
|
|
6457
6485
|
}
|
|
6458
6486
|
if (nx) {
|
|
6459
|
-
|
|
6460
|
-
// plain text). When `blockBr` is set, separate them with a line
|
|
6461
|
-
// break instead, so paragraph structure survives — e.g. the
|
|
6462
|
-
// "Insert only Text" paste option. See #1232
|
|
6463
|
-
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before(nx, doc.createTextNode(blockBr ? '%%%jodit-single-br%%%' : ' '));
|
|
6487
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before(nx, separator());
|
|
6464
6488
|
}
|
|
6465
6489
|
});
|
|
6466
6490
|
return restoreTags((0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__.trim)(tmp.innerText));
|
|
@@ -6470,6 +6494,181 @@ function restoreTags(content) {
|
|
|
6470
6494
|
}
|
|
6471
6495
|
|
|
6472
6496
|
|
|
6497
|
+
/***/ }),
|
|
6498
|
+
|
|
6499
|
+
/***/ 75480:
|
|
6500
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6501
|
+
|
|
6502
|
+
"use strict";
|
|
6503
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6504
|
+
/* harmony export */ readWordListItems: function() { return /* binding */ readWordListItems; },
|
|
6505
|
+
/* harmony export */ wrapWordListItems: function() { return /* binding */ wrapWordListItems; }
|
|
6506
|
+
/* harmony export */ });
|
|
6507
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
6508
|
+
/* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(88475);
|
|
6509
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7909);
|
|
6510
|
+
/*!
|
|
6511
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
6512
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
6513
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
6514
|
+
*/ /**
|
|
6515
|
+
* @module helpers/html
|
|
6516
|
+
*/
|
|
6517
|
+
|
|
6518
|
+
|
|
6519
|
+
const ROMAN = {
|
|
6520
|
+
i: 1,
|
|
6521
|
+
v: 5,
|
|
6522
|
+
x: 10,
|
|
6523
|
+
l: 50,
|
|
6524
|
+
c: 100,
|
|
6525
|
+
d: 500,
|
|
6526
|
+
m: 1000
|
|
6527
|
+
};
|
|
6528
|
+
function romanValue(roman) {
|
|
6529
|
+
let value = 0;
|
|
6530
|
+
for(let i = 0; i < roman.length; i += 1){
|
|
6531
|
+
const current = ROMAN[roman[i]], next = ROMAN[roman[i + 1]] || 0;
|
|
6532
|
+
value += current < next ? -current : current;
|
|
6533
|
+
}
|
|
6534
|
+
return value;
|
|
6535
|
+
}
|
|
6536
|
+
/**
|
|
6537
|
+
* Word's marker text (`1.`, `b)`, `iv.`, `·`, `o`, `§`) decides the list type
|
|
6538
|
+
*/ function parseMarker(marker) {
|
|
6539
|
+
const text = marker.replace(/\s+/g, '');
|
|
6540
|
+
const decimal = /^\(?(?:\d+\.)*(\d+)[.)]?$/.exec(text);
|
|
6541
|
+
if (decimal) {
|
|
6542
|
+
return {
|
|
6543
|
+
tag: 'ol',
|
|
6544
|
+
listStyleType: null,
|
|
6545
|
+
start: Number(decimal[1])
|
|
6546
|
+
};
|
|
6547
|
+
}
|
|
6548
|
+
const letters = /^\(?([a-z]+|[A-Z]+)[.)]$/.exec(text);
|
|
6549
|
+
if (letters) {
|
|
6550
|
+
const value = letters[1], lower = value.toLowerCase(), upper = value !== lower;
|
|
6551
|
+
if (/^[ivxlcdm]+$/.test(lower) && (lower.length > 1 || lower === 'i')) {
|
|
6552
|
+
return {
|
|
6553
|
+
tag: 'ol',
|
|
6554
|
+
listStyleType: upper ? 'upper-roman' : 'lower-roman',
|
|
6555
|
+
start: romanValue(lower)
|
|
6556
|
+
};
|
|
6557
|
+
}
|
|
6558
|
+
// Word continues a lettered list with aa, bb, ...
|
|
6559
|
+
if (/^([a-z])\1*$/.test(lower)) {
|
|
6560
|
+
return {
|
|
6561
|
+
tag: 'ol',
|
|
6562
|
+
listStyleType: upper ? 'upper-alpha' : 'lower-alpha',
|
|
6563
|
+
start: (lower.length - 1) * 26 + lower.charCodeAt(0) - 96
|
|
6564
|
+
};
|
|
6565
|
+
}
|
|
6566
|
+
}
|
|
6567
|
+
return {
|
|
6568
|
+
tag: 'ul',
|
|
6569
|
+
listStyleType: null,
|
|
6570
|
+
start: 1
|
|
6571
|
+
};
|
|
6572
|
+
}
|
|
6573
|
+
/**
|
|
6574
|
+
* Removes the marker and the wrappers it leaves empty
|
|
6575
|
+
*/ function removeMarker(marker, paragraph) {
|
|
6576
|
+
let parent = marker.parentNode;
|
|
6577
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(marker);
|
|
6578
|
+
while(parent && parent !== paragraph && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isElement(parent) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(parent)){
|
|
6579
|
+
const next = parent.parentNode;
|
|
6580
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(parent);
|
|
6581
|
+
parent = next;
|
|
6582
|
+
}
|
|
6583
|
+
}
|
|
6584
|
+
/**
|
|
6585
|
+
* Finds Word's list paragraphs (`<p style="mso-list:l0 level1 lfo1">`), reads
|
|
6586
|
+
* their list, level and type from the `mso-list:Ignore` marker, and removes the
|
|
6587
|
+
* marker. Call it before anything strips the `mso-list` styles, then pass the
|
|
6588
|
+
* result to {@link wrapWordListItems}
|
|
6589
|
+
*/ function readWordListItems(root) {
|
|
6590
|
+
const items = [];
|
|
6591
|
+
(0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_1__.toArray)(root.querySelectorAll('p')).forEach((paragraph)=>{
|
|
6592
|
+
const match = /mso-list:\s*l(\d+)\s+level(\d+)(?:\s+lfo(\d+))?/i.exec((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(paragraph, 'style') || '');
|
|
6593
|
+
if (!match) {
|
|
6594
|
+
return;
|
|
6595
|
+
}
|
|
6596
|
+
const marker = (0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_1__.toArray)(paragraph.querySelectorAll('[style]')).find((elm)=>/mso-list:\s*ignore/i.test((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'style') || ''));
|
|
6597
|
+
items.push({
|
|
6598
|
+
paragraph,
|
|
6599
|
+
list: `${match[1]}:${match[3] || ''}`,
|
|
6600
|
+
level: Number(match[2]),
|
|
6601
|
+
...parseMarker(marker?.textContent || '')
|
|
6602
|
+
});
|
|
6603
|
+
if (marker) {
|
|
6604
|
+
removeMarker(marker, paragraph);
|
|
6605
|
+
}
|
|
6606
|
+
});
|
|
6607
|
+
return items;
|
|
6608
|
+
}
|
|
6609
|
+
function isAdjacent(prev, item) {
|
|
6610
|
+
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findSibling(item.paragraph, true, (n)=>!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmptyTextNode(n) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isComment(n)) === prev.paragraph;
|
|
6611
|
+
}
|
|
6612
|
+
/**
|
|
6613
|
+
* Turns the paragraphs found by {@link readWordListItems} into `<ul>`/`<ol>`
|
|
6614
|
+
* lists, nesting them by level. Each paragraph becomes an `<li>` without Word's
|
|
6615
|
+
* hanging indent
|
|
6616
|
+
*/ function wrapWordListItems(items) {
|
|
6617
|
+
let stack = [];
|
|
6618
|
+
const continues = items.map((item, index)=>index > 0 && isAdjacent(items[index - 1], item));
|
|
6619
|
+
items.forEach((item, index)=>{
|
|
6620
|
+
const { paragraph } = item;
|
|
6621
|
+
if (!continues[index]) {
|
|
6622
|
+
stack = [];
|
|
6623
|
+
}
|
|
6624
|
+
while(stack.length && stack[stack.length - 1].level > item.level){
|
|
6625
|
+
stack.pop();
|
|
6626
|
+
}
|
|
6627
|
+
let top = stack[stack.length - 1];
|
|
6628
|
+
if (top && top.level === item.level && top.list !== item.list) {
|
|
6629
|
+
stack.pop();
|
|
6630
|
+
top = stack[stack.length - 1];
|
|
6631
|
+
}
|
|
6632
|
+
const doc = paragraph.ownerDocument;
|
|
6633
|
+
if (!top || top.level < item.level) {
|
|
6634
|
+
const element = doc.createElement(item.tag);
|
|
6635
|
+
if (item.listStyleType) {
|
|
6636
|
+
element.style.listStyleType = item.listStyleType;
|
|
6637
|
+
}
|
|
6638
|
+
if (item.tag === 'ol' && item.start !== 1) {
|
|
6639
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(element, 'start', item.start);
|
|
6640
|
+
}
|
|
6641
|
+
if (top && top.li) {
|
|
6642
|
+
top.li.appendChild(element);
|
|
6643
|
+
} else {
|
|
6644
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before(paragraph, element);
|
|
6645
|
+
}
|
|
6646
|
+
top = {
|
|
6647
|
+
level: item.level,
|
|
6648
|
+
list: item.list,
|
|
6649
|
+
element
|
|
6650
|
+
};
|
|
6651
|
+
stack.push(top);
|
|
6652
|
+
}
|
|
6653
|
+
const li = doc.createElement('li');
|
|
6654
|
+
(0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_1__.toArray)(paragraph.attributes).forEach((attribute)=>{
|
|
6655
|
+
if (attribute.name !== 'class') {
|
|
6656
|
+
li.setAttribute(attribute.name, attribute.value);
|
|
6657
|
+
}
|
|
6658
|
+
});
|
|
6659
|
+
li.style.removeProperty('margin-left');
|
|
6660
|
+
li.style.removeProperty('text-indent');
|
|
6661
|
+
if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(li, 'style')) {
|
|
6662
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(li, 'style', null);
|
|
6663
|
+
}
|
|
6664
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.moveContent(paragraph, li);
|
|
6665
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(paragraph);
|
|
6666
|
+
top.element.appendChild(li);
|
|
6667
|
+
top.li = li;
|
|
6668
|
+
});
|
|
6669
|
+
}
|
|
6670
|
+
|
|
6671
|
+
|
|
6473
6672
|
/***/ }),
|
|
6474
6673
|
|
|
6475
6674
|
/***/ 65946:
|
|
@@ -7628,7 +7827,7 @@ const classSets = (value)=>((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPO
|
|
|
7628
7827
|
/**
|
|
7629
7828
|
* The class names to align `elm` with: `alignClasses` for its tag, or for the
|
|
7630
7829
|
* media in it when it wraps media (a `mediaWrappers` wrapper, `jodit` or
|
|
7631
|
-
* `jodit-media`)
|
|
7830
|
+
* `jodit-media`)
|
|
7632
7831
|
*/ function getAlignClasses(jodit, elm) {
|
|
7633
7832
|
if (!elm) {
|
|
7634
7833
|
return null;
|
|
@@ -7637,8 +7836,7 @@ const classSets = (value)=>((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPO
|
|
|
7637
7836
|
'jodit',
|
|
7638
7837
|
'jodit-media'
|
|
7639
7838
|
])) ? elm.firstElementChild : (0,jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_4__.getWrappedMedia)(jodit, elm);
|
|
7640
|
-
|
|
7641
|
-
return jodit.o.alignClasses?.[tag] ?? (tag === 'img' ? jodit.o.imageAlignClasses : null);
|
|
7839
|
+
return jodit.o.alignClasses?.[(media ?? elm).nodeName.toLowerCase()] ?? null;
|
|
7642
7840
|
}
|
|
7643
7841
|
/**
|
|
7644
7842
|
* Align image, with `classes` (see `alignClasses`) instead of inline styles
|
|
@@ -10801,13 +10999,15 @@ function usable(ranges, shadowRoot) {
|
|
|
10801
10999
|
/* harmony export */ composedRanges: function() { return /* reexport safe */ _composed_ranges__WEBPACK_IMPORTED_MODULE_2__.composedRanges; },
|
|
10802
11000
|
/* harmony export */ cursorInTheEdgeOfString: function() { return /* binding */ cursorInTheEdgeOfString; },
|
|
10803
11001
|
/* harmony export */ findCorrectCurrentNode: function() { return /* binding */ findCorrectCurrentNode; },
|
|
10804
|
-
/* harmony export */
|
|
11002
|
+
/* harmony export */ isMoved: function() { return /* reexport safe */ _is_moved__WEBPACK_IMPORTED_MODULE_3__.isMoved; },
|
|
11003
|
+
/* harmony export */ moveNodeInsideStart: function() { return /* reexport safe */ _move_node_inside_start__WEBPACK_IMPORTED_MODULE_4__.moveNodeInsideStart; }
|
|
10805
11004
|
/* harmony export */ });
|
|
10806
11005
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
10807
11006
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
10808
11007
|
/* harmony import */ var _composed_ranges__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43134);
|
|
10809
|
-
/* harmony import */ var
|
|
10810
|
-
/* harmony import */ var
|
|
11008
|
+
/* harmony import */ var _is_moved__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(90657);
|
|
11009
|
+
/* harmony import */ var _move_node_inside_start__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(89817);
|
|
11010
|
+
/* harmony import */ var _move_the_node_along_the_edge_outward__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7470);
|
|
10811
11011
|
/*!
|
|
10812
11012
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
10813
11013
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -10819,6 +11019,7 @@ function usable(ranges, shadowRoot) {
|
|
|
10819
11019
|
|
|
10820
11020
|
|
|
10821
11021
|
|
|
11022
|
+
|
|
10822
11023
|
/**
|
|
10823
11024
|
* Despite the name, returns `true` when the cursor is NOT at the checked edge
|
|
10824
11025
|
* of the text node: there is significant (non invisible-space) text between
|
|
@@ -10873,6 +11074,36 @@ function findCorrectCurrentNode(node, range, rightMode, isCollapsed, checkChild,
|
|
|
10873
11074
|
}
|
|
10874
11075
|
|
|
10875
11076
|
|
|
11077
|
+
/***/ }),
|
|
11078
|
+
|
|
11079
|
+
/***/ 90657:
|
|
11080
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
11081
|
+
|
|
11082
|
+
"use strict";
|
|
11083
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
11084
|
+
/* harmony export */ isMoved: function() { return /* binding */ isMoved; }
|
|
11085
|
+
/* harmony export */ });
|
|
11086
|
+
/*!
|
|
11087
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
11088
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
11089
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
11090
|
+
*/ /**
|
|
11091
|
+
* @module selection
|
|
11092
|
+
*/ /**
|
|
11093
|
+
* Whether the selection, `before` as it was when a key went down, has since
|
|
11094
|
+
* moved to somewhere else in the editor
|
|
11095
|
+
* @private
|
|
11096
|
+
*/ function isMoved(jodit, before) {
|
|
11097
|
+
const { s } = jodit;
|
|
11098
|
+
// Selecting table cells, for one, removes the selection altogether
|
|
11099
|
+
if (!before || !s.isInsideArea) {
|
|
11100
|
+
return false;
|
|
11101
|
+
}
|
|
11102
|
+
const { range } = s;
|
|
11103
|
+
return range.startContainer !== before.startContainer || range.startOffset !== before.startOffset || range.endContainer !== before.endContainer || range.endOffset !== before.endOffset;
|
|
11104
|
+
}
|
|
11105
|
+
|
|
11106
|
+
|
|
10876
11107
|
/***/ }),
|
|
10877
11108
|
|
|
10878
11109
|
/***/ 89817:
|
|
@@ -12928,12 +13159,14 @@ function elementsEqualAttributes(elm1, elm2) {
|
|
|
12928
13159
|
/* harmony export */ toggleOrderedList: function() { return /* binding */ toggleOrderedList; }
|
|
12929
13160
|
/* harmony export */ });
|
|
12930
13161
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
12931
|
-
/* harmony import */ var
|
|
12932
|
-
/* harmony import */ var
|
|
12933
|
-
/* harmony import */ var
|
|
12934
|
-
/* harmony import */ var
|
|
12935
|
-
/* harmony import */ var
|
|
12936
|
-
/* harmony import */ var
|
|
13162
|
+
/* harmony import */ var jodit_core_helpers_size_object_size__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18073);
|
|
13163
|
+
/* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28712);
|
|
13164
|
+
/* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_2__);
|
|
13165
|
+
/* harmony import */ var jodit_core_selection_style_api_extract__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17481);
|
|
13166
|
+
/* harmony import */ var jodit_core_selection_style_api_is_same_attributes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(95971);
|
|
13167
|
+
/* harmony import */ var jodit_core_selection_style_api_toggle_attributes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(82794);
|
|
13168
|
+
/* harmony import */ var jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(98394);
|
|
13169
|
+
/* harmony import */ var _wrap_list__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(97110);
|
|
12937
13170
|
/*!
|
|
12938
13171
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
12939
13172
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -12944,6 +13177,8 @@ function elementsEqualAttributes(elm1, elm2) {
|
|
|
12944
13177
|
|
|
12945
13178
|
|
|
12946
13179
|
|
|
13180
|
+
|
|
13181
|
+
|
|
12947
13182
|
/**
|
|
12948
13183
|
* Replaces `ul->ol` or `ol->ul`, apply styles to the list, or remove a list item from it
|
|
12949
13184
|
* @private
|
|
@@ -12955,39 +13190,69 @@ function elementsEqualAttributes(elm1, elm2) {
|
|
|
12955
13190
|
if (!list) {
|
|
12956
13191
|
return mode;
|
|
12957
13192
|
}
|
|
12958
|
-
const result = jodit.e.fire(`${
|
|
13193
|
+
const result = jodit.e.fire(`${jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__._PREFIX}BeforeToggleList`, mode, commitStyle, list);
|
|
12959
13194
|
if (result !== undefined) {
|
|
12960
13195
|
return result;
|
|
12961
13196
|
}
|
|
12962
|
-
const hook = jodit.e.fire.bind(jodit.e, `${
|
|
13197
|
+
const hook = jodit.e.fire.bind(jodit.e, `${jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__._PREFIX}AfterToggleList`);
|
|
12963
13198
|
if (mode !== (/* inlined export .UNWRAP */"unwrap")) {
|
|
12964
|
-
const isChangeMode = (0,
|
|
13199
|
+
const isChangeMode = (0,jodit_core_selection_style_api_toggle_attributes__WEBPACK_IMPORTED_MODULE_5__.toggleAttributes)(commitStyle, li.parentElement, jodit, jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.INITIAL, true) === (/* inlined export .CHANGE */"change");
|
|
13200
|
+
const isSameList = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(list, commitStyle.element);
|
|
13201
|
+
// ol => ol[style="list-style-type: lower-roman"]: a list's style
|
|
13202
|
+
// belongs to the whole list, so it is changed without splitting it
|
|
13203
|
+
if (isSameList && isChangeMode && mode !== jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE && changesStyleOnly(commitStyle)) {
|
|
13204
|
+
(0,jodit_core_selection_style_api_toggle_attributes__WEBPACK_IMPORTED_MODULE_5__.toggleAttributes)(commitStyle, list, jodit, (/* inlined export .CHANGE */"change"));
|
|
13205
|
+
hook((/* inlined export .CHANGE */"change"), joinPrevious(commitStyle, list, mode), commitStyle);
|
|
13206
|
+
return (/* inlined export .CHANGE */"change");
|
|
13207
|
+
}
|
|
13208
|
+
// Restyled already, for an earlier part of the selection
|
|
13209
|
+
if (isSameList && mode === (/* inlined export .CHANGE */"change")) {
|
|
13210
|
+
return (/* inlined export .CHANGE */"change");
|
|
13211
|
+
}
|
|
12965
13212
|
// ul => ol, ol => ul or ul => ul.class1
|
|
12966
|
-
if (mode ===
|
|
12967
|
-
const wrapper = unwrapList(
|
|
12968
|
-
const newList = (0,
|
|
12969
|
-
hook(
|
|
12970
|
-
return
|
|
13213
|
+
if (mode === jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE || isChangeMode || !isSameList) {
|
|
13214
|
+
const wrapper = unwrapList(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE, list, li, jodit, commitStyle);
|
|
13215
|
+
const newList = (0,_wrap_list__WEBPACK_IMPORTED_MODULE_7__.wrapList)(commitStyle, wrapper, jodit);
|
|
13216
|
+
hook(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE, newList, commitStyle);
|
|
13217
|
+
return jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE;
|
|
12971
13218
|
}
|
|
12972
13219
|
}
|
|
12973
13220
|
const wrapper = unwrapList((/* inlined export .UNWRAP */"unwrap"), list, li, jodit, commitStyle);
|
|
12974
13221
|
hook((/* inlined export .UNWRAP */"unwrap"), wrapper, commitStyle);
|
|
12975
13222
|
return (/* inlined export .UNWRAP */"unwrap");
|
|
12976
13223
|
}
|
|
13224
|
+
/**
|
|
13225
|
+
* Other attributes, such as a class, still move the items into a new list,
|
|
13226
|
+
* where the `beforeWrapList` hook can add markup to each of them
|
|
13227
|
+
*/ function changesStyleOnly({ options: { attributes } }) {
|
|
13228
|
+
return Boolean(attributes?.style) && (0,jodit_core_helpers_size_object_size__WEBPACK_IMPORTED_MODULE_1__.size)(attributes) === 1;
|
|
13229
|
+
}
|
|
13230
|
+
/**
|
|
13231
|
+
* Joins a restyled list to the list before it, when the selection runs on
|
|
13232
|
+
* from that list and the two now match
|
|
13233
|
+
*/ function joinPrevious(commitStyle, list, mode) {
|
|
13234
|
+
const prev = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findSibling(list, true);
|
|
13235
|
+
if (mode !== (/* inlined export .CHANGE */"change") || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(prev, commitStyle.element) || !(0,jodit_core_selection_style_api_is_same_attributes__WEBPACK_IMPORTED_MODULE_4__.elementsEqualAttributes)(prev, list)) {
|
|
13236
|
+
return list;
|
|
13237
|
+
}
|
|
13238
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(prev, Array.from(list.childNodes));
|
|
13239
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(list);
|
|
13240
|
+
return prev;
|
|
13241
|
+
}
|
|
12977
13242
|
function unwrapList(mode, list, li, jodit, cs) {
|
|
12978
|
-
const result = jodit.e.fire(`${
|
|
13243
|
+
const result = jodit.e.fire(`${jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__._PREFIX}BeforeUnwrapList`, mode, list, cs);
|
|
12979
13244
|
if (result) {
|
|
12980
|
-
(0,
|
|
13245
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(result), `${jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__._PREFIX}BeforeUnwrapList hook must return HTMLElement`);
|
|
12981
13246
|
return result;
|
|
12982
13247
|
}
|
|
12983
|
-
;(0,
|
|
12984
|
-
(0,
|
|
13248
|
+
;(0,jodit_core_selection_style_api_extract__WEBPACK_IMPORTED_MODULE_3__.extractSelectedPart)(list, li, jodit);
|
|
13249
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(li.parentElement), 'Element should be inside the list');
|
|
12985
13250
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.unwrap(li.parentElement);
|
|
12986
13251
|
// In the REPLACE mode the content will be immediately wrapped in a `li`
|
|
12987
13252
|
// of the new list inside `wrapList`, so it should stay in the document.
|
|
12988
13253
|
// Replacing it with a fragment here would dissolve the content
|
|
12989
13254
|
// (with `enter: 'br'`) and the new list would never be inserted.
|
|
12990
|
-
if (mode ===
|
|
13255
|
+
if (mode === jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE) {
|
|
12991
13256
|
return li;
|
|
12992
13257
|
}
|
|
12993
13258
|
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.replace(li, jodit.o.enter.toLowerCase() !== 'br' ? jodit.o.enter : jodit.createInside.fragment(), jodit.createInside);
|
|
@@ -13700,7 +13965,7 @@ const transactions = {
|
|
|
13700
13965
|
[states.LIST]: {
|
|
13701
13966
|
exec (value) {
|
|
13702
13967
|
const { element, jodit, mode } = value;
|
|
13703
|
-
if (mode !== jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__.INITIAL && mode !== (/* inlined export .UNWRAP */"unwrap") && mode !== jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__.REPLACE) {
|
|
13968
|
+
if (mode !== jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__.INITIAL && mode !== (/* inlined export .UNWRAP */"unwrap") && mode !== jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__.REPLACE && mode !== (/* inlined export .CHANGE */"change")) {
|
|
13704
13969
|
return {
|
|
13705
13970
|
...value,
|
|
13706
13971
|
next: states.END
|
|
@@ -17923,6 +18188,18 @@ const __defaultClassesKey = 'data-jodit-default-classes';
|
|
|
17923
18188
|
const NOEDIT = {
|
|
17924
18189
|
contenteditable: false
|
|
17925
18190
|
};
|
|
18191
|
+
/**
|
|
18192
|
+
* The editor's options, with the deprecated `imageAlignClasses` copied into
|
|
18193
|
+
* `alignClasses.img` when that isn't set
|
|
18194
|
+
*/ function makeOptions(options) {
|
|
18195
|
+
const opt = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)(options || {}, jodit_config__WEBPACK_IMPORTED_MODULE_9__.Config.defaultOptions);
|
|
18196
|
+
if (opt.imageAlignClasses && !opt.alignClasses?.img) {
|
|
18197
|
+
opt.alignClasses = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)({
|
|
18198
|
+
img: opt.imageAlignClasses
|
|
18199
|
+
}, opt.alignClasses);
|
|
18200
|
+
}
|
|
18201
|
+
return opt;
|
|
18202
|
+
}
|
|
17926
18203
|
class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar {
|
|
17927
18204
|
/** @override */ className() {
|
|
17928
18205
|
return 'Jodit';
|
|
@@ -18691,7 +18968,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
18691
18968
|
// do nothing
|
|
18692
18969
|
}
|
|
18693
18970
|
/** @override **/ initOptions(options) {
|
|
18694
|
-
this.options = (
|
|
18971
|
+
this.options = makeOptions(options);
|
|
18695
18972
|
}
|
|
18696
18973
|
/** @override **/ initOwners() {
|
|
18697
18974
|
// in iframe, it can be changed
|
|
@@ -18805,7 +19082,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
18805
19082
|
right: rightSlot
|
|
18806
19083
|
},
|
|
18807
19084
|
statusbar: new jodit_modules__WEBPACK_IMPORTED_MODULE_10__.StatusBar(this, container),
|
|
18808
|
-
options: this.isReady ? (
|
|
19085
|
+
options: this.isReady ? makeOptions(options) : this.options,
|
|
18809
19086
|
history: new jodit_modules__WEBPACK_IMPORTED_MODULE_10__.History(this),
|
|
18810
19087
|
editorWindow: this.ow
|
|
18811
19088
|
};
|
|
@@ -19666,6 +19943,11 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19666
19943
|
}
|
|
19667
19944
|
}
|
|
19668
19945
|
__onResizerMouseDown(e) {
|
|
19946
|
+
// As for the header: otherwise Safari selects the dialog's text as
|
|
19947
|
+
// the pointer moves
|
|
19948
|
+
if (e.cancelable) {
|
|
19949
|
+
e.preventDefault();
|
|
19950
|
+
}
|
|
19669
19951
|
this.resizable = true;
|
|
19670
19952
|
this.startX = e.clientX;
|
|
19671
19953
|
this.startY = e.clientY;
|
|
@@ -19677,7 +19959,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19677
19959
|
// the content area does not shrink below its CSS `min-height`,
|
|
19678
19960
|
// so it is part of the smallest height the panel can take
|
|
19679
19961
|
const contentMinHeight = content ? parseFloat(this.ow.getComputedStyle(content).minHeight) || 0 : 0;
|
|
19680
|
-
this.minSize.w = (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_8__.isNumber)(this.o.minWidth) ? this.o.minWidth : Math.max(100, footer
|
|
19962
|
+
this.minSize.w = (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_8__.isNumber)(this.o.minWidth) ? this.o.minWidth : Math.max(100, header ? this.__contentWidth(header) : 0, footer ? this.__contentWidth(footer) : 0);
|
|
19681
19963
|
this.minSize.h = (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_8__.isNumber)(this.o.minHeight) ? this.o.minHeight : (header?.offsetHeight ?? 0) + (footer?.offsetHeight ?? 0) + contentMinHeight + this.resizer.offsetHeight;
|
|
19682
19964
|
this.lockSelect();
|
|
19683
19965
|
this.__addGlobalResizeListeners();
|
|
@@ -19687,13 +19969,25 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19687
19969
|
*/ this.e.fire(this, 'startResize');
|
|
19688
19970
|
}
|
|
19689
19971
|
}
|
|
19972
|
+
/**
|
|
19973
|
+
* The width `box` takes with its content on one line. The header and
|
|
19974
|
+
* footer are flex rows as wide as the dialog, so the footer's
|
|
19975
|
+
* `scrollWidth` was the dialog's width and kept it from getting any
|
|
19976
|
+
* narrower
|
|
19977
|
+
*/ __contentWidth(box) {
|
|
19978
|
+
const { width } = box.style;
|
|
19979
|
+
box.style.width = 'max-content';
|
|
19980
|
+
const contentWidth = box.offsetWidth;
|
|
19981
|
+
box.style.width = width;
|
|
19982
|
+
return contentWidth;
|
|
19983
|
+
}
|
|
19690
19984
|
__addGlobalResizeListeners() {
|
|
19691
19985
|
const self1 = this;
|
|
19692
19986
|
self1.e.on(self1.ow, 'pointermove touchmove', self1.__onMouseMove).on(self1.ow, 'pointerup touchend', self1.__onMouseUp);
|
|
19693
19987
|
}
|
|
19694
19988
|
__removeGlobalResizeListeners() {
|
|
19695
19989
|
const self1 = this;
|
|
19696
|
-
self1.e.off(self1.ow, '
|
|
19990
|
+
self1.e.off(self1.ow, 'pointermove touchmove', self1.__onMouseMove).off(self1.ow, 'pointerup touchend', self1.__onMouseUp);
|
|
19697
19991
|
}
|
|
19698
19992
|
/**
|
|
19699
19993
|
* Specifies the size of the window
|
|
@@ -24006,14 +24300,12 @@ StatusBar = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)
|
|
|
24006
24300
|
/* harmony export */ Table: function() { return /* binding */ Table; }
|
|
24007
24301
|
/* harmony export */ });
|
|
24008
24302
|
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
|
|
24009
|
-
/* harmony import */ var
|
|
24010
|
-
/* harmony import */ var
|
|
24011
|
-
/* harmony import */ var
|
|
24012
|
-
/* harmony import */ var
|
|
24013
|
-
/* harmony import */ var
|
|
24014
|
-
/* harmony import */ var
|
|
24015
|
-
/* harmony import */ var jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(65946);
|
|
24016
|
-
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
|
|
24303
|
+
/* harmony import */ var jodit_core_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16964);
|
|
24304
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(81937);
|
|
24305
|
+
/* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27795);
|
|
24306
|
+
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28077);
|
|
24307
|
+
/* harmony import */ var jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65946);
|
|
24308
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(80991);
|
|
24017
24309
|
/*!
|
|
24018
24310
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
24019
24311
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -24029,26 +24321,15 @@ StatusBar = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)
|
|
|
24029
24321
|
|
|
24030
24322
|
|
|
24031
24323
|
|
|
24032
|
-
|
|
24033
|
-
|
|
24034
24324
|
const markedValue = new WeakMap();
|
|
24035
|
-
class Table extends
|
|
24325
|
+
class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_1__.ViewComponent {
|
|
24036
24326
|
/** @override */ className() {
|
|
24037
24327
|
return 'Table';
|
|
24038
24328
|
}
|
|
24039
|
-
__recalculateStyles() {
|
|
24040
|
-
const style = (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_6__.getContainer)(this.j, Table, 'style', true);
|
|
24041
|
-
const selectors = [];
|
|
24042
|
-
this.selected.forEach((td)=>{
|
|
24043
|
-
const selector = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.cssPath)(td);
|
|
24044
|
-
selector && selectors.push(selector);
|
|
24045
|
-
});
|
|
24046
|
-
style.innerHTML = selectors.length ? selectors.join(',') + `{${this.jodit.options.table.selectionCellStyle}}` : '';
|
|
24047
|
-
}
|
|
24048
24329
|
addSelection(td) {
|
|
24049
24330
|
this.selected.add(td);
|
|
24050
24331
|
this.__recalculateStyles();
|
|
24051
|
-
const table =
|
|
24332
|
+
const table = jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.closest(td, 'table', this.j.editor);
|
|
24052
24333
|
if (table) {
|
|
24053
24334
|
const cells = Table.__selectedByTable.get(table) || new Set();
|
|
24054
24335
|
cells.add(td);
|
|
@@ -24058,7 +24339,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24058
24339
|
removeSelection(td) {
|
|
24059
24340
|
this.selected.delete(td);
|
|
24060
24341
|
this.__recalculateStyles();
|
|
24061
|
-
const table =
|
|
24342
|
+
const table = jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.closest(td, 'table', this.j.editor);
|
|
24062
24343
|
if (table) {
|
|
24063
24344
|
const cells = Table.__selectedByTable.get(table);
|
|
24064
24345
|
if (cells) {
|
|
@@ -24072,11 +24353,11 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24072
24353
|
/**
|
|
24073
24354
|
* Returns array of selected cells
|
|
24074
24355
|
*/ getAllSelectedCells() {
|
|
24075
|
-
return (0,
|
|
24356
|
+
return (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.toArray)(this.selected);
|
|
24076
24357
|
}
|
|
24077
24358
|
static __getSelectedCellsByTable(table) {
|
|
24078
24359
|
const cells = Table.__selectedByTable.get(table);
|
|
24079
|
-
return cells ? (0,
|
|
24360
|
+
return cells ? (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.toArray)(cells) : [];
|
|
24080
24361
|
}
|
|
24081
24362
|
/** @override **/ destruct() {
|
|
24082
24363
|
this.selected.clear();
|
|
@@ -24103,7 +24384,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24103
24384
|
const matrix = [
|
|
24104
24385
|
[]
|
|
24105
24386
|
];
|
|
24106
|
-
const rows = (0,
|
|
24387
|
+
const rows = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.toArray)(table.rows);
|
|
24107
24388
|
const setCell = (cell, i)=>{
|
|
24108
24389
|
if (matrix[i] === undefined) {
|
|
24109
24390
|
matrix[i] = [];
|
|
@@ -24126,7 +24407,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24126
24407
|
}
|
|
24127
24408
|
};
|
|
24128
24409
|
for(let i = 0; i < rows.length; i += 1){
|
|
24129
|
-
const cells = (0,
|
|
24410
|
+
const cells = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.toArray)(rows[i].cells);
|
|
24130
24411
|
for(let j = 0; j < cells.length; j += 1){
|
|
24131
24412
|
if (setCell(cells[j], i) === false) {
|
|
24132
24413
|
return matrix;
|
|
@@ -24176,34 +24457,34 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24176
24457
|
row = create.element('tr');
|
|
24177
24458
|
for(let j = 0; j < columnsCount; j += 1){
|
|
24178
24459
|
const cell = create.element('td');
|
|
24179
|
-
|
|
24180
|
-
|
|
24460
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(cell, create.element('br'));
|
|
24461
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(row, cell);
|
|
24181
24462
|
}
|
|
24182
24463
|
} else {
|
|
24183
24464
|
row = line.cloneNode(true);
|
|
24184
|
-
|
|
24185
|
-
if (!
|
|
24465
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.each(line, (cell)=>{
|
|
24466
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isCell(cell)) {
|
|
24186
24467
|
return;
|
|
24187
24468
|
}
|
|
24188
|
-
const rowspan = (0,
|
|
24469
|
+
const rowspan = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'rowspan');
|
|
24189
24470
|
if (rowspan && parseInt(rowspan, 10) > 1) {
|
|
24190
24471
|
const newRowSpan = parseInt(rowspan, 10) - 1;
|
|
24191
|
-
(0,
|
|
24472
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'rowspan', newRowSpan > 1 ? newRowSpan : null);
|
|
24192
24473
|
}
|
|
24193
24474
|
});
|
|
24194
|
-
|
|
24195
|
-
if (
|
|
24196
|
-
|
|
24197
|
-
|
|
24475
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.each(row, (cell)=>{
|
|
24476
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isCell(cell)) {
|
|
24477
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.detach(cell);
|
|
24478
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(cell, create.element('br'));
|
|
24198
24479
|
}
|
|
24199
24480
|
});
|
|
24200
24481
|
}
|
|
24201
24482
|
if (after && line && line.nextSibling) {
|
|
24202
|
-
|
|
24483
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.after(line, row);
|
|
24203
24484
|
} else if (!after && line) {
|
|
24204
|
-
|
|
24485
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.before(line, row);
|
|
24205
24486
|
} else {
|
|
24206
|
-
|
|
24487
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.first(table, (node)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(node, 'tbody')) || table, row);
|
|
24207
24488
|
}
|
|
24208
24489
|
}
|
|
24209
24490
|
/**
|
|
@@ -24231,7 +24512,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24231
24512
|
while(box[rowIndex + 1][nextCell] === cell){
|
|
24232
24513
|
nextCell += 1;
|
|
24233
24514
|
}
|
|
24234
|
-
const nextRow =
|
|
24515
|
+
const nextRow = jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.next(cell.parentNode, (elm)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(elm, 'tr'), table);
|
|
24235
24516
|
if (nextRow) {
|
|
24236
24517
|
// `box[rowIndex + 1][nextCell]` is the cell that
|
|
24237
24518
|
// logically follows the moved cell in the next row, but
|
|
@@ -24248,21 +24529,21 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24248
24529
|
}
|
|
24249
24530
|
}
|
|
24250
24531
|
if (referenceCell) {
|
|
24251
|
-
|
|
24532
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.before(referenceCell, cell);
|
|
24252
24533
|
} else {
|
|
24253
|
-
|
|
24534
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(nextRow, cell);
|
|
24254
24535
|
}
|
|
24255
24536
|
}
|
|
24256
24537
|
}
|
|
24257
24538
|
} else {
|
|
24258
|
-
|
|
24539
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(cell);
|
|
24259
24540
|
}
|
|
24260
24541
|
if (dec && (cell.parentNode === row || cell !== box[rowIndex][j - 1])) {
|
|
24261
24542
|
const rowSpan = cell.rowSpan;
|
|
24262
|
-
(0,
|
|
24543
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'rowspan', rowSpan - 1 > 1 ? rowSpan - 1 : null);
|
|
24263
24544
|
}
|
|
24264
24545
|
});
|
|
24265
|
-
|
|
24546
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(row);
|
|
24266
24547
|
}
|
|
24267
24548
|
/**
|
|
24268
24549
|
* Remove row
|
|
@@ -24273,7 +24554,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24273
24554
|
* Insert column before / after all the columns containing the selected cells
|
|
24274
24555
|
*/ appendColumn(table, selectedCell, insertAfter = true) {
|
|
24275
24556
|
const box = Table.__formalMatrix(table);
|
|
24276
|
-
if (!insertAfter &&
|
|
24557
|
+
if (!insertAfter && jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isCell(selectedCell.previousElementSibling)) {
|
|
24277
24558
|
return this.appendColumn(table, selectedCell.previousElementSibling, true);
|
|
24278
24559
|
}
|
|
24279
24560
|
const [, formalCol] = Table.__formalCoordinate(table, selectedCell, insertAfter);
|
|
@@ -24283,11 +24564,11 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24283
24564
|
const cells = box[i];
|
|
24284
24565
|
if (cells[columnIndex] !== cells[newColumnIndex] || columnIndex === newColumnIndex) {
|
|
24285
24566
|
const cell = this.j.createInside.element('td');
|
|
24286
|
-
|
|
24567
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(cell, this.j.createInside.element('br'));
|
|
24287
24568
|
if (insertAfter) {
|
|
24288
|
-
|
|
24569
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.after(cells[columnIndex], cell);
|
|
24289
24570
|
} else {
|
|
24290
|
-
|
|
24571
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.before(cells[columnIndex], cell);
|
|
24291
24572
|
}
|
|
24292
24573
|
if (cells[columnIndex].rowSpan > 1) {
|
|
24293
24574
|
cell.rowSpan = cells[columnIndex].rowSpan;
|
|
@@ -24309,11 +24590,11 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24309
24590
|
} else if (j + 1 < cells.length && box[i][j + 1] === td) {
|
|
24310
24591
|
dec = true;
|
|
24311
24592
|
} else {
|
|
24312
|
-
|
|
24593
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(td);
|
|
24313
24594
|
}
|
|
24314
24595
|
if (dec && (i - 1 < 0 || td !== box[i - 1][j])) {
|
|
24315
24596
|
const colSpan = td.colSpan;
|
|
24316
|
-
(0,
|
|
24597
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(td, 'colspan', colSpan - 1 > 1 ? (colSpan - 1).toString() : null);
|
|
24317
24598
|
}
|
|
24318
24599
|
});
|
|
24319
24600
|
}
|
|
@@ -24390,13 +24671,13 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24390
24671
|
continue; // broken table
|
|
24391
24672
|
}
|
|
24392
24673
|
if (box[i][j].hasAttribute('rowspan') && box[i][j].rowSpan === 1) {
|
|
24393
|
-
(0,
|
|
24674
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'rowspan', null);
|
|
24394
24675
|
}
|
|
24395
24676
|
if (box[i][j].hasAttribute('colspan') && box[i][j].colSpan === 1) {
|
|
24396
|
-
(0,
|
|
24677
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'colspan', null);
|
|
24397
24678
|
}
|
|
24398
|
-
if (box[i][j].hasAttribute('class') && !(0,
|
|
24399
|
-
(0,
|
|
24679
|
+
if (box[i][j].hasAttribute('class') && !(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'class')) {
|
|
24680
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'class', null);
|
|
24400
24681
|
}
|
|
24401
24682
|
}
|
|
24402
24683
|
}
|
|
@@ -24470,10 +24751,10 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24470
24751
|
return;
|
|
24471
24752
|
}
|
|
24472
24753
|
alreadyMerged.add(td);
|
|
24473
|
-
if (i === bound[0][0] && (0,
|
|
24754
|
+
if (i === bound[0][0] && (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__.cssInline)(td, 'width')) {
|
|
24474
24755
|
w += td.offsetWidth;
|
|
24475
24756
|
}
|
|
24476
|
-
if ((0,
|
|
24757
|
+
if ((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.trim)(cell.innerHTML.replace(/<br(\/)?>/g, '')) !== '') {
|
|
24477
24758
|
html.push(cell.innerHTML);
|
|
24478
24759
|
}
|
|
24479
24760
|
if (cs > 1) {
|
|
@@ -24502,7 +24783,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24502
24783
|
Table.__mark(first, 'rowspan', rows, __marked);
|
|
24503
24784
|
}
|
|
24504
24785
|
if (w) {
|
|
24505
|
-
Table.__mark(first, 'width', (w / table.offsetWidth * 100).toFixed(
|
|
24786
|
+
Table.__mark(first, 'width', (w / table.offsetWidth * 100).toFixed(jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.ACCURACY) + '%', __marked);
|
|
24506
24787
|
if (first_j) {
|
|
24507
24788
|
Table.__setColumnWidthByDelta(table, first_j, 0, true, __marked);
|
|
24508
24789
|
}
|
|
@@ -24512,9 +24793,9 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24512
24793
|
alreadyMerged.delete(first);
|
|
24513
24794
|
Table.__unmark(__marked);
|
|
24514
24795
|
Table.__normalizeTable(table);
|
|
24515
|
-
(0,
|
|
24796
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.toArray)(table.rows).forEach((tr)=>{
|
|
24516
24797
|
if (!tr.cells.length) {
|
|
24517
|
-
|
|
24798
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(tr);
|
|
24518
24799
|
}
|
|
24519
24800
|
});
|
|
24520
24801
|
}
|
|
@@ -24530,7 +24811,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24530
24811
|
const __marked = [];
|
|
24531
24812
|
Table.__getSelectedCellsByTable(table).forEach((cell)=>{
|
|
24532
24813
|
td = jodit.createInside.element('td');
|
|
24533
|
-
|
|
24814
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(td, jodit.createInside.element('br'));
|
|
24534
24815
|
tr = jodit.createInside.element('tr');
|
|
24535
24816
|
coord = Table.__formalCoordinate(table, cell);
|
|
24536
24817
|
if (cell.rowSpan < 2) {
|
|
@@ -24539,8 +24820,8 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24539
24820
|
Table.__mark(tdElm, 'rowspan', tdElm.rowSpan + 1, __marked);
|
|
24540
24821
|
}
|
|
24541
24822
|
});
|
|
24542
|
-
|
|
24543
|
-
|
|
24823
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.after(jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.closest(cell, 'tr', table), tr);
|
|
24824
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(tr, td);
|
|
24544
24825
|
} else {
|
|
24545
24826
|
Table.__mark(cell, 'rowspan', cell.rowSpan - 1, __marked);
|
|
24546
24827
|
Table.__formalMatrix(table, (tdElm, i, j)=>{
|
|
@@ -24552,9 +24833,9 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24552
24833
|
}
|
|
24553
24834
|
});
|
|
24554
24835
|
if (after) {
|
|
24555
|
-
|
|
24836
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.after(after, td);
|
|
24556
24837
|
} else {
|
|
24557
|
-
|
|
24838
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.prepend(parent, td);
|
|
24558
24839
|
}
|
|
24559
24840
|
}
|
|
24560
24841
|
if (cell.colSpan > 1) {
|
|
@@ -24585,15 +24866,15 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24585
24866
|
Table.__mark(cell, 'colspan', cell.colSpan - 1, __marked);
|
|
24586
24867
|
}
|
|
24587
24868
|
td = jodit.createInside.element('td');
|
|
24588
|
-
|
|
24869
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(td, jodit.createInside.element('br'));
|
|
24589
24870
|
if (cell.rowSpan > 1) {
|
|
24590
24871
|
Table.__mark(td, 'rowspan', cell.rowSpan, __marked);
|
|
24591
24872
|
}
|
|
24592
24873
|
const oldWidth = cell.offsetWidth; // get old width
|
|
24593
|
-
|
|
24874
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.after(cell, td);
|
|
24594
24875
|
percentage = oldWidth / table.offsetWidth / 2;
|
|
24595
|
-
Table.__mark(cell, 'width', (percentage * 100).toFixed(
|
|
24596
|
-
Table.__mark(td, 'width', (percentage * 100).toFixed(
|
|
24876
|
+
Table.__mark(cell, 'width', (percentage * 100).toFixed(jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.ACCURACY) + '%', __marked);
|
|
24877
|
+
Table.__mark(td, 'width', (percentage * 100).toFixed(jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.ACCURACY) + '%', __marked);
|
|
24597
24878
|
Table.__unmark(__marked);
|
|
24598
24879
|
instance(jodit).removeSelection(cell);
|
|
24599
24880
|
});
|
|
@@ -24614,7 +24895,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24614
24895
|
}
|
|
24615
24896
|
const w = cell.offsetWidth;
|
|
24616
24897
|
const percent = (w + delta) / table.offsetWidth * 100;
|
|
24617
|
-
Table.__mark(cell, 'width', percent.toFixed(
|
|
24898
|
+
Table.__mark(cell, 'width', percent.toFixed(jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.ACCURACY) + '%', marked);
|
|
24618
24899
|
clearWidthIndex = i;
|
|
24619
24900
|
break;
|
|
24620
24901
|
}
|
|
@@ -24645,22 +24926,22 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24645
24926
|
const value = dict[key];
|
|
24646
24927
|
switch(key){
|
|
24647
24928
|
case 'remove':
|
|
24648
|
-
|
|
24929
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(cell);
|
|
24649
24930
|
break;
|
|
24650
24931
|
case 'rowspan':
|
|
24651
|
-
(0,
|
|
24932
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'rowspan', (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.isNumber)(value) && value > 1 ? value : null);
|
|
24652
24933
|
break;
|
|
24653
24934
|
case 'colspan':
|
|
24654
|
-
(0,
|
|
24935
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'colspan', (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.isNumber)(value) && value > 1 ? value : null);
|
|
24655
24936
|
break;
|
|
24656
24937
|
case 'width':
|
|
24657
24938
|
if (value == null) {
|
|
24658
24939
|
cell.style.removeProperty('width');
|
|
24659
|
-
if (!(0,
|
|
24660
|
-
(0,
|
|
24940
|
+
if (!(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'style')) {
|
|
24941
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'style', null);
|
|
24661
24942
|
}
|
|
24662
24943
|
} else {
|
|
24663
|
-
(0,
|
|
24944
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.css)(cell, 'width', value.toString());
|
|
24664
24945
|
}
|
|
24665
24946
|
break;
|
|
24666
24947
|
}
|
|
@@ -24671,13 +24952,23 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
|
|
|
24671
24952
|
});
|
|
24672
24953
|
}
|
|
24673
24954
|
constructor(...args){
|
|
24674
|
-
super(...args), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "selected", new Set())
|
|
24955
|
+
super(...args), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "selected", new Set()), /**
|
|
24956
|
+
* Rewrite the `<style>` that marks the selected cells once for all the
|
|
24957
|
+
* cells (un)selected in one go: a drag over a block of cells unmarks and
|
|
24958
|
+
* marks every one of them on each move. `@debounce()` was never applied,
|
|
24959
|
+
* as a Table never reaches `ready`
|
|
24960
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__recalculateStyles", this.async.microDebounce(()=>{
|
|
24961
|
+
const style = (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.getContainer)(this.j, Table, 'style', true);
|
|
24962
|
+
const selectors = [];
|
|
24963
|
+
this.selected.forEach((td)=>{
|
|
24964
|
+
const selector = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.cssPath)(td);
|
|
24965
|
+
selector && selectors.push(selector);
|
|
24966
|
+
});
|
|
24967
|
+
style.innerHTML = selectors.length ? selectors.join(',') + `{${this.jodit.options.table.selectionCellStyle}}` : '';
|
|
24968
|
+
}));
|
|
24675
24969
|
}
|
|
24676
24970
|
}
|
|
24677
24971
|
;(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Table, "__selectedByTable", new WeakMap());
|
|
24678
|
-
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
24679
|
-
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.debounce)()
|
|
24680
|
-
], Table.prototype, "__recalculateStyles", null);
|
|
24681
24972
|
const instance = (j)=>j.getInstance('Table', j.o);
|
|
24682
24973
|
|
|
24683
24974
|
|
|
@@ -27877,6 +28168,10 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('backspace', bac
|
|
|
27877
28168
|
mainClosestBox = nextBox;
|
|
27878
28169
|
}
|
|
27879
28170
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(mainClosestBox) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isContentEditable(mainClosestBox, jodit.editor)) {
|
|
28171
|
+
// A table cell is never joined with its neighbour
|
|
28172
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.up(fakeNode, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell, mainClosestBox, true)) {
|
|
28173
|
+
return false;
|
|
28174
|
+
}
|
|
27880
28175
|
const sibling = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(mainClosestBox, backspace);
|
|
27881
28176
|
// A line break before the cursor is a single unit: remove it instead of
|
|
27882
28177
|
// merging the current element into the (void) `<br>`, which used to move
|
|
@@ -27886,13 +28181,48 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('backspace', bac
|
|
|
27886
28181
|
jodit.s.setCursorBefore(fakeNode);
|
|
27887
28182
|
return true;
|
|
27888
28183
|
}
|
|
27889
|
-
|
|
28184
|
+
// Backspace leaves a block after a table alone, as Word does, rather
|
|
28185
|
+
// than moving its text into the last cell
|
|
28186
|
+
if (backspace && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(sibling, 'table')) {
|
|
28187
|
+
jodit.s.setCursorBefore(fakeNode);
|
|
28188
|
+
return true;
|
|
28189
|
+
}
|
|
28190
|
+
const box = findCaretBox(fakeNode, mainClosestBox);
|
|
28191
|
+
if (sibling && (checkPullNextLine(jodit, fakeNode, box, sibling, backspace) || checkMoveListContent(jodit, box, sibling, backspace) || moveContentAndRemoveEmpty(jodit, box, findEdgeBlock(resolveTableSibling(sibling, backspace), backspace, jodit.editor), backspace))) {
|
|
27890
28192
|
jodit.s.setCursorBefore(fakeNode);
|
|
27891
28193
|
return true;
|
|
27892
28194
|
}
|
|
27893
28195
|
}
|
|
27894
28196
|
return false;
|
|
27895
28197
|
}
|
|
28198
|
+
/**
|
|
28199
|
+
* The block holding the caret inside the box that has the sibling, so
|
|
28200
|
+
* `<p>one</p><div><p>|two</p></div>` joins the two paragraphs instead of
|
|
28201
|
+
* moving the whole `<div>` into the first one. For a list item that is its
|
|
28202
|
+
* list, which the list cases handle.
|
|
28203
|
+
*/ function findCaretBox(fakeNode, mainClosestBox) {
|
|
28204
|
+
const block = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.up(fakeNode, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, mainClosestBox);
|
|
28205
|
+
if (!block) {
|
|
28206
|
+
return mainClosestBox;
|
|
28207
|
+
}
|
|
28208
|
+
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(block) && block.parentElement ? block.parentElement : block;
|
|
28209
|
+
}
|
|
28210
|
+
/**
|
|
28211
|
+
* The innermost block on the sibling's edge facing the caret, so the
|
|
28212
|
+
* content is joined to text: `<div><p>one</p></div><p>|two</p>` gives
|
|
28213
|
+
* `<div><p>one|two</p></div>`
|
|
28214
|
+
*/ function findEdgeBlock(sibling, backspace, root) {
|
|
28215
|
+
let block = sibling;
|
|
28216
|
+
while(block){
|
|
28217
|
+
const edge = backspace ? block.lastChild : block.firstChild;
|
|
28218
|
+
const child = edge && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmptyTextNode(edge) ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(edge, backspace) : edge;
|
|
28219
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(child) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(child, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(child, 'table') || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isContentEditable(child, root)) {
|
|
28220
|
+
return block;
|
|
28221
|
+
}
|
|
28222
|
+
block = child;
|
|
28223
|
+
}
|
|
28224
|
+
return block;
|
|
28225
|
+
}
|
|
27896
28226
|
/**
|
|
27897
28227
|
* Content cannot be merged into the `<table>` element itself — it would land
|
|
27898
28228
|
* between the table sections (after `</tbody>`), which is invalid HTML and
|
|
@@ -27909,6 +28239,40 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('backspace', bac
|
|
|
27909
28239
|
});
|
|
27910
28240
|
return cells.length ? cells[backspace ? cells.length - 1 : 0] : null;
|
|
27911
28241
|
}
|
|
28242
|
+
/**
|
|
28243
|
+
* Delete at the edge of a list pulls the next line up to the caret, as the
|
|
28244
|
+
* browsers do, instead of moving the caret's line into the next block:
|
|
28245
|
+
* `<ul><li>one|</li></ul><p>two</p>` gives `<ul><li>one|two</li></ul>`, and
|
|
28246
|
+
* `<p>one|</p><ul><li>two</li></ul>` gives `<p>one|two</p>`
|
|
28247
|
+
* @private
|
|
28248
|
+
*/ function checkPullNextLine(jodit, fakeNode, box, sibling, backspace) {
|
|
28249
|
+
if (backspace || !(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(box) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(sibling))) {
|
|
28250
|
+
return false;
|
|
28251
|
+
}
|
|
28252
|
+
const target = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.up(fakeNode, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, box, true);
|
|
28253
|
+
const source = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(sibling) ? sibling.firstElementChild : sibling;
|
|
28254
|
+
if (!target || !source || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(source, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(source, 'table')) {
|
|
28255
|
+
return false;
|
|
28256
|
+
}
|
|
28257
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(source)) {
|
|
28258
|
+
const line = [];
|
|
28259
|
+
for(let node = source.firstChild; node && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node); node = node.nextSibling){
|
|
28260
|
+
line.push(node);
|
|
28261
|
+
}
|
|
28262
|
+
if (!line.length) {
|
|
28263
|
+
return false;
|
|
28264
|
+
}
|
|
28265
|
+
const filter = (0,jodit_plugins_backspace_helpers__WEBPACK_IMPORTED_MODULE_2__.getMoveFilter)(jodit);
|
|
28266
|
+
line.forEach((node)=>filter(node) ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(target, node) : jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(node));
|
|
28267
|
+
}
|
|
28268
|
+
let remove = source;
|
|
28269
|
+
while(remove && remove !== jodit.editor && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(remove)){
|
|
28270
|
+
const parent = remove.parentElement;
|
|
28271
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(remove);
|
|
28272
|
+
remove = parent;
|
|
28273
|
+
}
|
|
28274
|
+
return true;
|
|
28275
|
+
}
|
|
27912
28276
|
function checkMoveListContent(jodit, mainClosestBox, sibling, backspace) {
|
|
27913
28277
|
// Process UL/LI/OL cases
|
|
27914
28278
|
const siblingIsList = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(sibling, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.LIST_TAGS);
|
|
@@ -29013,6 +29377,18 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
|
|
|
29013
29377
|
this.walker.setWork(editor.editor);
|
|
29014
29378
|
this.currentSelectionNode = editor.s.current();
|
|
29015
29379
|
}
|
|
29380
|
+
/**
|
|
29381
|
+
* Typing into an empty block (`<p><br></p>`) replaces its `<br>`, but the
|
|
29382
|
+
* browser keeps the `<br>` when the caret is in an invisible-space text
|
|
29383
|
+
* node in front of it, as Jodit leaves the caret in many of the empty
|
|
29384
|
+
* blocks it makes (a cleared editor, a heading in an empty table cell).
|
|
29385
|
+
* See #1632
|
|
29386
|
+
*/ onInputRemovePlaceholderBr(event) {
|
|
29387
|
+
if (!this.isEditMode || event.type === 'input' && (event.isComposing || !event.inputType?.startsWith('insert'))) {
|
|
29388
|
+
return;
|
|
29389
|
+
}
|
|
29390
|
+
;(0,_helpers__WEBPACK_IMPORTED_MODULE_10__.removePlaceholderBr)(this.j);
|
|
29391
|
+
}
|
|
29016
29392
|
startWalker() {
|
|
29017
29393
|
const { jodit } = this;
|
|
29018
29394
|
const allow = (0,_helpers__WEBPACK_IMPORTED_MODULE_10__.getHash)(this.j.o.cleanHTML.allowTags);
|
|
@@ -29181,6 +29557,12 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
|
|
|
29181
29557
|
':keydown'
|
|
29182
29558
|
])
|
|
29183
29559
|
], cleanHtml.prototype, "onChangeCleanHTML", null);
|
|
29560
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
29561
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)([
|
|
29562
|
+
':input',
|
|
29563
|
+
'jodit.editor:compositionend'
|
|
29564
|
+
])
|
|
29565
|
+
], cleanHtml.prototype, "onInputRemovePlaceholderBr", null);
|
|
29184
29566
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
29185
29567
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.hook)('ready')
|
|
29186
29568
|
], cleanHtml.prototype, "startWalker", null);
|
|
@@ -29319,12 +29701,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.controls.eraser = {
|
|
|
29319
29701
|
/* harmony export */ getHash: function() { return /* reexport safe */ _get_hash__WEBPACK_IMPORTED_MODULE_0__.getHash; },
|
|
29320
29702
|
/* harmony export */ removeFormatForCollapsedSelection: function() { return /* reexport safe */ _remove_format_remove_format_for_collapsed_selection__WEBPACK_IMPORTED_MODULE_1__.removeFormatForCollapsedSelection; },
|
|
29321
29703
|
/* harmony export */ removeFormatForSelection: function() { return /* reexport safe */ _remove_format_remove_format_for_selection__WEBPACK_IMPORTED_MODULE_2__.removeFormatForSelection; },
|
|
29322
|
-
/* harmony export */
|
|
29704
|
+
/* harmony export */ removePlaceholderBr: function() { return /* reexport safe */ _remove_placeholder_br__WEBPACK_IMPORTED_MODULE_3__.removePlaceholderBr; },
|
|
29705
|
+
/* harmony export */ visitNodeWalker: function() { return /* reexport safe */ _visitor_visit_node_walker__WEBPACK_IMPORTED_MODULE_4__.visitNodeWalker; }
|
|
29323
29706
|
/* harmony export */ });
|
|
29324
29707
|
/* harmony import */ var _get_hash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5650);
|
|
29325
29708
|
/* harmony import */ var _remove_format_remove_format_for_collapsed_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37431);
|
|
29326
29709
|
/* harmony import */ var _remove_format_remove_format_for_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(70195);
|
|
29327
|
-
/* harmony import */ var
|
|
29710
|
+
/* harmony import */ var _remove_placeholder_br__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53626);
|
|
29711
|
+
/* harmony import */ var _visitor_visit_node_walker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(45219);
|
|
29328
29712
|
/*!
|
|
29329
29713
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
29330
29714
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -29338,6 +29722,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.controls.eraser = {
|
|
|
29338
29722
|
|
|
29339
29723
|
|
|
29340
29724
|
|
|
29725
|
+
|
|
29341
29726
|
/***/ }),
|
|
29342
29727
|
|
|
29343
29728
|
/***/ 28665:
|
|
@@ -29497,6 +29882,64 @@ const VIMEO_EMBED = /^(https?:)?\/\/player\.vimeo\.com\/video\//i;
|
|
|
29497
29882
|
}
|
|
29498
29883
|
|
|
29499
29884
|
|
|
29885
|
+
/***/ }),
|
|
29886
|
+
|
|
29887
|
+
/***/ 53626:
|
|
29888
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
29889
|
+
|
|
29890
|
+
"use strict";
|
|
29891
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
29892
|
+
/* harmony export */ removePlaceholderBr: function() { return /* binding */ removePlaceholderBr; }
|
|
29893
|
+
/* harmony export */ });
|
|
29894
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
29895
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
29896
|
+
/* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4040);
|
|
29897
|
+
/*!
|
|
29898
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
29899
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
29900
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
29901
|
+
*/ /**
|
|
29902
|
+
* @module plugins/clean-html
|
|
29903
|
+
*/
|
|
29904
|
+
|
|
29905
|
+
|
|
29906
|
+
function lastNode(node) {
|
|
29907
|
+
let last = node.lastChild;
|
|
29908
|
+
while(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(last) && !last.nodeValue){
|
|
29909
|
+
last = last.previousSibling;
|
|
29910
|
+
}
|
|
29911
|
+
return last;
|
|
29912
|
+
}
|
|
29913
|
+
/**
|
|
29914
|
+
* Remove the `<br>` that kept the block with the caret open while it was
|
|
29915
|
+
* empty, once text has gone into the block: when the block is one line of
|
|
29916
|
+
* text that ends in that `<br>`, the `<br>` adds nothing to it
|
|
29917
|
+
* @private
|
|
29918
|
+
*/ function removePlaceholderBr(jodit) {
|
|
29919
|
+
const block = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(jodit.s.current(), jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, jodit.editor);
|
|
29920
|
+
if (!block || !(0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__.trim)(block.textContent ?? '')) {
|
|
29921
|
+
return;
|
|
29922
|
+
}
|
|
29923
|
+
let br = lastNode(block);
|
|
29924
|
+
while(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(br) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(br, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(br)){
|
|
29925
|
+
br = lastNode(br);
|
|
29926
|
+
}
|
|
29927
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(br, 'br')) {
|
|
29928
|
+
return;
|
|
29929
|
+
}
|
|
29930
|
+
// Another line break, a block, an image or an embed means the `<br>` may
|
|
29931
|
+
// end an empty line, or give the caret a place after the embed
|
|
29932
|
+
const isOneLineOfText = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(block, (node)=>{
|
|
29933
|
+
if (node !== br && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node) && (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(node, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isHTMLElement(node) && !node.isContentEditable)) {
|
|
29934
|
+
return false;
|
|
29935
|
+
}
|
|
29936
|
+
});
|
|
29937
|
+
if (isOneLineOfText) {
|
|
29938
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(br);
|
|
29939
|
+
}
|
|
29940
|
+
}
|
|
29941
|
+
|
|
29942
|
+
|
|
29500
29943
|
/***/ }),
|
|
29501
29944
|
|
|
29502
29945
|
/***/ 95559:
|
|
@@ -30827,6 +31270,11 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugi
|
|
|
30827
31270
|
}
|
|
30828
31271
|
jodit.s.expandSelection();
|
|
30829
31272
|
const range = jodit.s.range;
|
|
31273
|
+
const caret = this.__clearSelectedCells(range);
|
|
31274
|
+
if (caret && range.collapsed) {
|
|
31275
|
+
jodit.s.selectRange(caret);
|
|
31276
|
+
return false;
|
|
31277
|
+
}
|
|
30830
31278
|
range.deleteContents();
|
|
30831
31279
|
const fake = jodit.createInside.fake();
|
|
30832
31280
|
range.insertNode(fake);
|
|
@@ -30836,21 +31284,98 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugi
|
|
|
30836
31284
|
range.setStartBefore(fake);
|
|
30837
31285
|
range.collapse(true);
|
|
30838
31286
|
this.__moveCursorInEditableSibling(jodit, leftSibling, fake, range);
|
|
30839
|
-
this.__addBrInEmptyBlock(fake,
|
|
31287
|
+
this.__addBrInEmptyBlock(fake, range);
|
|
30840
31288
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(fake);
|
|
30841
|
-
jodit.s.selectRange(range);
|
|
31289
|
+
jodit.s.selectRange(caret ?? range);
|
|
30842
31290
|
return false;
|
|
30843
31291
|
}
|
|
31292
|
+
/**
|
|
31293
|
+
* A selection that starts or ends in a table cell clears the selected part
|
|
31294
|
+
* of each cell it covers and keeps the cells, as the browsers do.
|
|
31295
|
+
* `deleteContents` would remove the cells it fully covers, and the cells
|
|
31296
|
+
* it cuts would then be merged as blocks. The range is moved out of those
|
|
31297
|
+
* tables, so only the content between them is left to delete.
|
|
31298
|
+
*
|
|
31299
|
+
* Returns where the caret goes, or null when no table is involved
|
|
31300
|
+
*/ __clearSelectedCells(range) {
|
|
31301
|
+
const { editor, createInside } = this.j;
|
|
31302
|
+
const startCell = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(range.startContainer, jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell, editor);
|
|
31303
|
+
const endCell = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(range.endContainer, jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell, editor);
|
|
31304
|
+
if (startCell === endCell) {
|
|
31305
|
+
return null;
|
|
31306
|
+
}
|
|
31307
|
+
const startTable = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(startCell, 'table', editor);
|
|
31308
|
+
const endTable = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(endCell, 'table', editor);
|
|
31309
|
+
const caret = range.cloneRange();
|
|
31310
|
+
caret.collapse(true);
|
|
31311
|
+
const parts = [];
|
|
31312
|
+
const addParts = (table)=>{
|
|
31313
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.toArray)(table.rows).flatMap((row)=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.toArray)(row.cells)).filter((cell)=>range.intersectsNode(cell)).forEach((cell)=>{
|
|
31314
|
+
const part = range.cloneRange();
|
|
31315
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isOrContains(cell, range.startContainer)) {
|
|
31316
|
+
part.setStart(cell, 0);
|
|
31317
|
+
}
|
|
31318
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isOrContains(cell, range.endContainer)) {
|
|
31319
|
+
part.setEnd(cell, cell.childNodes.length);
|
|
31320
|
+
}
|
|
31321
|
+
parts.push([
|
|
31322
|
+
cell,
|
|
31323
|
+
part
|
|
31324
|
+
]);
|
|
31325
|
+
});
|
|
31326
|
+
};
|
|
31327
|
+
if (startTable) {
|
|
31328
|
+
addParts(startTable);
|
|
31329
|
+
if (startTable === endTable) {
|
|
31330
|
+
range.collapse(true);
|
|
31331
|
+
} else {
|
|
31332
|
+
range.setStartAfter(startTable);
|
|
31333
|
+
}
|
|
31334
|
+
}
|
|
31335
|
+
if (endTable && endTable !== startTable) {
|
|
31336
|
+
addParts(endTable);
|
|
31337
|
+
range.setEndBefore(endTable);
|
|
31338
|
+
}
|
|
31339
|
+
parts.forEach(([cell, part])=>{
|
|
31340
|
+
part.deleteContents();
|
|
31341
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(cell)) {
|
|
31342
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.detach(cell);
|
|
31343
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(cell, createInside.element('br'));
|
|
31344
|
+
}
|
|
31345
|
+
});
|
|
31346
|
+
return startTable ? caret : null;
|
|
31347
|
+
}
|
|
30844
31348
|
__moveContentInLeftSibling(fake, leftSibling, rightSibling) {
|
|
30845
31349
|
leftSibling = this.__defineRightLeftBox(leftSibling);
|
|
31350
|
+
// Nothing is moved into a table, and a block left empty after it goes
|
|
31351
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(leftSibling, 'table')) {
|
|
31352
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(rightSibling) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(rightSibling)) {
|
|
31353
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(rightSibling);
|
|
31354
|
+
}
|
|
31355
|
+
return;
|
|
31356
|
+
}
|
|
30846
31357
|
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(rightSibling) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(rightSibling, 'table') && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(rightSibling) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(leftSibling)) {
|
|
30847
31358
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(leftSibling, fake);
|
|
30848
31359
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.moveContent(rightSibling, leftSibling);
|
|
30849
31360
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(rightSibling);
|
|
30850
31361
|
}
|
|
30851
|
-
|
|
30852
|
-
|
|
30853
|
-
|
|
31362
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(rightSibling) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(rightSibling.firstElementChild)) {
|
|
31363
|
+
const item = rightSibling.firstElementChild;
|
|
31364
|
+
// What's left of the right list's first item joins the left block,
|
|
31365
|
+
// up to a list nested in the item
|
|
31366
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(item) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(leftSibling)) {
|
|
31367
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(leftSibling, fake);
|
|
31368
|
+
while(item.firstChild && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(item.firstChild)){
|
|
31369
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(leftSibling, item.firstChild);
|
|
31370
|
+
}
|
|
31371
|
+
}
|
|
31372
|
+
// Remove empty right LI
|
|
31373
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(item)) {
|
|
31374
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(item);
|
|
31375
|
+
}
|
|
31376
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(rightSibling)) {
|
|
31377
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(rightSibling);
|
|
31378
|
+
}
|
|
30854
31379
|
}
|
|
30855
31380
|
}
|
|
30856
31381
|
/**
|
|
@@ -30867,8 +31392,8 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugi
|
|
|
30867
31392
|
return lastLeaf;
|
|
30868
31393
|
}
|
|
30869
31394
|
/**
|
|
30870
|
-
* Add BR in empty
|
|
30871
|
-
*/ __addBrInEmptyBlock(fake,
|
|
31395
|
+
* Add BR in the empty block left at the caret
|
|
31396
|
+
*/ __addBrInEmptyBlock(fake, range) {
|
|
30872
31397
|
const jodit = this.j;
|
|
30873
31398
|
if (fake.isConnected && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(fake.parentNode) && !fake.nextSibling && !fake.previousSibling) {
|
|
30874
31399
|
const br = jodit.createInside.element('br');
|
|
@@ -30876,13 +31401,6 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugi
|
|
|
30876
31401
|
range.setStartBefore(br);
|
|
30877
31402
|
range.collapse(true);
|
|
30878
31403
|
}
|
|
30879
|
-
// Add BR in the right empty table cell
|
|
30880
|
-
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(rightSibling, 'table')) {
|
|
30881
|
-
const firstCell = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.$$)('td,th', rightSibling).shift();
|
|
30882
|
-
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell(firstCell) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(firstCell)) {
|
|
30883
|
-
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(firstCell, jodit.createInside.element('br'));
|
|
30884
|
-
}
|
|
30885
|
-
}
|
|
30886
31404
|
}
|
|
30887
31405
|
__moveCursorInEditableSibling(jodit, leftSibling, fake, range) {
|
|
30888
31406
|
if (!leftSibling || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(leftSibling)) {
|
|
@@ -32373,7 +32891,18 @@ function focus(editor) {
|
|
|
32373
32891
|
editor.e.on('afterInit', ()=>{
|
|
32374
32892
|
if (editor.o.autofocus) {
|
|
32375
32893
|
if (editor.defaultTimeout) {
|
|
32376
|
-
editor
|
|
32894
|
+
// A click or key in the editor during the delay has put the
|
|
32895
|
+
// caret where the user wants it, so autofocus leaves it there
|
|
32896
|
+
const userInput = 'mousedown touchstart keydown';
|
|
32897
|
+
const cancel = ()=>{
|
|
32898
|
+
editor.async.clearTimeout(timeout);
|
|
32899
|
+
editor.e.off(userInput, cancel);
|
|
32900
|
+
};
|
|
32901
|
+
const timeout = editor.async.setTimeout(()=>{
|
|
32902
|
+
editor.e.off(userInput, cancel);
|
|
32903
|
+
focus();
|
|
32904
|
+
}, 300);
|
|
32905
|
+
editor.e.on(userInput, cancel);
|
|
32377
32906
|
} else {
|
|
32378
32907
|
focus();
|
|
32379
32908
|
}
|
|
@@ -33597,7 +34126,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeBaseUrl = '';
|
|
|
33597
34126
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeTitle = 'Jodit Editor';
|
|
33598
34127
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDoctype = '<!DOCTYPE html>';
|
|
33599
34128
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDefaultSrc = 'about:blank';
|
|
33600
|
-
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeStyle = 'html{' + 'margin:0;' + 'padding:0;' + 'min-height: 100%;' + '}' + 'body{' + 'box-sizing:border-box;' + 'font-size:13px;' + 'line-height:1.6;' + 'padding:10px;' + 'margin:0;' + 'background:transparent;' + 'color:#000;' + 'position:' + 'relative;' + 'z-index:2;' + 'user-select:auto;' + 'margin:0px;' + 'overflow:auto;' + 'outline:none;' + '}' + 'table{' + 'width:100%;' + 'border:none;' + 'border-collapse:collapse;' + 'empty-cells: show;' + 'max-width: 100%;' + '}' + 'th,td{' + 'padding: 2px 5px;' + 'border:1px solid #ccc;' + '-webkit-user-select:text;' + '-moz-user-select:text;' + '-ms-user-select:text;' + 'user-select:text' + '}' + 'p{' + 'margin-top:0;' + '}' + '
|
|
34129
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeStyle = 'html{' + 'margin:0;' + 'padding:0;' + 'min-height: 100%;' + '}' + 'body{' + 'box-sizing:border-box;' + 'font-size:13px;' + 'line-height:1.6;' + 'padding:10px;' + 'margin:0;' + 'background:transparent;' + 'color:#000;' + 'position:' + 'relative;' + 'z-index:2;' + 'user-select:auto;' + 'margin:0px;' + 'overflow:auto;' + 'outline:none;' + '}' + 'table{' + 'width:100%;' + 'border:none;' + 'border-collapse:collapse;' + 'empty-cells: show;' + 'max-width: 100%;' + '}' + 'th,td{' + 'padding: 2px 5px;' + 'border:1px solid #ccc;' + '-webkit-user-select:text;' + '-moz-user-select:text;' + '-ms-user-select:text;' + 'user-select:text' + '}' + 'p{' + 'margin-top:0;' + '}' + '.jodit_disabled{' + 'user-select: none;' + '-o-user-select: none;' + '-moz-user-select: none;' + '-khtml-user-select: none;' + '-webkit-user-select: none;' + '-ms-user-select: none' + '}';
|
|
33601
34130
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeCSSLinks = [];
|
|
33602
34131
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
33603
34132
|
|
|
@@ -33648,6 +34177,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
|
33648
34177
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(link, 'rel', 'stylesheet');
|
|
33649
34178
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(link, 'href', href);
|
|
33650
34179
|
doc.head && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(doc.head, link);
|
|
34180
|
+
// What plugins measured in the editing document changes once it's styled
|
|
34181
|
+
jodit.e.on(link, 'load', ()=>jodit.e.fire('resize'));
|
|
33651
34182
|
});
|
|
33652
34183
|
}
|
|
33653
34184
|
if (opt.iframeStyle) {
|
|
@@ -33685,6 +34216,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
|
33685
34216
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(doc.body, 'contenteditable', editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.MODE_SOURCE && !editor.getReadOnly() || null);
|
|
33686
34217
|
};
|
|
33687
34218
|
const clearMarkers = (html)=>{
|
|
34219
|
+
// The plugins' own styles, from `getContainer`, aren't part of the value
|
|
34220
|
+
html = html.replace(/<style[^>]+jodit-box[^>]*>[\s\S]*?<\/style>/gi, '');
|
|
33688
34221
|
const bodyReg = /<body.*<\/body>/im, bodyMarker = '{%%BODY%%}', body = bodyReg.exec(html);
|
|
33689
34222
|
if (body) {
|
|
33690
34223
|
// remove markers
|
|
@@ -33709,7 +34242,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
|
33709
34242
|
*/ const replaceDocument = (html)=>{
|
|
33710
34243
|
const inert = new DOMParser().parseFromString(html, 'text/html');
|
|
33711
34244
|
editor.e.fire('safeHTML', inert.documentElement);
|
|
34245
|
+
// The plugins' own styles stay, as the value leaves them out
|
|
34246
|
+
const styles = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.$$)('style.jodit-box', doc.head);
|
|
33712
34247
|
doc.replaceChild(doc.adoptNode(inert.documentElement), doc.documentElement);
|
|
34248
|
+
styles.forEach((style)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(doc.head, style));
|
|
33713
34249
|
};
|
|
33714
34250
|
if (docMode) {
|
|
33715
34251
|
const tag = editor.element.tagName;
|
|
@@ -33839,15 +34375,22 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.imageProcessor = {
|
|
|
33839
34375
|
|
|
33840
34376
|
|
|
33841
34377
|
|
|
33842
|
-
|
|
33843
34378
|
const JODIT_IMAGE_PROCESSOR_BINDED = '__jodit_imageprocessor_binded';
|
|
33844
34379
|
const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
|
|
33845
34380
|
const IMAGE_SELECTED = 'jodit-wysiwyg_image-selected';
|
|
34381
|
+
const SELECTED_TAGS = new Set([
|
|
34382
|
+
'img',
|
|
34383
|
+
'jodit',
|
|
34384
|
+
'jodit-media'
|
|
34385
|
+
]);
|
|
33846
34386
|
/**
|
|
33847
34387
|
* Change editor's size after load all images
|
|
33848
34388
|
*/ class imageProcessor extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugin {
|
|
33849
34389
|
afterInit(jodit) {
|
|
33850
34390
|
jodit.e.on(jodit.ed, 'selectionchange', this.onSelectionChange);
|
|
34391
|
+
// Over the highlight in `styles/reset.less`; the image keeps its own. It goes
|
|
34392
|
+
// in the editing document, so iframe mode has it whatever `iframeStyle` holds
|
|
34393
|
+
(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.getContainer)(jodit, 'image-processor', 'style', true).textContent = `.jodit-wysiwyg.${IMAGE_SELECTED}::selection,` + `.jodit-wysiwyg.${IMAGE_SELECTED} *:not(img)::selection{background:transparent}`;
|
|
33851
34394
|
}
|
|
33852
34395
|
beforeDestruct(jodit) {
|
|
33853
34396
|
jodit.e.off(jodit.ed, 'selectionchange', this.onSelectionChange);
|
|
@@ -33884,7 +34427,10 @@ const IMAGE_SELECTED = 'jodit-wysiwyg_image-selected';
|
|
|
33884
34427
|
}
|
|
33885
34428
|
/**
|
|
33886
34429
|
* While the selection is an image, only the image is highlighted: Safari
|
|
33887
|
-
* paints the rest of a block image's line with its parent's highlight. See #1528
|
|
34430
|
+
* paints the rest of a block image's line with its parent's highlight. See #1528.
|
|
34431
|
+
* Media in a wrapper (`jodit-media`, the resizer's `jodit` for an embed, or
|
|
34432
|
+
* one from `mediaWrappers`) isn't highlighted either, as Safari paints its
|
|
34433
|
+
* wrapper's whole line, and its resize frame shows it's selected
|
|
33888
34434
|
*/ onSelectionChange() {
|
|
33889
34435
|
const { jodit } = this;
|
|
33890
34436
|
jodit.editor.classList.toggle(IMAGE_SELECTED, isImageSelected(jodit));
|
|
@@ -33937,7 +34483,8 @@ function isImageSelected(jodit) {
|
|
|
33937
34483
|
return false;
|
|
33938
34484
|
}
|
|
33939
34485
|
const { startContainer, startOffset, endContainer, endOffset } = sel.getRangeAt(0);
|
|
33940
|
-
|
|
34486
|
+
const node = startContainer.childNodes[startOffset];
|
|
34487
|
+
return startContainer === endContainer && endOffset === startOffset + 1 && (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(node, SELECTED_TAGS) || Boolean((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.getWrappedMedia)(jodit, node))) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isOrContains(jodit.editor, startContainer);
|
|
33941
34488
|
}
|
|
33942
34489
|
/**
|
|
33943
34490
|
* Remove the invisible-space text beside an image, which only held a caret.
|
|
@@ -35845,9 +36392,10 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('indent', indent
|
|
|
35845
36392
|
/* harmony import */ var jodit_plugins_table_keyboard_navigation_table_keyboard_navigation__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(30110);
|
|
35846
36393
|
/* harmony import */ var jodit_plugins_toolbar_navigation_toolbar_navigation__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(74192);
|
|
35847
36394
|
/* harmony import */ var jodit_plugins_video_video__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(34142);
|
|
35848
|
-
/* harmony import */ var
|
|
35849
|
-
/* harmony import */ var
|
|
35850
|
-
/* harmony import */ var
|
|
36395
|
+
/* harmony import */ var jodit_plugins_video_properties_video_properties__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(40878);
|
|
36396
|
+
/* harmony import */ var jodit_plugins_wrap_nodes_wrap_nodes__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(22980);
|
|
36397
|
+
/* harmony import */ var jodit_plugins_dtd_dtd__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(56894);
|
|
36398
|
+
/* harmony import */ var jodit_plugins_xpath_xpath__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(52014);
|
|
35851
36399
|
/*!
|
|
35852
36400
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
35853
36401
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -35920,6 +36468,7 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('indent', indent
|
|
|
35920
36468
|
|
|
35921
36469
|
|
|
35922
36470
|
|
|
36471
|
+
|
|
35923
36472
|
|
|
35924
36473
|
|
|
35925
36474
|
/***/ }),
|
|
@@ -36182,6 +36731,12 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
|
|
|
36182
36731
|
* @module plugins/inline-popup
|
|
36183
36732
|
*/
|
|
36184
36733
|
/* harmony default export */ __webpack_exports__["default"] = ([
|
|
36734
|
+
{
|
|
36735
|
+
name: 'replace',
|
|
36736
|
+
icon: 'video',
|
|
36737
|
+
tooltip: 'Replace',
|
|
36738
|
+
popup: (editor, target, close)=>target ? editor.e.fire('generateReplaceVideoTabs', target, close) : undefined
|
|
36739
|
+
},
|
|
36185
36740
|
{
|
|
36186
36741
|
name: 'bin',
|
|
36187
36742
|
tooltip: 'Delete',
|
|
@@ -36189,6 +36744,13 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
|
|
|
36189
36744
|
image && editor.s.removeNode(image);
|
|
36190
36745
|
}
|
|
36191
36746
|
},
|
|
36747
|
+
{
|
|
36748
|
+
name: 'pencil',
|
|
36749
|
+
tooltip: 'Edit',
|
|
36750
|
+
exec: (editor, target)=>{
|
|
36751
|
+
target && editor.e.fire('openVideoProperties', target);
|
|
36752
|
+
}
|
|
36753
|
+
},
|
|
36192
36754
|
_img__WEBPACK_IMPORTED_MODULE_0__.align
|
|
36193
36755
|
]);
|
|
36194
36756
|
|
|
@@ -36391,10 +36953,11 @@ const align = {
|
|
|
36391
36953
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28077);
|
|
36392
36954
|
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65946);
|
|
36393
36955
|
/* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91206);
|
|
36394
|
-
/* harmony import */ var
|
|
36395
|
-
/* harmony import */ var
|
|
36396
|
-
/* harmony import */ var
|
|
36397
|
-
/* harmony import */ var
|
|
36956
|
+
/* harmony import */ var jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(42259);
|
|
36957
|
+
/* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4099);
|
|
36958
|
+
/* harmony import */ var jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(56490);
|
|
36959
|
+
/* harmony import */ var jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(4274);
|
|
36960
|
+
/* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(89873);
|
|
36398
36961
|
/*!
|
|
36399
36962
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
36400
36963
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -36415,14 +36978,15 @@ const align = {
|
|
|
36415
36978
|
|
|
36416
36979
|
|
|
36417
36980
|
|
|
36981
|
+
|
|
36418
36982
|
/**
|
|
36419
36983
|
* Plugin for show inline popup dialog
|
|
36420
36984
|
*/ class inlinePopup extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugin {
|
|
36421
36985
|
get popup() {
|
|
36422
|
-
return new
|
|
36986
|
+
return new jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_9__.Popup(this.jodit, false);
|
|
36423
36987
|
}
|
|
36424
36988
|
get toolbar() {
|
|
36425
|
-
return (0,
|
|
36989
|
+
return (0,jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_10__.makeCollection)(this.jodit, this.popup);
|
|
36426
36990
|
}
|
|
36427
36991
|
onClick(node) {
|
|
36428
36992
|
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));
|
|
@@ -36496,6 +37060,33 @@ const align = {
|
|
|
36496
37060
|
onOutsideClick() {
|
|
36497
37061
|
this.popup.close();
|
|
36498
37062
|
}
|
|
37063
|
+
/**
|
|
37064
|
+
* A key that moves the caret off an element closes its popup, and one
|
|
37065
|
+
* that moves the caret into an element with a popup (a link) opens it,
|
|
37066
|
+
* as clicks do
|
|
37067
|
+
*/ onKeyUp() {
|
|
37068
|
+
this.__followCaret();
|
|
37069
|
+
}
|
|
37070
|
+
__followCaret() {
|
|
37071
|
+
if (!(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_7__.isMoved)(this.j, this.snapRange)) {
|
|
37072
|
+
return;
|
|
37073
|
+
}
|
|
37074
|
+
const { range } = this.j.s;
|
|
37075
|
+
const target = this.previousTarget;
|
|
37076
|
+
if (this.popup.isOpened && this.type !== 'selection' && target && !range.intersectsNode(target)) {
|
|
37077
|
+
this.popup.close();
|
|
37078
|
+
}
|
|
37079
|
+
const node = range.startContainer;
|
|
37080
|
+
const element = this.__elementAt(node);
|
|
37081
|
+
if (range.collapsed && element && element !== this.__keyDownElement) {
|
|
37082
|
+
this.onClick(node);
|
|
37083
|
+
}
|
|
37084
|
+
}
|
|
37085
|
+
/**
|
|
37086
|
+
* The element with a popup that holds `node`
|
|
37087
|
+
*/ __elementAt(node) {
|
|
37088
|
+
return jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.closest(node, this.elmsList, this.j.editor);
|
|
37089
|
+
}
|
|
36499
37090
|
/**
|
|
36500
37091
|
* Can show popup for this type
|
|
36501
37092
|
*/ canShowPopupForType(type) {
|
|
@@ -36535,12 +37126,28 @@ const align = {
|
|
|
36535
37126
|
], 'mousedown touchstart', this.__onDocumentMouseDown).on('closeAllPopups', this.__onCloseAllPopups);
|
|
36536
37127
|
this.addListenersForElements();
|
|
36537
37128
|
}
|
|
37129
|
+
onRecalcPositionPopup() {
|
|
37130
|
+
if (this.popup.isOpened && this.type !== 'selection' && this.previousTarget) {
|
|
37131
|
+
this.__reopenFor = this.previousTarget;
|
|
37132
|
+
}
|
|
37133
|
+
}
|
|
36538
37134
|
__onDocumentMouseDown(e) {
|
|
36539
|
-
|
|
37135
|
+
this.__reopenFor = null;
|
|
37136
|
+
if (this.popup.isOpened && this.type === 'selection' && e.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_8__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_9__.Popup)) {
|
|
36540
37137
|
this.__reopenSelectionPopup = true;
|
|
36541
37138
|
}
|
|
36542
37139
|
}
|
|
36543
37140
|
__onCloseAllPopups() {
|
|
37141
|
+
const target = this.__reopenFor;
|
|
37142
|
+
if (target) {
|
|
37143
|
+
this.__reopenFor = null;
|
|
37144
|
+
// After the popup's own `closeAllPopups` handler, as below
|
|
37145
|
+
this.j.async.setTimeout(()=>{
|
|
37146
|
+
if (this.j.editor.contains(target)) {
|
|
37147
|
+
this.onClick(target);
|
|
37148
|
+
}
|
|
37149
|
+
}, 1);
|
|
37150
|
+
}
|
|
36544
37151
|
if (!this.__reopenSelectionPopup) {
|
|
36545
37152
|
return;
|
|
36546
37153
|
}
|
|
@@ -36577,11 +37184,16 @@ const align = {
|
|
|
36577
37184
|
height: rect.height
|
|
36578
37185
|
};
|
|
36579
37186
|
}
|
|
36580
|
-
onSelectionStart() {
|
|
37187
|
+
onSelectionStart(event) {
|
|
37188
|
+
// A key held down moves the caret on every repeat, with one keyup
|
|
37189
|
+
if (event?.repeat) {
|
|
37190
|
+
this.__followCaret();
|
|
37191
|
+
}
|
|
36581
37192
|
this.snapRange = this.j.s.range.cloneRange();
|
|
37193
|
+
this.__keyDownElement = this.__elementAt(this.snapRange.startContainer);
|
|
36582
37194
|
}
|
|
36583
37195
|
onSelectionEnd(e) {
|
|
36584
|
-
if (e && e.target &&
|
|
37196
|
+
if (e && e.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_8__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_9__.Popup)) {
|
|
36585
37197
|
return;
|
|
36586
37198
|
}
|
|
36587
37199
|
const { snapRange } = this, { range } = this.j.s;
|
|
@@ -36661,7 +37273,11 @@ const align = {
|
|
|
36661
37273
|
* The user pressed a button inside the selection toolbar — after the
|
|
36662
37274
|
* command fires `closeAllPopups`, the toolbar should be shown again
|
|
36663
37275
|
* while the selection is still there. See #1238
|
|
36664
|
-
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__reopenSelectionPopup", false),
|
|
37276
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__reopenSelectionPopup", false), /**
|
|
37277
|
+
* The alignment controls fire `recalcPositionPopup` once they have moved
|
|
37278
|
+
* the element, and their button then fires `closeAllPopups`. The popup
|
|
37279
|
+
* opens again beside the element, as the selection toolbar does
|
|
37280
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__reopenFor", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "snapRange", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__keyDownElement", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "elmsList", (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.keys)(this.j.o.popup, false).filter((s)=>!this.isExcludedTarget(s)));
|
|
36665
37281
|
}
|
|
36666
37282
|
}
|
|
36667
37283
|
;(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(inlinePopup, "requires", [
|
|
@@ -36690,6 +37306,12 @@ const align = {
|
|
|
36690
37306
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
36691
37307
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':outsideClick')
|
|
36692
37308
|
], inlinePopup.prototype, "onOutsideClick", null);
|
|
37309
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
37310
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':keyup')
|
|
37311
|
+
], inlinePopup.prototype, "onKeyUp", null);
|
|
37312
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
37313
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':recalcPositionPopup')
|
|
37314
|
+
], inlinePopup.prototype, "onRecalcPositionPopup", null);
|
|
36693
37315
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
36694
37316
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
|
|
36695
37317
|
], inlinePopup.prototype, "__onDocumentMouseDown", null);
|
|
@@ -37850,6 +38472,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
|
|
|
37850
38472
|
} else if (mediaWrappers[element.nodeName.toLowerCase()]) {
|
|
37851
38473
|
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);
|
|
37852
38474
|
} else if (mediaInFakeBlock) {
|
|
38475
|
+
const media = element;
|
|
37853
38476
|
const wrapper = editor.createInside.element(mediaFakeTag, {
|
|
37854
38477
|
'data-jodit-temp': 1,
|
|
37855
38478
|
contenteditable: false,
|
|
@@ -37857,11 +38480,17 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
|
|
|
37857
38480
|
[`data-${keyFake}`]: 1
|
|
37858
38481
|
});
|
|
37859
38482
|
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(wrapper, 'style', (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(element, 'style'));
|
|
37860
|
-
|
|
37861
|
-
|
|
37862
|
-
|
|
37863
|
-
|
|
37864
|
-
|
|
38483
|
+
// The wrapper fits the media, whose size changes as its metadata loads
|
|
38484
|
+
// and as it's resized. A percentage width is of the line, so it takes that
|
|
38485
|
+
const fit = ()=>{
|
|
38486
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.css)(wrapper, {
|
|
38487
|
+
display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.cssInline)(media, 'display') === 'inline-block' ? 'inline-block' : 'block',
|
|
38488
|
+
width: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.cssInline)(media, 'width').endsWith('%') ? '' : 'fit-content',
|
|
38489
|
+
height: ''
|
|
38490
|
+
});
|
|
38491
|
+
};
|
|
38492
|
+
fit();
|
|
38493
|
+
editor.e.on(media, 'changesize', fit);
|
|
37865
38494
|
if (element.parentNode) {
|
|
37866
38495
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.before(element, wrapper);
|
|
37867
38496
|
}
|
|
@@ -38246,6 +38875,7 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('mobile', mobile
|
|
|
38246
38875
|
/* harmony import */ var _icons_ol_svg__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_icons_ol_svg__WEBPACK_IMPORTED_MODULE_3__);
|
|
38247
38876
|
/* harmony import */ var _icons_ul_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(83207);
|
|
38248
38877
|
/* harmony import */ var _icons_ul_svg__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_icons_ul_svg__WEBPACK_IMPORTED_MODULE_4__);
|
|
38878
|
+
/* harmony import */ var _start_dialog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(97547);
|
|
38249
38879
|
/*!
|
|
38250
38880
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
38251
38881
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -38257,10 +38887,18 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('mobile', mobile
|
|
|
38257
38887
|
|
|
38258
38888
|
|
|
38259
38889
|
|
|
38890
|
+
|
|
38891
|
+
/**
|
|
38892
|
+
* The `ol` dropdown item that asks for the list's start number
|
|
38893
|
+
*/ const START = 'start';
|
|
38260
38894
|
const memoExec = (jodit, _, { control })=>{
|
|
38261
38895
|
const key = `button${control.command}`;
|
|
38262
38896
|
const value = (control.args && control.args[0]) ?? (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_0__.dataBind)(jodit, key);
|
|
38263
|
-
(
|
|
38897
|
+
if (value === START) {
|
|
38898
|
+
(0,_start_dialog__WEBPACK_IMPORTED_MODULE_5__.openStartDialog)(jodit);
|
|
38899
|
+
return;
|
|
38900
|
+
}
|
|
38901
|
+
;(0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_0__.dataBind)(jodit, key, value);
|
|
38264
38902
|
jodit.execCommand(control.command, false, value === 'default' ? null : value);
|
|
38265
38903
|
};
|
|
38266
38904
|
jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_1__.Icon.set('ol', (_icons_ol_svg__WEBPACK_IMPORTED_MODULE_3___default())).set('ul', (_icons_ul_svg__WEBPACK_IMPORTED_MODULE_4___default()));
|
|
@@ -38290,9 +38928,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.ol = {
|
|
|
38290
38928
|
'lower-greek': 'Lower Greek',
|
|
38291
38929
|
'lower-roman': 'Lower Roman',
|
|
38292
38930
|
'upper-alpha': 'Upper Alpha',
|
|
38293
|
-
'upper-roman': 'Upper Roman'
|
|
38931
|
+
'upper-roman': 'Upper Roman',
|
|
38932
|
+
[START]: 'Start at...'
|
|
38294
38933
|
},
|
|
38295
|
-
exec: memoExec
|
|
38934
|
+
exec: memoExec,
|
|
38935
|
+
isChildDisabled: (jodit, button)=>button.control.args?.[0] === START && !(0,_start_dialog__WEBPACK_IMPORTED_MODULE_5__.closestOrderedList)(jodit)
|
|
38296
38936
|
};
|
|
38297
38937
|
|
|
38298
38938
|
|
|
@@ -38323,6 +38963,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.ol = {
|
|
|
38323
38963
|
|
|
38324
38964
|
|
|
38325
38965
|
|
|
38966
|
+
|
|
38326
38967
|
/**
|
|
38327
38968
|
* Process commands insertOrderedList and insertUnOrderedList
|
|
38328
38969
|
*/ class orderedList extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__.Plugin {
|
|
@@ -38361,6 +39002,86 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.ol = {
|
|
|
38361
39002
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('orderedList', orderedList);
|
|
38362
39003
|
|
|
38363
39004
|
|
|
39005
|
+
/***/ }),
|
|
39006
|
+
|
|
39007
|
+
/***/ 97547:
|
|
39008
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
39009
|
+
|
|
39010
|
+
"use strict";
|
|
39011
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
39012
|
+
/* harmony export */ closestOrderedList: function() { return /* binding */ closestOrderedList; },
|
|
39013
|
+
/* harmony export */ openStartDialog: function() { return /* binding */ openStartDialog; }
|
|
39014
|
+
/* harmony export */ });
|
|
39015
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
39016
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7909);
|
|
39017
|
+
/* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(59400);
|
|
39018
|
+
/* harmony import */ var jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5658);
|
|
39019
|
+
/*!
|
|
39020
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
39021
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
39022
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
39023
|
+
*/ /**
|
|
39024
|
+
* @module plugins/ordered-list
|
|
39025
|
+
*/
|
|
39026
|
+
|
|
39027
|
+
|
|
39028
|
+
|
|
39029
|
+
/**
|
|
39030
|
+
* The numbered list the selection is in
|
|
39031
|
+
*/ function closestOrderedList(jodit) {
|
|
39032
|
+
const current = jodit.s.current();
|
|
39033
|
+
return current ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(current, 'ol', jodit.editor) : null;
|
|
39034
|
+
}
|
|
39035
|
+
/**
|
|
39036
|
+
* Asks for the number of the first item of the list the selection is in,
|
|
39037
|
+
* and sets the list's `start`. The selection is put back when the dialog
|
|
39038
|
+
* closes, however it closes.
|
|
39039
|
+
*/ function openStartDialog(jodit) {
|
|
39040
|
+
const list = closestOrderedList(jodit);
|
|
39041
|
+
if (!list) {
|
|
39042
|
+
return;
|
|
39043
|
+
}
|
|
39044
|
+
const dialog = jodit.dlg({
|
|
39045
|
+
resizable: false,
|
|
39046
|
+
closeOnClickOverlay: true
|
|
39047
|
+
});
|
|
39048
|
+
const input = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_3__.UIInput(jodit, {
|
|
39049
|
+
name: 'start',
|
|
39050
|
+
type: 'number',
|
|
39051
|
+
label: 'Number for the first item',
|
|
39052
|
+
value: list.start
|
|
39053
|
+
});
|
|
39054
|
+
const form = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_3__.UIForm(jodit, [
|
|
39055
|
+
new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_3__.UIBlock(jodit, [
|
|
39056
|
+
input
|
|
39057
|
+
])
|
|
39058
|
+
]);
|
|
39059
|
+
form.container.classList.add('jodit-dialog_alert');
|
|
39060
|
+
form.onSubmit(({ start })=>{
|
|
39061
|
+
const value = start === '' ? 1 : parseInt(start, 10);
|
|
39062
|
+
if (isNaN(value)) {
|
|
39063
|
+
input.focus();
|
|
39064
|
+
return false;
|
|
39065
|
+
}
|
|
39066
|
+
dialog.close();
|
|
39067
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(list, 'start', value === 1 ? null : value);
|
|
39068
|
+
jodit.synchronizeValues();
|
|
39069
|
+
});
|
|
39070
|
+
jodit.s.save();
|
|
39071
|
+
dialog.e.on(dialog, 'afterClose', ()=>{
|
|
39072
|
+
jodit.s.focus();
|
|
39073
|
+
jodit.s.restore();
|
|
39074
|
+
});
|
|
39075
|
+
dialog.setFooter([
|
|
39076
|
+
(0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_2__.Button)(jodit, 'cancel', 'Cancel').onAction(()=>dialog.close()),
|
|
39077
|
+
(0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_2__.Button)(jodit, 'ok', 'Apply', 'primary').onAction(()=>form.submit())
|
|
39078
|
+
]);
|
|
39079
|
+
dialog.open(form, jodit.i18n('Start numbering at'), true, true);
|
|
39080
|
+
input.focus();
|
|
39081
|
+
input.nativeInput.select();
|
|
39082
|
+
}
|
|
39083
|
+
|
|
39084
|
+
|
|
38364
39085
|
/***/ }),
|
|
38365
39086
|
|
|
38366
39087
|
/***/ 71693:
|
|
@@ -39161,6 +39882,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.useInputsPlaceholder
|
|
|
39161
39882
|
return true;
|
|
39162
39883
|
}
|
|
39163
39884
|
const first = root.firstChild;
|
|
39885
|
+
// Firefox pads an empty editable body with a bare <br>
|
|
39886
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(first, 'br') && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.next(first, Boolean, root)) {
|
|
39887
|
+
return true;
|
|
39888
|
+
}
|
|
39164
39889
|
if (jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.INSEPARABLE_TAGS.has(first.nodeName?.toLowerCase()) || /^(TABLE)$/i.test(first.nodeName)) {
|
|
39165
39890
|
return false;
|
|
39166
39891
|
}
|
|
@@ -39209,11 +39934,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.useInputsPlaceholder
|
|
|
39209
39934
|
marginTop = parseInt(style2.getPropertyValue('margin-top'), 10);
|
|
39210
39935
|
marginLeft = parseInt(style2.getPropertyValue('margin-left'), 10);
|
|
39211
39936
|
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.placeholderElm, {
|
|
39937
|
+
fontFamily: style2.getPropertyValue('font-family'),
|
|
39212
39938
|
fontSize: parseInt(style2.getPropertyValue('font-size'), 10),
|
|
39213
39939
|
lineHeight: style2.getPropertyValue('line-height')
|
|
39214
39940
|
});
|
|
39215
39941
|
} else {
|
|
39216
39942
|
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.placeholderElm, {
|
|
39943
|
+
fontFamily: style.getPropertyValue('font-family'),
|
|
39217
39944
|
fontSize: parseInt(style.getPropertyValue('font-size'), 10),
|
|
39218
39945
|
lineHeight: style.getPropertyValue('line-height')
|
|
39219
39946
|
});
|
|
@@ -39259,7 +39986,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.useInputsPlaceholder
|
|
|
39259
39986
|
this.placeholderElm.innerHTML = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(editor.element, 'placeholder') || '';
|
|
39260
39987
|
}
|
|
39261
39988
|
editor.e.fire('placeholder', this.placeholderElm.innerHTML);
|
|
39262
|
-
editor.e.off('.placeholder').on('changePlace.placeholder', this.addNativeListeners).on('change.placeholder focus.placeholder keyup.placeholder mouseup.placeholder keydown.placeholder ' + 'mousedown.placeholder afterSetMode.placeholder changePlace.placeholder ' + 'internalChange.placeholder afterCommand.placeholder', this.toggle).on(window, 'load', this.toggle);
|
|
39989
|
+
editor.e.off('.placeholder').on('changePlace.placeholder', this.addNativeListeners).on('change.placeholder focus.placeholder keyup.placeholder mouseup.placeholder keydown.placeholder ' + 'mousedown.placeholder afterSetMode.placeholder changePlace.placeholder ' + 'internalChange.placeholder afterCommand.placeholder resize.placeholder', this.toggle).on(window, 'load', this.toggle);
|
|
39263
39990
|
this.addNativeListeners();
|
|
39264
39991
|
this.toggle();
|
|
39265
39992
|
});
|
|
@@ -40091,7 +40818,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.allowResizeTags = new
|
|
|
40091
40818
|
'img',
|
|
40092
40819
|
'iframe',
|
|
40093
40820
|
'table',
|
|
40094
|
-
'jodit'
|
|
40821
|
+
'jodit',
|
|
40822
|
+
'video'
|
|
40095
40823
|
]);
|
|
40096
40824
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
|
|
40097
40825
|
showSize: true,
|
|
@@ -40100,7 +40828,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
|
|
|
40100
40828
|
min_width: 10,
|
|
40101
40829
|
min_height: 10,
|
|
40102
40830
|
useAspectRatio: new Set([
|
|
40103
|
-
'img'
|
|
40831
|
+
'img',
|
|
40832
|
+
'video'
|
|
40104
40833
|
])
|
|
40105
40834
|
};
|
|
40106
40835
|
|
|
@@ -40121,7 +40850,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
|
|
|
40121
40850
|
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(65946);
|
|
40122
40851
|
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(80991);
|
|
40123
40852
|
/* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(18855);
|
|
40124
|
-
/* harmony import */ var
|
|
40853
|
+
/* harmony import */ var jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(42259);
|
|
40854
|
+
/* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(4099);
|
|
40855
|
+
/* harmony import */ var jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(56490);
|
|
40856
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(96608);
|
|
40125
40857
|
/*!
|
|
40126
40858
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
40127
40859
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -40142,6 +40874,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
|
|
|
40142
40874
|
|
|
40143
40875
|
|
|
40144
40876
|
|
|
40877
|
+
|
|
40878
|
+
|
|
40879
|
+
|
|
40145
40880
|
const keyBInd = '__jodit-resizer_binded';
|
|
40146
40881
|
/**
|
|
40147
40882
|
* Reads a plain pixel value out of a `width`/`height` attribute.
|
|
@@ -40154,11 +40889,25 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
40154
40889
|
}
|
|
40155
40890
|
return parseFloat(value);
|
|
40156
40891
|
}
|
|
40892
|
+
/**
|
|
40893
|
+
* A video with no height of its own takes it from its width and its ratio,
|
|
40894
|
+
* so resizing it keeps the ratio without setting a height.
|
|
40895
|
+
*/ function heightFollowsWidth(element) {
|
|
40896
|
+
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(element, 'video') && !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, 'height') && !(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(element, 'height');
|
|
40897
|
+
}
|
|
40898
|
+
const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
40899
|
+
/**
|
|
40900
|
+
* A click on an embed lands on its wrapper, so it selects the embed, until the
|
|
40901
|
+
* wrapper is active. While the editor is locked, as during resizing, the
|
|
40902
|
+
* wrapper takes the mouse again.
|
|
40903
|
+
*/ const EMBED_WRAPPER_STYLE = `${IFRAME_WRAPPER}{position:relative;display:block;user-select:none}` + `${IFRAME_WRAPPER} iframe{position:relative}` + `${IFRAME_WRAPPER}::after{position:absolute;z-index:1;display:block;background:transparent;content:'';cursor:pointer;inset:0}` + `${IFRAME_WRAPPER}[data-jodit-wrapper_active=true] iframe{z-index:2}` + `.jodit_lock ${IFRAME_WRAPPER}[data-jodit-wrapper_active=true] iframe{z-index:1}`;
|
|
40157
40904
|
/**
|
|
40158
40905
|
* The module creates a supporting frame for resizing of the elements img and table
|
|
40159
40906
|
*/ class resizer extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_8__.Plugin {
|
|
40160
40907
|
/** @override */ afterInit(editor) {
|
|
40161
|
-
|
|
40908
|
+
// It goes in the editing document, so iframe mode has it whatever `iframeStyle` holds
|
|
40909
|
+
(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.getContainer)(editor, 'resizer', 'style', true).textContent = EMBED_WRAPPER_STYLE;
|
|
40910
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.$$)('div', this.rect).forEach((resizeHandle)=>{
|
|
40162
40911
|
editor.e.on(resizeHandle, 'mousedown.resizer touchstart.resizer', this.onStartResizing.bind(this, resizeHandle));
|
|
40163
40912
|
});
|
|
40164
40913
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.eventEmitter.on('hideHelpers', this.hide);
|
|
@@ -40166,7 +40915,11 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
40166
40915
|
if (isReadOnly) {
|
|
40167
40916
|
this.hide();
|
|
40168
40917
|
}
|
|
40169
|
-
}).on('afterInit changePlace', this.addEventListeners.bind(this))
|
|
40918
|
+
}).on('afterInit changePlace', this.addEventListeners.bind(this))// Handlers without a namespace run first, ahead of those that
|
|
40919
|
+
// move the caret, as table-keyboard-navigation's do
|
|
40920
|
+
.on('keydown', this.onEditorKeyDown, {
|
|
40921
|
+
top: true
|
|
40922
|
+
}).on('afterGetValueFromEditor.resizer', (data)=>{
|
|
40170
40923
|
const rgx = /<jodit[^>]+data-jodit_iframe_wrapper[^>]+>(.*?<iframe[^>]*>.*?<\/iframe>.*?)<\/jodit>/gi;
|
|
40171
40924
|
if (rgx.test(data.value)) {
|
|
40172
40925
|
data.value = data.value.replace(rgx, '$1');
|
|
@@ -40181,14 +40934,26 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
40181
40934
|
let node = e.target;
|
|
40182
40935
|
const { editor, options: { allowResizeTags } } = this.j;
|
|
40183
40936
|
while(node && node !== editor){
|
|
40184
|
-
|
|
40185
|
-
|
|
40186
|
-
this.
|
|
40937
|
+
const element = this.__resizable(node);
|
|
40938
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(element, allowResizeTags)) {
|
|
40939
|
+
this.__bind(element);
|
|
40940
|
+
this.onClickElement(element);
|
|
40187
40941
|
return;
|
|
40188
40942
|
}
|
|
40189
40943
|
node = node.parentNode;
|
|
40190
40944
|
}
|
|
40191
40945
|
}
|
|
40946
|
+
/**
|
|
40947
|
+
* What a click on `node` resizes: the media in it when it's a media
|
|
40948
|
+
* wrapper (`jodit-media`, or one from `mediaWrappers`), or `node` itself
|
|
40949
|
+
*/ __resizable(node) {
|
|
40950
|
+
const media = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getWrappedMedia)(this.j, node) ?? (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isHTMLElement(node) && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(node, 'data-jodit_fake_wrapper') ? node.firstElementChild : null);
|
|
40951
|
+
if (!media) {
|
|
40952
|
+
return node;
|
|
40953
|
+
}
|
|
40954
|
+
// An embed is resized through its own wrapper
|
|
40955
|
+
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isHTMLElement(media.parentNode) && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(media.parentNode, 'data-jodit_iframe_wrapper') ? media.parentNode : media;
|
|
40956
|
+
}
|
|
40192
40957
|
__afterInsertImage(image) {
|
|
40193
40958
|
if (this.j.o.resizer.forImageChangeAttributes) {
|
|
40194
40959
|
return;
|
|
@@ -40205,17 +40970,15 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
40205
40970
|
if (this.isShown && (e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_DELETE || e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_BACKSPACE) && this.element && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(this.element, 'table')) {
|
|
40206
40971
|
this.onDelete(e);
|
|
40207
40972
|
}
|
|
40208
|
-
}).on(editor.ow, 'resize.resizer', this.updateSize).on('resize.resizer', this.updateSize)
|
|
40973
|
+
}).on(editor.ow, 'resize.resizer', this.updateSize).on('resize.resizer', this.updateSize)// The frame is outside the content, so it's moved to follow the
|
|
40974
|
+
// element as the content scrolls
|
|
40975
|
+
.on([
|
|
40209
40976
|
editor.ow,
|
|
40210
40977
|
editor.editor
|
|
40211
|
-
], 'scroll.resizer', ()
|
|
40212
|
-
if (this.isShown && !this.isResizeMode) {
|
|
40213
|
-
this.hide();
|
|
40214
|
-
}
|
|
40215
|
-
}).on(editor.ow, 'keydown.resizer', this.onKeyDown).on(editor.ow, 'keyup.resizer', this.onKeyUp).on(editor.ow, 'mouseup.resizer touchend.resizer', this.onClickOutside);
|
|
40978
|
+
], 'scroll.resizer', this.updateSize).on(editor.ow, 'keydown.resizer', this.onKeyDown).on(editor.ow, 'keyup.resizer', this.onKeyUp).on(editor.ow, 'mouseup.resizer touchend.resizer', this.onClickOutside);
|
|
40216
40979
|
}
|
|
40217
40980
|
onStartResizing(resizeHandle, e) {
|
|
40218
|
-
if (!this.element || !this.
|
|
40981
|
+
if (!this.element || !this.isElementInEditor) {
|
|
40219
40982
|
this.hide();
|
|
40220
40983
|
return false;
|
|
40221
40984
|
}
|
|
@@ -40268,7 +41031,8 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
40268
41031
|
const className = this.handle.className;
|
|
40269
41032
|
let new_w, new_h;
|
|
40270
41033
|
const uar = this.j.o.resizer.useAspectRatio;
|
|
40271
|
-
|
|
41034
|
+
const keepRatio = !this.isAltMode && (uar === true || Boolean(uar && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(this.element, uar)));
|
|
41035
|
+
if (keepRatio) {
|
|
40272
41036
|
if (diff_x) {
|
|
40273
41037
|
new_w = this.width + (className.match(/left/) ? -1 : 1) * diff_x;
|
|
40274
41038
|
new_h = Math.round(new_w / this.ratio);
|
|
@@ -40291,7 +41055,7 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
40291
41055
|
this.applySize(this.element, 'width', '100%');
|
|
40292
41056
|
}
|
|
40293
41057
|
}
|
|
40294
|
-
if (new_h > this.j.o.resizer.min_height) {
|
|
41058
|
+
if (new_h > this.j.o.resizer.min_height && !(keepRatio && heightFollowsWidth(this.element))) {
|
|
40295
41059
|
this.applySize(this.element, 'height', new_h);
|
|
40296
41060
|
}
|
|
40297
41061
|
this.updateSize();
|
|
@@ -40299,6 +41063,38 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
40299
41063
|
e.stopImmediatePropagation();
|
|
40300
41064
|
}
|
|
40301
41065
|
}
|
|
41066
|
+
onEditorKeyDown(event) {
|
|
41067
|
+
// A key held down moves the caret on every repeat, with one keyup
|
|
41068
|
+
if (event?.repeat) {
|
|
41069
|
+
this.__followCaret();
|
|
41070
|
+
}
|
|
41071
|
+
this.__keyDownRange = this.j.s.range.cloneRange();
|
|
41072
|
+
this.__keyDownTable = this.__caretTable();
|
|
41073
|
+
}
|
|
41074
|
+
__caretTable() {
|
|
41075
|
+
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(this.j.s.range.startContainer, 'table', this.j.editor);
|
|
41076
|
+
}
|
|
41077
|
+
/**
|
|
41078
|
+
* Hide the frame once a key has moved the caret off its element, and
|
|
41079
|
+
* frame a table the caret has moved into, as clicks do
|
|
41080
|
+
*/ onEditorKeyUp() {
|
|
41081
|
+
this.__followCaret();
|
|
41082
|
+
}
|
|
41083
|
+
__followCaret() {
|
|
41084
|
+
const before = this.__keyDownRange;
|
|
41085
|
+
this.__keyDownRange = null;
|
|
41086
|
+
if (!(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_9__.isMoved)(this.j, before)) {
|
|
41087
|
+
return;
|
|
41088
|
+
}
|
|
41089
|
+
if (this.isShown && this.element && !this.j.s.range.intersectsNode(this.element)) {
|
|
41090
|
+
this.hide();
|
|
41091
|
+
}
|
|
41092
|
+
const table = this.__caretTable();
|
|
41093
|
+
if (table && table !== this.__keyDownTable && this.j.o.allowResizeTags.has('table')) {
|
|
41094
|
+
this.__bind(table);
|
|
41095
|
+
this.onClickElement(table);
|
|
41096
|
+
}
|
|
41097
|
+
}
|
|
40302
41098
|
onKeyDown(e) {
|
|
40303
41099
|
this.isAltMode = e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_ALT;
|
|
40304
41100
|
if (!this.isAltMode && this.isResizeMode) {
|
|
@@ -40320,6 +41116,11 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
40320
41116
|
return;
|
|
40321
41117
|
}
|
|
40322
41118
|
if (!this.isResizeMode) {
|
|
41119
|
+
// A click in the element's popup, or in a list it opens, works on
|
|
41120
|
+
// the element, so it keeps its frame
|
|
41121
|
+
if (e?.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_10__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_11__.Popup)) {
|
|
41122
|
+
return;
|
|
41123
|
+
}
|
|
40323
41124
|
return this.hide();
|
|
40324
41125
|
}
|
|
40325
41126
|
e.stopImmediatePropagation();
|
|
@@ -40337,10 +41138,19 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
40337
41138
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(element, key, value);
|
|
40338
41139
|
}
|
|
40339
41140
|
}
|
|
41141
|
+
/**
|
|
41142
|
+
* The framed element can go with a wrapper round it, keeping its parent
|
|
41143
|
+
*/ get isElementInEditor() {
|
|
41144
|
+
return Boolean(this.element && this.j.editor.contains(this.element));
|
|
41145
|
+
}
|
|
40340
41146
|
onDelete(e) {
|
|
40341
41147
|
if (!this.element) {
|
|
40342
41148
|
return;
|
|
40343
41149
|
}
|
|
41150
|
+
if (!this.isElementInEditor) {
|
|
41151
|
+
this.hide();
|
|
41152
|
+
return;
|
|
41153
|
+
}
|
|
40344
41154
|
if (this.element.tagName !== 'JODIT') {
|
|
40345
41155
|
this.j.s.select(this.element);
|
|
40346
41156
|
} else {
|
|
@@ -40351,7 +41161,7 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
40351
41161
|
}
|
|
40352
41162
|
__onChangeEditor() {
|
|
40353
41163
|
if (this.isShown) {
|
|
40354
|
-
if (!this.
|
|
41164
|
+
if (!this.isElementInEditor) {
|
|
40355
41165
|
this.hide();
|
|
40356
41166
|
} else {
|
|
40357
41167
|
this.updateSize();
|
|
@@ -40449,9 +41259,13 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
40449
41259
|
return;
|
|
40450
41260
|
}
|
|
40451
41261
|
this.isShown = true;
|
|
41262
|
+
if (this.layer.parentNode !== this.j.workplace) {
|
|
41263
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.markOwner)(this.j, this.layer);
|
|
41264
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(this.j.workplace, this.layer);
|
|
41265
|
+
}
|
|
40452
41266
|
if (!this.rect.parentNode) {
|
|
40453
41267
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.markOwner)(this.j, this.rect);
|
|
40454
|
-
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(this.
|
|
41268
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(this.layer, this.rect);
|
|
40455
41269
|
}
|
|
40456
41270
|
if (this.j.isFullSize) {
|
|
40457
41271
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(this.rect, 'zIndex', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(this.j.container, 'zIndex').toString());
|
|
@@ -40471,8 +41285,9 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
40471
41285
|
}
|
|
40472
41286
|
beforeDestruct(jodit) {
|
|
40473
41287
|
this.hide();
|
|
41288
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(this.layer);
|
|
40474
41289
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.eventEmitter.off('hideHelpers', this.hide);
|
|
40475
|
-
jodit.e.off(this.j.ow, '.resizer').off('.resizer');
|
|
41290
|
+
jodit.e.off(this.j.ow, '.resizer').off('.resizer').off('keydown', this.onEditorKeyDown);
|
|
40476
41291
|
}
|
|
40477
41292
|
constructor(...args){
|
|
40478
41293
|
super(...args), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "LOCK_KEY", 'resizer'), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "handle", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "element", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isResizeMode", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isShown", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "startX", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "startY", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "width", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "height", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "ratio", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "rect", this.j.c.fromHTML(`<div title="${this.j.i18n('Press Alt for custom resizing')}" class="jodit-resizer">
|
|
@@ -40481,7 +41296,8 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
40481
41296
|
<div class="jodit-resizer__bottom-right"></div>
|
|
40482
41297
|
<div class="jodit-resizer__bottom-left"></div>
|
|
40483
41298
|
<span>100x100</span>
|
|
40484
|
-
</div>`)),
|
|
41299
|
+
</div>`)), // Clips the frame to the workplace, without the frame making it scroll
|
|
41300
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "layer", this.j.c.div('jodit-resizer-layer')), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "sizeViewer", this.rect.getElementsByTagName('span')[0]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "pointerX", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "pointerY", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__keyDownRange", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__keyDownTable", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isAltMode", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "onClickElement", (element)=>{
|
|
40485
41301
|
if (this.isResizeMode) {
|
|
40486
41302
|
return;
|
|
40487
41303
|
}
|
|
@@ -40491,6 +41307,9 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
40491
41307
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(this.element, 'img') && !this.element.complete) {
|
|
40492
41308
|
this.j.e.one(this.element, 'load', this.updateSize);
|
|
40493
41309
|
}
|
|
41310
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(this.element, 'video') && this.element.readyState < HTMLMediaElement.HAVE_METADATA) {
|
|
41311
|
+
this.j.e.one(this.element, 'loadedmetadata', this.updateSize);
|
|
41312
|
+
}
|
|
40494
41313
|
}
|
|
40495
41314
|
}), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "updateSize", ()=>{
|
|
40496
41315
|
if (this.isInDestruct || !this.isShown) {
|
|
@@ -40536,6 +41355,12 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
40536
41355
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
40537
41356
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
40538
41357
|
], resizer.prototype, "onResize", null);
|
|
41358
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
41359
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
41360
|
+
], resizer.prototype, "onEditorKeyDown", null);
|
|
41361
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
41362
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':keyup')
|
|
41363
|
+
], resizer.prototype, "onEditorKeyUp", null);
|
|
40539
41364
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
40540
41365
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
40541
41366
|
], resizer.prototype, "onKeyDown", null);
|
|
@@ -41485,8 +42310,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.tableAllowCellSelecti
|
|
|
41485
42310
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28077);
|
|
41486
42311
|
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(65946);
|
|
41487
42312
|
/* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(91206);
|
|
41488
|
-
/* harmony import */ var
|
|
41489
|
-
/* harmony import */ var
|
|
42313
|
+
/* harmony import */ var jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(42259);
|
|
42314
|
+
/* harmony import */ var jodit_modules_table_table__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(98803);
|
|
42315
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(69070);
|
|
41490
42316
|
/*!
|
|
41491
42317
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
41492
42318
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -41505,19 +42331,24 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.tableAllowCellSelecti
|
|
|
41505
42331
|
|
|
41506
42332
|
|
|
41507
42333
|
|
|
42334
|
+
|
|
41508
42335
|
const key = 'table_processor_observer';
|
|
41509
42336
|
const MOUSE_MOVE_LABEL = 'onMoveTableSelectCell';
|
|
41510
42337
|
class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin {
|
|
41511
42338
|
/**
|
|
41512
42339
|
* Shortcut for Jodit.modules.Table
|
|
41513
42340
|
*/ get __tableModule() {
|
|
41514
|
-
return this.j.getInstance(
|
|
42341
|
+
return this.j.getInstance(jodit_modules_table_table__WEBPACK_IMPORTED_MODULE_9__.Table, this.j.o);
|
|
41515
42342
|
}
|
|
41516
42343
|
afterInit(jodit) {
|
|
41517
42344
|
if (!jodit.o.tableAllowCellSelection) {
|
|
41518
42345
|
return;
|
|
41519
42346
|
}
|
|
41520
|
-
jodit.e
|
|
42347
|
+
jodit.e// Handlers without a namespace run first, ahead of those that
|
|
42348
|
+
// move the caret, as table-keyboard-navigation's do
|
|
42349
|
+
.on('keydown', this.__onKeyDown, {
|
|
42350
|
+
top: true
|
|
42351
|
+
}).on('keydown.select-cells', (event)=>{
|
|
41521
42352
|
if (event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_TAB) {
|
|
41522
42353
|
this.unselectCells();
|
|
41523
42354
|
}
|
|
@@ -41540,6 +42371,59 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
41540
42371
|
}
|
|
41541
42372
|
});
|
|
41542
42373
|
}
|
|
42374
|
+
__onKeyDown(event) {
|
|
42375
|
+
// A key held down moves the caret on every repeat, with one keyup
|
|
42376
|
+
if (event?.repeat) {
|
|
42377
|
+
this.__followCaret();
|
|
42378
|
+
}
|
|
42379
|
+
this.__keyDownCell = this.__caretCell();
|
|
42380
|
+
this.__keyDownRange = this.j.s.range.cloneRange();
|
|
42381
|
+
this.__keyDownInLink = this.__isInLink();
|
|
42382
|
+
}
|
|
42383
|
+
__isInLink() {
|
|
42384
|
+
return Boolean(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(this.j.s.range.startContainer, 'a', this.j.editor));
|
|
42385
|
+
}
|
|
42386
|
+
/**
|
|
42387
|
+
* Where the selection starts rather than `s.current()`, which finds the
|
|
42388
|
+
* first cell when the caret is just before the table
|
|
42389
|
+
*/ __caretCell() {
|
|
42390
|
+
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(this.j.s.range.startContainer, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isCell, this.j.editor);
|
|
42391
|
+
}
|
|
42392
|
+
/**
|
|
42393
|
+
* A key that moves the caret into a cell, from another cell or from
|
|
42394
|
+
* outside the table, marks that cell and opens its popup, as a click on
|
|
42395
|
+
* it does. One that moves the caret out of the table unmarks the cells
|
|
42396
|
+
*/ onKeyUp() {
|
|
42397
|
+
this.__followCaret();
|
|
42398
|
+
}
|
|
42399
|
+
__followCaret() {
|
|
42400
|
+
const before = this.__keyDownRange;
|
|
42401
|
+
this.__keyDownRange = null;
|
|
42402
|
+
if (this.j.o.readonly || !(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_8__.isMoved)(this.j, before)) {
|
|
42403
|
+
return;
|
|
42404
|
+
}
|
|
42405
|
+
const cell = this.__caretCell();
|
|
42406
|
+
const hasLeftLink = this.__keyDownInLink && !this.__isInLink();
|
|
42407
|
+
if (cell === this.__keyDownCell && !(cell && hasLeftLink)) {
|
|
42408
|
+
return;
|
|
42409
|
+
}
|
|
42410
|
+
const hadMarked = this.__tableModule.getAllSelectedCells().length > 0;
|
|
42411
|
+
this.unselectCells();
|
|
42412
|
+
if (!cell) {
|
|
42413
|
+
if (hadMarked) {
|
|
42414
|
+
this.j.e.fire('hidePopup', 'cells');
|
|
42415
|
+
}
|
|
42416
|
+
return;
|
|
42417
|
+
}
|
|
42418
|
+
const table = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(cell, 'table', this.j.editor);
|
|
42419
|
+
if (!table) {
|
|
42420
|
+
return;
|
|
42421
|
+
}
|
|
42422
|
+
// As after a click, the first change to the cell keeps the mark
|
|
42423
|
+
this.__selectedCell = cell;
|
|
42424
|
+
this.__tableModule.addSelection(cell);
|
|
42425
|
+
this.j.e.fire('showPopup', table, ()=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.position)(cell, this.j), 'cells');
|
|
42426
|
+
}
|
|
41543
42427
|
/**
|
|
41544
42428
|
* Mouse click inside the table
|
|
41545
42429
|
*/ onStartSelection(cell, event) {
|
|
@@ -41857,10 +42741,14 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
41857
42741
|
}
|
|
41858
42742
|
/** @override */ beforeDestruct(jodit) {
|
|
41859
42743
|
this.__onRemoveSelection();
|
|
41860
|
-
jodit.e.off('.select-cells');
|
|
42744
|
+
jodit.e.off('.select-cells').off('keydown', this.__onKeyDown);
|
|
41861
42745
|
}
|
|
41862
42746
|
constructor(...args){
|
|
41863
42747
|
super(...args), /**
|
|
42748
|
+
* The cell with the caret, and the selection, when a key went down
|
|
42749
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__keyDownCell", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__keyDownRange", null), /**
|
|
42750
|
+
* A link's popup replaces the cell's while the caret is in the link
|
|
42751
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__keyDownInLink", false), /**
|
|
41864
42752
|
* First selected cell
|
|
41865
42753
|
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__selectedCell", null), /**
|
|
41866
42754
|
* User is selecting cells now
|
|
@@ -41870,6 +42758,12 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
41870
42758
|
;(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(selectCells, "requires", [
|
|
41871
42759
|
'select'
|
|
41872
42760
|
]);
|
|
42761
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
42762
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
42763
|
+
], selectCells.prototype, "__onKeyDown", null);
|
|
42764
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
42765
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':keyup')
|
|
42766
|
+
], selectCells.prototype, "onKeyUp", null);
|
|
41873
42767
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
41874
42768
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
41875
42769
|
], selectCells.prototype, "onStartSelection", null);
|
|
@@ -44401,7 +45295,9 @@ const WORK_KEYS = new Set([
|
|
|
44401
45295
|
case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_LEFT:
|
|
44402
45296
|
{
|
|
44403
45297
|
next = getNextCell();
|
|
44404
|
-
|
|
45298
|
+
// Left in the first cell leaves the table, as Up in the
|
|
45299
|
+
// top row does
|
|
45300
|
+
if (!next && key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB) {
|
|
44405
45301
|
tableModule.appendRow(table, !isPrev ? false : jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.first(table, (node)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(node, 'tr')), !isPrev);
|
|
44406
45302
|
next = getNextCell();
|
|
44407
45303
|
}
|
|
@@ -44427,7 +45323,6 @@ const WORK_KEYS = new Set([
|
|
|
44427
45323
|
if (!next) {
|
|
44428
45324
|
return;
|
|
44429
45325
|
}
|
|
44430
|
-
editor.e.fire('hidePopup hideResizer');
|
|
44431
45326
|
if (!next.firstChild) {
|
|
44432
45327
|
const first = editor.createInside.element('br');
|
|
44433
45328
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(next, first);
|
|
@@ -44893,10 +45788,732 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.pluginSystem.add('toolbarNavigati
|
|
|
44893
45788
|
|
|
44894
45789
|
/***/ }),
|
|
44895
45790
|
|
|
44896
|
-
/***/
|
|
45791
|
+
/***/ 39057:
|
|
45792
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
45793
|
+
|
|
45794
|
+
"use strict";
|
|
45795
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
45796
|
+
/* harmony export */ editedMedia: function() { return /* binding */ editedMedia; },
|
|
45797
|
+
/* harmony export */ ownSize: function() { return /* binding */ ownSize; },
|
|
45798
|
+
/* harmony export */ readValues: function() { return /* binding */ readValues; }
|
|
45799
|
+
/* harmony export */ });
|
|
45800
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
45801
|
+
/* harmony import */ var jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(70222);
|
|
45802
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7909);
|
|
45803
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80991);
|
|
45804
|
+
/* harmony import */ var jodit_plugins_image_properties_utils_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(10808);
|
|
45805
|
+
/*!
|
|
45806
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
45807
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
45808
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
45809
|
+
*/ /**
|
|
45810
|
+
* @module plugins/video-properties
|
|
45811
|
+
*/
|
|
45812
|
+
|
|
45813
|
+
|
|
45814
|
+
|
|
45815
|
+
|
|
45816
|
+
const mediaSelector = 'video, audio, iframe';
|
|
45817
|
+
/**
|
|
45818
|
+
* The media `target` is, or holds as its wrapper (`jodit-media`, the resizer's
|
|
45819
|
+
* `jodit` for an embed, or one from `mediaWrappers`)
|
|
45820
|
+
* @private
|
|
45821
|
+
*/ function editedMedia(target) {
|
|
45822
|
+
return target.matches(mediaSelector) ? target : target.querySelector(mediaSelector);
|
|
45823
|
+
}
|
|
45824
|
+
/**
|
|
45825
|
+
* The size `media` is given, inline or by its attribute
|
|
45826
|
+
* @private
|
|
45827
|
+
*/ function ownSize(media, key) {
|
|
45828
|
+
return (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.cssInline)(media, key) || (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(media, key) || '';
|
|
45829
|
+
}
|
|
45830
|
+
const toNumber = (value)=>parseFloat(value.toString());
|
|
45831
|
+
/**
|
|
45832
|
+
* Read the media's values into the state
|
|
45833
|
+
* @private
|
|
45834
|
+
*/ function readValues(state) {
|
|
45835
|
+
const { media, values } = state;
|
|
45836
|
+
const width = ownSize(media, 'width');
|
|
45837
|
+
const height = ownSize(media, 'height');
|
|
45838
|
+
values.width = width ? (0,jodit_plugins_image_properties_utils_utils__WEBPACK_IMPORTED_MODULE_4__.normalSizeFromString)(width) : media.offsetWidth;
|
|
45839
|
+
values.height = height ? (0,jodit_plugins_image_properties_utils_utils__WEBPACK_IMPORTED_MODULE_4__.normalSizeFromString)(height) : '';
|
|
45840
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(media, 'video') && media.videoWidth) {
|
|
45841
|
+
state.ratio = media.videoWidth / media.videoHeight;
|
|
45842
|
+
} else if ((0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(values.width) && (0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(values.height)) {
|
|
45843
|
+
state.ratio = toNumber(values.width) / toNumber(values.height);
|
|
45844
|
+
} else {
|
|
45845
|
+
state.ratio = media.offsetWidth / media.offsetHeight || 1;
|
|
45846
|
+
}
|
|
45847
|
+
// One with no height takes it from its width
|
|
45848
|
+
if (!height && (0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(values.width)) {
|
|
45849
|
+
values.height = Math.round(toNumber(values.width) / state.ratio);
|
|
45850
|
+
}
|
|
45851
|
+
state.sizeIsLocked = (0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(values.width) && (0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(values.height) && (!height || Math.abs(toNumber(values.width) - toNumber(values.height) * state.ratio) < 1);
|
|
45852
|
+
values.poster = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(media, 'poster') || '';
|
|
45853
|
+
values.autoplay = media.hasAttribute('autoplay');
|
|
45854
|
+
values.loop = media.hasAttribute('loop');
|
|
45855
|
+
// Autoplay's own: turning it off gives the sound back
|
|
45856
|
+
values.muted = media.hasAttribute('muted') && !values.autoplay;
|
|
45857
|
+
// Without Autoplay it keeps its controls, or it could never be played
|
|
45858
|
+
values.controls = media.hasAttribute('controls') || !values.autoplay;
|
|
45859
|
+
}
|
|
45860
|
+
|
|
45861
|
+
|
|
45862
|
+
/***/ }),
|
|
45863
|
+
|
|
45864
|
+
/***/ 25001:
|
|
45865
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
45866
|
+
|
|
45867
|
+
"use strict";
|
|
45868
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
45869
|
+
/* harmony export */ replaceMedia: function() { return /* binding */ replaceMedia; }
|
|
45870
|
+
/* harmony export */ });
|
|
45871
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
45872
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7909);
|
|
45873
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80991);
|
|
45874
|
+
/* harmony import */ var _readers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(39057);
|
|
45875
|
+
/* harmony import */ var _writers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(94893);
|
|
45876
|
+
/*!
|
|
45877
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
45878
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
45879
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
45880
|
+
*/ /**
|
|
45881
|
+
* @module plugins/video-properties
|
|
45882
|
+
*/
|
|
45883
|
+
|
|
45884
|
+
|
|
45885
|
+
|
|
45886
|
+
|
|
45887
|
+
/**
|
|
45888
|
+
* Give `media`, in `outer`, the classes, inline styles, size and playback
|
|
45889
|
+
* settings of `old`, in `oldOuter`. It keeps its own source and poster.
|
|
45890
|
+
*/ function takeOver(j, oldOuter, old, outer, media) {
|
|
45891
|
+
const state = {
|
|
45892
|
+
target: oldOuter,
|
|
45893
|
+
media: old,
|
|
45894
|
+
ratio: 1,
|
|
45895
|
+
sizeIsLocked: true,
|
|
45896
|
+
values: {
|
|
45897
|
+
width: '',
|
|
45898
|
+
height: '',
|
|
45899
|
+
poster: '',
|
|
45900
|
+
autoplay: false,
|
|
45901
|
+
loop: false,
|
|
45902
|
+
muted: false,
|
|
45903
|
+
controls: true
|
|
45904
|
+
}
|
|
45905
|
+
};
|
|
45906
|
+
(0,_readers__WEBPACK_IMPORTED_MODULE_3__.readValues)(state);
|
|
45907
|
+
const pairs = [
|
|
45908
|
+
[
|
|
45909
|
+
old,
|
|
45910
|
+
media
|
|
45911
|
+
]
|
|
45912
|
+
];
|
|
45913
|
+
// A wrapper kept in the content, which holds the alignment
|
|
45914
|
+
if (oldOuter !== old && outer !== media && oldOuter.nodeName === outer.nodeName) {
|
|
45915
|
+
pairs.push([
|
|
45916
|
+
oldOuter,
|
|
45917
|
+
outer
|
|
45918
|
+
]);
|
|
45919
|
+
}
|
|
45920
|
+
pairs.forEach(([from, to])=>{
|
|
45921
|
+
[
|
|
45922
|
+
'class',
|
|
45923
|
+
'style'
|
|
45924
|
+
].forEach((name)=>(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(to, name, (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(from, name)));
|
|
45925
|
+
});
|
|
45926
|
+
// A video's size is CSS and an embed's its attributes, so the writer sizes
|
|
45927
|
+
// one that's a different element
|
|
45928
|
+
if (old.nodeName !== media.nodeName) {
|
|
45929
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(media, {
|
|
45930
|
+
width: null,
|
|
45931
|
+
height: null
|
|
45932
|
+
});
|
|
45933
|
+
if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(media, 'style')?.trim()) {
|
|
45934
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(media, 'style', null);
|
|
45935
|
+
}
|
|
45936
|
+
}
|
|
45937
|
+
state.media = media;
|
|
45938
|
+
state.values.poster = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(media, 'poster') || '';
|
|
45939
|
+
(0,_writers__WEBPACK_IMPORTED_MODULE_4__.applyValues)(j, state, Boolean((0,_readers__WEBPACK_IMPORTED_MODULE_3__.ownSize)(old, 'width') || (0,_readers__WEBPACK_IMPORTED_MODULE_3__.ownSize)(old, 'height')));
|
|
45940
|
+
}
|
|
45941
|
+
/**
|
|
45942
|
+
* Run `insert`, which inserts media at the cursor, with the cursor after
|
|
45943
|
+
* `replaced`, and put what it inserts in place of `replaced`
|
|
45944
|
+
* @private
|
|
45945
|
+
*/ function replaceMedia(j, replaced, insert) {
|
|
45946
|
+
const inserted = [];
|
|
45947
|
+
const collect = (node)=>{
|
|
45948
|
+
inserted.push(node);
|
|
45949
|
+
};
|
|
45950
|
+
j.history.snapshot.transaction(()=>{
|
|
45951
|
+
j.s.focus();
|
|
45952
|
+
j.s.setCursorAfter(replaced);
|
|
45953
|
+
j.e.on('afterInsertNode', collect);
|
|
45954
|
+
try {
|
|
45955
|
+
insert();
|
|
45956
|
+
} finally{
|
|
45957
|
+
j.e.off('afterInsertNode', collect);
|
|
45958
|
+
}
|
|
45959
|
+
const [outer] = inserted;
|
|
45960
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(outer)) {
|
|
45961
|
+
return;
|
|
45962
|
+
}
|
|
45963
|
+
const old = (0,_readers__WEBPACK_IMPORTED_MODULE_3__.editedMedia)(replaced);
|
|
45964
|
+
const media = (0,_readers__WEBPACK_IMPORTED_MODULE_3__.editedMedia)(outer);
|
|
45965
|
+
if (old && media) {
|
|
45966
|
+
takeOver(j, replaced, old, outer, media);
|
|
45967
|
+
}
|
|
45968
|
+
// The resizer can have put an embed in its own wrapper already
|
|
45969
|
+
const placed = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(outer.parentElement) && (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(outer.parentElement, 'data-jodit-temp') ? outer.parentElement : outer;
|
|
45970
|
+
// Where the old one was, since media Jodit counts as blocks can be put
|
|
45971
|
+
// after the paragraph
|
|
45972
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before(replaced, placed);
|
|
45973
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(replaced);
|
|
45974
|
+
j.s.setCursorAfter(placed);
|
|
45975
|
+
});
|
|
45976
|
+
j.synchronizeValues();
|
|
45977
|
+
j.e.fire('closeAllPopups');
|
|
45978
|
+
}
|
|
45979
|
+
|
|
45980
|
+
|
|
45981
|
+
/***/ }),
|
|
45982
|
+
|
|
45983
|
+
/***/ 83533:
|
|
45984
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
45985
|
+
|
|
45986
|
+
"use strict";
|
|
45987
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
45988
|
+
/* harmony export */ UIVideoPropertiesForm: function() { return /* binding */ UIVideoPropertiesForm; }
|
|
45989
|
+
/* harmony export */ });
|
|
45990
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
|
|
45991
|
+
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
|
|
45992
|
+
/* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(91672);
|
|
45993
|
+
/* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29200);
|
|
45994
|
+
/* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(68616);
|
|
45995
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(23211);
|
|
45996
|
+
/* harmony import */ var jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(70222);
|
|
45997
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7909);
|
|
45998
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
|
|
45999
|
+
/* harmony import */ var jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(96007);
|
|
46000
|
+
/* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(29434);
|
|
46001
|
+
/*!
|
|
46002
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
46003
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
46004
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
46005
|
+
*/ /**
|
|
46006
|
+
* @module plugins/video-properties
|
|
46007
|
+
*/
|
|
46008
|
+
|
|
46009
|
+
|
|
46010
|
+
|
|
46011
|
+
|
|
46012
|
+
|
|
46013
|
+
|
|
46014
|
+
|
|
46015
|
+
|
|
46016
|
+
|
|
46017
|
+
|
|
46018
|
+
|
|
46019
|
+
const flags = {
|
|
46020
|
+
autoplay: 'Autoplay',
|
|
46021
|
+
loop: 'Loop',
|
|
46022
|
+
muted: 'Muted',
|
|
46023
|
+
controls: 'Controls'
|
|
46024
|
+
};
|
|
46025
|
+
const checkbox = ([flag, label])=>`<label class="jodit_vertical_middle">
|
|
46026
|
+
<input type="checkbox" class="jodit-checkbox &__${flag}"/>
|
|
46027
|
+
<span>~${label}~</span>
|
|
46028
|
+
</label>`;
|
|
46029
|
+
class UIVideoPropertiesForm extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_9__.UIElement {
|
|
46030
|
+
className() {
|
|
46031
|
+
return 'UIVideoPropertiesForm';
|
|
46032
|
+
}
|
|
46033
|
+
render() {
|
|
46034
|
+
return `<form>
|
|
46035
|
+
<div class="jodit-form__group &__previewBox">
|
|
46036
|
+
<img class="&__preview" alt=""/>
|
|
46037
|
+
</div>
|
|
46038
|
+
<div class="jodit-form__group &__sizes">
|
|
46039
|
+
<input type="text" class="jodit-input &__width" placeholder="~Width~" aria-label="~Width~"/>
|
|
46040
|
+
<a class="&__lockSize">*lock*</a>
|
|
46041
|
+
<input type="text" class="jodit-input &__height" placeholder="~Height~" aria-label="~Height~"/>
|
|
46042
|
+
</div>
|
|
46043
|
+
<div class="jodit-form__group &__editPoster">
|
|
46044
|
+
<label>~Poster~</label>
|
|
46045
|
+
<div class="jodit-input_group">
|
|
46046
|
+
<input type="text" class="jodit-input &__poster" placeholder="https://"/>
|
|
46047
|
+
<div class="jodit-input_group-buttons">
|
|
46048
|
+
<a class="jodit-button &__changePoster" title="~Upload~">*image*</a>
|
|
46049
|
+
<a class="jodit-button &__removePoster" title="~Remove~">*bin*</a>
|
|
46050
|
+
</div>
|
|
46051
|
+
</div>
|
|
46052
|
+
</div>
|
|
46053
|
+
<div class="jodit-form__group &__playback">
|
|
46054
|
+
${Object.entries(flags).map(checkbox).join('')}
|
|
46055
|
+
</div>
|
|
46056
|
+
</form>`;
|
|
46057
|
+
}
|
|
46058
|
+
input(name) {
|
|
46059
|
+
return this.getElm(name);
|
|
46060
|
+
}
|
|
46061
|
+
show(name, shown) {
|
|
46062
|
+
;(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.getElm(name), 'display', shown ? null : 'none');
|
|
46063
|
+
}
|
|
46064
|
+
/**
|
|
46065
|
+
* A video has every field, an embed only its size, and audio only its
|
|
46066
|
+
* playback settings
|
|
46067
|
+
*/ onStateMediaChange() {
|
|
46068
|
+
const { media } = this.state;
|
|
46069
|
+
this.show('editPoster', jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isTag(media, 'video'));
|
|
46070
|
+
this.show('sizes', !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isTag(media, 'audio'));
|
|
46071
|
+
this.show('playback', !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isTag(media, 'iframe'));
|
|
46072
|
+
this.showPreview();
|
|
46073
|
+
}
|
|
46074
|
+
// A video's poster, when it has one
|
|
46075
|
+
showPreview() {
|
|
46076
|
+
const { media, values } = this.state;
|
|
46077
|
+
const shown = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isTag(media, 'video') && Boolean(values.poster);
|
|
46078
|
+
this.show('previewBox', shown);
|
|
46079
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(this.getElm('preview'), 'src', shown ? values.poster : null);
|
|
46080
|
+
}
|
|
46081
|
+
hideChangePoster() {
|
|
46082
|
+
const { uploader, filebrowser } = this.j.o;
|
|
46083
|
+
// What FileSelectorWidget offers
|
|
46084
|
+
const canUpload = uploader.showTabInFileSelector !== false && Boolean(uploader.url || uploader.insertImageAsBase64URI || uploader.customUploadFunction);
|
|
46085
|
+
const canBrowse = Boolean(filebrowser.ajax.url || filebrowser.items.url);
|
|
46086
|
+
this.show('changePoster', canUpload || canBrowse);
|
|
46087
|
+
}
|
|
46088
|
+
onStatePosterChange() {
|
|
46089
|
+
const { poster } = this.state.values;
|
|
46090
|
+
this.input('poster').value = poster;
|
|
46091
|
+
this.show('removePoster', Boolean(poster));
|
|
46092
|
+
this.showPreview();
|
|
46093
|
+
}
|
|
46094
|
+
onPosterChange() {
|
|
46095
|
+
this.state.values.poster = this.input('poster').value;
|
|
46096
|
+
}
|
|
46097
|
+
onChangePosterClick(e) {
|
|
46098
|
+
this.handlers.openPosterPopup(this.getElm('changePoster'));
|
|
46099
|
+
e.stopPropagation();
|
|
46100
|
+
}
|
|
46101
|
+
onRemovePosterClick() {
|
|
46102
|
+
this.state.values.poster = '';
|
|
46103
|
+
}
|
|
46104
|
+
onStateSizeIsLockedChange() {
|
|
46105
|
+
this.getElm('lockSize').innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__.Icon.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
|
|
46106
|
+
}
|
|
46107
|
+
onLockSizeClick() {
|
|
46108
|
+
const { state } = this;
|
|
46109
|
+
const { values } = state;
|
|
46110
|
+
state.sizeIsLocked = !state.sizeIsLocked;
|
|
46111
|
+
if (state.sizeIsLocked && (0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_6__.isNumeric)(values.width)) {
|
|
46112
|
+
values.height = Math.round(parseFloat(values.width.toString()) / state.ratio);
|
|
46113
|
+
}
|
|
46114
|
+
}
|
|
46115
|
+
onStateSizeChange() {
|
|
46116
|
+
const { values } = this.state;
|
|
46117
|
+
// Not the field being typed in
|
|
46118
|
+
[
|
|
46119
|
+
'width',
|
|
46120
|
+
'height'
|
|
46121
|
+
].forEach((key)=>{
|
|
46122
|
+
const input = this.input(key);
|
|
46123
|
+
if (input !== this.j.od.activeElement) {
|
|
46124
|
+
input.value = values[key].toString();
|
|
46125
|
+
}
|
|
46126
|
+
});
|
|
46127
|
+
}
|
|
46128
|
+
onSizeInput(e) {
|
|
46129
|
+
const { state } = this;
|
|
46130
|
+
const { values } = state;
|
|
46131
|
+
// Both read first, since setting one rewrites the other's field
|
|
46132
|
+
const width = this.input('width').value;
|
|
46133
|
+
const height = this.input('height').value;
|
|
46134
|
+
if (!state.sizeIsLocked || !(0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_6__.isNumeric)(width) || !(0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_6__.isNumeric)(height)) {
|
|
46135
|
+
values.width = width;
|
|
46136
|
+
values.height = height;
|
|
46137
|
+
return;
|
|
46138
|
+
}
|
|
46139
|
+
const w = parseFloat(width);
|
|
46140
|
+
const h = parseFloat(height);
|
|
46141
|
+
if (e.target === this.input('width')) {
|
|
46142
|
+
values.width = w;
|
|
46143
|
+
values.height = Math.round(w / state.ratio);
|
|
46144
|
+
} else {
|
|
46145
|
+
values.width = Math.round(h * state.ratio);
|
|
46146
|
+
values.height = h;
|
|
46147
|
+
}
|
|
46148
|
+
}
|
|
46149
|
+
/**
|
|
46150
|
+
* Autoplay mutes it, and it keeps its controls unless it autoplays
|
|
46151
|
+
*/ onStateFlagsChange() {
|
|
46152
|
+
const { values } = this.state;
|
|
46153
|
+
this.input('autoplay').checked = values.autoplay;
|
|
46154
|
+
this.input('loop').checked = values.loop;
|
|
46155
|
+
this.input('muted').checked = values.muted || values.autoplay;
|
|
46156
|
+
this.input('muted').disabled = values.autoplay;
|
|
46157
|
+
this.input('controls').checked = values.controls || !values.autoplay;
|
|
46158
|
+
this.input('controls').disabled = !values.autoplay;
|
|
46159
|
+
}
|
|
46160
|
+
onFlagChange(e) {
|
|
46161
|
+
Object.keys(flags).forEach((flag)=>{
|
|
46162
|
+
const input = this.input(flag);
|
|
46163
|
+
if (e.target === input) {
|
|
46164
|
+
this.state.values[flag] = input.checked;
|
|
46165
|
+
}
|
|
46166
|
+
});
|
|
46167
|
+
}
|
|
46168
|
+
constructor(jodit, state, handlers){
|
|
46169
|
+
super(jodit), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "state", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "handlers", void 0), this.state = state, this.handlers = handlers;
|
|
46170
|
+
}
|
|
46171
|
+
}
|
|
46172
|
+
;(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
46173
|
+
(0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_3__.hook)('ready'),
|
|
46174
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)('state.media')
|
|
46175
|
+
], UIVideoPropertiesForm.prototype, "onStateMediaChange", null);
|
|
46176
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
46177
|
+
(0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_3__.hook)('ready')
|
|
46178
|
+
], UIVideoPropertiesForm.prototype, "hideChangePoster", null);
|
|
46179
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
46180
|
+
(0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_3__.hook)('ready'),
|
|
46181
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)('state.values.poster')
|
|
46182
|
+
], UIVideoPropertiesForm.prototype, "onStatePosterChange", null);
|
|
46183
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
46184
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)('poster:change')
|
|
46185
|
+
], UIVideoPropertiesForm.prototype, "onPosterChange", null);
|
|
46186
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
46187
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)('changePoster:click')
|
|
46188
|
+
], UIVideoPropertiesForm.prototype, "onChangePosterClick", null);
|
|
46189
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
46190
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)('removePoster:click')
|
|
46191
|
+
], UIVideoPropertiesForm.prototype, "onRemovePosterClick", null);
|
|
46192
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
46193
|
+
(0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_3__.hook)('ready'),
|
|
46194
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)('state.sizeIsLocked')
|
|
46195
|
+
], UIVideoPropertiesForm.prototype, "onStateSizeIsLockedChange", null);
|
|
46196
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
46197
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)('lockSize:click')
|
|
46198
|
+
], UIVideoPropertiesForm.prototype, "onLockSizeClick", null);
|
|
46199
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
46200
|
+
(0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_3__.hook)('ready'),
|
|
46201
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)([
|
|
46202
|
+
'state.values.width',
|
|
46203
|
+
'state.values.height'
|
|
46204
|
+
])
|
|
46205
|
+
], UIVideoPropertiesForm.prototype, "onStateSizeChange", null);
|
|
46206
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
46207
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)([
|
|
46208
|
+
'width:input',
|
|
46209
|
+
'height:input',
|
|
46210
|
+
'width:change',
|
|
46211
|
+
'height:change'
|
|
46212
|
+
])
|
|
46213
|
+
], UIVideoPropertiesForm.prototype, "onSizeInput", null);
|
|
46214
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
46215
|
+
(0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_3__.hook)('ready'),
|
|
46216
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)(Object.keys(flags).map((flag)=>`state.values.${flag}`))
|
|
46217
|
+
], UIVideoPropertiesForm.prototype, "onStateFlagsChange", null);
|
|
46218
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
46219
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)(Object.keys(flags).map((flag)=>`${flag}:change`))
|
|
46220
|
+
], UIVideoPropertiesForm.prototype, "onFlagChange", null);
|
|
46221
|
+
UIVideoPropertiesForm = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
46222
|
+
jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_2__.component
|
|
46223
|
+
], UIVideoPropertiesForm);
|
|
46224
|
+
|
|
46225
|
+
|
|
46226
|
+
/***/ }),
|
|
46227
|
+
|
|
46228
|
+
/***/ 40878:
|
|
44897
46229
|
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
44898
46230
|
|
|
44899
46231
|
"use strict";
|
|
46232
|
+
/* unused harmony export videoProperties */
|
|
46233
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
|
|
46234
|
+
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
|
|
46235
|
+
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(84839);
|
|
46236
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23211);
|
|
46237
|
+
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28077);
|
|
46238
|
+
/* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(17312);
|
|
46239
|
+
/* harmony import */ var jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(23599);
|
|
46240
|
+
/* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(71125);
|
|
46241
|
+
/* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(18855);
|
|
46242
|
+
/* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(59400);
|
|
46243
|
+
/* harmony import */ var jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(51116);
|
|
46244
|
+
/* harmony import */ var jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(18762);
|
|
46245
|
+
/* harmony import */ var _ui_ui_video_form__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(83533);
|
|
46246
|
+
/* harmony import */ var _readers__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(39057);
|
|
46247
|
+
/* harmony import */ var _replace__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(25001);
|
|
46248
|
+
/* harmony import */ var _writers__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(94893);
|
|
46249
|
+
/* harmony import */ var jodit_plugins_video_config__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(48899);
|
|
46250
|
+
/*!
|
|
46251
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
46252
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
46253
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
46254
|
+
*/ /**
|
|
46255
|
+
* [[include:plugins/video-properties/README.md]]
|
|
46256
|
+
* @packageDocumentation
|
|
46257
|
+
* @module plugins/video-properties
|
|
46258
|
+
*/
|
|
46259
|
+
|
|
46260
|
+
|
|
46261
|
+
|
|
46262
|
+
|
|
46263
|
+
|
|
46264
|
+
|
|
46265
|
+
|
|
46266
|
+
|
|
46267
|
+
|
|
46268
|
+
|
|
46269
|
+
|
|
46270
|
+
|
|
46271
|
+
|
|
46272
|
+
|
|
46273
|
+
|
|
46274
|
+
|
|
46275
|
+
/**
|
|
46276
|
+
* Show a dialog with the size, poster and playback settings of a video, an
|
|
46277
|
+
* embed or audio. The media popup's Edit button opens it:
|
|
46278
|
+
*
|
|
46279
|
+
* ```javascript
|
|
46280
|
+
* editor.events.fire('openVideoProperties', video);
|
|
46281
|
+
* ```
|
|
46282
|
+
*/ class videoProperties extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_8__.Plugin {
|
|
46283
|
+
get __size() {
|
|
46284
|
+
const { width, height } = this.state.values;
|
|
46285
|
+
return `${width}x${height}`;
|
|
46286
|
+
}
|
|
46287
|
+
get form() {
|
|
46288
|
+
return new _ui_ui_video_form__WEBPACK_IMPORTED_MODULE_12__.UIVideoPropertiesForm(this.j, this.state, {
|
|
46289
|
+
openPosterPopup: (target)=>this.__openPosterPopup(target)
|
|
46290
|
+
});
|
|
46291
|
+
}
|
|
46292
|
+
get dialog() {
|
|
46293
|
+
const { j } = this;
|
|
46294
|
+
const dialog = j.dlg({
|
|
46295
|
+
minWidth: Math.min(400, screen.width),
|
|
46296
|
+
buttons: [
|
|
46297
|
+
'dialog.close'
|
|
46298
|
+
]
|
|
46299
|
+
});
|
|
46300
|
+
const buttons = this.__buttons;
|
|
46301
|
+
buttons.check.onAction(()=>{
|
|
46302
|
+
(0,_writers__WEBPACK_IMPORTED_MODULE_15__.applyValues)(j, this.state, this.__size !== this.__readSize);
|
|
46303
|
+
j.synchronizeValues();
|
|
46304
|
+
dialog.close();
|
|
46305
|
+
});
|
|
46306
|
+
buttons.remove.onAction(()=>{
|
|
46307
|
+
j.s.removeNode(this.state.target);
|
|
46308
|
+
dialog.close();
|
|
46309
|
+
});
|
|
46310
|
+
buttons.cancel.onAction(()=>{
|
|
46311
|
+
dialog.close();
|
|
46312
|
+
});
|
|
46313
|
+
dialog.setContent(this.form);
|
|
46314
|
+
dialog.setFooter([
|
|
46315
|
+
[
|
|
46316
|
+
buttons.cancel,
|
|
46317
|
+
buttons.remove
|
|
46318
|
+
],
|
|
46319
|
+
buttons.check
|
|
46320
|
+
]);
|
|
46321
|
+
(0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_7__.markOwner)(j, dialog.container);
|
|
46322
|
+
return dialog;
|
|
46323
|
+
}
|
|
46324
|
+
get __buttons() {
|
|
46325
|
+
const { j } = this;
|
|
46326
|
+
return {
|
|
46327
|
+
check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_9__.Button)(j, 'ok', 'Apply', 'primary'),
|
|
46328
|
+
remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_9__.Button)(j, 'bin', 'Delete'),
|
|
46329
|
+
cancel: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_9__.Button)(j, 'cancel', 'Cancel')
|
|
46330
|
+
};
|
|
46331
|
+
}
|
|
46332
|
+
/**
|
|
46333
|
+
* Open the dialog for the media `target` is, or is the wrapper of
|
|
46334
|
+
*/ open(target) {
|
|
46335
|
+
const media = (0,_readers__WEBPACK_IMPORTED_MODULE_13__.editedMedia)(target);
|
|
46336
|
+
if (!media) {
|
|
46337
|
+
return;
|
|
46338
|
+
}
|
|
46339
|
+
this.state.target = target;
|
|
46340
|
+
this.state.media = media;
|
|
46341
|
+
(0,_readers__WEBPACK_IMPORTED_MODULE_13__.readValues)(this.state);
|
|
46342
|
+
this.__readSize = this.__size;
|
|
46343
|
+
this.dialog.setHeader(this.j.i18n(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(media, 'audio') ? 'Audio properties' : 'Video properties'));
|
|
46344
|
+
this.dialog.open().setModal(true).setPosition();
|
|
46345
|
+
}
|
|
46346
|
+
/**
|
|
46347
|
+
* The video popup's tabs for the media popup's Replace: what they insert
|
|
46348
|
+
* takes the place of the media `target` is, or is the wrapper of
|
|
46349
|
+
*/ onGenerateReplaceVideoTabs(target, close) {
|
|
46350
|
+
return (0,jodit_plugins_video_config__WEBPACK_IMPORTED_MODULE_16__.videoTabs)(this.j, close, (insert)=>(0,_replace__WEBPACK_IMPORTED_MODULE_14__.replaceMedia)(this.j, target, insert));
|
|
46351
|
+
}
|
|
46352
|
+
__openPosterPopup(button) {
|
|
46353
|
+
const { j, state } = this;
|
|
46354
|
+
const popup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_10__.Popup(this.dialog);
|
|
46355
|
+
const close = ()=>{
|
|
46356
|
+
popup.close();
|
|
46357
|
+
popup.destruct();
|
|
46358
|
+
};
|
|
46359
|
+
popup.setContent((0,jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_11__.FileSelectorWidget)(j, {
|
|
46360
|
+
upload: (data)=>{
|
|
46361
|
+
if (data.files && data.files.length) {
|
|
46362
|
+
state.values.poster = data.baseurl + data.files[0];
|
|
46363
|
+
}
|
|
46364
|
+
close();
|
|
46365
|
+
},
|
|
46366
|
+
filebrowser: (data)=>{
|
|
46367
|
+
if ((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_5__.isArray)(data.files) && data.files.length) {
|
|
46368
|
+
state.values.poster = data.files[0];
|
|
46369
|
+
close();
|
|
46370
|
+
}
|
|
46371
|
+
}
|
|
46372
|
+
}, null, close)).open(()=>(0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_6__.position)(button));
|
|
46373
|
+
}
|
|
46374
|
+
/** @override */ afterInit() {}
|
|
46375
|
+
/** @override */ beforeDestruct() {
|
|
46376
|
+
Object.values((0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cached)(this, '__buttons') ?? {}).forEach((b)=>b.destruct());
|
|
46377
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cached)(this, 'dialog')?.destruct();
|
|
46378
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cached)(this, 'form')?.destruct();
|
|
46379
|
+
}
|
|
46380
|
+
constructor(...args){
|
|
46381
|
+
super(...args), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "state", {
|
|
46382
|
+
target: this.j.c.element('video'),
|
|
46383
|
+
media: this.j.c.element('video'),
|
|
46384
|
+
ratio: 1,
|
|
46385
|
+
sizeIsLocked: true,
|
|
46386
|
+
values: {
|
|
46387
|
+
width: '',
|
|
46388
|
+
height: '',
|
|
46389
|
+
poster: '',
|
|
46390
|
+
autoplay: false,
|
|
46391
|
+
loop: false,
|
|
46392
|
+
muted: false,
|
|
46393
|
+
controls: true
|
|
46394
|
+
}
|
|
46395
|
+
}), // The size as it was read, so an unchanged one isn't written
|
|
46396
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__readSize", '');
|
|
46397
|
+
}
|
|
46398
|
+
}
|
|
46399
|
+
;(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
46400
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cache
|
|
46401
|
+
], videoProperties.prototype, "form", null);
|
|
46402
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
46403
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cache
|
|
46404
|
+
], videoProperties.prototype, "dialog", null);
|
|
46405
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
46406
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cache
|
|
46407
|
+
], videoProperties.prototype, "__buttons", null);
|
|
46408
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
46409
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':openVideoProperties')
|
|
46410
|
+
], videoProperties.prototype, "open", null);
|
|
46411
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
46412
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':generateReplaceVideoTabs')
|
|
46413
|
+
], videoProperties.prototype, "onGenerateReplaceVideoTabs", null);
|
|
46414
|
+
jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.pluginSystem.add('videoProperties', videoProperties);
|
|
46415
|
+
|
|
46416
|
+
|
|
46417
|
+
/***/ }),
|
|
46418
|
+
|
|
46419
|
+
/***/ 94893:
|
|
46420
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
46421
|
+
|
|
46422
|
+
"use strict";
|
|
46423
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
46424
|
+
/* harmony export */ applyValues: function() { return /* binding */ applyValues; }
|
|
46425
|
+
/* harmony export */ });
|
|
46426
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
46427
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7909);
|
|
46428
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80991);
|
|
46429
|
+
/* harmony import */ var _readers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(39057);
|
|
46430
|
+
/* harmony import */ var jodit_plugins_image_properties_utils_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(10808);
|
|
46431
|
+
/*!
|
|
46432
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
46433
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
46434
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
46435
|
+
*/ /**
|
|
46436
|
+
* @module plugins/video-properties
|
|
46437
|
+
*/
|
|
46438
|
+
|
|
46439
|
+
|
|
46440
|
+
|
|
46441
|
+
|
|
46442
|
+
const cssSize = (value)=>value === '' ? null : (0,jodit_plugins_image_properties_utils_utils__WEBPACK_IMPORTED_MODULE_4__.normalSizeToString)(value);
|
|
46443
|
+
// Sizes go on as the resizer writes them: an embed takes them as attributes,
|
|
46444
|
+
// and a video as CSS, without a height while its ratio is kept, if it had none
|
|
46445
|
+
function applySize(j, state) {
|
|
46446
|
+
const { media, values } = state;
|
|
46447
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(media, 'iframe')) {
|
|
46448
|
+
[
|
|
46449
|
+
'width',
|
|
46450
|
+
'height'
|
|
46451
|
+
].forEach((key)=>{
|
|
46452
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(media, key, values[key] === '' ? null : values[key]);
|
|
46453
|
+
if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.cssInline)(media, key)) {
|
|
46454
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(media, key, cssSize(values[key]));
|
|
46455
|
+
}
|
|
46456
|
+
});
|
|
46457
|
+
// The resizer's frame for an embed
|
|
46458
|
+
const wrapper = media.parentElement;
|
|
46459
|
+
if (wrapper && (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(wrapper, 'data-jodit_iframe_wrapper')) {
|
|
46460
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(wrapper, {
|
|
46461
|
+
width: media.offsetWidth,
|
|
46462
|
+
height: media.offsetHeight
|
|
46463
|
+
});
|
|
46464
|
+
}
|
|
46465
|
+
return;
|
|
46466
|
+
}
|
|
46467
|
+
const heightFollowsWidth = state.sizeIsLocked && !(0,_readers__WEBPACK_IMPORTED_MODULE_3__.ownSize)(media, 'height');
|
|
46468
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(media, {
|
|
46469
|
+
width: cssSize(values.width),
|
|
46470
|
+
height: heightFollowsWidth ? null : cssSize(values.height)
|
|
46471
|
+
});
|
|
46472
|
+
if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(media, 'style')?.trim()) {
|
|
46473
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(media, 'style', null);
|
|
46474
|
+
}
|
|
46475
|
+
j.e.fire(media, 'changesize');
|
|
46476
|
+
}
|
|
46477
|
+
function setFlag(media, name, on) {
|
|
46478
|
+
if (media.hasAttribute(name) !== on) {
|
|
46479
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(media, name, on ? '' : null);
|
|
46480
|
+
}
|
|
46481
|
+
}
|
|
46482
|
+
/**
|
|
46483
|
+
* Apply the dialog's values to the media
|
|
46484
|
+
* @private
|
|
46485
|
+
*/ function applyValues(j, state, sizeChanged) {
|
|
46486
|
+
const { media, values } = state;
|
|
46487
|
+
if (sizeChanged && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(media, 'audio')) {
|
|
46488
|
+
applySize(j, state);
|
|
46489
|
+
}
|
|
46490
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(media, 'iframe')) {
|
|
46491
|
+
return;
|
|
46492
|
+
}
|
|
46493
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(media, 'video')) {
|
|
46494
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(media, 'poster', values.poster || null);
|
|
46495
|
+
}
|
|
46496
|
+
// Browsers only autoplay muted media, and playsinline keeps an iPhone from
|
|
46497
|
+
// playing it full screen
|
|
46498
|
+
setFlag(media, 'autoplay', values.autoplay);
|
|
46499
|
+
setFlag(media, 'muted', values.autoplay || values.muted);
|
|
46500
|
+
setFlag(media, 'loop', values.loop);
|
|
46501
|
+
setFlag(media, 'controls', values.controls || !values.autoplay);
|
|
46502
|
+
if (values.autoplay && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(media, 'video')) {
|
|
46503
|
+
setFlag(media, 'playsinline', true);
|
|
46504
|
+
}
|
|
46505
|
+
}
|
|
46506
|
+
|
|
46507
|
+
|
|
46508
|
+
/***/ }),
|
|
46509
|
+
|
|
46510
|
+
/***/ 48899:
|
|
46511
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
46512
|
+
|
|
46513
|
+
"use strict";
|
|
46514
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
46515
|
+
/* harmony export */ videoTabs: function() { return /* binding */ videoTabs; }
|
|
46516
|
+
/* harmony export */ });
|
|
44900
46517
|
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(65946);
|
|
44901
46518
|
/* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59400);
|
|
44902
46519
|
/* harmony import */ var jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5658);
|
|
@@ -44933,75 +46550,84 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.video = {
|
|
|
44933
46550
|
defaultHandlerSuccess: insertVideos
|
|
44934
46551
|
};
|
|
44935
46552
|
jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__.Icon.set('video', (_video_svg__WEBPACK_IMPORTED_MODULE_6___default()));
|
|
44936
|
-
|
|
44937
|
-
|
|
44938
|
-
|
|
44939
|
-
|
|
44940
|
-
|
|
44941
|
-
|
|
44942
|
-
|
|
44943
|
-
|
|
44944
|
-
|
|
44945
|
-
|
|
44946
|
-
|
|
44947
|
-
|
|
44948
|
-
|
|
44949
|
-
|
|
44950
|
-
|
|
44951
|
-
|
|
44952
|
-
|
|
44953
|
-
|
|
44954
|
-
|
|
44955
|
-
|
|
44956
|
-
|
|
44957
|
-
|
|
44958
|
-
|
|
44959
|
-
|
|
44960
|
-
|
|
44961
|
-
|
|
44962
|
-
|
|
44963
|
-
|
|
44964
|
-
|
|
44965
|
-
|
|
44966
|
-
|
|
44967
|
-
|
|
44968
|
-
|
|
46553
|
+
/**
|
|
46554
|
+
* The video popup's tabs: Upload, when the uploader is configured, then Link
|
|
46555
|
+
* and Code. `insert` runs what a tab inserts, which by default goes in at the
|
|
46556
|
+
* selection the popup was opened with.
|
|
46557
|
+
*/ function videoTabs(jodit, close, insert) {
|
|
46558
|
+
const run = insert ?? ((fn)=>{
|
|
46559
|
+
jodit.s.restore();
|
|
46560
|
+
fn();
|
|
46561
|
+
});
|
|
46562
|
+
const formLink = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UIForm(jodit, [
|
|
46563
|
+
new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UIBlock(jodit, [
|
|
46564
|
+
new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UIInput(jodit, {
|
|
46565
|
+
name: 'url',
|
|
46566
|
+
required: true,
|
|
46567
|
+
label: 'URL',
|
|
46568
|
+
placeholder: 'https://',
|
|
46569
|
+
validators: [
|
|
46570
|
+
'url'
|
|
46571
|
+
]
|
|
46572
|
+
})
|
|
46573
|
+
]),
|
|
46574
|
+
new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UIBlock(jodit, [
|
|
46575
|
+
(0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__.Button)(jodit, '', 'Insert', 'primary').onAction(()=>formLink.submit())
|
|
46576
|
+
])
|
|
46577
|
+
]), formCode = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UIForm(jodit, [
|
|
46578
|
+
new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UIBlock(jodit, [
|
|
46579
|
+
new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UITextArea(jodit, {
|
|
46580
|
+
name: 'code',
|
|
46581
|
+
required: true,
|
|
46582
|
+
label: 'Embed code'
|
|
46583
|
+
})
|
|
46584
|
+
]),
|
|
46585
|
+
new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UIBlock(jodit, [
|
|
46586
|
+
(0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__.Button)(jodit, '', 'Insert', 'primary').onAction(()=>formCode.submit())
|
|
46587
|
+
])
|
|
46588
|
+
]), tabs = [], insertCode = (code)=>{
|
|
46589
|
+
run(()=>jodit.s.insertHTML((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.prepareEmbedCode)(jodit, code)));
|
|
46590
|
+
close();
|
|
46591
|
+
};
|
|
46592
|
+
if (!insert) {
|
|
44969
46593
|
jodit.s.save();
|
|
44970
|
-
|
|
44971
|
-
|
|
44972
|
-
|
|
44973
|
-
|
|
44974
|
-
|
|
44975
|
-
|
|
44976
|
-
}, {
|
|
44977
|
-
label: 'Drop file',
|
|
44978
|
-
accept: 'video/*'
|
|
44979
|
-
}));
|
|
44980
|
-
}
|
|
44981
|
-
tabs.push({
|
|
44982
|
-
icon: 'link',
|
|
44983
|
-
name: 'Link',
|
|
44984
|
-
content: formLink.container
|
|
46594
|
+
}
|
|
46595
|
+
const { uploader } = jodit.o;
|
|
46596
|
+
// Base64 alone would put whole video files into the content
|
|
46597
|
+
if (uploader.showTabInFileSelector !== false && (uploader.url || uploader.customUploadFunction)) {
|
|
46598
|
+
tabs.push((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_5__.UploadTab)(jodit, (data)=>{
|
|
46599
|
+
run(()=>(jodit.o.video?.defaultHandlerSuccess ?? insertVideos).call(jodit, data));
|
|
44985
46600
|
}, {
|
|
44986
|
-
|
|
44987
|
-
|
|
44988
|
-
|
|
44989
|
-
|
|
44990
|
-
|
|
44991
|
-
|
|
44992
|
-
|
|
44993
|
-
|
|
44994
|
-
|
|
44995
|
-
|
|
44996
|
-
|
|
44997
|
-
|
|
44998
|
-
|
|
44999
|
-
|
|
45000
|
-
|
|
45001
|
-
|
|
45002
|
-
|
|
45003
|
-
|
|
45004
|
-
}
|
|
46601
|
+
label: 'Drop file',
|
|
46602
|
+
accept: 'video/*'
|
|
46603
|
+
}));
|
|
46604
|
+
}
|
|
46605
|
+
tabs.push({
|
|
46606
|
+
icon: 'link',
|
|
46607
|
+
name: 'Link',
|
|
46608
|
+
content: formLink.container
|
|
46609
|
+
}, {
|
|
46610
|
+
icon: 'source',
|
|
46611
|
+
name: 'Code',
|
|
46612
|
+
content: formCode.container
|
|
46613
|
+
});
|
|
46614
|
+
formLink.onSubmit((data)=>{
|
|
46615
|
+
insertCode((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.call)(jodit.o.video?.parseUrlToVideoEmbed ?? jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed, data.url, {
|
|
46616
|
+
width: jodit.o.video?.defaultWidth,
|
|
46617
|
+
height: jodit.o.video?.defaultHeight
|
|
46618
|
+
}));
|
|
46619
|
+
});
|
|
46620
|
+
formCode.onSubmit((data)=>{
|
|
46621
|
+
insertCode(data.code);
|
|
46622
|
+
});
|
|
46623
|
+
const box = (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_5__.TabsWidget)(jodit, tabs);
|
|
46624
|
+
// Its tabs are sized to their labels, as the file selector's are, since
|
|
46625
|
+
// "Upload" doesn't fit a third of the popup
|
|
46626
|
+
box.classList.add('jodit-file-selector');
|
|
46627
|
+
return box;
|
|
46628
|
+
}
|
|
46629
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.video = {
|
|
46630
|
+
popup: (jodit, current, close)=>videoTabs(jodit, close),
|
|
45005
46631
|
tags: [
|
|
45006
46632
|
'iframe'
|
|
45007
46633
|
],
|
|
@@ -45517,7 +47143,7 @@ module.exports["default"] = {"Type something":"Start writing...","pencil":"Edit"
|
|
|
45517
47143
|
/***/ 53414:
|
|
45518
47144
|
/***/ (function(module) {
|
|
45519
47145
|
|
|
45520
|
-
module.exports["default"] = [" URL","--Not Set--","About Jodit","Add column","Add folder","Add row","Advanced","Align","Align Center","Align Justify","Align Left","Align Right","All","Alternative","Alternative text","Anchor","Apply","Are you sure?","Background","Bold","Border","Border radius","Bottom","Break","Browse","Buy full version","Cancel","Center","Change mode","Chars: %d","Choose Content to Paste","Circle","Class name","Classes","Clean","Clear Formatting","Code","Copy selection","Copyright © XDSoft.net - Chupurnov Valeriy. All rights reserved.","Create directory","Crop","Cut selection","Decrease Indent","Default","Delete","Delete column","Delete row","Delete table","Dot","Drop file","Drop image","Edit","Edit image","Edit link","Embed code","Empty cell","Enter Directory name","Enter new name","Error on load folders","Error on load list","Eye","File Browser","Fill color or set the text color","Filter","Find","Find Next","Find Previous","Font family","Font size","For information about the license, please go to our website:","Free Non-commercial Version","Heading 1","Heading 2","Heading 3","Heading 4","Height","Horizontal align","Image","Image properties","Increase Indent","Insert","Insert Horizontal Line","Insert Image","Insert Ordered List","Insert Special Character","Insert Unordered List","Insert as Text","Insert className","Insert column after","Insert column before","Insert file","Insert format block","Insert link","Insert only Text","Insert row above","Insert row below","Insert table","Insert youtube/vimeo video","Interim Results","Italic","Jodit Editor","Jodit User's Guide","Keep","Keep Aspect Ratio","Left","License: %s","Line height","Link","List view","Lower Alpha","Lower Greek","Lower Roman","Margins","Merge","Middle","No","No follow","Normal","Ok","Open in fullsize","Open in new tab","Open link","Open link in new tab","Paint format","Paste","Paste as HTML","Paste from clipboard","Please enter a web address","Please fill out this field","Press Alt for custom resizing","Print","Quadrate","Quote","Redo","Remove","Remove file","Rename","Replace","Replace with","Reset","Resize","Right","Save","Save as ...","Search for","Select","Select %s","Select Special Character","Select all","Select file","Show all","Sort by changed","Sort by name","Sort by size","Sound","Speech Recognize","Spellcheck","Split","Split horizontal","Split vertical","Src","Strike through","Styles","Text","The image has been successfully uploaded to the host!","The pasted content is coming from a Microsoft Word/Excel document. Do you want to keep the format or clean it up?","There are no files","Tiles view","Title","Top","Type something","Underline","Undo","Unlink","Update","Update file list","Upload","Upload file","Upper Alpha","Upper Roman","Vertical align","Width","Word Paste Detected","Words: %d","Yes","You can only edit your own images. Download this image on the host?","Your browser doesn't support direct access to the clipboard.","Your code is similar to HTML. Keep as HTML?","about","apply","bold","bottom","brush","circle","contains detailed help for using","copy","cut","default","delete","dot","download","edit","eraser","file","font","fontsize","fullsize","hr","image","indent","italic","left","link","newline","ol","or click","outdent","palette","paragraph","pencil","preview","print","redo","right","selectall","shrink","sound","source","space","spellcheck","square","strikethrough","subscript","superscript","table","top","type dir name","type name","ul","underline","undo","video"]
|
|
47146
|
+
module.exports["default"] = [" URL","--Not Set--","About Jodit","Add column","Add folder","Add row","Advanced","Align","Align Center","Align Justify","Align Left","Align Right","All","Alternative","Alternative text","Anchor","Apply","Are you sure?","Audio properties","Autoplay","Background","Bold","Border","Border radius","Bottom","Break","Browse","Buy full version","Cancel","Center","Change mode","Chars: %d","Choose Content to Paste","Circle","Class name","Classes","Clean","Clear Formatting","Code","Controls","Copy selection","Copyright © XDSoft.net - Chupurnov Valeriy. All rights reserved.","Create directory","Crop","Cut selection","Decrease Indent","Default","Delete","Delete column","Delete row","Delete table","Dot","Drop file","Drop image","Edit","Edit image","Edit link","Embed code","Empty cell","Enter Directory name","Enter new name","Error on load folders","Error on load list","Eye","File Browser","Fill color or set the text color","Filter","Find","Find Next","Find Previous","Font family","Font size","For information about the license, please go to our website:","Free Non-commercial Version","Heading 1","Heading 2","Heading 3","Heading 4","Height","Horizontal align","Image","Image properties","Increase Indent","Insert","Insert Horizontal Line","Insert Image","Insert Ordered List","Insert Special Character","Insert Unordered List","Insert as Text","Insert className","Insert column after","Insert column before","Insert file","Insert format block","Insert link","Insert only Text","Insert row above","Insert row below","Insert table","Insert youtube/vimeo video","Interim Results","Italic","Jodit Editor","Jodit User's Guide","Keep","Keep Aspect Ratio","Left","License: %s","Line height","Link","List view","Loop","Lower Alpha","Lower Greek","Lower Roman","Margins","Merge","Middle","Muted","No","No follow","Normal","Number for the first item","Ok","Open in fullsize","Open in new tab","Open link","Open link in new tab","Paint format","Paste","Paste as HTML","Paste from clipboard","Please enter a web address","Please fill out this field","Poster","Press Alt for custom resizing","Print","Quadrate","Quote","Redo","Remove","Remove file","Rename","Replace","Replace with","Reset","Resize","Right","Save","Save as ...","Search for","Select","Select %s","Select Special Character","Select all","Select file","Show all","Sort by changed","Sort by name","Sort by size","Sound","Speech Recognize","Spellcheck","Split","Split horizontal","Split vertical","Src","Start at...","Start numbering at","Strike through","Styles","Text","The image has been successfully uploaded to the host!","The pasted content is coming from a Microsoft Word/Excel document. Do you want to keep the format or clean it up?","There are no files","Tiles view","Title","Top","Type something","Underline","Undo","Unlink","Update","Update file list","Upload","Upload file","Upper Alpha","Upper Roman","Vertical align","Video properties","Width","Word Paste Detected","Words: %d","Yes","You can only edit your own images. Download this image on the host?","Your browser doesn't support direct access to the clipboard.","Your code is similar to HTML. Keep as HTML?","about","apply","bold","bottom","brush","circle","contains detailed help for using","copy","cut","default","delete","dot","download","edit","eraser","file","font","fontsize","fullsize","hr","image","indent","italic","left","link","newline","ol","or click","outdent","palette","paragraph","pencil","preview","print","redo","right","selectall","shrink","sound","source","space","spellcheck","square","strikethrough","subscript","superscript","table","top","type dir name","type name","ul","underline","undo","video"]
|
|
45521
47147
|
|
|
45522
47148
|
/***/ }),
|
|
45523
47149
|
|